import{c as P}from"./chunk-3TWYSNJO.js";import"./chunk-2H3HTOVO.js";import{A as e,B as n,m as y,w as r}from"./chunk-B4FSAK53.js";import"./chunk-FSRPMVAS.js";var E={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"var(--doc-overlay)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},T={backgroundColor:"var(--doc-surface)",borderRadius:8,boxShadow:"0 4px 20px var(--doc-shadow)",padding:24,minWidth:400,maxWidth:500},x={marginBottom:16,padding:12,border:"1px solid var(--doc-border)",borderRadius:4},i={display:"block",fontSize:12,color:"var(--doc-text-muted)",marginBottom:4},l={width:"100%",padding:"4px 8px",border:"1px solid var(--doc-border-input)",borderRadius:4,fontSize:13,marginBottom:8},C={width:60,padding:"4px 8px",border:"1px solid var(--doc-border-input)",borderRadius:4,fontSize:13,marginBottom:8},D={display:"flex",justifyContent:"flex-end",gap:8,marginTop:16},R={padding:"6px 16px",border:"1px solid var(--doc-border-input)",borderRadius:4,cursor:"pointer",fontSize:13,backgroundColor:"var(--doc-surface)"},L={...R,backgroundColor:"var(--doc-primary)",color:"var(--doc-on-primary)",border:"1px solid var(--doc-primary)"},S=[{value:"decimal",labelKey:"dialogs.footnoteProperties.formats.decimal"},{value:"lowerRoman",labelKey:"dialogs.footnoteProperties.formats.lowerRoman"},{value:"upperRoman",labelKey:"dialogs.footnoteProperties.formats.upperRoman"},{value:"lowerLetter",labelKey:"dialogs.footnoteProperties.formats.lowerAlpha"},{value:"upperLetter",labelKey:"dialogs.footnoteProperties.formats.upperAlpha"},{value:"chicago",labelKey:"dialogs.footnoteProperties.formats.symbols"}];function $({isOpen:k,onClose:a,onApply:b,footnotePr:s,endnotePr:d}){let{t}=P(),[p,w]=r(s?.position??"pageBottom"),[c,O]=r(s?.numFmt??"decimal"),[u,z]=r(s?.numStart??1),[m,K]=r(s?.numRestart??"continuous"),[g,F]=r(d?.position??"docEnd"),[h,B]=r(d?.numFmt??"lowerRoman"),[v,A]=r(d?.numStart??1),[f,I]=r(d?.numRestart??"continuous"),j=y(()=>{b({position:p,numFmt:c,numStart:u,numRestart:m},{position:g,numFmt:h,numStart:v,numRestart:f}),a()},[p,c,u,m,g,h,v,f,b,a]);return k?e("div",{style:E,onClick:a,children:n("div",{style:T,onClick:o=>o.stopPropagation(),children:[e("h3",{style:{margin:"0 0 16px",fontSize:16},children:t("dialogs.footnoteProperties.title")}),n("div",{style:x,children:[e("h4",{style:{margin:"0 0 8px",fontSize:14},children:t("dialogs.footnoteProperties.footnotes")}),e("label",{style:i,children:t("dialogs.footnoteProperties.position")}),n("select",{style:l,value:p,onChange:o=>w(o.target.value),children:[e("option",{value:"pageBottom",children:t("dialogs.footnoteProperties.footnotePositions.bottomOfPage")}),e("option",{value:"beneathText",children:t("dialogs.footnoteProperties.footnotePositions.belowText")})]}),e("label",{style:i,children:t("dialogs.footnoteProperties.numberFormat")}),e("select",{style:l,value:c,onChange:o=>O(o.target.value),children:S.map(o=>e("option",{value:o.value,children:t(o.labelKey)},o.value))}),n("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[n("div",{children:[e("label",{style:i,children:t("dialogs.footnoteProperties.startAt")}),e("input",{type:"number",min:1,style:C,value:u,onChange:o=>z(parseInt(o.target.value,10)||1)})]}),n("div",{style:{flex:1},children:[e("label",{style:i,children:t("dialogs.footnoteProperties.numbering")}),n("select",{style:l,value:m,onChange:o=>K(o.target.value),children:[e("option",{value:"continuous",children:t("dialogs.footnoteProperties.numberingOptions.continuous")}),e("option",{value:"eachSect",children:t("dialogs.footnoteProperties.numberingOptions.restartSection")}),e("option",{value:"eachPage",children:t("dialogs.footnoteProperties.numberingOptions.restartPage")})]})]})]})]}),n("div",{style:x,children:[e("h4",{style:{margin:"0 0 8px",fontSize:14},children:t("dialogs.footnoteProperties.endnotes")}),e("label",{style:i,children:t("dialogs.footnoteProperties.position")}),n("select",{style:l,value:g,onChange:o=>F(o.target.value),children:[e("option",{value:"docEnd",children:t("dialogs.footnoteProperties.endnotePositions.endOfDocument")}),e("option",{value:"sectEnd",children:t("dialogs.footnoteProperties.endnotePositions.endOfSection")})]}),e("label",{style:i,children:t("dialogs.footnoteProperties.numberFormat")}),e("select",{style:l,value:h,onChange:o=>B(o.target.value),children:S.map(o=>e("option",{value:o.value,children:t(o.labelKey)},o.value))}),n("div",{style:{display:"flex",gap:12,alignItems:"center"},children:[n("div",{children:[e("label",{style:i,children:t("dialogs.footnoteProperties.startAt")}),e("input",{type:"number",min:1,style:C,value:v,onChange:o=>A(parseInt(o.target.value,10)||1)})]}),n("div",{style:{flex:1},children:[e("label",{style:i,children:t("dialogs.footnoteProperties.numbering")}),n("select",{style:l,value:f,onChange:o=>I(o.target.value),children:[e("option",{value:"continuous",children:t("dialogs.footnoteProperties.numberingOptions.continuous")}),e("option",{value:"eachSect",children:t("dialogs.footnoteProperties.numberingOptions.restartSection")})]})]})]})]}),n("div",{style:D,children:[e("button",{style:R,onClick:a,children:t("common.cancel")}),e("button",{style:L,onClick:j,children:t("common.apply")})]})]})}):null}export{$ as FootnotePropertiesDialog};
