@docx-editor.dev/core 2.32.0 → 2.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +1 -0
  3. package/dist/automation.cjs +1 -1
  4. package/dist/automation.d.ts +14 -52
  5. package/dist/automation.js +1 -1
  6. package/dist/binding.cjs +1 -1
  7. package/dist/binding.d.ts +14 -14
  8. package/dist/binding.js +1 -1
  9. package/dist/{chrome-print-CznJ0ucN.d.ts → chrome-print-DY0xsXm_.d.ts} +231 -125
  10. package/dist/chunk-37IYWENL.cjs +1 -0
  11. package/dist/chunk-37RNWL45.js +4 -0
  12. package/dist/chunk-5HUVQXET.cjs +4 -0
  13. package/dist/chunk-5JP3QQF7.js +7 -0
  14. package/dist/chunk-5KOLFKOB.cjs +5 -0
  15. package/dist/chunk-6MF5PN2E.js +236 -0
  16. package/dist/chunk-77JT2AU7.js +2 -0
  17. package/dist/{chunk-ETDZFNMI.js → chunk-7FUORGCW.js} +1 -1
  18. package/dist/chunk-A5BTVPET.cjs +236 -0
  19. package/dist/chunk-AFXFH2T2.js +3 -0
  20. package/dist/chunk-AVCYP7OY.js +5 -0
  21. package/dist/chunk-BL2E4QRA.js +1 -0
  22. package/dist/chunk-DB7X4Y6O.js +4 -0
  23. package/dist/chunk-DR6W23TB.cjs +2 -0
  24. package/dist/chunk-DYLB5U42.js +1 -0
  25. package/dist/chunk-E5BKDHIP.cjs +1 -0
  26. package/dist/chunk-IWXBRUPG.cjs +4 -0
  27. package/dist/{chunk-L5TYBFDB.js → chunk-KCUXXO3Q.js} +1 -1
  28. package/dist/chunk-KYA4Y2YB.js +1 -0
  29. package/dist/{chunk-6UDJUI3W.cjs → chunk-L74TCGVH.cjs} +1 -1
  30. package/dist/chunk-NBSSQSKY.js +30 -0
  31. package/dist/{chunk-OKMEMSKB.cjs → chunk-NEM774E3.cjs} +1 -1
  32. package/dist/chunk-NKZVMMHU.cjs +1 -0
  33. package/dist/chunk-TXIO5WYQ.cjs +32 -0
  34. package/dist/chunk-UKG2TXWH.cjs +7 -0
  35. package/dist/chunk-V7CO55DO.cjs +3 -0
  36. package/dist/chunk-VLQDQNSS.js +1 -0
  37. package/dist/chunk-VQOAC3VI.cjs +30 -0
  38. package/dist/chunk-YWJSQA2O.js +32 -0
  39. package/dist/chunk-ZJ74LCFI.cjs +1 -0
  40. package/dist/collaboration/replication.cjs +1 -1
  41. package/dist/collaboration/replication.d.ts +13 -4
  42. package/dist/collaboration/replication.js +1 -1
  43. package/dist/collaboration.d.ts +3 -3
  44. package/dist/contracts/document.d.ts +3 -3
  45. package/dist/contracts/editor.d.ts +10 -10
  46. package/dist/contracts/interaction.d.ts +2 -2
  47. package/dist/contracts/modules.d.ts +12 -12
  48. package/dist/contracts/types.d.ts +4 -4
  49. package/dist/{custom-node-writes-CLJKGD9t.d.ts → custom-node-writes-DparEcZK.d.ts} +45 -7
  50. package/dist/diagnostic-context-CkZKkKvB.d.ts +98 -0
  51. package/dist/{diagnostic-hints-DK8-V0fk.d.ts → diagnostic-hints-BTyb8yzX.d.ts} +3 -3
  52. package/dist/{document-protection-NaniLHWF.d.ts → document-protection-DdWxihIN.d.ts} +1 -1
  53. package/dist/{headless-document-view-Bcz9_Qva.d.ts → drawing-graphic-kind-CK0cMc7H.d.ts} +161 -18
  54. package/dist/drawing-preview-package-fFjXpOMS.d.ts +115 -0
  55. package/dist/{editor-DZwOTmlR.d.ts → editor-DDCkWqfD.d.ts} +125 -21
  56. package/dist/{editor-scope-B3L-1ALc.d.ts → editor-scope-CA6egMaK.d.ts} +5 -1
  57. package/dist/editor.cjs +1 -1
  58. package/dist/editor.css +4 -4
  59. package/dist/editor.d.ts +387 -78
  60. package/dist/editor.js +1 -1
  61. package/dist/export.cjs +2 -2
  62. package/dist/export.d.ts +47 -12
  63. package/dist/export.js +2 -2
  64. package/dist/{font-resolver-BlQNGdvR.d.ts → font-resolver-Bm9XqTNO.d.ts} +14 -0
  65. package/dist/index.cjs +1 -1
  66. package/dist/index.d.ts +38 -23
  67. package/dist/index.js +1 -1
  68. package/dist/{layout-shaping-E5J4Z1Gf.d.ts → layout-shaping-Byj-TwsI.d.ts} +1 -1
  69. package/dist/layout.cjs +1 -1
  70. package/dist/layout.d.ts +434 -199
  71. package/dist/layout.js +1 -1
  72. package/dist/metafile-drawing-Ce6TuWLm.d.ts +115 -0
  73. package/dist/{note-properties-Ds5R2_3F.d.ts → note-properties-BiunaIQa.d.ts} +31 -7
  74. package/dist/output.cjs +1 -1
  75. package/dist/output.d.ts +77 -13
  76. package/dist/output.js +1 -1
  77. package/dist/{protocol-DKa4qt7F.d.ts → protocol-Dn44dL4M.d.ts} +184 -120
  78. package/dist/{review-paragraph-order-Dc17w_6v.d.ts → review-paragraph-order-BWMXAKuA.d.ts} +1 -1
  79. package/dist/{revision-projection-Cn6rZJ7H.d.ts → revision-projection-DwFhgIR0.d.ts} +1 -1
  80. package/dist/{semantic-cell-selection-BaUR0iJ4.d.ts → semantic-cell-selection-DhalxEBH.d.ts} +2 -2
  81. package/dist/{semantic-interaction-CJoHLoOl.d.ts → semantic-interaction-QeuzEtAk.d.ts} +2 -4
  82. package/dist/{semantic-paint-BPw_n0li.d.ts → semantic-paint-BYDZbTiY.d.ts} +16 -9
  83. package/dist/{semantic-record-queries-C0rJ3sB4.d.ts → semantic-record-queries-Bf5bgQL3.d.ts} +1 -1
  84. package/dist/{semantic-records-BvN-WWst.d.ts → semantic-records-CzZiWMY8.d.ts} +348 -132
  85. package/dist/store.cjs +1 -1
  86. package/dist/store.d.ts +526 -19
  87. package/dist/store.js +1 -1
  88. package/dist/{tree-op-types-C_S2niXW.d.ts → tree-op-types-DKvJSH8T.d.ts} +1024 -501
  89. package/dist/{tree-package-store-CRHvMyNj.d.ts → tree-package-store-Cl3BkWXF.d.ts} +8 -3
  90. package/dist/{tree-session-contract-D1awo_dA.d.ts → tree-session-contract-BL50pqs8.d.ts} +15 -8
  91. package/dist/{unsupported-elements-CVos5cqe.d.ts → unsupported-elements-Bra4QTOM.d.ts} +1 -1
  92. package/licenses/ECMA-376.md +29 -0
  93. package/package.json +2 -2
  94. package/dist/bookmark-names-DDuAra_V.d.ts +0 -37
  95. package/dist/chunk-25EXMBV2.cjs +0 -5
  96. package/dist/chunk-3IEXDEFH.cjs +0 -7
  97. package/dist/chunk-65XBN67F.cjs +0 -2
  98. package/dist/chunk-6NVZNB7O.cjs +0 -3
  99. package/dist/chunk-ACLR4DMK.js +0 -1
  100. package/dist/chunk-B2BEELUE.js +0 -1
  101. package/dist/chunk-DDFHKQFU.js +0 -30
  102. package/dist/chunk-E4IAO4CY.cjs +0 -2
  103. package/dist/chunk-FDSL5OJU.cjs +0 -30
  104. package/dist/chunk-FS7CMYLT.js +0 -4
  105. package/dist/chunk-GDS24SZN.js +0 -30
  106. package/dist/chunk-GIY6NT2X.js +0 -5
  107. package/dist/chunk-GWM3AKUD.js +0 -18
  108. package/dist/chunk-HDOXACHP.js +0 -2
  109. package/dist/chunk-IILEENID.js +0 -1
  110. package/dist/chunk-MNF2K7NN.cjs +0 -30
  111. package/dist/chunk-O324RB6R.cjs +0 -1
  112. package/dist/chunk-QXJKYNYZ.js +0 -1
  113. package/dist/chunk-RALTVLB6.js +0 -2
  114. package/dist/chunk-SRVKFUFI.js +0 -3
  115. package/dist/chunk-TELQ52LG.cjs +0 -1
  116. package/dist/chunk-TJHE5EET.cjs +0 -1
  117. package/dist/chunk-UMMRURPE.js +0 -7
  118. package/dist/chunk-XJYZVGQR.cjs +0 -1
  119. package/dist/chunk-ZGTIE3QJ.cjs +0 -4
  120. package/dist/chunk-ZOZI27AW.cjs +0 -18
  121. package/dist/diagnostic-context-BtDUY3v2.d.ts +0 -31
@@ -1,30 +0,0 @@
1
- 'use strict';var chunkV3N4SOAK_cjs=require('./chunk-V3N4SOAK.cjs'),chunkZGTIE3QJ_cjs=require('./chunk-ZGTIE3QJ.cjs'),chunkE4IAO4CY_cjs=require('./chunk-E4IAO4CY.cjs'),chunk6NVZNB7O_cjs=require('./chunk-6NVZNB7O.cjs'),chunk3IEXDEFH_cjs=require('./chunk-3IEXDEFH.cjs'),chunkTELQ52LG_cjs=require('./chunk-TELQ52LG.cjs'),chunkFDSL5OJU_cjs=require('./chunk-FDSL5OJU.cjs'),chunk25EXMBV2_cjs=require('./chunk-25EXMBV2.cjs'),chunkXJYZVGQR_cjs=require('./chunk-XJYZVGQR.cjs'),chunk65XBN67F_cjs=require('./chunk-65XBN67F.cjs'),chunk2CWQY27B_cjs=require('./chunk-2CWQY27B.cjs'),chunkO324RB6R_cjs=require('./chunk-O324RB6R.cjs'),chunkZOZI27AW_cjs=require('./chunk-ZOZI27AW.cjs'),chunkUKVVUHZL_cjs=require('./chunk-UKVVUHZL.cjs'),fflate=require('fflate'),i18n=require('@docx-editor.dev/i18n');function bw(e){return e===void 0?void 0:Object.freeze({maxFontBytes:chunk6NVZNB7O_cjs.k(e).maxFontBytes})}function nN(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var yw=false;function vw(e){if(yw)return;yw=true;let t=e.diagnostic?`: ${e.diagnostic}`:".";console.error(`[@docx-editor.dev/core] text shaping is disabled${t}
2
- Text is being measured with fallback metrics, so line and page breaks will not match Word.`);}function ba(e){if(e instanceof chunkUKVVUHZL_cjs.a)return e;if(e instanceof chunkFDSL5OJU_cjs.d)return new chunkUKVVUHZL_cjs.a(e.code,e.message,{request:nN(e.request),diagnostic:e.diagnostic});if(e instanceof chunk6NVZNB7O_cjs.l)return new chunkUKVVUHZL_cjs.a("overLimit",e.message,{diagnostic:e.message});if(e instanceof chunk6NVZNB7O_cjs.f){let t=e.code==="wasmUnavailable"||e.code==="shapingLibraryMismatch"?"wasmUnavailable":"initializationFailed";return new chunkUKVVUHZL_cjs.a(t,e.message,{diagnostic:e.diagnostic??e.message,cause:e})}return new chunkUKVVUHZL_cjs.a("initializationFailed",e instanceof Error?e.message:"Font initialization failed",{diagnostic:e instanceof Error?e.message:String(e),cause:e})}async function il(e,t,n){try{return await chunk6NVZNB7O_cjs.s(e,t,n)}catch(r){throw ba(r)}}var Ad=Object.freeze({opening:"auto",overflow:"float",revisionsIn:"pane",commentMarkers:"icon"}),sm={opening:["auto","manual"],overflow:["float","shrinkPage","scroll"],revisionsIn:["pane","balloons"],commentMarkers:["initials","icon"]};function Fd(e,t=Ad){if(e===void 0)return t;if(e===null||typeof e!="object")throw new TypeError("review pane settings must be an object");let n=t;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;if(!Object.hasOwn(sm,r))throw new TypeError(`unknown review pane setting ${r}`);let i=r;if(typeof o!="string"||!sm[i].includes(o))throw new TypeError(`review pane ${i} must be ${sm[i].join(" or ")}`);n[i]!==o&&(n={...n,[i]:o});}return n===t?t:Object.freeze(n)}function lm(e,t){return e==="pane"?true:t.kind==="revision"?false:!(t.kind==="comment"&&t.parentRevisionId!==void 0)}var rN=Object.freeze({revisionMarkup:chunkFDSL5OJU_cjs.Xa,reviewPane:Ad,scope:Object.freeze({kind:"body"}),isLoading:true,isOpening:false,parseError:null,openFailure:null,editable:false,zoom:1,selection:null,selectionCollapsed:true,formatting:null,table:null,tocContext:null,image:null,page:Object.freeze({current:0,total:0}),canUndo:false,canRedo:false,collaborationStatus:"inactive"});var xw="http://schemas.openxmlformats.org/wordprocessingml/2006/main",iN="http://schemas.openxmlformats.org/package/2006/content-types",Sw="http://schemas.openxmlformats.org/package/2006/relationships",aN="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",sN="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",lN=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="${iN}"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/></Types>`,cN=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${Sw}"><Relationship Id="rId1" Type="${aN}" Target="word/document.xml"/></Relationships>`,dN=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${Sw}"><Relationship Id="rId1" Type="${sN}" Target="styles.xml"/></Relationships>`,uN=[{level:1,before:240,color:"2F5496",halfPoints:32,italic:false},{level:2,before:40,color:"2F5496",halfPoints:26,italic:false},{level:3,before:40,color:"1F3763",halfPoints:24,italic:false},{level:4,before:40,color:"2F5496",halfPoints:null,italic:true},{level:5,before:40,color:"2F5496",halfPoints:null,italic:false},{level:6,before:40,color:"1F3763",halfPoints:null,italic:false},{level:7,before:40,color:"1F3763",halfPoints:null,italic:true},{level:8,before:40,color:"272727",halfPoints:21,italic:false},{level:9,before:40,color:"272727",halfPoints:21,italic:true}],fN=e=>`<w:style w:type="paragraph" w:styleId="Heading${e.level}"><w:name w:val="heading ${e.level}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="9"/><w:qFormat/><w:pPr><w:keepNext/><w:keepLines/><w:spacing w:before="${e.before}" w:after="0"/><w:outlineLvl w:val="${e.level-1}"/></w:pPr><w:rPr>`+(e.italic?"<w:i/><w:iCs/>":"")+`<w:color w:val="${e.color}"/>`+(e.halfPoints===null?"":`<w:sz w:val="${e.halfPoints}"/><w:szCs w:val="${e.halfPoints}"/>`)+"</w:rPr></w:style>",pN=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="${xw}"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="Calibri" w:hAnsi="Calibri" w:eastAsia="Calibri" w:cs="Calibri"/><w:sz w:val="22"/><w:szCs w:val="22"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="160" w:line="259" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style>`+uN.map(fN).join("")+'<w:style w:type="character" w:default="1" w:styleId="DefaultParagraphFont"><w:name w:val="Default Paragraph Font"/><w:uiPriority w:val="1"/><w:semiHidden/><w:unhideWhenUsed/></w:style><w:style w:type="table" w:default="1" w:styleId="TableNormal"><w:name w:val="Normal Table"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/><w:tblPr><w:tblInd w:w="0" w:type="dxa"/><w:tblCellMar><w:top w:w="0" w:type="dxa"/><w:left w:w="108" w:type="dxa"/><w:bottom w:w="0" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr></w:style><w:style w:type="numbering" w:default="1" w:styleId="NoList"><w:name w:val="No List"/><w:uiPriority w:val="99"/><w:semiHidden/><w:unhideWhenUsed/></w:style><w:style w:type="paragraph" w:styleId="Title"><w:name w:val="Title"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="10"/><w:qFormat/><w:pPr><w:spacing w:after="0" w:line="240" w:lineRule="auto"/><w:contextualSpacing/></w:pPr><w:rPr><w:spacing w:val="-10"/><w:kern w:val="28"/><w:sz w:val="56"/><w:szCs w:val="56"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Subtitle"><w:name w:val="Subtitle"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="11"/><w:qFormat/><w:rPr><w:color w:val="5A5A5A"/><w:spacing w:val="15"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Quote"><w:name w:val="Quote"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="29"/><w:qFormat/><w:pPr><w:spacing w:before="160"/><w:jc w:val="center"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Caption"><w:name w:val="caption"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="35"/><w:semiHidden/><w:unhideWhenUsed/><w:pPr><w:spacing w:after="0"/></w:pPr><w:rPr><w:i/><w:iCs/><w:color w:val="404040"/><w:sz w:val="18"/><w:szCs w:val="18"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="NoSpacing"><w:name w:val="No Spacing"/><w:uiPriority w:val="1"/><w:qFormat/><w:pPr><w:spacing w:after="0" w:line="240" w:lineRule="auto"/></w:pPr></w:style><w:style w:type="paragraph" w:styleId="ListParagraph"><w:name w:val="List Paragraph"/><w:basedOn w:val="Normal"/><w:uiPriority w:val="34"/><w:qFormat/><w:pPr><w:ind w:left="720"/><w:contextualSpacing/></w:pPr></w:style></w:styles>',mN=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document xmlns:w="${xw}"><w:body><w:p/><w:sectPr><w:pgSz w:w="12240" w:h="15840"/><w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/></w:sectPr></w:body></w:document>`;function cm(){return fflate.zipSync({"[Content_Types].xml":fflate.strToU8(lN),"_rels/.rels":fflate.strToU8(cN),"word/_rels/document.xml.rels":fflate.strToU8(dN),"word/document.xml":fflate.strToU8(mN),"word/styles.xml":fflate.strToU8(pN)})}var ww="http://schemas.microsoft.com/office/2004/12/omml",gN="http://www.w3.org/1998/Math/MathML",hN=4096,kw=32;function Iw(e,t){return e.failed||t>kw||e.left<=0?(e.failed=true,false):(e.left-=1,true)}function sl(e,t){return e.kind!=="textValue"&&e.namespaceUri===chunkZOZI27AW_cjs.Ze&&(t===void 0||e.localName===t)}function dm(e,t){if(e.kind!=="textValue")return e.attributes.find(n=>n.localName==="val"&&n.namespaceUri===t)?.value}function Rw(e,t,n){if(!Iw(t,n))return "";if(e.kind==="textValue")return e.value;let r="";for(let o of e.children)r+=Rw(o,t,n+1);return r}function yN(e,t,n){if(e.kind==="textValue")return "";let r="",o,i=false,a;for(let d of e.children)if(sl(d,"t"))r+=Rw(d,t,n+1);else if(sl(d,"rPr")&&d.kind!=="textValue")for(let u of d.children)sl(u,"sty")&&(o=dm(u,chunkZOZI27AW_cjs.Ze)),sl(u,"nor")&&(i=true);else if(d.kind!=="textValue"&&d.namespaceUri===chunkZOZI27AW_cjs.pa&&d.localName==="rPr"){let u=d.children.find(p=>p.kind!=="textValue"&&p.localName==="color"),f=u?dm(u,chunkZOZI27AW_cjs.pa):void 0;f&&/^[0-9A-Fa-f]{6}$/.test(f)&&(a=f.toUpperCase());}if(r.length===0)return "";let s=`<m:r>${chunkZOZI27AW_cjs.V(r)}</m:r>`;a!==void 0&&(s=`<span style="color:#${a}">${s}</span>`);let l=!i&&(o===void 0||o==="i"||o==="bi"),c=o==="b"||o==="bi";return l&&(s=`<i>${s}</i>`),c&&(s=`<b>${s}</b>`),s}function Pw(e,t,n){if(e.kind==="textValue"||!sl(e)||!Iw(t,n))return "";if(e.localName==="r")return yN(e,t,n);if(e.localName==="ctrlPr")return "";let r=dm(e,chunkZOZI27AW_cjs.Ze),o=r===void 0?"":` m:val="${chunkZOZI27AW_cjs.W(r)}"`,i="";for(let a of e.children)i+=Pw(a,t,n+1);return i.length>0?`<m:${e.localName}${o}>${i}</m:${e.localName}>`:`<m:${e.localName}${o}/>`}function bN(e){let t="";for(let n of e.match(/\d+(?:\.\d+)?|\p{L}|\s+|./gu)??[]){if(/^\s+$/.test(n))continue;let r=chunkZOZI27AW_cjs.V(n);/^\d/.test(n)?t+=`<mn>${r}</mn>`:/^\p{L}$/u.test(n)?t+=`<mi>${r}</mi>`:t+=`<mo>${r}</mo>`;}return t}function um(e,t){if(t>kw)return "";let n=r=>`<mrow>${um(r,t+1)}</mrow>`;switch(e.kind){case "text":return e.format?.normalText?`<mtext>${chunkZOZI27AW_cjs.V(e.value)}</mtext>`:bN(e.value);case "fallback":return `<mtext>${chunkZOZI27AW_cjs.V(e.text)}</mtext>`;case "row":return e.items.map(r=>um(r,t+1)).join("");case "bar":return e.position==="top"?`<mover accent="true">${n(e.body)}<mo>\xAF</mo></mover>`:`<munder accentunder="true">${n(e.body)}<mo>\xAF</mo></munder>`;case "fraction":return `<mfrac>${n(e.numerator)}${n(e.denominator)}</mfrac>`;case "radical":return e.degree===void 0?`<msqrt>${n(e.radicand)}</msqrt>`:`<mroot>${n(e.radicand)}${n(e.degree)}</mroot>`;case "script":{let r=n(e.base);return e.subscript&&e.superscript?`<msubsup>${r}${n(e.subscript)}${n(e.superscript)}</msubsup>`:e.subscript?`<msub>${r}${n(e.subscript)}</msub>`:e.superscript?`<msup>${r}${n(e.superscript)}</msup>`:r}case "nary":{let r=`<mo>${chunkZOZI27AW_cjs.V(e.operator)}</mo>`,o=e.lowerLimit?n(e.lowerLimit):"",i=e.upperLimit?n(e.upperLimit):"";return `<mrow>${o&&i?`<munderover>${r}${o}${i}</munderover>`:o?`<munder>${r}${o}</munder>`:i?`<mover>${r}${i}</mover>`:r}${n(e.body)}</mrow>`}}}function Tw(e){if(!chunkZOZI27AW_cjs.ef(e))return "";let t=chunkZOZI27AW_cjs.df(e),n=t?chunkZOZI27AW_cjs.gf(e):chunkZOZI27AW_cjs.$e(e),r={left:hN,failed:false},o=Pw(e,r,0),i=n===null?"":`<math xmlns="${gN}"${t?' display="block"':""}>${um(n.expression,0)}</math>`;return r.failed||o.length===0?i:`<!--[if gte msEquation 12]>${o}<![endif]--><![if !msEquation]>${i}<![endif]>`}function Ew(e){return e.includes("<!--[if gte msEquation 12]>")}var va="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",vN=(()=>{let e=new Int16Array(128).fill(-1);for(let t=0;t<va.length;t+=1)e[va.charCodeAt(t)]=t;return e})();function Ld(e,t){if(e.length===0)return null;let n=e.length%4;if(n===1)return null;let r=n===0?e:e+"=".repeat(4-n),o=r.endsWith("==")?2:r.endsWith("=")?1:0,i=r.length/4*3-o;if(i<=0||i>t)return null;let a=new Uint8Array(i),s=0;for(let l=0;l<r.length;l+=4){let c=0,d=0;for(let u=0;u<4;u+=1){let f=r.charCodeAt(l+u);if(f===61){if(l+u<r.length-o)return null;continue}let p=f<128?vN[f]:-1;if(p<0)return null;c=c<<6|p,d+=6;}c<<=24-d,d>=12&&(a[s++]=c>>>16&255),d>=18&&(a[s++]=c>>>8&255),d>=24&&(a[s++]=c&255);}return s===i?a:null}function Dd(e){let t=[],n="";for(let r=0;r<e.length;r+=3){let o=e[r],i=r+1<e.length?e[r+1]:0,a=r+2<e.length?e[r+2]:0;n+=va[o>>2]+va[(o&3)<<4|i>>4],n+=r+1<e.length?va[(i&15)<<2|a>>6]:"=",n+=r+2<e.length?va[a&63]:"=",n.length>=32768&&(t.push(n),n="");}return t.push(n),t.join("")}var xN=16*1024*1024,Ow=64*1024*1024,Mw="data-docx-fragment",Aw="data-docx-fragment-end",SN=Dd;function Fw(e,t){let n=t?.lastMarkCovered?"covered":"open",r=t?`<div ${Mw}="${SN(t.bytes)}" ${Aw}="${n}">${e}</div>`:`<div>${e}</div>`;return Ew(e)?`<html xmlns:m="${ww}"><body>${r}</body></html>`:r}function Cw(e,t){let n=`${t}="`,r=e.indexOf(n);if(r===-1||r>Ow)return null;let o=r+n.length,i=e.indexOf('"',o);return i===-1?null:e.slice(o,i)}function xa(e,t=xN){if(e.length>Ow)return null;let n=Cw(e,Mw);if(n===null||n.length===0)return null;let r=Ld(n,t);if(r===null||r.byteLength===0)return null;let o=Cw(e,Aw);return {bytes:r,lastMarkCovered:o==="covered"}}function hi(e){if(e==null)return null;let t=e.trim();return /^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8}){0,3}$/.test(t)?t:null}var pm=["single","words","double","thick","dotted","dottedHeavy","dash","dashedHeavy","dashLong","dashLongHeavy","dotDash","dashDotHeavy","dotDotDash","dashDotDotHeavy","wave","wavyHeavy","wavyDouble"],fm={Normal:"MsoNormal",ListParagraph:"MsoListParagraph",Title:"MsoTitle",Subtitle:"MsoSubtitle",Caption:"MsoCaption",Quote:"MsoQuote",IntenseQuote:"MsoIntenseQuote",BodyText:"MsoBodyText",FootnoteText:"MsoFootnoteText"},mm=new Map([...Object.entries(fm).filter(([e])=>e!=="Normal").map(([e,t])=>[t,e]),["MsoListParagraphCxSpFirst","ListParagraph"],["MsoListParagraphCxSpMiddle","ListParagraph"],["MsoListParagraphCxSpLast","ListParagraph"]]);function Lw(e){return e===void 0?null:/^Heading[7-9]$/.test(e)?`Mso${e}`:Object.hasOwn(fm,e)?fm[e]:null}var gm=Object.fromEntries(chunkZGTIE3QJ_cjs.q),hm={left:"left",start:"left",center:"center",right:"right",end:"right",both:"justify",distribute:"justify"};function Dw(e){let t=e.trim();if(t.length===0||t.length>255)return null;let n=t.replace(/[^\p{L}\p{N} _.,-]/gu,"");return n.length===0?null:`"${chunkZOZI27AW_cjs.Z(n)}"`}var wN=new Map([["single","solid"],["thick","solid"],["double","double"],["triple","double"],["dotted","dotted"],["dashed","dashed"],["dashSmallGap","dashed"],["dotDash","dashed"],["dotDotDash","dashed"],["wave","solid"],["hairline","solid"],["inset","solid"],["outset","solid"]]);function yi(e){if(e===null)return null;let t=chunkZOZI27AW_cjs.eg(e,"val",chunkZOZI27AW_cjs.pa);if(t===void 0||t==="nil"||t==="none")return null;let n=wN.get(t)??"solid",r=chunkZOZI27AW_cjs.eg(e,"sz",chunkZOZI27AW_cjs.pa),o=r!==void 0&&/^\d{1,4}$/.test(r)?Number.parseInt(r,10):0,i=o>0?o/8:.5,a=`${Math.round(i*100)/100}pt`,s=chunkZOZI27AW_cjs.eg(e,"color",chunkZOZI27AW_cjs.pa),l=s!==void 0&&/^[0-9A-Fa-f]{6}$/.test(s)?`#${s}`:"#000000";return `${a} ${n} ${l.toLowerCase()}`}function Nw(e,t){return e===null||e<=0?[]:t==="exact"||t==="atLeast"?[`line-height:${`${Math.round(e/20*100)/100}pt`}`,`mso-line-height-rule:${t==="exact"?"exactly":"at-least"}`]:[`line-height:${Math.round(e/240*100)/100}`]}var kN=new Map([["double","double"],["wavyDouble","double"],["dotted","dotted"],["dottedHeavy","dotted"],["dash","dashed"],["dashedHeavy","dashed"],["dashLong","dashed"],["dashLongHeavy","dashed"],["dotDash","dashed"],["dashDotHeavy","dashed"],["dotDotDash","dashed"],["dashDotDotHeavy","dashed"],["wave","wavy"],["wavyHeavy","wavy"]]),IN=new Set(pm);function Hw(e){if(e===null)return [];let t=chunkZOZI27AW_cjs.eg(e,"val",chunkZOZI27AW_cjs.pa),n=[],r=t===void 0?void 0:kN.get(t);r!==void 0&&n.push(`text-decoration-style:${r}`),t!==void 0&&t!=="single"&&IN.has(t)&&n.push(`text-underline:${t}`);let o=chunkZOZI27AW_cjs.eg(e,"color",chunkZOZI27AW_cjs.pa);return o!==void 0&&/^[0-9A-Fa-f]{6}$/.test(o)&&n.push(`text-decoration-color:#${o.toLowerCase()}`),t==="thick"&&n.push("text-decoration-thickness:2px"),n}function _w(e,t){return e===null||e<=0?"":`height:${Math.round(e/20*100)/100}pt;mso-height-rule:${t==="exact"?"exactly":"at-least"}`}function Bw(e,t,n,r){if(e.namespaceUri!==chunkZOZI27AW_cjs.pa)return "";let o=e.localName==="footnoteRef"?"footnote":e.localName==="endnoteRef"?"endnote":null,i=e.localName==="footnoteReference"?"footnote":e.localName==="endnoteReference"?"endnote":null,a=o??i;if(a===null)return "";let s=chunkZOZI27AW_cjs.eg(e,"id",chunkZOZI27AW_cjs.pa),l=o===null?s!==void 0&&/^\d{1,10}$/.test(s)?Number.parseInt(s,10):void 0:t?.id;if(l===void 0||!Number.isInteger(l)||l<1||o!==null&&t?.kind!==o||l>2147483647||o===null&&!r(a,l))return "";let c=a==="footnote",d=o!==null,u=c?"MsoFootnoteReference":"MsoEndnoteReference",f=c?"ftn":"edn",p=d?`#_${f}ref${l}`:`#_${f}${l}`,g=d?`_${f}${l}`:`_${f}ref${l}`;return `<a style="mso-${c?"footnote":"endnote"}-id:${f}${l}" href="${p}" name="${g}"><span class="${u}"><span style="mso-special-character:footnote">[${n(a,l)}]</span></span></a>`}function $w(e){if(e.namespaceUri!==chunkZOZI27AW_cjs.pa||e.localName!=="ptab")return "";let t=chunkZOZI27AW_cjs.eg(e,"alignment",chunkZOZI27AW_cjs.pa),n=chunkZOZI27AW_cjs.eg(e,"relativeTo",chunkZOZI27AW_cjs.pa),r=chunkZOZI27AW_cjs.eg(e,"leader",chunkZOZI27AW_cjs.pa)??"none";if(t!=="left"&&t!=="center"&&t!=="right")return "";let o=n==="margin"||n==="leftMargin"?"margin":n==="indent"?"indent":null;return o===null||r!=="none"&&r!=="dot"&&r!=="hyphen"&&r!=="underscore"&&r!=="middleDot"&&r!=="heavy"?"":`<w:PTab Alignment="${t.toUpperCase()}" RelativeTo="${o.toUpperCase()}" Leader="${r.toUpperCase()}"></w:PTab>`}function At(e){let t=e.trim().toLowerCase();if(/^-?0+(\.0+)?$/.test(t))return 0;let n=/^(-?(?:\d+(?:\.\d+)?|\.\d+))(px|pt|in|cm|mm|pc)$/.exec(t);if(!n)return null;let r=Number.parseFloat(n[1]);if(!Number.isFinite(r))return null;switch(n[2]){case "px":return r*.75;case "in":return r*72;case "cm":return r*72/2.54;case "mm":return r*72/25.4;case "pc":return r*12;default:return r}}function jw(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("<o:p")||e.includes("class=Mso")||e.includes('class="Mso')||e.includes("class='Mso")}function Kw(e,t){for(let r of e.classList){let o=/^MsoHeading([1-9])$/.exec(r);if(o)return `Heading${o[1]}`;let i=/^Heading([1-9])$/.exec(r);if(i)return `Heading${i[1]}`;let a=mm.get(r);if(a!==void 0)return a}if(e.classList.contains("docx-outline"))return;let n=t?/^h([1-6])$/.exec(tt(e)):null;return n?`Heading${n[1]}`:void 0}var Vw=262144,RN=4096,PN=256,TN=2048,EN=8,CN=new Set(["MsoNormal",...mm.keys(),...Array.from({length:9},(e,t)=>`MsoHeading${t+1}`),...Array.from({length:9},(e,t)=>`Heading${t+1}`)]),ON=new Map([["left","left"],["start","start"],["center","center"],["right","right"],["end","end"],["justify","both"]]),MN=/^\s*(p|li|div)\.([A-Za-z][A-Za-z0-9]{0,31})\s*$/i;function AN(e){let t="";for(let n=0;n<e.length;n+=1){if(e.startsWith("<!--",n)){n+=3;continue}if(e.startsWith("-->",n)){n+=2;continue}t+=e[n];}return t}function FN(e,t){let n=0;for(let r=t;r<e.length;r+=1){let o=e[r];if(o==="{"){if(n+=1,n>4)return null}else if(o==="}"&&(n-=1,n===0))return r+1}return null}function LN(e,t){for(let n=t+1;n<e.length;n+=1){let r=e[n];if(r===";")return n+1;if(r==="{")return FN(e,n)}return null}function DN(e){let t=e.split(",");if(t.length===0||t.length>EN)return null;let n=[];for(let r of t){let o=MN.exec(r);if(!o)return null;let i=o[2];if(!CN.has(i))return null;n.includes(i)||n.push(i);}return n}function NN(e){let t;for(let n of e.split(";")){let r=n.indexOf(":");if(r<=0||n.slice(0,r).trim().toLowerCase()!=="text-align")continue;let i=n.slice(r+1).trim().toLowerCase();if(i.length===0||i.length>32||i.includes("("))continue;let a=0;for(;a<i.length&&i.charCodeAt(a)>32;)a+=1;let s=ON.get(i.slice(0,a));s!==void 0&&(t=s);}return t}function HN(e){let t=new Map,n=()=>({ok:false,alignments:new Map});if(e.length===0)return {ok:true,alignments:t};if(e.length>Vw)return n();let r=AN(e),o=0,i=0;for(;o<r.length&&i<RN;){for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;if(o>=r.length)break;if(r[o]==="@"){let f=LN(r,o);if(f===null)return n();o=f;continue}let a=r.indexOf("{",o);if(a<0)return n();let s=r.slice(o,a),l=r.indexOf("}",a+1);if(l<0)return n();let c=r.slice(a+1,l);if(i+=1,o=l+1,s.length>PN||c.length>TN||c.includes("{"))return n();let d=DN(s),u=NN(c);if(!(!d||u===void 0))for(let f of d)t.set(f,u);}for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;return o<r.length?n():{ok:true,alignments:t}}function Uw(e){let t=new Map,n=e.getElementsByTagName("style");if(n.length>16)return new Map;for(let r=0;r<n.length;r+=1){let o=n[r]?.textContent??"";if(o.length>Vw)return new Map;let i=HN(o);if(!i.ok)return new Map;for(let[a,s]of i.alignments)t.set(a,s);}return t}var _N=262144;function zw(e,t=_N){let n=e.getElementsByTagName("style"),r="";for(let o=0;o<n.length&&o<16;o+=1){let i=n[o]?.textContent??"";i.length>t||r.length+i.length>t||(r+=`
3
- ${i}`);}return r}function Gw(e,t,n){for(let o of t.classList){let i=n.get(o);if(i!==void 0){e.jc=i;break}}let r=t.getAttribute("align")?.trim().toLowerCase();r==="left"||r==="center"||r==="right"?e.jc=r:r==="justify"&&(e.jc="both");}function ym(e,t,n,r){let o=At(t.get(n)??"");if(o!==null&&o>0)return o/.75;let i=e.getAttribute(n)?.trim()??"";if(!/^[1-9]\d{0,4}$/.test(i))return null;let a=Number.parseInt(i,10);return r?a/.75:a}function Sa(e){return e.nodeType===1}function tt(e){return e.tagName.toLowerCase()}var BN=new Map("black:000000 white:FFFFFF red:FF0000 green:008000 blue:0000FF yellow:FFFF00 gray:808080 grey:808080 silver:C0C0C0 maroon:800000 navy:000080 purple:800080 orange:FFA500 aqua:00FFFF cyan:00FFFF fuchsia:FF00FF magenta:FF00FF lime:00FF00 olive:808000 windowtext:000000".split(" ").map(e=>e.split(":"))),$N=new Map([["yellow","yellow"],["aqua","cyan"],["cyan","cyan"],["fuchsia","magenta"],["magenta","magenta"],["lime","green"],["green","green"],["olive","darkYellow"],["red","red"],["blue","blue"],["black","black"],["white","white"],["darkblue","darkBlue"],["darkcyan","darkCyan"],["darkgray","darkGray"],["darkgrey","darkGray"],["darkgreen","darkGreen"],["darkmagenta","darkMagenta"],["darkred","darkRed"],["darkyellow","darkYellow"],["lightgray","lightGray"],["lightgrey","lightGray"]]),qN=/url\s*\(|image\s*\(|image-set\s*\(|element\s*\(|cross-fade\s*\(/i,WN=new Map(pm.map(e=>[e.toLowerCase(),e])),qw=new WeakMap;function xt(e){let t=qw.get(e);if(t!==void 0)return t;let n=new Map;qw.set(e,n);let r=e.getAttribute("style");if(!r||r.length>8192)return n;for(let o of r.split(";")){let i=o.indexOf(":");if(i<=0)continue;let a=o.slice(0,i).trim().toLowerCase(),s=o.slice(i+1).trim();a.length>0&&s.length>0&&(n.delete(a),n.set(a,s));}return n}function Ro(e){let t=e.trim().toLowerCase(),n=BN.get(t);if(n)return n;let r=/^#([0-9a-f]{6})$/.exec(t);if(r)return r[1].toUpperCase();let o=/^#([0-9a-f]{3})$/.exec(t);if(o){let[a,s,l]=o[1];return `${a}${a}${s}${s}${l}${l}`.toUpperCase()}let i=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,[^)]*)?\)$/.exec(t);if(i){let a=s=>Math.min(255,Number.parseInt(s,10)).toString(16).padStart(2,"0");return `${a(i[1])}${a(i[2])}${a(i[3])}`.toUpperCase()}return null}function jN(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(!(t.length===0||t.length>32||/[^a-z]/.test(t)))return $N.get(t)}function Ww(e){if(e===void 0)return null;let t=e.trim();if(t.length===0||t.length>128||qN.test(t))return null;let n=t.toLowerCase();return n==="transparent"||n==="none"?null:Ro(t)}function Bn(e,t,n){return Math.min(n,Math.max(t,e))}function Hd(e){let t=null;for(let[n,r]of e)if(n==="background")t=Ww(r);else if(n==="background-color"){let o=r.trim().toLowerCase();if(o==="transparent"||o==="none"||o==="initial"){t=null;continue}let i=Ww(r);i!==null&&(t=i);}return t}var KN=new Set(["left","center","right","decimal","bar"]),VN=new Map([["dotted","dot"],["dot","dot"],["dashed","hyphen"],["hyphen","hyphen"],["lined","underscore"],["underscore","underscore"],["middledot","middleDot"],["heavy","heavy"]]);function UN(e){if(e===void 0||e.length===0||e.length>512)return;let t="left",n,r=[];for(let o of e.trim().toLowerCase().split(/\s+/)){if(KN.has(o)){t=o;continue}if(o==="list"){t="left";continue}let i=VN.get(o);if(i!==void 0){n=i;continue}let a=At(o);if(!(a===null||a<0)){if(r.push({val:t,posTwips:Bn(Math.round(a*20),0,31680),...n===void 0?{}:{leader:n}}),r.length>=32)break;t="left",n=void 0;}}return r.length>0?r:void 0}var zN=new Map([["solid","single"],["single","single"],["double","double"],["dotted","dotted"],["dashed","dashed"]]);function bm(e){return e.trim().replace(/\([^)]*\)/g,t=>t.replace(/\s+/g,"")).split(/\s+/)}var GN=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function Nd(e){if(e===void 0||e.length===0||e.length>128)return;let t,n=false,r,o;for(let i of bm(e)){let a=i.toLowerCase();if(a==="none"||a==="hidden"){n=true;continue}let s=zN.get(a);if(s!==void 0){t=s;continue}let l=GN.get(i.toLowerCase())??At(i);if(l!==null){r=l;continue}let c=Ro(i);if(c!==null){o=c;continue}return}if(n)return "suppressed";if(t!==void 0)return r===void 0?{val:t,szEighthPoints:4,color:o??"000000"}:r<=0?"suppressed":{val:t,szEighthPoints:Bn(Math.round(r*8),2,96),color:o??"000000"}}function _d(e){let t=e.getAttribute("style");return t?/mso-list\s*:[^;]{0,128}ignore/i.test(t.slice(0,8192)):false}function ll(e,t){return t==="b"||t==="strong"?{...e,bold:true}:t==="i"||t==="em"?{...e,italic:true}:t==="u"||t==="ins"?{...e,underline:true}:t==="s"||t==="strike"||t==="del"?{...e,strike:true}:t==="sub"?{...e,vertAlign:"subscript"}:t==="sup"?{...e,vertAlign:"superscript"}:t==="code"||t==="tt"||t==="kbd"||t==="samp"?{...e,font:"Courier New"}:e}function vm(e,t){if(t.size===0)return e;let n={...e},r=t.get("font-weight")?.toLowerCase();if(r!==void 0){let v=Number.parseInt(r,10);r==="bold"||v>=600?n.bold=true:(r==="normal"||v<600)&&(n.bold=false);}let o=t.get("font-style");o!==void 0&&(n.italic=o.toLowerCase().includes("italic"));let i=(t.get("text-decoration")??t.get("text-decoration-line"))?.toLowerCase();i!==void 0&&(i.includes("underline")&&(n.underline=true),i.includes("line-through")&&(n.strike=true),i.includes("none")&&(n.underline=n.strike=false));let a=t.get("font-variant")?.toLowerCase();a!==void 0&&(a.includes("small-caps")?n.smallCaps=true:(a.includes("normal")||a.includes("none"))&&(n.smallCaps=false));let s=t.get("text-transform")?.trim().toLowerCase();s==="uppercase"?n.caps=true:s==="none"&&(n.caps=false);let l=t.get("text-underline");if(l!==void 0&&l.length<=128)for(let v of l.trim().split(/\s+/)){let S=v.toLowerCase(),I=WN.get(S);if(I!==void 0)n.underline=true,n.underlineVal=I;else {let C=Ro(v);C!==null&&(n.underlineColor=C);}}let c=t.get("text-decoration-style")?.trim().toLowerCase();if(c==="double"&&n.strike&&!n.underline&&(n.doubleStrike=true),n.underline){c==="double"?n.underlineVal="double":c==="dotted"?n.underlineVal="dotted":c==="dashed"?n.underlineVal="dash":c==="wavy"&&(n.underlineVal="wave");let v=Ro(t.get("text-decoration-color")??"");v!==null&&(n.underlineColor=v);}let d=Ro(t.get("color")??"");d&&(n.color=d);let u=jN(t.get("mso-highlight"));if(u)n.highlight=u,delete n.shdFill;else {let v=Hd(t);v&&(n.shdFill=v);}let f=At(t.get("font-size")??"");f!==null&&f>0&&(n.szHalfPoints=Bn(Math.round(f*2),2,3276));let p=t.get("font-family");if(p!==void 0){let v=p.split(",")[0].trim().replace(/^['"]|['"]$/g,"");v.length>0&&v.length<=64&&(n.font=v);}let g=At(t.get("letter-spacing")??"");g!==null&&(n.charSpacingTwentieths=Bn(Math.round(g*20),-31680,31680));let b=t.get("vertical-align")?.trim().toLowerCase();b==="sub"?n.vertAlign="subscript":b==="super"&&(n.vertAlign="superscript");let h=hi(t.get("mso-ansi-language")),y=hi(t.get("mso-fareast-language")),x=hi(t.get("mso-bidi-language"));return h!==null&&(n.langVal=h),y!==null&&(n.langEastAsia=y),x!==null&&(n.langBidi=x),t.get("direction")?.trim().toLowerCase()==="rtl"&&(n.rtl=true),n}function bi(e,t){let n=vm(e,xt(t)),r=hi(t.getAttribute("lang"));return r!==null&&(n={...n,lang:r}),t.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(n={...n,rtl:true}),n}function Zw(e,t){let n=t.get("text-align")?.toLowerCase();n==="left"||n==="right"||n==="start"||n==="end"?e.jc=n:n==="center"?e.jc="center":n==="justify"&&(e.jc="both"),t.get("direction")?.trim().toLowerCase()==="rtl"&&(e.bidi=true);let r={top:null,right:null,bottom:null,left:null},o=t.get("margin");if(o!==void 0&&o.length<=128){let y=o.trim().split(/\s+/).map(x=>At(x));if(y.length>=1&&y.length<=4&&!y.some(x=>x===null)){let[x,v=x,S=x,I=v]=y.length===2?[y[0],y[1],y[0],y[1]]:y.length===3?[y[0],y[1],y[2],y[1]]:y;r.top=x??null,r.right=v??null,r.bottom=S??null,r.left=I??null;}}let i=At(t.get("margin-left")??"")??r.left;i!==null&&(i>0||i===0&&!e.numPr)&&(e.indLeftTwips=Bn(Math.round(i*20),0,31680));let a=At(t.get("margin-right")??"")??r.right;a!==null&&a>=0&&(e.indRightTwips=Bn(Math.round(a*20),0,31680));let s=At(t.get("text-indent")??"");if(s!==null&&s!==0){let y=Bn(Math.round(s*20),-31680,31680);y!==0&&(e.firstLineTwips=y);}let l=At(t.get("margin-top")??"")??r.top;l!==null&&l>=0&&(e.spacingBeforeTwips=Bn(Math.round(l*20),0,31680));let c=At(t.get("margin-bottom")??"")??r.bottom;c!==null&&c>=0&&(e.spacingAfterTwips=Bn(Math.round(c*20),0,31680));let d=t.get("line-height")?.trim()??"",u=t.get("mso-line-height-rule")?.trim().toLowerCase(),f=At(d);if(f!==null&&f>0)e.lineTwentieths=Bn(Math.round(f*20),24,31680),e.lineRule=u==="exactly"?"exact":"atLeast";else if(/^\d+(\.\d+)?$/.test(d)&&Number.parseFloat(d)>0)e.lineTwentieths=Bn(Math.round(240*Number.parseFloat(d)),24,9600),e.lineRule="auto";else if(/^\d+(\.\d+)?%$/.test(d)){let y=Number.parseFloat(d);y>0&&(e.lineTwentieths=Bn(Math.round(2.4*y),24,9600),e.lineRule="auto");}(t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page")&&(e.pageBreakBefore=true),t.get("page-break-after")?.trim().toLowerCase()==="avoid"&&(e.keepNext=true),t.get("page-break-inside")?.trim().toLowerCase()==="avoid"&&(e.keepLines=true),(/^[2-9]\d?$/.test(t.get("widows")?.trim()??"")||/^[2-9]\d?$/.test(t.get("orphans")?.trim()??""))&&(e.widowControl=true);let p=Hd(t);p&&(e.shdFill=p);let g=UN(t.get("tab-stops"));g!==void 0&&(e.tabs=g);let b=Nd(t.get("mso-border-alt"))??Nd(t.get("border")),h={};for(let y of ["top","left","bottom","right"]){let x=Nd(t.get(`mso-border-${y}-alt`))??Nd(t.get(`border-${y}`))??b;x!==void 0&&x!=="suppressed"&&(h[y]=x);}Object.keys(h).length>0&&(e.borders=h);}var ZN="http://schemas.openxmlformats.org/drawingml/2006/picture",XN=/^data:image\/(?:png|jpeg|jpg|gif|bmp|webp|svg\+xml|tiff|tif|x-emf|emf|x-wmf|wmf);base64,([A-Za-z0-9+/=]+)$/i,YN=new Map([["image/png","png"],["image/jpeg","jpeg"],["image/gif","gif"],["image/bmp","bmp"],["image/webp","webp"],["image/svg+xml","svg"],["image/tiff","tiff"],["image/x-emf","emf"],["image/x-wmf","wmf"]]);function Xw(e,t,n){return Math.min(n,Math.max(t,e))}function Yw(e,t,n,r){let o=e.getAttribute("src");if(o===null||o.length>n.maxImageBytes*2)return;let i=XN.exec(o);if(!i)return;let a=n.mediaBySrc.get(o),s=a===void 0?void 0:n.media.get(a),l=s??Ld(i[1],n.maxImageBytes);if(l==null)return;let c=chunkZOZI27AW_cjs.ke(l),d=YN.get(c);if(d===void 0)return;let u=c==="image/png"||c==="image/jpeg"||c==="image/gif"||c==="image/bmp"||c==="image/webp"?chunkZOZI27AW_cjs.pe(l,c):null,f=xt(e),p=ym(e,f,"width",n.wordHtml),g=ym(e,f,"height",n.wordHtml);u!==null?p===null&&g===null?(p=u.pixelWidth*96/(u.dpiX??96),g=u.pixelHeight*96/(u.dpiY??96)):p!==null&&g===null?g=p*u.pixelHeight/u.pixelWidth:p===null&&g!==null&&(p=g*u.pixelWidth/u.pixelHeight):p!==null&&g===null?g=p*2/3:p===null&&g!==null&&(p=g*3/2);let b=p===null?381e4:Xw(Math.round(p*9525),9525,3e7),h=g===null?254e4:Xw(Math.round(g*9525),9525,3e7),y=s===void 0?void 0:a;y===void 0&&(n.imageCount+=1,y=`word/media/image${n.imageCount}.${d}`,n.media.set(y,l),n.mediaBySrc.set(o,y),n.mediaExtensions.has(d)||n.mediaExtensions.set(d,c));let x=r(y.replace("word/",""));n.docPrId+=1,t.push(`<w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${b}" cy="${h}"/><wp:docPr id="${n.docPrId}" name=""/><wp:cNvGraphicFramePr/><a:graphic><a:graphicData uri="${ZN}"><pic:pic><pic:nvPicPr><pic:cNvPr id="0" name="" descr=""/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${x}"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${b}" cy="${h}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`);}var QN="http://schemas.openxmlformats.org/wordprocessingml/2006/main",JN='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',Qw=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}];function Jw(e,t,n){let r=720*(n+1);if(e==="bullet"){let i=Qw[n%Qw.length];return `<w:lvl w:ilvl="${n}"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="${chunkZOZI27AW_cjs.W(i.text)}"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${r}" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="${i.font}" w:hAnsi="${i.font}" w:hint="default"/></w:rPr></w:lvl>`}let o=e==="lowerRoman"||e==="upperRoman";return `<w:lvl w:ilvl="${n}"><w:start w:val="${t}"/><w:numFmt w:val="${e}"/><w:lvlText w:val="%${n+1}."/><w:lvlJc w:val="${o?"right":"left"}"/><w:pPr><w:ind w:left="${r}" w:hanging="${o?180:360}"/></w:pPr></w:lvl>`}var eH=new Map([["i",1],["v",5],["x",10],["l",50],["c",100],["d",500],["m",1e3]]),tH=new Map([["alpha-lower","lowerLetter"],["alpha-upper","upperLetter"],["roman-lower","lowerRoman"],["roman-upper","upperRoman"],["bullet","bullet"],["image","bullet"],["decimal","decimal"],["arabic","decimal"]]),ek=/@list\s+l(\d{1,4}):level([1-9])(?:[\s:]+lfo(\d{1,4}))?\s*\{([^{}]{0,2048})\}/g;function tk(e){let t=new Map;if(e.length===0||e.length>262200)return t;ek.lastIndex=0;let n,r=0;for(;(n=ek.exec(e))!==null&&r<512;){r+=1;let o="decimal",i=null;for(let s of n[4].split(";")){let l=s.indexOf(":");if(l<=0)continue;let c=s.slice(0,l).trim().toLowerCase(),d=s.slice(l+1).trim().toLowerCase();c==="mso-level-number-format"?o=tH.get(d)??null:c==="mso-level-start-at"&&/^\d{1,5}$/.test(d)&&(i=Math.min(32767,Number.parseInt(d,10)));}if(o===null)continue;let a=n[3]===void 0?`l${n[1]}:level${n[2]}`:`l${n[1]}:level${n[2]}:lfo${n[3]}`;t.has(a)||t.set(a,{kind:o,start:i});}return t}function nk(e,t){let n=e.trim().replace(/^\(/,"");if(t==="decimal"){let r=/^(\d{1,5}(?:\.\d{1,5})*)/.exec(n);if(!r)return null;let o=r[1].split(".");return Math.min(32767,Number.parseInt(o[o.length-1],10))}if(t==="lowerRoman"||t==="upperRoman"){let r=/^([A-Za-z]{1,8})/.exec(n);return r?rk(r[1]):null}if(t==="lowerLetter"||t==="upperLetter"){let r=/^(([A-Za-z])\2{0,4})(?![A-Za-z])/.exec(n);if(!r)return null;let o=r[2].toLowerCase().charCodeAt(0);return Math.min(32767,(r[1].length-1)*26+(o-96))}return null}var nH=/^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$/;function rk(e){let t=e.toLowerCase();if(!nH.test(t))return null;let n=0,r=0;for(let o of t){let i=eH.get(o);if(i===void 0)return null;n+=i,r>0&&r<i&&(n-=2*r),r=i;}return n>0&&n<=32767?n:null}function ok(e){let t=e.trim().replace(/^\(/,""),n=/^(\d{1,5}(?:\.\d{1,5})*)[.)]/.exec(t);if(n){let a=n[1].split(".");return {kind:"decimal",start:Math.min(32767,Number.parseInt(a[a.length-1],10))}}let r=/^([A-Za-z])[.)]/.exec(t);if(r){let a=r[1].toLowerCase();if(a==="i"||a==="v"||a==="x"){let l=a==="i"?1:a==="v"?5:10;return {kind:r[1]===a?"lowerRoman":"upperRoman",start:l}}let s=r[1].charCodeAt(0);return s>=97?{kind:"lowerLetter",start:s-96}:{kind:"upperLetter",start:s-64}}let o=/^([A-Za-z]{2,8})[.)]/.exec(t);if(o){let a=o[1],s=a===a.toLowerCase(),l=/^([A-Za-z])\1+$/.test(a);if(!l||/^[iI]+$/.test(a)){let c=rk(a);if(c!==null)return {kind:s?"lowerRoman":"upperRoman",start:c}}if(l){let c=a.toLowerCase().charCodeAt(0),d=Math.min(32767,(a.length-1)*26+(c-96));return {kind:s?"lowerLetter":"upperLetter",start:d}}}let i=/\d{1,5}/.exec(t);return i?{kind:"decimal",start:Math.min(32767,Number.parseInt(i[0],10))}:{kind:"bullet",start:1}}var rH=new Map([["none","none"],["decimal","decimal"],["upper-alpha","upperLetter"],["upper-latin","upperLetter"],["lower-alpha","lowerLetter"],["lower-latin","lowerLetter"],["upper-roman","upperRoman"],["lower-roman","lowerRoman"]]);function ik(e){if(e.localName.toLowerCase()!=="ol")return "bullet";let t=xt(e).get("list-style-type")?.trim().toLowerCase(),n=t===void 0?void 0:rH.get(t);if(n!==void 0)return n;let r=e.getAttribute("type");return r==="A"?"upperLetter":r==="a"?"lowerLetter":r==="I"?"upperRoman":r==="i"?"lowerRoman":"decimal"}function xm(e){let t=e.getAttribute("start")?.trim();return t!==void 0&&/^\d{1,5}$/.test(t)?Math.min(32767,Number.parseInt(t,10)):1}function ak(e){let t=e.map((r,o)=>{let i=r.levels.get(0)??r.levels.values().next().value??{kind:"decimal"},a=Array.from({length:9},(s,l)=>{let c=r.levels.get(l);return c?Jw(c.kind,c.start,l):Jw(i.kind==="bullet"?"bullet":"decimal",1,l)}).join("");return `<w:abstractNum w:abstractNumId="${o}"><w:multiLevelType w:val="hybridMultilevel"/>${a}</w:abstractNum>`}).join(""),n=e.map((r,o)=>`<w:num w:numId="${r.numId}"><w:abstractNumId w:val="${o}"/></w:num>`).join("");return `${JN}<w:numbering xmlns:w="${QN}">${t}${n}</w:numbering>`}function ir(e){if(e==null)return null;let t=e.trim();if(t.length===0||t.length>256)return null;if(/^[A-Za-z_][A-Za-z0-9_]{0,39}$/.test(t))return t;let n=t.replace(/[^A-Za-z0-9_]/g,"_");if(n.replace(/_/g,"").length===0)return null;let r=5381;for(let a=0;a<t.length;a+=1)r=(Math.imul(r,33)^t.charCodeAt(a))>>>0;let o=`_${r.toString(36)}`,i=n.slice(0,40-o.length);return /^[A-Za-z_]/.test(i)||(i=`_${i.slice(0,39-o.length)}`),`${i}${o}`}function sk(e){if(e===null)return false;if(e.startsWith("#"))return ir(e.slice(1))!==null;let t=chunkZOZI27AW_cjs.U(e);return t?.ok===true&&t.href.length>0}function lk(e,t){if(e!==void 0&&e.startsWith("#")){let o=ir(e.slice(1)),i=ir(t)??o;return i===null?null:`#${i}`}let n=e===void 0?null:chunkZOZI27AW_cjs.U(e),r=ir(t);return n?.ok===true&&n.href.length>0?r===null?n.href:`${n.href.split("#")[0]}#${r}`:r===null?null:`#${r}`}function ck(){let e=null;return (t,n,r)=>{if(e!==null&&e.html===t&&e.key===n){let a=e.value;return e=null,a}let o=r(),i={html:t,key:n,value:o};return e=i,globalThis.setTimeout(()=>{e===i&&(e=null);},0),o}}var oH=/^(ftn|edn)([1-9]\d{0,9})$/i,iH={footnote:"ftn",endnote:"edn"};function dk(e,t){let n=e===null?null:oH.exec(e);if(!n||n[1].toLowerCase()!==iH[t])return null;let r=Number.parseInt(n[2],10);return r<=2147483647?r:null}function Sm(e){for(let t of ["footnote","endnote"]){let n=e.get(`mso-${t}-id`),r=dk(n??null,t);if(r!==null)return {kind:t,id:r}}return null}function aH(e,t){let n=t.get("mso-element")?.trim().toLowerCase();if(n!=="footnote"&&n!=="endnote")return null;let r=dk(e.getAttribute("id"),n);return r===null?null:{kind:n,id:r}}function uk(e){let t=[],n=e.getElementsByTagName("div");for(let r=0;r<n.length&&t.length<2048;r+=1){let o=n[r],i=aH(o,xt(o));i!==null&&t.push({...i,element:o});}return t}function fk(e,t,n){let r=new Map(t.map(a=>[a.element,a])),o=a=>{let s=a.parentElement;for(let l=0;s!==null&&l<128;l+=1){let c=r.get(s);if(c!==void 0)return c;s=s.parentElement;}return null},i=e.getElementsByTagName("a");for(let a=0;a<i.length&&a<2e4;a+=1){let s=i[a],l=Sm(xt(s));if(l===null)continue;let c=o(s);c!==null&&c.kind===l.kind&&c.id===l.id||n[l.kind].add(l.id);}}function pk(e){let t=e.get("mso-element")?.trim().toLowerCase();return t==="footnote-list"||t==="endnote-list"}var sH=/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(footnote|endnote)Reference w:id="(\d{1,10})"\/><\/w:r>/g;function wa(e,t,n){return e.replace(sH,(r,o,i)=>{let a=`${o}:${i}`;return t.has(a)?n?.get(a)??"":r})}function wm(e,t){let n="";for(let[r,o]of t)n+=`<w:${e} w:id="${r}">${o.join("")}</w:${e}>`;return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${e}s xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">${n}</w:${e}s>`}function mk(e,t,n,r){let o=new Set,i={footnote:new Set,endnote:new Set},a=()=>{i.footnote.clear(),i.endnote.clear();let s=[],l=(c,d)=>{o.has(`${c}:${d}`)||!e.notes[c].has(d)||i[c].has(d)||(i[c].add(d),s.push({kind:c,id:d}));};for(let c of ["footnote","endnote"])for(let d of e.bodyNoteRefs[c])l(c,d);for(let c of o)for(let d of e.noteNoteRefs.get(c)??[])l(d.kind,d.id);for(;s.length>0;){let c=s.pop();for(let d of e.noteNoteRefs.get(`${c.kind}:${c.id}`)??[])l(d.kind,d.id);}};for(;;){a();let s=false;for(let l of ["footnote","endnote"]){for(let c of e.notes[l].keys()){let d=`${l}:${c}`;if(!(i[l].has(c)||o.has(d))){o.add(d),s=true;break}}if(s)break}if(!s)break}if(o.size>0)for(let s of ["footnote","endnote"])for(let[l,c]of e.notes[s])o.has(`${s}:${l}`)||e.notes[s].set(l,c.map(d=>wa(d,o,e.noteMarkFallbacks)));for(let s of ["footnote","endnote"])for(let[l,c]of [...e.notes[s]]){if(!o.has(`${s}:${l}`))continue;e.notes[s].delete(l),t[s].delete(l);let d=new Map;for(let u of c){let f=wa(u.replace(/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(?:footnote|endnote)Ref\/><\/w:r>/g,""),o,e.noteMarkFallbacks).replace(/ r:(id|embed)="([^"]{1,32})"/g,(p,g,b)=>{let h=d.get(b);if(h===void 0){let y=e.noteRels[s].find(x=>x.id===b);if(y===void 0)return p;h=r(e,y.type,y.target,y.external),d.set(b,h);}return ` r:${g}="${h}"`});n.push(f),e.lastMarkCovered=false;}}}function km(e,t,n,r=1,o=0){let i=e.lists.get(t);if(i)return i.levels.has(o)||i.levels.set(o,{kind:n,start:r}),i.numId;let a=String(1001+e.lists.size),s={numId:a,levels:new Map([[o,{kind:n,start:r}]])};return e.lists.set(t,s),e.listsByNumId.set(a,s),a}function gk(e,t,n,r){let o=t.get("mso-list");if(o===void 0)return;let i=/\bl(\d{1,4})\s+level(\d{1,2})\b/i.exec(o);if(!i)return;let a=Math.min(Math.max(Number.parseInt(i[2],10)-1,0),8),s=lH(e,n),l=/\blfo(\d{1,4})\b/i.exec(o),c=(l!==null?n.listDefinitions.get(`l${i[1]}:level${i[2]}:lfo${l[1]}`):void 0)??n.listDefinitions.get(`l${i[1]}:level${i[2]}`),d,u;c!==void 0?(d=c.kind,u=nk(s,d)??c.start??1):{kind:d,start:u}=ok(s);let p=`mso:${r===void 0?"":`${r.kind}${r.id}:`}l${i[1]}${l?`:lfo${l[1]}`:""}`;return {numId:km(n,p,d,u,a),ilvl:a}}function lH(e,t){let n="",r=(o,i)=>{if(!(n.length>0||i>8||t.nodesLeft<=0)&&Sa(o)){if(_d(o)){n=(o.textContent??"").slice(0,16);return}for(let a of Array.from(o.childNodes))r(a,i+1);}};for(let o of Array.from(e.childNodes))r(o,0);return n}var cH="http://schemas.openxmlformats.org/package/2006/relationships",dH="http://schemas.openxmlformats.org/package/2006/content-types",uH="application/vnd.openxmlformats-package.relationships+xml",Pm='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',fH="http://schemas.openxmlformats.org/wordprocessingml/2006/main",Rm="http://schemas.openxmlformats.org/officeDocument/2006/relationships",pH="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",mH="http://schemas.openxmlformats.org/drawingml/2006/main",gH="http://schemas.openxmlformats.org/drawingml/2006/picture",hH="http://schemas.openxmlformats.org/officeDocument/2006/math",hk={document:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml",numbering:"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",footnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml",endnotes:"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml"};function Im(e){let t=e.map(n=>`<Relationship Id="${chunkZOZI27AW_cjs.W(n.id)}" Type="${chunkZOZI27AW_cjs.W(n.type)}" Target="${chunkZOZI27AW_cjs.W(n.target)}"${n.external?' TargetMode="External"':""}/>`).join("");return `${Pm}<Relationships xmlns="${cH}">${t}</Relationships>`}function yH(e){let t=new Map;t.set("word/document.xml",chunkZOZI27AW_cjs._d(e.documentXml)),t.set("word/_rels/document.xml.rels",chunkZOZI27AW_cjs._d(Im(e.rels))),t.set("_rels/.rels",chunkZOZI27AW_cjs._d(Im([{id:"rId1",type:`${Rm}/officeDocument`,target:"word/document.xml",external:false}])));let n=[["numbering",e.numberingXml],["footnotes",e.footnotesXml],["endnotes",e.endnotesXml]],r=`<Override PartName="/word/document.xml" ContentType="${hk.document}"/>`;for(let[i,a]of n)a!==void 0&&(t.set(`word/${i}.xml`,chunkZOZI27AW_cjs._d(a)),r+=`<Override PartName="/word/${i}.xml" ContentType="${hk[i]}"/>`);for(let[i,a]of [["footnotes",e.footnotesRels],["endnotes",e.endnotesRels]])a!==void 0&&a.length>0&&t.set(`word/_rels/${i}.xml.rels`,chunkZOZI27AW_cjs._d(Im(a)));for(let[i,a]of e.media)t.set(i,a);let o=`<Default Extension="rels" ContentType="${uH}"/><Default Extension="xml" ContentType="application/xml"/>`;for(let[i,a]of e.mediaExtensions)o+=`<Default Extension="${chunkZOZI27AW_cjs.W(i)}" ContentType="${chunkZOZI27AW_cjs.W(a)}"/>`;return t.set("[Content_Types].xml",chunkZOZI27AW_cjs._d(`${Pm}<Types xmlns="${dH}">${o}${r}</Types>`)),chunkZOZI27AW_cjs.Zd(t)}function yk(e){let t=[...e.rels],n=o=>{t.push({id:`rId${t.length+1}`,type:`${Rm}/${o}`,target:`${o}.xml`,external:false});};e.lists.length>0&&n("numbering");for(let o of ["footnote","endnote"])e.notes[o].size>0&&n(`${o}s`);let r=`${Pm}<w:document xmlns:w="${fH}" xmlns:r="${Rm}" xmlns:wp="${pH}" xmlns:a="${mH}" xmlns:pic="${gH}" xmlns:m="${hH}"><w:body>${e.blocks.join("")}</w:body></w:document>`;return yH({documentXml:r,rels:t,...e.lists.length>0?{numberingXml:ak(e.lists)}:{},...e.notes.footnote.size>0?{footnotesXml:wm("footnote",e.notes.footnote),footnotesRels:e.noteRels.footnote}:{},...e.notes.endnote.size>0?{endnotesXml:wm("endnote",e.notes.endnote),endnotesRels:e.noteRels.endnote}:{},media:e.media,mediaExtensions:e.mediaExtensions})}function Jr(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(!(r!==9&&(r<32||r===65534||r===65535))){if(r>=55296&&r<=56319){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(t+=e[n]+e[n+1],n+=1);continue}r>=56320&&r<=57343||(t+=e[n]);}}return t}function Rr(e){let t="";if(e.rStyle!==void 0&&(t+=`<w:rStyle w:val="${chunkZOZI27AW_cjs.W(e.rStyle)}"/>`),e.font!==void 0){let a=chunkZOZI27AW_cjs.W(Jr(e.font));t+=e.rtl?`<w:rFonts w:cs="${a}"/>`:`<w:rFonts w:ascii="${a}" w:hAnsi="${a}"/>`;}e.bold?t+="<w:b/>":e.bold===false&&(t+='<w:b w:val="0"/>'),e.italic?t+="<w:i/>":e.italic===false&&(t+='<w:i w:val="0"/>'),e.caps?t+="<w:caps/>":e.caps===false&&(t+='<w:caps w:val="0"/>'),e.smallCaps?t+="<w:smallCaps/>":e.smallCaps===false&&(t+='<w:smallCaps w:val="0"/>'),e.doubleStrike?t+="<w:dstrike/>":e.strike?t+="<w:strike/>":e.strike===false&&(t+='<w:strike w:val="0"/>'),e.color!==void 0&&(t+=`<w:color w:val="${e.color}"/>`),e.charSpacingTwentieths!==void 0&&(t+=`<w:spacing w:val="${e.charSpacingTwentieths}"/>`),e.szHalfPoints!==void 0&&(t+=`<w:sz w:val="${e.szHalfPoints}"/>`),e.highlight!==void 0&&(t+=`<w:highlight w:val="${chunkZOZI27AW_cjs.W(e.highlight)}"/>`),e.underline?t+=`<w:u w:val="${e.underlineVal??"single"}"${e.underlineColor===void 0?"":` w:color="${e.underlineColor}"`}/>`:e.underline===false&&(t+='<w:u w:val="none"/>'),e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.vertAlign!==void 0&&(t+=`<w:vertAlign w:val="${e.vertAlign}"/>`),e.rtl&&(t+="<w:rtl/>");let n=e.langVal,r=e.langEastAsia,o=e.langBidi;e.lang!==void 0&&(e.rtl?o??=e.lang:/^(?:zh|ja|ko)(?:-|$)/i.test(e.lang)?r??=e.lang:n??=e.lang);let i=`${n===void 0?"":` w:val="${chunkZOZI27AW_cjs.W(n)}"`}${r===void 0?"":` w:eastAsia="${chunkZOZI27AW_cjs.W(r)}"`}${o===void 0?"":` w:bidi="${chunkZOZI27AW_cjs.W(o)}"`}`;return i.length>0&&(t+=`<w:lang${i}/>`),t.length>0?`<w:rPr>${t}</w:rPr>`:""}function Bd(e,t){return `<w:r>${Rr(t)}<w:t xml:space="preserve">${chunkZOZI27AW_cjs.V(Jr(e))}</w:t></w:r>`}function bH(e){let t="";if(e.styleId!==void 0&&(t+=`<w:pStyle w:val="${chunkZOZI27AW_cjs.W(e.styleId)}"/>`),e.keepNext&&(t+="<w:keepNext/>"),e.keepLines&&(t+="<w:keepLines/>"),e.pageBreakBefore&&(t+="<w:pageBreakBefore/>"),e.widowControl&&(t+="<w:widowControl/>"),e.numPr&&(t+=`<w:numPr><w:ilvl w:val="${e.numPr.ilvl}"/><w:numId w:val="${chunkZOZI27AW_cjs.W(e.numPr.numId)}"/></w:numPr>`),e.borders!==void 0){let a="";for(let s of ["top","left","bottom","right"]){let l=e.borders[s];l!==void 0&&(a+=`<w:${s} w:val="${l.val}" w:sz="${l.szEighthPoints}" w:space="0" w:color="${l.color}"/>`);}a.length>0&&(t+=`<w:pBdr>${a}</w:pBdr>`);}if(e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.tabs!==void 0&&e.tabs.length>0&&(t+=`<w:tabs>${e.tabs.map(a=>`<w:tab w:val="${a.val}" w:pos="${a.posTwips}"`+(a.leader===void 0?"/>":` w:leader="${a.leader}"/>`)).join("")}</w:tabs>`),e.bidi&&(t+="<w:bidi/>"),e.spacingBeforeTwips!==void 0||e.spacingAfterTwips!==void 0||e.lineTwentieths!==void 0){let a="<w:spacing";e.spacingBeforeTwips!==void 0&&(a+=` w:before="${e.spacingBeforeTwips}"`),e.spacingAfterTwips!==void 0&&(a+=` w:after="${e.spacingAfterTwips}"`),e.lineTwentieths!==void 0&&(a+=` w:line="${e.lineTwentieths}" w:lineRule="${e.lineRule??"auto"}"`),t+=`${a}/>`;}let n=e.firstLineTwips,[r,o]=e.bidi?[e.indRightTwips,e.indLeftTwips]:[e.indLeftTwips,e.indRightTwips];if(r!==void 0||o!==void 0||n!==void 0){let a="<w:ind";r!==void 0&&(a+=` w:left="${r}"`),o!==void 0&&(a+=` w:right="${o}"`),n!==void 0&&(a+=n>=0?` w:firstLine="${n}"`:` w:hanging="${-n}"`),t+=`${a}/>`;}let i=e.jc==="start"?"left":e.jc==="end"?"right":e.bidi&&(e.jc==="left"||e.jc==="right")?e.jc==="left"?"right":"left":e.jc;return i!==void 0&&(t+=`<w:jc w:val="${i}"/>`),t.length>0?`<w:pPr>${t}</w:pPr>`:""}function vi(e,t){return `<w:p>${bH(e)}${t.join("")}</w:p>`}var vk={h1:64,h2:52,h3:44,h4:36,h5:32,h6:28};function $d(e){let t=e[e.length-1];if(t?.endsWith("</w:p>")){e[e.length-1]=`${t.slice(0,-6)}<w:r><w:br w:type="page"/></w:r></w:p>`;return}e.push('<w:p><w:r><w:br w:type="page"/></w:r></w:p>');}var vH=/^(?:<w:bookmark(?:Start|End)\b[^>]*\/>)+$/,bk=new WeakMap;function Tm(e){let t=bk.get(e);for(t||(t={checked:0,furniture:true},bk.set(e,t));t.furniture&&t.checked<e.length;)t.furniture=vH.test(e[t.checked]),t.checked+=1;return t.furniture}var xi=32;function $n(e){return e.left<=0?(e.truncated=true,false):(e.left-=1,e.visited+=1,true)}var xk=Object.freeze({});function Sk(e,t){let n={...t};return e.bold!==void 0&&(n.bold=e.bold),e.italic!==void 0&&(n.italic=e.italic),e.color!==void 0&&(n.color=e.color),e.highlight!==void 0&&(n.highlight=e.highlight),e.shdFill!==void 0&&(n.shdFill=e.shdFill),e.szHalfPoints!==void 0&&(n.szHalfPoints=e.szHalfPoints),n}function xH(e){return e.replace(/ /g," ").replace(/[⁡-⁤]/g,"").replace(/[ \t\r\n\f\v]+/g," ")}function eo(e,t,n){let r=chunkZOZI27AW_cjs.V(Jr(xH(e)));if(r.length===0)return "";let i=n.uprightUnlessItalic===true&&n.italic!==true?n.bold?"b":"p":n.bold?"bi":null,a=t.length>0?t:i?`<m:sty m:val="${i}"/>`:"",s=Rr({...n.color!==void 0?{color:n.color}:{},...n.highlight!==void 0?{highlight:n.highlight}:{},...n.shdFill!==void 0?{shdFill:n.shdFill}:{},...n.szHalfPoints!==void 0?{szHalfPoints:n.szHalfPoints}:{}});return `<m:r>${a.length>0?`<m:rPr>${a}</m:rPr>`:""}${s}<m:t xml:space="preserve">${r}</m:t></m:r>`}var SH=512,wk=new Set(["\u2211","\u220F","\u2210","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"]),wH=new Map([["^","\u0302"],["\u02C6","\u0302"],["\u0302","\u0302"],["~","\u0303"],["\u02DC","\u0303"],["\u0303","\u0303"],["\u02D9","\u0307"],["\u0307","\u0307"],["\xA8","\u0308"],["\u0308","\u0308"],["\u2192","\u20D7"],["\u20D7","\u20D7"],["\xB4","\u0301"],["`","\u0300"],["\u02C7","\u030C"],["\u02D8","\u0306"]]),kk=new Set(["\xAF","\u203E","_","\u2015","\u2014","\u0305","-"]),Ik=new Map([["(",")"],["[","]"],["{","}"],["|","|"],["\u2016","\u2016"],["\u27E8","\u27E9"],["\u2329","\u232A"],["\u230A","\u230B"],["\u2308","\u2309"]]),kH=new Set(["annotation","annotation-xml","none","mprescripts","mspace","maligngroup","malignmark","mphantom"]),IH=new Set(["msub","msup","msubsup","munder","mover","munderover"]);function to(e){return e.localName.toLowerCase()}function dl(e){return Array.from(e.children)}function Po(e){return (e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim().slice(0,SH)}function Si(e){return chunkZOZI27AW_cjs.W(Jr(e))}function We(e,t){return t.length>0?`<m:${e}>${t}</m:${e}>`:`<m:${e}/>`}function Rk(e,t){let n=t,r=e.getAttribute("mathcolor")?.trim()??"",o=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(r)?.[1];if(o!==void 0){let a=o.length===3?o.replace(/./g,s=>s+s):o;n={...n,color:a.toUpperCase()};}let i=e.getAttribute("mathvariant")?.trim().toLowerCase();return (i==="bold"||i==="bold-italic")&&(n={...n,bold:true}),n}function cl(e){if(e===void 0||to(e)!=="mo")return null;let t=Po(e);return [...t].length===1?t:null}var Em=class{constructor(t){this.state=t;}state;node(t,n,r){if(n>xi)return this.state.truncated=true,"";if(!$n(this.state))return "";let o=to(t),i=Rk(t,r),a=dl(t),s=l=>a[l]?this.node(a[l],n+1,i):"";if(kH.has(o))return "";switch(o){case "semantics":return s(0);case "mi":return this.identifier(t,i);case "mn":case "mo":return eo(Po(t),"",i);case "mtext":return eo(Po(t),"<m:nor/>",i);case "ms":return eo(`"${Po(t)}"`,"<m:nor/>",i);case "msub":return `<m:sSub>${We("e",s(0))}${We("sub",s(1))}</m:sSub>`;case "msup":return `<m:sSup>${We("e",s(0))}${We("sup",s(1))}</m:sSup>`;case "msubsup":return `<m:sSubSup>${We("e",s(0))}${We("sub",s(1))}${We("sup",s(2))}</m:sSubSup>`;case "mfrac":return this.fraction(t,s(0),s(1));case "msqrt":return `<m:rad><m:radPr><m:degHide m:val="1"/></m:radPr><m:deg/>${We("e",this.row(a,n+1,i))}</m:rad>`;case "mroot":return `<m:rad>${We("deg",s(1))}${We("e",s(0))}</m:rad>`;case "munder":return this.under(a[1],s(0),s(1));case "mover":return this.over(t,a[1],s(0),s(1));case "munderover":return `<m:limUpp>${We("e",`<m:limLow>${We("e",s(0))}${We("lim",s(1))}</m:limLow>`)}${We("lim",s(2))}</m:limUpp>`;case "mfenced":return this.fenced(t,a,n,i);case "menclose":return `<m:borderBox>${We("e",this.row(a,n+1,i))}</m:borderBox>`;case "mtable":return this.table(a,n,i);case "mmultiscripts":return this.multiscripts(a,n,i);default:return this.row(a,n+1,i)}}identifier(t,n){let r=Po(t),o=t.getAttribute("mathvariant")?.trim().toLowerCase(),i="";return o==="normal"||o===void 0&&[...r].length>1?i='<m:sty m:val="p"/>':o==="bold"?i='<m:sty m:val="b"/>':o==="bold-italic"&&(i='<m:sty m:val="bi"/>'),eo(r,i,n)}fraction(t,n,r){let o=t.getAttribute("linethickness")?.trim().toLowerCase(),i=t.getAttribute("bevelled")?.trim().toLowerCase()==="true",a=o!==void 0&&/^0(?:\.0*)?(?:px|pt|em|ex|%)?$/.test(o)?"noBar":i?"skw":null;return `<m:f>${a===null?"":`<m:fPr><m:type m:val="${a}"/></m:fPr>`}${We("num",n)}${We("den",r)}</m:f>`}under(t,n,r){let o=cl(t);return o!==null&&kk.has(o)?`<m:bar><m:barPr><m:pos m:val="bot"/></m:barPr>${We("e",n)}</m:bar>`:`<m:limLow>${We("e",n)}${We("lim",r)}</m:limLow>`}over(t,n,r,o){let i=cl(n);if(i!==null&&kk.has(i))return `<m:bar><m:barPr><m:pos m:val="top"/></m:barPr>${We("e",r)}</m:bar>`;let a=i===null?void 0:wH.get(i);return a!==void 0||i!==null&&t.getAttribute("accent")?.trim()==="true"?`<m:acc><m:accPr><m:chr m:val="${Si(a??i)}"/></m:accPr>${We("e",r)}</m:acc>`:`<m:limUpp>${We("e",r)}${We("lim",o)}</m:limUpp>`}fenced(t,n,r,o){let i=[...t.getAttribute("open")??"("].slice(0,1).join(""),a=[...t.getAttribute("close")??")"].slice(0,1).join(""),s=[...(t.getAttribute("separators")??",").trim()][0]??"",l=n.map(c=>We("e",this.node(c,r+1,o)));return `<m:d><m:dPr><m:begChr m:val="${Si(i)}"/>${s.length>0?`<m:sepChr m:val="${Si(s)}"/>`:""}<m:endChr m:val="${Si(a)}"/></m:dPr>${l.join("")||"<m:e/>"}</m:d>`}table(t,n,r){let o="";for(let i of t){if(!$n(this.state))break;let a=to(i);if(a!=="mtr"&&a!=="mlabeledtr")continue;let s=dl(i).slice(a==="mlabeledtr"?1:0);o+="<m:mr>"+s.map(l=>We("e",to(l)==="mtd"?this.row(dl(l),n+2,r):this.node(l,n+2,r))).join("")+"</m:mr>";}return o.length>0?`<m:m>${o}</m:m>`:""}multiscripts(t,n,r){let o=c=>c===void 0||to(c)==="none"?"":this.node(c,n+1,r),i=t.findIndex(c=>to(c)==="mprescripts"),a=i<0?t.slice(1):t.slice(1,i),s=i<0?[]:t.slice(i+1),l=o(t[0]);return a.length>0&&(l=`<m:sSubSup>${We("e",l)}${We("sub",o(a[0]))}${We("sup",o(a[1]))}</m:sSubSup>`),s.length>0?`<m:sPre>${We("sub",o(s[0]))}${We("sup",o(s[1]))}${We("e",l)}</m:sPre>`:l}nary(t,n,r,o){let i=to(t),a=dl(t),s=Po(i==="mo"?t:a[0]),l=g=>a[g]?this.node(a[g],r+1,o):"",c="",d="";i==="msub"||i==="munder"?c=l(1):i==="msup"||i==="mover"?d=l(1):(i==="msubsup"||i==="munderover")&&(c=l(1),d=l(2));let u=i==="munder"||i==="mover"||i==="munderover"?"undOvr":"subSup",f=`<m:chr m:val="${Si(s)}"/><m:limLoc m:val="${u}"/>${c.length===0?'<m:subHide m:val="1"/>':""}${d.length===0?'<m:supHide m:val="1"/>':""}`,p=n?this.node(n,r+1,o):"";return `<m:nary><m:naryPr>${f}</m:naryPr>${We("sub",c)}${We("sup",d)}${We("e",p)}</m:nary>`}isNary(t){let n=to(t);if(n==="mo")return wk.has(Po(t));if(!IH.has(n))return false;let r=t.children[0];return r!==void 0&&wk.has(cl(r)??"")}row(t,n,r){if(n>xi)return this.state.truncated=true,"";let o=cl(t[0]),i=cl(t[t.length-1]);if(t.length>=2&&o!==null&&i!==null&&Ik.has(o)&&[...Ik.values()].includes(i)){let l=this.row(t.slice(1,-1),n+1,r);return `<m:d><m:dPr><m:begChr m:val="${Si(o)}"/><m:endChr m:val="${Si(i)}"/></m:dPr>${We("e",l)}</m:d>`}let a="";for(let s=0;s<t.length;s+=1){let l=t[s];if(this.isNary(l)){let c=t[s+1];a+=this.nary(l,c,n,r),c!==void 0&&(s+=1);continue}a+=this.node(l,n,r);}return a}};function Cm(e){return to(e)==="math"}function Pk(e){return e.getAttribute("display")?.trim().toLowerCase()==="block"||e.getAttribute("mode")?.trim().toLowerCase()==="display"}function Tk(e,t,n){return new Em(t).row(dl(e),1,Rk(e,n))}var RH="acc accPr aln alnScr argPr argSz bar barPr baseJc begChr borderBox borderBoxPr box boxPr brk brkBin brkBinSub cGp cGpRule chr count cSp ctrlPr d defJc deg degHide den diff dispDef dPr e endChr eqArr eqArrPr f fName fPr func funcPr groupChr groupChrPr grow hideBot hideLeft hideRight hideTop interSp intLim intraSp jc lim limLoc limLow limLowPr limUpp limUppPr lit lMargin m mathFont mathPr maxDist mc mcJc mcPr mcs mPr mr nary naryLim naryPr noBreak nor num objDist oMath oMathPara oMathParaPr opEmu phant phantPr plcHide pos postSp preSp r rad radPr rMargin rPr rSp rSpRule scr sepChr show shp smallFrac sPre sPrePr sSub sSubPr sSubSup sSubSupPr sSup sSupPr strikeBLTR strikeH strikeTLBR strikeV sty sub subHide sup supHide t transp type vertJc wrapIndent wrapRight zeroAsc zeroDesc zeroWid".split(" "),Ck=new Map(RH.map(e=>[`m:${e.toLowerCase()}`,e])),PH=new Set(["oMath","e","num","den","sub","sup","deg","lim","fName"]),TH=512,EH=512,CH=64,OH=64,MH=2,AH=256,Ek=/^\[if\s+gte\s+msEquation\b[^\]]*\]>([\s\S]*)<!\[endif\]$/i,FH=/^\[if\s+!msEquation\s*\]$/i,LH=/^\[if\b[^\]]*\]$/i,DH=/^\[endif\]$/i,NH=Object.freeze({byElement:new Map,visited:0,truncated:false});function Ok(e){return /<m:omath|msEquation|<math[\s>]/i.test(e)}function ul(e){return e.nodeType===1?Ck.get(tt(e)):void 0}function Mk(e,t,n,r){if(!(n>xi||!$n(t))){if(e.nodeType===3){r.push(e.nodeValue??"");return}if(!(e.nodeType!==1||tt(e)==="o:p"))for(let o of Array.from(e.childNodes))Mk(o,t,n+1,r);}}function Om(e,t){return Sk(bi(ll({},tt(e)),e),t)}function HH(e,t,n,r){let o="",i=[],a=r;for(let s of Array.from(e.childNodes)){let l=ul(s);if(l==="rPr")o+=qd(s,"rPr",t,n+1,r);else {if(s.nodeType===1&&tt(s)==="w:rpr")continue;s.nodeType===1&&l===void 0&&(a=Om(s,a)),Mk(s,t,n+1,i);}}return eo(i.join(""),o,a)}function qd(e,t,n,r,o){let i="",a="",s=PH.has(t);for(let l of Array.from(e.childNodes)){if(l.nodeType===3){if(!$n(n))break;s&&(a+=l.nodeValue??"");continue}l.nodeType===1&&(a.trim().length>0&&(i+=eo(a,"",o)),a="",i+=Ak(l,t,n,r+1,o));}return a.trim().length>0&&(i+=eo(a,"",o)),i}function Ak(e,t,n,r,o){if(r>xi)return n.truncated=true,"";if(!$n(n))return "";let i=Ck.get(tt(e));if(i===void 0)return tt(e)==="o:p"?"":qd(e,t,n,r,Om(e,o));if(i==="ctrlPr"||i==="oMathPara"||i==="oMath")return "";if(i==="r"||i==="t")return HH(e,n,r,o);let a=e.getAttribute("m:val"),s=a!==null&&a.length<=CH?` m:val="${chunkZOZI27AW_cjs.W(Jr(a))}"`:"",l=qd(e,i,n,r,o);return l.length>0?`<m:${i}${s}>${l}</m:${i}>`:`<m:${i}${s}/>`}function Fk(e,t,n){if(!$n(t))return null;let r=qd(e,"oMath",t,1,n);return r.length>0?`<m:oMath>${r}</m:oMath>`:null}function Lk(e,t,n,r,o){if(!(n>xi||!$n(t)))for(let i of Array.from(e.children)){let a=ul(i);if(a==="oMath"){let s=Fk(i,t,r);s!==null&&o.equations.push(s);}else a==="oMathParaPr"&&o.properties.length===0?o.properties=Ak(i,"oMathPara",t,n+1,r):a===void 0&&Lk(i,t,n+1,Om(i,r),o);}}function _H(e){let t=ul(e);return t==="oMath"||t==="oMathPara"||Cm(e)}function BH(e){let t=0;for(let n=e.parentElement;n!==null;n=n.parentElement)if((t+=1)>AH||_H(n))return true;return false}function $H(e,t){if(typeof e.createTreeWalker!="function")return;let n=e.createTreeWalker(e.body,128),r=[];for(let o=n.nextNode();o!==null;o=n.nextNode()){if(!$n(t))return;let i=o.data;if(/<m:omath|<math[\s>]/i.test(i)&&Ek.test(i)){if(r.length>=EH){t.truncated=true;break}r.push(o);}}for(let o of r){let i=Ek.exec(o.data)?.[1]??"",a;try{a=new DOMParser().parseFromString(i,"text/html");}catch{continue}let s=o.parentNode;if(!(s===null||a.body===null)){for(let l of Array.from(a.body.childNodes))s.insertBefore(e.importNode(l,true),o);s.removeChild(o);}}}function qH(e){return e.nodeType===3?(e.nodeValue??"").replace(/[\s ]/g,"").length>0:e.nodeType===1||e.nodeType===8}function WH(e){let t=e;for(let n=0;n<=MH;n+=1){let r=t.nextSibling;for(;r!==null&&!qH(r);)r=r.nextSibling;if(r!==null){if(r.nodeType!==8||!FH.test(r.data.trim()))return;let a=[r],s=1;for(let l=r.nextSibling;l!==null&&a.length<=OH;l=l.nextSibling)if(a.push(l),l.nodeType===8){let c=l.data.trim();if(DH.test(c)?s-=1:LH.test(c)&&(s+=1),s===0){for(let d of a)d.parentNode?.removeChild(d);return}}return}let o=t.parentElement;if(o===null||ul(o)!==void 0)return;let i=tt(o);if(i!=="span"&&i!=="i"&&i!=="b"&&i!=="font")return;t=o;}}function jH(e,t){let n=e.getElementsByTagName("i").length>0?{uprightUnlessItalic:true}:xk;if(Cm(e)){if(!$n(t))return null;let r=Tk(e,t,n);return r.length===0?null:Pk(e)?`<m:oMathPara><m:oMath>${r}</m:oMath></m:oMathPara>`:`<m:oMath>${r}</m:oMath>`}if(ul(e)==="oMathPara"){let r={properties:"",equations:[]};return Lk(e,t,1,n,r),r.equations.length===0?null:`<m:oMathPara>${r.properties}${r.equations.join("")}</m:oMathPara>`}return Fk(e,t,n)}function Dk(e,t){if(e.body===null||t<=0)return NH;let n={left:t,visited:0,truncated:false};$H(e,n);let r=new Map,o=[];for(let i of ["m:omathpara","m:omath","math"]){let a=e.body.getElementsByTagName(i);for(let s=0;s<a.length;s+=1){if(o.length>=TH){n.truncated=true;break}if(!$n(n))break;let l=a[s];BH(l)||o.push(l);}}for(let i of o){if(n.left<=0){n.truncated=true;break}let a=jH(i,n);a===null||n.truncated||(r.set(i,[a]),WH(i));}return {byElement:r,visited:n.visited,truncated:n.truncated}}function Mm(e){return e.startsWith("<m:oMath>")||e.startsWith("<m:oMathPara>")}function ar(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var To=31680;function no(e,t,n){return Math.min(n,Math.max(t,e))}function Nk(e){let t=At(xt(e).get("width")??"");if(t!==null&&t>0)return t;let n=e.getAttribute("width")?.trim();if(n===void 0||!/^\d{1,6}(\.\d+)?$/.test(n))return null;let r=Number.parseFloat(n);return Number.isFinite(r)&&r>0?r*.75:null}function KH(e){return wi(e,"colspan",63)}function Hk(e){return Array.from(e.children).flatMap(t=>{let n=tt(t);return n==="tr"?[t]:n!=="thead"&&n!=="tbody"&&n!=="tfoot"?[]:Array.from(t.children).filter(r=>tt(r)==="tr")})}function wi(e,t,n){let r=e.getAttribute(t);return r===null||!/^\d{1,4}$/.test(r.trim())?1:no(Number.parseInt(r,10),1,n)}function _k(e,t){let n=(xt(e).get("width")??e.getAttribute("width")??"").trim(),r=/^(\d{1,3}(?:\.\d+)?)%$/.exec(n);if(r)return {xml:`<w:tblW w:w="${no(Math.round(Number.parseFloat(r[1])*50),50,5e3)}" w:type="pct"/>`,twips:t};let o=Nk(e);if(o===null)return {xml:'<w:tblW w:w="0" w:type="auto"/>',twips:t};let i=no(Math.round(o*20),1,To);return {xml:`<w:tblW w:w="${i}" w:type="dxa"/>`,twips:i}}function Bk(e){let n=xt(e).get("mso-table-left")?.trim().toLowerCase(),r=(n==="left"||n==="center"||n==="right"?n:void 0)??e.getAttribute("align")?.trim().toLowerCase();return r==="left"||r==="center"||r==="right"?r:void 0}function $k(e){let t=xt(e),n=t.get("mso-table-anchor-horizontal")?.trim().toLowerCase(),r=t.get("mso-table-anchor-vertical")?.trim().toLowerCase();if(n===void 0&&r===void 0)return "";let o=l=>l==="margin"||l==="page"?l:"text",i=` w:horzAnchor="${o(n)}" w:vertAnchor="${o(r)}"`,a=t.get("mso-table-left")?.trim().toLowerCase();if(a==="left"||a==="center"||a==="right")i+=` w:tblpXSpec="${a}"`;else {let l=At(a??"");l!==null&&(i+=` w:tblpX="${no(Math.round(l*20),-To,To)}"`);}let s=At(t.get("mso-table-top")??"");return s!==null&&(i+=` w:tblpY="${no(Math.round(s*20),-To,To)}"`),`<w:tblpPr${i}/>`}function qk(e,t,n){let r=Math.max(1,Math.floor(n/t)),o=-1,i=Array.from({length:t},()=>r),a=new Array(t).fill(null);for(let d of e){let u=Array.from({length:t},()=>r),f=0,p=0,g=a.map(y=>y?y.span:null);for(let y=0;y<t;y+=1){let x=a[y];x&&(x.remaining-=1,x.remaining<=0&&(a[y]=null));}let b=Array.from(d.children).filter(y=>/^t[dh]$/.test(tt(y))),h=0;for(;p<t;){let y=g[p];if(y!==null){p+=y;continue}let x=b[h];if(x===void 0)break;h+=1;let v=Math.min(KH(x),t-p);for(let C=p+1;C<p+v;C+=1)if(g[C]!==null){v=C-p;break}let S=wi(x,"rowspan",1e3);S>1&&(a[p]={remaining:S-1,span:v});let I=Nk(x);if(I!==null){let C=no(Math.round(I*20/v),1,To);for(let P=0;P<v;P+=1)u[p+P]=C;f+=v;}p+=v;}f>o&&(o=f,i=u);}let s=i.reduce((d,u)=>d+u,0);if(s<=0)return i;let l=i.map(d=>Math.max(1,Math.round(d*n/s))),c=n-l.reduce((d,u)=>d+u,0);return l[l.length-1]=Math.max(1,l[l.length-1]+c),l}function Am(e,t,n){let r=0;for(let o=0;o<n;o+=1)r+=e[t+o]??0;return Math.max(1,r)}var Wk=new Map([["solid","single"],["double","double"],["dotted","dotted"],["dashed","dashed"],["none","nil"],["hidden","nil"]]),jk=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function Kk(e){return no(Math.round(e*8),2,96)}function Pr(e){if(e===void 0||e.length===0||e.length>128)return;let t,n,r;for(let o of bm(e)){let i=Wk.get(o.toLowerCase());if(i!==void 0){t=i;continue}let a=jk.get(o.toLowerCase())??At(o);if(a!==null){n=a;continue}let s=Ro(o);if(s!==null){r=s;continue}return}if(t!==void 0){if(t==="nil")return {val:t,size:0,color:r??"auto"};if(n===void 0)return {val:t,size:4,color:r??"000000"};if(!(n<=0))return {val:t,size:Kk(n),color:r??"000000"}}}function Wd(e,t){let n=e.get(`${t}-style`)?.trim();if(n===void 0||n.length===0||n.length>64)return;let r=Wk.get(n.split(/\s+/)[0].toLowerCase());if(r===void 0)return;if(r==="nil")return {val:r,size:0,color:"auto"};let o=e.get(`${t}-width`)?.trim().split(/\s+/)[0],i=o===void 0||o.length>64?null:jk.get(o.toLowerCase())??At(o);if(i!==null&&i<=0)return;let a=e.get(`${t}-color`)?.trim().split(/\s+/)[0],s=a===void 0||a.length>64?null:Ro(a);return {val:r,size:i===null?4:Kk(i),color:s??"000000"}}function Vk(e,t){return `<w:${e} w:val="${t.val}" w:sz="${t.size}" w:space="0" w:color="${t.color}"/>`}function Uk(e,t=false){let n=xt(e),o=Pr(n.get("mso-border-alt"))??Pr(n.get("border"))??Wd(n,"border")??(e.getAttribute("border")?.trim()&&e.getAttribute("border")?.trim()!=="0"?{val:"single",size:4,color:"auto"}:void 0),i=[["top","top"],["left","left"],["bottom","bottom"],["right","right"],["insideH","insideh"],["insideV","insidev"]],a="";for(let[s,l]of i){let c=ar(l,t),d=Pr(n.get(`mso-border-${c}-alt`))??Pr(n.get(`mso-border-${c}`))??Pr(n.get(`border-${c}`))??Wd(n,`border-${c}`)??o;d!==void 0&&(a+=Vk(s,d));}return a.length>0?`<w:tblBorders>${a}</w:tblBorders>`:""}function zk(e){let t=xt(e),n=At(t.get("height")??"");if(n===null||n<=0)return "";let r=no(Math.round(n*20),1,To),i=t.get("mso-height-rule")?.trim().toLowerCase()==="exactly"?"exact":"atLeast";return `<w:trPr><w:trHeight w:val="${r}" w:hRule="${i}"/></w:trPr>`}function VH(e,t){let n={top:null,right:null,bottom:null,left:null},r=e.get("padding");if(r!==void 0&&r.length<=128){let i=r.trim().split(/\s+/).map(a=>At(a));if(i.length>=1&&i.length<=4&&!i.some(a=>a===null||a<0)){let[a,s=a,l=a,c=s]=i.length===2?[i[0],i[1],i[0],i[1]]:i.length===3?[i[0],i[1],i[2],i[1]]:i;n.top=a??null,n.right=s??null,n.bottom=l??null,n.left=c??null;}}for(let i of ["top","right","bottom","left"]){let a=At(e.get(`padding-${i}`)??"");a!==null&&a>=0&&(n[i]=a);}let o="";for(let i of ["top","left","bottom","right"]){let a=ar(i,t),s=n[a];s!==null&&(o+=`<w:${i} w:w="${no(Math.round(s*20),0,To)}" w:type="dxa"/>`);}return o.length>0?`<w:tcMar>${o}</w:tcMar>`:""}function Gk(e,t=false){let n=xt(e),r=Pr(n.get("mso-border-alt"))??Pr(n.get("border"))??Wd(n,"border"),o="";for(let l of ["top","left","bottom","right"]){let c=ar(l,t),d=Pr(n.get(`mso-border-${c}-alt`))??Pr(n.get(`mso-border-${c}`))??Pr(n.get(`border-${c}`))??Wd(n,`border-${c}`)??r;d!==void 0&&(o+=Vk(l,d));}let i=o.length>0?`<w:tcBorders>${o}</w:tcBorders>`:"",a=Hd(n);a&&(i+=`<w:shd w:val="clear" w:color="auto" w:fill="${a}"/>`),i+=VH(n,t);let s=n.get("vertical-align")?.toLowerCase()??e.getAttribute("valign")?.toLowerCase();return s==="top"?i+='<w:vAlign w:val="top"/>':s==="middle"||s==="center"?i+='<w:vAlign w:val="center"/>':s==="bottom"&&(i+='<w:vAlign w:val="bottom"/>'),i}var UH=9360;function Zk(e,t,n,r,o,i){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;for(let P of Array.from(e.children))tt(P)==="caption"&&i(Array.from(P.childNodes),t+1,n,r,o,true);let a=Hk(e);if(a.length===0)return;let s=1,l=r.nodesLeft,c=[];for(let P of a){if(l<=0||s>=63)break;let E=c.map(O=>O?O.span:null);for(let O=0;O<c.length;O+=1){let B=c[O];B&&(B.remaining-=1,B.remaining<=0&&(c[O]=null));}let R=Array.from(P.children).filter(O=>/^t[dh]$/.test(tt(O))),w=0,M=0;for(;M<63&&(l-=1,!(l<=0));){let O=M<E.length?E[M]:null;if(O!=null){M+=O;continue}let B=R[w];if(B===void 0)break;w+=1;let q=Math.min(wi(B,"colspan",63),63-M);for(let z=M+1;z<M+q;z+=1)if(z<E.length&&E[z]!=null){q=z-M;break}let j=wi(B,"rowspan",1e3);if(j>1){for(;c.length<=M;)c.push(null);c[M]={remaining:j-1,span:q};}M+=q;}for(let O=M;O<E.length&&O<63;O+=1){let B=E[O];B!=null&&(M=Math.max(M,O+B));}s=Math.max(s,M);}s=Math.min(Math.max(s,1),63);let d=_k(e,UH),u=d.twips,f=a.length>r.nodesLeft?a.slice(0,Math.max(1,r.nodesLeft)):a,p=qk(f,s,u),b=(xt(e).get("direction")??e.getAttribute("dir"))?.trim().toLowerCase()==="rtl",h=Uk(e,b),y=$k(e),x=Bk(e)??(b?"left":void 0),v=x===void 0?"":`<w:jc w:val="${ar(x,b)}"/>`,S=p.map(P=>`<w:gridCol w:w="${P}"/>`).join(""),I=new Array(s).fill(null),C=[];for(let P of a){if(r.nodesLeft<=0){r.truncated=true;break}r.nodesLeft-=1;let E=I.map(q=>q?q.span:null);for(let q=0;q<s;q+=1){let j=I[q];j&&(j.remaining-=1,j.remaining<=0&&(I[q]=null));}let R=Array.from(P.children).filter(q=>/^t[dh]$/.test(tt(q))),w=0,M=[],O=0,B=true;for(;O<s;){if(r.nodesLeft-=1,r.nodesLeft<=0){r.truncated=true,B=false;break}let q=E[O];if(q!==null){let L=q>1?`<w:gridSpan w:val="${q}"/>`:"";M.push(`<w:tc><w:tcPr><w:tcW w:w="${Am(p,O,q)}" w:type="dxa"/>${L}<w:vMerge/></w:tcPr><w:p/></w:tc>`),O+=q;continue}let j=R[w];if(j===void 0){M.push(`<w:tc><w:tcPr><w:tcW w:w="${p[O]}" w:type="dxa"/></w:tcPr><w:p/></w:tc>`),O+=1;continue}w+=1;let z=Math.min(wi(j,"colspan",63),s-O);for(let L=O+1;L<O+z;L+=1)if(E[L]!==null){z=L-O;break}let _=wi(j,"rowspan",1e3);_>1&&(I[O]={remaining:_-1,span:z}),M.push(zH(j,z,Am(p,O,z),_>1,t,n,r,i,b)),O+=z;}if(!B)break;C.push(`<w:tr>${zk(P)}${M.join("")}</w:tr>`);}C.length!==0&&(o.push(`<w:tbl><w:tblPr>${b?"<w:bidiVisual/>":""}${y}${d.xml}${v}${h}</w:tblPr><w:tblGrid>${S}</w:tblGrid>${C.join("")}</w:tbl>`),r.lastMarkCovered=false);}function zH(e,t,n,r,o,i,a,s,l){let c=tt(e)==="th",d=`<w:tcW w:w="${n}" w:type="dxa"/>`;t>1&&(d+=`<w:gridSpan w:val="${t}"/>`),r&&(d+='<w:vMerge w:val="restart"/>'),d+=Gk(e,l);let u={run:c?{...i.run,bold:true}:i.run,para:c?{jc:"center"}:{},paragraphMarkCovered:false,pre:false,list:null,...i.noteBody?{noteBody:i.noteBody}:{},...i.rels?{rels:i.rels}:{}},f=[];return s(Array.from(e.childNodes),o+2,u,a,f,true),(f.length===0||f[f.length-1].endsWith("</w:tbl>"))&&f.push("<w:p/>"),`<w:tc><w:tcPr>${d}</w:tcPr>${f.join("")}</w:tc>`}function Xk(e){if(e===void 0)return "";let t=e.trim();return /^\d{1,4}$/.test(t)?"<w:tab/>".repeat(Math.min(Number.parseInt(t,10),64)):""}function Yk(e){let t=e.getAttribute("alignment")?.trim().toLowerCase(),n=e.getAttribute("relativeto")?.trim().toLowerCase(),r=e.getAttribute("leader")?.trim().toLowerCase();return t!=="left"&&t!=="center"&&t!=="right"||n!=="margin"&&n!=="indent"||r!=="none"&&r!=="dot"&&r!=="hyphen"&&r!=="underscore"&&r!=="middledot"?"":`<w:ptab w:alignment="${t}" w:relativeTo="${n}" w:leader="${r==="middledot"?"middleDot":r}"/>`}function Qk(e){if(tt(e)!=="br")return false;let t=xt(e);return t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page"}function Jk(e){if(Qk(e))return true;if(tt(e)!=="span"||e.childNodes.length>8)return false;let t=false;for(let n=0;n<e.childNodes.length;n+=1){let r=e.childNodes[n];if(!(r.nodeType===3&&(r.nodeValue??"").trim().length===0)){if(r.nodeType!==1||t||!Qk(r))return false;t=true;}}return t}function eI(e){if(tt(e)!=="p")return false;let t=null;for(let o=0;o<e.childNodes.length;o+=1){let i=e.childNodes[o];if(i.nodeType===3){if((i.nodeValue??"").replace(/[\s\u00a0]/g,"").length===0)continue;return false}if(i.nodeType!==1||t!==null)return false;t=i;}if(t===null)return false;let n=xt(e);for(let o of n.keys())if(o==="background"||o==="background-color"||o.startsWith("border"))return false;if(tt(t)!=="o:p"||t.childNodes.length>3)return false;let r="";for(let o=0;o<t.childNodes.length;o+=1){let i=t.childNodes[o];if(i.nodeType!==3)return false;r+=i.nodeValue??"";}return r.includes("\xA0")&&r.replace(/[\s\u00a0]/g,"").length===0}function Fm(e){let t=0,n=e.parentElement;for(;n!==null&&t<256;)t+=1,n=n.parentElement;return t}var Lm=new Set("script style head template iframe object embed noscript svg math meta link title base select textarea hr w:sdtpr".split(" ")),Dm=new Set("p div h1 h2 h3 h4 h5 h6 li blockquote pre".split(" ")),Nm=new Set("thead tbody tfoot tr section article main header footer aside nav figure form body html".split(" ")),GH=new Set([...Dm,...Nm,"table","ol","ul","w:sdt"]);function Hm(e){for(let t=0;t<e.children.length;t+=1)if(GH.has(tt(e.children[t])))return true;return false}var ZH=new Set(["p","div","table","ol","ul","section","article","main","h1","h2","h3","h4","h5","h6"]);function tI(e){if(tt(e)!=="w:sdt")return null;let t=[e],n=0;for(let r=0;r<t.length&&n<64;r+=1){let o=t[r];for(let i=0;i<o.children.length&&n<64;i+=1){let a=o.children[i];n+=1;let s=tt(a);if(ZH.has(s))return Array.from(e.childNodes);s!=="w:sdtpr"&&t.push(a);}}return null}var XH=4*1024*1024,YH=1e5,QH=64,JH=2*1024*1024,nI="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function _m(e,t,n,r,o=e.rels){let i=`rId${o.length+1}`;return o.push({id:i,type:t,target:n,external:r}),i}function jd(e,t,n,r,o){if(o.nodesLeft<=0){o.truncated=true;return}if(t>o.maxDepth)return;if(o.nodesLeft-=1,e.nodeType===3){let b=e.nodeValue??"";if(n.pre){let y=b.replace(/\r\n?/g,`
4
- `).split(`
5
- `);for(let x=0;x<y.length;x+=1){if(x>0){if(o.nodesLeft-=1,o.nodesLeft<=0){o.truncated=true;return}r.push(`<w:r>${Rr(n.run)}<w:br/></w:r>`);}let v=y[x];v.length>0&&r.push(Bd(v,n.run));}return}let h=b.replace(/[ \t\r\n\f\v]+/g," ");if(h.length===0||h===" "&&Tm(r))return;r.push(Bd(h,n.run));return}if(!Sa(e))return;let i=o.equations.get(e);if(i!==void 0){for(let b of i)r.push(b);return}let a=tt(e);if(Lm.has(a))return;let s=xt(e);if(_d(e)&&n.para.numPr!==void 0||s.get("mso-element")?.trim().toLowerCase()==="comment-reference"||s.get("mso-special-character")?.trim().toLowerCase()==="comment"||e.classList.contains("msocomanchor")||o.definedNoteElements.has(e))return;if(a==="w:ptab"){let b=Yk(e);b.length>0&&r.push(`<w:r>${Rr(n.run)}${b}</w:r>`);return}let c=Xk(s.get("mso-tab-count"));if(c.length>0){if(o.nodesLeft-=c.split("<w:tab/>").length-2,o.nodesLeft<=0){o.truncated=true;return}let b=vm(ll(n.run,a),s);if(r.push(`<w:r>${Rr(b)}${c}</w:r>`),(e.textContent??"").trim().length===0&&e.children.length===0)return}if(a==="br"){let b=s.get("page-break-before")?.trim().toLowerCase()==="always"||s.get("break-before")?.trim().toLowerCase()==="page";r.push(`<w:r>${Rr(n.run)}${b?'<w:br w:type="page"/>':"<w:br/>"}</w:r>`);return}if(a==="img"){Yw(e,r,o,b=>_m(o,`${nI}/image`,b,false,n.rels??o.rels));return}let d=ll(n.run,a),u=a==="a"?e.getAttribute("href"):null,f=a==="a"?Sm(s):null;f===null&&sk(u)&&(d={...d,rStyle:"Hyperlink"});let p=bi(d,e),g={...n,run:p,pre:n.pre||a==="pre"};if(f!==null){let b={...g.run,vertAlign:"superscript"};if(n.noteBody!==void 0&&n.noteBody.kind===f.kind&&n.noteBody.id===f.id){let h=f.kind==="footnote"?"footnoteRef":"endnoteRef";r.push(`<w:r>${Rr(b)}<w:${h}/></w:r>`);return}if(o.definedNotes[f.kind].has(f.id)){let h=f.kind==="footnote"?"footnoteReference":"endnoteReference";r.push(`<w:r>${Rr(b)}<w:${h} w:id="${f.id}"/></w:r>`);let y=(e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim(),x=`${f.kind}:${f.id}`;if(y.length>0&&!o.noteMarkFallbacks.has(x)&&o.noteMarkFallbacks.set(x,Bd(y,b)),n.noteBody===void 0)o.bodyNoteRefs[f.kind].add(f.id);else {let v=`${n.noteBody.kind}:${n.noteBody.id}`,S=o.noteNoteRefs.get(v)??[];S.push({kind:f.kind,id:f.id}),o.noteNoteRefs.set(v,S);}return}for(let h of Array.from(e.childNodes))jd(h,t+1,g,r,o);return}if(a==="a"){let b=e.getAttribute("href"),h=ir(e.getAttribute("name")||e.getAttribute("id")),y=[];for(let S of Array.from(e.childNodes))jd(S,t+1,g,y,o);let x=b?.startsWith("#")?ir(b.slice(1)):null,v=y.join("");if(x!==null)v=`<w:hyperlink w:anchor="${chunkZOZI27AW_cjs.W(x)}">${v}</w:hyperlink>`;else if(b!==null&&!b.startsWith("#")){let S=chunkZOZI27AW_cjs.U(b);S.ok&&S.href.length>0&&(v=`<w:hyperlink r:id="${_m(o,`${nI}/hyperlink`,S.href,true,n.rels??o.rels)}">${v}</w:hyperlink>`);}if(h!==null){let S=String(o.nextBookmarkId++);v=`<w:bookmarkStart w:id="${S}" w:name="${chunkZOZI27AW_cjs.W(h)}"/>${v}<w:bookmarkEnd w:id="${S}"/>`;}v.length>0&&r.push(v);return}for(let b of Array.from(e.childNodes))jd(b,t+1,g,r,o);}function rI(e,t,n,r){let o=tt(e),i=xt(e),a={};r&&(a.pageBreakBefore=true);let s=Kw(e,n.wordHtml);s!==void 0&&(a.styleId=s),t.para.numPr&&(a.numPr=t.para.numPr),t.para.jc&&(a.jc=t.para.jc),t.para.bidi&&(a.bidi=true);let l={...t.run},c=vk[o];c!==void 0&&s===void 0&&!e.classList.contains("docx-outline")&&(l.bold=true,l.szHalfPoints=c);let d=t.pre||o==="pre";o==="pre"&&(l.font="Courier New");let u=gk(e,i,n,t.noteBody);return u&&(a.numPr=u),Gw(a,e,n.classAlignments),Zw(a,i),l=bi(l,e),e.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(a.bidi=true),{run:l,para:a,paragraphMarkCovered:a.styleId!==void 0||a.numPr!==void 0,pre:d,list:t.list,...t.noteBody?{noteBody:t.noteBody}:{},...t.rels?{rels:t.rels}:{}}}function oI(e,t,n,r,o,i=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;let a=rI(e,n,r,i);Eo(Array.from(e.childNodes),t+1,a,r,o,true,void 0,false);}function iI(e,t,n,r,o,i=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;let a=ik(e);n.list||(r.semanticListCount+=1);let s=n.list?{numId:n.list.numId,level:Math.min(n.list.level+1,8)}:{numId:km(r,`sem:${r.semanticListCount}`,a,xm(e)),level:0};if(n.list){let d=r.listsByNumId.get(s.numId);d!==void 0&&!d.levels.has(s.level)&&d.levels.set(s.level,{kind:a,start:xm(e)});}let l={...n,list:s,para:{numPr:{numId:s.numId,ilvl:s.level}}},c=i;for(let d of Array.from(e.childNodes)){if(r.nodesLeft<=0){r.truncated=true;break}if(!Sa(d))continue;let u=tt(d);if(u==="li")r.nodesLeft-=1,oI(d,t+1,l,r,o,c),c=false;else if(u==="ol"||u==="ul"){let f=o.length;iI(d,t+1,{...n,list:s},r,o,c),o.length>f&&(c=false);}}}function Eo(e,t,n,r,o,i=false,a,s=true){if(t>r.maxDepth)return;let l=o.length,c=a===void 0,d=[],u=[],f=n.para,p=a??{pending:false,skipSpacer:false},g=()=>({...f,pageBreakBefore:void 0,numPr:void 0}),b=()=>{if(d.length===0)return;if(!d.some(y=>y.includes("<w:r")||Mm(y))){if(o.length===l){u=u.concat(d),d=[];return}let y=o[o.length-1];y?.endsWith("</w:p>")?(o[o.length-1]=`${y.slice(0,-6)}${d.join("")}</w:p>`,d=[]):y!==void 0&&d.length>0&&(o.push(vi(g(),d)),d=[],r.lastMarkCovered=false);return}let h=p.pending?{...f,pageBreakBefore:true}:f;o.push(vi(h,d)),f.pageBreakBefore&&(f={...f,pageBreakBefore:void 0}),p.pending=false,p.skipSpacer=false,r.lastMarkCovered=n.paragraphMarkCovered,d=[];};for(let h of e){if(r.nodesLeft<=0){r.truncated=true;break}if(Sa(h)){let y=tt(h),x=y==="w:sdt"?tI(h):null;if(s&&Jk(h)){b(),r.nodesLeft-=1,p.pending&&$d(o),p.pending=true,p.skipSpacer=true;continue}if(Lm.has(y)&&!r.equations.has(h)){r.nodesLeft-=1;continue}let v=xt(h);if(v.get("mso-element")?.trim().toLowerCase()==="comment-list"){r.nodesLeft-=1;continue}if(pk(v)){b(),r.nodesLeft-=1,Eo(Array.from(h.childNodes),t+1,n,r,o,false,p,s);continue}if(r.definedNoteElements.has(h)){r.nodesLeft-=1;continue}if(Dm.has(y)){if(b(),r.nodesLeft-=1,p.pending&&p.skipSpacer&&eI(h)){p.skipSpacer=false;continue}if(y==="div"&&Hm(h)){let I=rI(h,n,r,false);I.para.pageBreakBefore&&(p.pending=true),Eo(Array.from(h.childNodes),t+1,I,r,o,false,p,s);continue}let S=o.length;oI(h,t,n,r,o,p.pending),o.length>S&&(p.pending=false,p.skipSpacer=false);continue}if(y==="ol"||y==="ul"){b();let S=o.length;iI(h,t,n,r,o,p.pending),o.length>S&&(p.pending=false,p.skipSpacer=false);continue}if(y==="table"){b(),p.pending&&$d(o),e2(h,t,n,r,o),p.pending=false,p.skipSpacer=false;continue}if(Nm.has(y)||x!==null||y==="span"&&Hm(h)){b(),r.nodesLeft-=1,Eo(x??Array.from(h.childNodes),t+1,n,r,o,false,p,s);continue}}if(h.nodeType===3&&/^[\s\u00a0]+$/.test(h.nodeValue??"")&&Tm(d)){r.nodesLeft-=1;continue}jd(h,t,n,d,r);}if(i&&o.length===l&&d.length>0&&!d.some(h=>h.includes("<w:r")||Mm(h))&&(o.push(vi(f,d)),d=[],r.lastMarkCovered=n.paragraphMarkCovered),b(),u.length>0){let h=o[l];h!==void 0&&h.startsWith("<w:p>")?o[l]=h.replace(/^(<w:p>(?:<w:pPr>(?:(?!<\/w:pPr>)[\s\S])*?<\/w:pPr>)?)/,`$1${u.join("")}`):h!==void 0?o.splice(l,0,vi(g(),u)):d=u.concat(d),u=[];}d.length>0&&(o.push(vi(g(),d)),d=[],r.lastMarkCovered=false),c&&p.pending&&($d(o),p.pending=false,p.skipSpacer=false,r.lastMarkCovered=false),i&&o.length===l&&(o.push(vi(f,d)),d=[],r.lastMarkCovered=n.paragraphMarkCovered);}function e2(e,t,n,r,o){Zk(e,t,n,r,o,Eo);}function t2(e,t){return yk({blocks:t,rels:e.rels,lists:[...e.lists.values()],notes:e.notes,noteRels:e.noteRels,media:e.media,mediaExtensions:e.mediaExtensions})}function n2(e,t){let n=t.maxHtmlBytes??XH;if(e.length>n)return {ok:false,reason:"too-large"};if(e.length*3>n&&new TextEncoder().encode(e).byteLength>n)return {ok:false,reason:"too-large"};if(typeof DOMParser>"u")return {ok:false,reason:"parse-unavailable"};let r;try{r=new DOMParser().parseFromString(e,"text/html");}catch{return {ok:false,reason:"parse-unavailable"}}let o=r.body;if(!o)return {ok:false,reason:"no-content"};let i=t.maxNodes??YH,a=Ok(e)?Dk(r,i):null,s=uk(r),l={footnote:new Set,endnote:new Set},c=new Set,d={footnote:new Set,endnote:new Set};fk(r,s,d);let u={nodesLeft:i-(a?.visited??0),maxDepth:t.maxDepth??QH,maxImageBytes:t.maxImageBytes??JH,wordHtml:jw(e),truncated:false,lastMarkCovered:false,rels:[],media:new Map,mediaExtensions:new Map,mediaBySrc:new Map,lists:new Map,listsByNumId:new Map,semanticListCount:0,imageCount:0,docPrId:0,nextBookmarkId:1,classAlignments:Uw(r),listDefinitions:tk(zw(r)),notes:{footnote:new Map,endnote:new Map},noteRels:{footnote:[],endnote:[]},definedNotes:l,bodyNoteRefs:{footnote:new Set,endnote:new Set},noteNoteRefs:new Map,noteMarkFallbacks:new Map,definedNoteElements:c,equations:a?.byElement??new Map},f={};f=bi(f,r.documentElement),f=bi(f,o);let p={run:f,para:f.rtl?{bidi:true}:{},paragraphMarkCovered:false,pre:false,list:null},g=[];for(let v of s)d[v.kind].has(v.id)&&(l[v.kind].has(v.id)||(l[v.kind].add(v.id),c.add(v.element),g.push(v)));g.sort((v,S)=>Fm(S.element)-Fm(v.element)),u.lastMarkCovered=false;let b=[];Eo(Array.from(o.childNodes),0,p,u,b);let h=u.lastMarkCovered,y=u.truncated,x=false;for(let v=0;v<g.length;v+=1){let S=g[v];u.truncated=false;let I=u.nodesLeft,C=[];if(Eo(Array.from(S.element.childNodes),0,{...p,noteBody:{kind:S.kind,id:S.id},rels:u.noteRels[S.kind]},u,C,true),u.truncated||C.length===0){x=true;let P=new Set;for(let E=v;E<g.length;E+=1){let R=g[E];l[R.kind].delete(R.id),c.delete(R.element),u.notes[R.kind].delete(R.id),u.bodyNoteRefs[R.kind].delete(R.id),P.add(`${R.kind}:${R.id}`);}if(P.size>0){for(let E=0;E<b.length;E+=1)b[E]=wa(b[E],P,u.noteMarkFallbacks);for(let E of ["footnote","endnote"])for(let[R,w]of u.notes[E])u.notes[E].set(R,w.map(M=>wa(M,P,u.noteMarkFallbacks)));}u.nodesLeft=I;for(let E=v;E<g.length&&u.nodesLeft>0;E+=1)Eo(Array.from(g[E].element.childNodes),0,p,u,b);break}u.notes[S.kind].set(S.id,C);}return u.truncated=y||x,u.lastMarkCovered=h,mk(u,l,b,_m),b.length===0?{ok:false,reason:"no-content"}:{ok:true,projection:u,blocks:b}}var r2=ck();function aI(e,t){let n=`${t.maxHtmlBytes??""}:${t.maxNodes??""}:${t.maxDepth??""}:${t.maxImageBytes??""}`;return r2(e,n,()=>n2(e,t))}function sI(e,t={}){let n=aI(e,t);return n.ok?{ok:true,fragmentBytes:t2(n.projection,n.blocks),lastMarkCovered:n.projection.lastMarkCovered,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:n}function lI(e,t={}){let n=aI(e,t);return n.ok?{lands:true,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:{lands:false,imageCount:0,truncated:false}}var o2={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function cI(e){return e.replace(/&(#x[0-9a-fA-F]+|#\d+|[a-zA-Z]+);/g,(t,n)=>{if(n.startsWith("#")){let r=n.startsWith("#x")?Number.parseInt(n.slice(2),16):Number.parseInt(n.slice(1),10);return !Number.isFinite(r)||r<0||r>1114111||r>=55296&&r<=57343?t:String.fromCodePoint(r)}return o2[n.toLowerCase()]??t})}var i2=new Set(["script","style","title","template"]),a2=new Set(["p","div","li","tr","h1","h2","h3","h4","h5","h6","blockquote","section","article","pre","table"]),s2=new Set(["td","th"]),dI=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),l2=e=>dI(e)||e!==void 0&&e>="0"&&e<="9",uI=e=>e===" "||e===" "||e===`
6
- `||e==="\r"||e==="\f";function c2(e,t){let n=t+1,r=e[n]==="/";if(r&&(n+=1),!dI(e[n]))return null;let o=n;for(;n<e.length&&l2(e[n]);)n+=1;let i=e.slice(o,n).toLowerCase(),a="",s=false;for(;n<e.length;){let l=e[n];if(a!=="")l===a&&(a="");else if(l==="=")s=true;else if(s&&(l==='"'||l==="'"))a=l,s=false;else {if(l===">")return {name:i,closing:r,end:n+1};uI(l)||(s=false);}n+=1;}return {name:i,closing:r,end:e.length}}function d2(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===9;)t-=1;return t===e.length?e:e.slice(0,t)}function u2(e,t,n){for(let r=n;r<e.length;){let o=e.indexOf("</",r);if(o===-1)return e.length;let i=o+2;if(e.slice(i,i+t.length).toLowerCase()===t){for(i+=t.length;i<e.length&&uI(e[i]);)i+=1;if(e[i]===">")return i+1}r=o+2;}return e.length}function*fI(e){let t=0;for(;t<e.length;){let n=e.indexOf("<",t);if(n===-1){yield e.slice(t);break}if(n>t&&(yield e.slice(t,n)),e.startsWith("<!--",n)){if(e[n+4]===">"){t=n+5;continue}if(e[n+4]==="-"&&e[n+5]===">"){t=n+6;continue}let o=e.indexOf("-->",n+4);t=o===-1?e.length:o+3;continue}if(e[n+1]==="!"||e[n+1]==="?"){let o=e.indexOf(">",n+1);t=o===-1?e.length:o+1;continue}let r=c2(e,n);if(r===null){yield "<",t=n+1;continue}t=r.end,!r.closing&&i2.has(r.name)?t=u2(e,r.name,r.end):!r.closing&&r.name==="br"?yield `
7
- `:r.closing&&s2.has(r.name)?yield " ":r.closing&&a2.has(r.name)&&(yield `
8
- `);}}function f2(e){let t=e.length>2e6?e.slice(0,2e6):e,n="";for(let r of fI(t))n+=r;return cI(n).replace(/\r\n?/g,`
9
- `).split(`
10
- `).map(d2).join(`
11
- `).replace(/\n{3,}/g,`
12
-
13
- `).trim()}function pI(e){let t="";for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r===12){t+=`
14
- `;continue}if(r===13){t+=`
15
- `,e.charCodeAt(n+1)===10&&(n+=1);continue}if(r===9||r===10){t+=e[n];continue}if(!(r<32||r===65534||r===65535)){if(r>=55296&&r<=56319){let o=e.charCodeAt(n+1);o>=56320&&o<=57343&&(t+=e[n]+e[n+1],n+=1);continue}r>=56320&&r<=57343||(t+=e[n]);}}return t}var mI=/[^\s\u200B-\u200F\u2060\u2066-\u2069\u061C\uFEFF\u00AD]/;function gI(e){return mI.test(e)}function Bm(e){let t=e.length>2e6?e.slice(0,2e6):e;for(let n of fI(t)){let r=n.includes("&")?cI(n):n;if(mI.test(r))return true}return false}function $m(e){if(!e)return "";let t=e.getData("text/plain");if(t.length>0)return t;let n=e.getData("text/html");return n.length>0?f2(n):""}function qm(e,t){if(typeof e.getData!="function")return "";try{return e.getData(t)??""}catch{return ""}}function p2(e){if(!e)return false;if(gI(qm(e,"text/plain")))return true;let t=qm(e,"text/html");if(t.length===0)return false;if(Bm(t))return true;let n=xa(t);return n!==null&&n.bytes[0]===80&&n.bytes[1]===75?true:lI(t).imageCount>0}function m2(e){return e?Bm(qm(e,"text/html")):false}var g2="popup,width=1000,height=900",hI=["class","style","data-theme","data-color-mode","dir","lang"];async function h2(e={}){let t=globalThis.window;if(!t?.open)return null;let n=e.url??"about:blank",r=t.open(n,e.name??"docx-editor",e.features??g2);if(!r)return null;n!=="about:blank"&&await y2(r);let o=r.document;e.title&&(o.title=e.title),o.body.style.margin="0";let i=o.createElement("div");i.style.height="100vh",o.body.append(i);let a=e.styles??true,s=a===false?()=>{}:a===true?bI(t.document,o):a(t.document,o),l=new Set,c=false,d=()=>{if(!c){c=true,r.removeEventListener("pagehide",d),t.removeEventListener("pagehide",u),s();for(let f of [...l])try{f();}catch(p){console.error(p);}l.clear();}},u=()=>{d(),r.close();};return r.addEventListener("pagehide",d),t.addEventListener("pagehide",u),{window:r,element:i,onClose(f){return l.add(f),()=>l.delete(f)},close:u}}function y2(e){return new Promise(t=>{let n=false,r=()=>{n||(n=true,t());};e.addEventListener("load",r,{once:true});try{e.document.readyState==="complete"&&e.location.href!=="about:blank"&&r();}catch{}})}function bI(e,t){let n=new Map,r=b=>{if(n.has(b))return;let h=t.importNode(b,true),y=b.sheet;b.localName==="style"&&y&&!(b.textContent??"").trim()&&(h.textContent=Wm(y)),t.head.append(h),n.set(b,h);},o=b=>b.nodeType===1&&(b.localName==="style"||b.localName==="link"&&(b.getAttribute("rel")??"").split(/\s+/).includes("stylesheet"));for(let b of Array.from(e.querySelectorAll('link[rel~="stylesheet"], style')))r(b);let i=t.createElement("style");i.dataset.docxAdopted="",t.head.append(i);let a="",s=()=>{let b=e.adoptedStyleSheets??[],h=b.map(y=>yI(y)).join(",");h!==a&&(a=h,i.textContent=b.map(Wm).join(`
16
- `));};s();let l=()=>{for(let b of hI){let h=e.documentElement.getAttribute(b);h===null?t.documentElement.removeAttribute(b):t.documentElement.setAttribute(b,h);}};l();let c=new Map,d=()=>{for(let[b,h]of n){let y=b.sheet;if(b.localName!=="style"||!y)continue;let x=yI(y);if(c.get(b)===x)continue;let v=!c.has(b);c.set(b,x),v||(h.textContent=Wm(y));}s();};d();let u=t.defaultView?.setInterval(d,b2),f=()=>{u!==void 0&&t.defaultView?.clearInterval(u);},p=e.defaultView?.MutationObserver;if(typeof p!="function")return f;let g=new p(b=>{for(let h of b){if(h.type==="attributes"){l();continue}for(let x of Array.from(h.addedNodes))if(o(x))r(x);else if(x.nodeType===1)for(let v of Array.from(x.querySelectorAll("style, link")))o(v)&&r(v);for(let x of Array.from(h.removedNodes)){let v=n.get(x);v&&(n.delete(x),v.parentNode?.removeChild(v));}let y=h.target;if(h.type==="characterData"||y.localName==="style"&&n.has(y)){let x=h.type==="characterData"?h.target.parentNode:y,v=x&&n.get(x);v&&(v.textContent=x.textContent);}}});return g.observe(e.head,{childList:true,subtree:true,characterData:true}),g.observe(e.documentElement,{attributes:true,attributeFilter:hI}),()=>{g.disconnect(),f();}}var b2=250;function yI(e){try{return e.cssRules.length}catch{return -1}}function Wm(e){try{return Array.from(e.cssRules,t=>t.cssText).join(`
17
- `)}catch{return ""}}function fl(e){if(e){if(e.nodeType===9)return e;if(e.ownerDocument)return e.ownerDocument}return globalThis.document}function je(e){return fl(e)?.defaultView??globalThis}var vI=new WeakMap;function xI(e,t){vI.set(e,t);}function v2(e){return ro(e)}function ro(e){return vI.get(e)?.()??null}function SI(e){let t=e.ownerDocument?.defaultView;return t?t.closed?"attach() needs an element in an open window; this window has closed":null:"attach() needs an element in a document with a window; this one has none"}function x2(e){return fl(ro(e))}function S2(e){return je(ro(e))}function _t(e){return typeof e=="object"&&e!==null&&e.nodeType===1}function Tr(e){return _t(e)&&e.namespaceURI==="http://www.w3.org/1999/xhtml"}function w2(e){return typeof e=="object"&&e!==null&&e.nodeType===3}function Co(e){return typeof e=="object"&&e!==null&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function Kd(e,t){return Tr(e)&&e.localName===t}function jm(){return globalThis}function mt(e){let t=0,n=new Map,r=new Map;function o(f,p){f.win=p,f.native=f.kind==="frame"&&typeof p.requestAnimationFrame=="function"?p.requestAnimationFrame(f.fire):p.setTimeout(()=>f.fire(p.performance?.now()??Date.now()),Math.max(0,f.dueAt-Date.now())),a(p);}function i(f){f.kind==="frame"&&typeof f.win.cancelAnimationFrame=="function"?f.win.cancelAnimationFrame(f.native):f.win.clearTimeout(f.native);}function a(f){if(r.has(f)||f===jm())return;let p=()=>{s(f);let g=je(e()),b=g===f?jm():g;for(let h of n.values())h.win===f&&(i(h),o(h,b));};f.addEventListener("pagehide",p),r.set(f,p);}function s(f){let p=r.get(f);p&&(r.delete(f),f.removeEventListener("pagehide",p));}function l(f){let p=n.get(f);if(p){n.delete(f);for(let g of n.values())if(g.win===p.win)return;s(p.win);}}function c(){if(n.size===0)return;let f=je(e());for(let p of n.values()){if(p.win===f)continue;let g=p.win;i(p),o(p,f);let b=false;for(let h of n.values())h.win===g&&(b=true);b||s(g);}}function d(f,p,g=0){c();let b=++t,h={kind:f,win:jm(),native:0,dueAt:Date.now()+g,fire:y=>{l(b),p(y);}};return n.set(b,h),o(h,je(e())),b}function u(f){if(f==null)return;let p=n.get(f);p&&(i(p),l(f));}return {setTimeout:(f,p)=>d("timeout",()=>f(),p),clearTimeout:u,requestAnimationFrame:f=>d("frame",f),cancelAnimationFrame:u,migrate:c}}function pl(e){return typeof e.key=="string"&&"repeat"in e}function Km(e){return typeof e.pointerId=="number"}function k2(e){return typeof e.button=="number"&&"clientX"in e}function Vm(e){return typeof e.inputType=="string"}var I2=Object.freeze({kind:"body"});function Ee(e,t){let n=t?.indexOf("#")??-1;if(n===-1)return null;let r=t.slice(0,n);return r.length===0?null:e.currentPackage().parts.get(r)??null}function Ct(e,t,n){let r=t?.indexOf("#")??-1;return Um(e,r===-1?"":t.slice(0,r),n)}function Um(e,t,n){if(t.length===0||t===e.part().name)return {kind:"body"};for(let r of e.headerFooterResolutionBySection())for(let o of [r.headers,r.footers])for(let i of o.values())if(i.partName===t)return {kind:"headerFooter",rId:i.rId};for(let r of ["footnote","endnote"])if(e.partFor({kind:"notesPart",noteKind:r})?.name===t)return {kind:"notesPart",noteKind:r};return n}function Vd(e,t){if(e)return {kind:"headerFooter",rId:e.scope.rId};if(t){let n=chunkZOZI27AW_cjs.tc(t.id);if(n)return {kind:"notesPart",noteKind:n.noteKind}}return {kind:"body"}}function kI(e,t){return e?e.scope:t||I2}function R2(e,t,n){if(n){let o=[];for(let i of [e.footnotes,e.endnotes])if(i)for(let a of i.notes)a.scopeId===n&&o.push(...wI(a.fragments));return o}if(!t)return chunkFDSL5OJU_cjs.Aa(e);let r=ka(e,t);return r?wI(r.fragments):[]}function ka(e,t){let n=t.kind==="header"?e.header:e.footer;if(n&&(n.rId&&n.rId===t.scope.rId||!n.rId&&n.partName===t.partName))return n}function II(e,t){for(let n of e.pages)for(let r of ["header","footer"]){let o=n[r];if(o?.rId===t)return {pageIndex:n.index,kind:r,story:o}}return null}function Ud(e,t){return !!(e.rId&&e.rId===t.scope.rId||!e.rId&&e.partName===t.partName&&e.kind===t.kind)}function zm(e,t,n){let r=chunkFDSL5OJU_cjs.he(e,t.y),o=e.pages[r];if(!o)return false;let i=t.x-n(r),a=t.y,s=o.contentBox;return i>=s.x&&i<s.x+s.width&&a>=s.y&&a<s.y+s.height}function Gm(e,t,n,r,o={}){return chunkFDSL5OJU_cjs.le(e,t,n.fragments,r,o)}function P2(e,t,n){let r=e.pages[t.pageIndex]??e.pages[0];if(!r)return null;let o=ka(r,t);return o?chunkFDSL5OJU_cjs.ye(e,t.pageIndex,o.fragments,n):null}function T2(e,t,n){let r=[];for(let o of e.pages)for(let i of [o.footnotes,o.endnotes]){let a=i?.notes.find(s=>s.scopeId===t);a&&r.push(...chunkFDSL5OJU_cjs.ye(e,o.index,a.fragments,n));}return r.length>0?r:null}function RI(e,t){return e.querySelector(`[data-page-index="${t}"] > [data-docx-hf-active]`)??e.querySelector("[data-docx-hf-active]")}function PI(e,t,n){let r=e.querySelectorAll("[data-docx-note-scope]"),o=null;for(let i of r){if(i.dataset.docxNoteScope!==t||!i.matches("[data-docx-note]"))continue;o??=i;let a=Number(i.closest("[data-page-index]")?.dataset.pageIndex);if(n!==null&&a===n)return i}return o}function TI(e,t,n){if((i=>{let a=e.pages[i];return !!a&&!!ka(a,t)})(t.pageIndex)&&(n===void 0||n.has(t.pageIndex)))return t.pageIndex;let o=null;for(let i of e.pages)if(ka(i,t)&&(o===null&&(o=i.index),n===void 0||n.has(i.index)))return i.index;return o??t.pageIndex}function EI(e){return e?{rId:e.scope.rId,pageIndex:e.pageIndex,kind:e.kind,partName:e.partName,variant:e.variant}:null}function CI(e,t,n){e.classList.toggle("docx-paginated-surface--hf-editing",n),t.classList.toggle("docx-pages--hf-editing",n);}function Zm(e,t){e.classList.toggle("docx-paginated-surface--viewing",t==="view");}function Xm(e,t,n,r,o,i,a,s){let l=o?P2(e,o,a):i?T2(e,i,a):null,c=chunkFDSL5OJU_cjs.De(e,t,n,r,{...a?{measurer:a}:{},...l?{stops:l}:{},...s!==void 0?{lineId:s}:{}});if(!c)return null;let u=(l?.find(p=>p.position.paragraphId===c.position.paragraphId&&p.position.offset===c.position.offset&&(c.lineId===void 0||p.lineId===c.lineId))??l?.find(p=>p.position.paragraphId===c.position.paragraphId&&p.position.offset===c.position.offset))?.pageIndex,f=c.lineId===void 0?null:chunkFDSL5OJU_cjs.ze(e,c.position,{...a?{measurer:a}:{},...u!==void 0?{preferredPageIndex:u}:{},preferredLineId:c.lineId});return {position:c.position,desiredX:c.desiredX,...u!==void 0?{pageIndex:u}:{},...f?{caret:f}:{}}}function zd(e,t,n){for(let r of e.pages){let o=n(r.index);for(let i of [r.footnotes,r.endnotes])if(i)for(let a of i.notes){let s=a.box,l=s.x+o,c=s.y;if(t.x>=l&&t.x<l+s.width&&t.y>=c&&t.y<c+s.height)return {pageIndex:r.index,scopeId:a.scopeId,noteKind:a.noteKind,noteId:a.noteId,local:{x:t.x-l,y:t.y-c},fragments:a.fragments}}}return null}function OI(e,t){let n=e[t],r=e.contentBox,o=e.box;if(t==="header"){let c=o.y,d=r.y,u=n?Math.max(d,n.box.y+n.box.height):d,f=n?Math.min(c,n.box.y):c;return u<=f?null:{x:r.x,y:f,width:r.width,height:u-f}}let i=r.y+r.height,a=o.y+o.height,s=n?Math.min(i,n.box.y):i,l=n?Math.max(a,n.box.y+n.box.height):a;return l<=s?null:{x:r.x,y:s,width:r.width,height:l-s}}function Ym(e,t,n){for(let r of e.pages){if(r.parityBlank)continue;let o=n(r.index);for(let i of ["header","footer"]){if(r[i])continue;let a=OI(r,i);if(!a)continue;let s=a.x+o;if(t.x>=s&&t.x<s+a.width&&t.y>=a.y&&t.y<a.y+a.height)return {pageIndex:r.index,kind:i}}}return null}function Qm(e,t,n){for(let r of e.pages){let o=n(r.index);for(let i of ["header","footer"]){let a=r[i];if(!a)continue;let s=a.box,l=OI(r,i)??s,c=l.x+o,d=l.y;if(t.x>=c&&t.x<c+l.width&&t.y>=d&&t.y<d+l.height)return {pageIndex:r.index,kind:i,story:a,local:{x:t.x-(s.x+o),y:t.y-s.y}}}}return null}function MI(e,t,n,r,o,i){let a=e.pages[t.pageIndex];if(!a)return false;let s=a.contentBox,l=n.x-r(a.index)-s.x,c=n.y-s.y;if(l<0||l>=s.width||c<0||c>=s.height)return false;let d=i?{measurer:i}:{},{story:u,local:f}=t,p=chunkFDSL5OJU_cjs.je(u.anchoredDrawings,f,a.index)!==null||chunkFDSL5OJU_cjs.le(e,a.index,u.fragments,f,d)?.onGlyphs===true;if(o&&p)return false;let g=chunkFDSL5OJU_cjs.ke(e,a.index,{x:l,y:c},d),b=zd(e,n,r),h=g?.onGlyphs===true&&g.pageIndex===a.index||b?.pageIndex===a.index&&chunkFDSL5OJU_cjs.le(e,a.index,b.fragments,b.local,d)?.onGlyphs===true;return o?h:h||!p}function Ia(e,t,n){if(!t&&!n)return chunkFDSL5OJU_cjs.Ua(e);let r=new Set,o=[];for(let i of e.pages)for(let a of R2(i,t,n)){for(let s of a.lines)for(let l of chunkFDSL5OJU_cjs.Pa(s))r.has(l.paragraphId)||(r.add(l.paragraphId),o.push(l.paragraphId));a.lines.length===0&&!r.has(a.paragraphId)&&(r.add(a.paragraphId),o.push(a.paragraphId));}return o}function Gd(e,t,n,r){let o=Ia(e,n,r);if(o.length===0)return t;let i=new Set(o),a=s=>i.has(s.paragraphId)?s:{paragraphId:o[0],offset:0};return {anchor:a(t.anchor),head:a(t.head)}}function wI(e){let t=[],n=r=>{for(let o of r){if(o.kind==="paragraph"){t.push(o);continue}for(let i of o.rows)if(!i.isHeaderRepeat)for(let a of i.cells)n(a.blocks);}};return n(e),t}function AI(e,t){for(let n of e.pages)for(let r of [n.footnotes,n.endnotes])if(r){for(let o of r.notes)for(let i of chunkFDSL5OJU_cjs.Ba(o.fragments))if(i.paragraphId===t)return o.scopeId}return null}function FI(e){return e.family.trim().length===0?"font family must not be empty":!Number.isInteger(e.weight)||e.weight<1||e.weight>1e3?"font weight must be an integer from 1 through 1000":e.style!=="normal"&&e.style!=="italic"?"font style must be normal or italic":null}function E2(e){try{return typeof caches>"u"?Promise.resolve(null):caches.open(e).catch(()=>null)}catch{return Promise.resolve(null)}}async function C2(e,t){if(!e)return null;try{let n=await e.match(t);return n?new Uint8Array(await n.arrayBuffer()):null}catch{return null}}async function O2(e,t,n){if(e)try{await e.put(t,new Response(n.slice(),{headers:{"Content-Length":String(n.byteLength)}}));}catch{}}async function M2(e,t){if(e)try{await e.delete(t);}catch{}}async function Jm(e){let t=()=>{if(e.signal?.aborted)throw e.signal.reason};t();let n=e.fetcher??fetch,r=e.maxFontBytes??chunkFDSL5OJU_cjs.a,o=await E2(e.cacheName??"docx-editor-fonts");t();async function i(c){t();let d=Object.freeze({family:c.family,weight:c.weight,style:c.style}),u=FI(d);if(u)return {failure:{url:c.url,request:d,reason:"invalidRequest",diagnostic:u}};let f=(y,x)=>{if(y.byteLength===0)return {url:c.url,request:d,reason:"emptyResponse"};if(y.byteLength>r)return {url:c.url,request:d,reason:"overLimit"};let v=chunkFDSL5OJU_cjs.l(y,c.faceIndex??0);if(!v.valid)return {url:c.url,request:d,reason:"malformed",diagnostic:v.diagnostic};let S=chunkZOZI27AW_cjs.f(y);return c.hash!==void 0&&c.hash!==S?{url:c.url,request:d,reason:"hashMismatch",expectedHash:c.hash,actualHash:S,...x?{diagnostic:"cached bytes failed revalidation"}:{}}:{request:d,id:`url:${c.url}`,bytes:y,hash:S,faceIndex:c.faceIndex??0}},p=await C2(o,c.url);if(t(),p){let y=f(p,true);if(!("reason"in y))return {source:y};await M2(o,c.url),t();}let g;try{g=e.signal?await n(c.url,{signal:e.signal}):await n(c.url),t();}catch(y){return t(),{failure:{url:c.url,request:d,reason:"networkError",diagnostic:y instanceof Error?y.message:String(y)}}}if(!g.ok)return {failure:{url:c.url,request:d,reason:"httpError",status:g.status}};let b;try{b=new Uint8Array(await g.arrayBuffer()),t();}catch(y){return t(),{failure:{url:c.url,request:d,reason:"networkError",diagnostic:y instanceof Error?y.message:String(y)}}}let h=f(b,false);return "reason"in h?{failure:h}:(await O2(o,c.url,b),t(),{source:h})}let a=await Promise.all(e.sources.map(c=>i(c)));t();let s=[],l=[];for(let c of a)"source"in c?s.push(c.source):l.push(c.failure);return {sources:s,failures:l}}function A2(e,t,n={}){let r=Object.freeze({family:t.family,weight:t.weight,style:t.style}),o=n.id??`bytes:${r.family}#${r.weight}#${r.style}`,i=FI(r);if(i)return {failure:{url:o,request:r,reason:"invalidRequest",diagnostic:i}};if(e.byteLength===0)return {failure:{url:o,request:r,reason:"emptyResponse"}};if(e.byteLength>(n.maxFontBytes??chunkFDSL5OJU_cjs.a))return {failure:{url:o,request:r,reason:"overLimit"}};let a=t.faceIndex??0,s=chunkFDSL5OJU_cjs.l(e,a);return s.valid?{source:{request:r,id:o,bytes:e,hash:chunkZOZI27AW_cjs.f(e),faceIndex:a}}:{failure:{url:o,request:r,reason:"malformed",diagnostic:s.diagnostic}}}var F2=e=>e.trim().toLowerCase(),LI=e=>JSON.stringify([F2(e.family),e.weight,e.style]);function L2(e){return chunkE4IAO4CY_cjs.j(async t=>{if(t.signal?.aborted)throw t.signal.reason;let n=new Set((t.resolvedFaces??[]).map(LI)),r=e.sources.filter(s=>!n.has(LI(s)));if(r.length===0)return {sources:[],failures:[]};let{onFailure:o,...i}=e,a=await Jm({...i,sources:r,signal:t.signal});if(t.signal?.aborted)throw t.signal.reason;for(let s of a.failures)o?o(s):console.warn(`[fonts] ${s.request.family} (${s.url}): ${s.reason}`);return a})}var D2=96,DI=37.79527559055118;function N2(e,t){if(!Number.isFinite(e)||e<=0)return [];let n=[];if(t==="inch"){let a=Math.floor(e/12);for(let s=0;s<=a;s+=1){let l=s*12;if(s%8===0){let c=s/8;n.push({position:l,height:10,...c>0?{label:String(c)}:{}});}else s%4===0?n.push({position:l,height:6}):s%2===0?n.push({position:l,height:4}):n.push({position:l,height:2});}return n}let r=DI/10,o=Math.floor(e/r);for(let i=0;i<=o;i+=1){let a=i*r;if(i%10===0){let s=i/10;n.push({position:a,height:10,...s>0?{label:String(s)}:{}});}else i%5===0?n.push({position:a,height:6}):n.push({position:a,height:3});}return n}function H2(e){let t=[...e].sort((n,r)=>n.index-r.index)[0];return t?t.box:null}var _2=1440,B2=567,$2=180,q2=56.7,NI=e=>({pageWidth:e.pageWidth,leftMargin:e.rightMargin,rightMargin:e.leftMargin}),Zd=(e,t,n)=>n<t||e<t?t:e>n?n:e;function HI(e,t,n){if(t.rtl)return n.pageWidth-HI(e,{...t,rtl:false},NI(n));switch(e){case "firstLine":return n.leftMargin+t.left+t.firstLine;case "hanging":case "left":return n.leftMargin+t.left;case "right":return n.pageWidth-n.rightMargin-t.right}}function _I(e,t,n){if(n)return Math.round(e);let r=t==="cm"?56.7:180;return Math.round(Math.round(e/r)*r)}function BI(e,t,n,r,o={}){if(n.rtl)return {...BI(e,r.pageWidth-t,{...n,rtl:false},NI(r),o),rtl:true};let i=_I(t,o.unit??"inch",o.precise??false),a=r.pageWidth-r.rightMargin-n.right,s=r.leftMargin+n.left+Math.max(0,n.firstLine);switch(e){case "firstLine":{let l=Zd(i,0,a);return {...n,firstLine:l-r.leftMargin-n.left}}case "left":{let l=-r.leftMargin-Math.min(0,n.firstLine),c=a-r.leftMargin-Math.max(0,n.firstLine);return {...n,left:Zd(i-r.leftMargin,l,c)}}case "hanging":{let l=Zd(i-r.leftMargin,-r.leftMargin,a-r.leftMargin);return {...n,left:l,firstLine:n.firstLine+(n.left-l)}}case "right":{let l=Zd(i,s,r.pageWidth);return {...n,right:r.pageWidth-r.rightMargin-l}}}}function $I(e,t){let n=e.snapshot().formatting;if(n)switch(t){case "text.color":return n.color?.kind==="hex"?n.color.value.replace(/^#/,""):void 0;case "text.highlight":return n.highlight;case "styles.style":return n.styleId;case "font.family":return n.fontFamily;case "font.size":return n.fontSizePt===void 0?void 0:String(n.fontSizePt*2);case "list.lineSpacing":return n.lineSpacing?.rule==="multiple"?String(n.lineSpacing.value):void 0;default:return}}function W2(e){if(!(!e||typeof e!="object"||"preventDefault"in e))return e}var qI="no formatting has been copied",Xd="there is nothing at the selection to copy",eg="the selection has nothing to paint",Yd=Object.freeze({mode:"off",level:"none"});function WI(e,t){let n=Math.round(t*12700),r=1143e3,o=`<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:body><w:p><w:r>
18
- <w:drawing xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
19
- <wp:anchor distT="0" distB="0" distL="91440" distR="91440" simplePos="0" relativeHeight="251658240" behindDoc="0" locked="0" layoutInCell="1" allowOverlap="1">
20
- <wp:simplePos x="0" y="0"/><wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>
21
- <wp:extent cx="${n}" cy="${r}"/><wp:effectExtent l="0" t="0" r="0" b="0"/><wp:wrapNone/><wp:docPr id="${e}" name="Text Box ${e}"/><wp:cNvGraphicFramePr/>
22
- <a:graphic><a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"><wps:wsp><wps:cNvSpPr txBox="1"/><wps:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${n}" cy="${r}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:solidFill><a:srgbClr val="FFFFFF"/></a:solidFill><a:ln w="12700"><a:solidFill><a:srgbClr val="000000"/></a:solidFill></a:ln></wps:spPr><wps:txbx><w:txbxContent><w:p/></w:txbxContent></wps:txbx><wps:bodyPr lIns="91440" rIns="91440" tIns="45720" bIns="45720" anchor="t"><a:noAutofit/></wps:bodyPr></wps:wsp></a:graphicData></a:graphic>
23
- </wp:anchor></w:drawing></w:r></w:p></w:body></w:document>`,i=chunkZOZI27AW_cjs.Ma(o,{name:"/word/document.xml",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"});if(!i.ok)throw new Error("Cannot build textbox drawing");let a=l=>{if(l.kind==="drawing")return l;if(l.kind==="textValue")return null;for(let c of l.children){let d=a(c);if(d)return d}return null},s=a(i.part.root);if(!s)throw new Error("Textbox drawing is missing");return s}function tg(e){let t=e.activeScope();if(e.editingMode()!=="edit"||t.kind!=="body"&&t.kind!=="frame")return {ok:false,code:"unsupported",reason:"Textboxes can only be inserted in body editing mode"};let n=t.kind==="frame"?t.hostParagraphId:e.state().selection.head.paragraphId;return e.layout().pages.some(r=>r.fragments.some(o=>o.kind==="paragraph"&&o.paragraphId===n))?null:{ok:false,code:"unsupported",reason:"Select a body paragraph outside a table to insert a textbox"}}function jI(e){let t=tg(e);if(t)return t;let n=e.activeScope(),r=n.kind==="frame"?n.hostParagraphId:e.state().selection.head.paragraphId,o=e.session.part(),i=chunkZOZI27AW_cjs.Xa(o,r);if(!i||i.kind!=="paragraph")return {ok:false,code:"notFound",reason:"Textbox anchor is missing"};let a=chunkZOZI27AW_cjs.we(e.session.currentPackage(),e.collaborationSession()?.identity.actorId);if(!a.ok)return {ok:false,code:"invalidArgs",reason:"Cannot allocate textbox identity"};let s=new Set(chunkZOZI27AW_cjs.Di(o).map(p=>p.root.id)),l=e.layout().pages.flatMap(p=>p.fragments).find(p=>p.kind==="paragraph"&&p.paragraphId===r),c=Math.min(300,l?.box.width??300);n.kind==="frame"&&e.setActiveScope({kind:"body"});let d=chunkZOZI27AW_cjs.tg(i);e.setSelection({anchor:{paragraphId:r,offset:d},head:{paragraphId:r,offset:d}});let u=e.applyDrawingOps([{op:"insertDrawing",paragraphId:r,offset:d,drawing:WI(a.id,c)}]);if(u.rejected)return {ok:false,code:"invalidArgs",reason:u.reason??"Textbox insertion was refused"};let f=chunkZOZI27AW_cjs.Di(e.session.part()).find(p=>!s.has(p.root.id));return f&&e.setActiveScope({kind:"frame",id:f.root.id,drawingNodeId:f.drawingNodeId,hostParagraphId:f.hostParagraphId}),e.focus(),{ok:true,changed:u.committed}}var ng=new WeakMap;function oo(e){let t=ng.get(e);if(t)return t;let n=chunkZOZI27AW_cjs.Zf(e);if(n.length===0)return ng.set(e,[]),[];let r=[];for(let o of n){let i=chunkZOZI27AW_cjs.Yf(o);for(let a of new Set([o.beginParagraphId,...o.resultParagraphIds,o.endParagraphId])){let s=chunkZOZI27AW_cjs.Xa(e,a);if(s?.kind!=="paragraph")continue;let l=chunkZOZI27AW_cjs.rg(s),c=a===o.beginParagraphId,d=a===o.endParagraphId;r.push({toc:o,paragraphId:a,length:l.length,startsHere:c,endsHere:d,start:c?l.spanOf(o.beginNodeId)?.start??0:0,end:d&&i?l.spanOf(i.endNodeId)?.end??l.length:l.length});}}return ng.set(e,r),r}function Qd(e){return new Set(oo(e).filter(t=>t.start===0&&t.end===t.length&&!(t.endsHere&&!t.startsHere&&t.end===0)).map(t=>t.paragraphId))}function rg(e,t){return e.endsHere&&!e.startsHere&&e.end===0||e.startsHere&&e.start>0&&t<=e.start||e.endsHere&&e.end<e.length&&t>=e.end?false:t>=e.start&&t<=e.end}function qn(e,t){return oo(e).find(n=>n.paragraphId===t.paragraphId&&rg(n,t.offset))?.toc}function KI(e,t){let{anchor:n,head:r}=t;if(n.paragraphId===r.paragraphId){let o=Math.min(n.offset,r.offset),i=Math.max(n.offset,r.offset);return oo(e).some(a=>a.paragraphId===n.paragraphId&&(o===i?rg(a,o):o<a.end&&i>a.start))}return qn(e,n)!==void 0||qn(e,r)!==void 0}function VI(e,t){let n=oo(e);if(n.length===0)return false;let r=chunkZOZI27AW_cjs.Ck(t);if(r.kind==="nodes")return r.targets.some(a=>n.some(s=>{if(a.nodeId!==s.paragraphId)return false;if(a.range){let{start:l,end:c}=a.range;return l===c?rg(s,l):l<s.end&&c>s.start}return t.op==="joinParagraphs"&&t.firstId===s.paragraphId&&s.endsHere&&s.end===0?false:a.removes||a.structural?true:s.end>s.start||s.length===0&&!s.endsHere}));let o=new Set(n.map(a=>a.paragraphId)),i=(a,s="")=>typeof a=="string"?/(?:Id|Ids)$/.test(s)&&o.has(a):Array.isArray(a)?a.some(l=>i(l,s)):!!a&&typeof a=="object"&&Object.entries(a).some(([l,c])=>i(c,l));return i(t)}function UI(e,t,n){let r=qn(e,t);if(!r)return null;let o=oo(e).find(i=>i.toc.id===r.id&&(n?i.startsHere&&i.start>0:i.endsHere&&i.end<i.length));return o?{paragraphId:o.paragraphId,offset:n?o.start:o.end}:null}function zI(e,t){return !oo(t).some(r=>r.toc.id===e.id&&(r.start>0||r.end<r.length))&&e.contentControlId?e.contentControlId:`toc:${e.id}`}function GI(e,t,n){if(!t)return;let r=n?.closest("[data-start]");return oo(e).find(o=>o.paragraphId===t&&(r?Number(r.dataset.start)<o.end&&Number(r.dataset.end)>o.start:Qd(e).has(t)))?.toc}function ZI(e,t){return chunkZOZI27AW_cjs.Zf(e).some(n=>n.beginParagraphId===t||n.endParagraphId===t||n.resultParagraphIds.includes(t))}var Jd="suggesting cannot merge or split cells; stop suggesting to change the table structure",j2="select two or more cells that form a rectangle to merge them",K2="select two or more cells to merge them";function YI(e){switch(e){case "cells-not-rectangle":return {code:"invalidArgs",reason:j2};case "split-rows-not-divisor":return {code:"invalidArgs",reason:"a merged cell splits only into a number of rows that divides its rows"};case "split-needs-grid":return {code:"invalidArgs",reason:"this table has no column grid, so the cell splits only into a divisor of its columns"};case "cell-too-narrow":return {code:"invalidArgs",reason:"the cell is too narrow to split into that many columns"};case "cell-has-revision":return {code:"unsupported",reason:"the cells have a tracked change; accept or reject it first"};default:return null}}function XI(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=chunkZOZI27AW_cjs.jl}function QI(e){return XI(e.rows)&&XI(e.cols)&&e.rows*e.cols>=2?null:`splitCell rows and cols must be whole numbers from 1 to ${chunkZOZI27AW_cjs.jl}, and not both 1`}function JI(e,t,n){return e.type==="mergeCells"?!n||t.cellIds.length<2?{ok:false,code:"invalidArgs",reason:K2}:{ok:true,op:{op:"mergeTableCells",tableId:t.tableId,cellIds:t.cellIds}}:t.cellIds.length>1?{ok:false,code:"invalidArgs",reason:"select one cell to split it"}:{ok:true,op:{op:"splitTableCell",tableId:t.tableId,cellId:t.cellId,rows:e.rows,columns:e.cols}}}function eR(e,t,n){let r=chunkZOZI27AW_cjs.kl(e,t.tableId);if(!r.ok)return null;let o=null;for(let i of t.cellIds){let a=r.table.index.byId.get(i);if(!a)continue;let s=chunkZOZI27AW_cjs.ll(r.table,a),l=n==="above"?s.rowFrom:s.rowTo;o=o===null?l:n==="above"?Math.min(o,l):Math.max(o,l);}return o===null?null:r.table.topology.rows[o]?.row.id??null}function tR(e,t,n){let r=chunkZOZI27AW_cjs.kl(e,t.tableId);if(!r.ok)return null;let o=null;for(let i of t.cellIds){let a=r.table.index.byId.get(i);if(!a)continue;let s=chunkZOZI27AW_cjs.ll(r.table,a),l=n==="left"?s.colFrom:s.colTo;o=o===null?l:n==="left"?Math.min(o,l):Math.max(o,l);}return o===null?null:r.table.topology.gridColumns[o]?.id??null}var ml=/^[0-9A-Fa-f]{6}$/,nR={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folhlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedhyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"},V2={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"};function og(e){return typeof e=="number"&&Number.isFinite(e)&&e>0&&e<=1}function eu(e){return Math.max(0,Math.min(1,e))}function rR(e){let t=e.replace(/^#/,"").padStart(6,"0").slice(0,6);return {r:parseInt(t.slice(0,2),16)||0,g:parseInt(t.slice(2,4),16)||0,b:parseInt(t.slice(4,6),16)||0}}function oR(e,t,n){let r=o=>Math.max(0,Math.min(255,Math.round(o))).toString(16).padStart(2,"0");return `${r(e)}${r(t)}${r(n)}`.toUpperCase()}function iR(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "FFFFFF";let r=Math.max(0,Math.min(255,Math.round((1-eu(t))*255)))/255,o=rR(e);return oR(r*255+(1-r)*o.r,r*255+(1-r)*o.g,r*255+(1-r)*o.b)}function aR(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "000000";let r=Math.max(0,Math.min(255,Math.round(eu(t)*255)))/255,o=rR(e);return oR(r*o.r,r*o.g,r*o.b)}function ig(e){return nR[e]??nR[e.toLowerCase()]??null}function U2(e,t){let n=ig(e);if(!n)return null;let r=t.find(i=>i.slot===n)?.hex;if(r&&ml.test(r))return r.toUpperCase();let o=V2[n];return o&&ml.test(o)?o.toUpperCase():null}function tu(e,t){let n=U2(e.slot,t);if(!n)return {ok:false,reason:"the theme colour could not be resolved for this document"};if(e.tint!==void 0&&!og(e.tint))return {ok:false,reason:"theme tint is out of range"};if(e.shade!==void 0&&!og(e.shade))return {ok:false,reason:"theme shade is out of range"};let r=n;return e.tint!==void 0?r=iR(r,eu(e.tint)):e.shade!==void 0&&(r=aR(r,eu(e.shade))),{ok:true,hex:r}}var z2="000000";function ag(e,t){if(e.kind==="hex"){let o=e.value.toUpperCase();return ml.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"border colour requires a six-digit hex value"}}if(e.kind==="auto")return {ok:true,color:{kind:"auto",resolvedHex:z2}};let n=tu(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:ig(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function sg(e,t){if(e.kind==="auto")return {ok:false,reason:"automatic fill cannot be written without a resolved colour"};if(e.kind==="hex"){let o=e.value.toUpperCase();return ml.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"fill colour requires a six-digit hex value"}}let n=tu(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:ig(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function G2(e,t,n="000000"){if(!e||e.kind==="auto")return `#${n}`;if(e.kind==="hex"){let o=e.value.replace(/^#/,"").toUpperCase();return ml.test(o)?`#${o}`:`#${n}`}let r=tu(e,t);return `#${r.ok?r.hex:n}`}function lg(e,t){return chunkFDSL5OJU_cjs.$e(e).occurrences.some(n=>n.table.tableId===t&&n.row.cells.some(r=>r.logicalGridColumn!==void 0))}function sR(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var Q2=new Set(["insertRow","deleteRow","insertColumn","deleteColumn","deleteTable","setCellFill","setTableCellVerticalAlignment","setTableBorders","commitTableColumnDividerResize","commitTableRightEdgeResize","mergeCells","splitCell","toggleHeaderRow","selectTableRegion","setTableProperties"]);function Oo(e){return Q2.has(e.type)}function ye(e,t){return {ok:false,code:e,reason:t}}function cg(e,t){let n=YI(e);if(n)return ye(n.code,n.reason);switch(e){case "unknown-table":case "unknown-row":case "unknown-grid-column":return ye("invalidArgs","the table target is no longer valid");case "table-has-merge":return ye("unsupported","this table uses a legacy horizontal merge the editor cannot change");case "row-hides-cell":case "tree-invariant":return ye("unsupported","this table has a cell the editor cannot place in the grid");case "block-required":return ye("unsupported","the table must keep at least one row or column");case "resource-limit":return ye("unsupported","the table has reached the supported size limit");case "invalidArgs":case "invalid-property-value":case "unsupported-property":return ye("invalidArgs","the table command arguments are invalid");default:return ye("unsupported",`the table operation was refused (${e})`)}}function Jt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function En(e,t){return !Jt(e)||Object.keys(e).length!==t.length?false:t.every(r=>Object.prototype.hasOwnProperty.call(e,r))}function uR(e){if(!Jt(e))return false;let t=e.kind;if(t==="hex")return En(e,["kind","value"])&&typeof e.value=="string";if(t==="auto")return En(e,["kind"]);if(t==="theme"){if(typeof e.slot!="string")return false;let n=["kind","slot"];if(e.tint!==void 0){if(typeof e.tint!="number"||!Number.isFinite(e.tint))return false;n.push("tint");}if(e.shade!==void 0){if(typeof e.shade!="number"||!Number.isFinite(e.shade))return false;n.push("shade");}return En(e,n)}return false}function fR(e){return Jt(e)&&En(e,["sourceRevision","tableId","rowId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&e.tableId.length>0&&typeof e.rowId=="string"&&e.rowId.length>0&&typeof e.isHeaderRepeat=="boolean"}function pR(e){return Jt(e)&&En(e,["sourceRevision","tableId","gridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&e.tableId.length>0&&typeof e.gridColumnId=="string"&&e.gridColumnId.length>0&&typeof e.isHeaderRepeat=="boolean"}function J2(e){return Jt(e)&&En(e,["sourceRevision","tableId","leftGridColumnId","rightGridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&typeof e.leftGridColumnId=="string"&&typeof e.rightGridColumnId=="string"&&typeof e.isHeaderRepeat=="boolean"}function e8(e){return Jt(e)&&En(e,["sourceRevision","tableId","gridColumnId","isHeaderRepeat"])&&typeof e.sourceRevision=="number"&&Number.isInteger(e.sourceRevision)&&typeof e.tableId=="string"&&typeof e.gridColumnId=="string"&&typeof e.isHeaderRepeat=="boolean"}function t8(e){return !Jt(e)||!En(e,["style","size","color"])?false:typeof e.style=="string"&&typeof e.size=="number"&&Number.isInteger(e.size)&&uR(e.color)}function lR(e){return !("target"in e)||e.target===void 0||fR(e.target)}function cR(e){return !("target"in e)||e.target===void 0||pR(e.target)}function n8(e){switch(e.type){case "splitCell":{let t=QI(e);return t?ye("invalidArgs",t):null}case "insertRow":return !Jt(e)||e.type!=="insertRow"?ye("invalidArgs","insertRow command shape is invalid"):e.where!=="above"&&e.where!=="below"?ye("invalidArgs","insertRow where must be above or below"):lR(e)?null:ye("invalidArgs","insertRow target shape is invalid");case "deleteRow":return !Jt(e)||e.type!=="deleteRow"?ye("invalidArgs","deleteRow command shape is invalid"):lR(e)?null:ye("invalidArgs","deleteRow target shape is invalid");case "insertColumn":return !Jt(e)||e.type!=="insertColumn"?ye("invalidArgs","insertColumn command shape is invalid"):e.where!=="left"&&e.where!=="right"?ye("invalidArgs","insertColumn where must be left or right"):cR(e)?null:ye("invalidArgs","insertColumn target shape is invalid");case "deleteColumn":return !Jt(e)||e.type!=="deleteColumn"?ye("invalidArgs","deleteColumn command shape is invalid"):cR(e)?null:ye("invalidArgs","deleteColumn target shape is invalid");case "deleteTable":return !Jt(e)||!En(e,["type"])?ye("invalidArgs","deleteTable command shape is invalid"):null;case "setCellFill":return !Jt(e)||!En(e,["type","color"])?ye("invalidArgs","setCellFill command shape is invalid"):e.color!==null&&!uR(e.color)?ye("invalidArgs","setCellFill color shape is invalid"):null;case "setTableCellVerticalAlignment":return !Jt(e)||!En(e,["type","alignment"])||!["top","center","bottom"].includes(e.alignment)?ye("invalidArgs","cell vertical alignment command shape is invalid"):null;case "setTableBorders":return !Jt(e)||e.type!=="setTableBorders"?ye("invalidArgs","setTableBorders command shape is invalid"):e.scope==="none"?typeof e.target!="string"?ye("invalidArgs","border none scope requires a target edge"):null:!("spec"in e)||!t8(e.spec)?ye("invalidArgs","concrete border scopes require a complete spec"):null;case "commitTableColumnDividerResize":return !Jt(e)||!En(e,["type","target","leftWidthTwips","rightWidthTwips"])||!J2(e.target)||typeof e.leftWidthTwips!="number"||typeof e.rightWidthTwips!="number"?ye("invalidArgs","column divider resize command shape is invalid"):null;case "commitTableRightEdgeResize":return !Jt(e)||!En(e,["type","target","columnWidthTwips","tableWidthTwips"])||!e8(e.target)||typeof e.columnWidthTwips!="number"||typeof e.tableWidthTwips!="number"?ye("invalidArgs","right-edge resize command shape is invalid"):null;default:return null}}function r8(e){return !("target"in e)||e.target===void 0?null:fR(e.target)?e.target:null}function o8(e){return !("target"in e)||e.target===void 0?null:pR(e.target)?e.target:null}function i8(e,t){let n=chunkZOZI27AW_cjs._k(e.root,t.tableId);if(!n.ok)return {rowIds:[t.rowId],wholeTable:false};let r=new Set(t.cellIds),o=n.topology.rows.filter(i=>i.cells.some(a=>r.has(a.id))).map(i=>i.row.id);return o.length===0?{rowIds:[t.rowId],wholeTable:false}:{rowIds:o,wholeTable:o.length===n.topology.rows.length}}function a8(e,t){let n=chunkZOZI27AW_cjs._k(e.root,t.tableId);if(!n.ok||!n.topology.grid)return {gridColumnIds:[],wholeTable:false};let r=new Set(t.cellIds),o=new Set;for(let i of n.topology.rows){let a=0;for(let s of i.cells){let l=mR(s);if(r.has(s.id))for(let c=0;c<l;c+=1){let d=n.topology.gridColumns[a+c];d&&o.add(d.id);}a+=l;}}return {gridColumnIds:[...o],wholeTable:o.size>0&&o.size===n.topology.gridColumns.length}}function dR(e,t,n){let r=chunkZOZI27AW_cjs._k(e.root,t);return !r.ok||!r.topology.grid?null:r.topology.gridColumns[n]?.id??null}function s8(e){let t=chunk6NVZNB7O_cjs.qa(e.layout,e.selection.head.paragraphId,e.cellSelection);return t?{tableId:t.tableId,rowId:t.rowId,cellId:t.cellId,cellIds:[...t.cellIds],gridColumnIndex:t.gridColumnIndex,isHeaderRepeat:t.isHeaderRepeat}:null}function mR(e){let t=chunkZOZI27AW_cjs.Xk(e,"tcPr"),n=t&&chunkZOZI27AW_cjs.Xk(t,"gridSpan"),r=n&&chunkZOZI27AW_cjs.Yk(n,"val");if(!r||!/^\d{1,7}$/.test(r))return 1;let o=Number(r);return Number.isInteger(o)&&o>1?Math.min(o,1024):1}function l8(e,t,n){let r=e.gridColumns.findIndex(o=>o.id===n);if(r===-1)return null;for(let{row:o,cells:i}of e.rows){let a=0;for(let s of i){let l=mR(s);if(r>=a&&r<a+l)return {tableId:t,rowId:o.id,cellId:s.id,cellIds:[s.id],gridColumnIndex:r,isHeaderRepeat:false};a+=l;}}return null}function c8(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunkZOZI27AW_cjs._k(e.part.root,t.tableId);if(!n.ok)return null;let r=n.topology.rows.findIndex(a=>a.row.id===t.rowId);if(r===-1)return null;let i=n.topology.rows[r].cells[0];return i?{tableId:t.tableId,rowId:t.rowId,cellId:i.id,cellIds:[i.id],gridColumnIndex:0,isHeaderRepeat:false}:null}function d8(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunkZOZI27AW_cjs._k(e.part.root,t.tableId);return n.ok?l8(n.topology,t.tableId,t.gridColumnId):null}function u8(e,t){for(let n of t){let r=chunkZOZI27AW_cjs.Hl(e,n);if(r)return cg(r)}return null}function yn(e,t,n){let r=u8(e,t);return r||{ok:true,ops:t,selection:n}}function f8(e,t){if(!chunkZOZI27AW_cjs.il.includes(e.style))return {ok:false,reason:"border style is not allowlisted"};if(!Number.isInteger(e.size)||e.size<1)return {ok:false,reason:"border size is out of range"};if(e.size>96)return {ok:false,reason:"border size is out of range"};let n=ag(e.color,t);return n.ok?{ok:true,spec:{style:e.style,size:e.size,color:n.color}}:{ok:false,reason:n.reason}}function gl(e,t,n){return n!==e.storeRevision?ye("invalidArgs","the table target is stale"):chunkZOZI27AW_cjs._k(e.part.root,t).ok?null:ye("invalidArgs","the table target is no longer valid")}function p8(e){return e?.isHeaderRepeat?ye("unsupported","repeated header rows cannot be edited"):null}function m8(e,t,n,r){let o=gl(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return ye("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return ye("invalidArgs","column widths must be whole twips");if(n<300||r<300)return ye("invalidArgs","column widths are below the minimum");let i=chunkZOZI27AW_cjs._k(e.part.root,t.tableId);if(!i.ok){let u=i.reason==="duplicate-node-id"?"unknown-table":i.reason;return cg(u)}let a=i.topology.gridColumns.find(u=>u.id===t.leftGridColumnId),s=i.topology.gridColumns.find(u=>u.id===t.rightGridColumnId);if(!a||!s)return ye("invalidArgs","the table target is no longer valid");let l=i.topology.gridColumns.indexOf(a),c=i.topology.gridColumns.indexOf(s);if(Math.abs(c-l)!==1)return ye("invalidArgs","the column divider target is not adjacent");let d={op:"setTableColumnWidths",tableId:t.tableId,leftGridColumnId:l<c?t.leftGridColumnId:t.rightGridColumnId,rightGridColumnId:l<c?t.rightGridColumnId:t.leftGridColumnId,leftWidthTwips:l<c?n:r,rightWidthTwips:l<c?r:n};return yn(e.part,[d],{kind:"preserveSelection"})}function g8(e,t,n,r){let o=gl(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return ye("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return ye("invalidArgs","column widths must be whole twips");if(n<300)return ye("invalidArgs","column widths are below the minimum");let i=chunkZOZI27AW_cjs._k(e.part.root,t.tableId);if(!i.ok){let l=i.reason==="duplicate-node-id"?"unknown-table":i.reason;return cg(l)}let a=i.topology.gridColumns[i.topology.gridColumns.length-1];if(!a||a.id!==t.gridColumnId)return ye("invalidArgs","the resize target is not the table right edge");let s={op:"setTableRightEdgeWidth",tableId:t.tableId,gridColumnId:t.gridColumnId,columnWidthTwips:n,tableWidthTwips:r};return yn(e.part,[s],{kind:"preserveSelection"})}function gR(e,t,n){if(e.viewing||!e.editable)return ye("locked","the document is open for viewing");let r=gl(e,t.tableId,t.sourceRevision);if(r)return r;if(t.isHeaderRepeat)return ye("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||n<20||n>31680)return ye("invalidArgs","row height is outside the supported range");let o={op:"setTableRowHeight",tableId:t.tableId,rowId:t.rowId,heightTwips:n};return yn(e.part,[o],{kind:"preserveSelection"})}function io(e){let{command:t,part:n,viewing:r,editable:o}=e;if(r||!o)return ye("locked","the document is open for viewing");switch(t.type){case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return ye("unsupported",`command '${t.type}' is not supported by the tree editor`);}let i=n8(t);if(i)return i;let a=r8(t),s=o8(t),l=p8(a??s);if(l)return l;if(a){let d=gl(e,a.tableId,a.sourceRevision);if(d)return d}if(s){let d=gl(e,s.tableId,s.sourceRevision);if(d)return d}let c=a!==null?c8(e,a):s!==null?d8(e,s):s8(e);if(t.type!=="commitTableColumnDividerResize"&&t.type!=="commitTableRightEdgeResize"&&!c)return a||s?ye("invalidArgs","the table target is no longer valid"):ye("unsupported","the selection is not inside a table");if(c?.isHeaderRepeat)return ye("unsupported","repeated header rows cannot be edited");switch(t.type){case "mergeCells":case "splitCell":{if(!c)return ye("unsupported","the selection is not inside a table");let d=JI(t,c,e.cellSelection!==null);return d.ok?yn(n,[d.op],{kind:"adoptCommittedCaret"}):ye(d.code,d.reason)}case "insertRow":{if(!c)return ye("unsupported","the selection is not inside a table");let d=(a?null:eR(n,c,t.where))??c.rowId,u={op:"insertTableRow",tableId:c.tableId,rowId:d,where:t.where};return yn(n,[u],{kind:"adoptCommittedCaret"})}case "deleteRow":{if(!c)return ye("unsupported","the selection is not inside a table");let d=i8(n,c),u=d.wholeTable?[{op:"deleteBlock",blockId:c.tableId}]:d.rowIds.map(f=>({op:"deleteTableRow",tableId:c.tableId,rowId:f,...f===c.rowId?{referenceCellId:c.cellId}:{}}));return yn(n,u,{kind:"adoptCommittedCaret"})}case "insertColumn":{if(!c)return ye("unsupported","the selection is not inside a table");let d=s?.tableId??c.tableId,u=lg(e.layout,d)?t.where==="left"?"right":"left":t.where,f=s?.gridColumnId??tR(n,c,u)??dR(n,d,c.gridColumnIndex),p=f?{op:"insertTableColumn",tableId:d,where:u,gridColumnId:f}:{op:"insertTableColumn",tableId:d,where:u,referenceCellId:c.cellId};return yn(n,[p],{kind:"adoptCommittedCaret"})}case "deleteColumn":{if(!c)return ye("unsupported","the selection is not inside a table");let d=s?.tableId??c.tableId,u=s?.gridColumnId??dR(n,d,c.gridColumnIndex);if(!u)return ye("invalidArgs","the table has no grid column to delete");let f=s?.gridColumnId===void 0?a8(n,c):{gridColumnIds:[u],wholeTable:false};if(f.wholeTable)return yn(n,[{op:"deleteBlock",blockId:d}],{kind:"adoptCommittedCaret"});let g=(f.gridColumnIds.length>0?f.gridColumnIds:[u]).map(b=>({op:"deleteTableColumn",tableId:d,gridColumnId:b}));return yn(n,g,{kind:"adoptCommittedCaret"})}case "deleteTable":{if(!c)return ye("unsupported","the selection is not inside a table");let d={op:"deleteBlock",blockId:c.tableId};return yn(n,[d],{kind:"adoptCommittedCaret"})}case "setCellFill":{if(!c)return ye("unsupported","the selection is not inside a table");let d;if(t.color===null)d=null;else {let f=sg(t.color,e.themeColors);if(!f.ok)return ye("invalidArgs",f.reason);d=f.color;}let u={op:"setTableCellFill",tableId:c.tableId,cellIds:c.cellIds,color:d};return yn(n,[u],{kind:"preserveSelection"})}case "setTableCellVerticalAlignment":{if(!c)return ye("unsupported","the selection is not inside a table");let d={op:"setTableCellVerticalAlignment",tableId:c.tableId,cellIds:c.cellIds,alignment:t.alignment};return yn(n,[d],{kind:"preserveSelection"})}case "setTableBorders":{if(!c)return ye("unsupported","the selection is not inside a table");if(t.scope==="none"){let f={op:"setTableCellBorders",tableId:c.tableId,cellIds:c.cellIds,scope:"none",target:sR(t.target,lg(e.layout,c.tableId))};return yn(n,[f],{kind:"preserveSelection"})}let d=f8(t.spec,e.themeColors);if(!d.ok)return ye("invalidArgs",d.reason);let u={op:"setTableCellBorders",tableId:c.tableId,cellIds:c.cellIds,scope:sR(t.scope,lg(e.layout,c.tableId)),spec:d.spec};return yn(n,[u],{kind:"preserveSelection"})}case "commitTableColumnDividerResize":return m8(e,t.target,t.leftWidthTwips,t.rightWidthTwips);case "commitTableRightEdgeResize":return g8(e,t.target,t.columnWidthTwips,t.tableWidthTwips);default:return ye("unsupported",`command '${t.type}' is not a table command`)}}function hR(e){if(!Oo(e))return {supported:false,reason:`command '${e.type}' is not a table command`};switch(e.type){case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return {supported:false,reason:`command '${e.type}' is not supported by the tree editor`};default:return {supported:true}}}var nu="Calibri",dg=new Set(["image/png","image/jpeg","image/gif","image/bmp","image/webp"]),h8=4e3,Ra=e=>Math.max(1,Math.min(h8,e));function y8(e,t,n,r){let o={...chunkFDSL5OJU_cjs.ca,fontFamily:t.fontFamily,bold:t.bold,italic:t.italic,fontSizePt:t.size??100},i=r?.measure(e,o)??NaN,a=r?.lineMetrics(o).height??NaN;if(i>0||(i=.55*o.fontSizePt*Array.from(e).length),a>0||(a=1.22*o.fontSizePt),t.size!==null)return {width:Ra(i),height:Ra(a)};let s=a/i,l=Math.min(n.width,n.height),c=t.diagonal?l*Math.SQRT2/(1+s):n.width;return {width:Ra(c),height:Ra(c*s)}}function b8(e,t,n){let r=chunkZOZI27AW_cjs.ke(e);if(!dg.has(r))return null;let o=chunkZOZI27AW_cjs.pe(e,r);if(!o)return null;let i=o.pixelWidth*72/(o.dpiX&&o.dpiX>0?o.dpiX:96),a=o.pixelHeight*72/(o.dpiY&&o.dpiY>0?o.dpiY:96);if(!(i>0)||!(a>0))return null;let s=t??Math.min(n.width/i,n.height/a);return {width:Ra(i*s),height:Ra(a*s)}}function hl(e,t,n){if(e.imageData)return b8(e.imageData,e.scale??null,t);let r=e.text??"";return r===""?null:y8(r,{fontFamily:e.fontFamily?.trim()||nu,bold:e.bold??false,italic:e.italic??false,size:e.fontSizePt??null,diagonal:(e.layout??"diagonal")==="diagonal"},t,n)}var v8="C0C0C0",x8=.5,S8=/^[^"';{}<>\\\u0000-\u001f]{1,64}$/u;function ru(e){if(!e)return null;let t=chunkZOZI27AW_cjs.Xg(e.session.currentPackage());return t?t.kind==="picture"?Object.freeze({kind:"image",washout:t.washout}):Object.freeze({kind:"text",text:t.text,fontFamily:t.fontFamily,fontSizePt:t.fontSizePt,bold:t.bold,italic:t.italic,color:t.colorHex,transparency:Math.round((1-t.opacity)*1e3)/1e3,layout:t.diagonal?"diagonal":"horizontal"}):null}function bR(e){let t=ru(e);if(!t||!e)return null;if(t.kind==="text"){let{kind:i,...a}=t;return Object.freeze(a)}let n=e.session.currentPackage(),r=chunkZOZI27AW_cjs.Xg(n),o=r?.kind==="picture"&&r.mediaPartName?n.partBytes.get(r.mediaPartName):void 0;return Object.freeze({washout:t.washout??false,scale:null,...o?{imageData:o}:{}})}var ug=(e,t,n)=>typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n;function fg(e){if(e===null)return null;if(typeof e!="object"||e===void 0)return "watermark must be an object or null";let t=e,n=t.text!==void 0,r=t.imageData!==void 0;if(n===r)return "set exactly one of text and imageData";if(n){if(typeof t.text!="string"||!t.text.trim())return "text must be a non-empty string";if(t.text.length>chunkZOZI27AW_cjs.td)return `text is longer than ${chunkZOZI27AW_cjs.td}`;if(/[\r\n\v\f\u2028\u2029]/u.test(t.text))return "text must be one line";if(/[\u0000-\u0008\u000e-\u001f]/u.test(t.text))return "text holds a control character";if(t.fontFamily!==void 0&&(typeof t.fontFamily!="string"||!S8.test(t.fontFamily.trim())))return "fontFamily is not a font name";if(t.fontSizePt!==void 0&&t.fontSizePt!==null&&!ug(t.fontSizePt,1,1e3))return "fontSizePt must be from 1 to 1000";if(t.color!==void 0&&(typeof t.color!="string"||!/^[0-9a-f]{6}$/iu.test(t.color)))return "color must be RRGGBB";if(t.transparency!==void 0&&!ug(t.transparency,0,1))return "transparency must be from 0 to 1";if(t.layout!==void 0&&t.layout!=="diagonal"&&t.layout!=="horizontal")return "layout must be 'diagonal' or 'horizontal'";for(let i of ["bold","italic"])if(t[i]!==void 0&&typeof t[i]!="boolean")return `${i} must be a boolean`;return t.scale!==void 0||t.washout!==void 0?"scale and washout apply to a picture watermark":null}if(!(t.imageData instanceof Uint8Array))return "imageData must be a Uint8Array";let o=chunkZOZI27AW_cjs.ke(t.imageData);if(!dg.has(o))return "imageData is not a PNG, JPEG, GIF, BMP or WebP picture";if(!chunkZOZI27AW_cjs.xe(t.imageData,o))return "imageData is not a readable picture";if(t.scale!==void 0&&t.scale!==null&&!ug(t.scale,.01,10))return "scale must be from 0.01 to 10";if(t.washout!==void 0&&typeof t.washout!="boolean")return "washout must be a boolean";for(let i of ["fontFamily","fontSizePt","bold","italic","color","transparency","layout"])if(t[i]!==void 0)return `${i} applies to a text watermark`;return null}function vR(e){let{pageSize:t,margins:n}=e,r=(t.widthTwips-n.leftTwips-n.rightTwips-n.gutterTwips)/20,o=(t.heightTwips-n.topTwips-n.bottomTwips)/20;return {width:Math.max(72,r),height:Math.max(72,o)}}function yR(e,t,n){let r=e.session.currentPackage(),o=r.parts.get(r.mainDocumentPart);if(o)return chunkFDSL5OJU_cjs.Yc(o).map(i=>{let a=hl(t,vR(i.properties),n);return a?{widthPt:a.width,heightPt:a.height}:null})}function w8(e,t){let n=vR(e.sectionPropertiesAt(e.state().selection.head.paragraphId)),r=e.textMeasurer?.();if(t.imageData){let u=chunkZOZI27AW_cjs.ke(t.imageData),f=hl(t,n);return f?{kind:"picture",washout:t.washout??true,widthPt:f.width,heightPt:f.height,sectionSizes:yR(e,t,r),image:{bytes:t.imageData,mime:u}}:null}let o=t.text??"",i=t.fontFamily?.trim()||nu,a=t.bold??false,s=t.italic??false,l=(t.layout??"diagonal")==="diagonal",c=t.fontSizePt??null,d=hl(t,n,r);return {kind:"text",text:o,fontFamily:i,fontSizePt:c,bold:a,italic:s,colorHex:(t.color??v8).toUpperCase(),opacity:1-(t.transparency??x8),diagonal:l,widthPt:d.width,heightPt:d.height,sectionSizes:yR(e,t,r)}}function xR(e,t){let n=fg(t);if(n)return {ok:false,code:"invalidArgs",reason:n};if(typeof e.applyHeaderFooterLifecycle!="function")return {ok:false,code:"unsupported",reason:"watermarks are not available"};let r=t?w8(e,t):null;if(t&&!r)return {ok:false,code:"invalidArgs",reason:"imageData is not a readable picture"};if(!t&&!chunkZOZI27AW_cjs.Xg(e.session.currentPackage()))return {ok:true,changed:false};let o={op:"setWatermark",watermark:r},i=e.applyHeaderFooterLifecycle(o);return i.ok?{ok:true,changed:true}:{ok:false,code:i.reason==="locked"?"locked":"invalidArgs",reason:`the watermark was not written: ${i.reason}`}}function qt(e){if(typeof e!="object"||e===null)return false;let t=e;return typeof t.paraId=="string"&&t.paraId.length>0&&(t.search===void 0||typeof t.search=="string"&&t.search.length>0)&&(t.occurrence===void 0||typeof t.occurrence=="number"&&Number.isInteger(t.occurrence)&&t.occurrence>=1)}function ki(e){if(typeof e!="object"||e===null)return false;let t=e;return qt(t.from)&&qt(t.to)}function SR(e,t,n){let r=[],o=e.indexOf(t);for(;o>=0&&r.length<n;)r.push(o),o=e.indexOf(t,o+1);return r}function Cn(e,t,n){if(typeof n.paraId!="string"||n.paraId.length===0)return {ok:false,code:"invalidArgs",reason:"paraId must be a non-empty string"};let r=n.paraId.toUpperCase();if(t.ambiguousParaIds.has(r))return {ok:false,code:"ambiguous",reason:`paraId '${n.paraId}' is claimed by more than one story`};let o=t.nodeByParaId.get(r);if(o===void 0)return {ok:false,code:"notFound",reason:`no paragraph with paraId '${n.paraId}'`};let i=chunkZOZI27AW_cjs.Tk(t.partByNode.get(o)??e,o)??"";if(n.search===void 0)return {ok:true,span:{nodeId:o,start:0,end:i.length}};if(n.search.length===0)return {ok:false,code:"invalidArgs",reason:"search must be a non-empty phrase"};if(n.occurrence!==void 0){if(!Number.isInteger(n.occurrence)||n.occurrence<1)return {ok:false,code:"invalidArgs",reason:"occurrence must be a positive integer (1-based)"};let s=SR(i,n.search,n.occurrence),l=s[n.occurrence-1];return l===void 0?{ok:false,code:"notFound",reason:`'${n.search}' matches ${s.length} time(s) in paragraph '${n.paraId}'; occurrence ${n.occurrence} does not exist`}:{ok:true,span:{nodeId:o,start:l,end:l+n.search.length}}}let a=SR(i,n.search,2);return a.length===0?{ok:false,code:"notFound",reason:`'${n.search}' does not occur in paragraph '${n.paraId}'`}:a.length>1?{ok:false,code:"ambiguous",reason:`'${n.search}' matches more than once in paragraph '${n.paraId}'; pass occurrence to disambiguate`}:{ok:true,span:{nodeId:o,start:a[0],end:a[0]+n.search.length}}}function wR(e,t,n){if("anchor"in n){let s=Cn(e,t,n.anchor);if(!s.ok)return {ok:false,code:s.code,reason:s.reason,target:n.anchor};let l={paragraphId:s.span.nodeId,offset:s.span.start};return {ok:true,selection:{anchor:l,head:l}}}let{from:r,to:o}=n.range;if(!qt(r)||!qt(o))return {ok:false,code:"unsupported",reason:"DocLocation endpoints are not supported; address paragraphs by paraId",target:n.range};let i=Cn(e,t,r);if(!i.ok)return {ok:false,code:i.code,reason:i.reason,target:r};let a=Cn(e,t,o);return a.ok?{ok:true,selection:{anchor:{paragraphId:i.span.nodeId,offset:i.span.start},head:{paragraphId:a.span.nodeId,offset:a.span.end}}}:{ok:false,code:a.code,reason:a.reason,target:o}}function kR(e){let t=e.match;return typeof t?.blockId!="string"||t.blockId.length===0||!Number.isInteger(t.start)||t.start<0||!Number.isInteger(t.length)||t.length<0?"match must carry a blockId and offsets":typeof e.text!="string"?"replaceMatch requires text":/[\r\n\v\f\u2028\u2029]/.test(e.text)?"replaceMatch requires text without a paragraph mark":null}function pg(e,t){let n=t.scope??{kind:"body"},r=e.activeScope();return (n.kind==="body"?r.kind==="body":n.kind==="headerFooter"?r.kind==="headerFooter"&&r.rId===n.rId:n.kind==="note"?r.kind==="note"&&r.id===n.id:false)?null:{ok:false,code:"unsupported",reason:n.kind==="frame"?"replaceMatch does not replace text in a text box":"replaceMatch replaces text only in the open story"}}function IR(e,t){let n=pg(e,t.match);if(n)return n;let{blockId:r,start:o,length:i}=t.match;return e.replaceTextInPlace(r,o,o+i,t.text)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"replaceMatch was refused"}}var k8=["alignment","direction","spaceBeforePt","spaceAfterPt","lineSpacing","tabStops"];function I8(e,t){return e===t?true:!e||!t?false:k8.every(n=>e[n]===t[n])}function mg(e,t){if(e===t)return true;if(!e||!t||e.bold!==t.bold||e.italic!==t.italic||e.underline!==t.underline||e.strike!==t.strike||e.superscript!==t.superscript||e.subscript!==t.subscript||e.highlight!==t.highlight||e.fontFamily!==t.fontFamily||e.fontSizePt!==t.fontSizePt||e.alignment!==t.alignment||e.direction!==t.direction||e.styleId!==t.styleId||e.spaceBeforePt!==t.spaceBeforePt||e.spaceAfterPt!==t.spaceAfterPt||e.lineSpacing?.rule!==t.lineSpacing?.rule||e.lineSpacing?.value!==t.lineSpacing?.value||e.indent?.left!==t.indent?.left||e.indent?.right!==t.indent?.right||e.indent?.firstLine!==t.indent?.firstLine||e.indent?.mixed.left!==t.indent?.mixed.left||e.indent?.mixed.right!==t.indent?.mixed.right||e.indent?.mixed.firstLine!==t.indent?.mixed.firstLine||e.indent?.rtl!==t.indent?.rtl||e.paragraphFlags?.contextualSpacing!==t.paragraphFlags?.contextualSpacing||e.paragraphFlags?.keepNext!==t.paragraphFlags?.keepNext||e.paragraphFlags?.keepLines!==t.paragraphFlags?.keepLines||e.paragraphFlags?.widowControl!==t.paragraphFlags?.widowControl||e.paragraphFlags?.pageBreakBefore!==t.paragraphFlags?.pageBreakBefore||!I8(e.disagrees,t.disagrees)||e.tabStops?.length!==t.tabStops?.length||(e.tabStops??[]).some((i,a)=>i.positionTwips!==t.tabStops?.[a]?.positionTwips||i.alignment!==t.tabStops?.[a]?.alignment||(i.leader??"none")!==(t.tabStops?.[a]?.leader??"none")))return false;if(e.color===t.color)return true;if(!e.color||!t.color)return false;let n=e.color,r=t.color,o=new Set([...Object.keys(n),...Object.keys(r)]);for(let i of o)if(n[i]!==r[i])return false;return true}function gg(e,t){return e.current===t.current&&e.total===t.total}function hg(e,t){return e===t?true:!e||!t?false:e.pageWidthTwips===t.pageWidthTwips&&e.pageHeightTwips===t.pageHeightTwips&&e.orientation===t.orientation&&e.marginsTwips.top===t.marginsTwips.top&&e.marginsTwips.right===t.marginsTwips.right&&e.marginsTwips.bottom===t.marginsTwips.bottom&&e.marginsTwips.left===t.marginsTwips.left&&e.gutterTwips===t.gutterTwips}function RR(e,t){if(e===t)return true;if(!e||!t)return false;let n=e,r=t;return n.paraId===r.paraId&&n.search===r.search&&n.occurrence===r.occurrence}function yg(e,t){return e===t?true:!e||!t||!ki(e)||!ki(t)?false:RR(e.from,t.from)&&RR(e.to,t.to)}function bg(){let e=null;return t=>(t===null?e=null:e?.id!==t&&(e=Object.freeze({id:t})),e)}var R8={scope:"compared",isLoading:"compared",isOpening:"compared",parseError:"compared",openFailure:"compared",editable:"compared",zoom:"compared",zoomMode:"compared",selection:"compared",selectionCollapsed:"compared",formatting:"compared",table:"compared",tocContext:"compared",image:"compared",page:"compared",canUndo:"compared",canRedo:"compared",pageSetup:"compared",reviewPaneOpen:"compared",reviewPane:"compared",showParagraphMarks:"compared",showBookmarks:"compared",documentProtection:"compared",reviewDisplayMode:"compared",revisionMarkup:"compared",hasReviewContent:"compared",hiddenReviewAuthors:"compared",collaborationStatus:"compared",editingMode:"compared",lastRejection:"compared",fontSubstitutions:"compared",formatPainter:"compared"},P8=Object.keys(R8);function vg(e,t){return P8.every(n=>e[n]===t[n])}function ou(e){if(e===null||typeof e!="object"||Object.isFrozen(e))return e;if(Array.isArray(e)){for(let n of e)ou(n);return Object.freeze(e)}let t=e;for(let n of Object.keys(t))ou(t[n]);return Object.freeze(e)}var xg=new Map([["bold",{localName:"b"}],["italic",{localName:"i"}],["underline",{localName:"u",attributes:{val:"single"}}],["strike",{localName:"strike"}],["superscript",{localName:"vertAlign",attributes:{val:"superscript"}}],["subscript",{localName:"vertAlign",attributes:{val:"subscript"}}]]),T8=new Set(["none","black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","yellow","white"]),E8=/^[0-9A-Fa-f]{6}$/;function Sg(e){let{mark:t,value:n}=e;switch(t){case "fontFamily":return typeof n!="string"||chunkXJYZVGQR_cjs.a(n)===null?{ok:false,code:"invalidArgs",reason:"fontFamily requires a family name of 1-64 letters, digits, or [ -.+_,;]"}:{ok:true,localName:"rFonts",attributes:{ascii:n,hAnsi:n}};case "fontSize":return typeof n!="number"||!Number.isInteger(n)||n<2||n>3276?{ok:false,code:"invalidArgs",reason:"fontSize requires an integer half-point value between 2 and 3276"}:{ok:true,localName:"sz",attributes:{val:String(n)}};case "color":return typeof n!="string"||n!=="auto"&&!E8.test(n)?{ok:false,code:"invalidArgs",reason:"color requires a six-digit hex value like FF0000, or 'auto'"}:{ok:true,localName:"color",attributes:{val:n}};case "highlight":return typeof n!="string"||!T8.has(n)?{ok:false,code:"invalidArgs",reason:"highlight requires an ST_HighlightColor name (yellow, cyan, ...)"}:{ok:true,localName:"highlight",attributes:{val:n}};default:return {ok:false,code:"unsupported",reason:`mark '${t}' is not supported by setMarkAttr`}}}function CR(e){return typeof e=="object"&&e!==null&&typeof e.paragraphId=="string"&&typeof e.offset=="number"}function wg(e){return typeof e=="object"&&e!==null&&CR(e.anchor)&&CR(e.head)}function en(e,t){let n=new Error(t);return n.code=e,n}function iu(e,t){return e===t?true:!e||!t?false:e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}function kg(e){return e==="blank"?cm():e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):null}function OR(e){return typeof e=="string"?`'${e}' is not a document; pass DOCX bytes, or 'blank' for an empty one`:"a DocumentHandle cannot be re-loaded; pass DOCX bytes"}function Ii(e){switch(e.type){case "toggleMark":return xg.has(e.mark)?{supported:true,mutating:true}:{supported:false,reason:`mark '${e.mark}' is not supported`};case "setMarkAttr":{let t=Sg(e);return t.ok?{supported:true,mutating:true}:{supported:false,reason:t.reason,code:t.code}}case "setAlignment":return {supported:true,mutating:true};case "setParagraphDirection":return e.direction==="ltr"||e.direction==="rtl"?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"setParagraphDirection requires a direction of 'ltr' or 'rtl'"};case "clearFormatting":return {supported:true,mutating:true};case "copyFormatting":return {supported:true,mutating:false};case "pasteFormatting":return {supported:true,mutating:true};case "setLineSpacing":{if(!["multiple","exact","atLeast"].includes(e.rule))return {supported:false,code:"invalidArgs",reason:"setLineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let n=e.rule==="multiple"?e.value*240:e.value*20;return !Number.isFinite(e.value)||e.value<=0||Math.round(n)>31680?{supported:false,code:"invalidArgs",reason:"setLineSpacing requires a positive value no taller than 1584pt"}:{supported:true,mutating:true}}case "setParagraphSpacing":{for(let t of ["beforePt","afterPt"]){let n=e[t];if(n!=null&&(!Number.isFinite(n)||n<0||n>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphSpacing requires ${t} between 0 and 1584 points`}}return {supported:true,mutating:true}}case "setParagraphStyle":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; the style applies at the selection"}:typeof e.styleId!="string"||e.styleId.length===0||e.styleId.length>128||/[\u0000-\u001f\u007f-\u009f]/.test(e.styleId)?{supported:false,code:"invalidArgs",reason:"setParagraphStyle requires a styleId of 1-128 printable characters"}:{supported:true,mutating:true};case "insertHyperlink":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; a link applies at the selection"}:typeof e.href!="string"||e.href.length===0?{supported:false,code:"invalidArgs",reason:"insertHyperlink requires an href"}:{supported:true,mutating:true};case "removeHyperlink":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; unlink acts at the selection"};case "setParagraphFormat":{let t=[e.indentLeftTwips,e.indentRightTwips,e.indentFirstLineTwips];for(let r of t)if(r!=null&&(!Number.isInteger(r)||Math.abs(r)>chunkFDSL5OJU_cjs.rd))return {supported:false,code:"invalidArgs",reason:`indent values must be whole twips within \xB1${chunkFDSL5OJU_cjs.rd}`};for(let r of ["spaceBeforePt","spaceAfterPt"]){let o=e[r];if(o!=null&&(!Number.isFinite(o)||o<0||o>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphFormat requires ${r} between 0 and 1584 points`}}let n=e.lineSpacing;if(n!=null){if(n.rule!=="multiple"&&n.rule!=="exact"&&n.rule!=="atLeast")return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let r=n.rule==="multiple"?n.value*240:n.value*20;if(!Number.isFinite(n.value)||n.value<=0||Math.round(r)>31680)return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a positive value no taller than 1584pt"}}if(e.alignment!==void 0&&!["left","center","right","justify"].includes(e.alignment))return {supported:false,code:"invalidArgs",reason:"unknown alignment"};if(e.direction!==void 0&&!["ltr","rtl"].includes(e.direction))return {supported:false,code:"invalidArgs",reason:"unknown direction"};if(e.tabStops!==void 0){if(e.tabStops.length>64)return {supported:false,code:"invalidArgs",reason:"setParagraphFormat accepts at most 64 tab stops"};let r=new Set;for(let o of e.tabStops){if(typeof o!="object"||o===null)return {supported:false,code:"invalidArgs",reason:"a tab stop must be an object"};if(!Number.isInteger(o.positionTwips)||o.positionTwips<0||o.positionTwips>31680)return {supported:false,code:"invalidArgs",reason:"tab stop positions must be whole twips between 0 and 31680"};if(!["left","center","right","decimal"].includes(o.alignment))return {supported:false,code:"invalidArgs",reason:"unknown tab alignment"};if(o.leader!==void 0&&!["none","dot","hyphen","underscore","heavy","middleDot"].includes(o.leader))return {supported:false,code:"invalidArgs",reason:"unknown tab leader"};if(r.has(o.positionTwips))return {supported:false,code:"invalidArgs",reason:"two tab stops cannot share a position"};r.add(o.positionTwips);}}return {supported:true,mutating:true}}case "setIndent":{let t=[e.left,e.right,e.firstLine];if(t.every(n=>n===void 0))return {supported:false,reason:"setIndent requires at least one indent field"};for(let n of t)if(n!=null){if(!Number.isInteger(n))return {supported:false,reason:"indent values must be whole twips"};if(Math.abs(n)>chunkFDSL5OJU_cjs.rd)return {supported:false,reason:`indent values must be within \xB1${chunkFDSL5OJU_cjs.rd} twips`}}return {supported:true,mutating:true}}case "toggleList":return e.kind==="bullet"||e.kind==="ordered"?{supported:true,mutating:true}:{supported:false,reason:`list kind '${e.kind}' is not supported`};case "adjustIndent":return e.direction==="increase"||e.direction==="decrease"?{supported:true,mutating:true}:{supported:false,reason:`indent direction '${e.direction}' is not supported`};case "insertBreak":return e.kind==="line"||e.kind==="page"||e.kind==="section"||e.kind==="sectionContinuous"?{supported:true,mutating:true}:{supported:false,reason:`break kind '${e.kind}' is not supported`};case "insertText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; text inserts at the selection"};case "deleteText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; deletion removes the selection"};case "proposeInsertion":case "proposeReplacement":{let t=e.type==="proposeInsertion"?e.text:e.replaceWith;return typeof t!="string"||t.length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires non-empty text`}:/[\r\n\v\f\u2028\u2029]/.test(t)?{supported:false,code:"invalidArgs",reason:`${e.type} requires text without a paragraph mark`}:e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires a non-empty author`}:{supported:true,mutating:true}}case "replaceMatch":{let t=kR(e);return t?{supported:false,code:"invalidArgs",reason:t}:{supported:true,mutating:true}}case "proposeDeletion":return e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:"proposeDeletion requires a non-empty author"}:{supported:true,mutating:true};case "setPageSetup":{let t=[e.pageWidth,e.pageHeight],n=[e.marginTop,e.marginRight,e.marginBottom,e.marginLeft];if(t.every(r=>r===void 0)&&n.every(r=>r===void 0)&&e.orientation===void 0)return {supported:false,reason:"setPageSetup requires at least one field"};for(let r of t)if(r!==void 0&&(!Number.isInteger(r)||r<1||r>63360))return {supported:false,code:"invalidArgs",reason:"page dimensions must be integer twips between 1 and 63360"};for(let r of n)if(r!==void 0&&(!Number.isInteger(r)||r<0||r>31680))return {supported:false,code:"invalidArgs",reason:"margins must be integer twips between 0 and 31680"};return e.orientation!==void 0&&e.orientation!=="portrait"&&e.orientation!=="landscape"?{supported:false,code:"invalidArgs",reason:"orientation must be 'portrait' or 'landscape'"}:e.scope!==void 0&&e.scope!=="document"&&e.scope!=="section"?{supported:false,code:"invalidArgs",reason:"scope must be 'document' or 'section'"}:{supported:true,mutating:true}}case "undo":case "redo":return {supported:true,mutating:true};case "insertTable":return Number.isInteger(e.rows)&&Number.isInteger(e.cols)&&e.rows>=1&&e.cols>=1&&e.rows<=32767&&e.cols<=63&&e.rows*e.cols<=2e4?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:`insertTable needs whole rows and cols of at least 1, at most ${32767}\xD7${63}, and at most ${2e4} cells`};case "insertToc":return {supported:true,mutating:true};case "editTextFormField":return {supported:true,mutating:false};case "refreshToc":return e.mode!==void 0&&e.mode!=="entire"&&e.mode!=="pageNumbers"?{supported:false,code:"invalidArgs",reason:"refreshToc mode must be 'entire' or 'pageNumbers'"}:e.tocId!==void 0&&(typeof e.tocId!="string"||e.tocId.length===0)?{supported:false,code:"invalidArgs",reason:"refreshToc tocId must be a non-empty string"}:{supported:true,mutating:true};case "editHeaderFooter":return e.position!=="header"&&e.position!=="footer"?{supported:false,reason:"editHeaderFooter requires position 'header' or 'footer'"}:e.variant!==void 0&&e.variant!=="default"&&e.variant!=="first"&&e.variant!=="even"?{supported:false,reason:"editHeaderFooter variant must be 'default', 'first', or 'even'"}:{supported:true,mutating:true};case "exitHeaderFooter":return {supported:true,mutating:false};case "removeHeaderFooter":case "linkHeaderFooterToPrevious":case "unlinkHeaderFooterFromPrevious":return "variant"in e&&e.variant!==void 0&&e.variant!=="default"&&e.variant!=="first"&&e.variant!=="even"?{supported:false,reason:"furniture variant must be 'default', 'first', or 'even'"}:{supported:true,mutating:true};case "setHeaderFooterOptions":return e.titlePage===void 0&&e.evenAndOddHeaders===void 0&&e.headerDistanceTwips===void 0&&e.footerDistanceTwips===void 0?{supported:false,reason:"setHeaderFooterOptions requires at least one option"}:{supported:true,mutating:true};case "insertPageField":return e.field==="PAGE"||e.field==="NUMPAGES"||e.field==="SECTIONPAGES"||e.field==="PAGE_X_OF_Y"?{supported:true,mutating:true}:{supported:false,reason:"insertPageField field must be 'PAGE', 'NUMPAGES', 'SECTIONPAGES', or 'PAGE_X_OF_Y'"};case "insertNote":return e.noteKind==="footnote"||e.noteKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"insertNote noteKind must be 'footnote' or 'endnote'"};case "deleteNote":return e.noteKind==="footnote"||e.noteKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"deleteNote noteKind must be 'footnote' or 'endnote'"};case "convertNote":return e.fromKind==="footnote"||e.fromKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"convertNote fromKind must be 'footnote' or 'endnote'"};case "convertAllNotes":return e.fromKind==="footnote"||e.fromKind==="endnote"?{supported:true,mutating:true}:{supported:false,reason:"convertAllNotes fromKind must be 'footnote' or 'endnote'"};case "setNoteProperties":return e.endnote?.position==="pageBottom"?{supported:false,reason:"endnote-pageBottom"}:e.footnote!==void 0||e.endnote!==void 0?{supported:true,mutating:true}:{supported:false,reason:"setNoteProperties requires footnote and/or endnote fields"};case "selectAll":case "copy":return {supported:true,mutating:false};case "cut":return {supported:true,mutating:true};case "paste":case "pasteWithoutFormatting":{if(typeof e.text!="string")return {supported:false,code:"invalidArgs",reason:"paste requires text"};let t=e.type==="paste"?e.html:void 0;return t!==void 0&&typeof t!="string"?{supported:false,code:"invalidArgs",reason:"paste html must be a string"}:e.text===""&&(t===void 0||t==="")?{supported:false,code:"invalidArgs",reason:"there is nothing to paste"}:{supported:true,mutating:true}}case "insertRow":case "deleteRow":case "insertColumn":case "deleteColumn":case "deleteTable":case "setCellFill":case "setTableCellVerticalAlignment":case "setTableBorders":case "commitTableColumnDividerResize":case "commitTableRightEdgeResize":case "mergeCells":case "splitCell":case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":{let t=hR(e);return t.supported?{supported:true,mutating:true}:{supported:false,reason:t.reason??"unsupported table command"}}case "setSelection":return "range"in e&&(wg(e.range)||ki(e.range))||"anchor"in e&&qt(e.anchor)?{supported:true,mutating:false}:{supported:false,reason:"setSelection accepts { anchor: { paraId } }, a { range } whose from/to are paraId anchors, or a { range } carrying a semantic { anchor: { paragraphId, offset }, head } selection"};case "insertTextBox":return {supported:true,mutating:true};case "insertImage":return e.data instanceof Uint8Array&&(e.mime==="image/png"||e.mime==="image/jpeg"||e.mime==="image/gif")&&Number.isFinite(e.widthPoints)&&Number.isFinite(e.heightPoints)&&e.widthPoints>0&&e.heightPoints>0?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"insertImage requires png/jpeg/gif bytes and finite dimensions"};case "replaceImage":return e.data instanceof Uint8Array?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};case "deleteImage":return {supported:true,mutating:true};case "setImageWrapType":return ["inline","square","squareLeft","squareRight","tight","through","topAndBottom","behind","inFront"].includes(e.target)?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported wrap target"};case "transformImage":return e.action==="rotateCW"||e.action==="rotateCCW"||e.action==="flipH"||e.action==="flipV"?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported transform action"};case "setImagePosition":return {supported:true,mutating:true};case "setImageProperties":return {supported:true,mutating:true};case "insertBookmark":case "deleteBookmark":case "keepFirstBookmark":case "goToBookmark":return typeof e.name=="string"&&e.name.length>0?{supported:true,mutating:e.type!=="goToBookmark"}:{supported:false,code:"invalidArgs",reason:`${e.type} needs a name`};case "setWatermark":{let t=fg(e.watermark);return t?{supported:false,code:"invalidArgs",reason:t}:{supported:true,mutating:true}}default:return {supported:false,reason:Ig(e.type)}}}function Ig(e){return `command '${e}' is not supported by the tree editor`}var sn="comments and tracked changes require the pro review module (@docx-editor.dev/pro)",MR="realtime collaboration requires the pro collaboration module (@docx-editor.dev/pro)",Er="suggesting mode needs an author; configure author before enabling it",C8="this document asks for tracked changes, but no author is configured",au="this document is protected for filling in forms, which does not track changes",Pg="this document permits editing only as tracked changes",yl="image changes are not supported in suggesting mode",Pa="this revision kind has no structural accept/reject yet",Ri="this document is protected against editing; open it in Word to change that",Pi="this document is protected for comments only",Rg={mode:null,rejection:null};function Tg(e,t){if(e===void 0||e==="view")return Rg;if(e==="edit")return {mode:"editing",rejection:null};let n=AR(t);return n!==null?{mode:null,rejection:n.reason}:{mode:"suggesting",rejection:null}}function AR(e){return e.reviewEnabled?e.hasAuthor?null:{ok:false,code:"invalidArgs",reason:Er}:{ok:false,code:"unsupported",reason:sn}}function FR(e){let t=false,n=null,r=e.log??(o=>console.error(o));return {report(o){o!==Er||t||n!==null||(n=globalThis.setTimeout(()=>{if(n=null,!e.stillMissing())return;t=true;let i=`${Er}. Edits are not tracked until an author is set (the author option at construction, setAuthor(), or the adapter author prop).`;e.emit(en("suggestingNeedsAuthor",i)),r(`[@docx-editor.dev/core] ${i}`);},0));},dispose(){n!==null&&globalThis.clearTimeout(n),n=null;}}}function Eg(e){if(e.restrictedToReadOnly)return e.currentMode==="viewing"?Rg:{mode:"viewing",rejection:Ri};let t=e.currentMode,n=null;e.engineAdoptedViewing&&t==="viewing"&&!e.viewOnly&&(n="editing",t="editing");let r=n===null?Rg:{mode:n,rejection:null};return e.restrictedToComments?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:Pi}:r:e.restrictedToForms?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:au}:r:e.viewOnly||t!=="editing"||e.readerChoseMode||!(e.trackRevisions&&!e.hostChoseMode)&&!e.restrictedToTrackedChanges||!e.reviewEnabled?r:e.hasAuthor?{mode:"suggesting",rejection:null}:{mode:n,rejection:C8}}function LR(e){return e===null?{enter:true,rejection:null}:{enter:false,rejection:e.reason}}function DR(e,t){return t!=="viewing"&&e.restrictedToReadOnly?{ok:false,code:"locked",reason:Ri}:t==="suggesting"&&e.restrictedToComments?{ok:false,code:"locked",reason:Pi}:t==="suggesting"&&e.restrictedToForms?{ok:false,code:"locked",reason:au}:t!=="editing"||!e.restrictedToTrackedChanges?null:{ok:false,code:"locked",reason:Pg}}function NR(e,t,n,r){return e&&r!=="viewing"?{ok:false,code:"locked",reason:"this document was opened for viewing"}:(r==="suggesting"?AR(t()):null)??DR(n(),r)}function HR(e,t,n,r,o,i=false){let a=Tg(e,t),s=e==="view"?"viewing":a.mode??o,l=Eg({...t,...n,viewOnly:e==="view",hostChoseMode:e!==void 0,readerChoseMode:false,currentMode:s,engineAdoptedViewing:i});l.mode!==null&&(s=l.mode);let c=DR(n,s),d=n.restrictedToReadOnly?"viewing":r;return {mode:c===null?s:d,rejection:l.rejection??c?.reason??null,configurationRejection:a.rejection}}var _R=new WeakMap;function BR(e,t){_R.set(e,t);}var Cg=new WeakMap;function $R(e,t){let n=chunkZOZI27AW_cjs.pj(t);n&&Cg.set(e,n);}function qR(e){return Cg.get(e)}var Og="this document is protected for tracked changes; their authors cannot change",Ti="this document is protected; only form fields can be filled";function sr(e,t){if(e.type==="undo"||e.type==="redo"||e.type==="toggleDocumentProtection")return null;let n=chunkZOZI27AW_cjs.fh(t.session.currentPackage()),r=chunkZOZI27AW_cjs.Zg(n?.root);if(!r.enforced)return null;if(r.edit==="readOnly"||r.edit==="comments")return {ok:false,code:"locked",reason:r.edit==="comments"?Pi:Ri};if(r.edit==="trackedChanges"&&e.type==="setReviewChangesAuthor")return {ok:false,code:"locked",reason:Og};if(r.edit!=="forms"||Oo(e))return null;let o="structure",i,a=false;switch(e.type){case "insertText":o="text",i=e.text;break;case "paste":case "pasteWithoutFormatting":o="text",i=e.text,a=true;break;case "deleteText":case "cut":o="text";break;case "toggleMark":case "setMarkAttr":case "pasteFormatting":o="runFormat";break;case "clearFormatting":case "setAlignment":case "setParagraphDirection":case "setLineSpacing":case "setParagraphSpacing":case "setIndent":case "adjustIndent":case "toggleList":case "setParagraphStyle":case "setParagraphFormat":case "removeTabMark":o="paragraph";break;case "setPageSetup":case "setHeaderFooterOptions":case "setWatermark":case "convertAllNotes":case "insertToc":case "refreshToc":case "replaceAllMatches":case "resolveAllReviewChanges":case "setReviewChangesAuthor":case "acceptRevision":case "rejectRevision":case "acceptAllRevisions":case "rejectAllRevisions":o="document";break}let s=t.state().selection,l=t.session.storyParts().find(f=>s.head.paragraphId.startsWith(`${f.name}#`));if(!l)return {ok:false,code:"locked",reason:Ti};let c=t.state().cellSelection;return (c&&(o==="runFormat"||o==="paragraph")?[...chunk6NVZNB7O_cjs.la(t.layout(),c.cellIds)].map(f=>({anchor:{paragraphId:f,offset:0},head:{paragraphId:f,offset:(chunkZOZI27AW_cjs.Tk(l,f)??"").length}})):[s]).some(f=>chunkZOZI27AW_cjs.zj(l,n,{selection:f,intent:o,text:i,paste:a,fieldId:_R.get(t)?.()??void 0,contentLockPolicy:Cg.get(t)}))?{ok:false,code:"locked",reason:Ti}:null}function WR(e,t){if(e!=="locked")return e;let n=chunkZOZI27AW_cjs.Zg(t);return n.enforced?n.edit==="comments"?Pi:n.edit==="forms"?Ti:Ri:"this content is locked"}function jR(e){return e!==null&&sr({type:"resolveAllReviewChanges"},e)!==null}function KR(e,t){return ()=>e()??(t()?null:"the document is read-only")}var O8="this content is locked",M8=new Set(["toggleMark","setMarkAttr","clearFormatting"]),su=Number.MAX_SAFE_INTEGER;function A8(e){let t=e.state(),n=t.cellSelection;if(n)return [...chunk6NVZNB7O_cjs.la(e.layout(),n.cellIds)].map(b=>({paragraphId:b,start:0,end:su}));let{anchor:r,head:o}=t.selection;if(r.paragraphId===o.paragraphId)return r.offset===o.offset?[{paragraphId:o.paragraphId,start:o.offset,end:o.offset}]:[{paragraphId:r.paragraphId,start:Math.min(r.offset,o.offset),end:Math.max(r.offset,o.offset)}];let i=Ct(e.session,r.paragraphId,{kind:"body"}),a=e.session.paragraphIdsIn(i),s=a.indexOf(r.paragraphId),l=a.indexOf(o.paragraphId);if(s===-1||l===-1)return [{paragraphId:r.paragraphId,start:0,end:su},{paragraphId:o.paragraphId,start:0,end:su}];let[c,d]=s<l?[r,o]:[o,r],[u,f]=s<l?[s,l]:[l,s],p=a.slice(u,f+1).map((b,h,y)=>({paragraphId:b,start:h===0?c.offset:0,end:h===y.length-1?d.offset:su})),g=p[p.length-1];return g&&g.end===0?p.slice(0,-1):p}function F8(e){return chunkZOZI27AW_cjs.dc(e.root).some(t=>chunkZOZI27AW_cjs.hc(chunkZOZI27AW_cjs.bc(t.node).lock))}function VR(e,t,n){if(!M8.has(e.type))return null;let r=e.type==="clearFormatting",o=t.editingMode()==="suggest"&&!!t.author()?.trim()&&!t.session.trackingSettings().doNotTrackFormatting,i=n?.allowFormattingInLockedContent===true&&!o,{selection:a,cellSelection:s}=t.state(),l=!s&&a.anchor.paragraphId===a.head.paragraphId&&a.anchor.offset===a.head.offset;if(i&&!r&&!l)return null;let c={ok:false,code:"locked",reason:O8};for(let d of A8(t)){let u=Ee(t.session,d.paragraphId)??t.session.part();if(!F8(u))continue;let f=chunkZOZI27AW_cjs.Xa(u,d.paragraphId);if(!f||f.kind!=="paragraph")continue;if(chunkZOZI27AW_cjs.fg(u,d.paragraphId).content)return c;if(i&&!l)continue;let p=chunkZOZI27AW_cjs.dc(f);if(p.length===0)continue;let g=chunkZOZI27AW_cjs.rg(f),b=d.start===d.end;for(let h of p){let y=g.spanOf(h.node);if(!y||!(b?y.start<d.start&&d.start<y.end:y.end>d.start&&y.start<d.end))continue;let v=chunkZOZI27AW_cjs.Ak(u,h.node.id).map(S=>chunkZOZI27AW_cjs.bc(S).lock);if(chunkZOZI27AW_cjs.hc(chunkZOZI27AW_cjs.gc(v)))return c}}return null}function UR(e){return e.borderWidthEmu!==void 0||e.borderColor!==void 0}function zR(e){return e.horizontalEmu!==void 0||e.verticalEmu!==void 0||e.relativeToH!==void 0||e.relativeToV!==void 0}function GR(e){return e.widthEmu!==void 0||e.heightEmu!==void 0||e.alt!==void 0||e.title!==void 0||e.description!==void 0||e.hyperlink!==void 0||e.crop!==void 0||e.wrap!==void 0||e.resetToNaturalSize===true||chunkZOZI27AW_cjs.yl(e)}function ZR(e,t){for(let n of e.pages){let r=L8(n.fragments,t);if(r!==void 0)return r}return null}function L8(e,t){for(let n of e)if(n.kind==="paragraph")for(let r of n.lines)for(let o of r.drawings??[]){if(o.drawingNodeId!==t)continue;if(n.fragmentIndex!==0||n.positionedFrame||n.outOfFlow)return null;let i=Math.round(o.x*12700),a=Math.round((o.y-n.box.y)*12700);return !Number.isFinite(i)||!Number.isFinite(a)?null:Object.freeze({mode:"frame",horizontalEmu:i,verticalEmu:a,relativeToH:"margin",relativeToV:"paragraph"})}}function D8(e,t,n=e.extentEmu){let r=e.picture?.transform.rotationDegrees;return e.kind==="inline"==(t==="inline")||r===void 0||Math.abs(r%180)!==90||n.cx===n.cy?null:{cx:n.cy,cy:n.cx}}function XR(e,t,n,r,o=e.drawingNodeId){let i=D8(e,t);if(!i)return;let a=n.findIndex(l=>l.op==="resizeDrawing"),s=n[a];s?.op==="resizeDrawing"?n[a]={...s,extentEmu:{cx:r?.widthEmu!==void 0||r?.resetToNaturalSize?s.extentEmu.cx:i.cx,cy:r?.heightEmu!==void 0||r?.resetToNaturalSize?s.extentEmu.cy:i.cy}}:n.push({op:"resizeDrawing",drawingNodeId:o,extentEmu:i});}var YR=new WeakMap;function QR(e,t){YR.set(e,t);}function JR(e,t,n){YR.get(e)?.(t,n);}function N8(e){return [e.left,e.top,e.right,e.bottom]}function Mg(e){return Object.freeze({left:e.left*100,top:e.top*100,right:e.right*100,bottom:e.bottom*100})}function H8(e){return Object.freeze({left:e.left/100,top:e.top/100,right:e.right/100,bottom:e.bottom/100})}function bl(e){return Math.round(e*1e3)}function vl(e){return e/1e3}function Ag(e){return Object.freeze({left:bl(e.left),top:bl(e.top),right:bl(e.right),bottom:bl(e.bottom)})}function _8(e){return Object.freeze({left:vl(e.left),top:vl(e.top),right:vl(e.right),bottom:vl(e.bottom)})}function Fg(e){return N8(e).some(n=>!Number.isFinite(n)||n<0||n>100)?false:e.left+e.right<100&&e.top+e.bottom<100}var lu=12700;function Wt(e){return Math.round(e*12700)}function Ei(e){return e/12700}function eP(e,t,n,r,o,i){let a=Ei(e),s=Ei(t),l=a/s,c=n.includes("e")?r:n.includes("w")?-r:0,d=n.includes("s")?o:n.includes("n")?-o:0;if(a=Math.max(1,a+c),s=Math.max(1,s+d),i)if(n.length===2){let f=Math.max(a/Ei(e),s/Ei(t));a=Math.max(1,Ei(e)*f),s=Math.max(1,a/l);}else n==="e"||n==="w"?s=Math.max(1,a/l):a=Math.max(1,s*l);return Object.freeze({cx:Wt(a),cy:Wt(s)})}function cu(e,t,n){return e.mode==="simple"?Object.freeze({mode:"simple",horizontalEmu:(e.horizontalEmu??0)+Wt(t),verticalEmu:(e.verticalEmu??0)+Wt(n)}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu+Wt(t)}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu+Wt(n)}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}var B8=new Set(["insertImage","replaceImage"]),$8=new Set(["insertImage","replaceImage","deleteImage","setImageWrapType","transformImage","setImagePosition","setImageProperties"]);function Lg(e,t,n){return e.accessibility.hidden||n!==null&&e.drawingNodeId!==n?false:e.start===t||e.start+1===t}function q8(e,t,n,r){if(!e)return null;for(let o of e.drawings??[])if(o.paragraphId===t&&Lg(o,n,r))return o;return null}function W8(e,t,n,r){let o=e.layout();for(let i of o.pages){for(let a of i.anchoredDrawings??[])if(a.anchorParagraphId===t&&Lg(a,n,r))return a;for(let a of [i.header,i.footer])if(a){for(let s of a.anchoredDrawings??[])if(s.anchorParagraphId===t&&Lg(s,n,r))return s}}return null}function nP(e){return e.kind==="pointer"?`pointer:${e.drawingNodeId}`:e.kind}function On(e){if(!e)return null;let t=e.drawingSelectionIntent();if(t.kind==="none")return null;let{anchor:n,head:r}=e.state().selection;if(n.paragraphId!==r.paragraphId||n.offset!==r.offset)return null;let o=chunkFDSL5OJU_cjs.Hd(e.layout(),n.paragraphId,n.offset),i=t.kind==="pointer"?t.drawingNodeId:null;return q8(o,n.paragraphId,n.offset,i)??W8(e,n.paragraphId,n.offset,i)}function Ng(e,t){let n=e.storyScope(),r=e.session.partFor(n)??e.session.part(),o=chunkZOZI27AW_cjs.Xa(r,t.drawingNodeId);return o?o.kind!=="drawing"?chunkZOZI27AW_cjs.ul(r,t.drawingNodeId):chunkZOZI27AW_cjs.Ud(o,{ownerPartName:t.ownerPartName,supportedMcRequires:chunkZOZI27AW_cjs.Nd,limits:chunkZOZI27AW_cjs.Md,resolveRelationship:chunkZOZI27AW_cjs.Pd(e.session.currentPackage(),t.ownerPartName)}):null}function rP(e){if(e.kind!=="anchored"||!e.position)return null;let t=e.position;return e.anchor?.simplePos?Object.freeze({mode:"simple",horizontalEmu:t.simplePosition.xEmu,verticalEmu:t.simplePosition.yEmu}):Object.freeze({mode:"frame",...t.horizontal.offsetEmu!==null?{horizontalEmu:t.horizontal.offsetEmu}:{},...t.vertical.offsetEmu!==null?{verticalEmu:t.vertical.offsetEmu}:{},relativeToH:t.horizontal.relativeFrom,relativeToV:t.vertical.relativeFrom})}function j8(e){let t=e.resource;return t.kind!=="ready"?null:Object.freeze({pixelWidth:t.pixelWidth,pixelHeight:t.pixelHeight,dpiX:t.dpiX,dpiY:t.dpiY})}function oP(e){let t=e.locks,n=e.kind==="inline"&&e.textboxStory!==null;return Object.freeze({canResize:!n&&!t.resize&&!e.hidden,canMove:!n&&!t.move&&!e.hidden,canChangeWrap:e.picture!==null&&!t.move&&!e.hidden,canCrop:e.picture!==null&&!t.resize&&!t.changeAspect&&!e.hidden})}function K8(e){return e.kind==="inlineDrawing"?"inline":e.wrap}var iP=e=>e.placeholderGraphicKind===null||!!e.textboxStory;function Cr(e){let t=On(e);if(!t||!iP(t))return null;let n=e?Ng(e,t):null;if(!n||n.hidden||n.locks.select)return null;let r=t.transform;return Object.freeze({id:t.drawingNodeId,kind:n.kind,widthEmu:n.extentEmu.cx,heightEmu:n.extentEmu.cy,crop:Mg(t.crop),rotationDegrees:r.rotationDegrees,wrap:K8(t),position:rP(n),name:n.name,title:n.title,description:n.description,hyperlink:n.hyperlinkHref,locks:n.locks,hidden:n.hidden,resourceStatus:t.resource.kind,intrinsic:j8(t),...oP(n)})}function aP(e,t){return e===t?true:!e||!t?false:e.id===t.id&&e.kind===t.kind&&e.widthEmu===t.widthEmu&&e.heightEmu===t.heightEmu&&e.crop.left===t.crop.left&&e.crop.top===t.crop.top&&e.crop.right===t.crop.right&&e.crop.bottom===t.crop.bottom&&e.rotationDegrees===t.rotationDegrees&&e.wrap===t.wrap&&e.name===t.name&&e.title===t.title&&e.description===t.description&&e.hyperlink===t.hyperlink&&e.hidden===t.hidden&&e.resourceStatus===t.resourceStatus&&e.canResize===t.canResize&&e.canMove===t.canMove&&e.canChangeWrap===t.canChangeWrap&&e.canCrop===t.canCrop&&e.locks.select===t.locks.select&&e.locks.move===t.locks.move&&e.locks.resize===t.locks.resize&&e.locks.changeAspect===t.locks.changeAspect&&(e.position?.mode??"frame")===(t.position?.mode??"frame")&&(e.position?.horizontalEmu??null)===(t.position?.horizontalEmu??null)&&(e.position?.verticalEmu??null)===(t.position?.verticalEmu??null)&&(e.position?.relativeToH??null)===(t.position?.relativeToH??null)&&(e.position?.relativeToV??null)===(t.position?.relativeToV??null)&&(e.intrinsic?.pixelWidth??null)===(t.intrinsic?.pixelWidth??null)&&(e.intrinsic?.pixelHeight??null)===(t.intrinsic?.pixelHeight??null)&&(e.intrinsic?.dpiX??null)===(t.intrinsic?.dpiX??null)&&(e.intrinsic?.dpiY??null)===(t.intrinsic?.dpiY??null)}function Hg(e){if("drawingNodeId"in e&&typeof e.drawingNodeId=="string")return e.drawingNodeId}function sP(e){if("expectedPackageRevision"in e&&typeof e.expectedPackageRevision=="number")return e.expectedPackageRevision}function _g(e){return Hg(e)!==void 0||sP(e)!==void 0||e.type==="setImageProperties"&&e.selectionParagraphId!==void 0}function Bg(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};let o=sP(t);if(o!==void 0&&r.session.packageRevision()!==o)return {ok:false,code:"notFound",reason:"stale package revision"};let i=Hg(t),a=Cr(r);if(i!==void 0&&(!a||a.id!==i))return {ok:false,code:"notFound",reason:"stale drawing selection"};if(t.type==="setImageProperties"&&t.selectionParagraphId!==void 0&&t.selectionOffset!==void 0){let{anchor:s,head:l}=r.state().selection;if(s.paragraphId!==t.selectionParagraphId||s.offset!==t.selectionOffset||l.paragraphId!==t.selectionParagraphId||l.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return Ta(e,n,{requireDrawing:i!==void 0||n.drawingNodeId!==null,drawingNodeId:i??n.drawingNodeId??void 0})}function Mo(e,t){let n=Cr(e),r=Hg(t);return r?!n||n.id!==r?{ok:false,code:"notFound",reason:"stale drawing selection"}:{id:r}:n?{id:n.id}:{ok:false,code:"notFound",reason:"no drawing is selected"}}function V8(e){return e.rejected?{ok:false,code:"invalidArgs",reason:e.reason==="drawing-locked"?"the drawing is locked":e.reason==="unknown-drawing"?"stale drawing selection":typeof e.reason=="string"?e.reason:"the image change was refused"}:null}function tP(e,t,n){if(n==="inline")return [];let r=ZR(e.layout(),t);return r?[{op:"positionDrawing",drawingNodeId:t,position:r}]:[]}function Dg(e,t,n,r){let o=On(e),i=o&&Ng(e,o);i&&XR(i,t,n,r,o.drawingNodeId);}function du(e,t){return V8(e.applyDrawingOps(t))}function U8(e){if(!e.intrinsic)return null;let t=Math.round(e.intrinsic.pixelWidth*914400/e.intrinsic.dpiX),n=Math.round(e.intrinsic.pixelHeight*914400/e.intrinsic.dpiY);return !Number.isFinite(t)||!Number.isFinite(n)||t<=0||n<=0?null:{cx:t,cy:n}}function lP(e,t){return t?.position?.mode==="simple"?Object.freeze({mode:"simple",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu}:{}}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}function xl(e){return $8.has(e.type)}function z8(e){return B8.has(e.type)}function cP(e){return {ok:false,code:"unsupported",reason:`${e.type} is asynchronous; use executeImageCommand`}}function dP(e,t){if(!e)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=e.editingMode();return n==="view"?{ok:false,code:"locked",reason:"the document is open for viewing"}:n==="suggest"&&t==="replaceImage"?{ok:false,code:"invalidArgs",reason:yl}:null}function Sl(e){let t=e.surface;if(!t)return null;let{anchor:n}=t.state().selection,r=Cr(t);return Object.freeze({mountGeneration:e.mountGeneration,packageRevision:t.session.packageRevision(),drawingNodeId:r?.id??null,selectionParagraphId:n.paragraphId,selectionOffset:n.offset})}function Ta(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};if(e.mountGeneration!==t.mountGeneration)return {ok:false,code:"notFound",reason:"the editor is no longer attached"};let{anchor:o,head:i}=r.state().selection;if(o.paragraphId!==t.selectionParagraphId||o.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(o.paragraphId!==i.paragraphId||o.offset!==i.offset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(n?.requireDrawing){let a=Cr(r),s=n.drawingNodeId??t.drawingNodeId;if(!a||!s||a.id!==s)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return null}var $g="a picture is selected; place the caret in text to insert a picture";function Ea(e,t){if(!xl(e))return null;if(!t)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=sr(e,t);if(n)return n;if(e.type==="insertImage")return On(t)?{ok:false,code:"invalidArgs",reason:$g}:!(e.data instanceof Uint8Array)||e.data.byteLength===0?{ok:false,code:"invalidArgs",reason:"insertImage requires image bytes"}:!Number.isFinite(e.widthPoints)||!Number.isFinite(e.heightPoints)?{ok:false,code:"invalidArgs",reason:"insertImage requires finite dimensions"}:e.widthPoints<=0||e.heightPoints<=0?{ok:false,code:"invalidArgs",reason:"insertImage dimensions must be positive"}:null;let r=On(t);if(r&&"textboxStory"in r&&r.textboxStory&&(e.type==="replaceImage"||e.type==="transformImage"||e.type==="setImageProperties"&&e.hyperlink!==void 0))return {ok:false,code:"unsupported",reason:"this operation is not supported for textboxes"};if(e.type==="replaceImage"){if(!(e.data instanceof Uint8Array)||e.data.byteLength===0)return {ok:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};let l=Mo(t,e);return "ok"in l?l:null}let i=Mo(t,e);if("ok"in i)return i;let a=Cr(t);if(!a)return {ok:false,code:"notFound",reason:"no drawing is selected"};let s=e.type==="setImageWrapType"?e.target:e.type==="setImageProperties"?e.wrap:void 0;if(s!==void 0&&a.locks.resize){let l=[];if(Dg(t,s,l),l.length)return {ok:false,code:"locked",reason:"the drawing size is locked"}}if(t.editingMode()==="suggest"&&e.type!=="deleteImage")return {ok:false,code:"invalidArgs",reason:yl};switch(e.type){case "deleteImage":return a.locks.select?{ok:false,code:"locked",reason:"the drawing cannot be selected"}:null;case "setImageWrapType":return a.canChangeWrap?null:{ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};case "transformImage":return a.locks.changeAspect||a.locks.resize?{ok:false,code:"locked",reason:"the drawing is locked"}:null;case "setImagePosition":if(!a.canMove||a.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};if(!zR(e))return {ok:false,code:"invalidArgs",reason:"setImagePosition requires at least one field"};let l=a.position?.mode??"frame";return chunkZOZI27AW_cjs.Al(e,l)?chunkZOZI27AW_cjs.vl(lP(e,a))?null:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"}:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"};case "setImageProperties":{if(UR(e))return {ok:false,code:"unsupported",reason:"image border properties are not supported yet"};if(!GR(e))return {ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"};if(e.resetToNaturalSize&&!a.intrinsic)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};if(e.widthEmu!==void 0&&(!Number.isFinite(e.widthEmu)||e.widthEmu<=0))return {ok:false,code:"invalidArgs",reason:"widthEmu must be a positive finite number"};if(e.heightEmu!==void 0&&(!Number.isFinite(e.heightEmu)||e.heightEmu<=0))return {ok:false,code:"invalidArgs",reason:"heightEmu must be a positive finite number"};if(e.widthEmu!==void 0&&!a.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.heightEmu!==void 0&&!a.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.crop!==void 0&&!Fg(e.crop))return {ok:false,code:"invalidArgs",reason:"crop values are out of range"};if(e.crop!==void 0&&!a.canCrop)return {ok:false,code:"locked",reason:"crop cannot be changed on this drawing"};if(e.hyperlink!==void 0&&e.hyperlink!==null&&!chunkZOZI27AW_cjs.U(e.hyperlink).ok)return {ok:false,code:"invalidArgs",reason:"unsafe hyperlink URL"};if(e.wrap!==void 0&&!a.canChangeWrap)return {ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};if(chunkZOZI27AW_cjs.yl(e)){if(!a.canMove||a.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};let c=a.position?.mode??"frame";if(!chunkZOZI27AW_cjs.Al(e,c))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"};if(!chunkZOZI27AW_cjs.vl(chunkZOZI27AW_cjs.zl(e,a)))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"}}return null}default:return null}}function qg(e,t){let n=dP(t,e.type);if(n)return n;let r=Ea(e,t);return r||{ok:true}}function uP(e,t){let n=Ea(e,t);return n||cP(e)}function Wg(e,t,n){if(z8(t))return cP(t);let r=n&&_g(t)?Sl(n):null;if(r&&n){let o=Bg(n,t,r);if(o)return o}switch(t.type){case "deleteImage":{let o=Mo(e,t);if("ok"in o)return o;let i=e.deleteImage(o.id);return i.ok?null:{ok:false,code:"invalidArgs",reason:i.detail??i.reason??"deleteImage was refused"}}case "setImageWrapType":{let o=Mo(e,t);if("ok"in o)return o;let i=[];return Dg(e,t.target,i),du(e,[...i,{op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.target},...tP(e,o.id,t.target)])}case "transformImage":{let o=Mo(e,t);return "ok"in o?o:du(e,[{op:"transformDrawing",drawingNodeId:o.id,action:t.action}])}case "setImagePosition":{let o=Mo(e,t);if("ok"in o)return o;let i=Cr(e),a=lP(t,i);return du(e,[{op:"positionDrawing",drawingNodeId:o.id,position:a}])}case "setImageProperties":{let o=Mo(e,t);if("ok"in o)return o;let i=Cr(e);if(!i)return {ok:false,code:"notFound",reason:"no drawing is selected"};let a=[];if(t.resetToNaturalSize){let c=U8(i);if(!c)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};a.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:c});}else (t.widthEmu!==void 0||t.heightEmu!==void 0)&&a.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:{cx:t.widthEmu??i.widthEmu,cy:t.heightEmu??i.heightEmu}});t.crop!==void 0&&a.push({op:"cropDrawing",drawingNodeId:o.id,crop:Ag(t.crop)});let s=t.title??t.alt,l=t.description??t.alt;if((s!==void 0||l!==void 0)&&a.push({op:"setDrawingMetadata",drawingNodeId:o.id,title:s??i.title,description:l??i.description}),t.wrap!==void 0&&(Dg(e,t.wrap,a,t),a.push({op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.wrap}),a.push(...tP(e,o.id,t.wrap))),chunkZOZI27AW_cjs.yl(t)){let c=chunkZOZI27AW_cjs.zl(t,i);a.push({op:"positionDrawing",drawingNodeId:o.id,position:c});}if(t.hyperlink!==void 0){let c=e.applyImageProperties({drawingNodeId:o.id,ops:a,hyperlink:t.hyperlink});return c.ok?null:{ok:false,code:"invalidArgs",reason:c.detail??c.reason??"setImageProperties was refused"}}return a.length===0?{ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"}:du(e,a)}default:return null}}function G8(e,t,n,r,o){let i=chunkFDSL5OJU_cjs.$c(e.sectionPropertiesAt(t)),a=i.width-i.margin.left-i.margin.right,s=chunkFDSL5OJU_cjs.Qc(i),l=i.height-s.top-s.bottom,c=chunkFDSL5OJU_cjs.Hd(e.layout(),t,n),d=c&&c.box.width>0?Math.min(c.box.width,a):a,u=Math.min(1,d/r,l/o);return u>=1?{widthPoints:r,heightPoints:o}:{widthPoints:r*u,heightPoints:o*u}}async function jg(e,t){let n=await Z8(e,t);return JR(e,t,n),n}async function Z8(e,t){let n=e.surface;if(!n)return {ok:false,code:"notFound",reason:"no document is loaded"};let r=dP(n,t.type);if(r)return r;let o=Ea(t,n);if(o)return o;let i=Sl(e);if(!i)return {ok:false,code:"notFound",reason:"no document is loaded"};if(t.type==="insertImage"){let{anchor:u}=n.state().selection,f=t.expectedPackageRevision??i.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let p=G8(n,u.paragraphId,u.offset,t.widthPoints,t.heightPoints),g=await n.insertImage({paragraphId:u.paragraphId,offset:u.offset,bytes:t.data,mime:t.mime,widthPoints:p.widthPoints,heightPoints:p.heightPoints,expectedPackageRevision:f,commitGuard:()=>Ta(e,i)===null,...t.title!==void 0?{title:t.title}:{},...t.description!==void 0?{description:t.description}:{},...t.hyperlink!==void 0?{hyperlink:t.hyperlink}:{}}),b=Ta(e,i);return b||(g.ok?{ok:true,changed:g.change!==null}:{ok:false,code:"invalidArgs",reason:g.detail==="stale-package-epoch"?"stale package revision":g.detail??g.reason??"insertImage was refused"})}let a=Mo(n,t);if("ok"in a)return a;let s=t.expectedPackageRevision??i.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let l=t.mime??"image/png",c=await n.replaceImage(a.id,t.data,l,{expectedPackageRevision:s,commitGuard:()=>Ta(e,i,{requireDrawing:true,drawingNodeId:a.id})===null}),d=Ta(e,i,{requireDrawing:true,drawingNodeId:a.id});return d||(c.ok?{ok:true,changed:c.change!==null}:{ok:false,code:"invalidArgs",reason:c.detail==="stale-package-epoch"?"stale package revision":c.detail??c.reason??"replaceImage was refused"})}var X8=1,Y8=10;function Q8(e,t){if(!t||t.hidden||t.locks.select||!iP(e))return Object.freeze({canResize:false,canMove:false,aspectLocked:true});let n=oP(t);return Object.freeze({canResize:n.canResize,canMove:n.canMove,aspectLocked:t.locks.changeAspect})}function J8(e){if(!e)return null;let t=e.activeScope(),{anchor:n,head:r}=e.state().selection;if(t.kind!=="frame"&&(n.paragraphId!==r.paragraphId||n.offset!==r.offset))return null;let o=t.kind==="frame"?chunkFDSL5OJU_cjs.re(e.layout(),t.drawingNodeId)?.record:On(e);if(!o||o.accessibility.hidden)return null;let i=e.layout(),a=chunkFDSL5OJU_cjs.re(i,o.drawingNodeId);if(!a)return null;let s=Ng(e,o);if(!s||s.locks.select)return null;let l=Q8(o,s),d=e.editingMode()==="edit"&&e.session.editable?l:{...l,canResize:false,canMove:false},u=o.kind==="anchoredDrawing"?Object.freeze({x:o.horizontalFrameOrigin,y:o.verticalFrameOrigin}):null;return Object.freeze({id:o.drawingNodeId,textbox:"textboxStory"in o&&!!o.textboxStory,pageIndex:a.pageIndex,x:a.x,y:a.y,width:a.width,height:a.height,kind:o.kind==="inlineDrawing"?"inline":"anchored",widthEmu:s.extentEmu.cx,heightEmu:s.extentEmu.cy,position:rP(s),anchorFrameOrigin:u,transform:o.transform,...d})}function e6(e,t){let n=e.surface;return n?n.publishedLayout().revision!==t.layoutRevision?{ok:false,code:"notFound",reason:"stale layout revision"}:n.session.packageRevision()!==t.packageRevision?{ok:false,code:"notFound",reason:"stale package revision"}:Ta(e,t.preconditions,{requireDrawing:true,drawingNodeId:t.drawingNodeId}):{ok:false,code:"notFound",reason:"no document is loaded"}}function Kg(e,t){for(let n of [e.footnotes,e.endnotes]){let r=n?.notes.find(o=>chunkFDSL5OJU_cjs.Ba(o.fragments).some(i=>i.paragraphId===t));if(r)return r}}function wl(e,t){for(let n of [e.header,e.footer]){if(!n)continue;if(chunkFDSL5OJU_cjs.Ba(n.fragments).some(o=>o.paragraphId===t))return n.box}return Kg(e,t)?.box??e.contentBox}var t6={empty:"a bookmark needs a name",tooLong:"a bookmark name has at most 40 characters",invalidStart:"a bookmark name starts with a letter",invalidCharacter:"a bookmark name holds only letters, digits and underscores"};function Vg(e){let t=chunkZOZI27AW_cjs.Lg(e);return t?t6[t]:e.startsWith("_")?"a bookmark name starts with a letter":null}var fP=new WeakMap;function n6(e){let t=fP.get(e);return t||(t=chunkZOZI27AW_cjs.Og(e),fP.set(e,t)),t}function r6(e,t){return e.kind==="body"?"body":e.kind==="notesPart"?e.noteKind:t.root.localName==="ftr"?"footer":"header"}function pP(e){return e.kind==="body"?"body":e.kind==="headerFooter"?"headerFooter":"note"}function hP(e){let t=e.options.showBookmarks===true,n=null;e.options.bookmarkMarks?.onChange(()=>{t&&n?.isConnected&&e.repaint();});let r=null,o=()=>{let c=e.session.storyParts();if(r?.parts.length===c.length&&r.parts.every((u,f)=>u===c[f]))return r.entries;let d=[];for(let u of c){let f=Um(e.session,u.name,{kind:"body"}),p=r6(f,u);for(let g of n6(u))d.push({record:g,scope:f,partName:u.name,place:p});}return r={parts:c,entries:d},d},i=c=>{let d=chunkZOZI27AW_cjs.Ng(c);return o().find(u=>chunkZOZI27AW_cjs.Ng(u.record.name)===d)??null},a=(c,d,u=[])=>{let f=false;return e.commit(()=>(f=e.session.applyTreeOps([c],void 0,void 0,d,{packageEdits:u}).committed,f)),f},s=c=>Vg(c)??e.writeRefusal(),l=()=>{let c=e.orderedRange().from,d=JSON.stringify(e.storyScope()),u,f=g=>(u??=new Map(e.session.paragraphIdsIn(e.storyScope()).map((b,h)=>[b,h]))).get(g)??-1,p=(g,b)=>g===c.paragraphId?[0,b-c.offset]:[f(g)-f(c.paragraphId),0];return (g,b)=>{if(JSON.stringify(b)!==d)return false;let[h,y]=p(g.start.paragraphId,g.start.offset),[x,v]=p(g.end.paragraphId,g.end.offset),S=h<0||h===0&&y<=0,I=x>0||x===0&&v>=0;return S&&I}};return {list(){let c=l(),d=new Map;for(let{record:p}of o()){let g=chunkZOZI27AW_cjs.Ng(p.name);d.set(g,(d.get(g)??0)+p.copies);}let u=new Set,f=[];for(let{record:p,scope:g,place:b}of o()){let h=chunkZOZI27AW_cjs.Ng(p.name);u.has(h)||(u.add(h),f.push(Object.freeze({name:p.name,hidden:p.hidden,story:pP(g),place:b,order:f.length,empty:p.start.paragraphId===p.end.paragraphId&&p.start.offset===p.end.offset,atSelection:c(p,g),duplicates:(d.get(h)??1)-1})));}return f},insertRefusal:s,insert(c){if(s(c))return false;let d=e.storyScope(),u=e.orderedRange(),f=chunkZOZI27AW_cjs.Ng(c),p=new Set(o().filter(g=>chunkZOZI27AW_cjs.Ng(g.record.name)===f&&JSON.stringify(g.scope)!==JSON.stringify(d)).map(g=>g.partName));return a({op:"insertBookmark",name:c,start:{paragraphId:u.from.paragraphId,offset:u.from.offset},end:{paragraphId:u.to.paragraphId,offset:u.to.offset}},d,[...p].map(g=>b=>chunkZOZI27AW_cjs.lj(b,g,c)))},remove(c){let d=i(c);if(!d||e.writeRefusal()!==null)return false;let u=chunkZOZI27AW_cjs.Ng(c),f=new Set(o().filter(p=>chunkZOZI27AW_cjs.Ng(p.record.name)===u&&p.partName!==d.partName).map(p=>p.partName));return a({op:"deleteBookmark",name:c},d.scope,[...f].map(p=>g=>chunkZOZI27AW_cjs.lj(g,p,c)))},keepFirst(c){let d=i(c);if(!d||e.writeRefusal()!==null)return false;let u=chunkZOZI27AW_cjs.Ng(c),p=[...new Set(o().filter(b=>chunkZOZI27AW_cjs.Ng(b.record.name)===u&&b.partName!==d.partName).map(b=>b.partName))].map(b=>h=>chunkZOZI27AW_cjs.lj(h,b,c));if(d.record.copies>1)return a({op:"deleteBookmark",name:c,keepFirst:true},d.scope,p);if(p.length===0)return false;let g=false;return e.commit(()=>(g=e.session.applyTreeOps([],void 0,void 0,d.scope,{packageEdits:p}).committed,g)),g},writeRefusal:()=>e.writeRefusal(),goTo(c){let d=i(c);if(!d)return false;let{start:u,end:f}=d.record,p=e.goToPosition(u,{orShow:true,center:true});return p?(p===true&&e.setSelection({anchor:u,head:f}),true):false},shown:()=>t,setShown(c){c!==t&&(e.beforeChange(),t=c,e.repaint());},paint(c){if(n=c.layer,!t){c.layer.replaceChildren();return}let d=e.options.bookmarkMarks?.current()??{};c.layer.classList.toggle("docx-bookmark-overlay--print",d.print===true);let u=d.include??"visible",f=[],p=new Set;for(let{record:g,scope:b,partName:h}of o()){let y=chunkZOZI27AW_cjs.Ng(g.name);if(p.has(y))continue;p.add(y);let x={name:g.name,hidden:g.hidden,story:pP(b)};if(u==="visible"?g.hidden:u!=="all"&&!u(x))continue;let v=g.start.paragraphId===g.end.paragraphId&&g.start.offset===g.end.offset,S=b.kind==="headerFooter"?h:void 0;if(v){f.push({...x,edge:"point",...g.start,repeats:S});continue}f.push({...x,edge:"start",...g.start,repeats:S},{...x,edge:"end",...g.end,repeats:S});}i6(c,f,d.decorate,e.options.bookmarkMarks?.reportError);}}}var mP=new WeakMap,gP=new WeakSet;function o6(e){gP.has(e)||(gP.add(e),e.addEventListener("mousedown",t=>{let r=t.target?.localName;r==="input"||r==="select"||r==="textarea"||t.preventDefault();}));}function i6(e,t,n,r){let{layer:o,layout:i,scale:a}=e,s=o.ownerDocument;o6(o),o.style.setProperty("--docx-bookmark-scale",String(a));let l=[],c=e.pages?[...e.pages]:i.pages.map((f,p)=>p),d=mP.get(i);d||mP.set(i,d=new Map);let u=d;for(let f of t){let p={paragraphId:f.paragraphId,offset:f.offset},g=(y,x)=>{let v=`${f.paragraphId}:${y}:${x??""}`;if(u.has(v))return u.get(v);let S=chunkFDSL5OJU_cjs.ze(i,{paragraphId:f.paragraphId,offset:y},{...e.measurer?{measurer:e.measurer}:{},...x!==void 0?{preferredPageIndex:x}:{}});return u.set(v,S),S},b=f.repeats?c.map(y=>g(p.offset,y)):[g(p.offset)],h=new Set;for(let y of b){if(!y||!(y.height>0)||h.has(y.pageIndex)||e.pages&&!e.pages.has(y.pageIndex))continue;let x=i.pages[y.pageIndex];if(!x)continue;let v=e.pageOffsetX?.get(y.pageIndex)??0,S=f.repeats?[x.header,x.footer].find(w=>w?.partName===f.repeats):f.story==="note"?Kg(x,f.paragraphId):void 0;if((f.repeats||f.story==="note")&&!S)continue;let I=S?.box??x.contentBox;h.add(y.pageIndex);let C=s.createElement("div");C.className=`docx-bookmark-mark docx-bookmark-mark--${f.edge}`;let P=f.edge==="end"?p.offset-1:p.offset+1,E=P>=0?g(P,f.repeats?y.pageIndex:void 0):null;E?.lineId===y.lineId&&(f.edge==="end"?E.x>y.x:E.x<y.x)&&C.classList.add("docx-bookmark-mark--rtl");let R={name:f.name,hidden:f.hidden,story:f.story,edge:f.edge};try{C=n?.(C,R)??C;}catch(w){r?.(w);}C.dataset.bookmarkName=f.name,C.dataset.bookmarkHidden=String(f.hidden),C.dataset.bookmarkEdge=f.edge,C.dataset.bookmarkStory=f.story,C.dataset.docxMarker="",C.setAttribute("contenteditable","false"),C.style.position="absolute",C.style.left=`${(I.x+y.x+v)*a}px`,C.style.top=`${(I.y+y.y)*a}px`,C.style.height=`${y.height*a}px`,l.push(C);}}o.replaceChildren(...l);}function a6(e){return e.type==="insertBookmark"||e.type==="deleteBookmark"||e.type==="keepFirstBookmark"||e.type==="goToBookmark"}function s6(e,t){let n=chunkZOZI27AW_cjs.Ng(t);return e.bookmarkEditing.list().some(r=>chunkZOZI27AW_cjs.Ng(r.name)===n)}function Ug(e,t){if(!a6(t))return null;if(t.type==="insertBookmark"){let n=Vg(t.name);if(n)return {ok:false,code:"invalidArgs",reason:n};let r=e.bookmarkEditing.insertRefusal(t.name);return r?{ok:false,code:"locked",reason:r}:null}if(!s6(e,t.name))return {ok:false,code:"notFound",reason:"the document has no bookmark with that name"};if(t.type==="keepFirstBookmark"){let n=chunkZOZI27AW_cjs.Ng(t.name);if(!e.bookmarkEditing.list().find(o=>chunkZOZI27AW_cjs.Ng(o.name)===n)?.duplicates)return {ok:false,code:"unsupported",reason:"the bookmark has no copies"}}if(t.type!=="goToBookmark"){let n=e.bookmarkEditing.writeRefusal();if(n)return {ok:false,code:"locked",reason:n}}return null}function zg(e,t,n,r="bookmark dialog"){return t?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.canOpen()?(n&&e.open(),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:`no ${r} is registered`}}function yP(e,t){let n=Ug(e,t);return n||(t.type==="goToBookmark"?e.bookmarkEditing.goTo(t.name)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the bookmark cannot be shown"}:(t.type==="insertBookmark"?e.bookmarkEditing.insert(t.name):t.type==="keepFirstBookmark"?e.bookmarkEditing.keepFirst(t.name):e.bookmarkEditing.remove(t.name))?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:e.state().lastRejection??`${t.type} was refused`})}function bP(e){if(!e)return null;let t=e.formatting();return {bold:t.bold,italic:t.italic,underline:t.underline,strike:t.strikethrough,superscript:t.superscript,subscript:t.subscript,...t.color?{color:{kind:"hex",value:t.color}}:{},...t.highlight?{highlight:t.highlight}:{},...t.fontFamily?{fontFamily:t.fontFamily}:{},...t.fontSizeHalfPoints!==null?{fontSizePt:t.fontSizeHalfPoints/2}:{},...t.alignment?{alignment:t.alignment}:{},...t.direction?{direction:t.direction}:{},...t.styleId?{styleId:t.styleId}:{},...t.lineSpacing?{lineSpacing:t.lineSpacing}:{},...t.spaceBeforePt!==null?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==null?{spaceAfterPt:t.spaceAfterPt}:{},...t.indent!==null?{indent:t.indent}:{},paragraphFlags:t.paragraphFlags,disagrees:t.disagrees,...t.tabStops!==null?{tabStops:t.tabStops}:{}}}var Gg=new WeakMap;function vP(e,t){let n=e.isScheduled(),r=Zg(t);return r?Gg.set(e,r):n||Gg.delete(e),r??(n?Gg.get(e)??null:null)}function Zg(e){if(!e)return null;let t=e.sectionPropertiesAt(e.state().selection.head.paragraphId);return {pageWidthTwips:t.pageSize.widthTwips,pageHeightTwips:t.pageSize.heightTwips,orientation:t.landscape?"landscape":"portrait",marginsTwips:{top:t.margins.topTwips,right:t.margins.rightTwips,bottom:t.margins.bottomTwips,left:t.margins.leftTwips},gutterTwips:t.margins.gutterTwips}}function uu(e){if(!e)return null;let{anchor:t,head:n}=e.state().selection;if(t.paragraphId===n.paragraphId){let c=e.session.paraIdOf(t.paragraphId);return c===null?null:{from:{paraId:c},to:{paraId:c}}}let r=e.session.paragraphAnchors(),o=r.paraIdByNode.get(t.paragraphId),i=r.paraIdByNode.get(n.paragraphId);if(o===void 0||i===void 0)return null;let a=r.ordinalByNode.get(t.paragraphId)??0,s=r.ordinalByNode.get(n.paragraphId)??0;return s<a||s===a&&n.offset<t.offset?{from:{paraId:i},to:{paraId:o}}:{from:{paraId:o},to:{paraId:i}}}function xP(e){if(!e)return null;let t=e.hyperlinks.linkAtCaret();if(!t)return null;let n=e.session.paraIdOf(t.paragraphId);return n===null?null:{href:t.href??"",range:{from:{paraId:n},to:{paraId:n}},...t.tooltip!==void 0?{tooltip:t.tooltip}:{}}}function SP(e,t){if(!e)return [];if(t!==void 0&&t.part!=="body")return [];let n=e.session.part(),r=e.session.paragraphAnchors();return chunk25EXMBV2_cjs.d(n).map(o=>{let i=r.paraIdByNode.get(o.id),a=o.kind==="textValue"?void 0:chunk25EXMBV2_cjs.i(o);return {...i!==void 0?{paraId:i}:{},text:chunkZOZI27AW_cjs.Tk(n,o.id)??"",...a!==void 0?{styleId:a}:{}}})}function Ca(e){return e?e.state().pageCount:0}function Xg(e,t="caret"){return e?e.currentPage(t):1}function l6(e,t){if(!Oo(e))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"not a table command"}};let n=fu(e,t);return n.can.ok?{ok:true,tablePlan:n.plan}:{ok:false,refusal:{ok:false,code:n.can.code,reason:n.can.reason}}}function wP(e,t){return {command:e,part:t.session.partFor(t.storyScope())??t.session.part(),layout:t.layout(),storeRevision:t.session.packageRevision(),selection:t.state().selection,cellSelection:t.state().cellSelection,themeColors:t.session.documentThemeColors(),editable:t.session.editable,viewing:t.editingMode()==="view"}}function fu(e,t){let n=wP(e,t),r=io(n),o=chunkZOZI27AW_cjs.fh(t.session.currentPackage());return r.ok&&r.ops.some(i=>chunkZOZI27AW_cjs.Ek(n.part,o,i))&&(r={ok:false,code:"locked",reason:Ti}),r.ok&&t.editingMode()==="suggest"&&(e.type==="mergeCells"||e.type==="splitCell")&&(r={ok:false,code:"unsupported",reason:Jd}),r.ok?{can:{ok:true},plan:r}:{can:{ok:false,code:r.code,reason:r.reason},plan:r}}function kl(e,t,n,r){if(r?.scope){if(r.scope.kind==="all")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"the all scope is read-only"}};if(r.scope.kind==="note"||r.scope.kind==="frame")return {ok:false,refusal:{ok:false,code:"unsupported",reason:`scope kind '${r.scope.kind}' is not supported`}};if(r.scope.kind==="headerFooter"){let c=t?.activeScope?.()??{kind:"body"};if(c.kind!=="headerFooter"||c.rId!==r.scope.rId)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"open that header or footer before dispatching against its scope"}}}}let o=Ii(e);if(!o.supported)return {ok:false,refusal:{ok:false,code:o.code??"unsupported",reason:o.reason}};if(!t)return {ok:false,refusal:{ok:false,code:"notFound",reason:"no document is loaded"}};if(o.mutating&&(n==="view"||!t.session.editable))return {ok:false,refusal:{ok:false,code:"locked",reason:"the document is read-only"}};let i=o.mutating?sr(e,t):null;if(i)return {ok:false,refusal:i};let a=VR(e,t,qR(t));if(a)return {ok:false,refusal:a};if(e.type==="insertTextBox"){let c=tg(t);return c?{ok:false,refusal:c}:{ok:true}}if(e.type==="adjustIndent"&&!t.canAdjustIndent(e.direction))return {ok:false,refusal:{ok:false,code:"unsupported",reason:e.direction==="decrease"?"the selection is already at the outermost level":"the selection cannot indent any further"}};if(e.type==="deleteText"&&On(t)){let c=Ea({type:"deleteImage"},t);return c&&!c.ok?{ok:false,refusal:c}:{ok:true}}if(e.type==="copy"||e.type==="cut"||e.type==="deleteText"){let{anchor:c,head:d}=t.state().selection;if(c.paragraphId===d.paragraphId&&c.offset===d.offset)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing is selected"}}}if(e.type==="setParagraphStyle"&&!t.session.documentStyles().some(c=>c.type==="paragraph"))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"this document defines no paragraph styles"}};if(e.type==="pasteFormatting"&&t.formatPainter.state().level==="none")return {ok:false,refusal:{ok:false,code:"notFound",reason:qI}};if(e.type==="undo"&&!t.state().canUndo)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to undo"}};if(e.type==="redo"&&!t.state().canRedo)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to redo"}};if(e.type==="insertTable"&&!t.canInsertTable(e.rows,e.cols))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a table can only be inserted at a caret in editable body, cell, or note text"}};let s=Ug(t,e);if(s)return {ok:false,refusal:s};if(e.type==="insertToc"&&!t.canInsertToc())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a table of contents can only be inserted in the editable document body"}};if(e.type==="editTextFormField"&&!t.canEditTextFormField())return {ok:false,refusal:{ok:false,code:"unsupported",reason:"field options are unavailable"}};if(e.type==="refreshToc"&&!t.canRefreshToc(e.tocId))return {ok:false,refusal:{ok:false,code:"notFound",reason:"there is no refreshable table of contents at the selection"}};if(e.type==="insertPageField"&&(t.activeScope?.()??{kind:"body"}).kind!=="headerFooter")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"insertPageField requires an open header or footer scope"}};if(e.type==="insertNote"&&(t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"insertNote requires body scope"}};if(e.type==="insertBreak"&&(e.kind==="section"||e.kind==="sectionContinuous")){if((t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a section break can only be inserted in the editable document body"}};let d=t.sectionBreakRefusal(e.kind==="section"?"nextPage":"continuous");if(d)return {ok:false,refusal:{ok:false,code:"unsupported",reason:d}}}if(e.type==="insertBreak"&&e.kind==="page"&&(t.activeScope?.()??{kind:"body"}).kind!=="body")return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a page break can only be inserted in the editable document body"}};if(e.type==="linkHeaderFooterToPrevious"){let c=t.headerFooterState?.();if((e.sectionIndex??c?.sectionIndex??0)===0)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}}}if(Oo(e)){let c=l6(e,t);return c.ok?{ok:true,tablePlan:c.tablePlan}:c}let l=Ea(e,t);return l&&!l.ok?{ok:false,refusal:l}:{ok:true}}function kP(e,t){let n=e.session.part();if(!t.startsWith(`${n.name}#`)||!chunkZOZI27AW_cjs.Xa(n,t))return true;let r=chunkZOZI27AW_cjs.Ya(n,t),o=0;for(;r;){if(r.kind==="tableCell"||r.kind==="generic"&&r.localName==="tc"||(o+=1)>64)return true;r=chunkZOZI27AW_cjs.Ya(n,r.id);}return false}function IP(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!kP(e,t.selection.head.paragraphId))return null;let r=chunk6NVZNB7O_cjs.pa(e.layout(),t.selection.head.paragraphId);return r?{blockId:r.tableId,rowCount:r.rows,columnCount:r.columns,cell:{row:n?n.rows.from:r.rowIndex,column:n?n.columns.from:r.columnIndex}}:null}function pu(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!kP(e,t.selection.head.paragraphId))return null;let r=chunk6NVZNB7O_cjs.pa(e.layout(),t.selection.head.paragraphId);return r?{rows:r.rows,columns:r.columns,rowIndex:n?n.rows.from:r.rowIndex,columnIndex:n?n.columns.from:r.columnIndex}:null}function RP(e){if(!e)return null;let t=wP({type:"splitCell",rows:1,cols:2},e),n=chunk6NVZNB7O_cjs.qa(t.layout,t.selection.head.paragraphId,t.cellSelection);if(!n||n.cellIds.length>1)return null;let r=chunkZOZI27AW_cjs.nl(t.part,n.tableId,n.cellId);return r?{...r}:null}function PP(e){return e?{...e.bold!==void 0?{bold:e.bold}:{},...e.italic!==void 0?{italic:e.italic}:{},...e.underline!==void 0?{underline:e.underline}:{},...e.fontFamily?{fontFamily:e.fontFamily}:{},...e.fontSizePt!==void 0?{fontSizeHalfPoints:Math.round(e.fontSizePt*2)}:{},...e.styleId?{styleId:e.styleId}:{},...e.alignment?{alignment:e.alignment}:{}}:null}function TP(e){return !!e&&qn(e.session.part(),e.state().selection.head)!==void 0}var ae={undo:["M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"],redo:["M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"],print:["M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"],file_download:["M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],file_upload:["M440-320v-326L336-542l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],format_bold:["M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"],format_italic:["M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"],format_underlined:["M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"],strikethrough_s:["M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"],superscript:["M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"],subscript:["M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"],link:["M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"],format_clear:["m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"],format_paragraph:["M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z"],format_shapes:["M40-40v-240h80v-400H40v-240h240v80h400v-80h240v240h-80v400h80v240H680v-80H280v80H40Zm240-160h400v-80h80v-400h-80v-80H280v80h-80v400h80v80Zm32-120 136-360h64l136 360h-62l-32-92H408l-32 92h-64Zm114-144h108l-52-150h-4l-52 150ZM120-760h80v-80h-80v80Zm640 0h80v-80h-80v80Zm0 640h80v-80h-80v80Zm-640 0h80v-80h-80v80Zm80-640Zm560 0Zm0 560Zm-560 0Z"],lock:["M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm0-80h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80Zm-120 480v-400 400Z"],format_align_left:["M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"],format_align_center:["M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"],format_align_right:["M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"],format_align_justify:["M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"],format_line_spacing:["M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"],format_list_bulleted:["M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"],format_list_numbered:["M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"],format_indent_increase:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"],format_indent_decrease:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"],format_color_text:["M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"],ink_highlighter:["M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"],format_color_reset:["M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"],arrow_drop_down:["M480-360 280-560h400L480-360Z"],table:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"],table_chart:["M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"],grid_on:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"],table_rows:["M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"],view_column:["M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"],border_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],select_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],border_outer:["M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"],border_inner:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"],border_clear:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],add:["M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"],remove:["M200-440v-80h560v80H200Z"],delete:["M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"],delete_sweep:["M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"],call_merge:["m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"],call_split:["M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"],drag_indicator:["M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"],image:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"],format_image_left:["M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"],format_image_right:["M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"],horizontal_rule:["M160-440v-80h640v80H160Z"],flip_to_back:["M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],flip_to_front:["M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],open_with:["M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"],tune:["M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"],rotate_right:["M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"],rotate_left:["M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"],swap_horiz:["M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"],swap_vert:["M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"],shapes:["M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"],format_paint:["M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"],expand_more:["M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"],expand_less:["m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"],border_top:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_bottom:["M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_left:["M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_right:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"],border_horizontal:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h720v60H120Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],border_vertical:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-720h60v720h-60Zm165 0v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],padding:["M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"],text_rotation_none:["M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"],wrap_text:["M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"],height:["M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"],fit_width:["M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],settings:["m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"],border_color:["M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"],format_color_fill:["m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"],vertical_align_top:["M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"],vertical_align_center:["M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"],vertical_align_bottom:["M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"],line_weight:["M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"],keyboard_arrow_up:["M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"],keyboard_arrow_down:["M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"],keyboard_arrow_left:["M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"],keyboard_arrow_right:["M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"],more_vert:["M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"],page_break:["M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"],branding_watermark:["M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm0-80h640v-480H160v480Zm320-60q66 0 113-37t47-93q0-29-13-58t-34-55q-21-26-50-49t-50-31q-21 8-50 31t-50 49q-21 26-34 55t-13 58q0 56 47 93t140 37Z"],arrow_back:["M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"],search:["M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"],toc:["M120-240v-80h240v80H120Zm0-200v-80h480v80H120Zm0-200v-80h720v80H120Z"],bookmark:["M200-120v-640q0-33 23.5-56.5T280-840h400q33 0 56.5 23.5T760-760v640L480-240 200-120Zm80-122 200-86 200 86v-518H280v518Zm0-518h400-400Z"],bookmarks:["M120-40v-640q0-33 23.5-56.5T200-760h400q33 0 56.5 23.5T680-680v640L400-160 120-40Zm80-122 200-86 200 86v-518H200v518Zm560 2v-680H240v-80h520q33 0 56.5 23.5T840-840v680h-80ZM200-680h400-400Z"],done_all:["M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 57 57-425 424Zm0-226-57-56 198-198 57 56-198 198Z"],check_circle:["m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"],chat_bubble_outline:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],chat_bubble_check:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],check:["M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"],close:["m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"],add_comment:["M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],comment:["M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],edit_note:["M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"],rate_review:["M240-400h122l200-200q9-9 13.5-20.5T580-643q0-11-5-21.5T562-684l-36-38q-9-9-20-13.5t-23-4.5q-11 0-22.5 4.5T440-722L240-522v122Zm280-243-37-37 37 37ZM300-460v-38l101-101 20 18 18 20-101 101h-38Zm121-121 18 20-38-38 20 18Zm26 181h273v-80H527l-80 80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],visibility:["M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"],format_textdirection_l_to_r:["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"],format_textdirection_r_to_l:["M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"],"agent-sparkle":["m760-600-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110Zm0 560-50-110-110-50 110-50 50-110 50 110 110 50-110 50-50 110ZM360-160 260-380 40-480l220-100 100-220 100 220 220 100-220 100-100 220Zm0-194 40-86 86-40-86-40-40-86-40 86-86 40 86 40 40 86Zm0-126Z"]};var Oa={activeTarget:"all",spec:{style:"single",size:8,color:{kind:"hex",value:"000000"}}},CP=["table.borderTarget","table.borderColor","table.borderStyle","table.borderWidth","table.cellFill"];function Yg(e){return i18n.createT(i18n.en)(e)}function Il(e){return CP.includes(e)}function u6(e){return e!=null}var OP=[{value:"all",icon:"border_all",labelKey:"table.borders.all"},{value:"outside",icon:"border_outer",labelKey:"table.borders.outside"},{value:"inside",icon:"border_inner",labelKey:"table.borders.inside"},{value:"top",icon:"border_top",labelKey:"table.borders.top"},{value:"bottom",icon:"border_bottom",labelKey:"table.borders.bottom"},{value:"left",icon:"border_left",labelKey:"table.borders.left"},{value:"right",icon:"border_right",labelKey:"table.borders.right"},{value:"none",icon:"border_clear",labelKey:"table.borders.none"}],MP=[{value:"single",labelKey:"table.borderStyles.single",previewClass:"docx-table-line--single"},{value:"dashed",labelKey:"table.borderStyles.dashed",previewClass:"docx-table-line--dashed"},{value:"dotted",labelKey:"table.borderStyles.dotted",previewClass:"docx-table-line--dotted"},{value:"double",labelKey:"table.borderStyles.double",previewClass:"docx-table-line--double"},{value:"triple",labelKey:"table.borderStyles.triple",previewClass:"docx-table-line--triple"},{value:"thick",labelKey:"table.borderStyles.thick",previewClass:"docx-table-line--thick"}],f6=[{size:4,labelKey:"table.borderWidths.halfPt",previewThickness:.5},{size:8,labelKey:"table.borderWidths.onePt",previewThickness:1},{size:12,labelKey:"table.borderWidths.oneHalfPt",previewThickness:1.5},{size:16,labelKey:"table.borderWidths.twoPt",previewThickness:2},{size:24,labelKey:"table.borderWidths.threePt",previewThickness:3}];function p6(e){return e==="all"||e==="outside"||e==="inside"||e==="top"||e==="bottom"||e==="left"||e==="right"}function m6(e){return e==="none"||p6(e)}function EP(e){if(!e||typeof e!="object")return false;let t=e.kind;return t==="hex"||t==="theme"||t==="auto"}function g6(e){return MP.some(t=>t.value===e)}function Ci(e,t,n){switch(t){case "table.borderTarget":return m6(n)?n==="none"?{command:{type:"setTableBorders",scope:"none",target:e.activeTarget},nextDraft:e}:{command:{type:"setTableBorders",scope:n,spec:e.spec},nextDraft:{activeTarget:n,spec:e.spec}}:null;case "table.borderColor":{if(!EP(n))return null;let r={...e.spec,color:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.borderStyle":{if(!g6(n))return null;let r={...e.spec,style:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.borderWidth":{if(typeof n!="number"||!Number.isInteger(n))return null;let r={...e.spec,size:n};return {command:{type:"setTableBorders",scope:e.activeTarget,spec:r},nextDraft:{activeTarget:e.activeTarget,spec:r}}}case "table.cellFill":return n!==null&&!EP(n)?null:{command:{type:"setCellFill",color:n},nextDraft:e};default:return null}}function Qg(e,t=Oa){switch(e){case "table.borderTarget":return {type:"setTableBorders",scope:t.activeTarget,spec:t.spec};case "table.borderColor":return Ci(t,e,{kind:"hex",value:"000000"})?.command??null;case "table.borderStyle":return Ci(t,e,"single")?.command??null;case "table.borderWidth":return Ci(t,e,8)?.command??null;case "table.cellFill":return {type:"setCellFill",color:{kind:"hex",value:"FFFF00"}};default:return null}}function h6(e){return OP.find(n=>n.value===e)?.labelKey??"table.borders.all"}function y6(e){return ae[e]}function Ma(e){let t=[];return {current:()=>t[t.length-1]??e,push:n=>(t.push(n),()=>{let r=t.lastIndexOf(n);r>=0&&t.splice(r,1);})}}function mu(e){let t=Ma({}),n=false,r=false,o=()=>t.current().onRequest!==void 0,i=()=>{o()!==n&&(n=o(),e?.());};return {canOpen:o,open(){let a=t.current().onRequest;return a?.(),a!==void 0},shortcutOn:()=>t.current().shortcut!==false,openFromShortcut(){if(t.current().shortcut===false)return false;let a=t.current().onRequest;return a?.(),a!==void 0},register(a){let s=t.push(a);return i(),()=>{s(),!r&&(r=true,globalThis.queueMicrotask(()=>{r=false,i();}));}}}}function AP(e={}){let t=mu(e.changed),n=mu(e.changed),r=Ma({}),o=null,i={current:r.current,onChange:a=>{o=a;},reportError:a=>e.error?.(a)};return {surfaceOptions:{onRequestBookmark:t.open,onRequestGoTo:n.openFromShortcut,bookmarkMarks:i},bookmarkDialog:t,goTo:n,setters:{setBookmarkChrome:a=>t.register(a),setGoToChrome:a=>n.register(a),setBookmarkMarks(a){let s=r.push(a);return o?.(),()=>{s(),o?.();}}}}}var gu="no comment draft view is registered",FP=new WeakMap;function LP(e={}){let t=mu(e.changed);return {requests:{canOpen:t.canOpen,open:t.open},setters:{setCommentDraftChrome:r=>t.register(r)}}}function DP(e,t){FP.set(e,t);}function Jg(e){return FP.get(e)??null}function Ao(e){return e.surface??null}var b6={"review.revisionMarkup":{type:"openRevisionMarkupDialog"},"review.comments":{type:"toggleReviewPane"},"review.paragraphMarks":{type:"toggleParagraphMarks"},"review.bookmarks":{type:"toggleBookmarks"},"insert.bookmark":{type:"openBookmarkDialog"},"insert.goToBookmark":{type:"openGoTo"},"review.protectDocument":{type:"toggleDocumentProtection"},"review.simpleMarkup":{type:"setReviewDisplayMode",mode:"simple-markup"},"review.allMarkup":{type:"setReviewDisplayMode",mode:"all-markup"},"review.noMarkup":{type:"setReviewDisplayMode",mode:"proposed"},"review.original":{type:"setReviewDisplayMode",mode:"original"},"review.previousChange":{type:"navigateReviewChange",direction:"previous"},"review.nextChange":{type:"navigateReviewChange",direction:"next"},"review.acceptAllChanges":{type:"resolveAllReviewChanges",action:"accept"},"review.rejectAllChanges":{type:"resolveAllReviewChanges",action:"reject"},"history.undo":{type:"undo"},"history.redo":{type:"redo"},"text.bold":{type:"toggleMark",mark:"bold"},"text.italic":{type:"toggleMark",mark:"italic"},"text.underline":{type:"toggleMark",mark:"underline"},"text.strike":{type:"toggleMark",mark:"strike"},"script.super":{type:"toggleMark",mark:"superscript"},"script.sub":{type:"toggleMark",mark:"subscript"},"format.clear":{type:"clearFormatting"},"alignment.left":{type:"setAlignment",align:"left"},"alignment.center":{type:"setAlignment",align:"center"},"alignment.right":{type:"setAlignment",align:"right"},"alignment.justify":{type:"setAlignment",align:"justify"},"direction.ltr":{type:"setParagraphDirection",direction:"ltr"},"direction.rtl":{type:"setParagraphDirection",direction:"rtl"},"list.bullet":{type:"toggleList",kind:"bullet"},"list.numbered":{type:"toggleList",kind:"ordered"},"list.indent":{type:"adjustIndent",direction:"increase"},"list.outdent":{type:"adjustIndent",direction:"decrease"},"insert.textBox":{type:"insertTextBox"},"insert.footnote":{type:"insertNote",noteKind:"footnote"},"insert.endnote":{type:"insertNote",noteKind:"endnote"},"insert.pageNumber":{type:"insertPageField",field:"PAGE"},"insert.totalPages":{type:"insertPageField",field:"NUMPAGES"},"insert.sectionPages":{type:"insertPageField",field:"SECTIONPAGES"},"insert.pageXofY":{type:"insertPageField",field:"PAGE_X_OF_Y"},"insert.pageBreak":{type:"insertBreak",kind:"page"},"insert.sectionBreakNextPage":{type:"insertBreak",kind:"section"},"insert.sectionBreakContinuous":{type:"insertBreak",kind:"sectionContinuous"},"insert.toc":{type:"insertToc"},"contentControl.remove":{type:"removeContentControl"},"table.mergeCells":{type:"mergeCells"}};function v6(e){return _P[e]??null}var NP=Uint8Array.from(atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),e=>e.charCodeAt(0)),HP={"file.pageSetup":"page setup is not a command; render DocxEditor.PageSetupDialog with open and onClose","paragraph.dialog":"the paragraph dialog is not a command; render DocxEditor.ParagraphDialog with open and onClose"},_P={"text.link":{type:"insertHyperlink",href:"https://example.com"},"image.insert":{type:"insertImage",data:NP,mime:"image/png",widthPoints:72,heightPoints:72},"image.properties":{type:"setImageProperties",description:"probe"},"table.insert":{type:"insertTable",rows:1,cols:1},"file.pageSetup":{type:"setPageSetup",orientation:"portrait"},"paragraph.dialog":{type:"setParagraphFormat",alignment:"left"},"insert.watermark":{type:"setWatermark",watermark:{text:"DRAFT"}},"table.splitCell":{type:"splitCell",rows:1,cols:2}};function yu(e){return b6[e]??null}var x6={"font.family":{mark:"fontFamily",attr:"family"},"font.size":{mark:"fontSize",attr:"val"},"text.color":{mark:"color",attr:"val"},"text.highlight":{mark:"highlight",attr:"val"}},BP={"font.family":"Arial","font.size":22,"text.color":"000000","text.highlight":"yellow","styles.style":"Normal","list.lineSpacing":1,"image.wrap":"square","image.altText":"probe alt text"};function $P(e,t,n){return Ci(n,e,t)?.command??null}function hu(e,t){if(e==="review.editingMode")return {type:"setEditingMode",mode:t};if(e==="styles.style")return {type:"setParagraphStyle",styleId:t};if(e==="list.lineSpacing")return {type:"setLineSpacing",rule:"multiple",value:t};if(Il(e))return $P(e,t,Oa);if(e==="image.wrap")return typeof t!="string"||!chunkZOZI27AW_cjs.Ld.includes(t)?null:{type:"setImageWrapType",target:t};if(e==="image.altText")return typeof t!="string"?null:{type:"setImageProperties",description:t};let n=x6[e];return n?{type:"setMarkAttr",mark:n.mark,attr:n.attr,value:t}:null}function qP(e,t,n=Oa){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let r=Qg(t,n);if(!r)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let o=e.can(r);return o.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:o.reason,active:false}}var S6=["editing","suggesting","viewing"];function WP(e){let t="review.addComment",n=o=>({id:t,enabled:false,disabledReason:o,active:false}),r=e.can({type:"toggleReviewPane"});return r.ok?(e.getEditingMode?.()??"editing")==="viewing"?n("the document is open for viewing"):Jg(e)?.canOpen()?e.getSelectionPlacement()===null?n("a comment needs a selected range"):{id:t,enabled:true,disabledReason:null,active:false}:n(gu):n(r.reason)}function jP(e,t){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};if(Il(t))return qP(e,t);if(t==="review.editingMode"){let i=e.getEditingMode?.()??"editing",a=S6.filter(c=>c!==i).map(c=>e.can(hu(t,c))),s=a.some(c=>c.ok),l=a.find(c=>!c.ok);return {id:t,enabled:s,disabledReason:!s&&l&&!l.ok?l.reason:null,active:false,value:i}}if(t==="format.painter"){let i=Ao(e);if(!i)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let a=i.formatPainter.state();if(a.mode!=="off")return {id:t,enabled:true,disabledReason:null,active:true,value:a.mode};let s=e.can({type:"clearFormatting"});return s.ok?{id:t,enabled:true,disabledReason:null,active:false,value:a.mode}:{id:t,enabled:false,disabledReason:s.reason,active:false,value:a.mode}}if(t==="contentControl.showAll"||t==="contentControl.formFill"){let i=Ao(e),a=i?.state().contentControls,s=t==="contentControl.showAll"?a?.showAll??false:a?.formFill??false;return {id:t,enabled:i!==null,disabledReason:i?null:"editor is not ready",active:s}}if(t==="contentControl.inspector"){let i=Ao(e);return i?i.state().contentControls.activeControlId?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"no content control at the selection",active:false}:{id:t,enabled:false,disabledReason:"editor is not ready",active:false}}if(t==="review.addComment")return WP(e);if(t==="review.authors"){let i=e.can({type:"toggleReviewPane"});return i.ok?(e.getReviewAuthors?.().length??0)>0?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"the document has no review authors",active:false}:{id:t,enabled:false,disabledReason:i.reason,active:false}}let n=yu(t);if(!n){let i=BP[t];if(i!==void 0){let s=hu(t,i);if(!s)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let l=e.can(s),c=e.getSelectedImage?.()??null,d=t==="image.wrap"?c?.wrap:t==="image.altText"?c?.description:$I(e,t);return l.ok?{id:t,enabled:true,disabledReason:null,active:false,...d!==void 0?{value:d}:{}}:{id:t,enabled:false,disabledReason:l.reason,active:false,...d!==void 0?{value:d}:{}}}let a=_P[t];if(a){if(t==="image.insert"&&a.type==="insertImage"){let c=e.canExecuteImageCommand?.({type:"insertImage",data:NP,mime:"image/png",widthPoints:72,heightPoints:72})??e.can(a);return c.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:c.reason,active:false}}if(t==="image.properties"&&a.type==="setImageProperties"){let c=e.can(a);return c.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:c.reason,active:false}}if(t==="table.insert"&&a.type==="insertTable"){let c=e.can(a);return c.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:c.reason,active:false}}if(t==="table.splitCell"&&a.type==="splitCell"){let c=e.can(a),d=c.ok?null:e.query({type:"splitCellConfig"});for(let u of d?[2,d.maxRows]:[]){if(c.ok||u<2)break;let f=e.can({type:"splitCell",rows:u,cols:1});f.ok&&(c=f);}return c.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:c.reason,active:false}}if(t==="paragraph.dialog"&&a.type==="setParagraphFormat"){let c=e.can(a);return c.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:c.reason,active:false}}let s=e.can(a);if(!s.ok)return {id:t,enabled:false,disabledReason:s.reason,active:false};let l=HP[t];if(l)return {id:t,enabled:false,disabledReason:l,active:false}}return t==="file.exportMarkdown"||t==="file.exportPdf"?{id:t,enabled:false,active:false,disabledReason:"export is not a command; run it with runChromeExport(editor, format, handlers)"}:t==="file.print"?{id:t,enabled:false,active:false,disabledReason:"print is not a command; run it with runChromePrint(editor, handlers)"}:t==="file.save"?{id:t,enabled:false,disabledReason:"save is not a command; run it with runSave(editor)",active:false}:t==="file.open"?{id:t,enabled:false,disabledReason:"open is not a command; run it with editor.load(bytes)",active:false}:{id:t,enabled:false,disabledReason:"not wired to an editor command",active:false}}let r=e.can(n),o=e.isActive?.(n)??false;return r.ok?{id:t,enabled:true,disabledReason:null,active:o}:{id:t,enabled:false,disabledReason:r.reason,active:o}}function w6(e){if(e==="format.painter")return true;let t=yu(e);return t?.type==="toggleMark"||t?.type==="toggleParagraphMarks"||t?.type==="toggleBookmarks"||t?.type==="toggleDocumentProtection"||t?.type==="setReviewDisplayMode"||t?.type==="setAlignment"||t?.type==="setParagraphDirection"}function k6(e,t){return t.map(n=>jP(e,n))}function I6(e,t,n,r){if(!e)return {result:{ok:false,code:"unsupported",reason:"editor is not ready"},nextDraft:null};let o=Ci(r,t,n);if(!o)return {result:{ok:false,code:"unsupported",reason:"invalid table chrome value"},nextDraft:null};let i=e.can(o.command);if(!i.ok)return {result:{ok:false,code:i.code,reason:i.reason},nextDraft:null};let a=e.exec(o.command);return a.ok?{result:a,nextDraft:o.nextDraft}:{result:a,nextDraft:null}}var R6=new Set(["format.painter","contentControl.showAll","contentControl.formFill","contentControl.inspector","contentControl.remove","review.addComment"]);function P6(e,t,n,r){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(n&&typeof n=="object"&&("historyGroup"in n||"scope"in n||Object.keys(n).length===0)){if(r||BP[t]!==void 0||Il(t))return {ok:false,code:"invalidArgs",reason:"pass a toolbar value before command options"};r=n,n=void 0;}if(r?.historyGroup!==void 0&&R6.has(t))return {ok:false,code:"unsupported",reason:`${t} does not take a history group`};if(t==="format.painter"){let a=Ao(e);if(!a)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(a.formatPainter.state().mode==="off"){let s=e.can({type:"clearFormatting"});if(!s.ok)return {ok:false,code:s.code,reason:s.reason}}return a.formatPainter.press()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:Xd}}if(t==="review.addComment"){let a=WP(e);return a.enabled?Jg(e)?.open()?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:gu}:{ok:false,code:"unsupported",reason:a.disabledReason??gu}}if(t==="contentControl.showAll"){let a=Ao(e);return a?(a.contentControls.setShowAll(!a.contentControls.showAll()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.formFill"){let a=Ao(e);return a?(a.contentControls.setFormFill(!a.contentControls.formFill()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.inspector"){let a=Ao(e);return a?a.state().contentControls.activeControlId?{ok:true,changed:false}:{ok:false,code:"notFound",reason:"no content control at the selection"}:{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.remove"){let a=Ao(e);if(!a)return {ok:false,code:"unsupported",reason:"editor is not ready"};let s=a.state().contentControls.activeControlId;if(!s)return {ok:false,code:"notFound",reason:"no content control at the selection"};let l=a.contentControls.disabledReason(s,"remove");return l?{ok:false,code:l==="bound"?"bound":"locked",reason:l}:a.contentControls.remove(s)?{ok:true,changed:true}:{ok:false,code:a.state().lastRejection??"unsupported",reason:a.state().lastRejection??"removeContentControl was refused"}}let o=n===void 0?yu(t):hu(t,n);if(!o){if(n!==void 0)return {ok:false,code:"unsupported",reason:"invalid value for toolbar command"};if(t==="file.exportMarkdown"||t==="file.exportPdf")return {ok:false,code:"unsupported",reason:"export is not a command; run it with runChromeExport(editor, format, handlers)"};if(t==="file.print")return {ok:false,code:"unsupported",reason:"print is not a command; run it with runChromePrint(editor, handlers)"};if(t==="file.save")return {ok:false,code:"unsupported",reason:"save is not a command; run it with runSave(editor)"};if(t==="file.open")return {ok:false,code:"unsupported",reason:"open is not a command; run it with editor.load(bytes)"};let a=HP[t];return a?{ok:false,code:"unsupported",reason:a}:{ok:false,code:"unsupported",reason:"not wired to an editor command"}}let i=e.can(o,r);return i.ok?e.exec(o,r):{ok:false,code:i.code,reason:i.reason}}function T6(e){return e?e.save():Promise.reject(new Error("editor is not ready"))}function E6(e,t){if(!e)return {enabled:false,disabledReason:"editor is not ready"};let n=fu(t,e);return n.can.ok?{enabled:true,disabledReason:null}:{enabled:false,disabledReason:n.can.reason}}function C6(e,t,n){if(!e)return {ok:false,code:"unsupported",reason:"editor is not ready"};let r=e.can(t,n);return r.ok?e.exec(t,n):{ok:false,code:r.code,reason:r.reason}}function eh(e){return e instanceof Uint8Array?Array.from(e):Array.isArray(e)?e.map(eh):e===null||typeof e!="object"?e:Object.fromEntries(Object.keys(e).sort().map(t=>[t,eh(e[t])]))}function O6(e){return JSON.stringify(eh(e))}var th=["zoom","script","format","list","alignment","styles","font","text","history"],M6=new Set(["review"]),VP=24,UP=new Set;function zP(e,t=th){let n=t.indexOf(e);return n===-1?void 0:(n+1)*10}function A6(e,t=th,n){let r=[],o=[];return e.forEach((i,a)=>{let s=n?.get(i)??zP(i,t);s===void 0||Number.isNaN(s)?o.push(i):r.push({id:i,priority:s,position:a});}),r.sort((i,a)=>i.priority-a.priority||a.position-i.position),[...o.reverse(),...r.map(i=>i.id)]}function F6(e,t){let n=[...e],r=new Map,o=t.filter(i=>!e.includes(i.id));for(;o.length>0;){let i=[];for(let a of o){let s=a.after;if(s===void 0||s===a.id){n.push(a.id);continue}if(!n.includes(s)){i.push(a);continue}let l=r.get(s)??s;n.splice(n.indexOf(l)+1,0,a.id),r.set(s,a.id);}if(i.length===o.length){n.push(...i.map(a=>a.id));break}o=i;}return n}var nh=8;function L6(e){let t=e.margin??nh,n=Math.max(0,e.viewportWidth-t*2),r=Math.min(e.panelWidth,n),o=t,i=e.viewportWidth-t-r,a=e.triggerRight-r;if(a>=o&&a<=i)return {left:a,maxWidth:n,anchor:"end"};let s=e.triggerLeft;return s>=o&&s<=i?{left:s,maxWidth:n,anchor:"start"}:{left:Math.max(o,Math.min(a,i)),maxWidth:n,anchor:"clamped"}}function KP(e,t){let{widths:n,groups:r,order:o,fixed:i,more:a}=e,s=i;for(let c of r)s+=n.get(c)??0;if(s<=t)return UP;s+=a;let l=new Set;for(let c of o){if(s<=t)break;let d=n.get(c);d===void 0||l.has(c)||(l.add(c),s-=d);}return l}function GP(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}var D6=GP;function N6(e){if(!(e.available>0))return UP;let t=KP(e,e.available),n=e.previous;if(!n||n.size===0||t.size>=n.size)return t;let r=KP(e,e.available-(e.hysteresis??VP));return GP(r,n)?n:r}function H6(e){let t=e.margin??nh,n=e.viewportWidth-t-e.popupWidth;return Math.max(t,Math.min(e.anchorLeft,n))}function _6(e,t,n,r){return e+t+n+r*2}function B6(e,t){return e+t}function $6(e,t){return e+t}function q6(e){let t=Number.parseFloat(e.marginInlineStart||e.marginLeft),n=Number.parseFloat(e.marginInlineEnd||e.marginRight);return {start:Number.isFinite(t)?t:0,end:Number.isFinite(n)?n:0}}function lr(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function W6(e){return lr(e.columnGap)}function ZP(e){if(!(e.parentContent>0))return e.own;let t=e.parentContent-e.siblings-e.margins;return e.maxWidth!==null&&(t=Math.min(t,e.maxWidth)),Math.max(e.own,t-e.chrome)}function XP(e){return e.position==="absolute"||e.position==="fixed"||e.display==="none"}function YP(e){let t=e.computedStyleMap;if(typeof t!="function")return null;try{return t.call(e)}catch{return null}}function rh(e,t){let n=e?.get(t);return n&&typeof n.value=="string"?n.value:null}var j6=new Set(["auto","max-content","fit-content","min-content"]);function QP(e){return e.display.includes("flex")&&!e.flexDirection.startsWith("column")&&!e.flexWrap.startsWith("wrap")}function vu(e,t,n){return rh(e,`margin-${n}`)==="auto"?0:lr(n==="left"?t.marginLeft:t.marginRight)}function K6(e){return /^(input|textarea|select|button|img|video|canvas|iframe|svg)$/i.test(e.tagName)?true:e.children.length>0||(e.textContent??"").trim().length>0}function V6(e,t,n){let r=t.flexBasis.trim(),o=r.endsWith("px")?lr(r):0,i=rh(n,"min-width")??t.minWidth.trim();return i==="auto"||i===""?K6(e)?null:o:/^[\d.]+px$/.test(i)?Math.max(o,lr(i)):null}function JP(e,t,n){for(let r of e.childNodes){if(r.nodeType===3&&(r.textContent??"").trim().length>0)return false;if(!_t(r))continue;let o=je(r).getComputedStyle(r);if(o.display==="contents"){if(!JP(r,t,n))return false;continue}if(XP(o)||(n.items+=1,r===t))continue;let i=YP(r),s=Number.parseFloat(o.flexGrow)>0?V6(r,o,i):r.getBoundingClientRect().width;if(s===null)return false;n.width+=s+vu(i,o,"left")+vu(i,o,"right");}return true}function U6(e,t){if(!QP(t)||!e.parentElement)return 0;let n={width:0,items:0};return JP(e.parentElement,e,n)?n.width+Math.max(0,n.items-1)*lr(t.columnGap):null}function z6(e,t,n){let r=e.maxWidth.trim();if(r==="none"||r==="")return null;let o;if(/^-?[\d.]+%$/.test(r))o=Number.parseFloat(r)/100*t;else if(/^-?[\d.]+px$/.test(r))o=Number.parseFloat(r);else return;if(Number.isFinite(o))return e.boxSizing==="border-box"?o:o+n}var G6="[data-toolbar-group], [data-toolbar-fixed], [data-toolbar-more]";function eT(e,t){let n=e.getBoundingClientRect();if(!(n.width>0))return null;let r=n.left+e.clientLeft+lr(t.paddingLeft),o=n.left+e.clientLeft+e.clientWidth-lr(t.paddingRight);for(let i of e.querySelectorAll(G6)){let a=i.getBoundingClientRect();if(a.width!==0&&(a.right>o+1||a.left<r-1))return true}return false}var Rl=new WeakMap,bu=new WeakMap;function Z6(e,t,n,r){let o=e.parentElement;if(!o||XP(t)||(t.cssFloat||t.getPropertyValue("float")||"none")!=="none")return null;let i=YP(e),a=rh(i,"width");if(a===null||!j6.has(a))return null;let s=je(o).getComputedStyle(o),l=QP(s),c=s.display.includes("flex")&&s.flexDirection.startsWith("column"),d=(s.display==="block"||s.display==="flow-root"||c)&&!t.display.startsWith("inline");if(!l&&!d||l&&Number.parseFloat(t.flexGrow)>0)return null;let u=o.clientWidth-lr(s.paddingLeft)-lr(s.paddingRight),f=Math.max(0,e.offsetWidth-e.clientWidth)+r,p=U6(e,s),g=z6(t,u,f);return p===null||g===void 0?null:{room:ZP({own:n,parentContent:u,siblings:p,margins:vu(i,t,"left")+vu(i,t,"right"),chrome:f,maxWidth:g}),parentContent:u}}function X6(e,t){let n=lr(t.paddingLeft)+lr(t.paddingRight),r=e.clientWidth-n,o=Z6(e,t,r,n);if(!o)return Rl.delete(e),bu.delete(e),r;let i=Rl.get(e);if(i&&i.parentContent!==o.parentContent&&Rl.delete(e),eT(e,t)===true)return bu.get(e)&&Rl.set(e,{parentContent:o.parentContent,cap:r}),bu.set(e,false),r;let a=Rl.get(e)?.cap??Number.POSITIVE_INFINITY,s=Math.max(r,Math.min(o.room,a));return bu.set(e,s>r),s}var Q6=/^[a-z]$/;function xu(e){let t=e.key.toLowerCase();if(Q6.test(t))return t;let n=e.code??"";return n.length===4&&n.startsWith("Key")?n[3].toLowerCase():""}function oh(e,t=i18n.isApplePlatform()){if(e.shiftKey||e.isComposing)return false;if(t){if(!e.metaKey||!e.altKey||e.ctrlKey)return false}else if(!e.ctrlKey||e.metaKey||e.altKey)return false;return xu(e)==="g"}function tT(e){let t=[],n=r=>{for(let o of r)o.kind==="item"?t.push(o.slot):o.kind==="submenu"&&n(o.items);};for(let r of e)n(r.entries);return t}var nT={id:"file",labelKey:"toolbar.file",contextual:true,controls:[{id:"open",labelKey:"toolbar.open",paths:ae.file_upload,state:{kind:"load"}},{id:"save",labelKey:"toolbar.saveShortcut",paths:ae.file_download,state:{kind:"save"}},{id:"exportMarkdown",labelKey:"toolbar.exportMarkdown",paths:ae.file_download,state:{kind:"export"}},{id:"exportPdf",labelKey:"toolbar.exportPdf",paths:ae.file_download,state:{kind:"export"}},{id:"print",labelKey:"toolbar.print",paths:ae.print,state:{kind:"export"}},{id:"pageSetup",labelKey:"toolbar.pageSetup",paths:ae.settings,state:{kind:"command"}}]};var rT={id:"review",labelKey:"formattingBar.commentsAndChanges",controls:[{id:"revisionMarkup",shape:"icon",labelKey:"revisionMarkup.title",defaultToolbar:false,paths:ae.edit_note,state:{kind:"command"}},{id:"simpleMarkup",shape:"icon",labelKey:"review.simpleMarkup",defaultToolbar:false,paths:ae.visibility,state:{kind:"command"}},{id:"allMarkup",shape:"icon",labelKey:"review.allMarkup",defaultToolbar:false,paths:ae.visibility,state:{kind:"command"}},{id:"noMarkup",shape:"icon",labelKey:"review.noMarkup",defaultToolbar:false,paths:ae.visibility,state:{kind:"command"}},{id:"original",shape:"icon",labelKey:"review.original",defaultToolbar:false,paths:ae.visibility,state:{kind:"command"}},{id:"previousChange",shape:"icon",labelKey:"review.previousChange",defaultToolbar:false,paths:ae.keyboard_arrow_up,state:{kind:"command"}},{id:"nextChange",shape:"icon",labelKey:"review.nextChange",defaultToolbar:false,paths:ae.keyboard_arrow_down,state:{kind:"command"}},{id:"acceptAllChanges",shape:"icon",labelKey:"review.acceptAllChanges",defaultToolbar:false,paths:ae.check,state:{kind:"command"}},{id:"rejectAllChanges",shape:"icon",labelKey:"review.rejectAllChanges",defaultToolbar:false,paths:ae.close,state:{kind:"command"}},{id:"paragraphMarks",shape:"icon",labelKey:"formattingBar.paragraphMarks",defaultToolbar:false,paths:ae.format_paragraph,state:{kind:"command"}},{id:"bookmarks",shape:"icon",labelKey:"formattingBar.showBookmarks",defaultToolbar:false,paths:ae.bookmarks,state:{kind:"command"}},{id:"protectDocument",shape:"icon",labelKey:"review.protectDocument",defaultToolbar:false,paths:ae.lock,state:{kind:"command"}},{id:"comments",shape:"icon",labelKey:"formattingBar.commentsAndChanges",paths:ae.comment,state:{kind:"command"}},{id:"addComment",shape:"icon",labelKey:"formattingBar.addComment",defaultToolbar:false,paths:ae.add_comment,state:{kind:"command"}},{id:"authors",shape:"dropdown",labelKey:"reviewers.label",paths:ae.visibility,defaultToolbar:false,state:{kind:"command"}},{id:"editingMode",shape:"dropdown",labelKey:"editingMode.label",valueKey:"editingMode.editing",paths:ae.edit_note,state:{kind:"command"}}]};var ih=[{id:"history",labelKey:"formattingBar.groups.history",controls:[{id:"undo",labelKey:"formattingBar.undoShortcut",paths:ae.undo,state:{kind:"command"}},{id:"redo",labelKey:"formattingBar.redoShortcut",paths:ae.redo,state:{kind:"command"}}]},{id:"zoom",labelKey:"formattingBar.groups.zoom",controls:[{id:"level",shape:"stepper",valueText:"100%",labelKey:"formattingBar.groups.zoom",paths:null,valueKey:"zoom.zoomLevel",state:{kind:"command"}}]},{id:"styles",labelKey:"formattingBar.groups.styles",controls:[{id:"style",shape:"dropdown",labelKey:"styles.selectAriaLabel",paths:null,valueKey:"styles.normalText",state:{kind:"value"}}]},{id:"font",labelKey:"formattingBar.groups.font",controls:[{id:"family",shape:"dropdown",labelKey:"font.selectAriaLabel",paths:null,valueKey:"font.sansSerif",state:{kind:"value"}},{id:"size",shape:"stepper",valueText:"11",labelKey:"fontSize.listLabel",paths:null,valueKey:"fontSize.label",state:{kind:"value"}}]},{id:"text",labelKey:"formattingBar.groups.textFormatting",controls:[{id:"bold",labelKey:"formattingBar.boldShortcut",paths:ae.format_bold,state:{kind:"command"}},{id:"italic",labelKey:"formattingBar.italicShortcut",paths:ae.format_italic,state:{kind:"command"}},{id:"underline",labelKey:"formattingBar.underlineShortcut",paths:ae.format_underlined,state:{kind:"command"}},{id:"strike",labelKey:"formattingBar.strikethrough",paths:ae.strikethrough_s,state:{kind:"command"}},{id:"color",shape:"colorSplit",swatch:"#ff0000",labelKey:"formattingBar.fontColor",paths:ae.format_color_text,state:{kind:"value"}},{id:"highlight",shape:"colorSplit",swatch:"#ffff00",labelKey:"formattingBar.highlightColor",paths:ae.ink_highlighter,state:{kind:"value"}},{id:"link",labelKey:"formattingBar.insertLinkShortcut",paths:ae.link,state:{kind:"command"}}]},{id:"script",labelKey:"formattingBar.groups.script",controls:[{id:"super",labelKey:"formattingBar.superscript",paths:ae.superscript,state:{kind:"command"}},{id:"sub",labelKey:"formattingBar.subscript",paths:ae.subscript,state:{kind:"command"}}]},{id:"alignment",labelKey:"formattingBar.groups.alignment",controls:[{id:"left",labelKey:"alignment.alignLeft",paths:ae.format_align_left,state:{kind:"command"}},{id:"center",labelKey:"alignment.center",paths:ae.format_align_center,state:{kind:"command"}},{id:"right",labelKey:"alignment.alignRight",paths:ae.format_align_right,state:{kind:"command"}},{id:"justify",labelKey:"alignment.justify",paths:ae.format_align_justify,state:{kind:"command"}}]},{id:"direction",labelKey:"formattingBar.groups.direction",contextual:true,controls:[{id:"ltr",labelKey:"toolbar.leftToRight",paths:ae.format_textdirection_l_to_r,state:{kind:"command"}},{id:"rtl",labelKey:"toolbar.rightToLeft",paths:ae.format_textdirection_r_to_l,state:{kind:"command"}}]},{id:"list",labelKey:"formattingBar.groups.listFormatting",controls:[{id:"bullet",labelKey:"lists.bulletList",paths:ae.format_list_bulleted,state:{kind:"command"}},{id:"numbered",labelKey:"lists.numberedList",paths:ae.format_list_numbered,state:{kind:"command"}},{id:"outdent",labelKey:"lists.decreaseIndent",paths:ae.format_indent_decrease,state:{kind:"command"}},{id:"indent",labelKey:"lists.increaseIndent",paths:ae.format_indent_increase,state:{kind:"command"}},{id:"lineSpacing",shape:"dropdown",labelKey:"lineSpacing.label",paths:ae.format_line_spacing,state:{kind:"command"}}]},{id:"format",labelKey:"formattingBar.groups.format",controls:[{id:"painter",labelKey:"formattingBar.formatPainterShortcut",paths:ae.format_paint,state:{kind:"command"}},{id:"clear",labelKey:"formattingBar.clearFormatting",paths:ae.format_clear,state:{kind:"command"}}]},rT,{id:"contentControl",labelKey:"contentControl.group",contextual:true,controls:[{id:"showAll",labelKey:"contentControl.showAll",paths:ae.visibility,state:{kind:"command"}},{id:"formFill",labelKey:"contentControl.formFill",paths:ae.edit_note,state:{kind:"command"}},{id:"inspector",labelKey:"contentControl.inspector",paths:ae.tune,state:{kind:"command"}},{id:"remove",labelKey:"contentControl.remove",paths:ae.delete,state:{kind:"command"}}]},{id:"image",labelKey:"formattingBar.groups.image",contextual:true,controls:[{id:"insert",labelKey:"toolbar.image",paths:ae.image,state:{kind:"command"}},{id:"properties",labelKey:"formattingBar.imagePropertiesShortcut",paths:ae.tune,state:{kind:"command"}},{id:"wrap",shape:"dropdown",labelKey:"formattingBar.imageWrap",paths:ae.wrap_text,valueKey:"imageWrap.inline",state:{kind:"value"}},{id:"altText",shape:"dropdown",labelKey:"formattingBar.altText",paths:null,valueKey:"imageProperties.altText",state:{kind:"value"}}]},{id:"table",labelKey:"formattingBar.groups.table",contextual:true,controls:[{id:"insert",labelKey:"toolbar.table",paths:ae.table,state:{kind:"command"}},{id:"borderTarget",shape:"dropdown",labelKey:"table.borders.tooltip",paths:ae.border_all,state:{kind:"value"}},{id:"borderColor",shape:"colorSplit",swatch:"#000000",labelKey:"table.borderColor",paths:ae.border_color,state:{kind:"value"}},{id:"borderStyle",shape:"dropdown",labelKey:"table.borders.styleAriaLabel",paths:ae.border_horizontal,state:{kind:"value"}},{id:"borderWidth",shape:"dropdown",labelKey:"table.borderWidth",paths:ae.line_weight,state:{kind:"value"}},{id:"cellFill",shape:"colorSplit",swatch:"#ffffff",labelKey:"table.cellFillColor",paths:ae.format_color_fill,state:{kind:"value"}},{id:"mergeCells",labelKey:"table.mergeCells",paths:ae.call_merge,state:{kind:"command"}},{id:"splitCell",labelKey:"table.splitCell",paths:ae.call_split,state:{kind:"command"}}]},{id:"paragraph",labelKey:"dialogs.paragraph.title",contextual:true,controls:[{id:"dialog",labelKey:"lineSpacing.options",paths:ae.format_line_spacing,state:{kind:"command"}}]},nT,{id:"insert",labelKey:"toolbar.insert",contextual:true,controls:[{id:"textBox",labelKey:"toolbar.insertTextBox",paths:ae.format_shapes,state:{kind:"command"}},{id:"footnote",labelKey:"toolbar.insertFootnote",paths:ae.superscript,state:{kind:"command"}},{id:"endnote",labelKey:"toolbar.insertEndnote",paths:ae.edit_note,state:{kind:"command"}},{id:"pageNumber",labelKey:"headerFooter.insertPageNumber",paths:ae.format_list_numbered,state:{kind:"command"}},{id:"totalPages",labelKey:"headerFooter.insertTotalPages",paths:ae.format_list_numbered,state:{kind:"command"}},{id:"sectionPages",labelKey:"headerFooter.insertSectionPages",paths:ae.format_list_numbered,state:{kind:"command"}},{id:"pageXofY",labelKey:"headerFooter.insertPageXofY",paths:ae.format_list_numbered,state:{kind:"command"}},{id:"pageBreak",labelKey:"toolbar.pageBreak",paths:ae.page_break,state:{kind:"command"}},{id:"sectionBreakNextPage",labelKey:"toolbar.sectionBreakNextPage",paths:ae.horizontal_rule,state:{kind:"command"}},{id:"sectionBreakContinuous",labelKey:"toolbar.sectionBreakContinuous",paths:ae.border_horizontal,state:{kind:"command"}},{id:"toc",labelKey:"toolbar.tableOfContents",paths:ae.toc,state:{kind:"command"}},{id:"bookmark",labelKey:"toolbar.bookmark",paths:ae.bookmark,state:{kind:"command"}},{id:"goToBookmark",labelKey:"toolbar.goToBookmark",paths:ae.bookmarks,state:{kind:"command"}},{id:"watermark",labelKey:"toolbar.watermark",paths:ae.branding_watermark,state:{kind:"command"}}]}],oT=ih;function J6(e,t){return `${e.id}.${t.id}`}function iT(){return oT.filter(e=>!e.contextual).map(e=>({...e,controls:e.controls.filter(t=>t.defaultToolbar!==false)}))}function e_(e){let t=iT();if(!e)return t;let n=oT.find(r=>r.id==="image");return n?[...t,n]:t}var aT=[{id:"file",labelKey:"toolbar.file",entries:[{kind:"item",slot:"file.open",shortcutKey:"toolbar.openShortcut"},{kind:"item",slot:"file.save",labelKey:"toolbar.save",shortcutKey:"toolbar.saveShortcut"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.export",paths:ae.file_download,items:[{kind:"item",slot:"file.exportMarkdown"},{kind:"item",slot:"file.exportPdf"}]},{kind:"item",slot:"file.print",shortcutKey:"toolbar.printShortcut"},{kind:"item",slot:"file.pageSetup"}]},{id:"format",labelKey:"toolbar.format",entries:[{kind:"item",slot:"text.bold",labelKey:"formattingBar.bold"},{kind:"item",slot:"text.italic",labelKey:"formattingBar.italic"},{kind:"item",slot:"text.underline",labelKey:"formattingBar.underline"},{kind:"item",slot:"text.strike"},{kind:"separator"},{kind:"item",slot:"alignment.left"},{kind:"item",slot:"alignment.center"},{kind:"item",slot:"alignment.right"},{kind:"item",slot:"alignment.justify"},{kind:"separator"},{kind:"item",slot:"direction.ltr"},{kind:"item",slot:"direction.rtl"},{kind:"separator"},{kind:"item",slot:"paragraph.dialog"},{kind:"separator"},{kind:"item",slot:"format.painter",labelKey:"formattingBar.formatPainter"},{kind:"item",slot:"format.clear"}]},{id:"insert",labelKey:"toolbar.insert",entries:[{kind:"item",slot:"image.insert"},{kind:"item",slot:"insert.textBox"},{kind:"item",slot:"table.insert",picker:"tableGrid"},{kind:"separator"},{kind:"item",slot:"insert.footnote"},{kind:"item",slot:"insert.endnote"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.break",paths:ae.page_break,items:[{kind:"item",slot:"insert.pageBreak"},{kind:"item",slot:"insert.sectionBreakNextPage"},{kind:"item",slot:"insert.sectionBreakContinuous"}]},{kind:"item",slot:"insert.toc"},{kind:"item",slot:"insert.bookmark",shortcutKey:"toolbar.bookmarkShortcut"},{kind:"item",slot:"insert.goToBookmark"},{kind:"item",slot:"insert.watermark"}]},{id:"review",labelKey:"toolbar.review",entries:[{kind:"submenu",labelKey:"review.displayForReview",paths:ae.visibility,items:[{kind:"item",slot:"review.simpleMarkup"},{kind:"item",slot:"review.allMarkup"},{kind:"item",slot:"review.noMarkup"},{kind:"item",slot:"review.original"}]},{kind:"separator"},{kind:"item",slot:"review.revisionMarkup"},{kind:"item",slot:"review.previousChange"},{kind:"item",slot:"review.nextChange"},{kind:"separator"},{kind:"item",slot:"review.acceptAllChanges"},{kind:"item",slot:"review.rejectAllChanges"},{kind:"separator"},{kind:"item",slot:"review.paragraphMarks"},{kind:"item",slot:"review.bookmarks"},{kind:"separator"},{kind:"item",slot:"review.protectDocument"}]},{id:"help",labelKey:"toolbar.help",entries:[]}];function t_(){return tT(aT)}function n_(){return ih.reduce((e,t)=>e+t.controls.length,0)}var r_="formattingBar.unavailableInPreview";function Pl(e){return e.map(t=>{if(t.match!==void 0&&typeof t.match!="function")throw new TypeError("UnsupportedElement match must be a function.");let n=t.layout;if(n&&(!Number.isFinite(n.width)||!Number.isFinite(n.height)||n.width<=0||n.height<=0||n.width>1e5||n.height>1e5))throw new RangeError("UnsupportedElement layout requires positive dimensions up to 100000 points.");return Object.freeze({...t,...n?{layout:Object.freeze({...n})}:{}})})}function ah(e){let t=new Map;return {...chunkFDSL5OJU_cjs.ob(r=>{let o=e.find(a=>a.match?.(r)??true),i=o?o.layout??(r.placement==="block"?{width:240,height:96}:{width:120,height:24}):null;return t.set(`${r.ownerPartName}\0${r.nodeId}`,i?`${i.width},${i.height}`:"hidden"),i}),geometryKey:()=>JSON.stringify([...t].sort(([r],[o])=>r.localeCompare(o)))}}function sT(e,t){let n=Pl(e??[]);return {current:()=>n,set(r){let o=Pl(r);t()?.setUnsupportedElementRules(o),n=o;}}}var Su=class{constructor(t,n,r,o){this.selection=n;this.part=r;this.revision=o;this.position=t?chunkZOZI27AW_cjs.Wl(t):void 0;}selection;part;revision;entries=new WeakMap;position;save(){let t=this.part(),n=o=>{let i=chunkZOZI27AW_cjs.Xa(t,o.paragraphId);return {nodeId:o.paragraphId,stableId:i&&i.kind!=="textValue"?chunkZOZI27AW_cjs.Ab(i):null,offset:o.offset}},r=this.selection();return {partName:t.name,anchor:n(r.anchor),head:n(r.head)}}begin(){if(!this.position)return ()=>{};let t=this.revision(),n=this.save();return ()=>{let r=this.position.current();!r||t===this.revision()||this.entries.set(r,{before:this.entries.get(r)?.before??n,after:this.save()});}}step(t,n){let r=this.position?.current(),o=n(),i=t==="undo"?r:this.position?.current(),a=i?this.entries.get(i):void 0,s=t==="undo"?a?.before:a?.after;return {changed:o,selection:s?this.resolve(s):null}}resolve(t){let n=this.part();if(n.name!==t.partName)return null;let r=new Map,o=[n.root];for(;o.length;){let l=o.pop();for(let d of l.children)d.kind!=="textValue"&&o.push(d);if(l.kind!=="paragraph")continue;let c=chunkZOZI27AW_cjs.Ab(l);c&&r.set(c,l.id);}let i=l=>{let c=l.stableId?r.get(l.stableId):l.nodeId;return c?{paragraphId:c,offset:l.offset}:null},a=i(t.anchor),s=i(t.head);return a&&s?{anchor:a,head:s}:null}};var o_=new Set(["Shift","Control","Alt","AltGraph","Meta","OS","Hyper","Super","Symbol","Fn","FnLock","CapsLock","NumLock","ScrollLock","SymbolLock"]),i_=["opening","fonts","drawing-resources"];function lT(e){return !o_.has(e.key)}function cT(e){return e.paragraphIds.size>0||!i_.some(t=>e.dependencyKeys.has(t))}var a_=new Set;function Tl(e,t){let n=chunkFDSL5OJU_cjs.Bd(e,t.displayMode,t.authorFilter),r=chunkFDSL5OJU_cjs.Dc(n);if(r===n)return a_;let o=new Set(n.map(i=>i.id));return new Set(r.flatMap(i=>o.has(i.id)?[]:[i.id]))}function s_(e,t,n){let r=chunkFDSL5OJU_cjs.Bd(e,n.displayMode,n.authorFilter),o=chunkFDSL5OJU_cjs.Dc(r);if(o===r)return null;let i=new Set(r.map(l=>l.id));if(i.has(t))return null;let a=o.findIndex(l=>l.id===t);if(a===-1)return null;let s=o.slice(a+1).find(l=>i.has(l.id));return s?.kind==="paragraph"?s.id:null}function l_(e,t,n,r){let o=c=>e.findIndex(d=>d.kind!=="textValue"&&d.id===c),i=o(t),a=o(n);if(i===-1||a<=i)return null;let s=[];for(let c=i+1;c<a;c+=1){let d=e[c];if(d.kind==="textValue")return null;s.push(d.id);}if(s.length===0)return s;let l=r();return s.every(c=>l.has(c))?s:null}function dT(e,t,n,r){let o=chunkZOZI27AW_cjs.Ya(e,t);if(o===null||chunkZOZI27AW_cjs.Ya(e,n)?.id!==o.id)return null;let i=l_(o.children,t,n,()=>Tl(o.children,r));return i===null?null:[...i,n].map(a=>({op:"joinParagraphs",firstId:t,secondId:a}))}function uT(e,t,n,r){if(chunkFDSL5OJU_cjs.Gd(e,n.paragraphId).length>0)return n;let o=chunkZOZI27AW_cjs.Ya(t,n.paragraphId);if(o===null)return n;let i=s_(o.children,n.paragraphId,r);return i===null?n:{paragraphId:i,offset:0}}function c_(e,t,n,r,o){if(chunkFDSL5OJU_cjs.Gd(e,n.paragraphId).length>0)return null;let i=chunkZOZI27AW_cjs.Ya(t,n.paragraphId);if(i===null||!Tl(i.children,r).has(n.paragraphId))return null;let a=i.children,s=a.findIndex(d=>d.kind!=="textValue"&&d.id===n.paragraphId),l;for(let d=s-1;d>=0&&l===void 0;d-=1)a[d].kind!=="textValue"&&(l=a[d]);if(l===void 0||l.kind!=="paragraph")return null;let c=o==="backward"?{paragraphId:l.id,offset:(chunkZOZI27AW_cjs.Tk(t,l.id)??"").length}:uT(e,t,n,r);return {ops:[{op:"joinParagraphs",firstId:l.id,secondId:n.paragraphId}],caret:c}}function d_(e,t,n){let r=chunkZOZI27AW_cjs.Ya(e,t);if(r===null)return null;let o=r.children,i=o.findIndex(l=>l.kind!=="textValue"&&l.id===t);if(i===-1)return null;let a=null,s=[];for(let l=i+1;l<o.length;l+=1){let c=o[l];if(c.kind!=="textValue"){if(a??=Tl(o,n),!a.has(c.id))break;s.push({op:"joinParagraphs",firstId:t,secondId:c.id});}}return s.length>0?s:null}function fT(e){let t=n=>uT(e.layout(),e.part(),n,e.view());return {joinOps:(n,r)=>dT(e.part(),n,r,e.view()),forwardJoinOps:(n,r)=>dT(e.part(),n,r,e.view())??d_(e.part(),n,e.view()),shown:t,removedCaretEdit:(n,r)=>c_(e.layout(),e.part(),n,e.view(),r),shownRange:n=>{let{from:r,to:o}=n;if(r.paragraphId!==o.paragraphId||r.offset!==o.offset)return n;let i=t(r);return i===r?n:{from:i,to:i}},shownSelection:n=>{let{anchor:r,head:o}=n;if(r.paragraphId!==o.paragraphId||r.offset!==o.offset)return n;let i=t(o);return i===o?n:{...n,anchor:i,head:i}}}}function u_(e){return e.level==="inline"&&e.range!==void 0&&e.range.start<e.range.end&&(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")}function sh(e,t,n){let r=(e.contentControls??[]).filter(l=>u_(l)&&l.range.paragraphId===t.paragraphId&&l.range.start>=t.offset&&l.range.end<=n.offset),o=r.filter(l=>!r.some(c=>c!==l&&c.range.start<=l.range.start&&c.range.end>=l.range.end&&c.nestingDepth<l.nestingDepth)).sort((l,c)=>c.range.start-l.range.start);if(o.length===0)return null;let i=t.paragraphId,a=[],s=n.offset;for(let l of o)l.range.end<s&&a.push({op:"deleteText",paragraphId:i,start:l.range.end,end:s}),a.push({op:"removeContentControl",controlId:l.id,keepContent:false}),s=l.range.start;return t.offset<s&&a.push({op:"deleteText",paragraphId:i,start:t.offset,end:s}),a}function pT(e){let{anchor:t,head:n}=e.selection;if(t.paragraphId!==n.paragraphId)return null;if(t.offset!==n.offset){if(e.tracked)return null;let[l,c]=t.offset<n.offset?[t,n]:[n,t],d=sh(e.layout,l,c);return d?{kind:"remove",ops:d,collapseTo:l}:null}let r=e.shown(n),o=e.direction==="backward",i=e.controlBeside(r,o?"before":"after");if(!i)return null;let a={paragraphId:r.paragraphId,offset:i.start},s={paragraphId:r.paragraphId,offset:i.end};if(i.struck){let l=o?a:s;return {kind:"select",selection:{anchor:l,head:l}}}return i.contentLocked?{kind:"select",selection:o?{anchor:s,head:a}:{anchor:a,head:s}}:{kind:"remove",ops:e.tracked?[{op:"deleteText",paragraphId:r.paragraphId,start:i.start,end:i.end}]:[{op:"removeContentControl",controlId:i.controlId,keepContent:false}],collapseTo:o?a:e.tracked?s:r}}var mT="\uFFFC";function f_(e,t){let n=new Map,r=new Set,o=chunkFDSL5OJU_cjs.Gd(e,t),i=o[0],a=i&&e.pages.find(l=>l.index===i.pageIndex),s=i&&[a?.header,a?.footer].some(l=>l?chunkFDSL5OJU_cjs.Ba(l.fragments).some(c=>c.lines.includes(i.line)):false);for(let{line:l,pageIndex:c}of o)if(!(s&&c!==i.pageIndex)&&!r.has(l)){r.add(l);for(let d of chunkFDSL5OJU_cjs.Qa(l,t)?.spans??[])!d.fieldAtom&&!d.projected||d.range.end-d.range.start===1&&n.set(d.range.start,(n.get(d.range.start)??"")+d.text);}for(let[l,c]of n)c.length<=1&&n.delete(l);return n}function El(e,t){let n=new Map,r=i=>{let a=n.get(i);return a||n.set(i,a=f_(e,i)),a},o=i=>{let a=t(e,i).split("");for(let s of r(i).keys())s<a.length&&(a[s]=mT);return a};return {markedText:(i,a)=>o(a).join(""),resultAt:(i,a)=>r(i).get(a)??null,spelledText:(i,a)=>{let s=r(a);return o(a).map((l,c)=>l===mT?s.get(c)??l:l).join("")}}}var p_=/[\p{L}\p{N}_'’]/u,gT=e=>e!==void 0&&p_.test(e);function wu(e,t,n){let r=chunkFDSL5OJU_cjs.Be(e,t.paragraphId),o=t.paragraphId,i=Math.max(0,Math.min(t.offset,r.length)),a=-1;if(gT(r[i])?a=i:i>0&&gT(r[i-1])&&(a=i-1),a===-1){let s=i,l=i;for(;s>0&&/\s/.test(r[s-1]??"");)s-=1;for(;l<r.length&&/\s/.test(r[l]??"");)l+=1;return s===l&&l<r.length&&(l+=1),{from:{paragraphId:o,offset:s},to:{paragraphId:o,offset:l}}}return {from:{paragraphId:o,offset:chunkFDSL5OJU_cjs.te(r,a+1,-1,n)},to:{paragraphId:o,offset:chunkFDSL5OJU_cjs.te(r,a,1,n)}}}function Ve(e){return {anchor:e,head:e}}function Oi(e){if(e.anchor.paragraphId!==e.head.paragraphId)return null;let t=Math.min(e.anchor.offset,e.head.offset),n=Math.max(e.anchor.offset,e.head.offset);return {paragraphId:e.head.paragraphId,start:t,end:n}}function ku(e,t,n){let{anchor:r,head:o}=t;if(r.paragraphId===o.paragraphId)return r.offset<=o.offset?{from:r,to:o}:{from:o,to:r};let i=n??chunkFDSL5OJU_cjs.Ua(e);return i.indexOf(r.paragraphId)<=i.indexOf(o.paragraphId)?{from:r,to:o}:{from:o,to:r}}function Fo(e,t,n){let r=t[0],o=i=>{let a=t.includes(i.paragraphId),s=a?i.paragraphId:r??i.paragraphId,l=a?i.offset:0,c=chunkFDSL5OJU_cjs.Be(e,s).length;return {paragraphId:s,offset:Math.max(0,Math.min(l,c))}};return {anchor:o(n.anchor),head:o(n.head)}}function lh(e,t,n,r,o,i=chunkFDSL5OJU_cjs.Be){let a=(f,p,g)=>o===void 0||!p.includes("\uFFFC")?p:p.replace(/\uFFFC/g,(b,h)=>o(f,g+h)??b);if(t.paragraphId===n.paragraphId)return a(t.paragraphId,i(e,t.paragraphId).slice(t.offset,n.offset),t.offset);let s=r??chunkFDSL5OJU_cjs.Ua(e),l=s.indexOf(t.paragraphId),c=s.indexOf(n.paragraphId);if(l===-1||c===-1)return "";let d=s.slice(l,c+1),u=a(t.paragraphId,i(e,t.paragraphId).slice(t.offset),t.offset);for(let f=1;f<d.length;f+=1){let p=d[f],g=i(e,p),b=chunkFDSL5OJU_cjs.Ra(e,p).includes(d[f-1])?"":`
24
- `;u+=b+a(p,f===d.length-1?g.slice(0,n.offset):g,0);}return u}function yT(e,t,n,r){let o=El(e,chunkFDSL5OJU_cjs.Be);return lh(e,t,n,r,o.resultAt,o.markedText)}function bT(e,t){return chunk6NVZNB7O_cjs.oa(e,t,El(e,chunkFDSL5OJU_cjs.Be).spelledText)}function ch(e){let t=[],n=r=>{if(r.kind!=="textValue"){r.kind==="paragraph"&&t.push(r.id);for(let o of r.children)n(o);}};return n(e),t}function vT(e){return e.kind}function xT(e){return e.kind!=="textValue"&&vT(e)==="contentControl"}function hT(e){return e.kind!=="textValue"&&vT(e)==="contentControlContent"}function m_(e,t){let n=new Map,r=o=>{if(o.kind!=="textValue"){if(o.kind==="table"){let i=ch(o);if(i.length>0&&i.every(a=>t.has(a))){n.set(o.id,i);return}}for(let i of o.children)r(i);}};return r(e.root),n}function g_(e,t,n){let r=new Set,o=(i,a)=>{if(i.kind!=="textValue"){if(i.kind==="table"&&n.has(i.id)){for(let s of i.children)o(s,true);return}if(xT(i)){let s=ch(i);!a&&s.length>0&&s.every(l=>t.has(l))&&r.add(i.id);for(let l of i.children)o(l,a);return}for(let s of i.children)o(s,a);}};return o(e.root,false),r}function ST(e,t,n,r,o,i){let a=new Set;for(let s=n;s<=r;s+=1){let l=t[s];(s===n?o.offset===0&&(s!==r||i.offset===e(l).length):s!==r||i.offset===e(l).length)&&a.add(l);}return a}function h_(e,t,n){let r=[],o=i=>{if(i.kind!=="textValue"){if(i.kind==="table"||xT(i)){let s=ch(i).filter(l=>n.has(l));if(s.length>0&&s.every(l=>t.has(l))){r.push(i.id);return}}for(let a of i.children)o(a);}};return o(e.root),r}function wT(e,t,n,r,o){let i=f=>chunkFDSL5OJU_cjs.Be(e,f);if(n.paragraphId===r.paragraphId&&n.offset===r.offset)return null;let a=o??chunkFDSL5OJU_cjs.Ua(e),s=a.indexOf(n.paragraphId),l=a.indexOf(r.paragraphId);if(s===-1||l===-1||s>l)return null;let c=a.slice(s,l+1),d=ST(i,a,s,l,n,r),u=a[l];return {partName:t.name,paragraphIds:c,startOffset:n.offset,endOffset:r.offset,coveredParagraphIds:[...d],fullyCoveredBlockIds:h_(t,d,new Set(a)),lastMarkCovered:r.offset===i(u).length}}function kT(e,t,n,r,o,i={displayMode:e.displayMode??"all-markup",authorFilter:void 0},a=false){let s=M=>chunkFDSL5OJU_cjs.Be(e,M),l=(M,O,B)=>(a?null:sh(e,{paragraphId:M,offset:O},{offset:B}))??[{op:"deleteText",paragraphId:M,start:O,end:B}];if(n.paragraphId===r.paragraphId)return n.offset===r.offset?{ops:[],collapseTo:n}:{ops:l(n.paragraphId,n.offset,r.offset),collapseTo:n};let c=o??chunkFDSL5OJU_cjs.Ua(e),d=c.indexOf(n.paragraphId),u=c.indexOf(r.paragraphId);if(d===-1||u===-1)return {ops:[],collapseTo:n};let f=ST(s,c,d,u,n,r),p=m_(t,f),g=new Map;for(let[M,O]of p)for(let B of O)g.set(B,M);let b=g_(t,f,p),h=d;if(g.has(n.paragraphId)){h=-1;for(let M=d+1;M<=u;M+=1)if(!g.has(c[M])){h=M;break}if(h===-1){let M=g.get(n.paragraphId);for(let O of p.get(M)??[])g.delete(O);p.delete(M),h=d;}}let y=c[h],x=h===d?n:{paragraphId:y,offset:0},v=[];for(let M=d;M<=u;M+=1){let O=c[M];if(g.has(O))continue;let B=s(O).length,q=M===d?n.offset:0,j=M===u?r.offset:B;q<j&&v.push(...l(O,q,j));}for(let M of p.keys())v.push({op:"deleteBlock",blockId:M});for(let M of b)v.push({op:"removeContentControl",controlId:M});let S=M=>{let O=chunkZOZI27AW_cjs.Ya(t,M);for(;O&&hT(O);){let B=chunkZOZI27AW_cjs.Ya(t,O.id);if(!B||!b.has(B.id))break;O=chunkZOZI27AW_cjs.Ya(t,B.id);}return O},I=new Map,C=M=>{let O=I.get(M.id);return O||I.set(M.id,O=Tl(M.children,i)),O},P=M=>{let O=[],B=q=>{for(let j of q)if(j.kind!=="textValue"&&!p.has(j.id)){if(b.has(j.id)){let z=j.children.find(hT);z&&z.kind!=="textValue"&&B(z.children);continue}if(j.kind==="paragraph"){O.push(j.id);continue}O.push(`\0barrier:${j.id}`);}};return B(M.children),O},E=(M,O)=>{let B=S(M);if(!B||S(O)!==B)return null;let q=P(B),j=q.indexOf(M),z=q.indexOf(O);if(j===-1||z<=j)return null;let _=q.slice(j+1,z);if(_.length===0)return _;let L=C(B);return _.every(X=>L.has(X))?_:null},R=y,w=y;for(let M=h+1;M<=u;M+=1){let O=c[M];if(g.has(O))continue;let B=E(w,O);if(B)for(let q of [...B,O])v.push({op:"joinParagraphs",firstId:R,secondId:q});else R=O;w=O;}return {ops:v,collapseTo:x}}function IT(e,t,n,r){return t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset?[]:chunkFDSL5OJU_cjs.He(e,t,n(),r)}function dh(e,t){if(!e)return null;let n=e.position,r=o=>o.paragraphId===n.paragraphId&&o.offset===n.offset;return r(t.anchor)&&r(t.head)?e:null}function RT(e,t,n,r){if(n===null||n.length===0)return t?null:void 0;let{anchor:o,head:i}=e;if(!(o.paragraphId!==i.paragraphId||o.offset!==i.offset))return {position:i,properties:n,base:dh(t,e)?.base??r()}}function PT(e,t,n){let r=Fo(t,n,e.selection),o=n.includes(e.selection.head.paragraphId);return {selection:r,format:o&&e.format?{...e.format,position:r.head}:null}}var Iu=class{undo=[];redo=[];moving=false;group;position;constructor(t){this.position=chunkZOZI27AW_cjs.Wl(t);}get canUndo(){return this.matches(this.undo.at(-1))}get canRedo(){return this.matches(this.redo.at(-1))}matches(t){return !!t&&!!this.position&&t.anchor===this.position.current()}record(t,n,r){if(!this.position)return;let o=this.undo.at(-1);if(r!==void 0&&r===this.group&&this.matches(o)){this.undo[this.undo.length-1]={...o,after:n},chunkZOZI27AW_cjs.Ul(r,"extended");return}this.group=r,this.position.split(),this.redo.length=0,this.undo.push({anchor:this.position.current(),before:t,after:n}),this.undo.length>200&&this.undo.shift(),chunkZOZI27AW_cjs.Ul(r,"started");}endGroup(){this.group=void 0;}noteEdit(){this.endGroup(),this.moving||(this.redo.length=0);}step(t,n,r){let o=t==="undo"?this.undo:this.redo,i=t==="undo"?this.redo:this.undo;this.endGroup(),this.moving=true;try{if(this.matches(o.at(-1))){let a=o.pop();i.push(a),n(t==="undo"?a.before:a.after);}else r();}finally{this.moving=false;}}};function TT(e,t,n,r){let o=e??chunkFDSL5OJU_cjs.Xa,i,a,s;return {current:()=>o,filter(){let l=t();return (!s||l!==i||o!==a)&&(i=l,a=o,s={...l,hiddenAuthors:l?.hiddenAuthors??new Set,revisionMarkup:o,cacheKey:`${l?.cacheKey??""}|markup:${JSON.stringify(o)}`}),s},set(l){JSON.stringify(l)!==JSON.stringify(o)&&(n(),o=l,r());}}}function ET(e){return e?.root.children.some(t=>t.kind!=="textValue"&&(t.localName==="mirrorMargins"||t.localName==="evenAndOddHeaders")&&!t.attributes.some(n=>n.localName==="val"&&["0","false","off"].includes(n.value)))??false}function CT(e,t,n,r){let o=chunkZOZI27AW_cjs.Xa(e,t);if(o?.kind!=="paragraph")return false;if(!chunkFDSL5OJU_cjs.Bc(o,n,r))return true;let i=chunkZOZI27AW_cjs.Ya(e,t);return i?chunkFDSL5OJU_cjs.Bd(i.children,n,r).some(a=>a.kind==="paragraph"&&a.id===t):false}var y_=new Set(["Shift","Control","Alt","Meta","CapsLock","NumLock","ScrollLock","ContextMenu"]);function OT(e){return {onDrawingPointerGesture(t){if(Km(t)&&t.button!==0||e.surface.editingMode()==="view")return;let n=_t(t.target)?t.target:null,o=!e.textbox()?.preparePointer(n)&&n?.closest("[data-drawing-node-id]")?.getAttribute("data-drawing-node-id");if(o&&n?.closest(".docx-drawing-textbox")){let i;for(let a of e.surface.layout().pages)if(i=chunkFDSL5OJU_cjs.Kd(a,o),i)break;if(i&&e.surface.selectDrawing(o,i.paragraphId)){t.preventDefault(),t.stopImmediatePropagation();return}}e.setIntent(o?{kind:"pointer",drawingNodeId:o}:{kind:"none"});},onDrawingKeyGesture(t){if(pl(t)&&y_.has(t.key))return;if(pl(t)&&t.key==="Escape"&&e.textbox()?.active()){e.textbox().exit(),t.preventDefault(),t.stopImmediatePropagation();return}if((pl(t)&&(t.key==="Delete"||t.key==="Backspace")&&!t.altKey&&!t.ctrlKey&&!t.metaKey||Vm(t)&&(t.inputType==="deleteContentBackward"||t.inputType==="deleteContentForward"))&&e.intent().kind==="pointer"){let r=On(e.surface);if(r!==null){t.preventDefault(),t.stopImmediatePropagation(),e.setIntent({kind:"none"}),e.surface.deleteImage(r.drawingNodeId);return}}e.setIntent({kind:"none"});}}}var FT=32,MT=new WeakMap,AT=new WeakMap,b_=new WeakMap,v_=new WeakMap;function Ru(e){let t=MT.get(e);if(t)return t;let n=[e.fragments];e.header&&n.push(e.header.fragments),e.footer&&n.push(e.footer.fragments);for(let o of [e.footnotes,e.endnotes])if(o)for(let i of o.notes)n.push(i.fragments);let r={stories:n,sparse:new Map,complete:null};return MT.set(e,r),r}function LT(e,t){let n=t?v_:b_,r=n.get(e);return r||(r={fragment:e,indent:{indent:e.indent,inTable:t},emptyStyle:e.emptyParagraphStyle},n.set(e,r)),r}function DT(e,t){return e?!e.emptyStyle&&t.emptyStyle?{...e,emptyStyle:t.emptyStyle}:e:t}function Cl(e,t,n){let r=e.get(t),o=DT(r,n);o!==r&&e.set(t,o);}function x_(e,t){let n=(r,o)=>{for(let i of r){if(i.kind==="paragraph"){t(i,o);continue}for(let a of i.rows)if(!a.isHeaderRepeat)for(let s of a.cells)n(s.blocks,true);}};for(let r of e)n(r,false);}function uh(e){if(e.complete)return e.complete;let t=new Map;x_(e.stories,(n,r)=>{let o=LT(n,r);for(let i of chunkFDSL5OJU_cjs.Sa(n))Cl(t,i,o);});for(let[n,r]of e.sparse)r&&t.set(n,r);return e.sparse.clear(),e.complete=t,t}function S_(e,t){if(e.paragraphId===t)return true;for(let n of e.lines??[])if(n.range.paragraphId===t||n.spans.some(r=>r.range.paragraphId===t)||(n.drawings??[]).some(r=>r.paragraphId===t))return chunkFDSL5OJU_cjs.Sa(e).includes(t);return false}function NT(e,t){if(e.complete)return e.complete.get(t);let n=e.sparse.get(t);if(n!==void 0)return n??void 0;if(e.sparse.size>=FT)return uh(e).get(t);let r,o=(i,a)=>{for(let s of i){if(s.kind==="paragraph"){if(!S_(s,t))continue;if(r=DT(r,LT(s,a)),r.emptyStyle)return true;continue}if(chunkFDSL5OJU_cjs.of(s).has(t)){for(let l of s.rows)if(!l.isHeaderRepeat){for(let c of l.cells)if(o(c.blocks,true))return true}}}return false};for(let i of e.stories)if(o(i,false))break;return e.sparse.set(t,r??null),r}function w_(e,t,n){for(let[r,o]of n)HT(e,t,r,o);for(let r=0;r<t.frontier;r+=1)for(let[o,i]of uh(Ru(e.pages[r])))n.has(o)||Cl(t.entries,o,i);t.progress=null;}function HT(e,t,n,r){for(let o=r;o<t.frontier;o+=1){let i=NT(Ru(e.pages[o]),n);i&&Cl(t.entries,n,i);}}function Ol(e,t,n=false){let r=AT.get(e);r||(r={frontier:0,entries:new Map,progress:new Map},AT.set(e,r));let o=()=>{let s=r.entries.get(t);return s&&(!n||s.emptyStyle)?s:void 0},i=r.progress;if(i&&!i.has(t)&&i.size>=FT&&w_(e,r,i),r.progress){HT(e,r,t,r.progress.get(t)??0);let s=o();for(;!s&&r.frontier<e.pages.length;){let l=NT(Ru(e.pages[r.frontier++]),t);l&&Cl(r.entries,t,l),s=o();}return r.progress.set(t,r.frontier),s??r.entries.get(t)}let a=o();for(;!a&&r.frontier<e.pages.length;){for(let[s,l]of uh(Ru(e.pages[r.frontier++])))Cl(r.entries,s,l);a=o();}return a??r.entries.get(t)}var fh=e=>chunkFDSL5OJU_cjs.Ed(e)?"rtl":"ltr";function k_(e,t){return Ol(e,t,true)?.emptyStyle}var BT=Object.freeze([]);function Or(e,t){return Ol(e,t)?.fragment.props??BT}function Ml(e,t){return Ol(e,t)?.fragment.tabStops??null}function Pu(e){return Math.round((e.hanging>0?-e.hanging:e.firstLine)*20)}function ph(e,t){return Ol(e,t)?.indent??null}function $T(e,t,n,r,o=chunkZOZI27AW_cjs.Ih,i){let a=chunkZOZI27AW_cjs.Xa(e,t);if(!a||a.kind!=="paragraph")return false;for(let s of chunkZOZI27AW_cjs.Jh(a,chunkZOZI27AW_cjs.Wh(a),n,r,o,i))if(chunkZOZI27AW_cjs.Rh(chunkZOZI27AW_cjs.Qh(s.run,"runProperties","rPr"),chunkZOZI27AW_cjs.Oh).length>0)return true;return false}function La(e,t,n,r=chunkZOZI27AW_cjs.Ih,o){let i=chunkZOZI27AW_cjs.Xa(e,t);if(!i||i.kind!=="paragraph")return [];if(chunkZOZI27AW_cjs.ci(i,n)===null)return [];let a=chunkZOZI27AW_cjs.bi(i,n,r,o);return a?chunkZOZI27AW_cjs.Rh(chunkZOZI27AW_cjs.Qh(a,"runProperties","rPr"),chunkZOZI27AW_cjs.Oh):chunkZOZI27AW_cjs.Th(e,t)}function Fa(e,t,n){let r=e?.find(i=>i.localName===t);if(!r)return null;let o=r.attributes?.val;return t==="vertAlign"?o===n:(t==="u"||o!=="0"&&o!=="false"&&o!=="off")&&o!=="none"}function qT(e,t){if(!t||t.length===0)return e;let n=e;for(let r of t){let o=r.attributes?.val;switch(r.localName){case "b":n={...n,bold:Fa(t,"b")===true};break;case "i":n={...n,italic:Fa(t,"i")===true};break;case "u":n={...n,underline:Fa(t,"u")===true};break;case "strike":n={...n,strikethrough:Fa(t,"strike")===true};break;case "vertAlign":n={...n,superscript:o==="superscript",subscript:o==="subscript"};break;case "rFonts":n={...n,fontFamily:r.attributes?.ascii??n.fontFamily};break;case "sz":{let i=Number(o);Number.isFinite(i)&&(n={...n,fontSizeHalfPoints:i});break}case "color":n={...n,color:o==="auto"?null:o??n.color};break;case "highlight":n={...n,highlight:o==="none"?null:o??n.highlight};break;}}return n}function mh(e,t,n,r){return (n&&n.length>0?chunk6NVZNB7O_cjs.ma(e,n):chunkFDSL5OJU_cjs.Fe(e,t,r??(t.anchor.paragraphId===t.head.paragraphId?[]:chunkFDSL5OJU_cjs.Va(e)))).map(i=>{let a=chunkFDSL5OJU_cjs.x(chunkFDSL5OJU_cjs.w(i.style));return a===i.style?i:{...i,style:a}})}function Tu(e,t){let n=e.indexOf(t.from.paragraphId),r=e.indexOf(t.to.paragraphId);if(n===-1||r===-1)return [];let o=r>n&&t.to.offset===0?r-1:r;return e.slice(n,o+1)}function Eu(e,t,n,r){return mh(e,t,n,r)[0]?.style??null}function gh(e,t,n,r,o,i){let a=mh(e,t,r,i);if(a.length===0)return false;let s=l=>{switch(n){case "b":return l.style.bold;case "i":return l.style.italic;case "u":return l.style.underline!==null;case "strike":return l.style.strike;case "vertAlign":return l.style.verticalAlign===o;default:return false}};return a.every(s)}function WT(e,t,n,r,o,i,a,s=true){let l=s?mh(e,t,r,i):[],c=l.length===0?_T(e,t,r,i).map(_=>k_(e,_)).filter(_=>_!==void 0):[],d=c.length>0?c:l.map(_=>_.style),u=_=>{if(d.length===0)return null;let L=_(d[0]);return d.every(X=>_(X)===L)?L:null},f=(_,L=(X,te)=>X===te)=>_.length>0&&_.every(X=>L(X,_[0]))?_[0]:null,p=(_,L)=>_.props.some(X=>X.localName===L),g=_=>_.style.fontFamily??n?.(_.range.paragraphId,_.props).fontFamily??null,b=_=>p(_,"sz")?Math.round(_.style.fontSizePt*2):n?.(_.range.paragraphId,_.props).fontSizeHalfPoints??Math.round(_.style.fontSizePt*2),h=c.length>0?{fontFamily:u(_=>_.fontFamily??a??null),fontSizeHalfPoints:u(_=>Math.round(_.fontSizePt*2))}:l.length===0?n?.(t.head.paragraphId,[]):void 0,y=_T(e,t,r,i),x=_=>f(y.map(L=>_(Or(e,L)))),v=(_,L=(X,te)=>X===te)=>{if(y.length<2)return false;let X=_(Or(e,y[0]));return y.some((te,me)=>me>0&&!L(_(Or(e,te)),X))},S=x(_=>chunkFDSL5OJU_cjs.md(_)),I=x(fh),C=x(_=>chunkFDSL5OJU_cjs.R(_,"pStyle")?.val??o??void 0)??null,P=_=>chunkFDSL5OJU_cjs.R(_,"spacing")??void 0,E=_=>{if(_===BT)return "";let L=chunkFDSL5OJU_cjs.T(_),X=te=>Math.round(te*100)/100;return L.rule==="auto"?`multiple:${X(L.value/240)}`:`${L.rule}:${X(L.value)}`},R=x(E),w=(()=>{if(!R)return null;let[_,L]=R.split(":");return {rule:_,value:Number(L)}})(),M=(_,L)=>{let X=chunkZOZI27AW_cjs.sd(P(_)?.[L]);return X===null?null:Math.round(X/20*100)/100},O=_=>x(L=>M(L,_)),B=(()=>{let _=$=>fh(Or(e,$))==="rtl",L=y.map($=>{let K=ph(e,$);return !K||!_($)?K:{...K,indent:{...K.indent,left:K.indent.right,right:K.indent.left}}}),X=L[0];if(!X||L.some($=>$===null||$.inTable))return null;let te=_(y[0]),me=$=>Math.round($*20),se=L,D=me(X.indent.left),T=me(X.indent.right),W=Pu(X.indent);return {left:D,right:T,firstLine:W,mixed:{left:se.some($=>me($.indent.left)!==D),right:se.some($=>me($.indent.right)!==T),firstLine:se.some($=>Pu($.indent)!==W)},...te?{rtl:te}:{}}})(),q=_=>x(L=>_(chunkFDSL5OJU_cjs.zd(L))),j=x(chunkFDSL5OJU_cjs.K),z=x(chunkFDSL5OJU_cjs.V);return {bold:d.length>0&&d.every(_=>_.bold),italic:d.length>0&&d.every(_=>_.italic),underline:d.length>0&&d.every(_=>_.underline!==null),strikethrough:d.length>0&&d.every(_=>_.strike),superscript:d.length>0&&d.every(_=>_.verticalAlign==="superscript"),subscript:d.length>0&&d.every(_=>_.verticalAlign==="subscript"),fontFamily:l.length>0?f(l.map(g)):h?.fontFamily??null,fontSizeHalfPoints:l.length>0?f(l.map(b)):h?.fontSizeHalfPoints??null,color:u(_=>_.color),highlight:u(_=>_.highlight),alignment:S,direction:I,styleId:C,lineSpacing:w,spaceBeforePt:O("before"),spaceAfterPt:O("after"),disagrees:{alignment:v(_=>chunkFDSL5OJU_cjs.md(_)),direction:v(fh),spaceBeforePt:v(_=>M(_,"before")),spaceAfterPt:v(_=>M(_,"after")),lineSpacing:v(E),tabStops:(()=>{if(y.length<2)return false;let _=JSON.stringify(Ml(e,y[0])?.stops??null);return y.some((L,X)=>X>0&&JSON.stringify(Ml(e,L)?.stops??null)!==_)})()},indent:B,tabStops:f(y.map(_=>Ml(e,_)?.stops??null),(_,L)=>_===null||L===null?_===L:_.length===L.length&&_.every((X,te)=>Math.round(X.positionPt*20)===Math.round(L[te].positionPt*20)&&X.alignment===L[te].alignment&&(X.leader??"none")===(L[te].leader??"none")))?.map(_=>({positionTwips:Math.round(_.positionPt*20),alignment:_.alignment,..._.leader?{leader:_.leader}:{}}))??null,paragraphFlags:{contextualSpacing:z,keepNext:q(_=>_.keepNext),keepLines:q(_=>_.keepLines),widowControl:q(_=>_.widowControl),pageBreakBefore:j}}}function _T(e,t,n,r){if(n&&n.length>0)return [...chunk6NVZNB7O_cjs.la(e,n)];if(t.anchor.paragraphId===t.head.paragraphId)return [t.head.paragraphId];let o=r??chunkFDSL5OJU_cjs.Va(e),i=o.indexOf(t.anchor.paragraphId),a=o.indexOf(t.head.paragraphId);return i===-1||a===-1?[t.head.paragraphId]:o.slice(Math.min(i,a),Math.max(i,a)+1)}function jT(e,t,n,r){return t.paragraphId!==n.paragraphId?[]:t.offset!==0||n.offset!==e.length?[]:e.length===0?[]:[{op:"setParagraphMarkProperties",paragraphId:t.paragraphId,properties:r}]}function KT(e){let t=null,n=null,r=null,o=()=>t&&chunkZOZI27AW_cjs.Di(e.session.part()).find(l=>l.root.id===t.id&&l.drawingNodeId===t.drawingNodeId),i=()=>{if(t&&!o()){a();return}for(let l of e.pagesLayer.querySelectorAll(".docx-drawing-textbox")){let c=l.dataset.drawingNodeId===t?.drawingNodeId;l.dataset.docxTextboxActive=String(c),l.contentEditable=c?"true":"false",l.setAttribute("role",c?"textbox":"img"),c?(l.removeAttribute("aria-hidden"),l.setAttribute("aria-multiline","true")):(l.removeAttribute("aria-multiline"),l.hasAttribute("aria-label")||l.setAttribute("aria-hidden","true"));for(let d of l.querySelectorAll("[data-textbox-paragraph-id]"))c?d.dataset.paragraphId=d.dataset.textboxParagraphId:delete d.dataset.paragraphId;}},a=(l=true)=>{t&&(e.flush(),t=null,r=null,i(),l&&n&&e.setSelection(n),n=null);},s=l=>{if(l.owner||!e.writable())return false;e.flush();let c=chunkZOZI27AW_cjs.Di(e.session.part()).find(I=>I.root.id===l.id&&I.drawingNodeId===l.drawingNodeId&&I.hostParagraphId===l.hostParagraphId),d=c&&chunkZOZI27AW_cjs.Ya(e.session.part(),c.root.id),u=d&&chunkZOZI27AW_cjs.Ya(e.session.part(),d.id),f=u&&chunkZOZI27AW_cjs.Bd(u.children,{namespaceUri:chunkZOZI27AW_cjs.ma,localName:"spPr"}),p=f&&chunkZOZI27AW_cjs.Bd(f.children,{namespaceUri:chunkZOZI27AW_cjs.va,localName:"xfrm"}),g=u&&chunkZOZI27AW_cjs.Bd(u.children,{namespaceUri:chunkZOZI27AW_cjs.ma,localName:"bodyPr"}),b=p&&chunkZOZI27AW_cjs.oa(p.attributes,"rot"),h=g&&chunkZOZI27AW_cjs.oa(g.attributes,"rot"),y=g&&chunkZOZI27AW_cjs.oa(g.attributes,"vert");if(b&&Number(b)!==0||h&&Number(h)!==0||y&&y!=="horz")return false;let x;for(let I of e.layout().pages)if(x=chunkFDSL5OJU_cjs.Kd(I,l.drawingNodeId),x)break;if(!c||!x?.textboxStory||x.transform.rotationDegrees!==0||x.textboxStory.fragments.some(I=>I.kind!=="paragraph"))return false;let v=x.textboxStory.fragments[0];if(!v||v.kind!=="paragraph")return false;if(t?.id===l.id)return true;a(),e.leaveOtherStories(),n=e.selection(),t=l,r=null,i();let S={paragraphId:v.paragraphId,offset:v.range.start};return e.setSelection({anchor:S,head:S}),true};return {active:()=>t,replacementFormatOps(l,c,d){let{anchor:u,head:f}=e.selection();if(!t||d===0||u.paragraphId===f.paragraphId&&u.offset===f.offset)return [];let p=La(e.session.part(),l,c);return p.length?[{op:"setRunProperties",paragraphId:l,start:c,end:c+d,properties:p}]:[]},enter:s,exit:a,syncDom:i,contains:l=>{let c=o();return !!c&&chunkZOZI27AW_cjs.Vc(c.root).some(d=>d.id===l)},paragraphIds:()=>{let l=o();return l?chunkZOZI27AW_cjs.Vc(l.root).map(c=>c.id):[]},caretInput(l){if(!t)return {};let c=t.drawingNodeId,d;for(let g of l.pages)if(d=chunkFDSL5OJU_cjs.Kd(g,c),d)break;let u=d?.textboxStory,p=[...e.pagesLayer.querySelectorAll(".docx-drawing-textbox")].find(g=>g.dataset.drawingNodeId===c)?.querySelector(".docx-drawing-textbox-content");return !d||!u||!p?{}:{scopedHost:p,scopedHostKind:"textbox",scopedOrigin:{x:d.x+u.contentOffset.x,y:d.y+u.contentOffset.y}}},layout(l){if(!t)return l;if(r?.base===l&&r.id===t.id)return r.layout;let c=t.drawingNodeId,d={...l,pages:l.pages.map(u=>{let f=chunkFDSL5OJU_cjs.Kd(u,c),p=f?.textboxStory;return {...u,header:void 0,footer:void 0,footnotes:void 0,endnotes:void 0,anchoredDrawings:[],fragments:f&&p?p.fragments.flatMap(g=>g.kind==="paragraph"?[chunkFDSL5OJU_cjs.Ye(g,f.x+p.contentOffset.x,f.y+p.contentOffset.y)]:[]):[]}})};return r={base:l,id:t.id,layout:d},d},preparePointer(l){let d=l?.closest(".docx-drawing-textbox-content")?.closest("[data-drawing-node-id]")?.dataset.drawingNodeId,u=d&&chunkZOZI27AW_cjs.Di(e.session.part()).find(f=>f.drawingNodeId===d);return u&&s({kind:"frame",id:u.root.id,drawingNodeId:u.drawingNodeId,hostParagraphId:u.hostParagraphId})?true:(a(false),false)}}}function VT(e,t,n){return (r,o)=>{let i=t(),a=n();return chunkZOZI27AW_cjs.ai(Ee(e,r)??e.part(),r,o,chunk3IEXDEFH_cjs.a(e.stylesRoot(),e.settingsRoot(),i,a),i,a)}}function hh(e,t){e.setAttribute("aria-label",t?.("editor.documentContent")??i18n.en.editor.documentContent);}var yh="An external document refresh is in progress.",Fl="rejected",ao="A preview is open. Commit or discard it before editing.",Da=new WeakSet,Al=new WeakSet,UT=new WeakMap,cr=e=>Da.has(e)||Al.has(e),zT=e=>Da.has(e),Na=e=>!Da.has(e)&&Al.has(e)?ao:yh;function Lo(e,t){t?Da.add(e):Da.delete(e);}function bh(e,t){t?Al.add(e):Al.delete(e);}function GT(e,t){UT.set(e,t);}var Cu=e=>UT.get(e)?.()??false,R_=new Set(["toggleReviewPane","toggleParagraphMarks","selectAll","setSelection","copyFormatting"]),vh=(e,t)=>!Da.has(e)&&Al.has(e)&&R_.has(t.type);function ZT(e){let t="select[data-docx-form-dropdown]",n=c=>_t(c)?c.closest(t):null,r=c=>{let d=c.closest("[data-start][data-paragraph-id]"),u=d?.dataset.paragraphId;if(!d||!u)return null;let f=e.part(u),p=chunkZOZI27AW_cjs.Xa(f,u);if(p?.kind!=="paragraph")return null;let g=Number(d.dataset.start),b=chunkZOZI27AW_cjs.bj(p).find(y=>y.start<=g&&g<y.end);if(!b)return null;let h={op:"setLegacyDropdown",paragraphId:u,fieldNodeId:b.fieldNodeId,selectedIndex:c.selectedIndex};return {field:b,paragraphId:u,op:h,enabled:e.editable()&&e.canApply(h)&&chunkZOZI27AW_cjs.tj(e.settings(),h)===null&&chunkZOZI27AW_cjs.Hl(f,h)===null}},o=()=>{for(let c of e.pagesLayer.querySelectorAll(t))c.disabled=!r(c)?.enabled;},i=c=>{let d=n(c.target);d&&(c.stopPropagation(),r(d)?.enabled||c.preventDefault());},a=c=>{let d=n(c.target);d&&(d.disabled=!r(d)?.enabled);},s=c=>{let d=n(c.target);if(!d)return;c.stopPropagation();let u=r(d);if(!u)return;if(!u.enabled||!e.apply(u.op)){d.selectedIndex=u.field.selectedIndex;return}e.select({anchor:{paragraphId:u.paragraphId,offset:u.field.start},head:{paragraphId:u.paragraphId,offset:u.field.end}}),[...e.pagesLayer.querySelectorAll(t)].find(p=>{let g=p.closest("[data-start][data-paragraph-id]");return g?.dataset.paragraphId===u.paragraphId&&Number(g.dataset.start)===u.field.start})?.focus({preventScroll:true});},l=new(je(e.pagesLayer)).MutationObserver(c=>{for(let d of c)for(let u of d.addedNodes){if(!_t(u))continue;let f=u.matches(t)?[u]:u.querySelectorAll(t);for(let p of f)p.disabled=!r(p)?.enabled;}});return l.observe(e.pagesLayer,{childList:true,subtree:true}),e.pagesLayer.addEventListener("pointerdown",i,true),e.pagesLayer.addEventListener("focusin",a),e.pagesLayer.addEventListener("change",s),o(),{sync:o,keydown(c){let d=n(c.target);if(!d)return false;c.stopPropagation();let u=c.key.toLowerCase();return (c.ctrlKey||c.metaKey)&&!c.altKey&&(u==="z"||u==="y")?(c.preventDefault(),e.pagesLayer.focus({preventScroll:true}),e.history(u==="y"||c.shiftKey?"redo":"undo"),true):(!r(d)?.enabled&&c.key!=="Tab"&&c.preventDefault(),true)},destroy(){l.disconnect(),e.pagesLayer.removeEventListener("pointerdown",i,true),e.pagesLayer.removeEventListener("focusin",a),e.pagesLayer.removeEventListener("change",s);}}}function XT(e,t){let n=chunkZOZI27AW_cjs.Ya(e,t.id);for(let i=0;n&&i<64&&(n.namespaceUri===chunkZOZI27AW_cjs.pa&&n.localName==="customXml"||chunkZOZI27AW_cjs.Yc(n)||chunkZOZI27AW_cjs.Zc(n));i+=1)n=chunkZOZI27AW_cjs.Ya(e,n.id);if(!n)return [];let r=chunkZOZI27AW_cjs.ad(n.children),o=r.findIndex(i=>i.id===t.id);return o>=2?r.slice(o-2,o):[]}function YT(e){let t=n=>n.kind==="textValue"?/^[ \t\u00a0]*$/.test(n.value):n.namespaceUri!==chunkZOZI27AW_cjs.pa?false:n.localName==="pPr"?!n.children.some(r=>r.kind!=="textValue"&&r.localName==="sectPr"):n.localName==="rPr"||n.localName==="tab"||["bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","proofErr"].includes(n.localName)?true:["p","r","t","hyperlink"].includes(n.localName)?n.children.every(t):false;return t(e)}function QT(e,t,n,r,o,i,a,s){let l=chunkZOZI27AW_cjs.Xa(e,n.paragraphId);if(l?.kind!=="paragraph")return null;let[c,d]=XT(e,l);if(d?.kind!=="paragraph"||c?.kind!=="paragraph"||!YT(d))return null;let u=chunkFDSL5OJU_cjs.Ta(t,l.id),f=chunkFDSL5OJU_cjs.Ta(t,c.id);if(!u||u.numId!==f?.numId||u.level!==f.level||chunkFDSL5OJU_cjs.Ta(t,d.id))return null;let p=(C,P,E,R)=>({id:C,kind:P,localName:E,namespaceUri:chunkZOZI27AW_cjs.pa,prefix:"w",namespaceBindings:[],attributes:[],children:R}),g=l.children.find(C=>C.kind==="paragraphProperties"),b=g&&{...g,children:g.children.filter(C=>C.localName!=="sectPr")},h=chunkZOZI27AW_cjs.aj({localName:"pStyle",attributes:{val:o}},"separator-style"),y=r.map((C,P)=>chunkZOZI27AW_cjs.aj(C,`separator-format-${P}`));a&&y.push(chunkZOZI27AW_cjs.aj({localName:"ins",attributes:{id:chunkZOZI27AW_cjs.Ch(e,s)(),author:a.author,...a.date?{date:a.date}:{}}},"separator-insertion"));let x=p("separator-mark","runProperties","rPr",y),v=p("separator-properties","paragraphProperties","pPr",[...h?[h]:[],...y.length?[x]:[]]),S=[...v.children],I=i?.styles.has(o)?v:p("separator-defaults","paragraphProperties","pPr",[]);return i&&chunkFDSL5OJU_cjs.Gc(chunkFDSL5OJU_cjs.ud(i,I).paragraphPropertyNodes)&&S.splice(h?1:0,0,p("separator-numbering","generic","numPr",[chunkZOZI27AW_cjs.aj({localName:"numId",attributes:{val:"0"}},"separator-number-id")])),{op:"insertFragment",paragraphId:l.id,offset:n.offset,blocks:[p("separator-head","paragraph","p",b?[b]:[]),p("separator-blank","paragraph","p",[p("separator-properties-final","paragraphProperties","pPr",S)])],lastMarkCovered:true}}function JT(e,t=true){return e.ownerDocument.defaultView?.navigator?.scheduling?.isInputPending?.({includeContinuous:t})??false}function xh(e,t){let n=e.setScale;return typeof n!="function"?false:n.call(e,t)}var eE=new Set(["comment-add","comment-delete","comment-reply","comment-resolve","package-scoped","revision-resolve","revision-attribution"]);var P_="list paragraph",T_="ListParagraph";function tE(e){return e.find(t=>t.localName==="pStyle")?.attributes?.val}function Ou(e){let t=null;for(let n of e)if(n.type==="paragraph"){if(n.name.trim().toLowerCase()===P_)return n.styleId;t===null&&n.styleId===T_&&(t=n.styleId);}return t}function nE(e){let{session:t}=e,n;function r(){let o=t.stylesRoot();return (n===void 0||n.root!==o)&&(n={root:o,styleId:chunkFDSL5OJU_cjs.td(o,t.documentThemeFonts()).defaultParagraphStyleId}),n.styleId}return {applyOps(o){let i=Ou(t.documentStyles());if(i===null)return [];let a=r(),s=e.storyPart(),l=[];for(let c of o){let d=chunkZOZI27AW_cjs.Sh(s,c),u=tE(d);u!==void 0&&u!==a||l.push({op:"setParagraphProperties",paragraphId:c,properties:chunkZOZI27AW_cjs.Uh(d,{localName:"pStyle",attributes:{val:i}})});}return l},clearOp(o){let i=Ou(t.documentStyles());if(i===null)return null;let a=chunkZOZI27AW_cjs.Sh(e.storyPart(),o);return tE(a)!==i?null:{op:"setParagraphProperties",paragraphId:o,properties:a.filter(s=>s.localName!=="pStyle")}}}}function rE(e,t){return n=>{let r=chunkZOZI27AW_cjs.fd(n),o=r?.name??"/word/styles.xml",i="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml",a=r?null:chunkZOZI27AW_cjs.Ma('<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"/>',{name:o,contentType:i}),s=r??(a?.ok?a.part:null);if(!s)throw new Error("Cannot create list paragraph style");if(s.root.children.some(g=>g.kind!=="textValue"&&g.attributes.some(b=>b.localName==="styleId"&&b.value===t)))return n;let l=chunkZOZI27AW_cjs.Va(s),c=(g,b={},h=[])=>({...chunkZOZI27AW_cjs.aj({localName:g,attributes:b},l()),children:h,...g==="pPr"?{kind:"paragraphProperties"}:{}}),u={...c("style",{type:"paragraph",styleId:t},[c("name",{val:"List Paragraph"}),...e?[c("basedOn",{val:e})]:[],c("uiPriority",{val:"34"}),c("qFormat"),c("pPr",{},[c("ind",{left:"720"}),c("contextualSpacing")])]),namespaceBindings:[{prefix:"w",namespaceUri:chunkZOZI27AW_cjs.pa}]};if(r){let g=chunkZOZI27AW_cjs.ab(s,s.root.id,s.root.children.length,[u]);if(!g.ok)throw new Error("Cannot insert list paragraph style");return chunkZOZI27AW_cjs.Ne(n,g.part)}let f=chunkZOZI27AW_cjs.Xe(n,o,{...s.root,children:[u]},i);f=chunkZOZI27AW_cjs.Ve(f,n.mainDocumentPart);let p=chunkZOZI27AW_cjs.We(f,n.mainDocumentPart,"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",o);if(!p.ok)throw new Error("Cannot link list paragraph style");return p.pkg}}function Mu(e,t){let n=e.ownerDocument,r=e.dataset.docxCcId,o=()=>{n.removeEventListener("pointerdown",i,true),n.removeEventListener("keydown",a,true);},i=s=>{if(e.parentNode===null){o();return}let l=s.target,c=_t(l)?l.closest("[data-docx-cc-widget]"):null;l&&(e.contains(l)||c?.getAttribute("data-docx-cc-id")===r)||(o(),t());},a=s=>{s.key!=="Escape"||s.isComposing||(s.preventDefault(),o(),e.parentNode!==null&&(s.stopPropagation(),t()));};return n.addEventListener("pointerdown",i,true),n.addEventListener("keydown",a,true),o}function oE(e,t,n,r,o){let a=chunkFDSL5OJU_cjs.Ae(e).find(u=>u.id===n)?.fragments[0],s=a?e.pages[a.pageIndex]:void 0;if(!a||!s)return null;let l=o?.get(a.pageIndex)??0,c=s.contentBox.x-s.box.x,d=s.contentBox.y-s.box.y;return {left:(s.box.x+l+c+a.box.x)*t,top:(s.box.y+d+a.box.y+a.box.height)*t,element:[...r.querySelectorAll("[data-docx-content-control]")].find(u=>u.dataset.docxContentControl===n)?.querySelector(".docx-content-control-boundary")??void 0,sheetLeft:(s.box.x+l)*t,sheetRight:(s.box.x+l+s.box.width)*t}}function iE(e){return e.kind==="textValue"?e.value:e.localName==="sdtPr"?"":e.children.map(iE).join("")}function Sh(e,t){let n=e?iE(e):"";return t.find(r=>r.displayText===n)?.value??n}function aE(e){let t=e?.children.find(n=>n.kind!=="textValue"&&n.localName==="sdtPr");if(!(!t||t.kind==="textValue")){for(let n of t.children)if(n.kind!=="textValue"){if(n.localName==="dropDownList")return "dropdown";if(n.localName==="comboBox"||n.localName==="date")return n.localName;if(n.localName==="checkbox")return "checkbox";if(n.localName==="picture")return "picture";if(n.localName==="docPartList")return "buildingBlockGallery"}}}var E_=["dropdown","comboBox","date","checkbox","picture","buildingBlockGallery"];function sE(e){let t=null,n=false,r=()=>{let o=t;t=null,o&&(e.setOpen(o.id,false),o.controller.abort());};return {cancel:r,destroy(){n=true,r();},open(o,i){if(r(),n||!e.request||!E_.includes(i))return false;let a=new AbortController;t={controller:a,id:o};let s=()=>!n&&t?.controller===a&&!a.signal.aborted,l=()=>s()&&aE(e.find(o))===i&&e.allowed(o),c=e.find(o),d=e.items(o).map(b=>({...b})),u=Sh(c,d),f=i==="picture"?e.picture(o):void 0;if(i==="picture"&&!f)return r(),false;let p=false,g={controlId:o,kind:i,items:d,value:i==="date"?e.date(o)??"":i==="checkbox"?String(e.checked(o)):i==="picture"?f:i==="buildingBlockGallery"?"":u,locale:e.locale(),anchor:[...e.layer.querySelectorAll("[data-docx-content-control]")].find(b=>b.getAttribute("data-docx-content-control")===o)?.querySelector(".docx-content-control-boundary")??null,signal:a.signal,canApply:l,apply(b){return i==="picture"||!l()||!e.apply(o,b)?false:(s()&&r(),true)},cancel(){s()&&r();},...i==="picture"?{async replaceImage(b){if(p||!l())return false;p=true;try{return await e.replaceImage(o,b,()=>l()&&e.picture(o)===f)?(s()&&r(),!0):!1}finally{p=false;}}}:{}};return e.setOpen(o,true),e.request(g)?true:(g.cancel(),false)}}}function lE(e,t){if(!e)return [];if(t&&dE(e))return chunkZOZI27AW_cjs.Sg(t(),e).map(n=>({displayText:n.name,value:n.name}));for(let n of e.children)if(n.kind!=="textValue"&&!(n.kind!=="contentControlProperties"&&n.localName!=="sdtPr"))for(let r of n.children){if(r.kind==="textValue"||r.localName!=="dropDownList"&&r.localName!=="comboBox")continue;let o=[];for(let i of r.children){if(i.kind==="textValue"||i.localName!=="listItem")continue;let a=i.attributes.find(l=>l.localName==="value")?.value??"",s=i.attributes.find(l=>l.localName==="displayText")?.value??a;o.push({displayText:s,value:a});}return o}return []}function cE(e){if(e){for(let t of e.children)if(t.kind==="contentControlProperties"){for(let n of t.children)if(n.kind==="contentControlDate")return n.attributes.find(r=>r.localName==="fullDate")?.value}}}function dE(e){return aE(e&&e.kind!=="textValue"?e:null)==="buildingBlockGallery"}function uE(e,t,n,r){if(!e||!dE(e))return [{op:"setContentControlValue",controlId:n,value:r}];let o=chunkZOZI27AW_cjs.Sg(t(),e).filter(a=>a.name===r),i=o.length===1?o[0]:void 0;return i?[{op:"insertBuildingBlock",controlId:n,name:i.name,blocks:i.blocks}]:null}function fE(e){let t=-1,n=true;return ()=>{let r=e.packageRevision();return t!==r&&(t=r,n=!chunkZOZI27AW_cjs.Ai(e.settingsRoot()).doNotShadeFormData),n}}var Mi="switch to field results before editing a form value";function pE(e,t){let{anchor:n,head:r}=t,o=n.paragraphId===r.paragraphId;for(let i of [n,r]){let a=e(i.paragraphId),s=a&&chunkZOZI27AW_cjs.Xa(a,i.paragraphId);if(s?.kind!=="paragraph")continue;let l=o?Math.min(n.offset,r.offset):i.offset,c=o?Math.max(n.offset,r.offset):i.offset,d=chunkZOZI27AW_cjs.rg(s);if(chunkZOZI27AW_cjs.Pf(s).filter(f=>f.addressing==="editable-result").map(f=>{let p=d.spanOf(f.node)?.start??0,g=p;for(let b of f.removeNodeIds)g=Math.max(g,d.spanOf(b)?.end??g);return {start:p,end:g}}).some(f=>l===c?l>=f.start&&(l<f.end||f.start===f.end):l<f.end&&c>f.start))return true}return false}function mE(e,t,n,r){let o=e.contentControlId?chunkFDSL5OJU_cjs.Ae(t).find(d=>d.id===e.contentControlId):void 0,i=oo(n).filter(d=>d.toc.id===e.id),a=i.some(d=>d.start>0||d.end<d.length);if(o&&!a)return {tocId:e.id,boundary:o,additional:false};let s=new Map(i.map(d=>[d.paragraphId,d])),l=i.filter(d=>d.start>0||d.end<d.length).flatMap(d=>chunkFDSL5OJU_cjs.Ge(t,{anchor:{paragraphId:d.paragraphId,offset:d.start},head:{paragraphId:d.paragraphId,offset:d.end}},[d.paragraphId],r)),c=t.pages.flatMap(d=>{let u=chunkFDSL5OJU_cjs.Aa(d).filter(h=>{let y=s.get(h.paragraphId);return y&&y.start===0&&y.end===y.length}).map(chunkFDSL5OJU_cjs.Qd);if(u.push(...l.filter(h=>h.pageIndex===d.index)),u.length===0)return [];let f=Math.min(...u.map(h=>h.x)),p=Math.min(...u.map(h=>h.y)),g=Math.max(...u.map(h=>h.x+h.width)),b=Math.max(...u.map(h=>h.y+h.height));return [{pageIndex:d.index,box:{x:f,y:p,width:g-f,height:b-p}}]});return c.length===0?null:{tocId:e.id,additional:true,boundary:{id:`toc:${e.id}`,controlType:"richText",lock:"unlocked",effectiveLock:"unlocked",placeholder:false,bound:false,nestingDepth:0,level:"block",fragments:c}}}var gE=new WeakMap;function hE(e,t,n,r){gE.set(e,(o,i)=>{let a=t();e.flushPendingInput();try{n(o),r();}catch(s){throw i&&(n(a),r()),s}});}function wh(e,t,n=true){let r=gE.get(e);if(!r)throw new Error("Surface does not support measurement updates");r(t,n);}var Au=new WeakMap,C_=96;function yE(e){if(e.host){e.status.replaceChildren();return}let t=e.status.ownerDocument.createElement("span");t.className="docx-editor__loading-spinner",t.setAttribute("aria-hidden","true"),e.status.replaceChildren(t);}function bE(e,t){let n=t.ownerDocument,r=n.createElement("div");r.className="docx-opening-indicator",r.contentEditable="false";let o=n.createElement("div");o.className="docx-editor__loading-page-status",o.setAttribute("role","status"),r.append(o);let i={frame:r,status:o,host:null};Au.set(e,i),yE(i);let a=()=>{let s=r.parentElement?.querySelector(":scope > .docx-pages"),l=s?.querySelector(":scope > .docx-page");r.hidden=!s||!l,!(!s||!l)&&(r.style.left=l.style.left,r.style.top=s.style.height,r.style.width=l.style.width,r.style.height=`${C_}px`);};return t.append(r),a(),{place:a,remove:()=>{Au.get(e)===i&&(Au.delete(e),r.remove(),i.host?.publish(null));}}}function kh(e,t){let n=Au.get(e);if(!n||n.host===t)return;let r=n.host;n.host=t,r?.publish(null),yE(n),t?.publish(n.status);}var Ll=64,so=new WeakMap,Do=new WeakMap,O_=48;function A_(e,t){so.set(e,t);}function Dl(e,t){let n=so.get(e);if(!n)return true;let r=n(t);return r&&so.delete(e),r}function dr(e){return so.has(e)}var F_=6e4,L_=300,D_=16,xE=4096;function N_(e,t,n){let r=0,o=e;for(;o<t&&o-e<xE&&(o-e<D_||r<F_);)r+=__(n(o)),o+=1;return o}function H_(e,t,n){let r=[];for(let o=e;o<t;o+=1){let i=n(o);if(i?.kind==="table"){for(let a of i.children)r.push(a);r.push(i);}}return r}var vE=new WeakMap;function __(e){if(typeof e!="object"||e===null)return 1;let t=vE.get(e);if(t!==void 0)return t;let n=1,r=[e];for(;r.length>0;){let o=r.pop();if(o.kind==="textValue")n+=o.value?.length??0;else if(o.children)for(let i of o.children)r.push(i);}return vE.set(e,n),n}function SE(e,t,n,r){let o=r,i=n.now(),a=null,s=null,l=[],c=0,d=()=>{let x=a;a=null,x&&chunkFDSL5OJU_cjs.sf(x);},u=(x,v=false)=>{if(!v&&n.composing())return false;let S=n.now()+(Do.has(e)?Math.max(x,O_):x);for(;n.limit()!==null&&!n.destroyed();){if(!a){if(n.busy()){if(!v)return false;n.finishBusy();}let E=n.limit(),R=n.bodyBlockCount();if(R!==void 0&&E>=R)return n.finish(),v&&n.busy()&&n.finishBusy(),true;s===null&&(s=R===void 0?E+o:N_(E,R,w=>n.bodyBlock(w)),l=H_(E,s,w=>n.bodyBlock(w)),c=0);for(let w=0;c<l.length;w+=1){if(w>0&&(n.now()>=S||n.inputPending()))return false;chunkFDSL5OJU_cjs.Re([l[c++]]);}if(s<=n.limit()){s=null;continue}n.setLimit(s),a=n.prefixPass(s),s=null;}let I;do I=a.next();while(!I.done&&n.now()<S&&!n.inputPending());if(!I.done)return false;a=null;let C=Do.get(e),P=C?.covers(I.value)===true;if(n.limit()!==null&&(P||n.now()-i>=L_)&&(n.publish(I.value),i=n.now()),P&&(Do.delete(e),C.reveal()),o=Math.min(xE,o*2),n.now()>=S||n.inputPending())return false}return true};if(t().removeAttribute("data-docx-opening-preview"),n.limit()===null)return {finishPaused:d,stop:()=>{}};t().setAttribute("data-docx-opening-preview",""),t().setAttribute("data-docx-layout-pending","");let f=bE(e,t()),p=()=>{Do.delete(e);},g=["pointerdown","keydown","wheel"],b=n.pages();for(let x of g)b.addEventListener(x,p,{capture:true});let h=false,y=()=>{if(!h){h=true,so.delete(e),a=null,s=null,l=[];for(let x of g)b.removeEventListener(x,p,true);t().removeAttribute("data-docx-opening-preview"),n.busy()||t().removeAttribute("data-docx-layout-pending"),f.remove();}};return A_(e,(x,v)=>{if(!u(x,v))return f.place(),false;y();let I=Do.get(e);return Do.delete(e),n.destroyed()||I?.reveal(),true}),{finishPaused:d,stop:y}}function No(e){if(!so.has(e))return false;for(;!so.get(e)?.(Number.POSITIVE_INFINITY,true)&&so.has(e););return true}function B_(e){Do.delete(e);}function $_(e,t,n,r,o){if(!so.has(e)||typeof t!="number"&&!r(t.paragraphId))return false;let i=s=>typeof t=="number"?s.pages.length>t:chunkFDSL5OJU_cjs.ze(s,t)!==null,a=o();return Do.set(e,{covers:i,reveal:()=>{Math.abs(o()-a)<1&&n();}}),true}function wE(e,t){return {begin(){t.flushLayout(),B_(e());},later(n,r){return t.scroller()!==null&&$_(e(),n,r,o=>t.paragraphIds().includes(o),()=>t.scroller()?.scrollTop??0)}}}function kE(e,t,n,r){let o=r?.offsetPx??24,i=r?.block??"start",a=e.clientHeight;if(i==="nearest"||i==="centerIfNeeded"){let c=t<e.scrollTop,d=t+n>e.scrollTop+a;if(!c&&!d)return false}let s=i==="center"||i==="centerIfNeeded"?t-Math.max(0,(a-n)/2):i==="nearest"&&t>e.scrollTop?t+n+o-a:t-o,l=Math.max(0,e.scrollHeight-a);return e.scrollTo({top:Math.max(0,Math.min(s,l)),behavior:r?.behavior??"auto"}),true}var q_=40,W_=12,j_=8;function Ih(e,t){if(typeof MessageChannel=="function"){let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),e();},n.port2.postMessage(null);return}(t??globalThis).setTimeout(e,0);}function V_(e,t){let n=t??globalThis;if(typeof n.requestAnimationFrame=="function"){n.requestAnimationFrame(()=>Ih(e,t));return}Ih(e,t);}function IE(e){let t=null,n=0,r=(l,c)=>{l&&e.passTimed?.(c);},o=l=>{let c=t===null!=(l===null);t=l,c&&e.pendingChanged?.(l!==null);},i=(l,c)=>{e.revision()===c&&e.publish(l);},a=()=>{let l=t;if(!l)return;let c=e.now(),d=c+W_;for(;;){let u=l.steps.next();if(!u.done&&u.value?.wrapUp&&(l.wrapUp=u.value.wrapUp),u.done){o(null),i(u.value,l.revision),r(l.timed,l.spent+e.now()-c);return}if(e.now()>=d)break}l.spent+=e.now()-c,Ih(a,e.view?.());},s=()=>{let l=t;if(!l)return;let c=e.now();o(null),i(chunkFDSL5OJU_cjs.sf(l.steps),l.revision),r(l.timed,l.spent+e.now()-c);};return {run(l,c,d=true){let u=e.snapshot(),f=e.now(),p=d?n:0;d&&(n=0);let g=f+q_,b=e.pageAfterView(),h=e.current(),y=e.partial?.()===true,x=null;for(;;){let v=l.next();if(v.done)return r(d,p+e.now()-f),v.value;if(v.value&&(x=v.value),b===void 0||!x?.finalize||x.pages.length<=b||e.now()<g||!h||!y&&!x.settled&&h.pages.length-x.pages.length<j_)continue;let S=x.settled?x.pages:[...x.pages,...h.pages.slice(x.pages.length)];return o({steps:l,revision:c,restore:u,spent:p+e.now()-f,timed:d,restorable:x.restorable!==false,wrapUp:x.wrapUp,settled:x.settled===true}),V_(a,e.view?.()),x.finalize(S)}},finish:s,abandon(){let l=t;if(l){if(l.settled){o(null),l.timed&&(n+=l.spent);return}if(!l.restorable)return l.wrapUp?.(),s();o(null),l.restore(),l.timed&&(n+=l.spent);}},pending:()=>t!==null,cancel(){o(null);}}}var U_=1e3,z_=12,RE=100;function PE(e,t){let n=o=>{let i=o.fragments[0];if(!i)return "";let a=i.kind==="paragraph"?i.lines[0]:void 0;return `${i.id}:${a?.range.start??""}`},r=o=>(o.footnotes?.notes??[]).map(i=>`${i.noteId}${i.continuation?"c":""}:${i.box.height}`).join(",");return `${e.pages.map(o=>`${n(o)}/${r(o)}`).join("|")}#${chunkFDSL5OJU_cjs.Kf(t)}`}function TE(e){let t=null,n=false,r=false,o=null,i=()=>{t?.(),t=null;},a=(l,c)=>{i(),!r&&(t=e.schedule(()=>{t=null,r||l();},c));},s=()=>{if(e.busy())return a(s,RE);let l=e.live().notePageBottomReserves,c=e.current();if(!l||!c)return;let d=PE(c,l);if(d===o)return;let u=e.revision(),f=e.createSession(),p=e.pass(u,f),g=()=>{if(e.revision()!==u)return;let h=e.now()+z_;for(;;){let y=p.next();if(y.done)return b(y.value);if(e.now()>=h)break}a(g,0);},b=h=>{if(e.revision()!==u)return;if(e.busy())return a(()=>b(h),RE);let y=e.live().notePageBottomReserves,x=f.notePageBottomReserves??new Map;if(y&&chunkFDSL5OJU_cjs.Jf(y,x)){o=d;return}n=true;try{e.adopt(f,h);}finally{n=false;}o=PE(h,x);};g();};return {request(){n||r||a(s,U_);},cancel(){r=true,i();}}}var G_=1e4;function EE(e){let t=null,n=()=>{let a=[],s=new Set([e.part()]);for(let l of e.headerFooterPartsBySection())for(let c of [l.headers,l.footers])for(let d of c.values())s.has(d)||(s.add(d),a.push(d));for(let l of ["footnote","endnote"]){let c=e.partFor({kind:"notesPart",noteKind:l});!c||s.has(c)||(s.add(c),a.push(c));}return a},r=(a,s)=>a.length===s.length&&a.every((l,c)=>l===s[c]),o=a=>{let s=chunkZOZI27AW_cjs.Xa(e.part(),a);if(!s||s.kind!=="paragraph")return false;let l=0,c=[...s.children];for(;c.length>0;){let d=c.pop();if(++l>G_)return false;if(d.kind!=="textValue"){if(d.namespaceUri===chunkZOZI27AW_cjs.pa&&d.localName==="p")return false;for(let u of d.children)c.push(u);}}return true},i=(a,s)=>{if(a.splitJoin.length!==1||a.story!==void 0&&a.story.kind!=="body")return false;let l=a.splitJoin[0];if("split"in l){let{from:u,tail:f}=l.split,p=s.get(u);if(p===void 0||s.has(f)||a.deleted.length>0||a.created.length!==1||a.created[0]!==f||!o(u)||!o(f))return false;for(let[g,b]of s)b>p&&s.set(g,b+1);return s.set(f,p+1),true}let{kept:c,removed:d}=l.join;return !s.has(c)||a.created.length>0||a.deleted.length!==1||a.deleted[0]!==d||!o(c)?false:(s.delete(d),true)};return {retain(a){if(!t)return;let s=a.created.length>0||a.deleted.length>0||a.splitJoin.length>0,l=a.impact==="text-local"&&!s?t.otherParts:n();a.impact!=="global"&&(a.impact==="text-local"||r(t.otherParts,l))&&(!s||r(t.otherParts,l)&&i(a,t.index))?t={packageRevision:e.packageRevision(),bodyRoot:e.part().root,index:t.index,otherParts:l}:t=null;},index(){let a=e.packageRevision(),s=e.part().root;if(t&&t.packageRevision===a&&t.bodyRoot===s)return t.index;let l=new Map,c=u=>{let f=l.size;for(let[p,g]of u)l.has(p)||l.set(p,f+g);};c(chunkZOZI27AW_cjs.rj(e.part()));let d=n();for(let u of d)c(chunkZOZI27AW_cjs.rj(u));return t={packageRevision:a,bodyRoot:s,index:l,otherParts:d},l}}}var Z_=`revision-${chunkZOZI27AW_cjs.Gj}`,Ha=new WeakMap;function _a(e){return e?Ha.get(e)??null:null}function Fu(e){let t=Ha.get(e);return t?[e,t.deletion,t.insertion]:[e]}var X_=chunkZOZI27AW_cjs.Ij,CE=new WeakMap;function Y_(e,t){let n=CE.get(e);if(n&&Ha.get(n)?.insertion===t)return n;let r=t.date??e.date,o={kind:"revision",id:chunkZOZI27AW_cjs.Hj(e.id,t.id),address:e.address,addresses:[...e.addresses,...t.addresses],replacedText:e.text,revisionKind:"replace",author:t.author,...r!==void 0?{date:r}:{},text:t.text,ranges:[...e.ranges,...t.ranges],nesting:e.nesting,replacedRangeCount:e.ranges.length,readOnly:e.readOnly||t.readOnly,replyIds:[...e.replyIds,...t.replyIds]};return Ha.set(o,{deletion:e,insertion:t}),CE.set(e,o),chunkZOZI27AW_cjs.Dj(o,[...chunkZOZI27AW_cjs.Ej(e),...chunkZOZI27AW_cjs.Ej(t)])}function AE(e){let t=e.filter(a=>a.kind==="revision"),n=new Map,r=new Set,o=new Map;for(let a=0;a+1<t.length;a+=1){let s=t[a],l=t[a+1];if(!X_(s,l))continue;let c=Y_(s,l);n.set(s,c),r.add(l),o.set(s.id,c.id),o.set(l.id,c.id),a+=1;}if(n.size===0)return {items:e,renamed:o};let i=[];for(let a of e)r.has(a)||i.push(n.get(a)??a);return {items:i,renamed:o}}function FE(e,t){let n=`${Rh(t)}|${[...t?.excludeRevisionKinds??[]].sort().join(",")}`,r=OE.get(e),o=r?.get(n);if(o)return o;let i=Q_(e,t);return r||OE.set(e,r=new Map),r.set(n,i),i}var OE=new WeakMap;function Q_(e,t){let n=new Set(t?.excludeRevisionKinds??[]),r=s=>s.kind!=="revision"||!n.has(s.revisionKind),o=n.size>0?e.filter(r):e,i=new Map;if(Rh(t)){let s=AE(o);i=s.renamed,o=n.size>0?s.items.filter(r):s.items;}if(n.size===0&&i.size===0)return o;let a=new Set(o.filter(s=>s.kind==="revision").map(s=>s.id));return o.map(s=>{if(s.kind!=="comment"||s.parentRevisionId===void 0)return s;let l=i.get(s.parentRevisionId)??s.parentRevisionId;if(a.has(l))return l===s.parentRevisionId?s:{...s,parentRevisionId:l};let{parentRevisionId:c,...d}=s;return d})}function Lu(e,t,n){if(t===null)return new Set;let r=n?J_(e(),t):null;return new Set(r===null?[t]:[t,r])}function J_(e,t){for(let n of AE(e).items){let r=Ha.get(n);if(!r)continue;let o=chunkZOZI27AW_cjs.Fj(r.deletion),i=chunkZOZI27AW_cjs.Fj(r.insertion);if(o===t)return i;if(i===t)return o}return null}function LE(e,t){let n=null;return {set:r=>n=r,lightsPair:()=>e()||n!==null&&t()?.activatedReviewKey()===n}}function Rh(e){return e?.pairReplacements!==false}function Ai(e){return e.startsWith(Z_)}function Mr(e,t){let n={placement:false,pairReplacements:Ai(t)};return e(n).find(r=>r.key===t)}function Du(e){let t=Ha.get(e);return t?[chunkZOZI27AW_cjs.Fj(t.deletion),chunkZOZI27AW_cjs.Fj(t.insertion)]:[chunkZOZI27AW_cjs.Fj(e)]}function Ph(e,t,n){return t===null||!Rh(n)?t:e({...n,placement:false}).find(o=>Ai(o.key)&&Du(o.item).includes(t))?.key??t}function Th(e,t){let n=Ai(t.key)?t.key:Ph(e,t.key,{pairReplacements:true});return n!==null&&Ai(n)?{...t,pairKey:n}:t}var ME=new WeakMap;function DE(e){let t=ME.get(e);if(!t){let n=new Map;for(let r of e)n.set(chunkZOZI27AW_cjs.Fj(r),r);ME.set(e,t=n);}return t}function Eh(e){let t={...e},n=chunkFDSL5OJU_cjs.Mf(e),r=e.multi,o=r?{...r}:null,i=r?r.sections.map(Eh):[],a=typeof e.notes=="object"?e.notes:null,s=a?{...a}:null;return ()=>{Object.assign(e,t),n(),r&&o&&Object.assign(r,o);for(let l of i)l();a&&s&&Object.assign(a,s),chunkFDSL5OJU_cjs.Lf(e),chunkFDSL5OJU_cjs.Nf(e);}}var NE=2,HE=100;function*_E(e,t){if(!t||t.size===0)return yield*e;let n=1/0,r=-1/0;for(let l of t)n=Math.min(n,l),r=Math.max(r,l);let o=l=>l<n-NE||l>r+NE,i;for(;;){let l=chunkFDSL5OJU_cjs.lc(o,()=>e.next());if(l.done){i=l.value;break}let c=l.value,d=c?.finalize;yield c&&d?{...c,finalize:u=>chunkFDSL5OJU_cjs.lc(o,()=>d(u))}:c;}let a=i.pages.length,s=i.pages.findIndex(l=>chunkFDSL5OJU_cjs.mc(l,a));if(s<0)return i;for(;s<a;s+=HE){let l=i;yield {pages:l.pages,finalize:()=>l,settled:true},i=chunkFDSL5OJU_cjs.nc(i,s,s+HE);}return i}var n5=i18n.createT(i18n.en);function jn(e){return t=>{try{let n=e?.(t);if(typeof n=="string"&&n&&n!==t)return n}catch{}return n5(t)}}var BE=new WeakMap;function Nu(e,t){let n=new Map;return BE.set(e,n),(r,o,i="textContent")=>{let a=n.get(r);a||n.set(r,a=new Map),a.set(i,o),i==="textContent"?r.textContent=t(o):r.setAttribute(i,t(o));}}function $E(e,t){let n=BE.get(e);if(n)for(let[r,o]of n){if(r!==e&&!e.contains(r)){n.delete(r);continue}for(let[i,a]of o)i==="textContent"?r.textContent=t(a):r.setAttribute(i,t(a));}}function qE(e,t){let n=e.ownerDocument.defaultView;if(!n)return;if(n.getComputedStyle(e).position==="fixed"){let E=t.getBoundingClientRect();e.style.maxHeight="";let R=Number.parseFloat(n.getComputedStyle(e).maxHeight),w=Number.isFinite(R)?R:n.innerHeight;e.style.maxWidth=`${Math.max(0,n.innerWidth-16)}px`,e.style.maxHeight=`${Math.max(0,Math.min(w,n.innerHeight-16))}px`;let M=e.getBoundingClientRect(),O=Math.max(0,n.innerHeight-8-E.bottom-4),B=Math.max(0,E.top-8-4),q=M.height>O&&B>O,j=Math.min(M.height,q?B:O);e.style.maxHeight=`${j}px`,e.style.left=`${Math.max(8,Math.min(E.left,n.innerWidth-8-M.width))}px`;let z=q?E.top-4-j:E.bottom+4;e.style.top=`${Math.max(8,Math.min(z,n.innerHeight-8-j))}px`,e.dataset.placement=q?"top":"bottom";return}let r=e.offsetParent;if(!r)return;let o=t.getBoundingClientRect(),i=t.closest(".docx-page")?.getBoundingClientRect(),a=t.closest(".docx-editor__scroll-container")?.getBoundingClientRect(),s=Math.max(0,i?.left??0,a?.left??0),l=Math.min(n.innerWidth,i?.right??n.innerWidth,a?.right??n.innerWidth),c=Math.max(0,a?.top??0),d=Math.min(n.innerHeight,a?.bottom??n.innerHeight);e.style.maxWidth=`${Math.max(0,l-s)}px`,e.style.maxHeight=`${Math.max(0,d-c)}px`;let u=e.getBoundingClientRect(),f=d-o.bottom,p=o.top-c,g=u.height>f&&p>f,b=Math.max(0,g?p:f);e.style.maxHeight=`${Math.max(0,Math.min(d-c,b))}px`;let h=Math.min(u.height,b),y=Math.max(s,Math.min(o.left,l-u.width)),x=Math.max(c,g?o.top-h:o.bottom),v=r.getBoundingClientRect(),S=r.offsetWidth?v.width/r.offsetWidth:1,I=r.offsetHeight?v.height/r.offsetHeight:1;e.style.left=`${(y-v.left)/S-r.clientLeft+r.scrollLeft}px`,e.style.top=`${(x-v.top)/I-r.clientTop+r.scrollTop}px`,e.dataset.placement=g?"top":"bottom";}function Nl(e,t){let n=e.ownerDocument.defaultView,r=t.closest(".docx-pages")??e.closest(".docx-editor")?.querySelector(".docx-pages"),o=t.closest("[data-docx-content-control]")?.dataset.docxContentControl,i=t,a=()=>{if(!i.isConnected&&r&&o){let c=[...r.querySelectorAll("[data-docx-content-control]")].find(d=>d.dataset.docxContentControl===o)?.querySelector(".docx-content-control-boundary");c&&(s?.unobserve(i),i=c,s?.observe(i));}i.isConnected&&qE(e,i);},s=typeof n?.ResizeObserver=="function"?new n.ResizeObserver(a):null;s?.observe(e),s?.observe(i);let l=typeof n?.MutationObserver=="function"?new n.MutationObserver(a):null;return r&&l?.observe(r,{childList:true,subtree:true}),a(),n?.addEventListener("resize",a),e.ownerDocument.addEventListener("scroll",a,true),()=>{s?.disconnect(),l?.disconnect(),n?.removeEventListener("resize",a),e.ownerDocument.removeEventListener("scroll",a,true);}}function Hl(e,t,n){if(t.stopPropagation(),t.isComposing||(t.key==="Escape"&&(t.preventDefault(),n()),t.key!=="Tab"))return;let r=[...e.querySelectorAll("button,input,select,textarea,[href],[tabindex]")].filter(a=>a.tabIndex>=0&&!a.hasAttribute("disabled")&&!a.closest("[hidden]")&&e.ownerDocument.defaultView?.getComputedStyle(a).display!=="none");if(!r.length){t.preventDefault(),e.focus();return}let o=e.ownerDocument.activeElement,i=t.shiftKey&&(o===r[0]||o===e)?r.at(-1):!t.shiftKey&&(o===r.at(-1)||o===e)?r[0]:null;i&&(t.preventDefault(),i.focus());}function r5(e){let t=e?.ownerDocument??(typeof globalThis.document>"u"?null:globalThis.document),n=t?.activeElement;return n&&n!==t?.body?n:e?.closest(".docx-pages")??null}var Ch="image/png,image/jpeg,image/gif,image/bmp,image/webp",o5=new Set(Ch.split(",")),i5=8;function a5(e){if(!e||e.kind==="textValue")return;let t=(n,r)=>{if(!(n.kind==="textValue"||r>i5)){if(n.kind==="drawing")return n.id;if(n.localName!=="sdtPr")for(let o of n.children){let i=t(o,r+1);if(i)return i}}};return t(e,0)}function WE(e){let t=null,n=null,r=null,o,i,a=0,s=false,l=()=>{a++,o?.(),i?.(),r?.remove(),r=null;let u=n;t?.remove(),t=null,n=null,u&&(e.setOpen(u,false),s||e.layer.focus({preventScroll:true}));},c=u=>a5(e.find(u)),d=async(u,f,p=()=>true)=>{if(s||!p()||!e.allowed(u))return false;if(f.byteLength>chunkZOZI27AW_cjs.r.maxEncodedBytes)return e.reject("image-resource-limit"),false;let g=c(u);if(!g)return e.reject("no-picture"),false;let b=chunkZOZI27AW_cjs.ke(f);if(!o5.has(b))return e.reject("unsupported-image"),false;let h=await e.replaceImage(g,f,b,()=>!s&&p()&&e.allowed(u)&&c(u)===g);return h.ok?true:(e.reject(h.detail??h.reason),false)};return {drawingOf:c,replace:d,cancel:l,select(u){let f=c(u),p=f?chunkFDSL5OJU_cjs.re(e.layout(),f):null;return p?e.selectDrawing(f,p.record.paragraphId):false},pick(u){if(l(),s||!e.allowed(u))return;let f=a,p=()=>!s&&a===f;if(!c(u)){e.reject("no-picture");return}let g=e.document.createElement("input");g.type="file",g.accept=Ch,g.className="docx-content-control-picture-picker",g.dataset.docxMarker="",g.dataset.docxCcId=u,g.setAttribute("contenteditable","false"),g.setAttribute("aria-hidden","true"),g.tabIndex=-1;let b=jn(e.translate),h=e.document.createElement("div");h.className="docx-content-control-menu",h.style.position="absolute",h.style.zIndex="20",h.style.pointerEvents="auto",h.dataset.docxCcId=u,h.dataset.docxMarker="",h.setAttribute("role","dialog"),h.setAttribute("aria-label",b("contentControl.types.picture")),h.setAttribute("contenteditable","false"),h.hidden=true;let y=e.document.createElement("div");y.className="docx-content-control-widget-error",y.setAttribute("role","alert"),y.textContent=b("disabledReason.invalidValue");let x=e.document.createElement("button");x.type="button",x.textContent=b("common.cancel"),x.addEventListener("click",l),h.addEventListener("pointerdown",v=>v.stopPropagation()),h.addEventListener("keydown",v=>{Hl(h,v,l),v.stopPropagation();}),h.append(y,x),g.addEventListener("change",()=>{let v=g.files?.[0];!v||!p()||(g.value="",g.disabled=true,(async()=>{let S=false;try{v.size>chunkZOZI27AW_cjs.r.maxEncodedBytes?e.reject("image-resource-limit"):S=await d(u,new Uint8Array(await v.arrayBuffer()),p);}catch{p()&&e.reject("image-read-failed");}if(!p())return;if(S){l();return}g.disabled=false,g.className="docx-content-control-picture-input",g.removeAttribute("aria-hidden"),g.tabIndex=0,g.setAttribute("aria-label",b("contentControl.types.picture")),g.setAttribute("aria-invalid","true"),h.prepend(g),h.hidden=false;let I=[...e.layer.querySelectorAll("[data-docx-content-control]")].find(C=>C.getAttribute("data-docx-content-control")===u)?.querySelector(".docx-content-control-boundary");i?.(),o?.(),I&&(i=Nl(h,I)),o=Mu(h,l),g.focus();})());}),g.addEventListener("cancel",l),e.layer.append(g),(e.layer.closest(".docx-editor__scroll-container")??e.layer).append(h),r=h,t=g,n=u,e.setOpen(u,true),g.click();},destroy(){s=true,l();}}}function jE(e,t,n,r){return (chunkZOZI27AW_cjs.Ik(e,t,n)?.offset??n)+r}function KE(e){if(e&&!(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")&&!e.bound&&!(e.controlType==="checkbox"||e.controlType==="picture"))return e.id}function VE(e,t,n){return {op:"insertText",paragraphId:e.paragraphId,offset:e.offset,text:t,...n===void 0?{}:{inside:n}}}var s5=22,Oh=3;function l5(e,t,n){let r=e.ownerDocument;if(typeof r.elementFromPoint!="function")return null;let o=r.elementFromPoint(t,n)?.closest(".docx-page");if(!o)return null;for(let i of o.querySelectorAll("[data-docx-content-control]:not([data-docx-toc])"))for(let a of i.querySelectorAll(".docx-content-control-boundary")){let s=a.getBoundingClientRect();if(t>=s.left-Oh&&t<=s.right+s5&&n>=s.top-Oh&&n<=s.bottom+Oh)return i}return null}function UE(e){let t=null,n=mt(()=>e),r=0,o=null,i=c=>{c!==t&&(t?.isConnected&&delete t.dataset.hover,t=c,c&&(c.dataset.hover=""));},a=()=>{r=0,o&&i(l5(e,o.x,o.y));},s=c=>{o={x:c.clientX,y:c.clientY},n.migrate(),r===0&&(r=n.requestAnimationFrame(a));},l=()=>{o=null,i(null);};return e.addEventListener("pointermove",s),e.addEventListener("pointerleave",l),{destroy(){e.removeEventListener("pointermove",s),e.removeEventListener("pointerleave",l),n.cancelAnimationFrame(r),i(null);}}}var _l=.25;function zE(e,t,n){let r=(s,l)=>{let c=chunkFDSL5OJU_cjs.ze(e,s,n);return c?chunkFDSL5OJU_cjs.we(e,{x:c.x+l,y:c.y+c.height/2,pageIndex:c.pageIndex}):null},o=r(t.head,0);if(o)return o;if(t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset)return r(t.head,-_l);let a=t.head.paragraphId===t.anchor.paragraphId&&t.head.offset<t.anchor.offset;return r(t.head,a?_l:-_l)??r(t.anchor,a?-_l:_l)}function GE(e,t,n,r,o){let i=r==="left"?-1:1,a=chunkFDSL5OJU_cjs.ze(e,t.from,o),s=chunkFDSL5OJU_cjs.ze(e,t.to,o),l=a?chunkFDSL5OJU_cjs.ue(e,a)??1:1,c=i*l===-1?t.from:t.to;if(!a||!s||a.lineId!==s.lineId||a.pageIndex!==s.pageIndex)return c;let d=chunkFDSL5OJU_cjs.Gd(e,t.from.paragraphId)?.find(({line:g})=>g.id===a.lineId)?.line;if(!d?.spans.some(g=>g.style.shaping))return c;let u=n.indexOf(t.from.paragraphId),f=n.indexOf(t.to.paragraphId),p;for(let g of d.spans){let b=g.range.paragraphId,h=n.indexOf(b);if(h<u||h>f)continue;let y=Math.max(g.range.start,b===t.from.paragraphId?t.from.offset:0),x=Math.min(g.range.end,b===t.to.paragraphId?t.to.offset:1/0);if(!(y>=x))for(let v of [y,x]){let S={paragraphId:b,offset:v},I=chunkFDSL5OJU_cjs.ze(e,S,o);if(!I||I.lineId!==a.lineId||I.pageIndex!==a.pageIndex)continue;let C=I.x;(!p||(C-p.x)*i>0)&&(p={position:S,x:C});}}return p?.position??c}function ZE(e,t,n){let r=e;return {get:()=>r,set(o){o!==r&&(t(),r=o,n());}}}function XE(e,t,n,r){let o=jn(r),i=e.ownerDocument,a=i.createElement("dialog"),s=Nu(a,o);a.className="docx-text-form-dialog",a.setAttribute("role","alertdialog"),a.setAttribute("data-docx-modal",""),s(a,"textFormField.invalidTitle","aria-label"),s(a,`textFormField.invalid${t==="number"?"Number":"Date"}`,"aria-description");let l=i.createElement("h2");l.className="docx-text-form-dialog__header",s(l,"textFormField.invalidTitle");let c=i.createElement("div");c.className="docx-text-form-dialog__body",s(c,`textFormField.invalid${t==="number"?"Number":"Date"}`);let d=i.createElement("div");d.className="docx-text-form-dialog__footer";let u=i.createElement("button");u.type="button",u.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",s(u,"textFormField.apply");let f=false,p=()=>{f||(f=true,n());};return u.addEventListener("click",p),a.addEventListener("keydown",g=>{g.key!=="Enter"||g.isComposing||(g.preventDefault(),g.stopPropagation(),p());}),a.addEventListener("cancel",g=>{g.preventDefault(),p();}),d.append(u),a.append(l,c,d),e.append(a),a.showModal(),u.focus(),a}function YE(e,t,n,r,o){let i=jn(o),a=e.ownerDocument,s=a.createElement("dialog"),l=Nu(s,i);s.className="docx-text-form-dialog",s.setAttribute("data-docx-modal",""),l(s,"textFormField.title","aria-label");let c=a.createElement("h2");c.className="docx-text-form-dialog__header",l(c,"textFormField.title");let d=a.createElement("div");d.className="docx-text-form-dialog__body";let u=a.createElement("div");u.className="docx-text-form-dialog__footer",s.append(c,d,u);let f=(w,M)=>{let O=a.createElement("label");O.className="docx-text-form-dialog__row";let B=a.createElement("span");B.className="docx-text-form-dialog__label",l(B,w),M.className="docx-text-form-dialog__input",O.append(B,M),d.append(O);},p=a.createElement("input");p.type="text",p.value=t.defaultText,f("textFormField.defaultText",p);let g=a.createElement("select"),b=["regular","number","date"];for(let w of b){let M=a.createElement("option");M.value=w,l(M,`textFormField.${w}`),g.append(M);}if(!b.includes(t.type)){let w=a.createElement("option");w.value=t.type,l(w,"textFormField.preservedType"),w.disabled=true,g.append(w);}g.value=t.type,f("textFormField.type",g);let h=a.createElement("input");h.type="number",h.min="0",h.max="32767",h.step="1",h.value=String(t.maxLength),f("textFormField.maxLength",h);let y=a.createElement("select"),x=w=>{y.replaceChildren();let M=chunkZOZI27AW_cjs.fj[g.value]??[];for(let O of M){let B=a.createElement("option");B.value=O;let j={Uppercase:"textFormField.uppercase",Lowercase:"textFormField.lowercase","First capital":"textFormField.firstCapital","Title case":"textFormField.titleCase"}[O];j||!O?l(B,j??"textFormField.noFormat"):B.textContent=O,y.append(B);}if(!M.includes(w)){let O=a.createElement("option");O.value=w,w?O.textContent=w:l(O,"textFormField.noFormat"),O.disabled=true,y.append(O);}y.value=w;};x(t.format),g.addEventListener("change",()=>x("")),f("textFormField.format",y);let v=a.createElement("input");v.type="checkbox",v.checked=t.enabled;let S=a.createElement("label");S.className="docx-text-form-dialog__checkbox-row";let I=a.createElement("span");l(I,"textFormField.enabled"),S.append(v,I),d.append(S);let C=a.createElement("p");C.className="docx-text-form-dialog__error",C.setAttribute("role","alert"),d.append(C);let P=a.createElement("button");P.type="button",P.className="docx-text-form-dialog__button",l(P,"textFormField.cancel"),P.addEventListener("click",r);let E=a.createElement("button");E.type="button",E.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",l(E,"textFormField.apply");let R=()=>{if(!h.value||!h.checkValidity()||!n(p.value,{type:g.value,maxLength:Number(h.value),format:y.value,enabled:v.checked})){l(C,"textFormField.invalidOptions");return}r();};return E.addEventListener("click",R),s.addEventListener("keydown",w=>{w.key==="Enter"&&!w.isComposing&&Kd(w.target,"input")&&(w.preventDefault(),R());}),s.addEventListener("cancel",w=>{w.preventDefault(),r();}),u.append(P,E),e.append(s),s.showModal(),p.focus(),p.select(),s}function QE(e,t,n){let r=[],o=[];for(let a of e)for(let s of chunkZOZI27AW_cjs.rj(a).keys()){let l=chunkZOZI27AW_cjs.Xa(a,s);if(l?.kind==="paragraph")for(let c of chunkZOZI27AW_cjs.xj(l)){let d=t.get(c.fieldNodeId);if(!d)continue;let u=(chunkZOZI27AW_cjs.Tk(a,s)??"").slice(c.start,c.end),f=chunkZOZI27AW_cjs.gj(u,c,"fill",d.locale);if(f===null)return {reason:"invalidArgs"};if(f===u)continue;let p={op:"commitTextFormField",paragraphId:s,fieldNodeId:c.fieldNodeId,locale:d.locale},g=chunkZOZI27AW_cjs.Hl(a,p);if(g)return {reason:g};r.push(p),o.push({paragraphId:s,start:c.start,end:c.end,length:f.length});}}let i=a=>{let s=a.offset;for(let l of o)l.paragraphId!==a.paragraphId||a.offset<=l.start||(s+=a.offset>=l.end?l.length-(l.end-l.start):Math.min(a.offset-l.start,l.length)-(a.offset-l.start));return s===a.offset?a:{...a,offset:s}};return {ops:r,selection:{anchor:i(n.anchor),head:i(n.head)}}}var Mh=new WeakMap,Hu=new WeakMap;function c5(e){for(let t of Array.from(e.children))if(t.classList.contains("docx-pages"))return t;return null}function eC(e){let t=c5(e);return (t&&Hu.get(t)?.())??null}function JE(e){return [...chunkZOZI27AW_cjs.rj(e).keys()].flatMap(t=>{let n=chunkZOZI27AW_cjs.Xa(e,t);return n?.kind==="paragraph"?chunkZOZI27AW_cjs.xj(n):[]})}function tC(e,t){let n=jn(e.translate),r,o=false,i=new Map,a=()=>e.parts?.()??[e.part()];if(t?.length)for(let D of a()){let T=t.filter($=>$.partName===D.name);if(!T.length)continue;let W=JE(D);for(let $ of T){let K=W[$.fieldIndex];K&&i.set(K.fieldNodeId,{text:$.text,locale:$.locale});}}let s=new WeakMap,l=new WeakMap,c=(D=e.part())=>{s.set(D,new Map([...i].filter(([T])=>T.startsWith(`${D.name}#`))));},d=()=>(i=new Map(a().flatMap(D=>[...s.get(D)??[]])),l.get(e.part())??null),u=D=>{i.delete(D),c();};a().forEach(c);let f=()=>{if(!i.size)return null;if(o)return "invalidState";let D=QE(a(),i,e.selection());if("reason"in D)return D.reason;if(D.ops.length&&!e.editable())return "locked";let T=a();a().forEach(c);let W=i;D.ops.length&&l.set(e.part(),e.selection()),i=new Map,o=true;try{let $=D.ops.length?e.save?e.save(D.ops,D.selection):"unsupported":null;return $?i=W:(delete se.dataset.fieldError,D.ops.length&&l.set(e.part(),D.selection)),a().forEach(c),$}catch($){throw a().every(K=>T.includes(K))&&(i=W),a().forEach(c),$}finally{o=false;}};Hu.set(e.pagesLayer,f);let p=()=>i.size?a().flatMap(D=>JE(D).flatMap((T,W)=>{let $=i.get(T.fieldNodeId);return $?[{partName:D.name,fieldIndex:W,...$}]:[]})):[];Mh.set(e.pagesLayer,p);let g,b=(D,T)=>(chunkZOZI27AW_cjs.Tk(e.part(),D)??"").slice(T.start,T.end),h=null,y=null,x=null,v=false,S=false,I=()=>{let D=x;x=null,S=false,h?.remove(),h=null,D?.abort();},C=()=>{if(!h&&!x)return;let D=e.selection();I(),!v&&(e.pagesLayer.focus({preventScroll:true}),e.select(D));};function P(D,T,W="plain"){g={paragraphId:D,fieldNodeId:T.fieldNodeId},e.select({anchor:{paragraphId:D,offset:T.start},head:{paragraphId:D,offset:T.end}},W==="press"?"pressed":void 0);let $=e.selection().head.paragraphId===D&&e.selection().head.offset>=T.start&&e.selection().head.offset<=T.end;$&&(y=g??y),g=void 0,$&&W==="travel"&&e.reveal?.({paragraphId:D,offset:T.start});}function E(D,T){if(v)return;C();let W=e.locale?.()??"en-US",$=new AbortController;x=$;let K=()=>{if(v||$.signal.aborted||x!==$)return false;let re=chunkZOZI27AW_cjs.Xa(e.part(D),D);return re?.kind==="paragraph"&&chunkZOZI27AW_cjs.xj(re).some(N=>N.fieldNodeId===T.fieldNodeId)&&e.editable()&&!e.protected(D)},Y={field:{...T},signal:$.signal,canApply:K,apply(re,N){if(!K()||!e.apply({op:"setTextFormFieldDefault",locale:W,paragraphId:D,fieldNodeId:T.fieldNodeId,text:re,options:N}))return false;if(v||x!==$||$.signal.aborted)return true;let U=chunkZOZI27AW_cjs.Xa(e.part(D),D),G=U?.kind==="paragraph"?chunkZOZI27AW_cjs.xj(U).find(ee=>ee.fieldNodeId===T.fieldNodeId):null;return G&&P(D,G),C(),true},cancel(){x===$&&!$.signal.aborted&&C();}};e.onRequest?.(Y)||$.signal.aborted||(h=YE(e.container,T,Y.apply,Y.cancel,n));}let R=D=>{let W=D.target?.closest('[data-field-atom="form"][data-start]'),$=W?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!W||!$||!e.editable())return null;let K=chunkZOZI27AW_cjs.Xa(e.part(),$);if(K?.kind!=="paragraph")return null;let Y=Number(W.dataset.start),re=chunkZOZI27AW_cjs.xj(K).find(N=>N.start<=Y&&Y<N.end);return re?{paragraphId:$,field:re}:null},w=null,M=D=>D.shiftKey||D.altKey||D.ctrlKey||D.metaKey,O=D=>{if(r=void 0,w=null,D.button!==0)return;let T=R(D);T&&!M(D)&&!e.protected(T.paragraphId)&&(w={x:D.clientX,y:D.clientY,paragraphId:T.paragraphId,fieldNodeId:T.field.fieldNodeId,moved:false}),g=T?{paragraphId:T.paragraphId,fieldNodeId:T.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("pointerdown",O,{capture:true});let B=D=>{w&&Math.hypot(D.clientX-w.x,D.clientY-w.y)>4&&(w.moved=true);},q=()=>{w=null;},j=(D,T=false)=>{let W=w;if(w=null,!W||W.moved||h||D.button!==0||D.detail>1||Math.hypot(D.clientX-W.x,D.clientY-W.y)>4||!e.editable()||M(D)||e.protected(W.paragraphId))return;let $=chunkZOZI27AW_cjs.Xa(e.part(),W.paragraphId),K=$?.kind==="paragraph"?chunkZOZI27AW_cjs.xj($).find(re=>re.fieldNodeId===W.fieldNodeId):null;if(!K)return;let Y=e.selection();T&&(Y.anchor.paragraphId!==Y.head.paragraphId||Y.anchor.offset!==Y.head.offset)&&!(Y.anchor.paragraphId===W.paragraphId&&Y.head.paragraphId===W.paragraphId&&Math.min(Y.anchor.offset,Y.head.offset)===K.start&&Math.max(Y.anchor.offset,Y.head.offset)===K.end)||P(W.paragraphId,K,"press");},z=[e.listeners.onDocument("pointermove",B),e.listeners.onDocument("pointercancel",q)];e.pagesLayer.addEventListener("click",j);let _=D=>{if(D.shiftKey||D.altKey||D.ctrlKey||D.metaKey||e.pagesLayer.contentEditable==="false")return false;let T=R(D);if(!T)return false;let{paragraphId:W,field:$}=T;return D.preventDefault(),P(W,$,"press"),e.protected(W)||E(W,$),true};e.pagesLayer.addEventListener("dblclick",_);function L(){let D=e.selection();if(D.anchor.paragraphId!==D.head.paragraphId)return null;let T=D.head.paragraphId,W=chunkZOZI27AW_cjs.Xa(e.part(),T);if(W?.kind!=="paragraph")return null;let $=Math.min(D.anchor.offset,D.head.offset),K=Math.max(D.anchor.offset,D.head.offset),Y=chunkZOZI27AW_cjs.xj(W).filter(N=>N.start<=$&&N.end>=K&&(N.start===N.end||$!==K||$<N.end||e.protected(T))),re=Y.find(N=>y?.paragraphId===T&&N.fieldNodeId===y.fieldNodeId)??Y.find(N=>N.start===$&&N.end===K)??Y[0];return re?{paragraphId:T,field:re}:null}function X(){if(r===void 0)return L();if(!r)return null;let D=chunkZOZI27AW_cjs.Xa(e.part(),r.paragraphId),T=D?.kind==="paragraph"?chunkZOZI27AW_cjs.xj(D).find(W=>W.fieldNodeId===r.fieldNodeId):null;return T?{paragraphId:r.paragraphId,field:T}:null}let te=D=>{let T=D.button===-1||D.clientX===0&&D.clientY===0?L():R(D);r=T?{paragraphId:T.paragraphId,fieldNodeId:T.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("contextmenu",te);let me=()=>{let D=X();return !!D&&e.editable()&&!e.protected(D.paragraphId)&&!chunkZOZI27AW_cjs.Hl(e.part(),{op:"setTextFormFieldDefault",paragraphId:D.paragraphId,fieldNodeId:D.field.fieldNodeId,text:"",options:{type:"regular",maxLength:0,format:"",enabled:true}})},se=e.pagesLayer.ownerDocument.createElement("span");return se.className="docx-text-form-status",e.container.append(se),{doubleClick:_,pointerUp:D=>j(D,true),canEdit:me,edit(){if(!me())return false;let D=X();return P(D.paragraphId,D.field,"travel"),E(D.paragraphId,D.field),true},selectForDeletion(D){let T=e.selection(),{paragraphId:W,offset:$}=T.head;if(!e.editable()||e.protected(W)||T.anchor.paragraphId!==W||T.anchor.offset!==$)return false;let K=chunkZOZI27AW_cjs.Xa(e.part(),W);if(K?.kind!=="paragraph")return false;let Y=chunkZOZI27AW_cjs.xj(K).find(re=>re.start<re.end&&(D==="backward"?re.end===$:re.start===$));return Y?(P(W,Y),true):false},wordDeletionBoundary(D,T,W,$){let K=chunkFDSL5OJU_cjs.te(D,T,W,$),Y=e.selection().head.paragraphId;if(e.protected(Y))return K;let re=chunkZOZI27AW_cjs.Xa(e.part(Y),Y);if(re?.kind!=="paragraph")return K;let N=chunkZOZI27AW_cjs.xj(re),U=N.find(ee=>ee.start<ee.end&&(W===-1?ee.end===T:ee.start===T));if(U)return W===-1?U.start:U.end;let G=K;for(let ee of N)for(let de of [ee.start,ee.end])W===-1&&de<T&&de>G&&(G=de),W===1&&de>T&&de<G&&(G=de);return G},beforeSelect(D){let T=Ae=>{if(g!==void 0)y=g;else if(D.anchor.paragraphId!==D.head.paragraphId||y?.paragraphId!==D.head.paragraphId)y=null;else {let Ie=chunkZOZI27AW_cjs.Xa(e.part(),D.head.paragraphId),Re=Ie?.kind==="paragraph"?chunkZOZI27AW_cjs.xj(Ie).find(dt=>dt.fieldNodeId===y?.fieldNodeId):null;(!Re||Math.min(D.anchor.offset,D.head.offset)<Re.start||Math.max(D.anchor.offset,D.head.offset)>Re.end)&&(y=null);}return g=void 0,delete se.dataset.fieldError,Ae};if(o||S)return null;if(!e.editable())return D;let W=L();if(!W||!e.protected(W.paragraphId)||!W.field.enabled||!chunkZOZI27AW_cjs.hj(W.field))return T(D);let{field:$,paragraphId:K}=W;if((!g||g.fieldNodeId===$.fieldNodeId)&&D.anchor.paragraphId===K&&D.head.paragraphId===K&&Math.min(D.anchor.offset,D.head.offset)>=$.start&&Math.max(D.anchor.offset,D.head.offset)<=$.end)return T(D);let Y=i.get($.fieldNodeId),re=Y?.text,N=Y?.locale??e.locale?.()??"en-US",U=b(K,$);if($.type==="date"&&re===void 0)return u($.fieldNodeId),T(D);let G=chunkZOZI27AW_cjs.gj(U,$,"fill",N);if(G===U||G===null&&(re===void 0||re===U))return u($.fieldNodeId),T(D);o=true;let ee=e.part();c(ee);let de=i;i=new Map(de),i.delete($.fieldNodeId);let oe;try{oe=e.apply({op:"commitTextFormField",locale:N,paragraphId:K,fieldNodeId:$.fieldNodeId}),oe||(i=de);}catch(Ae){throw e.part()===ee&&(i=de),Ae}finally{c(),o=false;}if(!oe){if(g=void 0,se.setAttribute("role","alert"),se.dataset.fieldError="true",se.textContent=n("textFormField.invalidValue"),G===null&&($.type==="number"||$.type==="date")){I();let Ae=new AbortController;x=Ae,S=true;let Ie=()=>{if(v||Ae.signal.aborted||x!==Ae||(I(),v))return;let dt=e.selection(),Nt=()=>{e.pagesLayer.focus({preventScroll:true}),e.select(dt);},we=chunkZOZI27AW_cjs.Xa(e.part(),K),De=we?.kind==="paragraph"?chunkZOZI27AW_cjs.xj(we).find(Rt=>Rt.fieldNodeId===$.fieldNodeId):null;if(!De||!e.editable()||!e.protected(K)||b(K,De)!==U||!De.enabled||!chunkZOZI27AW_cjs.hj(De)||De.type!==$.type||De.format!==$.format||chunkZOZI27AW_cjs.gj(U,De,"fill",N)!==null){Nt();return}o=true;try{if(e.apply({op:"deleteText",paragraphId:K,start:De.start,end:De.end,textFormFieldId:De.fieldNodeId})){u(De.fieldNodeId),delete se.dataset.fieldError,e.pagesLayer.focus({preventScroll:!0});let Rt={paragraphId:K,offset:De.start};o=!1,e.select({anchor:Rt,head:Rt}),y={paragraphId:K,fieldNodeId:De.fieldNodeId};}else o=!1,Nt();}finally{o=false;}},Re={type:$.type,signal:Ae.signal,acknowledge:Ie,cancel(){x===Ae&&!Ae.signal.aborted&&C();}};!e.onInvalidRequest?.(Re)&&!Ae.signal.aborted&&(h=XE(e.container,$.type,Ie,n));}return null}u($.fieldNodeId);let ce=chunkZOZI27AW_cjs.Xa(e.part(),K),he=ce?.kind==="paragraph"?chunkZOZI27AW_cjs.xj(ce).find(Ae=>Ae.fieldNodeId===$.fieldNodeId):null,Ce=he?he.end-$.end:0,ct=Ae=>Ae.paragraphId===K&&Ae.offset>=$.end?{...Ae,offset:Ae.offset+Ce}:Ae;return T({anchor:ct(D.anchor),head:ct(D.head)})},update(){h&&$E(h,n);let D=L(),T=e.selection(),W=!!D&&T.anchor.offset!==T.head.offset&&Math.min(T.anchor.offset,T.head.offset)===D.field.start&&Math.max(T.anchor.offset,T.head.offset)===D.field.end;for(let $ of e.pagesLayer.querySelectorAll('[data-field-atom="form"][data-start]')){let K=$.closest("[data-paragraph-id]")?.dataset.paragraphId,Y=Number($.dataset.start);!!D&&K===D.paragraphId&&Y>=D.field.start&&Y<D.field.end?$.dataset.textFormSelection=W?"whole":"caret":delete $.dataset.textFormSelection;}if(se.dataset.fieldError){se.textContent=n("textFormField.invalidValue");return}D?se.setAttribute("role","status"):se.removeAttribute("role"),se.textContent=D?n(W?"textFormField.selected":"textFormField.editing"):"";},fieldId:()=>L()?.field.fieldNodeId??null,afterApply(D){D?c():d();},restoreAfterHistory:d,annotate(D){(!o||D.some(W=>W.op!=="commitTextFormField"))&&c(),D.some(W=>W.op==="insertText"||W.op==="deleteText")&&delete se.dataset.fieldError;let T=L();return y=T?{paragraphId:T.paragraphId,fieldNodeId:T.field.fieldNodeId}:null,D.map(W=>{if(!y||W.op!=="insertText"&&W.op!=="deleteText"||W.revision||W.paragraphId!==y.paragraphId||!e.protected(W.paragraphId))return W;let $=chunkZOZI27AW_cjs.Xa(e.part(),W.paragraphId),K=$?.kind==="paragraph"?chunkZOZI27AW_cjs.xj($).find(N=>N.fieldNodeId===y.fieldNodeId):null,Y=W.op==="insertText"?W.offset:W.start,re=W.op==="insertText"?W.offset:W.end;return !K||Y<K.start||re>K.end?W:(i.has(K.fieldNodeId)||i.set(K.fieldNodeId,{text:b(W.paragraphId,K),locale:e.locale?.()??"en-US"}),{...W,textFormFieldId:K.fieldNodeId})})},keydown(D){if(D.key==="F10"&&D.shiftKey&&!D.altKey&&!D.ctrlKey&&!D.metaKey)return r=void 0,D.preventDefault(),e.pagesLayer.dispatchEvent(new(je(e.pagesLayer)).MouseEvent("contextmenu",{bubbles:true,cancelable:true,button:-1})),true;if(D.key!=="Tab"||D.altKey||D.ctrlKey||D.metaKey||!e.editable()||!e.protected(e.selection().head.paragraphId))return false;let T=[],W=[e.part().root];for(;W.length;){let G=W.pop();if(G.kind==="paragraph")for(let ee of chunkZOZI27AW_cjs.xj(G))e.protected(G.id)&&ee.enabled&&chunkZOZI27AW_cjs.hj(ee)&&!chunkZOZI27AW_cjs.Hl(e.part(),{op:"insertText",paragraphId:G.id,offset:ee.start,text:"x"})&&T.push({paragraphId:G.id,field:ee});else for(let ee=G.children.length-1;ee>=0;ee--){let de=G.children[ee];de.kind!=="textValue"&&W.push(de);}}if(!T.length)return false;let $=e.selection(),K=$.head,Y=y?T.findIndex(G=>G.paragraphId===y.paragraphId&&G.field.fieldNodeId===y.fieldNodeId&&G.field.start<=Math.min($.anchor.offset,K.offset)&&G.field.end>=Math.max($.anchor.offset,K.offset)):-1,re=Y>=0?Y:T.findIndex(G=>G.paragraphId===K.paragraphId&&G.field.start<=Math.min($.anchor.offset,K.offset)&&G.field.end>=Math.max($.anchor.offset,K.offset)),N=re<0?D.shiftKey?T.length-1:0:(re+(D.shiftKey?-1:1)+T.length)%T.length,U=T[N];return D.preventDefault(),P(U.paragraphId,U.field,"travel"),true},destroy(){v=true,I(),Hu.get(e.pagesLayer)===f&&Hu.delete(e.pagesLayer),Mh.get(e.pagesLayer)===p&&Mh.delete(e.pagesLayer);for(let D of z)D();e.pagesLayer.removeEventListener("click",j),e.pagesLayer.removeEventListener("contextmenu",te),se.remove(),e.pagesLayer.removeEventListener("dblclick",_),e.pagesLayer.removeEventListener("pointerdown",O,{capture:true}),h?.remove(),h=null;}}}function nC(e,t,n,r=o=>o){let o,i=e.subscribe(a=>{for(let s of a.splitJoin)"split"in s&&s.split.from===t&&(o=s.split.tail);});try{n(()=>{let a=o&&r(o,t);if(!a)return null;let s={paragraphId:a,offset:0};return {anchor:s,head:s}});}finally{i();}}var _u=new WeakMap;function Bl(e){let t=_u.get(e);if(t)return t.settled??=new Promise(n=>{t.resolve=n;}),t.settled}function rC(e){let t=_u.get(e)??{depth:0};return t.depth++,_u.set(e,t),()=>{--t.depth===0&&(_u.delete(e),t.resolve?.());}}var d5=12;function $l(e,t){if(typeof MessageChannel!="function"){t.setTimeout(e,0);return}let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),e();},n.port2.postMessage(null);}function oC(e,t,n=d5){let r=globalThis.performance??Date;return new Promise((o,i)=>{let a=()=>{let s=r.now()+n;try{for(;;){let l=e.next();if(l.done){o(l.value);return}if(r.now()>=s)break}}catch(l){i(l);return}$l(a,je(t));};a();})}async function iC(e,t,n){if(!e)throw en("notFound","no document is loaded");let r=t?Bl(t):void 0;if(r&&(await r,n()!==e))throw en("invalidState","The document changed before the pending save could finish.");return (await oC(e.saveSteps(),t)).slice().buffer}function aC(e,t,n){return lC(e,t,n,()=>e.session.save())}function sC(e,t,n){return lC(e,t,n,()=>e.session.saveSteps())}function lC(e,t,n,r){let o=()=>{if(n())throw en("destroyed","Cannot save a destroyed surface.")};if(o(),Bl(t))throw en("invalidState","Cannot save during an active edit. Retry after the edit finishes.");e.flushPendingInput(),o();let i=eC(t);if(i)throw en(i,"Cannot save pending text form input. Enter a valid value in each field.");o(),e.refreshRefFieldResults(),o();let a=zT(t);Lo(t,true);try{return r()}finally{Lo(t,a);}}function Bu(e,t,n){let r=false;return t(()=>{let o=n([e]);return r=!o.rejected,o}),r}function cC(e,t,n){let r=n.refusal();if(r)return r;let o=new Map;for(let a of e){if(a.op!=="commitTextFormField")return "invalidArgs";let s=Ct(n.session,a.paragraphId,{kind:"body"}),l=JSON.stringify(s),c=o.get(l)??{scope:s,ops:[]};c.ops.push(a),o.set(l,c);}for(let a of o.values()){let s=n.gate(a.ops,a.scope);if(s)return s}if(n.collaborationActive)return "unsupported";let i;return n.commit(()=>i=n.session.applyTreeOpsAtomic([...o.values()]),()=>t),i?.rejected?i.reason??"invalidArgs":null}function dC(e,t){let n=chunkZOZI27AW_cjs.cj(e);return {get:()=>n,set(r){let o=chunkZOZI27AW_cjs.cj(r);n!==o&&(t(),n=o);}}}var u5=42,f5=/^(\d{4})-(\d{2})-(\d{2})/,p5=new Set(["AG","AS","BD","BR","BS","BT","BW","BZ","CA","CO","DM","DO","ET","GT","GU","HK","HN","ID","IL","IN","JM","JP","KE","KH","KR","LA","MH","MM","MO","MT","MX","MZ","NI","NP","PA","PE","PH","PK","PR","PT","PY","SA","SG","SV","TH","TT","TW","UM","US","VE","VI","WS","YE","ZA","ZW"]),m5=new Set(["AE","AF","BH","DJ","DZ","EG","IQ","IR","JO","KW","LY","OM","QA","SD","SY"]);function Fi(e){return `${String(e.getFullYear()).padStart(4,"0")}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function lo(e){let t=f5.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);if(r<1||r>12||o<1||o>31)return null;let i=new Date(n,r-1,o);return i.getFullYear()!==n||i.getMonth()!==r-1||i.getDate()!==o?null:i}function $u(e){let t=chunkZOZI27AW_cjs.cj(e);try{let n=new Intl.Locale(t),r=n,o=r.getWeekInfo?.().firstDay??r.weekInfo?.firstDay;if(typeof o=="number"&&o>=1&&o<=7)return o%7;let i=n.maximize().region;if(i&&p5.has(i))return 0;if(i&&m5.has(i))return 6}catch{}return 1}function uC(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function fC(e,t,n){return new Intl.DateTimeFormat(chunkZOZI27AW_cjs.cj(n),{calendar:"gregory",month:"long",year:"numeric"}).format(new Date(e,t,1))}function pC(e){let t=chunkZOZI27AW_cjs.cj(e),n=new Intl.DateTimeFormat(t,{calendar:"gregory",weekday:"narrow"}),r=$u(t);return Array.from({length:7},(o,i)=>n.format(new Date(2024,0,7+(r+i)%7)))}function Ah(e,t,n={}){let r=chunkZOZI27AW_cjs.cj(n.locale),o=n.selected?lo(n.selected):null,i=n.today??new Date,a=new Intl.DateTimeFormat(r,{calendar:"gregory",weekday:"long",year:"numeric",month:"long",day:"numeric"}),s=$u(r),l=(new Date(e,t,1).getDay()-s+7)%7,c=[];for(let d=0;d<u5;d+=1){let u=new Date(e,t,d-l+1);c.push({iso:Fi(u),day:u.getDate(),label:a.format(u),otherMonth:u.getMonth()!==t,selected:o!==null&&uC(u,o),today:uC(u,i)});}return {year:e,month:t,title:fC(e,t,r),weekdays:pC(r),days:c}}function qu(e,t,n){let r=new Date(e,t+n,1);return {year:r.getFullYear(),month:r.getMonth()}}function Fh(e,t,n,r=false){let o=lo(e);if(!o)return null;let i={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7},a=(o.getDay()-$u(n)+7)%7;if(t==="PageUp"||t==="PageDown"){let s=o.getDate();o.setDate(1),o.setMonth(o.getMonth()+(t==="PageUp"?-1:1)*(r?12:1));let l=new Date(o.getFullYear(),o.getMonth()+1,0).getDate();o.setDate(Math.min(s,l));}else {let s=t==="Home"?-a:t==="End"?6-a:i[t];if(s===void 0)return null;o.setDate(o.getDate()+s);}return o.getFullYear()>=100&&o.getFullYear()<=9999?Fi(o):null}function Wu(e,t){let n=lo(e);if(!n)return "";let r=chunkZOZI27AW_cjs.cj(t),o=new Intl.NumberFormat(r,{useGrouping:false}).format(0);return new Intl.DateTimeFormat(r,{calendar:"gregory",year:"numeric",month:"numeric",day:"numeric"}).formatToParts(n).map(i=>i.type==="year"?i.value.padStart(4,o):i.value).join("")}function Lh(e,t){if(e.length>100)return null;let n=e.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(n)){let s=lo(n);return s?Fi(s):null}let r=chunkZOZI27AW_cjs.dj(chunkZOZI27AW_cjs.cj(t)),o=r.pattern.exec(chunkZOZI27AW_cjs.ej(n,r));if(!o)return null;let i={year:"",month:"",day:""};if(r.order.forEach((s,l)=>{i[s]=o[l+1];}),i.year.length!==4)return null;let a=`${i.year}-${i.month.padStart(2,"0")}-${i.day.padStart(2,"0")}`;return lo(a)?a:null}function Dh(e){let t=new Intl.DateTimeFormat(chunkZOZI27AW_cjs.cj(e),{calendar:"gregory",month:"long"});return Array.from({length:12},(n,r)=>t.format(new Date(2e3,r,1)))}function Nh(e){let t="",n=0,r=new Intl.Collator(chunkZOZI27AW_cjs.cj(e),{usage:"search",sensitivity:"base"});return {reset(){t="",n=0;},keyDown(o,i){if(o.defaultPrevented||o.isComposing||o.altKey||o.ctrlKey||o.metaKey)return;let a=o.target.tagName==="INPUT",s=[...i.querySelectorAll('[role="option"]')].filter(d=>!d.hasAttribute("disabled"));if(!s.length)return;let l=s.indexOf(i.ownerDocument.activeElement),c;if(o.key==="ArrowDown")c=Math.min(s.length-1,l+1);else if(o.key==="ArrowUp")c=l<0?s.length-1:Math.max(0,l-1);else if(!a&&o.key==="Home")c=0;else if(!a&&o.key==="End")c=s.length-1;else if(!a&&o.key.length===1&&o.key!==" "){let d=Date.now();t=d-n>700?o.key:(t+o.key).slice(-100),n=d;let u=[...t].every(f=>r.compare(f,o.key)===0)?o.key:t;for(let f=1;f<=s.length;f++){let p=(Math.max(-1,l)+f)%s.length;if(r.compare((s[p].textContent??"").slice(0,u.length),u)===0){c=p;break}}}c!==void 0&&(o.preventDefault(),s.forEach((d,u)=>{d.tabIndex=u===c?0:-1;}),s[c]?.focus({preventScroll:true}),s[c]?.scrollIntoView?.({block:"nearest"}));}}}var g5=0;function mC(e,t){let n=e.document.createElement("div");n.className="docx-content-control-menu",n.dataset.docxMarker="",n.dataset.docxPart="popup",n.addEventListener("keydown",r=>Hl(n,r,()=>e.close(n))),n.dataset.docxCcId=t,n.setAttribute("contenteditable","false"),n.style.position="absolute",n.style.zIndex="20",n.style.pointerEvents="auto",n.addEventListener("pointerdown",r=>r.stopPropagation());for(let r of ["keydown","beforeinput","input","compositionstart","compositionupdate","compositionend","copy","cut","paste"])n.addEventListener(r,o=>o.stopPropagation());return n}function gC(e,t,n){if(!n){t.append(e);return}e.style.left=`${n.left}px`,e.style.top=`${n.top}px`;let r=n.element?t.closest(".docx-editor__scroll-container")??t.parentElement??t:t;if(r.append(e),n.element){let a=Nl(e,n.element),s=new(je(e)).MutationObserver(()=>{e.isConnected||(a(),s.disconnect());});s.observe(r,{childList:true});return}let o=e.offsetWidth;if(o<=0)return;let i=n.left+o-n.sheetRight;i>0&&(e.style.left=`${Math.max(n.sheetLeft,n.left-i)}px`);}function ju(e,t,n,r){if(e.setValue(n,r))return e.close(t),true;let o=t.querySelector("[data-docx-part=error]");return o||(o=e.document.createElement("div"),o.dataset.docxPart="error",o.className="docx-content-control-widget-error",o.setAttribute("role","alert"),t.append(o)),o.hidden=false,o.textContent=jn(e.translate)("disabledReason.invalidValue"),false}function hC(e,t,n,r,o,i){let a=mC(e,t),s=jn(e.translate);a.setAttribute("role","dialog"),a.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let l=e.document.createElement("div");l.className="docx-content-control-menu-list",l.dataset.docxPart="list",l.id=`docx-engine-cc-list-${++g5}`,l.setAttribute("role","listbox"),l.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let c=Nh(e.locale());a.addEventListener("keydown",u=>c.keyDown(u,a));let d=r.findIndex(u=>u.value===i);for(let[u,f]of r.entries()){let p=e.document.createElement("button");p.type="button",p.className="docx-content-control-menu-item",p.dataset.docxPart="item",p.dataset.value=f.value,p.setAttribute("role","option"),p.setAttribute("aria-selected",String(f.value===i)),p.tabIndex=u===Math.max(0,d)?0:-1,p.textContent=f.displayText,p.addEventListener("click",()=>{ju(e,a,t,f.value);}),l.append(p);}if(n==="buildingBlockGallery"&&r.length===0){let u=e.document.createElement("div");u.className="docx-content-control-menu-empty",u.dataset.docxPart="empty",u.setAttribute("role","note"),u.tabIndex=0,u.textContent=s("contentControl.gallery.empty"),l.append(u);}if(n==="comboBox"){let u=e.document.createElement("input");u.type="text",u.className="docx-content-control-menu-input",u.dataset.docxPart="input",u.value=i??"",u.setAttribute("aria-label",o||s("contentControl.types.comboBox")),u.setAttribute("aria-autocomplete","list"),u.setAttribute("role","combobox"),u.setAttribute("aria-expanded","true"),u.setAttribute("aria-controls",l.id),u.addEventListener("keydown",p=>{p.key!=="Enter"||p.isComposing||(p.preventDefault(),ju(e,a,t,u.value));}),a.append(u);let f=e.document.createElement("div");f.className="docx-dialog__footer",f.dataset.docxPart="footer";for(let p of ["cancel","apply"]){let g=e.document.createElement("button");g.type="button",g.className=`docx-dialog__button${p==="apply"?" docx-dialog__button--primary":""}`,g.dataset.docxPart=p,g.textContent=s(`common.${p}`),g.addEventListener("click",()=>{p==="apply"?ju(e,a,t,u.value):e.close(a);}),f.append(g);}a.append(l,f);}else a.append(l);return a}function Ku(e,t){let n=(t?e.querySelector(`[data-iso="${t}"]`):null)??e.querySelector("[data-selected]")??e.querySelector("[data-today]:not([data-other-month])")??e.querySelector(".docx-content-control-calendar-day:not([data-other-month])");for(let r of e.querySelectorAll("[data-iso]"))r.tabIndex=r===n?0:-1;n?.focus({preventScroll:true});}function yC(e,t,n,r){let o=jn(e.translate),i=mC(e,t);i.classList.add("docx-content-control-calendar"),i.setAttribute("role","dialog"),i.setAttribute("aria-label",r||o("contentControl.types.date"));let a=n?lo(n):null,s=a?Fi(a):null,l=new Date,c={year:(a??l).getFullYear(),month:(a??l).getMonth()},d=null,u=Wu(s??"",e.locale()),f=y=>{ju(e,i,t,y);},p=y=>{y.addEventListener("mousedown",x=>x.stopPropagation());},g=e.document.createElement("div");g.className="docx-content-control-calendar-title docx-content-control-calendar-announcement",g.dataset.docxPart="title",g.setAttribute("aria-live","polite");let b=()=>{let y=e.document.activeElement?.dataset.docxCalendarNav,x=Ah(c.year,c.month,{locale:e.locale(),selected:s,today:l}),v=e.document.createElement("div");v.className="docx-content-control-calendar-header",v.dataset.docxPart="header";let S=e.document.createElement("button");S.type="button",S.className="docx-content-control-calendar-nav",S.dataset.docxPart="previousMonth",S.dataset.docxCalendarNav="previous",S.textContent="\u2039",S.setAttribute("aria-label",o("contentControl.calendar.previousMonth")),g.textContent=x.title;let I=e.document.createElement("button");I.type="button",I.className="docx-content-control-calendar-nav",I.dataset.docxPart="nextMonth",I.dataset.docxCalendarNav="next",I.textContent="\u203A",I.setAttribute("aria-label",o("contentControl.calendar.nextMonth")),p(S),p(I),S.addEventListener("click",()=>{c=qu(c.year,c.month,-1),d=null,b();}),I.addEventListener("click",()=>{c=qu(c.year,c.month,1),d=null,b();});let C=e.document.createElement("div");C.className="docx-content-control-calendar-navigation",C.dataset.docxPart="navigation";let P=e.document.createElement("select");P.className="docx-content-control-calendar-month",P.dataset.docxPart="month",P.dataset.docxCalendarNav="month",P.setAttribute("aria-label",o("contentControl.calendar.month"));for(let[_,L]of Dh(e.locale()).entries()){let X=e.document.createElement("option");X.value=String(_),X.textContent=L,P.append(X);}P.value=String(c.month);let E=e.document.createElement("input");E.type="number",E.min="100",E.max="9999",E.value=String(c.year),E.className="docx-content-control-calendar-year",E.dataset.docxPart="year",E.dataset.docxCalendarNav="year",E.addEventListener("keydown",_=>{_.key==="Enter"&&!_.isComposing&&(_.preventDefault(),E.blur());}),E.setAttribute("aria-label",o("contentControl.calendar.year")),P.addEventListener("change",()=>{c.month=Number(P.value),d=null,b();}),E.addEventListener("change",()=>{let _=Number(E.value);if(!Number.isInteger(_)||_<100||_>9999){E.value=String(c.year);return}c.year=_,d=null,b();}),C.append(P,E);let R=e.document.createElement("div");R.className="docx-content-control-calendar-weekdays",R.dataset.docxPart="weekdays";for(let _ of x.weekdays){let L=e.document.createElement("span");L.textContent=_,R.append(L);}let w=e.document.createElement("div");w.className="docx-content-control-calendar-grid",w.dataset.docxPart="grid",w.setAttribute("role","grid"),w.setAttribute("aria-label",x.title);for(let _=0;_<x.days.length;_+=7){let L=e.document.createElement("div");L.className="docx-content-control-calendar-week",L.setAttribute("role","row");for(let X of x.days.slice(_,_+7))L.append(h(X));w.append(L);}let M=e.document.createElement("div");M.className="docx-content-control-calendar-entry",M.dataset.docxPart="dateEntry";let O=e.document.createElement("button");O.type="button",O.className="docx-content-control-calendar-today",O.dataset.docxPart="today",O.textContent=o("contentControl.calendar.today"),p(O),O.addEventListener("click",()=>f(Fi(l)));let B=e.document.createElement("input");B.type="text",B.className="docx-content-control-menu-input",B.dataset.docxPart="input",B.setAttribute("aria-label",o("contentControl.types.date")),B.placeholder=Wu("2006-11-22",e.locale()),B.value=u,B.addEventListener("input",()=>{u=B.value,B.removeAttribute("aria-invalid"),q.hidden=true;});let q=e.document.createElement("div");q.className="docx-content-control-widget-error",q.dataset.docxPart="error",q.setAttribute("role","alert"),q.hidden=true,q.textContent=o("disabledReason.invalidValue");let j=()=>{let _=Lh(u,e.locale());_?f(_):(q.hidden=false,B.setAttribute("aria-invalid","true"),B.focus());};B.addEventListener("keydown",_=>{_.key==="Enter"&&!_.isComposing&&(_.preventDefault(),j());});let z=e.document.createElement("div");z.className="docx-dialog__footer",z.dataset.docxPart="footer";for(let _ of ["cancel","apply"]){let L=e.document.createElement("button");L.type="button",L.dataset.docxPart=_,L.className=`docx-dialog__button${_==="apply"?" docx-dialog__button--primary":""}`,L.textContent=o(`common.${_}`),L.addEventListener("click",_==="apply"?j:()=>e.close(i)),z.append(L);}v.append(S,C,I,g),M.append(O,B),i.replaceChildren(v,R,w,M,q,z),Ku(i,d),y==="previous"&&S.focus({preventScroll:true}),y==="next"&&I.focus({preventScroll:true}),y==="month"&&P.focus({preventScroll:true}),y==="year"&&E.focus({preventScroll:true});},h=y=>{let x=e.document.createElement("button");return x.type="button",x.className="docx-content-control-calendar-day",x.dataset.docxPart="day",x.textContent=String(y.day),x.dataset.iso=y.iso,x.setAttribute("role","gridcell"),x.setAttribute("aria-label",y.label),y.otherMonth&&(x.dataset.otherMonth=""),y.selected&&(x.dataset.selected="",x.setAttribute("aria-selected","true")),x.setAttribute("aria-selected",String(y.selected)),y.today&&(x.dataset.today="",x.setAttribute("aria-current","date")),p(x),x.addEventListener("click",()=>f(y.iso)),x.addEventListener("keydown",v=>{if(v.isComposing||v.altKey||v.ctrlKey||v.metaKey)return;let S=Fh(y.iso,v.key,e.locale(),v.shiftKey);if(!S)return;v.preventDefault();let I=lo(S);if(d=S,I.getFullYear()!==c.year||I.getMonth()!==c.month){c={year:I.getFullYear(),month:I.getMonth()},b();return}Ku(i,d);}),x};return b(),i}function Hh(e,t){let r=(_t(t)?t:null)?.closest("[data-docx-form-checkbox][data-start]"),o=r?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!r||!o)return null;let i=chunkZOZI27AW_cjs.Xa(e.part(o),o);if(i?.kind!=="paragraph")return null;let a=Number(r.dataset.start),s=chunkZOZI27AW_cjs.gl(i).find(l=>l.start<=a&&a<l.end);return s?{paragraphId:o,field:s}:null}function bC(e){return e.shiftKey||e.altKey||e.ctrlKey||e.metaKey}function vC(e){let t=(i,a)=>{if(!e.editable()||!a.enabled)return false;let s=e.apply({op:"setLegacyCheckbox",paragraphId:i,fieldNodeId:a.fieldNodeId,checked:!a.checked});return s&&(e.pagesLayer.focus({preventScroll:true}),e.select({anchor:{paragraphId:i,offset:a.start},head:{paragraphId:i,offset:a.end}})),s},n=i=>{if(i.button!==0||bC(i))return;let a=Hh(e,i.target);!a||!e.editable()||!a.field.enabled||(i.preventDefault(),i.stopPropagation(),t(a.paragraphId,a.field));};e.pagesLayer.addEventListener("pointerdown",n,{capture:true});let r=i=>{let a=Hh(e,i.target);a&&Tr(i.target)&&i.target.setAttribute("aria-disabled",String(!e.editable()||!a.field.enabled));};e.pagesLayer.addEventListener("focusin",r);let o=()=>{let i=e.selection();if(i.anchor.paragraphId!==i.head.paragraphId)return null;let a=i.head.paragraphId,s=chunkZOZI27AW_cjs.Xa(e.part(a),a);if(s?.kind!=="paragraph")return null;let l=Math.min(i.anchor.offset,i.head.offset),c=Math.max(i.anchor.offset,i.head.offset),d=chunkZOZI27AW_cjs.gl(s).find(u=>u.start===l&&u.end===c||l===c&&l===u.start&&e.protected(a));return d?{paragraphId:a,field:d}:null};return {keydown(i){let a=Hh(e,i.target);if(a&&i.key==="Tab")return true;if(a&&i.key.length===1&&i.key!==" "&&!i.ctrlKey&&!i.metaKey&&!i.altKey)return i.preventDefault(),true;if(i.key!==" "||bC(i)||i.isComposing)return false;let s=a??o();if(!s)return false;if(!e.editable()||!s.field.enabled)return a?(i.preventDefault(),true):false;i.preventDefault();let l=t(s.paragraphId,s.field);return a&&l&&[...e.pagesLayer.querySelectorAll("[data-docx-form-checkbox][data-start]")].find(c=>c.dataset.paragraphId===s.paragraphId&&Number(c.dataset.start)===s.field.start)?.focus({preventScroll:true}),true},destroy(){e.pagesLayer.removeEventListener("pointerdown",n,{capture:true}),e.pagesLayer.removeEventListener("focusin",r);}}}var h5=new Set(["insertText","deleteText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertComplexField","insertEquation","setFieldResult","insertInlineContentControl","insertNote","insertTable","insertTableRow","deleteTableRow","setRunProperties","setParagraphProperties","setParagraphMarkProperties"]);function xC(e){return h5.has(e.op)}function ql(e){if(xC(e))return e.revision!==void 0;switch(e.op){case "setParagraphMarkRevision":case "proposeParagraphMerge":return true;case "insertContentControl":case "authorTable":case "setListNumbering":case "setListLevel":case "splitParagraphMany":return e.revision!==void 0;default:return false}}var y5=e=>chunkZOZI27AW_cjs.dk.has(e);function Wl(e,t,n){return e.flatMap(r=>xC(r)?!n&&y5(r.op)?[r]:[r.revision!==void 0?r:{...r,revision:t}]:r.op==="splitParagraphMany"?[{...r,revision:t}]:r.op==="splitParagraph"?[r,{op:"setParagraphMarkRevision",paragraphId:r.paragraphId,kind:"ins",revision:t}]:r.op==="joinParagraphs"?[{op:"proposeParagraphMerge",paragraphId:r.secondId,revision:t}]:[r])}function Vu(e,t,n,r,o){let{past:i,landing:a}=chunkZOZI27AW_cjs.Hh(e,{start:t,end:n},n,r,o),s=chunkZOZI27AW_cjs.Fh(e,t,i,r);return (i-t>s?a:i)-s}function Bh(e){return e?.trim()||void 0}var _h=new Map;function SC(e){let t=_h.get(e);if(t!==void 0)return t;let n=e.trim().split(/\s+/).filter(Boolean),r=n.length===0?"?":n.slice(0,2).map(o=>o[0].toUpperCase()).join("");return _h.size<256&&_h.set(e,r),r}function Uu(e){return e==="suggesting needs an author before it can propose a change"||e==="tracked changes need a non-empty author"}function Ba(e,t,n){if(!e)return null;let r=chunkFDSL5OJU_cjs.re(e,t);return !r||r.record.paragraphId!==n?null:{paragraphId:n,offset:r.record.start}}var wC="docx-field-atom--active",b5="docx-field-atom",kC=new WeakMap;function $h(e,t,n){let r=kC.get(e);r||(r={caretKey:null,marked:[]},kC.set(e,r));let o=t?`${t.paragraphId}\0${t.offset}`:null;if(!n?.domReplaced&&o===r.caretKey)return;for(let a of r.marked)a.classList.remove(wC);if(r.marked=[],r.caretKey=o,!t)return;let i=e.querySelectorAll(`.${b5}`);for(let a of i){if(a.dataset.paragraphId!==t.paragraphId)continue;let s=Number(a.dataset.fieldResultStart??a.dataset.start),l=Number(a.dataset.fieldResultEnd??a.dataset.end);!Number.isFinite(s)||!Number.isFinite(l)||t.offset<s||t.offset>l||(a.classList.add(wC),r.marked.push(a));}}var v5={kind:"body"};function IC(e){let{session:t}=e;if(e.editingMode==="view"||!t.editable)return true;if(e.collaborationActive)return false;let n,r=e.reviewerFilterActive?l=>(n??=chunk6NVZNB7O_cjs.Y(e.canonicalUnfilteredLayout()),n(l)):chunk6NVZNB7O_cjs.Y(e.layout),o={package:t.currentPackage(),styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,displayMode:e.displayMode,pageRefPageNumberOf:r},i=chunk6NVZNB7O_cjs.Z(t.part(),o),a=chunk6NVZNB7O_cjs._(t.part(),o);if(!i&&a.length===0)return true;let s=[];i&&s.push({scope:v5,ops:[i]});for(let l of a)s.push({scope:{kind:"notesPart",noteKind:l.noteKind},ops:[l.op]});return t.applyTreeOpsAtomic(s).committed}function x5(e,t,n){return t==="all-markup"||t==="simple-markup"?chunkFDSL5OJU_cjs.jd(e,chunk25EXMBV2_cjs.k(n.reviewItems()),t==="simple-markup"):e}function RC(e,t,n){return e.filter(x5(t.filterForSession(n),e.view(),n))}function PC(){let e=new WeakMap;return {record(t,n){e.set(t,[n?.cacheKey,n?.unlisted]);},moved(t,n){let[r,o]=e.get(t)??[];return n?.cacheKey!==r||n?.unlisted!==o}}}function EC(e){let t=0,n=null,r="",o=null,i=true,a=null,s="";return ()=>{let l=e.surface(),c=`${l?.session.packageRevision()??-1}:${l?.session.revision()??-1}`,d=e.activeKey(),u=e.paneOpen(),f=e.selectionAnchor(),p=e.authorFilterKey();return (l!==n||c!==r||d!==o||u!==i||f!==a||p!==s)&&(n=l,r=c,o=d,i=u,a=f,s=p,t+=1),t}}function zu(e=[]){let t=new Set(e),n=Object.freeze([...t]),r=chunkFDSL5OJU_cjs.db(t),o=null,i="accept",a=null,s="accept",l=new WeakMap,c=null,d=false,u=0,f=null,p=[],g=null,b=[],h=r,y=t,x=new Set,v="accept",S=new WeakSet,I=new WeakMap,C=new Map,P=()=>{u+=1,f=null,p=[],g=null;},E=M=>JSON.stringify([M.id,chunkZOZI27AW_cjs.Ej(M)]),R=(M,O,B)=>{let q=S5(B),j=t,z=r?.hiddenAuthors??chunkFDSL5OJU_cjs.cb,_=i,L;j===y&&w5(q,x)&&(q.size===0||_===v)?L=h:q.size===0&&j.size===0?L=void 0:L=Object.freeze({hiddenAuthors:z,includes:te=>!j.has(te.author)&&!q.has(te.nodeId),includesNode:(te,me)=>!j.has(me)&&!q.has(te),excludedNodeMode:(te,me)=>j.has(me)?"proposed":q.has(te)&&_==="reject"?"original":"proposed",cacheKey:k5(j,q,_)});let X=[];for(let te of M){let me=TC(te);me!==null&&j.has(me)||te.kind==="revision"&&O.has(te)||X.push(te);}b=X.length===M.length?M:chunkZOZI27AW_cjs.wk(X),g=M,S=O,h=L,y=j,x=q,v=_,d=false,a=null,s="accept",l=new WeakMap,c=null;},w=M=>{if(M===g)return;let O=new WeakSet,B=[],q=[];try{for(let z of M){if(z.kind!=="revision")continue;let _=!t.has(z.author),L=I.get(z);L===void 0&&(L=o?.(z)??!0,q.push([z,L])),!(_&&L)&&(O.add(z),L||B.push(z));}}catch(z){if(d)o=a,i=s,I=l,g=c,a=null,s="accept",l=new WeakMap,c=null,u+=1;else {let _=new WeakSet,L=[];for(let X of M){if(X.kind!=="revision")continue;let te=C.get(E(X))??true;(t.has(X.author)||!te)&&_.add(X),te||L.push(X);}R(M,_,L);}throw d=false,z}for(let[z,_]of q)I.set(z,_);let j=new Map;for(let z of M)z.kind==="revision"&&j.set(E(z),I.get(z)??true);C=j,R(M,O,B);};return {get hiddenAuthors(){return r?.hiddenAuthors??chunkFDSL5OJU_cjs.cb},get hiddenAuthorList(){return n},get stateKey(){return String(u)},get hasFilter(){return t.size>0||o!==null},get hasPredicate(){return o!==null},filterFor(M){return o?(w(M),h):r},filterForSession(M){return o?(w(M.reviewItems()),h):r},filterItems(M){if(!o){if(t.size===0)return M;if(M===f)return p;let O=M.filter(B=>{let q=TC(B);return q===null||!t.has(q)});return f=M,p=O.length===M.length?M:chunkZOZI27AW_cjs.wk(O),p}return w(M),b},includesRevisionItem(M){return !S.has(M)},setPredicate(M,O="accept"){return o===null&&M===null?false:M===null?(o=null,i="accept",a=null,s="accept",d=false,I=new WeakMap,l=new WeakMap,C=new Map,c=null,b=[],S=new WeakSet,h=r,y=t,x=new Set,v="accept",P(),true):(a=o,s=i,l=I,c=g,d=true,o=M,i=O,I=new WeakMap,P(),true)},isVisible:M=>!t.has(M),setVisible(M,O){if(O===!t.has(M))return false;let B=new Set(t);return O?B.delete(M):B.add(M),t=B,n=Object.freeze([...B]),r=chunkFDSL5OJU_cjs.db(B),P(),true},setAllVisible(M,O){let B=O?new Set:new Set(M);return B.size===t.size&&[...B].every(q=>t.has(q))?false:(t=B,n=Object.freeze([...B]),r=chunkFDSL5OJU_cjs.db(B),P(),true)},showAll(){return t.size===0?false:(t=new Set,n=Object.freeze([]),r=void 0,P(),true)}}}function CC(e,t){return t.filterItems(e)}function S5(e){let t=new Set;for(let n of e)for(let r of chunkZOZI27AW_cjs.Ej(n))t.add(r);return t}function w5(e,t){if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function k5(e,t,n){return JSON.stringify({hiddenAuthors:[...e].sort(),excludedNodeIds:[...t].sort(),mode:t.size===0?"accept":n})}function TC(e){return e.kind==="comment"?e.comment?.author??"":e.author??null}function OC(e,t){let n=r=>{if(!t.enabled)return;let o=t.surface();if(o)return o.setAllRevisionAuthorsVisible(r);!r||!e.showAll()||t.notify();};return {isReviewAuthorVisible:e.isVisible,setReviewAuthorVisible(r,o){if(!t.enabled)return;let i=t.surface();if(i)return i.setRevisionAuthorVisible(r,o);e.setVisible(r,o)&&t.notify();},setAllReviewAuthorsVisible:n,showAllReviewAuthors:()=>n(true)}}var I5=Object.freeze({mode:"atomic",run:e=>e(),wrap:e=>e,methods:e=>e,listeners:()=>{},selectsWholeFieldWhen:()=>{},edits:e=>e});function R5(e){if(e===void 0||e==="atomic")return "atomic";if(e==="editable")return "editable";throw new TypeError('Invalid fieldResults: use "atomic" or "editable"')}var qh='fieldResults "editable" is not supported in a collaboration session: shared paragraph text keeps each field one unit';function P5(e){if(e==="atomic")return I5;let t=o=>chunkZOZI27AW_cjs.sf(e,o),n=o=>function(...i){return t(()=>o.apply(this,i))},r=()=>false;return {mode:e,run:t,wrap:n,selectsWholeFieldWhen(o){r=o;},edits:o=>function(...i){return r()?chunkZOZI27AW_cjs.tf(()=>o.apply(this,i)):o.apply(this,i)},methods(o){for(let i of Reflect.ownKeys(o)){let a=Object.getOwnPropertyDescriptor(o,i);if(a?.configurable){if(typeof a.value=="function")a.value=n(a.value);else if(a.get||a.set)a.get&&(a.get=n(a.get)),a.set&&(a.set=n(a.set));else continue;Object.defineProperty(o,i,a);}}return o},listeners(o){let i=o.addEventListener,a=o.removeEventListener,s=new WeakMap,l=c=>{let d=s.get(c);return d||(d=typeof c=="function"?function(u){return t(()=>c.call(this,u))}:u=>t(()=>c.handleEvent(u)),s.set(c,d)),d};Object.defineProperty(o,"addEventListener",{configurable:true,writable:true,value(c,d,u){d&&i.call(o,c,l(d),u);}}),Object.defineProperty(o,"removeEventListener",{configurable:true,writable:true,value(c,d,u){d&&a.call(o,c,s.get(d)??d,u);}});}}}function MC(e,t){if(t.mode==="atomic")return e;let n=e,r=n.subscribe.bind(n),o=n.applyTreeOps.bind(n),i=n.applyTreeOpsAtomic.bind(n);return n.subscribe=a=>r(t.wrap(a)),n.applyTreeOps=t.edits(o),n.applyTreeOpsAtomic=t.edits(i),t.methods(e)}function Gu(e){let t=R5(e.fieldResults);if(t==="editable"&&e.collaborationModel)throw new TypeError(qh);return P5(t)}function Zu(e,t){let n=e.part(t),r=n?chunkZOZI27AW_cjs.Xa(n,t):null;return r?.kind!=="paragraph"?[]:chunkZOZI27AW_cjs.$i(r).filter(o=>o.start<o.end)}function T5(e,t){return Zu(e,t.paragraphId).find(n=>t.offset>n.start&&t.offset<n.end)}function E5(e,t){let n=(i,a)=>{let s=T5(e,i);if(!s||a.paragraphId===i.paragraphId&&a.offset>=s.start&&a.offset<=s.end)return i;let l=e.compare(a,i)<0?s.end:s.start;return {paragraphId:i.paragraphId,offset:l}},r=n(t.anchor,t.head),o=n(t.head,t.anchor);return r===t.anchor&&o===t.head?t:{anchor:r,head:o}}function C5(e,t){if(t.length!==2)return t;let[n,r]=t;if(n?.op!=="deleteText"||r?.op!=="insertText"||r.paragraphId!==n.paragraphId||n.start>=n.end||r.offset!==n.start&&r.offset!==n.end)return t;let{start:o,end:i}=n,a=Zu(e,n.paragraphId).find(l=>l.start<=o&&i<=l.end);if(!a||o!==a.start&&i!==a.end)return t;let s=r.text.length;return [{...r,offset:o,...o===a.start?{bias:"right"}:{}},{...n,start:o+s,end:i+s}]}function AC(e,t,n){if(n.mode==="atomic")return e;let{selectForDeletion:r,wordDeletionBoundary:o,beforeSelect:i,annotate:a}=e,s=null,l=d=>s!==null&&d.anchor.paragraphId===s.anchor.paragraphId&&d.head.paragraphId===s.head.paragraphId&&d.anchor.offset===s.anchor.offset&&d.head.offset===s.head.offset;n.selectsWholeFieldWhen(()=>l(t.selection()));let c=d=>{let{anchor:u,head:f}=t.selection();if(!(u.paragraphId!==f.paragraphId||u.offset!==f.offset))return Zu(t,f.paragraphId).find(p=>d===-1?p.end===f.offset:p.start===f.offset)};return Object.assign(e,{annotate:n.wrap(d=>a.call(e,l(t.selection())?d:C5(t,d))),selectForDeletion:n.wrap(d=>{let u=t.writable()?c(d==="backward"?-1:1):void 0;if(!u)return r.call(e,d);let{paragraphId:f}=t.selection().head;return s={anchor:{paragraphId:f,offset:u.start},head:{paragraphId:f,offset:u.end}},t.select(s),true}),wordDeletionBoundary:n.wrap((d,u,f,p)=>{let g=o.call(e,d,u,f,p),b=Zu(t,t.selection().head.paragraphId),h=b.find(x=>f===-1?x.end===u:x.start===u);if(h)return f===-1?h.start:h.end;let y=g;for(let x of b)for(let v of [x.start,x.end])f===-1&&v<u&&v>y&&(y=v),f===1&&v>u&&v<y&&(y=v);return y}),beforeSelect:n.wrap(d=>(l(d)||(s=null),i.call(e,E5(t,d))))})}function FC(e,t){let n,r=()=>{n!==void 0&&(n=void 0,t());};return ()=>{let o=e.ownerDocument?.defaultView??null;n!==void 0&&n===o||(n=o,o&&typeof o.requestAnimationFrame=="function"?o.requestAnimationFrame(r):queueMicrotask(r));}}var LC=chunkFDSL5OJU_cjs.Xe;function DC(e){let{session:t,...n}=e;return chunkFDSL5OJU_cjs.jf({view:t,...n})}function Ft(e){return e.closest(".docx-editor__scroll-container")}function NC(e){let t=Ft(e);t&&(t.scrollTop=0,t.scrollLeft=0);}function HC(e,t,n){let r=e.getBoundingClientRect(),o=t.getBoundingClientRect();return {top:(t.scrollTop!==0&&r.top===0&&o.top===0?t.scrollTop-e.offsetTop:o.top+t.clientTop-r.top)/n,height:t.clientHeight/n}}function _C(e,t,n){let r=Ft(e);if(!r||r.clientHeight<=0||t.pages.length===0||n<=0)return null;let o=HC(e,r,n),i=o.top+o.height/2;for(let a of t.pages)if(i<a.box.y+a.box.height)return a.index+1;return t.pages.length}function BC(e,t,n,r){let o=Ft(e);if(!o||o.clientHeight===0)return;let i=HC(e,o,r),a=[];for(let s of [n.anchor,n.head]){let l=chunkFDSL5OJU_cjs.ze(t,s);l&&a.push(l.pageIndex);}return chunk6NVZNB7O_cjs.ha({layout:t,viewport:i,overscanPages:1,pinnedPages:a})}function Wh(e,t){if(e===t)return true;if(!e||!t||e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function Xu(e,t){let n=e.pages[e.pages.length-1],r=n?n.box.y+n.box.height:0,o=t?e.pages.filter(s=>t.has(s.index)):e.pages,i=0;for(let s of o)i=Math.max(i,s.box.x+s.box.width);let a=new Map;if(new Set(o.map(s=>s.box.width)).size>1)for(let s of e.pages)a.set(s.index,(i-s.box.width)/2-s.box.x);return {width:i,height:r,pageOffsetX:a}}function $C(e,t){if(e.width!==t.width||e.height!==t.height||e.pageOffsetX.size!==t.pageOffsetX.size)return false;for(let[n,r]of e.pageOffsetX)if(t.pageOffsetX.get(n)!==r)return false;return true}function qC(e,t,n,r){for(let o of t.pages){let i=e.children.item(o.index);if(i?.dataset.pageIndex!==String(o.index))continue;let a=n.pageOffsetX.get(o.index)??0;i.style.left=`${(o.box.x+a)*r}px`;}}function WC(e){let{pagesLayer:t,listeners:n}=e,r=n.onDocument("selectionchange",e.onSelectionChange),o=FC(t,e.rematerialize),i=n.onDocument("scroll",p=>{let g=Ft(e.container());!g||p.target!==g||o();},{capture:true,passive:true}),a=n.onWindow("resize",o,{passive:true}),s=null,l=null,c=null,d=false;function u(){s?.disconnect(),s=null,l=null,c=null;}function f(){if(d)return;let p=je(t);if(p!==l&&(u(),l=p,s=typeof p.ResizeObserver=="function"?new p.ResizeObserver(o):null),!s)return;let g=Ft(e.container());g!==c&&(s.disconnect(),c=g,g&&s.observe(g));}return f(),{schedule:o,watchScrollerSize:f,rebind(){d=false,f(),o();},suspend(){d=true,u();},destroy(){r(),i(),a(),u();}}}function jC(e){let t=new Set,n=false;function r(s){return s==="document"?fl(e()):je(e())}function o(s){s.bound?.removeEventListener(s.type,s.listener,s.options),s.bound=null;}function i(s){let l=r(s.target);s.bound!==l&&(o(s),l.addEventListener(s.type,s.listener,s.options),s.bound=l);}function a(s,l,c,d){let u={target:s,type:l,listener:c,options:d,bound:null};return t.add(u),n||i(u),()=>{o(u),t.delete(u);}}return {onDocument(s,l,c){return a("document",s,l,c)},onWindow(s,l,c){return a("window",s,l,c)},rebind(){n=false;for(let s of t)i(s);},suspend(){n=true;for(let s of t)o(s);},clear(){for(let s of t)o(s);t.clear();},stale(){if(n)return false;for(let s of t)if(s.bound!==r(s.target))return true;return false}}}var O5=["docx-paginated-surface--viewing","docx-paginated-surface--hf-editing"],M5=["data-docx-layout-pending","data-docx-opening-preview"];function A5(e,t){if(e===t)return;t.style.position="relative";let n=Array.from(e.childNodes);t.replaceChildren();for(let r of n)t.appendChild(r);for(let r of O5)e.classList.contains(r)&&(e.classList.remove(r),t.classList.add(r));for(let r of M5){let o=e.getAttribute(r);o!==null&&(e.removeAttribute(r),t.setAttribute(r,o));}e.style.removeProperty("position"),e.style.removeProperty("width"),e.style.removeProperty("height");}var KC=["focusin","pointerdown","pointerenter","wheel"],F5=5,L5=2e3;function D5(e){return _t(e)?e.localName==="input"||e.localName==="textarea"||e.localName==="select"||Tr(e)&&e.isContentEditable:false}function VC(e){let t=null,n=null,r=false,o=Number.NEGATIVE_INFINITY,i=f=>{let p=f.relatedTarget;Co(p)&&e.pagesLayer.contains(p)||(o=D5(p)?Number.NEGATIVE_INFINITY:Date.now());};e.pagesLayer.addEventListener("focusout",i);let a=mt(()=>e.pagesLayer);function s(f){if(t!==null)return;let p=Ft(f),g=e.scale();n=p?{x:(p.scrollLeft-f.offsetLeft)/g,y:(p.scrollTop-f.offsetTop)/g}:null;let b=e.pagesLayer.ownerDocument.activeElement;r=!!b&&e.pagesLayer.contains(b)||Date.now()-o<L5;}function l(){let f=n;if(n=null,!f)return;let p=()=>{let h=e.container(),y=Ft(h);if(!y)return false;let x=e.scale();return y.scrollTop=Math.max(0,f.y*x+h.offsetTop),y.scrollLeft=Math.max(0,f.x*x+h.offsetLeft),true};p();let g=0,b=()=>{t!==null||p()||++g>F5||a.requestAnimationFrame(b);};queueMicrotask(b);}function c(f){s(e.container()),e.settle(),e.listeners.suspend(),e.viewport()?.suspend(),A5(e.container(),f),e.setContainer(f);}let d=false;function u(){if(!(d||t!==null||e.destroyed()||!e.listeners.stale())){d=true;try{e.listeners.rebind(),e.viewport()?.rebind(),e.settle(),e.onHostMoved?.(e.pagesLayer.ownerDocument);}finally{d=false;}}}for(let f of KC)e.pagesLayer.addEventListener(f,u,{capture:true,passive:true});return {moveTo(f,p){if(!e.destroyed()){if(f===e.container()&&t===null)return u();c(f),t=null,e.listeners.rebind(),e.viewport()?.rebind(),(p?.focus??r)&&e.pagesLayer.focus({preventScroll:true}),e.repaint(),l();}},park(){if(e.destroyed()||t!==null)return;let f=e.pagesLayer.ownerDocument.createElement("div");c(f),t=f;},parked:()=>t!==null,heal:u,destroy(){for(let f of KC)e.pagesLayer.removeEventListener(f,u,{capture:true});e.pagesLayer.removeEventListener("focusout",i);}}}function jh(e){return e.kind==="comment"?e.comment.author:e.kind==="revision"?e.author:null}function UC(e){let t=null;return {get(){let n=e.layout(),r=e.items(),o=e.styles(),i=t;if(i?.layout===n&&i.items===r&&i.styles===o)return i;let a=e.slots.resolve(chunkZGTIE3QJ_cjs.f(n),(function*(){for(let f of r){let p=jh(f);p!==null&&(yield p);}})()),s=i?.value,l=s!==void 0&&s.size===a.size&&[...a].every(([u,f])=>s.get(u)===f),c=l?s:a,d=i!==null&&l&&i.styles===o?i.resolved:new Map(chunkZGTIE3QJ_cjs.e(c,o).map(u=>[u.author,u]));return t={layout:n,items:r,styles:o,value:c,resolved:d},t},releaseLayout(){t!==null&&(t={...t,layout:null,items:null});}}}function zC(e){let t=null;return {forAuthor(n){let r=e.roster(),o=r.resolved.get(n);if(o)return chunk2CWQY27B_cjs.a(o.color)??chunkZGTIE3QJ_cjs.c(o.slot);let i=e.slots.resolve(r.value,[n]).get(n);return i===void 0?void 0:chunkZGTIE3QJ_cjs.c(i)},declaredFor(n){let r=e.styles();return (t===null||t.styles!==r)&&(t={styles:r,resolved:chunkZGTIE3QJ_cjs.d(r)}),chunk2CWQY27B_cjs.a(t.resolved.get(n)?.color)}}}function Ho(e){try{return e.createElement("canvas").getContext("2d")}catch{return null}}var GC=new WeakMap;function N5(e){let t=[],n={x:e.box.x,y:e.box.y};for(let r of [e.header,e.footer]){if(!r)continue;let o={x:r.box.x,y:r.box.y};chunkFDSL5OJU_cjs.Ia(r,(i,a)=>{a.textboxDepth===0||a.textboxOwner?.accessibility.hidden||t.push(chunkFDSL5OJU_cjs.Ye(i,a.storyOrigin.x-e.contentBox.x,a.storyOrigin.y-e.contentBox.y));},o,i=>chunkFDSL5OJU_cjs.za(i,o,n));}return t}function Li(e){let t=GC.get(e);if(t)return t;let n=e.pages.map(o=>{let i=chunkFDSL5OJU_cjs.Jd(o).flatMap(a=>{let s=a.textboxStory;return s.fragments.flatMap(l=>l.kind==="paragraph"?[chunkFDSL5OJU_cjs.Ye(l,a.x+s.contentOffset.x,a.y+s.contentOffset.y)]:[])});return i.push(...N5(o)),i.length?{...o,fragments:[...o.fragments,...i]}:o}),r=n.every((o,i)=>o===e.pages[i])?e:{...e,pages:n};return GC.set(e,r),r}function XC(e,t,n){let r=t(e.anchor.paragraphId),o=t(e.head.paragraphId);return !r||!o?null:{anchor:{paragraphId:r.paragraphId,offset:Math.max(0,e.anchor.offset)},head:{paragraphId:o.paragraphId,offset:Math.max(0,e.head.offset)},...n?{kind:n}:{}}}function YC(e,t){let n=chunkZOZI27AW_cjs.Xa(e,t);if(!n||n.kind==="textValue")return null;let r=chunkZOZI27AW_cjs.Ab(n);return !r||!chunkZOZI27AW_cjs.zb(r)?null:{paragraphId:r.toUpperCase(),nodeId:t,text:""}}var Kh=new WeakMap;function H5(e,t,n){return e.map(r=>chunk2CWQY27B_cjs.a(n?.(r.name))??chunk2CWQY27B_cjs.a(r.color)??chunk2CWQY27B_cjs.a(t?.(r.name)))}function _5(e,t){let n="";for(let[r,o]of e.entries())n+=`${o.actorId} ${o.name} ${t[r]??""} ${o.kind??""} `,n+=`${o.anchor.nodeId}:${o.anchor.offset} `,n+=`${o.head.nodeId}:${o.head.offset}
25
- `;return n}function B5(e){if(!e)return "*";let t=[];for(let n of e)t.push(n);return t.sort((n,r)=>n-r),t.join(",")}function $5(e){if(!e||e.size===0)return "";let t=[];for(let[n,r]of e)t.push(`${n}:${r}`);return t.sort(),t.join(",")}function q5(e,t,n){return e.layout===n.layout&&e.fingerprint===n.fingerprint&&e.pagesKey===n.pagesKey&&e.scale===n.scale&&e.offsetKey===n.offsetKey&&e.labelHost===n.labelHost&&e.childCount===t.childElementCount}function ZC(e){return e.anchor.nodeId===e.head.nodeId&&e.anchor.offset===e.head.offset}function W5(e,t){let n=chunk6NVZNB7O_cjs.ra(e,t.anchor.nodeId),r=chunk6NVZNB7O_cjs.ra(e,t.head.nodeId);if(!n||!r)return [];let o=chunk6NVZNB7O_cjs.ja(e,n,r);return o?chunk6NVZNB7O_cjs.na(e,o.cellIds).map(i=>({...i,className:"docx-remote-selection-rect"})):[]}function QC(e,t,n,r){t=Li(t);let{scale:o,pageOffsetX:i,pages:a,colorForAuthor:s,declaredColorFor:l}=r,c=r.labelHost??null,d=H5(n,s,l),u={layout:t,fingerprint:_5(n,d),pagesKey:B5(a),scale:o,offsetKey:$5(i),labelHost:c},f=Kh.get(e);if(f&&q5(f,e,u))return;Kh.delete(e);let p=[],g=[],b=[],h=[];for(let[S,I]of n.entries())I.kind==="cells"||ZC(I)||h.push({key:String(S),from:{paragraphId:I.anchor.nodeId,offset:I.anchor.offset},to:{paragraphId:I.head.nodeId,offset:I.head.offset}});let y=h.length>0?chunkFDSL5OJU_cjs.Ne(t,h,chunkFDSL5OJU_cjs.Va(t),a,r.measurer):null;for(let[S,I]of n.entries()){let C=d[S],P=chunkFDSL5OJU_cjs.ze(t,{paragraphId:I.head.nodeId,offset:I.head.offset},r.measurer);if(P){let R=chunkFDSL5OJU_cjs.Me(t,I.head.nodeId,P.pageIndex);b.push({selection:I,...C?{color:C}:{},pageIndex:P.pageIndex,x:P.x+R.x,y:P.y+R.y});}if(I.kind==="cells"){let R=W5(t,I);if(R.length>0){for(let w of R)p.push(w),g.push(C);continue}}if(ZC(I)){let R=chunkFDSL5OJU_cjs.ze(t,{paragraphId:I.anchor.nodeId,offset:I.anchor.offset},r.measurer);if(!R)continue;let w=chunkFDSL5OJU_cjs.Me(t,I.anchor.nodeId,R.pageIndex);p.push({pageIndex:R.pageIndex,x:R.x+w.x,y:R.y+w.y,width:Math.max(1/o,1),height:R.height,className:"docx-remote-caret"}),g.push(C);continue}let E=y?.get(String(S));if(E)for(let R of E)p.push({...R,className:"docx-remote-selection-rect"}),g.push(C);}chunkZGTIE3QJ_cjs.u(e,t,p,{scale:o,pageOffsetX:i}),[...e.children].forEach((S,I)=>{let C=chunk2CWQY27B_cjs.a(g[I]);!C||!Tr(S)||S.style.setProperty("--doc-remote-color",C);});let x=e.ownerDocument,v=[];for(let S of b){let I=t.pages[S.pageIndex];if(!I)continue;let C=x.createElement("div");C.className="docx-remote-caret-label",c?(C.setAttribute("data-docx-remote-actor",S.selection.actorId),v.push({element:C,selection:S.selection})):C.textContent=S.selection.name,C.style.left=`${(I.contentBox.x+S.x+(i?.get(S.pageIndex)??0))*o}px`,C.style.top=`${(I.contentBox.y+S.y)*o}px`;let P=chunk2CWQY27B_cjs.a(S.color);P&&C.style.setProperty("--doc-remote-color",P),e.append(C);}Kh.set(e,{...u,childCount:e.childElementCount}),c&&c.publish(v);}function JC(e){if(e.some(r=>r.op==="deleteNote"))return "suggesting cannot delete a note outright; strike its reference to propose the deletion";let t=r=>r.op==="removeContentControl"&&r.keepContent===false;if(e.some(t))return "suggesting cannot remove a content control outright";let n=r=>r.op==="mergeTableCells"||r.op==="splitTableCell";return e.some(n)?Jd:null}function j5(e,t){let n=Math.max(0,e.end-e.start);return e.start+Math.max(0,Math.min(t,n))}var iO=/^[^\s]{1,512}$/,Vh=/["\\\u0000-\u001f\u007f]/;function aO(e,t){return !e||t===void 0||!/^\d{1,9}$/.test(t)||!iO.test(e)||e==="__proto__"?null:{paragraphId:e,offset:Number(t)}}function _o(e){let t=aO(e.dataset?.paragraphId,e.dataset?.start);if(!t)return null;let{paragraphId:n,offset:r}=t,o=e.dataset?.end,i=o!==void 0&&/^\d{1,9}$/.test(o)&&Number(o)>=r?Number(o):r+(e.textContent?.length??0);return {paragraphId:n,start:r,end:i}}function $a(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return null;let t=e;return !t.classList.contains("docx-inline-drawing-advance")||t.parentElement?.dataset.paragraphId===void 0?null:aO(t.dataset.drawingParagraphId,t.dataset.drawingStart)}function K5(e,t){let n=Vh.test(t)?"[data-paragraph-id][data-start], .docx-inline-drawing-advance":`[data-paragraph-id="${t}"][data-start], .docx-inline-drawing-advance[data-drawing-paragraph-id="${t}"]`,r=[],o=[];for(let i of e.querySelectorAll(n))i.classList.contains("docx-inline-drawing-advance")?$a(i)?.paragraphId===t&&o.push(i):r.push(i);return {spans:r,spacers:o}}function Qu(e,t,n){return Vh.test(t)?e.querySelectorAll(`[data-paragraph-id]${n}`):e.querySelectorAll(`[data-paragraph-id="${t}"]${n}`)}function sO(e){let t=e.nodeType===Node.TEXT_NODE?e.parentNode:e;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let n=_o(t);if(n)return {element:t,identity:n};t=t.parentNode;}return null}function lO(e){return e.querySelector("[data-docx-hf-active]")}function Di(e,t){if(!e||t&&!t.contains(e))return;let o=(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest("[data-page-index]")?.dataset?.pageIndex;if(!(o===void 0||!/^\d{1,9}$/.test(o)))return Number(o)}function V5(e,t){return t===void 0||!Number.isInteger(t)||t<0?null:e.querySelector(`[data-page-index="${t}"]`)}function Yu(e,t){let n=lO(e);if(n)return [n,e];let r=V5(e,t);return r&&r!==e?[r,e]:[e]}function eO(e,t){let n=l=>({paragraphId:l.paragraphId,offset:t?l.end:l.start}),r=l=>t?{...l,offset:l.offset+1}:l,o=sO(e);if(o)return n(o.identity);let i=$a(e);if(i)return r(i);if(e.nodeType!==Node.ELEMENT_NODE)return null;let a=e.querySelectorAll("[data-paragraph-id][data-start], .docx-inline-drawing-advance"),s=t?[...a].reverse():[...a];for(let l of s){let c=$a(l);if(c)return r(c);let d=_o(l);if(d)return n(d)}return null}function tO(e,t,n=false){let r=[...e.childNodes];if(r.length===0)return null;let o=$a(r[t-1]);if(o)return {paragraphId:o.paragraphId,offset:o.offset+1};for(let i=Math.max(0,t);!n&&i<r.length;i+=1){let a=eO(r[i],false);if(a)return a}for(let i=Math.min(t,r.length)-1;i>=0;i-=1){let a=eO(r[i],true);if(a)return a}return null}function nO(e,t,n){if(!n.contains(e))return null;let r=e.nodeType===Node.ELEMENT_NODE?e:e.parentElement;if(r?.closest("[data-docx-field]"))return null;let o=r?.closest("[data-docx-hf]");if(o&&!o.hasAttribute("data-docx-hf-active")||lO(n)&&r?.closest(".docx-page-content"))return null;let i=r?.closest("[data-docx-marker]"),a=$a(i??void 0);if(a)return t>0?{...a,offset:a.offset+1}:a;let s=r?.closest(".docx-terminator-seat");if(s?.querySelector(".docx-line-break-mark")&&s.parentElement){let d=s.parentElement,u=[...d.querySelectorAll(".layout-run[data-start]")].filter(g=>g.closest(".docx-line")===d).flatMap(g=>{let b=_o(g);return b?[{run:g,identity:b}]:[]}),f=u.at(-1)?.identity.paragraphId,p;for(let g of u)g.identity.paragraphId===f&&(!p||g.identity.start>p.identity.start)&&(p=g);if(p){let g=p.run.textContent===`
26
- `,{start:b,end:h}=p.identity;return {paragraphId:p.identity.paragraphId,offset:g?b:h}}}let l=s??(i?.classList.contains("docx-wrap-advance")?i:null);if(l?.parentElement){let d=[...l.parentElement.childNodes],u=d.indexOf(l);if(s){let g="[data-start], a, br, .docx-inline-drawing-advance, .docx-wrap-advance";for(;u>0&&!d[u-1].matches?.(g);)u-=1;}let f=!s&&t>0?1:0,p=tO(l.parentElement,u+f,!!s);if(p)return p}if(i)return i.parentElement?cO(i.parentElement):null;if(r?.closest("[data-docx-tab-leader]"))return null;if(e.nodeType===Node.ELEMENT_NODE){let d=e,u=_o(d);if(u)return {paragraphId:u.paragraphId,offset:t>0?u.end:u.start};let f=tO(d,t);return f||Z5(d)}let c=sO(e);return c?{paragraphId:c.identity.paragraphId,offset:j5(c.identity,t)}:null}function qa(e,t){if(!t||t.rangeCount===0)return null;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}=t;if(!n||!o)return null;let a=nO(n,r,e),s=nO(o,i,e);if(!a||!s){let l=a??s;return l?{anchor:l,head:l}:null}return {anchor:a,head:s}}function Uh(e,t){if(!t||t.rangeCount===0)return false;let{anchorNode:n,focusNode:r}=t;return !!n&&e.contains(n)||!!r&&e.contains(r)}function rO(e,t,n,r){if(r!==void 0)for(let o of Yu(e,n)){let i=Vh.test(r)?"[data-line-id]":`[data-line-id="${r}"]`;for(let a of o.querySelectorAll(i)){if(a.dataset.lineId!==r)continue;let s=oO(a,t);if(s)return s}}for(let o of Yu(e,n)){let i=oO(o,t);if(i)return i}return null}function U5(e,t){let n=null;for(let r of e){if(!r.hasAttribute("data-docx-field")||!r.parentNode)continue;let o=_o(r);if(o?.paragraphId===t.paragraphId){if(o.start===t.offset)return {node:r.parentNode,offset:[...r.parentNode.childNodes].indexOf(r)};o.end===t.offset&&(n=r);}}if(n){let r=_o(n);for(let o of e){let i=_o(o);i?.paragraphId===t.paragraphId&&i.start===r.start&&i.end===r.end&&(n=o);}}return n?.parentNode?{node:n.parentNode,offset:[...n.parentNode.childNodes].indexOf(n)+1}:null}function oO(e,t){let{spans:n,spacers:r}=K5(e,t.paragraphId),o=U5(n,t);if(o)return o;let i=null,a=false;for(let p of n){let g=_o(p);if(!g||g.paragraphId!==t.paragraphId)continue;let b=z5(p),h=p.textContent?.length??0,y=g.end;if(b){if(p.closest?.("[data-docx-field]")){a=true;continue}if(a=true,t.offset>=g.start&&t.offset<=y){let x={node:b,offset:Math.min(t.offset-g.start,h)};if(t.offset<y)return x;i=x;}}}let s=p=>r.find(g=>$a(g)?.offset===p)??null,l=s(t.offset);if(i&&l?.parentNode&&!l.parentNode.contains(i.node))return {node:l.parentNode,offset:[...l.parentNode.childNodes].indexOf(l)};if(i)return i;let c=l,d=c?null:s(t.offset-1),u=c??d;if(u?.parentNode)return {node:u.parentNode,offset:[...u.parentNode.childNodes].indexOf(u)+(d?1:0)};if(a||=r.length>0,a)return null;let f=G5(e,t.paragraphId);return f?{node:f,offset:0}:null}function z5(e){let t=e.firstChild;for(;t&&t.nodeType===Node.ELEMENT_NODE;)t=t.firstChild;return t&&t.nodeType===Node.TEXT_NODE?t:null}function G5(e,t){let n=null;for(let r of Qu(e,t,""))if(r.dataset?.paragraphId===t&&r.dataset?.start===void 0){if(r.dataset?.lineId!==void 0)return r;n??=r;}return n}function cO(e){let t=e.closest("[data-paragraph-id]");if(!t||t.dataset.start!==void 0)return null;let n=t.dataset.paragraphId;return !n||!iO.test(n)||n==="__proto__"?null:{paragraphId:n,offset:0}}function Z5(e){let t=cO(e);return !t||e.closest("[data-paragraph-id]").querySelector("[data-paragraph-id][data-start]")?null:t}function dO(e,t,n,r){if(!n)return false;let o=r?.preferredPageIndex??Di(n.anchorNode,e),a=Lt(t,{anchor:t.head,head:t.head})?r?.preferredLineId:void 0,s=rO(e,t.anchor,o,a),l=rO(e,t.head,o,a);if(!s||!l)return false;let c=qa(e,n);if(c&&Lt(c,t)){let d=Di(n.anchorNode,e),f=(n.focusNode?.nodeType===Node.ELEMENT_NODE?n.focusNode:n.focusNode?.parentElement)?.closest("[data-line-id]")?.dataset.lineId;if((o===void 0||d===o)&&(a===void 0||f===a))return true}try{return n.setBaseAndExtent(s.node,s.offset,l.node,l.offset),!0}catch{return false}}function Lt(e,t){return e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}var X5='[data-docx-marker],[data-docx-tab-leader],[aria-hidden="true"],[contenteditable="false"],[data-drawing-node-id]';function uO(e,t,n){let r=e.dataset.end;if(r===void 0||!/^\d{1,9}$/.test(r))return n;let o=Number(r);return o>=t?o:n}function fO(e,t){if(e.dataset.paragraphId!==t)return null;let n=e.dataset.start;return n===void 0||!/^\d{1,9}$/.test(n)?null:Number(n)}function Y5(e){return e?(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(".docx-page")??null:null}function Q5(e,t,n){return t&&e.contains(t)?2:n?.contains(e)?1:0}function pO(e,t,n,r){if(e.dataset.docxField!==void 0){let i=uO(e,t,t);return {start:t,end:i,text:n.slice(t,i),seq:r}}let o=e.textContent??"";return {start:t,end:uO(e,t,t+o.length),text:o,seq:r}}function mO(e,t){for(let n of e.childNodes){if(n.nodeType===Node.TEXT_NODE){let s=n.textContent??"";s.length>0&&(t.pieces.push({start:t.end,end:t.end,text:s,seq:t.seq}),t.seq+=1);continue}if(n.nodeType!==Node.ELEMENT_NODE)continue;let r=n,o=fO(r,t.paragraphId);if(o===null){if(r.dataset?.start!==void 0)continue;let s=r.dataset?.drawingStart;if(r.dataset?.drawingParagraphId===t.paragraphId&&s!==void 0&&/^\d{1,9}$/.test(s)){t.end=Math.max(t.end,Number(s)+1);continue}if(r.matches?.(X5))continue;mO(r,t);continue}let i=pO(r,o,t.modelText,t.seq);t.seq+=1,t.end=Math.max(t.end,i.end);let a=`${i.start}:${i.end}`;t.ranges.has(a)||(t.ranges.add(a),t.pieces.push(i));}}function J5(e,t,n,r){let o=[];for(let a of Qu(e,t,"")){let s=a;s.dataset.paragraphId===t&&s.dataset.start===void 0&&(o.some(l=>l.contains(s))||o.push(s));}let i=new Map;for(let a of o){let s=a.dataset.fragmentIndex??"",l=Q5(a,n,r),c=i.get(s);(!c||l>c.affinity)&&i.set(s,{element:a,affinity:l});}return [...i.values()].map(a=>a.element)}function eB(e,t,n){for(let r of Qu(e,n.paragraphId,"[data-start]")){let o=r,i=fO(o,n.paragraphId);if(i===null||t.some(l=>l.contains(o)))continue;let a=pO(o,i,n.modelText,n.seq);n.seq+=1;let s=`${a.start}:${a.end}`;n.ranges.has(s)||(n.ranges.add(s),n.pieces.push(a));}}function tB(e,t){let n=[...e].sort((i,a)=>i.start-a.start||i.seq-a.seq),r="",o=0;for(let i of n)i.start>o&&(r+=t.slice(o,i.start)),r+=i.text,o=Math.max(o,i.end);return o<t.length&&(r+=t.slice(o)),r}function gO(e,t,n,r){let o=J5(e,t,r,Y5(r)),i={paragraphId:t,modelText:n,pieces:[],ranges:new Set,end:0,seq:0};for(let a of o)mO(a,i);return eB(e,o,i),i.pieces.length===0?null:tB(i.pieces,n)}function zh(e){if(!(e.metaKey||e.ctrlKey))return null;let t=e.key.toLowerCase();return t==="y"?"redo":t==="z"?e.shiftKey?"redo":"undo":null}var xO={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Home:"lineStart",End:"lineEnd"};function nB(e){return xO[e.key]||e.key==="PageUp"||e.key==="PageDown"?e.shiftKey:(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="a"}var hO={l:"left",e:"center",r:"right",j:"both"},yO={1:"240",5:"360",2:"480"},bO={b:{localName:"b"},i:{localName:"i"},u:{localName:"u",attributes:{val:"single"}}};function rB(e,t){return e.altKey?e.metaKey?true:e.ctrlKey?e.getModifierState?.("AltGraph")??false?e.key.toLowerCase()===t:true:false:false}function SO(e,t={}){return n=>{if(n.defaultPrevented)return;let r=e.editingMode()==="view"||n.currentTarget?.contentEditable==="false";if(n.key==="F5"&&n.shiftKey&&(n.ctrlKey||n.metaKey)&&!n.altKey&&!n.isComposing&&t.onRequestBookmark?.()){n.preventDefault();return}if(oh(n)&&t.onRequestGoTo?.()){n.preventDefault();return}if(n.key==="F9"&&n.altKey&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey&&!n.isComposing&&t.onToggleFieldCodes){n.preventDefault(),t.onToggleFieldCodes();return}if(!n.altKey&&!n.isComposing&&(n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.key==="8"||n.ctrlKey&&!n.metaKey&&n.shiftKey&&(n.code==="Digit8"||n.key==="*"))&&t.onToggleParagraphMarks){n.preventDefault(),t.onToggleParagraphMarks();return}if(r&&!nB(n))return;if(n.key==="Escape"&&e.formatPainter.state().mode!=="off"){e.formatPainter.disarm(),n.preventDefault();return}if(n.key==="Escape"&&e.activeScope().kind==="headerFooter"){e.exitHeaderFooter(),n.preventDefault();return}if(n.key==="Escape"&&e.activeScope().kind==="note"){e.exitNote(),n.preventDefault();return}let o=xu(n);if(rB(n,o)&&!n.shiftKey){let l=o;if(l==="f"){n.preventDefault(),e.insertNote("footnote");return}if(l==="d"){n.preventDefault(),e.insertNote("endnote");return}if(l==="c"){n.preventDefault(),e.formatPainter.capture();return}if(l==="v"){n.preventDefault(),e.formatPainter.apply();return}}let i=n.metaKey||n.ctrlKey,a=xO[n.key];if(a){let l=a;n.key==="Home"||n.key==="End"?i&&(l=n.key==="Home"?"documentStart":"documentEnd"):(n.key==="ArrowLeft"||n.key==="ArrowRight")&&(n.altKey||n.ctrlKey)?l=n.key==="ArrowLeft"?"wordLeft":"wordRight":n.metaKey&&(n.key==="ArrowLeft"||n.key==="ArrowRight")?l=n.key==="ArrowLeft"?"lineStart":"lineEnd":i&&(n.key==="ArrowUp"||n.key==="ArrowDown")&&(l=n.key==="ArrowUp"?"documentStart":"documentEnd"),e.navigate(l,n.shiftKey),n.preventDefault();return}if(n.key==="PageUp"||n.key==="PageDown"){e.navigate(i?n.key==="PageUp"?"documentStart":"documentEnd":n.key==="PageUp"?"pageUp":"pageDown",n.shiftKey),n.preventDefault();return}if(n.key==="Backspace"){i||n.altKey?e.deleteWordBackward():e.deleteBackward(),n.preventDefault();return}if(n.key==="Delete"){i||n.altKey?e.deleteWordForward():e.deleteForward(),n.preventDefault();return}if(n.key==="Tab"){if(e.contentControls.formFill()&&e.contentControls.navigate(n.shiftKey?"previous":"next")){n.preventDefault();return}let l=n.shiftKey?"decrease":"increase";e.isListParagraph()?e.adjustIndent(l):e.indentWithTab(l)||(n.shiftKey?e.adjustIndent("decrease"):e.insertTab()),n.preventDefault();return}if(n.key==="Enter"){i?e.insertPageBreak():n.shiftKey?e.insertLineBreak():e.exitListOnEmptyItem()||e.splitParagraph(),n.preventDefault();return}if(i&&n.key.toLowerCase()==="a"){e.selectAll(),n.preventDefault();return}if(i&&n.shiftKey&&n.key.toLowerCase()==="v"){e.armForcePlainPaste();return}if(i&&!n.shiftKey&&n.key.toLowerCase()==="k"&&t.onRequestHyperlink){t.onRequestHyperlink(),n.preventDefault();return}if(i&&!n.shiftKey&&bO[n.key.toLowerCase()]){let l=bO[n.key.toLowerCase()];e.toggleRunProperty(l.localName,l.attributes),n.preventDefault();return}if(i&&(n.key==="="||n.key==="+"||n.code==="Equal")){e.toggleRunProperty("vertAlign",{val:n.shiftKey?"superscript":"subscript"}),n.preventDefault();return}if(i&&n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("decrease"),n.preventDefault();return}if(i&&!n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("increase"),n.preventDefault();return}if(i&&!n.shiftKey&&hO[n.key.toLowerCase()]){if(n.metaKey&&n.key.toLowerCase()==="r")return;e.setParagraphProperties([{localName:"jc",attributes:{val:hO[n.key.toLowerCase()]},physicalAlignment:true}]),n.preventDefault();return}if(i&&!n.shiftKey&&yO[n.key]){e.setParagraphProperty("spacing",{line:yO[n.key],lineRule:"auto"},{mergeAttributes:true}),n.preventDefault();return}let s=zh(n);s&&(s==="redo"?e.redo():e.undo(),n.preventDefault());}}function wO(e){let t=i=>{let a=e.copyFlavours();return a.reason?(i.preventDefault(),false):!a.text||!i.clipboardData?false:(i.clipboardData?.setData("text/plain",a.text),a.html&&i.clipboardData?.setData("text/html",a.html),true)};return {onCopy:i=>{t(i)&&i.preventDefault();},onCut:i=>{if(e.editingMode()==="view"){i.preventDefault();return}t(i)&&(e.deleteSelection(),i.preventDefault());},onPaste:i=>{let a=$m(i.clipboardData),s=i.clipboardData?.getData("text/html")??"";i.preventDefault(),!(!a&&!s)&&e.pasteRich(a,s.length>0?s:null);}}}function vO(e){let t=$m(e.dataTransfer);return t.length>0?t:null}function kO(e,t){return n=>{if(n.preventDefault(),!t.isComposing()){if(n.inputType==="insertText"&&n.data!=null){e.enqueueType(n.data);return}if(n.inputType!=="insertFromPaste"){if(n.inputType==="insertReplacementText"){let r=n.data??vO(n);if(!r)return;sB(e,iB(n),r),t.onBrowserSelectionFixup?.();return}if(n.inputType==="deleteContentBackward"){e.deleteBackward();return}if(n.inputType==="deleteWordBackward"){e.deleteWordBackward();return}if(n.inputType==="deleteContentForward"){e.deleteForward();return}if(n.inputType==="deleteWordForward"){e.deleteWordForward();return}if(n.inputType==="insertLineBreak"){e.insertLineBreak();return}if(n.inputType==="insertFromDrop"||n.inputType==="insertFromPasteAsQuotation"){let r=vO(n);r&&t.insertPlainText(r);return}n.inputType==="insertParagraph"&&e.splitParagraph();}}}}function oB(e){let{startContainer:t,endContainer:n}=e;if(t===n&&t.nodeType===Node.TEXT_NODE)return (t.textContent??"").slice(e.startOffset,e.endOffset);let r=t.ownerDocument;if(!r)return null;try{let o=r.createRange();return o.setStart(t,e.startOffset),o.setEnd(n,e.endOffset),o.toString()}catch{return null}}function iB(e){if(typeof e.getTargetRanges!="function")return null;let t=e.getTargetRanges();if(t.length!==1)return null;let n=t[0],r=oB(n);return r?{text:r,paragraphId:aB(n)}:null}function aB(e){let t=e.startContainer;return t.isConnected?(t.nodeType===Node.ELEMENT_NODE?t:t.parentElement??null)?.closest("[data-paragraph-id]")?.getAttribute("data-paragraph-id")??null:null}function sB(e,t,n){if(t!==null){e.flushPendingInput();let r=e.state(),o=r.selection.head,i=t.text;if(Lt(r.selection,Ve(o))&&o.offset>=i.length&&(t.paragraphId===null||t.paragraphId===o.paragraphId)&&r.pendingFormat===null){let a=Ee(e.session,o.paragraphId)??e.session.part(),s=chunkZOZI27AW_cjs.Tk(a,o.paragraphId);s!==null&&s.slice(o.offset-i.length,o.offset)===i&&e.setSelection({anchor:{paragraphId:o.paragraphId,offset:o.offset-i.length},head:o});}}e.type(n);}function IO(e,t,n,r=null){for(let o of Yu(e)){let i=gO(o,t,n,r);if(i!==null)return i}return null}function RO(e,t,n){if(n===t)return null;let r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r+=1;let o=0;for(;o<n.length-r&&o<t.length-r&&n[n.length-1-o]===t[t.length-1-o];)o+=1;let i=n.slice(r,n.length-o),a=[];return t.length-o>r&&a.push({op:"deleteText",paragraphId:e,start:r,end:t.length-o}),i.length>0&&a.push({op:"insertText",paragraphId:e,offset:r,text:i}),a.length===0?null:{ops:a,caret:r+i.length}}var lB="equation replacement is not supported in suggesting mode",cB="in suggesting mode, remove the whole equation block rather than one equation",PO=new WeakMap,TO=new WeakSet;function Gh(e,t){let n=chunkZOZI27AW_cjs.Xa(e,t);if(!n||n.kind!=="paragraph")return [];let r=PO.get(n);if(r)return r;let o=[];for(let a of chunkZOZI27AW_cjs.pg(n))for(let s of chunkZOZI27AW_cjs.ff(a.node)){let l=chunkZOZI27AW_cjs.$e(s);if(!l)continue;let c=Object.freeze({id:s.id,paragraphId:t,start:a.start,end:a.end,linear:chunkZOZI27AW_cjs.bf(l.expression),fallbackText:l.fallbackText,supported:Vn(l.expression)});Kn(l.expression)&&TO.add(c),o.push(c);}let i=Object.freeze(o);return PO.set(n,i),i}function EO(e,t,n){let r=Gh(e,t).filter(o=>o.start===n);return r.length===0?null:r.map(o=>o.linear||o.fallbackText).join(" ")}function CO(e){return "controlProperties"in e&&e.controlProperties===true}function Kn(e){if(CO(e))return true;switch(e.kind){case "bar":return true;case "text":return e.format!==void 0;case "fallback":return false;case "row":return e.items.some(Kn);case "fraction":return Kn(e.numerator)||Kn(e.denominator);case "radical":return Kn(e.radicand)||e.degree!==void 0&&Kn(e.degree);case "script":return Kn(e.base)||e.subscript!==void 0&&Kn(e.subscript)||e.superscript!==void 0&&Kn(e.superscript);case "nary":return Kn(e.body)||e.lowerLimit!==void 0&&Kn(e.lowerLimit)||e.upperLimit!==void 0&&Kn(e.upperLimit)}}function Vn(e){if(CO(e))return false;switch(e.kind){case "fallback":case "bar":return false;case "text":return e.format===void 0;case "row":return e.items.every(Vn);case "fraction":return Vn(e.numerator)&&Vn(e.denominator);case "radical":return Vn(e.radicand)&&(e.degree===void 0||Vn(e.degree));case "script":return Vn(e.base)&&(e.subscript===void 0||Vn(e.subscript))&&(e.superscript===void 0||Vn(e.superscript));case "nary":return Vn(e.body)&&(e.lowerLimit===void 0||Vn(e.lowerLimit))&&(e.upperLimit===void 0||Vn(e.upperLimit))}}function OO(e,t){return e.find(n=>n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)??null}function MO(e){let t=null,n=a=>{if(chunkZGTIE3QJ_cjs.b(a)||!e.pagesLayer.ownerDocument.defaultView||!_t(a))return null;let l=a.closest("[data-docx-equation]");return l&&e.pagesLayer.contains(l)?l:null},r=(a,s)=>{let l=e.equationById(a);l&&(e.pagesLayer.contentEditable!=="false"&&e.setSelection({anchor:{paragraphId:l.paragraphId,offset:l.start},head:{paragraphId:l.paragraphId,offset:l.end}}),e.onPopover?.({equation:l,rect:s}));},o=a=>{t=null;let s=n(a.target),l=s?.dataset.docxEquation;if(!s||!l)return;let c=s.getBoundingClientRect();t={equationId:l,rect:{left:c.left,top:c.top,right:c.right,bottom:c.bottom}};},i=a=>{let s=n(a.target),l=s?.dataset.docxEquation,c=t;if(t=null,!s||!l){if(!c)return;a.preventDefault(),r(c.equationId,c.rect);return}let d=s.getBoundingClientRect();a.preventDefault(),r(l,{left:d.left,top:d.top,right:d.right,bottom:d.bottom});};return e.pagesLayer.addEventListener("pointerdown",o,true),e.pagesLayer.addEventListener("click",i),{destroy:()=>{e.pagesLayer.removeEventListener("pointerdown",o,true),e.pagesLayer.removeEventListener("click",i);}}}function AO(e){let t=()=>e.session.partFor(e.storyScope()),n=c=>{let d=t();return d?Gh(d,c):[]},r=()=>{let c=e.selection().head;return OO(n(c.paragraphId),c)},o=c=>{let d=n(e.selection().head.paragraphId).find(u=>u.id===c);if(d)return d;for(let u of e.session.storyParts()){let f=chunkZOZI27AW_cjs.Xa(u,c);if(!f||f.kind!=="generic"||f.namespaceUri!==chunkZOZI27AW_cjs.Ze||f.localName!=="oMath")continue;let p=f;for(;p&&p.kind!=="paragraph";)p=chunkZOZI27AW_cjs.Ya(u,p.id);return !p||p.kind!=="paragraph"?null:Gh(u,p.id).find(g=>g.id===c)??null}return null},i=c=>e.editingMode()==="suggest"?e.trackedOps([{op:"deleteText",paragraphId:c.paragraphId,start:c.start,end:c.end}]):[{op:"removeMathEquation",equationId:c.id}],a=(c,d)=>{let u=false,f={paragraphId:c.paragraphId,offset:c.start};return e.commit(()=>{let p=e.session.applyTreeOps([...d],e.selectionMark(),{paragraphId:f.paragraphId,start:f.offset,end:f.offset},e.storyScope());return u=p.committed,p},()=>({anchor:f,head:f})),u},s=(c,d)=>{let u=o(c);if(!u)return {ok:false,code:"notFound",reason:"no equation with that id"};if(e.editingMode()==="suggest"){if(d==="replace")return {ok:false,code:"unsupported",reason:lB};if(n(u.paragraphId).filter(b=>b.start===u.start).length>1)return {ok:false,code:"unsupported",reason:cB}}if(d==="replace"&&TO.has(u))return {ok:false,code:"unsupported",reason:"compact linear editing cannot preserve this equation source formatting"};let[f]=d==="replace"?[{op:"setMathEquation",equationId:c,linear:u.linear}]:i(u),p=f?e.writeRefusal(f):null;return p===null?{ok:true}:{ok:false,code:"locked",reason:p}},l=c=>(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:c.reason})),false);return {equationsInCaretParagraph:()=>[...n(e.selection().head.paragraphId)],equationAtCaret:r,equationById:o,can:s,applyEquation(c,d){let u=o(c);if(!u)return false;let f=s(c,"replace");return f.ok?u.supported&&u.linear===d?true:a(u,[{op:"setMathEquation",equationId:c,linear:d}]):l(f)},removeEquation(c){let d=o(c);if(!d)return false;let u=s(c,"remove");return u.ok?a(d,i(d)):l(u)}}}function FO(e,t){for(let[n,r]of t){let o=chunkZOZI27AW_cjs.Xa(e,n);if(o&&o.kind!=="textValue"&&o.kind==="paragraph"&&r&&r.end>r.start){let i=chunkZOZI27AW_cjs.rg(o),a=[...o.children];for(;a.length;){let s=a.pop();if(s.kind!=="textValue"){if(chunk65XBN67F_cjs.D(s)){let l=i.spanOf(s);if(l?l.end>r.start&&l.start<r.end:r.start===0&&r.end===1/0)return true}for(let l of s.children)a.push(l);}}}}return false}function Ju(e){let t=chunkZOZI27AW_cjs.Je(e);if(!t.ok)return false;for(let n of t.package.parts.values())if(chunk65XBN67F_cjs.E([n.root]))return true;return false}function Ue(e){return e.kind!=="textValue"}function ge(e,t){if(!e||e.kind==="textValue")return null;for(let n of e.children)if(Ue(n)&&n.localName===t&&n.namespaceUri===chunkZOZI27AW_cjs.pa)return n;return null}function lt(e,t="val"){return e?chunkZOZI27AW_cjs.eg(e,t,chunkZOZI27AW_cjs.pa):void 0}function Un(e,t,n){return e?chunkZOZI27AW_cjs.eg(e,t,n):void 0}function Zh(e){if(e.kind==="textValue")return e.value;let t="";for(let n of e.children)t+=Zh(n);return t}function Wa(e,t,n){if(e.kind==="textValue")return null;if(e.localName===t&&e.namespaceUri===n)return e;for(let r of e.children){let o=Wa(r,t,n);if(o)return o}return null}function Bo(e){if(e===void 0||!/^-?\d+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function bn(e){return chunkZOZI27AW_cjs.sd(e)}function Xh(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}var Ar=Xh;function ef(e){return e===void 0||e.toLowerCase()==="auto"?null:/^[0-9A-Fa-f]{6}$/.test(e)?`#${e.toLowerCase()}`:null}function ur(e){return `${Math.round(e/20*100)/100}pt`}var dB="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",uB=chunkFDSL5OJU_cjs.Pb;function jl(e,t,n){for(let o of chunkZOZI27AW_cjs.Pe(e,e.mainDocumentPart)){if(o.type!==t||o.targetMode==="External")continue;let i=chunkZOZI27AW_cjs.E(o.ownerPart,o.rawTarget);if(i.ok){let a=e.parts.get(i.partName);if(a&&Ue(a.root))return a.root}}let r=e.parts.get(n);return r&&Ue(r.root)?r.root:null}function LO(e){let t=jl(e,dB,"/word/styles.xml"),n=new Map,r=null,o=null,i=null,a=null,s=null;if(!t)return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:i,defaultCharacterStyleId:a,defaultTableStyleId:s};let l=0,c=null;for(let d of t.children){if(!Ue(d)||d.namespaceUri!==chunkZOZI27AW_cjs.pa)continue;if(d.localName==="docDefaults"){c=d,r=ge(ge(d,"rPrDefault"),"rPr"),o=ge(ge(d,"pPrDefault"),"pPr");continue}if(d.localName!=="style")continue;if(l>=chunkFDSL5OJU_cjs.sd)break;l+=1;let u=chunkZOZI27AW_cjs.eg(d,"styleId",chunkZOZI27AW_cjs.pa);if(!u)continue;n.set(u,d);let f=chunkZOZI27AW_cjs.eg(d,"default",chunkZOZI27AW_cjs.pa),p=chunkZOZI27AW_cjs.eg(d,"type",chunkZOZI27AW_cjs.pa);f==="1"||f==="true"||f==="on"?p==="paragraph"?i=u:p==="character"?a=u:p==="table"&&(s=u):(i===u&&(i=null),a===u&&(a=null),s===u&&(s=null));}if(t.namespaceUri===chunkZOZI27AW_cjs.pa){let d=chunk65XBN67F_cjs.H(c);d.run&&(r=chunk65XBN67F_cjs.J("rPr","application")),d.paragraph&&(o=chunk65XBN67F_cjs.J("pPr","application"));}return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:i,defaultCharacterStyleId:a,defaultTableStyleId:s}}function co(e,t,n){let r=[],o=new Set,i=t;for(;i&&!o.has(i)&&r.length<uB;){o.add(i);let a=e.byId.get(i);if(!a)break;if(r.length===0&&n!==void 0){let s=chunkZOZI27AW_cjs.eg(a,"type",chunkZOZI27AW_cjs.pa);if(s!==void 0&&s!==n)return []}r.unshift(a),i=lt(ge(a,"basedOn"));}return r}function Yh(e,t,n){let r=[];if(e.docDefaultsPPr&&r.push(e.docDefaultsPPr),n)for(let i of n)r.push(i);let o=lt(ge(t,"pStyle"));for(let i of co(e,o??e.defaultParagraphStyleId??void 0,"paragraph")){let a=ge(i,"pPr");a&&r.push(a);}return t&&r.push(t),r}function tf(e,t,n,r){let o=[];e.docDefaultsRPr&&o.push(e.docDefaultsRPr);let i=[];if(r)for(let u of r)i.push(u);let a=[],s=lt(ge(t,"pStyle"));for(let u of co(e,s??e.defaultParagraphStyleId??void 0,"paragraph")){let f=ge(u,"rPr");f&&a.push(f);}let l=[],c=lt(ge(n,"rStyle"))??e.defaultCharacterStyleId??void 0;for(let u of co(e,c,"character")){let f=ge(u,"rPr");f&&l.push(f);}let d=[...o,...i,...a,...l];return n&&d.push(n),{all:d,defaults:o,tableLevel:i,paragraphLevel:a,characterLevel:l,direct:n}}function zn(e,t){let n=null;for(let r of e){let o=ge(r,t);o&&(n=o);}return n}function Dt(e,t,n){let r;for(let o of e){let i=ge(o,t);if(!i)continue;let a=chunkZOZI27AW_cjs.eg(i,n,chunkZOZI27AW_cjs.pa);a!==void 0&&(r=a);}return r}function nf(e){return !(e==="0"||e==="false"||e==="off")}function Fr(e,t){let n=false;for(let r of e){let o=ge(r,t);o&&(n=nf(lt(o)));}return n}function $o(e,t){let n;for(let r of e){let o=ge(r,t);o&&(n=nf(lt(o)));}return n}function fr(e,t){let n=e.direct?ge(e.direct,t):null;if(n)return nf(lt(n));let r=$o(e.tableLevel,t),o=$o(e.paragraphLevel,t),i=$o(e.characterLevel,t);return i===false||i===void 0&&o===false||i===void 0&&o===void 0&&r===false?false:$o(e.defaults,t)===true?true:r===true!=(o===true)!=(i===true)}function Qh(e,t){let n=e.direct?ge(e.direct,t):null;if(n)return nf(lt(n));let r=$o(e.characterLevel,t);if(r!==void 0)return r;let o=$o(e.paragraphLevel,t);if(o!==void 0)return o;let i=$o(e.tableLevel,t);return i!==void 0?i:$o(e.defaults,t)===true}function DO(e){return e.isLgl?"decimal":e.numFmt}function NO(e){let t=chunkFDSL5OJU_cjs.vc(e),n=new Map,r=new Map,o=new Map,i=new Map,a=new Map,s=new Map;for(let[l,c]of t.abstractNums){c.numStyleLink!==void 0&&s.set(l,c.numStyleLink);let d=new Map,u=new Map;for(let[f,p]of c.levels)d.set(String(f),DO(p)),u.set(String(f),p.start);r.set(l,d),o.set(l,u);}for(let[l,c]of t.nums){n.set(l,c.abstractNumId);for(let[d,u]of c.overrides){let f=`${l}:${d}`,p=u.startOverride??u.level?.start;p!==void 0&&i.set(f,p),u.level!==void 0&&a.set(f,DO(u.level));}}return {numToAbstract:n,levelFormats:r,levelStarts:o,startOverrides:i,formatOverrides:a,styleLinks:s}}function HO(e,t){return e===null?null:chunkZOZI27AW_cjs.sd(chunkZOZI27AW_cjs.eg(e,t,chunkZOZI27AW_cjs.pa))}function BO(e,t){if(e===null)return null;let n=chunkZOZI27AW_cjs.eg(e,t,chunkZOZI27AW_cjs.pa);return n!==void 0&&/^[0-9A-Fa-f]{6}$/.test(n)?`#${n.toLowerCase()}`:null}function _O(e){return `${Math.round(e/20*100)/100}pt`}var fB=["wholeTable","firstRow","lastRow","firstCol","lastCol","band1Horz","band2Horz","band1Vert","band2Vert","nwCell","neCell","swCell","seCell"];function ja(e,t,n){if(e===null)return null;let r=chunkZOZI27AW_cjs.eg(e,t,chunkZOZI27AW_cjs.pa);if(r!==void 0)return !(r==="0"||r==="false"||r==="off");let o=chunkZOZI27AW_cjs.eg(e,"val",chunkZOZI27AW_cjs.pa);return o===void 0||!/^[0-9A-Fa-f]{1,4}$/.test(o)?null:(Number.parseInt(o,16)&n)!==0}function Jh(e,t){let n=new Map,r=new Set(fB);for(let o of e)for(let i of o.children){if(i.kind==="textValue"||i.localName!=="tblStylePr"||i.namespaceUri!==chunkZOZI27AW_cjs.pa)continue;let a=chunkZOZI27AW_cjs.eg(i,"type",chunkZOZI27AW_cjs.pa);a===void 0||!r.has(a)||n.set(a,{fill:BO(ge(ge(i,"tcPr"),"shd"),"fill"),rPr:ge(i,"rPr"),pPr:ge(i,"pPr")});}return {byType:n,firstRowEnabled:ja(t,"firstRow",32)??false,lastRowEnabled:ja(t,"lastRow",64)??false,firstColumnEnabled:ja(t,"firstColumn",128)??false,lastColumnEnabled:ja(t,"lastColumn",256)??false,hBandingEnabled:!(ja(t,"noHBand",512)??false),vBandingEnabled:!(ja(t,"noVBand",1024)??false)}}function ey(e,t,n,r,o,i){let a=e.firstRowEnabled&&t===0,s=e.lastRowEnabled&&t===n-1,l=e.firstColumnEnabled&&r,c=e.lastColumnEnabled&&o,d=u=>e.byType.get(u)??null;if(s&&l&&d("swCell"))return d("swCell");if(s&&c&&d("seCell"))return d("seCell");if(a&&l&&d("nwCell"))return d("nwCell");if(a&&c&&d("neCell"))return d("neCell");if(s&&d("lastRow"))return d("lastRow");if(a&&d("firstRow"))return d("firstRow");if(c&&d("lastCol"))return d("lastCol");if(l&&d("firstCol"))return d("firstCol");if(e.hBandingEnabled){let u=t-(e.firstRowEnabled?1:0);if(u>=0){let f=d(u%2===0?"band1Horz":"band2Horz");if(f)return f}}if(e.vBandingEnabled){let u=i-(e.firstColumnEnabled?1:0);if(u>=0){let f=d(u%2===0?"band1Vert":"band2Vert");if(f)return f}}return null}function $O(e,t,n,r,o,i,a,s,l=false,c=[]){let d=[],u=ge(e,"tcBorders"),f={top:n===0?"top":"insideH",bottom:n+o>=r?"bottom":"insideH",left:i?"left":"insideV",right:a?"right":"insideV"};for(let S of ["top","left","bottom","right"]){let I=S==="left"?"start":S==="right"?"end":S,C=ge(u,S)??ge(u,I),P=f[S],E=P==="left"?"start":P==="right"?"end":P,R=C!==null?yi(C):yi(ge(t,P)??ge(t,E));R&&d.push(`border-${ar(S,l)}:${R}`);}let p=BO(ge(e,"shd"),"fill")??s;p&&d.push(`background-color:${p}`);let g=ge(e,"vAlign"),b=g===null?void 0:chunkZOZI27AW_cjs.eg(g,"val",chunkZOZI27AW_cjs.pa);b==="center"?d.push("vertical-align:middle"):(b==="bottom"||b==="top")&&d.push(`vertical-align:${b}`);let h=ge(e,"tcW"),y=HO(h,"w"),x=h===null?void 0:chunkZOZI27AW_cjs.eg(h,"type",chunkZOZI27AW_cjs.pa);y!==null&&y>0&&(x===void 0||x==="dxa")&&d.push(`width:${_O(y)}`);let v=ge(e,"tcMar");for(let S of ["top","right","bottom","left"]){let I=S==="left"?"start":S==="right"?"end":S,C=ge(v,S)??ge(v,I)??c.map(R=>ge(R,S)??ge(R,I)).find(R=>R!==null)??null,P=HO(C,"w"),E=C===null?void 0:chunkZOZI27AW_cjs.eg(C,"type",chunkZOZI27AW_cjs.pa);P!==null&&P>=0&&(E===void 0||E==="dxa")&&d.push(`padding-${ar(S,l)}:${_O(P)}`);}return d.join(";")}function pB(e){return e.kind==="tableCell"?true:e.localName==="tc"&&e.namespaceUri===chunkZOZI27AW_cjs.pa}function qO(e){return e.localName==="customXml"&&e.namespaceUri===chunkZOZI27AW_cjs.pa}function WO(e){let t=[],n=[],r=o=>{for(let i of o)if(Ue(i)){if(i.kind==="tableRow"||i.localName==="tr"&&i.namespaceUri===chunkZOZI27AW_cjs.pa){n.push({row:t.length}),t.push(i);continue}if(i.kind==="contentControl"){let a=i.children.find(s=>s.kind==="contentControlContent");a&&Ue(a)&&r(a.children);continue}if(qO(i)){r(i.children);continue}n.push({skip:i});}};return r(e.children),{rows:t,tableItems:n}}function jO(e){let t=[],n=[],r=new Set;for(let o of e){let i=new Set,a=[],s=[],l=0,c=d=>{for(let u of d)if(Ue(u)){if(pB(u)){let f=ge(u,"tcPr"),p=Math.min(Math.max(Bo(lt(ge(f,"gridSpan")))??1,1),63),g=ge(f,"vMerge"),b=g===null?null:lt(g)==="restart"?"restart":"continue",h=b==="continue"&&!r.has(l)?"restart":b;b!==null&&i.add(l);let y={cell:u,startColumn:l,span:p,vMerge:h};a.push(y),s.push({placement:y}),l+=p;continue}if(u.kind==="contentControl"){let f=u.children.find(p=>p.kind==="contentControlContent");f&&Ue(f)&&c(f.children);continue}if(qO(u)){c(u.children);continue}s.push({skip:u});}};c(o.children),r=i,t.push(a),n.push(s);}return {placements:t,items:n}}function KO(e){let t=1;for(let n of e)for(let r of n)t=Math.max(t,r.startColumn+r.span);return t}function VO(e,t,n,r){let o=new Map,i=t.byType.get("wholeTable")??null;for(let a=0;a<n.length;a+=1)for(let s of n[a]??[]){if(s.vMerge==="continue")continue;let l=ey(t,a,n.length,s.startColumn===0,s.startColumn+s.span>=r,s.startColumn),c=[],d=[];i?.rPr&&c.push(i.rPr),i?.pPr&&d.push(i.pPr),l?.rPr&&c.push(l.rPr),l?.pPr&&d.push(l.pPr),o.set(s.cell,c.length>0||d.length>0?{...e,tableRPr:c,tablePPr:d}:e);}return o}function UO(e,t){let n=co(e.styles,lt(ge(t,"tblStyle")),"table");return n.length>0?n:co(e.styles,e.styles.defaultTableStyleId??void 0,"table")}function zO(e,t){let n=t.children.find(l=>l.kind==="tableProperties"),r=n&&Ue(n)?n:null,o=UO(e,r),i=Jh(o,ge(r,"tblLook")),{rows:a}=WO(t),{placements:s}=jO(a);return VO(e,i,s,KO(s))}function GO(e,t,n,r){let o=t.children.find(R=>R.kind==="tableProperties"),i=o&&Ue(o)?o:null,a=null,s=UO(e,i);for(let R of s){let w=ge(ge(R,"tblPr"),"tblBorders");w&&(a=w);}let l=s.map(R=>ge(R,"tblPr")).filter(R=>R!==null);i&&l.push(i);let c=Fr(l,"bidiVisual"),d=[],u;for(let R of l){let w=ge(R,"tblCellMar");w&&d.unshift(w),u=lt(ge(R,"jc"))??u;}let f=ge(i,"tblBorders");f&&(a=f);let p=Jh(s,ge(i,"tblLook")),{rows:g,tableItems:b}=WO(t),{placements:h,items:y}=jO(g),x=KO(h),v=VO(e,p,h,x),S=["border-collapse:collapse"],I=ge(i,"tblW"),C=bn(Un(I,"w",chunkZOZI27AW_cjs.pa));C!==null&&C>0&&Un(I,"type",chunkZOZI27AW_cjs.pa)==="dxa"&&S.push(`width:${ur(C)}`);let P=ar(u==="right"||u==="end"?"right":u==="center"?"center":"left",c);P==="center"?S.push("margin-left:auto","margin-right:auto"):P==="right"?S.push("margin-left:auto","margin-right:0"):S.push("margin-left:0","margin-right:auto");for(let[R,w]of [["insideH","insideh"],["insideV","insidev"]]){let M=yi(ge(a,R));M&&S.push(`mso-border-${w}-alt:${M}`);}let E=`<table dir="${c?"rtl":"ltr"}" align="${P}" style="${S.join(";")}">`;for(let R of b){if("skip"in R){r.advanceFieldState(R.skip,n);continue}let w=R.row,M=ge(ge(g[w]??null,"trPr"),"trHeight"),O=bn(Un(M,"val",chunkZOZI27AW_cjs.pa)),B=_w(O,Un(M,"hRule",chunkZOZI27AW_cjs.pa)),q=B===""?"":` style="${B}"`;E+=`<tr${q}>`;for(let j of y[w]??[]){if("skip"in j){r.advanceFieldState(j.skip,n);continue}let z=j.placement;if(z.vMerge==="continue"){r.advanceFieldState(z.cell,n);continue}let _=1;if(z.vMerge==="restart")for(let W=w+1;W<h.length&&h[W].find(K=>K.startColumn===z.startColumn&&K.vMerge==="continue");W+=1)_+=1;let L=ge(z.cell,"tcPr"),X=z.startColumn+z.span>=x,te=ey(p,w,h.length,z.startColumn===0,X,z.startColumn),me=p.byType.get("wholeTable")??null,se=$O(L,a,w,h.length,_,z.startColumn===0,X,te?.fill??me?.fill??null,c,d),D=(z.span>1?` colspan="${z.span}"`:"")+(_>1?` rowspan="${_}"`:"")+(se===""?"":` style="${Ar(se)}"`),T=v.get(z.cell)??e;E+=`<td dir="ltr"${D}>${r.renderBlocks(T,z.cell.children,n)}</td>`;}E+="</tr>";}return `${E}</table>`}function rf(e){if(e===void 0||!/^\d{1,10}$/.test(e))return null;let t=Number.parseInt(e,10);return t>=1&&t<=2147483647?t:null}function ty(e){let t=chunkZOZI27AW_cjs.eg(e,"type",chunkZOZI27AW_cjs.pa);return t==="separator"||t==="continuationSeparator"}function ny(e,t){let n=new Set;if(e===null)return n;for(let r of e.children){if(!Ue(r)||r.namespaceUri!==chunkZOZI27AW_cjs.pa||r.localName!==t||ty(r))continue;let o=rf(chunkZOZI27AW_cjs.eg(r,"id",chunkZOZI27AW_cjs.pa));o!==null&&n.add(o);}return n}function Kl(e,t,n,r,o,i,a){for(let s of t.children)if(Ue(s)&&s.kind!=="drawing"){if(s.kind==="revisionDelete"||s.kind==="revisionMoveFrom"){r.inert||o(s,r);continue}if(s.kind==="table"){Kl(e,s,n,r,o,i,zO(e,s));continue}if(s.kind==="tableCell"||s.namespaceUri===chunkZOZI27AW_cjs.pa&&s.localName==="tc"){let l=a?.get(s);if(l===void 0){r.inert||o(s,r);continue}Kl(l,s,n,r,o,i,a);continue}if(s.kind==="paragraph"){let l=s.children.find(c=>c.kind==="paragraphProperties");Kl(e,s,n,r,o,l&&Ue(l)?l:null,a);continue}if(s.kind==="run"){if(s.children.some(d=>d.kind==="fldChar")){r.inert||o(s,r);continue}if(s.children.some(d=>d.kind==="instrText")||!r.inert&&r.stack.some(d=>d==="instr"))continue;let l=s.children.find(d=>d.kind==="runProperties"),c=tf(e.styles,i,l&&Ue(l)?l:null,e.tableRPr);if(fr(c,"vanish"))continue}if(s.namespaceUri===chunkZOZI27AW_cjs.pa&&(s.localName==="footnoteReference"||s.localName==="endnoteReference")){let l=rf(chunkZOZI27AW_cjs.eg(s,"id",chunkZOZI27AW_cjs.pa));l!==null&&n.push({kind:s.localName==="footnoteReference"?"footnote":"endnote",id:l});continue}Kl(e,s,n,r,o,i,a);}}function mB(e,t,n){if(e===null)return null;for(let r of e.children)if(!(!Ue(r)||r.namespaceUri!==chunkZOZI27AW_cjs.pa)&&!(r.localName!==t||ty(r))&&rf(chunkZOZI27AW_cjs.eg(r,"id",chunkZOZI27AW_cjs.pa))===n)return r;return null}function ZO(e,t,n){let r={footnote:new Set(e.noteOrdinals.footnote.keys()),endnote:new Set(e.noteOrdinals.endnote.keys())},o=[];for(let i of ["footnote","endnote"])for(let a of r[i])o.push({kind:i,id:a});for(;o.length>0;){let i=o.pop(),a=mB(t[i.kind],i.kind,i.id);if(a===null)continue;let s={stack:[],inert:false};n(a,s);let l={stack:[],inert:s.stack.length>0},c=[];Kl(e,a,c,l,n,null);for(let d of c)e.availableNotes[d.kind].has(d.id)&&(r[d.kind].has(d.id)||(r[d.kind].add(d.id),o.push(d)));}return r}function ry(e,t,n,r,o){if(n===null)return "";let i=`/word/${t}s.xml`;for(let[l,c]of e.pkg.parts)c.root===n&&(i=l);let a=chunkZOZI27AW_cjs.Pe(e.pkg,i),s="";for(let l of n.children){if(!Ue(l)||l.namespaceUri!==chunkZOZI27AW_cjs.pa||l.localName!==t||ty(l))continue;let c=chunkZOZI27AW_cjs.eg(l,"id",chunkZOZI27AW_cjs.pa),d=rf(c);if(c===void 0||d===null||!r.has(d))continue;let u=o({...e,noteBody:{kind:t,id:d},docRels:a},l.children);s+=`<div style="mso-element:${t}" id="${t==="footnote"?"ftn":"edn"}${d}">${u===""?"<p></p>":u}</div>`;}return s===""?"":`<div style="mso-element:${t}-list">${s}</div>`}function XO(e){if(!e)return null;let t=[];for(let n of e.children){if(!Ue(n)||n.localName!=="tab")continue;let r=lt(n),o=bn(chunkZOZI27AW_cjs.eg(n,"pos",chunkZOZI27AW_cjs.pa));if(o===null||o<0||r!=="left"&&r!=="center"&&r!=="right"&&r!=="decimal"&&r!=="bar")continue;let i=lt(n,"leader"),a=i==="dot"?"dotted":i==="hyphen"?"dashed":i==="underscore"?"lined":i==="middleDot"?"middledot":i==="heavy"?"heavy":"";t.push(`${r}${a?` ${a}`:""} ${ur(o)}`);}return t.length>0?`tab-stops:${t.join(" ")}`:null}var oy="http://schemas.openxmlformats.org/officeDocument/2006/relationships",gB=`${oy}/numbering`,hB=`${oy}/footnotes`,yB=`${oy}/endnotes`,bB=2*1024*1024,vB=8*1024*1024,YO=9525,xB=new Map([["image/png","image/png"],["image/jpeg","image/jpeg"],["image/jpg","image/jpeg"],["image/gif","image/gif"],["image/bmp","image/bmp"],["image/x-ms-bmp","image/bmp"],["image/x-bmp","image/bmp"],["image/webp","image/webp"],["image/svg+xml","image/svg+xml"],["image/tiff","image/tiff"],["image/x-emf","image/x-emf"],["image/x-wmf","image/x-wmf"]]);function of(e,t,n,r){let o=e.direct!==null&&ge(e.direct,r)!==null||zn(e.defaults,r)!==null||zn(e.tableLevel,r)!==null||zn(e.paragraphLevel,r)!==null||zn(e.characterLevel,r)!==null;return fr(e,t&&o?r:n)}function SB(e){let t=e.all;if(fr(e,"vanish"))return {css:"",vanish:true,vertAlign:null,lang:null,rtl:false};let n=[],r=Fr(t,"rtl"),o=(r?Dt(t,"rFonts","cs"):void 0)??Dt(t,"rFonts","ascii")??Dt(t,"rFonts","hAnsi")??Dt(t,"rFonts","eastAsia")??(r?void 0:Dt(t,"rFonts","cs"));if(o!==void 0){let S=Dw(o);S&&n.push(`font-family:${S}`);}let i=Bo((r?Dt(t,"szCs","val"):void 0)??Dt(t,"sz","val")??(r?void 0:Dt(t,"szCs","val")));i!==null&&i>0&&n.push(`font-size:${Math.round(i/2*100)/100}pt`);let a={...e,direct:null},s=e.direct?t.slice(0,-1):t;of(e,r,"b","bCs")?n.push("font-weight:bold"):of(a,r,"b","bCs")&&n.push("font-weight:normal"),of(e,r,"i","iCs")?n.push("font-style:italic"):of(a,r,"i","iCs")&&n.push("font-style:normal");let l=[],c=zn(t,"u"),d=c!==null&&lt(c)!=="none";d&&l.push("underline");let u=Qh(e,"dstrike");if((fr(e,"strike")||u)&&l.push("line-through"),l.length>0)n.push(`text-decoration:${l.join(" ")}`);else {let S=zn(s,"u");(S!==null&&lt(S)!=="none"||fr(a,"strike")||Qh(a,"dstrike"))&&n.push("text-decoration:none");}d&&n.push(...Hw(c)),u&&!d&&n.push("text-decoration-style:double");let f=ef(Dt(t,"color","val"));f&&n.push(`color:${f}`);let p=bn(Dt(t,"spacing","val"));p!==null&&n.push(`letter-spacing:${Math.round(p/20*100)/100}pt`);let g=lt(zn(t,"highlight")),b=g!==void 0&&Object.hasOwn(gm,g)?gm[g]:void 0,h=ef(Dt(t,"shd","fill"));b?n.push(`background-color:${b}`,`mso-highlight:${g}`):h&&n.push(`background-color:${h}`),fr(e,"caps")?n.push("text-transform:uppercase"):fr(a,"caps")&&n.push("text-transform:none"),fr(e,"smallCaps")?n.push("font-variant:small-caps"):fr(a,"smallCaps")&&n.push("font-variant:normal");let y=lt(zn(t,"vertAlign")),x=y==="superscript"||y==="subscript"?y:null,v=hi((r?Dt(t,"lang","bidi"):void 0)??Dt(t,"lang","val")??Dt(t,"lang","bidi")??Dt(t,"lang","eastAsia"));return {css:n.join(";"),vanish:false,vertAlign:x,lang:v,rtl:r}}function wB(e,t,n=false){let r=[],o=lt(zn(e,"jc")),i=o!==void 0&&Object.hasOwn(hm,o)?hm[o]:void 0;i&&r.push(`text-align:${n&&i!=="center"&&i!=="justify"?i==="left"?"right":"left":i}`);let a=bn(Dt(e,"spacing","before"));a!==null&&a>=0&&r.push(`margin-top:${ur(a)}`);let s=bn(Dt(e,"spacing","after"));s!==null&&s>=0&&r.push(`margin-bottom:${ur(s)}`);let l=bn(Dt(e,"spacing","line")),c=Dt(e,"spacing","lineRule");r.push(...Nw(l,c));let d=null,u=null,f=null,p=null;for(let y of e){let x=ge(y,"ind");if(!x)continue;let v=bn(Un(x,"left",chunkZOZI27AW_cjs.pa)??Un(x,"start",chunkZOZI27AW_cjs.pa));v!==null&&(d=v);let S=bn(Un(x,"right",chunkZOZI27AW_cjs.pa)??Un(x,"end",chunkZOZI27AW_cjs.pa));S!==null&&(u=S);let I=bn(Un(x,"hanging",chunkZOZI27AW_cjs.pa)),C=bn(Un(x,"firstLine",chunkZOZI27AW_cjs.pa));I!==null?(f=I,p=null):C!==null&&(p=C,f=null);}!t&&d!==null&&r.push(`margin-${n?"right":"left"}:${ur(d)}`),u!==null&&r.push(`margin-${n?"left":"right"}:${ur(u)}`),f!==null&&f!==0?r.push(`text-indent:${ur(-f)}`):p!==null&&p!==0&&r.push(`text-indent:${ur(p)}`);let g=XO(zn(e,"tabs"));g&&r.push(g),Fr(e,"pageBreakBefore")&&r.push("page-break-before:always"),Fr(e,"keepNext")&&r.push("page-break-after:avoid"),Fr(e,"keepLines")&&r.push("page-break-inside:avoid"),Fr(e,"widowControl")&&r.push("widows:2","orphans:2");let b=ef(Dt(e,"shd","fill"));b&&r.push(`background-color:${b}`);let h=zn(e,"pBdr");if(h)for(let y of ["top","left","bottom","right"]){let x=yi(ge(h,y));x&&r.push(`border-${y}:${x}`,`mso-border-${y}-alt:${x}`);}return r.join(";")}function kB(e,t,n){let r=e.noteOrdinals[t],o=r.get(n);if(o!==void 0)return o;let i=r.size+1;return r.set(n,i),i}var QO={decimal:"decimal",decimalZero:"decimal-leading-zero",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",none:"none"};function eM(e,t,n,r){let o=e.numbering.formatOverrides.get(`${t}:${r}`)??e.numbering.levelFormats.get(n)?.get(String(r))??"decimal",i=e.numbering.startOverrides.get(`${t}:${r}`)??e.numbering.levelStarts.get(n)?.get(String(r))??1;return {fmt:o,start:i}}function IB(e,t){let n,r;for(let s of t){let l=ge(s,"numPr");if(!l)continue;let c=lt(ge(l,"numId"));c!==void 0&&(n=c);let d=lt(ge(l,"ilvl"));d!==void 0&&(r=d);}if(n===void 0||n==="0")return null;let o=e.numbering.numToAbstract.get(n);if(o===void 0)return null;for(let s=0;s<8&&!((e.numbering.levelFormats.get(o)?.size??0)>0);s+=1){let l=e.numbering.styleLinks.get(o),c=l===void 0?void 0:e.styles.byId.get(l),d=lt(ge(ge(ge(c??null,"pPr"),"numPr"),"numId")),u=d===void 0?void 0:e.numbering.numToAbstract.get(d);if(u===void 0||u===o)break;o=u;}let i=Math.min(Math.max(Bo(r)??0,0),8),a=eM(e,n,o,i);return {numId:n,abstractId:o,level:i,fmt:a.fmt,start:a.start}}function RB(e,t){let n=chunkZOZI27AW_cjs.K(e.pkg.contentTypes,t);if(n.ok){let i=xB.get(n.contentType.toLowerCase());if(i!==void 0)return i}let r=t.lastIndexOf("."),o=r===-1?"":t.slice(r+1).toLowerCase();return o==="png"?"image/png":o==="jpg"||o==="jpeg"?"image/jpeg":o==="gif"?"image/gif":o==="bmp"?"image/bmp":o==="webp"?"image/webp":o==="svg"?"image/svg+xml":o==="tif"||o==="tiff"?"image/tiff":o==="emf"?"image/x-emf":o==="wmf"?"image/x-wmf":null}function PB(e,t){let n=Wa(t,"inline",chunkZOZI27AW_cjs.wa)??Wa(t,"anchor",chunkZOZI27AW_cjs.wa);if(!n)return "";let r=Wa(n,"blip",chunkZOZI27AW_cjs.va);if(!r)return "";let o=chunkZOZI27AW_cjs.eg(r,"embed",chunkZOZI27AW_cjs.ya);if(!o)return "";let i=e.docRels.find(b=>b.id===o&&b.targetMode!=="External");if(!i)return "";let a=chunkZOZI27AW_cjs.E(i.ownerPart,i.rawTarget);if(!a.ok)return "";let s=e.pkg.partBytes.get(a.partName.replace(/^\//,""))??e.pkg.partBytes.get(a.partName);if(!s)return "";let l=RB(e,a.partName);if(!l||s.byteLength>e.maxImageBytes||e.imageBudget.used+s.byteLength>e.maxTotalImageBytes)return "";e.imageBudget.used+=s.byteLength;let c=e.imageDataUris.get(a.partName);c==null&&(c=`data:${l};base64,${Dd(s)}`,e.imageDataUris.set(a.partName,c));let d=Wa(n,"extent",chunkZOZI27AW_cjs.wa),u=d?Bo(chunkZOZI27AW_cjs.eg(d,"cx","")):null,f=d?Bo(chunkZOZI27AW_cjs.eg(d,"cy","")):null,p=b=>Math.round(b/12700*100)/100,g=u!==null&&f!==null&&u>0&&f>0?` width="${Math.round(u/YO)}" height="${Math.round(f/YO)}" style="width:${p(u)}pt;height:${p(f)}pt"`:"";return `<img src="${c}"${g}>`}function Hi(e,t,n=0){if(n>=chunkZOZI27AW_cjs.Aa)return;let r=chunkZOZI27AW_cjs.Df(e)?n+1:chunkZOZI27AW_cjs.Ba(e,n);for(let o of e.children)if(Ue(o)&&o.kind!=="drawing"){if(o.kind==="contentControl"){let i=o.children.find(a=>a.kind==="contentControlContent");i&&Ue(i)&&Hi(i,t,r+1);continue}if(o.kind==="fldChar"){tM(o,t);continue}Hi(o,t,r);}}function tM(e,t){let n=chunkZOZI27AW_cjs.eg(e,"fldCharType",chunkZOZI27AW_cjs.pa);n==="begin"?t.stack.push("instr"):n==="separate"&&t.stack.length>0?t.stack[t.stack.length-1]="result":n==="end"&&t.stack.pop();}function TB(e,t,n,r){let o=t.children.find(c=>c.kind==="runProperties"),i=tf(e.styles,n,o&&Ue(o)?o:null,e.tableRPr),a=SB(i),s="";for(let c of t.children){if(!Ue(c))continue;if(c.kind==="fldChar"){r.inert||tM(c,r);continue}if(c.kind==="instrText"||!r.inert&&r.stack.some(f=>f==="instr")||a.vanish)continue;let d=$w(c);if(d!==""){s+=d;continue}let u=Bw(c,e.noteBody,(f,p)=>kB(e,f,p),(f,p)=>e.availableNotes[f].has(p));if(u!==""){s+=u;continue}switch(c.kind){case "text":s+=Xh(Zh(c));break;case "tab":s+='<span style="white-space:pre;mso-tab-count:1"> </span>';break;case "hardBreak":{let f=chunkZOZI27AW_cjs.eg(c,"type",chunkZOZI27AW_cjs.pa);s+=f==="page"?'<br style="page-break-before:always">':"<br>";break}case "bookmarkStart":{let f=ir(chunkZOZI27AW_cjs.eg(c,"name",chunkZOZI27AW_cjs.pa));f!==null&&(s+=`<a id="${Ar(f)}"></a>`);break}case "drawing":s+=PB(e,c);break;default:s+=chunkFDSL5OJU_cjs.mb(c)?.text??"";break}}if(s==="")return "";a.vertAlign==="superscript"?s=`<sup>${s}</sup>`:a.vertAlign==="subscript"&&(s=`<sub>${s}</sub>`);let l=`${a.lang===null?"":` lang="${a.lang}"`}${a.rtl?' dir="rtl"':""}${a.css===""?"":` style="${Ar(a.css)}"`}`;return l===""?s:`<span${l}>${s}</span>`}function Ni(e,t,n,r,o=0){if(o>=chunkZOZI27AW_cjs.Aa)return "";let i="";for(let a of t)if(Ue(a))switch(chunkZOZI27AW_cjs.Df(a)?"fldSimple":a.kind){case "run":i+=TB(e,a,n,r);break;case "hyperlink":{let s=Ni(e,a.children,n,r,o+1);if(s==="")break;let l=chunkZOZI27AW_cjs.eg(a,"id",chunkZOZI27AW_cjs.ya),c=l?e.docRels.find(f=>f.id===l):void 0,d=c===void 0?void 0:c.targetMode==="External"||c.rawTarget.startsWith("#")?c.rawTarget:void 0,u=lk(d,chunkZOZI27AW_cjs.eg(a,"anchor",chunkZOZI27AW_cjs.pa));i+=u!==null?`<a href="${Ar(u)}">${s}</a>`:s;break}case "bookmarkStart":{let s=ir(chunkZOZI27AW_cjs.eg(a,"name",chunkZOZI27AW_cjs.pa));s!==null&&(i+=`<a id="${Ar(s)}"></a>`);break}case "fldSimple":i+=Ni(e,a.children,n,r,o+1);break;case "contentControl":{let s=a.children.find(l=>l.kind==="contentControlContent");s&&Ue(s)&&(i+=Ni(e,s.children,n,r,o+1));break}case "revisionInsert":case "revisionMoveTo":i+=Ni(e,a.children,n,r,o+1);break;case "revisionDelete":case "revisionMoveFrom":Hi(a,r,o);break;case "generic":if(chunkZOZI27AW_cjs.ef(a))i+=Tw(a);else if(chunkZOZI27AW_cjs.Ca(a))i+=Ni(e,a.children,n,r,o+1);else {let s=chunkZOZI27AW_cjs._c(a);s&&(i+=Ni(e,s,n,r,o+1));}break}return i}function EB(e,t){let n=lt(ge(t,"pStyle")),r=co(e.styles,n,"paragraph");for(let o=r.length-1;o>=0;o-=1){let i=chunkZOZI27AW_cjs.eg(r[o],"styleId",chunkZOZI27AW_cjs.pa),a=i?/^Heading([1-6])$/.exec(i):null;if(a)return {level:Number(a[1]),fromStyle:true}}if(n===void 0){let o=Bo(lt(ge(t,"outlineLvl")));if(o!==null&&o>=0&&o<=5)return {level:o+1,fromStyle:false}}return null}function CB(e,t){let n=co(e.styles,lt(ge(t,"pStyle")),"paragraph");for(let r=n.length-1;r>=0;r-=1){let o=Lw(chunkZOZI27AW_cjs.eg(n[r],"styleId",chunkZOZI27AW_cjs.pa));if(o!==null)return o}return null}function JO(e,t,n,r){let o=t.children.find(h=>h.kind==="paragraphProperties"),i=o&&Ue(o)?o:null,a=Yh(e.styles,i,e.tablePPr),s=wB(a,n.asListItem,Fr(a,"bidi")),l=Ni(e,t.children,i,r),c=s===""?"":` style="${Ar(s)}"`,d=Fr(a,"bidi")?' dir="rtl"':"",u=CB(e,i),f=u===null?"":` class="${u}"`,p=EB(e,i);if(n.asListItem)return `<li${p?.fromStyle===true?` class="Heading${p.level}"`:f}${d}${c}>${l}</li>`;let g=p===null?"p":`h${p.level}`,b=p===null?f:p.fromStyle?` class="Heading${p.level}"`:' class="docx-outline"';return `<${g}${b}${d}${c}>${l}</${g}>`}var OB={renderBlocks:(e,t,n)=>af(e,t,n),advanceFieldState:Hi};function af(e,t,n){let r="",o=[],i=null,a=new Map,s=n;if(s===void 0){let f={stack:[]};for(let p of t)Ue(p)&&Hi(p,f);s={stack:[],inert:f.stack.length>0};}let l=()=>{let f=o.pop();f&&(r+=`</${f.tag}>`);},c=()=>{for(;o.length>0;)l();i=null;},d=(f,p)=>{for(i!==null&&p.level<i&&c();o.length>0&&o[o.length-1].abstractId!==p.abstractId;)l();o.length===0&&(i=p.level);let g=i??p.level,b=p.level-g+1;for(;o.length>b;)l();for(o.length===b&&o[b-1].numId!==p.numId&&l();o.length<b;){let x=g+o.length,v=eM(e,p.numId,p.abstractId,x),S=a.get(`${p.abstractId}:${p.numId}:${x}`)??0,I=v.start+S,C=v.fmt==="bullet"?"ul":"ol",P=C==="ol"?Object.hasOwn(QO,v.fmt)?QO[v.fmt]:"decimal":null,E=C==="ol"&&I!==1?` start="${I}"`:"";r+=P?`<${C}${E} style="list-style-type:${Ar(P)}">`:`<${C}>`,o.push({tag:C,numId:p.numId,abstractId:p.abstractId});}let h=`${p.abstractId}:${p.numId}:${p.level}`;a.set(h,(a.get(h)??0)+1);let y=`${p.abstractId}:`;for(let x of a.keys()){if(!x.startsWith(y))continue;let v=x.slice(x.lastIndexOf(":")+1);/^\d+$/.test(v)&&Number(v)>p.level&&a.delete(x);}r+=JO(e,f,{asListItem:true},s);},u=f=>{for(let p of f)if(Ue(p))switch(p.kind){case "paragraph":{let g=p.children.find(y=>y.kind==="paragraphProperties"),b=g&&Ue(g)?g:null,h=IB(e,Yh(e.styles,b));h?d(p,h):(c(),r+=JO(e,p,{asListItem:false},s));break}case "table":c(),r+=GO(e,p,s,OB);break;case "contentControl":{let g=p.children.find(b=>b.kind==="contentControlContent");g&&Ue(g)&&u(g.children);break}case "generic":u(p.children);break;case "bookmarkStart":{let g=ir(chunkZOZI27AW_cjs.eg(p,"name",chunkZOZI27AW_cjs.pa));g!==null&&(r+=`<a id="${Ar(g)}"></a>`);break}default:s.inert||Hi(p,s);break}};return u(t),c(),r}function nM(e,t){let n=e.parts.get(e.mainDocumentPart);if(!n||!Ue(n.root))return "";let r=n.root.children.find(c=>c.kind==="body");if(!r||!Ue(r))return "";let o=jl(e,hB,"/word/footnotes.xml"),i=jl(e,yB,"/word/endnotes.xml"),a={pkg:e,styles:LO(e),numbering:NO(jl(e,gB,"/word/numbering.xml")),docRels:chunkZOZI27AW_cjs.Pe(e,e.mainDocumentPart),maxImageBytes:bB,maxTotalImageBytes:vB,imageBudget:{used:0},imageDataUris:new Map,noteOrdinals:{footnote:new Map,endnote:new Map},availableNotes:{footnote:ny(o,"footnote"),endnote:ny(i,"endnote")},noteBody:null},s=af(a,r.children),l=ZO(a,{footnote:o,endnote:i},Hi);return s+ry(a,"footnote",o,l.footnote,af)+ry(a,"endnote",i,l.endnote,af)}var MB=12*1024*1024;function AB(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function FB(e){return `<div><table>${e.split(`
27
- `).map(n=>`<tr>${n.split(" ").map(r=>`<td>${AB(r)}</td>`).join("")}</tr>`).join("")}</table></div>`}function iy(e){if(e.cellRectangle)return {text:e.text,html:FB(e.text)};if(!e.coverage||!e.pkg)return {text:e.text,html:null};let t=chunk65XBN67F_cjs.K(e.pkg,e.coverage);if(!t.ok)return {text:e.text,html:null,...t.reason==="unsupported-content"?{reason:t.reason}:{}};let n=e.maxFragmentBytes??MB,r=t.bytes;if(t.bytes.byteLength>n){let a=chunk65XBN67F_cjs.K(e.pkg,e.coverage,{omitMedia:true});r=a.ok&&a.bytes.byteLength<=n?a.bytes:null;}let o;try{o=nM(t.package);}catch(a){console.error("docx-editor: copy HTML flavour failed to render",a),o="";}let i=Fw(o,r?{bytes:r,lastMarkCovered:t.lastMarkCovered}:null);return {text:e.text,html:i}}function rM(e,t){let n=()=>t.text.length===0?"none":(e.insertPlainText(t.text),"plain");if(t.forcePlain)return n();let r=t.html;if(r===null||r.length===0)return n();let o=xa(r);if(!e.richLaneOpen)return o&&Ju(o.bytes)?"unsupported-content":n();if(o){let a=e.pasteFragment(o.bytes,o.lastMarkCovered);if(a==="unsupported-content")return "unsupported-content";if(a)return "fragment"}let i=sI(r);if(i.ok&&i.truncated&&t.text.length>0)return n();if(i.ok){let a=e.pasteFragment(i.fragmentBytes,i.lastMarkCovered);if(a==="unsupported-content")return "unsupported-content";if(a)return "external-html"}return n()}function oM(e,t){let n=chunkFDSL5OJU_cjs.Be(e,t);if(!n.includes("\xAD"))return n;let r=n.split("");for(let{line:o}of chunkFDSL5OJU_cjs.Gd(e,t)??[])for(let i of chunkFDSL5OJU_cjs.Qa(o,t)?.spans??[])chunkFDSL5OJU_cjs.pd(i)&&i.range.start<r.length&&(r[i.range.start]=chunkZOZI27AW_cjs.gb);return r.join("")}function iM(e){return e.includes(chunkZOZI27AW_cjs.gb)?e.replaceAll(chunkZOZI27AW_cjs.gb,""):e}function aM(e,t,n,r,o){if(!o||t.paragraphId!==n.paragraphId||/[\r\n\t]/.test(r)||!chunkZOZI27AW_cjs.vj(e.settingsRoot()))return r;let i=Ee(e,t.paragraphId)??e.part();if(!chunkZOZI27AW_cjs.wj(i,t.paragraphId))return r;let a=chunkZOZI27AW_cjs.Xa(i,t.paragraphId);if(a?.kind!=="paragraph")return r;let s=chunkZOZI27AW_cjs.xj(a).find(h=>h.fieldNodeId===o&&h.start<=t.offset&&h.end>=n.offset);if(!s?.enabled||!chunkZOZI27AW_cjs.hj(s)||s.maxLength<=0)return r;let l=(chunkZOZI27AW_cjs.Tk(i,t.paragraphId)??"").slice(s.start,s.end),c=l.slice(0,t.offset-s.start),d=l.slice(n.offset-s.start),u=c+d,f=h=>chunkZOZI27AW_cjs.ij(c+h+d,s,u)<=s.maxLength;if(f(r))return r;let p=[...r],g=s.maxLength-[...u].length;if(s.type==="number"&&s.format)for(let h of u)(h===","&&s.format.includes(",")||h==="%"&&s.format.endsWith("%"))&&g++;let b=new Set;if(s.type==="date"){let h=0;for(let y=0;y<p.length;y++)if(/\S/.test(p[y])){if(++h>18)break;b.add(y+1);}else (y+1===p.length||/\S/.test(p[y+1]))&&b.add(y+1);}else if(s.type==="number"&&s.format)for(let h=1;h<=3;h++)b.add(g+h);for(let h of [...b].sort((y,x)=>x-y)){if(h<=Math.max(0,g)||h>p.length)continue;let y=p.slice(0,h).join("");if(f(y))return y}return p.slice(0,Math.max(0,g)).join("")}var sM=iM,LB=2e3;function lM(e){let{session:t}=e,n=null;function r(s){let l=pI(s),c=e.orderedRange(),d=aM(t,c.from,c.to,l,e.textFormFieldId?.()??null).split(`
28
- `),u=e.deleteSelectionPlan(),f=u.replaceAt??u.collapseTo,p=d.join(""),g=[...u.ops],b=e.consumePendingFormatOps(f.paragraphId,f.offset,p.length);p.length>0&&(g.push({op:"insertText",paragraphId:f.paragraphId,offset:f.offset,text:p}),g.push(...b));let h=[],y=0;for(let C=0;C<d.length-1;C+=1)y+=d[C].length,h.push(f.offset+y);if(h.length>0&&g.push({op:"splitParagraphMany",paragraphId:f.paragraphId,offsets:h}),g.length===0)return;let x=new Set(e.paragraphIds?.()??t.paragraphIdsIn(e.storyScope())),v=d[d.length-1],S=h.length===0?e.caretMark({paragraphId:f.paragraphId,offset:f.offset+v.length}):void 0,I=g.filter(C=>!b.includes(C));e.commit(()=>e.withoutPendingOnRejection(g,I,e.selectionMark(),S),()=>{if(h.length===0)return Ve({paragraphId:f.paragraphId,offset:f.offset+v.length});let C=(e.paragraphIds?.()??t.paragraphIdsIn(e.storyScope())).filter(E=>!x.has(E)),P=C[C.length-1];return P?Ve({paragraphId:P,offset:v.length}):null});}function o(){e.flushPendingInputAndLayout();let s=e.cellSelection(),l=e.orderedRange(),c=e.paragraphOrder(),d=s?chunk6NVZNB7O_cjs.la(e.layout(),s.cellIds):c.slice(c.indexOf(l.from.paragraphId),c.indexOf(l.to.paragraphId)+1),u=new Map(d.map(P=>[P,{start:!s&&P===l.from.paragraphId?l.from.offset:0,end:!s&&P===l.to.paragraphId?l.to.offset:1/0}])),p=e.storyScope().kind==="body"?t.part():Ee(t,d[0]??l.from.paragraphId);if(p&&FO(p,u))return e.commit(()=>({committed:false,rejected:true,opCount:0,reason:"unsupported-content"})),{text:"",html:null,reason:"unsupported-content"};let g=El(e.layout(),oM);if(s)return iy({text:sM(chunk6NVZNB7O_cjs.oa(e.layout(),s,g.spelledText)),cellRectangle:true,coverage:null,pkg:null});let{from:b,to:h}=e.orderedRange(),y=t.part(),x=sM(lh(e.layout(),b,h,e.paragraphOrder(),(P,E)=>g.resultAt(P,E)??(y?EO(y,P,E):null),g.markedText)),v=e.storyScope();if(b.paragraphId===h.paragraphId&&b.offset===h.offset||v.kind!=="body")return {text:x,html:null};let I=t.part(),C=wT(e.layout(),I,b,h,e.paragraphOrder());return iy({text:x,cellRectangle:false,coverage:C,pkg:t.currentPackage()})}function i(s,l){if(e.editingMode()!=="edit"||e.storyScope().kind!=="body"||e.cellSelection())return false;e.flushPendingInputAndLayout();let c=e.deleteSelectionPlan(),d=c.replaceAt??c.collapseTo,u=false,f=false;return e.commit(()=>{let p=e.collaborationGate(c.ops,{kind:"body"});if(p)return {committed:false,rejected:true,opCount:0,reason:p};let g=e.actorId(),b=t.applyFragmentPaste({kind:"body"},{paragraphId:d.paragraphId,offset:d.offset,fragmentBytes:s,lastMarkCovered:l,priorOps:c.ops,...g!==void 0?{actorId:g}:{}});return u=b.ok,f=!b.ok&&b.detail==="fragment-merge:unsupported-content",{committed:b.ok,rejected:!b.ok,opCount:b.ok?1:0,...b.ok?{}:{reason:b.detail??b.reason}}},()=>Ve(d)),f?"unsupported-content":u}function a(s,l){let c=n!==null&&e.now()-n<LB;n=null;let d=rM({richLaneOpen:(e.richPasteAllowed?.()??true)&&e.editingMode()==="edit"&&e.storyScope().kind==="body"&&e.cellSelection()===null,pasteFragment:(u,f)=>i(u,f),insertPlainText:r},{html:l,text:s,forcePlain:c});return d==="unsupported-content"?(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:"unsupported-content"})),false):d!=="none"}return {insertPlainText:r,copyFlavoursNow:o,pasteRichNow:a,armForcePlainPaste:()=>{n=e.now();}}}function cM(e){let{session:t}=e,n=null,r=()=>n??e.selection(),o=()=>n?null:e.cellSelection();function i(){return Oi(e.selection())}function a(){e.flushPendingInputAndLayout();let S=r(),I=S.anchor.paragraphId===S.head.paragraphId?void 0:e.paragraphOrder();return ku(e.layout(),S,I)}function s(){return a().from}function l(S){return chunkFDSL5OJU_cjs.Be(e.layout(),S)}function c(S,I){let C=t.partFor(e.storyScope())??t.part(),P=chunkZOZI27AW_cjs.Xa(C,S.paragraphId);if(!P||P.kind!=="paragraph")return null;let E=I==="before"?chunkZOZI27AW_cjs.ug(P,S.offset):chunkZOZI27AW_cjs.vg(P,S.offset);if(!E)return null;let R=chunkZOZI27AW_cjs.gg(C,E.controlId),w=R?chunkZOZI27AW_cjs.bc(R):null;if(!w)return null;let M=w.lock==="contentLocked"||w.lock==="sdtContentLocked";if(!(M||w.type==="checkbox"||w.type==="picture")||!R)return null;let B=false,q=e.trackedAuthorOrNone()!==void 0;for(let j=q?chunkZOZI27AW_cjs.Ya(C,R.id):null;j&&(j.kind==="revisionDelete"&&(B=true),!(B||j.kind==="paragraph"));j=chunkZOZI27AW_cjs.Ya(C,j.id));return {...E,contentLocked:M,...B?{struck:B}:{}}}function d(S,I){return e.flushPendingInputAndLayout(),e.cellSelection()?null:pT({layout:e.layout(),selection:e.selection(),direction:S,shown:I,controlBeside:c,tracked:e.trackedAuthorOrNone()!==void 0})}function u(S){if(e.trackedAuthorOrNone()!==void 0||e.cellSelection())return false;let I=a();return I.from.paragraphId===I.to.paragraphId&&I.from.offset===I.to.offset?e.atParagraphEnd(S.paragraphId,S.offset):e.atParagraphEnd(I.to.paragraphId,I.to.offset)}function f(S){let I=S?.trim()||void 0,C=p(g(I!==void 0||e.trackedAuthorOrNone()!==void 0),!I&&e.editingMode()!=="suggest"),P=o(),E=null;return {...C,get replaceAt(){return E??=x(C,I,P),E}}}function p(S,I){if(!I||S.ops.length===0||o())return S;let{from:C,to:P}=a();if(C.paragraphId===P.paragraphId)return S;let E=Ee(t,C.paragraphId)??t.part(),R=chunkZOZI27AW_cjs.mj(E,C,P,e.paragraphOrder());return R.length===0?S:{...S,ops:[...R,...S.ops]}}function g(S=e.trackedAuthorOrNone()!==void 0){e.flushPendingInputAndLayout();let I=o();if(I){let R=[];for(let w of chunk6NVZNB7O_cjs.la(e.layout(),I.cellIds)){let M=chunkFDSL5OJU_cjs.Be(e.layout(),w).length;M>0&&R.push({op:"deleteText",paragraphId:w,start:0,end:M});}return {ops:R,collapseTo:s()}}let C=r();if(C.anchor.paragraphId===C.head.paragraphId&&C.anchor.offset===C.head.offset)return {ops:[],collapseTo:chunkFDSL5OJU_cjs.Id(e.layout(),C.head)};let{from:P,to:E}=a();return kT(e.layout(),t.partFor(e.storyScope())??t.part(),P,E,e.paragraphOrder(),e.revisionView(),S)}function b(){return f().ops}function h(S){let I=n;n=S;try{let C=f();return {ops:C.ops,replaceAt:C.replaceAt??C.collapseTo}}finally{n=I;}}function y(S,I,C){if(!(C!==void 0||e.editingMode()==="suggest")||S.paragraphId!==I.paragraphId||I.offset<=S.offset)return S.offset;let E=(C??e.author())?.trim();if(!E)return chunkFDSL5OJU_cjs.Id(e.layout(),I).offset;let R=Ee(t,I.paragraphId)??t.part(),w=chunkZOZI27AW_cjs.Xa(R,I.paragraphId);return !w||w.kind!=="paragraph"?chunkFDSL5OJU_cjs.Id(e.layout(),I).offset:Vu(w,S.offset,I.offset,E,e.trackedDate())}function x(S,I,C){let P=S.collapseTo;if(I===void 0&&e.editingMode()!=="suggest")return P;if(C){for(let te of C.cellIds){let me=chunk6NVZNB7O_cjs.ka(e.layout(),[te]),se=me.length>0?me:chunk6NVZNB7O_cjs.la(e.layout(),[te]);if(se.length===0)continue;let D=new Map,T=Y=>{let re=D.get(Y);return re===void 0&&(re=y({paragraphId:Y,offset:0},{paragraphId:Y,offset:l(Y).length},I),D.set(Y,re)),re},W=(I??e.author())?.trim(),$=Y=>{let re=l(Y);if(!W)return /\S/.test(re);let N=chunkZOZI27AW_cjs.Xa(Ee(t,Y)??t.part(),Y);if(!N||N.kind!=="paragraph")return /\S/.test(re);let U="",G=0;for(let ee of chunkZOZI27AW_cjs.Gh(N,0,re.length,W))U+=re.slice(G,Math.max(G,ee.start)),G=Math.max(G,ee.end);return U+=re.slice(G),/\S/.test(U)},K=null;for(let Y=se.length-1;Y>=0;Y-=1){let re=se[Y];if($(re)){K=re;break}}if(K===null)for(let Y=se.length-1;Y>=0;Y-=1){let re=se[Y];if(T(re)!==0){K=re;break}}return K??=se[se.length-1],{paragraphId:K,offset:T(K)}}return P}let{from:E,to:R}=a();if(E.paragraphId===R.paragraphId&&E.offset===R.offset)return P;if(E.paragraphId===R.paragraphId)return {paragraphId:R.paragraphId,offset:y(E,R,I)};let w=new Set(S.ops.flatMap(te=>te.op==="deleteBlock"?[te.blockId]:[])),M=Ee(t,R.paragraphId)??t.part();if(w.size>0)for(let te=chunkZOZI27AW_cjs.Ya(M,R.paragraphId);te;te=chunkZOZI27AW_cjs.Ya(M,te.id)){if(!w.has(te.id))continue;let me={paragraphId:P.paragraphId,offset:l(P.paragraphId).length};return {paragraphId:P.paragraphId,offset:y(P,me,I)}}let O=(I??e.author())?.trim();if(!O)return P;let B=new Set(S.ops.flatMap(te=>te.op==="joinParagraphs"?[te.secondId]:[])),q=e.paragraphOrder(),j=q.indexOf(E.paragraphId),z=q.indexOf(R.paragraphId);if(j===-1||z===-1)return P;let _=te=>{let me=chunkZOZI27AW_cjs.Xa(M,te);return me?.kind==="paragraph"&&chunkZOZI27AW_cjs.Ol(me,O)},L=z;for(;L>j&&B.has(q[L])&&_(q[L-1]);)L-=1;let X=0;for(let te=L;te<=z;te+=1){let me=q[te],se={paragraphId:me,offset:me===E.paragraphId?E.offset:0},D=me===R.paragraphId?chunkFDSL5OJU_cjs.Id(e.layout(),R):{paragraphId:me,offset:l(me).length};te===L&&(X+=se.offset),X+=D.offset-se.offset-v(se,D,O);}return {paragraphId:q[L],offset:X}}function v(S,I,C){let P=C?.trim();if(!P||S.paragraphId!==I.paragraphId)return 0;let E=Ee(t,I.paragraphId)??t.partFor(e.storyScope())??t.part(),R=chunkZOZI27AW_cjs.Xa(E,I.paragraphId);return !R||R.kind!=="paragraph"?0:chunkZOZI27AW_cjs.Fh(R,S.offset,I.offset,P)}return {selectionMark:i,orderedRange:a,orderedStart:s,textOf:l,inlineControlBeside:c,atomicControlDeletion:d,splitEndsTheParagraph:u,deleteSelectionPlan:f,deleteSelectionOps:b,deleteRangePlan:h,replacementOffset:y}}function Vl(e,t,n,r){if(r===n)return e;let o=i=>i.paragraphId===t?{...i,offset:chunkO324RB6R_cjs.c(i.offset,n,r)}:i;return {anchor:o(e.anchor),head:o(e.head)}}var uM=[24,16,12,8,6,4],DB=8;function dM(e,t,n,r,o){let i=r.textOf(e.paragraphId)??"",a=n.after.slice(0,DB);if(a&&i.slice(e.offset,e.offset+a.length)===a)return e;let s=new Set;for(let l of [e.paragraphId,t.paragraphId]){let c=o.indexOf(l);if(!(c<0))for(let d of [c,c-1,c+1])o[d]&&s.add(o[d]);}for(let l of uM){if(n.before.length<l)continue;let c=n.before.slice(-l);if(i.slice(Math.max(0,e.offset-l),e.offset)===c)return e;let d=null;for(let u of s){let f=r.textOf(u)??"";for(let p=f.indexOf(c);p>=0;p=f.indexOf(c,p+1)){if(d)return e;d={...e,paragraphId:u,offset:p+c.length};}}if(d)return d}return e}var sf="stale",NB=16;function ay(e,t){return e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}function fM(e){let t=null,n=false,r=o=>{let i=new Set(e.order());return o.filter(a=>i.has(a)).slice(0,NB).map(a=>({id:a,text:e.textOf(a)??""}))};return {expectHistory(o){n=o;},note(o,i,a){let s=n;if(n=false,t!==null){s&&t!==sf&&t.history.length===0&&(t={...t,history:r(i)});return}if(!a){t=sf;return}let l=new Map;for(let d of [o.anchor.paragraphId,o.head.paragraphId]){let u=e.textOf(d);u!==null&&l.set(d,u);}let c=d=>{let u=l.get(d.paragraphId)??"",f=uM[0];return {before:u.slice(Math.max(0,d.offset-f),d.offset),after:u.slice(d.offset,d.offset+f)}};t={selection:o,before:l,order:e.order(),context:{anchor:c(o.anchor),head:c(o.head)},history:s?r(i):[]};},noteLocal(){t!==null&&(t=sf);},discard(){t=null;},map(o){let i=t;if(t=null,!i)return o;let a=e.carried?.()??null,s=v=>a&&ay(a.from,v)&&ay(o,v)&&e.textOf(a.to.anchor.paragraphId)!==null&&e.textOf(a.to.head.paragraphId)!==null?a.to:null;if(i===sf)return s(o)??o;let l=e.order(),c=new Set(l);for(let{id:v,text:S}of i.history){if(!c.has(v))continue;let I=e.textOf(v)??S;if(I===S)continue;let C=0;for(;C<S.length&&C<I.length&&S[C]===I[C];)C+=1;let P={paragraphId:v,offset:C+Math.max(0,I.length-S.length)};return {anchor:P,head:P}}let d=new Set(l),u=s(i.selection);if(u)return u;let f=new Set(i.order),p=v=>{let S=i.before.get(v.paragraphId),I=e.textOf(v.paragraphId);if(S===void 0||I===null||I.length>=S.length||!S.startsWith(I)||v.offset<=I.length)return null;let C=l[l.indexOf(v.paragraphId)+1];return C===void 0||f.has(C)||!(e.textOf(C)??"").startsWith(S.slice(I.length))?null:{paragraphId:C,offset:v.offset-I.length}},g=p(o.anchor),b=p(o.head),h=o;for(let[v,S]of i.before)d.has(v)&&(h=Vl(h,v,S,e.textOf(v)??S));h={anchor:g??h.anchor,head:b??h.head};let y=v=>{if(d.has(v.paragraphId))return v;let S=i.order.indexOf(v.paragraphId),I=null;for(let E=S-1;E>=0&&I===null;E-=1)d.has(i.order[E])&&(I=i.order[E]);let C=i.before.get(v.paragraphId),P=I===null?"":e.textOf(I)??"";if(I!==null&&C!==void 0&&P.endsWith(C)){let E=P.length-C.length+v.offset;return {paragraphId:I,offset:E}}for(let E=S+1;S>=0&&E<i.order.length;E+=1){let R=i.order[E];if(d.has(R))return {paragraphId:R,offset:0}}return I===null?v:{paragraphId:I,offset:P.length}};return !(l.length!==i.order.length||l.some((v,S)=>v!==i.order[S]))||!ay(o,i.selection)?{anchor:y(h.anchor),head:y(h.head)}:{anchor:dM(y(h.anchor),o.anchor,i.context.anchor,e,l),head:dM(y(h.head),o.head,i.context.head,e,l)}}}}function pM(e,t){let n=e?.historySelection?.()??null;return n&&t?HB(n,t):null}function mM(e){let t=e?.remoteSelectionMove?.();if(!t)return null;let n=o=>({paragraphId:o.nodeId,offset:o.offset}),r=o=>({anchor:n(o.anchor),head:n(o.head)});return {from:r(t.from),to:r(t.to)}}function HB(e,t){let n=i=>{let a=t.paragraphByStableId(i.paragraphId);return a?{paragraphId:a.nodeId,offset:Math.min(i.offset,a.text.length)}:null},r=n(e.anchor),o=n(e.head);return r&&o?{anchor:r,head:o}:null}function gM(e){return {atParagraphEnd(t,n){let r=chunkZOZI27AW_cjs.Tk(e.partOf(t),t);return r!==null&&n===r.length},followerStyleId(t){let n=e.partOf(t),r=e.styleCascade();if(!r)return;let i=chunkZOZI27AW_cjs.Sh(n,t).find(l=>l.localName==="pStyle")?.attributes?.val??r.defaultParagraphStyleId;if(i==null)return;let a=r.styles.get(i)?.next;if(!a||a===i)return;let s=r.styles.get(a);if(!(!s||s.type!=="paragraph"))return a===r.defaultParagraphStyleId?null:a}}}function yM(e){if(typeof e.defaultView?.createImageBitmap!="function")return null;let t=e.defaultView;return Object.freeze({async decode(n,r,o){let i=new Blob([new Uint8Array(n)],{type:r}),a;try{a=await t.createImageBitmap(i,{imageOrientation:"from-image"});}catch(s){if(s?.name!=="TypeError")throw s;a=await t.createImageBitmap(i);}try{let s=a.width,l=a.height;if(s<=0||l<=0)throw new Error("image dimensions invalid");if(s*l>o.maxPixels)throw new Error("image dimensions exceed limits");return Object.freeze({pixelWidth:s,pixelHeight:l,dpiX:96,dpiY:96})}finally{a.close();}},convertPreserved(n,r,o){return r==="image/tiff"?$B(e,n,o):_B(n,r)}})}async function _B(e,t,n){let{convertEmfToDataUrl:r,convertWmfToDataUrl:o}=await import('emf-converter'),i=new Uint8Array(e),a=i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength),s={maxWidth:4096,maxHeight:4096},l=t==="image/x-emf"?await r(a,s):await o(a,s);if(!l)return null;let c="data:image/png;base64,";if(!l.startsWith(c))return null;let d=atob(l.slice(c.length)),u=new Uint8Array(d.length);for(let f=0;f<d.length;f+=1)u[f]=d.charCodeAt(f);return Object.freeze({bytes:u,mime:"image/png"})}function hM(e,t){let n=e[t];if(!Array.isArray(n)||n.length===0)return null;let r=Number(n[0]);return Number.isSafeInteger(r)&&r>0?r:null}async function BB(e,t){let n=await import('utif2'),r=n.default??n,o=e.slice().buffer,i=r.decode(o)[0];if(!i)return null;let a=hM(i,"t256"),s=hM(i,"t257");if(a===null||s===null||a>t.maxDimension||s>t.maxDimension||a>t.maxPixels/s)return null;let l=a*s;if(l*4>t.maxDecodedBytes||(r.decodeImage(o,i),i.width!==a||i.height!==s))return null;let c=r.toRGBA8(i);return c.length!==l*4?null:Object.freeze({rgba:c,pixelWidth:a,pixelHeight:s})}async function $B(e,t,n){let r=await BB(t,n);if(r===null)return null;let o=await qB(e,r.rgba,r.pixelWidth,r.pixelHeight);return o===null?null:Object.freeze({bytes:o,mime:"image/png"})}async function qB(e,t,n,r){let o=e.createElement("canvas");if(o.width=n,o.height=r,o.width!==n||o.height!==r)return null;let i=o.getContext("2d");if(!i)return null;let a=i.createImageData(n,r);a.data.set(t),i.putImageData(a,0,0);let s=await new Promise(l=>{o.toBlob(c=>l(c),"image/png");});return s?new Uint8Array(await s.arrayBuffer()):null}function bM(){return Object.freeze({async decode(){throw new Error("Image decode unavailable in headless environment")}})}function vM(e){return typeof URL.createObjectURL!="function"||typeof URL.revokeObjectURL!="function"?null:Object.freeze({create(t,n){let r=e.mintValidatedBytes(t,t.contentId);if(!r)throw new Error(`PaintImageUrlSource: validated bytes unavailable for ${t.resourceKey}`);let o=new Uint8Array(r);return URL.createObjectURL(new Blob([o],{type:n}))},revoke(t){URL.revokeObjectURL(t);}})}function xM(e,t){e.contentEditable=t?"true":"false",e.setAttribute("aria-readonly",t?"false":"true"),t?e.removeAttribute("tabindex"):e.tabIndex=0;}var WB="docx-editor-one-surface__caret",sy="docx-editor-one-surface__caret--steady",jB=530;function SM(e,t,n){let r=e.ownerDocument.createElement("div");r.className=WB,r.dataset.docxCaret="",r.dataset.docxMarker="",r.setAttribute("contenteditable","false"),r.setAttribute("aria-hidden","true"),r.dataset.noColorInvert="",r.style.position="absolute",r.style.pointerEvents="none",r.style.userSelect="none",r.style.setProperty("-webkit-user-select","none");let o=false,i=mt(()=>e),a=null,s=null,l=null;function c(){let x=e.ownerDocument.activeElement;return x===e||!!x&&e.contains(x)}function d(x){return x.anchor.paragraphId===x.head.paragraphId&&x.anchor.offset===x.head.offset}function u(){s=null,a!==null&&(i.clearTimeout(a),a=null),r.classList.remove(sy),r.remove(),e.style.removeProperty("caret-color"),l?.style.removeProperty("caret-color"),l=null;}function f(){r.classList.add(sy),a!==null&&i.clearTimeout(a),a=i.setTimeout(()=>{a=null,r.classList.remove(sy);},jB);}function p(){if(o||!c()||n().suppress){u();return}let{layout:x,selection:v,scopedHost:S,scopedHostKind:I,scopedOrigin:C,preferredPageIndex:P,preferredLineId:E,measurer:R,typingStyle:w}=n(),M=t();if(!d(v)){u();return}let O=chunkFDSL5OJU_cjs.ze(x,v.head,{...R?{measurer:R}:{},...P!==void 0?{preferredPageIndex:P}:{},...E!==void 0?{preferredLineId:E}:{}});if(!O||!Number.isInteger(O.pageIndex)){u();return}if(w&&R){let{pageIndex:_,lineId:L}=O,X=chunkFDSL5OJU_cjs.Gd(x,v.head.paragraphId)?.find(me=>me.pageIndex===_&&me.line.id===L),te=X?.line;if(te&&!te.drawings?.length&&!chunkFDSL5OJU_cjs.fe(O)&&(te.spans.length>0||te.box.height>0)){let me=w();if(me){let se={...Eu(x,v)??chunkFDSL5OJU_cjs.ca,...me},D=R.lineMetrics(se);if(D.height>0){let T=chunkFDSL5OJU_cjs.Pd({...O,width:0,y:te.spans.length>0?te.box.y+te.baseline-D.baseline-chunkFDSL5OJU_cjs.ha(se):O.y,height:D.height},X?.clipBox);if(!T){u();return}O=T;}}}}let B=S??e.querySelector(`[data-page-index="${O.pageIndex}"] > .docx-page-content`);if(!B){u();return}if(!(O.height>0)){u();return}r.style.left=`${(O.x-(C?.x??0))*M}px`,r.style.top=`${(O.y-(C?.y??0))*M}px`,r.style.height=`${O.height*M}px`;let q=chunkFDSL5OJU_cjs.fe(O);r.style.transformOrigin=q?"0 0":"",r.style.transform=q?"rotate(-90deg)":"",r.parentNode!==B&&B.append(r),e.style.caretColor="transparent",l&&l!==S&&l.style.removeProperty("caret-color"),l=S??null,l?.style.setProperty("caret-color","transparent");let j=B===S?I??"scoped":"body",z=`${O.pageIndex}:${j}:${O.x}:${O.y}:${O.height}`;z!==s&&(s=z,f());}let g=()=>{o=true,p();},b=()=>{o=false,p();},h=()=>p(),y=x=>{let v=x.relatedTarget;v&&e.contains(v)||u();};return e.addEventListener("compositionstart",g),e.addEventListener("compositionend",b),e.addEventListener("focusin",h),e.addEventListener("focusout",y),{update:p,destroy(){e.removeEventListener("compositionstart",g),e.removeEventListener("compositionend",b),e.removeEventListener("focusin",h),e.removeEventListener("focusout",y),u();}}}function ly(e){let t=e.indexOf("#");return t===-1?"":e.slice(0,t)}function _i(e,t){let n=ly(t);return n.length===0?e.part():e.currentPackage().parts.get(n)??e.part()}function cy(e,t){return !e||e.kind==="tableBody"?null:ly(e.tableId)===ly(t)?e:null}function Ul(e,t,n){let r=a=>{for(let s of a)if(s.kind==="table"){if(s.tableId===t)return s;for(let l of s.rows)for(let c of l.cells){let d=r(c.blocks);if(d)return d}}return null},o=e.pages[n];if(!o)return null;let i=r(o.fragments);if(i)return {table:i,origin:o.contentBox};for(let a of [o.header,o.footer]){if(!a)continue;let s=r(a.fragments);if(s)return {table:s,origin:a.box}}return null}function dy(e,t){for(let n of e)if(n.kind==="table"){t(n);for(let r of n.rows)for(let o of r.cells)dy(o.blocks,t);}}function KB(e,t){for(let n of e.pages){let r=o=>{for(let i=0;i<o.rows.length;i+=1)t({table:o,row:o.rows[i],rowIndex:i});};dy(n.fragments,r);for(let o of [n.header,n.footer])o&&dy(o.fragments,r);}}function uy(e,t,n,r){let o=null;return KB(e,i=>{i.table.tableId===t&&i.row.id===n&&i.row.isHeaderRepeat===r&&(o=i);}),o}function fy(e,t){return {sourceRevision:e,tableId:t.table.tableId,rowId:t.row.id,isHeaderRepeat:t.row.isHeaderRepeat}}function wM(e,t,n){let r=n.gridColumnId;return r?{sourceRevision:e,tableId:t.table.tableId,gridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}:null}function kM(e,t,n,r){return {sourceRevision:e,tableId:t.table.tableId,leftGridColumnId:n,rightGridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}}function IM(e,t,n){return {sourceRevision:e,tableId:t.table.tableId,gridColumnId:n,isHeaderRepeat:t.row.isHeaderRepeat}}var UB=120,RM=20;function lf(e){return chunkZOZI27AW_cjs.sd(chunkZOZI27AW_cjs.Yk(e,"w"))??0}function zB(e,t,n){let r=e.pagesLayer.getBoundingClientRect(),o=e.scale();return {x:(t-r.left)/o,y:(n-r.top)/o}}function py(e){let t=e.editingMode==="view";return {editable:!t,viewing:t}}function my(e,t){return t.kind==="insertColumn"?uy(e,t.tableId,t.rowId,t.isHeaderRepeat):"rowId"in t?uy(e,t.tableId,t.rowId,t.isHeaderRepeat):null}function PM(e){return Math.min(160,e)}function TM(e){let t=e.furnitureLayer;t.className="docx-table-furniture",t.setAttribute("contenteditable","false"),t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.pointerEvents="none";let n=mt(()=>t),r=null,o=null,i=null,a=null,s=null,l=null,c=false,d=0,u=0,f=null,p=null,g=null;function b(N){return Kd(N,"button")&&(N.classList.contains("docx-table-insert-row")||N.classList.contains("docx-table-insert-column"))}function h(){let N=t.ownerDocument.activeElement;return N!==null&&b(N)&&N.closest(".docx-table-furniture")===t?N:null}function y(N){for(let U of [...t.children])b(U)&&U!==N&&U.remove();}function x(){p=null,g=null;}function v(){r!==null&&(n.clearTimeout(r),r=null);}function S(){for(let U of [...t.children])b(U)||U.remove();let N=h();if(!N){y(null),x();return}p=N,y(N);}function I(N){let U=p??h(),G=U!==null&&t.ownerDocument.activeElement===U;x(),t.replaceChildren(),N&&G&&e.pagesLayer.focus({preventScroll:true});}function C(){for(let N of [...t.children])b(N)||N.remove();}function P(N,U,G,ee){let oe=e.read().layout.pages[N];if(!oe)return {left:0,top:0};let ce=ee??oe.contentBox,he=e.scale(),Ce=e.pageOffsetX(N);return {left:(ce.x+U+Ce)*he,top:(ce.y+G)*he}}function E(N,U){let G=e.read(),ee=Ul(G.layout,U.tableId,U.pageIndex);if(!ee)return;let{table:de,origin:oe}=ee,ce=t.ownerDocument.createElement("div");ce.className="docx-table-resize-preview",ce.style.position="absolute",ce.style.pointerEvents="none";let he=U.kind!=="rowDivider",Ce=P(U.pageIndex,he?de.box.x+N:de.box.x,he?de.box.y:de.box.y+N,oe);ce.style.left=`${Ce.left}px`,ce.style.top=`${Ce.top}px`,ce.style.width=he?"2px":`${de.box.width*e.scale()}px`,ce.style.height=he?`${de.box.height*e.scale()}px`:"2px",t.append(ce);}function R(){let N=t.ownerDocument.createElement("button");return N.type="button",N.textContent="+",N.style.position="absolute",N.style.pointerEvents="auto",N}function w(N){q(N);let U=g;if(!U)return;let G=e.read();U.kind==="insertRow"?z(U,G):U.kind==="insertColumn"&&_(U,G);}function M(){queueMicrotask(()=>{!p||t.ownerDocument.activeElement===p||c||o?.kind==="insertRow"||o?.kind==="insertColumn"||(p.remove(),x());});}function O(){if(p&&t.contains(p))return p;let N=h();if(N)return p=N,N;let U=R();return U.addEventListener("pointerenter",()=>{c=true,v();}),U.addEventListener("pointerleave",()=>{c=false;}),U.addEventListener("pointerdown",q),U.addEventListener("mousedown",q),U.addEventListener("click",w),U.addEventListener("blur",M),p=U,U}function B(N,U){let G=Ul(U.layout,N.tableId,N.pageIndex);if(!G)return;let{table:ee,origin:de}=G,oe=O();if(y(oe),g=N,oe.dataset.tableId=N.tableId,N.kind==="insertRow"){let ce=ee.rows.find(ct=>ct.id===N.rowId);if(!ce)return;oe.dataset.rowId=N.rowId,delete oe.dataset.gridColumnId,oe.className="docx-table-insert-row",oe.setAttribute("aria-label",e.label("table.insertRowBelow"));let he=ce.box.y+ce.box.height/2,Ce=P(N.pageIndex,ee.box.x-14,he,de);oe.style.left=`${Ce.left}px`,oe.style.top=`${Ce.top-8}px`;}else {let ce=ee.rows[0]?.cells.find(Ae=>Ae.gridColumnId===N.gridColumnId);if(!ce)return;oe.dataset.gridColumnId=N.gridColumnId,delete oe.dataset.rowId;let he=ee.columnEdges[ce.gridColumn]??0,Ce=ee.columnEdges[ce.gridColumn+1]??ee.box.width;oe.className="docx-table-insert-column",oe.setAttribute("aria-label",e.label("table.insertColumnRight"));let ct=P(N.pageIndex,ee.box.x+(he+Ce)/2-8,ee.box.y-14,de);oe.style.left=`${ct.left}px`,oe.style.top=`${ct.top}px`;}t.contains(oe)||t.append(oe);}function q(N){N.preventDefault(),N.stopPropagation();}function j(N,U){if(C(),y(p??h()),!(l||U.editingMode==="view")){if((N.kind==="columnDivider"||N.kind==="rightEdge")&&!N.isHeaderRepeat){let G=Ul(U.layout,N.tableId,N.pageIndex);if(!G)return;let{table:ee,origin:de}=G,oe=t.ownerDocument.createElement("div");oe.className=N.kind==="rightEdge"?"docx-table-edge-handle-right layout-table-edge-handle-right":"docx-table-divider-handle layout-table-resize-handle",oe.style.position="absolute",oe.style.pointerEvents="auto",oe.style.cursor="col-resize",oe.dataset.active="true";let ce=P(N.pageIndex,ee.box.x+N.edgeX,ee.box.y,de);oe.style.left=`${ce.left-3}px`,oe.style.top=`${ce.top}px`,oe.style.width="6px",oe.style.height=`${ee.box.height*e.scale()}px`,oe.addEventListener("pointerdown",L),t.append(oe);}if(N.kind==="rowDivider"&&!N.isHeaderRepeat){let G=Ul(U.layout,N.tableId,N.pageIndex);if(!G)return;let{table:ee,origin:de}=G,oe=t.ownerDocument.createElement("div");oe.className="docx-table-row-divider-handle layout-table-row-resize-handle",oe.style.position="absolute",oe.style.pointerEvents="auto",oe.style.cursor="row-resize",oe.dataset.active="true";let ce=P(N.pageIndex,ee.box.x,ee.box.y+N.edgeY,de);oe.style.left=`${ce.left}px`,oe.style.top=`${ce.top-3}px`,oe.style.width=`${ee.box.width*e.scale()}px`,oe.style.height="6px",oe.addEventListener("pointerdown",L),t.append(oe);}N.kind==="insertRow"&&!N.isHeaderRepeat&&B(N,U),N.kind==="insertColumn"&&!N.isHeaderRepeat&&B(N,U);}}function z(N,U){let G=my(U.layout,N);if(!G)return;let ee=py(U),de=io({command:{type:"insertRow",where:"below",target:fy(N.sourceRevision,G)},part:_i(e.session(),N.tableId),layout:U.layout,storeRevision:U.storeRevision,selection:U.selection,cellSelection:U.cellSelection,themeColors:U.themeColors,...ee});e.applyTableCommandPlan(de);}function _(N,U){let G=my(U.layout,N);if(!G)return;let ee=G.row.cells.find(he=>he.gridColumnId===N.gridColumnId);if(!ee)return;let de=wM(N.sourceRevision,G,ee);if(!de)return;let oe=py(U),ce=io({command:{type:"insertColumn",where:"right",target:de},part:_i(e.session(),N.tableId),layout:U.layout,storeRevision:U.storeRevision,selection:U.selection,cellSelection:U.cellSelection,themeColors:U.themeColors,...oe});e.applyTableCommandPlan(ce);}function L(N){if(N.button!==0)return;let U=e.read();if(U.editingMode==="view"||!o||o.kind!=="columnDivider"&&o.kind!=="rightEdge"&&o.kind!=="rowDivider")return;N.preventDefault(),N.stopPropagation();let G=o,ee=my(U.layout,G);if(!ee)return;let de=chunkZOZI27AW_cjs._k(_i(e.session(),G.tableId).root,G.tableId);if(!de.ok||G.kind!=="rowDivider"&&chunkZOZI27AW_cjs.fl(de.topology)!==null)return;let oe=0,ce=0,he=0,Ce=de.topology.gridColumns.reduce((Ie,Re)=>Ie+lf(Re),0),ct;if(G.kind==="columnDivider"){let Ie=de.topology.gridColumns.find(dt=>dt.id===G.leftGridColumnId),Re=de.topology.gridColumns.find(dt=>dt.id===G.rightGridColumnId);if(!Ie||!Re)return;oe=lf(Ie),ce=lf(Re),ct=kM(G.sourceRevision,ee,G.leftGridColumnId,G.rightGridColumnId);}else if(G.kind==="rightEdge"){let Ie=de.topology.gridColumns.find(Re=>Re.id===G.gridColumnId);if(!Ie)return;oe=lf(Ie),ce=0,ct=IM(G.sourceRevision,ee,G.gridColumnId);}else he=Math.max(20,Math.round(ee.row.box.height*RM)),ct=fy(G.sourceRevision,ee);let Ae=N.currentTarget;Ae.setPointerCapture(N.pointerId),d=N.clientX,u=N.clientY,l={pointerId:N.pointerId,startClientX:N.clientX,startClientY:N.clientY,startEdgePt:G.kind==="rowDivider"?G.edgeY:G.edgeX,leftTwips:oe,rightTwips:ce,tableWidthTwips:Ce,rowHeightTwips:he,target:G,ref:ee,resizeTarget:ct,captureElement:Ae,rightEdge:G.kind==="rightEdge",vertical:G.kind==="rowDivider",cancelled:false};for(let Ie of [...t.children])Ie!==Ae&&Ie.remove();E(G.kind==="rowDivider"?G.edgeY:G.edgeX,G);}function X(){if(l){try{l.captureElement.hasPointerCapture(l.pointerId)&&l.captureElement.releasePointerCapture(l.pointerId);}catch{}l.cancelled=true,l=null,S(),o=null;}}function te(){if(!l||l.cancelled){l=null,S();return}let N=l;l=null;try{N.captureElement.hasPointerCapture(N.pointerId)&&N.captureElement.releasePointerCapture(N.pointerId);}catch{}if(N.vertical?u===N.startClientY:d===N.startClientX){S();return}let U=e.read(),G=py(U),ee=(N.vertical?u-N.startClientY:d-N.startClientX)/e.scale(),de=Math.round(ee*RM),oe;if(N.target.kind==="rowDivider")oe=gR({part:_i(e.session(),N.target.tableId),layout:U.layout,storeRevision:U.storeRevision,selection:U.selection,cellSelection:U.cellSelection,themeColors:U.themeColors,...G},N.resizeTarget,Math.max(PM(N.rowHeightTwips),N.rowHeightTwips+de));else if(N.rightEdge&&N.target.kind==="rightEdge"){let ce=Math.max(300,N.leftTwips+de),he=Math.max(ce,N.tableWidthTwips+de);oe=io({command:{type:"commitTableRightEdgeResize",target:N.resizeTarget,columnWidthTwips:ce,tableWidthTwips:he},part:_i(e.session(),N.target.tableId),layout:U.layout,storeRevision:U.storeRevision,selection:U.selection,cellSelection:U.cellSelection,themeColors:U.themeColors,...G});}else if(N.target.kind==="columnDivider"){let ce=N.leftTwips+de,he=N.rightTwips-de;ce=Math.max(300,ce),he=Math.max(300,he);let Ce=N.leftTwips+N.rightTwips;ce+he!==Ce&&(ce>Ce-300?(ce=Ce-300,he=300):he=Ce-ce),oe=io({command:{type:"commitTableColumnDividerResize",target:N.resizeTarget,leftWidthTwips:ce,rightWidthTwips:he},part:_i(e.session(),N.target.tableId),layout:U.layout,storeRevision:U.storeRevision,selection:U.selection,cellSelection:U.cellSelection,themeColors:U.themeColors,...G});}else {S();return}e.applyTableCommandPlan(oe),S();}function me(N){if(!f)return null;i??=chunkFDSL5OJU_cjs.$e(N.layout);let U=e.pageOffsetX(f.pageIndex);return chunkFDSL5OJU_cjs.df(i,f.x,f.y,N.layout,U,f.pageIndex)}function se(N){if(!o||l||N.editingMode==="view")return;v();let U=me(N),G=cy(U,N.selection.head.paragraphId);if(!G){o=null,S();return}if(chunkFDSL5OJU_cjs.bf(G)!==chunkFDSL5OJU_cjs.bf(o)){o=null,S();return}o=G,j(G,N);}function D(){let N=p??h(),U=N!==null&&t.ownerDocument.activeElement===N;x(),N&&t.contains(N)&&N.remove(),U&&e.pagesLayer.focus({preventScroll:true});}function T(N){if(l||N.editingMode==="view")return;let U=p??h();if(!U||!t.contains(U)){g&&x();return}if(p=U,!g||g.kind!=="insertRow"&&g.kind!=="insertColumn")return;i??=chunkFDSL5OJU_cjs.$e(N.layout);let G=chunkFDSL5OJU_cjs.bf(g),ee=chunkFDSL5OJU_cjs.cf(i,g);if(!ee||chunkFDSL5OJU_cjs.bf(ee)!==G){D();return}g=ee,B(ee,N);}function W(N){let U=e.read();if(l&&N.pointerId===l.pointerId){d=N.clientX,u=N.clientY;let he=(l.vertical?N.clientY-l.startClientY:N.clientX-l.startClientX)/e.scale();l.target.kind==="rowDivider"&&(he=Math.max(he,(PM(l.rowHeightTwips)-l.rowHeightTwips)/20));for(let Ce of [...t.children])Ce!==l.captureElement&&Ce.remove();E(l.startEdgePt+he,l.target);return}if(U.editingMode==="view"){I(false);return}if(Co(N.target)&&p?.contains(N.target)){v();return}let G=zB(e,N.clientX,N.clientY),ee=chunkFDSL5OJU_cjs.he(U.layout,G.y);ee>=0&&(f={x:G.x,y:G.y,pageIndex:ee});let de=ee>=0?e.pageOffsetX(ee):0;i??=chunkFDSL5OJU_cjs.$e(U.layout);let oe=i?chunkFDSL5OJU_cjs.df(i,G.x,G.y,U.layout,de,ee>=0?ee:void 0):null,ce=cy(oe,U.selection.head.paragraphId);if(!ce){if(c)return;n.migrate(),!r&&o&&(r=n.setTimeout(()=>{r=null,o=null,S();},UB));return}r&&(n.clearTimeout(r),r=null),!(o&&chunkFDSL5OJU_cjs.af(ce)===chunkFDSL5OJU_cjs.af(o))&&(o=ce,j(ce,U));}function $(N){if(!(!l||N.pointerId!==l.pointerId)){if(e.read().editingMode==="view"){X();return}te();}}function K(N){!l||N.pointerId!==l.pointerId||X();}function Y(N){N.key!=="Escape"||!l||X();}e.pagesLayer.addEventListener("pointermove",W);let re=[e.listeners.onDocument("pointermove",W),e.listeners.onDocument("pointerup",$),e.listeners.onDocument("pointercancel",K)];return e.pagesLayer.addEventListener("keydown",Y),{update(){let N=e.read(),U=a,G=s;i=null,a=N.layout.revision,s=N.storeRevision,N.editingMode==="view"?(X(),o=null,v(),I(true)):U!==null&&(U!==N.layout.revision||G!==N.storeRevision)&&(o!==null&&se(N),T(N)),t.style.width=e.pagesLayer.style.width,t.style.height=e.pagesLayer.style.height;},cancelDrag:X,refreshLabels(){let N=e.read();if(N.editingMode==="view")return;let U=p??h();if(U&&t.contains(U)&&g&&(g.kind==="insertRow"||g.kind==="insertColumn")){B(g,N);return}o&&(o.kind==="insertRow"||o.kind==="insertColumn")&&B(o,N);},destroy(){v(),X(),x(),S(),e.pagesLayer.removeEventListener("pointermove",W);for(let N of re)N();e.pagesLayer.removeEventListener("keydown",Y),t.remove();}}}var GB=e=>e==="left"||e==="center"||e==="right"||e==="both";function EM(e,t){if(!t.some(r=>r.localName==="bidi"))return e;let n=e.map(r=>r.localName).lastIndexOf("bidi");return n===-1?e:e.filter((r,o)=>o!==n)}function cf(e,t,n,r=n){let o=()=>chunkFDSL5OJU_cjs.Ed([...t,...n]);if(e.paragraphDirection!==void 0&&e.localName==="bidi"){let a=e.paragraphDirection==="rtl";return o()===a?null:a?chunkFDSL5OJU_cjs.Ed(EM(t,r))?{localName:"bidi",remove:true}:{localName:"bidi"}:chunkFDSL5OJU_cjs.Ed(EM(t,r))?{localName:"bidi",attributes:{val:"0"}}:{localName:"bidi",remove:true}}let i=e.attributes?.val;return !e.physicalAlignment||e.localName!=="jc"||!GB(i)?e:{localName:"jc",attributes:{val:chunkFDSL5OJU_cjs.nd(i,o())}}}function CM(e){let{runPropertyEdits:t,mergedParagraphMarkProperties:n}=chunk3IEXDEFH_cjs.b(()=>e.session.stylesRoot(),()=>e.session.settingsRoot(),()=>e.displayMode(),()=>e.authorFilter()),{session:r,commit:o,orderedRange:i,selectionMark:a,textOf:s}=e,l=()=>e.displayMode(),c=()=>e.authorFilter(),d=()=>r.partFor(e.storyScope())??r.part(),u=S=>{let{anchor:I,head:C}=S;if(I.paragraphId!==C.paragraphId||I.offset!==C.offset)return {selection:S,caretSpan:true};let P=chunkZOZI27AW_cjs.Xa(d(),C.paragraphId),E=P?chunkZOZI27AW_cjs.ci(P,C.offset):void 0;if(E===void 0)return {selection:S,caretSpan:true};if(E===null)return {selection:S,caretSpan:false};let R=E.end<=C.offset?E.end-1:E.start;return {selection:{anchor:{paragraphId:C.paragraphId,offset:R},head:{paragraphId:C.paragraphId,offset:R+1}},caretSpan:true}},f=(S,I,C)=>{let P=E=>r.applyTreeOps(E,I,C,e.storyScope());return e.applyOutsideToc?e.applyOutsideToc(S,P):P(S)},p=()=>{let S=e.runFormatRefusal?.();return S?e.commit(()=>({committed:false,rejected:true,opCount:0,reason:S}))??S:null},g={get value(){return e.layout()}},b={get value(){return e.selection()}},h=(S,I,C)=>{let P=d();if(S.paragraphId===I.paragraphId){let O=t(P,S.paragraphId,S.offset,I.offset,C,l(),c());if(O.length===0)return null;let B=n(P,S.paragraphId,C);return o(()=>f([...O.map(q=>({op:"setRunProperties",paragraphId:S.paragraphId,start:q.start,end:q.end,properties:q.properties,...q.targetRunIds?{targetRunIds:q.targetRunIds}:{}})),...e.paragraphMarkVisible(S.paragraphId)?jT(s(S.paragraphId),S,I,B):[]],a()))}let E=e.paragraphOrder(),R=E.indexOf(S.paragraphId),w=E.indexOf(I.paragraphId);if(R===-1||w===-1)return null;let M=[];for(let O=R;O<=w;O+=1){let B=E[O],q=s(B),j=O===R?S.offset:0,z=O===w?I.offset:q.length,_=j<z?t(P,B,j,z,C,l(),c()):[];for(let X of _)M.push({op:"setRunProperties",paragraphId:B,start:X.start,end:X.end,properties:X.properties,...X.targetRunIds?{targetRunIds:X.targetRunIds}:{}});(O<w||j===0&&z===q.length&&q.length>0)&&e.paragraphMarkVisible(B)&&M.push({op:"setParagraphMarkProperties",paragraphId:B,properties:n(P,B,C)});}return M.length===0?null:o(()=>f(M,a()))},y=(S,I)=>{let C=d(),P=[];for(let E of chunk6NVZNB7O_cjs.la(g.value,S)){let R=s(E);for(let w of t(C,E,0,R.length,I,l(),c()))P.push({op:"setRunProperties",paragraphId:E,start:w.start,end:w.end,properties:w.properties,...w.targetRunIds?{targetRunIds:w.targetRunIds}:{}});e.paragraphMarkVisible(E)&&P.push({op:"setParagraphMarkProperties",paragraphId:E,properties:n(C,E,I)});}return P.length===0?null:o(()=>f(P,a()),void 0,{keepCellSelection:true})},x=S=>{chunkZOZI27AW_cjs.Ph(S.localName)&&e.setPendingFormats(chunkZOZI27AW_cjs.Uh(e.pendingFormats()??[],S));},v=S=>{if(S.length===0)return;let I=e.selectedCells?.(),C=I&&I.length>0?[...chunk6NVZNB7O_cjs.la(g.value,I)]:null,{from:P,to:E}=i(),R=C??e.paragraphOrder(),w=C?0:R.indexOf(P.paragraphId),M=C?R.length-1:R.indexOf(E.paragraphId);if(w===-1||M===-1)return;let O=d(),B=R.slice(w,M+1).filter(q=>e.paragraphMarkVisible(q)).flatMap(q=>{let j=chunkZOZI27AW_cjs.Sh(O,q),z=j,_=Or(g.value,q),L=false;for(let X of S){let te=cf(X,_,z,j);if(!te)continue;if(L=true,te.remove){z=z.filter(D=>D.localName!==te.localName);continue}let me=te.mergeAttributes?{...z.find(D=>D.localName===te.localName)?.attributes??{},...te.attributes}:te.attributes??{},se=Object.fromEntries(Object.entries(me).filter(([,D])=>D!=null));z=chunkZOZI27AW_cjs.Uh(z,{localName:te.localName,...Object.keys(se).length>0?{attributes:se}:{}});}return L?[{op:"setParagraphProperties",paragraphId:q,properties:z}]:[]});B.length!==0&&o(()=>f(B,a()),void 0,{keepCellSelection:C!==null});};return {setRunProperty(S,I){let C=p();if(C)return C;let P={localName:S,...I?{attributes:I}:{}},E=e.selectedCells?.();if(E&&E.length>0)return y(E,P);let{from:R,to:w}=i();return R.paragraphId===w.paragraphId&&R.offset===w.offset?(x(P),null):h(R,w,P)},setParagraphProperty(S,I,C){v([{localName:S,...I?{attributes:I}:{},...C??{}}]);},setParagraphProperties:v,formatting:()=>{let S=u(b.value);return qT(WT(g.value,S.selection,(I,C)=>{let P=r.effectiveRunDefaults(I,C);if(P.fontFamily!==null)return P;let E=e.defaultFontFamily?.()??null;return E===null?P:{...P,fontFamily:E}},e.selectedCells?.(),e.defaultParagraphStyleId?.()??null,b.value.anchor.paragraphId===b.value.head.paragraphId?[b.value.head.paragraphId]:e.paragraphOrder(),e.defaultFontFamily?.()??null,S.caretSpan),e.pendingFormats())},toggleRunProperty(S,I){let C=p();if(C)return C;let P=e.selectedCells?.(),E=I?.val,R=Fa(e.pendingFormats(),S,E)??gh(g.value,b.value,S,P,E,e.paragraphOrder()),w=R?{localName:S,attributes:{val:ZB[S]??"0"}}:{localName:S,...I?{attributes:I}:{}};if(P&&P.length>0)return y(P,w);let{from:M,to:O}=i();if(M.paragraphId===O.paragraphId&&M.offset===O.offset){let B=e.pendingFormats()??[],q=gh(g.value,b.value,S,void 0,E,e.paragraphOrder());if(!R===q){let j=B.filter(z=>z.localName!==S);e.setPendingFormats(j.length>0?j:null);}else x(w);return null}return h(M,O,w)},clearFormatting(){if(p())return;e.setPendingFormats(null);let S=g.value,I=e.paragraphOrder(),C=e.selectedCells?.(),P=C&&C.length>0?[...chunk6NVZNB7O_cjs.la(S,C)]:Tu(I,i());if(P.length===0)return;let{from:E,to:R}=i(),w=C!==void 0&&C.length>0,M=d(),O=[];for(let B of P){let q=s(B),j=w||B!==E.paragraphId?0:E.offset,z=w||B!==R.paragraphId?q.length:R.offset;for(let X of chunkZOZI27AW_cjs.fi(M,B,j,z,l(),c()))$T(M,B,X.start,X.end,l(),c())&&O.push({op:"setRunProperties",paragraphId:B,start:X.start,end:X.end,properties:[]});e.paragraphMarkVisible(B)&&chunkZOZI27AW_cjs.Th(M,B).length>0&&O.push({op:"setParagraphMarkProperties",paragraphId:B,properties:[]});let _=chunkZOZI27AW_cjs.Sh(M,B),L=_.filter(X=>X.localName==="bidi");e.paragraphMarkVisible(B)&&_.length>L.length&&O.push({op:"setParagraphProperties",paragraphId:B,properties:L});}O.length!==0&&o(()=>f(O,a()),void 0,{keepCellSelection:w});}}}var ZB={u:"none",vertAlign:"baseline"};var XB=new Set,OM=500;function YB(e){let t=l=>({val:l?"1":"0"}),n=l=>String(Math.max(2,Math.min(3276,Math.round(l*2)))),r=e.latinLane??e,o=e.complexLane??e,i=n(r.fontSizePt),a=[{localName:"b",attributes:t(r.bold)},{localName:"i",attributes:t(r.italic)},{localName:"bCs",attributes:t(o.bold)},{localName:"iCs",attributes:t(o.italic)},{localName:"u",attributes:{val:e.underline?e.underline.variant:"none",color:e.underline?.color??"auto",themeColor:"none"}},{localName:"strike",attributes:t(e.strike)},{localName:"dstrike",attributes:t(e.doubleStrike)},{localName:"caps",attributes:t(e.caps)},{localName:"smallCaps",attributes:t(e.smallCaps)},{localName:"vertAlign",attributes:{val:e.verticalAlign}},{localName:"color",attributes:{val:e.color??"auto"}},{localName:"highlight",attributes:{val:e.highlight??"none"}},{localName:"sz",attributes:{val:i}},{localName:"szCs",attributes:{val:n(o.fontSizePt)}},{localName:"spacing",attributes:{val:String(Math.round(e.characterSpacingPt*20))}},{localName:"position",attributes:{val:String(Math.round(e.baselineShiftPt*2))}},{localName:"w",attributes:{val:String(Math.round(e.horizontalScalePercent))}},{localName:"kern",attributes:{val:String(Math.round(e.kerningMinPt*2))}}],s=e.complexLane?.fontFamily??null;return (r.fontFamily||r.fontFamilyEastAsia||s)&&a.push({localName:"rFonts",attributes:{...r.fontFamily?{ascii:r.fontFamily,hAnsi:r.fontFamily}:{},...r.fontFamilyEastAsia?{eastAsia:r.fontFamilyEastAsia}:{},...s?{cs:s}:{}}}),a}function MM(e){let{runPropertyEdits:t,mergedParagraphMarkProperties:n}=chunk3IEXDEFH_cjs.b(()=>e.session.stylesRoot(),()=>e.session.settingsRoot(),()=>e.displayMode(),()=>e.authorFilter()),r=e.session,o=()=>r.partFor(e.storyScope())??r.part(),i="off",a=null,s=null,l=null,c=Yd,d=()=>{let x=a===null?"none":a.paragraphProperties?"paragraph":"run";return (c.mode!==i||c.level!==x)&&(c={mode:i,level:x}),c},u=(x,v,S)=>{if(S||x.paragraphId!==v.paragraphId||x.offset===v.offset)return true;let I=e.textOf(x.paragraphId);return x.offset===0&&v.offset===I.length&&I.length>0},f=()=>{let x=e.selectedCells?.(),v=x!==void 0&&x.length>0,{from:S,to:I}=e.orderedRange();if(!e.paragraphOrder().includes(S.paragraphId))return false;let C=Eu(e.layout(),e.selection(),x,e.paragraphOrder()),P=u(S,I,v)?chunkZOZI27AW_cjs.Sh(o(),S.paragraphId):null;return !C&&P===null?false:(a={runProperties:C?YB(C):[],paragraphProperties:P},true)},p=()=>f()?(e.publish(),true):false,g=()=>{let x=a;if(!x)return {wrote:false,armed:false,built:false};let v=e.selectedCells?.(),S=v!==void 0&&v.length>0,{from:I,to:C}=e.orderedRange(),P=!S&&I.paragraphId===C.paragraphId&&I.offset===C.offset,E=P?wu(e.layout(),I,XB):null,R=E?.from??I,w=E?.to??C,M=P&&R.offset===w.offset,O=S?[...chunk6NVZNB7O_cjs.la(e.layout(),v)]:Tu(e.paragraphOrder(),{from:R,to:w});if(O.length===0)return {wrote:false,armed:false,built:false};let B=o(),q=e.displayMode(),j=[];for(let X of O){let te=e.textOf(X),me=S||X!==R.paragraphId?0:R.offset,se=S||X!==w.paragraphId?te.length:w.offset;if(me<se&&x.runProperties.length>0)for(let W of t(B,X,me,se,x.runProperties,q,e.authorFilter()))j.push({op:"setRunProperties",paragraphId:X,start:W.start,end:W.end,properties:W.properties,...W.targetRunIds?{targetRunIds:W.targetRunIds}:{}});let D=x.paragraphProperties!==null||S||X!==w.paragraphId||me===0&&se===te.length&&te.length>0,T=e.paragraphMarkVisible(X);D&&T&&x.runProperties.length>0&&j.push({op:"setParagraphMarkProperties",paragraphId:X,properties:n(B,X,x.runProperties)}),x.paragraphProperties&&T&&j.push({op:"setParagraphProperties",paragraphId:X,properties:[...x.paragraphProperties]});}let z=r.packageRevision();j.length>0&&e.commit(()=>r.applyTreeOps(j,e.selectionMark(),void 0,e.storyScope()),void 0,{keepCellSelection:S});let _=r.packageRevision()!==z,L=M&&x.runProperties.length>0&&(_||j.length===0);return L&&e.armPendingFormats(x.runProperties),{wrote:_,armed:L,built:j.length>0}},b=()=>{let x=g();return x.wrote&&i==="once"&&y(),x.wrote?"painted":x.armed?"armed":x.built?"refused":"nothingToPaint"},h=()=>{i!=="off"&&(i="off",e.publish());},y=()=>{s=null,l=null,h();};return {state:d,capture:p,apply:b,disarm:y,press(){let x=e.now(),v=s!==null&&x-s<OM,S=i;s=x;let I=()=>(s=null,false);return S==="once"&&v?f()?(i="locked",e.publish(),true):(h(),I()):S!=="off"?(h(),l=S==="locked"?x:null,true):l!==null&&x-l<OM?(l=null,true):f()?(i="once",l=null,e.publish(),true):I()},applyIfArmed(){i==="off"||a===null||g().wrote&&i==="once"&&y();}}}var AM=new WeakMap;function QB(e){let t=AM.get(e);if(t!==void 0)return t;let n=[e],r=false;for(;n.length>0&&!r;){let o=n.pop();if(o.kind!=="textValue"){(o.localName==="bidi"||o.localName==="rtl")&&(r=true);for(let i of o.children)n.push(i);}}return AM.set(e,r),r}function FM(e,t=()=>null){let n=null;return {keydown(r){if(r.key==="Shift"&&(r.location===1||r.location===2)&&r.ctrlKey&&!r.altKey&&!r.metaKey&&!r.isComposing&&!r.defaultPrevented){n=r.location===2?"rtl":"ltr";return}r.key!=="Control"&&(n=null);},keyup(r){if(n===null||r.key!=="Shift"&&r.key!=="Control")return;let o=n;if(n=null,r.defaultPrevented)return;let i=t();i===null||!QB(i)||e.setParagraphProperties([{localName:"bidi",paragraphDirection:o}]);},disarm(){n=null;}}}function LM(e,t){return e.addEventListener("keyup",t.keyup),e.addEventListener("pointerdown",t.disarm,{capture:true}),e.addEventListener("focusout",t.disarm),()=>{e.removeEventListener("keyup",t.keyup),e.removeEventListener("pointerdown",t.disarm,{capture:true}),e.removeEventListener("focusout",t.disarm);}}function JB(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),o=Math.min(e.x+e.width,t.x+t.width),i=Math.min(e.y+e.height,t.y+t.height);return o<=n||i<=r?0:(o-n)*(i-r)}function e4(e,t){return JB(e,t)>0?true:e.width===0?t.x<=e.x&&e.x<=t.x+t.width&&!(e.y+e.height<t.y||t.y+t.height<e.y):false}function Lr(e,t,n){if(t.paragraphId===n.paragraphId)return t.offset-n.offset;let r=chunkFDSL5OJU_cjs.Ua(e);return r.indexOf(t.paragraphId)-r.indexOf(n.paragraphId)}function NM(e,t,n){if(!(t>chunkFDSL5OJU_cjs.ce))for(let r of e){if(r.kind==="paragraph"){n(r);continue}if(!(t>=chunkFDSL5OJU_cjs.ce)){for(let o of r.rows)if(!o.isHeaderRepeat)for(let i of o.cells)NM(i.blocks,t+1,n);}}}function gy(e,t){if(t.range){let{paragraphId:o,start:i,end:a}=t.range;return {from:{paragraphId:o,offset:i},to:{paragraphId:o,offset:a}}}if(t.level==="inline"||t.fragments.length===0)return null;let n=null,r=null;for(let o of t.fragments){let i=e.pages[o.pageIndex];i&&NM(i.fragments,0,a=>{if(!e4(o.box,a.box))return;let s={paragraphId:a.paragraphId,offset:0},l={paragraphId:a.paragraphId,offset:chunkFDSL5OJU_cjs.Be(e,a.paragraphId).length};(!n||Lr(e,s,n)<0)&&(n=s),(!r||Lr(e,l,r)>0)&&(r=l);});}return n&&r?{from:n,to:r}:null}function zl(e,t){return t.placeholder?gy(e,t):null}function HM(e){return !e.placeholder&&e.level==="inline"&&e.range!==void 0&&(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")}function t4(e){return e.placeholder}var DM=new WeakMap;function n4(e,t){let n=DM.get(e);if(!n){n=new Map;for(let r of e.contentControls??[]){if(!HM(r))continue;let o=gy(e,r),i=n.get(o.from.paragraphId)??[];i.push(o),n.set(o.from.paragraphId,i);}DM.set(e,n);}return n.get(t)??[]}function hy(e,t){let n=null;for(let r of n4(e,t.paragraphId))t.offset<=r.from.offset||t.offset>=r.to.offset||(!n||r.from.offset<n.from.offset||r.from.offset===n.from.offset&&r.to.offset>n.to.offset)&&(n=r);return n}function _M(e,t,n){let r=hy(e,n);if(!r)return n;let o=t.paragraphId===n.paragraphId?n.offset-t.offset:0;if(o>0)return r.to;if(o<0)return r.from;let i=(r.from.offset+r.to.offset)/2;return n.offset<i?r.from:r.to}function Gl(e,t,n={}){let r=e.contentControls??[];if(r.length===0)return t;let o=Lr(e,t.anchor,t.head)<=0,i=o?t.anchor:t.head,a=o?t.head:t.anchor,s=true;for(;s;){s=false;for(let l of r){let c=n.atomic===true&&HM(l);if(!l.placeholder&&!c)continue;let d=gy(e,l);if(!d)continue;let u=Lr(e,i,a)===0,f=Lr(e,i,d.from);(u?(t4(l)?f>=0:f>0)&&Lr(e,i,d.to)<0:Lr(e,i,d.to)<0&&Lr(e,a,d.from)>0)&&(Lr(e,d.from,i)<0&&(i=d.from,s=true),Lr(e,d.to,a)>0&&(a=d.to,s=true));}}return o?{anchor:i,head:a}:{anchor:a,head:i}}var r4=500,BM=4,Ka=40,df=12;function o4(e,t){return (e.contentControls??[]).find(n=>n.id===t)??null}function $M(e,t){let n=t.contentControlId;if(!n){let o={x:t.caret.x,y:t.caret.y+t.caret.height/2},i=chunkFDSL5OJU_cjs.ne(e,t.pageIndex,o);return i?.placeholder?i:null}let r=o4(e,n);return r?.placeholder?r:null}var i4=new Set(["dropdown","comboBox","date","buildingBlockGallery"]);function qM(e,t={}){if(t.mode==="native")return {dragging:()=>false,cancelGesture:()=>{},destroy:()=>{}};let{pagesLayer:n}=e,r=t.atomicInlineControls===true,o=mt(()=>n),i=null,a=null,s=null,l=0,c=0,d=0,u=0,f=null;function p(T,W){if(!s){let K=n.getBoundingClientRect();s={left:K.left,top:K.top};}let $=e.scale()||1;return {x:(T-s.left)/$,y:(W-s.top)/$}}function g(T){return {scope:{kind:"headerFooter",rId:T.rId},pageIndex:T.pageIndex,kind:T.kind,partName:T.partName,variant:T.variant}}function b(T,W){let $=e.layout(),K=p(T,W),Y=chunkFDSL5OJU_cjs.he($,K.y),re=$.pages[Y];if(!re)return null;let N=e.measurer();return chunkFDSL5OJU_cjs.ke($,Y,{x:K.x-re.contentBox.x-e.pageOffsetX(Y),y:K.y-re.contentBox.y},N?{measurer:N}:{})}function h(T,W){let $=e.activeNote?.()??null;if($){let U=e.layout(),G=zd(U,p(T,W),e.pageOffsetX);if(!G||G.scopeId!==$.scopeId)return null;let ee=e.measurer();return chunkFDSL5OJU_cjs.le(U,G.pageIndex,G.fragments,G.local,{...ee?{measurer:ee}:{}})}let K=e.activeHeaderFooter?.()??null;if(!K)return b(T,W);let Y=e.layout(),re=p(T,W),N=Qm(Y,re,e.pageOffsetX);if(N&&Ud(N.story,g(K))){let U=e.measurer();return Gm(Y,N.pageIndex,N.story,N.local,U?{measurer:U}:{})}return null}function y(T,W){let{story:$,pageIndex:K,kind:Y}=T;return {rId:$.rId,pageIndex:K,kind:Y,partName:$.partName,variant:$.variant,...W?{position:W}:{}}}function x(T){let W=e.measurer();return Gm(e.layout(),T.pageIndex,T.story,T.local,W?{measurer:W}:{})?.position??void 0}let v=new WeakMap;function S(T,W){let $=e.activeNote?.();if($){let N=Ia(T,null,$.scopeId).indexOf(W);return N===-1?-1:N}let K=e.activeHeaderFooter?.();if(K){let N=Ia(T,g(K)).indexOf(W);return N===-1?-1:N}let Y=v.get(T);return Y||(Y=new Map(chunkFDSL5OJU_cjs.Ua(T).map((re,N)=>[re,N])),v.set(T,Y)),Y.get(W)??-1}function I(T,W,$){let K=S(T,W.paragraphId),Y=S(T,$.paragraphId);return K!==Y?K<Y:W.offset<$.offset}function C(T,W,$){if($==="character")return {from:W,to:W};let K=W.paragraphId;if($==="paragraph"){let Y=chunkFDSL5OJU_cjs.Be(T,K);return {from:{paragraphId:K,offset:0},to:{paragraphId:K,offset:Y.length}}}return wu(T,W,chunkFDSL5OJU_cjs.Ce(T,K))}function P(T,W,$,K,Y){let re=Y?$M(T,Y):null,N=re?zl(T,re)??C(T,$,K):C(T,$,K),U=I(T,N.from,W.from)?{anchor:W.to,head:N.from}:{anchor:W.from,head:N.to};return Gl(T,U,{atomic:r})}function E(){return e.container.closest(".docx-editor__scroll-container")}function R(T,W,$){if($<T+Ka){let K=Math.max(0,T+Ka-$);return -Math.min(df,K/Ka*df)}if($>W-Ka){let K=Math.max(0,$-(W-Ka));return Math.min(df,K/Ka*df)}return 0}function w(){f!==null&&(o.cancelAnimationFrame(f),f=null);}function M(){f=null;let T=a,W=E();if(!T||!W)return;let $=W.getBoundingClientRect(),K=R($.top,$.bottom,T.clientY);K!==0&&(W.scrollTop+=K,s=null,B(T.clientX,T.clientY),f=o.requestAnimationFrame(M));}function O(){if(f!==null||!a)return;let T=E();if(!T)return;let W=T.getBoundingClientRect();R(W.top,W.bottom,a.clientY)!==0&&(f=o.requestAnimationFrame(M));}function B(T,W){let $=a;if(!$)return;let K=h(T,W);K&&((e.isReadOnlyPosition?.(K.position)??e.isReadOnlyParagraph?.(K.position.paragraphId))||q($,K)||($.caret=K.caret,e.setSelection(P(e.layout(),$.anchorRange,K.position,$.granularity,K),K.caret)));}function q(T,W){let $=T.anchorCell;if(!$)return false;if(!W.cell||W.cell.tableId!==$.tableId)return T.cellDragging;if(!T.cellDragging&&W.cell.cellId===$.cellId)return false;let K=chunk6NVZNB7O_cjs.ja(e.layout(),$,W.cell);return K?(T.cellDragging=true,e.setCellSelection(K),true):T.cellDragging}function j(T){let W=Date.now(),$=W-c;return l=Math.abs(T.clientX-d)<=BM&&Math.abs(T.clientY-u)<=BM&&$>=0&&$<=r4?l+1:1,c=W,d=T.clientX,u=T.clientY,l}let z=["character","word","paragraph"],_=T=>{if(T.button!==0)return;if(e.onChangeBarToggle&&T.target?.closest?.("[data-docx-change-bar-toggle]")){T.preventDefault(),T.stopPropagation(),e.onChangeBarToggle();return}let W=T.target?.closest?.("[data-docx-cc-widget]");if(W){if(T.preventDefault(),T.stopPropagation(),W.hasAttribute("disabled")||W.dataset.disabledReason)return;let we=W.dataset.docxCcId,De=W.dataset.docxCcWidget;we&&De&&e.onContentControlWidget?.(we,De);return}if(T.pointerType==="touch")return;a&&me(),s=null;let $=e.layout(),K=p(T.clientX,T.clientY),Y=e.activeHeaderFooter?.()??null,re=e.activeNote?.()??null,N=Qm($,K,e.pageOffsetX),U=N!==null&&MI($,N,K,e.pageOffsetX,Y!==null&&Ud(N.story,g(Y)),e.measurer()),G=U?null:N,ee=zd($,K,e.pageOffsetX),de=U?null:T.target?.closest("[data-docx-hf]"),oe=!!(de||G),ce=T.target,he=ce?.closest("[data-docx-note-ref]"),Ce=ce?.closest("[data-docx-note-mark-back]"),ct=null,Ae=()=>ct??=j(T);if(he?.dataset.docxNoteScope){T.preventDefault(),e.focus(),e.enterNote?.(he.dataset.docxNoteScope);return}if(Ce){T.preventDefault(),e.focus(),e.exitNote?.(true);return}if(ee&&!oe){let we=e.measurer?.(),De=chunkFDSL5OJU_cjs.le($,ee.pageIndex,ee.fragments,ee.local,{...we?{measurer:we}:{}});if(!re||re.scopeId!==ee.scopeId){T.preventDefault(),e.focus(),e.enterNote?.(ee.scopeId,De?{paragraphId:De.position.paragraphId,offset:De.position.offset}:void 0,ee.pageIndex);return}if(re.pageIndex!==ee.pageIndex){T.preventDefault(),e.focus(),e.enterNote?.(ee.scopeId,De?{paragraphId:De.position.paragraphId,offset:De.position.offset}:void 0,ee.pageIndex);return}}else if(re){if(!zm($,K,e.pageOffsetX))return;e.exitNote?.(false),e.focus();}if(Y)if(G&&Ud(G.story,g(Y)))G.pageIndex!==Y.pageIndex&&e.enterHeaderFooter?.(y(G,x(G)));else if(G&&G.story.rId){T.preventDefault(),e.focus(),e.enterHeaderFooter?.(y(G,x(G)));return}else if(zm($,K,e.pageOffsetX)){T.preventDefault(),e.exitHeaderFooter?.(true),e.focus();return}else {let we=Ae()>=2?Ym($,K,e.pageOffsetX):null;we&&(T.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(we.kind,we.pageIndex));return}else if(oe&&Ae()>=2){if(G?.story.rId)T.preventDefault(),e.focus(),e.enterHeaderFooter?.(y(G,x(G)));else if(Tr(de)){let we=de.dataset.docxRId,De=de.dataset.docxHf,Rt=de.closest("[data-page-index]")?.getAttribute("data-page-index"),Pt=Rt!=null?Number(Rt):NaN;if((De==="header"||De==="footer")&&Number.isInteger(Pt))if(we){let Dr=$.pages[Pt]?.[De];T.preventDefault(),e.focus(),e.enterHeaderFooter?.({rId:we,pageIndex:Pt,kind:De,partName:Dr?.partName??"",variant:Dr?.variant??"default"});}else $.pages[Pt]?.[De]||(T.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(De,Pt));}return}else if(Ae()>=2){let we=Ym($,K,e.pageOffsetX);if(we){T.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(we.kind,we.pageIndex);return}}let Ie=h(T.clientX,T.clientY);if(!Ie)return;if(e.isReadOnlyPosition?.(Ie.position)??e.isReadOnlyParagraph?.(Ie.position.paragraphId)){T.preventDefault();return}if(Ae()===2&&e.onTextFormDoubleClick?.(T))return;T.preventDefault(),e.focus();try{n.setPointerCapture(T.pointerId);}catch{}i=n.ownerDocument,i.addEventListener("pointermove",X),i.addEventListener("pointerup",te),i.addEventListener("pointercancel",te);let Re=Ae(),dt=T.shiftKey?"character":z[(Re-1)%z.length],Nt=$M($,Ie);if(Nt&&!T.shiftKey){let we=()=>{n.contentEditable!=="false"&&Re===1&&i4.has(Nt.controlType)&&e.onContentControlWidget?.(Nt.id,Nt.controlType);};if(e.selectContentControl?.(Nt.id)){let Rt=e.selection(),Pt=I($,Rt.anchor,Rt.head)||Rt.anchor.paragraphId===Rt.head.paragraphId&&Rt.anchor.offset===Rt.head.offset?{from:Rt.anchor,to:Rt.head}:{from:Rt.head,to:Rt.anchor};a={pointerId:T.pointerId,granularity:"character",anchorRange:Pt,anchorCell:Ie.cell,cellDragging:false,clientX:T.clientX,clientY:T.clientY},we();return}let De=zl($,Nt);if(De){a={pointerId:T.pointerId,granularity:"character",anchorRange:De,anchorCell:Ie.cell,cellDragging:false,clientX:T.clientX,clientY:T.clientY},L(()=>e.setSelection({anchor:De.from,head:De.to})),we();return}}if(T.shiftKey){let we=e.selection();a={pointerId:T.pointerId,granularity:dt,caret:Ie.caret,anchorRange:{from:we.anchor,to:we.anchor},anchorCell:Ie.cell,cellDragging:false,clientX:T.clientX,clientY:T.clientY},L(()=>e.setSelection(P($,{from:we.anchor,to:we.anchor},Ie.position,dt,Ie),Ie.caret));}else {let we=(r&&dt==="word"?hy($,Ie.position):null)??C($,Ie.position,dt);a={pointerId:T.pointerId,granularity:dt,caret:Ie.caret,anchorRange:we,anchorCell:Ie.cell,cellDragging:false,clientX:T.clientX,clientY:T.clientY},L(()=>e.setSelection(Gl($,{anchor:we.from,head:we.to},{atomic:r}),Ie.caret));}};function L(T){try{T();}catch(W){throw me(),W}}let X=T=>{let W=a;!W||T.pointerId!==W.pointerId||(T.preventDefault(),W.clientX=T.clientX,W.clientY=T.clientY,B(T.clientX,T.clientY),O());},te=T=>{let W=a;if(!W||T.pointerId!==W.pointerId)return;me();try{n.releasePointerCapture(W.pointerId);}catch{}let $=e.cellSelection();$?e.setCellSelection($):e.setSelection(e.selection(),W.caret),T.type==="pointerup"&&(e.onTextFormPointerUp?.(T),e.onSelectionSettled?.());};function me(){if(a)try{n.releasePointerCapture(a.pointerId);}catch{}a=null,s=null,w(),i?.removeEventListener("pointermove",X),i?.removeEventListener("pointerup",te),i?.removeEventListener("pointercancel",te),i=null;}let se=()=>{s=null;};n.addEventListener("pointerdown",_);let D=[e.listeners.onWindow("scroll",se,{capture:true,passive:true}),e.listeners.onWindow("resize",se,{passive:true})];return {dragging:()=>a!==null,cancelGesture:me,destroy(){me(),n.removeEventListener("pointerdown",_);for(let T of D)T();}}}function WM(e,t,n){let r=e??chunkFDSL5OJU_cjs.ab;return {view:()=>r,projection:()=>chunkFDSL5OJU_cjs.$a(r),changeBars:()=>t?r==="all-markup"||r==="simple-markup"?r:"none":"all-markup",set:o=>{r=o;},filter:o=>t&&chunkFDSL5OJU_cjs.$a(r)!=="all-markup"?chunkFDSL5OJU_cjs.bb(o):o,toggleByChangeBar:()=>{t&&n(r==="simple-markup"?"all-markup":"simple-markup");}}}function jM(e){let{pagesLayer:t,session:n}=e,r=()=>t.ownerDocument,o=false,i=null,a,s;function l(){let{head:R}=e.selection();return s&&s.position.paragraphId===R.paragraphId&&s.position.offset===R.offset?s.lineId:void 0}function c(R){let w=Di(R?.anchorNode,t)??Di(R?.focusNode,t);w!==void 0&&(a=w);}function d(R){return a??Di(R?.anchorNode,t)??Di(R?.focusNode,t)}let u=false,f=false,p=false,g=null,b=false;function h(){let R=r().getSelection(),w=qa(t,R);return !w||(c(R),Lt(w,e.selection()))?false:(e.adoptSelection(w),true)}function y(){let R=r().activeElement;if(R&&t.contains(R))return true;if(R&&R!==r().body&&R!==r().documentElement)return false;let w=r().getSelection();if(!w||w.rangeCount===0)return true;let M=w.anchorNode;return !M||!M.isConnected?true:t.contains(M)}let x=()=>{let R=r().getSelection(),w=qa(t,R);if(!w){if(!Uh(t,R))return;u=false;let M=Ve(e.selection().head);if(Lt(M,e.selection()))return;e.setSelection(M);return}u=false,c(R),!Lt(w,e.selection())&&e.setSelection(w);};function v(R){let w=e.textOf(R),M=IO(t,R,w,r().getSelection()?.anchorNode??null);if(M===null)return;let O=RO(R,w,M);if(!O)return;let B=O.ops.find(X=>X.op==="deleteText"),q=O.ops.find(X=>X.op==="insertText"),j=q&&B?e.replacementOffset?.(R,B.start,B.end):void 0,z=q&&j!==void 0&&j!==q.offset?O.ops.map(X=>X===q?{...q,offset:j}:X):O.ops,_=q?e.pendingFormatOps?.(R,j??q.offset,q.text.length,B?{start:B.start,end:B.end}:void 0)??[]:[],L=e.storyScope();e.commit(()=>{let X=e.applyOps([...z,..._],e.selectionMark(),L);return _.length===0||!X.rejected?X:e.applyOps(z,e.selectionMark(),L)}),e.setSelection(Ve({paragraphId:R,offset:q&&j!==void 0?j+q.text.length:O.caret}));}function S(){o||p||e.isGesturing?.()||e.holdsCellSelection?.()||I()||u&&x();}function I(){if(!f||u)return false;if(!i)return true;let R=qa(t,r().getSelection());return R!==null&&Lt(R,i)}function C(R){R.type.startsWith("pointer")&&R.button!==0||(u=true);}let P=false;function E(R=false){if(e.updateCaret(),!R&&!y())return;o=true;let w=e.now(),M=e.domSelection?.()??e.selection();u=false;let O=r().getSelection(),B=d(O),q=l(),j=dO(t,M,O,{...B!==void 0?{preferredPageIndex:B}:{},...q!==void 0?{preferredLineId:q}:{}});j&&c(O),i=j?M:null,j||(f=true),e.recordSelectionMs(e.now()-w),queueMicrotask(()=>{o=false;});}return t.addEventListener("pointerdown",C,true),t.addEventListener("selectstart",C,true),{adoptBeforePaint(){let R=e.holdsCellSelection?.()===true||e.isGesturing?.()===true||e.hasPendingInput?.()===true,w=f||R||!u?false:h();return e.hasPendingInput?.()!==true&&(f=false),w},noteModelMoved(){f=true,s=void 0;},noteSelectionSettled(){f=false;},mirrorToDom:E,adoptBeforeInput:S,isComposing:()=>p,noteBrowserSelectionFixup(){P=true;},onSelectionChange:()=>{if(!o&&!p&&!e.isGesturing?.()&&!e.holdsCellSelection?.()){if(P&&Uh(t,r().getSelection())){let R=qa(t,r().getSelection());if((R===null||!Lt(R,e.selection()))&&(P=false,!u)){E();return}}I()||x();}},onCompositionStart:()=>{S(),p=true;let R=e.selection();b=R.anchor.paragraphId!==R.head.paragraphId,g=R.head.paragraphId,n.beginComposition(e.storyScope());},onCompositionEnd:R=>{p=false;let w=g??e.selection().head.paragraphId;g=null;let M=b;b=false;let O=e.storyScope(),B=n.revisionFor(O);if(M){let q=R?.data??"";q.length>0&&e.replaceSelectionWith?.(q);}else v(w);n.endComposition(),n.revisionFor(O)===B&&e.discardPaint?.(),e.flushToPaint()||e.render();},selectionPageIndex:()=>a,selectionLineId:l,caretPreference(R=a){let w=l();return {...R!==void 0?{preferredPageIndex:R}:{},...w!==void 0?{preferredLineId:w}:{}}},notePointerCaret(R){s=R,R&&(a=R.pageIndex);},destroy(){t.removeEventListener("pointerdown",C,true),t.removeEventListener("selectstart",C,true),u=false;}}}var a4=32;function yy(e,t,n,r){if(!(e.kind==="textValue"||r>a4)){if(e.kind==="paragraph"){n.has(e.id)||n.set(e.id,t);return}for(let o of e.children)yy(o,t,n,r+1);}}var KM=new WeakMap;function VM(e,t,n,r){if(e.kind==="paragraph"||e.kind==="textValue"){yy(e,t,n,0);return}let o=KM.get(e);if(!o){let i=new Map;yy(e,0,i,0),o=[...i.keys()],KM.set(e,o);}for(let i of o)n.has(i)||n.set(i,t);}function c4(e,t){let n=chunkFDSL5OJU_cjs.Cd(e),r=chunkFDSL5OJU_cjs.Dc(n),o=0,i=chunkFDSL5OJU_cjs.Yc(e),a=new Map;for(let s=0;s<i.length;s+=1){let l=i[s];for(let c=l.blockStart;c<l.blockEndExclusive;c+=1){let d=n[c];if(d){for(;o<r.length&&r[o]!==d;)VM(r[o],s,a),o+=1;o+=1,VM(d,s,a);}}}return a}var UM=new WeakMap;function d4(e){return !(!e.story||e.origin===chunkZOZI27AW_cjs.g.mutationUndo||e.origin===chunkZOZI27AW_cjs.g.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.includes(chunkZOZI27AW_cjs.l.section))}function u4(e,t){t.story&&t.story.kind!=="body"||d4(t)||(e.map=null);}function f4(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>u4(t,n)));}function p4(e,t){let n=UM.get(e);return n||(n={map:null,subscribed:false},UM.set(e,n)),f4(e,n),n.map||(n.map=c4(t)),n.map}function zM(e,t,n){return n.startsWith(`${t.name}#`)?p4(e,t).get(n)??null:null}var GM=32;function Zl(e,t,n,r,o="all-markup",i){let a=e.part(),s=chunkFDSL5OJU_cjs.Yc(a,o,i);if(s.length<=1)return 0;let l=chunkFDSL5OJU_cjs.Zc(a,o,i),c=f=>{let p=l.indexOf(f);if(p!==-1)return p;let g=l.findIndex(b=>b>f);return g===-1?Math.max(0,l.length-1):g},d=by(e,t);if(d!==null)return c(d);if(n.kind==="headerFooter"){if(r!==void 0&&s[r]!==void 0)return r;let f=e.headerFooterResolutionBySection().findIndex(p=>[p.headers,p.footers].some(g=>[...g.values()].some(b=>b.rId===n.rId)));return f===-1?0:c(f)}let u=g4(e,t);if(u!==null){let f=by(e,u);if(f!==null)return c(f)}return 0}function ZM(e,t,n,r,o="all-markup",i){let a=e.part(),s=chunkFDSL5OJU_cjs.Yc(a);if(s.length<=1)return {kind:"whole-document"};let l=chunkFDSL5OJU_cjs.Zc(a,o,i),c=by(e,t),d=Zl(e,t,n,r,o,i),u=l[d]??d;if(c!==null&&c===u)return {kind:"anchor",paragraphId:t};let f=s[u];if(!f)return {kind:"unaddressable"};let p=chunkFDSL5OJU_cjs.Cd(a);for(let g=f.blockStart;g<f.blockEndExclusive;g+=1){let b=m4(p[g]);if(b!==null)return {kind:"anchor",paragraphId:b}}return {kind:"unaddressable"}}function m4(e){if(!e)return null;let t=(n,r)=>{if(n.kind==="textValue"||r>GM)return null;if(n.kind==="paragraph")return n.id;for(let o of n.children){let i=t(o,r+1);if(i!==null)return i}return null};return t(e,0)}function by(e,t){return zM(e,e.part(),t)}function g4(e,t){let n=e.currentPackage();for(let r of ["footnote","endnote"]){let o=chunkZOZI27AW_cjs.qh(n,r);if(!(!o||!t.startsWith(`${o.name}#`)))for(let i of chunkZOZI27AW_cjs.Nc(o.root)){let a=chunkZOZI27AW_cjs.Cc(i);if(a===null||!h4(i,t))continue;return chunkZOZI27AW_cjs.rh(e.part()).find(l=>l.noteKind===r&&l.noteId===a)?.paragraphId??null}}return null}function h4(e,t){let n=(r,o)=>{if(r.kind==="textValue"||o>GM)return false;if(r.kind==="paragraph"&&r.id===t)return true;for(let i of r.children)if(n(i,o+1))return true;return false};return n(e,0)}function Va(e,t){if(t===void 0)return {};let n=`${e}Autospacing`,r=`${e}Lines`;return t===null?{[e]:null,[n]:null,[r]:null}:{[e]:String(Math.round(t*20)),[n]:"0",[r]:null}}function uf(e){return e===void 0?{}:e===null?{line:null,lineRule:null}:e.rule==="multiple"?{line:String(Math.round(e.value*240)),lineRule:"auto"}:{line:String(Math.round(e.value*20)),lineRule:e.rule==="exact"?"exact":"atLeast"}}function XM(e){return {val:e?"1":"0"}}function QM(e){let t=null,n=null,r=null,o=(a,s)=>(e.setLastRejection(null),e.commit(()=>{let l=e.applyOps(Array.isArray(a)?a:[a],e.selectionMark());return l.rejected&&e.setLastRejection(String(l.reason??"rejected")),l},s),e.lastRejection()===null),i=(a,s,l)=>{let c=chunkZOZI27AW_cjs.tc(a);if(!c)return e.setLastRejection("invalid note scope id"),false;let d=e.session.currentPackage(),u=chunkZOZI27AW_cjs.qh(d,c.noteKind),f=u?chunkZOZI27AW_cjs.Pc(u.root,c.noteId):null;if(!u||!f)return e.setLastRejection("note not found"),false;if(e.exitHeaderFooter?.(),e.activeScope().kind==="body"){let p=e.selection();r={anchor:{paragraphId:p.anchor.paragraphId,offset:p.anchor.offset},head:{paragraphId:p.head.paragraphId,offset:p.head.offset}};}if(t={kind:"note",id:chunkZOZI27AW_cjs.sc(c.noteKind,c.noteId)},n=Number.isInteger(l)?l:null,s)e.setSelection({anchor:s,head:s});else {let p=y4(f),g=new Set(e.session.paragraphIdsIn({kind:"notesPart",noteKind:c.noteKind})),b=p.find(h=>g.has(h.id));if(b){let h=vy(b);e.setSelection({anchor:{paragraphId:b.id,offset:h},head:{paragraphId:b.id,offset:h}});}}return e.noteModelMoved(),e.render(),n??=e.revealNote(t.id),e.notify(),true};return {insertNote(a){if(e.activeScope().kind!=="body")return e.setLastRejection("insertNote requires body scope"),false;let s=e.deleteSelectionPlan(),l=s.collapseTo;if(!(s.ops.length===0||o(s.ops,()=>({anchor:{...l},head:{...l}}))))return false;let d=YM(e.session.currentPackage(),a);if(!o({op:"insertNote",noteKind:a,paragraphId:l.paragraphId,offset:l.offset},()=>{let g={paragraphId:l.paragraphId,offset:l.offset+1};return {anchor:g,head:g}}))return s.ops.length>0&&e.undo(),false;let p=[...YM(e.session.currentPackage(),a)].find(g=>!d.has(g));return p===void 0?true:i(chunkZOZI27AW_cjs.sc(a,p))},deleteNote(a,s){return o({op:"deleteNote",noteKind:a,noteId:s})},convertNote(a,s){return o({op:"convertNote",fromKind:a,noteId:s})},convertAllNotes(a){return o({op:"convertAllNotes",fromKind:a})},setNoteProperties(a){return o({op:"setNoteProperties",scope:a.scope,sectionIndex:a.sectionIndex,footnote:a.footnote,endnote:a.endnote})},enterNote:i,exitNote(a=true){if(!t)return;let s=r;t=null,n=null,r=null,e.setActiveScopeBodyOrHf({kind:"body"}),a&&s&&e.setSelection(s),e.noteModelMoved(),e.render(),e.notify();},activeNoteScope(){return t},activeNotePageIndex(){return n},setActiveNotePageIndex(a){!t||!Number.isInteger(a)||n!==a&&(n=a);}}}function y4(e){let t=[],n=(r,o)=>{if(!(o>32)){if(r.kind==="paragraph"){t.push(r);return}if("children"in r)for(let i of r.children)n(i,o+1);}};return n(e,0),t}function vy(e){let t=chunkZOZI27AW_cjs.pg(e)[0];return t&&chunkZOZI27AW_cjs.yc(t.node)?t.end:0}function YM(e,t){let n=chunkZOZI27AW_cjs.qh(e,t),r=new Set;if(!n)return r;for(let o of chunkZOZI27AW_cjs.Nc(n.root)){if(!chunkZOZI27AW_cjs.Ec(o))continue;let i=chunkZOZI27AW_cjs.Cc(o);i!==null&&r.add(i);}return r}var b4=720;function xy(e,t,n=b4){return tA(e,t,e+t*n)}function eA(e,t,n){let r=t>0?Math.floor(e/n)+1:Math.ceil(e/n)-1;return tA(e,t,r*n)}function tA(e,t,n){return t>0?Math.max(e,Math.min(chunkFDSL5OJU_cjs.rd,n)):Math.max(0,n)}function Sy(e){let t;for(let r of e){if(r.localName!=="ind")continue;let o=r.attributes?.left??r.attributes?.start;o!==void 0&&(t=o);}let n=chunkZOZI27AW_cjs.sd(t);return n===null||Math.abs(n)>9999999?0:n}function JM(e,t){return e.kind==="midLine"?false:e.kind==="empty"||t<=e.offset}function nA(e,t,n,r,o){let{from:i,to:a}=e;if(i.paragraphId===a.paragraphId&&i.offset===a.offset)return null;let s=t.length>1?n.start(a.paragraphId):null,c=s!==null&&JM(s,a.offset)&&!(s.kind==="empty"&&n.endsStory(a.paragraphId))?t.slice(0,-1):t;if(c.length>1)return {write:"stepLeft",paragraphs:c};if(!JM(n.start(i.paragraphId),i.offset))return null;let{resolved:d,direct:u}=n.firstLine(i.paragraphId);return r==="increase"?{write:d>=0&&d<o?"setFirstLine":"stepLeft",paragraphs:c}:{write:u&&d>0?"clearFirstLine":"stepLeft",paragraphs:c}}function v4(e,t){let n=Number.POSITIVE_INFINITY,r=false;for(let{line:o}of chunkFDSL5OJU_cjs.Fd(e).get(t)??[]){if(!r&&(r=true,chunkFDSL5OJU_cjs.Pa(o)[0]?.paragraphId!==t))return {kind:"midLine"};let i=chunkFDSL5OJU_cjs.Qa(o,t);if(i){for(let a of i.spans)a.range.end>a.range.start&&(n=Math.min(n,a.range.start));for(let a of i.drawings)n=Math.min(n,a.start);if(Number.isFinite(n))break}}return Number.isFinite(n)?{kind:"start",offset:n}:{kind:"empty"}}var x4=["firstLine","hanging","firstLineChars","hangingChars"];function rA(e,t,n){let r=new Map;return {start(o){let i=r.get(o);if(i)return i;let a=v4(e,o);if(a.kind==="start"){let s=chunkZOZI27AW_cjs.Xa(t,o),l=s?.kind==="paragraph"?vy(s):0;l>a.offset&&(a={kind:"start",offset:l});}return r.set(o,a),a},endsStory:o=>n[n.length-1]===o,firstLine(o){let i=ph(e,o),a=chunkZOZI27AW_cjs.Sh(t,o).find(l=>l.localName==="ind")?.attributes,s=x4.some(l=>a?.[l]!==void 0);return {resolved:i?Pu(i.indent):0,direct:s}}}}function oA(e,t){let n=(r,o)=>r.paragraphId===o.paragraphId&&r.offset===o.offset;return (e.contentControls??[]).some(r=>{if(!r.placeholder)return false;let o=zl(e,r);return o!==null&&n(o.from,t.from)&&n(o.to,t.to)})}var Xl="a section break that changes where the next section starts cannot be suggested; turn off suggesting to insert it",Ua="a section break cannot be inserted inside a table cell",pf="a section break cannot change a section that a locked or linked content control holds",Yl="a section break cannot be inserted in locked or linked content";function S4(e){let t=new Set,n=new Set,r=i=>{if(i.kind==="textValue"||!("localName"in i)||i.localName!=="sdt")return false;let a=i.children?.find(s=>s.kind!=="textValue"&&"localName"in s&&s.localName==="sdtPr");return !a||a.kind==="textValue"?false:(a.children??[]).some(s=>{if(s.kind==="textValue"||!("localName"in s)||s.namespaceUri!==chunkZOZI27AW_cjs.pa)return false;if(s.localName==="dataBinding")return true;if(s.localName!=="lock")return false;let l=s.attributes?.find(c=>c.localName==="val"&&c.namespaceUri===chunkZOZI27AW_cjs.pa)?.value;return l==="contentLocked"||l==="sdtContentLocked"})},o=(i,a,s)=>{if(i.kind==="textValue")return;if(i.kind==="paragraph"){a&&t.add(i.id),s&&n.add(i.id);return}let l=a||i.kind==="table",c=s||r(i);for(let d of i.children??[])o(d,l,c);};return o(e.root,false,false),{inCell:t,held:n}}var w4=32;function k4(e){let t=new Set(chunkZOZI27AW_cjs.pl(e).map(n=>chunkZOZI27AW_cjs.sl(n)));return chunkZOZI27AW_cjs.ol(e)||t.add("nextPage"),t.size===1?[...t][0]:null}function ky(e,t){let n=t.replaceAt??t.collapseTo;return chunkZOZI27AW_cjs.ql(e,n.paragraphId)?t.collapseTo:n}var wy=(e,t)=>chunkZOZI27AW_cjs.ig(e,t)||chunkZOZI27AW_cjs.fg(e,t).content;function ff(e,t,n,r){if(chunkZOZI27AW_cjs.ql(e,t))return Ua;if(wy(e,t))return Yl;let{section:o,ownerId:i}=chunkZOZI27AW_cjs.rl(e,t);return chunkZOZI27AW_cjs.sl(o)===n?null:i!==null&&wy(e,i)?pf:r?Xl:null}function iA(e){let{breakType:t,suggesting:n}=e;if(e.cellRectangle)return Ua;if(e.caretParagraphId!==null)return ff(e.part(),e.caretParagraphId,t,n);let r=S4(e.part());if(!n&&r.inCell.size===0&&r.held.size===0)return null;let{from:o,to:i}=e.orderedRange(),a=e.part(),s=chunkZOZI27AW_cjs.rl(a,o.paragraphId),l=chunkZOZI27AW_cjs.rl(a,i.paragraphId),c=s.section===l.section,d=c?chunkZOZI27AW_cjs.sl(s.section):k4(a),u=e.paragraphOrder(),f=u.indexOf(o.paragraphId),p=u.indexOf(i.paragraphId),g=f===-1||p===-1?null:u.slice(f,p+1),b=g!==null&&!g.some(y=>r.inCell.has(y))&&!g.some(y=>r.held.has(y));if(d!==null&&d!==t){if(b&&c&&s.ownerId!==null&&wy(a,s.ownerId))return pf;if(n&&b)return Xl}if(b&&d!==null)return null;if(g===null||g.length-1>w4)return n&&d!==null&&d!==t?Xl:null;let h=ky(a,e.deleteSelectionPlan());return ff(a,h.paragraphId,t,n)}var I4=[["contextualSpacing","contextualSpacing"],["keepNext","keepNext"],["keepLines","keepLines"],["widowControl","widowControl"],["pageBreakBefore","pageBreakBefore"]];function R4(e,t){let n={...e??{}};return delete n.leftChars,delete n.startChars,e?.start!==void 0&&(n.start=t),(e?.start===void 0||e.left!==void 0)&&(n.left=t),n}function mf(e,t,n,r){let o={...e};if(delete o[`${t}Chars`],delete o[`${n}Chars`],r===null)return delete o[t],delete o[n],o;let i=String(r),a=e[n]!==void 0;return a&&(o[n]=i),(!a||e[t]!==void 0)&&(o[t]=i),o}function aA(e,t){let n={...e};return delete n.firstLineChars,delete n.hangingChars,t===null?(delete n.firstLine,delete n.hanging,n):(t>=0?(n.firstLine=String(t),n.hanging="0"):(n.hanging=String(-t),n.firstLine="0"),n)}function sA(e){let{session:t,commit:n,orderedStart:r,orderedRange:o,selectionMark:i,collapsedAt:a}=e,s=e.deleteSelectionPlan,l=()=>t.partFor(e.storyScope())??t.part(),c=(R,w,M)=>t.applyTreeOps(R,w,M,e.storyScope()),d=nE({session:t,storyPart:l}),u=()=>e.paragraphOrder(),f={get value(){return e.layout()}};function p(){let R=e.selectedCells?.();return R&&R.length>0?R:null}function g(R){let w=false;return n(()=>{let M=R();return w=M.committed,M},void 0,{keepCellSelection:p()!==null}),w}function b(R=o()){if(p()!==null)return [...chunk6NVZNB7O_cjs.la(f.value,p())];let{from:w,to:M}=R,O=u(),B=O.indexOf(w.paragraphId),q=O.indexOf(M.paragraphId);return B===-1||q===-1?null:O.slice(B,q+1)}let h=8;function y(R){return x(R)?.level??null}function x(R){return chunkFDSL5OJU_cjs.Ta(f.value,R)}function v(R){let w=x(R);return w?w.numFmt==="bullet"?"bullet":"ordered":null}function S(R,w){let M=u(),O=M.indexOf(R[0]??""),B=M.indexOf(R[R.length-1]??"");if(O===-1||B===-1)return null;for(let q of [O-1,B+1]){let j=M[q];if(!j)continue;let z=x(j);if(z&&(z.numFmt==="bullet"?"bullet":"ordered")===w)return z.numId}return null}function I(R,w){return w<0||w>h?false:e.numberingLevelExists(R.numId,w)}function C(R,w){return w<0||w>h?false:e.numberingLevelExists(R.numId,w)?true:t.ensureNumberingLevel(R.numId,w,R.numFmt==="bullet"?"bullet":"ordered")&&e.numberingLevelExists(R.numId,w)}function P(R,w,M){let O=w==="increase"?1:-1,B=[];for(let q of R){let j=Or(f.value,q),z=x(q),_=z?.level??null;if(z&&_!==null){let se=_+O;if(se<0||se>h||!C(z,se))continue;B.push({op:"setListLevel",paragraphId:q,level:se});continue}let L=Sy(j),X=M===void 0?xy(L,O):eA(L,O,M);if(X===L)continue;let te=chunkZOZI27AW_cjs.Sh(l(),q),me=te.find(se=>se.localName==="ind");B.push({op:"setParagraphProperties",paragraphId:q,properties:chunkZOZI27AW_cjs.Uh(te,{localName:"ind",attributes:R4(me?.attributes,String(X))})});}return B.length===0?false:g(()=>c(B,i()))}function E(R,w){let M=[];for(let O of R){let B=chunkZOZI27AW_cjs.Sh(l(),O),j={...B.find(z=>z.localName==="ind")?.attributes??{}};w.left!==void 0&&(j=mf(j,"left","start",w.left)),w.right!==void 0&&(j=mf(j,"right","end",w.right)),w.firstLine!==void 0&&(j=aA(j,w.firstLine)),M.push({op:"setParagraphProperties",paragraphId:O,properties:chunkZOZI27AW_cjs.Uh(B,{localName:"ind",...Object.keys(j).length>0?{attributes:j}:{}})});}return M.length===0?false:g(()=>c(M,i()))}return {insertTab(){let R=s(),w=R.replaceAt??R.collapseTo;n(()=>c([...R.ops,{op:"insertTab",paragraphId:w.paragraphId,offset:w.offset}],i()),()=>a({...w,offset:w.offset+1}));},insertLineBreak(){let R=s(),w=R.replaceAt??R.collapseTo;n(()=>c([...R.ops,{op:"insertHardBreak",paragraphId:w.paragraphId,offset:w.offset}],i()),()=>a({...w,offset:w.offset+1}));},insertPageBreak(){let R=s(),w=R.replaceAt??R.collapseTo;n(()=>c([...R.ops,{op:"insertPageBreak",paragraphId:w.paragraphId,offset:w.offset}],i()),()=>a({...w,offset:w.offset+1}));},exitListOnEmptyItem(){let{from:R,to:w}=o();if(R.paragraphId!==w.paragraphId||R.offset!==w.offset)return false;let M=x(R.paragraphId);if(!M||e.paragraphTextOf(R.paragraphId).length>0)return false;let B=M.level>0&&I(M,M.level-1),q=[];if(B)q.push({op:"setListLevel",paragraphId:R.paragraphId,level:M.level-1});else {let z=d.clearOp(R.paragraphId);z&&q.push(z),q.push({op:"setListNumbering",paragraphId:R.paragraphId,numId:null});}let j=false;return n(()=>{let z=c(q,i());return j=z.committed,z}),j},isListParagraph(){let{paragraphId:R}=r();return y(R)!==null},isListActive(R){let w=b();if(w===null)return false;let M=R==="bullet"?"bullet":"ordered";return w.length>0&&w.every(O=>v(O)===M)},toggleList(R){let w=b();if(w===null||w.length===0)return false;let M=w.every(q=>v(q)===R),O=M?null:S(w,R)??t.ensureListDefinition(R);if(!M&&O===null)return false;let B=M?[]:d.applyOps(w);for(let q of w){let j=y(q);B.push({op:"setListNumbering",paragraphId:q,numId:O,...j!==null?{level:j}:{}});}return g(()=>c(B,i()))},canAdjustIndent(R){let w=b();if(w===null)return false;let M=R==="increase"?1:-1;return w.some(O=>{let B=x(O);if(B){let j=B.level+M;return j>=0&&j<=h}let q=Sy(Or(f.value,O));return xy(q,M)!==q})},adjustIndent(R){let w=b();return w!==null&&P(w,R)},setIndent(R){if(R.left===void 0&&R.right===void 0&&R.firstLine===void 0)return false;let w=b();return w!==null&&E(w,R)},indentWithTab(R){let w=o();if(w.from.paragraphId===w.to.paragraphId&&w.from.offset===w.to.offset&&p()===null||oA(f.value,w))return false;let O=b(w);if(O===null)return false;let B=Math.round(chunkFDSL5OJU_cjs.Eb(t.settingsRoot())*20),q=rA(f.value,l(),u()),j=p()===null?nA(w,O,q,R,B):{write:"stepLeft",paragraphs:O};return j===null?false:(j.write==="stepLeft"?P(j.paragraphs,R,B):E(j.paragraphs,{firstLine:j.write==="setFirstLine"?B:null}),true)},setParagraphFormat(R){let w=b();if(w===null||w.length===0)return false;let M=[];R.direction!==void 0&&M.push({localName:"bidi",paragraphDirection:R.direction}),R.alignment!==void 0&&M.push({localName:"jc",attributes:{val:R.alignment},physicalAlignment:true});let O={...Va("before",R.spaceBeforePt),...Va("after",R.spaceAfterPt),...uf(R.lineSpacing)};Object.keys(O).length>0&&M.push({localName:"spacing",attributes:O,mergeAttributes:true});for(let[z,_]of I4){let L=R[z];L!==void 0&&M.push({localName:_,attributes:XM(L)});}let B=R.tabStops!==void 0,q=R.indentLeftTwips!==void 0||R.indentRightTwips!==void 0||R.indentFirstLineTwips!==void 0;if(M.length===0&&!q&&!B)return false;let j=[];for(let z of w){let _=chunkZOZI27AW_cjs.Sh(l(),z),L=_;if(q){let D={..._.find(T=>T.localName==="ind")?.attributes??{}};R.indentLeftTwips!==void 0&&(D=mf(D,"left","start",R.indentLeftTwips)),R.indentRightTwips!==void 0&&(D=mf(D,"right","end",R.indentRightTwips)),R.indentFirstLineTwips!==void 0&&(D=aA(D,R.indentFirstLineTwips)),L=chunkZOZI27AW_cjs.Uh(L,{localName:"ind",...Object.keys(D).length>0?{attributes:D}:{}});}let X=Or(f.value,z),te=_,me=false;for(let se of M){let D=cf(se,X,L,te);if(!D)continue;if(me=true,D.remove){L=L.filter($=>$.localName!==D.localName);continue}let T=D.mergeAttributes?{...L.find($=>$.localName===D.localName)?.attributes??{},...D.attributes}:D.attributes??{},W=Object.fromEntries(Object.entries(T).filter(([,$])=>$!=null));L=chunkZOZI27AW_cjs.Uh(L,{localName:D.localName,...Object.keys(W).length>0?{attributes:W}:{}});}if((me||q)&&j.push({op:"setParagraphProperties",paragraphId:z,properties:L}),B){let se=Ml(e.layout(),z);j.push({op:"setParagraphTabStops",paragraphId:z,stops:R.tabStops.map(D=>({positionTwips:Math.round(D.positionTwips),alignment:D.alignment,...D.leader&&D.leader!=="none"?{leader:D.leader}:{}})),...se?{inForcePositionsTwips:se.stops.map(D=>Math.round(D.positionPt*20))}:{}});}}return j.length===0?false:g(()=>c(j,i()))},sectionProperties:()=>chunkFDSL5OJU_cjs.Xc(t.part()),sectionPropertiesAt(R){let w=chunkFDSL5OJU_cjs.Yc(t.part(),e.revisionDisplayMode(),e.revisionAuthorFilter()),M=Zl(t,R,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter());return (w[M]??w[w.length-1]).properties},sectionAnchorParagraphAt(R){return ZM(t,R,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter())},setSectionProperties(R){let w=false;return n(()=>{let M=e.storyScope().kind==="body",O=t.applyTreeOps([{op:"setSectionProperties",...R}],M?i():void 0,void 0,{kind:"body"});return w=O.committed,O}),w},sectionBreakRefusal(R="nextPage"){return e.storyScope().kind!=="body"?null:iA({part:()=>t.part(),breakType:R,suggesting:e.editingMode?.()==="suggest",cellRectangle:(e.selectedCells?.()?.length??0)>0,caretParagraphId:e.caretParagraphId?.()??null,orderedRange:o,paragraphOrder:u,deleteSelectionPlan:s})},insertSectionBreak(R="nextPage"){if(e.storyScope().kind!=="body")return false;let w=s(),M=ky(t.part(),w),O=(chunkZOZI27AW_cjs.ql(t.part(),M.paragraphId)?Ua:null)??ff(t.part(),M.paragraphId,R,e.editingMode?.()==="suggest");if(O!==null)return e.publishRefusal?.(O),false;let B=new Set(t.paragraphIds()),q=false,j=false;return n(()=>{let z=t.applyTreeOps([...w.ops,{op:"splitParagraph",paragraphId:M.paragraphId,offset:M.offset},{op:"setSectionMark",paragraphId:M.paragraphId,breakType:R}],i(),void 0,{kind:"body"});return q=z.committed,j=z.reason==="locked"||z.reason==="bound",z},()=>{let z=t.paragraphIds().find(_=>!B.has(_));return z?a({paragraphId:z,offset:0}):null}),!q&&j&&e.publishRefusal?.(Yl),q}}}var fA="http://schemas.openxmlformats.org/wordprocessingml/2006/main";function pA(e){return e.kind==="textValue"?false:e.kind==="contentControl"?true:e.kind==="generic"&&e.localName==="sdt"&&e.namespaceUri===fA}function P4(e){return e.kind==="textValue"?false:e.kind==="contentControlContent"?true:e.kind==="generic"&&e.localName==="sdtContent"&&e.namespaceUri===fA}function Iy(e){return e.kind==="textValue"?[]:e.children}function mA(e,t=0){if(e.kind==="textValue")return e.value;if(t>=chunkZOZI27AW_cjs.Aa||e.kind==="deletedText"||T4(e.kind)||chunkZOZI27AW_cjs.Bf(e)||e.kind==="runProperties")return "";let n=chunkZOZI27AW_cjs.jb(e);if(n!==null)return n;if(e.kind==="generic"&&!chunkZOZI27AW_cjs.Ca(e)&&!pA(e))return "";if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunkZOZI27AW_cjs.tb(e);let r=chunkZOZI27AW_cjs.Ba(e,t),o="";for(let i of e.children)o+=mA(i,r);return o}function T4(e){return e==="revisionDelete"||e==="revisionMoveFrom"}function Ry(e,t,n){if(!(t>=chunkZOZI27AW_cjs.Aa))for(let r of e){if(r.kind==="hyperlink"){chunkZOZI27AW_cjs.Ba(r,t)<chunkZOZI27AW_cjs.Aa&&n(r,t);continue}if(chunkZOZI27AW_cjs.Ca(r)){Ry(Iy(r),chunkZOZI27AW_cjs.Ba(r,t),n);continue}if(pA(r)){for(let o of Iy(r))P4(o)&&Ry(Iy(o),chunkZOZI27AW_cjs.Ba(r,t),n);continue}n(r,t);}}function lA(e,t,n){let r=E4(e,t);if(!r||r.kind!=="paragraph")return [];let o=chunkZOZI27AW_cjs.rg(r),i=[],a=0;return Ry(r.children,0,(s,l)=>{let c=o.spanOf(s);if(c&&(a=Math.max(a,c.end)),s.kind!=="hyperlink")return;let d=c?c.start:a,u=c?c.end:a,f=chunkZOZI27AW_cjs.Id(s,n);i.push({id:s.id,paragraphId:t,start:d,end:u,text:chunkZOZI27AW_cjs.nb(mA(s,l)),kind:f.kind,href:f.href,authored:f.authored,...f.anchor!==void 0?{anchor:f.anchor}:{},...f.tooltip!==void 0?{tooltip:f.tooltip}:{}});}),i}function E4(e,t){let n=r=>{if(r.kind==="textValue")return r.id===t?r:null;if(r.id===t)return r;for(let o of r.children){let i=n(o);if(i)return i}return null};return n(e.root)}function C4(e,t){for(let n of e)if(n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)return n;return null}function O4(e,t){for(let n of chunkFDSL5OJU_cjs.Ja(e,t.paragraphId))for(let r of n.lines)for(let o of r.spans)if(!(!o.fieldAtom||!o.link)&&t.offset>=o.range.start&&t.offset<=o.range.end)return o.link.id;return null}function gA(e){let t=()=>e.storyScope(),n=()=>e.session.partFor(t()),r=c=>e.session.relationshipTarget(c,t()),o=(c,d,u)=>e.session.applyTreeOps(c,d,u,t()),i=c=>{let d=n();return d?lA(d,c,r):[]},a=()=>C4(i(e.selection().head.paragraphId),e.selection().head),s=()=>{let c=e.selection().head,d=O4(e.layout(),c);return d===null?null:e.fieldLinkById(d)},l=c=>{let d=e.selection().head.paragraphId,u=i(d).find(f=>f.id===c);if(u)return u;for(let f of e.session.storyParts()){let p=g=>chunkZOZI27AW_cjs.Vg(e.session.currentPackage(),f.name,g);for(let g of chunkZOZI27AW_cjs.Sc(f))for(let b of chunkZOZI27AW_cjs.Vc(g.root)){let h=b.id,y=lA(f,h,p).find(x=>x.id===c);if(y)return y}}return null};return {linksInCaretParagraph:()=>i(e.selection().head.paragraphId),linkAtCaret:a,fieldLinkAtCaret:s,linkById:l,applyHyperlink(c){let d=c.text===void 0?c:{...c,text:chunkZOZI27AW_cjs.ob(c.text)},u=d.url!==void 0&&d.url.length>0,f=d.anchor!==void 0&&d.anchor.length>0;if(u===f)return false;let p=t();if(!n()||e.refusesWrite())return false;let g;if(u){let w=()=>e.session.ensureHyperlinkRelationship(d.url,p),M=e.withMintActor?e.withMintActor(w):w();if(!M)return false;g=M;}let b={...g!==void 0?{relationshipId:g}:{},...f?{anchor:d.anchor}:{},...d.tooltip!==void 0?{tooltip:d.tooltip}:{}},h=a(),y=e.orderedRange(),x=y.from.paragraphId===y.to.paragraphId&&y.from.offset===y.to.offset;if(h&&(x||M4(h,y))){let w=[];if(d.text!==void 0&&d.text!==chunkZOZI27AW_cjs.ob(h.text)){if(d.text.length===0)return false;let O=e.replacementLanding?.(h.paragraphId,h.start,h.end),B=e.textOf(h.paragraphId).slice(h.start,h.start+2),q=h.start+(B.length===2&&B.charCodeAt(0)>=55296&&B.charCodeAt(0)<=56319&&B.charCodeAt(1)>=56320&&B.charCodeAt(1)<=57343?2:1);if(O!=null&&O>h.start&&q<h.end)w.push({op:"setHyperlinkTarget",linkId:h.id,...b},{op:"deleteText",paragraphId:h.paragraphId,start:h.start,end:h.end},{op:"insertText",paragraphId:h.paragraphId,offset:q,text:d.text});else if(O!=null){let j=cA(e.session);w.push({op:"setHyperlinkTarget",linkId:h.id,...b},...dA(h,O,d.text),{op:"insertHyperlink",paragraphId:h.paragraphId,start:O,end:O+d.text.length,...b,...j?{styleId:j}:{}});}else {let j=uA(h.paragraphId,h.start,h.end,d.text);if(!j)return false;w.push({op:"setHyperlinkTarget",linkId:h.id,...b},...j);}}else w.push({op:"setHyperlinkTarget",linkId:h.id,...b});let M=false;return e.commit(()=>{let O=o(w,e.selectionMark());return M=O.committed,O},()=>null),M}let v=y.from.paragraphId;if(y.to.paragraphId!==v)return false;let S=[],I=y.from.offset,C=y.to.offset;if(x){let w=d.text??d.url??d.anchor??"";if(w.length===0)return false;I=e.insertionLanding?.(v,I)??I,S.push({op:"insertText",paragraphId:v,offset:I,text:w}),C=I+w.length;}else {let w=e.replacementLanding?.(v,I,C);if(w!=null){let M=d.text??e.textOf(v).slice(I,C);if(M.length===0)return false;S.push(...dA({paragraphId:v,start:I,end:C},w,M)),I=w,C=w+M.length;}else if(d.text!==void 0&&d.text!==e.textOf(v).slice(I,C)){let M=uA(v,I,C,d.text);if(!M)return false;S.push(...M),C=I+d.text.length;}}if(C<=I)return false;let P=cA(e.session);S.push({op:"insertHyperlink",paragraphId:v,start:I,end:C,...b,...P?{styleId:P}:{}});let E=false,R={paragraphId:v,offset:C};return e.commit(()=>{let w=o(S,e.selectionMark(),{paragraphId:v,start:C,end:C});return E=w.committed,w},()=>({anchor:R,head:R})),E},removeHyperlink(c){if(!n())return false;let d=c?l(c):a();if(!d)return false;let u=false,f={paragraphId:d.paragraphId,offset:d.end};return e.commit(()=>{let p=o([{op:"removeHyperlink",linkId:d.id}],e.selectionMark());return u=p.committed,p},()=>({anchor:f,head:f})),u}}}function cA(e){for(let t of e.documentStyles())if(t.type==="character"&&t.styleId.toLowerCase()==="hyperlink")return t.styleId;return null}function M4(e,t){return t.from.paragraphId===e.paragraphId&&t.to.paragraphId===e.paragraphId&&t.from.offset>=e.start&&t.to.offset<=e.end}function dA(e,t,n){return [{op:"deleteText",paragraphId:e.paragraphId,start:e.start,end:e.end},{op:"insertText",paragraphId:e.paragraphId,offset:t,text:n}]}function uA(e,t,n,r){if(r.length===0)return null;let o=[{op:"insertText",paragraphId:e,offset:t,text:r,bias:"right"}];return n>t&&o.push({op:"deleteText",paragraphId:e,start:t+r.length,end:n+r.length}),o}function A4(e,t,n){if(!t)return 0;let r=t.scrollTop;return e.pages.find(i=>(i.box.y+i.box.height)*n>r)?.index??0}var F4=24;function L4(e,t,n){if(!n)return Math.max(0,t-F4);let r=e.clientHeight,o=e.scrollTop;return t>=o+r*.2&&t<=o+r*.8?o:Math.max(0,t-r/2)}function hA(e){let{pagesLayer:t}=e;function n(){return e.container.closest(".docx-editor__scroll-container")}let r=u=>{if(!u||u.length===0||u.startsWith("#"))return false;let f=chunkZOZI27AW_cjs.U(u);if(!f.ok||!f.href)return false;let p=t.ownerDocument.defaultView;return p?(p.open(f.href,"_blank","noopener,noreferrer"),true):false},o=(u,f)=>{e.beginJump?.();let p=!e.enterStoryFor||e.enterStoryFor(u.paragraphId);if(!p&&!f?.orShow)return false;let g=e.layout(),b=n(),h=chunkFDSL5OJU_cjs.ze(g,u,p?void 0:{preferredPageIndex:A4(g,b,e.scale())});if(!h)return !p||!e.whenLaidOut?.(u,()=>o(u,f))?false:(e.setSelection(u),true);let y=g.pages[h.pageIndex];if(!y)return false;let x=wl(y,u.paragraphId).y+h.y;return b&&(b.scrollTop=L4(b,x*e.scale(),f?.center===true),e.onScrolled?.()),p?(e.setSelection(u),true):"shown"},i=u=>{let f=e.bookmarks().get(u);return f?o(f)===true:false},a=null;function s(u){if(!u||u.closest("[data-docx-hf]"))return null;let f=u.closest("a.docx-hyperlink");if(f){let g=f.dataset.docxLink;return g?{linkId:g,drawing:false}:null}let p=u.closest("[data-docx-drawing-link]");if(p){let g=p.dataset.docxDrawingLink;return g?{linkId:g,drawing:true}:null}return null}let l=u=>{if(chunkZGTIE3QJ_cjs.b(u.target))return;a=null;let f=u.target,p=s(f);if(!p)return;let b=f.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();a={linkId:p.linkId,drawing:p.drawing,rect:{left:b.left,top:b.top,bottom:b.bottom,right:b.right}};},c=u=>{if(chunkZGTIE3QJ_cjs.b(u.target))return;let f=u.target,p=s(f);if(!p){let h=a;if(a=null,!h)return;u.preventDefault(),d(h.linkId,h.rect,u,h.drawing);return}a=null,u.preventDefault();let b=f.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();d(p.linkId,{left:b.left,top:b.top,bottom:b.bottom,right:b.right},u,p.drawing);};function d(u,f,p,g){let b=g?e.drawingLinkById?.(u)??null:e.linkById(u);if(!b)return;if(p.metaKey||p.ctrlKey){b.kind==="external"?r(b.href):b.anchor&&i(b.anchor);return}if(e.isCollapsedSelection()){if(b.kind==="internal"){b.anchor&&i(b.anchor);return}e.onPopover?.({link:b,rect:f});}}return t.addEventListener("pointerdown",l,true),t.addEventListener("click",c),{goToPosition:o,goToBookmark:i,openExternal:r,destroy(){t.removeEventListener("pointerdown",l,true),t.removeEventListener("click",c);}}}function D4(e){let t=e.hyperlinkHref;if(!t)return null;let n=e.kind==="anchoredDrawing"?e.anchorParagraphId:e.paragraphId,r=e.kind==="inlineDrawing"?e.start:0,o=t.startsWith("#")?"internal":"external";return Object.freeze({id:e.drawingNodeId,paragraphId:n,start:r,end:r+1,text:"",kind:o,href:t,authored:t,...o==="internal"?{anchor:t.slice(1)}:{}})}function Py(e,t){return e.drawingNodeId!==t?null:D4(e)}function yA(e,t){if(!e)return null;for(let n of e.anchoredDrawings??[]){let r=Py(n,t);if(r)return r}return null}function N4(e,t){for(let r of e.anchoredDrawings??[]){let o=Py(r,t);if(o)return o}for(let r of e.fragments){if(r.kind==="table"){for(let i of r.rows)for(let a of i.cells)for(let s of a.blocks){let l=vA(s,t);if(l)return l}continue}let o=bA(r,t);if(o)return o}let n=yA(e.header,t);return n||yA(e.footer,t)}function bA(e,t){for(let n of e.lines)for(let r of n.drawings??[]){let o=Py(r,t);if(o)return o}return null}function vA(e,t){if(e.kind==="table"){for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks){let i=vA(o,t);if(i)return i}return null}return bA(e,t)}function xA(e,t){for(let n of e.pages){let r=N4(n,t);if(r)return r}return null}var gf=24;function SA(e){let t=null,n=false;return {without(r){let o=n;n=true;try{return r()}finally{n=o;}},follow(r,o){let i=n?"none":o;if(e.storyScopeOpen())return;let a=e.selection();if(!(a.anchor.paragraphId===a.head.paragraphId&&a.anchor.offset===a.head.offset)&&i!=="head")return;let l=e.pagesLayer.ownerDocument.activeElement;if(!(l===e.pagesLayer||!!l&&e.pagesLayer.contains(l))&&i!=="none")return;let d=e.preferredPageIndex(),u=e.preferredLineId?.(),f=e.layout(),p=chunkFDSL5OJU_cjs.ze(f,a.head,{measurer:e.measurer(),...d!==void 0?{preferredPageIndex:d}:{},...u!==void 0?{preferredLineId:u}:{}});if(!p)return;let g=t!==null&&t!==p.pageIndex;if(t=p.pageIndex,i==="none"||!r&&!g)return;let b=f.pages[p.pageIndex],h=e.scroller();if(!b||!h||h.clientHeight<=0)return;let y=e.scale(),x=b.contentBox.y-b.box.y,v=(b.box.y+x+p.y)*y+e.container.offsetTop,S=v+p.height*y,I=h.scrollTop,C=I+h.clientHeight,P=I;if(v<I+gf)P=v-gf;else if(S>C-gf)P=S+gf-h.clientHeight;else return;let E=Math.max(0,h.scrollHeight-h.clientHeight),R=Math.max(0,Math.min(P,E));Math.abs(R-h.scrollTop)<.5||(h.scrollTop=R,e.scheduleRematerialize());}}}function wA(e){return (t,n,r,o)=>{if(e.settle(),/[\r\n\v\f\u2028\u2029]/.test(o))return e.refuse("replacement requires text without a paragraph mark");if(!e.storyParagraphs().includes(t))return e.refuse("that text is not in the story being edited");let i=e.textOf(t);if(n<0||r<n||r>i.length)return e.refuse("that range is outside the paragraph");let a={paragraphId:t,offset:n},s=r>n?e.rangePlan({anchor:a,head:{paragraphId:t,offset:r}}):{ops:[],replaceAt:e.insertionPoint(a)},l=[...s.ops],{paragraphId:c,offset:d}=s.replaceAt;if(o.length>0&&l.push({op:"insertText",paragraphId:c,offset:d,text:o}),l.length===0)return true;let u=e.selection();return e.commitWithoutFollow(l,e.selectionMark()??void 0,()=>{e.flushLayout();let f=e.textOf(t),p=Vl(u,t,i,f);return e.selectionsEqual(p,u)?null:(e.noteModelMoved(),p)})}}function kA(e,t){let n=[],r=a=>{for(let s of a){if(s.kind==="paragraph"){n.push({id:s.id,length:chunkZOZI27AW_cjs.rg(s).length});continue}if(s.kind==="textValue")continue;if(s.kind==="contentControl"){r(t.contentChildrenOf(s));continue}r(s.children);}};if(r(t.contentChildrenOf(e)),n.length>0){let a=n[0],s=n[n.length-1];return {anchor:{paragraphId:a.id,offset:0},head:{paragraphId:s.id,offset:s.length}}}let o=null,i=a=>{for(let s of a){if(s.kind==="paragraph"){let l=chunkZOZI27AW_cjs.rg(s).spanOf(e);if(!l)continue;return o={anchor:{paragraphId:s.id,offset:l.start},head:{paragraphId:s.id,offset:l.end}},true}if(s.kind!=="textValue"&&i(s.children))return true}return false};return i(t.searchRoots()),o}function IA(e){for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="contentControlContent"||t.localName==="sdtContent"))return t.children;return []}function RA(e){return {applyHeaderFooterLifecycle(t){let n=null;return e.commit(()=>{let r=e.applyOps([t]);return r.rejected&&(n=String(r.reason??"rejected")),r}),n?{ok:false,reason:n}:{ok:true}},insertPageField(t){if(!e.isHeaderFooterOpen())return false;let n=e.deleteSelectionPlan(),r=n.replaceAt??n.collapseTo;return e.commit(()=>e.applyOps([...n.ops,{op:"insertPageField",paragraphId:r.paragraphId,offset:r.offset,field:t}],e.selectionMark()),()=>e.collapsedAt({paragraphId:r.paragraphId,offset:r.offset+(t==="PAGE_X_OF_Y"?6:1)})),e.lastRejection()===null}}}var Ql="the document is open for viewing",Ty="image changes are not supported in suggesting mode",PA="tracked changes need a non-empty author";function TA(e){function t(){return {committed:false,rejected:true,opCount:0,reason:Ql}}function n(){return {committed:false,rejected:true,opCount:0,reason:Ty}}return {applyDrawingOps(r){if(e.editingMode()==="view")return t();if(e.editingMode()==="suggest")return n();let o=e.selectionMark(),i={committed:false,rejected:true,opCount:0};return e.commit(()=>(i=e.applyOps(r,o,o),i)),i},applyImageProperties(r){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:Ql};if(e.editingMode()==="suggest")return {ok:false,reason:"invalidArgs",detail:Ty};let o={ok:false,reason:"invalidArgs"};return e.commit(()=>(o=e.session.applyImageProperties(e.storyScope(),r),{committed:o.ok,rejected:!o.ok,opCount:o.ok?1:0,...o.ok?{}:{reason:o.detail??o.reason}})),o},deleteImage(r){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:Ql};let o=e.editingMode()==="suggest",i=e.author();if(o&&(i===void 0||i===""))return {ok:false,reason:"invalidArgs",detail:PA};let a={ok:false,reason:"invalidArgs"};return e.commit(()=>(a=o?e.session.deleteImageTracked(e.storyScope(),r,{author:i,date:e.trackedDate()}):e.session.deleteImage(e.storyScope(),r),{committed:a.ok,rejected:!a.ok,opCount:a.ok?1:0,...a.ok?{}:{reason:a.detail??a.reason}})),a},insertImage(r){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:Ql});let o=e.editingMode()==="suggest",i=e.author();if(o&&(i===void 0||i===""))return Promise.resolve({ok:false,reason:"invalidArgs",detail:PA});let a=e.actorId();return e.session.insertImage(e.storyScope(),{...r,decodePort:e.decodePort(),...o?{revision:{author:i,date:e.trackedDate()}}:{},...a?{actorId:a}:{}})},replaceImage(r,o,i,a){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:Ql});if(e.editingMode()==="suggest")return Promise.resolve({ok:false,reason:"invalidArgs",detail:Ty});let s=e.actorId();return e.session.replaceImage(e.storyScope(),r,o,i,e.decodePort(),{...a,commitGuard:()=>e.editingMode()==="edit"&&a.commitGuard?.()!==false,...s?{actorId:s}:{}})}}}function EA(e){let t=null,n=null,r="",o=()=>{let c=e.session.part(),d=e.revisionDisplayMode(),u=e.revisionAuthorFilter();return {sections:chunkFDSL5OJU_cjs.Yc(c,d,u),sourceIndexes:chunkFDSL5OJU_cjs.Zc(c,d,u)}},i=c=>{let{sourceIndexes:d}=o(),u=d.indexOf(c);if(u!==-1)return u;let f=d.findIndex(p=>p>c);return f===-1?Math.max(0,d.length-1):f},a=()=>{if(!t)return;let c=TI(e.layout(),t,e.materializedPages?.());c!==t.pageIndex&&(t={...t,pageIndex:c,sectionIndex:e.sectionAtPage(c).sectionIndex});},s=c=>{if(e.entryRefused?.()===true&&t?.scope.rId!==c.rId||!c.rId||e.session.partFor({kind:"headerFooter",rId:c.rId})===null)return false;t?.scope.rId!==c.rId&&e.leaveOtherStories?.();let d=e.layout(),u=II(d,c.rId),f=t,p=f?.scope.rId===c.rId,g=u?null:H4(e.session,c.rId);if(!u&&!g)return false;let b=c.pageIndex??(p&&f?f.pageIndex:u?.pageIndex??0),h=c.kind??(p&&f?f.kind:u?.kind??g.kind),y=c.variant??(p&&f?f.variant:u?.story.variant??g.variant),x=p&&f?f.partName:u?.story.partName??g.partName,v=d.pages[b]??d.pages[u?.pageIndex??0],S=(v?ka(v,{scope:{kind:"headerFooter",rId:c.rId},kind:h,partName:x}):null)??u?.story??{scope:{rId:c.rId},variant:y,partName:x},I=e.selection(),C=f?f.savedBodySelection:{anchor:{...I.anchor},head:{...I.head}},P=p&&f?.sectionIndex!==void 0&&b===f.pageIndex,E=c.sectionIndex??(P?f.sectionIndex:u?e.sectionAtPage(b).sectionIndex:g?i(g.sectionIndex):void 0);t={scope:{kind:"headerFooter",rId:c.rId},pageIndex:b,...E!==void 0?{sectionIndex:E}:{},kind:h,variant:S.variant,partName:S.partName,savedBodySelection:C};let w=e.session.paragraphIdsIn(Vd(t))[0];if(!w)return t=null,false;let M=c.position?Gd(d,{anchor:c.position,head:c.position},t):p?Gd(d,I,t):{anchor:{paragraphId:w,offset:0},head:{paragraphId:w,offset:0}};return e.setScopeSelection(M),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify(),true},l=()=>{if(!t)return;let c=t.savedBodySelection;t=null,e.setScopeSelection(Gd(e.layout(),c,null)),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify();};return {getActive:()=>t,activeScope:()=>kI(t),setActiveScope(c){return c.kind==="body"?(l(),true):c.kind==="headerFooter"?s({rId:c.rId}):false},enterHeaderFooter:s,exitHeaderFooter:l,reconcileOccurrence:a,headerFooterState(){if(!t)return null;let c=e.session.headerFooterResolutionBySection(),d=t.sectionIndex??0,u=o(),f,p,g,b=v=>{let S=u.sourceIndexes[v]??v,I=c[S];if(!I)return false;let P=(t.kind==="header"?I.headers:I.footers).get(t.variant);return !P||P.rId!==t.scope.rId?false:(d=v,f=P.inherited,p=I.titlePage,g=I.evenAndOddHeaders,true)};if(!(t.sectionIndex!==void 0&&b(t.sectionIndex))){let v;c.forEach((S,I)=>{let P=(t.kind==="header"?S.headers:S.footers).get(t.variant);!P||P.rId!==t.scope.rId||!(v===void 0||v&&!P.inherited||v===P.inherited&&i(I)<d)||(d=i(I),f=P.inherited,p=S.titlePage,g=S.evenAndOddHeaders,v=P.inherited);});}let h=u.sections[d]?.properties??u.sections.at(-1)?.properties,y=h?.margins.headerTwips,x=h?.margins.footerTwips;return {editing:t.kind,sectionIndex:d,variant:t.variant,rId:t.scope.rId,partName:t.partName,...f!==void 0?{inherited:f}:{},...p!==void 0?{titlePage:p}:{},...g!==void 0?{evenAndOddHeaders:g}:{},...y!==void 0?{headerDistanceTwips:y}:{},...x!==void 0?{footerDistanceTwips:x}:{}}},headerFooterStateStable(c){if(!t)return n=null,r="",null;let d=this.headerFooterState();if(!d)return null;let u=[c,d.editing,d.sectionIndex,d.variant??"",d.rId??"",d.partName??"",String(d.inherited),String(d.titlePage),String(d.evenAndOddHeaders),String(d.headerDistanceTwips??""),String(d.footerDistanceTwips??"")].join("|");return n&&r===u||(n=Object.freeze({...d}),r=u),n}}}function CA(e){return e.length>0&&e.every(t=>t.op==="setDocumentProtection")}function H4(e,t){let n=e.headerFooterResolutionBySection();for(let r=0;r<n.length;r+=1){let o=n[r];for(let i of ["header","footer"]){let a=i==="header"?o.headers:o.footers;for(let[s,l]of a)if(l.rId===t)return {sectionIndex:r,kind:i,variant:s,partName:l.partName}}}return null}function OA(e,t,n){let{sectionIndex:r,sectionStart:o}=e.sectionAtPage(n),i=f=>f[Math.min(r,Math.max(0,f.length-1))],a=f=>{let p=i(f);return t==="header"?p?.headers:p?.footers},s=e.session.headerFooterResolutionBySection(),l=i(s),c=e.layout.pages[n]?.pageFieldSource?.pageNumber??n+1,d=l?.evenAndOddHeaders&&c%2===0?"even":l?.titlePage&&n===o?"first":"default",u=a(s)?.get(d)?.rId;if(!u){if(!e.create({op:"createHeaderFooter",sectionIndex:r,kind:t,variant:d,...d==="first"?{titlePage:true}:{},...d==="even"?{evenAndOddHeaders:true}:{}})?.ok)return;u=a(e.session.headerFooterResolutionBySection())?.get(d)?.rId,e.flushLayout();}u&&e.enter({rId:u,pageIndex:n,sectionIndex:r,kind:t,variant:d});}var _4=500;function B4(e,t,n,r){let o=e.part(),i=chunkFDSL5OJU_cjs.Cd(o,n,r),a=chunkFDSL5OJU_cjs.Vc(o);return t.map((s,l)=>{let c=s.blockStart<s.blockEndExclusive?i[s.blockEndExclusive-1]:void 0,d=c?.kind==="paragraph"?chunkFDSL5OJU_cjs.Wc(c):void 0;return d||(l===t.length-1&&a?.kind!=="textValue"?a:void 0)})}function MA(e,t){if(!e)return null;let n=e.session,r=chunkFDSL5OJU_cjs.$a(e.revisionDisplayMode()),o=e.state().selection.head.paragraphId,i=Zl(n,o,e.activeScope().kind==="headerFooter"?{kind:"headerFooter",rId:e.headerFooterState()?.rId??""}:Ct(n,o,{kind:"body"}),e.headerFooterState()?.sectionIndex,r,t),a=n.currentPackage(),s=chunkZOZI27AW_cjs.fh(a),l=chunkZOZI27AW_cjs.gh(s),c=chunkZOZI27AW_cjs.hh(s),d=chunkFDSL5OJU_cjs.Yc(n.part(),r,t),u=B4(n,d,r,t),f=chunkZOZI27AW_cjs.dh(u[i]),p=chunkZOZI27AW_cjs.eh(u[i]),g=chunkZOZI27AW_cjs.ih(f,l),b=chunkZOZI27AW_cjs.jh(p,c);return {sectionIndex:i,footnote:{resolved:g,...l?{documentAuthored:l}:{},...f?{sectionAuthored:f}:{}},endnote:{resolved:b,...c?{documentAuthored:c}:{},...p?{sectionAuthored:p}:{}}}}function AA(e,t){let n=chunkZOZI27AW_cjs.tc(t);if(!n)return null;let r=chunkZOZI27AW_cjs.qh(e.currentPackage(),n.noteKind);if(!r)return null;let o=r,i=chunkZOZI27AW_cjs.Pc(o.root,n.noteId);if(!i)return null;let a=[],s=_4,l=(d,u)=>{if(!(u>32||s<=0)){if(d.kind==="paragraph"&&typeof d.id=="string"){let f=(chunkZOZI27AW_cjs.Tk(o,d.id)??"").replace(/\uFFFC/g,"").trim();if(f){let p=f.slice(0,s);a.push(p),s-=p.length;}return}if(d.kind!=="textValue")for(let f of d.children)l(f,u+1);}};l(i,0);let c=a.filter(Boolean).join(" ").trim();return c.length>0?c:null}function FA(e){return [()=>{chunkZOZI27AW_cjs.Db(e().root);},()=>{chunkZOZI27AW_cjs.rj(e());},()=>{chunkZOZI27AW_cjs.lk(e());}]}var $4=50,q4=16;function LA(e){let t=e.schedule??((s,l)=>{let c=globalThis.setTimeout(s,l);return ()=>globalThis.clearTimeout(c)}),n=false,r=null,o=0,i=0,a=s=>{r=t(()=>{if(r=null,!(n||i>=e.steps.length||!e.shouldRun())){if(e.hasPendingInput()){if(o+=1,o>$4)return;a(q4);return}try{e.steps[i]();}catch{return}i+=1,i<e.steps.length&&a(0);}},s);};return a(0),()=>{n=true,r&&r(),r=null;}}var uo=null;function za(e,t,n){let r=uo;uo=t===void 0?null:{owner:e,group:t};try{return n()}finally{uo=r;}}function Ey(e){if(uo===null||uo.owner!==e)return;let{group:t}=uo;return uo=null,t}function W4(e,t){uo===null&&(uo={owner:e,group:t});}var hf=class{current;get value(){return this.current}around(t,n,r,o=true){let i=this.current,a=Ey(t);this.current=a??(o?Symbol("command"):void 0);let s;try{s=n();}finally{this.current=i;}return a!==void 0&&!r(s)&&W4(t,a),s}};function DA(e,t){let n=t.indexOf("#"),r=n>0?t.slice(0,n):e.mainDocumentPart,o=e.parts.get(r);return o?chunkZOZI27AW_cjs.Xa(o,t):null}function NA(e){let{anchor:t,head:n}=e;return t.paragraphId!==n.paragraphId||t.offset!==n.offset?null:`${n.paragraphId}\0${n.offset}`}var j4=1e3,K4=2e3,yf=class{constructor(t,n=()=>performance.now()){this.currentPackage=t;this.now=n;}currentPackage;now;group;expected=null;startedAt=0;lastTypedAt=0;paragraphId=null;landedNode=null;groupAt(t){let n=this.now();return (this.group===void 0||NA(t)!==this.expected||n-this.lastTypedAt>=j4||n-this.startedAt>=K4||n<this.lastTypedAt)&&(this.group=Symbol("typing"),this.startedAt=n),this.lastTypedAt=n,this.group}landed(t){this.expected=NA(t),this.paragraphId=this.expected===null?null:t.head.paragraphId;let n=this.paragraphId;this.landedNode=n===null?null:DA(this.currentPackage(),n),this.expected===null&&(this.group=void 0);}noteForeignChange(t){let n=this.paragraphId;if(n===null||t.origin===chunkZOZI27AW_cjs.g.projection||t.origin===chunkZOZI27AW_cjs.g.awareness)return;if(t.dirty.includes(n)||t.deleted.includes(n))return this.end();if(t.dirty.length>0||t.deleted.length>0)return;let r=this.landedNode,o=DA(this.currentPackage(),n);r!==o&&(r===null||o===null||!chunkZOZI27AW_cjs.Ha(r,o))&&this.end();}end(){this.group=void 0,this.expected=null,this.paragraphId=null,this.landedNode=null;}};function Cy(e){return e.bound?"bound":e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked"?"locked":null}function HA(e){return e.effectiveLock==="sdtLocked"||e.effectiveLock==="sdtContentLocked"?"locked":null}function _A(e,t){for(let n of e.children)if(n.kind!=="textValue"&&!(n.kind!=="contentControlProperties"&&n.localName!=="sdtPr")){if(n.children.some(r=>r.kind!=="textValue"&&r.localName==="dataBinding")&&t==="edit")return "bound";for(let r of n.children){if(r.kind==="textValue"||r.localName!=="lock")continue;let o=r.attributes.find(i=>i.localName==="val")?.value;if(t==="remove"){if(o==="sdtLocked"||o==="sdtContentLocked")return "locked"}else if(o==="contentLocked"||o==="sdtContentLocked")return "locked"}}return null}function Bi(e,t,n=true){let r=e.createElement("div");return r.className=t,r.contentEditable="false",n&&r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.left="0",r.style.top="0",r.style.pointerEvents="none",r}function BA(e,t,n){for(let r of e)r.style.width=t,r.style.height=n;}function Jl(e,t,n={}){let r=n,o=Gu(n),i=r.openedSession??chunk25EXMBV2_cjs.l(t,{...n.reviewModel?{reviewModel:n.reviewModel}:{},...n.contentLockPolicy?{contentLockPolicy:n.contentLockPolicy}:{}});if(!i.ok)return {ok:false,reason:i.reason,...i.detail?{detail:i.detail}:{},..."limit"in i&&i.limit?{limit:i.limit}:{}};let a=MC(i.session,o),s=ah(Pl(n.unsupportedElementRules??[])),l=EE(a),c=l.index,d=n.collaborationModel?.session,u=n.author,f=n.scale??96/72,p={resolve:n.tableInteractionLabel??(m=>Yg(m))},g="the document is open for viewing",b="the table of contents is generated and read-only",h=false,y="\0range\0",x=n.measurer?null:chunk6NVZNB7O_cjs.X(f,{context:Ho(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),v=n.measurer??x.measurer,S=chunkFDSL5OJU_cjs.Te(),I=chunkFDSL5OJU_cjs._f();function C(){return n.measurer?n.producer??"host-measurer":`${n.producer??x?.producer??"fixed-measurer"}@scale:${f}`}let P=C(),E=n.lockedControlNavigation==="atomic",R=e.ownerDocument,w=R.createElement("div"),M=jC(()=>w);w.className="docx-pages",w.style.position="relative",o.listeners(w),w.contentEditable="true",w.spellcheck=false,w.setAttribute("role","textbox"),w.setAttribute("aria-multiline","true"),hh(w,n.translate),w.style.outline="none";let O=Bi(R,"docx-selection-overlay"),B=Bi(R,"docx-comment-overlay"),q=Bi(R,"docx-text-highlight-overlay"),j=null,z=Bi(R,"docx-remote-selection-overlay"),_=Bi(R,"docx-bookmark-overlay"),L=Bi(R,"docx-table-furniture",false);e.style.position="relative";let X=[L,B,_,q,z,O];e.replaceChildren(w,...X);let te=SM(w,()=>f,()=>{let m=Ke?.getActive()??null,k=Ne?.activeNoteScope()??null,F=Ne?.activeNotePageIndex()??null,H=m?RI(w,m.pageIndex):k?PI(w,k.id,F):null;return {layout:xe(),selection:jt.shownSelection(T),...Ze.caretPreference(m?.pageIndex??F??void 0),measurer:v,...Pt()?{typingStyle:()=>{let V=Gi.formatting();return V.fontSizeHalfPoints?{fontSizePt:V.fontSizeHalfPoints/2,fontFamily:V.fontFamily,bold:V.bold,italic:V.italic,verticalAlign:V.superscript?"superscript":V.subscript?"subscript":"baseline"}:null}}:{},scopedHost:H,...m?{scopedHostKind:"headerFooter"}:k?{scopedHostKind:"note"}:{},...ut?.caretInput(ve),suppress:Be==="view"}}),me=Qd(a.part()),se=a.paragraphIds(),D=se.find(m=>!me.has(m))??se[0]??"",T=r.initialSelection??{anchor:{paragraphId:D,offset:0},head:{paragraphId:D,offset:0}},W=r.initialDrawingSelectionIntent??{kind:"none"};function $(m,k){m.kind===W.kind&&(m.kind!=="pointer"||W.kind==="pointer"&&m.drawingNodeId===W.drawingNodeId)||(W=m,k&&n.onChange?.(vt()));}let K=null,Y=null;function re(m){return Y=N(m),n.onChange?.(vt()),false}function N(m,k=m){return n.onRejection?.(k),m}let U=()=>n.onEdit?.(Ln),G=new hf,ee=new yf(()=>a.currentPackage()),de="suggesting needs an author before it can propose a change",oe=false,ce=false,he=null,Ce=new Map;function ct(){he=null;for(let m of Ce.values())he=m;}function Ae(m,k){if(m.paragraphId===k.paragraphId)return m.offset-k.offset;let F=ft();return F.indexOf(m.paragraphId)-F.indexOf(k.paragraphId)}function Ie(m){if(!he)return;let{from:k,to:F}=ku(xe(),he),H=m.head;Ae(H,k)>=0&&Ae(H,F)<=0||(Ce.clear(),he=null);}let Re=null,dt=new Iu(d??a),Nt=new Su(d??a,()=>T,()=>Ee(a,T.head.paragraphId)??a.part(),()=>a.packageRevision());function we(m){let k=null;d&&He.expectHistory(true);let F;try{F=Nt.step(m,()=>{if(d)return d[m]();let V=a.packageRevision();return k=a[m](),a.packageRevision()!==V});}finally{d&&He.expectHistory(false);}if(!F.changed)return;U();let H=m==="undo"?pM(d,Jn):null;ZD(H??F.selection??k);}function De(m){Ze.noteModelMoved(),on();let k=PT(m,xe(),ft());kt(k.selection),Re=k.format,te.update(),n.onChange?.(vt());}function Rt(){return Pt()?.properties??null}function Pt(){return dh(Re,T)}function Zn(m){if(!Re)return;let k=Re.position;m.anchor.paragraphId===k.paragraphId&&m.anchor.offset===k.offset&&m.head.paragraphId===k.paragraphId&&m.head.offset===k.offset||(Re=null);}function Dr(m,k,F,H,V){let Z=st([...m],F,H,ze(),true,V);return m.length===k.length||!Z.rejected?Z:st([...k],F,H,ze(),true,V)}function ji(m,k,F,H){let V=ut?.replacementFormatOps(m,k,F);if(V?.length)return V;let Z=Pt()??(Vt(T.head.paragraphId).length===0?{base:[],properties:La(Ee(a,T.head.paragraphId)??a.part(),T.head.paragraphId,T.head.offset,tn(),St())}:null);if(!Z||F===0||Z.properties.length===0&&Z.base.length===0)return [];let J=Re?.position??T.head,fe=H&&J.paragraphId===m&&J.offset>=H.start&&J.offset<=H.end?{paragraphId:m,offset:ep({paragraphId:m,offset:H.start},{paragraphId:m,offset:H.end})}:chunkFDSL5OJU_cjs.Id(xe(),J);return fe.paragraphId!==m||fe.offset!==k?[]:[{op:"setRunProperties",paragraphId:m,start:k,end:k+F,properties:chunkZOZI27AW_cjs.$h(Z.base,Z.properties,is(m,k))}]}let Ke=null,Ne=null,ut=null,xe=()=>ut?.layout(ve)??ve,Xn=()=>ut?.active()?ut.paragraphIds():a.paragraphIdsIn(ze()),Wo=null,ze=()=>Vd(Ke?.getActive()??null,Ne?.activeNoteScope()??null),Oe=()=>Ne?.activeNoteScope()?.id??null,ln=m=>{let k=I.multi?.spans,F=0,H=0;if(k&&k.length>0)for(let V=0;V<k.length;V+=1){let Z=k[V];if(F=V,H=Z.startIndex,m<Z.startIndex+Z.pageCount)break}return {sectionIndex:F,sectionStart:H}},Nr=(m,k)=>{if(ut?.active()){let J=ut.paragraphIds();return J.includes(m)?m:J[J.indexOf(k)+1]??null}let F=Ee(a,m)??Ee(a,k)??a.part();if(chunkZOZI27AW_cjs.Xa(F,m))return m;let H=chunkZOZI27AW_cjs.Ya(F,k),V=H?H.children.findIndex(J=>J.id===k):-1,Z=H&&V>=0?H.children[V+1]:void 0;return Z?.kind==="paragraph"?Z.id:null},ft=()=>Ia(xe(),Ke?.getActive()??null,Oe()),He=fM({textOf:m=>Vt(m),order:ft,carried:()=>mM(d)}),it=()=>globalThis.performance?.now()??Date.now(),jo=0,vn=0,ts=0,Hr=m=>{lT(m)&&n.onTiming?.("input",m.timeStamp);},{styleCascade:cn,numberingIndex:zt,defaultTabStopPt:Ko,compatibilityMode:fo}=LC(a),Ki=gM({styleCascade:cn,partOf:m=>Ee(a,m)??a.part()}),ns=null,rs=n.imageDecodePort??yM(R)??bM(),Gt=chunkFDSL5OJU_cjs.Ze({session:a,decodePort:rs,onResourcesChanged:()=>ns?.()}),Vo=n.drawingStrings??chunkZGTIE3QJ_cjs.n,Vi=chunkZGTIE3QJ_cjs.h(n.translate),ac=n.tocLabels,sc=()=>T.anchor.paragraphId!==T.head.paragraphId||T.anchor.offset!==T.head.offset?null:{paragraphId:T.head.paragraphId,offset:T.head.offset},Lf=fE(a),lc=vM({mintValidatedBytes:(m,k)=>Gt.mintValidatedBytes(m,k)}),Mn=false,dn=WM(n.revisionDisplayMode,!!n.reviewModel,m=>Se.setRevisionDisplayMode(m)),Df=dn.view,tn=dn.projection,os=dn.changeBars,xn=r.revisionAuthorVisibility??zu(n.hiddenRevisionAuthors),jt=fT({layout:xe,part:()=>a.partFor(ze())??a.part(),view:Bb}),Uo=TT(n.revisionMarkup,()=>RC(dn,xn,a),()=>Qe(),()=>{Zt=Sn(St()),at.invalidateAll(a.packageRevision(),"revision-markup"),at.flush(),Tt(false);}),St=Uo.filter,is=VT(a,tn,St),as=m=>{let k=Ee(a,m)??a.part();return CT(k,m,tn(),St())},Zt,cc=chunkFDSL5OJU_cjs.mf(a),Ui=chunkFDSL5OJU_cjs.nf(),ss=PC(),Sn=(m,k=Mn)=>{let F=DC({session:s.view(a),measurer:v,producer:P,cache:S,styleCascade:cn,numberingIndex:zt,defaultTabStopPt:Ko,compatibilityMode:fo,displayMode:tn(),showFieldCodes:k,revisionAuthorFilter:m,inlineDrawingLayoutForPart:H=>Gt.contextForPart(H),drawingLayoutTokenForPart:H=>Gt.cacheTokenForPart(H),drawingTokenForParagraphForPart:(H,V)=>Gt.drawingTokenForParagraph(V,H),linkProjectors:cc,projectFieldLink:H=>Ui.project(H)});return ss.record(F,m),F};Zt=Sn(St());let _r={...a,applyTreeOps:(m,k,F,H,V)=>st(m,k,F,H,true,V?.packageEdits),ensureListDefinition:m=>chunkZOZI27AW_cjs.Lb(d?.identity.actorId,()=>a.ensureListDefinition(m)),applyPmDoc:m=>Be==="view"?{committed:false,rejected:true,opCount:0,reason:g}:d?{committed:false,rejected:true,opCount:0,reason:"collaboration-pm-doc-unproven"}:Zf()?{committed:false,rejected:true,opCount:0,reason:b}:a.applyPmDoc(m)},wn=()=>{},zo=()=>{},Yn=IE({now:it,view:()=>je(w),pageAfterView:()=>{let m=fc();return m&&m.size>0?Math.max(...m)+1:void 0},current:()=>ve,partial:()=>Kt!==null,revision:()=>a.packageRevision(),publish:m=>o.wrap(()=>gt(m))(),snapshot:()=>Eh(I),pendingChanged:m=>e.toggleAttribute("data-docx-layout-pending",m||Kt!==null),passTimed:m=>n.onTiming?.("layout",m)}),Kt=r.progressiveOpen?Ll:null,ve=rn(),po=n.revisionStyles,Go=ZE(n.showParagraphMarks??false,Qe,()=>Tt(false)),zi=hP({session:_r,storyScope:ze,orderedRange:()=>Wr(),writeRefusal:()=>br(true),commit:(m,k)=>$e(m,k),goToPosition:(m,k)=>be.goToPosition(m,k),setSelection:m=>kt(m),beforeChange:Qe,repaint:()=>Tt(false),options:n}),Zo=r.reviewAuthorSlots??chunkZGTIE3QJ_cjs.g(),mo=UC({layout:xe,items:()=>a.reviewItems(),styles:()=>po,slots:Zo});function Qn(m){Xt(),d?.flushPendingJournals();let k={selection:T,format:Re},F=JSON.stringify(Gi.formatting()),H=RT(T,Re,m,()=>La(a.partFor(ze())??a.part(),T.head.paragraphId,T.head.offset,tn(),St()));H!==void 0&&(Re=H,F!==JSON.stringify(Gi.formatting())&&dt.record(k,{selection:T,format:Re},Ey(Se)),ee.end(),te.update(),n.onChange?.(vt()));}let Gi=CM({runFormatRefusal:()=>sr({type:"toggleMark"},Se)?.reason??null,session:_r,applyOutsideToc:(m,k)=>{let F=m.filter(H=>!Yb(H));if(F.length===0)return k(m);h=true;try{return k(F)}finally{h=false;}},storyScope:ze,paragraphOrder:ft,layout:xe,selection:()=>jt.shownSelection(T),displayMode:()=>tn(),authorFilter:St,paragraphMarkVisible:as,commit:(m,k,F)=>$e(m,k,F),orderedRange:()=>jt.shownRange(Wr()),selectionMark:()=>rt(),textOf:m=>Vt(m),selectedCells:()=>K?.cellIds,defaultParagraphStyleId:()=>cn()?.defaultParagraphStyleId??null,defaultFontFamily:()=>n.defaultFontFamily??null,pendingFormats:()=>Rt(),setPendingFormats:Qn}),nn=MM({session:_r,storyScope:ze,layout:xe,selection:()=>jt.shownSelection(T),displayMode:()=>tn(),authorFilter:St,paragraphMarkVisible:as,commit:(m,k,F)=>$e(m,k,F),orderedRange:()=>jt.shownRange(Wr()),selectionMark:()=>rt(),textOf:m=>Vt(m),paragraphOrder:ft,selectedCells:()=>K?.cellIds,armPendingFormats:m=>Qn(m),now:it,publish:()=>{nn.state().mode!=="off"?w.dataset.formatPainter="":delete w.dataset.formatPainter,n.onChange?.(vt());}}),Br=sA({session:_r,storyScope:ze,headerFooterSectionIndex:()=>Ke?.getActive()?.sectionIndex,revisionDisplayMode:tn,revisionAuthorFilter:St,paragraphOrder:ft,selectedCells:()=>K?.cellIds,editingMode:()=>Be,publishRefusal:re,caretParagraphId:()=>T.anchor.paragraphId===T.head.paragraphId&&T.anchor.offset===T.head.offset?T.head.paragraphId:null,layout:xe,commit:(m,k,F)=>$e(m,k,{rearmPending:Pt()??void 0,...F?.keepCellSelection?{keepCellSelection:true}:{}}),orderedStart:()=>Jf(),orderedRange:()=>Wr(),selectionMark:()=>rt(),collapsedAt:m=>Ve(m),deleteSelectionPlan:()=>jr(),paragraphTextOf:m=>Vt(m),numberingLevelExists:(m,k)=>chunkFDSL5OJU_cjs.wc(chunkFDSL5OJU_cjs.Hc(zt(),cn()),m,k)!==null});function A(m,k,F){return Be!=="suggest"?null:ep({paragraphId:m,offset:k},{paragraphId:m,offset:F})}let Q=gA({session:_r,layout:xe,fieldLinkById:m=>Ui.linkById(m),refusesWrite:()=>br(true)!==null,withMintActor:m=>chunkZOZI27AW_cjs.Lb(d?.identity.actorId,m),storyScope:ze,replacementLanding:A,insertionLanding:(m,k)=>chunkFDSL5OJU_cjs.Id(xe(),{paragraphId:m,offset:k}).offset,selection:()=>T,orderedRange:()=>Wr(),selectionMark:()=>rt(),textOf:m=>Vt(m),commit:(m,k)=>$e(m,k)}),ne=AO({session:_r,storyScope:ze,editingMode:()=>Be,writeRefusal:m=>br(true,[m]),trackedOps:_b,selection:()=>T,selectionMark:()=>rt(),commit:(m,k)=>$e(m,k)}),Le=m=>{let k=Ct(a,m,{kind:"body"});if(k.kind==="body")return Ne?.exitNote(),Ke?.exitHeaderFooter(),true;if(k.kind==="headerFooter"){let H=Ke?.activeScope();return H?.kind==="headerFooter"&&H.rId===k.rId?true:(Ne?.exitNote(),Ke?.enterHeaderFooter({rId:k.rId})??false)}let F=AI(ve,m);return F?Ne?.activeNoteScope()?.id===F?true:(Ke?.exitHeaderFooter(),Ne?.enterNote(F)??false):false},be=hA({pagesLayer:w,get container(){return e},scale:()=>f,layout:xe,bookmarks:()=>a.bookmarks(),linkById:m=>Ui.linkById(m)??Q.linkById(m),drawingLinkById:m=>xA(ve,m),setSelection:m=>kt(Ve(m)),whenLaidOut:(m,k)=>gc(m,k),beginJump:()=>mc(),enterStoryFor:m=>Le(m),isCollapsedSelection:()=>Lt(T,Ve(T.head)),onScrolled:()=>vc(),...n.onHyperlinkPopover?{onPopover:n.onHyperlinkPopover}:{}}),Ye=MO({pagesLayer:w,equationById:m=>ne.equationById(m),setSelection:m=>kt(m,false,"none"),...n.onEquationPopover?{onPopover:n.onEquationPopover}:{}});w.addEventListener("contextmenu",Ob),w.addEventListener("click",Mb),w.addEventListener("pointermove",Ib),w.addEventListener("pointerleave",Pb);let Ge=UE(w),Xe=null;function Pe(m,k,F,H){return wn(),Yn.finish(),chunkFDSL5OJU_cjs.sf(_e(m,k,F,H))}function*_e(m,k,F,H){let V=F?F.authorFilter:St(),Z=!F||F.furnitureSource===Zt;Z&&ss.moved(Zt,V)&&(Zt=Sn(V));let J=F?.layoutSession??I,fe=Z||!F?Zt:F.furnitureSource;return k&&chunkFDSL5OJU_cjs.Fc(J,k),!F&&H===void 0&&(Kt=null),Gt.sync(a),yield*chunkTELQ52LG_cjs.a({view:s.view(a),revision:m,measurer:v,cache:S,session:J,producer:P,styleCascade:cn,defaultTabStopPt:Ko,numberingIndex:zt,furniture:fe,compatibilityMode:fo,linkProjectors:cc,projectFieldLink:ue=>Ui.project(ue),inlineDrawingLayout:Gt.bodyContext,inlineDrawingLayoutForPart:ue=>Gt.contextForPart(ue),drawingTokenForParagraph:ue=>Gt.drawingTokenForParagraph(ue,a.part().name),drawingTokenForParagraphForPart:(ue,ke)=>Gt.drawingTokenForParagraph(ke,ue),drawingLayoutEpoch:Gt.cacheTokenForPart(a.part().name),drawingLayoutEpochForPart:ue=>Gt.cacheTokenForPart(ue),displayMode:tn(),showFieldCodes:F&&!F.live?false:Mn,fieldResults:o.mode,revisionAuthorFilter:V,bodyBlockLimit:H})}function bt(){return Pe(a.packageRevision(),void 0,{layoutSession:chunkFDSL5OJU_cjs._f(),furnitureSource:Sn(void 0,false)})}function rn(){let m=it(),k=Pe(a.packageRevision(),void 0,void 0,Kt??void 0);return jo=it()-m,k}let Fe=mt(()=>w),nt=null,Je=0,Ot=false,An=null,Fn=false;function mr(){if(Fn)return;Fn=true;let m=a.packageRevision();An=LA({steps:FA(()=>a.part()),shouldRun:()=>Be!=="view"&&a.editable&&a.packageRevision()===m,hasPendingInput:Xo,schedule:(k,F)=>{let H=Fe.setTimeout(k,F);return ()=>Fe.clearTimeout(H)}});}function Xo(m=true){return JT(e,m)}function ls(){if(Je>0){Ot=true,mr();return}if(!Xo()){Tt(),mr();return}nt===null&&(nt=Fe.setTimeout(o.wrap(()=>{nt=null,at.pending()===null&&(Tt(),mr());}),0));}let wt="",Ht=null,Ln=false;function Xt(){if(Ln||(Ht!==null&&(Fe.clearTimeout(Ht),Ht=null),wt.length===0))return;let m=wt;wt="",Ln=true;try{za(Se,ee.groupAt(T),()=>Se.type(m)),ee.landed(T);}catch(k){throw wt=m+wt,k}finally{Ln=false;}}function dc(m){wt+=m,Ht===null&&(Ht=Fe.setTimeout(o.wrap(()=>{Ht=null,Xt();}),0));}function cs(m,k,F){Xt();let H=F?.trim()||u?.trim();if(!H)return re("tracked changes need a non-empty author");if(m!=="deletion"&&k.length===0)return re(`${m} requires non-empty text`);if(m!=="deletion"&&/[\r\n\v\f\u2028\u2029]/.test(k))return re(`${m} requires text without a paragraph mark`);let V={author:H,date:chunk3IEXDEFH_cjs.c()},Z=Wr(),J=Z.from.paragraphId===Z.to.paragraphId&&Z.from.offset===Z.to.offset;if(m!=="insertion"&&J&&!(m==="replacement"&&K))return re(`${m} needs a non-collapsed selection`);let fe=m==="insertion"?{ops:[],collapseTo:chunkFDSL5OJU_cjs.Id(xe(),Z.from)}:jr(H),ue=Wl(fe.ops,V,Hb()),ke=fe.collapseTo;if(m==="insertion"||m==="replacement"){let pe=m==="replacement"?fe.replaceAt??fe.collapseTo:fe.collapseTo;ue.push({op:"insertText",paragraphId:pe.paragraphId,offset:pe.offset,text:k,revision:V}),ke={paragraphId:pe.paragraphId,offset:pe.offset+k.length};}let Me=false;return $e(()=>{let pe=st(ue,rt(),qr(ke));return Me=pe.committed,pe},()=>Ve(ke)),Me}function Zi(m){ti=false,xc.without(m),ti=false;}let Yo=wA({settle:()=>Qe(),refuse:m=>re(m),storyParagraphs:()=>ft(),textOf:m=>Vt(m),rangePlan:m=>VD(m),insertionPoint:m=>chunkFDSL5OJU_cjs.Id(xe(),m),selection:()=>T,selectionMark:()=>rt(),commitWithoutFollow:(m,k,F)=>{let H=false;return Zi(()=>$e(()=>{let V=st(m,k,k,ze(),false);return H=V.committed,V},F)),H},flushLayout:()=>on(),noteModelMoved:()=>Ze.noteModelMoved(),selectionsEqual:Lt}),at=chunk6NVZNB7O_cjs.ia({run:m=>{let k=it();wn(),Yn.abandon();let F=_E(_e(m.revision,m,void 0,Kt??void 0),fc()),H=Yn.run(F,m.revision,cT(m));return Kt=chunkFDSL5OJU_cjs.Xf(I,Kt),jo=it()-k,H},currentRevision:()=>a.packageRevision(),schedule:m=>{let k=Fe.setTimeout(o.wrap(m),0);return ()=>Fe.clearTimeout(k)},publish:m=>gt(m)});function gt(m){mo.releaseLayout(),ve=m;let k=He.map(T);k!==T&&(T=k,ni()),ls(),gr.request();}let gr=TE({now:it,schedule:(m,k)=>Fe.clearTimeout.bind(null,Fe.setTimeout(o.wrap(m),k)),revision:()=>a.packageRevision(),live:()=>I,current:()=>ve,busy:()=>Yn.pending()||Kt!==null,pass:(m,k)=>_e(m,void 0,{authorFilter:St(),layoutSession:k,furnitureSource:Zt,live:true}),createSession:chunkFDSL5OJU_cjs._f,adopt:(m,k)=>{I=m,gt(k);}}),hr=false;ns=()=>{at.invalidateAll(a.packageRevision(),"drawing-resources"),!hr&&(hr=true,Fe.setTimeout(o.wrap(()=>{hr=false,on();}),0));};let Qo=a.subscribe(m=>{l.retain(m),m.origin!==chunkZOZI27AW_cjs.g.mutationRemote&&m.origin!==chunkZOZI27AW_cjs.g.mutationUndo&&m.origin!==chunkZOZI27AW_cjs.g.mutationRedo&&dt.noteEdit(),Re=null,Ln||ee.noteForeignChange(m),m.origin===chunkZOZI27AW_cjs.g.mutationRemote?He.note(T,m.dirty,ve.revision===m.fromRevision):He.noteLocal(),at.notify(m);}),Jn=d?a.collaborationPort(d.documentId):null,go=()=>{},uc=()=>{},Xi=false,Jo=null,xb=null,xD=d?d.subscribeRemoteSelections(()=>{Xi&&Rc();}):()=>{};function fc(){let m=BC(e,ve,T,f),k=Ke?.getActive()?.pageIndex??Ze.selectionPageIndex();return k===void 0||m===void 0||m.has(k)?m:new Set([...m,k])}function Sb(){Ot&&Tt();}function on(){return at.pending()?at.flush():false}let SD=8;function wD(m){!m&&at.pending()!==null&&jo>SD&&Xo(false)||(!on()||m&&Ot)&&Tt();}function Qe(){Xt(),on();}function pc(){Xt();let m=on();return nt!==null||Ot?(Tt(),mr(),true):m}let ds=null;function wb(m){return zI(m,a.part())}function kD(){for(let m of w.querySelectorAll(".docx-content-control-chrome[data-docx-toc]")){if(m.getAttribute("data-docx-content-control")===ds){m.dataset.hover="",m.dataset.boundaryVisible="";continue}delete m.dataset.hover,oe||delete m.dataset.boundaryVisible;}}function kb(m){ds!==m&&(ds=m,kD());}function Nf(m){return GI(a.part(),Rb(m),m.target)}function Ib(m){let k=Nf(m);kb(k?wb(k):null);}function Rb(m){let k=m.target,F=k?.isConnected?k.closest("[data-paragraph-id]"):void 0;if(F)return F.dataset.paragraphId;let H=w.ownerDocument;return typeof H.elementFromPoint!="function"?void 0:H.elementFromPoint(m.clientX,m.clientY)?.closest("[data-paragraph-id]")?.dataset.paragraphId}function Pb(){kb(null);}function ID(){let m=ho(),k=chunkFDSL5OJU_cjs.rb(a.part()),F=chunkZOZI27AW_cjs.Zf(a.part()),H=F.map(pe=>{let It=mE(pe,ve,a.part(),v);return It?{...It,empty:k.has(pe.beginParagraphId)}:null}).filter(pe=>pe!==null),V=new Set(H.map(pe=>pe.boundary.id)),Z=new Set(H.filter(pe=>pe.empty).map(pe=>pe.boundary.id));for(let pe of F)pe.contentControlId&&wb(pe)!==pe.contentControlId&&Z.add(pe.contentControlId);let J=m&&!V.has(m.id)?new Set([m.id]):void 0,fe=ds?new Set([ds]):void 0,ue=new Set(chunkFDSL5OJU_cjs.Ae(ve).filter(pe=>pe.controlType==="checkbox"&&_f(pe.id)).map(pe=>pe.id)),ke=H.filter(pe=>pe.additional&&!pe.empty).map(pe=>pe.boundary),Me=Db()!==null;if(!(!oe&&!J&&!fe&&!Me&&ue.size===0&&ke.length===0&&V.size===0))return {...Me?{readOnly:true}:{},...oe?{showAll:true}:{},...J?{activeIds:J}:{},...fe?{hoverIds:fe}:{},...ue.size>0?{checkedIds:ue}:{},...ke.length>0?{additionalBoundaries:ke}:{},...V.size>0?{tocControlIds:V}:{},...Z.size>0?{suppressedIds:Z}:{}}}let us=null;function ho(){let m=ze();if(m.kind!=="body")return TD(m);if(us&&us.layout===ve&&us.selection===T)return us.result;let k=RD();return us={layout:ve,selection:T,result:k},k}function RD(){let m=zE(ve,T,v);return m&&PD(m.id)===a.part().name?m:null}function PD(m){let k=m.indexOf("#");return k===-1?"":m.slice(0,k)}function TD(m){let k=a.partFor(m);return k?chunkFDSL5OJU_cjs.qf(k,T.head.paragraphId):null}function yr(m){let k=Ee(a,m),F=chunkZOZI27AW_cjs.Xa(k??a.part(),m);return !F||!chunkZOZI27AW_cjs.Yc(F)?null:F}function Tb(m){let k=yr(m);if(!k)return null;for(let F of k.children)if(F.kind!=="textValue"&&(F.kind==="contentControlProperties"||F.localName==="sdtPr"))for(let H of F.children){if(H.kind==="textValue"||H.localName!=="tabIndex")continue;let V=H.attributes.find(J=>J.localName==="val")?.value;if(V===void 0)return null;let Z=Number(V);return Number.isFinite(Z)?Z:null}return null}function ED(){let m=ze(),k=m.kind==="body"?null:a.partFor(m),F=m.kind==="notesPart"?new Set(ft()):void 0;return (k?[...chunkFDSL5OJU_cjs.pf(k,F)]:[...chunkFDSL5OJU_cjs.Ae(ve)]).filter(V=>Cy(V)===null).sort((V,Z)=>{let J=Tb(V.id),fe=Tb(Z.id);return J!==null&&fe!==null&&J!==fe?J-fe:J!==null&&fe===null?-1:J===null&&fe!==null?1:0})}let{begin:mc,later:gc}=wE(()=>Se,{flushLayout:()=>{on();},paragraphIds:()=>a.paragraphIds(),scroller:()=>Ft(e)});function Hf(m){Ke?.getActive()||Ne?.activeNoteScope()||Ct(a,m.paragraphId,{kind:"body"}).kind==="body"&&Se.revealPosition(m);}function CD(m){let k=yr(m);if(!k)return false;let F=kA(k,{contentChildrenOf:IA,searchRoots:()=>(a.partFor(Ct(a,m,ze()))??a.part()).root.children});if(!F)return false;let H=T;return kt(F,false,"none"),(T!==H||Lt(T,F))&&Hf(T.anchor),true}let Eb=m=>lE(yr(m),()=>a.currentPackage());function _f(m){let k=yr(m);if(!k)return false;for(let F of k.children)if(F.kind!=="textValue"&&!(F.kind!=="contentControlProperties"&&F.localName!=="sdtPr")){for(let H of F.children)if(H.kind==="contentControlCheckbox")for(let V of H.children){if(V.kind!=="contentControlChecked")continue;let Z=V.attributes.find(J=>J.localName==="val")?.value;return !(Z==="0"||Z==="false"||Z==="off")}}return false}let Cb=m=>cE(yr(m));function hc(m,k){for(let F of w.querySelectorAll("[data-docx-content-control]"))F.getAttribute("data-docx-content-control")===m&&(k?F.dataset.open="":delete F.dataset.open);}let ei=WE({get document(){return w.ownerDocument},layer:w,find:yr,layout:xe,selectDrawing:(m,k)=>Se.selectDrawing(m,k),allowed:m=>!$r.disabledReason(m,"edit"),translate:m=>ms?.(m)??m,replaceImage:(m,k,F,H)=>Se.replaceImage(m,k,F,{expectedPackageRevision:a.packageRevision(),commitGuard:H}),setOpen:hc,reject:re}),Bf=sE({find:yr,allowed:m=>!$r.disabledReason(m,"edit"),apply:(m,k)=>$r.setValue(m,k),items:Eb,date:Cb,checked:_f,picture:ei.drawingOf,replaceImage:ei.replace,locale:()=>wc.get(),layer:w,setOpen:hc,request:n.onRequestContentControlWidget}),yc=null,$f;function qf(m){yc===m&&(yc=null,$f?.(),$f=void 0);let k=m.dataset.docxCcId,F=m.contains(w.ownerDocument.activeElement);m.remove(),k&&hc(k,false),F&&w.focus({preventScroll:true});}function bc(){Bf.cancel();let m=yc;return m&&qf(m),m}function Ob(m){let k=Nf(m);OD(k&&Qf(k.id)?k.id:null);}let fs=null;function OD(m){fs!==m&&(fs=m,n.onChange?.(vt()));}function Mb(m){if(m.button!==0||m.target?.closest("a.docx-hyperlink")||!Lt(T,Ve(T.head)))return;let k=Rb(m);if(!k)return;let F=chunkZOZI27AW_cjs.Zf(a.part()).find(Z=>Z.resultParagraphIds.includes(k));if(!F||Nf(m)?.id!==F.id)return;let V=chunkZOZI27AW_cjs.Eg(a.part(),F,a.documentOutline(),Xf(F))[F.resultParagraphIds.indexOf(k)];V&&(m.preventDefault(),be.goToPosition({paragraphId:V,offset:0}));}let Ab={get document(){return w.ownerDocument},locale:()=>wc.get(),translate:m=>ms?.(m)??m,setValue:(m,k)=>$r.setValue(m,k),close:m=>qf(m)};function MD(m,k){let F=$r.disabledReason(m,"edit");if(F){Y=N(F),n.onChange?.(vt());return}if(ei.cancel(),bc()?.dataset.docxCcId===m||(k==="picture"&&ei.select(m),Bf.open(m,k)))return;if(k==="picture")return ei.pick(m);if(k==="checkbox"){$r.setValue(m,_f(m)?"false":"true");return}let H=chunkFDSL5OJU_cjs.Ae(ve).find(Z=>Z.id===m)?.alias,V;if(k==="dropdown"||k==="comboBox"||k==="buildingBlockGallery"){let Z=Eb(m);if(Z.length===0&&k==="dropdown")return;V=hC(Ab,m,k,Z,H,Sh(yr(m),Z));}else if(k==="date")V=yC(Ab,m,Cb(m),H);else return;yc=V,gC(V,w,oE(ve,f,m,w,Et?.pageOffsetX)),hc(m,true),$f=Mu(V,()=>qf(V)),k==="date"?Ku(V):(V.querySelector("input")??V.querySelector('[role=option][tabindex="0"]')??V.querySelector("button,[data-docx-part=empty]"))?.focus({preventScroll:true});}let $r={setShowAll(m){oe!==m&&(oe=m,Tt());},setFormFill(m){ce!==m&&(ce=m,n.onChange?.(vt()));},showAll:()=>oe,formFill:()=>ce,atCaret:()=>ho(),navigate(m){let k=ED();if(k.length===0)return false;let F=ho(),H=F?k.findIndex(Z=>Z.id===F.id):-1;m==="next"?H=H<0?0:(H+1)%k.length:H=H<0?k.length-1:(H-1+k.length)%k.length;let V=k[H];return CD(V.id)},setValue(m,k){let F=$r.disabledReason(m,"edit");if(F)return re(F);let H=uE(yr(m),()=>a.currentPackage(),m,k);if(!H)return re("unknown-building-block");let V=false;return $e(()=>{let Z=st(H,rt(),void 0,Ct(a,m,ze()),false);return V=Z.committed,Z}),V},remove(m){let k=m??ho()?.id;if(!k)return re("notFound");let F=$r.disabledReason(k,"remove");if(F)return re(F);let H=false;return $e(()=>{let V=st([{op:"removeContentControl",controlId:k}],rt(),void 0,Ct(a,k,ze()),false);return H=V.committed,V}),H},disabledReason(m,k){let F=Db();if(F!==null)return F;let H=chunkFDSL5OJU_cjs.Ae(ve).find(Z=>Z.id===m);if(H)return k==="remove"?HA(H):Cy(H);let V=yr(m);return V?_A(V,k):"notFound"}},Wf=()=>xM(w,jf&&Be!=="view");function vt(){return {revision:a.packageRevision(),pageCount:ve.pages.length,selection:T,cellSelection:K,canUndo:dt.canUndo||(d?.canUndo()??a.canUndo()),canRedo:dt.canRedo||(d?.canRedo()??a.canRedo()),collaborationStatus:d?.status()??"inactive",lastRejection:Y,pendingFormat:Rt(),contentControls:{showAll:oe,formFill:ce,activeControlId:ho()?.id??null},contextTocId:fs,formatPainter:nn.state(),perf:{layoutMs:jo,paintMs:vn,selectionMs:ts,placed:I.stats.placed,total:I.stats.total,reusedPages:I.stats.reusedPages,fullPasses:I.stats.fullPasses,staleDiscards:at.staleDiscards,cancelledRuns:at.cancelledRuns}}}let un,Et,ti=false,ps=null,Yi=VC({pagesLayer:w,listeners:M,viewport:()=>ps,container:()=>e,setContainer:m=>e=m,destroyed:()=>bo,scale:()=>f,settle:()=>{pc(),wn(),Yn.finish(),bc(),ei.cancel(),Tc?.cancelGesture(),ea.cancelDrag();},repaint:()=>Tt(false),onHostMoved:m=>n.onHostMoved?.(m)});function Tt(m=true){if(nt!==null&&(Fe.clearTimeout(nt),nt=null,m=true),Yi.heal(),Yi.parked()){Ot=false,Ic(),m&&n.onChange?.(vt());return}Ot=false;let k=Ze.adoptBeforePaint(),F=it();un=fc(),Ke?.reconcileOccurrence();let H=Ke?.getActive()??null,V=ID(),Z=chunkFDSL5OJU_cjs.rb(a.part());chunkZGTIE3QJ_cjs.t(w,ve,{scale:f,readOnlyParagraphIds:Qd(a.part()),...Z.size>0?{emptyTocPlaceholderIds:Z}:{},...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},materialize:un,ariaHidden:false,drawingStrings:Vo,unsupportedOwnerPartName:ue=>Ee(a,ue)?.name??a.part().name,unsupportedSource:(ue,ke)=>{let Me=ke?a.currentPackage().parts.get(ke):Ee(a,ue),pe=Me?chunkZOZI27AW_cjs.Xa(Me,ue):null;return pe&&pe.kind!=="textValue"?pe:null},breakMarkStrings:Vi,...n.fieldShading?{fieldShading:n.fieldShading}:{},...po!==void 0?{revisionStyles:po}:{},revisionMarkup:Uo.current(),facingPages:ET(chunkZOZI27AW_cjs.fh(a.currentPackage())),shadeFormFields:Lf(),showParagraphMarks:Go.get(),changeBars:os(),changeBarsToggle:!!n.reviewModel,...lc?{imageUrlPort:lc}:{},...H?{activeHeaderFooterRId:H.scope.rId,activeHeaderFooterPageIndex:H.pageIndex}:{},...V?{contentControlChrome:V}:{}},mo.get().value),ut?.syncDom(),$h(w,sc(),{domReplaced:true}),CI(e,w,H!=null),Zm(e,Be),Et=Xu(ve,un),qC(w,ve,Et,f),w.style.width=`${Et.width*f}px`,w.style.height=`${Et.height*f}px`,e.style.width=`${Et.width*f}px`,e.style.height=`${Et.height*f}px`;let{width:J,height:fe}=Et;BA(X,`${J*f}px`,`${fe*f}px`),ea.update(),vn=it()-F,n.onTiming?.("paint",vn),xs(),Rc(),Ji(true),zi.paint(Xb(_)),Ic(),ps?.watchScrollerSize(),Ze.mirrorToDom(),Fb(ti),ti=false,(m||k)&&n.onChange?.(vt());}function vc(){Qe();let m=fc(),k=Xu(ve,m);Et&&Wh(m,un)&&$C(k,Et)||Tt(false);}let xc=SA({storyScopeOpen:()=>!!(Ke?.getActive()||Ne?.activeNoteScope()),selection:()=>jt.shownSelection(T),layout:xe,measurer:()=>v,preferredPageIndex:()=>Ze.selectionPageIndex(),preferredLineId:()=>Ze.selectionLineId(),pagesLayer:w,get container(){return e},scroller:()=>Ft(e),scale:()=>f,scheduleRematerialize:()=>ps?.schedule()});function Fb(m=false,k="caret"){xc.follow(m,k);}let Be=n.editingMode??"edit",jf=true,Sc=Object.freeze({kind:"body"}),Lb=0,wc=dC(n.locale,Xt),ms=n.translate,Mt=null,kc=null,Kf=null;function st(m,k,F,H=ze(),V=true,Z){Xt();let J=br(m.some(Nb)||!!Z?.length,m,V);if(J!==null)return {committed:false,rejected:true,opCount:0,reason:J};let fe=_b(V&&Mt?Mt.annotate(m):m),ue=gs(fe,k,F,H,Z);return V&&Mt?.afterApply(ue.committed),ue.committed&&fe.some(ql)&&r.onTrackedChange?.(),ue}function gs(m,k,F,H=ze(),V){let Z=d?.gateOperations(m,H);if(Z)return {committed:false,rejected:true,opCount:0,reason:Z};Lb+=1;let J=G.value;return a.applyTreeOps(m,k,F,H,d?{packageEdits:V,origin:chunkZOZI27AW_cjs.g.mutationHuman,actorId:d.identity.actorId,operationId:`${d.identity.actorId}:${d.sessionId}:browser:${Lb}`,recordsHistory:false,historyToken:J}:{packageEdits:V,historyToken:J})}function br(m,k=[],F=true){if(cr(e))return Na(e);let H=CA(k);return Be==="view"&&!H?g:Mn&&m&&F&&!H&&pE(V=>Ee(a,V),T)?Mi:m&&!H&&(F&&!h&&Zf()||k.some(V=>Yb(V)))?b:Be==="suggest"&&!u?.trim()&&m?de:Be==="suggest"?JC(k):null}let Db=KR(()=>br(true,[],false),()=>a.editable);function Nb(m){return m.op!=="acceptRevision"&&m.op!=="rejectRevision"&&m.op!=="acceptAllRevisions"&&m.op!=="rejectAllRevisions"&&m.op!=="setRevisionAttribution"}let Hb=()=>Uo.current().trackFormatting&&!a.trackingSettings().doNotTrackFormatting;function Vf(){let m=u?.trim();return Be==="suggest"&&m?m:void 0}function _b(m){let k=Vf();return k===void 0?[...m]:Wl(m,{author:k,date:chunk3IEXDEFH_cjs.c()},Hb())}function Bb(){return {displayMode:tn(),authorFilter:St()}}function $b(m){let k=jt.removedCaretEdit(T.head,m);return k===null?false:($e(()=>st(k.ops,rt(),qr(k.caret)),()=>Ve(k.caret)),true)}function Uf(m){let k=WD(m,F=>jt.shown(F));if(k?.kind==="select")kt(k.selection);else if(k){let F=Pt()??void 0;$e(()=>st(k.ops,rt(),qr(k.collapseTo)),()=>Ve(k.collapseTo),{rearmPending:F});}return k!==null}function qr(m){return {paragraphId:m.paragraphId,start:m.offset,end:m.offset}}function $e(...m){if(cr(e))return N(Na(e));let k=rC(e);try{return AD(...m)}finally{k();}}function AD(m,k,F={}){Xt(),Ln||ee.end();let H=Nt.begin();F?.keepCellSelection||(K=null),Re=null,Ze.noteModelMoved(),Je+=1;let V=null;try{let Z=G.around(Se,m,fe=>typeof fe=="boolean"?fe:fe.committed,!F?.automation),J=typeof Z=="boolean"||!Z.rejected?null:Z;if(J){let fe=String(J.reason??Fl);V=Y=N(WR(fe,a.settingsRoot()),fe);}else {Y=null,(typeof Z=="boolean"?Z:Z.committed)&&U();let fe=k?.();fe&&(vs(),T=fe,$({kind:"none"},!1),Xe=null,ti=!0);let ue=F?.rearmPending;if(ue&&ue.properties.length>0){let{anchor:ke,head:Me}=T;ke.paragraphId===Me.paragraphId&&ke.offset===Me.offset&&(Re={properties:ue.properties,base:ue.base,position:Me});}}H(),ni();}catch(Z){if((Je-=1)===0&&Ot)try{Tt();}catch{}throw Z}return Je-=1,wD(V!==null),V}function FD(){if(!un)return true;for(let m of [T.anchor,T.head]){let k=chunkFDSL5OJU_cjs.ze(xe(),m);if(k&&!un.has(k.pageIndex))return false}return true}function ni(){let m=d;if(!m)return;let k=Jn?XC(K?.text??T,H=>{let V=Ee(a,H)??a.part();return YC(V,H)},K?"cells":void 0):null,F=k?`${k.anchor.paragraphId}:${k.anchor.offset}|${k.head.paragraphId}:${k.head.offset}|${k.kind??""}`:"";F!==xb&&(xb=F,m.setLocalSelection(k));}function kt(m,k=false,F="caret",H){let V=!Lt(m,T);ut?.active()&&(!ut.contains(m.anchor.paragraphId)||!ut.contains(m.head.paragraphId))&&ut.exit(false),V&&wt.length>0&&Xt();let Z=Mt?.beforeSelect(m);if(Z===null)return;V&&!Ln&&(ee.end(),dt.endGroup()),m=Z??m,Zn(m),Ie(m);let J=ho()?.id??null,fe=qn(a.part(),T.head)?.id;vs(),T=m,K=null,k||(Xe=null),FD()||(Ze.noteModelMoved(),F==="none"?xc.without(()=>Tt(false)):Tt(false)),Ze.noteSelectionSettled(),Ze.notePointerCaret(H),Ze.mirrorToDom(true),Fb(true,F),xs(),ri.clear(),Ji();let ue=ho()?.id??null,ke=qn(a.part(),T.head)?.id;(J!==ue||fe!==ke)&&Tt(false),ni(),n.onChange?.(vt());}let Ze=jM({session:a,storyScope:ze,pagesLayer:w,selection:()=>T,setSelection:m=>kt(m),adoptSelection:m=>{let k=Mt?.beforeSelect(m);k!==null&&(m=k??m,Zn(m),Ie(m),vs(),T=m,Xe=null,ti=true,ni());},commit:m=>$e(m),applyOps:(m,k,F)=>st(m,k,void 0,F),hasPendingInput:()=>wt.length>0,replacementOffset:(m,k,F)=>ep({paragraphId:m,offset:k},{paragraphId:m,offset:F}),render:()=>Tt(),flushLayout:()=>on(),flushToPaint:()=>pc(),updateCaret:()=>{te.update(),$h(w,sc());},textOf:m=>Vt(m),pendingFormatOps:(m,k,F,H)=>ji(m,k,F,H),selectionMark:()=>rt(),now:it,recordSelectionMs:m=>{ts=m;},isGesturing:()=>W.kind==="pointer"||(Tc?.dragging()??false),domSelection:()=>K?Ve(K.text.anchor):T,holdsCellSelection:()=>K!==null,replaceSelectionWith:m=>Se.type(m),discardPaint:()=>chunkZGTIE3QJ_cjs.r(w)});Ke=EA({session:a,layout:xe,sectionAtPage:ln,revisionDisplayMode:tn,revisionAuthorFilter:St,selection:()=>T,setScopeSelection:m=>{Xt(),vs(),Zn(m),ri.clear(),T=m,K=null,Xe=null,ni();},noteModelMoved:()=>Ze.noteModelMoved(),render:()=>Tt(),mirrorToDom:()=>Ze.mirrorToDom(),notify:()=>n.onChange?.(vt()),materializedPages:()=>un,entryRefused:()=>Be==="view",leaveOtherStories:()=>{Ne?.exitNote(),ut?.exit();}}),Ne=QM({session:a,exitHeaderFooter:()=>{Ke?.exitHeaderFooter(),ut?.exit();},applyOps:st,commit:$e,selection:()=>T,selectionMark:()=>rt(),orderedStart:()=>Jf(),deleteSelectionPlan:()=>jr(),undo:()=>Se.undo(),activeScope:()=>{let m=ut?.active();if(m)return m;let k=Ne?.activeNoteScope();return k||(Ke?.activeScope()??{kind:"body"})},setActiveScopeBodyOrHf:m=>Ke.setActiveScope(m),setSelection:m=>kt(m),noteModelMoved:()=>Ze.noteModelMoved(),render:()=>{on()||Tt();},revealNote:m=>{on();for(let k of ve.pages){let F=[...k.footnotes?.notes??[],...k.endnotes?.notes??[]].find(H=>H.scopeId===m);if(F)return ws(F.box.y,F.box.height,{block:"nearest",offsetPx:48}),k.index}return null},notify:()=>n.onChange?.(vt()),lastRejection:()=>Y,setLastRejection:m=>{Y=m===null?null:N(m);}});function qb(m){m&&Xt(),K=m,m&&(Zn(m.text),vs(),T=m.text),Xe=null,Ze.noteSelectionSettled(),Ze.mirrorToDom(),xs(),ri.clear(),Ji(),ni(),n.onChange?.(vt());}let yo=null;function LD(){let k=chunkFDSL5OJU_cjs.ze(xe(),T.head)?.pageIndex??0,F=new Set;for(let H=k-1;H<=k+1;H+=1)H>=0&&H<ve.pages.length&&F.add(H);return F}function DD(){let m=a.revision(),k=un??LD();if(yo?.layout===ve&&yo.revision===m&&Wh(yo.pages,k))return yo.rects;let F=k?chunkFDSL5OJU_cjs.Ie(ve,k):()=>true,H=[];for(let J of Qi()){if(J.kind==="comment"){if(J.range===null||!F(J.range.start.paragraphId,J.range.end.paragraphId))continue;H.push({key:chunkZOZI27AW_cjs.Fj(J),from:{paragraphId:J.range.start.paragraphId,offset:J.range.start.offset},to:{paragraphId:J.range.end.paragraphId,offset:J.range.end.offset}});continue}let fe=chunkZOZI27AW_cjs.Fj(J),ue=J.kind==="revision"?J.ranges:J.range?[J.range]:[];for(let[ke,Me]of ue.entries())F(Me.start.paragraphId,Me.end.paragraphId)&&H.push({key:ue.length===1?fe:`${fe}${y}${ke}`,from:{paragraphId:Me.start.paragraphId,offset:Me.start.offset},to:{paragraphId:Me.end.paragraphId,offset:Me.end.offset}});}let V=chunkFDSL5OJU_cjs.Je(ve,H,k,v),Z=[];for(let[J,fe]of V)for(let ue of fe)Z.push({...ue,key:J});return yo={layout:ve,revision:m,pages:k,rects:Z},Z}let ri=new Set,hs=null,ys,bs=null,zf=false,Wb=false;function vs(){zf||(bs=null);}function jb(){let m=bs;if(!m||!T)return null;let k=(H,V)=>H.paragraphId===V.paragraphId&&H.offset===V.offset;if(!k(T.anchor,m.anchor)||!k(T.head,m.head))return null;let F=Qi().find(H=>chunkZOZI27AW_cjs.Fj(H)===m.key);return !F||F.kind==="custom"&&!F.carded||F.kind==="revision"&&hs!==null&&hs.has(F.revisionKind)&&(F.revisionKind!=="format"||ys===void 0||ys.has(F.formattingKind??""))&&!Wb?null:F}function Gf(){let m=jb();if(m)return Kb(m);if(!T)return null;let F=chunkZOZI27AW_cjs.Oj(Qi(),T.anchor,T.head,c()).filter(H=>!(H.kind==="comment"&&H.resolved)&&!ri.has(chunkZOZI27AW_cjs.Fj(H))&&!(H.kind==="custom"&&!H.carded)&&!(H.kind==="revision"&&hs!==null&&hs.has(H.revisionKind)&&(H.revisionKind!=="format"||ys===void 0||ys.has(H.formattingKind??""))))[0];return F?Kb(F):null}function Kb(m){if(m.kind!=="comment")return m;let k=chunkZOZI27AW_cjs.Qj(Qi(),m);return ri.has(chunkZOZI27AW_cjs.Fj(k))?null:k}function Qi(){return xn.filterItems(a.reviewItems())}let Vb=zC({roster:mo.get,styles:()=>po,slots:Zo}),Ub=Vb.forAuthor,ND=Vb.declaredFor;function HD(m,k,F){let H=m.split(y),V=H[0],Z=k.has(V);if(m.startsWith("comment-")){let Me=F.get(V),pe=Me?.kind==="comment"&&Me.resolved;return pe&&!Z?null:Z?`docx-comment-band docx-comment-band--active${pe?" docx-comment-band--resolved-active":""}`:"docx-comment-band"}if(m.startsWith("custom-"))return Z?"docx-comment-band docx-comment-band--active":null;let J=F.get(V);if(!J||J.kind!=="revision")return null;let fe=H.length>1?Number(H[1]):0;return `docx-revision-band docx-revision-band--${(Me=>Me==="delete"||Me==="moveFrom"?"delete":Me==="insert"||Me==="moveTo"?"insert":Me==="replace"&&J.replacedRangeCount!==void 0?fe<J.replacedRangeCount?"delete":"insert":"other")(J.revisionKind)}${Z?" docx-revision-band--active":""}`}let zb=null,Gb,Zb=null;function Ji(m=false){let k=Gf(),F=k&&chunkZOZI27AW_cjs.Fj(k),H=Lu(Qi,F,n.pairsReplacements?.()),V=[...H].join(`
29
- `),Z=mo.get();if(!m&&zb===ve&&Gb===V&&Zb===Z.resolved)return;let J=DE(Qi()),fe=[];for(let ue of DD()){let ke=HD(ue.key,H,J);if(!ke)continue;let Me=ue.key.split(y)[0],pe=J.get(Me),It=pe?jh(pe):null,Dn=It===null||It===""?void 0:Z.resolved.get(It),Ut=pe?.kind==="revision"&&H.has(Me)?Dn?.style?.activeBackground:void 0;fe.push({...ue,className:ke,...Dn?{reviewAuthor:Dn}:{},...Ut!==void 0?{activeBackground:Ut}:{}});}chunkZGTIE3QJ_cjs.u(B,ve,fe,{scale:f,...Et?{pageOffsetX:Et.pageOffsetX}:{}}),zb=ve,Gb=V,Zb=Z.resolved;}function xs(){Mt?.update();let m=K?chunk6NVZNB7O_cjs.na(ve,K.cellIds):he?chunkFDSL5OJU_cjs.Ge(xe(),he,ft(),v):IT(xe(),T,ft,v);chunkZGTIE3QJ_cjs.u(O,ve,m,{scale:f,pageOffsetX:Et?.pageOffsetX,...K?{}:{className:he?"docx-retained-selection-rect":"docx-selection-mark-rect"}});}function Xb(m){return {layer:m,layout:ve,revision:a.packageRevision(),scale:f,measurer:v,...un?{pages:un}:{},...Et?{pageOffsetX:Et.pageOffsetX}:{}}}function Ic(){j?.(Xb(q));}function Rc(){if(!Xi){z.replaceChildren();return}let m=d;if(!m){z.replaceChildren();return}QC(z,ve,m.remoteSelections(),{scale:f,pageOffsetX:Et?.pageOffsetX,...un?{pages:un}:{},colorForAuthor:Ub,declaredColorFor:ND,labelHost:Jo,measurer:v});}function Pc(m){let k=chunkZOZI27AW_cjs.Zf(a.part());if(m)return k.find(V=>V.id===m)??null;let F=fs?k.find(V=>V.id===fs):void 0;if(F)return F;let H=T.head.paragraphId;return k.find(V=>V.beginParagraphId===H||V.endParagraphId===H||V.resultParagraphIds.includes(H))??(k.length===1?k[0]:null)}function Zf(){return KI(a.part(),T)}function Yb(m){return VI(a.part(),m)}function Qb(){return new Set(chunkZOZI27AW_cjs.Zf(a.part()).flatMap(m=>[m.beginParagraphId,...m.resultParagraphIds,m.endParagraphId]))}function Xf(m){return new Set([m.beginParagraphId,m.endParagraphId,...m.resultParagraphIds])}function _D(m){let k=0;for(let F of ve.pages)for(let H of chunkFDSL5OJU_cjs.Aa(F))m.has(H.paragraphId)&&(k+=H.lines.length);return k}function Yf(m,k){let F=new Set(k),H=new Map;for(let V of m.pages)for(let Z of chunkFDSL5OJU_cjs.Aa(V)){if(!F.has(Z.paragraphId)||H.has(Z.paragraphId))continue;let J=V.pageFieldSource;H.set(Z.paragraphId,chunkFDSL5OJU_cjs.oc(J?.pageNumber??V.index+1,J?.format));}return H}function Qf(m){if(Be==="view"||!a.editable)return false;let k=Pc(m);return !k||!chunkZOZI27AW_cjs.$f(a.part(),a.documentOutline(),k.instruction)?false:chunkZOZI27AW_cjs.Hl(a.part(),{op:"rewriteTocPageNumbers",tocId:k.id,updates:[]})===null}function Jb(m,k){if(!Number.isInteger(m)||!Number.isInteger(k)||m<1||k<1)return null;let F=Br.sectionPropertiesAt(T.head.paragraphId),H=F.pageSize.widthTwips-F.margins.leftTwips-F.margins.rightTwips-F.margins.gutterTwips,V=Math.max(300,Math.floor(H/k));return {op:"insertTable",beforeParagraphId:T.head.paragraphId,rows:m,cols:k,columnWidthTwips:V}}function ev(m,k){if(ut?.active()||Be==="view"||!a.editable)return false;let F=Jb(m,k),H=a.partFor(ze())??a.part();return F!==null&&chunkZOZI27AW_cjs.Hl(H,F)===null}function BD(m,k){if(!ev(m,k))return false;let F=Jb(m,k);if(!F)return false;let H=null,V=a.subscribe(J=>{J.caret&&(H=J.caret);}),Z=false;try{$e(()=>{let J=st([F],rt());return J.committed||(Y=N(J.reason??"the table could not be inserted here",J.reason??"table-insert-refused")),Z=J.committed,J},()=>{let J=H;return J?Ve({paragraphId:J.paragraphId,offset:J.start}):null});}finally{V();}return Z}let tv='TOC \\o "1-3" \\h';function nv(){let m=chunkZOZI27AW_cjs.Xf(tv);if(!m)return null;let k=a.documentOutline(),F=chunkZOZI27AW_cjs.Cg(a.part(),k,m,Yf(Se.layout(),k.map(H=>H.blockId)),Qb(),d?.identity.actorId);return {op:"insertToc",beforeParagraphId:T.head.paragraphId,instruction:tv,alias:ac?.title??"TOC",entries:F.entries,bookmarksToCreate:F.bookmarksToCreate}}function rv(){if(Be==="view"||!a.editable||Zf())return false;let m=nv();return m!==null&&chunkZOZI27AW_cjs.Hl(a.part(),m)===null}function $D(){if(!rv())return false;let m=nv();if(!m)return false;let k=new Set(chunkZOZI27AW_cjs.Zf(a.part()).map(V=>V.id)),F=gs([m],void 0,void 0,Sc);if(!F.committed)return Y=N(F.reason??"the table of contents could not be inserted",F.reason??"table-of-contents-refused"),false;let H=chunkZOZI27AW_cjs.Zf(a.part()).find(V=>!k.has(V.id));return H?ov(H.id,"pageNumbers"):true}function ov(m,k="entire"){let F=Pc(m);if(!F||!Qf(F.id))return false;No(Se);let H=Se.layout(),V=a.documentOutline(),Z=chunkZOZI27AW_cjs.$f(a.part(),V,F.instruction);if(!Z)return false;let J=Z.map(ue=>ue.blockId);if(k==="entire"){let ue=chunkZOZI27AW_cjs.Cg(a.part(),V,F.instruction,Yf(H,J),Xf(F),d?.identity.actorId),ke=gs([{op:"replaceTocResult",tocId:F.id,entries:ue.entries,bookmarksToCreate:ue.bookmarksToCreate}],void 0,void 0,Sc);if(!ke.committed)return Y=N(ke.reason??"the table of contents could not be refreshed",ke.reason??"table-of-contents-refused"),false;if(H=Se.layout(),F=Pc(F.id),!F)return true}let fe="";for(let ue=0;ue<3;ue+=1){let ke=Yf(H,J),Me=chunkZOZI27AW_cjs.Eg(a.part(),F,V,Xf(F)),pe=F.resultParagraphIds.flatMap((Ut,Kr)=>{let Cc=Me[Kr],ks=Cc?ke.get(Cc):void 0;return ks===void 0?[]:[{paragraphId:Ut,pageNumberText:ks}]});if(pe.length===0)break;let It=pe.map(Ut=>`${Ut.paragraphId}\0${Ut.pageNumberText}`).join("");if(It===fe)break;fe=It;let Dn=gs([{op:"rewriteTocPageNumbers",tocId:F.id,updates:pe}],void 0,void 0,Sc);if(!Dn.committed){if(Dn.rejected)return Y=N(Dn.reason??"the table of contents page numbers were refused",Dn.reason??"table-of-contents-refused"),false;break}H=Se.layout(),F=Pc(F.id)??F;}return true}function qD(){return No(Se),IC({session:a,editingMode:Be,collaborationActive:d!==void 0,reviewerFilterActive:xn.filterForSession(a)!==void 0,layout:Se.layout(),canonicalUnfilteredLayout:bt,styleCascade:cn(),numberingIndex:zt(),displayMode:tn()})}let{selectionMark:rt,orderedRange:Wr,orderedStart:Jf,textOf:Vt,atomicControlDeletion:WD,splitEndsTheParagraph:jD,deleteSelectionPlan:jr,deleteSelectionOps:KD,deleteRangePlan:VD,replacementOffset:ep}=cM({session:a,layout:xe,selection:()=>T,cellSelection:()=>K,editingMode:()=>Be,author:()=>u,trackedDate:chunk3IEXDEFH_cjs.c,storyScope:ze,paragraphOrder:ft,flushPendingInputAndLayout:Qe,trackedAuthorOrNone:Vf,atParagraphEnd:(m,k)=>Ki.atParagraphEnd(m,k),revisionView:Bb}),{insertPlainText:iv,copyFlavoursNow:UD,pasteRichNow:zD,armForcePlainPaste:GD}=lM({session:a,textFormFieldId:()=>Mt?.fieldId()??null,richPasteAllowed:()=>!ut?.active(),paragraphIds:Xn,layout:xe,cellSelection:()=>K,editingMode:()=>Be,storyScope:ze,paragraphOrder:ft,actorId:()=>d?.identity.actorId,collaborationGate:(m,k)=>d?.gateOperations(m,k)??null,now:it,flushPendingInputAndLayout:Qe,orderedRange:Wr,selectionMark:rt,deleteSelectionPlan:jr,consumePendingFormatOps:ji,withoutPendingOnRejection:Dr,caretMark:qr,commit:$e});function Ss(m){m&&(Wo=null,Qe(),Zt=Sn(St()),at.invalidateAll(a.packageRevision(),"tracked-change-filter"),at.flush(),n.onChange?.(vt()));}let bo=false,Se={session:a,applyGatedTreeOps:(m,k,F,H)=>gs(m,k,F,H??ze()),storyScope:ze,imageDecodePort:()=>rs,textMeasurer:()=>v,layout:()=>(Qe(),ve),state:vt,currentPage:(m="caret")=>{if(Qe(),m==="viewport"){let F=_C(e,ve,f);if(F!==null)return F}let k=chunkFDSL5OJU_cjs.ze(xe(),T.head);return k?k.pageIndex+1:1},automationWriteRefusal:(m,k)=>br(m.some(Nb)||k,m,false),setScale(m){if(!(m>0)||!Number.isFinite(m))return false;if(m===f)return true;let k={scale:f,defaults:x,measurer:v,producer:P,furnitureSource:Zt};try{let F=Ft(e),H=F?{x:(F.scrollLeft-e.offsetLeft+F.clientWidth/2)/f,y:(F.scrollTop-e.offsetTop+F.clientHeight/2)/f}:null;if(f=m,n.measurer||(x=chunk6NVZNB7O_cjs.X(f,{context:Ho(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),v=x.measurer),P=C(),Zt=Sn(St()),un=void 0,Et=void 0,yo=null,at.invalidateAll(a.packageRevision(),"zoom"),at.flush(),Sb(),F&&H){let V=Math.max(0,H.x*f+e.offsetLeft-F.clientWidth/2),Z=Math.max(0,H.y*f+e.offsetTop-F.clientHeight/2),J=Number.isFinite(F.scrollWidth)?Math.max(0,F.scrollWidth-F.clientWidth):null,fe=Number.isFinite(F.scrollHeight)?Math.max(0,F.scrollHeight-F.clientHeight):null;F.scrollLeft=J===null?V:Math.min(V,J),F.scrollTop=fe===null?Z:Math.min(Z,fe),vc();}return !0}catch{(({scale:f,defaults:x,measurer:v,producer:P,furnitureSource:Zt}=k)),un=void 0,Et=void 0,yo=null;try{at.invalidateAll(a.packageRevision(),"zoom-rollback"),at.flush();}catch{}return false}},enqueueType:dc,flushPendingInput:Qe,type(m){let k=jr(),F=k.replaceAt??k.collapseTo,H=ji(F.paragraphId,F.offset,m.length),V=k.ops.length===0?KE(ho()):void 0,Z=[...k.ops,VE(F,m,V)],J=jE(Ee(a,F.paragraphId)??a.part(),F.paragraphId,F.offset,m.length),fe={paragraphId:F.paragraphId,start:J,end:J};$e(()=>Dr([...Z,...H],Z,rt(),fe),()=>Ve({paragraphId:F.paragraphId,offset:J}));},proposeTextChange:(m,k,F)=>cs(m,k,F),replaceTextInPlace:Yo,insertPlainText:m=>iv(m),deleteBackward(){if(Mt?.selectForDeletion("backward")||Uf("backward"))return;let m=jr();if(m.ops.length>0){$e(()=>st(m.ops,rt(),qr(m.collapseTo)),()=>Ve(m.collapseTo));return}if($b("backward"))return;let k=Pt()??void 0,F=jt.shown(T.head);if(F.offset===0){for(let ue of chunkFDSL5OJU_cjs.Ra(xe(),F.paragraphId)){let ke=Vt(ue);if(ke.length!==0){$e(()=>st([{op:"deleteText",paragraphId:ue,start:ke.length-1,end:ke.length}],rt(),qr({paragraphId:ue,offset:ke.length-1})),()=>Ve({paragraphId:ue,offset:ke.length-1}),{rearmPending:k});return}}let H=ft(),V=H.indexOf(F.paragraphId),Z=H[V-1];if(!Z)return;let J=jt.joinOps(Z,F.paragraphId);if(!J){kt(Ve({paragraphId:Z,offset:Vt(Z).length}));return}let fe=Vt(Z).length;$e(()=>st(J,rt(),qr({paragraphId:Z,offset:fe})),()=>Ve({paragraphId:Z,offset:fe}),{rearmPending:k});return}$e(()=>st([{op:"deleteText",paragraphId:F.paragraphId,start:F.offset-1,end:F.offset}],rt(),qr({...F,offset:F.offset-1})),()=>Ve({...F,offset:F.offset-1}),{rearmPending:k});},splitParagraph(){let m=jr(),k=m.replaceAt??m.collapseTo,F=Pt()??{properties:La(Ee(a,k.paragraphId)??a.part(),k.paragraphId,k.offset,tn(),St()),base:[]},H=jD(k),V=H?Ki.followerStyleId(k.paragraphId):void 0,Z=chunkZOZI27AW_cjs.$h(F.base,F.properties,is(k.paragraphId,k.offset)),J=H&&Be==="edit"&&Z.length>0?[{op:"setParagraphMarkProperties",paragraphId:k.paragraphId,properties:Z}]:[],fe={op:"splitParagraph",paragraphId:k.paragraphId,offset:k.offset,tailStyleId:V},ue=Vf(),ke=ue?{author:ue,date:chunk3IEXDEFH_cjs.c()}:void 0,Me=a.documentStyles(),pe=Ou(Me),It=pe??"ListParagraph",Dn=new Set(Me.map(Vr=>Vr.styleId));for(let Vr=1;!pe&&Dn.has(It);Vr++)It=`ListParagraph${Vr}`;let Ut=Be!=="view"&&m.ops.every(Vr=>Vr.op==="deleteText"&&Vr.paragraphId===k.paragraphId)&&V===void 0?QT(Ee(a,k.paragraphId)??a.part(),ve,k,Z,It,cn(),ke,d?.identity.actorId):null,Kr=ke?[{op:"setParagraphMarkRevision",paragraphId:k.paragraphId,kind:"ins",revision:ke}]:[],Cc=Ut?[Ut,...J,...Kr]:[fe],ks=Ut?new Set(Xn()):null;nC(a,k.paragraphId,Vr=>$e(()=>Dr([...m.ops,...J,...Cc],[...m.ops,...Ut?[Ut,...Kr]:[fe]],rt(),void 0,Ut&&!pe?[rE(cn()?.defaultParagraphStyleId??null,It)]:void 0),()=>{if(!ks)return Vr();let gv=Xn().filter(tN=>!ks.has(tN)),hv=Ut?gv.at(-1):gv[0];return hv?Ve({paragraphId:hv,offset:0}):null},{rearmPending:F}),Nr);},navigate(m,k=false){if(m==="documentEnd"&&No(Se),Qe(),!k&&(m==="left"||m==="right")&&(T.anchor.paragraphId!==T.head.paragraphId||T.anchor.offset!==T.head.offset)){let pe=Wr();Xe=null;let It=GE(xe(),pe,ft(),m,v);kt(Ve(It),true);return}let F=xe(),H=Xm(F,jt.shown(T.head),m,Xe,Ke?.getActive()??null,Oe(),v,Ze.selectionLineId());if(!H)return;let V=Qb(),Z=UI(a.part(),H.position,["left","wordLeft","lineStart","up","pageUp"].includes(m));if(Z&&(H={...H,position:Z,caret:void 0}),E){let pe=_M(F,T.head,H.position);pe!==H.position&&(H={...H,position:pe,caret:void 0});}if(qn(a.part(),H.position)){if(k)return;let It=new Set(["left","wordLeft","lineStart","up","pageUp"]).has(m)?"up":"down",Dn=_D(V)+4;for(let Ut=0;Ut<Dn;Ut+=1){let Kr=Xm(xe(),H.position,It,H.desiredX,Ke?.getActive()??null,Oe(),v);if(!Kr||Kr.position.paragraphId===H.position.paragraphId&&Kr.position.offset===H.position.offset)return;if(H=Kr,!qn(a.part(),H.position))break}if(qn(a.part(),H.position))return}Xe=H.desiredX,Ne?.activeNoteScope()&&H.pageIndex!==void 0&&Number.isInteger(H.pageIndex)&&Ne.setActiveNotePageIndex(H.pageIndex);let fe={anchor:k?jt.shown(T.anchor):H.position,head:H.position},ue=k&&!E?fe:Gl(F,fe,{atomic:k&&E}),ke=!k&&!Lt(ue,fe),Me=T;kt(ue,true,ke?"none":"head",ke?void 0:H.caret),ke&&(T!==Me||Lt(T,ue))&&Hf(T.anchor);},deleteWordBackward(){if(Se.deleteSelection())return;let m=T.head,k=(Mt?.wordDeletionBoundary??chunkFDSL5OJU_cjs.te)(Vt(m.paragraphId),m.offset,-1,chunkFDSL5OJU_cjs.Ce(xe(),m.paragraphId));if(k===m.offset){Se.deleteBackward();return}$e(()=>st([{op:"deleteText",paragraphId:m.paragraphId,start:k,end:m.offset}],rt()),()=>Ve({...m,offset:k}),{rearmPending:Pt()??void 0});},deleteWordForward(){if(Se.deleteSelection())return;let m=T.head,k=(Mt?.wordDeletionBoundary??chunkFDSL5OJU_cjs.te)(Vt(m.paragraphId),m.offset,1,chunkFDSL5OJU_cjs.Ce(xe(),m.paragraphId));if(k===m.offset){Se.deleteForward();return}$e(()=>st([{op:"deleteText",paragraphId:m.paragraphId,start:m.offset,end:k}],rt()),void 0,{rearmPending:Pt()??void 0});},deleteForward(){if(Mt?.selectForDeletion("forward")||Uf("forward")||Se.deleteSelection()||$b("forward"))return;let m=Pt()??void 0,k=jt.shown(T.head),F=Vt(k.paragraphId);if(k.offset<F.length){$e(()=>st([{op:"deleteText",paragraphId:k.paragraphId,start:k.offset,end:k.offset+1}],rt()),void 0,{rearmPending:m});return}ft().at(-1)===k.paragraphId&&No(Se);let H=ft(),V=H[H.indexOf(k.paragraphId)+1];if(V){if(chunkFDSL5OJU_cjs.Ra(xe(),V).includes(k.paragraphId)){if(Vt(V).length===0)return;$e(()=>st([{op:"deleteText",paragraphId:V,start:0,end:1}],rt()),()=>Ve(k),{rearmPending:m});return}$e(()=>st(jt.forwardJoinOps(k.paragraphId,V)??[{op:"joinParagraphs",firstId:k.paragraphId,secondId:V}],rt()),()=>Ve(k),{rearmPending:m});}},...Br,...Gi,setSelection:m=>{Lt(m,T)||$({kind:"programmatic"},false),He.discard(),kt(m);},selectDrawing(m,k){on();let F=Ba(ve,m,k);if(!F)return false;let H=Ve(F);return $({kind:"pointer",drawingNodeId:m},Lt(H,T)),kt(H,true,"none"),On(Se)?.drawingNodeId===m},revealPage(m,k){mc();let F=ve.pages.find(H=>H.index===m);return !F&&gc(m,()=>Se.revealPage(m,k))?true:F?ws(F.box.y,F.box.height,k):false},revealParagraph(m,k){mc();let F={paragraphId:m,offset:0},H=chunkFDSL5OJU_cjs.ze(xe(),F);if(!H&&gc(F,()=>Se.revealParagraph(m,k)))return true;if(!H)return false;let V=ve.pages.find(Z=>Z.index===H.pageIndex);return V?ws(V.contentBox.y+H.y,H.height,k):false},revealPosition(m,k){mc();let F=chunkFDSL5OJU_cjs.ze(xe(),m);if(!F&&gc(m,()=>Se.revealPosition(m,k)))return true;if(!F)return false;let H=ve.pages.find(Z=>Z.index===F.pageIndex);if(!H)return false;let V=wl(H,m.paragraphId).y+F.y;return ws(V,F.height,{block:"nearest",...k})},setEditable(m){jf=m,m||ut?.exit(),Wf();},selectAll(){No(Se);let m=ft(),k=m[0],F=m[m.length-1];!k||!F||kt({anchor:{paragraphId:k,offset:0},head:{paragraphId:F,offset:Vt(F).length}});},hyperlinks:Q,equations:ne,contentControls:$r,formatPainter:nn,canInsertTable:ev,insertTable:BD,canInsertToc:rv,insertToc:$D,canRefreshToc:Qf,canEditTextFormField:()=>Mt?.canEdit()??false,editTextFormField:()=>Mt?.edit()??false,refreshToc:ov,refreshRefFieldResults:qD,save:()=>aC(Se,e,()=>bo),saveSteps:()=>sC(Se,e,()=>bo),isInsideToc:m=>ZI(a.part(),m),retainSelection:()=>{let m=Symbol("selection-pin");return Ce.set(m,T),he=T,xs(),m},releaseSelection:m=>{Ce.delete(m)&&(ct(),xs());},retainedSelection:()=>he,publishedLayout:()=>ve,drawingSelectionIntent:()=>W,overlayCoordinates:()=>Object.freeze({paintScale:f,pageOffsetX:Et?.pageOffsetX??new Map}),commitReviewOps:(m,k)=>{Qe();let F=T.head.paragraphId,H=Vt(F),V=null;return Zi(()=>{V=$e(()=>{if(Be==="view")return {committed:false,rejected:true,opCount:0,reason:g};if(d&&(k===void 0||!eE.has(k)))return {committed:false,rejected:true,opCount:0,reason:"experimental-collaboration-body-text-only"};if(d){let ke=d.gateOperations([],ze());if(ke)return {committed:false,rejected:true,opCount:0,reason:ke}}let Z=d?.identity.actorId,J=chunkZOZI27AW_cjs.Lb(Z,()=>m(G.value)),fe=typeof J.reason=="string"?{reason:J.reason}:{},ue=J.committed;return {committed:ue,rejected:!ue,opCount:0,...fe}},()=>{on(),Ze.noteModelMoved();let Z=ft();if(Z.length===0)return null;let J=Vl(T,F,H,Vt(F));return Fo(xe(),Z,J)});}),V},revisionDisplayMode:Df,replacementLanding:A,applyAutomationOps:(m,k,F,H=false)=>{let V=null,Z=k??Sc,fe=$e(()=>{let ue=br(false);if(ue!==null)return V={committed:false,rejected:true,opCount:0,reason:ue};let ke=null,Me=m(pe=>{let It=br(true,[],false);return It===null?chunkZOZI27AW_cjs.Lb(d?.identity.actorId,()=>a.ensureHyperlinkRelationship(pe,Z)):(ke=It,null)});return Me===null?V={committed:false,rejected:true,opCount:0,reason:ke??"this engine will not author that hyperlink target"}:!n.reviewModel&&(H||Me.some(ql))?V={committed:false,rejected:true,opCount:0,reason:"review-module-required"}:V=st(Me,void 0,void 0,Z,false,F)},()=>{on(),Ze.noteModelMoved();let ue=ft();return ue.length===0?null:Fo(xe(),ue,T)},{automation:true})??Fl;return V??{committed:false,rejected:true,opCount:0,reason:fe}},editingMode:()=>Be,author:()=>u,setAuthor:m=>{u!==m&&(Xt(),u=m,m?.trim()&&Uu(Y)&&(Y=null,n.onChange?.(vt())));},setDrawingStrings:m=>{Vo!==m&&chunkZGTIE3QJ_cjs.m(Vo)!==chunkZGTIE3QJ_cjs.m(m)&&(Vo=m,Qe(),Tt(false));},setLocale:wc.set,setTranslate:m=>{if(ms===m)return;ms=m,hh(w,m),Mt?.update();let k=chunkZGTIE3QJ_cjs.h(m),F=chunkZGTIE3QJ_cjs.i(k)!==chunkZGTIE3QJ_cjs.i(Vi);Vi=k,F&&Go.get()&&(Qe(),Tt(false));},setTocLabels:m=>{ac=m;},setEditingMode:m=>{Qe();let k=Be!==m;Be=m,k&&m!=="edit"&&ut?.exit(),k&&m==="view"&&Ke?.exitHeaderFooter(),k&&m==="view"&&Ne?.exitNote(),k&&m==="view"&&nn.disarm(),bc(),Wf(),Zm(e,Be),k&&Tt(false),Y=null,n.onChange?.(vt());},revisionAuthors:()=>mo.get().value,setRevisionDisplayMode(m){bo||m===dn.view()||(Qe(),dn.set(m),Ss(true));},hiddenRevisionAuthors:()=>xn.hiddenAuthors,setRevisionAuthorVisible(m,k){Ss(xn.setVisible(m,k));},setAllRevisionAuthorsVisible(m){Ss(xn.setAllVisible(mo.get().value.keys(),m));},showAllRevisionAuthors(){Ss(xn.showAll());},setTrackedChangesFilter(m,k){Ss(xn.setPredicate(m,k));},collaborationSession:()=>d??null,remotePresenceColor:Ub,setShowParagraphMarks:Go.set,setRevisionMarkup:Uo.set,setUnsupportedElementRules:m=>{let k=ah(Pl(m));if(k.view(a).currentPackage(),s.view(a).currentPackage(),k.geometryKey()===s.geometryKey()){s=k,Zt=Sn(St());return}Qe(),s=k,Zt=Sn(St()),at.invalidateAll(a.packageRevision(),"unsupported-content"),at.flush(),n.onChange?.(vt());},setRevisionStyles:m=>{m!==po&&(po=m,Qe(),Tt(false));},setHighlightPainter(m){j=m,m||q.replaceChildren(),Ic();},repaintHighlights:Ic,setRemoteCaretLabelHost:m=>{m!==Jo&&(Jo=m,Rc());},setReviewActivationExclusions(m,k){ys=k?.formattingKinds?new Set(k.formattingKinds):void 0,hs=m===null?null:new Set(m),Ji(),n.onChange?.(vt());},activeReviewKey:()=>{let m=Gf();return m?chunkZOZI27AW_cjs.Fj(m):null},activateReview:(m,k,F)=>{if(ri.clear(),Wb=F?.allowExcluded??false,bs=k?{key:m,anchor:k.anchor,head:k.head}:{key:m,anchor:T.anchor,head:T.head},k){let H=()=>{zf=true;try{kt(k,!1,F?.preventScroll?"none":"caret");}finally{zf=false;}};F?.preventScroll?Zi(H):H();return}Ji(),n.onChange?.(vt());},activatedReviewKey:()=>jb()===null?null:bs?.key??null,dismissActiveReview:()=>{let m=Gf();m&&(ri.add(chunkZOZI27AW_cjs.Fj(m)),bs=null,Ji(),n.onChange?.(vt()));},navigation:be,bookmarkEditing:zi,bookmarks:()=>a.bookmarks(),selectedText(){if(K)return bT(ve,K);let{from:m,to:k}=Wr();return yT(xe(),m,k,ft())},copyFlavours:()=>UD(),pasteRich:(m,k)=>zD(m,k),armForcePlainPaste:GD,deleteSelection(){if(!Lt(T,Ve(T.head))&&Uf("backward"))return true;let k=jr();return k.ops.length===0?false:($e(()=>st(k.ops,rt(),qr(k.collapseTo)),()=>Ve(k.collapseTo)),true)},setCellSelection:qb,layoutSession:()=>I,undo:()=>{if(Be==="view"||cr(e)){Y=N(g),n.onChange?.(vt());return}Xt(),ee.end(),d?.flushPendingJournals(),dt.step("undo",De,()=>we("undo"));},redo:()=>{if(Be==="view"||cr(e)){Y=N(g),n.onChange?.(vt());return}Xt(),ee.end(),d?.flushPendingJournals(),dt.step("redo",De,()=>we("redo"));},sectionAtPage:ln,activeScope:()=>{let m=ut?.active();if(m)return m;let k=Ne?.activeNoteScope();return k||Ke.activeScope()},setActiveScope:m=>(Qe(),m.kind==="frame"?ut.enter(m):m.kind!=="body"&&m.kind!=="headerFooter"&&m.kind!=="note"?false:(ut?.exit(),m.kind==="note"?Ne.enterNote(m.id):(Ne?.exitNote(),Ke.setActiveScope(m)))),insertNote:m=>(Qe(),Ne.insertNote(m)),deleteNote:(m,k)=>Ne.deleteNote(m,k),convertNote:(m,k)=>Ne.convertNote(m,k),convertAllNotes:m=>Ne.convertAllNotes(m),setNoteProperties:m=>Ne.setNoteProperties(m),enterNote:(m,k)=>(Qe(),Ne.enterNote(m,k)),exitNote:()=>(Qe(),Ne.exitNote()),notePropertiesState:()=>{let m=Se.state().selection.head.paragraphId,k=a.packageRevision(),F=a.currentPackage(),H=a.part(),V=chunkZOZI27AW_cjs.fh(F),Z=chunkZOZI27AW_cjs.qh(F,"footnote"),J=chunkZOZI27AW_cjs.qh(F,"endnote"),fe=Se.activeScope().kind==="headerFooter",ue=Se.headerFooterState(),ke=ue?.rId??null,Me=ue?.sectionIndex??null,pe=Wo;if(pe&&pe.packageRevision===k&&pe.paragraphId===m&&pe.bodyPart===H&&pe.settingsPart===V&&pe.footnotesPart===Z&&pe.endnotesPart===J&&pe.headerFooterOpen===fe&&pe.headerFooterRId===ke&&pe.headerFooterSectionIndex===Me)return pe.result;let It=MA(Se,St());return Wo={packageRevision:k,paragraphId:m,bodyPart:H,settingsPart:V,footnotesPart:Z,endnotesPart:J,headerFooterOpen:fe,headerFooterRId:ke,headerFooterSectionIndex:Me,result:It},It},notePreviewText:m=>AA(a,m),applyTableCommandPlan(m){if(!m.ok)return {ok:false,code:m.code,reason:m.reason};let k=null,F=a.subscribe(H=>{H.caret&&(k=H.caret);});try{let H=rt(),V=m.selection.kind==="adoptCommittedCaret";$e(()=>st(m.ops,H),V?()=>{let Z=k;return Z?Ve({paragraphId:Z.paragraphId,offset:Z.start}):null}:void 0,m.selection.kind==="preserveSelection"?{keepCellSelection:!0}:void 0);}finally{F();}return Y?{ok:false,code:"invalidArgs",reason:Y}:{ok:true,changed:true}},enterHeaderFooter:m=>{Qe();let k=Ke.enterHeaderFooter(m);if(!k)return k;let F=Ke.getActive(),H=F?ve.pages[F.pageIndex]:void 0;if(F&&H){let V=F.kind==="header"?H.header:H.footer,Z=V?.box.y??(F.kind==="header"?H.box.y:H.box.y+H.box.height-1),J=V?.box.height??1;ws(Z,J,{block:"nearest"});}return k},exitHeaderFooter:()=>(Qe(),Ke.exitHeaderFooter()),headerFooterState:()=>Ke.headerFooterStateStable(a.packageRevision()),...RA({applyOps:st,commit:$e,deleteSelectionOps:KD,deleteSelectionPlan:()=>jr(),orderedStart:Jf,selectionMark:rt,collapsedAt:Ve,isHeaderFooterOpen:()=>Ke?.getActive()!==null,lastRejection:()=>Y}),...TA({session:a,applyOps:st,commit:$e,storyScope:ze,selectionMark:rt,editingMode:()=>Be,author:()=>u,trackedDate:chunk3IEXDEFH_cjs.c,decodePort:()=>rs,actorId:()=>d?.identity.actorId}),focus:()=>{w.ownerDocument.activeElement!==w&&(w.focus({preventScroll:true}),Ze.mirrorToDom(true));},setTableInteractionLabel(m){p.resolve=m;},refreshTableInteractionLabels(){ea.refreshLabels();},moveTo:Yi.moveTo,park:Yi.park,parked:Yi.parked,hostElement:()=>e,destroy(){if(!bo){bo=true,zo(),Kt=null,Yn.cancel(),gr.cancel();try{pc();}finally{w.removeEventListener("pointerdown",mv,{capture:true}),w.removeEventListener("keydown",Ec,{capture:true}),w.removeEventListener("keydown",Hr,{capture:true}),w.removeEventListener("pointerdown",Hr,{capture:true}),w.removeEventListener("beforeinput",Ec,{capture:true}),w.removeEventListener("keydown",cv),eN(),w.removeEventListener("beforeinput",pv),w.removeEventListener("copy",dv),w.removeEventListener("cut",uv),w.removeEventListener("paste",fv),w.removeEventListener("compositionstart",sv),w.removeEventListener("compositionend",av),ps?.destroy(),M.clear(),Yi.destroy(),bc(),Bf.destroy(),ei.destroy(),Mt?.destroy(),kc?.destroy(),Kf?.destroy(),Tc?.destroy(),ea.destroy(),be.destroy(),Ye.destroy(),Ze.destroy(),w.removeEventListener("contextmenu",Ob),w.removeEventListener("click",Mb),w.removeEventListener("pointermove",Ib),w.removeEventListener("pointerleave",Pb),Ge.destroy(),at.cancel(),nt!==null&&Fe.clearTimeout(nt),nt=null,An&&An(),An=null,Gt.dispose(),chunkZGTIE3QJ_cjs.l(w),te.destroy(),xD(),uc(),go(),Qo(),e.replaceChildren();}}}};function ZD(m){Re=null;let k=Mt?.restoreAfterHistory();if(!m&&k&&(T=k),Ze.noteModelMoved(),on(),!m){kt(Fo(xe(),ft(),T));return}if("anchor"in m){let H=ft(),V=!d&&[m.anchor,m.head].every(Z=>H.includes(Z.paragraphId));kt(V?m:Fo(xe(),H,m));return}let F={anchor:{paragraphId:m.paragraphId,offset:m.start},head:{paragraphId:m.paragraphId,offset:m.end}};kt(ft().includes(m.paragraphId)?F:Fo(xe(),ft(),F));}function ws(m,k,F){let H=Ft(e);if(!H||H.clientHeight===0)return false;Sb();let V=m*f+e.offsetTop;return kE(H,V,k*f,F)&&vc(),true}let{onSelectionChange:XD,onCompositionEnd:av}=o.methods({...Ze}),sv=(...m)=>{Ze.adoptBeforeInput(),pc(),Ze.onCompositionStart(...m);},Tc=null,YD=tC({onRequest:n.onRequestTextFormField,onInvalidRequest:n.onRequestInvalidTextFormField,locale:wc.get,translate:(m,k)=>ms?.(m,k)??m,pagesLayer:w,get container(){return e},listeners:M,part:m=>Ee(a,m??T.head.paragraphId)??a.part(),parts:()=>a.storyParts(),protected:(m=T.head.paragraphId)=>chunkZOZI27AW_cjs.vj(a.settingsRoot())&&chunkZOZI27AW_cjs.wj(Ee(a,m)??a.part(),m),selection:()=>T,select:(m,k)=>kt(m,false,k?"none":"caret"),reveal:Hf,editable:()=>Be==="edit"&&!Mn,apply:m=>Bu(m,$e,st),save:(m,k)=>cC(m,k,{session:a,commit:$e,refusal:()=>br(true,m,false),gate:(F,H)=>d?.gateOperations(F,H)??null,collaborationActive:d!==void 0})},r.initialTextFormInput);Mt=AC(YD,{part:m=>Ee(a,m),selection:()=>T,select:m=>kt(m),writable:()=>Be!=="view"&&!Mn,compare:Ae},o),BR(Se,Mt.fieldId),$R(Se,n.contentLockPolicy),Kf=vC({pagesLayer:w,part:m=>Ee(a,m??T.head.paragraphId)??a.part(),editable:()=>Be==="edit"&&!Mn,protected:m=>chunkZOZI27AW_cjs.vj(a.settingsRoot())&&chunkZOZI27AW_cjs.wj(Ee(a,m)??a.part(),m),selection:()=>T,select:m=>kt(m,false,"none"),apply:m=>Bu(m,$e,st)}),kc=ZT({pagesLayer:w,settings:()=>chunkZOZI27AW_cjs.fh(a.currentPackage()),part:m=>Ee(a,m??T.head.paragraphId)??a.part(),editable:()=>Be==="edit"&&!Mn,select:m=>kt(m,false,"none"),canApply:m=>a.editable&&br(true,[m],false)===null,history:m=>Se[m](),apply:m=>Bu(m,$e,st)});let QD=SO(Se,{...n,onToggleFieldCodes:()=>{Qe(),Mn=!Mn,Zt=Sn(St()),at.invalidateAll(a.packageRevision(),"field-code-view"),at.flush();}}),lv=FM(Se,()=>(Ee(a,T.head.paragraphId)??a.part()).root),cv=m=>{lv.keydown(m),!kc?.keydown(m)&&(m.defaultPrevented||Ze.adoptBeforeInput(),!(Kf?.keydown(m)||Mt?.keydown(m))&&QD(m));},{onCopy:dv,onCut:uv,onPaste:fv}=wO(Se),JD=kO(Se,{isComposing:()=>Ze.isComposing(),insertPlainText:iv,onBrowserSelectionFixup:()=>{Ze.mirrorToDom(),Ze.noteBrowserSelectionFixup();}}),pv=m=>{Ze.adoptBeforeInput(),JD(m);},{onDrawingPointerGesture:mv,onDrawingKeyGesture:Ec}=OT({surface:Se,textbox:()=>ut,intent:()=>W,setIntent:m=>$(m,true)});w.addEventListener("pointerdown",mv,{capture:true}),w.addEventListener("keydown",Ec,{capture:true}),w.addEventListener("beforeinput",Ec,{capture:true}),w.addEventListener("keydown",Hr,{capture:true}),w.addEventListener("pointerdown",Hr,{capture:true}),w.addEventListener("keydown",cv);let eN=LM(w,lv);w.addEventListener("beforeinput",pv),w.addEventListener("copy",dv),w.addEventListener("cut",uv),w.addEventListener("paste",fv),w.addEventListener("compositionstart",sv),w.addEventListener("compositionend",av),ps=WC({pagesLayer:w,container:()=>e,listeners:M,onSelectionChange:XD,rematerialize:o.wrap(vc)}),ut=KT({session:a,pagesLayer:w,layout:()=>ve,selection:()=>T,setSelection:m=>kt(m,false,"none"),flush:Qe,leaveOtherStories:()=>{Ne?.exitNote(),Ke?.exitHeaderFooter();},writable:()=>jf&&Be==="edit"&&a.editable}),Tc=qM({onTextFormDoubleClick:m=>Mt?.doubleClick(m)??false,onTextFormPointerUp:m=>Mt?.pointerUp(m),pagesLayer:w,get container(){return e},listeners:M,scale:()=>f,pageOffsetX:m=>Et?.pageOffsetX.get(m)??0,layout:()=>(ti=false,xc.without(on),xe()),measurer:()=>v,selection:()=>jt.shownSelection(T),setSelection:(m,k)=>kt(m,false,"none",k),cellSelection:()=>K,setCellSelection:m=>qb(m),focus:()=>w.focus({preventScroll:true}),onSelectionSettled:()=>nn.applyIfArmed(),activeHeaderFooter:()=>EI(Ke?.getActive()??null),activeNote:()=>{let m=Ne?.activeNoteScope();return m?{scopeId:m.id,pageIndex:Ne?.activeNotePageIndex()??null}:null},enterHeaderFooter:m=>{Qe(),Ke?.enterHeaderFooter({rId:m.rId,pageIndex:m.pageIndex,sectionIndex:ln(m.pageIndex).sectionIndex,kind:m.kind,...m.position?{position:m.position}:{}});},enterNote:(m,k,F)=>{Be!=="view"&&(Qe(),Ne?.enterNote(m,k,F));},exitNote:m=>{Qe(),Ne?.exitNote(m);},exitHeaderFooter:()=>(Qe(),Ke?.exitHeaderFooter()),enterEmptyHeaderFooter:(m,k)=>{if(Be==="view")return;Qe();let F=Ke;F&&OA({session:a,layout:ve,sectionAtPage:ln,create:H=>Se.applyHeaderFooterLifecycle?.(H),flushLayout:on,enter:H=>F.enterHeaderFooter(H)},m,k);},onContentControlWidget:(m,k)=>MD(m,k),...n.reviewModel?{onChangeBarToggle:dn.toggleByChangeBar}:{},isReadOnlyPosition:m=>qn(a.part(),m)!==void 0},{...n.pointer?{mode:n.pointer}:{},...E?{atomicInlineControls:true}:{}});let ea=TM({pagesLayer:w,furnitureLayer:L,listeners:M,scale:()=>f,pageOffsetX:m=>Et?.pageOffsetX.get(m)??0,read:()=>({layout:ve,storeRevision:a.packageRevision(),selection:T,cellSelection:K,editingMode:Be,themeColors:a.documentThemeColors()}),session:()=>a,applyTableCommandPlan:m=>Se.applyTableCommandPlan(m),label:m=>p.resolve(m)});if(Tt(),kc?.sync(),Xi=true,Rc(),d&&(uc=d.subscribeStatus(()=>{n.onChange?.(vt());})),d&&Jn)try{go=d.attach(Jn);}catch{try{d.destroy();}catch{}}return ni(),Wf(),Se.setTableInteractionLabel=m=>{p.resolve=m,ea.refreshLabels();},Se.refreshTableInteractionLabels=()=>{ea.refreshLabels();},hE(Se,()=>({measurer:n.measurer,producer:n.producer,fontAlias:n.fontAlias,defaultFontFamily:n.defaultFontFamily}),m=>{n={...n,...m},v=n.measurer??x.measurer,P=C();},()=>{bo||(Zt=Sn(St()),un=void 0,Et=void 0,yo=null,at.invalidateAll(a.packageRevision(),"fonts"),at.flush());}),GT(Se,()=>Ze.isComposing()),{finishPaused:wn,stop:zo}=SE(Se,()=>e,{pages:()=>w,now:it,destroyed:()=>bo,limit:()=>Kt,setLimit:m=>Kt=m,bodyBlockCount:()=>chunkFDSL5OJU_cjs.Yf(I),bodyBlock:m=>chunkFDSL5OJU_cjs.Zf(I)?.[m],publish:m=>gt(m),inputPending:()=>Xo(false),busy:()=>Yn.pending(),finishBusy:()=>Yn.finish(),composing:()=>Ze.isComposing(),prefixPass:m=>_e(a.packageRevision(),void 0,void 0,m),finish:o.wrap(()=>{Kt=null,at.invalidateAll(a.packageRevision(),"opening"),at.flush();})},Ll),{ok:true,surface:o.methods(Se)}}function $A(e,t=()=>null){let n,r={change:new Set,selectionChange:new Set,error:new Set,historyDiagnostic:new Set,diagnostic:new Set,revisionMarkupChange:new Set,reviewItemReveal:new Set,hostChange:new Set},o=()=>{let c=t();if(c===n||n===void 0&&c===null)return;n=c;let d=Object.freeze({document:c});for(let u of [...r.hostChange])u(d);},i=0,a=false,s=[],l=c=>{i>0||a?s.push(c):c();};return {defer(c){i+=1;try{return c()}finally{if(i-=1,i===0&&!a){a=true;try{for(;s.length>0;){let d=s;s=[];for(let u of d)try{u();}catch{}}}finally{a=false;}}}},emitError(c,d){l(()=>{for(let u of [...r.error]){if(d&&!d())return;u(c);}});},emitDocumentChange(c){l(()=>{for(let d of [...r.change])d(c);});},emitSelectionChange(){l(()=>{if(o(),!r.selectionChange.size)return;let c=e();for(let d of [...r.selectionChange])d(c);});},emitHistoryDiagnostic(c){l(()=>{for(let d of [...r.historyDiagnostic])d(c);});},emitDiagnostic(c){l(()=>{for(let d of [...r.diagnostic])d(c);});},emitRevisionMarkupChange(c){l(()=>{for(let d of [...r.revisionMarkupChange])d(c);});},emitReviewItemReveal(c){l(()=>{let d=Object.freeze({...c});for(let u of [...r.reviewItemReveal])u(d);});},hasErrorHandlers:()=>r.error.size>0,hasDiagnosticHandlers:()=>r.diagnostic.size>0,clear(){s=[];for(let c of Object.values(r))c.clear();},on(c,d){return r[c].add(d),()=>{r[c].delete(d);}}}}var qA={"paragraph-count-unexplained":"edit.unmapped-change","paragraph-reordered":"edit.unmapped-change","unknown-paragraph-id":"edit.unmapped-change","unknown-content-moved":"edit.unmapped-change","unsupported-node":"edit.unsupported-content","split-not-clean":"edit.unmapped-change","join-not-clean":"edit.unmapped-change"},KA=new Map([["the document is open for viewing","edit.read-only"],["the document is read-only","edit.read-only"],["this content is locked","edit.protected-content"],[Ri,"edit.read-only"],[Pi,"edit.protected-content"],[Ti,"edit.protected-content"],[au,"edit.protected-content"],[Er,"edit.suggesting-needs-author"],[Og,"edit.suggesting-needs-author"],[sn,"edit.review-module-required"],[MR,"edit.unsupported-content"],[qh,"edit.unsupported-story"],[Mi,"edit.field-structure"],[Xl,"edit.tracked-structure-unsupported"],[Ua,"edit.section-mark"],[pf,"edit.protected-content"],[Yl,"edit.protected-content"],[yh,"edit.refresh-in-progress"],[ao,"edit.preview-active"],["invalid note scope id","edit.stale-target"],[Pg,"edit.tracking-required"],[yl,"edit.tracked-image-replace-unsupported"],[$g,"edit.picture-selected"],[Pa,"edit.revision-unsupported"],["note not found","edit.stale-target"]]);function Ga(e){let t=String(e??"refused");return KA.get(t)??t}function Za(e,t){return (Object.hasOwn(qA,e)?qA[e]:void 0)??chunk3IEXDEFH_cjs.u(e)??KA.get(e)??(t!==void 0&&Object.hasOwn(WA,t)?WA[t]:void 0)??"edit.refused"}var WA={notFound:"edit.stale-target",ambiguous:"edit.invalid-argument",locked:"edit.protected-content",bound:"edit.protected-content",typeMismatch:"edit.invalid-argument",kindMismatch:"edit.invalid-argument",outOfBounds:"edit.invalid-argument",unsupported:"edit.unsupported-content",invalidArgs:"edit.invalid-argument"},jA={wasmUnavailable:"font.shaper-unavailable",initializationFailed:"font.shaper-unavailable",missing:"font.missing",forbidden:"font.load-failed",overLimit:"font.size-limit",malformed:"font.malformed",fontFaceLoadFailed:"font.load-failed",loadFailed:"font.load-failed",missingFont:"font.missing",hashMismatch:"font.integrity-mismatch",hashInvalid:"font.integrity-mismatch",metadataMismatch:"font.integrity-mismatch",fontMismatch:"font.integrity-mismatch",unsupportedFaceIndex:"font.unsupported-face",unsupportedFace:"font.unsupported-face"};function VA(e){return e!==void 0&&Object.hasOwn(jA,e)?jA[e]:"font.load-failed"}var Oy=Object.freeze([16,33,50,100,200,500,1e3]),UA=2048,V4=6e4,U4=200,z4=20,G4=256,Z4=6e4;function X4(){return {now:()=>globalThis.performance?.now()??Date.now(),afterNextFrame(t,n){let r=globalThis.requestAnimationFrame;return typeof r!="function"?false:(r(()=>{t(),globalThis.setTimeout(n,0);}),true)},setTimer(t,n){let r=globalThis.setTimeout(t,n);return r.unref?.(),r},clearTimer:t=>globalThis.clearTimeout(t)}}function Xa(){return {count:0,max:0,bands:new Array(Oy.length+1).fill(0),samples:[]}}function zA(e,t){return e[Math.min(e.length-1,Math.ceil(t*e.length)-1)]}function Y4(e){let t=[...e.samples].sort((n,r)=>n-r);return Object.freeze({count:e.count,p50Ms:Math.round(zA(t,.5)),p95Ms:Math.round(zA(t,.95)),maxMs:Math.round(e.max),bands:Object.freeze([...e.bands])})}function GA(e){let t=e.clock??X4(),n=e.windowMs??V4,r={interaction:Xa(),layout:Xa(),paint:Xa()},o=null,i=null,a=null,s=[],l=false;function c(p,g){if(!Number.isFinite(g)||g<0)return;let b=r[p];b.count+=1,b.max=Math.max(b.max,g);let h=Oy.findIndex(y=>g<=y);if(b.bands[h===-1?Oy.length:h]+=1,b.samples.length<UA)b.samples.push(g);else {let y=Math.floor(Math.random()*b.count);y<UA&&(b.samples[y]=g);}o===null&&(o=t.now(),i=t.setTimer(d,n));}function d(){i!==null&&t.clearTimer(i),i=null;let p=o;o=null;let g=r;if(r={interaction:Xa(),layout:Xa(),paint:Xa()},p===null)return;let b={};for(let y of ["interaction","layout","paint"])g[y].count>0&&(b[y]=Y4(g[y]));let h=(b.interaction?.count??0)>=z4&&b.interaction.p95Ms>U4;e.deliver({kind:"performance",...h?{code:"performance.slow-interaction"}:{},windowMs:Math.max(0,Math.round(t.now()-p)),...a===null?{}:{pagesBucket:chunk3IEXDEFH_cjs.x(a)},...b});}let u=()=>{globalThis.document?.visibilityState==="hidden"&&(s=[],d());};globalThis.document?.addEventListener?.("visibilitychange",u);let f=()=>globalThis.document?.visibilityState==="hidden";return {timing(p,g,b){if(l||!e.enabled())return;if(b&&(a=b()),p!=="input"){c(p,g);return}if(s.length>=G4||f())return;let h=t.now(),y=g>0&&g<=h?g:h;if(s.push(y),s.length>1)return;let x=s,v=false;t.afterNextFrame(()=>{x===s&&(s=[],v=true);},()=>{if(!v||l)return;let I=t.now();for(let C of x)I-C<=Z4&&c("interaction",I-C);})||(s=[]);},flush:d,dispose(){l||(d(),l=true,globalThis.document?.removeEventListener?.("visibilitychange",u));}}}function Q4(){return {now:()=>globalThis.performance?.now()??Date.now(),setTimer:(e,t)=>{let n=globalThis.setTimeout(e,t);return n.unref?.(),n},clearTimer:e=>globalThis.clearTimeout(e)}}var My=()=>({activeMs:0,inputEdits:0,commandEdits:0,automationEdits:0}),J4={input:"inputEdits",command:"commandEdits",automation:"automationEdits"};function ZA(e){let t=e.clock??Q4(),n=e.windowMs??6e4,r=t.now(),o=My(),i=My(),a=null,s=null,l=null,c=false,d=false;queueMicrotask(()=>{c||!e.enabled()||(d=true,e.deliver({kind:"session",phase:"start"}));});function u(){s!==null&&t.clearTimer(s),s=null;let b=a;a=null;let h=o;if(o=My(),!(b===null||!d)){for(let y of Object.keys(h))i[y]+=h[y];e.deliver({kind:"session",phase:"active",durationMs:Math.max(0,Math.round(t.now()-b)),...h,activeMs:Math.round(h.activeMs)});}}function f(){if(c)return;let b=t.now();l!==null&&b-l<=3e4&&(o.activeMs+=Math.max(0,b-l)),l=b,a===null&&(a=b,s=t.setTimer(u,n));}let p=()=>{globalThis.document?.visibilityState==="hidden"&&u();};globalThis.document?.addEventListener?.("visibilitychange",p);function g(){c||(u(),c=true,globalThis.document?.removeEventListener?.("visibilitychange",p),d&&e.deliver({kind:"session",phase:"end",durationMs:Math.max(0,Math.round(t.now()-r)),...i,activeMs:Math.round(i.activeMs)}));}return {activity:f,edit(b){c||(o[J4[b]]+=1,f());},flush:u,end:g}}var Ay=new Set,e3=e=>{if(!e.persisted)for(let t of [...Ay])try{t();}catch{}};globalThis.addEventListener?.("pagehide",e3);function XA(e){return Ay.add(e),()=>{Ay.delete(e);}}var t3=new Set(["insertImage","openBookmarkDialog","openGoTo","openRevisionMarkupDialog","proposeDeletion","proposeInsertion","proposeReplacement","replaceImage","setEditingMode","setReviewDisplayMode","toggleDocumentProtection","toggleParagraphMarks","toggleReviewPane"]);function YA(e){if(t3.has(e.type))return e.type;try{let t=Ii(e);return t.supported||t.reason!==Ig(e.type)?e.type:void 0}catch{return}}function n3(e){let t=e.type;if(t==="acceptRevision"||t==="acceptAllRevisions")return "accept";if(t==="rejectRevision"||t==="rejectAllRevisions")return "reject";let n=e.action;return n==="accept"||n==="reject"?n:void 0}var QA=new WeakMap;function JA(e,t){let n=QA.get(e);return n?n(t):t()}var Fy=new WeakMap;function r3(e,t,n,r){Fy.get(e)?.(t,n,r);}function o3(e,t,n){Fy.get(e)?.("edit.internal-invariant",n,"exception",{thrown:t});}function i3(e){let t=e?.code;return t==="notFound"?"save.no-document":t==="invalidState"?"save.document-changed":"save.failed"}var a3=new Set(["split","possible-ungrouped-gesture","possible-fragmented-gesture"]);function eF(e){let t=()=>globalThis.performance?.now()??Date.now(),n=chunk3IEXDEFH_cjs.y(()=>[...e.modules.diagnosticListeners,e.events.emitDiagnostic],e.now),r=n.deliver,o=null,i=0,a=0,s=0,l=false;e.events.on("historyDiagnostic",x=>{a3.has(x.kind)&&r({kind:"history",code:`history.${x.kind}`});}),e.customNodes?.observe(x=>{let v=x?.code;(v==="payload-invalid"||v==="payload-missing")&&r({kind:"custom-node",code:`custom-node.${v}`});});let c=e.modules.collaboration?.session,d=c?l3(c,r,t):()=>{},u=GA({deliver:r,enabled:()=>e.events.hasDiagnosticHandlers?.()===true||e.modules.wantsDiagnostic("performance"),...e.performance}),f=ZA({deliver:r,enabled:()=>e.events.hasDiagnosticHandlers?.()===true||e.modules.wantsDiagnostic("session"),...e.session}),p=XA(()=>{u.flush(),f.end();}),g=x=>{let v=new Map;for(let[S,I]of x)for(let{reason:C,revision:P,detail:E}of S){let R=chunk3IEXDEFH_cjs.v(C);if(!R)continue;let w=chunk3IEXDEFH_cjs.E(P?.revisionKind),M=w==="format"?chunk3IEXDEFH_cjs.F(P?.formattingKind):void 0,O=chunk3IEXDEFH_cjs.D(P?.partName),B=chunk3IEXDEFH_cjs.A(E),q=[R,B,I,w,M,O].join("|"),j=v.get(q);j?j.count+=1:v.set(q,{count:1,event:{code:R,...I?{operation:I}:{},...w?{changeKind:w}:{},...M?{formattingKind:M}:{},...O?{part:O}:{},...B?{cause:B}:{}}});}for(let{event:S,count:I}of v.values())r({kind:"review.skipped",...S,count:I});},b=(x,v)=>g([[v.revisions?.skipped??[],n3(x)],[v.revisionAuthors?.skipped??[],"reassign"]]),h=(x,v,S)=>{try{r({kind:"edit.rejected",code:"edit.internal-invariant",origin:"command",...S,cause:chunk3IEXDEFH_cjs.B(),errorName:chunk3IEXDEFH_cjs.C(x),stage:v});}catch{}},y=x=>{if(x||i===0&&a===0){f.edit("input");return}l||(l=true,f.edit(a>0?"automation":"command"));};return {editorSessionId:n.editorSessionId,surfaceHooks(x,v){return {onRejection:S=>this.inputRejected(S,x()),onTiming:(S,I)=>this.timing(S,I,v()??void 0),onEdit:y}},openStarted(x){o={sizeBucket:chunk3IEXDEFH_cjs.w(x.byteLength),start:t()};},openDeferred(){o&&(o.start=null);},openMounting(){o&&o.start===null&&(o.start=t());},openSettled(x){if(!o)return;let{sizeBucket:v,start:S}=o;o=null,r({kind:"document.open",outcome:"opened",sizeBucket:v,pagesBucket:chunk3IEXDEFH_cjs.x(Ca(x)),durationMs:S===null?0:Math.max(0,Math.round(t()-S)),...s3(x)});},openRejected(x,v,S){let I=o?.sizeBucket;o=null;let C=chunk3IEXDEFH_cjs.A(x),P=chunk3IEXDEFH_cjs.D(S);r({kind:"document.open",outcome:"rejected",code:chunk3IEXDEFH_cjs.t(x,v),...I?{sizeBucket:I}:{},...C?{cause:C}:{},...P?{part:P}:{}});},openCrashed(x,v="open-mount"){if(!o)return;let{sizeBucket:S}=o;o=null,r({kind:"document.open",outcome:"rejected",code:"open.failed",sizeBucket:S,cause:chunk3IEXDEFH_cjs.B(),errorName:chunk3IEXDEFH_cjs.C(x),stage:v}),e.onOpenCrash?.();},continueOpen(x){try{return x()}catch(v){throw this.openCrashed(v,"open-layout"),v}},reviewItem(x,v,S,I){return (C,P)=>{let E=v(C),R=s,w;try{w=x(C,P);}catch(q){throw i===0&&h(q,"review-item",{tracked:I()}),q}if(w.ok||i>0)return w;let M=Za(w.reason,w.code),O=M==="edit.refresh-in-progress"||M==="edit.collaboration-not-ready";if(w.code==="notFound"||w.code==="unsupported"&&E&&!O){let q=E?S(E,P):{},j=E&&{revisionKind:E.revisionKind,partName:q.partName??"",...E.formattingKind?{formattingKind:E.formattingKind}:{}},z=w.reason===Pa?q.detail??"read-only":chunk3IEXDEFH_cjs.A(w.reason)??q.detail;return g([[[{reason:w.code==="notFound"?"unknown-revision":"unsupported-revision",...j?{revision:j}:{},detail:z}],P]]),w}if(s!==R)return w;let B=chunk3IEXDEFH_cjs.A(w.reason);return r({kind:"edit.rejected",code:M,origin:"command",tracked:I(),...B?{cause:B}:{}}),w}},exec(x,v,S,I){i===0&&a===0&&(l=false),i+=1;let C;try{C=S();}catch(P){if(i===1){let E;try{E=YA(x);}catch{E=void 0;}h(P,"command",{tracked:v,...E?{command:E}:{}});}throw P}finally{i-=1;}if(i>0)return C;if(C.ok&&!l&&I?.()&&(l=true,f.edit(a>0?"automation":"command")),!C.ok){let P=YA(x),E=chunk3IEXDEFH_cjs.A(C.reason);r({kind:"edit.rejected",code:Za(C.reason,C.code),origin:"command",tracked:v,...P?{command:P}:{},...E?{cause:E}:{}});}return b(x,C),C},inputRejected(x,v){if(i>0||a>0)return;s+=1;let S=Za(x),I=chunk3IEXDEFH_cjs.A(x);r({kind:"edit.rejected",code:S,origin:"input",tracked:v,...I?{cause:I}:{}});},fontFailed(x){r({kind:"font.failed",code:VA(x)});},attach(x,v){let S=x.exec,I=()=>x.getDocumentHandle().revision;x.exec=(P,E)=>{let R=I();return this.exec(P,v(),()=>S(P,E),()=>I()!==R)};let C=x.save;x.save=()=>this.save(()=>C.call(x)),QA.set(x,P=>{i===0&&a===0&&(l=false),a+=1;try{return P()}finally{a-=1;}}),QR(x,(P,E)=>{this.exec(P,v(),()=>E);}),Fy.set(x,(P,E,R,w)=>{let M=chunk3IEXDEFH_cjs.A(R);r({kind:"edit.rejected",code:P,origin:"automation",tracked:E,...M?{cause:M}:{},...w?{errorName:chunk3IEXDEFH_cjs.C(w.thrown),stage:"automation"}:{}});});},async save(x){let v=t(),S=()=>Math.max(0,Math.round(t()-v)),I;try{I=await x();}catch(C){try{let P=i3(C);r({kind:"document.save",outcome:"rejected",code:P,durationMs:S(),...P==="save.failed"?{cause:chunk3IEXDEFH_cjs.B(),errorName:chunk3IEXDEFH_cjs.C(C),stage:"save"}:{}});}catch{}throw C}return r({kind:"document.save",outcome:"saved",sizeBucket:chunk3IEXDEFH_cjs.w(I.byteLength),durationMs:S()}),I},timing(x,v,S){x==="input"&&f.activity(),u.timing(x,v,x==="paint"&&S?()=>Ca(S):void 0);},dispose(){u.dispose(),d(),f.end(),p();}}}function s3(e){try{let{session:t}=e;return {shape:{parts:chunk3IEXDEFH_cjs.x(t.currentPackage().parts.size),paragraphs:chunk3IEXDEFH_cjs.x(t.paragraphIds().length),reviewItems:chunk3IEXDEFH_cjs.x(t.reviewItems().length),embeddedFonts:chunk3IEXDEFH_cjs.x(t.embeddedFonts().length)}}}catch{return {}}}function l3(e,t,n){let r=n(),o="none",i,a=false,s=false,l=-1,c=()=>{let f=e.statusSnapshot(),p=f.reason?.code,g=f.recovering===true;if(f.status===o&&p===i&&g===a)return;let b=f.status==="ready"&&!s,h=b&&o!=="none";b&&(s=true),t({kind:"collab.status",status:f.status,previous:o,...p?{code:`collab.${p}`}:{},recovering:g,...h?{connectMs:Math.max(0,Math.round(n()-r))}:{}}),o=f.status,i=p,a=g;},d=()=>{let f=e.participants().length;f!==l&&(l=f,t({kind:"collab.participants",count:f}));},u=[e.subscribeStatus(c),e.subscribeParticipants(d)];return c(),()=>{for(let f of u)f();}}function tF(e,t,n=()=>true){if(!n())return;let r=e.code==="wasmUnavailable"||e.cause instanceof chunk6NVZNB7O_cjs.f&&e.cause.code==="unsupportedRuntime";r&&!t.config.onFontError&&!t.events.hasErrorHandlers()&&vw(e);try{t.config.onFontError?.(e);}catch{}n()&&(t.events.emitError(e,n),n()&&t.diagnostics.fontFailed(r?"wasmUnavailable":e.code));}function ec(e){let t=[],n=(r,o)=>{let i=o.kind,a=r.handlers.kinds??e;return typeof i!="string"||!a||a.includes(i)};return {request(r){let o=t.filter(l=>n(l,r)),i=[...o].reverse().find(l=>!l.fallback)??o.at(-1);if(!i?.handlers.onRequest)return false;let{sessions:a,handlers:s}=i;return a.add(r),r.signal.addEventListener("abort",()=>a.delete(r),{once:true}),s.onRequest(r),true},register(r,o){let i={handlers:r,fallback:o?.fallback===true,sessions:new Set};return t.push(i),()=>{let a=t.indexOf(i);if(!(a<0)){t.splice(a,1);for(let s of i.sessions)s.cancel();}}}}}var c3=()=>ec();function nF(e={}){let t=Ma({}),n=Ma({}),r=AP(e),o=LP(e),i=c3(),a=ec(["dropdown","comboBox","date","buildingBlockGallery"]),s=ec();return {surfaceOptions:{onRequestTextFormField:i.request,onRequestContentControlWidget:a.request,onRequestInvalidTextFormField:s.request,onHyperlinkPopover:l=>t.current().onPopover?.(l),onRequestHyperlink:()=>t.current().onRequest?.(),onEquationPopover:l=>n.current().onPopover?.(l),...r.surfaceOptions},bookmarkDialog:r.bookmarkDialog,goTo:r.goTo,commentDraft:o.requests,setters:{setTextFormFieldChrome:i.register,setContentControlWidgetChrome:a.register,setInvalidTextFormFieldChrome:s.register,setHyperlinkChrome:t.push,setEquationChrome:n.push,...r.setters,...o.setters}}}function rF(e,t){let n=chunkFDSL5OJU_cjs.Ya(e),r=null,o=null,i=null,a=ec(),s=()=>t.destroyed()?{ok:false,code:"notFound",reason:"the editor was destroyed"}:t.contribution()?.createRevisionMarkupDialog?t.container()?{ok:true}:{ok:false,code:"notFound",reason:"the editor is not attached"}:{ok:false,code:"unsupported",reason:"the review module does not supply a settings dialog"},l=f=>{if(t.destroyed())return;let p=chunkFDSL5OJU_cjs.Ya(f,n);JSON.stringify(p)!==JSON.stringify(n)&&(n=p,t.apply(n),i?.(),t.changed(n));},c=()=>{if(o){o.cancel();return}let f=r;r=null,f?.destroy();},d=()=>{let f=new AbortController,p=new Set,g=n,b=y=>{if(!(f.signal.aborted||JSON.stringify(y)===JSON.stringify(g))){g=y;for(let x of [...p])x();}},h={signal:f.signal,get:()=>g,set(y){f.signal.aborted||b(chunkFDSL5OJU_cjs.Ya(y,g));},reset:()=>b(chunkFDSL5OJU_cjs.Xa),subscribe(y){return f.signal.aborted?()=>{}:(p.add(y),()=>{p.delete(y);})},canApply:()=>o===h&&!f.signal.aborted&&s().ok,apply(){return h.canApply()?(l(g),h.cancel(),true):false},cancel(){if(f.signal.aborted)return;o===h&&(o=null,i=null),p.clear();let y=r;r=null,f.abort(),y?.destroy();}};return i=()=>b(n),h},u=f=>{r=t.contribution().createRevisionMarkupDialog({...f,container:t.container(),translate:p=>t.translate()?.(p)}),f.signal.aborted?c():r.open();};return {current:()=>n,set:l,canOpen:s,register(f,p){return a.register(f??{onRequest:u},p)},open(){let f=s();if(!f.ok)return f;c();let p=d();o=p;try{a.request(p)||u(p);}catch(g){throw p.cancel(),g}return {ok:true,changed:false}},destroyDialog:c}}var oF=new WeakMap;function p3(e){return !(!e.story||e.origin===chunkZOZI27AW_cjs.g.mutationUndo||e.origin===chunkZOZI27AW_cjs.g.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.some(t=>t!==chunkZOZI27AW_cjs.l.story))}function m3(e,t){p3(t)||(e.summaries=null);}function g3(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>m3(t,n)));}function aF(e){}function sF(e,t){let n=oF.get(e);return n||(n={summaries:null,subscribed:false},oF.set(e,n)),g3(e,n),n.summaries||(n.summaries=t()),n.summaries}var h3=new Map([["richText","richText"],["plainText","plainText"],["dropdown","dropDownList"],["dropDownList","dropDownList"],["comboBox","comboBox"],["date","date"]]);function y3(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function b3(e,t){let n=e.session.part(),r=e.session.paragraphAnchors();if(qt(t)){let o=Cn(n,r,t);return o.ok?{ok:true,span:{paragraphId:o.span.nodeId,start:o.span.start,end:o.span.end}}:{ok:false,code:o.code,reason:o.reason,target:t}}if(y3(t)){if(!qt(t.from)||!qt(t.to))return {ok:false,code:"unsupported",reason:"address the span with paraId anchors; DocLocation endpoints are not supported",target:t};let o=Cn(n,r,t.from);if(!o.ok)return {ok:false,code:o.code,reason:o.reason,target:t};let i=Cn(n,r,t.to);if(!i.ok)return {ok:false,code:i.code,reason:i.reason,target:t};if(o.span.nodeId!==i.span.nodeId)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported",target:t};let a=Math.min(o.span.start,i.span.start),s=Math.max(o.span.end,i.span.end);return {ok:true,span:{paragraphId:o.span.nodeId,start:a,end:s}}}return {ok:false,code:"unsupported",reason:"address the span with a paraId anchor; DocLocation targeting is not supported",target:t}}function Ly(e,t){let n=h3.get(t.subtype);if(!n)return {ok:false,code:"invalidArgs",reason:`that control type cannot be inserted (${String(t.subtype)})`,...t.target===void 0?{}:{target:t.target}};let r;if(t.target===void 0){let o=Oi(e.state().selection);if(!o)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported"};r=o;}else {let o=b3(e,t.target);if(!o.ok)return o;r=o.span;}return {ok:true,span:r,op:{op:"insertContentControl",paragraphId:r.paragraphId,start:r.start,end:r.end,type:n,...t.tag===void 0?{}:{tag:t.tag},...t.title===void 0?{}:{alias:t.title}}}}var v3="http://schemas.microsoft.com/office/word/2010/wordml",x3="http://schemas.microsoft.com/office/word/2012/wordml";function $i(e){return chunkZOZI27AW_cjs.Yc(e)}function tc(e){for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="contentControlProperties"||t.localName==="sdtPr"))return t}function S3(e){if(e.kind!=="textValue"){for(let t of e.attributes)if(t.localName==="val"&&t.namespaceUri===chunkZOZI27AW_cjs.pa)return t.value}}function Dy(e,t){if(e){for(let n of e.children)if(n.kind!=="textValue"&&n.localName===t)return S3(n)}}function w3(e){if(!e)return "richText";for(let t of e.children){if(t.kind==="textValue")continue;let n=k3(t);if(n!==void 0)return n}return "richText"}function k3(e){if(e.kind==="textValue")return;let t=e.kind,n=e.localName,r=e.namespaceUri;if(t==="contentControlDropDownList"||n==="dropDownList")return "dropdown";if(t==="contentControlComboBox"||n==="comboBox")return "comboBox";if(t==="contentControlDate"||n==="date")return "date";if(n==="picture")return "picture";if(n==="docPartList")return "buildingBlockGallery";if(t==="contentControlText"||n==="text")return "plainText";if(n==="richText")return "richText";if(n==="checkbox"&&(r===v3||t==="contentControlCheckbox"))return "checkbox";if(n==="repeatingSection"&&r===x3)return "repeatingSection"}function bf(e){let t=Dy(e,"lock");return t==="contentLocked"||t==="sdtContentLocked"}function I3(e,t){if(bf(tc(t)))return true;let n=chunkZOZI27AW_cjs.Ya(e,t.id);for(;n;){if($i(n)&&bf(tc(n)))return true;n=chunkZOZI27AW_cjs.Ya(e,n.id);}return false}function Hy(e,t){let n=tc(e),r=Dy(n,"tag"),o=Dy(n,"alias"),i=t?I3(t,e):bf(n);return {id:e.id,controlType:w3(n),...r!==void 0?{tag:r}:{},...o!==void 0?{alias:o}:{},...i?{locked:true}:{}}}var lF=new WeakMap;function R3(e,t){let n=[],r=chunkZOZI27AW_cjs.Ya(e,t.id);for(;r;)$i(r)&&n.push(`${r.id}:${bf(tc(r))?1:0}`),r=chunkZOZI27AW_cjs.Ya(e,r.id);return n.join("|")}function dF(e){return Object.freeze({...e,...e.tag!==void 0?{tag:e.tag}:{},...e.alias!==void 0?{alias:e.alias}:{},...e.locked?{locked:true}:{}})}function P3(e){return Object.freeze(e.map(t=>dF(t)))}function T3(e,t){let n=e.node,r=tc(n),o=R3(t,n),i=lF.get(n);if(i&&i.properties===r&&i.lockAncestors===o)return i.summary;let a=dF(Hy(n,t));return lF.set(n,{properties:r,lockAncestors:o,summary:a}),a}function E3(e){let t=chunkZOZI27AW_cjs.dc(e.root);return aF(t.length),t.map(n=>T3(n,e))}function C3(e){return P3(e.storyParts().flatMap(t=>E3(t)))}function O3(e){return sF(e,()=>C3(e))}function Ny(e,t){return t?!(t.tag!==void 0&&e.tag!==t.tag||t.alias!==void 0&&e.alias!==t.alias||t.controlType!==void 0&&e.controlType!==t.controlType):true}function M3(e){let t=[];if(e.kind!=="paragraph")return t;let n=(r,o,i,a)=>{if(a>=chunkZOZI27AW_cjs.Aa)return o;let s=o;for(let l of r)if(l.kind!=="paragraphProperties"){if(l.kind==="run"){s+=chunkZOZI27AW_cjs.sg(e,l);continue}if(chunkZOZI27AW_cjs.Ca(l)){s=n(l.children,s,i,a+1);continue}if($i(l)){let c=s,d=i+1;s=n(chunkZOZI27AW_cjs.Xb(l),s,d,a+1),t.push({control:l,start:c,end:s,depth:d});continue}s+=chunkZOZI27AW_cjs.sg(e,l);}return s};return n(e.children,0,-1,0),t}function _y(e,t,n){return M3(e).filter(r=>t>=r.start&&t<r.end).sort((r,o)=>o.depth-r.depth).map(r=>Hy(r.control,n))}function By(e,t){let n=[],r=chunkZOZI27AW_cjs.Ya(e,t);for(;r;)$i(r)&&n.push(Hy(r,e)),r=chunkZOZI27AW_cjs.Ya(e,r.id);return n.reverse()}function uF(e,t){if(!e)return [];let n=O3(e.session);return t?n.filter(r=>Ny(r,t)):n}function $y(e,t){if(!e)return null;let{paragraphId:n,offset:r}=e.state().selection.head,o=Ee(e.session,n)??e.session.part(),i=chunkZOZI27AW_cjs.Xa(o,n);if(i&&i.kind==="paragraph"){for(let s of _y(i,r,o))if(Ny(s,t))return s}let a=By(o,n);for(let s=a.length-1;s>=0;s-=1){let l=a[s];if(Ny(l,t))return l}return null}function qy(e){return e.type==="insertContentControl"||e.type==="setContentControlValue"||e.type==="removeContentControl"}function A3(e){return typeof e=="object"&&e!==null&&"container"in e&&"path"in e}function F3(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function L3(e){let t=n=>{if(n.kind==="textValue")return null;if(n.kind==="body")return n;for(let r of n.children){let o=t(r);if(o)return o}return null};return t(e.root)}function vf(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||$i(n))&&t.push(n);return t}function D3(e){let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...vf(r.children));return t}function N3(e){return e.kind==="table"?D3(e):$i(e)?vf(chunkZOZI27AW_cjs.Xb(e)):e.kind==="body"?vf(e.children):[]}function H3(e,t,n){if($i(t))return {ok:true,controlId:t.id};if(t.kind==="paragraph"){let r=n??0;for(let a of _y(t,r,e))return {ok:true,controlId:a.id};let i=By(e,t.id).at(-1);if(i)return {ok:true,controlId:i.id}}return {ok:false,code:"notFound",reason:"no content control at the addressed block"}}function _3(e,t){if(t.container.part!=="body")return {ok:false,code:"unsupported",reason:"only the body container is supported",target:t};let n=L3(e);if(!n)return {ok:false,code:"notFound",reason:"the document body was not found",target:t};if(t.path.length===0)return {ok:false,code:"notFound",reason:"DocLocation path is empty",target:t};let r=vf(n.children),o=null;for(let a=0;a<t.path.length;a+=1){if(o=r[t.path[a]]??null,!o)return {ok:false,code:"notFound",reason:`block index ${t.path[a]} is out of range`,target:t};a<t.path.length-1&&(r=N3(o));}if(!o)return {ok:false,code:"notFound",reason:"the addressed block was not found",target:t};let i=H3(e,o,t.offset);return i.ok?i:{...i,target:t}}function B3(e,t,n){let r=Cn(e,t,n);if(!r.ok)return {ok:false,code:r.code,reason:r.reason,target:n};let o=t.partByNode.get(r.span.nodeId)??e,i=chunkZOZI27AW_cjs.Xa(o,r.span.nodeId);if(!i||i.kind!=="paragraph")return {ok:false,code:"notFound",reason:`paragraph '${n.paraId}' was not found`,target:n};let a=r.span.start;for(let c of _y(i,a,o))return {ok:true,controlId:c.id};let l=By(o,i.id).at(-1);return l?{ok:true,controlId:l.id}:{ok:false,code:"notFound",reason:`no content control encloses paragraph '${n.paraId}'`,target:n}}function fF(e,t){if(t===void 0){let r=$y(e);return r?{ok:true,controlId:r.id}:{ok:false,code:"notFound",reason:"no content control at the current selection"}}if(F3(t))return {ok:false,code:"unsupported",reason:"DocRange targeting is not supported for content controls",target:t};let n=e.session.part();return A3(t)?_3(n,t):qt(t)?B3(n,e.session.paragraphAnchors(),t):{ok:false,code:"invalidArgs",reason:"unrecognized target shape",target:t}}function pF(e){switch(e){case "locked":case "bound":case "typeMismatch":case "invalidArgs":case "unsupported":return e;case "unknown-control":return "notFound";case "indivisible-content":return "unsupported";default:return "unsupported"}}function mF(e){switch(e){case "locked":return "the content control is locked";case "bound":return "the content control is bound to external data";case "typeMismatch":return "the value does not match the control type";case "invalidArgs":return "the value is not valid for this control";case "unsupported":return "this control type is not supported";case "unknown-control":return "the content control was not found";case "indivisible-content":return "a content control cannot start or end inside a hyperlink, a field, or another inline control";default:return `the edit was refused (${e})`}}function gF(e,t){return {ok:false,code:pF(e),reason:mF(e),...t!==void 0?{target:t}:{}}}function $3(e,t,n,r){return r?.scope&&r.scope.kind!=="body"&&e.target!==void 0?{ok:false,refusal:{ok:false,code:"unsupported",reason:"a location or anchor target resolves in the body only; omit it to use the caret"}}:t?n==="view"||!t.session.editable?{ok:false,refusal:{ok:false,code:"locked",reason:"the document is read-only"}}:e.type==="setContentControlValue"&&typeof e.value!="string"?{ok:false,refusal:{ok:false,code:"invalidArgs",reason:"setContentControlValue requires a string value"}}:{ok:true}:{ok:false,refusal:{ok:false,code:"notFound",reason:"no document is loaded"}}}function Wy(e){return e==="viewing"?"view":e==="suggesting"?"suggesting":"edit"}function jy(e,t,n,r){let o=$3(e,t,n,r);if(!o.ok)return o.refusal;if(e.type==="insertContentControl"){let s=Ly(t,e);return s.ok?cF(t,s.op,s.span.paragraphId):{ok:false,code:s.code,reason:s.reason}}let i=fF(t,e.target);if(!i.ok)return {ok:false,code:i.code,reason:i.reason};let a=e.type==="setContentControlValue"?{op:"setContentControlValue",controlId:i.controlId,value:e.value}:{op:"removeContentControl",controlId:i.controlId};return cF(t,a,i.controlId)}function cF(e,t,n){let r=Ee(e.session,n)??e.session.part(),o=chunkZOZI27AW_cjs.fh(e.session.currentPackage()),i=chunkZOZI27AW_cjs.tj(o,t)??chunkZOZI27AW_cjs.Ek(r,o,t)??chunkZOZI27AW_cjs.Hl(r,t);return i?{ok:false,code:pF(i),reason:mF(i)}:{ok:true}}function hF(e,t,n,r){t?.flushPendingInput();let o=jy(e,t,n,r);return o.ok?q3(t,e):o}function yF(e,t,n,r,o){let i=e.applyGatedTreeOps;return typeof i=="function"?i.call(e,t,n,r,o):e.session.applyTreeOps(t,n,r,o)}function q3(e,t){if(t.type==="insertContentControl")return W3(e,t);let n=fF(e,t.target);if(!n.ok){let a=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...a!==void 0?{target:a}:{}}}e.flushPendingInput();let r=Oi(e.state().selection),o=t.type==="setContentControlValue"?{op:"setContentControlValue",controlId:n.controlId,value:t.value}:{op:"removeContentControl",controlId:n.controlId},i=yF(e,[o],r,r,Ct(e.session,n.controlId,{kind:"body"}));return i.rejected?gF(i.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:i.committed})}function W3(e,t){e.flushPendingInput();let n=Ly(e,t);if(!n.ok){let c=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...c!==void 0?{target:c}:{}}}let{paragraphId:r,start:o,end:i}=n.span,a=Oi(e.state().selection),s={paragraphId:r,start:o,end:i},l=yF(e,[n.op],a,s,Ct(e.session,r,{kind:"body"}));return l.rejected?gF(l.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:l.committed})}function bF(e,t,n){switch(n.type){case "selectedText":return e?.selectedText()??"";case "selectionFormatting":return e?t():null;case "selection":return uu(e);case "paragraphs":return SP(e,n.container);case "isInsideToc":return TP(e);case "hyperlinkAt":return xP(e);case "contentControls":return uF(e,n.filter);case "trackedChanges":case "revisions":case "findText":case "comments":return [];case "styles":return {paragraph:new Map,character:new Map,table:new Map};case "variables":return {};case "contentControlAt":return $y(e,n.filter);case "tableContext":return pu(e);case "splitCellConfig":return RP(e);case "watermark":return bR(e);case "bookmarks":return e?.bookmarkEditing.list()??[];default:return null}}var j3=40,K3="docx-preview-surface",vF="data-docx-previewing";function V3(e){let t=e.ownerDocument.defaultView;for(let n=e.parentElement;n;n=n.parentElement){let r=t?.getComputedStyle(n),o=`${r?.overflowY??""} ${r?.overflowX??""}`;if(/(auto|scroll|overlay)/.test(o))return n}return null}function xF(e,t,n){let r=e.parentElement;if(!r)return null;let o=e.ownerDocument,i=V3(e),a=i?.scrollTop??0,s=i?.scrollLeft??0,l=o.createElement("div");l.className=K3,l.setAttribute("data-docx-preview",""),l.setAttribute("role","region"),l.setAttribute("aria-label",t),l.style.position="absolute",l.style.margin="0";let c=P=>{P.stopPropagation(),P.type!=="contextmenu"&&P.preventDefault();};for(let P of ["contextmenu","paste","cut","drop","dragover"])l.addEventListener(P,c);let d=()=>{l.style.top=`${e.offsetTop}px`,l.style.left=`${e.offsetLeft}px`,l.style.width=`${e.offsetWidth}px`,l.style.minHeight=`${e.offsetHeight}px`;};d(),r.insertBefore(l,e.nextSibling);let u=n(l);if(!u)return l.remove(),null;l.style.position="absolute",d();let f=o.activeElement,p=f&&e.contains(f)?f:null;p?.blur();let g=e.style.visibility;e.style.visibility="hidden",i&&(i.scrollTop=a,i.scrollLeft=s);let h=o.defaultView,y=h?.ResizeObserver,x=y?new y(d):null;x?.observe(e),x?.observe(r),h?.addEventListener("resize",d);let v=e.closest(".docx-editor")??r;v.setAttribute(vF,"");let S=mt(()=>l),I=null,C=()=>{I=null,Dl(u,j3)||(I=S.setTimeout(C,0));};return dr(u)&&(I=S.setTimeout(C,0)),{surface:u,place:d,finishOpening(){for(I!==null&&S.clearTimeout(I),I=null;!Dl(u,Number.POSITIVE_INFINITY););},remove(){I!==null&&S.clearTimeout(I),I=null,x?.disconnect(),h?.removeEventListener("resize",d),v.removeAttribute(vF);let P=i?.scrollTop??0,E=i?.scrollLeft??0;e.style.visibility=g,u.destroy(),l.remove(),i&&(i.scrollTop=P,i.scrollLeft=E),p?.isConnected&&p.focus({preventScroll:true});}}}function xf(e){if(e.kind==="paragraph")return e.id;if(!("children"in e)||!Array.isArray(e.children))return null;for(let t of e.children){let n=xf(t);if(n)return n}return null}function SF(e,t){let n=e.parts.get(e.mainDocumentPart)?.root,r=t.parts.get(t.mainDocumentPart)?.root;if(!n||!r||n===r)return null;let o=(a,s)=>{let l=a.children,c=s.children;for(let u=0;u<c.length;u+=1){let f=c[u],p=l[u];if(p!==f)return f.kind==="paragraph"?f.id:p&&p.kind===f.kind&&"children"in p&&"children"in f?o(p,f)??xf(f):xf(f)}let d=c[c.length-1];return d?xf(d):null},i=o(n,r);return i&&chunkZOZI27AW_cjs.Xa(t.parts.get(t.mainDocumentPart),i)?i:null}var Ky="review-module-required",wF="preview-operation-unsupported";function kF(e,t,n){let r=chunk3IEXDEFH_cjs.q(e),o=t,i=t.collaborationSession(),a=i?.identity.actorId,s=()=>n().reviewModel!==void 0,l=()=>{let u=t.author()?.trim();return t.editingMode()==="suggest"&&u?u:void 0},c=()=>(n().revisionMarkup??chunkFDSL5OJU_cjs.Xa).trackFormatting&&!t.session.trackingSettings().doNotTrackFormatting,d=u=>{let f=l();return f===void 0?u:Wl(u,{author:f,date:chunk3IEXDEFH_cjs.c()},c())};return {...r,collaborative:()=>!!i,trackedRangeReplacement:()=>!i,suggesting:()=>t.editingMode()==="suggest",revisionDisplayMode:()=>chunkFDSL5OJU_cjs.$a(t.revisionDisplayMode()),replacementLanding(u,f,p){let g=l();if(g===void 0)return null;if(p<=f)return f;let b=U3(e,u);return b?Vu(b,f,p,g,chunk3IEXDEFH_cjs.c()):f},apply(u,f,p=[],g=false){let b=o.automationWriteRefusal([],false);if(b!==null)return {ok:false,reason:b};if(g&&!s())return {ok:false,reason:Ky};let h=chunkZOZI27AW_cjs.Lb(a,()=>r.apply(y=>{let x=u(y);if(x===null||(b=o.automationWriteRefusal(x,p.length>0),b!==null))return null;let v=d(x);return v.some(ql)&&!s()?b=Ky:b=i?.gateOperations(v,f)??null,b===null?v:null},f,p));return b!==null?{ok:false,reason:b}:h},applyCommentWrites(u,f){let p=o.automationWriteRefusal([],false);if(p!==null)return {ok:false,reason:p};if(f.kind!=="body")return {ok:false,reason:"unsupported-story"};if(!s())return {ok:false,reason:Ky};let g=i?.gateOperations([],f);return g?{ok:false,reason:g}:chunkZOZI27AW_cjs.Lb(a,()=>r.applyCommentWrites(u,f))},applyCustomNodeWrite:()=>({ok:false,reason:wF}),applyLifecycle:()=>({ok:false,reason:wF})}}function U3(e,t){let n=e.currentPackage(),r=n.parts.get(n.mainDocumentPart),o=r?[r,...n.parts.values()]:[...n.parts.values()];for(let i of o){if(!i.root)continue;let a=chunkZOZI27AW_cjs.Xa(i,t);if(a?.kind==="paragraph")return a}return null}var Sf=new WeakMap;function IF(e,t){Sf.set(e,{...t,active:null});}function RF(e){Sf.get(e)?.active?.end();}function Ya(e){let t=Sf.get(e)?.active;return !!t&&!t.ended&&t.shown}var G3=Object.freeze({document:true,save:false,events:false,selection:false,scrolling:false,layout:false}),Z3=new Uint8Array(0);function X3(e){let t=Sf.get(e),n=e.surface;if(!t||!n||n.parked())return {ok:false,reason:"no-document"};if(t.active&&!t.active.ended)return {ok:false,reason:"preview-active"};let r=n.hostElement();if(cr(r))return {ok:false,reason:"blocked"};if(n.editingMode()==="view")return {ok:false,reason:"viewing"};if(Cu(n))return {ok:false,reason:"composing"};n.flushPendingInput();let o=n.session.currentPackage(),i=o.parts.get(o.mainDocumentPart);if(!i)return {ok:false,reason:"no-document"};let a=t.displayOptions(),s=new chunk65XBN67F_cjs.Q(o,i,a.contentLockPolicy?{contentLockPolicy:a.contentLockPolicy}:{}),l=chunk3IEXDEFH_cjs.n({port:kF(s,n,t.displayOptions),capabilities:G3}),c=e.mountGeneration,d=new Set,u=null,f=false,p=e.on("change",()=>{if(f)return;if(e.surface!==n||e.mountGeneration!==c){g.end();return}if(!u)return;let{scale:b,showParagraphMarks:h}=t.displayOptions();b!==void 0&&u.surface.setScale(b)&&u.place(),u.surface.setShowParagraphMarks(h??false);}),g={deferEvents:t.deferEvents,host:l,get shown(){return u!==null},get ended(){return f},show(){if(f||u)return false;let b=t.displayOptions(),h=chunk25EXMBV2_cjs.m({ok:true,package:s.currentPackage()},{...b.reviewModel?{reviewModel:b.reviewModel}:{},...b.contentLockPolicy?{contentLockPolicy:b.contentLockPolicy}:{}});if(!h.ok)return false;let y=b.translate?.("editor.previewContent")??i18n.en.editor.previewContent;return u=xF(r,y,x=>{let v={...b,editingMode:"view",revisionDisplayMode:n.revisionDisplayMode(),openedSession:h,progressiveOpen:true},S=Jl(x,Z3,v);return S.ok?(S.surface.setEditable(false),S.surface):null}),u?(bh(r,true),t.changed(),true):false},reveal(){if(!u)return false;let b=SF(o,s.currentPackage());return b===null?false:(u.finishOpening(),u.surface.revealPosition({paragraphId:b,offset:0}),true)},end(){if(f)return;f=true,p();let b=u!==null;u?.remove(),u=null,b&&bh(r,false),t.active===g&&(t.active=null),b&&t.changed();for(let h of [...d])try{h();}catch{}d.clear();},onEnd(b){return f?(b(),()=>{}):(d.add(b),()=>d.delete(b))}};return t.active=g,{ok:true,fork:g}}var PF=new WeakMap;function TF(e){let t=PF.get(e);if(!t)throw new Error("External refresh requires a mounted createDocxEditor instance.");return t}function EF(e,t){let n=null,r=null,o={...t,epoch:0,revision:0,mountedRevision:0,source:void 0,invalidated:new Set,cancel(){if(!r||r.mountedRevision!==null)return;t.cancelLoad();let i=r;r=null,Lo(i.container,false),t.surface()?.setEditable(e.snapshot().editingMode!=="viewing"),o.source=void 0,i.resolve(false);try{t.changed();}catch{}},invalidate(){o.cancel(),o.epoch++,n=null,r&&(Lo(r.container,false),r.resolve(false),r=null),o.source=void 0;for(let i of o.invalidated)i();},contentMounted(i){r?.bytes===i&&(r.mountedRevision=o.revision);},mounted(i,a){if(!r||r.bytes!==i)return;let s=r,l=!a&&!!t.surface();o.mountedRevision=s.mountedRevision??o.revision,l?n=null:n={top:s.top,left:s.left};let c=Ft(s.container);if(l&&c&&(c.scrollTop=Math.max(0,Math.min(s.top,c.scrollHeight-c.clientHeight)),c.scrollLeft=Math.max(0,Math.min(s.left,c.scrollWidth-c.clientWidth)),c.dispatchEvent(new(je(c)).Event("scroll"))),r===s){r=null,Lo(s.container,false),t.surface()?.setEditable(e.snapshot().editingMode!=="viewing"),o.source=void 0,s.resolve(l);try{t.changed();}catch{}}},replace(i,a){let s=t.container();if(!s||r)return Promise.resolve(false);let l=Ft(s);return new Promise(c=>{r={bytes:i,resolve:c,container:s,top:a==="recovery"&&n?n.top:l?.scrollTop??0,left:a==="recovery"&&n?n.left:l?.scrollLeft??0,mountedRevision:null},o.source=a,Lo(s,true),t.surface()?.setEditable(false);try{t.load(i);}catch(d){o.mounted(i,d);}})}};return e.on("change",i=>{i.source||o.revision++;}),PF.set(e,o),o}function CF(e,t,n,r,o,i){let a=new Map,s=new Set,l=p=>{let{family:g,weight:b,style:h}=p.request;return `${p.identity}|${g}|${b}|${h}`},c=i?{shape(p){try{return e.shaper.shape(p)}catch(g){let b=p.environment.font;if(g instanceof chunk6NVZNB7O_cjs.f&&g.code==="fontOverLimit"&&!s.has(l(b))){s.add(l(b));let{family:h,weight:y,style:x}=b.request;try{i(new chunkUKVVUHZL_cjs.a("overLimit",g.message,{request:Object.freeze({family:h,weight:y,style:x}),diagnostic:g.diagnostic??g.message,cause:g}));}catch{}}throw g}}}:e.shaper,d=c!==e.shaper&&chunkFDSL5OJU_cjs.q(e.shaper)?chunkFDSL5OJU_cjs.p(c):c,u=chunk6NVZNB7O_cjs.ga({...e,shaper:d},{resolveFont:p=>{let g=p.fontFamily??t.defaultFont.family;if(g.trim().length===0)return null;let b={family:g,weight:p.bold?700:400,style:p.italic?"italic":"normal"},h=chunkFDSL5OJU_cjs.h(b);if(a.has(h))return a.get(h)??null;let y;try{y=e.fonts.resolve(b);}catch{return a.set(h,null),null}let x=y instanceof chunkFDSL5OJU_cjs.d?null:y;return a.set(h,x),x},fallback:n.measurer}),f=`shaped:${e.operation.extensionFingerprint}+algorithm:${e.operation.shapingHash}+producer:${e.operation.producerVersion}+fallback:${n.producer}@scale:${r}+fonts:${o}`;return {measurer:u,producer:f}}var Y3="The quick brown fox 0123 \u2014 {}#@",Q3=["monospace","serif"],J3=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function MF(e){if(!e)return ()=>true;let t=new Map,n=r=>(e.font=r,e.measureText(Y3).width);return r=>{let o=t.get(r);if(o!==void 0)return o;if(!J3.test(r))return t.set(r,true),true;let i=false;for(let a of Q3){let s=n(`32px ${a}`);if(n(`32px "${r}", ${a}`)!==s){i=true;break}}return t.set(r,i),i}}var OF=4;function AF(e,t,n){let r=new Set,o=[];for(let d of t){let u=d.toLowerCase();r.has(u)||(r.add(u),o.push(d));}let i=d=>new Set(e.slice(0,Math.max(d,0)).map(u=>u.toLowerCase())),a=0;for(let d=0;d<=OF;d+=1){let u=i(n-a),f=o.filter(g=>!u.has(g.toLowerCase())).length,p=Math.min(f,OF,Math.floor(n/2));if(p===a)break;a=p;}let s=e.slice(0,Math.max(n-a,0)),l=i(n-a),c=o.filter(d=>!l.has(d.toLowerCase()));return [...s,...c].slice(0,n)}function FF(e,t,n,r=new Set){let o=[];for(let i of e){if(r.has(i.toLowerCase())){o.push(i);continue}if(t(i)||n(i))continue;let a=chunk6NVZNB7O_cjs.U.get(i.toLowerCase());a!==void 0&&n(a)||o.push(i);}return o}function LF(e,t){let n=new Set(e.map(r=>r.request.family.toLowerCase()));for(let r=0;r<t.length;r+=1){let o=false;for(let i of t){let a=i.from.family.toLowerCase();n.has(a)||!n.has(i.to.family.toLowerCase())||(n.add(a),o=true);}if(!o)break}return n}var DF=new WeakMap,e$=0,t$=chunkE4IAO4CY_cjs.p((e,t)=>{if(e.kind==="paragraphProperties"){let n=DF.get(e);return n||(n=String(++e$),DF.set(e,n)),{families:[n],children:[]}}return {families:e.kind==="paragraph"&&!e.children.some(n=>n.kind==="paragraphProperties")?["default-paragraph"]:[],children:chunkE4IAO4CY_cjs.q(e,t)}});function wf(e){return t$(e,{key:""})}var NF=new WeakMap,HF=new WeakMap;function Vy(e){let t=HF.get(e);return t||HF.set(e,t=chunkE4IAO4CY_cjs.r()),t}function Uy(e,t){Vy(e)(t,e.stylesRoot(),e.documentThemeFonts()),chunkE4IAO4CY_cjs.t(t),wf(t);}function _F(e,t,n,r){let o=Vy(e).warmTableRows(t,n,r,e.stylesRoot(),e.documentThemeFonts()),i=t.children.slice(n,r);return chunkE4IAO4CY_cjs.t(i),wf(i),Math.max(o,t.children.length)}function BF(e){let t=e.packageRevision(),n=NF.get(e);if(n?.revision===t)return n.families;let r=n?.eastAsianFonts??Vy(e),o=e.storyParts().map(f=>f.root),i=e.stylesRoot(),a=e.numberingRoot(),s=e.documentThemeFonts(),l=wf(o),d=n&&n.stylesRoot===i&&n.numberingRoot===a&&n.theme===s&&n.numberingInputs.length===l.length&&n.numberingInputs.every((f,p)=>f===l[p])?n.numberingFamilies:chunkE4IAO4CY_cjs.v(o,a,i,s),u=[...e.symbolFontFamilies(),...r(o,i,s),...chunkE4IAO4CY_cjs.t(o),...d];return NF.set(e,{eastAsianFonts:r,revision:t,families:u,numberingInputs:l,numberingFamilies:d,numberingRoot:a,stylesRoot:i,theme:s}),u}function $F(e,t,n){let[r]=chunkE4IAO4CY_cjs.a([[t]]);return AF([...new Set([...r&&r!==n?[r]:[],...e.documentFonts()])],BF(e),chunkE4IAO4CY_cjs.c)}function qF(e,t){let n,r=false,o=()=>{r=false;let a=e();if(!a)return;let s=n?.generation!==a.generation;s&&(n={generation:a.generation,requested:new Set,running:false});let l=n;if(l.running||!s&&!a.dynamic)return;let c=a.families().filter(u=>!l.requested.has(u.toLowerCase()));if(!s&&c.length===0)return;for(let u of c)l.requested.add(u.toLowerCase());l.running=true;let d=t(c);return d.finally(()=>{l.running=false,n===l&&i();}),d},i=(a=false)=>{if(a)return o();r||(r=true,queueMicrotask(o));};return {schedule:i}}function WF(){let e=0,t=new AbortController,n=()=>{let r=t;return {generation:e,signal:r.signal,current:()=>t===r&&!r.signal.aborted}};return {get generation(){return e},capture:n,advance(){let r=t;return t=new AbortController,e+=1,{...n(),cancelPrevious:()=>r.abort()}},dispose:()=>t.abort()}}function Gn(e,t,n="unsupported"){if(e===null||e===Fl)return {ok:false,code:n,reason:t};let r=Za(e);return {ok:false,code:r==="edit.read-only"||r==="edit.protected-content"?"locked":"unsupported",reason:e}}function KF(e){return e.kind==="custom"?`custom node '${e.name}' has no reviewCard, so it has no card to activate`:`review items of kind '${e.kind==="revision"?e.revisionKind:e.kind}' are excluded from activation`}function zy(e,t){let n=e.review;return n?{reviewModel:chunk25EXMBV2_cjs.j({...n,collectReviewItems:r=>n.collectReviewItems(e.customNodes.length>0?{...r,customNodes:e.customNodes,...e.customNodeDiagnostics.length>0?{reportCustomNodeDiagnostic:t}:{}}:r)},chunkTELQ52LG_cjs.e)}:{}}var n$=["all-markup","simple-markup","proposed","original"];function VF(e){let t=()=>e.placements({pairReplacements:true}).filter(v=>v.kind==="revision"&&(v.activatable||v.revisionKind==="format")),n=()=>e.surface()?.session.reviewItems().filter(v=>v.kind==="revision")??[],r=()=>{let v=e.surface()?.session;if(!v)return [];let S=chunkTELQ52LG_cjs.d(v.currentPackage());return v.storyParts().flatMap(I=>chunkTELQ52LG_cjs.f(chunkZOZI27AW_cjs.sk(I),S))},o=(v,S)=>v.keys!==void 0||v.scope==="document"||e.authorVisibility.hasPredicate?[]:S().filter(I=>e.authorVisibility.isVisible(I.author)),i=(v,S=false)=>{let I=n(),C,P=_=>(C??=new Map(e.placements({placement:false,pairReplacements:true}).filter(L=>Ai(L.key)).map(L=>[L.key,L])),C.get(_)),E=new Set(v.keys?.flatMap(_=>{if(!Ai(_))return [_];let L=P(_);return L?Du(L.item):[_]})??(v.scope==="document"?I:CC(e.surface()?.session.reviewItems()??[],e.authorVisibility)).filter(_=>_.kind==="revision").map(chunkZOZI27AW_cjs.Fj)),R=new Map,w=v.scope==="document"&&v.keys===void 0;if(w){let _=e.surface().session;for(let L of _.storyParts())R.set(L.name,{scope:Ct(_,L.root.id,{kind:"body"}),part:L,keys:[]});}let M=null,O=()=>M??=r(),B=S?o(v,O):[];for(let _ of B)E.add(chunkZOZI27AW_cjs.Fj(_));let q=_=>{let L=e.scope(_),X=Ee(e.surface().session,chunkZOZI27AW_cjs.Ej(_)[0]);if(!X)return;let te=R.get(X.name);te||(te={scope:L,part:X,keys:[]},R.set(X.name,te));let me=chunkZOZI27AW_cjs.Fj(_);E.delete(me)&&te.keys.push(me);};for(let _ of I)q(_);for(let _ of B)q(_);let j=new Set(v.keys??[]);if(j.size>0&&E.size>0)for(let _ of O())E.has(chunkZOZI27AW_cjs.Fj(_))&&q(_);let z=S?new Set(O().flatMap(_=>j.has(chunkZOZI27AW_cjs.Fj(_))?[]:[chunkZOZI27AW_cjs.Fj(_)])):new Set;return {scopes:[...R.values()],missing:[...E],unfilteredDocument:w,silent:z}},a=v=>{let S=chunkZOZI27AW_cjs.fd(e.surface().session.currentPackage()),I=[],C=[];for(let{scope:P,part:E,ops:R}of v)R.length&&(E.name===S?.name?C.push({partName:E.name,ops:R}):I.push({scope:P,ops:R}));return {groups:I,partOps:C}},s=(v,S=false)=>{let{scopes:I,missing:C,unfilteredDocument:P,silent:E}=i(v,S),R=[],w=C.filter(B=>!E.has(B)).map(B=>({key:B,reason:"unknown-revision"})),M=[],O=0;for(let{scope:B,part:q,keys:j}of I){let z=chunk65XBN67F_cjs.sa(q,v.action,P?void 0:j,void 0,{countRemaining:false});for(let _ of z.result.resolved)E.has(_.key)||R.push(_);for(let _ of z.result.skipped)E.has(_.key)||w.push(_);O+=z.result.remaining,M.push({scope:B,part:q,ops:z.ops});}return {...a(M),result:{resolved:R,skipped:w,remaining:O}}},l=v=>v.author===void 0?e.surface()?.author():v.author,c=v=>{let{scopes:S,missing:I}=i(v),C={author:l(v)??"",...v.date===void 0?{}:{date:v.date}},P=I.map(w=>({key:w,reason:"unknown-revision"})),E=[];for(let{scope:w,part:M,keys:O}of S){if(!O.length)continue;let B=chunkZOZI27AW_cjs.yk(M,C,O,void 0,v.authors);E.push({scope:w,part:M,ops:B.ops,plan:B});}let R=w=>({updated:w.flatMap(M=>M.updated),skipped:[...P,...w.flatMap(M=>M.skipped)]});return {...a(E),result:R(E.map(({plan:w})=>w.result)),finish:()=>{let w=e.surface().session.currentPackage().parts;return R(E.map(({part:M,plan:O})=>{let B=w.get(M.name);return B?O.finish(B):O.result}))}}},d=()=>e.destroyed()?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.enabled()?e.surface()?{ok:true}:{ok:false,code:"notFound",reason:"no document is open"}:{ok:false,code:"unsupported",reason:sn},u=v=>v.scope!==void 0&&!["visible","document"].includes(v.scope)||v.unsupported!==void 0&&!["skip","fail"].includes(v.unsupported)||v.keys!==void 0&&(!Array.isArray(v.keys)||v.keys.some(S=>typeof S!="string"))?{ok:false,code:"invalidArgs",reason:"invalid bulk revision selection"}:null,f=v=>{let S=d();if(!S.ok)return {gate:S};if(e.viewing())return {gate:{ok:false,code:"locked",reason:"the document is open for viewing"}};let I=sr(v,e.surface());if(I)return {gate:I};let C=l(v);if(C===void 0)return {gate:{ok:false,code:"invalidArgs",reason:"pass an author, or configure the editor author, to change the author"}};if(typeof C!="string"||v.date!==void 0&&typeof v.date!="string"||chunkZOZI27AW_cjs.xk({author:C,...v.date===void 0?{}:{date:v.date}}))return {gate:{ok:false,code:"invalidArgs",reason:"author must be nonblank text, and date an ISO 8601 date and time"}};let P=u(v);if(P)return {gate:P};if(v.keys!==void 0&&(v.scope!==void 0||v.authors!==void 0)||v.authors!==void 0&&(!Array.isArray(v.authors)||v.authors.some(w=>typeof w!="string")))return {gate:{ok:false,code:"invalidArgs",reason:"select by keys, or by scope and authors; authors must be a list of names"}};let E=c(v),{result:R}=E;return v.unsupported==="fail"&&R.skipped.length?{gate:{ok:false,code:"unsupported",reason:"some selected changes cannot change author"},plan:E}:R.updated.length?{gate:{ok:true},plan:E}:{gate:{ok:false,code:R.skipped.some(w=>w.reason==="unsupported-revision")?"unsupported":"notFound",reason:"no eligible selected changes to update"},plan:E}},p=v=>{e.surface()?.flushPendingInput();let{gate:S,plan:I}=f(v);if(!S.ok)return I?{...S,revisionAuthors:{...I.result,updated:[]}}:S;let C=e.surface(),{groups:P,partOps:E}=I;if(!P.length&&!E.length)return {ok:true,changed:false,revisionAuthors:I.result};let R=e.placements({placement:false,pairReplacements:false}).find(q=>q.isActive)?.key,w,M=C.commitReviewOps(q=>(w=C.session.applyTreeOpsAtomic(P,{partOps:E,historyToken:q}),w),"revision-attribution");if(!w?.committed)return Gn(M,"the changes were refused");let O=I.finish(),B=O.updated.find(q=>q.previousKey===R);return B&&e.activate(B.key),{ok:true,changed:true,revisionAuthors:O}},g=v=>{if(v.type==="setReviewChangesAuthor")return f(v).gate;if(v.type!=="navigateReviewChange"&&v.type!=="resolveAllReviewChanges"&&v.type!=="setReviewDisplayMode")return null;let S=d();if(!S.ok)return S;if(v.type==="setReviewDisplayMode")return n$.includes(v.mode)?{ok:true}:{ok:false,code:"invalidArgs",reason:"unknown review display mode"};if(v.type==="navigateReviewChange"&&!["next","previous"].includes(v.direction))return {ok:false,code:"invalidArgs",reason:"unknown review navigation direction"};if(v.type==="resolveAllReviewChanges"&&!["accept","reject"].includes(v.action))return {ok:false,code:"invalidArgs",reason:"unknown review resolution action"};if(v.type==="navigateReviewChange")return t().length?{ok:true}:{ok:false,code:"notFound",reason:"no visible changes to review"};if(e.viewing())return {ok:false,code:"locked",reason:"the document is open for viewing"};let I=sr(v,e.surface());if(I)return I;let C=u(v);if(C)return C;let{result:P,groups:E,partOps:R}=s(v);return v.unsupported==="fail"&&P.skipped.length?{ok:false,code:"unsupported",reason:"some selected changes cannot be resolved"}:!P.resolved.length&&!E.length&&!R.length?{ok:false,code:P.skipped.length?"unsupported":"notFound",reason:"no eligible selected changes to review"}:{ok:true}},b=(v,S)=>{let I=d();if(!I.ok)return I;if(e.viewing()){let w=e.surface().commitReviewOps(()=>({committed:false,reason:"the document is open for viewing"}),"revision-resolve");return Gn(w,"the document is open for viewing","locked")}let C=sr({type:"resolveAllReviewChanges"},e.surface());if(C)return C;e.surface().flushPendingInput();let P=Mr(e.placements,v)?.item;if(!P||P.kind!=="revision")return {ok:false,code:"notFound",reason:"no revision with that key"};if(P.readOnly)return {ok:false,code:"unsupported",reason:Pa};let E,R=e.surface().commitReviewOps(w=>{let M=e.surface().session,O=Ee(M,chunkZOZI27AW_cjs.Ej(P)[0]);return O&&O.name===chunkZOZI27AW_cjs.fd(M.currentPackage())?.name?(E=M.applyTreeOpsAtomic([],{partOps:[{partName:O.name,ops:jF(P,S,O)}],historyToken:w}),E):(E=e.surface().session.applyTreeOps(jF(P,S,e.surface().session.partFor(e.scope(P))),void 0,void 0,e.scope(P),{historyToken:w}),E)},"revision-resolve");return E?.committed?{ok:true,changed:true}:Gn(R,"the revision was refused")},h=v=>{if(v.type==="setReviewChangesAuthor")return p(v);if(!["navigateReviewChange","resolveAllReviewChanges","setReviewDisplayMode"].includes(v.type))return null;e.surface()?.flushPendingInput();let S=g(v);if(!S)return null;if(!S.ok){if(v.type==="resolveAllReviewChanges"&&(S.code==="notFound"||S.code==="unsupported")&&d().ok&&!e.viewing()){let{result:M}=s(v);return {...S,revisions:{...M,resolved:[],remaining:n().length}}}return S}let I=e.surface();if(v.type==="setReviewDisplayMode")return e.setDisplayMode(v.mode),{ok:true,changed:false};if(v.type==="navigateReviewChange"){let M=t(),O=M.findIndex(X=>X.isActive),B=v.direction==="next"?1:-1,q=O<0?r$(M,I,B):(O+B+M.length)%M.length,j=M[q],z=_a(j.item),_=z?chunkZOZI27AW_cjs.Fj(z.deletion):j.key,L=e.activate(j.key,!j.activatable&&j.revisionKind==="format");return L.ok&&e.reveal({key:_,source:"navigate"}),L}if(v.type!=="resolveAllReviewChanges")return null;let{groups:C,partOps:P,result:E}=s(v,true),R,w=I.commitReviewOps(M=>(R=I.session.applyTreeOpsAtomic(C,{partOps:P,historyToken:M}),R),"revision-resolve");return R?.committed?(e.activate(null),{ok:true,changed:true,revisions:{...E,remaining:n().length}}):Gn(w,"the revisions were refused")},y=v=>{let S=Mr(e.placements,v)?.item;return S?.kind==="revision"?S:void 0},x=e.report?e.report.diagnostics.reviewItem(b,y,(v,S)=>{let I=e.surface()?.session,C=I&&Ee(I,chunkZOZI27AW_cjs.Ej(v)[0]);if(!C)return {};try{let E=chunk65XBN67F_cjs.sa(C,S,[chunkZOZI27AW_cjs.Fj(v)],void 0,{countRemaining:!1}).result.skipped[0]?.detail;return {partName:C.name,...E?{detail:E}:{}}}catch{return {partName:C.name}}},e.report.tracked):b;return {can:g,exec:h,resolveReviewItem:x}}function r$(e,t,n){let r=t.state().selection.head,o=t.session.storyParts().find(s=>r.paragraphId.startsWith(`${s.name}#`)),i=o?chunkZOZI27AW_cjs.rj(o):new Map,a=i.get(r.paragraphId);if(a!==void 0)for(let s=n>0?0:e.length-1;s>=0&&s<e.length;s+=n){let l=e[s],c=l.kind==="revision"?l.item.ranges[0]?.start:void 0,d=c?i.get(c.paragraphId):void 0;if(c&&d!==void 0&&(n>0?d>a||d===a&&c.offset>=r.offset:d<a||d===a&&c.offset<=r.offset))return s}return n>0?0:e.length-1}function jF(e,t,n){let r=t==="accept"?"acceptRevision":"rejectRevision";if(!n)return [];if(e.revisionKind==="structural"||chunkZOZI27AW_cjs.Bj(n.root).length>0||e.revisionKind==="format"&&chunkZOZI27AW_cjs.Ej(e).length>1)return [...chunk65XBN67F_cjs.sa(n,t,Du(e),void 0,{countRemaining:false}).ops];let o=new Set(chunkZOZI27AW_cjs.Ej(e)),i=new Map;for(let a of chunkZOZI27AW_cjs.lk(n)){if(!o.has(a.node.id))continue;let s=f=>a.node.attributes.find(p=>p.namespaceUri===chunkZOZI27AW_cjs.pa&&p.localName===f)?.value,l=e.addresses.find(f=>f.id===s("id")&&f.author===(s("author")??"")&&(f.date??"")===(s("date")??""));if(!l)continue;let c=a.node.localName,d=JSON.stringify([l,c]),u=i.get(d);u?u.siteNodeIds.push(a.node.id):i.set(d,{revision:l,localName:c,siteNodeIds:[a.node.id]});}return [...i.values()].map(({revision:a,localName:s,siteNodeIds:l})=>({op:r,revision:a,...s===void 0?{}:{localName:s},siteNodeIds:l}))}function UF(e){return e.kind==="comment"?e.comment.date:e.kind==="revision"?e.date:void 0}function GF(e,t,n,r){return e.type!=="toggleReviewPane"&&e.type!=="toggleParagraphMarks"&&e.type!=="toggleBookmarks"&&e.type!=="setEditingMode"?null:t?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.type==="toggleReviewPane"&&!n?{ok:false,code:"unsupported",reason:sn}:e.type==="setEditingMode"?r(e.mode)??{ok:true}:{ok:true}}function zF(e){let t=false;return {get:()=>t,toggle:()=>{t=!t,e(t);}}}function ZF(e){let t=0,n=0,r=nF({changed:()=>{t+=1,e.changed();},error:a=>e.emitError(en("hostCallback",`a bookmark mark callback failed: ${a instanceof Error?a.message:String(a)}`))}),o=zF(a=>{e.surface()?.setShowParagraphMarks(a),e.changed();}),i=zF(a=>{e.surface()?.bookmarkEditing.setShown(a),e.changed();});return {popupChrome:r,chromeSettled(){let a=n===t;return n=t,a},capability:e.capability,surfaceOptions:()=>({showParagraphMarks:o.get(),onToggleParagraphMarks:o.toggle,showBookmarks:i.get(),...r.surfaceOptions}),snapshot:()=>({showParagraphMarks:o.get(),showBookmarks:i.get()}),dialog(a,s){if(a.type==="openGoTo"){let l=r.goTo,c=a.fromShortcut===true;return c&&l.canOpen()&&!l.shortcutOn()&&!e.destroyed()?{ok:false,code:"unsupported",reason:"the Go To shortcut is turned off"}:zg(c?{canOpen:l.canOpen,open:l.openFromShortcut}:l,e.destroyed(),s,"Go To view")}return a.type!=="openBookmarkDialog"?null:zg(r.bookmarkDialog,e.destroyed(),s)},toggle(a){if(a.type==="toggleParagraphMarks")o.toggle();else if(a.type==="toggleBookmarks")i.toggle();else return null;return {ok:true,changed:false}},isActive(a){return a.type==="toggleParagraphMarks"?o.get():a.type==="toggleBookmarks"?i.get():null}}}function XF(e,t){return e.session.subscribe(n=>{let r={revision:e.session.packageRevision(),created:n.created,deleted:n.deleted,dirty:n.dirty};t.refitIfPageResized(),t.bump(),t.emit(r);})}var o$=12;function YF(e,t){if(typeof MessageChannel=="function"){let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),e();},n.port2.postMessage(null);return}t.setTimeout(e,0);}function QF(e,t){if(!dr(e))return;let n=()=>{t.current()!==e||!dr(e)||(t.slice(()=>Dl(e,o$))?t.settled():YF(n,t.view()));};YF(n,t.view());}function JF(e,t){let n=false;return {...e,slice:r=>{try{return e.slice(r)}catch(o){let i=t.take();if(!i)throw o;return t.crashed(o),t.mounted(i,o),n=true,true}},settled:()=>{if(n)return;let r=t.take();e.settled(),r&&t.mounted(r);}}}function eL(e,t,n){if(!t)return false;switch(e.type){case "toggleMark":switch(e.mark){case "bold":return t.bold===true;case "italic":return t.italic===true;case "underline":return t.underline===true;case "strike":return t.strike===true;case "superscript":return t.superscript===true;case "subscript":return t.subscript===true;default:return false}case "setParagraphDirection":return t.direction===e.direction;case "setAlignment":return t.alignment===(e.align==="justify"?"both":e.align);case "toggleList":return n(e.kind);default:return false}}var tL=new WeakMap;function Gy(e,t){let n=t(e?.matches??[]);return tL.set(n,e?.truncated??false),n}function nL(e){return tL.get(e)}function kf(e,t,n){return t.kind==="note"?e.enterNote?.(t.id,n)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the note could not be opened"}:(t.furnitureKind?e.enterHeaderFooter?.({rId:t.rId,kind:t.furnitureKind,position:n}):e.enterHeaderFooter?.({rId:t.rId,position:n}))?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the header or footer could not be opened"}}function i$(e){return e?.kind==="headerFooter"||e?.kind==="note"}function a$(e,t){return t!=="viewing"&&typeof e.enterHeaderFooter=="function"&&typeof e.enterNote=="function"?"all":"body"}function If(e,t){e.activeScope().kind!=="body"&&e.session.paragraphIds().includes(t)&&(e.activeScope().kind==="frame"&&e.setActiveScope({kind:"body"}),e.exitNote?.(),e.exitHeaderFooter?.());}function rL(e,t){if(typeof t?.blockId!="string"||t.blockId.length===0||!Number.isInteger(t.start)||t.start<0||!Number.isInteger(t.length)||t.length<0)return {ok:false,code:"invalidArgs",reason:"match must carry a blockId and offsets"};if(t.scope?.kind==="frame"){let{drawingNodeId:r,hostParagraphId:o}=t.scope;if(typeof r!="string"||r.length===0||typeof o!="string"||o.length===0)return {ok:false,code:"invalidArgs",reason:"a frame match must carry drawing and host paragraph ids"};let i={ok:false,code:"unsupported",reason:"the text box drawing could not be selected"};if(!Ba(e.layout(),r,o))return i;let a=t.scope.owner;if(a){let s=kf(e,a,{paragraphId:o,offset:0});if(!s.ok)return s}else If(e,o);return e.revealParagraph(o),e.selectDrawing(r,o)?{ok:true,changed:false}:i}let n={paragraphId:t.blockId,offset:t.start};if(i$(t.scope)){let r=kf(e,t.scope,n);if(!r.ok)return r}else {if(t.scope&&t.scope.kind!=="body")return {ok:false,code:"unsupported",reason:"the match scope cannot be opened"};If(e,t.blockId);}return e.setSelection({anchor:n,head:{paragraphId:t.blockId,offset:t.start+t.length}}),e.revealParagraph(t.blockId),{ok:true,changed:false}}function oL(e,t,n,r,o){let i={...o?.matchCase!==void 0?{matchCase:o.matchCase}:{},...o?.wholeWord!==void 0?{wholeWord:o.wholeWord}:{},...e?{stories:a$(e,t)}:{}};if(typeof r=="string")return Gy(e?.session.findText(r,i),n);let a=e?.session.findText(r,i);return r.map((s,l)=>Gy(a?.[l],n))}function Qa(e,t,n){let r=e.block??t,o=e.behavior??"instant",i=e.offsetPx??24;if(!["start","center","centerIfNeeded","nearest"].includes(r))throw new TypeError("block must be start, center, centerIfNeeded, or nearest.");if(!["instant","smooth"].includes(o))throw new TypeError("behavior must be instant or smooth.");if(!Number.isFinite(i)||i<0)throw new RangeError("offsetPx must be finite and nonnegative.");let a=n?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches??false;return {block:r,offsetPx:i,behavior:a?"instant":o}}function iL(e,t,n=()=>null){return {scrollToPage(r){return !Number.isInteger(r)||r<1?false:(t(),e()?.revealPage(r-1)??false)},scrollToBlock(r,o){if(typeof r!="string"||r.length===0)return false;let i;try{i=Qa(o??{},"start",n());}catch{return false}t();let a=e();return a&&If(a,r),a?.revealParagraph(r,i)??false}}}var aL="cubic-bezier(0.23, 1, 0.32, 1)";function qi(e,t,n,r=1/0){let o=e??t;if(!Number.isFinite(o)||o<0||o>r)throw new RangeError(r===1/0?`${n} must be a finite, nonnegative number.`:`${n} must be finite and between 0 and ${r}.`);return o}function sL(e,t=180){if(e!==void 0&&typeof e!="boolean"&&(typeof e!="object"||e===null||Array.isArray(e)))throw new TypeError("animation must be a boolean or a durationMs settings object.");return e===false?0:qi(typeof e=="object"?e.durationMs:void 0,e===true||typeof e=="object"?180:t,"animation.durationMs",1e4)}function Rf(e,t,{marker:n,defaultColor:r},o){let i=[],a=new Map,s=new Set,l=null,c=null,d=r,u=.14,f=4,p=6,g=0,b=r,h="solid",y="",x=180,v=180,S,I=aL,C=mt(()=>t.container()),P,E=0,R=()=>{E++,P!==void 0&&C.clearTimeout(P),P=void 0;},w=D=>{let T=t.container()?.ownerDocument.defaultView?.CSS??globalThis.CSS;if(D!==void 0&&(typeof D!="string"||!D.trim()||/var\(|^(inherit|initial|unset|revert|revert-layer)$/i.test(D.trim())||T?.supports&&!T.supports("animation-timing-function",D)))throw new TypeError("animation.easing must be a CSS timing function without variables.");let W=t.container()?.ownerDocument.defaultView?.KeyframeEffect??globalThis.KeyframeEffect;if(D!==void 0&&W)try{new W(null,[],{easing:D});}catch{throw new TypeError("animation.easing must be one valid animation timing function.")}return D},M=(D,T)=>qi(typeof D=="object"?D.exitDurationMs:void 0,T,"animation.exitDurationMs",1e4),O=(D={})=>{if(D.includePrevious!==void 0&&typeof D.includePrevious!="boolean")throw new TypeError("includePrevious must be a boolean.");let T=qi(D.opacity,.14,"opacity",1),W=qi(D.padding,4,"padding"),$=qi(D.borderRadius,6,"borderRadius"),K=sL(D.animation),Y=M(D.animation,K),re=w(typeof D.animation=="object"?D.animation.easing:void 0),N=D.timeoutMs===null?null:qi(D.timeoutMs,3e3,"timeoutMs",2147483647),U=D.color??r,G=qi(D.borderWidth,0,"borderWidth"),ee=D.borderColor??U,de=D.borderStyle??"solid",oe=D.className??"";if(!["solid","dashed","dotted"].includes(de))throw new TypeError("borderStyle must be solid, dashed, or dotted.");if(typeof oe!="string")throw new TypeError("className must be a string.");let ce=t.container()?.ownerDocument.defaultView?.CSS??globalThis.CSS;if(typeof U!="string"||!U.trim()||ce?.supports&&!ce.supports("color",U))throw new TypeError("color must be a CSS color or var() expression.");if(ce?.supports&&!ce.supports("color",`color-mix(in srgb, ${U} ${T*100}%, transparent)`))throw new TypeError("color must be valid inside color-mix(), including var() expressions.");if(typeof ee!="string"||!ee.trim()||ce?.supports&&!ce.supports("color",ee))throw new TypeError("borderColor must be a CSS color or var() expression.");if(D.changeIds!==void 0&&(!Array.isArray(D.changeIds)||D.changeIds.length>1e4||D.changeIds.some(he=>typeof he!="string"||!he)))throw new TypeError("changeIds must contain at most 10000 nonempty string IDs.");return {nextOpacity:T,nextPadding:W,nextRadius:$,nextDuration:K,nextExitDuration:Y,nextEasing:re,nextTimeout:N,nextColor:U,nextBorderWidth:G,nextBorderColor:ee,nextBorderStyle:de,nextClassName:oe}},B=()=>S||t.container()?.ownerDocument.defaultView?.getComputedStyle(t.container()).getPropertyValue("--doc-motion-ease-out").trim()||aL,q=D=>{D.animation&&(D.animation.onfinish=null,D.animation.cancel(),D.animation=void 0);},j=(D,T)=>{q(T),T.element.remove(),a.get(D)===T&&a.delete(D);},z=()=>(c||(c=t.container()?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)")??null,c?.addEventListener("change",L)),c?.matches??false),_=()=>{c?.removeEventListener("change",L),c=null;};function L(){if(c?.matches){for(let[D,T]of a)q(T),T.exiting&&j(D,T);a.size||_();}}let X=(D,T,W,$,K=false)=>{if(!K&&T.target===W&&!T.exiting)return;let Y=T.element.ownerDocument.defaultView,re=K?0:Number.parseFloat(Y?.getComputedStyle(T.element).opacity??String(T.target));q(T),T.target=W,T.element.style.opacity=String(W);let N=z()?Math.min($,125):$;if(N===0||typeof T.element.animate!="function"){T.exiting&&j(D,T);return}try{let U=T.element.animate([{opacity:Number.isFinite(re)?re:W},{opacity:W}],{duration:N,easing:I});T.animation=U,U.onfinish=()=>{T.animation===U&&(T.animation=void 0,T.exiting&&j(D,T),a.size||_());};}catch{T.exiting&&j(D,T);}},te=()=>{l?.disconnect();let D=t.surface(),T=t.container();if(!D||!T||i.length===0)return;I=B();let W=new Set(i.map(N=>N.paragraphId)),$=e.getRenderScale(),K=e.snapshot().zoom,Y=new Set,re=new Set;for(let N of D.layout().pages){let U=T.querySelector(`[data-page-index="${N.index}"] > .docx-page-content`);if(U)for(let G of chunkFDSL5OJU_cjs.Aa(N)){if(!W.has(G.paragraphId))continue;let ee=`${N.index}:${G.id}`;Y.add(ee);let de=chunkFDSL5OJU_cjs.Qd(G),oe=G.lines.length&&!G.clipToBox?1/0:de.y,ce=G.lines.length&&!G.clipToBox?-1/0:de.y+de.height;for(let we of G.clipToBox?[]:G.lines)oe=Math.min(oe,we.box.y),ce=Math.max(ce,we.box.y+we.box.height);let he=G.clipToBox?0:f*K,Ce=N.contentBox.x-N.box.x,ct=N.contentBox.y-N.box.y,Ae=Math.max(-Ce*$,de.x*$-he),Ie=Math.min((N.box.width-Ce)*$,(de.x+de.width)*$+he);oe=Math.max(-ct*$,oe*$-he),ce=Math.min((N.box.height-ct)*$,ce*$+he);let Re=a.get(ee);Re&&Re.element.parentElement!==U&&(j(ee,Re),Re=void 0);let dt=!Re;if(!Re){let we=T.ownerDocument.createElement("div");we.setAttribute("data-docx-marker",""),we.setAttribute(n,""),we.setAttribute("contenteditable","false"),we.setAttribute("aria-hidden","true"),we.style.cssText="position:absolute;pointer-events:none;box-sizing:border-box;",Re={element:we,paragraphId:G.paragraphId,target:-1,exiting:false},a.set(ee,Re),U.append(we);}let Nt=Re.exiting;Re.exiting=false,Nt&&(Re.target=-1),Re.element.className=y,Object.assign(Re.element.style,{border:g?`${g*K}px ${h} ${b}`:"0",backgroundColor:`color-mix(in srgb, ${d} ${u*100}%, transparent)`,borderRadius:`${p*K}px`,left:`${Ae}px`,top:`${oe}px`,width:`${Math.max(0,Ie-Ae)}px`,height:`${Math.max(0,ce-oe)}px`}),X(ee,Re,1,dt&&s.has(G.paragraphId)?0:x,dt),re.add(G.paragraphId);}}for(let N of re)s.add(N);for(let[N,U]of a)Y.has(N)||(!U.element.isConnected||W.has(U.paragraphId)||v===0?j(N,U):U.exiting||(U.exiting=true,X(N,U,0,v)));l??=new(je(T)).MutationObserver(te),l.observe(T,{childList:true,subtree:true});},me=()=>{R(),i=[],s.clear(),l?.disconnect();for(let[D,T]of a)j(D,T);_();},se=(D={})=>{let T=M(D.animation,sL(D.animation,v));I=w(typeof D.animation=="object"?D.animation.easing:void 0)??B(),R(),i=[],s.clear(),l?.disconnect();for(let[$,K]of a)K.exiting&&T>0||(K.exiting=true,X($,K,0,T));a.size||_();};return e.on("selectionChange",()=>{i.length&&te();}),{show(D,T={}){let{nextOpacity:W,nextPadding:$,nextRadius:K,nextDuration:Y,nextExitDuration:re,nextEasing:N,nextTimeout:U,nextColor:G,nextBorderWidth:ee,nextBorderColor:de,nextBorderStyle:oe,nextClassName:ce}=O(T),he=new Set(i.map(Ce=>Ce.paragraphId));if(s=new Set([...s].filter(Ce=>he.has(Ce))),d=G,g=ee,b=de,h=oe,y=ce,u=W,f=$,p=K,x=Y,v=re,S=N,i=D,x===0)for(let Ce of a.values())Ce.exiting||q(Ce);if(!i.length){se();return}if(te(),R(),U!==null){let Ce=E;P=C.setTimeout(()=>{Ce===E&&(P=void 0,se(),o());},U);}},validate:O,hide:se,clear:me,repaint:te}}function lL(e,t){e.flushPendingInput();let n=Cn(e.session.part(),e.session.paragraphAnchors(),t);return n.ok?n.span:null}function cL(e,t,n){let r=null,o=i=>{if(r)return r;let a=e(),s=Rf(a,i,{marker:"data-docx-anchor-highlight",defaultColor:"var(--doc-anchor-highlight-color)"},()=>{});return i.invalidated.add(()=>s.clear()),a.on("change",l=>{l.source&&s.clear();}),r=s,s};return {scrollToAnchor(i,a={}){let s=t(),l=Qa(a,"centerIfNeeded",s?.container()??null);if(!qt(i))return false;n();let c=s?.surface();if(!c)return false;let d=lL(c,i);return !!d&&c.revealPosition({paragraphId:d.nodeId,offset:d.start},l)},highlightAnchor(i,a){let s=t();if(!s)return false;let l=o(s);if(l.validate(a),!qt(i))return false;n();let c=s.surface();if(!c||!s.container()||s.source)return false;let d=lL(c,i)?.nodeId;return !d||!c.layout().pages.some(f=>chunkFDSL5OJU_cjs.Aa(f).some(p=>p.paragraphId===d))&&!(dr(c)&&c.session.paragraphIds().includes(d))?false:(l.show([{paragraphId:d}],a),true)},clearAnchorHighlight(i){let a=t();a&&o(a).hide(i);}}}function dL(e,t){if(!t.some(o=>o.scope?.kind==="frame"))return t;let n=e.publishedLayout();if(n.revision!==e.session.packageRevision())return t;let r=new Map;return t.filter(o=>{let i=o.scope;if(i?.kind!=="frame")return true;let a=`${i.drawingNodeId}\0${i.hostParagraphId}`,s=r.get(a);return s===void 0&&(s=!!Ba(n,i.drawingNodeId,i.hostParagraphId),r.set(a,s)),s})}var s$=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,l$=/^-?[A-Za-z_][A-Za-z0-9_-]*$/,c$=1e4,uL=32,Zy=1e3;function d$(e,t,n){let r=e?.ownerDocument.defaultView?.CSS??globalThis.CSS;return !r?.supports||r.supports(t,n)}function fL(e,t,n){if(e!==void 0){if(typeof e!="string"||!e.trim()||!d$(n,"color",e))throw new TypeError(`${t} must be a CSS color or var() expression.`);return e}}function pL(e){if(typeof e!="string"||!s$.test(e))throw new TypeError('Highlight set names are 1 to 64 letters, digits, "-", or "_", starting with a letter.');return e}function u$(e,t,n,r,o){if(!Array.isArray(t))throw new TypeError("ranges must be an array of HighlightRange.");if(n!==void 0&&(typeof n!="object"||n===null))throw new TypeError("options must be an object.");let i=t.slice(0,c$),a=t.length-i.length,s=[],l=new Int32Array(i.length),c=new Int32Array(i.length);for(let[h,y]of i.entries()){if(!(typeof y=="object"&&y!==null&&typeof y.blockId=="string"&&y.blockId.length>0&&Number.isSafeInteger(y.start)&&y.start>=0&&Number.isSafeInteger(y.length)&&y.length>=0&&y.start+y.length<=2147483647&&(y.expectedText===void 0||typeof y.expectedText=="string")))throw new TypeError(`ranges[${h}] must have a blockId string, nonnegative integer start and length, and an optional expectedText string.`);s.push(y.blockId),l[h]=y.start,c[h]=y.start+y.length;}let d=n?.activeIndex??-1;if(!Number.isInteger(d)||d<-1)throw new RangeError("activeIndex must be an integer of -1 or more.");let u=n?.priority??0;if(!Number.isInteger(u)||Math.abs(u)>Zy)throw new RangeError(`priority must be an integer from -${Zy} to ${Zy}.`);let f=n?.className??"";if(typeof f!="string")throw new TypeError("className must be a string.");let p=f.split(/\s+/).filter(Boolean);if(p.some(h=>!l$.test(h)))throw new TypeError("className must hold space-separated CSS class names.");let g=fL(n?.color,"color",o),b=fL(n?.activeColor,"activeColor",o);return {name:e,ranges:i,overflow:a,blockIds:s,starts:l,ends:c,...g!==void 0?{color:g}:{},...b!==void 0?{activeColor:b}:{},activeIndex:d,classes:p,priority:u,order:r,expected:null,seen:new Array(i.length).fill(null),resolved:new Uint8Array(i.length),live:new Uint8Array(i.length),checkedAt:null}}function f$(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r+=1;let o=0;for(;o<n-r&&e.charCodeAt(e.length-1-o)===t.charCodeAt(t.length-1-o);)o+=1;return {from:r,oldTo:e.length-o,delta:t.length-e.length}}function p$(e,t,n){return t<=n.from?0:e>=n.oldTo?n.delta:0}var Jy=new WeakMap,vL=new WeakMap,mL=new WeakSet,Xy=new WeakMap,Yy=new WeakMap;function m$(e,t){return Jy.has(e)?Jy.get(e):typeof e.expectedText=="string"?e.expectedText:(Xy.has(e)||Xy.set(e,t),Xy.get(e))}var Qy=new WeakMap;function xL(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=Ee(e.session,n),o=r?chunkZOZI27AW_cjs.Xa(r,n):null,i=null;return r&&o&&(Qy.has(o)?i=Qy.get(o):(i=chunkZOZI27AW_cjs.Tk(r,n),Qy.set(o,i))),t.set(n,i),i}}function gL(e,t,n){let r=t.session,o=r.packageRevision(),i=e.checkedAt;if(i?.session===r&&i.revision===o&&i.layout===n)return;let a=xL(t),s=chunkFDSL5OJU_cjs.Pe(n),l=e.expected===null,c=e.expected??new Array(e.ranges.length).fill(null),d=new Map;for(let u=0;u<e.ranges.length;u+=1){let f=e.ranges[u],p=e.ends[u]>e.starts[u]?a(e.blockIds[u]):null;if(!l&&p!==null&&p===e.seen[u]){e.live[u]=e.resolved[u]&&s.has(e.blockIds[u])?1:0;continue}let g=l?vL.get(f)??Yy.get(f)??p:e.seen[u];if(p!==null&&g!==null&&g!==p){let v=e.blockIds[u],S=d.get(v);S?.seen!==g&&(S={seen:g,edit:f$(g,p)},d.set(v,S));let I=p$(e.starts[u],e.ends[u],S.edit);e.starts[u]=e.starts[u]+I,e.ends[u]=e.ends[u]+I;}e.seen[u]=p;let b=e.starts[u],h=e.ends[u],y=p!==null&&h<=p.length?p.slice(b,h):null;if(!l&&p!==null&&y!==c[u]&&g!==null){let v=p.length-g.length,S=b+v>=0?p.slice(b+v,h+v):null;v!==0&&S!==null&&S===c[u]&&(e.starts[u]=b+v,e.ends[u]=h+v,y=S);}l&&(c[u]=m$(f,y),p!==null&&!Yy.has(f)&&Yy.set(f,p));let x=y!==null&&y===c[u];e.resolved[u]=x?1:0,e.live[u]=x&&s.has(e.blockIds[u])?1:0;}e.expected=c,e.checkedAt={session:r,revision:o,layout:n};}var hL=new WeakMap,yL=new WeakMap,bL=new WeakMap;function g$(e){let t=new Map;for(let n=0;n<e.ranges.length;n+=1){if(!e.live[n])continue;let r=e.blockIds[n],o=t.get(r)??[];o.push({key:n,start:e.starts[n],end:e.ends[n]}),t.set(r,o);}return t}function h$(e,t,n,r,o){let i=t.children[n];i||(i=e.createElement("div"),i.style.position="absolute",t.append(i));let a=r.index===o.activeIndex,s=`${r.index}|${a?1:0}|${r.left}|${r.top}|${r.width}|${r.height}`;bL.get(i)?.key!==s&&(i.className=a?"docx-text-highlight docx-text-highlight--active":"docx-text-highlight",o.classes.length>0&&i.classList.add(...o.classes),i.setAttribute("data-highlight-index",String(r.index)),i.style.left=`${r.left}px`,i.style.top=`${r.top}px`,i.style.width=`${r.width}px`,i.style.height=`${r.height}px`,bL.set(i,{key:s}));}function y$(e){return e?[...e].sort((t,n)=>t-n).join(","):"*"}function b$(e){return e?[...e].map(([t,n])=>`${t}:${n}`).join(","):""}function SL(e){let t=new Map,n=0,r=0,o=[],i=null,a=null,s=null,l=null,c=()=>[...t.values()].sort((h,y)=>h.priority-y.priority||h.order-y.order);function d(h){let y=e.surface();if(i=h.layer,l=h,!y||t.size===0){h.layer.childElementCount>0&&h.layer.replaceChildren(),o=[],a=null;return}let x=c();for(let R of x)gL(R,y,h.layout);let v=Li(h.layout),S=[r,y.session.packageRevision(),y$(h.pages),h.scale,b$(h.pageOffsetX)].join("|");if(S===a&&v===s&&h.layer.childElementCount>0)return;a=S,s=v;let I=h.layer.ownerDocument,C=[],P=[];for(let R of x){let w=u(R,v,h),M=f(I,R),O=0;for(let B of w){let q=v.pages[B.pageIndex];if(!q)continue;let j=h.pageOffsetX?.get(B.pageIndex)??0,z={set:R,index:B.key,left:(q.contentBox.x+B.x+j)*h.scale,top:(q.contentBox.y+B.y)*h.scale,width:B.width*h.scale,height:B.height*h.scale};h$(I,M,O,z,R),O+=1,P.push(z);}for(;M.childElementCount>O;)M.lastElementChild.remove();C.push(M);}let E=h.layer.children;(E.length!==C.length||C.some((R,w)=>E[w]!==R))&&h.layer.replaceChildren(...C),o=P;}function u(h,y,x){let v=hL.get(h);v||(v=new WeakMap,hL.set(h,v));let S=[],I=new Map;for(let P of y.pages)x.pages&&!x.pages.has(P.index)||(S.push(P),v.has(P)||I.set(P.index,{page:P,rects:[]}));if(I.size>0){let P=chunkFDSL5OJU_cjs.Oe(y,g$(h),new Set(I.keys()),x.measurer);for(let E of P)I.get(E.pageIndex).rects.push(E);for(let{page:E,rects:R}of I.values())v.set(E,R);}let C=[];for(let P of S)for(let E of v.get(P))C.push(E);return h.activeIndex>=0&&C.sort((P,E)=>+(P.key===h.activeIndex)-+(E.key===h.activeIndex)),C}function f(h,y){let x=yL.get(y);if(x)return x;let v=h.createElement("div");return v.className="docx-text-highlight-set",v.setAttribute("data-highlight-set",y.name),y.color&&v.style.setProperty("--doc-text-highlight-set-color",y.color),y.activeColor&&v.style.setProperty("--doc-text-highlight-set-active-color",y.activeColor),yL.set(y,v),v}function p(){r+=1,e.surface()?.repaintHighlights();}function g(h){let y=e.surface();if(!y)return {applied:0,unavailable:h.ranges.length+h.overflow};let x=y.publishedLayout();gL(h,y,x);let v=x.revision!==y.session.packageRevision(),S=0;for(let I=0;I<h.ranges.length;I+=1)S+=v?h.resolved[I]:h.live[I];return {applied:S,unavailable:h.ranges.length-S+h.overflow}}return {members:{setHighlights(h,y,x){pL(h),Array.isArray(y)&&y.length>0&&e.flushOpen();let v=t.get(h),S=u$(h,y,x,v?.order??n,e.container());if(!v&&S.ranges.length>0&&t.size>=uL)throw new RangeError(`At most ${uL} highlight sets exist at once.`);if(S.ranges.length===0)return v&&(t.delete(h),p()),{applied:0,unavailable:0};v||(n+=1),t.set(h,S);let I=g(S);return p(),I},clearHighlights(h){if(h===void 0){if(t.size===0)return;t.clear();}else if(!t.delete(pL(h)))return;p();},getHighlightsAt(h,y){if(!Number.isFinite(h)||!Number.isFinite(y))return [];let x=i;if(!x?.isConnected||o.length===0)return [];let v=x.getBoundingClientRect(),S=h-v.left,I=y-v.top,C=[],P=new Set;for(let E=o.length-1;E>=0;E-=1){let R=o[E];if(S<R.left||S>=R.left+R.width||I<R.top||I>=R.top+R.height)continue;let w=`${R.set.name}\0${R.index}`;if(P.has(w)||t.get(R.set.name)!==R.set)continue;P.add(w);let M=v.left+R.left,O=v.top+R.top;C.push({name:R.set.name,index:R.index,range:R.set.ranges[R.index],start:R.set.starts[R.index],length:R.set.ends[R.index]-R.set.starts[R.index],active:R.index===R.set.activeIndex,rect:{x:M,y:O,left:M,top:O,width:R.width,height:R.height,right:M+R.width,bottom:O+R.height}});}return C}},frame:()=>{let h=e.surface();if(!l||!h)return l;let y=h.session.packageRevision();if(l.layout.revision===y)return l;let x=h.layout();return l.layout===x?l:{...l,layout:x,revision:y}},noteMatches(h){let y=e.surface();if(!y||mL.has(h))return h;let x=dL(y,h);mL.add(x);let v=xL(y);for(let S of x){let I=v(S.blockId);I!==null&&vL.set(S,I);let C=S.start+S.length;Jy.set(S,I!==null&&C<=I.length?I.slice(S.start,C):null);}return x},attach(h,y=false){a=null,l=null,y&&t.clear(),h?.setHighlightPainter(d);},reset(){t.size!==0&&(t.clear(),p());}}}var wL=new WeakMap;function kL(e){let t=wL.get(e);if(t)return t;let n=new Map,r=new Map,o=(s,l)=>{if(n.has(l))return;let c=r.get(s);c||(c=[],r.set(s,c)),n.set(l,{story:s,index:c.length}),c.push(l);},i=(s,l)=>{for(let c of chunkFDSL5OJU_cjs.Ba(l)){for(let d of c.lines)for(let u of chunkFDSL5OJU_cjs.Pa(d))o(s,u.paragraphId);c.lines.length===0&&o(s,c.paragraphId);}};for(let s of e.pages){i("body",s.fragments);for(let l of [s.header,s.footer])l&&i(`part:${l.partName}`,l.fragments);for(let l of [s.footnotes,s.endnotes])for(let c of l?.notes??[])i(`notes:${c.noteKind}`,c.fragments);}let a={positions:n,paragraphs:r};return wL.set(e,a),a}function v$(e,t,n,r){let o=(d,u,f)=>{if(f<=u)return;let p=r.get(d);p?p.push({key:t,start:u,end:f}):r.set(d,[{key:t,start:u,end:f}]);},{start:i,end:a}=e;if(i.paragraphId===a.paragraphId){o(i.paragraphId,i.offset,a.offset);return}let s=n.positions.get(i.paragraphId),l=n.positions.get(a.paragraphId);if(o(i.paragraphId,i.offset,Number.POSITIVE_INFINITY),o(a.paragraphId,0,a.offset),!s||!l||s.story!==l.story||l.index<=s.index)return;let c=n.paragraphs.get(s.story);for(let d=s.index+1;d<l.index;d+=1)o(c[d],0,Number.POSITIVE_INFINITY);}function x$(e,t){if(e.start.paragraphId===e.end.paragraphId)return e.end.offset-e.start.offset;let n=t.positions.get(e.start.paragraphId),r=t.positions.get(e.end.paragraphId);return !n||!r||n.story!==r.story?Number.MAX_SAFE_INTEGER:(r.index-n.index)*1e6+(e.end.offset-e.start.offset)}function S$(e){let t=e.item;return t.kind==="revision"?t.ranges:t.range?[t.range]:[]}var IL={comment:0,custom:1,revision:2};function RL(e,t){let n=new Map,r=[];return e.forEach((o,i)=>{for(let a of S$(o)){let s=r.length;r.push({placement:i,width:x$(a,t)}),v$(a,s,t,n);}}),{byParagraph:n,sources:r}}function PL(e,t){return !e.pages||e.pages.has(t.index)}function TL(e,t,n,r){let o=e.pageOffsetX?.get(n.index)??0,i=t.left+(n.contentBox.x+r.x+o)*e.scale,a=t.top+(n.contentBox.y+r.y)*e.scale,s=r.width*e.scale,l=r.height*e.scale;return {x:i,y:a,left:i,top:a,width:s,height:l,right:i+s,bottom:a+l}}function EL(e){function t(){let n=e.frame();return !n?.layer.isConnected||!(n.scale>0)?null:{frame:n,origin:n.layer.getBoundingClientRect()}}return {getReviewItemsAt(n,r,o){if(!Number.isFinite(n)||!Number.isFinite(r))return [];let i=t();if(!i)return [];let{frame:a,origin:s}=i,l=(n-s.left)/a.scale,c=(r-s.top)/a.scale,d=a.layout.pages.find(S=>{if(!PL(a,S))return false;let I=S.box.x+(a.pageOffsetX?.get(S.index)??0);return l>=I&&l<I+S.box.width&&c>=S.box.y&&c<S.box.y+S.box.height});if(!d)return [];let u=e.placements(o);if(u.length===0)return [];let f=kL(a.layout),{byParagraph:p,sources:g}=RL(u,f),b=l-(a.pageOffsetX?.get(d.index)??0)-d.contentBox.x,h=c-d.contentBox.y,y=new Map,x=chunkFDSL5OJU_cjs.Oe(Li(a.layout),p,new Set([d.index]),a.measurer);for(let S of x){if(b<S.x||b>=S.x+S.width||h<S.y||h>=S.y+S.height)continue;let I=g[S.key],C=y.get(I.placement);(!C||I.width<C.width)&&y.set(I.placement,{width:I.width,rect:S});}let v=[...y.entries()].map(([S,I])=>({at:S,...I}));return v.sort((S,I)=>{if(S.width!==I.width)return S.width-I.width;let C=u[S.at],P=u[I.at];if(C.kind!==P.kind)return IL[C.kind]-IL[P.kind];if(C.kind==="revision"&&P.kind==="revision"){let E=P.item.nesting-C.item.nesting;if(E!==0)return E}return S.at-I.at}),v.map(S=>({placement:u[S.at],rect:TL(a,s,d,S.rect)}))},getReviewItemRects(n){if(typeof n!="string"||n.length===0)return [];let r=t();if(!r)return [];let{frame:o,origin:i}=r,a=Mr(e.placements,n);if(!a)return [];let s=new Set(o.layout.pages.filter(c=>PL(o,c)).map(c=>c.index)),{byParagraph:l}=RL([a],kL(o.layout));return chunkFDSL5OJU_cjs.Oe(Li(o.layout),l,s,o.measurer).map(c=>TL(o,i,o.layout.pages[c.pageIndex],c))}}}var w$=new WeakMap,k$=new WeakMap;function I$(e,t){return e.anchorY===t.anchorY&&e.pageIndex===t.pageIndex&&e.activatable===t.activatable&&e.isActive===t.isActive&&e.locked===t.locked}function CL(e,t){let n=t.anchorY===null&&t.pageIndex===null?k$:w$,r=n.get(e);if(r&&I$(r.inputs,t))return r.placement;let o=R$(e,t);return n.set(e,{inputs:t,placement:o}),o}function R$(e,t){let n=UF(e),r={key:chunkZOZI27AW_cjs.Fj(e),id:e.id,...n!==void 0?{date:n}:{},activatable:t.activatable,anchorY:t.anchorY,pageIndex:t.pageIndex,isActive:t.isActive};return e.kind==="comment"?{...r,kind:"comment",author:e.comment.author,initials:chunkZOZI27AW_cjs._j(e.comment),text:chunkZOZI27AW_cjs.Yj(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:e.parentId}:{},...e.parentRevisionId!==void 0?{parentRevisionId:e.parentRevisionId}:{},replyIds:e.replyIds,readOnly:false,item:e}:e.kind==="revision"?{...r,kind:"revision",revisionKind:e.revisionKind,author:e.author,initials:SC(e.author),text:chunkZOZI27AW_cjs.pb(e.text),...e.replacedText?{replacedText:chunkZOZI27AW_cjs.pb(e.replacedText)}:{},replyIds:e.replyIds,readOnly:e.readOnly||t.locked,item:e}:{...r,kind:"custom",author:"",initials:"",text:e.detail??e.text,replyIds:[],readOnly:true,item:e}}function P$(e){return e==="password"?{ok:false,code:"locked",reason:OL}:e==="other-restriction"?{ok:false,code:"locked",reason:"this document declares a different editing restriction; open it in Word to change that"}:e==="no-change"?{ok:false,code:"invalidArgs",reason:"the document protection is already set"}:{ok:false,code:"unsupported",reason:"document protection could not be written"}}var OL="this document is protected with a password; open it in Word to change that";function ML(e){let t=null,n=null,r=()=>{let l=e.tracking();return [l.restrictedToReadOnly,l.restrictedToComments,l.restrictedToForms,l.restrictedToTrackedChanges].join("|")},o,i=null,a=()=>{let l=e.surface();if(!l)return null;let c=l.session.settingsRoot();return (c!==o||i===null)&&(o=c,i=c?chunkZOZI27AW_cjs.Zg(c):chunkZOZI27AW_cjs.Yg),i},s=()=>{if(e.destroyed())return {ok:false,code:"notFound",reason:"the editor was destroyed"};let l=a();return l===null?{ok:false,code:"notFound",reason:"no document is loaded"}:e.hostViewOnly()?{ok:false,code:"locked",reason:"this document was opened for viewing"}:l.enforced&&l.password?{ok:false,code:"locked",reason:OL}:!l.enforced&&l.edit!=="none"&&l.edit!=="forms"?{ok:false,code:"locked",reason:"this document declares a different editing restriction; open it in Word to change that"}:null};return {sync(){let l=e.surface()?.session.settingsRoot()??null;if(l===n&&t!==null)return;n=l;let c=r();c!==t&&(t=c,e.adopt(e.decision()));},prime:()=>{n=e.surface()?.session.settingsRoot()??null,t=r();},state:a,isActive:()=>a()?.enforced===true,can(l){return l.type!=="toggleDocumentProtection"?null:s()??{ok:true}},exec(l){if(l.type!=="toggleDocumentProtection")return null;let c=s();if(c&&!c.ok)return c;let d=e.surface(),u=!a().enforced,f=d.applyHeaderFooterLifecycle?.({op:"setDocumentProtection",enforce:u});return f?f.ok?(e.publish(),{ok:true,changed:true}):P$(f.reason):{ok:false,code:"unsupported",reason:"document protection is not available"}}}}function AL(e,t){return lm(e.revisionsIn,t)}function FL(e,t){let n=Fd(e);return {current:()=>n,set(r){if(!t.enabled)return {ok:false,code:"unsupported",reason:sn};let o;try{o=Fd(r,n);}catch(a){return {ok:false,code:"invalidArgs",reason:a.message}}if(o===n)return {ok:true,changed:false};let i=n;return n=o,t.changed(n,i),{ok:true,changed:false}},shows:r=>r.some(o=>AL(n,o)),opensOnLoad:r=>n.opening==="auto"&&r.some(o=>AL(n,o)),opensOnTrackedChange:()=>n.opening==="auto"&&n.revisionsIn==="pane",pairsReplacements:()=>n.revisionsIn==="balloons"}}var T$=e=>chunkFDSL5OJU_cjs.Aa(e);function DL(){let e=new WeakMap;return t=>{let n=e.get(t);if(n)return n;let r=chunk6NVZNB7O_cjs.ba(t,T$);for(let o of t.pages){for(let i of [o.header,o.footer])i&&LL(r,i.fragments,o.index,i.box.y);for(let i of [o.footnotes,o.endnotes])if(i)for(let a of i.notes)LL(r,a.fragments,o.index,a.box.y);}return e.set(t,r),r}}function LL(e,t,n,r){for(let o of chunkFDSL5OJU_cjs.Ba(t))for(let i of chunkFDSL5OJU_cjs.Sa(o))e.has(i)||e.set(i,{pageIndex:n,contentY:r,fragmentY:o.box.y,...o.lines?{lines:o.lines}:{}});}var eb=new WeakSet;function NL(e,t,n){if(eb.has(e))return;eb.add(e);let r=()=>{eb.delete(e),n();};typeof t.requestIdleCallback=="function"?t.requestIdleCallback(r,{timeout:1e3}):t.setTimeout(r,200);}var HL=new WeakMap;function BL(e){let t=HL.get(e);if(t)return t;let n=new Map;for(let r of e.pages)for(let o of [r.footnotes,r.endnotes])if(o)for(let i of o.notes)for(let a of chunkFDSL5OJU_cjs.Ba(i.fragments))for(let s of chunkFDSL5OJU_cjs.Sa(a))n.has(s)||n.set(s,i.scopeId);return HL.set(e,n),n}var _L=new WeakMap;function $L(e){let t=_L.get(e);if(t)return t;let n=new Map;for(let[r,o]of chunkFDSL5OJU_cjs.Ua(e).entries())n.set(o,r);return _L.set(e,n),n}var E$={"open.zip-corrupt":"damaged","open.zip-invalid-entry-name":"damaged","open.xml-malformed":"damaged","open.content-types-invalid":"damaged","open.relationships-invalid":"damaged","open.unsupported-source":"not-docx","open.missing-main-document":"not-docx","open.zip-entry-limit":"too-large","open.zip-size-limit":"too-large","open.zip-ratio-limit":"too-large","open.xml-part-size-limit":"too-large","open.xml-depth-limit":"too-large","open.xml-element-limit":"too-large","open.relationship-limit":"too-large","open.part-limit":"too-large","open.xml-dtd-forbidden":"blocked","open.invalid-limits":"unknown","open.failed":"unknown"};function tb(e){return Object.freeze({code:e,reason:E$[e]??"unknown"})}function qL(e){let t=null,n=null;return {get parseError(){return t},get failure(){return n},reject(r,o,i){t=i?`${r}: ${i}`:r,n=tb(chunk3IEXDEFH_cjs.t(r,o));},refuseSource(r,o=false){let i=OR(r);return o||(t=i,n=tb("open.unsupported-source"),e()),i},crash(){t="open failed",n=tb("open.failed"),e();},clear(){t=null,n=null;}}}function WL(e,t){if(e==="")return;let n=(t??globalThis).navigator?.clipboard;if(n?.writeText)try{n.writeText(e).catch(()=>{});}catch{}}function nb(e,t,n){if(e===""&&(t===null||t===""))return;let r=n??globalThis,o=r.navigator?.clipboard;if(!o)return;let i=r.ClipboardItem,a=r.Blob;if(t&&o.write&&i&&a)try{let s=new i({"text/plain":new a([e],{type:"text/plain"}),"text/html":new a([t],{type:"text/html"})});o.write([s]).catch(()=>{WL(e,n);});return}catch{}WL(e,n);}function C$(e){return typeof e=="object"&&e!==null&&"container"in e&&Array.isArray(e.path)}function O$(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function jL(e){return KL(e.children)}function KL(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||chunkZOZI27AW_cjs.Ub(n))&&t.push(n);return t}function M$(e){if(chunkZOZI27AW_cjs.Ub(e))return KL(chunkZOZI27AW_cjs.Xb(e));if(e.kind!=="table")return [];let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...jL(r));return t}function A$(e,t,n){let r=t.container,o=r.part==="body"?{kind:"body"}:r.part==="header"||r.part==="footer"?{kind:"headerFooter",rId:r.rId}:{kind:"notesPart",noteKind:r.part==="footnote"?"footnote":"endnote"},i=e.session.partFor(o);if(!i)return {ok:false,code:"notFound",reason:"the target story was not found"};let a="noteId"in r?r.noteId:null,s=r.part==="body"?chunkZOZI27AW_cjs.Uc(i):chunkZOZI27AW_cjs.Sc(i).find(p=>r.part==="header"||r.part==="footer"?p.kind===r.part:p.kind==="note"&&chunkZOZI27AW_cjs.Cc(p.root)===a)?.root;if(!s||s.kind==="textValue")return {ok:false,code:"notFound",reason:"the target story was not found"};if(t.path.length===0)return {ok:false,code:"invalidArgs",reason:"DocLocation path must not be empty"};let l=jL(s),c;for(let p=0;p<t.path.length;p+=1){let g=t.path[p];if(!Number.isInteger(g)||g<0)return {ok:false,code:"invalidArgs",reason:"DocLocation indices must be non-negative"};if(c=l[g],!c)return {ok:false,code:"notFound",reason:`block index ${g} is out of range`};p<t.path.length-1&&(l=M$(c));}if(!c||c.kind!=="paragraph"||!chunkZOZI27AW_cjs.Xa(i,c.id))return {ok:false,code:"invalidArgs",reason:"DocLocation must resolve to a paragraph"};let d=(chunkZOZI27AW_cjs.Tk(i,c.id)??"").length,u=t.offset??(n==="start"?0:d);if(!Number.isInteger(u)||u<0||u>d)return {ok:false,code:"invalidArgs",reason:"DocLocation offset is outside the paragraph"};let f={paragraphId:c.id,offset:u};return {ok:true,selection:{anchor:f,head:f}}}function Pf(e,t,n){if(C$(t))return A$(e,t,n);if(!qt(t))return {ok:false,code:"invalidArgs",reason:"unrecognized DocTarget endpoint"};let r=e.session.paragraphAnchors(),o=r.nodeByParaId.get(t.paraId.toUpperCase());if(!o)return {ok:false,code:"notFound",reason:"the paragraph was not found"};let i=Ct(e.session,o,{kind:"body"}),a=e.session.partFor(i);if(!a)return {ok:false,code:"notFound",reason:"the target story was not found"};let s=Cn(a,r,t);if(!s.ok)return s;let l=n==="start"?s.span.start:s.span.end,c={paragraphId:s.span.nodeId,offset:l};return {ok:true,selection:{anchor:c,head:c}}}function Tf(e,t){if(!O$(t)){let o=Pf(e,t,"start");if(!o.ok)return o;let i=Pf(e,t,"end");return i.ok?{ok:true,selection:{anchor:o.selection.anchor,head:i.selection.head}}:i}let n=Pf(e,t.from,"start");if(!n.ok)return n;let r=Pf(e,t.to,"end");return r.ok?{ok:true,selection:{anchor:n.selection.anchor,head:r.selection.head}}:r}function F$(e){return e.evenPage?"even":e.firstPage?"first":"default"}function VL(e){return e.variant!==void 0?e.variant==="default"||e.variant==="first"||e.variant==="even"?e.variant:{ok:false,reason:"variant must be 'default', 'first', or 'even'"}:F$(e)}function rb(e,t){let n=e.headerFooterState(),r=t.position??n?.editing??null;if(r!=="header"&&r!=="footer")return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"header/footer position is required when no furniture scope is open"}};let i=t.variant!==void 0||t.firstPage!==void 0||t.evenPage!==void 0?VL(t):n?.variant??"default";if(typeof i=="object"&&i.ok===false)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:i.reason}};let a=i,s=t.sectionIndex??n?.sectionIndex??0;return !Number.isInteger(s)||s<0?{ok:false,refusal:{ok:false,code:"invalidArgs",reason:"sectionIndex must be a non-negative integer"}}:{ok:true,sectionIndex:s,kind:r,variant:a}}function L$(e){let t=e??"rejected";return t==="first-section"||t.includes("first-section")?{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}:{ok:false,code:"invalidArgs",reason:`header/footer lifecycle refused: ${t}`}}function nc(e,t){if(typeof e.applyHeaderFooterLifecycle!="function")return {ok:false,code:"unsupported",reason:"header/footer lifecycle is not available"};let n=e.applyHeaderFooterLifecycle(t);return n.ok?{ok:true,changed:true}:L$(n.reason)}function Ef(e,t,n,r){let i=e.session.headerFooterResolutionBySection()[t];if(!i)return null;let s=(n==="header"?i.headers:i.footers).get(r);return s?{rId:s.rId,partName:s.partName,inherited:s.inherited,titlePage:i.titlePage,evenAndOddHeaders:i.evenAndOddHeaders}:null}function UL(e,t){if(typeof e.enterHeaderFooter!="function")return {ok:false,code:"unsupported",reason:"header/footer editing is not available"};let n=t.sectionIndex??0;if(!Number.isInteger(n)||n<0)return {ok:false,code:"invalidArgs",reason:"sectionIndex must be a non-negative integer"};let r=t.position,o=VL(t);if(typeof o=="object"&&o.ok===false)return {ok:false,code:"invalidArgs",reason:o.reason};let i=o,s=Ef(e,n,r,i)?.rId,l=false;if(!s){let d=nc(e,{op:"createHeaderFooter",sectionIndex:n,kind:r,variant:i,...i==="first"?{titlePage:true}:{},...i==="even"?{evenAndOddHeaders:true}:{}});if(!d.ok)return d;l=true,s=Ef(e,n,r,i)?.rId;}return s?e.enterHeaderFooter({rId:s,kind:r,sectionIndex:n,variant:i})?{ok:true,changed:l}:{ok:false,code:"invalidArgs",reason:"the header/footer relationship could not be opened"}:{ok:false,code:"notFound",reason:`no ${r} story is available to edit`}}function zL(e,t){let n=rb(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=r?.rId,i=nc(e,{op:"deleteHeaderFooter",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});return i.ok&&o&&r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant&&e.exitHeaderFooter(),i}function GL(e,t){let n=rb(e,t);if(!n.ok)return n.refusal;if(n.sectionIndex===0)return {ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"};let r=e.headerFooterState(),o=r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,i=nc(e,{op:"linkToPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!i.ok)return i;if(o){let a=Ef(e,n.sectionIndex,n.kind,n.variant);a?e.enterHeaderFooter({rId:a.rId,kind:n.kind,sectionIndex:n.sectionIndex}):e.exitHeaderFooter();}return i}function ZL(e,t){let n=rb(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=!!r&&r.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,i=r?.rId,a=nc(e,{op:"unlinkFromPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!a.ok)return a;let s=Ef(e,n.sectionIndex,n.kind,n.variant);return o&&s&&s.rId!==i&&e.enterHeaderFooter({rId:s.rId,kind:n.kind,sectionIndex:n.sectionIndex}),a}function XL(e,t){let n=e.headerFooterState(),r=t.sectionIndex??n?.sectionIndex;return nc(e,{op:"setSectionFurnitureOptions",...r!==void 0?{sectionIndex:r}:{},...t.titlePage!==void 0?{titlePage:t.titlePage}:{},...t.evenAndOddHeaders!==void 0?{evenAndOddHeaders:t.evenAndOddHeaders}:{},...t.headerDistanceTwips!==void 0?{headerDistanceTwips:t.headerDistanceTwips}:{},...t.footerDistanceTwips!==void 0?{footerDistanceTwips:t.footerDistanceTwips}:{}})}function YL(e,t){return e.activeScope().kind!=="headerFooter"?{ok:false,code:"unsupported",reason:"insertPageField requires an open header or footer scope"}:typeof e.insertPageField!="function"?{ok:false,code:"unsupported",reason:"page field insertion is not available"}:e.insertPageField(t.field)?{ok:true,changed:true}:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"page field insertion was refused"}}function QL(e,t){let n=e.activeScope();return n.kind==="headerFooter"?{ok:false,code:"invalidArgs",reason:"cannot insert a note reference inside a header or footer"}:n.kind==="note"?{ok:false,code:"invalidArgs",reason:"cannot insert a note reference inside another note"}:typeof e.insertNote!="function"?{ok:false,code:"unsupported",reason:"insertNote is not available"}:e.insertNote(t.noteKind)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"insertNote was refused"}}function JL(e,t){return typeof e.deleteNote!="function"?{ok:false,code:"unsupported",reason:"deleteNote is not available"}:e.deleteNote(t.noteKind,t.noteId)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"deleteNote was refused"}}function e1(e,t){return typeof e.convertNote!="function"?{ok:false,code:"unsupported",reason:"convertNote is not available"}:e.convertNote(t.fromKind,t.noteId)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"convertNote was refused"}}function t1(e,t){return typeof e.convertAllNotes!="function"?{ok:false,code:"unsupported",reason:"convertAllNotes is not available"}:e.convertAllNotes(t.fromKind)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"convertAllNotes was refused"}}function n1(e,t){if(typeof e.setNoteProperties!="function")return {ok:false,code:"unsupported",reason:"setNoteProperties is not available"};let n=t.scope??"document";return e.setNoteProperties({scope:n,sectionIndex:t.sectionIndex,footnote:t.footnote,endnote:t.endnote})?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"setNoteProperties was refused"}}function r1(e){return chunk2CWQY27B_cjs.b(e)?{ok:false,code:"unsupported",reason:e}:{ok:false,code:Uu(e)||e==="the table of contents is generated and read-only"||e===Mi?"invalidArgs":"locked",reason:e}}function s1(e,t,n){switch(t.type){case "toggleMark":{let r=xg.get(t.mark),o=e.toggleRunProperty(r.localName,r.attributes);if(o)return r1(o);break}case "setMarkAttr":{let r=Sg(t);if(!r.ok)return {ok:false,code:r.code,reason:r.reason};let o=e.setRunProperty(r.localName,r.attributes);if(o)return r1(o);break}case "clearFormatting":e.clearFormatting();break;case "copyFormatting":return e.formatPainter.capture()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:Xd};case "pasteFormatting":{let r=e.formatPainter.apply();if(r==="nothingToPaint")return {ok:false,code:"notFound",reason:eg};if(r==="refused")return {ok:false,code:"locked",reason:e.state().lastRejection??eg};break}case "setLineSpacing":e.setParagraphProperty("spacing",uf({rule:t.rule,value:t.value}),{mergeAttributes:true});break;case "setParagraphSpacing":e.setParagraphProperty("spacing",{...Va("before",t.beforePt),...Va("after",t.afterPt)},{mergeAttributes:true});break;case "setAlignment":e.setParagraphProperties([{localName:"jc",attributes:{val:t.align==="justify"?"both":t.align},physicalAlignment:true}]);break;case "setParagraphDirection":e.setParagraphProperties([{localName:"bidi",paragraphDirection:t.direction}]);break;case "setParagraphStyle":{if(!e.session.documentStyles().some(o=>o.type==="paragraph"&&o.styleId===t.styleId))return {ok:false,code:"invalidArgs",reason:`style '${t.styleId}' is not a paragraph style of this document`};e.setParagraphProperty("pStyle",{val:t.styleId});break}case "setIndent":{e.setIndent({...t.left!==void 0?{left:t.left}:{},...t.right!==void 0?{right:t.right}:{},...t.firstLine!==void 0?{firstLine:t.firstLine}:{}});break}case "setParagraphFormat":{if(!e.setParagraphFormat({...t.alignment!==void 0?{alignment:t.alignment==="justify"?"both":t.alignment}:{},...t.direction!==void 0?{direction:t.direction}:{},...t.spaceBeforePt!==void 0?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==void 0?{spaceAfterPt:t.spaceAfterPt}:{},...t.lineSpacing!==void 0?{lineSpacing:t.lineSpacing}:{},...t.indentLeftTwips!==void 0?{indentLeftTwips:t.indentLeftTwips}:{},...t.indentRightTwips!==void 0?{indentRightTwips:t.indentRightTwips}:{},...t.indentFirstLineTwips!==void 0?{indentFirstLineTwips:t.indentFirstLineTwips}:{},...t.contextualSpacing!==void 0?{contextualSpacing:t.contextualSpacing}:{},...t.keepNext!==void 0?{keepNext:t.keepNext}:{},...t.keepLines!==void 0?{keepLines:t.keepLines}:{},...t.widowControl!==void 0?{widowControl:t.widowControl}:{},...t.pageBreakBefore!==void 0?{pageBreakBefore:t.pageBreakBefore}:{},...t.tabStops!==void 0?{tabStops:t.tabStops}:{}}))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the paragraph format could not be written here"};break}case "setPageSetup":{let r;if(t.scope==="section"){let s=e.sectionAnchorParagraphAt(e.state().selection.head.paragraphId);if(s.kind==="unaddressable")return {ok:false,code:"unsupported",reason:"this section holds no paragraph to address it by"};r=s.kind==="anchor"?s.paragraphId:void 0;}let o=t.pageWidth,i=t.pageHeight;if(t.orientation!==void 0&&(o!==void 0||i!==void 0)){let s=r?e.sectionPropertiesAt(r):e.sectionProperties(),l=o??s.pageSize.widthTwips,c=i??s.pageSize.heightTwips;o=t.orientation==="landscape"?Math.max(l,c):Math.min(l,c),i=t.orientation==="landscape"?Math.min(l,c):Math.max(l,c);}if(!e.setSectionProperties({...o!==void 0?{pageWidthTwips:o}:{},...i!==void 0?{pageHeightTwips:i}:{},...t.orientation!==void 0?{orientation:t.orientation}:{},...t.marginTop!==void 0?{marginTopTwips:t.marginTop}:{},...t.marginRight!==void 0?{marginRightTwips:t.marginRight}:{},...t.marginBottom!==void 0?{marginBottomTwips:t.marginBottom}:{},...t.marginLeft!==void 0?{marginLeftTwips:t.marginLeft}:{},...r!==void 0?{anchorParagraphId:r}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the page setup change was refused"};break}case "toggleList":if(!e.toggleList(t.kind))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the list change was refused"};break;case "adjustIndent":if(!e.adjustIndent(t.direction))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the selection is already at that indent level"};break;case "insertBreak":if(t.kind==="section"||t.kind==="sectionContinuous"){let r=t.kind==="section"?"nextPage":"continuous";if(!e.insertSectionBreak(r))return {ok:false,code:"invalidArgs",reason:e.sectionBreakRefusal(r)??e.state().lastRejection??"the section break was refused"};break}if(t.kind==="page"){e.insertPageBreak();break}e.insertLineBreak();break;case "insertHyperlink":{let r=t.href.startsWith("#");if(!e.hyperlinks.applyHyperlink({...r?{anchor:t.href.slice(1)}:{url:t.href},...t.text!==void 0?{text:t.text}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the link was refused: the target is not an allowed scheme, or there is no text to link"};break}case "removeHyperlink":if(!e.hyperlinks.removeHyperlink())return {ok:false,code:"notFound",reason:"there is no hyperlink at the selection"};break;case "insertTextBox":return jI(e);case "insertText":if(e.type(t.text),e.state().lastRejection==="the table of contents is generated and read-only"||e.state().lastRejection===Mi)return {ok:false,code:"invalidArgs",reason:e.state().lastRejection};break;case "deleteText":if(On(e))return Wg(e,{type:"deleteImage"},n?.editor);e.deleteSelection();break;case "proposeInsertion":case "proposeDeletion":case "proposeReplacement":{if(t.target!==void 0){let i=Tf(e,t.target);if(!i.ok)return {ok:false,code:i.code,reason:i.reason};e.setSelection(i.selection);}let r=t.type==="proposeInsertion"?"insertion":t.type==="proposeDeletion"?"deletion":"replacement",o=t.type==="proposeInsertion"?t.text:t.type==="proposeReplacement"?t.replaceWith:"";if(!e.proposeTextChange(r,o,t.author))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??`${t.type} was refused`};break}case "replaceMatch":return IR(e,t);case "undo":e.undo();break;case "redo":e.redo();break;case "insertTable":if(!e.insertTable(t.rows,t.cols))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table could not be inserted here"};break;case "insertToc":if(!e.insertToc())return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be inserted"};break;case "editTextFormField":return e.editTextFormField()?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"field options are unavailable"};case "refreshToc":if(!e.refreshToc(t.tocId,t.mode))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be refreshed"};break;case "editHeaderFooter":return UL(e,t);case "exitHeaderFooter":return typeof e.exitHeaderFooter=="function"&&e.exitHeaderFooter(),{ok:true,changed:false};case "removeHeaderFooter":return zL(e,t);case "linkHeaderFooterToPrevious":return GL(e,t);case "unlinkHeaderFooterFromPrevious":return ZL(e,t);case "setHeaderFooterOptions":return XL(e,t);case "setWatermark":return xR(e,t.watermark);case "insertBookmark":case "deleteBookmark":case "keepFirstBookmark":case "goToBookmark":return yP(e,t);case "insertPageField":return YL(e,t);case "insertNote":return QL(e,t);case "deleteNote":return JL(e,t);case "convertNote":return e1(e,t);case "convertAllNotes":return t1(e,t);case "setNoteProperties":return n1(e,t);case "insertRow":case "deleteRow":case "insertColumn":case "deleteColumn":case "deleteTable":case "setCellFill":case "setTableCellVerticalAlignment":case "setTableBorders":case "commitTableColumnDividerResize":case "commitTableRightEdgeResize":case "mergeCells":case "splitCell":case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":{if(!Oo(t))return {ok:false,code:"unsupported",reason:"unsupported command"};let r=n?.admittedTablePlan??io({command:t,part:e.session.part(),layout:e.layout(),storeRevision:e.session.packageRevision(),selection:e.state().selection,cellSelection:e.state().cellSelection,themeColors:e.session.documentThemeColors(),editable:e.session.editable,viewing:e.editingMode()==="view"});return e.applyTableCommandPlan(r)}case "selectAll":return e.selectAll(),{ok:true,changed:false};case "copy":{let r=e.copyFlavours();return r.reason?{ok:false,code:"unsupported",reason:r.reason}:(nb(r.text,r.html,o1(n?.editor)),{ok:true,changed:false})}case "cut":{let r=e.copyFlavours();if(r.reason)return {ok:false,code:"unsupported",reason:r.reason};nb(r.text,r.html,o1(n?.editor)),e.deleteSelection();break}case "paste":{let r=t.html?xa(t.html):null;if(r&&Ju(r.bytes))return {ok:false,code:"unsupported",reason:"unsupported-content"};if(!e.pasteRich(t.text,t.html??null))return {ok:true,changed:false};break}case "pasteWithoutFormatting":e.insertPlainText(t.text);break;case "setSelection":{if("range"in t&&wg(t.range)){let a=a1(e,t.range);return a.ok?(e.setSelection(t.range),e.revealPosition(t.range.head,{block:"centerIfNeeded"}),{ok:true,changed:false}):a}let r="anchor"in t&&qt(t.anchor)?{anchor:t.anchor}:"range"in t&&ki(t.range)?{range:t.range}:null;if(r===null)return {ok:false,code:"unsupported",reason:"unsupported selection form"};let o=wR(e.session.part(),e.session.paragraphAnchors(),r);if(!o.ok)return o;let i=a1(e,o.selection);return i.ok?(e.setSelection(o.selection),e.revealPosition(o.selection.head,{block:"centerIfNeeded"}),{ok:true,changed:false}):i}default:return xl(t)?Wg(e,t,n?.editor):{ok:false,code:"unsupported",reason:"unsupported command"}}return null}function o1(e){return e?je(ro(e)):void 0}function i1(e,t){for(let n of e.layout().pages)for(let r of [n.footnotes,n.endnotes])if(r){for(let o of r.notes)for(let i of chunkFDSL5OJU_cjs.Ba(o.fragments))if(i.paragraphId===t)return o.scopeId}return null}function D$(e,t){let n=e.layout().pages;for(let r=0;r<n.length;r+=1){let o=n[r];for(let i of [o.header,o.footer])if(i){for(let a of chunkFDSL5OJU_cjs.Ba(i.fragments))if(a.paragraphId===t)return {pageIndex:r,sectionIndex:e.sectionAtPage(r).sectionIndex}}}return null}function N$(e,t){return e.kind!==t.kind?false:e.kind==="headerFooter"&&t.kind==="headerFooter"?e.rId===t.rId:e.kind==="notesPart"&&t.kind==="notesPart"?e.noteKind===t.noteKind:true}function a1(e,t){let n=Ct(e.session,t.head.paragraphId,{kind:"body"}),r=Ct(e.session,t.anchor.paragraphId,{kind:"body"});if(!N$(n,r))return {ok:false,code:"unsupported",reason:"a selection cannot span two stories"};let o=e.activeScope();if(n.kind==="body")return o.kind!=="body"&&(e.exitNote?.(),e.exitHeaderFooter?.()),{ok:true,changed:false};if(n.kind==="headerFooter"){if(o.kind==="headerFooter"&&o.rId===n.rId)return {ok:true,changed:false};e.exitNote?.();let l=D$(e,t.head.paragraphId);return e.enterHeaderFooter?.({rId:n.rId,...l?{pageIndex:l.pageIndex,sectionIndex:l.sectionIndex}:{}})?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that header or footer could not be opened"}}let i=i1(e,t.head.paragraphId);return i?(t.anchor.paragraphId===t.head.paragraphId?i:i1(e,t.anchor.paragraphId))!==i?{ok:false,code:"unsupported",reason:"a selection cannot span two stories"}:o.kind==="note"&&o.id===i?{ok:true,changed:false}:(e.exitHeaderFooter?.(),e.enterNote?.(i)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that note could not be opened"}):{ok:false,code:"notFound",reason:"that note is not laid out"}}var H$=new Set(["resolveAllReviewChanges","setReviewChangesAuthor","proposeInsertion","proposeDeletion","proposeReplacement","replaceMatch","toggleMark","setMarkAttr","setAlignment","setParagraphDirection","clearFormatting","setLineSpacing","setParagraphSpacing","setParagraphStyle","setParagraphFormat"]),_$=Object.freeze({ok:false,code:"unsupported",reason:"historyGroup must be an open handle from this editor and document; begin a new group after end(), detach, or load"}),ob=class{constructor(t,n,r){this.owner=t;this.diagnose=n;this.target=r;}owner;diagnose;target;records=new WeakMap;undoEpoch=0;burst;diagnoseWrites(t,n,r=false){if(t.type!=="setMarkAttr"||!n.ok||!n.changed)return;let o=`${r}:${t.mark}:${t.attr}:${this.target()}`,i=Date.now(),a=this.burst,s=a?.key===o&&i-a.time<=250?a.count+1:1;this.burst={key:o,time:i,count:s},s===3&&this.diagnose({kind:r?"possible-fragmented-gesture":"possible-ungrouped-gesture",reason:"Three rapid formatting writes started separate groups at the same selection. For a continuous control, retain one handle with bindHistoryGroup; separate clicks may be intentional."});}begin(){let t=this.owner(),n={token:Symbol("gesture"),owner:t?new WeakRef(t):void 0,closed:false,committed:false,undoEpoch:this.undoEpoch,lastOutcome:null},r=B$(n,new WeakRef(this));return this.records.set(r,n),r}owns(t){return t!==void 0&&t===this.owner()}validate(t){let n=t?.historyGroup;return n===void 0?null:this.token(n)===void 0?_$:null}token(t){let n=this.records.get(t);return n&&t.state==="open"?n.token:void 0}gate(t,n){let r=this.validate(n);return r||n?.historyGroup===void 0?r:H$.has(t.type)?null:{ok:false,code:"unsupported",reason:`${t.type} does not support history grouping`}}note(t){(t.type==="undo"||t.type==="redo")&&this.undoEpoch++;}run(t,n,r,o){let i=r?.historyGroup,a=i&&this.records.get(i);if(!a){let d=za(t,void 0,o);return n&&this.diagnoseWrites(n,d),d}let s,l=chunkZOZI27AW_cjs.Tl(a.token,(d,u)=>s={kind:d,reason:u},()=>za(t,a.token,o));if(!l.ok)return l;let c=this.settle(a,s);return c.kind==="started"&&n?this.diagnoseWrites(n,l,true):this.burst=void 0,{...l,history:c}}automationFrames(t){let n=this.token(t)===void 0?void 0:this.records.get(t);if(!n)return null;let r=[];return {bind:(o,i)=>{let a,s=chunkZOZI27AW_cjs.Tl(n.token,(l,c)=>a={kind:l,reason:c},()=>za(o,n.token,i));return a&&r.push(a),s},finish:()=>{if(r.length===0)return null;this.burst=void 0;let o=r.find((i,a)=>i.kind==="split"||a>0&&i.kind==="started");return this.settle(n,o?{kind:"split",reason:o.reason}:r[0])}}}settle(t,n){let r=n?.kind==="split"||n?.kind==="started"&&t.committed,o=n===void 0?{kind:"none",reason:"no-history"}:r?{kind:"split",reason:n.reason??(t.undoEpoch!==this.undoEpoch?"undo-redo":"history-boundary")}:{kind:n.kind};return n&&(t.committed=true,t.undoEpoch=this.undoEpoch),t.lastOutcome=o,o.kind==="split"&&this.diagnose({kind:"split",reason:o.reason??"history-boundary"}),o}};function B$(e,t){return Object.freeze({get state(){return !e.closed&&t.deref()?.owns(e.owner?.deref())?"open":"closed"},get lastOutcome(){return e.lastOutcome},end(){e.closed=true,e.owner=void 0;}})}function l1(e,t,n){let r={generation:-1,token:{}};return new ob(()=>{let{mounted:o,generation:i}=e();return o?(r.generation!==i&&(r={generation:i,token:{}}),r.token):null},t,n)}var c1={selection:null,pendingFormat:null,headerFooter:null,drawingIntent:"none",formatPainter:"off/none",collaborationStatus:"inactive"};function d1(e,t){let n=t.headerFooterState?.();return {selection:e.selection,pendingFormat:e.pendingFormat,headerFooter:n?.editing&&n.rId?`${n.editing}:${n.rId}`:null,drawingIntent:nP(t.drawingSelectionIntent()),formatPainter:`${e.formatPainter.mode}/${e.formatPainter.level}`,collaborationStatus:e.collaborationStatus}}function u1(){let e={...c1};return {moved(t,n){let r=d1(t,n),o=iu(r.selection,e.selection)&&r.pendingFormat===e.pendingFormat&&r.headerFooter===e.headerFooter&&r.drawingIntent===e.drawingIntent&&r.formatPainter===e.formatPainter&&r.collaborationStatus===e.collaborationStatus;return e=r,!o},adopt(t){e=d1(t.state(),t);},reset(){e={...c1};}}}var f1=512*1024;function $$(e,t){let n=e.byteLength;if(n<22)return false;let r=new DataView(e.buffer,e.byteOffset,n),o=Math.max(0,n-(64*1024+22)),i=-1;for(let c=n-22;c>=o;c-=1)if(r.getUint32(c,true)===101010256){i=c;break}if(i<0)return false;let a=r.getUint16(i+10,true),s=r.getUint32(i+16,true),l=0;for(let c=0;c<a;c+=1){if(s+46>n||r.getUint32(s,true)!==33639248)return false;if(l+=r.getUint32(s+24,true),l>=t)return true;s+=46+r.getUint16(s+28,true)+r.getUint16(s+30,true)+r.getUint16(s+32,true);}return false}var q$=2e3,W$=40;function p1(e){let t=null,n=()=>je(e.node?.()??null),r=()=>{if(!t)return null;let{bytes:o}=t;return t.cancel(),t=null,o};return {shouldYield:o=>typeof n().requestAnimationFrame=="function"&&typeof n().cancelAnimationFrame=="function"&&(o.byteLength>=f1||$$(o,f1)),schedule(o){let i=mt(()=>e.node?.()??null),a=null,s=null,l=e.prepare?()=>e.prepare(o):null,c=false,d=false,u=b=>{try{return b()}catch(h){throw t===g&&(t=null,e.scheduled()),h}},f=()=>{if(c)return;if(l){let h=l;l=null;let y;try{y=h();}catch{}if(typeof y=="function"){l=y,$l(f,n());return}if(!y){a=i.setTimeout(f,0);return}let x=true,v=()=>{x&&(x=false,a!==null&&i.clearTimeout(a),a=i.setTimeout(f,0));};a=i.setTimeout(v,q$),y.then(v,v);return}d=true,u(()=>e.mount(o));let b=()=>{if(c||t!==g)return;let h=!e.continueOpen||u(()=>e.continueOpen(W$));if(!(c||t!==g)){if(!h){$l(b,n());return}t=null,e.continueOpen&&e.scheduled();}};e.continueOpen?$l(b,n()):t===g&&(t=null,e.scheduled());},p=i.requestAnimationFrame(()=>{s!==null&&i.clearTimeout(s),s=null,a=i.setTimeout(f,0);});s=i.setTimeout(()=>{i.cancelAnimationFrame(p),f();},250);let g={bytes:o,mounted:()=>d,cancel:()=>{c=true,i.cancelAnimationFrame(p),a!==null&&i.clearTimeout(a),s!==null&&i.clearTimeout(s);}};t=g,e.scheduled();},cancel:r,flush(){let o=t;if(!o)return;let i=o.mounted();r();try{if(i||e.mount(o.bytes),e.continueOpen)for(;!e.continueOpen(Number.POSITIVE_INFINITY););}catch(a){throw e.scheduled(),a}i&&e.scheduled();},isScheduled:()=>t!==null}}var ab=40,ib=16,m1=32,sb=new WeakMap;function lb(e,t){let n=chunkZOZI27AW_cjs.pj(t.contentLockPolicy);return n?{...e,contentLockPolicy:n}:e}function j$(e,t,n){let r=chunkZOZI27AW_cjs.Ke(e),o=()=>{let i=performance.now()+ab;for(;;){let a=r.next();if(a.done){let s=chunk25EXMBV2_cjs.m(a.value,t);return sb.set(e,s),n(s)}if(performance.now()>=i)return o}};return o}function g1(e){let t=sb.get(e);return t===void 0?{}:(sb.delete(e),{openedSession:t,progressiveOpen:true})}function h1(e,t,n){return r=>j$(r,e(),o=>{let i=o.ok?t(r,o.session):null;return o.ok&&i?K$(o.session,i,n):void 0})}function y1(e){let t=null;return {set(n){t=n;let r=e();r&&kh(r,n);},adopt:n=>kh(n,t)}}function K$(e,t,n){let r=e.part().root.children.find(g=>g.kind==="body"),o=r?.kind==="body"?r.children:[],i=[];for(let g of o.slice(0,Ll)){if(g.kind==="table")for(let b of g.children)i.push(b);i.push(g);}let a=[];for(let g=0;g<o.length;){let b=o[g];if(b.kind==="table"){for(let x=0;x<b.children.length;x+=m1){let v=x;a.push(()=>{_F(e,b,v,v+m1);});}a.push(()=>Uy(e,[b])),g+=1;continue}let h=g;for(;h<o.length&&h-g<ib&&o[h].kind!=="table";)h+=1;let y=o.slice(g,h);a.push(()=>Uy(e,y)),g=h;}let s=0,l=0,c=false,d,u=chunkZOZI27AW_cjs.Ta(e.part().root),f=[()=>{let g=performance.now()+ab;return u(()=>performance.now()>=g)},()=>(e.reviewItems(),true)],p=()=>{if(!t())return;let g=performance.now()+ab;if(!c){for(;s<a.length&&performance.now()<g;)a[s++]();return s<a.length||(c=true,d=n()),p}if(l<i.length){for(;l<i.length&&performance.now()<g;)chunkFDSL5OJU_cjs.Re(i.slice(l,l+ib)),l+=ib;return p}let b=f[0];return b?(b()&&f.shift(),p):d};return p}function b1(e){return {...e.tableInteractionLabel?{tableInteractionLabel:e.tableInteractionLabel}:{},...e.imageDecodePort?{imageDecodePort:e.imageDecodePort}:{},...e.lockedControlNavigation==="atomic"?{lockedControlNavigation:"atomic"}:{}}}function v1(e){let t=[];return Object.assign(r=>{for(let o of [...e.customNodeDiagnostics,...t])try{o(r);}catch{}},{observe(r){t.push(r);}})}function x1(e,t){t.customNodePayloadNamespaces.length!==0&&e.session.sweepCustomNodePayloads(t.customNodePayloadNamespaces);}function S1(e){return e.kind==="comment"}function w1(e){let{surface:t}=e,n=t?.retainedSelection()??t?.state().selection??null;if(!n)return null;let{anchor:r,head:o}=n;if(r.paragraphId===o.paragraphId&&r.offset===o.offset||!t?.publishedLayout())return null;let i=e.bodyOrder(),a=i.get(r.paragraphId)??-1,s=i.get(o.paragraphId)??-1;if(a===-1||s===-1){let c=e.openStoryOrder();a=c.get(r.paragraphId)??-1,s=c.get(o.paragraphId)??-1;}return a===-1||s===-1?null:a<s||a===s&&r.offset<=o.offset?{from:r,to:o}:{from:o,to:r}}function U$(e){let t=new Map;for(let n of e){let r=n.item;if(!S1(r))continue;let o=t.get(r.id);if(o===void 0){t.set(r.id,r);continue}if(o.comment!==r.comment)return "ambiguous"}return t}function z$(e,t){let n=e.filter(i=>i.key===t);if(n.length===0)return {ok:false,code:"notFound",reason:"no review item with that key"};let r=n.map(i=>i.item).filter(S1);if(r.length===0)return {ok:false,code:"kindMismatch",reason:"the review item is not a comment"};let o=r[0];for(let i of r)if(i.comment!==o.comment)return {ok:false,code:"ambiguous",reason:"duplicate comment records share that key"};return o}function k1(e,t,n){if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:e.proReviewReason};if(e.editingMode==="viewing"){let u=e.surface?.commitReviewOps(()=>({committed:false,reason:"the document is open for viewing"}),"comment-resolve"),f="the document is open for viewing";return Gn(u??f,f,"locked")}let r=e.placements({pairReplacements:false}),o=z$(r,t);if(!("kind"in o))return o;if(!e.surface)return {ok:false,code:"notFound",reason:"no review item with that key"};let i=U$(r);if(i==="ambiguous")return {ok:false,code:"ambiguous",reason:"duplicate comment records share an id"};let a=o,s=new Set;for(;a.parentId!==void 0&&!s.has(a.id);){s.add(a.id);let u=i.get(a.parentId);if(!u)break;a=u;}let l=false,c=false,d=e.surface.commitReviewOps(u=>{let f=e.surface.session.packageRevision();return l=e.surface.session.setCommentResolved(a.id,n,{historyToken:u}),c=l&&e.surface.session.packageRevision()!==f,{committed:c}},"comment-resolve");return l?(c&&e.bump(),{ok:true,changed:c}):Gn(d,"the comment could not be resolved","notFound")}function I1(e,t,n){return e.kind==="comment"&&e.resolved?{ok:false,code:"unsupported",reason:"a resolved comment takes no replies"}:n.length===0||t.trim().length===0?{ok:false,code:"invalidArgs",reason:"a reply needs both an author and text"}:e.kind==="custom"?{ok:false,code:"unsupported",reason:"a custom node card takes no replies"}:null}var G$=Object.freeze({ok:false,code:"invalidArgs",reason:"pass the author as a string and options last, or options alone in place of the author"});function R1(e,t){if(e==null||typeof e=="string")return [e??void 0,t];let n=typeof e=="object"?Object.getPrototypeOf(e):void 0;return !(n===null||n!==void 0&&Object.getPrototypeOf(n)===null)||Array.isArray(e)||t!==void 0?G$:[void 0,e]}function P1(e){let t=(i,a)=>{let s=e.historyGroups.validate(i);if(s)return s;let l=e.surface();return l?e.historyGroups.run(l,void 0,i,a):a()},n=(i,a)=>{if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:sn};let s=e.surface();s?.flushPendingInput();let l=e.commentTargetRange();if(!l||!s)return {ok:false,code:"invalidArgs",reason:"a comment needs a selected range"};let c=(a??e.author()??"").trim();if(c.length===0||i.trim().length===0)return {ok:false,code:"invalidArgs",reason:"a comment needs both an author and text"};let d=null,u=s.commitReviewOps(f=>(d=s.session.replyToComment(null,{paragraphId:l.from.paragraphId,start:l.from.offset,end:l.to.offset,...l.to.paragraphId===l.from.paragraphId?{}:{endParagraphId:l.to.paragraphId}},i,c,chunk3IEXDEFH_cjs.c(),e.storyScopeOfParagraph(l.from.paragraphId),void 0,{historyToken:f}),{committed:d!==null}),"comment-add");return d===null?Gn(u,"the comment could not be committed"):{ok:true,changed:true}},r=i=>{if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:sn};let a=e.surface(),s=Mr(e.placements,i)?.item;if(!s||!a)return {ok:false,code:"notFound",reason:"no review item with that key"};if(s.kind==="revision")return e.resolveReviewItem(i,"reject");if(s.kind!=="comment")return {ok:false,code:"unsupported",reason:"a custom node card cannot be deleted"};let l=false,c=a.commitReviewOps(d=>{let u=e.noteHomeOf(s),f=u===null?null:chunkZOZI27AW_cjs.tc(u);return l=a.session.deleteComment(s.id,e.storyScopeOfReviewItem(s),f?.noteId,{historyToken:d}),{committed:l}},"comment-delete");return l?(e.bump(),{ok:true,changed:true}):Gn(c,"the comment could not be deleted")},o=(i,a,s)=>{if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:sn};let l=e.surface();l?.flushPendingInput();let c=Mr(e.placements,i)?.item,d=_a(c)?.insertion??c;if(!d||!l)return {ok:false,code:"notFound",reason:"no review item with that key"};let u=chunkZOZI27AW_cjs.Lj(d);if(!u)return {ok:false,code:"invalidArgs",reason:"the item has no anchorable range"};let f=(s??e.author()??"").trim(),p=I1(d,a,f);if(p)return p;let g=d.kind==="comment"?d.id:null,b=null,h=l.commitReviewOps(y=>(b=l.session.replyToComment(g,{paragraphId:u.start.paragraphId,start:u.start.offset,end:u.end.offset},a,f,chunk3IEXDEFH_cjs.c(),e.storyScopeOfReviewItem(d),void 0,{historyToken:y}),{committed:b!==null}),"comment-reply");return b===null?Gn(h,"the reply could not be committed"):{ok:true,changed:true}};return {addComment:(i,a,s)=>{let l=R1(a,s);if(!Array.isArray(l))return l;let[c,d]=l;return t(d,()=>n(i,c))},acceptReviewItem:(i,a)=>t(a,()=>e.resolveReviewItem(i,"accept")),rejectReviewItem:(i,a)=>t(a,()=>e.resolveReviewItem(i,"reject")),setCommentResolved:(i,a,s)=>t(s,()=>k1({reviewEnabled:e.reviewEnabled,editingMode:e.editingMode(),placements:e.placements,surface:e.surface(),proReviewReason:sn,bump:e.bump},i,a)),deleteReviewItem:(i,a)=>t(a,()=>r(i)),replyToReviewItem:(i,a,s,l)=>{let c=R1(s,l);if(!Array.isArray(c))return c;let[d,u]=c;return t(u,()=>o(i,a,d))}}}var cb=new WeakMap;function T1(e,t){cb.set(e,t);}function E1(e,t){return cb.get(e)?.automationFrames(t)??null}function C1(e,t){return cb.get(e)?.token(t)!==void 0}var Z$=Object.freeze(["Arial","Calibri","Cambria","Consolas","Courier New","Garamond","Georgia","Helvetica","Open Sans","Roboto","Times New Roman","Verdana"]),X$=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function O1(e,t){let n=new Map,r=s=>{if(s===void 0||!X$.test(s))return;let l=s.toLowerCase();n.has(l)||n.set(l,s);};r(chunkE4IAO4CY_cjs.g(e));let o=e?.substitutions??[],i=new Set(o.map(s=>s.to.family.toLowerCase()));for(let s of o)r(s.from.family);for(let s of e?.sources??[])i.has(s.request.family.toLowerCase())||r(s.request.family);for(let s of chunkE4IAO4CY_cjs.a([e?.supportedFamilies]))r(s);for(let s of Z$)r(s);for(let s of t)r(s);let a=[...n.values()];return a.sort((s,l)=>s<l?-1:s>l?1:0),a}var M1=e=>new chunkUKVVUHZL_cjs.a("overLimit",`font source ${e.id} exceeds the font byte budget`,{request:e.request}),A1=e=>new chunkUKVVUHZL_cjs.a(e.reason,e.reason==="overLimit"?"an embedded font exceeds the font byte budget":"an embedded font part declares an invalid family name",{request:e.request});function F1(e,t){return chunkE4IAO4CY_cjs.C(e,t)}function db(e,t,n){return chunkE4IAO4CY_cjs.D(e,t,n)}var L1=chunkFDSL5OJU_cjs.a;function hn(e,t){if(!e)throw new Error(t)}function D1(e){let t=0;for(let n=0;n<e.length;n+=4){let r=(e[n]||0)*16777216+(e[n+1]||0)*65536+(e[n+2]||0)*256+(e[n+3]||0)>>>0;t=t+r>>>0;}return t}function N1(e,t=0){hn(e instanceof Uint8Array&&e.length>=12&&e.length<=L1,"Unsupported font byte length"),hn(Number.isSafeInteger(t)&&t>=0,"Invalid face index");let n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=(S,I)=>{hn(Number.isSafeInteger(S)&&Number.isSafeInteger(I)&&S>=0&&I>=0&&S+I<=e.length,"Font range exceeds source");},o=S=>String.fromCharCode(...e.subarray(S,S+4));if(o(0)!=="ttcf")return hn(t===0,"Face index requires a collection"),hn([65536,1330926671,1953658213].includes(n.getUint32(0)),"Unsupported SFNT version"),e.slice();let i=n.getUint32(4);hn(i===65536||i===131072,"Unsupported TTC version");let a=n.getUint32(8);hn(a>0&&t<a,"Collection face absent"),r(12,a*4+(i===131072?12:0));let s=12+a*4+(i===131072?12:0),l=n.getUint32(12+t*4);r(l,12);let c=n.getUint32(l);hn([65536,1330926671,1953658213,1954115633].includes(c),"Unsupported face version");let d=n.getUint16(l+4);hn(d>0,"Missing face tables"),r(l,12+d*16),hn(l>=s,"Selected directory overlaps collection header");let u=[[0,s],[l,l+12+d*16]],f=[],p=new Set;for(let S=0;S<d;S++){let I=l+12+S*16,C=o(I),P=n.getUint32(I+8),E=n.getUint32(I+12);hn(/^[\x20-\x7e]{4}$/.test(C)&&!p.has(C),"Invalid or duplicate table tag"),p.add(C),r(P,E);for(let[R,w]of u)hn(E===0||P>=w||P+E<=R,"Table overlaps collection directory");f.push({name:C,offset:P,length:E,destination:0});}let g=f.filter(S=>S.length>0).sort((S,I)=>S.offset-I.offset);for(let S=1;S<g.length;S++)hn(g[S].offset>=g[S-1].offset+g[S-1].length,"Selected face tables overlap");let b=f.find(S=>S.name==="head");hn(b&&b.length>=54,"Missing or truncated head table"),f.sort((S,I)=>S.name<I.name?-1:S.name>I.name?1:0);let h=12+d*16;for(let S of f)S.destination=h,h+=S.length+3&-4,hn(h<=L1,"Standalone face exceeds byte ceiling");let y=new Uint8Array(h),x=new DataView(y.buffer);x.setUint32(0,c),x.setUint16(4,d);let v=2**Math.floor(Math.log2(d));x.setUint16(6,v*16),x.setUint16(8,Math.log2(v)),x.setUint16(10,d*16-v*16);for(let[S,I]of f.entries()){let C=12+S*16;for(let P=0;P<4;P++)y[C+P]=I.name.charCodeAt(P);y.set(e.subarray(I.offset,I.offset+I.length),I.destination),I.name==="head"&&x.setUint32(I.destination+8,0),x.setUint32(C+4,D1(y.subarray(I.destination,I.destination+I.length))),x.setUint32(C+8,I.destination),x.setUint32(C+12,I.length);}return x.setUint32(b.destination+8,2981146554-D1(y)>>>0),y}var H1=Object.freeze({installed:0,alias:()=>{},showIn(){},dispose(){}});function Y$(e){let t=0;for(let n of e)for(let r=0;r<n.length;r+=1)t=t*31+n.charCodeAt(r)>>>0;return `docx-embedded-${t.toString(36)}`}var Cf=e=>e.trim().toLowerCase();function Of(e){let t=e??(typeof globalThis.document<"u"?globalThis.document:void 0),n=t?.fonts,r=t?.defaultView?.FontFace;return !n||typeof r!="function"?{}:{fontSet:n,createFontFace:(o,i,a)=>new r(o,i.slice().buffer,a)}}async function _1(e,t=Of(),n=[]){let{fontSet:r,createFontFace:o}=t;if(!r||!o||e.length===0)return H1;let i=new Map;for(let f of e){let p=Cf(f.request.family),g=i.get(p);g?g.push(f):i.set(p,[f]);}let a=new Map,s=[],l=[],c=f=>{let p=f.bytes,g=p.length>=4&&p[0]===116&&p[1]===116&&p[2]===99&&p[3]===102;if(g&&f.faceIndex===0&&!chunkFDSL5OJU_cjs.l(p,0).valid)throw new Error("Invalid collection face");if(!g&&f.faceIndex!==0)throw new Error("Font face index requires a collection");return g&&f.faceIndex!==0?N1(p,f.faceIndex):p};if(await Promise.all([...i].map(async([f,p])=>{let g=Y$(p.map(h=>`${h.hash}:face:${h.faceIndex}`)),b=false;await Promise.all(p.map(async h=>{try{let y=c(h),x={weight:String(h.request.weight),style:h.request.style},v=o(g,y,x);await v.load(),r.add(v),s.push({set:r,face:v}),l.push({alias:g,source:h,descriptors:x}),b=!0;}catch{}})),b&&a.set(f,g);})),s.length===0)return H1;for(let f of n){let p=Cf(f.from.family);if(a.has(p))continue;let g=a.get(Cf(f.to.family));g!==void 0&&a.set(p,g);}let d=false,u=new WeakSet([r]);return {installed:s.length,alias:f=>d?void 0:a.get(Cf(f)),showIn(f){if(d)return;let p=Of(f);if(!(!p.fontSet||!p.createFontFace||u.has(p.fontSet))){u.add(p.fontSet);for(let{alias:g,source:b,descriptors:h}of l)try{let y=p.createFontFace(g,c(b),h);p.fontSet.add(y),s.push({set:p.fontSet,face:y}),y.load().catch(()=>{});}catch{}}},dispose(){if(!d){d=true;for(let{set:f,face:p}of s)try{f.delete(p);}catch{}}}}}function B1(e,t){let n=[];for(let r of e){let o=t.resolve(r.request);if(o instanceof chunkFDSL5OJU_cjs.d||o.id!==r.id)continue;let{id:i,hash:a,faceIndex:s}=o;n.push({request:r.request,id:i,get bytes(){return o.bytes},hash:a,faceIndex:s});}return n}var fb=44,rc=.1,oc=5;var Ja={type:"fit",fit:"pageWidth",minZoom:.5,maxZoom:1},Q$={type:"fit",fit:"pageWidth"},Mf={type:"fixed"};function Af(e){return e==="auto"?Ja:!e||typeof e!="object"?null:e.type==="fixed"?Mf:e.type==="fit"&&e.fit==="pageWidth"?Ff(e,Ja)?Ja:e:null}function Ff(e,t){return e===t?true:e.type!==t.type?false:e.type!=="fit"||t.type!=="fit"?true:e.fit===t.fit&&Object.is(e.minZoom,t.minZoom)&&Object.is(e.maxZoom,t.maxZoom)}function pb(e,t,n="float"){return e?.type!=="fit"?t:n==="shrinkPage"?e.minZoom!==void 0&&Number.isFinite(e.minZoom)?ub(e.minZoom):.1:e.maxZoom!==void 0&&e.maxZoom<5?e.maxZoom:null}function es(e){return e.type==="fit"}function $1({availableWidthPx:e,pageWidthPx:t,gutterPx:n=24,minZoom:r=.1,maxZoom:o=5}){if(!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0)return null;let i=Number.isFinite(n)&&n>0?n:0,a=Math.max(e-2*i,e*.5),s=Number.isFinite(r)?ub(r):.1,l=Number.isFinite(o)?ub(o):5,c=Math.floor(a/t*100)/100;return Math.min(Math.max(c,s),Math.max(l,s))}function ub(e){return Math.min(Math.max(e,.1),5)}var J$=88;function eq(e,t=false){let n=Ft(e);if(!n)return null;let r=n.clientWidth;if(!Number.isFinite(r)||r<=0)return null;let o=n.ownerDocument.defaultView?.getComputedStyle(n);if(t&&n.hasAttribute("data-review-pane")){let s=Number.parseFloat(o?.getPropertyValue("--docx-review-strip")??""),l=Number.isFinite(s)?s:J$,c=l/2,d=Number.parseFloat(o?.getPropertyValue("--docx-nav-shift")??""),u=Number.parseFloat(o?.getPropertyValue("--docx-review-gutter-start")??""),f=(Number.isFinite(d)?d:0)+(Number.isFinite(u)?u:c)-c;return Math.max(r-l-Math.max(f,0),0)}if(!o)return r;let i=Number.parseFloat(o.paddingLeft)||0,a=Number.parseFloat(o.paddingRight)||0;return Math.max(r-i-a,0)}function q1(e){let t=null,n=null,r=mt(()=>n),o=null,i=null;function a(){o!==null&&(r.cancelAnimationFrame(o),o=null);}function s(){let c=e.mode();if(!es(c))return;let d=e.container();if(!d)return;let u=e.reviewPaneScrolls?.()===true&&pb(c,e.zoom())!==null,f=eq(d,u);if(f===null)return;let p=e.pageWidthPx();if(p===null)return;i=e.pageWidthTwips();let g=$1({availableWidthPx:f,pageWidthPx:p,...c.minZoom!==void 0?{minZoom:c.minZoom}:{},...c.maxZoom!==void 0?{maxZoom:c.maxZoom}:{}});if(g===null||g===e.zoom())return;let b=Ft(d),h=b!==null&&b.scrollLeft===0;e.applyZoom(g),h&&b&&b.scrollLeft!==0&&(b.scrollLeft=0);}function l(){if(!n||typeof je(n).requestAnimationFrame!="function"){s();return}r.migrate(),o===null&&(o=r.requestAnimationFrame(()=>{o=null,s();}));}return {refitIfPageResized(){let c=e.pageWidthTwips();c===null||c===i||s();},attach(){this.detach();let c=e.container();if(!c)return;let d=Ft(c);if(!d)return;n=d;let u=je(d);typeof u.ResizeObserver=="function"&&(t=new u.ResizeObserver(l),t.observe(d)),s();},refit:s,detach(){a(),t?.disconnect(),t=null,n=null,i=null;}}}function j1(e,t){let n=e.zoom!==void 0&&Number.isFinite(e.zoom)&&e.zoom>=.1&&e.zoom<=5?e.zoom:null,r=n??1,o=Af(e.zoomMode??(n!==null?Mf:"auto"))??Ja;function i(l,c){if(l===r)return c?.(),true;let d=t.surface();return d&&!xh(d,l*(96/72))?false:(r=l,c?.(),t.bump(),t.emitSelectionChange(),true)}function a(){o=Mf,s.detach();}let s=q1({container:t.container,mode:()=>o,pageWidthPx:()=>{let l=t.surface()?.layout().pages[0]?.box;return l?l.width*(96/72):null},pageWidthTwips:()=>t.surface()?.sectionProperties().pageSize.widthTwips??null,zoom:()=>r,applyZoom:l=>{i(l);},reviewPaneScrolls:()=>t.reviewPaneScrolls?.()===true});return {zoom:()=>r,mode:()=>o,scale:()=>r*(96/72),attach:()=>{es(o)&&s.attach();},detach:()=>s.detach(),refit:()=>s.refit(),refitIfPageResized:()=>s.refitIfPageResized(),setZoom(l){if(!Number.isFinite(l)||l<.1||l>5)return {ok:false,code:"invalidArgs",reason:`zoom must be between ${.1} and ${5}, got ${l}`};let c=es(o);return l===r?c?(a(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:true,changed:false}:i(l,c?a:void 0)?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:`the mounted surface could not apply zoom ${l}`}},setZoomMode(l){let c=Af(l);return c?Ff(c,o)?{ok:true,changed:false}:(o=c,es(c)?s.attach():s.detach(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:false,code:"invalidArgs",reason:`unknown zoom mode ${JSON.stringify(l)}`}}}}function W1(e){let t=1.3333333333333333;return {x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t}}function K1(e,t){return {getZoom:()=>e.zoom(),setZoom:n=>e.setZoom(n),getZoomMode:()=>e.mode(),setZoomMode:n=>e.setZoomMode(n),getRenderScale:()=>e.scale(),getPageGeometry:()=>{let n=t();return n?n.layout().pages.map(r=>({index:r.index,box:W1(r.box),contentBox:W1(r.contentBox)})):[]}}}var V1=new Map;function U1(e){let t=e,n=null,r=null;return {current:()=>t,set:o=>{t=o;},authorsFor:o=>{if(n&&n.slots===o&&n.colors===t)return n.value;let i=chunkZGTIE3QJ_cjs.e(o,t);return n={slots:o,colors:t,value:i},i},styleFor:o=>((!r||r.colors!==t)&&(r={colors:t,value:chunkZGTIE3QJ_cjs.d(t)}),r.value.get(o))}}function z1(e){let t=chunkZOZI27AW_cjs.cj(e),n=new Intl.Locale(t).baseName;for(;n&&!Object.hasOwn(i18n.locales,n);){let s=n.lastIndexOf("-");n=s<0?"":n.slice(0,s);}let r=new Intl.Locale(t).maximize(),o=n?void 0:Object.keys(i18n.locales).find(s=>{let l=new Intl.Locale(s).maximize();return l.language===r.language&&l.script===r.script}),i=n||o||"en",a=i18n.createT(i18n.deepMerge(i18n.en,i==="en"?void 0:i18n.locales[i]),i);return {locale:t,labels:{title:a("toolbar.tableOfContents")}}}function G1(e){let t=e.mode,n=e.translate,r=n?chunkZGTIE3QJ_cjs.o(n):chunkZGTIE3QJ_cjs.n,o=z1(e.locale);return {mode:()=>t,modeForGate:()=>t??"edit",openingModeDecision:i=>Tg(t,i),setMode(i){return t===i?false:(t=i,true)},translate:()=>n,drawingStrings:()=>r,setTranslate(i){if(n===i)return null;n=i;let a=i?chunkZGTIE3QJ_cjs.o(i):chunkZGTIE3QJ_cjs.n;return chunkZGTIE3QJ_cjs.m(r)===chunkZGTIE3QJ_cjs.m(a)?(r=a,null):(r=a,r)},locale:()=>o.locale,tocLabels:()=>o.labels,setLocale(i){let a=z1(i);return o.locale===a.locale?null:(o=a,o.labels)}}}function Z1(e,t){return {setTranslate(n){let r=e.setTranslate(n);t.surface()?.setTranslate(e.translate()),r!==null&&(t.surface()?.setDrawingStrings(r),t.bump(),t.emitSelectionChange());},setLocale(n){let r=e.setLocale(n);r!==null&&(t.surface()?.setLocale(e.locale()),t.surface()?.setTocLabels(r),t.bump(),t.emitSelectionChange());}}}var oq=Object.freeze({kind:"body"}),iq=Object.freeze([]);function aq(e){let t=bw(e.fontShaping),n,r=null,o=null,i=null,a=-1,s=()=>i!==null,l=G1(e),c=Bh(e.author),d=e.container??null,u=chunkV3N4SOAK_cjs.a(e.modules),f=v1(u),p=u.review!==null,g=FL(u.review?.pane,{enabled:p,changed:(A,Q)=>{xe&&A.revisionsIn!==Q.revisionsIn&&!g.shows(L?.session.reviewItems()??[])&&(xe=false),Oe(),He(),zt.refit();}}),b=null,h=new WeakMap,y=p1({mount:A=>Ki(A),prepare:h1(()=>lb(zy(u,f),e),(A,Q)=>r===A?null:(i=Q,()=>i===Q),()=>Ae.schedule(true)),scheduled:()=>{Oe(),He();},node:()=>d}),x=l.mode()==="view"?"viewing":"editing",v=null,S,I=false,C=LE(g.pairsReplacements,()=>L),P=zu(),E=U1(e.revisionStyles),R=chunkZGTIE3QJ_cjs.g(),w=false,M=false,O=null,B=()=>({reviewEnabled:p,hasAuthor:!!c}),q=false,j=null,z=FR({stillMissing:()=>!K&&c===void 0&&ve(null)===Er,emit:A=>Nr(A)}),_=l.openingModeDecision(B());_.mode!==null&&(x=_.mode),_.rejection!==null&&(O=_.rejection),z.report(_.rejection);let L=null,X=sT(e.unsupportedElementRules,()=>L),te=null,me=y1(()=>L),se=qL(()=>{Oe(),He();}),D=null,T=u1(),W,$=ZF({surface:()=>L,destroyed:()=>K,changed:()=>(Oe(),He()),emitError:A=>Nr(A),capability:A=>GF(A,K,p,zi)}),K=false,Y,re,N=null,U=()=>{},G=0;function ee(){N?.dispose(),N=null;}let de=0,oe=0,ce=WF(),he=e.fonts,Ce,ct=()=>typeof he=="function"?Ce:he,Ae=qF(()=>{let A=i??L?.session;if(K||!A)return null;let Q=i?void 0:dn().formatting?.fontFamily;return {generation:ce.generation,dynamic:typeof he=="function",families:()=>$F(A,Q,chunkE4IAO4CY_cjs.g(ct()))}},async A=>{let Q=i?{session:i}:L;Q&&await sc(de,Q,A);}),Ie=false,Re=null,dt=A=>(Re||(Re=MF(d?Ho(d.ownerDocument):null)),Re(A)),Nt=new Set,we=new Set,De=A=>Nt.has(A.toLowerCase())||N?.alias(A)!==void 0,Rt=()=>!L||Ie?iq:FF(L.session.renderedFontFamilies(),De,dt,we),Pt=0,Zn=null,Dr,ji=null,Ke=-1,Ne=0,ut=-1,xe=false,Xn=e.reviewDisplayMode??(p?"all-markup":"proposed");if(!["all-markup","simple-markup","proposed","original"].includes(Xn))throw new TypeError("Invalid reviewDisplayMode");if(e.reviewDisplayMode&&e.reviewDisplayMode!=="proposed"&&!p)throw new TypeError("reviewDisplayMode requires a review module");let Wo=Gu({fieldResults:e.fieldResults,collaborationModel:u.collaboration??void 0}),ze=ML({surface:()=>L,destroyed:()=>K,editingMode:()=>x,hostViewOnly:()=>l.mode()==="view",publish:()=>{Oe(),He();},decision:()=>Yn(),tracking:zo,adopt:A=>{O=A.rejection??ve(null),A.mode!==null&&(M=A.mode==="viewing",Kt(A.mode)),Oe(),He();}});function Oe(){Pt+=1;}let ln=$A(dn,()=>d?.ownerDocument??null),{emitError:Nr,emitDocumentChange:ft,emitSelectionChange:He}=ln,it=eF({modules:u,events:ln,customNodes:f,onOpenCrash:se.crash}),jo=()=>x==="suggesting",vn=rF(e.revisionMarkup,{container:()=>d,destroyed:()=>K,contribution:()=>u.review,translate:()=>l.translate(),apply:A=>{L?.setRevisionMarkup(A),Oe();},changed:A=>{He(),ln.emitRevisionMarkupChange(A);}});function ts(A){vn.destroyDialog(),N?.showIn(A),zt.detach(),zt.attach(),Oe(),He();}let Hr=()=>{};function cn(){Hr(),vn.destroyDialog(),D?.(),D=null,L?.destroy(),L=null,T.reset(),Ne+=1;}let zt=j1(e,{container:()=>d,surface:()=>L,bump:Oe,emitSelectionChange:He,reviewPaneScrolls:()=>g.current().overflow==="scroll"}),Ko=()=>zt.scale(),fo=SL({surface:()=>L,container:()=>d,flushOpen:()=>y.flush()});function Ki(...A){let Q=n?.source!==void 0;try{if(r===A[0]){r=null,Gt(A[0],{immediate:!0,continueDeferredRefresh:!0});return}rs(...A),Q&&L&&dr(L)?o=A[0]:n?.mounted(A[0]);}catch(ne){if(it.openCrashed(ne),n?.mounted(A[0],ne),!Q)throw ne}}function ns(){return {unsupportedElementRules:X.current(),scale:Ko(),...$.snapshot(),defaultFontFamily:chunkE4IAO4CY_cjs.g(ct()),translate:l.translate(),drawingStrings:l.drawingStrings(),locale:l.locale(),...c?{author:c}:{},...E.current()!==void 0?{revisionStyles:E.current()}:{},reviewAuthorSlots:R,revisionAuthorVisibility:P,revisionMarkup:vn.current(),...lb(zy(u,f),e),pairsReplacements:C.lightsPair,...Y?{measurer:Y,...re?{producer:re}:{}}:{},...N?{fontAlias:N.alias}:{},...b1(e),...Wo.mode==="editable"?{fieldResults:Wo.mode}:{}}}function rs(A,Q,ne){if(ne??=h.get(A),h.delete(A),i=null,!d){cn(),b=A,ne&&h.set(A,ne),se.clear(),it.openDeferred(),Oe();return}it.openMounting(),cn();let Le=P.stateKey,be=Jl(d,A,{...ns(),...$.surfaceOptions(),initialSelection:Q,initialTextFormInput:ne,editingMode:x==="suggesting"?"suggest":x==="viewing"?"view":"edit",revisionDisplayMode:p?Xn:"proposed",...it.surfaceHooks(jo,()=>L),...g1(A),...u.collaboration?{collaborationModel:u.collaboration}:{},onHostMoved:ts,onTrackedChange:()=>{xe||!g.opensOnTrackedChange()||(xe=true,Oe(),He());},tocLabels:l.tocLabels(),onChange:Ge=>{if(!L)return;Oe(),ze.sync(),Ae.schedule();let Xe=L?.session.packageRevision(),Pe=Xe!==W;if(W=Xe,p&&d&&L&&!Pe){let rn=L;NL(rn,je(d),()=>{L===rn&&rn.session.reviewItems().length>0&&os(rn.publishedLayout());});}let _e=p&&Xn!==L.revisionDisplayMode();_e&&(Xn=L.revisionDisplayMode());let bt=Le!==P.stateKey||_e;Le=P.stateKey,!(!bt&&!T.moved(Ge,L))&&He();}});if(!be.ok){se.reject(be.reason,be.limit,be.detail),Oe(),Nr(en(be.reason,`failed to open document: ${be.reason}`)),it.openRejected(be.reason,be.limit,be.detail);return}se.clear(),L=be.surface,N?.showIn(d.ownerDocument),a=de,fo.attach(L,n?.source!==void 0),ze.prime(),xe=p&&g.opensOnLoad(L.session.reviewItems()),T.adopt(L),j!==null?Go(j,false):po(),x1(L,u);let Ye=L;dr(Ye)?QF(Ye,JF({current:()=>L,view:()=>je(d),slice:Ge=>it.continueOpen(Ge),settled:()=>it.openSettled(Ye)},{take:()=>[o,o=null][0],crashed:Ge=>it.openCrashed(Ge),mounted:(Ge,Xe)=>n?.mounted(Ge,Xe)})):it.openSettled(Ye),Ne+=1,L.setEditable(x!=="viewing"),te!==null&&L.setRemoteCaretLabelHost(te),me.adopt(L),v!==null&&L.setReviewActivationExclusions(v,{formattingKinds:S}),D=XF(be.surface,{refitIfPageResized:()=>zt.refitIfPageResized(),bump:Oe,emit:ft}),n?.contentMounted(A),zt.attach(),Oe(),ft({revision:L.session.packageRevision(),source:n?.source??"load"}),He(),Ae.schedule(true);}function Gt(A,Q={}){let ne=Q.immediate??false;if(Q.continueDeferredRefresh||(oe+=1),ne||(y.cancel(),o=null),se.clear(),i=null,r=null,n?.source&&!ne&&d&&y.shouldYield(A)){r=A,y.schedule(A);return}h=new WeakMap,it.openStarted(A),xe=false,de+=1;let Le=ce.advance();try{R=chunkZGTIE3QJ_cjs.g(),P.showAll(),Vo(),d&&!n?.source&&NC(d),!ne&&d&&y.shouldYield(A)?(cn(),y.schedule(A)):Ki(A);}finally{Le.cancelPrevious();}}function Vo(){Y=void 0,re=void 0,Ce=void 0,Nt=new Set,we=new Set,ee(),U(),U=()=>{},Ie=false;}function Vi(){if(Vo(),L){let A=chunk6NVZNB7O_cjs.X(Ko(),{context:d?Ho(d.ownerDocument):null}),Q=`${A.producer}+fonts:${++G}`,ne=chunkE4IAO4CY_cjs.g(ct()),Le={measurer:A.measurer,producer:Q,defaultFontFamily:ne};wh(L,{...Le,fontAlias:void 0},false);}Oe(),He();}function ac(A,Q=de,ne=ce.generation){tF(A,{config:e,events:ln,diagnostics:it},()=>!K&&Q===de&&ne===ce.generation);}async function sc(A,Q,ne){let Le=ce.capture(),be=()=>!K&&A===de&&Le.current(),Ye=Pe=>ac(Pe,A,Le.generation),Ge=he,Xe=Q.session.embeddedFonts();if(!(!Ge&&Xe.length===0)){Ie=true,Oe();try{let{plan:Pe,request:_e}=chunkE4IAO4CY_cjs.y(Q.session,ne,ct()),bt={..._e,signal:Le.signal},Fe=!!d&&Ho(d.ownerDocument)!==null?chunkE4IAO4CY_cjs.B(Pe.fallbacks,dt):Pe.fallbacks,nt=typeof Ge!="function"?Ge:Ce?await chunkE4IAO4CY_cjs.n([Ce,chunkE4IAO4CY_cjs.j(gt=>Ge(gt))],bt,{onOriginFailure:({cause:gt})=>Ye(ba(gt))}):await Ge(bt),Je=typeof Ge=="function"?chunkE4IAO4CY_cjs.b(nt):nt;if(!be()){A===de&&Le.current()&&(Ie=!1);return}if(Ce=nt,Xe.length===0&&(!Je||nt?.supportedFamilies?.length&&!chunkE4IAO4CY_cjs.b(nt))){Ie=!1,Oe(),He();return}let Ot=(Je&&"maxFontBytes"in Je?Je.maxFontBytes:void 0)??chunkFDSL5OJU_cjs.a,An=F1(Je?.sources??[],Ot),Fn=An.sources;for(let gt of An.dropped)Ye(M1(gt));let mr=db(Xe,Fn,Ot),Xo=!1,ls=()=>{if(!Xo){Xo=!0;for(let gt of mr.dropped)Ye(A1(gt));}},wt=chunkE4IAO4CY_cjs.z(chunkE4IAO4CY_cjs.f({epoch:A,...Je,sources:Fn},mr),Pe,Fe);if(wt.sources.length===0){ls(),Ie=!1,Oe(),Je&&Ye(new chunkUKVVUHZL_cjs.a("missing","the supplied font configuration contains no usable sources; the fixed measurer stays in effect"));return}let Ht=await il(wt,void 0,t),Ln=()=>be()?!1:(chunk6NVZNB7O_cjs.u(Ht),A===de&&Le.current()&&(Ie=!1),!0);if(Ln())return;let Xt=gt=>{ls(),gt&&chunk6NVZNB7O_cjs.u(gt),Ie=!1,Oe();},dc=(gt,gr)=>{let hr=new Set;for(let Qo of gr.sources??[]){let Jn=gt.fonts.resolve(Qo.request);Jn instanceof chunkFDSL5OJU_cjs.d&&(Ye(ba(Jn)),hr.add(chunkFDSL5OJU_cjs.h(Qo.request)));}return hr},cs=dc(Ht,wt);try{if(cs.size>0){let gt=Fn.filter(go=>!cs.has(chunkFDSL5OJU_cjs.h(go.request))),gr=gt.length!==Fn.length;gr&&(mr=db(Xe,gt,Ot));let hr=mr.sources.filter(go=>gr||!cs.has(chunkFDSL5OJU_cjs.h(go.request))),Qo=Ht;if(wt=chunkE4IAO4CY_cjs.z(chunkE4IAO4CY_cjs.f({epoch:A,...Je,sources:gt},{sources:hr}),Pe,Fe),wt.sources.length===0)return Xt(Qo);if(Ht=await il(wt,void 0,t),chunk6NVZNB7O_cjs.u(Qo),Ln())return;let Jn=dc(Ht,wt);if(Jn.size>0){let go=gt.filter(Jo=>!Jn.has(chunkFDSL5OJU_cjs.h(Jo.request))),uc=mr.sources.filter(Jo=>!Jn.has(chunkFDSL5OJU_cjs.h(Jo.request))),Xi=Ht;if(wt=chunkE4IAO4CY_cjs.z(chunkE4IAO4CY_cjs.f({epoch:A,...Je,sources:go},{sources:uc}),Pe,Fe),wt.sources.length===0)return Xt(Xi);if(Ht=await il(wt,void 0,t),chunk6NVZNB7O_cjs.u(Xi),Ln())return}}}finally{ls();}let Zi=B1(wt.sources,Ht.fonts),Yo=await _1(Zi,Of(d?.ownerDocument),wt.substitutions??[]);if(!be()){Yo.dispose(),Ln();return}let at={embeddedFaces:N,coveredFontFamilies:Nt,documentSubstitutedFamilies:we,shapedMeasurer:Y,shapedProducer:re,disposeShapedFonts:U};try{N=Yo,d&&Yo.showIn(d.ownerDocument),Nt=LF(Zi,wt.substitutions??[]),we=chunkE4IAO4CY_cjs.w(wt,Pe,Ht.fonts);let gt=chunk6NVZNB7O_cjs.X(Ko(),{context:d?Ho(d.ownerDocument):null,...N?{fontAlias:N.alias}:{}}),gr=CF(Ht,wt,gt,Ko(),++G,hr=>be()&&Ye(hr));if(Y=gr.measurer,re=gr.producer,Ie=!1,L&&a===A&&wh(L,{measurer:Y,producer:re,fontAlias:N?.alias,defaultFontFamily:chunkE4IAO4CY_cjs.g(ct())}),!be()){Yo.dispose(),chunk6NVZNB7O_cjs.u(Ht);return}}catch(gt){throw be()&&({embeddedFaces:N,coveredFontFamilies:Nt,documentSubstitutedFamilies:we,shapedMeasurer:Y,shapedProducer:re,disposeShapedFonts:U}=at),Yo.dispose(),chunk6NVZNB7O_cjs.u(Ht),gt}U=()=>chunk6NVZNB7O_cjs.u(Ht),at.disposeShapedFonts(),at.embeddedFaces?.dispose(),Oe(),He();}catch(Pe){if(!be())return;Ie=false,Oe(),Ye(ba(Pe));}}}let Lf=bg();function lc(){let A=L?.state()??null;return {scope:L?.activeScope?.()??oq,isLoading:se.parseError===null&&L===null&&b===null&&!y.isScheduled(),isOpening:y.isScheduled()&&!n?.source,parseError:se.parseError,openFailure:se.failure,editable:L!==null&&L.session.editable&&l.mode()!=="view"&&x!=="viewing"&&!(d&&cr(d)),zoom:zt.zoom(),zoomMode:zt.mode(),selection:uu(L),selectionCollapsed:A===null||A.selection.anchor.paragraphId===A.selection.head.paragraphId&&A.selection.anchor.offset===A.selection.head.offset,formatting:bP(L),table:pu(L),tocContext:Lf(A?.contextTocId??null),image:Cr(L),page:{current:Xg(L),total:Ca(L)},canUndo:A?.canUndo??false,canRedo:A?.canRedo??false,pageSetup:vP(y,L),reviewPaneOpen:xe,reviewPane:g.current(),...$.snapshot(),documentProtection:ze.state(),revisionMarkup:vn.current(),reviewDisplayMode:L&&p?L.revisionDisplayMode():Xn,hasReviewContent:L?.session.hasReviewContent()??false,hiddenReviewAuthors:P.hiddenAuthorList,collaborationStatus:A?.collaborationStatus??"inactive",editingMode:x,lastRejection:O??A?.lastRejection??null,fontSubstitutions:Rt(),formatPainter:A?.formatPainter??Yd}}let Mn;function dn(){if(Zn&&ut===Pt)return Zn;let A=Zn,Q=ct()===Mn;Mn=ct();let ne=$.chromeSettled(),Le=c===Dr&&ne;Dr=c;let be=L?.state().selection??null,Ye=iu(be,ji);ji=be;let Ge=L?.session.packageRevision()??-1,Xe=Ge===Ke;Ke=Ge;let Pe=lc(),_e=Pe;if(A){let bt=mg(Pe.formatting,A.formatting)?A.formatting:Pe.formatting,rn=gg(Pe.page,A.page)?A.page:Pe.page,Fe=hg(Pe.pageSetup??null,A.pageSetup??null)?A.pageSetup:Pe.pageSetup,nt=yg(Pe.selection,A.selection)?A.selection:Pe.selection,Je=aP(Pe.image,A.image)?A.image:Pe.image,Ot=A.fontSubstitutions!==void 0&&Pe.fontSubstitutions!==void 0&&A.fontSubstitutions.length===Pe.fontSubstitutions.length&&Pe.fontSubstitutions.every((An,Fn)=>A.fontSubstitutions[Fn]===An)?A.fontSubstitutions:Pe.fontSubstitutions;_e={...Pe,formatting:bt,page:rn,pageSetup:Fe,selection:nt,image:Je,fontSubstitutions:Ot},vg(_e,A)&&Ye&&Xe&&Le&&Q&&(_e=A);}return Zn=ou(_e),ut=Pt,Zn}if(e.document){let A=kg(e.document);A?Gt(A):(Nr(en("unsupported",se.refuseSource(e.document))),it.openRejected("unsupported"));}let Df=EC({surface:()=>L,activeKey:Sn,paneOpen:()=>xe,selectionAnchor:()=>ss()?.anchorY??null,authorFilterKey:()=>P.stateKey});function tn(A){return chunkZOZI27AW_cjs.Lj(A)===null||A.kind==="custom"&&!A.carded?false:!(A.kind==="revision"&&v!==null&&v.includes(A.revisionKind)&&(A.revisionKind!=="format"||S===void 0||S.includes(A.formattingKind??"")))}let os=DL();function xn(A){let Q=chunkZOZI27AW_cjs.Lj(A)?.partName;if(!Q||!L||Q===L.session.part().name)return null;for(let ne of L.session.headerFooterResolutionBySection())for(let Le of ["header","footer"]){let be=Le==="header"?ne.headers:ne.footers;for(let Ye of be.values())if(Ye.partName===Q)return {kind:Le,rId:Ye.rId}}return null}function jt(A){let Q=chunkZOZI27AW_cjs.Lj(A),ne=L?.publishedLayout();return !Q||!ne?null:BL(ne).get(Q.start.paragraphId)??null}function Uo(A){let Q=chunkZOZI27AW_cjs.Lj(A)?.partName;if(!Q||!L)return null;for(let ne of ["footnote","endnote"])if(chunkZOZI27AW_cjs.qh(L.session.currentPackage(),ne)?.name===Q)return {kind:"notesPart",noteKind:ne};return null}function St(A){let Q=xn(A);return Q!==null?{kind:"headerFooter",rId:Q.rId}:Uo(A)??{kind:"body"}}function is(){return w1({surface:L,bodyOrder:()=>{let A=L?.publishedLayout();return A?$L(A):new Map},openStoryOrder:cc})}function as(){let A=L?.activeScope();if(A?.kind==="headerFooter")return {kind:"headerFooter",rId:A.rId};if(A?.kind==="note"){let Q=chunkZOZI27AW_cjs.tc(A.id);if(Q)return {kind:"notesPart",noteKind:Q.noteKind}}return {kind:"body"}}function Zt(A){if(!L)return {kind:"body"};let Q=A.slice(0,A.indexOf("#"));if(Q.length===0||Q===L.session.part().name)return {kind:"body"};for(let ne of L.session.headerFooterResolutionBySection())for(let Le of [ne.headers,ne.footers])for(let be of Le.values())if(be.partName===Q)return {kind:"headerFooter",rId:be.rId};for(let ne of ["footnote","endnote"])if(chunkZOZI27AW_cjs.qh(L.session.currentPackage(),ne)?.name===Q)return {kind:"notesPart",noteKind:ne};return as()}function cc(){if(!L)return new Map;let A=as();if(A.kind==="body")return new Map;let Q=new Map;for(let[ne,Le]of L.session.paragraphIdsIn(A).entries())Q.set(Le,ne);return Q}function Ui(A){if(A.kind==="revision"){let ne=A.ranges;if(ne.length===0)return null;let be=A.revisionKind==="replace"||A.revisionKind==="insert"||A.revisionKind==="delete"?ne[ne.length-1]:ne[0];return {start:ne[0].start,end:be.end}}let Q=chunkZOZI27AW_cjs.Lj(A);return Q?{start:Q.start,end:Q.end}:null}function ss(){if(L&&L.activatedReviewKey()!==null)return null;let A=is(),Q=L?.publishedLayout();if(!A||!Q)return null;let ne=os(Q).get(A.from.paragraphId);return ne?{pageIndex:ne.pageIndex,anchorY:ne.contentY+chunk6NVZNB7O_cjs.aa(ne,A.from.paragraphId,A.from.offset)}:null}function Sn(){return L?.activeReviewKey()??null}let _r=new WeakMap;function wn(A){if(!p)return [];let Q=P.filterItems(L?.session.reviewItems()??[]),ne=FE(Q,A),Le=A?.placement!==false,be=null;if(Le&&ne.length>0){let Fe=L?.publishedLayout()??null;Fe&&(be=os(Fe));}let Ye=Lu(()=>Q,Sn(),C.lightsPair()),Ge=Fe=>{let nt=xn(Fe);return nt===null?1:nt.kind==="header"?0:2},Xe=L?.session.packageRevision()??-1,Pe=_r.get(ne);if(!Pe||Pe.anchors!==be||Pe.revision!==Xe){let Fe=ne.map(Je=>be?chunk6NVZNB7O_cjs.ca(Je,be):null),nt=ne.map((Je,Ot)=>({position:Ot,pageIndex:Fe[Ot]?.pageIndex??null,group:Ge(Je)}));nt.sort((Je,Ot)=>{let An=Je.pageIndex??Number.MAX_SAFE_INTEGER,Fn=Ot.pageIndex??Number.MAX_SAFE_INTEGER;return An!==Fn?An-Fn:Je.group!==Ot.group?Je.group-Ot.group:Je.position-Ot.position}),Pe={anchors:be,revision:Xe,geometries:Fe,order:nt.map(Je=>Je.position)},_r.set(ne,Pe);}let{geometries:_e,order:bt}=Pe,rn=jR(L);return bt.map(Fe=>{let nt=ne[Fe];return CL(nt,{anchorY:_e[Fe]?.y??null,pageIndex:_e[Fe]?.pageIndex??null,activatable:Fu(nt).every(tn),isActive:Ye.size>0&&Fu(nt).some(Je=>Ye.has(chunkZOZI27AW_cjs.Fj(Je))),locked:rn})})}function zo(){return L?.session.trackingSettings()??chunkZOZI27AW_cjs.xi}function Yn(A=x,Q=w){let ne=zo();return Eg({...B(),viewOnly:l.mode()==="view",hostChoseMode:l.mode()!==void 0,readerChoseMode:Q,currentMode:A,trackRevisions:ne.trackRevisions,restrictedToTrackedChanges:ne.restrictedToTrackedChanges,restrictedToForms:ne.restrictedToForms,restrictedToReadOnly:ne.restrictedToReadOnly,restrictedToComments:ne.restrictedToComments,engineAdoptedViewing:M})}function Kt(A){j=null,x=A,L?.setEditingMode(A==="suggesting"?"suggest":A==="viewing"?"view":"edit"),L?.setEditable(A!=="viewing");}function ve(A){return A!==null?A:x==="suggesting"&&c===void 0?Er:q?Er:w?null:l.openingModeDecision(B()).rejection}function po(){let A=Yn();O=ve(A.rejection),A.mode!==null&&(M=A.mode==="viewing",Kt(A.mode));}function Go(A="editing",Q=true){if(y.isScheduled()){j=A;return}j=null;let ne=HR(l.mode(),B(),zo(),x,A,M);M=ne.mode==="viewing"&&l.mode()!=="view",ne.mode!==x&&Kt(ne.mode),O=ve(ne.rejection),z.report(ne.configurationRejection),Q&&(Oe(),He());}function zi(A){let Q=l.mode()==="view";return NR(Q,B,zo,A)}let Zo=VF({surface:()=>L,enabled:()=>p,destroyed:()=>K,viewing:()=>x==="viewing",placements:wn,authorVisibility:P,scope:St,reveal:A=>ln.emitReviewItemReveal(Th(wn,A)),activate:(A,Q)=>{I=Q??false;try{return nn.setActiveReviewItem(A,{announce:!1})}finally{I=false;}},setDisplayMode:A=>{Xn=A,L?.setRevisionDisplayMode(A),Oe(),He();},report:{diagnostics:it,tracked:()=>x==="suggesting"}}),{resolveReviewItem:mo}=Zo,Qn=l1(()=>({mounted:!!L&&!!d,generation:Ne}),ln.emitHistoryDiagnostic,()=>JSON.stringify(L?.state().selection)),Gi=P1({reviewEnabled:p,historyGroups:Qn,surface:()=>L,author:()=>c,editingMode:()=>x,commentTargetRange:is,storyScopeOfParagraph:Zt,storyScopeOfReviewItem:St,noteHomeOf:jt,placements:wn,resolveReviewItem:mo,bump:Oe}),nn={beginHistoryGroup(){return y.flush(),Qn.begin()},get mountGeneration(){return Ne},get surface(){return L},...$.popupChrome.setters,stateVersion:()=>Pt,fontMeasurement:()=>({measurer:Y&&!s()?"shaped":"fixed",resolving:Ie||s(),...Y&&re&&!s()?{producer:re}:{}}),async setFonts(A){if(K)throw en("destroyed","a destroyed editor cannot replace fonts");let Q=++oe;if(y.flush(),L?.flushPendingInput(),K||Q!==oe)return;let ne=ce.advance(),Le=()=>!K&&ne.current();try{he=A,Ce=void 0,Ie=!1,A||Vi();}finally{ne.cancelPrevious();}let be=U;Le()&&await Ae.schedule(true),A&&Le()&&U===be&&Vi();},attach(A,Q){let ne=SI(A);if(ne)return Nr(en("invalidTarget",ne));if(d!==A&&n?.invalidate(),K){Nr(en("destroyed","this editor was destroyed; create a new instance to remount"));return}if(L&&d===A)return L.moveTo(A,Q);let Le=y.cancel();if(Le&&(cn(),b=Le),zt.detach(),d=A,Re=null,L){Hr(),L.moveTo(A,Q),Ne+=1,ts(A.ownerDocument);return}let be=b;b=null,be&&y.shouldYield(be)?y.schedule(be):be?Ki(be):Oe();},detach(){if(n?.invalidate(),K)return;zt.detach();let A=y.cancel();A?(cn(),b=A):L&&(vn.destroyDialog(),Hr(),L.park(),Ne+=1),d=null,Re=null,Oe(),He();},load(A){let Q=kg(A);if(!Q){let ne=L!==null||b!==null||y.isScheduled();Nr(en("unsupported",se.refuseSource(A,ne))),it.openRejected("unsupported");return}n?.invalidate(),fo.reset(),Gt(Q);},save(){return y.flush(),iC(L,L?.hostElement()??d,()=>L)},getDocumentHandle(){return Object.freeze({revision:L?.session.packageRevision()??0})},exec(A,Q){if(d&&cr(d)&&!vh(d,A))return {ok:false,code:"unsupported",reason:Na(d)};if(y.flush(),A.type==="openRevisionMarkupDialog")return vn.open();let ne=$.dialog(A,true);if(ne)return ne;let Le=Qn.gate(A,Q);if(Le)return Le;Qn.note(A);let be=$.capability(A);if(K&&be&&!be.ok)return be;if(A.type==="setEditingMode"){let Fe=zi(A.mode);return Fe!==null?(Fe.reason===Er&&(q=true,O=Fe.reason,z.report(Fe.reason),Oe(),He()),Fe):(w=true,q=false,O=null,Kt(A.mode),Oe(),He(),{ok:true,changed:false})}let Ye=$.toggle(A);if(Ye)return Ye;if(A.type==="toggleReviewPane")return p?(xe=!xe,Oe(),He(),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:sn};let Ge=ze.exec(A);if(Ge)return Ge;let Xe=L&&(A.type==="resolveAllReviewChanges"||A.type==="setReviewChangesAuthor")?Qn.run(L,A,Q,()=>Zo.exec(A)):Zo.exec(A);if(Xe)return Xe;if(qy(A))return hF(A,L,Wy(x),Q);let Pe=Ii(A);if(x==="viewing"&&Pe.supported&&Pe.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let _e=kl(A,L,l.modeForGate(),Q);if(!_e.ok)return _e.refusal;let bt=L,rn=bt.session.packageRevision();return Qn.run(bt,A,Q,()=>{let Fe=s1(bt,A,{..._e.tablePlan?{admittedTablePlan:_e.tablePlan}:{},editor:nn});return Fe||{ok:true,changed:bt.session.packageRevision()!==rn}})},can(A,Q){if(d&&cr(d)&&!vh(d,A))return {ok:false,code:"unsupported",reason:Na(d)};if(A.type==="openRevisionMarkupDialog")return vn.canOpen();let ne=$.dialog(A,false);if(ne)return ne;let Le=Qn.gate(A,Q);if(Le)return Le;if(A.type==="insertImage"||A.type==="replaceImage"){if(K)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(Q?.scope){let _e=kl(A,L,l.modeForGate(),Q);if(!_e.ok)return _e.refusal}return uP(A,L)}let be=$.capability(A);if(be)return be;let Ye=ze.can(A);if(Ye)return Ye;let Ge=Zo.can(A);if(Ge)return Ge;if(qy(A))return jy(A,L,Wy(x),Q);let Xe=Ii(A);if(x==="viewing"&&Xe.supported&&Xe.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let Pe=kl(A,L,l.modeForGate(),Q);if(!Pe.ok)return Pe.refusal;if(A.type==="replaceMatch"){let _e=pg(L,A.match);if(_e)return _e}if(A.type==="proposeInsertion"||A.type==="proposeDeletion"||A.type==="proposeReplacement"){if(!(A.author??c??"").trim())return {ok:false,code:"invalidArgs",reason:`${A.type} requires a non-empty author`};let bt=A.target===void 0?{ok:true,selection:L.state().selection}:Tf(L,A.target);if(!bt.ok)return bt;let{anchor:rn,head:Fe}=bt.selection,nt=rn.paragraphId===Fe.paragraphId&&rn.offset===Fe.offset,Je=A.type==="proposeReplacement"&&A.target===void 0&&L.state().cellSelection!==null;if(A.type!=="proposeInsertion"&&nt&&!Je)return {ok:false,code:"invalidArgs",reason:`${A.type} needs a non-collapsed selection`}}if(xl(A)&&_g(A)){let _e=Sl(nn);if(_e){let bt=Bg(nn,A,_e);if(bt)return bt}}return {ok:true}},isActive(A){let Q=$.isActive(A);return Q!==null?Q:A.type==="toggleDocumentProtection"?ze.isActive():A.type==="setReviewDisplayMode"?Xn===A.mode:A.type==="toggleReviewPane"?xe:A.type==="setEditingMode"?x===A.mode:eL(A,L?dn().formatting:null,ne=>L?.isListActive(ne)??false)},getDocumentStyles:()=>L?.session.documentStyles()??[],getDocumentFonts:()=>L?.session.documentFonts()??[],getAvailableFonts:()=>O1(ct(),L?.session.documentFonts()??[]),getDocumentThemeColors:()=>L?.session.documentThemeColors()??[],getOutline:()=>L?.session.documentOutline()??[],getComments:()=>[],getSelectionFormatting:()=>PP(L?dn().formatting:null),findMatches:((A,Q)=>oL(L,x,fo.noteMatches,A,Q)),selectMatch(A){return y.flush(),L?rL(L,A):{ok:false,code:"notFound",reason:"no document is loaded"}},getSelectedImage:()=>dn().image,getSelectedTable:()=>IP(L),getTableCellSelection:()=>{let A=L?.state().cellSelection;return A?{tableId:A.tableId,rows:A.rows,columns:A.columns,cellIds:A.cellIds}:null},setTableInteractionLabel(A){L?.setTableInteractionLabel(A);},canExecuteImageCommand(A,Q){if(K)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(Q?.scope){let ne=kl(A,L,l.modeForGate(),Q);if(!ne.ok)return ne.refusal}return qg(A,L)},executeImageCommand(A){return K?Promise.resolve({ok:false,code:"notFound",reason:"the editor was destroyed"}):jg(nn,A)},getPageSetup:()=>Zg(L),getWatermark:()=>ru(L),getTrackedChanges:()=>(L?.session.reviewItems()??[]).filter(A=>A.kind==="revision").map(A=>{let Q=xn(A);return {id:A.id,kind:A.kind==="revision"?A.revisionKind:"revision",...A.kind==="revision"&&A.author?{author:A.author}:{},story:Q!==null?Q.kind:Uo(A)?.noteKind??"body"}}),getReviewItems:A=>wn(A),getCustomNodeDefinitions:()=>u.customNodes,reportCustomNodeDiagnostic:f,...Gi,getSelectionPlacement:()=>ss(),isReviewPaneOpen:()=>xe,getEditingMode:()=>x,getReviewAuthors:()=>E.authorsFor(L?.revisionAuthors()??V1),...OC(P,{enabled:p,surface:()=>L,notify:()=>{Oe(),He();}}),setTrackedChangesFilter(A,Q){if(L)return L.setTrackedChangesFilter(A,Q);P.setPredicate(A,Q)&&(Oe(),He());},getConfiguredAuthor:()=>c??null,setAuthor(A){let Q=Bh(A);if(c!==Q){if(c=Q,L?.setAuthor(c),c!==void 0&&q){q=false;let ne=LR(zi("suggesting"));if(ne.enter)w=true,Kt("suggesting");else {O=ne.rejection,Oe(),He();return}}else if(!w){let ne=j??x;Go(l.mode()===void 0?ne:"editing");return}O=ve(null),z.report(O),Oe(),He();}},setMode(A){l.setMode(A)&&(w=false,q=false,Go());},...Z1(l,{surface:()=>L,bump:Oe,emitSelectionChange:He}),presenceColorFor:A=>L?.remotePresenceColor(A)??"var(--doc-accent)",collaborationSession:()=>L?.collaborationSession()??null,getReviewAuthorStyle:A=>E.styleFor(A),setOpeningIndicatorHost:me.set,setRemoteCaretLabelHost(A){te=A,L?.setRemoteCaretLabelHost(A);},setReviewPaneOptions:g.set,setRevisionMarkup:vn.set,setRevisionMarkupChrome:vn.register,setUnsupportedElementRules:X.set,setRevisionStyles(A){E.set(A),L?.setRevisionStyles(A),Oe(),He();},setEditingMode:A=>nn.exec({type:"setEditingMode",mode:A}),getReviewRevision:()=>Df(),getActivatedReviewItemKey:A=>Ph(wn,L?.activatedReviewKey()??null,A),setActiveReviewItem(A,Q){if(A===null)return L?.dismissActiveReview(),Oe(),He(),{ok:true,changed:false};if(!L)return {ok:false,code:"notFound",reason:"no document is open"};L.flushPendingInput();let ne=Mr(wn,A)?.item;if(!ne)return {ok:false,code:"notFound",reason:"no review item with that key"};let Le=_a(ne),be=C.set(Le?chunkZOZI27AW_cjs.Fj(Le.deletion):null)??A,Ye=chunkZOZI27AW_cjs.Lj(ne);if(!Ye)return {ok:false,code:"unsupported",reason:"this review item has no resolvable range"};if(!Fu(ne).every(tn)&&!(I&&ne.kind==="revision"&&ne.revisionKind==="format"))return {ok:false,code:"unsupported",reason:KF(ne)};let Ge=ne?xn(ne):null,Xe=Ge===null&&ne?jt(ne):null;if(Ge!==null||Xe!==null){let Pe=Ge!==null?{kind:"headerFooter",rId:Ge.rId,furnitureKind:Ge.kind}:{kind:"note",id:Xe},_e=kf(L,Pe,Ye.start);if(!_e.ok)return _e}else {L.exitNote?.(),L.exitHeaderFooter?.();let Pe=Ui(ne)??Ye,_e={paragraphId:Pe.start.paragraphId,offset:Pe.start.offset};L.activateReview(be,{anchor:_e,head:_e},{allowExcluded:I,preventScroll:true});let bt=Q?.reveal??"centerIfNeeded";bt!==false&&L.revealPosition?.(Pe.start,{block:bt});}return (Ge!==null||Xe!==null)&&L.activateReview(be,void 0,{allowExcluded:I}),Oe(),He(),Q?.announce===true&&ln.emitReviewItemReveal(Th(wn,{key:A,source:"host"})),{ok:true,changed:false}},setReviewActivationExclusions(A,Q){v=A===null?null:[...A],S=Q?.formattingKinds?[...Q.formattingKinds]:void 0,L?.setReviewActivationExclusions(v,{formattingKinds:S});},getHeaderFooterState:()=>L?.headerFooterState()??null,getNotePropertiesState:()=>L?.notePropertiesState?.()??null,getNotePreviewText:A=>L?.notePreviewText?.(A)??null,setActiveScope(A){L?.setActiveScope(A)&&Oe();},getActiveScope:()=>L?.activeScope()??{kind:"body"},query:A=>bF(L,()=>dn().formatting,A),snapshot:()=>dn(),getTotalPages:()=>Ca(L),getCurrentPage:A=>Xg(L,A),...iL(()=>L,()=>y.flush(),()=>d),...cL(()=>nn,()=>n,()=>y.flush()),...K1(zt,()=>L),...fo.members,...EL({frame:fo.frame,placements:wn}),relayout(A){A?.sync,L?.layout();},retainSelection:()=>d?L?.retainSelection()??null:null,releaseSelection:A=>L?.releaseSelection(A),focus(A){return y.flush(),L?A&&A.kind==="all"?{ok:false,code:"invalidTarget",reason:"the all scope cannot take focus"}:A&&!L.setActiveScope(A)?{ok:false,code:"invalidTarget",reason:"that scope cannot be opened"}:(L.focus(),{ok:true,value:void 0}):{ok:false,code:"invalidTarget",reason:"no document is loaded"}},destroy(){n?.invalidate(),K=true,ce.dispose(),z.dispose(),y.cancel(),zt.detach(),ee(),U(),U=()=>{},cn(),d=null,b=null,h=new WeakMap,Ne+=1,Oe(),it.dispose(),ln.clear();},on:ln.on};n=EF(nn,{surface:()=>L,container:()=>d,collaboration:()=>u.collaboration!==null,load:Gt,changed:()=>{Oe(),He();},cancelLoad:()=>{r=null,o=null,y.cancel();}}),it.attach(nn,jo);let Br=Wo.methods(nn);return xI(Br,()=>d),T1(Br,Qn),DP(Br,$.popupChrome.commentDraft),Hr=()=>RF(Br),IF(Br,{deferEvents:ln.defer,displayOptions:ns,changed:()=>{Oe(),He();}}),Br}var X1=Object.freeze({document:true,save:true,events:true,selection:true,scrolling:true,layout:true});function sq(e){if(e.length===0)return;if(e.every(n=>n.kind==="delete"))return "comment-delete";if(e.length!==1)return;let t=e[0];if(t.kind==="resolve")return "comment-resolve";if(t.kind==="create")return "comment-add";if(t.kind==="reply")return "comment-reply"}function lq(e){let t,n=chunk3IEXDEFH_cjs.n({port:cq(e,()=>t),capabilities:X1}),r=false,o=i=>(r||e.surface?.flushPendingInput(),JA(e,()=>n.execute(i)));return {...n,save:()=>{try{return n.save()}catch(i){return {ok:false,error:{code:"transaction-refused",message:i instanceof Error?i.message:"Cannot save the document."}}}},dispose:()=>{r=true,n.dispose();},execute:o,beginHistoryGroupRun:i=>{let a=r?null:E1(e,i);if(a===null)return null;let s=false;return {execute:l=>{if(s||r||!C1(e,i))return null;let c=t;t=a;try{return o(l)}finally{t=c;}},finish:()=>{s||(s=true,a.finish());}}}}}function cq(e,t){let n=(u,f)=>{let p=t();return p===void 0?f():p.bind(u,f)},r=0,o=0,i=null,a=false,s=false,l=()=>{if(s)return null;let u=e.surface?.session??null;return u!==i&&(a&&(r+=o+1),a=true,i=u,o=0),u&&(o=u.packageRevision()),u},c,d=null;return {localChangeTracking:true,suggesting:()=>e.surface?.editingMode()==="suggest",async prepare(u){if(!u.operations.some(g=>g.op==="updateFieldResult"))return;c=void 0,d=null;let f=e.surface;if(!f)return;No(f);let p=f.layout();c=chunk3IEXDEFH_cjs.k(p),d=l()?.currentPackage()??null;},fieldPageContext(u,f,p){let g=l()?.currentPackage()??null;if(!g||g!==d)return null;let b=chunk3IEXDEFH_cjs.j(g).story(u);return b?chunk3IEXDEFH_cjs.l(c,b.part,f,p):null},revision(){return l(),r+o},currentPackage:()=>l()?.currentPackage()??null,revisionDisplayMode:()=>e.surface?chunkFDSL5OJU_cjs.$a(e.surface.revisionDisplayMode()):chunkZOZI27AW_cjs.Ih,collaborative:()=>!!e.surface?.collaborationSession(),allocationActor:()=>e.surface?.collaborationSession()?.identity.actorId,trackedRangeReplacement:()=>!e.surface?.collaborationSession(),replacementLanding:(u,f,p)=>e.surface?.replacementLanding(u,f,p)??null,apply(u,f,p=[],g=false){if(l(),Ya(e))return {ok:false,reason:ao};let b=e.surface;if(!b)return {ok:false,reason:"no-document"};let h=n(b,()=>b.applyAutomationOps(u,f,p,g));return h.rejected?{ok:false,reason:Ga(h.reason)}:{ok:true,changed:h.committed}},applyLifecycle(u){if(l(),Ya(e))return {ok:false,reason:ao};let f=e.surface;if(!f)return {ok:false,reason:"no-document"};let p=n(f,()=>f.applyAutomationOps(()=>[u]));return p.rejected?{ok:false,reason:Ga(p.reason)}:{ok:true,changed:p.committed}},applyCommentWrites(u,f){let p=e.surface,g=l();if(!p||!g)return {ok:false,reason:"no-document"};if(Ya(e))return {ok:false,reason:ao};if(u.length===0)return {ok:true,changed:false};if(f.kind!=="body")return {ok:false,reason:"unsupported-story"};let b=e.can({type:"toggleReviewPane"});if(!b.ok)return {ok:false,reason:Ga(b.reason??"review-module-required")};if(u.length!==1&&!u.every(x=>x.kind==="delete"))return {ok:false,reason:"mixed-comment-writes"};let h=null,y=n(p,()=>p.commitReviewOps(x=>{if(u.every(I=>I.kind==="delete")){let I=u.find(P=>P.kind==="delete"),C=g.deleteComments(u.map(P=>{if(P.kind!=="delete")throw new Error("unreachable mixed comment write");return {commentId:P.commentId,...P.parentCommentId===void 0?{}:{parentCommentId:P.parentCommentId}}}),f,I?.kind==="delete"?I.noteId:void 0,{historyToken:x});return h=C?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:C}}if(u.length!==1)return h={ok:false,reason:"mixed-comment-writes"},{committed:false};let v=u[0];if(v.kind==="resolve"){let I=g.setCommentResolved(v.commentId,v.resolved,{historyToken:x});return h=I?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:I}}if(v.kind!=="create"&&v.kind!=="reply")return h={ok:false,reason:"unsupported-comment-write"},{committed:false};let S=g.replyToComment(v.kind==="reply"?v.parentCommentId:null,v.anchor,v.text,v.author,v.date,void 0,void 0,{historyToken:x});return h=S===null?{ok:false,reason:"refused"}:{ok:true,changed:true,commentId:S},{committed:S!==null}},sq(u)));return h??{ok:false,reason:Ga(y??"refused")}},applyCustomNodeWrite(u,f){let p=e.surface,g=l();if(!p||!g)return {ok:false,reason:"no-document"};if(Ya(e))return {ok:false,reason:ao};if(f.kind!=="body")return {ok:false,reason:"unsupported-story"};let b=null,h=n(p,()=>p.commitReviewOps(y=>{let x=g.insertCustomNode(u,void 0,{historyToken:y});return b=x.ok?{ok:true,changed:x.change!==null}:{ok:false,reason:x.detail?`${x.reason}: ${x.detail}`:x.reason},{committed:x.ok}},"package-scoped"));return b??{ok:false,reason:Ga(h??"refused")}},save:()=>l()?e.surface?.save()??null:null,selectRefusal(u,f){if(u.kind==="body")return null;let p=e.surface;return p?.editingMode()==="view"?"a read-only editor does not open a header, footer or note to select in it":p&&!chunkFDSL5OJU_cjs.ze(p.layout(),{paragraphId:f,offset:0})?"that header, footer or note is not shown on any page":null},select(u,f){if(!e.surface)return false;let g=f==="end"?u.end:u.start,b=f==="start"?u.start:u.end;return e.exec({type:"setSelection",range:{anchor:{paragraphId:g.paragraphId,offset:g.offset},head:{paragraphId:b.paragraphId,offset:b.offset}}}).ok},subscribe:u=>e.on("change",()=>u()),dispose(){s=true,i=null;}}}function gb(e){let t=e?.closest(".docx-editor")??null;for(;t&&!t.querySelector(".docx-pages");)t=t.parentElement?.closest(".docx-editor")??null;return t}function dq(e){let t=e.popup.ownerDocument,n=r=>{if(r.key!=="Escape"||r.isComposing||r.keyCode===229||e.skip?.(r))return;let o=r.composedPath(),i=o[0]??r.target,a=Co(i)?i:null,s=a!==null&&e.contains(a);if(!s&&Y1(a,e.popup))return;let l=[gb(e.popup),e.chromeRoot?.(),...e.editorElements?.()??[]],c=s||l.some(d=>d!=null&&o.includes(d));e.close(s),c&&(r.preventDefault(),r.stopPropagation());};return t.addEventListener("keydown",n,true),()=>t.removeEventListener("keydown",n,true)}function Y1(e,t){let r=(_t(e)?e:e?.parentElement??null)?.closest('[aria-modal="true"], [data-docx-modal]');return r?r.hasAttribute("data-docx-dialog")||r.hasAttribute("data-docx-modal")?true:gb(t)?.contains(r)===true:false}var uq='[aria-expanded="true"], [role="menu"], [role="listbox"], [role="dialog"]';function fq(e){return e?.querySelector(uq)!=null}function pq(e){let t=e.popup.ownerDocument,n=r=>{let o=r.composedPath()[0]??r.target;if(!Co(o)||e.contains(o))return;let i=_t(o)?o:o.parentElement;i===null||i===t.body||i===t.documentElement||i.closest(".docx-pages")||Y1(i,e.popup)||e.close();};return t.addEventListener("focusin",n,true),()=>t.removeEventListener("focusin",n,true)}function mq(e){return e*(96/72)}function gq(e,t){return e*t}function hq(e,t){return e/t}function yq(e,t,n){let r=e.pages.find(a=>a.index===t.pageIndex)??e.pages[t.pageIndex];if(!r)return {left:0,top:0,width:0,height:0};let o=n.pageOffsetX.get(r.index)??0,i=n.paintScale;return Object.freeze({left:(r.contentBox.x+t.x+o)*i,top:(r.contentBox.y+t.y)*i,width:t.width*i,height:t.height*i})}function bq(e){return Object.freeze(e?{left:e.offsetLeft,top:e.offsetTop}:{left:0,top:0})}function J1(e,t,n,r=false){return t?true:e.length===1?false:r?n:!n}var Q1=["e","se","s","sw","w","nw","n","ne"];function vq(e,t){let n=Q1.indexOf(e);t.flipHorizontal&&(n=(4-n+8)%8),t.flipVertical&&(n=(8-n)%8);let r=Math.round(t.rotationDegrees/45)%8;return Q1[(n-r+8)%8]}function xq(e,t,n){let r=e,o=t,i=-n.rotationDegrees*Math.PI/180,a=Math.cos(i),s=Math.sin(i),l=r*a-o*s,c=r*s+o*a;return r=l,o=c,n.flipHorizontal&&(r=-r),n.flipVertical&&(o=-o),Object.freeze({x:r,y:o})}function Wi(e){return e/12700}function eD(e){let t=xq(e.deltaXPt,e.deltaYPt,e.transform),n=Wi(e.startWidthEmu),r=Wi(e.startHeightEmu),o=n/r,i=vq(e.handle,e.transform),a=i.includes("e")?t.x:i.includes("w")?-t.x:0,s=i.includes("s")?t.y:i.includes("n")?-t.y:0;if(n=Math.max(1,n+a),r=Math.max(1,r+s),e.preserveAspect)if(i.length===2){let S=Math.max(n/Wi(e.startWidthEmu),r/Wi(e.startHeightEmu));n=Math.max(1,Wi(e.startWidthEmu)*S),r=Math.max(1,n/o);}else i==="e"||i==="w"?r=Math.max(1,n/o):n=Math.max(1,r*o);let l=Wi(e.startWidthEmu),c=Wi(e.startHeightEmu),d=n/l,u=r/c,f=e.kind==="inline"&&Math.abs(e.transform.rotationDegrees%180)===90,p=Math.max(1,f?e.startBounds.width+r-c:e.startBounds.width*d),g=Math.max(1,f?e.startBounds.height+n-l:e.startBounds.height*u),b=e.startBounds.x,h=e.startBounds.y,y=e.handle;y.includes("w")&&(b=e.startBounds.x+e.startBounds.width-p),y.includes("n")&&(h=e.startBounds.y+e.startBounds.height-g);let x=null;if(e.kind==="anchored"&&e.startPosition&&(y.includes("w")||y.includes("n")||e.anchorFrameOrigin&&(e.startPosition.horizontalEmu===void 0&&n!==l||e.startPosition.verticalEmu===void 0&&r!==c)))if(e.startPosition.mode==="simple"){let v=y.includes("w")?Wt(b-e.startBounds.x):0,S=y.includes("n")?Wt(h-e.startBounds.y):0;x=Object.freeze({mode:"simple",horizontalEmu:(e.startPosition.horizontalEmu??0)+v,verticalEmu:(e.startPosition.verticalEmu??0)+S});}else if(e.anchorFrameOrigin)x=Object.freeze({mode:"frame",...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{},...y.includes("w")||e.startPosition.horizontalEmu===void 0&&n!==l?{horizontalEmu:Wt(b-e.anchorFrameOrigin.x)}:e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu}:{},...y.includes("n")||e.startPosition.verticalEmu===void 0&&r!==c?{verticalEmu:Wt(h-e.anchorFrameOrigin.y)}:e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu}:{}});else {let v=y.includes("w")?Wt(b-e.startBounds.x):0,S=y.includes("n")?Wt(h-e.startBounds.y):0;x=Object.freeze({mode:"frame",...e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu+v}:{},...e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu+S}:{},...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{}});}return Object.freeze({widthEmu:Wt(n),heightEmu:Wt(r),previewBounds:Object.freeze({x:b,y:h,width:p,height:g}),position:x})}function Sq(e,t){return Object.freeze({scrollBy(n){if(!Number.isFinite(n)||n===0)return 0;let r=e.scrollTop;return e.scrollTop+=n*t,(e.scrollTop-r)/t}})}function wq(e){if(e.session.mode==="move"){let t=e.session.startBounds.x+e.deltaXPt,n=e.session.startBounds.y+e.deltaYPt+e.accumulatedScrollPt,r=e.session.startPosition&&cu(e.session.startPosition.mode==="frame"&&e.anchorFrameOrigin?{...e.session.startPosition,horizontalEmu:e.session.startPosition.horizontalEmu??Wt(e.session.startBounds.x-e.anchorFrameOrigin.x),verticalEmu:e.session.startPosition.verticalEmu??Wt(e.session.startBounds.y-e.anchorFrameOrigin.y)}:e.session.startPosition,e.deltaXPt,e.deltaYPt+e.accumulatedScrollPt);return Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:Object.freeze({x:t,y:n,width:e.session.startBounds.width,height:e.session.startBounds.height}),position:r??null})}return e.session.handle?eD({handle:e.session.handle,startWidthEmu:e.session.startWidthEmu,startHeightEmu:e.session.startHeightEmu,startBounds:e.session.startBounds,startPosition:e.session.startPosition,anchorFrameOrigin:e.anchorFrameOrigin,deltaXPt:e.deltaXPt,deltaYPt:e.deltaYPt,transform:e.session.transform,preserveAspect:J1(e.session.handle,e.aspectLocked,e.shiftKey,e.textbox),kind:e.session.kind}):Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:e.session.startBounds,position:null})}var tD=e=>Math.round(e/1440*100)/100,kq=e=>tD(e).toLocaleString(void 0,{maximumFractionDigits:2}),Iq=e=>Math.round(e*1440),Rq={left:"dialogs.paragraph.tabAlignLeft",center:"dialogs.paragraph.tabAlignCenter",right:"dialogs.paragraph.tabAlignRight",decimal:"dialogs.paragraph.tabAlignDecimal",bar:"dialogs.paragraph.tabAlignBar"},nD=e=>e===null||e===0?"none":e<0?"hanging":"firstLine",rD=(e,t)=>e==="none"?0:e==="hanging"?-Math.abs(t):Math.abs(t);function Pq(e){let t=e.indentFirstLineTwips;return {alignment:e.alignment??"left",direction:e.direction??"ltr",indentLeft:e.indentLeftTwips??0,indentRight:e.indentRightTwips??0,special:nD(t),specialBy:Math.abs(t??0),spaceBefore:e.spaceBeforePt??0,spaceAfter:e.spaceAfterPt??0,lineRule:e.lineSpacing?.rule??"multiple",lineValue:e.lineSpacing?.value??1.08,contextualSpacing:e.contextualSpacing===true,keepNext:e.keepNext===true,keepLines:e.keepLines===true,widowControl:e.widowControl!==false,pageBreakBefore:e.pageBreakBefore===true,tabStops:e.tabStops??[],clearedAllTabStops:false}}var oD={contextualSpacing:false,keepNext:false,keepLines:false,widowControl:false,pageBreakBefore:false,tabStops:false,alignment:false,direction:false,indentLeft:false,indentRight:false,special:false,spaceBefore:false,spaceAfter:false,lineSpacing:false};function Tq(e){return {contextualSpacing:e.contextualSpacing===null,keepNext:e.keepNext===null,keepLines:e.keepLines===null,widowControl:e.widowControl===null,pageBreakBefore:e.pageBreakBefore===null,tabStops:e.disagrees.tabStops,alignment:e.disagrees.alignment,direction:e.disagrees.direction,indentLeft:e.disagrees.indentLeft||e.indentUnknown,indentRight:e.disagrees.indentRight||e.indentUnknown,special:e.disagrees.indentFirstLine||e.indentUnknown,spaceBefore:e.disagrees.spaceBeforePt,spaceAfter:e.disagrees.spaceAfterPt,lineSpacing:e.disagrees.lineSpacing}}function iD(e,t){return e===t?true:e.length!==t.length?false:e.every((n,r)=>{let o=t[r];return o!==void 0&&n.positionTwips===o.positionTwips&&n.alignment===o.alignment&&(n.leader??"none")===(o.leader??"none")})}function Eq(e,t,n=oD,r=n){let o={},i=false,a=(c,d)=>{o[c]=d,i=true;},s=c=>n[c]&&!r[c];(e.direction!==t.direction||s("direction"))&&a("direction",t.direction);let l=!n.direction&&!n.alignment&&e.direction!==t.direction&&t.alignment===aD(e.alignment);return (e.alignment!==t.alignment&&!l||s("alignment"))&&a("alignment",t.alignment),(e.indentLeft!==t.indentLeft||s("indentLeft"))&&a("indentLeftTwips",t.indentLeft),(e.indentRight!==t.indentRight||s("indentRight"))&&a("indentRightTwips",t.indentRight),(e.special!==t.special||e.specialBy!==t.specialBy||s("special"))&&a("indentFirstLineTwips",rD(t.special,t.specialBy)),(e.spaceBefore!==t.spaceBefore||s("spaceBefore"))&&a("spaceBeforePt",t.spaceBefore),(e.spaceAfter!==t.spaceAfter||s("spaceAfter"))&&a("spaceAfterPt",t.spaceAfter),!r.lineSpacing&&(e.lineRule!==t.lineRule||e.lineValue!==t.lineValue||s("lineSpacing"))&&a("lineSpacing",{rule:t.lineRule,value:t.lineValue}),(e.contextualSpacing!==t.contextualSpacing||s("contextualSpacing"))&&a("contextualSpacing",t.contextualSpacing),(e.keepNext!==t.keepNext||s("keepNext"))&&a("keepNext",t.keepNext),(e.keepLines!==t.keepLines||s("keepLines"))&&a("keepLines",t.keepLines),(e.widowControl!==t.widowControl||s("widowControl"))&&a("widowControl",t.widowControl),(e.pageBreakBefore!==t.pageBreakBefore||s("pageBreakBefore"))&&a("pageBreakBefore",t.pageBreakBefore),(!iD(e.tabStops,t.tabStops)||s("tabStops")&&t.clearedAllTabStops)&&a("tabStops",t.tabStops),i?o:null}function aD(e){return e==="left"?"right":e==="right"?"left":e}function Cq(e,t){return [...e.filter(r=>r.positionTwips!==t.positionTwips),t].sort((r,o)=>r.positionTwips-o.positionTwips)}function Oq(e,t){if(t.key!=="Tab")return false;let n=[...e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(a=>!a.hasAttribute("disabled")&&a.tabIndex!==-1);if(n.length===0)return false;let r=n[0],o=n[n.length-1],i=e.ownerDocument.activeElement;return t.shiftKey&&(i===r||i===e)?(o.focus(),true):!t.shiftKey&&i===o?(r.focus(),true):false}var Mq=63;function sD(e){return /^\d{1,3}$/.test(e.trim())?Number(e.trim()):null}function Aq(e,t,n){let r=n?.maxCols??63,o=n?.maxRows??63,i=sD(e),a=sD(t);return i===null||i<1||i>r?{counts:null,problem:{kind:"range",field:"columns",max:r}}:a===null||a<1||a>o?{counts:null,problem:{kind:"range",field:"rows",max:o}}:i*a<2?{counts:null,problem:{kind:"oneCell"}}:{counts:{rows:a,cols:i},problem:null}}function Fq(e,t){let n=[[1,2],[2,1],[e?.maxRows??2,1]];for(let[r,o]of n)if(r*o>=2&&t({type:"splitCell",rows:r,cols:o}).ok)return {columns:String(o),rows:String(r)};return {columns:"2",rows:"1"}}function Lq(e,t,n){let r,o=false,i,a=mt(()=>t),s,l=new Set,c=[],d=()=>{a.clearTimeout(s),s=void 0,r?.end(),r=void 0,i=void 0,l.clear();},u=()=>{if(o)throw new Error("history group binding was disposed");return (!r||r.state==="closed")&&(r=e.beginHistoryGroup()),r},f=()=>{d(),u();},p=()=>{let h=r;i=void 0,l.clear(),a.clearTimeout(s),s=a.setTimeout(()=>{r===h&&d();},0);},g=(h,y,x,v=false)=>{h.addEventListener(y,x,v),c.push(()=>h.removeEventListener(y,x,v));},b=h=>n.kind==="native-color"?h==="Enter"||h===" ":["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"," ","Enter"].includes(h);if(g(t,"pointerdown",h=>{let y=h;if(!(y.button!==0||n.kind==="keyboard")&&(f(),i=y.pointerId,n.kind!=="native-color"))try{t.setPointerCapture?.(y.pointerId);}catch{}},true),g(t,"keydown",h=>{let y=h;if(y.key==="Escape"){p();return}!b(y.key)||y.altKey||y.ctrlKey||y.metaKey||(!y.repeat&&l.size===0&&f(),l.add(y.key),u());},true),g(t.ownerDocument,"keyup",h=>{let y=h.key;l.delete(y)&&n.kind!=="native-color"&&l.size===0&&p();},true),n.kind!=="native-color")for(let h of ["pointerup","pointercancel","lostpointercapture"])g(h==="lostpointercapture"?t:t.ownerDocument,h,y=>{i!==void 0&&y.pointerId===i&&p();},true);return g(t,"input",()=>{s!==void 0?f():u();},true),g(t,"change",()=>{(n.kind==="native-color"||i===void 0&&l.size===0)&&p();}),g(t,"blur",p,true),t.ownerDocument.defaultView&&g(t.ownerDocument.defaultView,"blur",p),{options:()=>({historyGroup:u()}),dispose(){if(!o){o=true,d();for(let h of c)h();}}}}var cD=Object.freeze([1,1.15,1.5,2,2.5,3]);function Dq(e){return Number.isInteger(e*10)?e.toFixed(1):String(e)}function lD(e,t,n){let r=e.rule==="multiple";return {spacing:e,command:t?null:{type:"setLineSpacing",rule:e.rule,value:e.value},text:r?Dq(e.value):String(e.value),labelKey:r?null:e.rule==="exact"?"lineSpacing.exactlyPoints":"lineSpacing.atLeastPoints",selected:t,preset:n}}function Nq(e){let t=cD.map(o=>lD({rule:"multiple",value:o},e?.rule==="multiple"&&e.value===o,true));if(!e||t.some(o=>o.selected))return t;let n=lD(e,true,false);if(e.rule!=="multiple")return [n,...t];let r=t.findIndex(o=>o.spacing.value>e.value);return t.splice(r===-1?t.length:r,0,n),t}function Hq(e,t,n){let r={minimumFractionDigits:t,maximumFractionDigits:2};try{return new Intl.NumberFormat(n,r).format(e)}catch{return new Intl.NumberFormat("en",r).format(e)}}function _q(e,t,n){let r=n===void 0?e.text:Hq(e.spacing.value,e.spacing.rule==="multiple"?1:0,n);return e.labelKey?t(e.labelKey).replace("{value}",r):r}var qo=class extends Error{code;constructor(t,n){super(`Document capture failed: ${t}.`,{cause:n}),this.name="DocumentRefreshError",this.code=t;}};function dD(e){return JSON.stringify([e.revisionKind,e.author,e.date,e.text,e.replacedText])}function uD(e){return new Map(e.surface()?.session.reviewItems().filter(t=>t.kind==="revision").map(t=>[t.id,dD(t)]))}function fD(e,t,n,r){let o=e.surface();if(!o)return {located:[],available:false};let i=o.session.part(),a=chunk25EXMBV2_cjs.d(i),s=o.session.paragraphAnchors().paraIdByNode,l=new Map,c=new Map;a.forEach((g,b)=>{c.set(g.id,b);let h=s.get(g.id);if(h){let y=h.toUpperCase();l.set(y,l.has(y)?null:g);}});let d=new Set(o.layout().pages.flatMap(g=>chunkFDSL5OJU_cjs.Aa(g).map(b=>b.paragraphId))),u=(g,b=JSON.stringify([typeof g.location?.text=="string"?g.location.text:null,g.unavailableReason,g.description]))=>{let h={id:g.id,resultId:t,isNew:r.get(g.id)!==b,...g.description!==void 0?{description:g.description}:{}};if(!g.location)return {fingerprint:b,change:{...h,status:g.unavailableReason??"unavailable",diagnostic:Object.freeze({code:g.unavailableReason==="deleted"?"deleted":"missing-location"})}};let y=g.location,x=C=>({fingerprint:b,change:{...h,status:"invalid",diagnostic:Object.freeze({code:C,location:Object.freeze({...y})})}});if(y.paragraphId===void 0==(y.paragraphIndex===void 0)||y.paragraphIndex!==void 0&&(!Number.isSafeInteger(y.paragraphIndex)||y.paragraphIndex<0))return x("invalid-selector");if(y.paragraphId!==void 0&&(typeof y.paragraphId!="string"||!chunkZOZI27AW_cjs.zb(y.paragraphId)))return x("invalid-paragraph-id");let v=y.paragraphId!==void 0?l.get(y.paragraphId.toUpperCase()):a[y.paragraphIndex];if(v===null)return x("ambiguous-paragraph-id");if(!v)return x("paragraph-not-found");let S=v?chunkZOZI27AW_cjs.Tk(i,v.id)??"":"";if(!Number.isSafeInteger(y.start)||!Number.isSafeInteger(y.end)||y.start<0||y.end<=y.start||y.end>S.length)return x("invalid-offsets");if(S.slice(y.start,y.end)!==y.text)return x("text-mismatch");let I=d.has(v.id);return {fingerprint:b,change:{...h,status:I?"available":"unavailable",location:Object.freeze({...y}),...I?{}:{diagnostic:Object.freeze({code:"not-rendered",location:Object.freeze({...y})})}},...I?{paragraphId:v.id,offset:y.start}:{}}};if(n)return {located:n.map(g=>u(g)),available:true};let f=o.session.reviewItems().filter(g=>g.kind==="revision");return {located:f.map(g=>{let b=dD(g),h=g.ranges[0];if(!h||h.partName!==i.name)return {fingerprint:b,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==b,status:h?"unsupported-story":"unavailable",diagnostic:Object.freeze({code:h?"unsupported-story":"missing-location"})}};let y=c.get(h.start.paragraphId)??-1;if(g.revisionKind==="delete"||g.revisionKind==="moveFrom")return {fingerprint:b,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==b,status:"deleted",diagnostic:Object.freeze({code:"deleted"})}};if(h.start.paragraphId!==h.end.paragraphId)return {fingerprint:b,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==b,status:"unavailable",diagnostic:Object.freeze({code:"multiple-paragraphs"})}};let x=chunkZOZI27AW_cjs.Tk(i,h.start.paragraphId)??"",v={paragraphIndex:y,start:h.start.offset,end:h.end.offset,text:x.slice(h.start.offset,h.end.offset)};return u({id:g.id,location:v},b)}),available:f.length>0}}var pD=new WeakMap,Bq=0;function $q(e){let t=pD.get(e);if(t)return t;let n=TF(e),r=`refresh-${++Bq}`,o=0,i=null,a=new AbortController,s=false,l=Promise.resolve(),c=null,d=[],u=null,f=new Set,p=new Set,g=Object.freeze({phase:"idle",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false}),b=P=>{g=Object.freeze({...g,...P});for(let E of f)try{E();}catch{}},h=Rf(e,n,{marker:"data-docx-refresh-highlight",defaultColor:"var(--doc-refresh-highlight-color)"},()=>{g.highlightsVisible&&b({highlightsVisible:false});}),y=(P,E)=>{E&&b({phase:E,result:P,recoveryAvailable:c!==null});for(let R of p)try{R(P);}catch{}return P},x=(P,E,R)=>({ok:false,resultId:P,code:E,...R===void 0?{}:{recovered:R}}),v=()=>n.collaboration()?"collaboration":!n.surface()||!n.container()||e.snapshot().isOpening?"unavailable":null,S=()=>{o++,i=null,a.abort(),a=new AbortController,d=[],u=null,h.clear();};n.invalidated.add(()=>{S(),c=null,b({phase:"idle",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false});}),e.on("change",P=>{P.source||u===null||n.revision===u||(d=[],h.clear(),u=null,b({changes:[],highlightsVisible:false}));});let I=async P=>{let E=n.surface(),R=n.container();if(!E||!R)throw new Error("unavailable");Cu(E)&&await new Promise((O,B)=>{let q=()=>{R.removeEventListener("compositionend",j),P.removeEventListener("abort",z);},j=()=>{q(),O();},z=()=>{q(),B(new Error("cancelled"));};R.addEventListener("compositionend",j),P.addEventListener("abort",z,{once:true}),P.aborted&&z();});let w=Bl(R);if(w&&await w,P.aborted||n.surface()!==E)throw new Error("document-changed");let M=E.save();if(n.surface()!==E)throw new Error("document-changed");return {bytes:M,revision:n.revision}},C={async capture(){let P=v();if(c)throw new qo("recovery-failed");if(P||s)throw new qo(P??"busy");S(),c=null;let E=o,R=n.epoch,w=a.signal;b({phase:"capturing",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false});try{let M=await I(w);if(E!==o||R!==n.epoch)throw new Error("superseded");let O=Object.freeze({id:`${r}-${E}`,bytes:M.bytes.slice().buffer});return i={token:O,epoch:R,revision:M.revision,sequence:-1,seen:uD(n)},b({phase:"processing"}),O}catch(M){throw E===o&&b({phase:"failed"}),new qo(E===o?"input-failed":"superseded",M)}},applyUpdate(P){let E=`${P.submission?.id??"unknown"}:${P.sequence}`,R;try{if(!Number.isSafeInteger(P.sequence)||P.sequence<0||!(P.bytes instanceof Uint8Array||P.bytes instanceof ArrayBuffer)||P.failures!==void 0&&(!Array.isArray(P.failures)||P.failures.length>1e4||Array.from(P.failures).some(O=>typeof O!="string"))||P.changes!==void 0&&(!Array.isArray(P.changes)||P.changes.length>1e4||new Set(P.changes.map(O=>O.id)).size!==P.changes.length||Array.from(P.changes).some(O=>!O||typeof O.id!="string"||!O.id||O.description!==void 0&&(typeof O.description!="string"||O.description.length>1e3)||O.location!==void 0&&(!O.location||typeof O.location!="object"||O.location.paragraphId!==void 0&&typeof O.location.paragraphId!="string"||O.location.paragraphIndex!==void 0&&typeof O.location.paragraphIndex!="number"||typeof O.location.start!="number"||typeof O.location.end!="number"||typeof O.location.text!="string")||O.unavailableReason!==void 0&&!["deleted","unavailable"].includes(O.unavailableReason))))throw new Error("invalid-result");R={...P,bytes:new Uint8Array((P.bytes instanceof Uint8Array,P.bytes)).slice(),changes:P.changes?.map(O=>({id:O.id,description:O.description,unavailableReason:O.unavailableReason,location:O.location?{paragraphId:O.location.paragraphId,paragraphIndex:O.location.paragraphIndex,start:O.location.start,end:O.location.end,text:O.location.text}:void 0})),failures:P.failures?.slice()};}catch{return Promise.resolve(y(x(E,"invalid-result")))}let w=async()=>{let O=i,B=v();if(B)return y(x(E,B));if(!O||O.token!==R.submission)return y(x(E,"superseded"));if(R.sequence<=O.sequence)return y(x(E,"out-of-order"));if(O.epoch!==n.epoch)return y(x(E,"document-changed"));s=true;let q=a.signal,j=()=>i===O&&O.epoch===n.epoch&&!q.aborted;try{let z=await I(q);if(!j())return y(x(E,"cancelled"));if(z.revision!==O.revision)return y(x(E,"local-edits"),"failed");let _=R.bytes;if(!chunkZOZI27AW_cjs.Je(_).ok)return y(x(E,"invalid-document"),"failed");if(h.clear(),d=[],u=null,b({phase:"refreshing",changes:[],highlightsVisible:!1}),!j())return y(x(E,"cancelled"));let L=n.surface().save();if(!j())return y(x(E,"cancelled"));if(n.revision!==O.revision)return y(x(E,"local-edits"),"failed");c={bytes:L.slice(),epoch:n.epoch};let X=await n.replace(_,"refresh");if(O.epoch!==n.epoch)return y(x(E,"document-changed"));if(!X&&!j())return c=null,y(x(E,"cancelled"));if(!X){if(b({phase:"recovering"}),O.epoch!==n.epoch)return y(x(E,"document-changed"));let D=c&&await n.replace(c.bytes,"recovery");return O.epoch!==n.epoch?y(x(E,"document-changed")):(D&&(c=null),i=null,y(x(E,D?"load-failed":"recovery-failed",!!D),"failed"))}c=null,h.clear(),O.revision=n.mountedRevision,O.sequence=R.sequence;let te=fD(n,E,R.changes,O.seen);d=n.revision===O.revision?te.located:[];for(let D of d)O.seen.set(D.change.id,D.fingerprint);u=O.revision;let me=Object.freeze(d.map(D=>Object.freeze(D.change))),se=Object.freeze({ok:!0,resultId:E,changes:me,changeInformation:n.revision===O.revision&&te.available?"available":"unavailable",failures:Object.freeze(R.failures??[])});return b({changes:me,result:se,phase:"complete",recoveryAvailable:!1}),y(se)}catch{return y(x(E,j()?"input-failed":"cancelled"),j()?"failed":void 0)}finally{s=false;}},M=l.then(w);return l=M.then(()=>{},()=>{}),M},cancel(){let P=g.phase==="recovering"||!n.surface()&&c!==null;n.cancel(),o++,i=null,a.abort(),a=new AbortController,P||(c=null),b({phase:P?"failed":g.result?.ok?"complete":"idle",result:P||g.result?.ok?g.result:null,recoveryAvailable:c!==null});},finish(P){i?.token===P&&!s&&(i=null,b({phase:g.phase==="processing"?"idle":g.phase}));},snapshot:()=>g,subscribe(P){return f.add(P),()=>{f.delete(P);}},onResult(P){return p.add(P),()=>{p.delete(P);}},highlightChanges(P){if(h.validate(P),u!==n.revision)return 0;let E=P?.changeIds===void 0?null:new Set(P.changeIds),R=d.filter(w=>w.change.status==="available"&&(E?E.has(w.change.id):P?.includePrevious||w.change.isNew));return h.show(R,P),b({highlightsVisible:R.length>0}),R.length},clearHighlights(P){h.hide(P),b({highlightsVisible:false});},navigateToChange(P,E={}){if(E.focus!==void 0&&typeof E.focus!="boolean")throw new TypeError("focus must be a boolean.");let R=Qa(E,"center",n.container());if(u!==n.revision)return false;let w=d.find(O=>O.change.id===P);if(!w?.paragraphId||w.offset===void 0)return false;let M=n.surface();if(!M?.revealPosition({paragraphId:w.paragraphId,offset:w.offset},R))return false;if(E?.focus){M.setActiveScope({kind:"body"});let O={paragraphId:w.paragraphId,offset:w.offset};M.setSelection({anchor:O,head:O}),M.focus();}return true},recoveryBytes:()=>c?c.bytes.slice().buffer:null,async recover(){if(!c||c.epoch!==n.epoch||s)return false;s=true;let P=c;b({phase:"recovering"});try{if(P.epoch!==n.epoch)return !1;let E=await n.replace(P.bytes,"recovery");return P.epoch!==n.epoch?!1:(E&&(c=null),b({phase:E?"idle":"failed",recoveryAvailable:!E}),E)}finally{s=false;}}};return pD.set(e,C),C}var mD=150,qq=1e3,Wq=Object.freeze({applied:0,unavailable:0});function jq(e,t,n,r={}){let{onResult:o,...i}=r,a=n,s=i,l=Wq,c=false,d=mt(()=>ro(e)),u,f=0,p=y=>{y.applied===l.applied&&y.unavailable===l.unavailable||(l=y,o?.(y));},g=()=>{if(d.clearTimeout(u),u=void 0,f=0,c)return;let y=typeof a=="function"?a(e):a;p(e.setHighlights(t,y,s));},b=()=>{let y=Date.now();f===0&&(f=y),d.clearTimeout(u);let x=Math.min(mD,qq-(y-f));u=d.setTimeout(g,Math.max(0,x));},h=e.on("change",y=>{typeof a=="function"?y.source?g():b():y.source==="refresh"||y.source==="recovery"?g():y.source==="load"&&p({applied:0,unavailable:a.length});});return g(),{get result(){return l},refresh:g,update(y,x){a=y,x!==void 0&&(s=x),g();},stop(){c||(c=true,d.clearTimeout(u),h(),e.clearHighlights(t));}}}var yb=150,hD=2e3,yD="search",bD=10,hb=Object.freeze([]),Kq=1e3;function Vq(e,t){let n=e.activeIndex>=0?e.matches[e.activeIndex]:void 0;if(!n)return -1;let r=-1;for(let[o,i]of t.entries())i.blockId===n.blockId&&(r<0||Math.abs(i.start-n.start)<Math.abs(t[r].start-n.start))&&(r=o);return r}var gD=new WeakMap;function Uq(e){let t=gD.get(e);if(t)return t;let n={query:"",matchCase:false,wholeWord:false,matches:hb,truncated:false,activeIndex:-1,activeMatch:null,isPending:false},r="",o={},i=mt(()=>ro(e)),a,s=new Set,l=new Map,c=false;function d(){let P="none";for(let E of l.values()){if(E==="all")return "all";E==="active"&&(P="active");}return P}function u(){let P=d(),{matches:E,activeIndex:R}=n,w=R>=0?E[R]:void 0,M=P==="all"?E:P==="active"&&w?[w]:[];M.length===0&&!c||(e.setHighlights(yD,M,{activeIndex:P==="all"?R:M.length>0?0:-1,priority:bD}),c=M.length>0);}function f(P){let E={...n,...P};if(E.matches!==n.matches&&P.activeIndex===void 0&&(E.activeIndex=Vq(n,E.matches)),E.truncated=nL(E.matches)??E.matches.length>=hD,E.activeMatch=E.matches[E.activeIndex]??null,!!Object.keys(E).some(w=>E[w]!==n[w])){n=E,u();for(let w of [...s])w();}}function p(P=r,E=n){return P.length===0?hb:e.findMatches(P,{matchCase:E.matchCase??false,wholeWord:E.wholeWord??false})}function g(){i.clearTimeout(a),a=void 0;}function b(){g(),r=n.query,f({matches:p(),isPending:false});}let h,y=0,x=()=>{i.clearTimeout(h),h=void 0,y=0,r.length>0&&f({matches:p()});},v=()=>{h!==void 0&&x();};e.on("change",P=>{if(r.length===0)return;if(P.source)return x();let E=Date.now();y===0&&(y=E),i.clearTimeout(h);let R=Math.min(yb,Kq-(E-y));h=i.setTimeout(x,Math.max(0,R));});let S=e.snapshot().editingMode;e.on("selectionChange",P=>{P.editingMode!==S&&(S=P.editingMode,x());});let I=(P,E)=>{v();let R=n.matches.length;if(R===0)return false;let w=n.activeIndex<0?P>0?-1:0:n.activeIndex;return C.goTo((w+P+R)%R,E)},C={getState:()=>n,subscribe(P){return s.add(P),()=>s.delete(P)},find(P,E={}){g(),r=P;let R=E.matchCase??n.matchCase,w=E.wholeWord??n.wholeWord,M=p(P,{matchCase:R,wholeWord:w});return E.highlight===void 0||E.highlight==="none"?l.delete(o):l.set(o,E.highlight),f({query:P,matchCase:R,wholeWord:w,matches:M,activeIndex:-1,isPending:false}),u(),E.selectFirst&&C.goTo(0),n.matches},setQuery(P){P!==n.query&&(g(),P!==r&&(a=i.setTimeout(b,yb)),f({query:P,isPending:P!==r}));},setMatchCase(P){f({matchCase:P,matches:p(r,{...n,matchCase:P})});},setWholeWord(P){f({wholeWord:P,matches:p(r,{...n,wholeWord:P})});},goTo(P,E){v();let R=n.matches[P];return !R||(E?.focus&&e.focus(),!e.selectMatch(R).ok)?false:(f({activeIndex:P}),true)},next:P=>I(1,P),previous:P=>I(-1,P),clear(){g(),r="",l.delete(o),f({query:"",matches:hb,activeIndex:-1,isPending:false});},showHighlights(P){let E={};return l.set(E,P),u(),()=>{l.delete(E)&&u();}}};return gD.set(e,C),C}var zq=[37,80,68,70,45],ic=class extends Error{constructor(n){super(`Install @docx-editor.dev/docx-to-${n} and configure menu.exporters.${n}.`+(n==="pdf"?" PDF conversion requires a Node.js server.":""));this.format=n;this.name="ChromeExportError";}format;code="missing-exporter"};async function bb(e,t,n={}){if(t==="markdown"){if(!n.markdown)throw new ic(t);let a=await n.markdown(new Uint8Array(await e.save()));if(typeof a?.markdown!="string")throw new TypeError("The Markdown converter returned no Markdown.");return {bytes:new TextEncoder().encode(a.markdown),extension:"md",mimeType:"text/markdown;charset=utf-8"}}if(t!=="pdf")throw new TypeError("Unsupported export format.");if(!n.pdf)throw new ic(t);let r=e.snapshot?.(),o=r?{displayMode:r.reviewDisplayMode??"proposed",revisionMarkup:r.revisionMarkup,...e.getReviewAuthors?{revisionAuthorSlots:Object.freeze(Object.fromEntries(e.getReviewAuthors().map(({author:a,slot:s})=>[a,s])))}:{}}:void 0,i=await n.pdf(new Uint8Array(await e.save()),o);if(!(i?.bytes instanceof Uint8Array)||i.bytes.length===0)throw new TypeError("The PDF converter returned no PDF bytes.");if(!zq.every((a,s)=>i.bytes[s]===a))throw new TypeError("The PDF converter returned a file without a PDF header.");return {bytes:i.bytes,extension:"pdf",mimeType:"application/pdf"}}var Zq=15e3,pr=class extends Error{code;constructor(t){super(t==="pdf-viewer-unavailable"?"This browser cannot display PDF files in the page.":t==="pdf-load-failed"?"The PDF did not load for printing.":t==="print-refused"?"The browser refused to print the PDF from the page.":"The print job has ended."),this.code=t,this.name="ChromePrintError";}};function Xq(e){if(e.altKey||e.shiftKey||typeof e.key!="string")return false;let t=e.key.toLowerCase();return t!=="p"&&(e.code!=="KeyP"||/^[a-z]$/.test(t))?false:i18n.isApplePlatform()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}async function Yq(e,t={},n=globalThis.document){let{bytes:r,mimeType:o}=await bb(e,"pdf",t);return Qq(r,o,n)}function Qq(e,t,n){let r=n.nodeType===9?n.body:n;if(!r)throw new TypeError("Printing requires a document body.");let o=r.ownerDocument,i=o.defaultView;if(!i)throw new TypeError("Printing requires a document with a window.");let a=e.buffer instanceof ArrayBuffer?e:e.slice(),s=i.URL.createObjectURL(new i.Blob([a],{type:t})),l=null,c=null,d,u=null,f=false,p=h=>{i.clearTimeout(d),u?.(h),u=null,l?.remove(),l=null,c=null;},g=()=>{if(c)return c;let h=o.createElement("iframe");return l=h,h.setAttribute("aria-hidden","true"),h.setAttribute("tabindex","-1"),h.setAttribute("data-docx-print-frame",""),h.style.cssText="position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden;",c=new Promise((y,x)=>{u=x,d=i.setTimeout(()=>p(new pr("pdf-load-failed")),Zq),h.addEventListener("load",()=>{if(i.clearTimeout(d),!h.contentWindow){p(new pr("pdf-load-failed"));return}u=null,y(h.contentWindow);},{once:true});}),c.catch(()=>{}),h.src=s,r.append(h),c};return {url:s,async print(h={}){if(f)throw new pr("print-ended");if(i.navigator.pdfViewerEnabled===false)throw new pr("pdf-viewer-unavailable");let y=await g();if(f)throw new pr("print-ended");if(await h.beforePrint?.(),f)throw new pr("print-ended");let x=o.activeElement;try{y.focus(),y.print();}catch{throw new pr("print-refused")}finally{x?.isConnected&&x.focus({preventScroll:true});}},dispose(){f||(f=true,p(new pr("print-ended")),i.URL.revokeObjectURL(s));}}}var Jq=new Intl.Collator(void 0,{numeric:true,sensitivity:"base"});function vD(e,t){let n=e.filter(r=>t.showHidden||!r.hidden);return t.sortBy==="location"?[...n].sort((r,o)=>r.order-o.order):[...n].sort((r,o)=>Jq.compare(r.name,o.name)||r.order-o.order)}var vb=["body","header","footer","footnote","endnote"];function eW(e,t){let n=vD(e,t),r=chunkZOZI27AW_cjs.Ng(t.query.trim()),o=n;if(r.length>0){let i=[],a=[];for(let s of n){let l=chunkZOZI27AW_cjs.Ng(s.name);l.startsWith(r)?i.push(s):l.includes(r)&&a.push(s);}o=[...i,...a];}return t.sortBy!=="location"?o:[...o].sort((i,a)=>vb.indexOf(i.place)-vb.indexOf(a.place))}function tW(e,t,n){let r=chunkZOZI27AW_cjs.Ng(t.trim());return r.length===0?null:e.find(o=>chunkZOZI27AW_cjs.Ng(o.name)===r)??n[0]??null}function nW(e,t){let n=chunkZOZI27AW_cjs.Ng(t.trim()),r=chunkZOZI27AW_cjs.Ng(e);if(n.length===0||r.length!==e.length)return null;let o=r.indexOf(n);return o<0?null:{start:o,end:o+n.length}}function rW(e){return vb.map(t=>({place:t,rows:e.flatMap((n,r)=>n.place===t?[{row:n,index:r}]:[])})).filter(t=>t.rows.length>0)}function oW(e){return e.find(t=>t.atSelection&&!t.hidden)?.name??""}function iW(e,t,n){let r=chunkZOZI27AW_cjs.Lg(t)??(chunkZOZI27AW_cjs.Mg(t)?"invalidStart":null),o=chunkZOZI27AW_cjs.Ng(t),i=t.length===0?null:e.find(a=>chunkZOZI27AW_cjs.Ng(a.name)===o)??null;return {problem:r,existing:i,canAdd:n&&r===null,canDelete:n&&i!==null,canGoTo:i!==null}}
30
- exports.$=vl;exports.$a=H6;exports.$b=X1;exports.$c=rW;exports.A=Jm;exports.Aa=Qg;exports.Ab=fC;exports.Ac=Cq;exports.B=A2;exports.Ba=h6;exports.Bb=pC;exports.Bc=Oq;exports.C=L2;exports.Ca=y6;exports.Cb=Ah;exports.Cc=Mq;exports.D=D2;exports.Da=v6;exports.Db=qu;exports.Dc=Aq;exports.E=DI;exports.Ea=yu;exports.Eb=Fh;exports.Ec=Fq;exports.F=N2;exports.Fa=$P;exports.Fb=Wu;exports.Fc=Lq;exports.G=H2;exports.Ga=hu;exports.Gb=Lh;exports.Gc=cD;exports.H=_2;exports.Ha=qP;exports.Hb=Dh;exports.Hc=Nq;exports.I=B2;exports.Ia=jP;exports.Ib=Nh;exports.Ic=_q;exports.J=$2;exports.Ja=w6;exports.Jb=Xu;exports.Jc=qo;exports.K=q2;exports.Ka=k6;exports.Kb=zh;exports.Kc=$q;exports.L=HI;exports.La=I6;exports.Lb=OO;exports.Lc=mD;exports.M=_I;exports.Ma=P6;exports.Mb=Jl;exports.Mc=jq;exports.N=BI;exports.Na=T6;exports.Nb=Za;exports.Nc=yb;exports.O=W2;exports.Oa=E6;exports.Ob=r3;exports.Oc=hD;exports.P=og;exports.Pa=C6;exports.Pb=o3;exports.Pc=yD;exports.Q=iR;exports.Qa=O6;exports.Qb=Ya;exports.Qc=bD;exports.R=aR;exports.Ra=th;exports.Rb=X3;exports.Rc=Uq;exports.S=tu;exports.Sa=M6;exports.Sb=fb;exports.Sc=ic;exports.T=ag;exports.Ta=VP;exports.Tb=rc;exports.Tc=bb;exports.U=sg;exports.Ua=zP;exports.Ub=oc;exports.Uc=pr;exports.V=G2;exports.Va=A6;exports.Vb=Ja;exports.Vc=Xq;exports.W=nu;exports.Wa=F6;exports.Wb=Q$;exports.Wc=Yq;exports.X=hl;exports.Xa=nh;exports.Xb=Af;exports.Xc=vD;exports.Y=Mg;exports.Ya=L6;exports.Yb=Ff;exports.Yc=eW;exports.Z=H8;exports.Za=D6;exports.Zb=pb;exports.Zc=tW;exports._=bl;exports._a=N6;exports._b=aq;exports._c=nW;exports.a=ba;exports.aa=Ag;exports.ab=_6;exports.ac=lq;exports.ad=oW;exports.b=il;exports.ba=_8;exports.bb=B6;exports.bc=gb;exports.bd=iW;exports.c=Ad;exports.ca=Fg;exports.cb=$6;exports.cc=dq;exports.d=Fd;exports.da=lu;exports.db=q6;exports.dc=fq;exports.e=lm;exports.ea=Wt;exports.eb=W6;exports.ec=pq;exports.f=rN;exports.fa=Ei;exports.fb=ZP;exports.fc=mq;exports.g=cm;exports.ga=eP;exports.gb=eT;exports.gc=gq;exports.h=p2;exports.ha=cu;exports.hb=X6;exports.hc=hq;exports.i=m2;exports.ia=Cr;exports.ib=xu;exports.ic=yq;exports.j=h2;exports.ja=Sl;exports.jb=oh;exports.jc=bq;exports.k=bI;exports.ka=qg;exports.kb=ih;exports.kc=J1;exports.l=fl;exports.la=jg;exports.lb=J6;exports.lc=eD;exports.m=je;exports.ma=X8;exports.mb=iT;exports.mc=Sq;exports.n=v2;exports.na=Y8;exports.nb=e_;exports.nc=wq;exports.o=x2;exports.oa=J8;exports.ob=aT;exports.oc=tD;exports.p=S2;exports.pa=e6;exports.pb=t_;exports.pc=kq;exports.q=_t;exports.qa=fu;exports.qb=n_;exports.qc=Iq;exports.r=Tr;exports.ra=Oa;exports.rb=r_;exports.rc=Rq;exports.s=w2;exports.sa=CP;exports.sb=qE;exports.sc=nD;exports.t=Co;exports.ta=Yg;exports.tb=Nl;exports.tc=rD;exports.u=mt;exports.ua=Il;exports.ub=Hl;exports.uc=Pq;exports.v=pl;exports.va=u6;exports.vb=r5;exports.vc=oD;exports.w=Km;exports.wa=OP;exports.wb=Ch;exports.wc=Tq;exports.x=k2;exports.xa=MP;exports.xb=Fi;exports.xc=iD;exports.y=Vm;exports.ya=f6;exports.yb=lo;exports.yc=Eq;exports.z=Ee;exports.za=Ci;exports.zb=$u;exports.zc=aD;