@docx-editor.dev/core 2.21.0 → 2.22.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.
- package/README.md +41 -35
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +10 -10
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +8 -8
- package/dist/binding.js +1 -1
- package/dist/{chunk-Q2B6HX3R.js → chunk-5RKCJ5DF.js} +1 -1
- package/dist/chunk-65GJRSZ5.cjs +18 -0
- package/dist/chunk-6TBRG6SA.cjs +20 -0
- package/dist/chunk-A72MJGY7.cjs +4 -0
- package/dist/chunk-AZ7QSAXH.js +4 -0
- package/dist/chunk-BL57VQ7E.js +1 -0
- package/dist/chunk-CB6RQ3GD.cjs +11 -0
- package/dist/chunk-GG4IAKFI.js +5 -0
- package/dist/chunk-HJYLFMLX.js +2 -0
- package/dist/chunk-HL6NO7IH.cjs +2 -0
- package/dist/chunk-HZQFGB2X.cjs +5 -0
- package/dist/{chunk-X5QNSISI.js → chunk-IWAUA732.js} +1 -1
- package/dist/chunk-OZXBAEWW.js +2 -0
- package/dist/{chunk-4EHMMSFR.cjs → chunk-P5PWSRNW.cjs} +1 -1
- package/dist/{chunk-BDAY2ETZ.js → chunk-PD5XKBJA.js} +1 -1
- package/dist/chunk-REMFTPDL.cjs +2 -0
- package/dist/{chunk-Z2ETEZRU.cjs → chunk-RLKX7BIP.cjs} +1 -1
- package/dist/chunk-UGLO2GA5.cjs +1 -0
- package/dist/chunk-UOQONZVQ.js +11 -0
- package/dist/chunk-VD2MWTR6.js +20 -0
- package/dist/chunk-VIXH2OVP.js +1 -0
- package/dist/chunk-W2JIZ5JH.js +18 -0
- package/dist/chunk-W5H62AWM.cjs +1 -0
- package/dist/chunk-X2LJDR53.cjs +5 -0
- package/dist/chunk-YQXY6TQ3.js +5 -0
- package/dist/{chunk-PYXMAUNR.cjs → chunk-YYFBYVW4.cjs} +1 -1
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +4 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +3 -3
- package/dist/contracts/document.d.ts +2 -2
- package/dist/contracts/editor.d.ts +8 -8
- package/dist/contracts/modules.d.ts +6 -6
- package/dist/contracts/types.d.ts +1 -1
- package/dist/{custom-node-writes-05qS32px.d.ts → custom-node-writes-Ck6eOiJ3.d.ts} +2 -2
- package/dist/{document-protection-Cr59VKLO.d.ts → document-protection-CMPEonQc.d.ts} +1 -1
- package/dist/{editor-BsLSz_7y.d.ts → editor-BKDVqXyk.d.ts} +75 -50
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +188 -26
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +31 -14
- package/dist/export.js +2 -2
- package/dist/{font-resolver-CzwdBJDE.d.ts → font-resolver-PBc8Vuxs.d.ts} +1 -1
- package/dist/{headless-document-view-B7nAiR7P.d.ts → headless-document-view-9wjJT20Y.d.ts} +2 -2
- package/dist/{image-resources-C4ilLzog.d.ts → image-resources-B0v-XaTM.d.ts} +2 -2
- package/dist/{index-zkvqBQ9o.d.ts → index-DQA53aR1.d.ts} +139 -20
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-BJKVTI6i.d.ts → layout-shaping-Dyr0ZSOI.d.ts} +5 -2
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +378 -33
- package/dist/layout.js +1 -1
- package/dist/{note-properties-MNztEj5s.d.ts → note-properties-D_lmG9xx.d.ts} +1 -1
- package/dist/{omml-equation-CbnW9yXd.d.ts → omml-equation-CfTm3jOK.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +7 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-Co_r0SZQ.d.ts → protocol-CkVDxyQ3.d.ts} +2 -2
- package/dist/{review-paragraph-order-EFaU7TqH.d.ts → review-paragraph-order-BjUs-tDd.d.ts} +1 -1
- package/dist/{revision-projection-DEIvpxiq.d.ts → revision-projection-DDVBYTIG.d.ts} +1 -1
- package/dist/{semantic-cell-selection-DXmfnDCw.d.ts → semantic-cell-selection-DW6qsmoC.d.ts} +6 -4
- package/dist/{semantic-interaction-BLu3M6Nn.d.ts → semantic-interaction-BNiYSBcB.d.ts} +1 -1
- package/dist/{semantic-paint-CPsihA6k.d.ts → semantic-paint-DE236npp.d.ts} +2 -2
- package/dist/{semantic-records-CqD0b5Ex.d.ts → semantic-records-C5OeXnaL.d.ts} +546 -567
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +19 -25
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-CwJDixNs.d.ts → tree-package-fragment-DBb97w3F.d.ts} +2 -2
- package/dist/{tree-session-contract-D9RRWE0C.d.ts → tree-session-contract-BYat3RKx.d.ts} +10 -5
- package/dist/{types-barrel-DLB11iSY.d.ts → types-barrel-ChGvWjkO.d.ts} +11 -5
- package/package.json +2 -2
- package/dist/chunk-44LQJIKH.cjs +0 -20
- package/dist/chunk-AFG7Q622.cjs +0 -2
- package/dist/chunk-AYMSP25Q.js +0 -4
- package/dist/chunk-B4KZSKF7.cjs +0 -5
- package/dist/chunk-BNZF6DYC.cjs +0 -18
- package/dist/chunk-BQXF2PFF.js +0 -2
- package/dist/chunk-GIHKVXEO.js +0 -2
- package/dist/chunk-ITNK6C5M.cjs +0 -3
- package/dist/chunk-MP3K4LC5.js +0 -1
- package/dist/chunk-MXOO7KRI.cjs +0 -11
- package/dist/chunk-NG6IQ4SI.js +0 -11
- package/dist/chunk-Q5JPPUNR.js +0 -5
- package/dist/chunk-S35UK656.cjs +0 -2
- package/dist/chunk-TE43S3LX.cjs +0 -1
- package/dist/chunk-VH2DLEZK.js +0 -20
- package/dist/chunk-VUNFWXHF.js +0 -1
- package/dist/chunk-WQFNWLNY.cjs +0 -4
- package/dist/chunk-WZX4UGRQ.js +0 -3
- package/dist/chunk-XS4FOHH6.js +0 -18
- package/dist/chunk-XZY4Q6PJ.cjs +0 -1
package/dist/chunk-44LQJIKH.cjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkTKQH7BNE_cjs=require('./chunk-TKQH7BNE.cjs'),chunkS35UK656_cjs=require('./chunk-S35UK656.cjs'),chunkXZY4Q6PJ_cjs=require('./chunk-XZY4Q6PJ.cjs'),chunkWQFNWLNY_cjs=require('./chunk-WQFNWLNY.cjs'),chunkAFG7Q622_cjs=require('./chunk-AFG7Q622.cjs'),chunkTE43S3LX_cjs=require('./chunk-TE43S3LX.cjs'),chunkBNZF6DYC_cjs=require('./chunk-BNZF6DYC.cjs'),chunkB4KZSKF7_cjs=require('./chunk-B4KZSKF7.cjs'),chunkITNK6C5M_cjs=require('./chunk-ITNK6C5M.cjs'),chunkBTQKU64Q_cjs=require('./chunk-BTQKU64Q.cjs'),chunkMXOO7KRI_cjs=require('./chunk-MXOO7KRI.cjs'),chunkUKVVUHZL_cjs=require('./chunk-UKVVUHZL.cjs'),fflate=require('fflate'),i18n=require('@docx-editor.dev/i18n');function vk(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var gh=false;function hh(e){if(gh)return;gh=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 go(e){if(e instanceof chunkUKVVUHZL_cjs.a)return e;if(e instanceof chunkWQFNWLNY_cjs.d)return new chunkUKVVUHZL_cjs.a(e.code,e.message,{request:vk(e.request),diagnostic:e.diagnostic});if(e instanceof chunkWQFNWLNY_cjs.z)return new chunkUKVVUHZL_cjs.a("overLimit",e.message,{diagnostic:e.message});if(e instanceof chunkWQFNWLNY_cjs.u){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)})}async function Ma(e,t){try{return await chunkWQFNWLNY_cjs.G(e,t)}catch(n){throw go(n)}}var xk=Object.freeze({scope:Object.freeze({kind:"body"}),isLoading:true,isOpening:false,parseError: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 yh="http://schemas.openxmlformats.org/wordprocessingml/2006/main",wk="http://schemas.openxmlformats.org/package/2006/content-types",bh="http://schemas.openxmlformats.org/package/2006/relationships",Ik="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",kk="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",Tk=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="${wk}"><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>`,Ck=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${bh}"><Relationship Id="rId1" Type="${Ik}" Target="word/document.xml"/></Relationships>`,Pk=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${bh}"><Relationship Id="rId1" Type="${kk}" Target="styles.xml"/></Relationships>`,Rk=[{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}],Ek=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>",Ok=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="${yh}"><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>`+Rk.map(Ek).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>',Fk=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document xmlns:w="${yh}"><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 Vd(){return fflate.zipSync({"[Content_Types].xml":fflate.strToU8(Tk),"_rels/.rels":fflate.strToU8(Ck),"word/_rels/document.xml.rels":fflate.strToU8(Pk),"word/document.xml":fflate.strToU8(Fk),"word/styles.xml":fflate.strToU8(Ok)})}var ho="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mk=(()=>{let e=new Int16Array(128).fill(-1);for(let t=0;t<ho.length;t+=1)e[ho.charCodeAt(t)]=t;return e})();function ss(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,a=r.length/4*3-o;if(a<=0||a>t)return null;let i=new Uint8Array(a),s=0;for(let l=0;l<r.length;l+=4){let d=0,u=0;for(let f=0;f<4;f+=1){let p=r.charCodeAt(l+f);if(p===61){if(l+f<r.length-o)return null;continue}let m=p<128?Mk[p]:-1;if(m<0)return null;d=d<<6|m,u+=6;}d<<=24-u,u>=12&&(i[s++]=d>>>16&255),u>=18&&(i[s++]=d>>>8&255),u>=24&&(i[s++]=d&255);}return s===a?i:null}function ls(e){let t=[],n="";for(let r=0;r<e.length;r+=3){let o=e[r],a=r+1<e.length?e[r+1]:0,i=r+2<e.length?e[r+2]:0;n+=ho[o>>2]+ho[(o&3)<<4|a>>4],n+=r+1<e.length?ho[(a&15)<<2|i>>6]:"=",n+=r+2<e.length?ho[i&63]:"=",n.length>=32768&&(t.push(n),n="");}return t.push(n),t.join("")}var Ak=16*1024*1024,xh=64*1024*1024,Sh="data-docx-fragment",wh="data-docx-fragment-end",Lk=ls;function Ih(e,t){if(!t)return `<div>${e}</div>`;let n=t.lastMarkCovered?"covered":"open";return `<div ${Sh}="${Lk(t.bytes)}" ${wh}="${n}">${e}</div>`}function vh(e,t){let n=`${t}="`,r=e.indexOf(n);if(r===-1||r>xh)return null;let o=r+n.length,a=e.indexOf('"',o);return a===-1?null:e.slice(o,a)}function ds(e,t=Ak){if(e.length>xh)return null;let n=vh(e,Sh);if(n===null||n.length===0)return null;let r=ss(n,t);if(r===null||r.byteLength===0)return null;let o=vh(e,wh);return {bytes:r,lastMarkCovered:o==="covered"}}function Br(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 jd=["single","words","double","thick","dotted","dottedHeavy","dash","dashedHeavy","dashLong","dashLongHeavy","dotDash","dashDotHeavy","dotDotDash","dashDotDotHeavy","wave","wavyHeavy","wavyDouble"],zd={Normal:"MsoNormal",ListParagraph:"MsoListParagraph",Title:"MsoTitle",Subtitle:"MsoSubtitle",Caption:"MsoCaption",Quote:"MsoQuote",IntenseQuote:"MsoIntenseQuote",BodyText:"MsoBodyText",FootnoteText:"MsoFootnoteText"},Wd=new Map([...Object.entries(zd).filter(([e])=>e!=="Normal").map(([e,t])=>[t,e]),["MsoListParagraphCxSpFirst","ListParagraph"],["MsoListParagraphCxSpMiddle","ListParagraph"],["MsoListParagraphCxSpLast","ListParagraph"]]);function kh(e){return e===void 0?null:/^Heading[7-9]$/.test(e)?`Mso${e}`:Object.hasOwn(zd,e)?zd[e]:null}var Ud=Object.fromEntries(chunkS35UK656_cjs.k),Gd={left:"left",start:"left",center:"center",right:"right",end:"right",both:"justify",distribute:"justify"};function Th(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:`"${chunkMXOO7KRI_cjs.Q(n)}"`}var Nk=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 $r(e){if(e===null)return null;let t=chunkMXOO7KRI_cjs.Ie(e,"val",chunkMXOO7KRI_cjs.da);if(t===void 0||t==="nil"||t==="none")return null;let n=Nk.get(t)??"solid",r=chunkMXOO7KRI_cjs.Ie(e,"sz",chunkMXOO7KRI_cjs.da),o=r!==void 0&&/^\d{1,4}$/.test(r)?Number.parseInt(r,10):0,a=o>0?o/8:.5,i=`${Math.round(a*100)/100}pt`,s=chunkMXOO7KRI_cjs.Ie(e,"color",chunkMXOO7KRI_cjs.da),l=s!==void 0&&/^[0-9A-Fa-f]{6}$/.test(s)?`#${s}`:"#000000";return `${i} ${n} ${l.toLowerCase()}`}function Ch(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 Dk=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"]]),Hk=new Set(jd);function Ph(e){if(e===null)return [];let t=chunkMXOO7KRI_cjs.Ie(e,"val",chunkMXOO7KRI_cjs.da),n=[],r=t===void 0?void 0:Dk.get(t);r!==void 0&&n.push(`text-decoration-style:${r}`),t!==void 0&&t!=="single"&&Hk.has(t)&&n.push(`text-underline:${t}`);let o=chunkMXOO7KRI_cjs.Ie(e,"color",chunkMXOO7KRI_cjs.da);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 Rh(e,t){return e===null||e<=0?"":`height:${Math.round(e/20*100)/100}pt;mso-height-rule:${t==="exact"?"exactly":"at-least"}`}function Eh(e,t,n,r){if(e.namespaceUri!==chunkMXOO7KRI_cjs.da)return "";let o=e.localName==="footnoteRef"?"footnote":e.localName==="endnoteRef"?"endnote":null,a=e.localName==="footnoteReference"?"footnote":e.localName==="endnoteReference"?"endnote":null,i=o??a;if(i===null)return "";let s=chunkMXOO7KRI_cjs.Ie(e,"id",chunkMXOO7KRI_cjs.da),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(i,l))return "";let d=i==="footnote",u=o!==null,f=d?"MsoFootnoteReference":"MsoEndnoteReference",p=d?"ftn":"edn",m=u?`#_${p}ref${l}`:`#_${p}${l}`,h=u?`_${p}${l}`:`_${p}ref${l}`;return `<a style="mso-${d?"footnote":"endnote"}-id:${p}${l}" href="${m}" name="${h}"><span class="${f}"><span style="mso-special-character:footnote">[${n(i,l)}]</span></span></a>`}function Oh(e){if(e.namespaceUri!==chunkMXOO7KRI_cjs.da||e.localName!=="ptab")return "";let t=chunkMXOO7KRI_cjs.Ie(e,"alignment",chunkMXOO7KRI_cjs.da),n=chunkMXOO7KRI_cjs.Ie(e,"relativeTo",chunkMXOO7KRI_cjs.da),r=chunkMXOO7KRI_cjs.Ie(e,"leader",chunkMXOO7KRI_cjs.da)??"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 st(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 Ah(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 Lh(e,t){for(let r of e.classList){let o=/^MsoHeading([1-9])$/.exec(r);if(o)return `Heading${o[1]}`;let a=/^Heading([1-9])$/.exec(r);if(a)return `Heading${a[1]}`;let i=Wd.get(r);if(i!==void 0)return i}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 Nh=262144,_k=4096,Bk=256,$k=2048,qk=8,Zk=new Set(["MsoNormal",...Wd.keys(),...Array.from({length:9},(e,t)=>`MsoHeading${t+1}`),...Array.from({length:9},(e,t)=>`Heading${t+1}`)]),Kk=new Map([["left","left"],["start","left"],["center","center"],["right","right"],["end","right"],["justify","both"]]),Vk=/^\s*(p|li|div)\.([A-Za-z][A-Za-z0-9]{0,31})\s*$/i;function zk(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 jk(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 Wk(e,t){for(let n=t+1;n<e.length;n+=1){let r=e[n];if(r===";")return n+1;if(r==="{")return jk(e,n)}return null}function Uk(e){let t=e.split(",");if(t.length===0||t.length>qk)return null;let n=[];for(let r of t){let o=Vk.exec(r);if(!o)return null;let a=o[2];if(!Zk.has(a))return null;n.includes(a)||n.push(a);}return n}function Gk(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 a=n.slice(r+1).trim().toLowerCase();if(a.length===0||a.length>32||a.includes("("))continue;let i=0;for(;i<a.length&&a.charCodeAt(i)>32;)i+=1;let s=Kk.get(a.slice(0,i));s!==void 0&&(t=s);}return t}function Xk(e){let t=new Map,n=()=>({ok:false,alignments:new Map});if(e.length===0)return {ok:true,alignments:t};if(e.length>Nh)return n();let r=zk(e),o=0,a=0;for(;o<r.length&&a<_k;){for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;if(o>=r.length)break;if(r[o]==="@"){let p=Wk(r,o);if(p===null)return n();o=p;continue}let i=r.indexOf("{",o);if(i<0)return n();let s=r.slice(o,i),l=r.indexOf("}",i+1);if(l<0)return n();let d=r.slice(i+1,l);if(a+=1,o=l+1,s.length>Bk||d.length>$k||d.includes("{"))return n();let u=Uk(s),f=Gk(d);if(!(!u||f===void 0))for(let p of u)t.set(p,f);}for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;return o<r.length?n():{ok:true,alignments:t}}function Dh(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>Nh)return new Map;let a=Xk(o);if(!a.ok)return new Map;for(let[i,s]of a.alignments)t.set(i,s);}return t}var Yk=262144;function Hh(e,t=Yk){let n=e.getElementsByTagName("style"),r="";for(let o=0;o<n.length&&o<16;o+=1){let a=n[o]?.textContent??"";a.length>t||r.length+a.length>t||(r+=`
|
|
3
|
-
${a}`);}return r}function _h(e,t,n){for(let o of t.classList){let a=n.get(o);if(a!==void 0){e.jc=a;break}}let r=t.getAttribute("align")?.trim().toLowerCase();r==="left"||r==="center"||r==="right"?e.jc=r:r==="justify"&&(e.jc="both");}function Xd(e,t,n,r){let o=st(t.get(n)??"");if(o!==null&&o>0)return o/.75;let a=e.getAttribute(n)?.trim()??"";if(!/^[1-9]\d{0,4}$/.test(a))return null;let i=Number.parseInt(a,10);return r?i/.75:i}function yo(e){return e.nodeType===1}function tt(e){return e.tagName.toLowerCase()}var Qk=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(":"))),Jk=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"]]),eT=/url\s*\(|image\s*\(|image-set\s*\(|element\s*\(|cross-fade\s*\(/i,tT=new Map(jd.map(e=>[e.toLowerCase(),e])),Fh=new WeakMap;function Je(e){let t=Fh.get(e);if(t!==void 0)return t;let n=new Map;Fh.set(e,n);let r=e.getAttribute("style");if(!r||r.length>8192)return n;for(let o of r.split(";")){let a=o.indexOf(":");if(a<=0)continue;let i=o.slice(0,a).trim().toLowerCase(),s=o.slice(a+1).trim();i.length>0&&s.length>0&&(n.delete(i),n.set(i,s));}return n}function cr(e){let t=e.trim().toLowerCase(),n=Qk.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[i,s,l]=o[1];return `${i}${i}${s}${s}${l}${l}`.toUpperCase()}let a=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,[^)]*)?\)$/.exec(t);if(a){let i=s=>Math.min(255,Number.parseInt(s,10)).toString(16).padStart(2,"0");return `${i(a[1])}${i(a[2])}${i(a[3])}`.toUpperCase()}return null}function nT(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(!(t.length===0||t.length>32||/[^a-z]/.test(t)))return Jk.get(t)}function Mh(e){if(e===void 0)return null;let t=e.trim();if(t.length===0||t.length>128||eT.test(t))return null;let n=t.toLowerCase();return n==="transparent"||n==="none"?null:cr(t)}function Wt(e,t,n){return Math.min(n,Math.max(t,e))}function us(e){let t=null;for(let[n,r]of e)if(n==="background")t=Mh(r);else if(n==="background-color"){let o=r.trim().toLowerCase();if(o==="transparent"||o==="none"||o==="initial"){t=null;continue}let a=Mh(r);a!==null&&(t=a);}return t}var rT=new Set(["left","center","right","decimal","bar"]),oT=new Map([["dotted","dot"],["dot","dot"],["dashed","hyphen"],["hyphen","hyphen"],["lined","underscore"],["underscore","underscore"],["middledot","middleDot"],["heavy","heavy"]]);function aT(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(rT.has(o)){t=o;continue}if(o==="list"){t="left";continue}let a=oT.get(o);if(a!==void 0){n=a;continue}let i=st(o);if(!(i===null||i<0)){if(r.push({val:t,posTwips:Wt(Math.round(i*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 iT=new Map([["solid","single"],["single","single"],["double","double"],["dotted","dotted"],["dashed","dashed"]]);function Yd(e){return e.trim().replace(/\([^)]*\)/g,t=>t.replace(/\s+/g,"")).split(/\s+/)}var sT=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function cs(e){if(e===void 0||e.length===0||e.length>128)return;let t,n=false,r,o;for(let a of Yd(e)){let i=a.toLowerCase();if(i==="none"||i==="hidden"){n=true;continue}let s=iT.get(i);if(s!==void 0){t=s;continue}let l=sT.get(a.toLowerCase())??st(a);if(l!==null){r=l;continue}let d=cr(a);if(d!==null){o=d;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:Wt(Math.round(r*8),2,96),color:o??"000000"}}function fs(e){let t=e.getAttribute("style");return t?/mso-list\s*:[^;]{0,128}ignore/i.test(t.slice(0,8192)):false}function Qd(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 Jd(e,t){if(t.size===0)return e;let n={...e},r=t.get("font-weight")?.toLowerCase();if(r!==void 0){let k=Number.parseInt(r,10);r==="bold"||k>=600?n.bold=true:(r==="normal"||k<600)&&(n.bold=false);}let o=t.get("font-style");o!==void 0&&(n.italic=o.toLowerCase().includes("italic"));let a=(t.get("text-decoration")??t.get("text-decoration-line"))?.toLowerCase();a!==void 0&&(a.includes("underline")&&(n.underline=true),a.includes("line-through")&&(n.strike=true),a.includes("none")&&(n.underline=n.strike=false));let i=t.get("font-variant")?.toLowerCase();i!==void 0&&(i.includes("small-caps")?n.smallCaps=true:(i.includes("normal")||i.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 k of l.trim().split(/\s+/)){let E=k.toLowerCase(),C=tT.get(E);if(C!==void 0)n.underline=true,n.underlineVal=C;else {let H=cr(k);H!==null&&(n.underlineColor=H);}}let d=t.get("text-decoration-style")?.trim().toLowerCase();if(d==="double"&&n.strike&&!n.underline&&(n.doubleStrike=true),n.underline){d==="double"?n.underlineVal="double":d==="dotted"?n.underlineVal="dotted":d==="dashed"?n.underlineVal="dash":d==="wavy"&&(n.underlineVal="wave");let k=cr(t.get("text-decoration-color")??"");k!==null&&(n.underlineColor=k);}let u=cr(t.get("color")??"");u&&(n.color=u);let f=nT(t.get("mso-highlight"));if(f)n.highlight=f,delete n.shdFill;else {let k=us(t);k&&(n.shdFill=k);}let p=st(t.get("font-size")??"");p!==null&&p>0&&(n.szHalfPoints=Wt(Math.round(p*2),2,3276));let m=t.get("font-family");if(m!==void 0){let k=m.split(",")[0].trim().replace(/^['"]|['"]$/g,"");k.length>0&&k.length<=64&&(n.font=k);}let h=st(t.get("letter-spacing")??"");h!==null&&(n.charSpacingTwentieths=Wt(Math.round(h*20),-31680,31680));let x=t.get("vertical-align")?.trim().toLowerCase();x==="sub"?n.vertAlign="subscript":x==="super"&&(n.vertAlign="superscript");let b=Br(t.get("mso-ansi-language")),y=Br(t.get("mso-fareast-language")),I=Br(t.get("mso-bidi-language"));return b!==null&&(n.langVal=b),y!==null&&(n.langEastAsia=y),I!==null&&(n.langBidi=I),t.get("direction")?.trim().toLowerCase()==="rtl"&&(n.rtl=true),n}function La(e,t){let n=Jd(e,Je(t)),r=Br(t.getAttribute("lang"));return r!==null&&(n={...n,lang:r}),t.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(n={...n,rtl:true}),n}function Bh(e,t){let n=t.get("text-align")?.toLowerCase();n==="left"||n==="start"?e.jc="left":n==="center"?e.jc="center":n==="right"||n==="end"?e.jc="right":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(I=>st(I));if(y.length>=1&&y.length<=4&&!y.some(I=>I===null)){let[I,k=I,E=I,C=k]=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=I??null,r.right=k??null,r.bottom=E??null,r.left=C??null;}}let a=st(t.get("margin-left")??"")??r.left;a!==null&&(a>0||a===0&&!e.numPr)&&(e.indLeftTwips=Wt(Math.round(a*20),0,31680));let i=st(t.get("margin-right")??"")??r.right;i!==null&&i>=0&&(e.indRightTwips=Wt(Math.round(i*20),0,31680));let s=st(t.get("text-indent")??"");if(s!==null&&s!==0){let y=Wt(Math.round(s*20),-31680,31680);y!==0&&(e.firstLineTwips=y);}let l=st(t.get("margin-top")??"")??r.top;l!==null&&l>=0&&(e.spacingBeforeTwips=Wt(Math.round(l*20),0,31680));let d=st(t.get("margin-bottom")??"")??r.bottom;d!==null&&d>=0&&(e.spacingAfterTwips=Wt(Math.round(d*20),0,31680));let u=t.get("line-height")?.trim()??"",f=t.get("mso-line-height-rule")?.trim().toLowerCase(),p=st(u);if(p!==null&&p>0)e.lineTwentieths=Wt(Math.round(p*20),24,31680),e.lineRule=f==="exactly"?"exact":"atLeast";else if(/^\d+(\.\d+)?$/.test(u)&&Number.parseFloat(u)>0)e.lineTwentieths=Wt(Math.round(240*Number.parseFloat(u)),24,9600),e.lineRule="auto";else if(/^\d+(\.\d+)?%$/.test(u)){let y=Number.parseFloat(u);y>0&&(e.lineTwentieths=Wt(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 m=us(t);m&&(e.shdFill=m);let h=aT(t.get("tab-stops"));h!==void 0&&(e.tabs=h);let x=cs(t.get("mso-border-alt"))??cs(t.get("border")),b={};for(let y of ["top","left","bottom","right"]){let I=cs(t.get(`mso-border-${y}-alt`))??cs(t.get(`border-${y}`))??x;I!==void 0&&I!=="suppressed"&&(b[y]=I);}Object.keys(b).length>0&&(e.borders=b);}var lT="http://schemas.openxmlformats.org/drawingml/2006/picture",dT=/^data:image\/(?:png|jpeg|jpg|gif|bmp|webp|svg\+xml|tiff|tif|x-emf|emf|x-wmf|wmf);base64,([A-Za-z0-9+/=]+)$/i,cT=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 $h(e,t,n){return Math.min(n,Math.max(t,e))}function qh(e,t,n,r){let o=e.getAttribute("src");if(o===null||o.length>n.maxImageBytes*2)return;let a=dT.exec(o);if(!a)return;let i=n.mediaBySrc.get(o),s=i===void 0?void 0:n.media.get(i),l=s??ss(a[1],n.maxImageBytes);if(l==null)return;let d=chunkMXOO7KRI_cjs.ub(l),u=cT.get(d);if(u===void 0)return;let f=d==="image/png"||d==="image/jpeg"||d==="image/gif"||d==="image/bmp"||d==="image/webp"?chunkMXOO7KRI_cjs.zb(l,d):null,p=Je(e),m=Xd(e,p,"width",n.wordHtml),h=Xd(e,p,"height",n.wordHtml);f!==null?m===null&&h===null?(m=f.pixelWidth*96/(f.dpiX??96),h=f.pixelHeight*96/(f.dpiY??96)):m!==null&&h===null?h=m*f.pixelHeight/f.pixelWidth:m===null&&h!==null&&(m=h*f.pixelWidth/f.pixelHeight):m!==null&&h===null?h=m*2/3:m===null&&h!==null&&(m=h*3/2);let x=m===null?381e4:$h(Math.round(m*9525),9525,3e7),b=h===null?254e4:$h(Math.round(h*9525),9525,3e7),y=s===void 0?void 0:i;y===void 0&&(n.imageCount+=1,y=`word/media/image${n.imageCount}.${u}`,n.media.set(y,l),n.mediaBySrc.set(o,y),n.mediaExtensions.has(u)||n.mediaExtensions.set(u,d));let I=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="${x}" cy="${b}"/><wp:docPr id="${n.docPrId}" name=""/><wp:cNvGraphicFramePr/><a:graphic><a:graphicData uri="${lT}"><pic:pic><pic:nvPicPr><pic:cNvPr id="0" name="" descr=""/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${I}"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${x}" cy="${b}"/></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 uT="http://schemas.openxmlformats.org/wordprocessingml/2006/main",fT='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',Zh=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}];function Kh(e,t,n){let r=720*(n+1);if(e==="bullet"){let a=Zh[n%Zh.length];return `<w:lvl w:ilvl="${n}"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="${chunkMXOO7KRI_cjs.N(a.text)}"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${r}" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="${a.font}" w:hAnsi="${a.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 pT=new Map([["i",1],["v",5],["x",10],["l",50],["c",100],["d",500],["m",1e3]]),mT=new Map([["alpha-lower","lowerLetter"],["alpha-upper","upperLetter"],["roman-lower","lowerRoman"],["roman-upper","upperRoman"],["bullet","bullet"],["image","bullet"],["decimal","decimal"],["arabic","decimal"]]),Vh=/@list\s+l(\d{1,4}):level([1-9])(?:[\s:]+lfo(\d{1,4}))?\s*\{([^{}]{0,2048})\}/g;function zh(e){let t=new Map;if(e.length===0||e.length>262200)return t;Vh.lastIndex=0;let n,r=0;for(;(n=Vh.exec(e))!==null&&r<512;){r+=1;let o="decimal",a=null;for(let s of n[4].split(";")){let l=s.indexOf(":");if(l<=0)continue;let d=s.slice(0,l).trim().toLowerCase(),u=s.slice(l+1).trim().toLowerCase();d==="mso-level-number-format"?o=mT.get(u)??null:d==="mso-level-start-at"&&/^\d{1,5}$/.test(u)&&(a=Math.min(32767,Number.parseInt(u,10)));}if(o===null)continue;let i=n[3]===void 0?`l${n[1]}:level${n[2]}`:`l${n[1]}:level${n[2]}:lfo${n[3]}`;t.has(i)||t.set(i,{kind:o,start:a});}return t}function jh(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?Wh(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 gT=/^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$/;function Wh(e){let t=e.toLowerCase();if(!gT.test(t))return null;let n=0,r=0;for(let o of t){let a=pT.get(o);if(a===void 0)return null;n+=a,r>0&&r<a&&(n-=2*r),r=a;}return n>0&&n<=32767?n:null}function Uh(e){let t=e.trim().replace(/^\(/,""),n=/^(\d{1,5}(?:\.\d{1,5})*)[.)]/.exec(t);if(n){let i=n[1].split(".");return {kind:"decimal",start:Math.min(32767,Number.parseInt(i[i.length-1],10))}}let r=/^([A-Za-z])[.)]/.exec(t);if(r){let i=r[1].toLowerCase();if(i==="i"||i==="v"||i==="x"){let l=i==="i"?1:i==="v"?5:10;return {kind:r[1]===i?"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 i=o[1],s=i===i.toLowerCase(),l=/^([A-Za-z])\1+$/.test(i);if(!l||/^[iI]+$/.test(i)){let d=Wh(i);if(d!==null)return {kind:s?"lowerRoman":"upperRoman",start:d}}if(l){let d=i.toLowerCase().charCodeAt(0),u=Math.min(32767,(i.length-1)*26+(d-96));return {kind:s?"lowerLetter":"upperLetter",start:u}}}let a=/\d{1,5}/.exec(t);return a?{kind:"decimal",start:Math.min(32767,Number.parseInt(a[0],10))}:{kind:"bullet",start:1}}var hT=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 Gh(e){if(e.localName.toLowerCase()!=="ol")return "bullet";let t=Je(e).get("list-style-type")?.trim().toLowerCase(),n=t===void 0?void 0:hT.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 ec(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 Xh(e){let t=e.map((r,o)=>{let a=r.levels.get(0)??r.levels.values().next().value??{kind:"decimal"},i=Array.from({length:9},(s,l)=>{let d=r.levels.get(l);return d?Kh(d.kind,d.start,l):Kh(a.kind==="bullet"?"bullet":"decimal",1,l)}).join("");return `<w:abstractNum w:abstractNumId="${o}"><w:multiLevelType w:val="hybridMultilevel"/>${i}</w:abstractNum>`}).join(""),n=e.map((r,o)=>`<w:num w:numId="${r.numId}"><w:abstractNumId w:val="${o}"/></w:num>`).join("");return `${fT}<w:numbering xmlns:w="${uT}">${t}${n}</w:numbering>`}function ln(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 i=0;i<t.length;i+=1)r=(Math.imul(r,33)^t.charCodeAt(i))>>>0;let o=`_${r.toString(36)}`,a=n.slice(0,40-o.length);return /^[A-Za-z_]/.test(a)||(a=`_${a.slice(0,39-o.length)}`),`${a}${o}`}function Yh(e){if(e===null)return false;if(e.startsWith("#"))return ln(e.slice(1))!==null;let t=chunkMXOO7KRI_cjs.L(e);return t?.ok===true&&t.href.length>0}function Qh(e,t){if(e!==void 0&&e.startsWith("#")){let o=ln(e.slice(1)),a=ln(t)??o;return a===null?null:`#${a}`}let n=e===void 0?null:chunkMXOO7KRI_cjs.L(e),r=ln(t);return n?.ok===true&&n.href.length>0?r===null?n.href:`${n.href.split("#")[0]}#${r}`:r===null?null:`#${r}`}function Jh(){let e=null;return (t,n,r)=>{if(e!==null&&e.html===t&&e.key===n){let i=e.value;return e=null,i}let o=r(),a={html:t,key:n,value:o};return e=a,setTimeout(()=>{e===a&&(e=null);},0),o}}var yT=/^(ftn|edn)([1-9]\d{0,9})$/i,bT={footnote:"ftn",endnote:"edn"};function ey(e,t){let n=e===null?null:yT.exec(e);if(!n||n[1].toLowerCase()!==bT[t])return null;let r=Number.parseInt(n[2],10);return r<=2147483647?r:null}function tc(e){for(let t of ["footnote","endnote"]){let n=e.get(`mso-${t}-id`),r=ey(n??null,t);if(r!==null)return {kind:t,id:r}}return null}function vT(e,t){let n=t.get("mso-element")?.trim().toLowerCase();if(n!=="footnote"&&n!=="endnote")return null;let r=ey(e.getAttribute("id"),n);return r===null?null:{kind:n,id:r}}function ty(e){let t=[],n=e.getElementsByTagName("div");for(let r=0;r<n.length&&t.length<2048;r+=1){let o=n[r],a=vT(o,Je(o));a!==null&&t.push({...a,element:o});}return t}function ny(e,t,n){let r=new Map(t.map(i=>[i.element,i])),o=i=>{let s=i.parentElement;for(let l=0;s!==null&&l<128;l+=1){let d=r.get(s);if(d!==void 0)return d;s=s.parentElement;}return null},a=e.getElementsByTagName("a");for(let i=0;i<a.length&&i<2e4;i+=1){let s=a[i],l=tc(Je(s));if(l===null)continue;let d=o(s);d!==null&&d.kind===l.kind&&d.id===l.id||n[l.kind].add(l.id);}}function ry(e){let t=e.get("mso-element")?.trim().toLowerCase();return t==="footnote-list"||t==="endnote-list"}var xT=/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(footnote|endnote)Reference w:id="(\d{1,10})"\/><\/w:r>/g;function bo(e,t,n){return e.replace(xT,(r,o,a)=>{let i=`${o}:${a}`;return t.has(i)?n?.get(i)??"":r})}function nc(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">${n}</w:${e}s>`}function oy(e,t,n,r){let o=new Set,a={footnote:new Set,endnote:new Set},i=()=>{a.footnote.clear(),a.endnote.clear();let s=[],l=(d,u)=>{o.has(`${d}:${u}`)||!e.notes[d].has(u)||a[d].has(u)||(a[d].add(u),s.push({kind:d,id:u}));};for(let d of ["footnote","endnote"])for(let u of e.bodyNoteRefs[d])l(d,u);for(let d of o)for(let u of e.noteNoteRefs.get(d)??[])l(u.kind,u.id);for(;s.length>0;){let d=s.pop();for(let u of e.noteNoteRefs.get(`${d.kind}:${d.id}`)??[])l(u.kind,u.id);}};for(;;){i();let s=false;for(let l of ["footnote","endnote"]){for(let d of e.notes[l].keys()){let u=`${l}:${d}`;if(!(a[l].has(d)||o.has(u))){o.add(u),s=true;break}}if(s)break}if(!s)break}if(o.size>0)for(let s of ["footnote","endnote"])for(let[l,d]of e.notes[s])o.has(`${s}:${l}`)||e.notes[s].set(l,d.map(u=>bo(u,o,e.noteMarkFallbacks)));for(let s of ["footnote","endnote"])for(let[l,d]of [...e.notes[s]]){if(!o.has(`${s}:${l}`))continue;e.notes[s].delete(l),t[s].delete(l);let u=new Map;for(let f of d){let p=bo(f.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,(m,h,x)=>{let b=u.get(x);if(b===void 0){let y=e.noteRels[s].find(I=>I.id===x);if(y===void 0)return m;b=r(e,y.type,y.target,y.external),u.set(x,b);}return ` r:${h}="${b}"`});n.push(p),e.lastMarkCovered=false;}}}function rc(e,t,n,r=1,o=0){let a=e.lists.get(t);if(a)return a.levels.has(o)||a.levels.set(o,{kind:n,start:r}),a.numId;let i=String(1001+e.lists.size),s={numId:i,levels:new Map([[o,{kind:n,start:r}]])};return e.lists.set(t,s),e.listsByNumId.set(i,s),i}function ay(e,t,n,r){let o=t.get("mso-list");if(o===void 0)return;let a=/\bl(\d{1,4})\s+level(\d{1,2})\b/i.exec(o);if(!a)return;let i=Math.min(Math.max(Number.parseInt(a[2],10)-1,0),8),s=ST(e,n),l=/\blfo(\d{1,4})\b/i.exec(o),d=(l!==null?n.listDefinitions.get(`l${a[1]}:level${a[2]}:lfo${l[1]}`):void 0)??n.listDefinitions.get(`l${a[1]}:level${a[2]}`),u,f;d!==void 0?(u=d.kind,f=jh(s,u)??d.start??1):{kind:u,start:f}=Uh(s);let m=`mso:${r===void 0?"":`${r.kind}${r.id}:`}l${a[1]}${l?`:lfo${l[1]}`:""}`;return {numId:rc(n,m,u,f,i),ilvl:i}}function ST(e,t){let n="",r=(o,a)=>{if(!(n.length>0||a>8||t.nodesLeft<=0)&&yo(o)){if(fs(o)){n=(o.textContent??"").slice(0,16);return}for(let i of Array.from(o.childNodes))r(i,a+1);}};for(let o of Array.from(e.childNodes))r(o,0);return n}var wT="http://schemas.openxmlformats.org/package/2006/relationships",IT="http://schemas.openxmlformats.org/package/2006/content-types",kT="application/vnd.openxmlformats-package.relationships+xml",ic='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',TT="http://schemas.openxmlformats.org/wordprocessingml/2006/main",ac="http://schemas.openxmlformats.org/officeDocument/2006/relationships",CT="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",PT="http://schemas.openxmlformats.org/drawingml/2006/main",RT="http://schemas.openxmlformats.org/drawingml/2006/picture",iy={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 oc(e){let t=e.map(n=>`<Relationship Id="${chunkMXOO7KRI_cjs.N(n.id)}" Type="${chunkMXOO7KRI_cjs.N(n.type)}" Target="${chunkMXOO7KRI_cjs.N(n.target)}"${n.external?' TargetMode="External"':""}/>`).join("");return `${ic}<Relationships xmlns="${wT}">${t}</Relationships>`}function ET(e){let t=new Map;t.set("word/document.xml",chunkMXOO7KRI_cjs.Sa(e.documentXml)),t.set("word/_rels/document.xml.rels",chunkMXOO7KRI_cjs.Sa(oc(e.rels))),t.set("_rels/.rels",chunkMXOO7KRI_cjs.Sa(oc([{id:"rId1",type:`${ac}/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="${iy.document}"/>`;for(let[a,i]of n)i!==void 0&&(t.set(`word/${a}.xml`,chunkMXOO7KRI_cjs.Sa(i)),r+=`<Override PartName="/word/${a}.xml" ContentType="${iy[a]}"/>`);for(let[a,i]of [["footnotes",e.footnotesRels],["endnotes",e.endnotesRels]])i!==void 0&&i.length>0&&t.set(`word/_rels/${a}.xml.rels`,chunkMXOO7KRI_cjs.Sa(oc(i)));for(let[a,i]of e.media)t.set(a,i);let o=`<Default Extension="rels" ContentType="${kT}"/><Default Extension="xml" ContentType="application/xml"/>`;for(let[a,i]of e.mediaExtensions)o+=`<Default Extension="${chunkMXOO7KRI_cjs.N(a)}" ContentType="${chunkMXOO7KRI_cjs.N(i)}"/>`;return t.set("[Content_Types].xml",chunkMXOO7KRI_cjs.Sa(`${ic}<Types xmlns="${IT}">${o}${r}</Types>`)),chunkMXOO7KRI_cjs.Ra(t)}function sy(e){let t=[...e.rels],n=o=>{t.push({id:`rId${t.length+1}`,type:`${ac}/${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=`${ic}<w:document xmlns:w="${TT}" xmlns:r="${ac}" xmlns:wp="${CT}" xmlns:a="${PT}" xmlns:pic="${RT}"><w:body>${e.blocks.join("")}</w:body></w:document>`;return ET({documentXml:r,rels:t,...e.lists.length>0?{numberingXml:Xh(e.lists)}:{},...e.notes.footnote.size>0?{footnotesXml:nc("footnote",e.notes.footnote),footnotesRels:e.noteRels.footnote}:{},...e.notes.endnote.size>0?{endnotesXml:nc("endnote",e.notes.endnote),endnotesRels:e.noteRels.endnote}:{},media:e.media,mediaExtensions:e.mediaExtensions})}function sc(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 ur(e){let t="";if(e.rStyle!==void 0&&(t+=`<w:rStyle w:val="${chunkMXOO7KRI_cjs.N(e.rStyle)}"/>`),e.font!==void 0){let i=chunkMXOO7KRI_cjs.N(sc(e.font));t+=e.rtl?`<w:rFonts w:cs="${i}"/>`:`<w:rFonts w:ascii="${i}" w:hAnsi="${i}"/>`;}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="${chunkMXOO7KRI_cjs.N(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 a=`${n===void 0?"":` w:val="${chunkMXOO7KRI_cjs.N(n)}"`}${r===void 0?"":` w:eastAsia="${chunkMXOO7KRI_cjs.N(r)}"`}${o===void 0?"":` w:bidi="${chunkMXOO7KRI_cjs.N(o)}"`}`;return a.length>0&&(t+=`<w:lang${a}/>`),t.length>0?`<w:rPr>${t}</w:rPr>`:""}function ps(e,t){return `<w:r>${ur(t)}<w:t xml:space="preserve">${chunkMXOO7KRI_cjs.M(sc(e))}</w:t></w:r>`}function OT(e){let t="";if(e.styleId!==void 0&&(t+=`<w:pStyle w:val="${chunkMXOO7KRI_cjs.N(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="${chunkMXOO7KRI_cjs.N(e.numPr.numId)}"/></w:numPr>`),e.borders!==void 0){let r="";for(let o of ["top","left","bottom","right"]){let a=e.borders[o];a!==void 0&&(r+=`<w:${o} w:val="${a.val}" w:sz="${a.szEighthPoints}" w:space="0" w:color="${a.color}"/>`);}r.length>0&&(t+=`<w:pBdr>${r}</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(r=>`<w:tab w:val="${r.val}" w:pos="${r.posTwips}"`+(r.leader===void 0?"/>":` w:leader="${r.leader}"/>`)).join("")}</w:tabs>`),e.bidi&&(t+="<w:bidi/>"),e.spacingBeforeTwips!==void 0||e.spacingAfterTwips!==void 0||e.lineTwentieths!==void 0){let r="<w:spacing";e.spacingBeforeTwips!==void 0&&(r+=` w:before="${e.spacingBeforeTwips}"`),e.spacingAfterTwips!==void 0&&(r+=` w:after="${e.spacingAfterTwips}"`),e.lineTwentieths!==void 0&&(r+=` w:line="${e.lineTwentieths}" w:lineRule="${e.lineRule??"auto"}"`),t+=`${r}/>`;}let n=e.firstLineTwips;if(e.indLeftTwips!==void 0||e.indRightTwips!==void 0||n!==void 0){let r="<w:ind";e.indLeftTwips!==void 0&&(r+=` w:left="${e.indLeftTwips}"`),e.indRightTwips!==void 0&&(r+=` w:right="${e.indRightTwips}"`),n!==void 0&&(r+=n>=0?` w:firstLine="${n}"`:` w:hanging="${-n}"`),t+=`${r}/>`;}return e.jc!==void 0&&(t+=`<w:jc w:val="${e.jc}"/>`),t.length>0?`<w:pPr>${t}</w:pPr>`:""}function qr(e,t){return `<w:p>${OT(e)}${t.join("")}</w:p>`}var dy={h1:64,h2:52,h3:44,h4:36,h5:32,h6:28};function ms(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 FT=/^(?:<w:bookmark(?:Start|End)\b[^>]*\/>)+$/,ly=new WeakMap;function lc(e){let t=ly.get(e);for(t||(t={checked:0,furniture:true},ly.set(e,t));t.furniture&&t.checked<e.length;)t.furniture=FT.test(e[t.checked]),t.checked+=1;return t.furniture}function dn(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var fr=31680;function zn(e,t,n){return Math.min(n,Math.max(t,e))}function cy(e){let t=st(Je(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 MT(e){return Zr(e,"colspan",63)}function uy(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 Zr(e,t,n){let r=e.getAttribute(t);return r===null||!/^\d{1,4}$/.test(r.trim())?1:zn(Number.parseInt(r,10),1,n)}function fy(e,t){let n=(Je(e).get("width")??e.getAttribute("width")??"").trim(),r=/^(\d{1,3}(?:\.\d+)?)%$/.exec(n);if(r)return {xml:`<w:tblW w:w="${zn(Math.round(Number.parseFloat(r[1])*50),50,5e3)}" w:type="pct"/>`,twips:t};let o=cy(e);if(o===null)return {xml:'<w:tblW w:w="0" w:type="auto"/>',twips:t};let a=zn(Math.round(o*20),1,fr);return {xml:`<w:tblW w:w="${a}" w:type="dxa"/>`,twips:a}}function py(e){let n=Je(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 my(e){let t=Je(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",a=` w:horzAnchor="${o(n)}" w:vertAnchor="${o(r)}"`,i=t.get("mso-table-left")?.trim().toLowerCase();if(i==="left"||i==="center"||i==="right")a+=` w:tblpXSpec="${i}"`;else {let l=st(i??"");l!==null&&(a+=` w:tblpX="${zn(Math.round(l*20),-fr,fr)}"`);}let s=st(t.get("mso-table-top")??"");return s!==null&&(a+=` w:tblpY="${zn(Math.round(s*20),-fr,fr)}"`),`<w:tblpPr${a}/>`}function gy(e,t,n){let r=Math.max(1,Math.floor(n/t)),o=-1,a=Array.from({length:t},()=>r),i=new Array(t).fill(null);for(let u of e){let f=Array.from({length:t},()=>r),p=0,m=0,h=i.map(y=>y?y.span:null);for(let y=0;y<t;y+=1){let I=i[y];I&&(I.remaining-=1,I.remaining<=0&&(i[y]=null));}let x=Array.from(u.children).filter(y=>/^t[dh]$/.test(tt(y))),b=0;for(;m<t;){let y=h[m];if(y!==null){m+=y;continue}let I=x[b];if(I===void 0)break;b+=1;let k=Math.min(MT(I),t-m);for(let H=m+1;H<m+k;H+=1)if(h[H]!==null){k=H-m;break}let E=Zr(I,"rowspan",1e3);E>1&&(i[m]={remaining:E-1,span:k});let C=cy(I);if(C!==null){let H=zn(Math.round(C*20/k),1,fr);for(let A=0;A<k;A+=1)f[m+A]=H;p+=k;}m+=k;}p>o&&(o=p,a=f);}let s=a.reduce((u,f)=>u+f,0);if(s<=0)return a;let l=a.map(u=>Math.max(1,Math.round(u*n/s))),d=n-l.reduce((u,f)=>u+f,0);return l[l.length-1]=Math.max(1,l[l.length-1]+d),l}function dc(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 hy=new Map([["solid","single"],["double","double"],["dotted","dotted"],["dashed","dashed"],["none","nil"],["hidden","nil"]]),yy=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function by(e){return zn(Math.round(e*8),2,96)}function Sn(e){if(e===void 0||e.length===0||e.length>128)return;let t,n,r;for(let o of Yd(e)){let a=hy.get(o.toLowerCase());if(a!==void 0){t=a;continue}let i=yy.get(o.toLowerCase())??st(o);if(i!==null){n=i;continue}let s=cr(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:by(n),color:r??"000000"}}}function gs(e,t){let n=e.get(`${t}-style`)?.trim();if(n===void 0||n.length===0||n.length>64)return;let r=hy.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],a=o===void 0||o.length>64?null:yy.get(o.toLowerCase())??st(o);if(a!==null&&a<=0)return;let i=e.get(`${t}-color`)?.trim().split(/\s+/)[0],s=i===void 0||i.length>64?null:cr(i);return {val:r,size:a===null?4:by(a),color:s??"000000"}}function vy(e,t){return `<w:${e} w:val="${t.val}" w:sz="${t.size}" w:space="0" w:color="${t.color}"/>`}function xy(e,t=false){let n=Je(e),o=Sn(n.get("mso-border-alt"))??Sn(n.get("border"))??gs(n,"border")??(e.getAttribute("border")?.trim()&&e.getAttribute("border")?.trim()!=="0"?{val:"single",size:4,color:"auto"}:void 0),a=[["top","top"],["left","left"],["bottom","bottom"],["right","right"],["insideH","insideh"],["insideV","insidev"]],i="";for(let[s,l]of a){let d=dn(l,t),u=Sn(n.get(`mso-border-${d}-alt`))??Sn(n.get(`mso-border-${d}`))??Sn(n.get(`border-${d}`))??gs(n,`border-${d}`)??o;u!==void 0&&(i+=vy(s,u));}return i.length>0?`<w:tblBorders>${i}</w:tblBorders>`:""}function Sy(e){let t=Je(e),n=st(t.get("height")??"");if(n===null||n<=0)return "";let r=zn(Math.round(n*20),1,fr),a=t.get("mso-height-rule")?.trim().toLowerCase()==="exactly"?"exact":"atLeast";return `<w:trPr><w:trHeight w:val="${r}" w:hRule="${a}"/></w:trPr>`}function AT(e,t){let n={top:null,right:null,bottom:null,left:null},r=e.get("padding");if(r!==void 0&&r.length<=128){let a=r.trim().split(/\s+/).map(i=>st(i));if(a.length>=1&&a.length<=4&&!a.some(i=>i===null||i<0)){let[i,s=i,l=i,d=s]=a.length===2?[a[0],a[1],a[0],a[1]]:a.length===3?[a[0],a[1],a[2],a[1]]:a;n.top=i??null,n.right=s??null,n.bottom=l??null,n.left=d??null;}}for(let a of ["top","right","bottom","left"]){let i=st(e.get(`padding-${a}`)??"");i!==null&&i>=0&&(n[a]=i);}let o="";for(let a of ["top","left","bottom","right"]){let i=dn(a,t),s=n[i];s!==null&&(o+=`<w:${a} w:w="${zn(Math.round(s*20),0,fr)}" w:type="dxa"/>`);}return o.length>0?`<w:tcMar>${o}</w:tcMar>`:""}function wy(e,t=false){let n=Je(e),r=Sn(n.get("mso-border-alt"))??Sn(n.get("border"))??gs(n,"border"),o="";for(let l of ["top","left","bottom","right"]){let d=dn(l,t),u=Sn(n.get(`mso-border-${d}-alt`))??Sn(n.get(`mso-border-${d}`))??Sn(n.get(`border-${d}`))??gs(n,`border-${d}`)??r;u!==void 0&&(o+=vy(l,u));}let a=o.length>0?`<w:tcBorders>${o}</w:tcBorders>`:"",i=us(n);i&&(a+=`<w:shd w:val="clear" w:color="auto" w:fill="${i}"/>`),a+=AT(n,t);let s=n.get("vertical-align")?.toLowerCase()??e.getAttribute("valign")?.toLowerCase();return s==="top"?a+='<w:vAlign w:val="top"/>':s==="middle"||s==="center"?a+='<w:vAlign w:val="center"/>':s==="bottom"&&(a+='<w:vAlign w:val="bottom"/>'),a}var LT=9360;function Iy(e,t,n,r,o,a){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;for(let A of Array.from(e.children))tt(A)==="caption"&&a(Array.from(A.childNodes),t+1,n,r,o,true);let i=uy(e);if(i.length===0)return;let s=1,l=r.nodesLeft,d=[];for(let A of i){if(l<=0||s>=63)break;let w=d.map(B=>B?B.span:null);for(let B=0;B<d.length;B+=1){let U=d[B];U&&(U.remaining-=1,U.remaining<=0&&(d[B]=null));}let P=Array.from(A.children).filter(B=>/^t[dh]$/.test(tt(B))),R=0,N=0;for(;N<63&&(l-=1,!(l<=0));){let B=N<w.length?w[N]:null;if(B!=null){N+=B;continue}let U=P[R];if(U===void 0)break;R+=1;let F=Math.min(Zr(U,"colspan",63),63-N);for(let $=N+1;$<N+F;$+=1)if($<w.length&&w[$]!=null){F=$-N;break}let _=Zr(U,"rowspan",1e3);if(_>1){for(;d.length<=N;)d.push(null);d[N]={remaining:_-1,span:F};}N+=F;}for(let B=N;B<w.length&&B<63;B+=1){let U=w[B];U!=null&&(N=Math.max(N,B+U));}s=Math.max(s,N);}s=Math.min(Math.max(s,1),63);let u=fy(e,LT),f=u.twips,p=i.length>r.nodesLeft?i.slice(0,Math.max(1,r.nodesLeft)):i,m=gy(p,s,f),x=(Je(e).get("direction")??e.getAttribute("dir"))?.trim().toLowerCase()==="rtl",b=xy(e,x),y=my(e),I=py(e)??(x?"left":void 0),k=I===void 0?"":`<w:jc w:val="${dn(I,x)}"/>`,E=m.map(A=>`<w:gridCol w:w="${A}"/>`).join(""),C=new Array(s).fill(null),H=[];for(let A of i){if(r.nodesLeft<=0){r.truncated=true;break}r.nodesLeft-=1;let w=C.map(F=>F?F.span:null);for(let F=0;F<s;F+=1){let _=C[F];_&&(_.remaining-=1,_.remaining<=0&&(C[F]=null));}let P=Array.from(A.children).filter(F=>/^t[dh]$/.test(tt(F))),R=0,N=[],B=0,U=true;for(;B<s;){if(r.nodesLeft-=1,r.nodesLeft<=0){r.truncated=true,U=false;break}let F=w[B];if(F!==null){let Y=F>1?`<w:gridSpan w:val="${F}"/>`:"";N.push(`<w:tc><w:tcPr><w:tcW w:w="${dc(m,B,F)}" w:type="dxa"/>${Y}<w:vMerge/></w:tcPr><w:p/></w:tc>`),B+=F;continue}let _=P[R];if(_===void 0){N.push(`<w:tc><w:tcPr><w:tcW w:w="${m[B]}" w:type="dxa"/></w:tcPr><w:p/></w:tc>`),B+=1;continue}R+=1;let $=Math.min(Zr(_,"colspan",63),s-B);for(let Y=B+1;Y<B+$;Y+=1)if(w[Y]!==null){$=Y-B;break}let Z=Zr(_,"rowspan",1e3);Z>1&&(C[B]={remaining:Z-1,span:$}),N.push(NT(_,$,dc(m,B,$),Z>1,t,n,r,a,x)),B+=$;}if(!U)break;H.push(`<w:tr>${Sy(A)}${N.join("")}</w:tr>`);}H.length!==0&&(o.push(`<w:tbl><w:tblPr>${x?"<w:bidiVisual/>":""}${y}${u.xml}${k}${b}</w:tblPr><w:tblGrid>${E}</w:tblGrid>${H.join("")}</w:tbl>`),r.lastMarkCovered=false);}function NT(e,t,n,r,o,a,i,s,l){let d=tt(e)==="th",u=`<w:tcW w:w="${n}" w:type="dxa"/>`;t>1&&(u+=`<w:gridSpan w:val="${t}"/>`),r&&(u+='<w:vMerge w:val="restart"/>'),u+=wy(e,l);let f={run:d?{...a.run,bold:true}:a.run,para:d?{jc:"center"}:{},paragraphMarkCovered:false,pre:false,list:null,...a.noteBody?{noteBody:a.noteBody}:{},...a.rels?{rels:a.rels}:{}},p=[];return s(Array.from(e.childNodes),o+2,f,i,p,true),(p.length===0||p[p.length-1].endsWith("</w:tbl>"))&&p.push("<w:p/>"),`<w:tc><w:tcPr>${u}</w:tcPr>${p.join("")}</w:tc>`}function ky(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 Ty(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 Cy(e){if(tt(e)!=="br")return false;let t=Je(e);return t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page"}function Py(e){if(Cy(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||!Cy(r))return false;t=true;}}return t}function Ry(e){if(tt(e)!=="p")return false;let t=null;for(let o=0;o<e.childNodes.length;o+=1){let a=e.childNodes[o];if(a.nodeType===3){if((a.nodeValue??"").replace(/[\s\u00a0]/g,"").length===0)continue;return false}if(a.nodeType!==1||t!==null)return false;t=a;}if(t===null)return false;let n=Je(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 a=t.childNodes[o];if(a.nodeType!==3)return false;r+=a.nodeValue??"";}return r.includes("\xA0")&&r.replace(/[\s\u00a0]/g,"").length===0}function cc(e){let t=0,n=e.parentElement;for(;n!==null&&t<256;)t+=1,n=n.parentElement;return t}var uc=new Set("script style head template iframe object embed noscript svg math meta link title base select textarea hr w:sdtpr".split(" ")),fc=new Set("p div h1 h2 h3 h4 h5 h6 li blockquote pre".split(" ")),pc=new Set("thead tbody tfoot tr section article main header footer aside nav figure form body html".split(" ")),DT=new Set([...fc,...pc,"table","ol","ul","w:sdt"]);function mc(e){for(let t=0;t<e.children.length;t+=1)if(DT.has(tt(e.children[t])))return true;return false}var HT=new Set(["p","div","table","ol","ul","section","article","main","h1","h2","h3","h4","h5","h6"]);function Ey(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 a=0;a<o.children.length&&n<64;a+=1){let i=o.children[a];n+=1;let s=tt(i);if(HT.has(s))return Array.from(e.childNodes);s!=="w:sdtpr"&&t.push(i);}}return null}var _T=4*1024*1024,BT=1e5,$T=64,qT=2*1024*1024,Oy="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function gc(e,t,n,r,o=e.rels){let a=`rId${o.length+1}`;return o.push({id:a,type:t,target:n,external:r}),a}function hs(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 h=e.nodeValue??"";if(n.pre){let b=h.replace(/\r\n?/g,`
|
|
4
|
-
`).split(`
|
|
5
|
-
`);for(let y=0;y<b.length;y+=1){if(y>0){if(o.nodesLeft-=1,o.nodesLeft<=0){o.truncated=true;return}r.push(`<w:r>${ur(n.run)}<w:br/></w:r>`);}let I=b[y];I.length>0&&r.push(ps(I,n.run));}return}let x=h.replace(/[ \t\r\n\f\v]+/g," ");if(x.length===0||x===" "&&lc(r))return;r.push(ps(x,n.run));return}if(!yo(e))return;let a=tt(e);if(uc.has(a))return;let i=Je(e);if(fs(e)&&n.para.numPr!==void 0||i.get("mso-element")?.trim().toLowerCase()==="comment-reference"||i.get("mso-special-character")?.trim().toLowerCase()==="comment"||e.classList.contains("msocomanchor")||o.definedNoteElements.has(e))return;if(a==="w:ptab"){let h=Ty(e);h.length>0&&r.push(`<w:r>${ur(n.run)}${h}</w:r>`);return}let l=ky(i.get("mso-tab-count"));if(l.length>0){if(o.nodesLeft-=l.split("<w:tab/>").length-2,o.nodesLeft<=0){o.truncated=true;return}let h=Jd(Qd(n.run,a),i);if(r.push(`<w:r>${ur(h)}${l}</w:r>`),(e.textContent??"").trim().length===0&&e.children.length===0)return}if(a==="br"){let h=i.get("page-break-before")?.trim().toLowerCase()==="always"||i.get("break-before")?.trim().toLowerCase()==="page";r.push(`<w:r>${ur(n.run)}${h?'<w:br w:type="page"/>':"<w:br/>"}</w:r>`);return}if(a==="img"){qh(e,r,o,h=>gc(o,`${Oy}/image`,h,false,n.rels??o.rels));return}let d=Qd(n.run,a),u=a==="a"?e.getAttribute("href"):null,f=a==="a"?tc(i):null;f===null&&Yh(u)&&(d={...d,rStyle:"Hyperlink"});let p=La(d,e),m={...n,run:p,pre:n.pre||a==="pre"};if(f!==null){let h={...m.run,vertAlign:"superscript"};if(n.noteBody!==void 0&&n.noteBody.kind===f.kind&&n.noteBody.id===f.id){let x=f.kind==="footnote"?"footnoteRef":"endnoteRef";r.push(`<w:r>${ur(h)}<w:${x}/></w:r>`);return}if(o.definedNotes[f.kind].has(f.id)){let x=f.kind==="footnote"?"footnoteReference":"endnoteReference";r.push(`<w:r>${ur(h)}<w:${x} w:id="${f.id}"/></w:r>`);let b=(e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim(),y=`${f.kind}:${f.id}`;if(b.length>0&&!o.noteMarkFallbacks.has(y)&&o.noteMarkFallbacks.set(y,ps(b,h)),n.noteBody===void 0)o.bodyNoteRefs[f.kind].add(f.id);else {let I=`${n.noteBody.kind}:${n.noteBody.id}`,k=o.noteNoteRefs.get(I)??[];k.push({kind:f.kind,id:f.id}),o.noteNoteRefs.set(I,k);}return}for(let x of Array.from(e.childNodes))hs(x,t+1,m,r,o);return}if(a==="a"){let h=e.getAttribute("href"),x=ln(e.getAttribute("name")||e.getAttribute("id")),b=[];for(let k of Array.from(e.childNodes))hs(k,t+1,m,b,o);let y=h?.startsWith("#")?ln(h.slice(1)):null,I=b.join("");if(y!==null)I=`<w:hyperlink w:anchor="${chunkMXOO7KRI_cjs.N(y)}">${I}</w:hyperlink>`;else if(h!==null&&!h.startsWith("#")){let k=chunkMXOO7KRI_cjs.L(h);k.ok&&k.href.length>0&&(I=`<w:hyperlink r:id="${gc(o,`${Oy}/hyperlink`,k.href,true,n.rels??o.rels)}">${I}</w:hyperlink>`);}if(x!==null){let k=String(o.nextBookmarkId++);I=`<w:bookmarkStart w:id="${k}" w:name="${chunkMXOO7KRI_cjs.N(x)}"/>${I}<w:bookmarkEnd w:id="${k}"/>`;}I.length>0&&r.push(I);return}for(let h of Array.from(e.childNodes))hs(h,t+1,m,r,o);}function Fy(e,t,n,r){let o=tt(e),a=Je(e),i={};r&&(i.pageBreakBefore=true);let s=Lh(e,n.wordHtml);s!==void 0&&(i.styleId=s),t.para.numPr&&(i.numPr=t.para.numPr),t.para.jc&&(i.jc=t.para.jc),t.para.bidi&&(i.bidi=true);let l={...t.run},d=dy[o];d!==void 0&&s===void 0&&!e.classList.contains("docx-outline")&&(l.bold=true,l.szHalfPoints=d);let u=t.pre||o==="pre";o==="pre"&&(l.font="Courier New");let f=ay(e,a,n,t.noteBody);return f&&(i.numPr=f),_h(i,e,n.classAlignments),Bh(i,a),l=La(l,e),e.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(i.bidi=true),{run:l,para:i,paragraphMarkCovered:i.styleId!==void 0||i.numPr!==void 0,pre:u,list:t.list,...t.noteBody?{noteBody:t.noteBody}:{},...t.rels?{rels:t.rels}:{}}}function My(e,t,n,r,o,a=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;let i=Fy(e,n,r,a);pr(Array.from(e.childNodes),t+1,i,r,o,true,void 0,false);}function Ay(e,t,n,r,o,a=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;let i=Gh(e);n.list||(r.semanticListCount+=1);let s=n.list?{numId:n.list.numId,level:Math.min(n.list.level+1,8)}:{numId:rc(r,`sem:${r.semanticListCount}`,i,ec(e)),level:0};if(n.list){let u=r.listsByNumId.get(s.numId);u!==void 0&&!u.levels.has(s.level)&&u.levels.set(s.level,{kind:i,start:ec(e)});}let l={...n,list:s,para:{numPr:{numId:s.numId,ilvl:s.level}}},d=a;for(let u of Array.from(e.childNodes)){if(r.nodesLeft<=0){r.truncated=true;break}if(!yo(u))continue;let f=tt(u);if(f==="li")r.nodesLeft-=1,My(u,t+1,l,r,o,d),d=false;else if(f==="ol"||f==="ul"){let p=o.length;Ay(u,t+1,{...n,list:s},r,o,d),o.length>p&&(d=false);}}}function pr(e,t,n,r,o,a=false,i,s=true){if(t>r.maxDepth)return;let l=o.length,d=i===void 0,u=[],f=[],p=n.para,m=i??{pending:false,skipSpacer:false},h=()=>({...p,pageBreakBefore:void 0,numPr:void 0}),x=()=>{if(u.length===0)return;if(!u.some(y=>y.includes("<w:r"))){if(o.length===l){f=f.concat(u),u=[];return}let y=o[o.length-1];y?.endsWith("</w:p>")?(o[o.length-1]=`${y.slice(0,-6)}${u.join("")}</w:p>`,u=[]):y!==void 0&&u.length>0&&(o.push(qr(h(),u)),u=[],r.lastMarkCovered=false);return}let b=m.pending?{...p,pageBreakBefore:true}:p;o.push(qr(b,u)),p.pageBreakBefore&&(p={...p,pageBreakBefore:void 0}),m.pending=false,m.skipSpacer=false,r.lastMarkCovered=n.paragraphMarkCovered,u=[];};for(let b of e){if(r.nodesLeft<=0){r.truncated=true;break}if(yo(b)){let y=tt(b),I=y==="w:sdt"?Ey(b):null;if(s&&Py(b)){x(),r.nodesLeft-=1,m.pending&&ms(o),m.pending=true,m.skipSpacer=true;continue}if(uc.has(y)){r.nodesLeft-=1;continue}let k=Je(b);if(k.get("mso-element")?.trim().toLowerCase()==="comment-list"){r.nodesLeft-=1;continue}if(ry(k)){x(),r.nodesLeft-=1,pr(Array.from(b.childNodes),t+1,n,r,o,false,m,s);continue}if(r.definedNoteElements.has(b)){r.nodesLeft-=1;continue}if(fc.has(y)){if(x(),r.nodesLeft-=1,m.pending&&m.skipSpacer&&Ry(b)){m.skipSpacer=false;continue}if(y==="div"&&mc(b)){let C=Fy(b,n,r,false);C.para.pageBreakBefore&&(m.pending=true),pr(Array.from(b.childNodes),t+1,C,r,o,false,m,s);continue}let E=o.length;My(b,t,n,r,o,m.pending),o.length>E&&(m.pending=false,m.skipSpacer=false);continue}if(y==="ol"||y==="ul"){x();let E=o.length;Ay(b,t,n,r,o,m.pending),o.length>E&&(m.pending=false,m.skipSpacer=false);continue}if(y==="table"){x(),m.pending&&ms(o),ZT(b,t,n,r,o),m.pending=false,m.skipSpacer=false;continue}if(pc.has(y)||I!==null||y==="span"&&mc(b)){x(),r.nodesLeft-=1,pr(I??Array.from(b.childNodes),t+1,n,r,o,false,m,s);continue}}if(b.nodeType===3&&/^[\s\u00a0]+$/.test(b.nodeValue??"")&&lc(u)){r.nodesLeft-=1;continue}hs(b,t,n,u,r);}if(a&&o.length===l&&u.length>0&&!u.some(b=>b.includes("<w:r"))&&(o.push(qr(p,u)),u=[],r.lastMarkCovered=n.paragraphMarkCovered),x(),f.length>0){let b=o[l];b!==void 0&&b.startsWith("<w:p>")?o[l]=b.replace(/^(<w:p>(?:<w:pPr>(?:(?!<\/w:pPr>)[\s\S])*?<\/w:pPr>)?)/,`$1${f.join("")}`):b!==void 0?o.splice(l,0,qr(h(),f)):u=f.concat(u),f=[];}u.length>0&&(o.push(qr(h(),u)),u=[],r.lastMarkCovered=false),d&&m.pending&&(ms(o),m.pending=false,m.skipSpacer=false,r.lastMarkCovered=false),a&&o.length===l&&(o.push(qr(p,u)),u=[],r.lastMarkCovered=n.paragraphMarkCovered);}function ZT(e,t,n,r,o){Iy(e,t,n,r,o,pr);}function KT(e,t){return sy({blocks:t,rels:e.rels,lists:[...e.lists.values()],notes:e.notes,noteRels:e.noteRels,media:e.media,mediaExtensions:e.mediaExtensions})}function VT(e,t){let n=t.maxHtmlBytes??_T;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 a=ty(r),i={footnote:new Set,endnote:new Set},s=new Set,l={footnote:new Set,endnote:new Set};ny(r,a,l);let d={nodesLeft:t.maxNodes??BT,maxDepth:t.maxDepth??$T,maxImageBytes:t.maxImageBytes??qT,wordHtml:Ah(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:Dh(r),listDefinitions:zh(Hh(r)),notes:{footnote:new Map,endnote:new Map},noteRels:{footnote:[],endnote:[]},definedNotes:i,bodyNoteRefs:{footnote:new Set,endnote:new Set},noteNoteRefs:new Map,noteMarkFallbacks:new Map,definedNoteElements:s},u={};u=La(u,r.documentElement),u=La(u,o);let f={run:u,para:u.rtl?{bidi:true}:{},paragraphMarkCovered:false,pre:false,list:null},p=[];for(let y of a)l[y.kind].has(y.id)&&(i[y.kind].has(y.id)||(i[y.kind].add(y.id),s.add(y.element),p.push(y)));p.sort((y,I)=>cc(I.element)-cc(y.element)),d.lastMarkCovered=false;let m=[];pr(Array.from(o.childNodes),0,f,d,m);let h=d.lastMarkCovered,x=d.truncated,b=false;for(let y=0;y<p.length;y+=1){let I=p[y];d.truncated=false;let k=d.nodesLeft,E=[];if(pr(Array.from(I.element.childNodes),0,{...f,noteBody:{kind:I.kind,id:I.id},rels:d.noteRels[I.kind]},d,E,true),d.truncated||E.length===0){b=true;let C=new Set;for(let H=y;H<p.length;H+=1){let A=p[H];i[A.kind].delete(A.id),s.delete(A.element),d.notes[A.kind].delete(A.id),d.bodyNoteRefs[A.kind].delete(A.id),C.add(`${A.kind}:${A.id}`);}if(C.size>0){for(let H=0;H<m.length;H+=1)m[H]=bo(m[H],C,d.noteMarkFallbacks);for(let H of ["footnote","endnote"])for(let[A,w]of d.notes[H])d.notes[H].set(A,w.map(P=>bo(P,C,d.noteMarkFallbacks)));}d.nodesLeft=k;for(let H=y;H<p.length&&d.nodesLeft>0;H+=1)pr(Array.from(p[H].element.childNodes),0,f,d,m);break}d.notes[I.kind].set(I.id,E);}return d.truncated=x||b,d.lastMarkCovered=h,oy(d,i,m,gc),m.length===0?{ok:false,reason:"no-content"}:{ok:true,projection:d,blocks:m}}var zT=Jh();function Ly(e,t){let n=`${t.maxHtmlBytes??""}:${t.maxNodes??""}:${t.maxDepth??""}:${t.maxImageBytes??""}`;return zT(e,n,()=>VT(e,t))}function Ny(e,t={}){let n=Ly(e,t);return n.ok?{ok:true,fragmentBytes:KT(n.projection,n.blocks),lastMarkCovered:n.projection.lastMarkCovered,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:n}function Dy(e,t={}){let n=Ly(e,t);return n.ok?{lands:true,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:{lands:false,imageCount:0,truncated:false}}var jT={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function Hy(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 jT[n.toLowerCase()]??t})}var WT=new Set(["script","style","title","template"]),UT=new Set(["p","div","li","tr","h1","h2","h3","h4","h5","h6","blockquote","section","article","pre","table"]),GT=new Set(["td","th"]),_y=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),XT=e=>_y(e)||e!==void 0&&e>="0"&&e<="9",By=e=>e===" "||e===" "||e===`
|
|
6
|
-
`||e==="\r"||e==="\f";function YT(e,t){let n=t+1,r=e[n]==="/";if(r&&(n+=1),!_y(e[n]))return null;let o=n;for(;n<e.length&&XT(e[n]);)n+=1;let a=e.slice(o,n).toLowerCase(),i="",s=false;for(;n<e.length;){let l=e[n];if(i!=="")l===i&&(i="");else if(l==="=")s=true;else if(s&&(l==='"'||l==="'"))i=l,s=false;else {if(l===">")return {name:a,closing:r,end:n+1};By(l)||(s=false);}n+=1;}return {name:a,closing:r,end:e.length}}function QT(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 JT(e,t,n){for(let r=n;r<e.length;){let o=e.indexOf("</",r);if(o===-1)return e.length;let a=o+2;if(e.slice(a,a+t.length).toLowerCase()===t){for(a+=t.length;a<e.length&&By(e[a]);)a+=1;if(e[a]===">")return a+1}r=o+2;}return e.length}function*$y(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=YT(e,n);if(r===null){yield "<",t=n+1;continue}t=r.end,!r.closing&&WT.has(r.name)?t=JT(e,r.name,r.end):!r.closing&&r.name==="br"?yield `
|
|
7
|
-
`:r.closing&>.has(r.name)?yield " ":r.closing&&UT.has(r.name)&&(yield `
|
|
8
|
-
`);}}function eC(e){let t=e.length>2e6?e.slice(0,2e6):e,n="";for(let r of $y(t))n+=r;return Hy(n).replace(/\r\n?/g,`
|
|
9
|
-
`).split(`
|
|
10
|
-
`).map(QT).join(`
|
|
11
|
-
`).replace(/\n{3,}/g,`
|
|
12
|
-
|
|
13
|
-
`).trim()}function qy(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 Zy=/[^\s\u200B-\u200F\u2060\u2066-\u2069\u061C\uFEFF\u00AD]/;function Ky(e){return Zy.test(e)}function hc(e){let t=e.length>2e6?e.slice(0,2e6):e;for(let n of $y(t)){let r=n.includes("&")?Hy(n):n;if(Zy.test(r))return true}return false}function yc(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?eC(n):""}function bc(e,t){if(typeof e.getData!="function")return "";try{return e.getData(t)??""}catch{return ""}}function tC(e){if(!e)return false;if(Ky(bc(e,"text/plain")))return true;let t=bc(e,"text/html");if(t.length===0)return false;if(hc(t))return true;let n=ds(t);return n!==null&&n.bytes[0]===80&&n.bytes[1]===75?true:Dy(t).imageCount>0}function nC(e){return e?hc(bc(e,"text/html")):false}var rC=Object.freeze({kind:"body"});function Ue(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 vt(e,t,n){let r=t?.indexOf("#")??-1,o=r===-1?"":t.slice(0,r);if(o.length===0||o===e.part().name)return {kind:"body"};for(let a of e.headerFooterResolutionBySection())for(let i of [a.headers,a.footers])for(let s of i.values())if(s.partName===o)return {kind:"headerFooter",rId:s.rId};for(let a of ["footnote","endnote"])if(e.partFor({kind:"notesPart",noteKind:a})?.name===o)return {kind:"notesPart",noteKind:a};return n}function ys(e,t){if(e)return {kind:"headerFooter",rId:e.scope.rId};if(t){let n=chunkMXOO7KRI_cjs.$c(t.id);if(n)return {kind:"notesPart",noteKind:n.noteKind}}return {kind:"body"}}function zy(e,t){return e?e.scope:t||rC}function oC(e,t,n){if(n){let o=[];for(let a of [e.footnotes,e.endnotes])if(a)for(let i of a.notes)i.scopeId===n&&o.push(...Vy(i.fragments));return o}if(!t)return chunkBNZF6DYC_cjs.B(e);let r=vo(e,t);return r?Vy(r.fragments):[]}function vo(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 jy(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 vc(e,t){return !!(e.rId&&e.rId===t.scope.rId||!e.rId&&e.partName===t.partName&&e.kind===t.kind)}function xc(e,t,n){let r=chunkBNZF6DYC_cjs.Xc(e,t.y),o=e.pages[r];if(!o)return false;let a=t.x-n(r),i=t.y,s=o.contentBox;return a>=s.x&&a<s.x+s.width&&i>=s.y&&i<s.y+s.height}function Sc(e,t,n,r,o={}){return chunkBNZF6DYC_cjs._c(e,t,n.fragments,r,o)}function aC(e,t,n){let r=e.pages[t.pageIndex]??e.pages[0];if(!r)return null;let o=vo(r,t);return o?chunkBNZF6DYC_cjs.me(e,t.pageIndex,o.fragments,n):null}function iC(e,t,n){let r=[];for(let o of e.pages)for(let a of [o.footnotes,o.endnotes]){let i=a?.notes.find(s=>s.scopeId===t);i&&r.push(...chunkBNZF6DYC_cjs.me(e,o.index,i.fragments,n));}return r.length>0?r:null}function Wy(e,t){return e.querySelector(`[data-page-index="${t}"] > [data-docx-hf-active]`)??e.querySelector("[data-docx-hf-active]")}function Uy(e,t,n){let r=e.querySelectorAll("[data-docx-note-scope]"),o=null;for(let a of r){if(a.dataset.docxNoteScope!==t||!a.matches("[data-docx-note]"))continue;o??=a;let i=Number(a.closest("[data-page-index]")?.dataset.pageIndex);if(n!==null&&i===n)return a}return o}function Gy(e,t,n){if((a=>{let i=e.pages[a];return !!i&&!!vo(i,t)})(t.pageIndex)&&(n===void 0||n.has(t.pageIndex)))return t.pageIndex;let o=null;for(let a of e.pages)if(vo(a,t)&&(o===null&&(o=a.index),n===void 0||n.has(a.index)))return a.index;return o??t.pageIndex}function Xy(e){return e?{rId:e.scope.rId,pageIndex:e.pageIndex,kind:e.kind,partName:e.partName,variant:e.variant}:null}function Yy(e,t,n){e.classList.toggle("docx-paginated-surface--hf-editing",n),t.classList.toggle("docx-pages--hf-editing",n);}function wc(e,t){e.classList.toggle("docx-paginated-surface--viewing",t==="view");}function Ic(e,t,n,r,o,a,i){let s=o?aC(e,o,i):a?iC(e,a,i):null,l=chunkBNZF6DYC_cjs.te(e,t,n,r,{...i?{measurer:i}:{},...s?{stops:s}:{}});if(!l)return null;if(!s)return l;let d=s.find(u=>u.position.paragraphId===l.position.paragraphId&&u.position.offset===l.position.offset);return d?{...l,pageIndex:d.pageIndex}:l}function kc(e,t,n){for(let r of e.pages){let o=n(r.index);for(let a of [r.footnotes,r.endnotes])if(a)for(let i of a.notes){let s=i.box,l=s.x+o,d=s.y;if(t.x>=l&&t.x<l+s.width&&t.y>=d&&t.y<d+s.height)return {pageIndex:r.index,scopeId:i.scopeId,noteKind:i.noteKind,noteId:i.noteId,local:{x:t.x-l,y:t.y-d},fragments:i.fragments}}}return null}function Qy(e,t){let n=e[t],r=e.contentBox,o=e.box;if(t==="header"){let d=o.y,u=r.y,f=n?Math.max(u,n.box.y+n.box.height):u,p=n?Math.min(d,n.box.y):d;return f<=p?null:{x:r.x,y:p,width:r.width,height:f-p}}let a=r.y+r.height,i=o.y+o.height,s=n?Math.min(a,n.box.y):a,l=n?Math.max(i,n.box.y+n.box.height):i;return l<=s?null:{x:r.x,y:s,width:r.width,height:l-s}}function Tc(e,t,n){for(let r of e.pages){let o=n(r.index);for(let a of ["header","footer"]){if(r[a])continue;let i=Qy(r,a);if(!i)continue;let s=i.x+o;if(t.x>=s&&t.x<s+i.width&&t.y>=i.y&&t.y<i.y+i.height)return {pageIndex:r.index,kind:a}}}return null}function Cc(e,t,n){for(let r of e.pages){let o=n(r.index);for(let a of ["header","footer"]){let i=r[a];if(!i)continue;let s=i.box,l=Qy(r,a)??s,d=l.x+o,u=l.y;if(t.x>=d&&t.x<d+l.width&&t.y>=u&&t.y<u+l.height)return {pageIndex:r.index,kind:a,story:i,local:{x:t.x-(s.x+o),y:t.y-s.y}}}}return null}function xo(e,t,n){if(!t&&!n)return chunkBNZF6DYC_cjs.V(e);let r=new Set,o=[];for(let a of e.pages)for(let i of oC(a,t,n)){for(let s of i.lines)for(let l of chunkBNZF6DYC_cjs.R(s))r.has(l.paragraphId)||(r.add(l.paragraphId),o.push(l.paragraphId));i.lines.length===0&&!r.has(i.paragraphId)&&(r.add(i.paragraphId),o.push(i.paragraphId));}return o}function bs(e,t,n,r){let o=xo(e,n,r);if(o.length===0)return t;let a=new Set(o),i=s=>a.has(s.paragraphId)?s:{paragraphId:o[0],offset:0};return {anchor:i(t.anchor),head:i(t.head)}}function Vy(e){let t=[],n=r=>{for(let o of r){if(o.kind==="paragraph"){t.push(o);continue}for(let a of o.rows)if(!a.isHeaderRepeat)for(let i of a.cells)n(i.blocks);}};return n(e),t}function Jy(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 sC(e){try{return typeof caches>"u"?Promise.resolve(null):caches.open(e).catch(()=>null)}catch{return Promise.resolve(null)}}async function lC(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 dC(e,t,n){if(e)try{await e.put(t,new Response(n.slice(),{headers:{"Content-Length":String(n.byteLength)}}));}catch{}}async function cC(e,t){if(e)try{await e.delete(t);}catch{}}async function Pc(e){let t=()=>{if(e.signal?.aborted)throw e.signal.reason};t();let n=e.fetcher??fetch,r=e.maxFontBytes??chunkWQFNWLNY_cjs.a,o=await sC(e.cacheName??"docx-editor-fonts");t();async function a(d){t();let u=Object.freeze({family:d.family,weight:d.weight,style:d.style}),f=Jy(u);if(f)return {failure:{url:d.url,request:u,reason:"invalidRequest",diagnostic:f}};let p=(y,I)=>{if(y.byteLength===0)return {url:d.url,request:u,reason:"emptyResponse"};if(y.byteLength>r)return {url:d.url,request:u,reason:"overLimit"};let k=chunkWQFNWLNY_cjs.i(y,d.faceIndex??0);if(!k.valid)return {url:d.url,request:u,reason:"malformed",diagnostic:k.diagnostic};let E=chunkMXOO7KRI_cjs.a(y);return d.hash!==void 0&&d.hash!==E?{url:d.url,request:u,reason:"hashMismatch",expectedHash:d.hash,actualHash:E,...I?{diagnostic:"cached bytes failed revalidation"}:{}}:{request:u,id:`url:${d.url}`,bytes:y,hash:E,faceIndex:d.faceIndex??0}},m=await lC(o,d.url);if(t(),m){let y=p(m,true);if(!("reason"in y))return {source:y};await cC(o,d.url),t();}let h;try{h=e.signal?await n(d.url,{signal:e.signal}):await n(d.url),t();}catch(y){return t(),{failure:{url:d.url,request:u,reason:"networkError",diagnostic:y instanceof Error?y.message:String(y)}}}if(!h.ok)return {failure:{url:d.url,request:u,reason:"httpError",status:h.status}};let x;try{x=new Uint8Array(await h.arrayBuffer()),t();}catch(y){return t(),{failure:{url:d.url,request:u,reason:"networkError",diagnostic:y instanceof Error?y.message:String(y)}}}let b=p(x,false);return "reason"in b?{failure:b}:(await dC(o,d.url,x),t(),{source:b})}let i=await Promise.all(e.sources.map(d=>a(d)));t();let s=[],l=[];for(let d of i)"source"in d?s.push(d.source):l.push(d.failure);return {sources:s,failures:l}}function uC(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}`,a=Jy(r);if(a)return {failure:{url:o,request:r,reason:"invalidRequest",diagnostic:a}};if(e.byteLength===0)return {failure:{url:o,request:r,reason:"emptyResponse"}};if(e.byteLength>(n.maxFontBytes??chunkWQFNWLNY_cjs.a))return {failure:{url:o,request:r,reason:"overLimit"}};let i=t.faceIndex??0,s=chunkWQFNWLNY_cjs.i(e,i);return s.valid?{source:{request:r,id:o,bytes:e,hash:chunkMXOO7KRI_cjs.a(e),faceIndex:i}}:{failure:{url:o,request:r,reason:"malformed",diagnostic:s.diagnostic}}}var fC=e=>e.trim().toLowerCase(),eb=e=>JSON.stringify([fC(e.family),e.weight,e.style]);function pC(e){return chunkXZY4Q6PJ_cjs.i(async t=>{if(t.signal?.aborted)throw t.signal.reason;let n=new Set((t.resolvedFaces??[]).map(eb)),r=e.sources.filter(s=>!n.has(eb(s)));if(r.length===0)return {sources:[],failures:[]};let{onFailure:o,...a}=e,i=await Pc({...a,sources:r,signal:t.signal});if(t.signal?.aborted)throw t.signal.reason;for(let s of i.failures)o?o(s):console.warn(`[fonts] ${s.request.family} (${s.url}): ${s.reason}`);return i})}var mC=96,tb=37.79527559055118;function gC(e,t){if(!Number.isFinite(e)||e<=0)return [];let n=[];if(t==="inch"){let i=Math.floor(e/12);for(let s=0;s<=i;s+=1){let l=s*12;if(s%8===0){let d=s/8;n.push({position:l,height:10,...d>0?{label:String(d)}:{}});}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=tb/10,o=Math.floor(e/r);for(let a=0;a<=o;a+=1){let i=a*r;if(a%10===0){let s=a/10;n.push({position:i,height:10,...s>0?{label:String(s)}:{}});}else a%5===0?n.push({position:i,height:6}):n.push({position:i,height:3});}return n}function hC(e){let t=[...e].sort((n,r)=>n.index-r.index)[0];return t?t.box:null}var yC=1440,bC=567,vC=180,xC=56.7,vs=(e,t,n)=>n<t||e<t?t:e>n?n:e;function SC(e,t,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 nb(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 wC(e,t,n,r,o={}){let a=nb(t,o.unit??"inch",o.precise??false),i=r.pageWidth-r.rightMargin-n.right,s=r.leftMargin+n.left+Math.max(0,n.firstLine);switch(e){case "firstLine":{let l=vs(a,0,i);return {...n,firstLine:l-r.leftMargin-n.left}}case "left":{let l=-r.leftMargin-Math.min(0,n.firstLine),d=i-r.leftMargin-Math.max(0,n.firstLine);return {...n,left:vs(a-r.leftMargin,l,d)}}case "hanging":{let l=vs(a-r.leftMargin,-r.leftMargin,i-r.leftMargin);return {...n,left:l,firstLine:n.firstLine+(n.left-l)}}case "right":{let l=vs(a,s,r.pageWidth);return {...n,right:r.pageWidth-r.rightMargin-l}}}}function rb(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 IC(e){if(!(!e||typeof e!="object"||"preventDefault"in e))return e}var ob="no formatting has been copied",xs="there is nothing at the selection to copy",Rc="the selection has nothing to paint",Ss=Object.freeze({mode:"off",level:"none"});var Ec=new WeakMap;function jn(e){let t=Ec.get(e);if(t)return t;let n=chunkMXOO7KRI_cjs.Be(e);if(n.length===0)return Ec.set(e,[]),[];let r=[];for(let o of n){let a=chunkMXOO7KRI_cjs.Ae(o);for(let i of new Set([o.beginParagraphId,...o.resultParagraphIds,o.endParagraphId])){let s=chunkMXOO7KRI_cjs.Ha(e,i);if(s?.kind!=="paragraph")continue;let l=chunkMXOO7KRI_cjs.Ue(s),d=i===o.beginParagraphId,u=i===o.endParagraphId;r.push({toc:o,paragraphId:i,length:l.length,startsHere:d,endsHere:u,start:d?l.spanOf(o.beginNodeId)?.start??0:0,end:u&&a?l.spanOf(a.endNodeId)?.end??l.length:l.length});}}return Ec.set(e,r),r}function ws(e){return new Set(jn(e).filter(t=>t.start===0&&t.end===t.length&&!(t.endsHere&&!t.startsHere&&t.end===0)).map(t=>t.paragraphId))}function Oc(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 Ut(e,t){return jn(e).find(n=>n.paragraphId===t.paragraphId&&Oc(n,t.offset))?.toc}function ab(e,t){let{anchor:n,head:r}=t;if(n.paragraphId===r.paragraphId){let o=Math.min(n.offset,r.offset),a=Math.max(n.offset,r.offset);return jn(e).some(i=>i.paragraphId===n.paragraphId&&(o===a?Oc(i,o):o<i.end&&a>i.start))}return Ut(e,n)!==void 0||Ut(e,r)!==void 0}function ib(e,t){let n=jn(e);if(n.length===0)return false;let r=chunkMXOO7KRI_cjs.ci(t);if(r.kind==="nodes")return r.targets.some(i=>n.some(s=>{if(i.nodeId!==s.paragraphId)return false;if(i.range){let{start:l,end:d}=i.range;return l===d?Oc(s,l):l<s.end&&d>s.start}return t.op==="joinParagraphs"&&t.firstId===s.paragraphId&&s.endsHere&&s.end===0?false:i.removes||i.structural?true:s.end>s.start||s.length===0&&!s.endsHere}));let o=new Set(n.map(i=>i.paragraphId)),a=(i,s="")=>typeof i=="string"?/(?:Id|Ids)$/.test(s)&&o.has(i):Array.isArray(i)?i.some(l=>a(l,s)):!!i&&typeof i=="object"&&Object.entries(i).some(([l,d])=>a(d,l));return a(t)}function sb(e,t,n){let r=Ut(e,t);if(!r)return null;let o=jn(e).find(a=>a.toc.id===r.id&&(n?a.startsHere&&a.start>0:a.endsHere&&a.end<a.length));return o?{paragraphId:o.paragraphId,offset:n?o.start:o.end}:null}function lb(e,t){return !jn(t).some(r=>r.toc.id===e.id&&(r.start>0||r.end<r.length))&&e.contentControlId?e.contentControlId:`toc:${e.id}`}function db(e,t,n){if(!t)return;let r=n?.closest("[data-start]");return jn(e).find(o=>o.paragraphId===t&&(r?Number(r.dataset.start)<o.end&&Number(r.dataset.end)>o.start:ws(e).has(t)))?.toc}var Na=/^[0-9A-Fa-f]{6}$/,cb={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"},kC={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 Fc(e){return typeof e=="number"&&Number.isFinite(e)&&e>0&&e<=1}function Is(e){return Math.max(0,Math.min(1,e))}function ub(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 fb(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 pb(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "FFFFFF";let r=Math.max(0,Math.min(255,Math.round((1-Is(t))*255)))/255,o=ub(e);return fb(r*255+(1-r)*o.r,r*255+(1-r)*o.g,r*255+(1-r)*o.b)}function mb(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "000000";let r=Math.max(0,Math.min(255,Math.round(Is(t)*255)))/255,o=ub(e);return fb(r*o.r,r*o.g,r*o.b)}function Mc(e){return cb[e]??cb[e.toLowerCase()]??null}function TC(e,t){let n=Mc(e);if(!n)return null;let r=t.find(a=>a.slot===n)?.hex;if(r&&Na.test(r))return r.toUpperCase();let o=kC[n];return o&&Na.test(o)?o.toUpperCase():null}function ks(e,t){let n=TC(e.slot,t);if(!n)return {ok:false,reason:"the theme colour could not be resolved for this document"};if(e.tint!==void 0&&!Fc(e.tint))return {ok:false,reason:"theme tint is out of range"};if(e.shade!==void 0&&!Fc(e.shade))return {ok:false,reason:"theme shade is out of range"};let r=n;return e.tint!==void 0?r=pb(r,Is(e.tint)):e.shade!==void 0&&(r=mb(r,Is(e.shade))),{ok:true,hex:r}}var CC="000000";function Ac(e,t){if(e.kind==="hex"){let o=e.value.toUpperCase();return Na.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:CC}};let n=ks(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:Mc(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function Lc(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 Na.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"fill colour requires a six-digit hex value"}}let n=ks(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:Mc(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function PC(e,t,n="000000"){if(!e||e.kind==="auto")return `#${n}`;if(e.kind==="hex"){let o=e.value.replace(/^#/,"").toUpperCase();return Na.test(o)?`#${o}`:`#${n}`}let r=ks(e,t);return `#${r.ok?r.hex:n}`}function Nc(e,t){return chunkBNZF6DYC_cjs.fd(e).occurrences.some(n=>n.table.tableId===t&&n.row.cells.some(r=>r.logicalGridColumn!==void 0))}function gb(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var FC=new Set(["insertRow","deleteRow","insertColumn","deleteColumn","deleteTable","setCellFill","setTableCellVerticalAlignment","setTableBorders","commitTableColumnDividerResize","commitTableRightEdgeResize","mergeCells","splitCell","toggleHeaderRow","selectTableRegion","setTableProperties"]);function mr(e){return FC.has(e.type)}function xe(e,t){return {ok:false,code:e,reason:t}}function Dc(e,t){switch(e){case "unknown-table":case "unknown-row":case "unknown-grid-column":return xe("invalidArgs","the table target is no longer valid");case "table-has-merge":return xe("unsupported","this table has merged cells");case "row-hides-cell":return xe("unsupported","this table has a cell the editor cannot place in the grid");case "block-required":return xe("unsupported","the table must keep at least one row or column");case "resource-limit":return xe("unsupported","the table has reached the supported size limit");case "invalidArgs":case "invalid-property-value":case "unsupported-property":return xe("invalidArgs","the table command arguments are invalid");default:return xe("unsupported",`the table operation was refused (${e})`)}}function xt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Bt(e,t){return !xt(e)||Object.keys(e).length!==t.length?false:t.every(r=>Object.prototype.hasOwnProperty.call(e,r))}function vb(e){if(!xt(e))return false;let t=e.kind;if(t==="hex")return Bt(e,["kind","value"])&&typeof e.value=="string";if(t==="auto")return Bt(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 Bt(e,n)}return false}function xb(e){return xt(e)&&Bt(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 Sb(e){return xt(e)&&Bt(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 MC(e){return xt(e)&&Bt(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 AC(e){return xt(e)&&Bt(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 LC(e){return !xt(e)||!Bt(e,["style","size","color"])?false:typeof e.style=="string"&&typeof e.size=="number"&&Number.isInteger(e.size)&&vb(e.color)}function hb(e){return !("target"in e)||e.target===void 0||xb(e.target)}function yb(e){return !("target"in e)||e.target===void 0||Sb(e.target)}function NC(e){switch(e.type){case "insertRow":return !xt(e)||e.type!=="insertRow"?xe("invalidArgs","insertRow command shape is invalid"):e.where!=="above"&&e.where!=="below"?xe("invalidArgs","insertRow where must be above or below"):hb(e)?null:xe("invalidArgs","insertRow target shape is invalid");case "deleteRow":return !xt(e)||e.type!=="deleteRow"?xe("invalidArgs","deleteRow command shape is invalid"):hb(e)?null:xe("invalidArgs","deleteRow target shape is invalid");case "insertColumn":return !xt(e)||e.type!=="insertColumn"?xe("invalidArgs","insertColumn command shape is invalid"):e.where!=="left"&&e.where!=="right"?xe("invalidArgs","insertColumn where must be left or right"):yb(e)?null:xe("invalidArgs","insertColumn target shape is invalid");case "deleteColumn":return !xt(e)||e.type!=="deleteColumn"?xe("invalidArgs","deleteColumn command shape is invalid"):yb(e)?null:xe("invalidArgs","deleteColumn target shape is invalid");case "deleteTable":return !xt(e)||!Bt(e,["type"])?xe("invalidArgs","deleteTable command shape is invalid"):null;case "setCellFill":return !xt(e)||!Bt(e,["type","color"])?xe("invalidArgs","setCellFill command shape is invalid"):e.color!==null&&!vb(e.color)?xe("invalidArgs","setCellFill color shape is invalid"):null;case "setTableCellVerticalAlignment":return !xt(e)||!Bt(e,["type","alignment"])||!["top","center","bottom"].includes(e.alignment)?xe("invalidArgs","cell vertical alignment command shape is invalid"):null;case "setTableBorders":return !xt(e)||e.type!=="setTableBorders"?xe("invalidArgs","setTableBorders command shape is invalid"):e.scope==="none"?typeof e.target!="string"?xe("invalidArgs","border none scope requires a target edge"):null:!("spec"in e)||!LC(e.spec)?xe("invalidArgs","concrete border scopes require a complete spec"):null;case "commitTableColumnDividerResize":return !xt(e)||!Bt(e,["type","target","leftWidthTwips","rightWidthTwips"])||!MC(e.target)||typeof e.leftWidthTwips!="number"||typeof e.rightWidthTwips!="number"?xe("invalidArgs","column divider resize command shape is invalid"):null;case "commitTableRightEdgeResize":return !xt(e)||!Bt(e,["type","target","columnWidthTwips","tableWidthTwips"])||!AC(e.target)||typeof e.columnWidthTwips!="number"||typeof e.tableWidthTwips!="number"?xe("invalidArgs","right-edge resize command shape is invalid"):null;default:return null}}function DC(e){return !("target"in e)||e.target===void 0?null:xb(e.target)?e.target:null}function HC(e){return !("target"in e)||e.target===void 0?null:Sb(e.target)?e.target:null}function _C(e,t){let n=chunkMXOO7KRI_cjs.Dh(e.root,t.tableId);if(!n.ok)return {rowIds:[t.rowId],wholeTable:false};let r=new Set(t.cellIds),o=n.topology.rows.filter(a=>a.cells.some(i=>r.has(i.id))).map(a=>a.row.id);return o.length===0?{rowIds:[t.rowId],wholeTable:false}:{rowIds:o,wholeTable:o.length===n.topology.rows.length}}function BC(e,t){let n=chunkMXOO7KRI_cjs.Dh(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 a of n.topology.rows){let i=0;for(let s of a.cells){let l=wb(s);if(r.has(s.id))for(let d=0;d<l;d+=1){let u=n.topology.gridColumns[i+d];u&&o.add(u.id);}i+=l;}}return {gridColumnIds:[...o],wholeTable:o.size>0&&o.size===n.topology.gridColumns.length}}function bb(e,t,n){let r=chunkMXOO7KRI_cjs.Dh(e.root,t);return !r.ok||!r.topology.grid?null:r.topology.gridColumns[n]?.id??null}function $C(e){let t=chunkWQFNWLNY_cjs.za(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 wb(e){let t=chunkMXOO7KRI_cjs.Ah(e,"tcPr"),n=t&&chunkMXOO7KRI_cjs.Ah(t,"gridSpan"),r=n&&chunkMXOO7KRI_cjs.Bh(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 qC(e,t,n){let r=e.gridColumns.findIndex(o=>o.id===n);if(r===-1)return null;for(let{row:o,cells:a}of e.rows){let i=0;for(let s of a){let l=wb(s);if(r>=i&&r<i+l)return {tableId:t,rowId:o.id,cellId:s.id,cellIds:[s.id],gridColumnIndex:r,isHeaderRepeat:false};i+=l;}}return null}function ZC(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunkMXOO7KRI_cjs.Dh(e.part.root,t.tableId);if(!n.ok)return null;let r=n.topology.rows.findIndex(i=>i.row.id===t.rowId);if(r===-1)return null;let a=n.topology.rows[r].cells[0];return a?{tableId:t.tableId,rowId:t.rowId,cellId:a.id,cellIds:[a.id],gridColumnIndex:0,isHeaderRepeat:false}:null}function KC(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=chunkMXOO7KRI_cjs.Dh(e.part.root,t.tableId);return n.ok?qC(n.topology,t.tableId,t.gridColumnId):null}function VC(e,t){for(let n of t){let r=chunkMXOO7KRI_cjs.Ji(e,n);if(r)return Dc(r)}return null}function _t(e,t,n){let r=VC(e,t);return r||{ok:true,ops:t,selection:n}}function zC(e,t){if(!chunkMXOO7KRI_cjs.ji.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=Ac(e.color,t);return n.ok?{ok:true,spec:{style:e.style,size:e.size,color:n.color}}:{ok:false,reason:n.reason}}function Da(e,t,n){return n!==e.storeRevision?xe("invalidArgs","the table target is stale"):chunkMXOO7KRI_cjs.Dh(e.part.root,t).ok?null:xe("invalidArgs","the table target is no longer valid")}function jC(e){return e?.isHeaderRepeat?xe("unsupported","repeated header rows cannot be edited"):null}function WC(e,t,n,r){let o=Da(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return xe("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return xe("invalidArgs","column widths must be whole twips");if(n<300||r<300)return xe("invalidArgs","column widths are below the minimum");let a=chunkMXOO7KRI_cjs.Dh(e.part.root,t.tableId);if(!a.ok){let f=a.reason==="duplicate-node-id"?"unknown-table":a.reason;return Dc(f)}if(a.topology.hasMerge)return xe("unsupported","this table has merged cells");let i=a.topology.gridColumns.find(f=>f.id===t.leftGridColumnId),s=a.topology.gridColumns.find(f=>f.id===t.rightGridColumnId);if(!i||!s)return xe("invalidArgs","the table target is no longer valid");let l=a.topology.gridColumns.indexOf(i),d=a.topology.gridColumns.indexOf(s);if(Math.abs(d-l)!==1)return xe("invalidArgs","the column divider target is not adjacent");let u={op:"setTableColumnWidths",tableId:t.tableId,leftGridColumnId:l<d?t.leftGridColumnId:t.rightGridColumnId,rightGridColumnId:l<d?t.rightGridColumnId:t.leftGridColumnId,leftWidthTwips:l<d?n:r,rightWidthTwips:l<d?r:n};return _t(e.part,[u],{kind:"preserveSelection"})}function UC(e,t,n,r){let o=Da(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return xe("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return xe("invalidArgs","column widths must be whole twips");if(n<300)return xe("invalidArgs","column widths are below the minimum");let a=chunkMXOO7KRI_cjs.Dh(e.part.root,t.tableId);if(!a.ok){let l=a.reason==="duplicate-node-id"?"unknown-table":a.reason;return Dc(l)}if(a.topology.hasMerge)return xe("unsupported","this table has merged cells");let i=a.topology.gridColumns[a.topology.gridColumns.length-1];if(!i||i.id!==t.gridColumnId)return xe("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 _t(e.part,[s],{kind:"preserveSelection"})}function Ib(e,t,n){if(e.viewing||!e.editable)return xe("locked","the document is open for viewing");let r=Da(e,t.tableId,t.sourceRevision);if(r)return r;if(t.isHeaderRepeat)return xe("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||n<20||n>31680)return xe("invalidArgs","row height is outside the supported range");let o={op:"setTableRowHeight",tableId:t.tableId,rowId:t.rowId,heightTwips:n};return _t(e.part,[o],{kind:"preserveSelection"})}function Wn(e){let{command:t,part:n,viewing:r,editable:o}=e;if(r||!o)return xe("locked","the document is open for viewing");switch(t.type){case "mergeCells":return xe("unsupported","cell merge is not supported yet");case "splitCell":return xe("unsupported","cell split is not supported yet");case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return xe("unsupported",`command '${t.type}' is not supported by the tree editor`);}let a=NC(t);if(a)return a;let i=DC(t),s=HC(t),l=jC(i??s);if(l)return l;if(i){let u=Da(e,i.tableId,i.sourceRevision);if(u)return u}if(s){let u=Da(e,s.tableId,s.sourceRevision);if(u)return u}let d=i!==null?ZC(e,i):s!==null?KC(e,s):$C(e);if(t.type!=="commitTableColumnDividerResize"&&t.type!=="commitTableRightEdgeResize"&&!d)return i||s?xe("invalidArgs","the table target is no longer valid"):xe("unsupported","the selection is not inside a table");if(d?.isHeaderRepeat)return xe("unsupported","repeated header rows cannot be edited");switch(t.type){case "insertRow":{if(!d)return xe("unsupported","the selection is not inside a table");let u={op:"insertTableRow",tableId:d.tableId,rowId:d.rowId,where:t.where};return _t(n,[u],{kind:"adoptCommittedCaret"})}case "deleteRow":{if(!d)return xe("unsupported","the selection is not inside a table");let u=_C(n,d),f=u.wholeTable?[{op:"deleteBlock",blockId:d.tableId}]:u.rowIds.map(p=>({op:"deleteTableRow",tableId:d.tableId,rowId:p,...p===d.rowId?{referenceCellId:d.cellId}:{}}));return _t(n,f,{kind:"adoptCommittedCaret"})}case "insertColumn":{if(!d)return xe("unsupported","the selection is not inside a table");let u=s?.tableId??d.tableId,f=s?.gridColumnId??bb(n,u,d.gridColumnIndex),p=Nc(e.layout,u)?t.where==="left"?"right":"left":t.where,m=f?{op:"insertTableColumn",tableId:u,where:p,gridColumnId:f}:{op:"insertTableColumn",tableId:u,where:p,referenceCellId:d.cellId};return _t(n,[m],{kind:"adoptCommittedCaret"})}case "deleteColumn":{if(!d)return xe("unsupported","the selection is not inside a table");let u=s?.tableId??d.tableId,f=s?.gridColumnId??bb(n,u,d.gridColumnIndex);if(!f)return xe("invalidArgs","the table has no grid column to delete");let p=s?.gridColumnId===void 0?BC(n,d):{gridColumnIds:[f],wholeTable:false};if(p.wholeTable)return _t(n,[{op:"deleteBlock",blockId:u}],{kind:"adoptCommittedCaret"});let h=(p.gridColumnIds.length>0?p.gridColumnIds:[f]).map(x=>({op:"deleteTableColumn",tableId:u,gridColumnId:x}));return _t(n,h,{kind:"adoptCommittedCaret"})}case "deleteTable":{if(!d)return xe("unsupported","the selection is not inside a table");let u={op:"deleteBlock",blockId:d.tableId};return _t(n,[u],{kind:"adoptCommittedCaret"})}case "setCellFill":{if(!d)return xe("unsupported","the selection is not inside a table");let u;if(t.color===null)u=null;else {let p=Lc(t.color,e.themeColors);if(!p.ok)return xe("invalidArgs",p.reason);u=p.color;}let f={op:"setTableCellFill",tableId:d.tableId,cellIds:d.cellIds,color:u};return _t(n,[f],{kind:"preserveSelection"})}case "setTableCellVerticalAlignment":{if(!d)return xe("unsupported","the selection is not inside a table");let u={op:"setTableCellVerticalAlignment",tableId:d.tableId,cellIds:d.cellIds,alignment:t.alignment};return _t(n,[u],{kind:"preserveSelection"})}case "setTableBorders":{if(!d)return xe("unsupported","the selection is not inside a table");if(t.scope==="none"){let p={op:"setTableCellBorders",tableId:d.tableId,cellIds:d.cellIds,scope:"none",target:gb(t.target,Nc(e.layout,d.tableId))};return _t(n,[p],{kind:"preserveSelection"})}let u=zC(t.spec,e.themeColors);if(!u.ok)return xe("invalidArgs",u.reason);let f={op:"setTableCellBorders",tableId:d.tableId,cellIds:d.cellIds,scope:gb(t.scope,Nc(e.layout,d.tableId)),spec:u.spec};return _t(n,[f],{kind:"preserveSelection"})}case "commitTableColumnDividerResize":return WC(e,t.target,t.leftWidthTwips,t.rightWidthTwips);case "commitTableRightEdgeResize":return UC(e,t.target,t.columnWidthTwips,t.tableWidthTwips);default:return xe("unsupported",`command '${t.type}' is not a table command`)}}function kb(e){if(!mr(e))return {supported:false,reason:`command '${e.type}' is not a table command`};switch(e.type){case "mergeCells":return {supported:false,reason:"cell merge is not supported yet"};case "splitCell":return {supported:false,reason:"cell split is not supported yet"};case "toggleHeaderRow":case "selectTableRegion":case "setTableProperties":return {supported:false,reason:`command '${e.type}' is not supported by the tree editor`};default:return {supported:true}}}function Tt(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 Kr(e){if(typeof e!="object"||e===null)return false;let t=e;return Tt(t.from)&&Tt(t.to)}function Tb(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 a=chunkMXOO7KRI_cjs.Di(t.partByNode.get(o)??e,o)??"";if(n.search===void 0)return {ok:true,span:{nodeId:o,start:0,end:a.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=Tb(a,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 i=Tb(a,n.search,2);return i.length===0?{ok:false,code:"notFound",reason:`'${n.search}' does not occur in paragraph '${n.paraId}'`}:i.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:i[0],end:i[0]+n.search.length}}}function Cb(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(!Tt(r)||!Tt(o))return {ok:false,code:"unsupported",reason:"DocLocation endpoints are not supported; address paragraphs by paraId",target:n.range};let a=cn(e,t,r);if(!a.ok)return {ok:false,code:a.code,reason:a.reason,target:r};let i=cn(e,t,o);return i.ok?{ok:true,selection:{anchor:{paragraphId:a.span.nodeId,offset:a.span.start},head:{paragraphId:i.span.nodeId,offset:i.span.end}}}:{ok:false,code:i.code,reason:i.reason,target:o}}var GC=["alignment","spaceBeforePt","spaceAfterPt","lineSpacing","tabStops"];function XC(e,t){return e===t?true:!e||!t?false:GC.every(n=>e[n]===t[n])}function Hc(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.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.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||!XC(e.disagrees,t.disagrees)||e.tabStops?.length!==t.tabStops?.length||(e.tabStops??[]).some((a,i)=>a.positionTwips!==t.tabStops?.[i]?.positionTwips||a.alignment!==t.tabStops?.[i]?.alignment||(a.leader??"none")!==(t.tabStops?.[i]?.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 a of o)if(n[a]!==r[a])return false;return true}function _c(e,t){return e.current===t.current&&e.total===t.total}function Bc(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 Pb(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 $c(e,t){return e===t?true:!e||!t||!Kr(e)||!Kr(t)?false:Pb(e.from,t.from)&&Pb(e.to,t.to)}function qc(){let e=null;return t=>(t===null?e=null:e?.id!==t&&(e=Object.freeze({id:t})),e)}var YC={scope:"compared",isLoading:"compared",isOpening:"compared",parseError:"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",showParagraphMarks:"compared",documentProtection:"compared",reviewDisplayMode:"compared",hasReviewContent:"compared",hiddenReviewAuthors:"compared",collaborationStatus:"compared",editingMode:"compared",lastRejection:"compared",fontSubstitutions:"compared",formatPainter:"compared"},QC=Object.keys(YC);function Zc(e,t){return QC.every(n=>e[n]===t[n])}function Ts(e){if(e===null||typeof e!="object"||Object.isFrozen(e))return e;if(Array.isArray(e)){for(let n of e)Ts(n);return Object.freeze(e)}let t=e;for(let n of Object.keys(t))Ts(t[n]);return Object.freeze(e)}var Kc=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"}}]]),JC=new Set(["none","black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","yellow","white"]),eP=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,tP=/^[0-9A-Fa-f]{6}$/;function Vc(e){let{mark:t,value:n}=e;switch(t){case "fontFamily":return typeof n!="string"||!eP.test(n)?{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"&&!tP.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"||!JC.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 Fb(e){return typeof e=="object"&&e!==null&&typeof e.paragraphId=="string"&&typeof e.offset=="number"}function zc(e){return typeof e=="object"&&e!==null&&Fb(e.anchor)&&Fb(e.head)}function $t(e,t){let n=new Error(t);return n.code=e,n}function Cs(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 jc(e){return e==="blank"?Vd():e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):null}function Wc(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 Ha(e){switch(e.type){case "toggleMark":return Kc.has(e.mark)?{supported:true,mutating:true}:{supported:false,reason:`mark '${e.mark}' is not supported`};case "setMarkAttr":{let t=Vc(e);return t.ok?{supported:true,mutating:true}:{supported:false,reason:t.reason,code:t.code}}case "setAlignment":return {supported:true,mutating:true};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)>chunkBNZF6DYC_cjs.Ab))return {supported:false,code:"invalidArgs",reason:`indent values must be whole twips within \xB1${chunkBNZF6DYC_cjs.Ab}`};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.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)>chunkBNZF6DYC_cjs.Ab)return {supported:false,reason:`indent values must be within \xB1${chunkBNZF6DYC_cjs.Ab} 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 "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=kb(e);return t.supported?{supported:true,mutating:true}:{supported:false,reason:t.reason??"unsupported table command"}}case "setSelection":return "range"in e&&(zc(e.range)||Kr(e.range))||"anchor"in e&&Tt(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 "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};default:return {supported:false,reason:`command '${e.type}' is not supported by the tree editor`}}}var un="comments and tracked changes require the pro review module (@docx-editor.dev/pro)";var gr="suggesting mode needs an author; configure author before enabling it",nP="this document asks for tracked changes, but no author is configured",Mb="this document is protected for filling in forms, which does not track changes",_a="this document is protected against editing; open it in Word to change that",Ba="this document is protected for comments only",Uc={mode:null,rejection:null};function Gc(e,t){if(e===void 0||e==="view")return Uc;if(e==="edit")return {mode:"editing",rejection:null};let n=Xc(t);return n!==null?{mode:null,rejection:n.reason}:{mode:"suggesting",rejection:null}}function Xc(e){return e.reviewEnabled?e.hasAuthor?null:{ok:false,code:"invalidArgs",reason:gr}:{ok:false,code:"unsupported",reason:un}}function Ab(e){let t=false,n=null,r=e.log??(o=>console.error(o));return {report(o){o!==gr||t||n!==null||(n=setTimeout(()=>{if(n=null,!e.stillMissing())return;t=true;let a=`${gr}. Edits are not tracked until an author is set (the author option at construction, setAuthor(), or the adapter author prop).`;e.emit($t("suggestingNeedsAuthor",a)),r(`[@docx-editor.dev/core] ${a}`);},0));},dispose(){n!==null&&clearTimeout(n),n=null;}}}function Yc(e){if(e.restrictedToReadOnly)return e.currentMode==="viewing"?Uc:{mode:"viewing",rejection:_a};let t=e.currentMode,n=null;e.engineAdoptedViewing&&t==="viewing"&&!e.viewOnly&&(n="editing",t="editing");let r=n===null?Uc:{mode:n,rejection:null};return e.restrictedToComments?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:Ba}:r:e.restrictedToForms?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:Mb}: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:nP}}function Lb(e){return e===null?{enter:true,rejection:null}:{enter:false,rejection:e.reason}}function Qc(e,t){return t!=="viewing"&&e.restrictedToReadOnly?{ok:false,code:"locked",reason:_a}:t==="suggesting"&&e.restrictedToComments?{ok:false,code:"locked",reason:Ba}:t==="suggesting"&&e.restrictedToForms?{ok:false,code:"locked",reason:Mb}:t!=="editing"||!e.restrictedToTrackedChanges?null:{ok:false,code:"locked",reason:"this document permits editing only as tracked changes"}}function Nb(e,t,n,r,o,a=false){let i=Gc(e,t),s=e==="view"?"viewing":i.mode??o,l=Yc({...t,...n,viewOnly:e==="view",hostChoseMode:e!==void 0,readerChoseMode:false,currentMode:s,engineAdoptedViewing:a});l.mode!==null&&(s=l.mode);let d=Qc(n,s),u=n.restrictedToReadOnly?"viewing":r;return {mode:d===null?s:u,rejection:l.rejection??d?.reason??null,configurationRejection:i.rejection}}var Db=new WeakMap;function Hb(e,t){Db.set(e,t);}var $a="this document is protected; only form fields can be filled";function wn(e,t){if(e.type==="undo"||e.type==="redo"||e.type==="toggleDocumentProtection")return null;let n=chunkMXOO7KRI_cjs.Lf(t.session.currentPackage()),r=chunkMXOO7KRI_cjs.Df(n?.root);if(!r.enforced)return null;if(r.edit==="readOnly"||r.edit==="comments")return {ok:false,code:"locked",reason:r.edit==="comments"?Ba:_a};if(r.edit!=="forms"||mr(e))return null;let o="structure",a,i=false;switch(e.type){case "insertText":o="text",a=e.text;break;case "paste":case "pasteWithoutFormatting":o="text",a=e.text,i=true;break;case "deleteText":case "cut":o="text";break;case "toggleMark":case "setMarkAttr":case "pasteFormatting":o="runFormat";break;case "clearFormatting":case "setAlignment":case "setLineSpacing":case "setParagraphSpacing":case "setIndent":case "adjustIndent":case "toggleList":case "setParagraphStyle":case "setParagraphFormat":case "removeTabMark":o="paragraph";break;case "setPageSetup":case "setHeaderFooterOptions":case "convertAllNotes":case "insertToc":case "refreshToc":case "replaceAllMatches":case "resolveAllReviewChanges":case "acceptRevision":case "rejectRevision":case "acceptAllRevisions":case "rejectAllRevisions":o="document";break}let s=t.state().selection,l=t.session.storyParts().find(p=>s.head.paragraphId.startsWith(`${p.name}#`));if(!l)return {ok:false,code:"locked",reason:$a};let d=t.state().cellSelection;return (d&&(o==="runFormat"||o==="paragraph")?[...chunkWQFNWLNY_cjs.ua(t.layout(),d.cellIds)].map(p=>({anchor:{paragraphId:p,offset:0},head:{paragraphId:p,offset:(chunkMXOO7KRI_cjs.Di(l,p)??"").length}})):[s]).some(p=>chunkMXOO7KRI_cjs.$h(l,n,{selection:p,intent:o,text:a,paste:i,fieldId:Db.get(t)?.()??void 0}))?{ok:false,code:"locked",reason:$a}:null}function _b(e,t){if(e!=="locked")return e;let n=chunkMXOO7KRI_cjs.Df(t);return n.enforced?n.edit==="comments"?Ba:n.edit==="forms"?$a:_a:"this content is locked"}function Bb(e){return e!==null&&wn({type:"resolveAllReviewChanges"},e)!==null}function $b(e,t){return ()=>e()??(t()?null:"the document is read-only")}function rP(e){return [e.left,e.top,e.right,e.bottom]}function Jc(e){return Object.freeze({left:e.left*100,top:e.top*100,right:e.right*100,bottom:e.bottom*100})}function oP(e){return Object.freeze({left:e.left/100,top:e.top/100,right:e.right/100,bottom:e.bottom/100})}function qa(e){return Math.round(e*1e3)}function Za(e){return e/1e3}function eu(e){return Object.freeze({left:qa(e.left),top:qa(e.top),right:qa(e.right),bottom:qa(e.bottom)})}function aP(e){return Object.freeze({left:Za(e.left),top:Za(e.top),right:Za(e.right),bottom:Za(e.bottom)})}function tu(e){return rP(e).some(n=>!Number.isFinite(n)||n<0||n>100)?false:e.left+e.right<100&&e.top+e.bottom<100}var iP=new Set(["insertImage","replaceImage"]),sP=new Set(["insertImage","replaceImage","deleteImage","setImageWrapType","transformImage","setImagePosition","setImageProperties"]);function nu(e,t,n){return n!==null&&e.drawingNodeId!==n?false:e.start===t||e.start+1===t}function lP(e,t,n,r){if(!e)return null;for(let o of e.drawings??[])if(o.paragraphId===t&&nu(o,n,r))return o;return null}function dP(e,t,n,r){let o=e.layout();for(let a of o.pages){for(let i of a.anchoredDrawings??[])if(i.anchorParagraphId===t&&nu(i,n,r))return i;for(let i of [a.header,a.footer])if(i){for(let s of i.anchoredDrawings??[])if(s.anchorParagraphId===t&&nu(s,n,r))return s}}return null}function qb(e){return e.kind==="pointer"?`pointer:${e.drawingNodeId}`:e.kind}function Ka(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=chunkBNZF6DYC_cjs.$d(e.layout(),n.paragraphId,n.offset),a=t.kind==="pointer"?t.drawingNodeId:null;return lP(o,n.paragraphId,n.offset,a)??dP(e,n.paragraphId,n.offset,a)}function Zb(e,t){let n=e.storyScope(),r=e.session.partFor(n)??e.session.part(),o=chunkMXOO7KRI_cjs.Ha(r,t.drawingNodeId);return !o||o.kind!=="drawing"?null:chunkMXOO7KRI_cjs.mb(o,{ownerPartName:t.ownerPartName,supportedMcRequires:chunkMXOO7KRI_cjs.fb,limits:chunkMXOO7KRI_cjs.eb,resolveRelationship:chunkMXOO7KRI_cjs.hb(e.session.currentPackage(),t.ownerPartName)})}function Kb(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 cP(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 Vb(e){let t=e.locks;return Object.freeze({canResize:!t.resize&&!e.hidden,canMove:!t.move&&!e.hidden,canChangeWrap:!t.move&&e.kind==="anchored"&&!e.hidden,canCrop:!t.resize&&!t.changeAspect&&!e.hidden})}function uP(e){return e.kind==="inlineDrawing"?"inline":e.wrap}function In(e){let t=Ka(e);if(!t||t.placeholderGraphicKind!==null)return null;let n=e?Zb(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:Jc(t.crop),rotationDegrees:r.rotationDegrees,wrap:uP(t),position:Kb(n),name:n.name,title:n.title,description:n.description,hyperlink:n.hyperlinkHref,locks:n.locks,hidden:n.hidden,resourceStatus:t.resource.kind,intrinsic:cP(t),...Vb(n)})}function zb(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 ru(e){if("drawingNodeId"in e&&typeof e.drawingNodeId=="string")return e.drawingNodeId}function jb(e){if("expectedPackageRevision"in e&&typeof e.expectedPackageRevision=="number")return e.expectedPackageRevision}function ou(e){return ru(e)!==void 0||jb(e)!==void 0||e.type==="setImageProperties"&&e.selectionParagraphId!==void 0}function au(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};let o=jb(t);if(o!==void 0&&r.session.packageRevision()!==o)return {ok:false,code:"notFound",reason:"stale package revision"};let a=ru(t),i=In(r);if(a!==void 0&&(!i||i.id!==a))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 wo(e,n,{requireDrawing:a!==void 0||n.drawingNodeId!==null,drawingNodeId:a??n.drawingNodeId??void 0})}function hr(e,t){let n=In(e),r=ru(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 fP(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 Ps(e,t){return fP(e.applyDrawingOps(t))}function pP(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 mP(e){return e.borderWidthEmu!==void 0||e.borderColor!==void 0}function gP(e){return e.horizontalEmu!==void 0||e.verticalEmu!==void 0||e.relativeToH!==void 0||e.relativeToV!==void 0}function hP(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||chunkMXOO7KRI_cjs.ni(e)}function Wb(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 Va(e){return sP.has(e.type)}function yP(e){return iP.has(e.type)}function Ub(e){return {ok:false,code:"unsupported",reason:`${e.type} is asynchronous; use executeImageCommand`}}function Gb(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:"image changes are not supported in suggesting mode"}:null}function za(e){let t=e.surface;if(!t)return null;let{anchor:n}=t.state().selection,r=In(t);return Object.freeze({mountGeneration:e.mountGeneration,packageRevision:t.session.packageRevision(),drawingNodeId:r?.id??null,selectionParagraphId:n.paragraphId,selectionOffset:n.offset})}function wo(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:a}=r.state().selection;if(o.paragraphId!==t.selectionParagraphId||o.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(o.paragraphId!==a.paragraphId||o.offset!==a.offset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(n?.requireDrawing){let i=In(r),s=n.drawingNodeId??t.drawingNodeId;if(!i||!s||i.id!==s)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return null}function ja(e,t){if(!Va(e))return null;if(!t)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=wn(e,t);if(n)return n;if(e.type==="insertImage")return !(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;if(e.type==="replaceImage"){if(!(e.data instanceof Uint8Array)||e.data.byteLength===0)return {ok:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};let a=hr(t,e);return "ok"in a?a:null}let r=hr(t,e);if("ok"in r)return r;let o=In(t);if(!o)return {ok:false,code:"notFound",reason:"no drawing is selected"};if(t.editingMode()==="suggest"&&e.type!=="deleteImage")return {ok:false,code:"invalidArgs",reason:"image changes are not supported in suggesting mode"};switch(e.type){case "deleteImage":return o.locks.select?{ok:false,code:"locked",reason:"the drawing cannot be selected"}:null;case "setImageWrapType":return o.canChangeWrap?null:{ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};case "transformImage":return o.locks.changeAspect||o.locks.resize?{ok:false,code:"locked",reason:"the drawing is locked"}:null;case "setImagePosition":if(!o.canMove||o.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};if(!gP(e))return {ok:false,code:"invalidArgs",reason:"setImagePosition requires at least one field"};let a=o.position?.mode??"frame";return chunkMXOO7KRI_cjs.pi(e,a)?chunkMXOO7KRI_cjs.ki(Wb(e,o))?null:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"}:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"};case "setImageProperties":{if(mP(e))return {ok:false,code:"unsupported",reason:"image border properties are not supported yet"};if(!hP(e))return {ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"};if(e.resetToNaturalSize&&!o.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&&!o.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.heightEmu!==void 0&&!o.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.crop!==void 0&&!tu(e.crop))return {ok:false,code:"invalidArgs",reason:"crop values are out of range"};if(e.crop!==void 0&&!o.canCrop)return {ok:false,code:"locked",reason:"crop cannot be changed on this drawing"};if(e.hyperlink!==void 0&&e.hyperlink!==null&&!chunkMXOO7KRI_cjs.L(e.hyperlink).ok)return {ok:false,code:"invalidArgs",reason:"unsafe hyperlink URL"};if(e.wrap!==void 0&&!o.canChangeWrap)return {ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};if(chunkMXOO7KRI_cjs.ni(e)){if(!o.canMove||o.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};let i=o.position?.mode??"frame";if(!chunkMXOO7KRI_cjs.pi(e,i))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"};if(!chunkMXOO7KRI_cjs.ki(chunkMXOO7KRI_cjs.oi(e,o)))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"}}return null}default:return null}}function iu(e,t){let n=Gb(t,e.type);if(n)return n;let r=ja(e,t);return r||{ok:true}}function Xb(e,t){let n=ja(e,t);return n||Ub(e)}function Yb(e,t,n){if(yP(t))return Ub(t);let r=n&&ou(t)?za(n):null;if(r&&n){let o=au(n,t,r);if(o)return o}switch(t.type){case "deleteImage":{let o=hr(e,t);if("ok"in o)return o;let a=e.deleteImage(o.id);return a.ok?null:{ok:false,code:"invalidArgs",reason:a.detail??a.reason??"deleteImage was refused"}}case "setImageWrapType":{let o=hr(e,t);return "ok"in o?o:Ps(e,[{op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.target}])}case "transformImage":{let o=hr(e,t);return "ok"in o?o:Ps(e,[{op:"transformDrawing",drawingNodeId:o.id,action:t.action}])}case "setImagePosition":{let o=hr(e,t);if("ok"in o)return o;let a=In(e),i=Wb(t,a);return Ps(e,[{op:"positionDrawing",drawingNodeId:o.id,position:i}])}case "setImageProperties":{let o=hr(e,t);if("ok"in o)return o;let a=In(e);if(!a)return {ok:false,code:"notFound",reason:"no drawing is selected"};let i=[];if(t.resetToNaturalSize){let d=pP(a);if(!d)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};i.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:d});}else (t.widthEmu!==void 0||t.heightEmu!==void 0)&&i.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:{cx:t.widthEmu??a.widthEmu,cy:t.heightEmu??a.heightEmu}});t.crop!==void 0&&i.push({op:"cropDrawing",drawingNodeId:o.id,crop:eu(t.crop)});let s=t.title??t.alt,l=t.description??t.alt;if((s!==void 0||l!==void 0)&&i.push({op:"setDrawingMetadata",drawingNodeId:o.id,title:s??a.title,description:l??a.description}),t.wrap!==void 0&&i.push({op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.wrap}),chunkMXOO7KRI_cjs.ni(t)){let d=chunkMXOO7KRI_cjs.oi(t,a);i.push({op:"positionDrawing",drawingNodeId:o.id,position:d});}if(t.hyperlink!==void 0){let d=e.applyImageProperties({drawingNodeId:o.id,ops:i,hyperlink:t.hyperlink});return d.ok?null:{ok:false,code:"invalidArgs",reason:d.detail??d.reason??"setImageProperties was refused"}}return i.length===0?{ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"}:Ps(e,i)}default:return null}}function bP(e,t,n,r,o){let a=chunkBNZF6DYC_cjs.fc(e.sectionPropertiesAt(t)),i=a.width-a.margin.left-a.margin.right,s=a.height-a.margin.top-a.margin.bottom,l=chunkBNZF6DYC_cjs.$d(e.layout(),t,n),d=l&&l.box.width>0?Math.min(l.box.width,i):i,u=Math.min(1,d/r,s/o);return u>=1?{widthPoints:r,heightPoints:o}:{widthPoints:r*u,heightPoints:o*u}}async function su(e,t){let n=e.surface;if(!n)return {ok:false,code:"notFound",reason:"no document is loaded"};let r=Gb(n,t.type);if(r)return r;let o=ja(t,n);if(o)return o;let a=za(e);if(!a)return {ok:false,code:"notFound",reason:"no document is loaded"};if(t.type==="insertImage"){let{anchor:f}=n.state().selection,p=t.expectedPackageRevision??a.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let m=bP(n,f.paragraphId,f.offset,t.widthPoints,t.heightPoints),h=await n.insertImage({paragraphId:f.paragraphId,offset:f.offset,bytes:t.data,mime:t.mime,widthPoints:m.widthPoints,heightPoints:m.heightPoints,expectedPackageRevision:p,commitGuard:()=>wo(e,a)===null,...t.title!==void 0?{title:t.title}:{},...t.description!==void 0?{description:t.description}:{},...t.hyperlink!==void 0?{hyperlink:t.hyperlink}:{}}),x=wo(e,a);return x||(h.ok?{ok:true,changed:h.change!==null}:{ok:false,code:"invalidArgs",reason:h.detail==="stale-package-epoch"?"stale package revision":h.detail??h.reason??"insertImage was refused"})}let i=hr(n,t);if("ok"in i)return i;let s=t.expectedPackageRevision??a.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",d=await n.replaceImage(i.id,t.data,l,{expectedPackageRevision:s,commitGuard:()=>wo(e,a,{requireDrawing:true,drawingNodeId:i.id})===null}),u=wo(e,a,{requireDrawing:true,drawingNodeId:i.id});return u||(d.ok?{ok:true,changed:d.change!==null}:{ok:false,code:"invalidArgs",reason:d.detail==="stale-package-epoch"?"stale package revision":d.detail??d.reason??"replaceImage was refused"})}var vP=1,xP=10,Wa=12700;function SP(e,t){if(!t||t.hidden||t.locks.select)return Object.freeze({canResize:false,canMove:false,aspectLocked:true});let n=Vb(t);return Object.freeze({canResize:n.canResize,canMove:n.canMove,aspectLocked:t.locks.changeAspect})}function wP(e){if(!e)return null;let{anchor:t,head:n}=e.state().selection;if(t.paragraphId!==n.paragraphId||t.offset!==n.offset)return null;let r=Ka(e);if(!r||r.accessibility.hidden)return null;let o=e.layout(),a=chunkBNZF6DYC_cjs.ed(o,r.drawingNodeId);if(!a)return null;let i=Zb(e,r);if(!i||i.locks.select)return null;let s=SP(r,i),d=e.editingMode()==="edit"&&e.session.editable?s:{...s,canResize:false,canMove:false},u=r.kind==="anchoredDrawing"?Object.freeze({x:r.horizontalFrameOrigin,y:r.verticalFrameOrigin}):null;return Object.freeze({id:r.drawingNodeId,pageIndex:a.pageIndex,x:a.x,y:a.y,width:a.width,height:a.height,kind:r.kind==="inlineDrawing"?"inline":"anchored",widthEmu:i.extentEmu.cx,heightEmu:i.extentEmu.cy,position:Kb(i),anchorFrameOrigin:u,transform:r.transform,...d})}function Ct(e){return Math.round(e*Wa)}function So(e){return e/Wa}function IP(e,t,n,r,o,a){let i=So(e),s=So(t),l=i/s,d=n.includes("e")?r:n.includes("w")?-r:0,u=n.includes("s")?o:n.includes("n")?-o:0;if(i=Math.max(1,i+d),s=Math.max(1,s+u),a)if(n.length===2){let p=Math.max(i/So(e),s/So(t));i=Math.max(1,So(e)*p),s=Math.max(1,i/l);}else n==="e"||n==="w"?s=Math.max(1,i/l):i=Math.max(1,s*l);return Object.freeze({cx:Ct(i),cy:Ct(s)})}function lu(e,t,n){return e.mode==="simple"?Object.freeze({mode:"simple",horizontalEmu:(e.horizontalEmu??0)+Ct(t),verticalEmu:(e.verticalEmu??0)+Ct(n)}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu+Ct(t)}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu+Ct(n)}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}function kP(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"}:wo(e,t.preconditions,{requireDrawing:true,drawingNodeId:t.drawingNodeId}):{ok:false,code:"notFound",reason:"no document is loaded"}}function Qb(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.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}:{}}}function du(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 cu(e){if(!e)return null;let{anchor:t,head:n}=e.state().selection;if(t.paragraphId===n.paragraphId){let d=e.session.paraIdOf(t.paragraphId);return d===null?null:{from:{paraId:d},to:{paraId:d}}}let r=e.session.paragraphAnchors(),o=r.paraIdByNode.get(t.paragraphId),a=r.paraIdByNode.get(n.paragraphId);if(o===void 0||a===void 0)return null;let i=r.ordinalByNode.get(t.paragraphId)??0,s=r.ordinalByNode.get(n.paragraphId)??0;return s<i||s===i&&n.offset<t.offset?{from:{paraId:a},to:{paraId:o}}:{from:{paraId:o},to:{paraId:a}}}function Jb(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 e0(e,t){if(!e)return [];if(t!==void 0&&t.part!=="body")return [];let n=e.session.part(),r=e.session.paragraphAnchors();return chunkB4KZSKF7_cjs.d(n).map(o=>{let a=r.paraIdByNode.get(o.id),i=o.kind==="textValue"?void 0:chunkB4KZSKF7_cjs.i(o);return {...a!==void 0?{paraId:a}:{},text:chunkMXOO7KRI_cjs.Di(n,o.id)??"",...i!==void 0?{styleId:i}:{}}})}function uu(e){return e?e.state().pageCount:0}function fu(e,t="caret"){return e?e.currentPage(t):1}function TP(e,t){if(!mr(e))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"not a table command"}};let n=Rs(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 CP(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 Rs(e,t){let n=CP(e,t),r=Wn(n),o=chunkMXOO7KRI_cjs.Lf(t.session.currentPackage());return r.ok&&r.ops.some(a=>chunkMXOO7KRI_cjs.ei(n.part,o,a))&&(r={ok:false,code:"locked",reason:$a}),r.ok?{can:{ok:true},plan:r}:{can:{ok:false,code:r.code,reason:r.reason},plan:r}}function Ua(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 s=t?.activeScope?.()??{kind:"body"};if(s.kind!=="headerFooter"||s.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=Ha(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 a=o.mutating?wn(e,t):null;if(a)return {ok:false,refusal:a};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==="copy"||e.type==="cut"||e.type==="deleteText"){let{anchor:s,head:l}=t.state().selection;if(s.paragraphId===l.paragraphId&&s.offset===l.offset)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing is selected"}}}if(e.type==="setParagraphStyle"&&!t.session.documentStyles().some(s=>s.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:ob}};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"}};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 l=t.sectionBreakRefusal(e.kind==="section"?"nextPage":"continuous");if(l)return {ok:false,refusal:{ok:false,code:"unsupported",reason:l}}}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 s=t.headerFooterState?.();if((e.sectionIndex??s?.sectionIndex??0)===0)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}}}if(mr(e)){let s=TP(e,t);return s.ok?{ok:true,tablePlan:s.tablePlan}:s}let i=ja(e,t);return i&&!i.ok?{ok:false,refusal:i}:{ok:true}}function t0(e,t){let n=e.session.part();if(!t.startsWith(`${n.name}#`)||!chunkMXOO7KRI_cjs.Ha(n,t))return true;let r=chunkMXOO7KRI_cjs.Ia(n,t),o=0;for(;r;){if(r.kind==="tableCell"||r.kind==="generic"&&r.localName==="tc"||(o+=1)>64)return true;r=chunkMXOO7KRI_cjs.Ia(n,r.id);}return false}function n0(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!t0(e,t.selection.head.paragraphId))return null;let r=chunkWQFNWLNY_cjs.ya(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&&!t0(e,t.selection.head.paragraphId))return null;let r=chunkWQFNWLNY_cjs.ya(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 r0(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 o0(e){return !!e&&Ut(e.session.part(),e.state().selection.head)!==void 0}var pe={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"],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"],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 Io={activeTarget:"all",spec:{style:"single",size:8,color:{kind:"hex",value:"000000"}}},i0=["table.borderTarget","table.borderColor","table.borderStyle","table.borderWidth","table.cellFill"];function mu(e){return i18n.createT(i18n.en)(e)}function Ga(e){return i0.includes(e)}function EP(e){return e!=null}var s0=[{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"}],l0=[{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"}],OP=[{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 FP(e){return e==="all"||e==="outside"||e==="inside"||e==="top"||e==="bottom"||e==="left"||e==="right"}function MP(e){return e==="none"||FP(e)}function a0(e){if(!e||typeof e!="object")return false;let t=e.kind;return t==="hex"||t==="theme"||t==="auto"}function AP(e){return l0.some(t=>t.value===e)}function Vr(e,t,n){switch(t){case "table.borderTarget":return MP(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(!a0(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(!AP(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&&!a0(n)?null:{command:{type:"setCellFill",color:n},nextDraft:e};default:return null}}function gu(e,t=Io){switch(e){case "table.borderTarget":return {type:"setTableBorders",scope:t.activeTarget,spec:t.spec};case "table.borderColor":return Vr(t,e,{kind:"hex",value:"000000"})?.command??null;case "table.borderStyle":return Vr(t,e,"single")?.command??null;case "table.borderWidth":return Vr(t,e,8)?.command??null;case "table.cellFill":return {type:"setCellFill",color:{kind:"hex",value:"FFFF00"}};default:return null}}function LP(e){return s0.find(n=>n.value===e)?.labelKey??"table.borders.all"}function NP(e){return pe[e]}function yr(e){return e.surface??null}var DP={"review.comments":{type:"toggleReviewPane"},"review.paragraphMarks":{type:"toggleParagraphMarks"},"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"},"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.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"}};function HP(e){return c0[e]??null}var d0=Uint8Array.from(atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),e=>e.charCodeAt(0)),c0={"text.link":{type:"insertHyperlink",href:"https://example.com"},"image.insert":{type:"insertImage",data:d0,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"}};function Os(e){return DP[e]??null}var _P={"font.family":{mark:"fontFamily",attr:"family"},"font.size":{mark:"fontSize",attr:"val"},"text.color":{mark:"color",attr:"val"},"text.highlight":{mark:"highlight",attr:"val"}},u0={"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 f0(e,t,n){return Vr(n,e,t)?.command??null}function Es(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(Ga(e))return f0(e,t,Io);if(e==="image.wrap")return typeof t!="string"||!chunkMXOO7KRI_cjs.db.includes(t)?null:{type:"setImageWrapType",target:t};if(e==="image.altText")return typeof t!="string"?null:{type:"setImageProperties",description:t};let n=_P[e];return n?{type:"setMarkAttr",mark:n.mark,attr:n.attr,value:t}:null}function p0(e,t,n=Io){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let r=gu(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 BP=["editing","suggesting","viewing"];function m0(e,t){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};if(Ga(t))return p0(e,t);if(t==="review.editingMode"){let a=e.getEditingMode?.()??"editing",i=BP.filter(d=>d!==a).map(d=>e.can(Es(t,d))),s=i.some(d=>d.ok),l=i.find(d=>!d.ok);return {id:t,enabled:s,disabledReason:!s&&l&&!l.ok?l.reason:null,active:false,value:a}}if(t==="format.painter"){let a=yr(e);if(!a)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let i=a.formatPainter.state();if(i.mode!=="off")return {id:t,enabled:true,disabledReason:null,active:true,value:i.mode};let s=e.can({type:"clearFormatting"});return s.ok?{id:t,enabled:true,disabledReason:null,active:false,value:i.mode}:{id:t,enabled:false,disabledReason:s.reason,active:false,value:i.mode}}if(t==="contentControl.showAll"||t==="contentControl.formFill"){let a=yr(e),i=a?.state().contentControls,s=t==="contentControl.showAll"?i?.showAll??false:i?.formFill??false;return {id:t,enabled:a!==null,disabledReason:a?null:"editor is not ready",active:s}}if(t==="contentControl.inspector"){let a=yr(e);return a?a.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.authors"){let a=e.can({type:"toggleReviewPane"});return a.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:a.reason,active:false}}let n=Os(t);if(!n){let a=u0[t];if(a!==void 0){let s=Es(t,a);if(!s)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let l=e.can(s),d=e.getSelectedImage?.()??null,u=t==="image.wrap"?d?.wrap:t==="image.altText"?d?.description:rb(e,t);return l.ok?{id:t,enabled:true,disabledReason:null,active:false,...u!==void 0?{value:u}:{}}:{id:t,enabled:false,disabledReason:l.reason,active:false,...u!==void 0?{value:u}:{}}}let i=c0[t];if(i){if(t==="image.insert"&&i.type==="insertImage"){let l=e.canExecuteImageCommand?.({type:"insertImage",data:d0,mime:"image/png",widthPoints:72,heightPoints:72})??e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="image.properties"&&i.type==="setImageProperties"){let l=e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="table.insert"&&i.type==="insertTable"){let l=e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}if(t==="paragraph.dialog"&&i.type==="setParagraphFormat"){let l=e.can(i);return l.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:l.reason,active:false}}let s=e.can(i);if(!s.ok)return {id:t,enabled:false,disabledReason:s.reason,active:false}}return 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 $P(e){if(e==="format.painter")return true;let t=Os(e);return t?.type==="toggleMark"||t?.type==="toggleParagraphMarks"||t?.type==="toggleDocumentProtection"||t?.type==="setReviewDisplayMode"||t?.type==="setAlignment"}function qP(e,t){return t.map(n=>m0(e,n))}function ZP(e,t,n,r){if(!e)return {result:{ok:false,code:"unsupported",reason:"editor is not ready"},nextDraft:null};let o=Vr(r,t,n);if(!o)return {result:{ok:false,code:"unsupported",reason:"invalid table chrome value"},nextDraft:null};let a=e.can(o.command);if(!a.ok)return {result:{ok:false,code:a.code,reason:a.reason},nextDraft:null};let i=e.exec(o.command);return i.ok?{result:i,nextDraft:o.nextDraft}:{result:i,nextDraft:null}}var KP=new Set(["format.painter","contentControl.showAll","contentControl.formFill","contentControl.inspector","contentControl.remove"]);function VP(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||u0[t]!==void 0||Ga(t))return {ok:false,code:"invalidArgs",reason:"pass a toolbar value before command options"};r=n,n=void 0;}if(r?.historyGroup!==void 0&&KP.has(t))return {ok:false,code:"unsupported",reason:`${t} does not take a history group`};if(t==="format.painter"){let i=yr(e);if(!i)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(i.formatPainter.state().mode==="off"){let s=e.can({type:"clearFormatting"});if(!s.ok)return {ok:false,code:s.code,reason:s.reason}}return i.formatPainter.press()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:xs}}if(t==="contentControl.showAll"){let i=yr(e);return i?(i.contentControls.setShowAll(!i.contentControls.showAll()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.formFill"){let i=yr(e);return i?(i.contentControls.setFormFill(!i.contentControls.formFill()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.inspector"){let i=yr(e);return i?i.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 i=yr(e);if(!i)return {ok:false,code:"unsupported",reason:"editor is not ready"};let s=i.state().contentControls.activeControlId;if(!s)return {ok:false,code:"notFound",reason:"no content control at the selection"};let l=i.contentControls.disabledReason(s,"remove");return l?{ok:false,code:l==="bound"?"bound":"locked",reason:l}:i.contentControls.remove(s)?{ok:true,changed:true}:{ok:false,code:i.state().lastRejection??"unsupported",reason:i.state().lastRejection??"removeContentControl was refused"}}let o=n===void 0?Os(t):Es(t,n);if(!o)return n!==void 0?{ok:false,code:"unsupported",reason:"invalid value for toolbar command"}:t==="file.save"?{ok:false,code:"unsupported",reason:"save is not a command; run it with runSave(editor)"}:t==="file.open"?{ok:false,code:"unsupported",reason:"open is not a command; run it with editor.load(bytes)"}:{ok:false,code:"unsupported",reason:"not wired to an editor command"};let a=e.can(o,r);return a.ok?e.exec(o,r):{ok:false,code:a.code,reason:a.reason}}function zP(e){return e?e.save():Promise.reject(new Error("editor is not ready"))}function jP(e,t){if(!e)return {enabled:false,disabledReason:"editor is not ready"};let n=Rs(t,e);return n.can.ok?{enabled:true,disabledReason:null}:{enabled:false,disabledReason:n.can.reason}}function WP(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 hu(e){return e instanceof Uint8Array?Array.from(e):Array.isArray(e)?e.map(hu):e===null||typeof e!="object"?e:Object.fromEntries(Object.keys(e).sort().map(t=>[t,hu(e[t])]))}function UP(e){return JSON.stringify(hu(e))}var g0={id:"review",labelKey:"formattingBar.commentsAndChanges",controls:[{id:"simpleMarkup",shape:"icon",labelKey:"review.simpleMarkup",defaultToolbar:false,paths:pe.visibility,state:{kind:"command"}},{id:"allMarkup",shape:"icon",labelKey:"review.allMarkup",defaultToolbar:false,paths:pe.visibility,state:{kind:"command"}},{id:"noMarkup",shape:"icon",labelKey:"review.noMarkup",defaultToolbar:false,paths:pe.visibility,state:{kind:"command"}},{id:"original",shape:"icon",labelKey:"review.original",defaultToolbar:false,paths:pe.visibility,state:{kind:"command"}},{id:"previousChange",shape:"icon",labelKey:"review.previousChange",defaultToolbar:false,paths:pe.keyboard_arrow_up,state:{kind:"command"}},{id:"nextChange",shape:"icon",labelKey:"review.nextChange",defaultToolbar:false,paths:pe.keyboard_arrow_down,state:{kind:"command"}},{id:"acceptAllChanges",shape:"icon",labelKey:"review.acceptAllChanges",defaultToolbar:false,paths:pe.check,state:{kind:"command"}},{id:"rejectAllChanges",shape:"icon",labelKey:"review.rejectAllChanges",defaultToolbar:false,paths:pe.close,state:{kind:"command"}},{id:"paragraphMarks",shape:"icon",labelKey:"formattingBar.paragraphMarks",defaultToolbar:false,paths:pe.format_paragraph,state:{kind:"command"}},{id:"protectDocument",shape:"icon",labelKey:"review.protectDocument",defaultToolbar:false,paths:pe.lock,state:{kind:"command"}},{id:"comments",shape:"icon",labelKey:"formattingBar.commentsAndChanges",paths:pe.comment,state:{kind:"command"}},{id:"authors",shape:"dropdown",labelKey:"reviewers.label",paths:pe.visibility,defaultToolbar:false,state:{kind:"command"}},{id:"editingMode",shape:"dropdown",labelKey:"editingMode.label",valueKey:"editingMode.editing",paths:pe.edit_note,state:{kind:"command"}}]};var yu=[{id:"history",labelKey:"formattingBar.groups.history",controls:[{id:"undo",labelKey:"formattingBar.undoShortcut",paths:pe.undo,state:{kind:"command"}},{id:"redo",labelKey:"formattingBar.redoShortcut",paths:pe.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:pe.format_bold,state:{kind:"command"}},{id:"italic",labelKey:"formattingBar.italicShortcut",paths:pe.format_italic,state:{kind:"command"}},{id:"underline",labelKey:"formattingBar.underlineShortcut",paths:pe.format_underlined,state:{kind:"command"}},{id:"strike",labelKey:"formattingBar.strikethrough",paths:pe.strikethrough_s,state:{kind:"command"}},{id:"color",shape:"colorSplit",swatch:"#ff0000",labelKey:"formattingBar.fontColor",paths:pe.format_color_text,state:{kind:"value"}},{id:"highlight",shape:"colorSplit",swatch:"#ffff00",labelKey:"formattingBar.highlightColor",paths:pe.ink_highlighter,state:{kind:"value"}},{id:"link",labelKey:"formattingBar.insertLinkShortcut",paths:pe.link,state:{kind:"command"}}]},{id:"script",labelKey:"formattingBar.groups.script",controls:[{id:"super",labelKey:"formattingBar.superscript",paths:pe.superscript,state:{kind:"command"}},{id:"sub",labelKey:"formattingBar.subscript",paths:pe.subscript,state:{kind:"command"}}]},{id:"alignment",labelKey:"formattingBar.groups.alignment",controls:[{id:"left",labelKey:"alignment.alignLeft",paths:pe.format_align_left,state:{kind:"command"}},{id:"center",labelKey:"alignment.center",paths:pe.format_align_center,state:{kind:"command"}},{id:"right",labelKey:"alignment.alignRight",paths:pe.format_align_right,state:{kind:"command"}},{id:"justify",labelKey:"alignment.justify",paths:pe.format_align_justify,state:{kind:"command"}}]},{id:"list",labelKey:"formattingBar.groups.listFormatting",controls:[{id:"bullet",labelKey:"lists.bulletList",paths:pe.format_list_bulleted,state:{kind:"command"}},{id:"numbered",labelKey:"lists.numberedList",paths:pe.format_list_numbered,state:{kind:"command"}},{id:"outdent",labelKey:"lists.decreaseIndent",paths:pe.format_indent_decrease,state:{kind:"command"}},{id:"indent",labelKey:"lists.increaseIndent",paths:pe.format_indent_increase,state:{kind:"command"}},{id:"lineSpacing",shape:"dropdown",labelKey:"lineSpacing.label",paths:pe.format_line_spacing,state:{kind:"command"}}]},{id:"format",labelKey:"formattingBar.groups.format",controls:[{id:"painter",labelKey:"formattingBar.formatPainterShortcut",paths:pe.format_paint,state:{kind:"command"}},{id:"clear",labelKey:"formattingBar.clearFormatting",paths:pe.format_clear,state:{kind:"command"}}]},g0,{id:"contentControl",labelKey:"contentControl.group",contextual:true,controls:[{id:"showAll",labelKey:"contentControl.showAll",paths:pe.visibility,state:{kind:"command"}},{id:"formFill",labelKey:"contentControl.formFill",paths:pe.edit_note,state:{kind:"command"}},{id:"inspector",labelKey:"contentControl.inspector",paths:pe.tune,state:{kind:"command"}},{id:"remove",labelKey:"contentControl.remove",paths:pe.delete,state:{kind:"command"}}]},{id:"image",labelKey:"formattingBar.groups.image",contextual:true,controls:[{id:"insert",labelKey:"toolbar.image",paths:pe.image,state:{kind:"command"}},{id:"properties",labelKey:"formattingBar.imagePropertiesShortcut",paths:pe.tune,state:{kind:"command"}},{id:"wrap",shape:"dropdown",labelKey:"formattingBar.imageWrap",paths:pe.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:pe.table,state:{kind:"command"}},{id:"borderTarget",shape:"dropdown",labelKey:"table.borders.tooltip",paths:pe.border_all,state:{kind:"value"}},{id:"borderColor",shape:"colorSplit",swatch:"#000000",labelKey:"table.borderColor",paths:pe.border_color,state:{kind:"value"}},{id:"borderStyle",shape:"dropdown",labelKey:"table.borders.styleAriaLabel",paths:pe.border_horizontal,state:{kind:"value"}},{id:"borderWidth",shape:"dropdown",labelKey:"table.borderWidth",paths:pe.line_weight,state:{kind:"value"}},{id:"cellFill",shape:"colorSplit",swatch:"#ffffff",labelKey:"table.cellFillColor",paths:pe.format_color_fill,state:{kind:"value"}}]},{id:"paragraph",labelKey:"dialogs.paragraph.title",contextual:true,controls:[{id:"dialog",labelKey:"lineSpacing.options",paths:pe.format_line_spacing,state:{kind:"command"}}]},{id:"file",labelKey:"toolbar.file",contextual:true,controls:[{id:"open",labelKey:"toolbar.open",paths:pe.file_upload,state:{kind:"load"}},{id:"save",labelKey:"toolbar.saveShortcut",paths:pe.file_download,state:{kind:"save"}},{id:"pageSetup",labelKey:"toolbar.pageSetup",paths:pe.settings,state:{kind:"command"}}]},{id:"insert",labelKey:"toolbar.insert",contextual:true,controls:[{id:"footnote",labelKey:"toolbar.insertFootnote",paths:pe.superscript,state:{kind:"command"}},{id:"endnote",labelKey:"toolbar.insertEndnote",paths:pe.edit_note,state:{kind:"command"}},{id:"pageNumber",labelKey:"headerFooter.insertPageNumber",paths:pe.format_list_numbered,state:{kind:"command"}},{id:"totalPages",labelKey:"headerFooter.insertTotalPages",paths:pe.format_list_numbered,state:{kind:"command"}},{id:"sectionPages",labelKey:"headerFooter.insertSectionPages",paths:pe.format_list_numbered,state:{kind:"command"}},{id:"pageXofY",labelKey:"headerFooter.insertPageXofY",paths:pe.format_list_numbered,state:{kind:"command"}},{id:"pageBreak",labelKey:"toolbar.pageBreak",paths:pe.page_break,state:{kind:"command"}},{id:"sectionBreakNextPage",labelKey:"toolbar.sectionBreakNextPage",paths:pe.horizontal_rule,state:{kind:"command"}},{id:"sectionBreakContinuous",labelKey:"toolbar.sectionBreakContinuous",paths:pe.border_horizontal,state:{kind:"command"}},{id:"toc",labelKey:"toolbar.tableOfContents",paths:pe.toc,state:{kind:"command"}}]}],h0=yu;function GP(e,t){return `${e.id}.${t.id}`}function y0(){return h0.filter(e=>!e.contextual).map(e=>({...e,controls:e.controls.filter(t=>t.defaultToolbar!==false)}))}function XP(e){let t=y0();if(!e)return t;let n=h0.find(r=>r.id==="image");return n?[...t,n]:t}var b0=[{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:"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:"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:"table.insert",picker:"tableGrid"},{kind:"separator"},{kind:"item",slot:"insert.footnote"},{kind:"item",slot:"insert.endnote"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.break",paths:pe.page_break,items:[{kind:"item",slot:"insert.pageBreak"},{kind:"item",slot:"insert.sectionBreakNextPage"},{kind:"item",slot:"insert.sectionBreakContinuous"}]},{kind:"item",slot:"insert.toc"}]},{id:"review",labelKey:"toolbar.review",entries:[{kind:"submenu",labelKey:"review.displayForReview",paths:pe.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.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:"separator"},{kind:"item",slot:"review.protectDocument"}]},{id:"help",labelKey:"toolbar.help",entries:[]}];function YP(){let e=[],t=n=>{for(let r of n)r.kind==="item"?e.push(r.slot):r.kind==="submenu"&&t(r.items);};for(let n of b0)t(n.entries);return e}function QP(){return yu.reduce((e,t)=>e+t.controls.length,0)}var JP="formattingBar.unavailableInPreview";function v0(e){let t="select[data-docx-form-dropdown]",n=d=>d instanceof Element?d.closest(t):null,r=d=>{let u=d.closest("[data-start][data-paragraph-id]"),f=u?.dataset.paragraphId;if(!u||!f)return null;let p=e.part(f),m=chunkMXOO7KRI_cjs.Ha(p,f);if(m?.kind!=="paragraph")return null;let h=Number(u.dataset.start),x=chunkMXOO7KRI_cjs.xh(m).find(y=>y.start<=h&&h<y.end);if(!x)return null;let b={op:"setLegacyDropdown",paragraphId:f,fieldNodeId:x.fieldNodeId,selectedIndex:d.selectedIndex};return {field:x,paragraphId:f,op:b,enabled:e.editable()&&e.canApply(b)&&chunkMXOO7KRI_cjs.Xh(e.settings(),b)===null&&chunkMXOO7KRI_cjs.Ji(p,b)===null}},o=()=>{for(let d of e.pagesLayer.querySelectorAll(t))d.disabled=!r(d)?.enabled;},a=d=>{let u=n(d.target);u&&(d.stopPropagation(),r(u)?.enabled||d.preventDefault());},i=d=>{let u=n(d.target);u&&(u.disabled=!r(u)?.enabled);},s=d=>{let u=n(d.target);if(!u)return;d.stopPropagation();let f=r(u);if(!f)return;if(!f.enabled||!e.apply(f.op)){u.selectedIndex=f.field.selectedIndex;return}e.select({anchor:{paragraphId:f.paragraphId,offset:f.field.start},head:{paragraphId:f.paragraphId,offset:f.field.end}}),[...e.pagesLayer.querySelectorAll(t)].find(m=>{let h=m.closest("[data-start][data-paragraph-id]");return h?.dataset.paragraphId===f.paragraphId&&Number(h.dataset.start)===f.field.start})?.focus({preventScroll:true});},l=new MutationObserver(d=>{for(let u of d)for(let f of u.addedNodes){if(!(f instanceof Element))continue;let p=f.matches(t)?[f]:f.querySelectorAll(t);for(let m of p)m.disabled=!r(m)?.enabled;}});return l.observe(e.pagesLayer,{childList:true,subtree:true}),e.pagesLayer.addEventListener("pointerdown",a,true),e.pagesLayer.addEventListener("focusin",i),e.pagesLayer.addEventListener("change",s),o(),{sync:o,keydown(d){let u=n(d.target);if(!u)return false;d.stopPropagation();let f=d.key.toLowerCase();return (d.ctrlKey||d.metaKey)&&!d.altKey&&(f==="z"||f==="y")?(d.preventDefault(),e.pagesLayer.focus({preventScroll:true}),e.history(f==="y"||d.shiftKey?"redo":"undo"),true):(!r(u)?.enabled&&d.key!=="Tab"&&d.preventDefault(),true)},destroy(){l.disconnect(),e.pagesLayer.removeEventListener("pointerdown",a,true),e.pagesLayer.removeEventListener("focusin",i),e.pagesLayer.removeEventListener("change",s);}}}function Fs(e,t){let n=e.ownerDocument,r=e.dataset.docxCcId,o=()=>{n.removeEventListener("pointerdown",a,true),n.removeEventListener("keydown",i,true);},a=s=>{if(e.parentNode===null){o();return}let l=s.target,d=l instanceof Element?l.closest("[data-docx-cc-widget]"):null;l&&(e.contains(l)||d?.getAttribute("data-docx-cc-id")===r)||(o(),t());},i=s=>{s.key!=="Escape"||s.isComposing||(s.preventDefault(),o(),e.parentNode!==null&&(s.stopPropagation(),t()));};return n.addEventListener("pointerdown",a,true),n.addEventListener("keydown",i,true),o}function x0(e,t,n,r,o){let i=chunkBNZF6DYC_cjs.qe(e).find(f=>f.id===n)?.fragments[0],s=i?e.pages[i.pageIndex]:void 0;if(!i||!s)return null;let l=o?.get(i.pageIndex)??0,d=s.contentBox.x-s.box.x,u=s.contentBox.y-s.box.y;return {left:(s.box.x+l+d+i.box.x)*t,top:(s.box.y+u+i.box.y+i.box.height)*t,element:[...r.querySelectorAll("[data-docx-content-control]")].find(f=>f.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 S0(e){return e.kind==="textValue"?e.value:e.localName==="sdtPr"?"":e.children.map(S0).join("")}function bu(e,t){let n=e?S0(e):"";return t.find(r=>r.displayText===n)?.value??n}function w0(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 eR=["dropdown","comboBox","date","checkbox","picture","buildingBlockGallery"];function I0(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,a){if(r(),n||!e.request||!eR.includes(a))return false;let i=new AbortController;t={controller:i,id:o};let s=()=>!n&&t?.controller===i&&!i.signal.aborted,l=()=>s()&&w0(e.find(o))===a&&e.allowed(o),d=e.find(o),u=e.items(o).map(x=>({...x})),f=bu(d,u),p=a==="picture"?e.picture(o):void 0;if(a==="picture"&&!p)return r(),false;let m=false,h={controlId:o,kind:a,items:u,value:a==="date"?e.date(o)??"":a==="checkbox"?String(e.checked(o)):a==="picture"?p:a==="buildingBlockGallery"?"":f,locale:e.locale(),anchor:[...e.layer.querySelectorAll("[data-docx-content-control]")].find(x=>x.getAttribute("data-docx-content-control")===o)?.querySelector(".docx-content-control-boundary")??null,signal:i.signal,canApply:l,apply(x){return a==="picture"||!l()||!e.apply(o,x)?false:(s()&&r(),true)},cancel(){s()&&r();},...a==="picture"?{async replaceImage(x){if(m||!l())return false;m=true;try{return await e.replaceImage(o,x,()=>l()&&e.picture(o)===p)?(s()&&r(),!0):!1}finally{m=false;}}}:{}};return e.setOpen(o,true),e.request(h)?true:(h.cancel(),false)}}}function k0(e,t){if(!e)return [];if(t&&C0(e))return chunkMXOO7KRI_cjs.xf(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 a of r.children){if(a.kind==="textValue"||a.localName!=="listItem")continue;let i=a.attributes.find(l=>l.localName==="value")?.value??"",s=a.attributes.find(l=>l.localName==="displayText")?.value??i;o.push({displayText:s,value:i});}return o}return []}function T0(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 C0(e){return w0(e&&e.kind!=="textValue"?e:null)==="buildingBlockGallery"}function P0(e,t,n,r){if(!e||!C0(e))return [{op:"setContentControlValue",controlId:n,value:r}];let o=chunkMXOO7KRI_cjs.xf(t(),e).filter(i=>i.name===r),a=o.length===1?o[0]:void 0;return a?[{op:"insertBuildingBlock",controlId:n,name:a.name,blocks:a.blocks}]:null}function R0(e){let t=-1,n=true;return ()=>{let r=e.packageRevision();return t!==r&&(t=r,n=!chunkMXOO7KRI_cjs.Jg(e.settingsRoot()).doNotShadeFormData),n}}var Ms="switch to field results before editing a form value";function E0(e,t){let{anchor:n,head:r}=t,o=n.paragraphId===r.paragraphId;for(let a of [n,r]){let i=e(a.paragraphId),s=i&&chunkMXOO7KRI_cjs.Ha(i,a.paragraphId);if(s?.kind!=="paragraph")continue;let l=o?Math.min(n.offset,r.offset):a.offset,d=o?Math.max(n.offset,r.offset):a.offset,u=chunkMXOO7KRI_cjs.Ue(s);if(chunkMXOO7KRI_cjs.re(s).filter(p=>p.addressing==="editable-result").map(p=>{let m=u.spanOf(p.node)?.start??0,h=m;for(let x of p.removeNodeIds)h=Math.max(h,u.spanOf(x)?.end??h);return {start:m,end:h}}).some(p=>l===d?l>=p.start&&(l<p.end||p.start===p.end):l<p.end&&d>p.start))return true}return false}function O0(e,t,n,r){let o=e.contentControlId?chunkBNZF6DYC_cjs.qe(t).find(u=>u.id===e.contentControlId):void 0,a=jn(n).filter(u=>u.toc.id===e.id),i=a.some(u=>u.start>0||u.end<u.length);if(o&&!i)return {tocId:e.id,boundary:o,additional:false};let s=new Map(a.map(u=>[u.paragraphId,u])),l=a.filter(u=>u.start>0||u.end<u.length).flatMap(u=>chunkBNZF6DYC_cjs.ee(t,{anchor:{paragraphId:u.paragraphId,offset:u.start},head:{paragraphId:u.paragraphId,offset:u.end}},[u.paragraphId],r)),d=t.pages.flatMap(u=>{let f=chunkBNZF6DYC_cjs.B(u).filter(b=>{let y=s.get(b.paragraphId);return y&&y.start===0&&y.end===y.length}).map(chunkBNZF6DYC_cjs.Ad);if(f.push(...l.filter(b=>b.pageIndex===u.index)),f.length===0)return [];let p=Math.min(...f.map(b=>b.x)),m=Math.min(...f.map(b=>b.y)),h=Math.max(...f.map(b=>b.x+b.width)),x=Math.max(...f.map(b=>b.y+b.height));return [{pageIndex:u.index,box:{x:p,y:m,width:h-p,height:x-m}}]});return d.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:d}}}var F0=new WeakMap;function M0(e,t,n,r){F0.set(e,o=>{let a=t();e.flushPendingInput();try{n(o),r();}catch(i){throw n(a),r(),i}});}function A0(e,t){let n=F0.get(e);if(!n)throw new Error("Surface does not support measurement updates");n(t);}var rR=i18n.createT(i18n.en);function Xt(e){return t=>{try{let n=e?.(t);if(typeof n=="string"&&n&&n!==t)return n}catch{}return rR(t)}}var L0=new WeakMap;function As(e,t){let n=new Map;return L0.set(e,n),(r,o,a="textContent")=>{let i=n.get(r);i||n.set(r,i=new Map),i.set(a,o),a==="textContent"?r.textContent=t(o):r.setAttribute(a,t(o));}}function N0(e,t){let n=L0.get(e);if(n)for(let[r,o]of n){if(r!==e&&!e.contains(r)){n.delete(r);continue}for(let[a,i]of o)a==="textContent"?r.textContent=t(i):r.setAttribute(a,t(i));}}function D0(e,t){let n=e.ownerDocument.defaultView;if(!n)return;let r=e.offsetParent;if(!r)return;let o=t.getBoundingClientRect(),a=t.closest(".docx-page")?.getBoundingClientRect(),i=t.closest(".docx-editor__scroll-container")?.getBoundingClientRect(),s=Math.max(0,a?.left??0,i?.left??0),l=Math.min(n.innerWidth,a?.right??n.innerWidth,i?.right??n.innerWidth),d=Math.max(0,i?.top??0),u=Math.min(n.innerHeight,i?.bottom??n.innerHeight);e.style.maxWidth=`${Math.max(0,l-s)}px`,e.style.maxHeight=`${Math.max(0,u-d)}px`;let f=e.getBoundingClientRect(),p=u-o.bottom,m=o.top-d,h=f.height>p&&m>p,x=Math.max(0,h?m:p);e.style.maxHeight=`${Math.max(0,Math.min(u-d,x))}px`;let b=Math.min(f.height,x),y=Math.max(s,Math.min(o.left,l-f.width)),I=Math.max(d,h?o.top-b:o.bottom),k=r.getBoundingClientRect(),E=r.offsetWidth?k.width/r.offsetWidth:1,C=r.offsetHeight?k.height/r.offsetHeight:1;e.style.left=`${(y-k.left)/E-r.clientLeft+r.scrollLeft}px`,e.style.top=`${(I-k.top)/C-r.clientTop+r.scrollTop}px`,e.dataset.placement=h?"top":"bottom";}function Xa(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,a=t,i=()=>{if(!a.isConnected&&r&&o){let d=[...r.querySelectorAll("[data-docx-content-control]")].find(u=>u.dataset.docxContentControl===o)?.querySelector(".docx-content-control-boundary");d&&(s?.unobserve(a),a=d,s?.observe(a));}a.isConnected&&D0(e,a);},s=typeof ResizeObserver>"u"?null:new ResizeObserver(i);s?.observe(e),s?.observe(a);let l=typeof MutationObserver>"u"?null:new MutationObserver(i);return r&&l?.observe(r,{childList:true,subtree:true}),i(),n?.addEventListener("resize",i),e.ownerDocument.addEventListener("scroll",i,true),()=>{s?.disconnect(),l?.disconnect(),n?.removeEventListener("resize",i),e.ownerDocument.removeEventListener("scroll",i,true);}}function Ya(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(i=>i.tabIndex>=0&&!i.hasAttribute("disabled")&&!i.closest("[hidden]")&&e.ownerDocument.defaultView?.getComputedStyle(i).display!=="none");if(!r.length){t.preventDefault(),e.focus();return}let o=e.ownerDocument.activeElement,a=t.shiftKey&&(o===r[0]||o===e)?r.at(-1):!t.shiftKey&&(o===r.at(-1)||o===e)?r[0]:null;a&&(t.preventDefault(),a.focus());}function oR(e){let t=e?.ownerDocument??(typeof document>"u"?null:document),n=t?.activeElement;return n&&n!==t?.body?n:e?.closest(".docx-pages")??null}var vu="image/png,image/jpeg,image/gif,image/bmp,image/webp",aR=new Set(vu.split(",")),iR=8;function sR(e){if(!e||e.kind==="textValue")return;let t=(n,r)=>{if(!(n.kind==="textValue"||r>iR)){if(n.kind==="drawing")return n.id;if(n.localName!=="sdtPr")for(let o of n.children){let a=t(o,r+1);if(a)return a}}};return t(e,0)}function H0(e){let t=null,n=null,r=null,o,a,i=0,s=false,l=()=>{i++,o?.(),a?.(),r?.remove(),r=null;let f=n;t?.remove(),t=null,n=null,f&&(e.setOpen(f,false),s||e.layer.focus({preventScroll:true}));},d=f=>sR(e.find(f)),u=async(f,p,m=()=>true)=>{if(s||!m()||!e.allowed(f))return false;if(p.byteLength>chunkMXOO7KRI_cjs.m.maxEncodedBytes)return e.reject("image-resource-limit"),false;let h=d(f);if(!h)return e.reject("no-picture"),false;let x=chunkMXOO7KRI_cjs.ub(p);if(!aR.has(x))return e.reject("unsupported-image"),false;let b=await e.replaceImage(h,p,x,()=>!s&&m()&&e.allowed(f)&&d(f)===h);return b.ok?true:(e.reject(b.detail??b.reason),false)};return {drawingOf:d,replace:u,cancel:l,select(f){let p=d(f),m=p?chunkBNZF6DYC_cjs.ed(e.layout(),p):null;return m?e.selectDrawing(p,m.record.paragraphId):false},pick(f){if(l(),s||!e.allowed(f))return;let p=i,m=()=>!s&&i===p;if(!d(f)){e.reject("no-picture");return}let h=e.document.createElement("input");h.type="file",h.accept=vu,h.className="docx-content-control-picture-picker",h.dataset.docxMarker="",h.dataset.docxCcId=f,h.setAttribute("contenteditable","false"),h.setAttribute("aria-hidden","true"),h.tabIndex=-1;let x=Xt(e.translate),b=e.document.createElement("div");b.className="docx-content-control-menu",b.style.position="absolute",b.style.zIndex="20",b.style.pointerEvents="auto",b.dataset.docxCcId=f,b.dataset.docxMarker="",b.setAttribute("role","dialog"),b.setAttribute("aria-label",x("contentControl.types.picture")),b.setAttribute("contenteditable","false"),b.hidden=true;let y=e.document.createElement("div");y.className="docx-content-control-widget-error",y.setAttribute("role","alert"),y.textContent=x("disabledReason.invalidValue");let I=e.document.createElement("button");I.type="button",I.textContent=x("common.cancel"),I.addEventListener("click",l),b.addEventListener("pointerdown",k=>k.stopPropagation()),b.addEventListener("keydown",k=>{Ya(b,k,l),k.stopPropagation();}),b.append(y,I),h.addEventListener("change",()=>{let k=h.files?.[0];!k||!m()||(h.value="",h.disabled=true,(async()=>{let E=false;try{k.size>chunkMXOO7KRI_cjs.m.maxEncodedBytes?e.reject("image-resource-limit"):E=await u(f,new Uint8Array(await k.arrayBuffer()),m);}catch{m()&&e.reject("image-read-failed");}if(!m())return;if(E){l();return}h.disabled=false,h.className="docx-content-control-picture-input",h.removeAttribute("aria-hidden"),h.tabIndex=0,h.setAttribute("aria-label",x("contentControl.types.picture")),h.setAttribute("aria-invalid","true"),b.prepend(h),b.hidden=false;let C=[...e.layer.querySelectorAll("[data-docx-content-control]")].find(H=>H.getAttribute("data-docx-content-control")===f)?.querySelector(".docx-content-control-boundary");a?.(),o?.(),C&&(a=Xa(b,C)),o=Fs(b,l),h.focus();})());}),h.addEventListener("cancel",l),e.layer.append(h),(e.layer.closest(".docx-editor__scroll-container")??e.layer).append(b),r=b,t=h,n=f,e.setOpen(f,true),h.click();},destroy(){s=true,l();}}}function _0(e,t,n,r){return (chunkMXOO7KRI_cjs.ii(e,t,n)?.offset??n)+r}function B0(e){if(e&&!(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")&&!(e.controlType==="checkbox"||e.controlType==="picture"))return e.id}function $0(e,t,n){return {op:"insertText",paragraphId:e.paragraphId,offset:e.offset,text:t,...n===void 0?{}:{inside:n}}}function lR(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 a of o.querySelectorAll("[data-docx-content-control]:not([data-docx-toc])"))for(let i of a.querySelectorAll(".docx-content-control-boundary")){let s=i.getBoundingClientRect();if(t>=s.left-3&&t<=s.right+22&&n>=s.top-3&&n<=s.bottom+3)return a}return null}function q0(e){let t=null,n=0,r=null,o=l=>{l!==t&&(t?.isConnected&&delete t.dataset.hover,t=l,l&&(l.dataset.hover=""));},a=()=>{n=0,r&&o(lR(e,r.x,r.y));},i=l=>{r={x:l.clientX,y:l.clientY},n===0&&(n=e.ownerDocument.defaultView?.requestAnimationFrame(a)??0),n===0&&a();},s=()=>{r=null,o(null);};return e.addEventListener("pointermove",i),e.addEventListener("pointerleave",s),{destroy(){e.removeEventListener("pointermove",i),e.removeEventListener("pointerleave",s),n&&e.ownerDocument.defaultView?.cancelAnimationFrame(n),o(null);}}}var Qa=.25;function Z0(e,t,n){let r=(s,l)=>{let d=chunkBNZF6DYC_cjs.ne(e,s,n);return d?chunkBNZF6DYC_cjs.pe(e,{x:d.x+l,y:d.y+d.height/2,pageIndex:d.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,-Qa);let i=t.head.paragraphId===t.anchor.paragraphId&&t.head.offset<t.anchor.offset;return r(t.head,i?Qa:-Qa)??r(t.anchor,i?-Qa:Qa)}function K0(e,t,n,r,o){let a=r==="left"?-1:1,i=chunkBNZF6DYC_cjs.ne(e,t.from,o),s=chunkBNZF6DYC_cjs.ne(e,t.to,o),l=i?chunkBNZF6DYC_cjs.ce(e,i)??1:1,d=a*l===-1?t.from:t.to;if(!i||!s||i.lineId!==s.lineId||i.pageIndex!==s.pageIndex)return d;let u=chunkBNZF6DYC_cjs._d(e).get(t.from.paragraphId)?.find(({line:h})=>h.id===i.lineId)?.line;if(!u?.spans.some(h=>h.style.shaping))return d;let f=n.indexOf(t.from.paragraphId),p=n.indexOf(t.to.paragraphId),m;for(let h of u.spans){let x=h.range.paragraphId,b=n.indexOf(x);if(b<f||b>p)continue;let y=Math.max(h.range.start,x===t.from.paragraphId?t.from.offset:0),I=Math.min(h.range.end,x===t.to.paragraphId?t.to.offset:1/0);if(!(y>=I))for(let k of [y,I]){let E={paragraphId:x,offset:k},C=chunkBNZF6DYC_cjs.ne(e,E,o);if(!C||C.lineId!==i.lineId||C.pageIndex!==i.pageIndex)continue;let H=C.x;(!m||(H-m.x)*a>0)&&(m={position:E,x:H});}}return m?.position??d}function V0(e,t,n){let r=e;return {get:()=>r,set(o){o!==r&&(t(),r=o,n());}}}function z0(e,t,n,r){let o=Xt(r),a=e.ownerDocument,i=a.createElement("dialog"),s=As(i,o);i.className="docx-text-form-dialog",i.setAttribute("role","alertdialog"),s(i,"textFormField.invalidTitle","aria-label"),s(i,`textFormField.invalid${t==="number"?"Number":"Date"}`,"aria-description");let l=a.createElement("h2");l.className="docx-text-form-dialog__header",s(l,"textFormField.invalidTitle");let d=a.createElement("div");d.className="docx-text-form-dialog__body",s(d,`textFormField.invalid${t==="number"?"Number":"Date"}`);let u=a.createElement("div");u.className="docx-text-form-dialog__footer";let f=a.createElement("button");f.type="button",f.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",s(f,"textFormField.apply");let p=false,m=()=>{p||(p=true,n());};return f.addEventListener("click",m),i.addEventListener("keydown",h=>{h.key!=="Enter"||h.isComposing||(h.preventDefault(),h.stopPropagation(),m());}),i.addEventListener("cancel",h=>{h.preventDefault(),m();}),u.append(f),i.append(l,d,u),e.append(i),i.showModal(),f.focus(),i}function j0(e,t,n,r,o){let a=Xt(o),i=e.ownerDocument,s=i.createElement("dialog"),l=As(s,a);s.className="docx-text-form-dialog",l(s,"textFormField.title","aria-label");let d=i.createElement("h2");d.className="docx-text-form-dialog__header",l(d,"textFormField.title");let u=i.createElement("div");u.className="docx-text-form-dialog__body";let f=i.createElement("div");f.className="docx-text-form-dialog__footer",s.append(d,u,f);let p=(R,N)=>{let B=i.createElement("label");B.className="docx-text-form-dialog__row";let U=i.createElement("span");U.className="docx-text-form-dialog__label",l(U,R),N.className="docx-text-form-dialog__input",B.append(U,N),u.append(B);},m=i.createElement("input");m.type="text",m.value=t.defaultText,p("textFormField.defaultText",m);let h=i.createElement("select"),x=["regular","number","date"];for(let R of x){let N=i.createElement("option");N.value=R,l(N,`textFormField.${R}`),h.append(N);}if(!x.includes(t.type)){let R=i.createElement("option");R.value=t.type,l(R,"textFormField.preservedType"),R.disabled=true,h.append(R);}h.value=t.type,p("textFormField.type",h);let b=i.createElement("input");b.type="number",b.min="0",b.max="32767",b.step="1",b.value=String(t.maxLength),p("textFormField.maxLength",b);let y=i.createElement("select"),I=R=>{y.replaceChildren();let N=chunkMXOO7KRI_cjs.lh[h.value]??[];for(let B of N){let U=i.createElement("option");U.value=B;let _={Uppercase:"textFormField.uppercase",Lowercase:"textFormField.lowercase","First capital":"textFormField.firstCapital","Title case":"textFormField.titleCase"}[B];_||!B?l(U,_??"textFormField.noFormat"):U.textContent=B,y.append(U);}if(!N.includes(R)){let B=i.createElement("option");B.value=R,R?B.textContent=R:l(B,"textFormField.noFormat"),B.disabled=true,y.append(B);}y.value=R;};I(t.format),h.addEventListener("change",()=>I("")),p("textFormField.format",y);let k=i.createElement("input");k.type="checkbox",k.checked=t.enabled;let E=i.createElement("label");E.className="docx-text-form-dialog__checkbox-row";let C=i.createElement("span");l(C,"textFormField.enabled"),E.append(k,C),u.append(E);let H=i.createElement("p");H.className="docx-text-form-dialog__error",H.setAttribute("role","alert"),u.append(H);let A=i.createElement("button");A.type="button",A.className="docx-text-form-dialog__button",l(A,"textFormField.cancel"),A.addEventListener("click",r);let w=i.createElement("button");w.type="button",w.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",l(w,"textFormField.apply");let P=()=>{if(!b.value||!b.checkValidity()||!n(m.value,{type:h.value,maxLength:Number(b.value),format:y.value,enabled:k.checked})){l(H,"textFormField.invalidOptions");return}r();};return w.addEventListener("click",P),s.addEventListener("keydown",R=>{R.key==="Enter"&&!R.isComposing&&R.target instanceof HTMLInputElement&&(R.preventDefault(),P());}),s.addEventListener("cancel",R=>{R.preventDefault(),r();}),f.append(A,w),e.append(s),s.showModal(),m.focus(),m.select(),s}function W0(e,t,n){let r=[],o=[];for(let i of e)for(let s of chunkMXOO7KRI_cjs.Vh(i).keys()){let l=chunkMXOO7KRI_cjs.Ha(i,s);if(l?.kind==="paragraph")for(let d of chunkMXOO7KRI_cjs.ph(l)){let u=t.get(d.fieldNodeId);if(!u)continue;let f=(chunkMXOO7KRI_cjs.Di(i,s)??"").slice(d.start,d.end),p=chunkMXOO7KRI_cjs.mh(f,d,"fill",u.locale);if(p===null)return {reason:"invalidArgs"};if(p===f)continue;let m={op:"commitTextFormField",paragraphId:s,fieldNodeId:d.fieldNodeId,locale:u.locale},h=chunkMXOO7KRI_cjs.Ji(i,m);if(h)return {reason:h};r.push(m),o.push({paragraphId:s,start:d.start,end:d.end,length:p.length});}}let a=i=>{let s=i.offset;for(let l of o)l.paragraphId!==i.paragraphId||i.offset<=l.start||(s+=i.offset>=l.end?l.length-(l.end-l.start):Math.min(i.offset-l.start,l.length)-(i.offset-l.start));return s===i.offset?i:{...i,offset:s}};return {ops:r,selection:{anchor:a(n.anchor),head:a(n.head)}}}var Ls=new WeakMap,Ns=new WeakMap;function G0(e){return Ns.get(e)?.()??null}function U0(e){return [...chunkMXOO7KRI_cjs.Vh(e).keys()].flatMap(t=>{let n=chunkMXOO7KRI_cjs.Ha(e,t);return n?.kind==="paragraph"?chunkMXOO7KRI_cjs.ph(n):[]})}function xu(e){return Ls.get(e)?.()}function X0(e,t){let n=Xt(e.translate),r=e.container.ownerDocument,o,a=false,i=new Map,s=()=>e.parts?.()??[e.part()];if(t?.length)for(let D of s()){let M=t.filter(z=>z.partName===D.name);if(!M.length)continue;let q=U0(D);for(let z of M){let X=q[z.fieldIndex];X&&i.set(X.fieldNodeId,{text:z.text,locale:z.locale});}}let l=new WeakMap,d=new WeakMap,u=(D=e.part())=>{l.set(D,new Map([...i].filter(([M])=>M.startsWith(`${D.name}#`))));},f=()=>(i=new Map(s().flatMap(D=>[...l.get(D)??[]])),d.get(e.part())??null),p=D=>{i.delete(D),u();};s().forEach(u);let m=()=>{if(!i.size)return null;if(a)return "invalidState";let D=W0(s(),i,e.selection());if("reason"in D)return D.reason;if(D.ops.length&&!e.editable())return "locked";let M=s();s().forEach(u);let q=i;D.ops.length&&d.set(e.part(),e.selection()),i=new Map,a=true;try{let z=D.ops.length?e.save?e.save(D.ops,D.selection):"unsupported":null;return z?i=q:(delete ce.dataset.fieldError,D.ops.length&&d.set(e.part(),D.selection)),s().forEach(u),z}catch(z){throw s().every(X=>M.includes(X))&&(i=q),s().forEach(u),z}finally{a=false;}};Ns.set(e.container,m);let h=()=>i.size?s().flatMap(D=>U0(D).flatMap((M,q)=>{let z=i.get(M.fieldNodeId);return z?[{partName:D.name,fieldIndex:q,...z}]:[]})):[];Ls.set(e.container,h);let x,b=(D,M)=>(chunkMXOO7KRI_cjs.Di(e.part(),D)??"").slice(M.start,M.end),y=null,I=null,k=null,E=false,C=false,H=()=>{let D=k;k=null,C=false,y?.remove(),y=null,D?.abort();},A=()=>{if(!y&&!k)return;let D=e.selection();H(),!E&&(e.pagesLayer.focus({preventScroll:true}),e.select(D));};function w(D,M){x={paragraphId:D,fieldNodeId:M.fieldNodeId},e.select({anchor:{paragraphId:D,offset:M.start},head:{paragraphId:D,offset:M.end}}),e.selection().head.paragraphId===D&&e.selection().head.offset>=M.start&&e.selection().head.offset<=M.end&&(I=x??I),x=void 0;}function P(D,M){if(E)return;A();let q=e.locale?.()??"en-US",z=new AbortController;k=z;let X=()=>{if(E||z.signal.aborted||k!==z)return false;let V=chunkMXOO7KRI_cjs.Ha(e.part(D),D);return V?.kind==="paragraph"&&chunkMXOO7KRI_cjs.ph(V).some(j=>j.fieldNodeId===M.fieldNodeId)&&e.editable()&&!e.protected(D)},O={field:{...M},signal:z.signal,canApply:X,apply(V,j){if(!X()||!e.apply({op:"setTextFormFieldDefault",locale:q,paragraphId:D,fieldNodeId:M.fieldNodeId,text:V,options:j}))return false;if(E||k!==z||z.signal.aborted)return true;let ee=chunkMXOO7KRI_cjs.Ha(e.part(D),D),ne=ee?.kind==="paragraph"?chunkMXOO7KRI_cjs.ph(ee).find(te=>te.fieldNodeId===M.fieldNodeId):null;return ne&&w(D,ne),A(),true},cancel(){k===z&&!z.signal.aborted&&A();}};e.onRequest?.(O)||z.signal.aborted||(y=j0(e.container,M,O.apply,O.cancel,n));}let R=D=>{let q=D.target?.closest('[data-field-atom="form"][data-start]'),z=q?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!q||!z||!e.editable())return null;let X=chunkMXOO7KRI_cjs.Ha(e.part(),z);if(X?.kind!=="paragraph")return null;let O=Number(q.dataset.start),V=chunkMXOO7KRI_cjs.ph(X).find(j=>j.start<=O&&O<j.end);return V?{paragraphId:z,field:V}:null},N=null,B=D=>D.shiftKey||D.altKey||D.ctrlKey||D.metaKey,U=D=>{if(o=void 0,N=null,D.button!==0)return;let M=R(D);M&&!B(D)&&!e.protected(M.paragraphId)&&(N={x:D.clientX,y:D.clientY,paragraphId:M.paragraphId,fieldNodeId:M.field.fieldNodeId,moved:false}),x=M?{paragraphId:M.paragraphId,fieldNodeId:M.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("pointerdown",U,{capture:true});let F=D=>{N&&Math.hypot(D.clientX-N.x,D.clientY-N.y)>4&&(N.moved=true);},_=()=>{N=null;},$=(D,M=false)=>{let q=N;if(N=null,!q||q.moved||y||D.button!==0||D.detail>1||Math.hypot(D.clientX-q.x,D.clientY-q.y)>4||!e.editable()||B(D)||e.protected(q.paragraphId))return;let z=chunkMXOO7KRI_cjs.Ha(e.part(),q.paragraphId),X=z?.kind==="paragraph"?chunkMXOO7KRI_cjs.ph(z).find(V=>V.fieldNodeId===q.fieldNodeId):null;if(!X)return;let O=e.selection();M&&(O.anchor.paragraphId!==O.head.paragraphId||O.anchor.offset!==O.head.offset)&&!(O.anchor.paragraphId===q.paragraphId&&O.head.paragraphId===q.paragraphId&&Math.min(O.anchor.offset,O.head.offset)===X.start&&Math.max(O.anchor.offset,O.head.offset)===X.end)||w(q.paragraphId,X);};r.addEventListener("pointermove",F),r.addEventListener("pointercancel",_),e.pagesLayer.addEventListener("click",$);let Z=D=>{if(D.shiftKey||D.altKey||D.ctrlKey||D.metaKey)return false;let M=R(D);if(!M)return false;let{paragraphId:q,field:z}=M;return D.preventDefault(),w(q,z),e.protected(q)||P(q,z),true};e.pagesLayer.addEventListener("dblclick",Z);function Y(){let D=e.selection();if(D.anchor.paragraphId!==D.head.paragraphId)return null;let M=D.head.paragraphId,q=chunkMXOO7KRI_cjs.Ha(e.part(),M);if(q?.kind!=="paragraph")return null;let z=Math.min(D.anchor.offset,D.head.offset),X=Math.max(D.anchor.offset,D.head.offset),O=chunkMXOO7KRI_cjs.ph(q).filter(j=>j.start<=z&&j.end>=X&&(j.start===j.end||z!==X||z<j.end||e.protected(M))),V=O.find(j=>I?.paragraphId===M&&j.fieldNodeId===I.fieldNodeId)??O.find(j=>j.start===z&&j.end===X)??O[0];return V?{paragraphId:M,field:V}:null}function oe(){if(o===void 0)return Y();if(!o)return null;let D=chunkMXOO7KRI_cjs.Ha(e.part(),o.paragraphId),M=D?.kind==="paragraph"?chunkMXOO7KRI_cjs.ph(D).find(q=>q.fieldNodeId===o.fieldNodeId):null;return M?{paragraphId:o.paragraphId,field:M}:null}let ue=D=>{let M=D.button===-1||D.clientX===0&&D.clientY===0?Y():R(D);o=M?{paragraphId:M.paragraphId,fieldNodeId:M.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("contextmenu",ue);let Te=()=>{let D=oe();return !!D&&e.editable()&&!e.protected(D.paragraphId)&&!chunkMXOO7KRI_cjs.Ji(e.part(),{op:"setTextFormFieldDefault",paragraphId:D.paragraphId,fieldNodeId:D.field.fieldNodeId,text:"",options:{type:"regular",maxLength:0,format:"",enabled:true}})},ce=r.createElement("span");return ce.className="docx-text-form-status",e.container.append(ce),{doubleClick:Z,pointerUp:D=>$(D,true),canEdit:Te,edit(){if(!Te())return false;let D=oe();return w(D.paragraphId,D.field),P(D.paragraphId,D.field),true},selectForDeletion(D){let M=e.selection(),{paragraphId:q,offset:z}=M.head;if(!e.editable()||e.protected(q)||M.anchor.paragraphId!==q||M.anchor.offset!==z)return false;let X=chunkMXOO7KRI_cjs.Ha(e.part(),q);if(X?.kind!=="paragraph")return false;let O=chunkMXOO7KRI_cjs.ph(X).find(V=>V.start<V.end&&(D==="backward"?V.end===z:V.start===z));return O?(w(q,O),true):false},wordDeletionBoundary(D,M,q,z){let X=chunkBNZF6DYC_cjs.be(D,M,q,z),O=e.selection().head.paragraphId;if(e.protected(O))return X;let V=chunkMXOO7KRI_cjs.Ha(e.part(O),O);if(V?.kind!=="paragraph")return X;let j=chunkMXOO7KRI_cjs.ph(V),ee=j.find(te=>te.start<te.end&&(q===-1?te.end===M:te.start===M));if(ee)return q===-1?ee.start:ee.end;let ne=X;for(let te of j)for(let le of [te.start,te.end])q===-1&&le<M&&le>ne&&(ne=le),q===1&&le>M&&le<ne&&(ne=le);return ne},beforeSelect(D){let M=Re=>{if(x!==void 0)I=x;else if(D.anchor.paragraphId!==D.head.paragraphId||I?.paragraphId!==D.head.paragraphId)I=null;else {let Fe=chunkMXOO7KRI_cjs.Ha(e.part(),D.head.paragraphId),Ge=Fe?.kind==="paragraph"?chunkMXOO7KRI_cjs.ph(Fe).find(Ee=>Ee.fieldNodeId===I?.fieldNodeId):null;(!Ge||Math.min(D.anchor.offset,D.head.offset)<Ge.start||Math.max(D.anchor.offset,D.head.offset)>Ge.end)&&(I=null);}return x=void 0,delete ce.dataset.fieldError,Re};if(a||C)return null;if(!e.editable())return D;let q=Y();if(!q||!e.protected(q.paragraphId)||!q.field.enabled||!chunkMXOO7KRI_cjs.nh(q.field))return M(D);let{field:z,paragraphId:X}=q;if((!x||x.fieldNodeId===z.fieldNodeId)&&D.anchor.paragraphId===X&&D.head.paragraphId===X&&Math.min(D.anchor.offset,D.head.offset)>=z.start&&Math.max(D.anchor.offset,D.head.offset)<=z.end)return M(D);let O=i.get(z.fieldNodeId),V=O?.text,j=O?.locale??e.locale?.()??"en-US",ee=b(X,z);if(z.type==="date"&&V===void 0)return p(z.fieldNodeId),M(D);let ne=chunkMXOO7KRI_cjs.mh(ee,z,"fill",j);if(ne===ee||ne===null&&(V===void 0||V===ee))return p(z.fieldNodeId),M(D);a=true;let te=e.part();u(te);let le=i;i=new Map(le),i.delete(z.fieldNodeId);let fe;try{fe=e.apply({op:"commitTextFormField",locale:j,paragraphId:X,fieldNodeId:z.fieldNodeId}),fe||(i=le);}catch(Re){throw e.part()===te&&(i=le),Re}finally{u(),a=false;}if(!fe){if(x=void 0,ce.setAttribute("role","alert"),ce.dataset.fieldError="true",ce.textContent=n("textFormField.invalidValue"),ne===null&&(z.type==="number"||z.type==="date")){H();let Re=new AbortController;k=Re,C=true;let Fe=()=>{if(E||Re.signal.aborted||k!==Re||(H(),E))return;let Ee=e.selection(),he=()=>{e.pagesLayer.focus({preventScroll:true}),e.select(Ee);},Ve=chunkMXOO7KRI_cjs.Ha(e.part(),X),Le=Ve?.kind==="paragraph"?chunkMXOO7KRI_cjs.ph(Ve).find(Nt=>Nt.fieldNodeId===z.fieldNodeId):null;if(!Le||!e.editable()||!e.protected(X)||b(X,Le)!==ee||!Le.enabled||!chunkMXOO7KRI_cjs.nh(Le)||Le.type!==z.type||Le.format!==z.format||chunkMXOO7KRI_cjs.mh(ee,Le,"fill",j)!==null){he();return}a=true;try{if(e.apply({op:"deleteText",paragraphId:X,start:Le.start,end:Le.end,textFormFieldId:Le.fieldNodeId})){p(Le.fieldNodeId),delete ce.dataset.fieldError,e.pagesLayer.focus({preventScroll:!0});let Nt={paragraphId:X,offset:Le.start};a=!1,e.select({anchor:Nt,head:Nt}),I={paragraphId:X,fieldNodeId:Le.fieldNodeId};}else a=!1,he();}finally{a=false;}},Ge={type:z.type,signal:Re.signal,acknowledge:Fe,cancel(){k===Re&&!Re.signal.aborted&&A();}};!e.onInvalidRequest?.(Ge)&&!Re.signal.aborted&&(y=z0(e.container,z.type,Fe,n));}return null}p(z.fieldNodeId);let we=chunkMXOO7KRI_cjs.Ha(e.part(),X),ot=we?.kind==="paragraph"?chunkMXOO7KRI_cjs.ph(we).find(Re=>Re.fieldNodeId===z.fieldNodeId):null,Oe=ot?ot.end-z.end:0,_e=Re=>Re.paragraphId===X&&Re.offset>=z.end?{...Re,offset:Re.offset+Oe}:Re;return M({anchor:_e(D.anchor),head:_e(D.head)})},update(){y&&N0(y,n);let D=Y(),M=e.selection(),q=!!D&&M.anchor.offset!==M.head.offset&&Math.min(M.anchor.offset,M.head.offset)===D.field.start&&Math.max(M.anchor.offset,M.head.offset)===D.field.end;for(let z of e.pagesLayer.querySelectorAll('[data-field-atom="form"][data-start]')){let X=z.closest("[data-paragraph-id]")?.dataset.paragraphId,O=Number(z.dataset.start);!!D&&X===D.paragraphId&&O>=D.field.start&&O<D.field.end?z.dataset.textFormSelection=q?"whole":"caret":delete z.dataset.textFormSelection;}if(ce.dataset.fieldError){ce.textContent=n("textFormField.invalidValue");return}D?ce.setAttribute("role","status"):ce.removeAttribute("role"),ce.textContent=D?n(q?"textFormField.selected":"textFormField.editing"):"";},fieldId:()=>Y()?.field.fieldNodeId??null,afterApply(D){D?u():f();},restoreAfterHistory:f,annotate(D){(!a||D.some(q=>q.op!=="commitTextFormField"))&&u(),D.some(q=>q.op==="insertText"||q.op==="deleteText")&&delete ce.dataset.fieldError;let M=Y();return I=M?{paragraphId:M.paragraphId,fieldNodeId:M.field.fieldNodeId}:null,D.map(q=>{if(!I||q.op!=="insertText"&&q.op!=="deleteText"||q.revision||q.paragraphId!==I.paragraphId||!e.protected(q.paragraphId))return q;let z=chunkMXOO7KRI_cjs.Ha(e.part(),q.paragraphId),X=z?.kind==="paragraph"?chunkMXOO7KRI_cjs.ph(z).find(j=>j.fieldNodeId===I.fieldNodeId):null,O=q.op==="insertText"?q.offset:q.start,V=q.op==="insertText"?q.offset:q.end;return !X||O<X.start||V>X.end?q:(i.has(X.fieldNodeId)||i.set(X.fieldNodeId,{text:b(q.paragraphId,X),locale:e.locale?.()??"en-US"}),{...q,textFormFieldId:X.fieldNodeId})})},keydown(D){if(D.key==="F10"&&D.shiftKey&&!D.altKey&&!D.ctrlKey&&!D.metaKey)return o=void 0,D.preventDefault(),e.pagesLayer.dispatchEvent(new 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 M=[],q=[e.part().root];for(;q.length;){let ne=q.pop();if(ne.kind==="paragraph")for(let te of chunkMXOO7KRI_cjs.ph(ne))e.protected(ne.id)&&te.enabled&&chunkMXOO7KRI_cjs.nh(te)&&!chunkMXOO7KRI_cjs.Ji(e.part(),{op:"insertText",paragraphId:ne.id,offset:te.start,text:"x"})&&M.push({paragraphId:ne.id,field:te});else for(let te=ne.children.length-1;te>=0;te--){let le=ne.children[te];le.kind!=="textValue"&&q.push(le);}}if(!M.length)return false;let z=e.selection(),X=z.head,O=I?M.findIndex(ne=>ne.paragraphId===I.paragraphId&&ne.field.fieldNodeId===I.fieldNodeId&&ne.field.start<=Math.min(z.anchor.offset,X.offset)&&ne.field.end>=Math.max(z.anchor.offset,X.offset)):-1,V=O>=0?O:M.findIndex(ne=>ne.paragraphId===X.paragraphId&&ne.field.start<=Math.min(z.anchor.offset,X.offset)&&ne.field.end>=Math.max(z.anchor.offset,X.offset)),j=V<0?D.shiftKey?M.length-1:0:(V+(D.shiftKey?-1:1)+M.length)%M.length,ee=M[j];return D.preventDefault(),w(ee.paragraphId,ee.field),true},destroy(){E=true,H(),Ns.get(e.container)===m&&Ns.delete(e.container),Ls.get(e.container)===h&&Ls.delete(e.container),r.removeEventListener("pointermove",F),r.removeEventListener("pointercancel",_),e.pagesLayer.removeEventListener("click",$),e.pagesLayer.removeEventListener("contextmenu",ue),ce.remove(),e.pagesLayer.removeEventListener("dblclick",Z),e.pagesLayer.removeEventListener("pointerdown",U,{capture:true}),y?.remove(),y=null;}}}var Ds=new WeakMap;function Su(e){let t=Ds.get(e);if(t)return t.settled??=new Promise(n=>{t.resolve=n;}),t.settled}function Y0(e){let t=Ds.get(e)??{depth:0};return t.depth++,Ds.set(e,t),()=>{--t.depth===0&&(Ds.delete(e),t.resolve?.());}}async function Q0(e,t,n){if(!e)throw $t("notFound","no document is loaded");let r=t?Su(t):void 0;if(r&&(await r,n()!==e))throw $t("invalidState","The document changed before the pending save could finish.");return e.save().slice().buffer}function J0(e,t,n){let r=()=>{if(n())throw $t("destroyed","Cannot save a destroyed surface.")};if(r(),Su(t))throw $t("invalidState","Cannot save during an active edit. Retry after the edit finishes.");e.flushPendingInput(),r();let o=G0(t);if(o)throw $t(o,"Cannot save pending text form input. Enter a valid value in each field.");return r(),e.refreshRefFieldResults(),r(),e.session.save()}function Hs(e,t,n){let r=false;return t(()=>{let o=n([e]);return r=!o.rejected,o}),r}function ev(e,t,n){let r=n.refusal();if(r)return r;let o=new Map;for(let i of e){if(i.op!=="commitTextFormField")return "invalidArgs";let s=vt(n.session,i.paragraphId,{kind:"body"}),l=JSON.stringify(s),d=o.get(l)??{scope:s,ops:[]};d.ops.push(i),o.set(l,d);}for(let i of o.values()){let s=n.gate(i.ops,i.scope);if(s)return s}if(n.collaborationActive)return "unsupported";let a;return n.commit(()=>a=n.session.applyTreeOpsAtomic([...o.values()]),()=>t),a?.rejected?a.reason??"invalidArgs":null}function tv(e,t){let n=chunkMXOO7KRI_cjs.ih(e);return {get:()=>n,set(r){let o=chunkMXOO7KRI_cjs.ih(r);n!==o&&(t(),n=o);}}}var dR=42,cR=/^(\d{4})-(\d{2})-(\d{2})/,uR=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"]),fR=new Set(["AE","AF","BH","DJ","DZ","EG","IQ","IR","JO","KW","LY","OM","QA","SD","SY"]);function zr(e){return `${String(e.getFullYear()).padStart(4,"0")}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Un(e){let t=cR.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 a=new Date(n,r-1,o);return a.getFullYear()!==n||a.getMonth()!==r-1||a.getDate()!==o?null:a}function _s(e){let t=chunkMXOO7KRI_cjs.ih(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 a=n.maximize().region;if(a&&uR.has(a))return 0;if(a&&fR.has(a))return 6}catch{}return 1}function nv(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function rv(e,t,n){return new Intl.DateTimeFormat(chunkMXOO7KRI_cjs.ih(n),{calendar:"gregory",month:"long",year:"numeric"}).format(new Date(e,t,1))}function ov(e){let t=chunkMXOO7KRI_cjs.ih(e),n=new Intl.DateTimeFormat(t,{calendar:"gregory",weekday:"narrow"}),r=_s(t);return Array.from({length:7},(o,a)=>n.format(new Date(2024,0,7+(r+a)%7)))}function wu(e,t,n={}){let r=chunkMXOO7KRI_cjs.ih(n.locale),o=n.selected?Un(n.selected):null,a=n.today??new Date,i=new Intl.DateTimeFormat(r,{calendar:"gregory",weekday:"long",year:"numeric",month:"long",day:"numeric"}),s=_s(r),l=(new Date(e,t,1).getDay()-s+7)%7,d=[];for(let u=0;u<dR;u+=1){let f=new Date(e,t,u-l+1);d.push({iso:zr(f),day:f.getDate(),label:i.format(f),otherMonth:f.getMonth()!==t,selected:o!==null&&nv(f,o),today:nv(f,a)});}return {year:e,month:t,title:rv(e,t,r),weekdays:ov(r),days:d}}function Bs(e,t,n){let r=new Date(e,t+n,1);return {year:r.getFullYear(),month:r.getMonth()}}function Iu(e,t,n,r=false){let o=Un(e);if(!o)return null;let a={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7},i=(o.getDay()-_s(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"?-i:t==="End"?6-i:a[t];if(s===void 0)return null;o.setDate(o.getDate()+s);}return o.getFullYear()>=100&&o.getFullYear()<=9999?zr(o):null}function $s(e,t){let n=Un(e);if(!n)return "";let r=chunkMXOO7KRI_cjs.ih(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(a=>a.type==="year"?a.value.padStart(4,o):a.value).join("")}function ku(e,t){if(e.length>100)return null;let n=e.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(n)){let s=Un(n);return s?zr(s):null}let r=chunkMXOO7KRI_cjs.jh(chunkMXOO7KRI_cjs.ih(t)),o=r.pattern.exec(chunkMXOO7KRI_cjs.kh(n,r));if(!o)return null;let a={year:"",month:"",day:""};if(r.order.forEach((s,l)=>{a[s]=o[l+1];}),a.year.length!==4)return null;let i=`${a.year}-${a.month.padStart(2,"0")}-${a.day.padStart(2,"0")}`;return Un(i)?i:null}function Tu(e){let t=new Intl.DateTimeFormat(chunkMXOO7KRI_cjs.ih(e),{calendar:"gregory",month:"long"});return Array.from({length:12},(n,r)=>t.format(new Date(2e3,r,1)))}function Cu(e){let t="",n=0,r=new Intl.Collator(chunkMXOO7KRI_cjs.ih(e),{usage:"search",sensitivity:"base"});return {reset(){t="",n=0;},keyDown(o,a){if(o.defaultPrevented||o.isComposing||o.altKey||o.ctrlKey||o.metaKey)return;let i=o.target.tagName==="INPUT",s=[...a.querySelectorAll('[role="option"]')].filter(u=>!u.hasAttribute("disabled"));if(!s.length)return;let l=s.indexOf(a.ownerDocument.activeElement),d;if(o.key==="ArrowDown")d=Math.min(s.length-1,l+1);else if(o.key==="ArrowUp")d=l<0?s.length-1:Math.max(0,l-1);else if(!i&&o.key==="Home")d=0;else if(!i&&o.key==="End")d=s.length-1;else if(!i&&o.key.length===1&&o.key!==" "){let u=Date.now();t=u-n>700?o.key:(t+o.key).slice(-100),n=u;let f=[...t].every(p=>r.compare(p,o.key)===0)?o.key:t;for(let p=1;p<=s.length;p++){let m=(Math.max(-1,l)+p)%s.length;if(r.compare((s[m].textContent??"").slice(0,f.length),f)===0){d=m;break}}}d!==void 0&&(o.preventDefault(),s.forEach((u,f)=>{u.tabIndex=f===d?0:-1;}),s[d]?.focus({preventScroll:true}),s[d]?.scrollIntoView?.({block:"nearest"}));}}}var pR=0;function av(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=>Ya(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 iv(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 i=Xa(e,n.element),s=new MutationObserver(()=>{e.isConnected||(i(),s.disconnect());});s.observe(r,{childList:true});return}let o=e.offsetWidth;if(o<=0)return;let a=n.left+o-n.sheetRight;a>0&&(e.style.left=`${Math.max(n.sheetLeft,n.left-a)}px`);}function qs(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=Xt(e.translate)("disabledReason.invalidValue"),false}function sv(e,t,n,r,o,a){let i=av(e,t),s=Xt(e.translate);i.setAttribute("role","dialog"),i.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-${++pR}`,l.setAttribute("role","listbox"),l.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let d=Cu(e.locale());i.addEventListener("keydown",f=>d.keyDown(f,i));let u=r.findIndex(f=>f.value===a);for(let[f,p]of r.entries()){let m=e.document.createElement("button");m.type="button",m.className="docx-content-control-menu-item",m.dataset.docxPart="item",m.dataset.value=p.value,m.setAttribute("role","option"),m.setAttribute("aria-selected",String(p.value===a)),m.tabIndex=f===Math.max(0,u)?0:-1,m.textContent=p.displayText,m.addEventListener("click",()=>{qs(e,i,t,p.value);}),l.append(m);}if(n==="buildingBlockGallery"&&r.length===0){let f=e.document.createElement("div");f.className="docx-content-control-menu-empty",f.dataset.docxPart="empty",f.setAttribute("role","note"),f.tabIndex=0,f.textContent=s("contentControl.gallery.empty"),l.append(f);}if(n==="comboBox"){let f=e.document.createElement("input");f.type="text",f.className="docx-content-control-menu-input",f.dataset.docxPart="input",f.value=a??"",f.setAttribute("aria-label",o||s("contentControl.types.comboBox")),f.setAttribute("aria-autocomplete","list"),f.setAttribute("role","combobox"),f.setAttribute("aria-expanded","true"),f.setAttribute("aria-controls",l.id),f.addEventListener("keydown",m=>{m.key!=="Enter"||m.isComposing||(m.preventDefault(),qs(e,i,t,f.value));}),i.append(f);let p=e.document.createElement("div");p.className="docx-dialog__footer",p.dataset.docxPart="footer";for(let m of ["cancel","apply"]){let h=e.document.createElement("button");h.type="button",h.className=`docx-dialog__button${m==="apply"?" docx-dialog__button--primary":""}`,h.dataset.docxPart=m,h.textContent=s(`common.${m}`),h.addEventListener("click",()=>{m==="apply"?qs(e,i,t,f.value):e.close(i);}),p.append(h);}i.append(l,p);}else i.append(l);return i}function Zs(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 lv(e,t,n,r){let o=Xt(e.translate),a=av(e,t);a.classList.add("docx-content-control-calendar"),a.setAttribute("role","dialog"),a.setAttribute("aria-label",r||o("contentControl.types.date"));let i=n?Un(n):null,s=i?zr(i):null,l=new Date,d={year:(i??l).getFullYear(),month:(i??l).getMonth()},u=null,f=$s(s??"",e.locale()),p=y=>{qs(e,a,t,y);},m=y=>{y.addEventListener("mousedown",I=>I.stopPropagation());},h=e.document.createElement("div");h.className="docx-content-control-calendar-title docx-content-control-calendar-announcement",h.dataset.docxPart="title",h.setAttribute("aria-live","polite");let x=()=>{let y=e.document.activeElement?.dataset.docxCalendarNav,I=wu(d.year,d.month,{locale:e.locale(),selected:s,today:l}),k=e.document.createElement("div");k.className="docx-content-control-calendar-header",k.dataset.docxPart="header";let E=e.document.createElement("button");E.type="button",E.className="docx-content-control-calendar-nav",E.dataset.docxPart="previousMonth",E.dataset.docxCalendarNav="previous",E.textContent="\u2039",E.setAttribute("aria-label",o("contentControl.calendar.previousMonth")),h.textContent=I.title;let C=e.document.createElement("button");C.type="button",C.className="docx-content-control-calendar-nav",C.dataset.docxPart="nextMonth",C.dataset.docxCalendarNav="next",C.textContent="\u203A",C.setAttribute("aria-label",o("contentControl.calendar.nextMonth")),m(E),m(C),E.addEventListener("click",()=>{d=Bs(d.year,d.month,-1),u=null,x();}),C.addEventListener("click",()=>{d=Bs(d.year,d.month,1),u=null,x();});let H=e.document.createElement("div");H.className="docx-content-control-calendar-navigation",H.dataset.docxPart="navigation";let A=e.document.createElement("select");A.className="docx-content-control-calendar-month",A.dataset.docxPart="month",A.dataset.docxCalendarNav="month",A.setAttribute("aria-label",o("contentControl.calendar.month"));for(let[Z,Y]of Tu(e.locale()).entries()){let oe=e.document.createElement("option");oe.value=String(Z),oe.textContent=Y,A.append(oe);}A.value=String(d.month);let w=e.document.createElement("input");w.type="number",w.min="100",w.max="9999",w.value=String(d.year),w.className="docx-content-control-calendar-year",w.dataset.docxPart="year",w.dataset.docxCalendarNav="year",w.addEventListener("keydown",Z=>{Z.key==="Enter"&&!Z.isComposing&&(Z.preventDefault(),w.blur());}),w.setAttribute("aria-label",o("contentControl.calendar.year")),A.addEventListener("change",()=>{d.month=Number(A.value),u=null,x();}),w.addEventListener("change",()=>{let Z=Number(w.value);if(!Number.isInteger(Z)||Z<100||Z>9999){w.value=String(d.year);return}d.year=Z,u=null,x();}),H.append(A,w);let P=e.document.createElement("div");P.className="docx-content-control-calendar-weekdays",P.dataset.docxPart="weekdays";for(let Z of I.weekdays){let Y=e.document.createElement("span");Y.textContent=Z,P.append(Y);}let R=e.document.createElement("div");R.className="docx-content-control-calendar-grid",R.dataset.docxPart="grid",R.setAttribute("role","grid"),R.setAttribute("aria-label",I.title);for(let Z=0;Z<I.days.length;Z+=7){let Y=e.document.createElement("div");Y.className="docx-content-control-calendar-week",Y.setAttribute("role","row");for(let oe of I.days.slice(Z,Z+7))Y.append(b(oe));R.append(Y);}let N=e.document.createElement("div");N.className="docx-content-control-calendar-entry",N.dataset.docxPart="dateEntry";let B=e.document.createElement("button");B.type="button",B.className="docx-content-control-calendar-today",B.dataset.docxPart="today",B.textContent=o("contentControl.calendar.today"),m(B),B.addEventListener("click",()=>p(zr(l)));let U=e.document.createElement("input");U.type="text",U.className="docx-content-control-menu-input",U.dataset.docxPart="input",U.setAttribute("aria-label",o("contentControl.types.date")),U.placeholder=$s("2006-11-22",e.locale()),U.value=f,U.addEventListener("input",()=>{f=U.value,U.removeAttribute("aria-invalid"),F.hidden=true;});let F=e.document.createElement("div");F.className="docx-content-control-widget-error",F.dataset.docxPart="error",F.setAttribute("role","alert"),F.hidden=true,F.textContent=o("disabledReason.invalidValue");let _=()=>{let Z=ku(f,e.locale());Z?p(Z):(F.hidden=false,U.setAttribute("aria-invalid","true"),U.focus());};U.addEventListener("keydown",Z=>{Z.key==="Enter"&&!Z.isComposing&&(Z.preventDefault(),_());});let $=e.document.createElement("div");$.className="docx-dialog__footer",$.dataset.docxPart="footer";for(let Z of ["cancel","apply"]){let Y=e.document.createElement("button");Y.type="button",Y.dataset.docxPart=Z,Y.className=`docx-dialog__button${Z==="apply"?" docx-dialog__button--primary":""}`,Y.textContent=o(`common.${Z}`),Y.addEventListener("click",Z==="apply"?_:()=>e.close(a)),$.append(Y);}k.append(E,H,C,h),N.append(B,U),a.replaceChildren(k,P,R,N,F,$),Zs(a,u),y==="previous"&&E.focus({preventScroll:true}),y==="next"&&C.focus({preventScroll:true}),y==="month"&&A.focus({preventScroll:true}),y==="year"&&w.focus({preventScroll:true});},b=y=>{let I=e.document.createElement("button");return I.type="button",I.className="docx-content-control-calendar-day",I.dataset.docxPart="day",I.textContent=String(y.day),I.dataset.iso=y.iso,I.setAttribute("role","gridcell"),I.setAttribute("aria-label",y.label),y.otherMonth&&(I.dataset.otherMonth=""),y.selected&&(I.dataset.selected="",I.setAttribute("aria-selected","true")),I.setAttribute("aria-selected",String(y.selected)),y.today&&(I.dataset.today="",I.setAttribute("aria-current","date")),m(I),I.addEventListener("click",()=>p(y.iso)),I.addEventListener("keydown",k=>{if(k.isComposing||k.altKey||k.ctrlKey||k.metaKey)return;let E=Iu(y.iso,k.key,e.locale(),k.shiftKey);if(!E)return;k.preventDefault();let C=Un(E);if(u=E,C.getFullYear()!==d.year||C.getMonth()!==d.month){d={year:C.getFullYear(),month:C.getMonth()},x();return}Zs(a,u);}),I};return x(),a}function Pu(e,t){let r=(t instanceof Element?t:null)?.closest("[data-docx-form-checkbox][data-start]"),o=r?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!r||!o)return null;let a=chunkMXOO7KRI_cjs.Ha(e.part(o),o);if(a?.kind!=="paragraph")return null;let i=Number(r.dataset.start),s=chunkMXOO7KRI_cjs.rh(a).find(l=>l.start<=i&&i<l.end);return s?{paragraphId:o,field:s}:null}function dv(e){return e.shiftKey||e.altKey||e.ctrlKey||e.metaKey}function cv(e){let t=(a,i)=>{if(!e.editable()||!i.enabled)return false;let s=e.apply({op:"setLegacyCheckbox",paragraphId:a,fieldNodeId:i.fieldNodeId,checked:!i.checked});return s&&(e.pagesLayer.focus({preventScroll:true}),e.select({anchor:{paragraphId:a,offset:i.start},head:{paragraphId:a,offset:i.end}})),s},n=a=>{if(a.button!==0||dv(a))return;let i=Pu(e,a.target);!i||!e.editable()||!i.field.enabled||(a.preventDefault(),a.stopPropagation(),t(i.paragraphId,i.field));};e.pagesLayer.addEventListener("pointerdown",n,{capture:true});let r=a=>{let i=Pu(e,a.target);i&&a.target instanceof HTMLElement&&a.target.setAttribute("aria-disabled",String(!e.editable()||!i.field.enabled));};e.pagesLayer.addEventListener("focusin",r);let o=()=>{let a=e.selection();if(a.anchor.paragraphId!==a.head.paragraphId)return null;let i=a.head.paragraphId,s=chunkMXOO7KRI_cjs.Ha(e.part(i),i);if(s?.kind!=="paragraph")return null;let l=Math.min(a.anchor.offset,a.head.offset),d=Math.max(a.anchor.offset,a.head.offset),u=chunkMXOO7KRI_cjs.rh(s).find(f=>f.start===l&&f.end===d||l===d&&l===f.start&&e.protected(i));return u?{paragraphId:i,field:u}:null};return {keydown(a){let i=Pu(e,a.target);if(i&&a.key==="Tab")return true;if(i&&a.key.length===1&&a.key!==" "&&!a.ctrlKey&&!a.metaKey&&!a.altKey)return a.preventDefault(),true;if(a.key!==" "||dv(a)||a.isComposing)return false;let s=i??o();if(!s)return false;if(!e.editable()||!s.field.enabled)return i?(a.preventDefault(),true):false;a.preventDefault();let l=t(s.paragraphId,s.field);return i&&l&&[...e.pagesLayer.querySelectorAll("[data-docx-form-checkbox][data-start]")].find(d=>d.dataset.paragraphId===s.paragraphId&&Number(d.dataset.start)===s.field.start)?.focus({preventScroll:true}),true},destroy(){e.pagesLayer.removeEventListener("pointerdown",n,{capture:true}),e.pagesLayer.removeEventListener("focusin",r);}}}var mR=new Set(["insertText","deleteText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertNote","insertTableRow","deleteTableRow","setRunProperties","setParagraphProperties","setParagraphMarkProperties"]);function Ru(e){return mR.has(e.op)}function Eu(e){if(Ru(e))return e.revision!==void 0;switch(e.op){case "setParagraphMarkRevision":case "proposeParagraphMerge":return true;case "splitParagraphMany":return e.revision!==void 0;default:return false}}function Ou(e){return e?.trim()||void 0}function uv(e){let t=e.trim().split(/\s+/).filter(Boolean);return t.length===0?"?":t.slice(0,2).map(n=>n[0].toUpperCase()).join("")}function fv(e){return e==="suggesting needs an author before it can propose a change"||e==="tracked changes need a non-empty author"}function Ks(e,t,n){if(!e)return null;let r=chunkBNZF6DYC_cjs.ed(e,t);return !r||r.record.paragraphId!==n?null:{paragraphId:n,offset:r.record.start}}var pv="docx-field-atom--active",gR="docx-field-atom",mv=new WeakMap;function Fu(e,t,n){let r=mv.get(e);r||(r={caretKey:null,marked:[]},mv.set(e,r));let o=t?`${t.paragraphId}\0${t.offset}`:null;if(!n?.domReplaced&&o===r.caretKey)return;for(let i of r.marked)i.classList.remove(pv);if(r.marked=[],r.caretKey=o,!t)return;let a=e.querySelectorAll(`.${gR}`);for(let i of a){if(i.dataset.paragraphId!==t.paragraphId)continue;let s=Number(i.dataset.start),l=Number(i.dataset.end);!Number.isFinite(s)||!Number.isFinite(l)||t.offset<s||t.offset>l||(i.classList.add(pv),r.marked.push(i));}}var hR={kind:"body"};function gv(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??=chunkWQFNWLNY_cjs.fa(e.canonicalUnfilteredLayout()),n(l)):chunkWQFNWLNY_cjs.fa(e.layout),o={package:t.currentPackage(),styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,displayMode:e.displayMode,pageRefPageNumberOf:r},a=chunkWQFNWLNY_cjs.ga(t.part(),o),i=chunkWQFNWLNY_cjs.ha(t.part(),o);if(!a&&i.length===0)return true;let s=[];a&&s.push({scope:hR,ops:[a]});for(let l of i)s.push({scope:{kind:"notesPart",noteKind:l.noteKind},ops:[l.op]});return t.applyTreeOpsAtomic(s).committed}function yv(e){let t=0,n=null,r="",o=null,a=true,i=null,s="";return ()=>{let l=e.surface(),d=`${l?.session.packageRevision()??-1}:${l?.session.revision()??-1}`,u=e.activeKey(),f=e.paneOpen(),p=e.selectionAnchor(),m=e.authorFilterKey();return (l!==n||d!==r||u!==o||f!==a||p!==i||m!==s)&&(n=l,r=d,o=u,a=f,i=p,s=m,t+=1),t}}function Vs(e=[]){let t=new Set(e),n=Object.freeze([...t]),r=chunkBNZF6DYC_cjs.$(t),o=null,a="accept",i=null,s="accept",l=new WeakMap,d=null,u=false,f=0,p=null,m=[],h=null,x=[],b=r,y=t,I=new Set,k="accept",E=new WeakSet,C=new WeakMap,H=new Map,A=()=>{f+=1,p=null,m=[],h=null;},w=N=>JSON.stringify([N.id,chunkITNK6C5M_cjs.Ea(N)]),P=(N,B,U)=>{let F=yR(U),_=t,$=r?.hiddenAuthors??chunkBNZF6DYC_cjs._,Z=a,Y;_===y&&bR(F,I)&&(F.size===0||Z===k)?Y=b:F.size===0&&_.size===0?Y=void 0:Y=Object.freeze({hiddenAuthors:$,includes:ue=>!_.has(ue.author)&&!F.has(ue.nodeId),includesNode:(ue,Te)=>!_.has(Te)&&!F.has(ue),excludedNodeMode:(ue,Te)=>_.has(Te)?"proposed":F.has(ue)&&Z==="reject"?"original":"proposed",cacheKey:vR(_,F,Z)});let oe=[];for(let ue of N){let Te=hv(ue);Te!==null&&_.has(Te)||ue.kind==="revision"&&B.has(ue)||oe.push(ue);}x=oe.length===N.length?N:chunkITNK6C5M_cjs.Sa(oe),h=N,E=B,b=Y,y=_,I=F,k=Z,u=false,i=null,s="accept",l=new WeakMap,d=null;},R=N=>{if(N===h)return;let B=new WeakSet,U=[],F=[];try{for(let $ of N){if($.kind!=="revision")continue;let Z=!t.has($.author),Y=C.get($);Y===void 0&&(Y=o?.($)??!0,F.push([$,Y])),!(Z&&Y)&&(B.add($),Y||U.push($));}}catch($){if(u)o=i,a=s,C=l,h=d,i=null,s="accept",l=new WeakMap,d=null,f+=1;else {let Z=new WeakSet,Y=[];for(let oe of N){if(oe.kind!=="revision")continue;let ue=H.get(w(oe))??true;(t.has(oe.author)||!ue)&&Z.add(oe),ue||Y.push(oe);}P(N,Z,Y);}throw u=false,$}for(let[$,Z]of F)C.set($,Z);let _=new Map;for(let $ of N)$.kind==="revision"&&_.set(w($),C.get($)??true);H=_,P(N,B,U);};return {get hiddenAuthors(){return r?.hiddenAuthors??chunkBNZF6DYC_cjs._},get hiddenAuthorList(){return n},get stateKey(){return String(f)},get hasFilter(){return t.size>0||o!==null},filterFor(N){return o?(R(N),b):r},filterForSession(N){return o?(R(N.reviewItems()),b):r},filterItems(N){if(!o){if(t.size===0)return N;if(N===p)return m;let B=N.filter(U=>{let F=hv(U);return F===null||!t.has(F)});return p=N,m=B.length===N.length?N:chunkITNK6C5M_cjs.Sa(B),m}return R(N),x},includesRevisionItem(N){return !E.has(N)},setPredicate(N,B="accept"){return o===null&&N===null?false:N===null?(o=null,a="accept",i=null,s="accept",u=false,C=new WeakMap,l=new WeakMap,H=new Map,d=null,x=[],E=new WeakSet,b=r,y=t,I=new Set,k="accept",A(),true):(i=o,s=a,l=C,d=h,u=true,o=N,a=B,C=new WeakMap,A(),true)},isVisible:N=>!t.has(N),setVisible(N,B){if(B===!t.has(N))return false;let U=new Set(t);return B?U.delete(N):U.add(N),t=U,n=Object.freeze([...U]),r=chunkBNZF6DYC_cjs.$(U),A(),true},setAllVisible(N,B){let U=B?new Set:new Set(N);return U.size===t.size&&[...U].every(F=>t.has(F))?false:(t=U,n=Object.freeze([...U]),r=chunkBNZF6DYC_cjs.$(U),A(),true)},showAll(){return t.size===0?false:(t=new Set,n=Object.freeze([]),r=void 0,A(),true)}}}function Mu(e,t){return t.filterItems(e)}function yR(e){let t=new Set;for(let n of e)for(let r of chunkITNK6C5M_cjs.Ea(n))t.add(r);return t}function bR(e,t){if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function vR(e,t,n){return JSON.stringify({hiddenAuthors:[...e].sort(),excludedNodeIds:[...t].sort(),mode:t.size===0?"accept":n})}function hv(e){return e.kind==="comment"?e.comment?.author??"":e.author??null}function bv(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 a=t.surface();if(a)return a.setRevisionAuthorVisible(r,o);e.setVisible(r,o)&&t.notify();},setAllReviewAuthorsVisible:n,showAllReviewAuthors:()=>n(true)}}function Au(e){return e.kind==="comment"?e.comment.author:e.kind==="revision"?e.author:null}function vv(e){let t=null;return {get(){let n=e.layout(),r=e.items(),o=e.styles(),a=t;if(a?.layout===n&&a.items===r&&a.styles===o)return a;let i=e.slots.resolve(chunkS35UK656_cjs.d(n),(function*(){for(let p of r){let m=Au(p);m!==null&&(yield m);}})()),s=a?.value,l=s!==void 0&&s.size===i.size&&[...i].every(([f,p])=>s.get(f)===p),d=l?s:i,u=a!==null&&l&&a.styles===o?a.resolved:new Map(chunkS35UK656_cjs.c(d,o).map(f=>[f.author,f]));return t={layout:n,items:r,styles:o,value:d,resolved:u},t},releaseLayout(){t!==null&&(t={...t,layout:null,items:null});}}}function xv(e){let t=null;return {forAuthor(n){let r=e.roster(),o=r.resolved.get(n);if(o)return chunkBTQKU64Q_cjs.a(o.color)??chunkS35UK656_cjs.a(o.slot);let a=e.slots.resolve(r.value,[n]).get(n);return a===void 0?void 0:chunkS35UK656_cjs.a(a)},declaredFor(n){let r=e.styles();return (t===null||t.styles!==r)&&(t={styles:r,resolved:chunkS35UK656_cjs.b(r)}),chunkBTQKU64Q_cjs.a(t.resolved.get(n)?.color)}}}function ko(e){try{return e.createElement("canvas").getContext("2d")}catch{return null}}function wv(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 Iv(e,t){let n=chunkMXOO7KRI_cjs.Ha(e,t);if(!n||n.kind==="textValue")return null;let r=chunkMXOO7KRI_cjs.Fb(n);return !r||!chunkMXOO7KRI_cjs.Eb(r)?null:{paragraphId:r.toUpperCase(),nodeId:t,text:""}}var Lu=new WeakMap;function xR(e,t,n){return e.map(r=>chunkBTQKU64Q_cjs.a(n?.(r.name))??chunkBTQKU64Q_cjs.a(r.color)??chunkBTQKU64Q_cjs.a(t?.(r.name)))}function SR(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}
|
|
16
|
-
`;return n}function wR(e){if(!e)return "*";let t=[];for(let n of e)t.push(n);return t.sort((n,r)=>n-r),t.join(",")}function IR(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 kR(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 Sv(e){return e.anchor.nodeId===e.head.nodeId&&e.anchor.offset===e.head.offset}function TR(e,t){let n=chunkWQFNWLNY_cjs.Aa(e,t.anchor.nodeId),r=chunkWQFNWLNY_cjs.Aa(e,t.head.nodeId);if(!n||!r)return [];let o=chunkWQFNWLNY_cjs.sa(e,n,r);return o?chunkWQFNWLNY_cjs.wa(e,o.cellIds).map(a=>({...a,className:"docx-remote-selection-rect"})):[]}function kv(e,t,n,r){let{scale:o,pageOffsetX:a,pages:i,colorForAuthor:s,declaredColorFor:l}=r,d=r.labelHost??null,u=xR(n,s,l),f={layout:t,fingerprint:SR(n,u),pagesKey:wR(i),scale:o,offsetKey:IR(a),labelHost:d},p=Lu.get(e);if(p&&kR(p,e,f))return;Lu.delete(e);let m=[],h=[],x=[],b=[];for(let[E,C]of n.entries())C.kind==="cells"||Sv(C)||b.push({key:String(E),from:{paragraphId:C.anchor.nodeId,offset:C.anchor.offset},to:{paragraphId:C.head.nodeId,offset:C.head.offset}});let y=b.length>0?chunkBNZF6DYC_cjs.ke(t,b,chunkBNZF6DYC_cjs.W(t),i,r.measurer):null;for(let[E,C]of n.entries()){let H=u[E],A=chunkBNZF6DYC_cjs.ne(t,{paragraphId:C.head.nodeId,offset:C.head.offset},r.measurer);if(A){let P=chunkBNZF6DYC_cjs.je(t,C.head.nodeId,A.pageIndex);x.push({selection:C,...H?{color:H}:{},pageIndex:A.pageIndex,x:A.x+P.x,y:A.y+P.y});}if(C.kind==="cells"){let P=TR(t,C);if(P.length>0){for(let R of P)m.push(R),h.push(H);continue}}if(Sv(C)){let P=chunkBNZF6DYC_cjs.ne(t,{paragraphId:C.anchor.nodeId,offset:C.anchor.offset},r.measurer);if(!P)continue;let R=chunkBNZF6DYC_cjs.je(t,C.anchor.nodeId,P.pageIndex);m.push({pageIndex:P.pageIndex,x:P.x+R.x,y:P.y+R.y,width:Math.max(1/o,1),height:P.height,className:"docx-remote-caret"}),h.push(H);continue}let w=y?.get(String(E));if(w)for(let P of w)m.push({...P,className:"docx-remote-selection-rect"}),h.push(H);}chunkS35UK656_cjs.o(e,t,m,{scale:o,pageOffsetX:a}),[...e.children].forEach((E,C)=>{let H=chunkBTQKU64Q_cjs.a(h[C]);!H||!(E instanceof HTMLElement)||E.style.setProperty("--doc-remote-color",H);});let I=e.ownerDocument,k=[];for(let E of x){let C=t.pages[E.pageIndex];if(!C)continue;let H=I.createElement("div");H.className="docx-remote-caret-label",d?(H.setAttribute("data-docx-remote-actor",E.selection.actorId),k.push({element:H,selection:E.selection})):H.textContent=E.selection.name,H.style.left=`${(C.contentBox.x+E.x+(a?.get(E.pageIndex)??0))*o}px`,H.style.top=`${(C.contentBox.y+E.y)*o}px`;let A=chunkBTQKU64Q_cjs.a(E.color);A&&H.style.setProperty("--doc-remote-color",A),e.append(H);}Lu.set(e,{...f,childCount:e.childElementCount}),d&&d.publish(k);}var CR=/[\p{L}\p{N}_'’]/u,Tv=e=>e!==void 0&&CR.test(e);function zs(e,t,n){let r=chunkBNZF6DYC_cjs.re(e,t.paragraphId),o=t.paragraphId,a=Math.max(0,Math.min(t.offset,r.length)),i=-1;if(Tv(r[a])?i=a:a>0&&Tv(r[a-1])&&(i=a-1),i===-1){let s=a,l=a;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:chunkBNZF6DYC_cjs.be(r,i+1,-1,n)},to:{paragraphId:o,offset:chunkBNZF6DYC_cjs.be(r,i,1,n)}}}function $e(e){return {anchor:e,head:e}}function jr(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 js(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 a=n??chunkBNZF6DYC_cjs.V(e);return a.indexOf(r.paragraphId)<=a.indexOf(o.paragraphId)?{from:r,to:o}:{from:o,to:r}}function Ja(e,t,n){let r=t[0],o=a=>{let i=t.includes(a.paragraphId),s=i?a.paragraphId:r??a.paragraphId,l=i?a.offset:0,d=chunkBNZF6DYC_cjs.re(e,s).length;return {paragraphId:s,offset:Math.max(0,Math.min(l,d))}};return {anchor:o(n.anchor),head:o(n.head)}}function Ws(e,t,n,r){if(t.paragraphId===n.paragraphId)return chunkBNZF6DYC_cjs.re(e,t.paragraphId).slice(t.offset,n.offset);let o=r??chunkBNZF6DYC_cjs.V(e),a=o.indexOf(t.paragraphId),i=o.indexOf(n.paragraphId);if(a===-1||i===-1)return "";let s=o.slice(a,i+1),l=chunkBNZF6DYC_cjs.re(e,t.paragraphId).slice(t.offset);for(let d=1;d<s.length;d+=1){let u=s[d],f=chunkBNZF6DYC_cjs.re(e,u),p=chunkBNZF6DYC_cjs.S(e,u).includes(s[d-1])?"":`
|
|
17
|
-
`;l+=p+(d===s.length-1?f.slice(0,n.offset):f);}return l}function Nu(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 Pv(e){return e.kind}function Rv(e){return e.kind!=="textValue"&&Pv(e)==="contentControl"}function Cv(e){return e.kind!=="textValue"&&Pv(e)==="contentControlContent"}function PR(e,t){let n=new Map,r=o=>{if(o.kind!=="textValue"){if(o.kind==="table"){let a=Nu(o);if(a.length>0&&a.every(i=>t.has(i))){n.set(o.id,a);return}}for(let a of o.children)r(a);}};return r(e.root),n}function RR(e,t,n){let r=new Set,o=(a,i)=>{if(a.kind!=="textValue"){if(a.kind==="table"&&n.has(a.id)){for(let s of a.children)o(s,true);return}if(Rv(a)){let s=Nu(a);!i&&s.length>0&&s.every(l=>t.has(l))&&r.add(a.id);for(let l of a.children)o(l,i);return}for(let s of a.children)o(s,i);}};return o(e.root,false),r}function Ev(e,t,n,r,o,a){let i=new Set;for(let s=n;s<=r;s+=1){let l=t[s];(s===n?o.offset===0&&(s!==r||a.offset===e(l).length):s!==r||a.offset===e(l).length)&&i.add(l);}return i}function ER(e,t,n){let r=[],o=a=>{if(a.kind!=="textValue"){if(a.kind==="table"||Rv(a)){let s=Nu(a).filter(l=>n.has(l));if(s.length>0&&s.every(l=>t.has(l))){r.push(a.id);return}}for(let i of a.children)o(i);}};return o(e.root),r}function Ov(e,t,n,r,o){let a=p=>chunkBNZF6DYC_cjs.re(e,p);if(n.paragraphId===r.paragraphId&&n.offset===r.offset)return null;let i=o??chunkBNZF6DYC_cjs.V(e),s=i.indexOf(n.paragraphId),l=i.indexOf(r.paragraphId);if(s===-1||l===-1||s>l)return null;let d=i.slice(s,l+1),u=Ev(a,i,s,l,n,r),f=i[l];return {partName:t.name,paragraphIds:d,startOffset:n.offset,endOffset:r.offset,coveredParagraphIds:[...u],fullyCoveredBlockIds:ER(t,u,new Set(i)),lastMarkCovered:r.offset===a(f).length}}function Fv(e,t,n,r,o){let a=H=>chunkBNZF6DYC_cjs.re(e,H);if(n.paragraphId===r.paragraphId)return n.offset===r.offset?{ops:[],collapseTo:n}:{ops:[{op:"deleteText",paragraphId:n.paragraphId,start:n.offset,end:r.offset}],collapseTo:n};let i=o??chunkBNZF6DYC_cjs.V(e),s=i.indexOf(n.paragraphId),l=i.indexOf(r.paragraphId);if(s===-1||l===-1)return {ops:[],collapseTo:n};let d=Ev(a,i,s,l,n,r),u=PR(t,d),f=new Map;for(let[H,A]of u)for(let w of A)f.set(w,H);let p=RR(t,d,u),m=s;if(f.has(n.paragraphId)){m=-1;for(let H=s+1;H<=l;H+=1)if(!f.has(i[H])){m=H;break}if(m===-1){let H=f.get(n.paragraphId);for(let A of u.get(H)??[])f.delete(A);u.delete(H),m=s;}}let h=i[m],x=m===s?n:{paragraphId:h,offset:0},b=[];for(let H=s;H<=l;H+=1){let A=i[H];if(f.has(A))continue;let w=a(A).length,P=H===s?n.offset:0,R=H===l?r.offset:w;P<R&&b.push({op:"deleteText",paragraphId:A,start:P,end:R});}for(let H of u.keys())b.push({op:"deleteBlock",blockId:H});for(let H of p)b.push({op:"removeContentControl",controlId:H});let y=H=>{let A=chunkMXOO7KRI_cjs.Ia(t,H);for(;A&&Cv(A);){let w=chunkMXOO7KRI_cjs.Ia(t,A.id);if(!w||!p.has(w.id))break;A=chunkMXOO7KRI_cjs.Ia(t,w.id);}return A},I=H=>{let A=[],w=P=>{for(let R of P)if(R.kind!=="textValue"&&!u.has(R.id)){if(p.has(R.id)){let N=R.children.find(Cv);N&&N.kind!=="textValue"&&w(N.children);continue}if(R.kind==="paragraph"){A.push(R.id);continue}A.push(`\0barrier:${R.id}`);}};return w(H.children),A},k=(H,A)=>{let w=y(H);if(!w||y(A)!==w)return false;let P=I(w),R=P.indexOf(H),N=P.indexOf(A);return R!==-1&&N===R+1},E=h,C=h;for(let H=m+1;H<=l;H+=1){let A=i[H];f.has(A)||(k(C,A)?b.push({op:"joinParagraphs",firstId:E,secondId:A}):E=A,C=A);}return {ops:b,collapseTo:x}}function OR(e,t){let n=Math.max(0,e.end-e.start);return e.start+Math.max(0,Math.min(t,n))}var Nv=/^[^\s]{1,512}$/,FR=/["\\\u0000-\u001f\u007f]/;function Us(e){let t=e.dataset?.paragraphId,n=e.dataset?.start;if(!t||n===void 0||!/^\d{1,9}$/.test(n)||!Nv.test(t)||t==="__proto__")return null;let r=Number(n),o=e.dataset?.end,a=o!==void 0&&/^\d{1,9}$/.test(o)&&Number(o)>=r?Number(o):r+(e.textContent?.length??0);return {paragraphId:t,start:r,end:a}}function ei(e,t,n){return FR.test(t)?e.querySelectorAll(`[data-paragraph-id]${n}`):e.querySelectorAll(`[data-paragraph-id="${t}"]${n}`)}function Dv(e){let t=e.nodeType===Node.TEXT_NODE?e.parentNode:e;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let n=Us(t);if(n)return {element:t,identity:n};t=t.parentNode;}return null}function Hv(e){return e.querySelector("[data-docx-hf-active]")}function Wr(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 MR(e,t){return t===void 0||!Number.isInteger(t)||t<0?null:e.querySelector(`[data-page-index="${t}"]`)}function Du(e,t){let n=Hv(e);if(n)return [n,e];let r=MR(e,t);return r&&r!==e?[r,e]:[e]}function Mv(e,t){let n=Dv(e);if(n)return n;if(e.nodeType!==Node.ELEMENT_NODE)return null;let r=e.querySelectorAll("[data-paragraph-id][data-start]"),o=t?[...r].reverse():[...r];for(let a of o){let i=Us(a);if(i)return {element:a,identity:i}}return null}function AR(e,t){let n=[...e.childNodes];if(n.length===0)return null;for(let r=Math.max(0,t);r<n.length;r+=1){let o=Mv(n[r],false);if(o)return {paragraphId:o.identity.paragraphId,offset:o.identity.start}}for(let r=Math.min(t,n.length)-1;r>=0;r-=1){let o=Mv(n[r],true);if(o)return {paragraphId:o.identity.paragraphId,offset:o.identity.end}}return null}function Av(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")||Hv(n)&&r?.closest(".docx-page-content"))return null;let a=r?.closest("[data-docx-marker]");if(a)return a.parentElement?_v(a.parentElement):null;if(r?.closest("[data-docx-tab-leader]"))return null;if(e.nodeType===Node.ELEMENT_NODE){let s=e,l=Us(s);if(l)return {paragraphId:l.paragraphId,offset:t>0?l.end:l.start};let d=AR(s,t);return d||HR(s)}let i=Dv(e);return i?{paragraphId:i.identity.paragraphId,offset:OR(i.identity,t)}:null}function To(e,t){if(!t||t.rangeCount===0)return null;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:a}=t;if(!n||!o)return null;let i=Av(n,r,e),s=Av(o,a,e);if(!i||!s){let l=i??s;return l?{anchor:l,head:l}:null}return {anchor:i,head:s}}function Hu(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 Lv(e,t,n){for(let r of Du(e,n)){let o=LR(r,t);if(o)return o}return null}function LR(e,t){let n=ei(e,t.paragraphId,"[data-start]"),r=null,o=false;for(let i of n){let s=Us(i);if(!s||s.paragraphId!==t.paragraphId)continue;let l=NR(i),d=i.textContent?.length??0,u=s.end;if(l&&!i.closest?.("[data-docx-field]")&&(o=true,t.offset>=s.start&&t.offset<=u)){let f={node:l,offset:Math.min(t.offset-s.start,d)};if(t.offset<u)return f;r=f;}}if(r)return r;if(o)return null;let a=DR(e,t.paragraphId);return a?{node:a,offset:0}:null}function NR(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 DR(e,t){let n=null;for(let r of ei(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 _v(e){let t=e.closest("[data-paragraph-id]");if(!t||t.dataset.start!==void 0)return null;let n=t.dataset.paragraphId;return !n||!Nv.test(n)||n==="__proto__"?null:{paragraphId:n,offset:0}}function HR(e){let t=_v(e);return !t||e.closest("[data-paragraph-id]").querySelector("[data-paragraph-id][data-start]")?null:t}function Bv(e,t,n,r){if(!n)return false;let o=r?.preferredPageIndex??Wr(n.anchorNode,e),a=Lv(e,t.anchor,o),i=Lv(e,t.head,o);if(!a||!i)return false;let s=To(e,n);if(s&&qt(s,t)){let l=Wr(n.anchorNode,e);if(o===void 0||l===o)return true}try{return n.setBaseAndExtent(a.node,a.offset,i.node,i.offset),!0}catch{return false}}function qt(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 _R='[data-docx-marker],[data-docx-tab-leader],[aria-hidden="true"],[contenteditable="false"],[data-drawing-node-id]';function $v(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 qv(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 BR(e){return e?(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(".docx-page")??null:null}function $R(e,t,n){return t&&e.contains(t)?2:n?.contains(e)?1:0}function Zv(e,t,n,r){if(e.dataset.docxField!==void 0){let a=$v(e,t,t);return {start:t,end:a,text:n.slice(t,a),seq:r}}let o=e.textContent??"";return {start:t,end:$v(e,t,t+o.length),text:o,seq:r}}function Kv(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=qv(r,t.paragraphId);if(o===null){if(r.dataset?.start!==void 0||r.matches?.(_R))continue;Kv(r,t);continue}let a=Zv(r,o,t.modelText,t.seq);t.seq+=1,t.end=Math.max(t.end,a.end);let i=`${a.start}:${a.end}`;t.ranges.has(i)||(t.ranges.add(i),t.pieces.push(a));}}function qR(e,t,n,r){let o=[];for(let i of ei(e,t,"")){let s=i;s.dataset.paragraphId===t&&s.dataset.start===void 0&&(o.some(l=>l.contains(s))||o.push(s));}let a=new Map;for(let i of o){let s=i.dataset.fragmentIndex??"",l=$R(i,n,r),d=a.get(s);(!d||l>d.affinity)&&a.set(s,{element:i,affinity:l});}return [...a.values()].map(i=>i.element)}function ZR(e,t,n){for(let r of ei(e,n.paragraphId,"[data-start]")){let o=r,a=qv(o,n.paragraphId);if(a===null||t.some(l=>l.contains(o)))continue;let i=Zv(o,a,n.modelText,n.seq);n.seq+=1;let s=`${i.start}:${i.end}`;n.ranges.has(s)||(n.ranges.add(s),n.pieces.push(i));}}function KR(e,t){let n=[...e].sort((a,i)=>a.start-i.start||a.seq-i.seq),r="",o=0;for(let a of n)a.start>o&&(r+=t.slice(o,a.start)),r+=a.text,o=Math.max(o,a.end);return o<t.length&&(r+=t.slice(o)),r}function Vv(e,t,n,r){let o=qR(e,t,r,BR(r)),a={paragraphId:t,modelText:n,pieces:[],ranges:new Set,end:0,seq:0};for(let i of o)Kv(i,a);return ZR(e,o,a),a.pieces.length===0?null:KR(a.pieces,n)}var VR={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Home:"lineStart",End:"lineEnd"},zv={l:"left",e:"center",r:"right",j:"both"},jv={1:"240",5:"360",2:"480"},Wv={b:{localName:"b"},i:{localName:"i"},u:{localName:"u",attributes:{val:"single"}}};function zR(e,t){return e.altKey?e.metaKey?true:e.ctrlKey?e.getModifierState?.("AltGraph")??false?e.key.toLowerCase()===t:true:false:false}var jR=/^[a-z]$/;function WR(e){let t=e.key.toLowerCase();if(jR.test(t))return t;let n=e.code??"";return n.length===4&&n.startsWith("Key")?n[3].toLowerCase():""}function Gv(e,t={}){return n=>{if(n.defaultPrevented)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(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 r=WR(n);if(zR(n,r)&&!n.shiftKey){let i=r;if(i==="f"){n.preventDefault(),e.insertNote("footnote");return}if(i==="d"){n.preventDefault(),e.insertNote("endnote");return}if(i==="c"){n.preventDefault(),e.formatPainter.capture();return}if(i==="v"){n.preventDefault(),e.formatPainter.apply();return}}let o=n.metaKey||n.ctrlKey,a=VR[n.key];if(a){let i=a;n.key==="Home"||n.key==="End"?o&&(i=n.key==="Home"?"documentStart":"documentEnd"):(n.key==="ArrowLeft"||n.key==="ArrowRight")&&(n.altKey||n.ctrlKey)?i=n.key==="ArrowLeft"?"wordLeft":"wordRight":n.metaKey&&(n.key==="ArrowLeft"||n.key==="ArrowRight")?i=n.key==="ArrowLeft"?"lineStart":"lineEnd":o&&(n.key==="ArrowUp"||n.key==="ArrowDown")&&(i=n.key==="ArrowUp"?"documentStart":"documentEnd"),e.navigate(i,n.shiftKey),n.preventDefault();return}if(n.key==="PageUp"||n.key==="PageDown"){e.navigate(o?n.key==="PageUp"?"documentStart":"documentEnd":n.key==="PageUp"?"pageUp":"pageDown",n.shiftKey),n.preventDefault();return}if(n.key==="Backspace"){o||n.altKey?e.deleteWordBackward():e.deleteBackward(),n.preventDefault();return}if(n.key==="Delete"){o||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}e.isListParagraph()?e.adjustIndent(n.shiftKey?"decrease":"increase"):n.shiftKey?e.adjustIndent("decrease"):e.insertTab(),n.preventDefault();return}if(n.key==="Enter"){o?e.insertPageBreak():n.shiftKey?e.insertLineBreak():e.exitListOnEmptyItem()||e.splitParagraph(),n.preventDefault();return}if(o&&n.key.toLowerCase()==="a"){e.selectAll(),n.preventDefault();return}if(o&&n.shiftKey&&n.key.toLowerCase()==="v"){e.armForcePlainPaste();return}if(o&&!n.shiftKey&&n.key.toLowerCase()==="k"&&t.onRequestHyperlink){t.onRequestHyperlink(),n.preventDefault();return}if(o&&!n.shiftKey&&Wv[n.key.toLowerCase()]){let i=Wv[n.key.toLowerCase()];e.toggleRunProperty(i.localName,i.attributes),n.preventDefault();return}if(o&&(n.key==="="||n.key==="+"||n.code==="Equal")){e.toggleRunProperty("vertAlign",{val:n.shiftKey?"superscript":"subscript"}),n.preventDefault();return}if(o&&n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("decrease"),n.preventDefault();return}if(o&&!n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("increase"),n.preventDefault();return}if(o&&!n.shiftKey&&zv[n.key.toLowerCase()]){if(n.metaKey&&n.key.toLowerCase()==="r")return;e.setParagraphProperty("jc",{val:zv[n.key.toLowerCase()]}),n.preventDefault();return}if(o&&!n.shiftKey&&jv[n.key]){e.setParagraphProperty("spacing",{line:jv[n.key],lineRule:"auto"},{mergeAttributes:true}),n.preventDefault();return}if(o&&n.key.toLowerCase()==="y"){e.redo(),n.preventDefault();return}(n.metaKey||n.ctrlKey)&&n.key.toLowerCase()==="z"&&(n.shiftKey?e.redo():e.undo(),n.preventDefault());}}function Xv(e){let t=a=>{let i=e.copyFlavours();return i.text?(a.clipboardData?.setData("text/plain",i.text),i.html&&a.clipboardData?.setData("text/html",i.html),true):false};return {onCopy:a=>{t(a)&&a.preventDefault();},onCut:a=>{t(a)&&(e.deleteSelection(),a.preventDefault());},onPaste:a=>{let i=yc(a.clipboardData),s=a.clipboardData?.getData("text/html")??"";a.preventDefault(),!(!i&&!s)&&e.pasteRich(i,s.length>0?s:null);}}}function Uv(e){let t=yc(e.dataTransfer);return t.length>0?t:null}function Yv(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??Uv(n);if(!r)return;YR(e,GR(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=Uv(n);r&&t.insertPlainText(r);return}n.inputType==="insertParagraph"&&e.splitParagraph();}}}}function UR(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 GR(e){if(typeof e.getTargetRanges!="function")return null;let t=e.getTargetRanges();if(t.length!==1)return null;let n=t[0],r=UR(n);return r?{text:r,paragraphId:XR(n)}:null}function XR(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 YR(e,t,n){if(t!==null){e.flushPendingInput();let r=e.state(),o=r.selection.head,a=t.text;if(qt(r.selection,$e(o))&&o.offset>=a.length&&(t.paragraphId===null||t.paragraphId===o.paragraphId)&&r.pendingFormat===null){let i=Ue(e.session,o.paragraphId)??e.session.part(),s=chunkMXOO7KRI_cjs.Di(i,o.paragraphId);s!==null&&s.slice(o.offset-a.length,o.offset)===a&&e.setSelection({anchor:{paragraphId:o.paragraphId,offset:o.offset-a.length},head:o});}}e.type(n);}function Qv(e,t,n,r=null){for(let o of Du(e)){let a=Vv(o,t,n,r);if(a!==null)return a}return null}function Jv(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 a=n.slice(r,n.length-o),i=[];return t.length-o>r&&i.push({op:"deleteText",paragraphId:e,start:r,end:t.length-o}),a.length>0&&i.push({op:"insertText",paragraphId:e,offset:r,text:a}),i.length===0?null:{ops:i,caret:r+a.length}}function De(e){return e.kind!=="textValue"}function me(e,t){if(!e||e.kind==="textValue")return null;for(let n of e.children)if(De(n)&&n.localName===t&&n.namespaceUri===chunkMXOO7KRI_cjs.da)return n;return null}function Ye(e,t="val"){return e?chunkMXOO7KRI_cjs.Ie(e,t,chunkMXOO7KRI_cjs.da):void 0}function Yt(e,t,n){return e?chunkMXOO7KRI_cjs.Ie(e,t,n):void 0}function _u(e){if(e.kind==="textValue")return e.value;let t="";for(let n of e.children)t+=_u(n);return t}function Co(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=Co(r,t,n);if(o)return o}return null}function gt(e){if(e===void 0||!/^-?\d+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function Bu(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var kn=Bu;function Gs(e){return e===void 0||e.toLowerCase()==="auto"?null:/^[0-9A-Fa-f]{6}$/.test(e)?`#${e.toLowerCase()}`:null}function Tn(e){return `${Math.round(e/20*100)/100}pt`}var QR="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",JR=chunkBNZF6DYC_cjs.Cb;function ti(e,t,n){for(let o of chunkMXOO7KRI_cjs.ic(e,e.mainDocumentPart)){if(o.type!==t||o.targetMode==="External")continue;let a=chunkMXOO7KRI_cjs.w(o.ownerPart,o.rawTarget);if(a.ok){let i=e.parts.get(a.partName);if(i&&De(i.root))return i.root}}let r=e.parts.get(n);return r&&De(r.root)?r.root:null}function ex(e){let t=ti(e,QR,"/word/styles.xml"),n=new Map,r=null,o=null,a=null,i=null,s=null;if(!t)return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:a,defaultCharacterStyleId:i,defaultTableStyleId:s};let l=0;for(let d of t.children){if(!De(d)||d.namespaceUri!==chunkMXOO7KRI_cjs.da)continue;if(d.localName==="docDefaults"){r=me(me(d,"rPrDefault"),"rPr"),o=me(me(d,"pPrDefault"),"pPr");continue}if(d.localName!=="style")continue;if(l>=chunkBNZF6DYC_cjs.Db)break;l+=1;let u=chunkMXOO7KRI_cjs.Ie(d,"styleId",chunkMXOO7KRI_cjs.da);if(!u)continue;n.set(u,d);let f=chunkMXOO7KRI_cjs.Ie(d,"default",chunkMXOO7KRI_cjs.da),p=chunkMXOO7KRI_cjs.Ie(d,"type",chunkMXOO7KRI_cjs.da);f==="1"||f==="true"||f==="on"?p==="paragraph"?a=u:p==="character"?i=u:p==="table"&&(s=u):(a===u&&(a=null),i===u&&(i=null),s===u&&(s=null));}return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:a,defaultCharacterStyleId:i,defaultTableStyleId:s}}function Gn(e,t,n){let r=[],o=new Set,a=t;for(;a&&!o.has(a)&&r.length<JR;){o.add(a);let i=e.byId.get(a);if(!i)break;if(r.length===0&&n!==void 0){let s=chunkMXOO7KRI_cjs.Ie(i,"type",chunkMXOO7KRI_cjs.da);if(s!==void 0&&s!==n)return []}r.unshift(i),a=Ye(me(i,"basedOn"));}return r}function $u(e,t,n){let r=[];if(e.docDefaultsPPr&&r.push(e.docDefaultsPPr),n)for(let a of n)r.push(a);let o=Ye(me(t,"pStyle"));for(let a of Gn(e,o??e.defaultParagraphStyleId??void 0,"paragraph")){let i=me(a,"pPr");i&&r.push(i);}return t&&r.push(t),r}function Xs(e,t,n,r){let o=[];e.docDefaultsRPr&&o.push(e.docDefaultsRPr);let a=[];if(r)for(let f of r)a.push(f);let i=[],s=Ye(me(t,"pStyle"));for(let f of Gn(e,s??e.defaultParagraphStyleId??void 0,"paragraph")){let p=me(f,"rPr");p&&i.push(p);}let l=[],d=Ye(me(n,"rStyle"))??e.defaultCharacterStyleId??void 0;for(let f of Gn(e,d,"character")){let p=me(f,"rPr");p&&l.push(p);}let u=[...o,...a,...i,...l];return n&&u.push(n),{all:u,defaults:o,tableLevel:a,paragraphLevel:i,characterLevel:l,direct:n}}function Qt(e,t){let n=null;for(let r of e){let o=me(r,t);o&&(n=o);}return n}function lt(e,t,n){let r;for(let o of e){let a=me(o,t);if(!a)continue;let i=chunkMXOO7KRI_cjs.Ie(a,n,chunkMXOO7KRI_cjs.da);i!==void 0&&(r=i);}return r}function Ys(e){return !(e==="0"||e==="false"||e==="off")}function Xn(e,t){let n=false;for(let r of e){let o=me(r,t);o&&(n=Ys(Ye(o)));}return n}function br(e,t){let n;for(let r of e){let o=me(r,t);o&&(n=Ys(Ye(o)));}return n}function fn(e,t){let n=e.direct?me(e.direct,t):null;if(n)return Ys(Ye(n));let r=br(e.tableLevel,t),o=br(e.paragraphLevel,t),a=br(e.characterLevel,t);return a===false||a===void 0&&o===false||a===void 0&&o===void 0&&r===false?false:br(e.defaults,t)===true?true:r===true!=(o===true)!=(a===true)}function qu(e,t){let n=e.direct?me(e.direct,t):null;if(n)return Ys(Ye(n));let r=br(e.characterLevel,t);if(r!==void 0)return r;let o=br(e.paragraphLevel,t);if(o!==void 0)return o;let a=br(e.tableLevel,t);return a!==void 0?a:br(e.defaults,t)===true}function tx(e){return e.isLgl?"decimal":e.numFmt}function nx(e){let t=chunkBNZF6DYC_cjs.wc(e),n=new Map,r=new Map,o=new Map,a=new Map,i=new Map,s=new Map;for(let[l,d]of t.abstractNums){d.numStyleLink!==void 0&&s.set(l,d.numStyleLink);let u=new Map,f=new Map;for(let[p,m]of d.levels)u.set(String(p),tx(m)),f.set(String(p),m.start);r.set(l,u),o.set(l,f);}for(let[l,d]of t.nums){n.set(l,d.abstractNumId);for(let[u,f]of d.overrides){let p=`${l}:${u}`,m=f.startOverride??f.level?.start;m!==void 0&&a.set(p,m),f.level!==void 0&&i.set(p,tx(f.level));}}return {numToAbstract:n,levelFormats:r,levelStarts:o,startOverrides:a,formatOverrides:i,styleLinks:s}}function rx(e,t){if(e===null)return null;let n=chunkMXOO7KRI_cjs.Ie(e,t,chunkMXOO7KRI_cjs.da);if(n===void 0||!/^-?\d{1,9}$/.test(n))return null;let r=Number.parseInt(n,10);return Number.isSafeInteger(r)?r:null}function ax(e,t){if(e===null)return null;let n=chunkMXOO7KRI_cjs.Ie(e,t,chunkMXOO7KRI_cjs.da);return n!==void 0&&/^[0-9A-Fa-f]{6}$/.test(n)?`#${n.toLowerCase()}`:null}function ox(e){return `${Math.round(e/20*100)/100}pt`}var eE=["wholeTable","firstRow","lastRow","firstCol","lastCol","band1Horz","band2Horz","band1Vert","band2Vert","nwCell","neCell","swCell","seCell"];function Po(e,t,n){if(e===null)return null;let r=chunkMXOO7KRI_cjs.Ie(e,t,chunkMXOO7KRI_cjs.da);if(r!==void 0)return !(r==="0"||r==="false"||r==="off");let o=chunkMXOO7KRI_cjs.Ie(e,"val",chunkMXOO7KRI_cjs.da);return o===void 0||!/^[0-9A-Fa-f]{1,4}$/.test(o)?null:(Number.parseInt(o,16)&n)!==0}function Zu(e,t){let n=new Map,r=new Set(eE);for(let o of e)for(let a of o.children){if(a.kind==="textValue"||a.localName!=="tblStylePr"||a.namespaceUri!==chunkMXOO7KRI_cjs.da)continue;let i=chunkMXOO7KRI_cjs.Ie(a,"type",chunkMXOO7KRI_cjs.da);i===void 0||!r.has(i)||n.set(i,{fill:ax(me(me(a,"tcPr"),"shd"),"fill"),rPr:me(a,"rPr"),pPr:me(a,"pPr")});}return {byType:n,firstRowEnabled:Po(t,"firstRow",32)??false,lastRowEnabled:Po(t,"lastRow",64)??false,firstColumnEnabled:Po(t,"firstColumn",128)??false,lastColumnEnabled:Po(t,"lastColumn",256)??false,hBandingEnabled:!(Po(t,"noHBand",512)??false),vBandingEnabled:!(Po(t,"noVBand",1024)??false)}}function Ku(e,t,n,r,o,a){let i=e.firstRowEnabled&&t===0,s=e.lastRowEnabled&&t===n-1,l=e.firstColumnEnabled&&r,d=e.lastColumnEnabled&&o,u=f=>e.byType.get(f)??null;if(s&&l&&u("swCell"))return u("swCell");if(s&&d&&u("seCell"))return u("seCell");if(i&&l&&u("nwCell"))return u("nwCell");if(i&&d&&u("neCell"))return u("neCell");if(s&&u("lastRow"))return u("lastRow");if(i&&u("firstRow"))return u("firstRow");if(d&&u("lastCol"))return u("lastCol");if(l&&u("firstCol"))return u("firstCol");if(e.hBandingEnabled){let f=t-(e.firstRowEnabled?1:0);if(f>=0){let p=u(f%2===0?"band1Horz":"band2Horz");if(p)return p}}if(e.vBandingEnabled){let f=a-(e.firstColumnEnabled?1:0);if(f>=0){let p=u(f%2===0?"band1Vert":"band2Vert");if(p)return p}}return null}function ix(e,t,n,r,o,a,i,s,l=false,d=[]){let u=[],f=me(e,"tcBorders"),p={top:n===0?"top":"insideH",bottom:n+o>=r?"bottom":"insideH",left:a?"left":"insideV",right:i?"right":"insideV"};for(let E of ["top","left","bottom","right"]){let C=E==="left"?"start":E==="right"?"end":E,H=me(f,E)??me(f,C),A=p[E],w=A==="left"?"start":A==="right"?"end":A,P=H!==null?$r(H):$r(me(t,A)??me(t,w));P&&u.push(`border-${dn(E,l)}:${P}`);}let m=ax(me(e,"shd"),"fill")??s;m&&u.push(`background-color:${m}`);let h=me(e,"vAlign"),x=h===null?void 0:chunkMXOO7KRI_cjs.Ie(h,"val",chunkMXOO7KRI_cjs.da);x==="center"?u.push("vertical-align:middle"):(x==="bottom"||x==="top")&&u.push(`vertical-align:${x}`);let b=me(e,"tcW"),y=rx(b,"w"),I=b===null?void 0:chunkMXOO7KRI_cjs.Ie(b,"type",chunkMXOO7KRI_cjs.da);y!==null&&y>0&&(I===void 0||I==="dxa")&&u.push(`width:${ox(y)}`);let k=me(e,"tcMar");for(let E of ["top","right","bottom","left"]){let C=E==="left"?"start":E==="right"?"end":E,H=me(k,E)??me(k,C)??d.map(P=>me(P,E)??me(P,C)).find(P=>P!==null)??null,A=rx(H,"w"),w=H===null?void 0:chunkMXOO7KRI_cjs.Ie(H,"type",chunkMXOO7KRI_cjs.da);A!==null&&A>=0&&(w===void 0||w==="dxa")&&u.push(`padding-${dn(E,l)}:${ox(A)}`);}return u.join(";")}function tE(e){return e.kind==="tableCell"?true:e.localName==="tc"&&e.namespaceUri===chunkMXOO7KRI_cjs.da}function sx(e){return e.localName==="customXml"&&e.namespaceUri===chunkMXOO7KRI_cjs.da}function lx(e){let t=[],n=[],r=o=>{for(let a of o)if(De(a)){if(a.kind==="tableRow"||a.localName==="tr"&&a.namespaceUri===chunkMXOO7KRI_cjs.da){n.push({row:t.length}),t.push(a);continue}if(a.kind==="contentControl"){let i=a.children.find(s=>s.kind==="contentControlContent");i&&De(i)&&r(i.children);continue}if(sx(a)){r(a.children);continue}n.push({skip:a});}};return r(e.children),{rows:t,tableItems:n}}function dx(e){let t=[],n=[];for(let r of e){let o=[],a=[],i=0,s=l=>{for(let d of l)if(De(d)){if(tE(d)){let u=me(d,"tcPr"),f=Math.min(Math.max(gt(Ye(me(u,"gridSpan")))??1,1),63),p=me(u,"vMerge"),m=p===null?null:Ye(p)==="restart"?"restart":"continue",h={cell:d,startColumn:i,span:f,vMerge:m};o.push(h),a.push({placement:h}),i+=f;continue}if(d.kind==="contentControl"){let u=d.children.find(f=>f.kind==="contentControlContent");u&&De(u)&&s(u.children);continue}if(sx(d)){s(d.children);continue}a.push({skip:d});}};s(r.children),t.push(o),n.push(a);}return {placements:t,items:n}}function cx(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 ux(e,t,n,r){let o=new Map,a=t.byType.get("wholeTable")??null;for(let i=0;i<n.length;i+=1)for(let s of n[i]??[]){if(s.vMerge==="continue")continue;let l=Ku(t,i,n.length,s.startColumn===0,s.startColumn+s.span>=r,s.startColumn),d=[],u=[];a?.rPr&&d.push(a.rPr),a?.pPr&&u.push(a.pPr),l?.rPr&&d.push(l.rPr),l?.pPr&&u.push(l.pPr),o.set(s.cell,d.length>0||u.length>0?{...e,tableRPr:d,tablePPr:u}:e);}return o}function fx(e,t){let n=Gn(e.styles,Ye(me(t,"tblStyle")),"table");return n.length>0?n:Gn(e.styles,e.styles.defaultTableStyleId??void 0,"table")}function px(e,t){let n=t.children.find(l=>l.kind==="tableProperties"),r=n&&De(n)?n:null,o=fx(e,r),a=Zu(o,me(r,"tblLook")),{rows:i}=lx(t),{placements:s}=dx(i);return ux(e,a,s,cx(s))}function mx(e,t,n,r){let o=t.children.find(P=>P.kind==="tableProperties"),a=o&&De(o)?o:null,i=null,s=fx(e,a);for(let P of s){let R=me(me(P,"tblPr"),"tblBorders");R&&(i=R);}let l=s.map(P=>me(P,"tblPr")).filter(P=>P!==null);a&&l.push(a);let d=Xn(l,"bidiVisual"),u=[],f;for(let P of l){let R=me(P,"tblCellMar");R&&u.unshift(R),f=Ye(me(P,"jc"))??f;}let p=me(a,"tblBorders");p&&(i=p);let m=Zu(s,me(a,"tblLook")),{rows:h,tableItems:x}=lx(t),{placements:b,items:y}=dx(h),I=cx(b),k=ux(e,m,b,I),E=["border-collapse:collapse"],C=me(a,"tblW"),H=gt(Yt(C,"w",chunkMXOO7KRI_cjs.da));H!==null&&H>0&&Yt(C,"type",chunkMXOO7KRI_cjs.da)==="dxa"&&E.push(`width:${Tn(H)}`);let A=dn(f==="right"||f==="end"?"right":f==="center"?"center":"left",d);A==="center"?E.push("margin-left:auto","margin-right:auto"):A==="right"?E.push("margin-left:auto","margin-right:0"):E.push("margin-left:0","margin-right:auto");for(let[P,R]of [["insideH","insideh"],["insideV","insidev"]]){let N=$r(me(i,P));N&&E.push(`mso-border-${R}-alt:${N}`);}let w=`<table dir="${d?"rtl":"ltr"}" align="${A}" style="${E.join(";")}">`;for(let P of x){if("skip"in P){r.advanceFieldState(P.skip,n);continue}let R=P.row,N=me(me(h[R]??null,"trPr"),"trHeight"),B=gt(Yt(N,"val",chunkMXOO7KRI_cjs.da)),U=Rh(B,Yt(N,"hRule",chunkMXOO7KRI_cjs.da)),F=U===""?"":` style="${U}"`;w+=`<tr${F}>`;for(let _ of y[R]??[]){if("skip"in _){r.advanceFieldState(_.skip,n);continue}let $=_.placement;if($.vMerge==="continue"){r.advanceFieldState($.cell,n);continue}let Z=1;if($.vMerge==="restart")for(let q=R+1;q<b.length&&b[q].find(X=>X.startColumn===$.startColumn&&X.vMerge==="continue");q+=1)Z+=1;let Y=me($.cell,"tcPr"),oe=$.startColumn+$.span>=I,ue=Ku(m,R,b.length,$.startColumn===0,oe,$.startColumn),Te=m.byType.get("wholeTable")??null,ce=ix(Y,i,R,b.length,Z,$.startColumn===0,oe,ue?.fill??Te?.fill??null,d,u),D=($.span>1?` colspan="${$.span}"`:"")+(Z>1?` rowspan="${Z}"`:"")+(ce===""?"":` style="${kn(ce)}"`),M=k.get($.cell)??e;w+=`<td dir="ltr"${D}>${r.renderBlocks(M,$.cell.children,n)}</td>`;}w+="</tr>";}return `${w}</table>`}function Qs(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 Vu(e){let t=chunkMXOO7KRI_cjs.Ie(e,"type",chunkMXOO7KRI_cjs.da);return t==="separator"||t==="continuationSeparator"}function zu(e,t){let n=new Set;if(e===null)return n;for(let r of e.children){if(!De(r)||r.namespaceUri!==chunkMXOO7KRI_cjs.da||r.localName!==t||Vu(r))continue;let o=Qs(chunkMXOO7KRI_cjs.Ie(r,"id",chunkMXOO7KRI_cjs.da));o!==null&&n.add(o);}return n}function ni(e,t,n,r,o,a,i){for(let s of t.children)if(De(s)&&s.kind!=="drawing"){if(s.kind==="revisionDelete"||s.kind==="revisionMoveFrom"){r.inert||o(s,r);continue}if(s.kind==="table"){ni(e,s,n,r,o,a,px(e,s));continue}if(s.kind==="tableCell"||s.namespaceUri===chunkMXOO7KRI_cjs.da&&s.localName==="tc"){let l=i?.get(s);if(l===void 0){r.inert||o(s,r);continue}ni(l,s,n,r,o,a,i);continue}if(s.kind==="paragraph"){let l=s.children.find(d=>d.kind==="paragraphProperties");ni(e,s,n,r,o,l&&De(l)?l:null,i);continue}if(s.kind==="run"){if(s.children.some(u=>u.kind==="fldChar")){r.inert||o(s,r);continue}if(s.children.some(u=>u.kind==="instrText")||!r.inert&&r.stack.some(u=>u==="instr"))continue;let l=s.children.find(u=>u.kind==="runProperties"),d=Xs(e.styles,a,l&&De(l)?l:null,e.tableRPr);if(fn(d,"vanish"))continue}if(s.namespaceUri===chunkMXOO7KRI_cjs.da&&(s.localName==="footnoteReference"||s.localName==="endnoteReference")){let l=Qs(chunkMXOO7KRI_cjs.Ie(s,"id",chunkMXOO7KRI_cjs.da));l!==null&&n.push({kind:s.localName==="footnoteReference"?"footnote":"endnote",id:l});continue}ni(e,s,n,r,o,a,i);}}function nE(e,t,n){if(e===null)return null;for(let r of e.children)if(!(!De(r)||r.namespaceUri!==chunkMXOO7KRI_cjs.da)&&!(r.localName!==t||Vu(r))&&Qs(chunkMXOO7KRI_cjs.Ie(r,"id",chunkMXOO7KRI_cjs.da))===n)return r;return null}function gx(e,t,n){let r={footnote:new Set(e.noteOrdinals.footnote.keys()),endnote:new Set(e.noteOrdinals.endnote.keys())},o=[];for(let a of ["footnote","endnote"])for(let i of r[a])o.push({kind:a,id:i});for(;o.length>0;){let a=o.pop(),i=nE(t[a.kind],a.kind,a.id);if(i===null)continue;let s={stack:[],inert:false};n(i,s);let l={stack:[],inert:s.stack.length>0},d=[];ni(e,i,d,l,n,null);for(let u of d)e.availableNotes[u.kind].has(u.id)&&(r[u.kind].has(u.id)||(r[u.kind].add(u.id),o.push(u)));}return r}function ju(e,t,n,r,o){if(n===null)return "";let a=`/word/${t}s.xml`;for(let[l,d]of e.pkg.parts)d.root===n&&(a=l);let i=chunkMXOO7KRI_cjs.ic(e.pkg,a),s="";for(let l of n.children){if(!De(l)||l.namespaceUri!==chunkMXOO7KRI_cjs.da||l.localName!==t||Vu(l))continue;let d=chunkMXOO7KRI_cjs.Ie(l,"id",chunkMXOO7KRI_cjs.da),u=Qs(d);if(d===void 0||u===null||!r.has(u))continue;let f=o({...e,noteBody:{kind:t,id:u},docRels:i},l.children);s+=`<div style="mso-element:${t}" id="${t==="footnote"?"ftn":"edn"}${u}">${f===""?"<p></p>":f}</div>`;}return s===""?"":`<div style="mso-element:${t}-list">${s}</div>`}var Wu="http://schemas.openxmlformats.org/officeDocument/2006/relationships",rE=`${Wu}/numbering`,oE=`${Wu}/footnotes`,aE=`${Wu}/endnotes`,iE=2*1024*1024,sE=8*1024*1024,hx=9525,lE=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 Js(e,t,n,r){let o=e.direct!==null&&me(e.direct,r)!==null||Qt(e.defaults,r)!==null||Qt(e.tableLevel,r)!==null||Qt(e.paragraphLevel,r)!==null||Qt(e.characterLevel,r)!==null;return fn(e,t&&o?r:n)}function dE(e){let t=e.all;if(fn(e,"vanish"))return {css:"",vanish:true,vertAlign:null,lang:null,rtl:false};let n=[],r=Xn(t,"rtl"),o=(r?lt(t,"rFonts","cs"):void 0)??lt(t,"rFonts","ascii")??lt(t,"rFonts","hAnsi")??lt(t,"rFonts","eastAsia")??(r?void 0:lt(t,"rFonts","cs"));if(o!==void 0){let E=Th(o);E&&n.push(`font-family:${E}`);}let a=gt((r?lt(t,"szCs","val"):void 0)??lt(t,"sz","val")??(r?void 0:lt(t,"szCs","val")));a!==null&&a>0&&n.push(`font-size:${Math.round(a/2*100)/100}pt`);let i={...e,direct:null},s=e.direct?t.slice(0,-1):t;Js(e,r,"b","bCs")?n.push("font-weight:bold"):Js(i,r,"b","bCs")&&n.push("font-weight:normal"),Js(e,r,"i","iCs")?n.push("font-style:italic"):Js(i,r,"i","iCs")&&n.push("font-style:normal");let l=[],d=Qt(t,"u"),u=d!==null&&Ye(d)!=="none";u&&l.push("underline");let f=qu(e,"dstrike");if((fn(e,"strike")||f)&&l.push("line-through"),l.length>0)n.push(`text-decoration:${l.join(" ")}`);else {let E=Qt(s,"u");(E!==null&&Ye(E)!=="none"||fn(i,"strike")||qu(i,"dstrike"))&&n.push("text-decoration:none");}u&&n.push(...Ph(d)),f&&!u&&n.push("text-decoration-style:double");let p=Gs(lt(t,"color","val"));p&&n.push(`color:${p}`);let m=gt(lt(t,"spacing","val"));m!==null&&n.push(`letter-spacing:${Math.round(m/20*100)/100}pt`);let h=Ye(Qt(t,"highlight")),x=h!==void 0&&Object.hasOwn(Ud,h)?Ud[h]:void 0,b=Gs(lt(t,"shd","fill"));x?n.push(`background-color:${x}`,`mso-highlight:${h}`):b&&n.push(`background-color:${b}`),fn(e,"caps")?n.push("text-transform:uppercase"):fn(i,"caps")&&n.push("text-transform:none"),fn(e,"smallCaps")?n.push("font-variant:small-caps"):fn(i,"smallCaps")&&n.push("font-variant:normal");let y=Ye(Qt(t,"vertAlign")),I=y==="superscript"||y==="subscript"?y:null,k=Br((r?lt(t,"lang","bidi"):void 0)??lt(t,"lang","val")??lt(t,"lang","bidi")??lt(t,"lang","eastAsia"));return {css:n.join(";"),vanish:false,vertAlign:I,lang:k,rtl:r}}function cE(e,t){let n=[],r=Ye(Qt(e,"jc")),o=r!==void 0&&Object.hasOwn(Gd,r)?Gd[r]:void 0;o&&n.push(`text-align:${o}`);let a=gt(lt(e,"spacing","before"));a!==null&&a>=0&&n.push(`margin-top:${Tn(a)}`);let i=gt(lt(e,"spacing","after"));i!==null&&i>=0&&n.push(`margin-bottom:${Tn(i)}`);let s=gt(lt(e,"spacing","line")),l=lt(e,"spacing","lineRule");n.push(...Ch(s,l));let d=null,u=null,f=null,p=null;for(let b of e){let y=me(b,"ind");if(!y)continue;let I=gt(Yt(y,"left",chunkMXOO7KRI_cjs.da)??Yt(y,"start",chunkMXOO7KRI_cjs.da));I!==null&&(d=I);let k=gt(Yt(y,"right",chunkMXOO7KRI_cjs.da)??Yt(y,"end",chunkMXOO7KRI_cjs.da));k!==null&&(u=k);let E=gt(Yt(y,"hanging",chunkMXOO7KRI_cjs.da)),C=gt(Yt(y,"firstLine",chunkMXOO7KRI_cjs.da));E!==null?(f=E,p=null):C!==null&&(p=C,f=null);}!t&&d!==null&&n.push(`margin-left:${Tn(d)}`),u!==null&&n.push(`margin-right:${Tn(u)}`),f!==null&&f!==0?n.push(`text-indent:${Tn(-f)}`):p!==null&&p!==0&&n.push(`text-indent:${Tn(p)}`);let m=Qt(e,"tabs");if(m){let b=[];for(let y of m.children){if(!De(y)||y.localName!=="tab")continue;let I=Ye(y),k=gt(chunkMXOO7KRI_cjs.Ie(y,"pos",chunkMXOO7KRI_cjs.da));if(k===null||k<0||I!=="left"&&I!=="center"&&I!=="right"&&I!=="decimal"&&I!=="bar")continue;let E=Ye(y,"leader"),C=E==="dot"?"dotted":E==="hyphen"?"dashed":E==="underscore"?"lined":E==="middleDot"?"middledot":E==="heavy"?"heavy":"";b.push(`${I}${C?` ${C}`:""} ${Tn(k)}`);}b.length>0&&n.push(`tab-stops:${b.join(" ")}`);}Xn(e,"pageBreakBefore")&&n.push("page-break-before:always"),Xn(e,"keepNext")&&n.push("page-break-after:avoid"),Xn(e,"keepLines")&&n.push("page-break-inside:avoid"),Xn(e,"widowControl")&&n.push("widows:2","orphans:2");let h=Gs(lt(e,"shd","fill"));h&&n.push(`background-color:${h}`);let x=Qt(e,"pBdr");if(x)for(let b of ["top","left","bottom","right"]){let y=$r(me(x,b));y&&n.push(`border-${b}:${y}`,`mso-border-${b}-alt:${y}`);}return n.join(";")}function uE(e,t,n){let r=e.noteOrdinals[t],o=r.get(n);if(o!==void 0)return o;let a=r.size+1;return r.set(n,a),a}var yx={decimal:"decimal",decimalZero:"decimal-leading-zero",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",none:"none"};function vx(e,t,n,r){let o=e.numbering.formatOverrides.get(`${t}:${r}`)??e.numbering.levelFormats.get(n)?.get(String(r))??"decimal",a=e.numbering.startOverrides.get(`${t}:${r}`)??e.numbering.levelStarts.get(n)?.get(String(r))??1;return {fmt:o,start:a}}function fE(e,t){let n,r;for(let s of t){let l=me(s,"numPr");if(!l)continue;let d=Ye(me(l,"numId"));d!==void 0&&(n=d);let u=Ye(me(l,"ilvl"));u!==void 0&&(r=u);}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),d=l===void 0?void 0:e.styles.byId.get(l),u=Ye(me(me(me(d??null,"pPr"),"numPr"),"numId")),f=u===void 0?void 0:e.numbering.numToAbstract.get(u);if(f===void 0||f===o)break;o=f;}let a=Math.min(Math.max(gt(r)??0,0),8),i=vx(e,n,o,a);return {numId:n,abstractId:o,level:a,fmt:i.fmt,start:i.start}}function pE(e,t){let n=chunkMXOO7KRI_cjs.B(e.pkg.contentTypes,t);if(n.ok){let a=lE.get(n.contentType.toLowerCase());if(a!==void 0)return a}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 mE(e,t){let n=Co(t,"inline",chunkMXOO7KRI_cjs.ia)??Co(t,"anchor",chunkMXOO7KRI_cjs.ia);if(!n)return "";let r=Co(n,"blip",chunkMXOO7KRI_cjs.ha);if(!r)return "";let o=chunkMXOO7KRI_cjs.Ie(r,"embed",chunkMXOO7KRI_cjs.ja);if(!o)return "";let a=e.docRels.find(x=>x.id===o&&x.targetMode!=="External");if(!a)return "";let i=chunkMXOO7KRI_cjs.w(a.ownerPart,a.rawTarget);if(!i.ok)return "";let s=e.pkg.partBytes.get(i.partName.replace(/^\//,""))??e.pkg.partBytes.get(i.partName);if(!s)return "";let l=pE(e,i.partName);if(!l||s.byteLength>e.maxImageBytes||e.imageBudget.used+s.byteLength>e.maxTotalImageBytes)return "";e.imageBudget.used+=s.byteLength;let d=e.imageDataUris.get(i.partName);d==null&&(d=`data:${l};base64,${ls(s)}`,e.imageDataUris.set(i.partName,d));let u=Co(n,"extent",chunkMXOO7KRI_cjs.ia),f=u?gt(chunkMXOO7KRI_cjs.Ie(u,"cx","")):null,p=u?gt(chunkMXOO7KRI_cjs.Ie(u,"cy","")):null,m=x=>Math.round(x/12700*100)/100,h=f!==null&&p!==null&&f>0&&p>0?` width="${Math.round(f/hx)}" height="${Math.round(p/hx)}" style="width:${m(f)}pt;height:${m(p)}pt"`:"";return `<img src="${d}"${h}>`}function Gr(e,t,n=0){if(n>=chunkMXOO7KRI_cjs.la)return;let r=chunkMXOO7KRI_cjs.fe(e)?n+1:chunkMXOO7KRI_cjs.ma(e,n);for(let o of e.children)if(De(o)&&o.kind!=="drawing"){if(o.kind==="contentControl"){let a=o.children.find(i=>i.kind==="contentControlContent");a&&De(a)&&Gr(a,t,r+1);continue}if(o.kind==="fldChar"){xx(o,t);continue}Gr(o,t,r);}}function xx(e,t){let n=chunkMXOO7KRI_cjs.Ie(e,"fldCharType",chunkMXOO7KRI_cjs.da);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 gE(e,t,n,r){let o=t.children.find(d=>d.kind==="runProperties"),a=Xs(e.styles,n,o&&De(o)?o:null,e.tableRPr),i=dE(a),s="";for(let d of t.children){if(!De(d))continue;if(d.kind==="fldChar"){r.inert||xx(d,r);continue}if(d.kind==="instrText"||!r.inert&&r.stack.some(p=>p==="instr")||i.vanish)continue;let u=Oh(d);if(u!==""){s+=u;continue}let f=Eh(d,e.noteBody,(p,m)=>uE(e,p,m),(p,m)=>e.availableNotes[p].has(m));if(f!==""){s+=f;continue}switch(d.kind){case "text":s+=Bu(_u(d));break;case "tab":s+='<span style="white-space:pre;mso-tab-count:1"> </span>';break;case "hardBreak":{let p=chunkMXOO7KRI_cjs.Ie(d,"type",chunkMXOO7KRI_cjs.da);s+=p==="page"?'<br style="page-break-before:always">':"<br>";break}case "bookmarkStart":{let p=ln(chunkMXOO7KRI_cjs.Ie(d,"name",chunkMXOO7KRI_cjs.da));p!==null&&(s+=`<a id="${kn(p)}"></a>`);break}case "drawing":s+=mE(e,d);break;}}if(s==="")return "";i.vertAlign==="superscript"?s=`<sup>${s}</sup>`:i.vertAlign==="subscript"&&(s=`<sub>${s}</sub>`);let l=`${i.lang===null?"":` lang="${i.lang}"`}${i.rtl?' dir="rtl"':""}${i.css===""?"":` style="${kn(i.css)}"`}`;return l===""?s:`<span${l}>${s}</span>`}function Ur(e,t,n,r,o=0){if(o>=chunkMXOO7KRI_cjs.la)return "";let a="";for(let i of t)if(De(i))switch(chunkMXOO7KRI_cjs.fe(i)?"fldSimple":i.kind){case "run":a+=gE(e,i,n,r);break;case "hyperlink":{let s=Ur(e,i.children,n,r,o+1);if(s==="")break;let l=chunkMXOO7KRI_cjs.Ie(i,"id",chunkMXOO7KRI_cjs.ja),d=l?e.docRels.find(p=>p.id===l):void 0,u=d===void 0?void 0:d.targetMode==="External"||d.rawTarget.startsWith("#")?d.rawTarget:void 0,f=Qh(u,chunkMXOO7KRI_cjs.Ie(i,"anchor",chunkMXOO7KRI_cjs.da));a+=f!==null?`<a href="${kn(f)}">${s}</a>`:s;break}case "bookmarkStart":{let s=ln(chunkMXOO7KRI_cjs.Ie(i,"name",chunkMXOO7KRI_cjs.da));s!==null&&(a+=`<a id="${kn(s)}"></a>`);break}case "fldSimple":a+=Ur(e,i.children,n,r,o+1);break;case "contentControl":{let s=i.children.find(l=>l.kind==="contentControlContent");s&&De(s)&&(a+=Ur(e,s.children,n,r,o+1));break}case "revisionInsert":case "revisionMoveTo":a+=Ur(e,i.children,n,r,o+1);break;case "revisionDelete":case "revisionMoveFrom":Gr(i,r,o);break;case "generic":if(chunkMXOO7KRI_cjs.na(i))a+=Ur(e,i.children,n,r,o+1);else {let s=chunkMXOO7KRI_cjs.Gd(i);s&&(a+=Ur(e,s,n,r,o+1));}break}return a}function hE(e,t){let n=Ye(me(t,"pStyle")),r=Gn(e.styles,n,"paragraph");for(let o=r.length-1;o>=0;o-=1){let a=chunkMXOO7KRI_cjs.Ie(r[o],"styleId",chunkMXOO7KRI_cjs.da),i=a?/^Heading([1-6])$/.exec(a):null;if(i)return {level:Number(i[1]),fromStyle:true}}if(n===void 0){let o=gt(Ye(me(t,"outlineLvl")));if(o!==null&&o>=0&&o<=5)return {level:o+1,fromStyle:false}}return null}function yE(e,t){let n=Gn(e.styles,Ye(me(t,"pStyle")),"paragraph");for(let r=n.length-1;r>=0;r-=1){let o=kh(chunkMXOO7KRI_cjs.Ie(n[r],"styleId",chunkMXOO7KRI_cjs.da));if(o!==null)return o}return null}function bx(e,t,n,r){let o=t.children.find(b=>b.kind==="paragraphProperties"),a=o&&De(o)?o:null,i=$u(e.styles,a,e.tablePPr),s=cE(i,n.asListItem),l=Ur(e,t.children,a,r),d=s===""?"":` style="${kn(s)}"`,u=Xn(i,"bidi")?' dir="rtl"':"",f=yE(e,a),p=f===null?"":` class="${f}"`,m=hE(e,a);if(n.asListItem)return `<li${m?.fromStyle===true?` class="Heading${m.level}"`:p}${u}${d}>${l}</li>`;let h=m===null?"p":`h${m.level}`,x=m===null?p:m.fromStyle?` class="Heading${m.level}"`:' class="docx-outline"';return `<${h}${x}${u}${d}>${l}</${h}>`}var bE={renderBlocks:(e,t,n)=>el(e,t,n),advanceFieldState:Gr};function el(e,t,n){let r="",o=[],a=null,i=new Map,s=n;if(s===void 0){let p={stack:[]};for(let m of t)De(m)&&Gr(m,p);s={stack:[],inert:p.stack.length>0};}let l=()=>{let p=o.pop();p&&(r+=`</${p.tag}>`);},d=()=>{for(;o.length>0;)l();a=null;},u=(p,m)=>{for(a!==null&&m.level<a&&d();o.length>0&&o[o.length-1].abstractId!==m.abstractId;)l();o.length===0&&(a=m.level);let h=a??m.level,x=m.level-h+1;for(;o.length>x;)l();for(o.length===x&&o[x-1].numId!==m.numId&&l();o.length<x;){let I=h+o.length,k=vx(e,m.numId,m.abstractId,I),E=i.get(`${m.abstractId}:${m.numId}:${I}`)??0,C=k.start+E,H=k.fmt==="bullet"?"ul":"ol",A=H==="ol"?Object.hasOwn(yx,k.fmt)?yx[k.fmt]:"decimal":null,w=H==="ol"&&C!==1?` start="${C}"`:"";r+=A?`<${H}${w} style="list-style-type:${kn(A)}">`:`<${H}>`,o.push({tag:H,numId:m.numId,abstractId:m.abstractId});}let b=`${m.abstractId}:${m.numId}:${m.level}`;i.set(b,(i.get(b)??0)+1);let y=`${m.abstractId}:`;for(let I of i.keys()){if(!I.startsWith(y))continue;let k=I.slice(I.lastIndexOf(":")+1);/^\d+$/.test(k)&&Number(k)>m.level&&i.delete(I);}r+=bx(e,p,{asListItem:true},s);},f=p=>{for(let m of p)if(De(m))switch(m.kind){case "paragraph":{let h=m.children.find(y=>y.kind==="paragraphProperties"),x=h&&De(h)?h:null,b=fE(e,$u(e.styles,x));b?u(m,b):(d(),r+=bx(e,m,{asListItem:false},s));break}case "table":d(),r+=mx(e,m,s,bE);break;case "contentControl":{let h=m.children.find(x=>x.kind==="contentControlContent");h&&De(h)&&f(h.children);break}case "generic":f(m.children);break;case "bookmarkStart":{let h=ln(chunkMXOO7KRI_cjs.Ie(m,"name",chunkMXOO7KRI_cjs.da));h!==null&&(r+=`<a id="${kn(h)}"></a>`);break}default:s.inert||Gr(m,s);break}};return f(t),d(),r}function Sx(e,t){let n=e.parts.get(e.mainDocumentPart);if(!n||!De(n.root))return "";let r=n.root.children.find(d=>d.kind==="body");if(!r||!De(r))return "";let o=ti(e,oE,"/word/footnotes.xml"),a=ti(e,aE,"/word/endnotes.xml"),i={pkg:e,styles:ex(e),numbering:nx(ti(e,rE,"/word/numbering.xml")),docRels:chunkMXOO7KRI_cjs.ic(e,e.mainDocumentPart),maxImageBytes:iE,maxTotalImageBytes:sE,imageBudget:{used:0},imageDataUris:new Map,noteOrdinals:{footnote:new Map,endnote:new Map},availableNotes:{footnote:zu(o,"footnote"),endnote:zu(a,"endnote")},noteBody:null},s=el(i,r.children),l=gx(i,{footnote:o,endnote:a},Gr);return s+ju(i,"footnote",o,l.footnote,el)+ju(i,"endnote",a,l.endnote,el)}var vE=12*1024*1024;function xE(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function SE(e){return `<div><table>${e.split(`
|
|
18
|
-
`).map(n=>`<tr>${n.split(" ").map(r=>`<td>${xE(r)}</td>`).join("")}</tr>`).join("")}</table></div>`}function Uu(e){if(e.cellRectangle)return {text:e.text,html:SE(e.text)};if(!e.coverage||!e.pkg)return {text:e.text,html:null};let t=chunkITNK6C5M_cjs.I(e.pkg,e.coverage);if(!t.ok)return {text:e.text,html:null};let n=e.maxFragmentBytes??vE,r=t.bytes;if(t.bytes.byteLength>n){let i=chunkITNK6C5M_cjs.I(e.pkg,e.coverage,{omitMedia:true});r=i.ok&&i.bytes.byteLength<=n?i.bytes:null;}let o;try{o=Sx(t.package);}catch(i){console.error("docx-editor: copy HTML flavour failed to render",i),o="";}let a=Ih(o,r?{bytes:r,lastMarkCovered:t.lastMarkCovered}:null);return {text:e.text,html:a}}function wx(e,t){let n=()=>t.text.length===0?"none":(e.insertPlainText(t.text),"plain");if(t.forcePlain||!e.richLaneOpen)return n();let r=t.html;if(r===null||r.length===0)return n();let o=ds(r);if(o&&e.pasteFragment(o.bytes,o.lastMarkCovered))return "fragment";let a=Ny(r);return a.ok&&a.truncated&&t.text.length>0?n():a.ok&&e.pasteFragment(a.fragmentBytes,a.lastMarkCovered)?"external-html":n()}function Ix(e,t,n,r,o){if(!o||t.paragraphId!==n.paragraphId||/[\r\n\t]/.test(r)||!chunkMXOO7KRI_cjs.Zh(e.settingsRoot()))return r;let a=Ue(e,t.paragraphId)??e.part();if(!chunkMXOO7KRI_cjs._h(a,t.paragraphId))return r;let i=chunkMXOO7KRI_cjs.Ha(a,t.paragraphId);if(i?.kind!=="paragraph")return r;let s=chunkMXOO7KRI_cjs.ph(i).find(b=>b.fieldNodeId===o&&b.start<=t.offset&&b.end>=n.offset);if(!s?.enabled||!chunkMXOO7KRI_cjs.nh(s)||s.maxLength<=0)return r;let l=(chunkMXOO7KRI_cjs.Di(a,t.paragraphId)??"").slice(s.start,s.end),d=l.slice(0,t.offset-s.start),u=l.slice(n.offset-s.start),f=d+u,p=b=>chunkMXOO7KRI_cjs.oh(d+b+u,s,f)<=s.maxLength;if(p(r))return r;let m=[...r],h=s.maxLength-[...f].length;if(s.type==="number"&&s.format)for(let b of f)(b===","&&s.format.includes(",")||b==="%"&&s.format.endsWith("%"))&&h++;let x=new Set;if(s.type==="date"){let b=0;for(let y=0;y<m.length;y++)if(/\S/.test(m[y])){if(++b>18)break;x.add(y+1);}else (y+1===m.length||/\S/.test(m[y+1]))&&x.add(y+1);}else if(s.type==="number"&&s.format)for(let b=1;b<=3;b++)x.add(h+b);for(let b of [...x].sort((y,I)=>I-y)){if(b<=Math.max(0,h)||b>m.length)continue;let y=m.slice(0,b).join("");if(p(y))return y}return m.slice(0,Math.max(0,h)).join("")}var wE=2e3;function kx(e){let{session:t}=e,n=null;function r(s){let l=qy(s),d=e.orderedRange(),u=Ix(t,d.from,d.to,l,e.textFormFieldId?.()??null).split(`
|
|
19
|
-
`),f=e.deleteSelectionPlan(),p=f.replaceAt??f.collapseTo,m=u.join(""),h=[...f.ops],x=e.consumePendingFormatOps(p.paragraphId,p.offset,m.length);m.length>0&&(h.push({op:"insertText",paragraphId:p.paragraphId,offset:p.offset,text:m}),h.push(...x));let b=[],y=0;for(let H=0;H<u.length-1;H+=1)y+=u[H].length,b.push(p.offset+y);if(b.length>0&&h.push({op:"splitParagraphMany",paragraphId:p.paragraphId,offsets:b}),h.length===0)return;let I=new Set(t.paragraphIdsIn(e.storyScope())),k=u[u.length-1],E=b.length===0?e.caretMark({paragraphId:p.paragraphId,offset:p.offset+k.length}):void 0,C=h.filter(H=>!x.includes(H));e.commit(()=>e.withoutPendingOnRejection(h,C,e.selectionMark(),E),()=>{if(b.length===0)return $e({paragraphId:p.paragraphId,offset:p.offset+k.length});let H=t.paragraphIdsIn(e.storyScope()).filter(w=>!I.has(w)),A=H[H.length-1];return A?$e({paragraphId:A,offset:k.length}):null});}function o(){e.flushPendingInputAndLayout();let s=e.cellSelection();if(s)return Uu({text:chunkWQFNWLNY_cjs.xa(e.layout(),s),cellRectangle:true,coverage:null,pkg:null});let{from:l,to:d}=e.orderedRange(),u=Ws(e.layout(),l,d,e.paragraphOrder()),f=e.storyScope();if(l.paragraphId===d.paragraphId&&l.offset===d.offset||f.kind!=="body")return {text:u,html:null};let m=t.part(),h=Ov(e.layout(),m,l,d,e.paragraphOrder());return Uu({text:u,cellRectangle:false,coverage:h,pkg:t.currentPackage()})}function a(s,l){if(e.editingMode()!=="edit"||e.storyScope().kind!=="body"||e.cellSelection())return false;e.flushPendingInputAndLayout();let d=e.deleteSelectionPlan(),u=d.replaceAt??d.collapseTo,f=false;return e.commit(()=>{let p=e.collaborationGate(d.ops,{kind:"body"});if(p)return {committed:false,rejected:true,opCount:0,reason:p};let m=e.actorId(),h=t.applyFragmentPaste({kind:"body"},{paragraphId:u.paragraphId,offset:u.offset,fragmentBytes:s,lastMarkCovered:l,priorOps:d.ops,...m!==void 0?{actorId:m}:{}});return f=h.ok,{committed:h.ok,rejected:!h.ok,opCount:h.ok?1:0,...h.ok?{}:{reason:h.detail??h.reason}}},()=>$e(u)),f}function i(s,l){let d=n!==null&&e.now()-n<wE;return n=null,wx({richLaneOpen:e.editingMode()==="edit"&&e.storyScope().kind==="body"&&e.cellSelection()===null,pasteFragment:(f,p)=>a(f,p),insertPlainText:r},{html:l,text:s,forcePlain:d})!=="none"}return {insertPlainText:r,copyFlavoursNow:o,pasteRichNow:i,armForcePlainPaste:()=>{n=e.now();}}}function Tx(e){let{session:t}=e;function n(){return jr(e.selection())}function r(){return e.flushPendingInputAndLayout(),js(e.layout(),e.selection(),e.paragraphOrder())}function o(){return r().from}function a(h){return chunkBNZF6DYC_cjs.re(e.layout(),h)}function i(h,x){let b=t.partFor(e.storyScope())??t.part(),y=chunkMXOO7KRI_cjs.Ha(b,h.paragraphId);if(!y||y.kind!=="paragraph")return null;let I=x==="before"?chunkMXOO7KRI_cjs.Ye(y,h.offset):chunkMXOO7KRI_cjs.Ze(y,h.offset);if(!I)return null;let k=chunkMXOO7KRI_cjs.Ke(b,I.controlId),E=k?chunkMXOO7KRI_cjs.Jc(k):null;return E&&(E.lock==="contentLocked"||E.lock==="sdtContentLocked"||E.type==="checkbox"||E.type==="picture")?I:null}function s(h){if(e.trackedAuthorOrNone()!==void 0||e.cellSelection())return false;let x=r();return x.from.paragraphId===x.to.paragraphId&&x.from.offset===x.to.offset?e.atParagraphEnd(h.paragraphId,h.offset):e.atParagraphEnd(x.to.paragraphId,x.to.offset)}function l(h){let x=h?.trim()||void 0,b=d(),y=e.cellSelection(),I=null;return {...b,get replaceAt(){return I??=p(b,x,y),I}}}function d(){e.flushPendingInputAndLayout();let h=e.cellSelection();if(h){let I=[];for(let k of chunkWQFNWLNY_cjs.ua(e.layout(),h.cellIds)){let E=chunkBNZF6DYC_cjs.re(e.layout(),k).length;E>0&&I.push({op:"deleteText",paragraphId:k,start:0,end:E});}return {ops:I,collapseTo:o()}}let x=e.selection();if(x.anchor.paragraphId===x.head.paragraphId&&x.anchor.offset===x.head.offset)return {ops:[],collapseTo:chunkBNZF6DYC_cjs.ae(e.layout(),x.head)};let{from:b,to:y}=r();return Fv(e.layout(),t.partFor(e.storyScope())??t.part(),b,y,e.paragraphOrder())}function u(){return l().ops}function f(h,x,b){if(!(b!==void 0||e.editingMode()==="suggest")||h.paragraphId!==x.paragraphId||x.offset<=h.offset)return h.offset;let I=(b??e.author())?.trim();if(!I)return chunkBNZF6DYC_cjs.ae(e.layout(),x).offset;let k=Ue(t,x.paragraphId)??t.part(),E=chunkMXOO7KRI_cjs.Ha(k,x.paragraphId);if(!E||E.kind!=="paragraph")return chunkBNZF6DYC_cjs.ae(e.layout(),x).offset;let C={start:h.offset,end:x.offset},{past:H,landing:A}=chunkMXOO7KRI_cjs.hg(E,C,x.offset,I,e.trackedDate()),w=chunkMXOO7KRI_cjs.eg(E,h.offset,H,I);return (H-h.offset>w?A:H)-w}function p(h,x,b){let y=h.collapseTo;if(x===void 0&&e.editingMode()!=="suggest")return y;if(b){for(let F of b.cellIds){let _=chunkWQFNWLNY_cjs.ta(e.layout(),[F]),$=_.length>0?_:chunkWQFNWLNY_cjs.ua(e.layout(),[F]);if($.length===0)continue;let Z=new Map,Y=ce=>{let D=Z.get(ce);return D===void 0&&(D=f({paragraphId:ce,offset:0},{paragraphId:ce,offset:a(ce).length},x),Z.set(ce,D)),D},oe=(x??e.author())?.trim(),ue=ce=>{let D=a(ce);if(!oe)return /\S/.test(D);let M=chunkMXOO7KRI_cjs.Ha(Ue(t,ce)??t.part(),ce);if(!M||M.kind!=="paragraph")return /\S/.test(D);let q="",z=0;for(let X of chunkMXOO7KRI_cjs.fg(M,0,D.length,oe))q+=D.slice(z,Math.max(z,X.start)),z=Math.max(z,X.end);return q+=D.slice(z),/\S/.test(q)},Te=null;for(let ce=$.length-1;ce>=0;ce-=1){let D=$[ce];if(ue(D)){Te=D;break}}if(Te===null)for(let ce=$.length-1;ce>=0;ce-=1){let D=$[ce];if(Y(D)!==0){Te=D;break}}return Te??=$[$.length-1],{paragraphId:Te,offset:Y(Te)}}return y}let{from:I,to:k}=r();if(I.paragraphId===k.paragraphId&&I.offset===k.offset)return y;if(I.paragraphId===k.paragraphId)return {paragraphId:k.paragraphId,offset:f(I,k,x)};let E=new Set(h.ops.flatMap(F=>F.op==="deleteBlock"?[F.blockId]:[])),C=Ue(t,k.paragraphId)??t.part();if(E.size>0)for(let F=chunkMXOO7KRI_cjs.Ia(C,k.paragraphId);F;F=chunkMXOO7KRI_cjs.Ia(C,F.id)){if(!E.has(F.id))continue;let _={paragraphId:y.paragraphId,offset:a(y.paragraphId).length};return {paragraphId:y.paragraphId,offset:f(y,_,x)}}let H=(x??e.author())?.trim();if(!H)return y;let A=new Set(h.ops.flatMap(F=>F.op==="joinParagraphs"?[F.secondId]:[])),w=e.paragraphOrder(),P=w.indexOf(I.paragraphId),R=w.indexOf(k.paragraphId);if(P===-1||R===-1)return y;let N=F=>{let _=chunkMXOO7KRI_cjs.Ha(C,F);return _?.kind==="paragraph"&&chunkMXOO7KRI_cjs.Mh(_,H)},B=R;for(;B>P&&A.has(w[B])&&N(w[B-1]);)B-=1;let U=0;for(let F=B;F<=R;F+=1){let _=w[F],$={paragraphId:_,offset:_===I.paragraphId?I.offset:0},Z=_===k.paragraphId?chunkBNZF6DYC_cjs.ae(e.layout(),k):{paragraphId:_,offset:a(_).length};F===B&&(U+=$.offset),U+=Z.offset-$.offset-m($,Z,H);}return {paragraphId:w[B],offset:U}}function m(h,x,b){let y=b?.trim();if(!y||h.paragraphId!==x.paragraphId)return 0;let I=Ue(t,x.paragraphId)??t.partFor(e.storyScope())??t.part(),k=chunkMXOO7KRI_cjs.Ha(I,x.paragraphId);return !k||k.kind!=="paragraph"?0:chunkMXOO7KRI_cjs.eg(k,h.offset,x.offset,y)}return {selectionMark:n,orderedRange:r,orderedStart:o,textOf:a,inlineControlBeside:i,splitEndsTheParagraph:s,deleteSelectionPlan:l,deleteSelectionOps:u,replacementOffset:f}}function Cx(e){return {atParagraphEnd(t,n){let r=chunkMXOO7KRI_cjs.Di(e.partOf(t),t);return r!==null&&n===r.length},followerStyleId(t){let n=e.partOf(t),r=e.styleCascade();if(!r)return;let a=chunkITNK6C5M_cjs.ra(n,t).find(l=>l.localName==="pStyle")?.attributes?.val??r.defaultParagraphStyleId;if(a==null)return;let i=r.styles.get(a)?.next;if(!i||i===a)return;let s=r.styles.get(i);if(!(!s||s.type!=="paragraph"))return i===r.defaultParagraphStyleId?null:i}}}var Px=chunkBNZF6DYC_cjs.zc;function Rx(e){let{session:t,...n}=e;return chunkBNZF6DYC_cjs.pd({view:t,...n})}function Zt(e){return e.closest(".docx-editor__scroll-container")}function Ex(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 Ox(e,t,n){let r=Zt(e);if(!r||r.clientHeight<=0||t.pages.length===0||n<=0)return null;let o=Ex(e,r,n),a=o.top+o.height/2;for(let i of t.pages)if(a<i.box.y+i.box.height)return i.index+1;return t.pages.length}function Fx(e,t,n,r){let o=Zt(e);if(!o||o.clientHeight===0)return;let a=Ex(e,o,r),i=[];for(let s of [n.anchor,n.head]){let l=chunkBNZF6DYC_cjs.ne(t,s);l&&i.push(l.pageIndex);}return chunkWQFNWLNY_cjs.qa({layout:t,viewport:a,overscanPages:1,pinnedPages:i})}function Gu(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 tl(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,a=0;for(let s of o)a=Math.max(a,s.box.x+s.box.width);let i=new Map;if(new Set(o.map(s=>s.box.width)).size>1)for(let s of e.pages)i.set(s.index,(a-s.box.width)/2-s.box.x);return {width:a,height:r,pageOffsetX:i}}function Mx(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 Lx(e){if(typeof e.defaultView?.createImageBitmap!="function")return null;let t=e.defaultView;return Object.freeze({async decode(n,r,o){let a=new Blob([new Uint8Array(n)],{type:r}),i;try{i=await t.createImageBitmap(a,{imageOrientation:"from-image"});}catch(s){if(s?.name!=="TypeError")throw s;i=await t.createImageBitmap(a);}try{let s=i.width,l=i.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{i.close();}},convertPreserved(n,r,o){return r==="image/tiff"?TE(e,n,o):IE(n,r)}})}async function IE(e,t,n){let{convertEmfToDataUrl:r,convertWmfToDataUrl:o}=await import('emf-converter'),a=new Uint8Array(e),i=a.buffer.slice(a.byteOffset,a.byteOffset+a.byteLength),s={maxWidth:4096,maxHeight:4096},l=t==="image/x-emf"?await r(i,s):await o(i,s);if(!l)return null;let d="data:image/png;base64,";if(!l.startsWith(d))return null;let u=atob(l.slice(d.length)),f=new Uint8Array(u.length);for(let p=0;p<u.length;p+=1)f[p]=u.charCodeAt(p);return Object.freeze({bytes:f,mime:"image/png"})}function Ax(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 kE(e,t){let n=await import('utif2'),r=n.default??n,o=e.slice().buffer,a=r.decode(o)[0];if(!a)return null;let i=Ax(a,"t256"),s=Ax(a,"t257");if(i===null||s===null||i>t.maxDimension||s>t.maxDimension||i>t.maxPixels/s)return null;let l=i*s;if(l*4>t.maxDecodedBytes||(r.decodeImage(o,a),a.width!==i||a.height!==s))return null;let d=r.toRGBA8(a);return d.length!==l*4?null:Object.freeze({rgba:d,pixelWidth:i,pixelHeight:s})}async function TE(e,t,n){let r=await kE(t,n);if(r===null)return null;let o=await CE(e,r.rgba,r.pixelWidth,r.pixelHeight);return o===null?null:Object.freeze({bytes:o,mime:"image/png"})}async function CE(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 a=o.getContext("2d");if(!a)return null;let i=a.createImageData(n,r);i.data.set(t),a.putImageData(i,0,0);let s=await new Promise(l=>{o.toBlob(d=>l(d),"image/png");});return s?new Uint8Array(await s.arrayBuffer()):null}function Nx(){return Object.freeze({async decode(){throw new Error("Image decode unavailable in headless environment")}})}function Dx(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 nl(e,t){let n=(r,o)=>{for(let a of r){if(a.kind==="paragraph"){t(a,o);continue}for(let i of a.rows)if(!i.isHeaderRepeat)for(let s of i.cells)n(s.blocks,true);}};n(e.fragments,false),e.header&&n(e.header.fragments,false),e.footer&&n(e.footer.fragments,false);for(let r of [e.footnotes,e.endnotes])if(r)for(let o of r.notes)n(o.fragments,false);}function rl(e,t,n){e.has(t.paragraphId)||e.set(t.paragraphId,n);for(let r of t.lines)for(let o of chunkBNZF6DYC_cjs.Q(r))e.has(o.paragraphId)||e.set(o.paragraphId,n);}var Hx=new WeakMap,_x=new WeakMap;function PE(e,t){let n=_x.get(e);if(!n){let r=new Map;for(let o of e.pages)nl(o,a=>{a.emptyParagraphStyle&&rl(r,a,a.emptyParagraphStyle);});n=r,_x.set(e,n);}return n.get(t)}var Bx=new WeakMap;function RE(e){let t=Bx.get(e);if(t)return t;let n=new Map;return nl(e,r=>rl(n,r,r.props)),Bx.set(e,n),n}function Eo(e,t){let n=Hx.get(e);if(!n){n=new Map;for(let r of e.pages)for(let[o,a]of RE(r))n.has(o)||n.set(o,a);Hx.set(e,n);}return n.get(t)??[]}var $x=new WeakMap;function EE(e){let t=$x.get(e);if(t)return t;let n=new Map;return nl(e,r=>rl(n,r,r.tabStops)),$x.set(e,n),n}function ri(e,t){let n=qx.get(e);if(!n){let r=new Map;for(let o of e.pages)for(let[a,i]of EE(o))r.has(a)||r.set(a,i);n=r,qx.set(e,r);}return n.get(t)??null}var qx=new WeakMap,Zx=new WeakMap,Kx=new WeakMap;function OE(e){let t=Kx.get(e);if(t)return t;let n=new Map;return nl(e,(r,o)=>rl(n,r,{indent:r.indent,inTable:o})),Kx.set(e,n),n}function FE(e,t){let n=Zx.get(e);if(!n){let r=new Map;for(let o of e.pages)for(let[a,i]of OE(o))r.has(a)||r.set(a,i);n=r,Zx.set(e,r);}return n.get(t)??null}function zx(e,t,n,r,o=chunkITNK6C5M_cjs.ja,a){let i=chunkMXOO7KRI_cjs.Ha(e,t);if(!i||i.kind!=="paragraph")return false;for(let s of chunkITNK6C5M_cjs.la(i,chunkITNK6C5M_cjs.va(i),n,r,o,a))if(chunkITNK6C5M_cjs.qa(chunkITNK6C5M_cjs.pa(s.run,"runProperties","rPr"),chunkITNK6C5M_cjs.na).length>0)return true;return false}function ol(e,t,n,r=chunkITNK6C5M_cjs.ja,o){let a=chunkMXOO7KRI_cjs.Ha(e,t);if(!a||a.kind!=="paragraph")return [];let i=chunkITNK6C5M_cjs.va(a),s=null,l=null;for(let u of chunkITNK6C5M_cjs.ka(a,r,o)){let f=i.get(u.id);!f||f.end<=f.start||(f.start<n&&n<=f.end&&(s=u),l===null&&f.start<=n&&n<f.end&&(l=u));}let d=s??l;return d?chunkITNK6C5M_cjs.qa(chunkITNK6C5M_cjs.pa(d,"runProperties","rPr"),chunkITNK6C5M_cjs.na):chunkITNK6C5M_cjs.sa(e,t)}function Ro(e,t,n){let r=e?.find(a=>a.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 jx(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:Ro(t,"b")===true};break;case "i":n={...n,italic:Ro(t,"i")===true};break;case "u":n={...n,underline:Ro(t,"u")===true};break;case "strike":n={...n,strikethrough:Ro(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 a=Number(o);Number.isFinite(a)&&(n={...n,fontSizeHalfPoints:a});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 Xu(e,t,n,r){return n&&n.length>0?chunkWQFNWLNY_cjs.va(e,n):chunkBNZF6DYC_cjs.ve(e,t,r??chunkBNZF6DYC_cjs.W(e))}function al(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 il(e,t,n,r){return Xu(e,t,n,r)[0]?.style??null}function Yu(e,t,n,r,o,a){let i=Xu(e,t,r,a);if(i.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 i.every(s)}function Wx(e,t,n,r,o,a,i){let s=Xu(e,t,r,a),l=s.length===0?Vx(e,t,r,a).map(_=>PE(e,_)).filter(_=>_!==void 0):[],d=l.length>0?l:s.map(_=>_.style),u=_=>{if(d.length===0)return null;let $=_(d[0]);return d.every(Z=>_(Z)===$)?$:null},f=(_,$=(Z,Y)=>Z===Y)=>_.length>0&&_.every(Z=>$(Z,_[0]))?_[0]:null,p=(_,$)=>_.props.some(Z=>Z.localName===$),m=_=>_.style.fontFamily??n?.(_.range.paragraphId,_.props).fontFamily??null,h=_=>p(_,"sz")?Math.round(_.style.fontSizePt*2):n?.(_.range.paragraphId,_.props).fontSizeHalfPoints??Math.round(_.style.fontSizePt*2),x=l.length>0?{fontFamily:u(_=>_.fontFamily??i??null),fontSizeHalfPoints:u(_=>Math.round(_.fontSizePt*2))}:s.length===0?n?.(t.head.paragraphId,[]):void 0,b=Vx(e,t,r,a),y=_=>f(b.map($=>_(Eo(e,$)))),I=(_,$=(Z,Y)=>Z===Y)=>{if(b.length<2)return false;let Z=_(Eo(e,b[0]));return b.some((Y,oe)=>oe>0&&!$(_(Eo(e,Y)),Z))},k=y(_=>chunkBNZF6DYC_cjs.Na(_)),E=y(_=>chunkBNZF6DYC_cjs.jb(_,"pStyle")?.val??o??void 0)??null,C=_=>chunkBNZF6DYC_cjs.jb(_,"spacing")??void 0,H=_=>{let $=C(_),Z=Number($?.line);if(!Number.isFinite(Z))return "";let Y=$?.lineRule??"auto";return Y==="auto"?`multiple:${Math.round(Z/240*100)/100}`:`${Y==="exact"?"exact":"atLeast"}:${Math.round(Z/20*100)/100}`},A=y(H),w=(()=>{if(!A)return null;let[_,$]=A.split(":");return {rule:_,value:Number($)}})(),P=(_,$)=>{let Z=Number(C(_)?.[$]);return Number.isFinite(Z)?Math.round(Z/20*100)/100:null},R=_=>y($=>P($,_)),N=(()=>{let _=b.map(D=>FE(e,D)),$=_[0];if(!$||_.some(D=>D===null||D.inTable))return null;let Z=D=>Math.round(D*20),Y=D=>Z(D.hanging>0?-D.hanging:D.firstLine),oe=_,ue=Z($.indent.left),Te=Z($.indent.right),ce=Y($.indent);return {left:ue,right:Te,firstLine:ce,mixed:{left:oe.some(D=>Z(D.indent.left)!==ue),right:oe.some(D=>Z(D.indent.right)!==Te),firstLine:oe.some(D=>Y(D.indent)!==ce)}}})(),B=_=>y($=>_(chunkBNZF6DYC_cjs.ud($))),U=y(chunkBNZF6DYC_cjs.cb),F=y(chunkBNZF6DYC_cjs.nb);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:s.length>0?f(s.map(m)):x?.fontFamily??null,fontSizeHalfPoints:s.length>0?f(s.map(h)):x?.fontSizeHalfPoints??null,color:u(_=>_.color),highlight:u(_=>_.highlight),alignment:k,styleId:E,lineSpacing:w,spaceBeforePt:R("before"),spaceAfterPt:R("after"),disagrees:{alignment:I(_=>chunkBNZF6DYC_cjs.Na(_)),spaceBeforePt:I(_=>P(_,"before")),spaceAfterPt:I(_=>P(_,"after")),lineSpacing:I(H),tabStops:(()=>{if(b.length<2)return false;let _=JSON.stringify(ri(e,b[0])?.stops??null);return b.some(($,Z)=>Z>0&&JSON.stringify(ri(e,$)?.stops??null)!==_)})()},indent:N,tabStops:f(b.map(_=>ri(e,_)?.stops??null),(_,$)=>_===null||$===null?_===$:_.length===$.length&&_.every((Z,Y)=>Math.round(Z.positionPt*20)===Math.round($[Y].positionPt*20)&&Z.alignment===$[Y].alignment&&(Z.leader??"none")===($[Y].leader??"none")))?.map(_=>({positionTwips:Math.round(_.positionPt*20),alignment:_.alignment,..._.leader?{leader:_.leader}:{}}))??null,paragraphFlags:{contextualSpacing:F,keepNext:B(_=>_.keepNext),keepLines:B(_=>_.keepLines),widowControl:B(_=>_.widowControl),pageBreakBefore:U}}}function Vx(e,t,n,r){if(n&&n.length>0)return [...chunkWQFNWLNY_cjs.ua(e,n)];if(t.anchor.paragraphId===t.head.paragraphId)return [t.head.paragraphId];let o=r??chunkBNZF6DYC_cjs.W(e),a=o.indexOf(t.anchor.paragraphId),i=o.indexOf(t.head.paragraphId);return a===-1||i===-1?[t.head.paragraphId]:o.slice(Math.min(a,i),Math.max(a,i)+1)}function Ux(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}]}var ME="docx-editor-one-surface__caret",Qu="docx-editor-one-surface__caret--steady",AE=530;function Gx(e,t,n){let r=e.ownerDocument,o=r.createElement("div");o.className=ME,o.dataset.docxCaret="",o.dataset.docxMarker="",o.setAttribute("contenteditable","false"),o.setAttribute("aria-hidden","true"),o.dataset.noColorInvert="",o.style.position="absolute",o.style.pointerEvents="none",o.style.userSelect="none",o.style.setProperty("-webkit-user-select","none");let a=false,i=null,s=null,l=null;function d(){let I=r.activeElement;return I===e||!!I&&e.contains(I)}function u(I){return I.anchor.paragraphId===I.head.paragraphId&&I.anchor.offset===I.head.offset}function f(){s=null,i!==null&&(clearTimeout(i),i=null),o.classList.remove(Qu),o.remove(),e.style.removeProperty("caret-color"),l?.style.removeProperty("caret-color"),l=null;}function p(){o.classList.add(Qu),i!==null&&clearTimeout(i),i=setTimeout(()=>{i=null,o.classList.remove(Qu);},AE);}function m(){if(a||!d()||n().suppress){f();return}let{layout:I,selection:k,scopedHost:E,scopedHostKind:C,preferredPageIndex:H,measurer:A,typingStyle:w}=n(),P=t();if(!u(k)){f();return}let R=chunkBNZF6DYC_cjs.ne(I,k.head,{...A?{measurer:A}:{},...H!==void 0?{preferredPageIndex:H}:{}});if(!R||!Number.isInteger(R.pageIndex)){f();return}if(w&&A){let{pageIndex:_,lineId:$}=R,Z=chunkBNZF6DYC_cjs._d(I).get(k.head.paragraphId)?.find(oe=>oe.pageIndex===_&&oe.line.id===$),Y=Z?.line;if(Y&&!Y.drawings?.length&&!chunkBNZF6DYC_cjs.Nc(R)){let oe=w();if(oe){let ue={...il(I,k)??chunkBNZF6DYC_cjs.h,...oe},Te=A.lineMetrics(ue);if(Te.height>0){let ce=chunkBNZF6DYC_cjs.Vc({...R,width:0,y:Y.spans.length>0?Y.box.y+Y.baseline-Te.baseline-chunkBNZF6DYC_cjs.m(ue):R.y,height:Te.height},Z?.clipBox);if(!ce){f();return}R=ce;}}}}let N=E??e.querySelector(`[data-page-index="${R.pageIndex}"] > .docx-page-content`);if(!N){f();return}if(!(R.height>0)){f();return}o.style.left=`${R.x*P}px`,o.style.top=`${R.y*P}px`,o.style.height=`${R.height*P}px`;let B=chunkBNZF6DYC_cjs.Nc(R);o.style.transformOrigin=B?"0 0":"",o.style.transform=B?"rotate(-90deg)":"",o.parentNode!==N&&N.append(o),e.style.caretColor="transparent",l&&l!==E&&l.style.removeProperty("caret-color"),l=E??null,l?.style.setProperty("caret-color","transparent");let U=N===E?C??"scoped":"body",F=`${R.pageIndex}:${U}:${R.x}:${R.y}:${R.height}`;F!==s&&(s=F,p());}let h=()=>{a=true,m();},x=()=>{a=false,m();},b=()=>m(),y=I=>{let k=I.relatedTarget;k&&e.contains(k)||f();};return e.addEventListener("compositionstart",h),e.addEventListener("compositionend",x),e.addEventListener("focusin",b),e.addEventListener("focusout",y),{update:m,destroy(){e.removeEventListener("compositionstart",h),e.removeEventListener("compositionend",x),e.removeEventListener("focusin",b),e.removeEventListener("focusout",y),f();}}}function Ju(e){let t=e.indexOf("#");return t===-1?"":e.slice(0,t)}function Xr(e,t){let n=Ju(t);return n.length===0?e.part():e.currentPackage().parts.get(n)??e.part()}function ef(e,t){return !e||e.kind==="tableBody"?null:Ju(e.tableId)===Ju(t)?e:null}function oi(e,t,n){let r=i=>{for(let s of i)if(s.kind==="table"){if(s.tableId===t)return s;for(let l of s.rows)for(let d of l.cells){let u=r(d.blocks);if(u)return u}}return null},o=e.pages[n];if(!o)return null;let a=r(o.fragments);if(a)return {table:a,origin:o.contentBox};for(let i of [o.header,o.footer]){if(!i)continue;let s=r(i.fragments);if(s)return {table:s,origin:i.box}}return null}function tf(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)tf(o.blocks,t);}}function LE(e,t){for(let n of e.pages){let r=o=>{for(let a=0;a<o.rows.length;a+=1)t({table:o,row:o.rows[a],rowIndex:a});};tf(n.fragments,r);for(let o of [n.header,n.footer])o&&tf(o.fragments,r);}}function nf(e,t,n,r){let o=null;return LE(e,a=>{a.table.tableId===t&&a.row.id===n&&a.row.isHeaderRepeat===r&&(o=a);}),o}function rf(e,t){return {sourceRevision:e,tableId:t.table.tableId,rowId:t.row.id,isHeaderRepeat:t.row.isHeaderRepeat}}function Xx(e,t,n){let r=n.gridColumnId;return r?{sourceRevision:e,tableId:t.table.tableId,gridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}:null}function Yx(e,t,n,r){return {sourceRevision:e,tableId:t.table.tableId,leftGridColumnId:n,rightGridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}}function Qx(e,t,n){return {sourceRevision:e,tableId:t.table.tableId,gridColumnId:n,isHeaderRepeat:t.row.isHeaderRepeat}}var NE=120,Jx=20;function sl(e){let t=chunkMXOO7KRI_cjs.Bh(e,"w"),n=t?Number.parseInt(t,10):Number.NaN;return Number.isFinite(n)?n:0}function DE(e,t,n){let r=e.pagesLayer.getBoundingClientRect(),o=e.scale();return {x:(t-r.left)/o,y:(n-r.top)/o}}function of(e){let t=e.editingMode==="view";return {editable:!t,viewing:t}}function af(e,t){return t.kind==="insertColumn"?nf(e,t.tableId,t.rowId,t.isHeaderRepeat):"rowId"in t?nf(e,t.tableId,t.rowId,t.isHeaderRepeat):null}function eS(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=null,r=null,o=null,a=null,i=null,s=null,l=false,d=0,u=0,f=null,p=null,m=null;function h(O){return O instanceof HTMLButtonElement&&(O.classList.contains("docx-table-insert-row")||O.classList.contains("docx-table-insert-column"))}function x(){let O=document.activeElement;return O!==null&&h(O)&&O.closest(".docx-table-furniture")===t?O:null}function b(O){for(let V of [...t.children])h(V)&&V!==O&&V.remove();}function y(){p=null,m=null;}function I(){n!==null&&(clearTimeout(n),n=null);}function k(){for(let V of [...t.children])h(V)||V.remove();let O=x();if(!O){b(null),y();return}p=O,b(O);}function E(O){let V=p??x(),j=V!==null&&document.activeElement===V;y(),t.replaceChildren(),O&&j&&e.pagesLayer.focus({preventScroll:true});}function C(){for(let O of [...t.children])h(O)||O.remove();}function H(O,V,j,ee){let te=e.read().layout.pages[O];if(!te)return {left:0,top:0};let le=ee??te.contentBox,fe=e.scale(),we=e.pageOffsetX(O);return {left:(le.x+V+we)*fe,top:(le.y+j)*fe}}function A(O,V){let j=e.read(),ee=oi(j.layout,V.tableId,V.pageIndex);if(!ee)return;let{table:ne,origin:te}=ee,le=document.createElement("div");le.className="docx-table-resize-preview",le.style.position="absolute",le.style.pointerEvents="none";let fe=V.kind!=="rowDivider",we=H(V.pageIndex,fe?ne.box.x+O:ne.box.x,fe?ne.box.y:ne.box.y+O,te);le.style.left=`${we.left}px`,le.style.top=`${we.top}px`,le.style.width=fe?"2px":`${ne.box.width*e.scale()}px`,le.style.height=fe?`${ne.box.height*e.scale()}px`:"2px",t.append(le);}function w(){let O=document.createElement("button");return O.type="button",O.textContent="+",O.style.position="absolute",O.style.pointerEvents="auto",O}function P(O){U(O);let V=m;if(!V)return;let j=e.read();V.kind==="insertRow"?_(V,j):V.kind==="insertColumn"&&$(V,j);}function R(){queueMicrotask(()=>{!p||document.activeElement===p||l||r?.kind==="insertRow"||r?.kind==="insertColumn"||(p.remove(),y());});}function N(){if(p&&t.contains(p))return p;let O=x();if(O)return p=O,O;let V=w();return V.addEventListener("pointerenter",()=>{l=true,I();}),V.addEventListener("pointerleave",()=>{l=false;}),V.addEventListener("pointerdown",U),V.addEventListener("mousedown",U),V.addEventListener("click",P),V.addEventListener("blur",R),p=V,V}function B(O,V){let j=oi(V.layout,O.tableId,O.pageIndex);if(!j)return;let{table:ee,origin:ne}=j,te=N();if(b(te),m=O,te.dataset.tableId=O.tableId,O.kind==="insertRow"){let le=ee.rows.find(ot=>ot.id===O.rowId);if(!le)return;te.dataset.rowId=O.rowId,delete te.dataset.gridColumnId,te.className="docx-table-insert-row",te.setAttribute("aria-label",e.label("table.insertRowBelow"));let fe=le.box.y+le.box.height/2,we=H(O.pageIndex,ee.box.x-14,fe,ne);te.style.left=`${we.left}px`,te.style.top=`${we.top-8}px`;}else {let le=ee.rows[0]?.cells.find(Oe=>Oe.gridColumnId===O.gridColumnId);if(!le)return;te.dataset.gridColumnId=O.gridColumnId,delete te.dataset.rowId;let fe=ee.columnEdges[le.gridColumn]??0,we=ee.columnEdges[le.gridColumn+1]??ee.box.width;te.className="docx-table-insert-column",te.setAttribute("aria-label",e.label("table.insertColumnRight"));let ot=H(O.pageIndex,ee.box.x+(fe+we)/2-8,ee.box.y-14,ne);te.style.left=`${ot.left}px`,te.style.top=`${ot.top}px`;}t.contains(te)||t.append(te);}function U(O){O.preventDefault(),O.stopPropagation();}function F(O,V){if(C(),b(p??x()),!(s||V.editingMode==="view")){if((O.kind==="columnDivider"||O.kind==="rightEdge")&&!O.isHeaderRepeat){let j=oi(V.layout,O.tableId,O.pageIndex);if(!j)return;let{table:ee,origin:ne}=j,te=document.createElement("div");te.className=O.kind==="rightEdge"?"docx-table-edge-handle-right layout-table-edge-handle-right":"docx-table-divider-handle layout-table-resize-handle",te.style.position="absolute",te.style.pointerEvents="auto",te.style.cursor="col-resize",te.dataset.active="true";let le=H(O.pageIndex,ee.box.x+O.edgeX,ee.box.y,ne);te.style.left=`${le.left-3}px`,te.style.top=`${le.top}px`,te.style.width="6px",te.style.height=`${ee.box.height*e.scale()}px`,te.addEventListener("pointerdown",Z),t.append(te);}if(O.kind==="rowDivider"&&!O.isHeaderRepeat){let j=oi(V.layout,O.tableId,O.pageIndex);if(!j)return;let{table:ee,origin:ne}=j,te=document.createElement("div");te.className="docx-table-row-divider-handle layout-table-row-resize-handle",te.style.position="absolute",te.style.pointerEvents="auto",te.style.cursor="row-resize",te.dataset.active="true";let le=H(O.pageIndex,ee.box.x,ee.box.y+O.edgeY,ne);te.style.left=`${le.left}px`,te.style.top=`${le.top-3}px`,te.style.width=`${ee.box.width*e.scale()}px`,te.style.height="6px",te.addEventListener("pointerdown",Z),t.append(te);}O.kind==="insertRow"&&!O.isHeaderRepeat&&B(O,V),O.kind==="insertColumn"&&!O.isHeaderRepeat&&B(O,V);}}function _(O,V){let j=af(V.layout,O);if(!j)return;let ee=of(V),ne=Wn({command:{type:"insertRow",where:"below",target:rf(O.sourceRevision,j)},part:Xr(e.session(),O.tableId),layout:V.layout,storeRevision:V.storeRevision,selection:V.selection,cellSelection:V.cellSelection,themeColors:V.themeColors,...ee});e.applyTableCommandPlan(ne);}function $(O,V){let j=af(V.layout,O);if(!j)return;let ee=j.row.cells.find(fe=>fe.gridColumnId===O.gridColumnId);if(!ee)return;let ne=Xx(O.sourceRevision,j,ee);if(!ne)return;let te=of(V),le=Wn({command:{type:"insertColumn",where:"right",target:ne},part:Xr(e.session(),O.tableId),layout:V.layout,storeRevision:V.storeRevision,selection:V.selection,cellSelection:V.cellSelection,themeColors:V.themeColors,...te});e.applyTableCommandPlan(le);}function Z(O){if(O.button!==0)return;let V=e.read();if(V.editingMode==="view"||!r||r.kind!=="columnDivider"&&r.kind!=="rightEdge"&&r.kind!=="rowDivider")return;O.preventDefault(),O.stopPropagation();let j=r,ee=af(V.layout,j);if(!ee)return;let ne=chunkMXOO7KRI_cjs.Dh(Xr(e.session(),j.tableId).root,j.tableId);if(!ne.ok||j.kind!=="rowDivider"&&ne.topology.hasMerge)return;let te=0,le=0,fe=0,we=ne.topology.gridColumns.reduce((_e,Re)=>_e+sl(Re),0),ot;if(j.kind==="columnDivider"){let _e=ne.topology.gridColumns.find(Fe=>Fe.id===j.leftGridColumnId),Re=ne.topology.gridColumns.find(Fe=>Fe.id===j.rightGridColumnId);if(!_e||!Re)return;te=sl(_e),le=sl(Re),ot=Yx(j.sourceRevision,ee,j.leftGridColumnId,j.rightGridColumnId);}else if(j.kind==="rightEdge"){let _e=ne.topology.gridColumns.find(Re=>Re.id===j.gridColumnId);if(!_e)return;te=sl(_e),le=0,ot=Qx(j.sourceRevision,ee,j.gridColumnId);}else fe=Math.max(20,Math.round(ee.row.box.height*Jx)),ot=rf(j.sourceRevision,ee);let Oe=O.currentTarget;Oe.setPointerCapture(O.pointerId),d=O.clientX,u=O.clientY,s={pointerId:O.pointerId,startClientX:O.clientX,startClientY:O.clientY,startEdgePt:j.kind==="rowDivider"?j.edgeY:j.edgeX,leftTwips:te,rightTwips:le,tableWidthTwips:we,rowHeightTwips:fe,target:j,ref:ee,resizeTarget:ot,captureElement:Oe,rightEdge:j.kind==="rightEdge",vertical:j.kind==="rowDivider",cancelled:false};for(let _e of [...t.children])_e!==Oe&&_e.remove();A(j.kind==="rowDivider"?j.edgeY:j.edgeX,j);}function Y(){if(s){try{s.captureElement.hasPointerCapture(s.pointerId)&&s.captureElement.releasePointerCapture(s.pointerId);}catch{}s.cancelled=true,s=null,k(),r=null;}}function oe(){if(!s||s.cancelled){s=null,k();return}let O=s;s=null;try{O.captureElement.hasPointerCapture(O.pointerId)&&O.captureElement.releasePointerCapture(O.pointerId);}catch{}if(O.vertical?u===O.startClientY:d===O.startClientX){k();return}let V=e.read(),j=of(V),ee=(O.vertical?u-O.startClientY:d-O.startClientX)/e.scale(),ne=Math.round(ee*Jx),te;if(O.target.kind==="rowDivider")te=Ib({part:Xr(e.session(),O.target.tableId),layout:V.layout,storeRevision:V.storeRevision,selection:V.selection,cellSelection:V.cellSelection,themeColors:V.themeColors,...j},O.resizeTarget,Math.max(20,O.rowHeightTwips+ne));else if(O.rightEdge&&O.target.kind==="rightEdge"){let le=Math.max(300,O.leftTwips+ne),fe=Math.max(le,O.tableWidthTwips+ne);te=Wn({command:{type:"commitTableRightEdgeResize",target:O.resizeTarget,columnWidthTwips:le,tableWidthTwips:fe},part:Xr(e.session(),O.target.tableId),layout:V.layout,storeRevision:V.storeRevision,selection:V.selection,cellSelection:V.cellSelection,themeColors:V.themeColors,...j});}else if(O.target.kind==="columnDivider"){let le=O.leftTwips+ne,fe=O.rightTwips-ne;le=Math.max(300,le),fe=Math.max(300,fe);let we=O.leftTwips+O.rightTwips;le+fe!==we&&(le>we-300?(le=we-300,fe=300):fe=we-le),te=Wn({command:{type:"commitTableColumnDividerResize",target:O.resizeTarget,leftWidthTwips:le,rightWidthTwips:fe},part:Xr(e.session(),O.target.tableId),layout:V.layout,storeRevision:V.storeRevision,selection:V.selection,cellSelection:V.cellSelection,themeColors:V.themeColors,...j});}else {k();return}e.applyTableCommandPlan(te),k();}function ue(O){if(!o||!f)return null;let V=e.pageOffsetX(f.pageIndex);return chunkBNZF6DYC_cjs.jd(o,f.x,f.y,O.layout,V,f.pageIndex)}function Te(O){if(!r||s||O.editingMode==="view")return;I();let V=ue(O),j=ef(V,O.selection.head.paragraphId);if(!j){r=null,k();return}if(chunkBNZF6DYC_cjs.hd(j)!==chunkBNZF6DYC_cjs.hd(r)){r=null,k();return}r=j,F(j,O);}function ce(){let O=p??x(),V=O!==null&&document.activeElement===O;y(),O&&t.contains(O)&&O.remove(),V&&e.pagesLayer.focus({preventScroll:true});}function D(O){if(s||O.editingMode==="view")return;let V=p??x();if(!V||!t.contains(V)){m&&y();return}if(p=V,!m||m.kind!=="insertRow"&&m.kind!=="insertColumn")return;if(!o){ce();return}let j=chunkBNZF6DYC_cjs.hd(m),ee=chunkBNZF6DYC_cjs.id(o,m);if(!ee||chunkBNZF6DYC_cjs.hd(ee)!==j){ce();return}m=ee,B(ee,O);}function M(O){let V=e.read();if(s&&O.pointerId===s.pointerId){d=O.clientX,u=O.clientY;let fe=(s.vertical?O.clientY-s.startClientY:O.clientX-s.startClientX)/e.scale();for(let we of [...t.children])we!==s.captureElement&&we.remove();A(s.startEdgePt+fe,s.target);return}if(V.editingMode==="view"){E(false);return}let j=DE(e,O.clientX,O.clientY),ee=chunkBNZF6DYC_cjs.Xc(V.layout,j.y);ee>=0&&(f={x:j.x,y:j.y,pageIndex:ee});let ne=ee>=0?e.pageOffsetX(ee):0,te=o?chunkBNZF6DYC_cjs.jd(o,j.x,j.y,V.layout,ne,ee>=0?ee:void 0):null,le=ef(te,V.selection.head.paragraphId);if(!le){if(l)return;!n&&r&&(n=setTimeout(()=>{n=null,r=null,k();},NE));return}n&&(clearTimeout(n),n=null),!(r&&chunkBNZF6DYC_cjs.gd(le)===chunkBNZF6DYC_cjs.gd(r))&&(r=le,F(le,V));}function q(O){if(!(!s||O.pointerId!==s.pointerId)){if(e.read().editingMode==="view"){Y();return}oe();}}function z(O){!s||O.pointerId!==s.pointerId||Y();}function X(O){O.key!=="Escape"||!s||Y();}return e.pagesLayer.addEventListener("pointermove",M),document.addEventListener("pointermove",M),document.addEventListener("pointerup",q),document.addEventListener("pointercancel",z),e.pagesLayer.addEventListener("keydown",X),{update(){let O=e.read(),V=a,j=i;o=chunkBNZF6DYC_cjs.fd(O.layout),a=O.layout.revision,i=O.storeRevision,O.editingMode==="view"?(Y(),r=null,I(),E(true)):V!==null&&(V!==O.layout.revision||j!==O.storeRevision)&&(r!==null&&Te(O),D(O)),t.style.width=e.pagesLayer.style.width,t.style.height=e.pagesLayer.style.height;},refreshLabels(){let O=e.read();if(O.editingMode==="view")return;let V=p??x();if(V&&t.contains(V)&&m&&(m.kind==="insertRow"||m.kind==="insertColumn")){B(m,O);return}r&&(r.kind==="insertRow"||r.kind==="insertColumn")&&B(r,O);},destroy(){I(),Y(),y(),k(),e.pagesLayer.removeEventListener("pointermove",M),document.removeEventListener("pointermove",M),document.removeEventListener("pointerup",q),document.removeEventListener("pointercancel",z),e.pagesLayer.removeEventListener("keydown",X),t.remove();}}}function tS(e){let{session:t,commit:n,orderedRange:r,selectionMark:o,textOf:a}=e,i=()=>e.displayMode(),s=()=>e.authorFilter(),l=()=>t.partFor(e.storyScope())??t.part(),d=(y,I,k)=>t.applyTreeOps(y,I,k,e.storyScope()),u=()=>{let y=e.runFormatRefusal?.();return y?(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:y})),true):false},f={get value(){return e.layout()}},p={get value(){return e.selection()}},m=(y,I,k)=>{let E=l();if(y.paragraphId===I.paragraphId){let P=chunkITNK6C5M_cjs.za(E,y.paragraphId,y.offset,I.offset,k,i(),s());if(P.length===0)return;let R=chunkITNK6C5M_cjs.ya(E,y.paragraphId,k);n(()=>d([...P.map(N=>({op:"setRunProperties",paragraphId:y.paragraphId,start:N.start,end:N.end,properties:N.properties,...N.targetRunIds?{targetRunIds:N.targetRunIds}:{}})),...e.paragraphMarkVisible(y.paragraphId)?Ux(a(y.paragraphId),y,I,R):[]],o()));return}let C=e.paragraphOrder(),H=C.indexOf(y.paragraphId),A=C.indexOf(I.paragraphId);if(H===-1||A===-1)return;let w=[];for(let P=H;P<=A;P+=1){let R=C[P],N=a(R),B=P===H?y.offset:0,U=P===A?I.offset:N.length,F=B<U?chunkITNK6C5M_cjs.za(E,R,B,U,k,i(),s()):[];for(let $ of F)w.push({op:"setRunProperties",paragraphId:R,start:$.start,end:$.end,properties:$.properties,...$.targetRunIds?{targetRunIds:$.targetRunIds}:{}});(P<A||B===0&&U===N.length&&N.length>0)&&e.paragraphMarkVisible(R)&&w.push({op:"setParagraphMarkProperties",paragraphId:R,properties:chunkITNK6C5M_cjs.ya(E,R,k)});}w.length!==0&&n(()=>d(w,o()));},h=(y,I)=>{let k=l(),E=[];for(let C of chunkWQFNWLNY_cjs.ua(f.value,y)){let H=a(C);for(let A of chunkITNK6C5M_cjs.za(k,C,0,H.length,I,i(),s()))E.push({op:"setRunProperties",paragraphId:C,start:A.start,end:A.end,properties:A.properties,...A.targetRunIds?{targetRunIds:A.targetRunIds}:{}});e.paragraphMarkVisible(C)&&E.push({op:"setParagraphMarkProperties",paragraphId:C,properties:chunkITNK6C5M_cjs.ya(k,C,I)});}return E.length===0?false:(n(()=>d(E,o()),void 0,{keepCellSelection:true}),true)},x=y=>{chunkITNK6C5M_cjs.oa(y.localName)&&e.setPendingFormats(chunkITNK6C5M_cjs.ta(e.pendingFormats()??[],y));},b=y=>{if(y.length===0)return;let I=e.selectedCells?.(),k=I&&I.length>0?[...chunkWQFNWLNY_cjs.ua(f.value,I)]:null,{from:E,to:C}=r(),H=k??e.paragraphOrder(),A=k?0:H.indexOf(E.paragraphId),w=k?H.length-1:H.indexOf(C.paragraphId);if(A===-1||w===-1)return;let P=l(),R=H.slice(A,w+1).filter(N=>e.paragraphMarkVisible(N)).map(N=>{let B=chunkITNK6C5M_cjs.ra(P,N);for(let U of y){let F=U.mergeAttributes?{...B.find($=>$.localName===U.localName)?.attributes??{},...U.attributes}:U.attributes??{},_=Object.fromEntries(Object.entries(F).filter(([,$])=>$!=null));B=chunkITNK6C5M_cjs.ta(B,{localName:U.localName,...Object.keys(_).length>0?{attributes:_}:{}});}return {op:"setParagraphProperties",paragraphId:N,properties:B}});R.length!==0&&n(()=>d(R,o()),void 0,{keepCellSelection:k!==null});};return {setRunProperty(y,I){if(u())return;let k={localName:y,...I?{attributes:I}:{}},E=e.selectedCells?.();if(E&&E.length>0){h(E,k);return}let{from:C,to:H}=r();if(C.paragraphId===H.paragraphId&&C.offset===H.offset){x(k);return}m(C,H,k);},setParagraphProperty(y,I,k){b([{localName:y,...I?{attributes:I}:{},...k??{}}]);},setParagraphProperties:b,formatting:()=>jx(Wx(f.value,p.value,(y,I)=>{let k=t.effectiveRunDefaults(y,I);if(k.fontFamily!==null)return k;let E=e.defaultFontFamily?.()??null;return E===null?k:{...k,fontFamily:E}},e.selectedCells?.(),e.defaultParagraphStyleId?.()??null,e.paragraphOrder(),e.defaultFontFamily?.()??null),e.pendingFormats()),toggleRunProperty(y,I){if(u())return;let k=e.selectedCells?.(),E=I?.val,C=Ro(e.pendingFormats(),y,E)??Yu(f.value,p.value,y,k,E,e.paragraphOrder()),H=C?{localName:y,attributes:{val:HE[y]??"0"}}:{localName:y,...I?{attributes:I}:{}};if(k&&k.length>0){h(k,H);return}let{from:A,to:w}=r();if(A.paragraphId===w.paragraphId&&A.offset===w.offset){let P=e.pendingFormats()??[],R=Yu(f.value,p.value,y,void 0,E,e.paragraphOrder());if(!C===R){let N=P.filter(B=>B.localName!==y);e.setPendingFormats(N.length>0?N:null);}else x(H);return}m(A,w,H);},clearFormatting(){if(u())return;e.setPendingFormats(null);let y=f.value,I=e.paragraphOrder(),k=e.selectedCells?.(),E=k&&k.length>0?[...chunkWQFNWLNY_cjs.ua(y,k)]:al(I,r());if(E.length===0)return;let{from:C,to:H}=r(),A=k!==void 0&&k.length>0,w=l(),P=[];for(let R of E){let N=a(R),B=A||R!==C.paragraphId?0:C.offset,U=A||R!==H.paragraphId?N.length:H.offset;for(let F of chunkITNK6C5M_cjs.Aa(w,R,B,U,i(),s()))zx(w,R,F.start,F.end,i(),s())&&P.push({op:"setRunProperties",paragraphId:R,start:F.start,end:F.end,properties:[]});e.paragraphMarkVisible(R)&&chunkITNK6C5M_cjs.sa(w,R).length>0&&P.push({op:"setParagraphMarkProperties",paragraphId:R,properties:[]}),e.paragraphMarkVisible(R)&&chunkITNK6C5M_cjs.ra(w,R).length>0&&P.push({op:"setParagraphProperties",paragraphId:R,properties:[]});}P.length!==0&&n(()=>d(P,o()),void 0,{keepCellSelection:A});}}}var HE={u:"none",vertAlign:"baseline"};var _E=new Set,nS=500;function BE(e){let t=o=>({val:o?"1":"0"}),n=String(Math.max(2,Math.min(3276,Math.round(e.fontSizePt*2)))),r=[{localName:"b",attributes:t(e.bold)},{localName:"i",attributes:t(e.italic)},{localName:"bCs",attributes:t(e.bold)},{localName:"iCs",attributes:t(e.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:n}},{localName:"szCs",attributes:{val:n}},{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))}}];return (e.fontFamily||e.fontFamilyEastAsia)&&r.push({localName:"rFonts",attributes:{...e.fontFamily?{ascii:e.fontFamily,hAnsi:e.fontFamily}:{},...e.fontFamilyEastAsia?{eastAsia:e.fontFamilyEastAsia}:{}}}),r}function rS(e){let t=e.session,n=()=>t.partFor(e.storyScope())??t.part(),r="off",o=null,a=null,i=null,s=Ss,l=()=>{let b=o===null?"none":o.paragraphProperties?"paragraph":"run";return (s.mode!==r||s.level!==b)&&(s={mode:r,level:b}),s},d=(b,y,I)=>{if(I||b.paragraphId!==y.paragraphId||b.offset===y.offset)return true;let k=e.textOf(b.paragraphId);return b.offset===0&&y.offset===k.length&&k.length>0},u=()=>{let b=e.selectedCells?.(),y=b!==void 0&&b.length>0,{from:I,to:k}=e.orderedRange();if(!e.paragraphOrder().includes(I.paragraphId))return false;let E=il(e.layout(),e.selection(),b,e.paragraphOrder()),C=d(I,k,y)?chunkITNK6C5M_cjs.ra(n(),I.paragraphId):null;return !E&&C===null?false:(o={runProperties:E?BE(E):[],paragraphProperties:C},true)},f=()=>u()?(e.publish(),true):false,p=()=>{let b=o;if(!b)return {wrote:false,armed:false,built:false};let y=e.selectedCells?.(),I=y!==void 0&&y.length>0,{from:k,to:E}=e.orderedRange(),C=!I&&k.paragraphId===E.paragraphId&&k.offset===E.offset,H=C?zs(e.layout(),k,_E):null,A=H?.from??k,w=H?.to??E,P=C&&A.offset===w.offset,R=I?[...chunkWQFNWLNY_cjs.ua(e.layout(),y)]:al(e.paragraphOrder(),{from:A,to:w});if(R.length===0)return {wrote:false,armed:false,built:false};let N=n(),B=e.displayMode(),U=[];for(let Z of R){let Y=e.textOf(Z),oe=I||Z!==A.paragraphId?0:A.offset,ue=I||Z!==w.paragraphId?Y.length:w.offset;if(oe<ue&&b.runProperties.length>0)for(let D of chunkITNK6C5M_cjs.za(N,Z,oe,ue,b.runProperties,B,e.authorFilter()))U.push({op:"setRunProperties",paragraphId:Z,start:D.start,end:D.end,properties:D.properties,...D.targetRunIds?{targetRunIds:D.targetRunIds}:{}});let Te=b.paragraphProperties!==null||I||Z!==w.paragraphId||oe===0&&ue===Y.length&&Y.length>0,ce=e.paragraphMarkVisible(Z);Te&&ce&&b.runProperties.length>0&&U.push({op:"setParagraphMarkProperties",paragraphId:Z,properties:chunkITNK6C5M_cjs.ya(N,Z,b.runProperties)}),b.paragraphProperties&&ce&&U.push({op:"setParagraphProperties",paragraphId:Z,properties:[...b.paragraphProperties]});}let F=t.packageRevision();U.length>0&&e.commit(()=>t.applyTreeOps(U,e.selectionMark(),void 0,e.storyScope()),void 0,{keepCellSelection:I});let _=t.packageRevision()!==F,$=P&&b.runProperties.length>0&&(_||U.length===0);return $&&e.armPendingFormats(b.runProperties),{wrote:_,armed:$,built:U.length>0}},m=()=>{let b=p();return b.wrote&&r==="once"&&x(),b.wrote?"painted":b.armed?"armed":b.built?"refused":"nothingToPaint"},h=()=>{r!=="off"&&(r="off",e.publish());},x=()=>{a=null,i=null,h();};return {state:l,capture:f,apply:m,disarm:x,press(){let b=e.now(),y=a!==null&&b-a<nS,I=r;a=b;let k=()=>(a=null,false);return I==="once"&&y?u()?(r="locked",e.publish(),true):(h(),k()):I!=="off"?(h(),i=I==="locked"?b:null,true):i!==null&&b-i<nS?(i=null,true):u()?(r="once",i=null,e.publish(),true):k()},applyIfArmed(){r==="off"||o===null||p().wrote&&r==="once"&&x();}}}var $E=500,oS=4,Oo=40,ll=12;function qE(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),a=Math.min(e.y+e.height,t.y+t.height);return o<=n||a<=r?0:(o-n)*(a-r)}function aS(e,t){return qE(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 Jt(e,t,n){let r=chunkBNZF6DYC_cjs.V(e),o=r.indexOf(t.paragraphId),a=r.indexOf(n.paragraphId);return o!==a?o-a:t.offset-n.offset}function sS(e,t,n){if(!(t>chunkBNZF6DYC_cjs.Pc))for(let r of e){if(r.kind==="paragraph"){n(r);continue}if(!(t>=chunkBNZF6DYC_cjs.Pc)){for(let o of r.rows)if(!o.isHeaderRepeat)for(let a of o.cells)sS(a.blocks,t+1,n);}}}function sf(e,t){if(!t.placeholder||t.fragments.length===0)return null;let n=null,r=null,o=(i,s)=>{(!n||Jt(e,i,n)<0)&&(n=i),(!r||Jt(e,s,r)>0)&&(r=s);},a=t.level!=="inline";for(let i of t.fragments){let s=e.pages[i.pageIndex];s&&sS(s.fragments,0,l=>{if(aS(i.box,l.box)){if(a){let d=chunkBNZF6DYC_cjs.re(e,l.paragraphId).length;o({paragraphId:l.paragraphId,offset:0},{paragraphId:l.paragraphId,offset:d});return}for(let d of l.lines)for(let u of d.spans)aS(i.box,u.box)&&o({paragraphId:u.range.paragraphId,offset:u.range.start},{paragraphId:u.range.paragraphId,offset:u.range.end});}});}return !n||!r?null:{from:n,to:r}}function ZE(e,t){return (e.contentControls??[]).find(n=>n.id===t)??null}function iS(e,t){let n=t.contentControlId;if(!n){let o={x:t.caret.x,y:t.caret.y+t.caret.height/2},a=chunkBNZF6DYC_cjs.ad(e,t.pageIndex,o);return a?.placeholder?a:null}let r=ZE(e,n);return r?.placeholder?r:null}function dl(e,t){let n=e.contentControls??[];if(n.length===0)return t;let r=Jt(e,t.anchor,t.head)<=0?t.anchor:t.head,o=Jt(e,t.anchor,t.head)<=0?t.head:t.anchor,a=true;for(;a;){a=false;for(let s of n){if(!s.placeholder)continue;let l=sf(e,s);!l||!(Jt(e,r,o)===0?Jt(e,r,l.from)>=0&&Jt(e,r,l.to)<0:Jt(e,r,l.to)<0&&Jt(e,o,l.from)>0)||(Jt(e,l.from,r)<0&&(r=l.from,a=true),Jt(e,l.to,o)>0&&(o=l.to,a=true));}}return Jt(e,t.anchor,t.head)<=0?{anchor:r,head:o}:{anchor:o,head:r}}var KE=new Set(["dropdown","comboBox","date","buildingBlockGallery"]);function lS(e,t={}){if(t.mode==="native")return {dragging:()=>false,destroy:()=>{}};let{pagesLayer:n,container:r}=e,o=n.ownerDocument,a=o.defaultView,i=null,s=null,l=0,d=0,u=0,f=0,p=null;function m(M,q){if(!s){let X=n.getBoundingClientRect();s={left:X.left,top:X.top};}let z=e.scale()||1;return {x:(M-s.left)/z,y:(q-s.top)/z}}function h(M){return {scope:{kind:"headerFooter",rId:M.rId},pageIndex:M.pageIndex,kind:M.kind,partName:M.partName,variant:M.variant}}function x(M,q){let z=e.layout(),X=m(M,q),O=chunkBNZF6DYC_cjs.Xc(z,X.y),V=z.pages[O];if(!V)return null;let j=e.measurer();return chunkBNZF6DYC_cjs.Zc(z,O,{x:X.x-V.contentBox.x-e.pageOffsetX(O),y:X.y-V.contentBox.y},j?{measurer:j}:{})}function b(M,q){let z=e.activeNote?.()??null;if(z){let ee=e.layout(),ne=kc(ee,m(M,q),e.pageOffsetX);if(!ne||ne.scopeId!==z.scopeId)return null;let te=e.measurer();return chunkBNZF6DYC_cjs._c(ee,ne.pageIndex,ne.fragments,ne.local,{...te?{measurer:te}:{}})}let X=e.activeHeaderFooter?.()??null;if(!X)return x(M,q);let O=e.layout(),V=m(M,q),j=Cc(O,V,e.pageOffsetX);if(j&&vc(j.story,h(X))){let ee=e.measurer();return Sc(O,j.pageIndex,j.story,j.local,ee?{measurer:ee}:{})}return null}function y(M,q){let{story:z,pageIndex:X,kind:O}=M;return {rId:z.rId,pageIndex:X,kind:O,partName:z.partName,variant:z.variant,...q?{position:q}:{}}}function I(M){let q=e.measurer();return Sc(e.layout(),M.pageIndex,M.story,M.local,q?{measurer:q}:{})?.position??void 0}let k=new WeakMap;function E(M,q){let z=e.activeNote?.();if(z){let j=xo(M,null,z.scopeId).indexOf(q);return j===-1?-1:j}let X=e.activeHeaderFooter?.();if(X){let j=xo(M,h(X)).indexOf(q);return j===-1?-1:j}let O=k.get(M);return O||(O=new Map(chunkBNZF6DYC_cjs.V(M).map((V,j)=>[V,j])),k.set(M,O)),O.get(q)??-1}function C(M,q,z){let X=E(M,q.paragraphId),O=E(M,z.paragraphId);return X!==O?X<O:q.offset<z.offset}function H(M,q,z){if(z==="character")return {from:q,to:q};let X=q.paragraphId;if(z==="paragraph"){let O=chunkBNZF6DYC_cjs.re(M,X);return {from:{paragraphId:X,offset:0},to:{paragraphId:X,offset:O.length}}}return zs(M,q,chunkBNZF6DYC_cjs.se(M,X))}function A(M,q,z,X,O){let V=O?iS(M,O):null,j=V?sf(M,V)??H(M,z,X):H(M,z,X),ee=C(M,j.from,q.from)?{anchor:q.to,head:j.from}:{anchor:q.from,head:j.to};return dl(M,ee)}let w=r.closest(".docx-editor__scroll-container");function P(){return r.closest(".docx-editor__scroll-container")}function R(M,q,z){if(z<M+Oo){let X=Math.max(0,M+Oo-z);return -Math.min(ll,X/Oo*ll)}if(z>q-Oo){let X=Math.max(0,z-(q-Oo));return Math.min(ll,X/Oo*ll)}return 0}function N(){p!==null&&(a?.cancelAnimationFrame(p),p=null);}function B(){p=null;let M=i,q=P();if(!M||!q||!a)return;let z=q.getBoundingClientRect(),X=R(z.top,z.bottom,M.clientY);X!==0&&(q.scrollTop+=X,s=null,F(M.clientX,M.clientY),p=a.requestAnimationFrame(B));}function U(){if(p!==null||!a||!i)return;let M=P();if(!M)return;let q=M.getBoundingClientRect();R(q.top,q.bottom,i.clientY)!==0&&(p=a.requestAnimationFrame(B));}function F(M,q){let z=i;if(!z)return;let X=b(M,q);X&&((e.isReadOnlyPosition?.(X.position)??e.isReadOnlyParagraph?.(X.position.paragraphId))||_(z,X)||e.setSelection(A(e.layout(),z.anchorRange,X.position,z.granularity,X)));}function _(M,q){let z=M.anchorCell;if(!z)return false;if(!q.cell||q.cell.tableId!==z.tableId)return M.cellDragging;if(!M.cellDragging&&q.cell.cellId===z.cellId)return false;let X=chunkWQFNWLNY_cjs.sa(e.layout(),z,q.cell);return X?(M.cellDragging=true,e.setCellSelection(X),true):M.cellDragging}function $(M){let q=Date.now(),z=q-d;return l=Math.abs(M.clientX-u)<=oS&&Math.abs(M.clientY-f)<=oS&&z>=0&&z<=$E?l+1:1,d=q,u=M.clientX,f=M.clientY,l}let Z=["character","word","paragraph"],Y=M=>{if(M.button!==0)return;if(e.onChangeBarToggle&&M.target?.closest?.("[data-docx-change-bar-toggle]")){M.preventDefault(),M.stopPropagation(),e.onChangeBarToggle();return}let q=M.target?.closest?.("[data-docx-cc-widget]");if(q){if(M.preventDefault(),M.stopPropagation(),q.hasAttribute("disabled")||q.dataset.disabledReason)return;let Ee=q.dataset.docxCcId,he=q.dataset.docxCcWidget;Ee&&he&&e.onContentControlWidget?.(Ee,he);return}if(M.pointerType==="touch")return;i&&ce(),s=null;let z=e.layout(),X=m(M.clientX,M.clientY),O=e.activeHeaderFooter?.()??null,V=e.activeNote?.()??null,j=Cc(z,X,e.pageOffsetX),ee=kc(z,X,e.pageOffsetX),ne=M.target?.closest("[data-docx-hf]"),te=!!(ne||j),le=M.target,fe=le?.closest("[data-docx-note-ref]"),we=le?.closest("[data-docx-note-mark-back]"),ot=null,Oe=()=>ot??=$(M);if(fe?.dataset.docxNoteScope){M.preventDefault(),e.focus(),e.enterNote?.(fe.dataset.docxNoteScope);return}if(we){M.preventDefault(),e.focus(),e.exitNote?.(true);return}if(ee&&!te){let Ee=e.measurer?.(),he=chunkBNZF6DYC_cjs._c(z,ee.pageIndex,ee.fragments,ee.local,{...Ee?{measurer:Ee}:{}});if(!V||V.scopeId!==ee.scopeId){M.preventDefault(),e.focus(),e.enterNote?.(ee.scopeId,he?{paragraphId:he.position.paragraphId,offset:he.position.offset}:void 0,ee.pageIndex);return}if(V.pageIndex!==ee.pageIndex){M.preventDefault(),e.focus(),e.enterNote?.(ee.scopeId,he?{paragraphId:he.position.paragraphId,offset:he.position.offset}:void 0,ee.pageIndex);return}}else if(V){if(!xc(z,X,e.pageOffsetX))return;e.exitNote?.(false),e.focus();}if(O)if(j&&vc(j.story,h(O)))j.pageIndex!==O.pageIndex&&e.enterHeaderFooter?.(y(j,I(j)));else if(j&&j.story.rId){M.preventDefault(),e.focus(),e.enterHeaderFooter?.(y(j,I(j)));return}else if(xc(z,X,e.pageOffsetX)){M.preventDefault(),e.exitHeaderFooter?.(true),e.focus();return}else {let Ee=Oe()>=2?Tc(z,X,e.pageOffsetX):null;Ee&&(M.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(Ee.kind,Ee.pageIndex));return}else if(te&&Oe()>=2){if(j?.story.rId)M.preventDefault(),e.focus(),e.enterHeaderFooter?.(y(j,I(j)));else if(ne instanceof HTMLElement){let Ee=ne.dataset.docxRId,he=ne.dataset.docxHf,Ve=ne.closest("[data-page-index]")?.getAttribute("data-page-index"),Le=Ve!=null?Number(Ve):NaN;if((he==="header"||he==="footer")&&Number.isInteger(Le))if(Ee){let ze=z.pages[Le]?.[he];M.preventDefault(),e.focus(),e.enterHeaderFooter?.({rId:Ee,pageIndex:Le,kind:he,partName:ze?.partName??"",variant:ze?.variant??"default"});}else z.pages[Le]?.[he]||(M.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(he,Le));}return}else if(Oe()>=2){let Ee=Tc(z,X,e.pageOffsetX);if(Ee){M.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(Ee.kind,Ee.pageIndex);return}}let _e=b(M.clientX,M.clientY);if(!_e)return;if(e.isReadOnlyPosition?.(_e.position)??e.isReadOnlyParagraph?.(_e.position.paragraphId)){M.preventDefault();return}if(Oe()===2&&e.onTextFormDoubleClick?.(M))return;M.preventDefault(),e.focus();try{n.setPointerCapture(M.pointerId);}catch{}o.addEventListener("pointermove",ue),o.addEventListener("pointerup",Te),o.addEventListener("pointercancel",Te);let Re=Oe(),Fe=M.shiftKey?"character":Z[(Re-1)%Z.length],Ge=iS(z,_e);if(Ge&&!M.shiftKey){let Ee=()=>{Re===1&&KE.has(Ge.controlType)&&e.onContentControlWidget?.(Ge.id,Ge.controlType);};if(e.selectContentControl?.(Ge.id)){let Ve=e.selection(),Le=C(z,Ve.anchor,Ve.head)||Ve.anchor.paragraphId===Ve.head.paragraphId&&Ve.anchor.offset===Ve.head.offset?{from:Ve.anchor,to:Ve.head}:{from:Ve.head,to:Ve.anchor};i={pointerId:M.pointerId,granularity:"character",anchorRange:Le,anchorCell:_e.cell,cellDragging:false,clientX:M.clientX,clientY:M.clientY},Ee();return}let he=sf(z,Ge);if(he){i={pointerId:M.pointerId,granularity:"character",anchorRange:he,anchorCell:_e.cell,cellDragging:false,clientX:M.clientX,clientY:M.clientY},oe(()=>e.setSelection({anchor:he.from,head:he.to})),Ee();return}}if(M.shiftKey){let Ee=e.selection();i={pointerId:M.pointerId,granularity:Fe,anchorRange:{from:Ee.anchor,to:Ee.anchor},anchorCell:_e.cell,cellDragging:false,clientX:M.clientX,clientY:M.clientY},oe(()=>e.setSelection(A(z,{from:Ee.anchor,to:Ee.anchor},_e.position,Fe,_e)));}else {let Ee=H(z,_e.position,Fe);i={pointerId:M.pointerId,granularity:Fe,anchorRange:Ee,anchorCell:_e.cell,cellDragging:false,clientX:M.clientX,clientY:M.clientY},oe(()=>e.setSelection(dl(z,{anchor:Ee.from,head:Ee.to})));}};function oe(M){try{M();}catch(q){throw ce(),q}}let ue=M=>{let q=i;!q||M.pointerId!==q.pointerId||(M.preventDefault(),q.clientX=M.clientX,q.clientY=M.clientY,F(M.clientX,M.clientY),U());},Te=M=>{let q=i;if(!q||M.pointerId!==q.pointerId)return;ce();try{n.releasePointerCapture(q.pointerId);}catch{}let z=e.cellSelection();z?e.setCellSelection(z):e.setSelection(e.selection()),M.type==="pointerup"&&(e.onTextFormPointerUp?.(M),e.onSelectionSettled?.());};function ce(){if(i)try{n.releasePointerCapture(i.pointerId);}catch{}i=null,s=null,N(),o.removeEventListener("pointermove",ue),o.removeEventListener("pointerup",Te),o.removeEventListener("pointercancel",Te);}let D=()=>{s=null;};return n.addEventListener("pointerdown",Y),w?.addEventListener("scroll",D,{passive:true}),a?.addEventListener("scroll",D,{capture:true,passive:true}),a?.addEventListener("resize",D,{passive:true}),{dragging:()=>i!==null,destroy(){ce(),n.removeEventListener("pointerdown",Y),w?.removeEventListener("scroll",D),a?.removeEventListener("scroll",D,{capture:true}),a?.removeEventListener("resize",D);}}}function dS(e,t,n){let r=e??chunkBNZF6DYC_cjs.Y;return {view:()=>r,projection:()=>chunkBNZF6DYC_cjs.X(r),changeBars:()=>t?r==="all-markup"||r==="simple-markup"?r:"none":"all-markup",set:o=>{r=o;},filter:o=>t&&chunkBNZF6DYC_cjs.X(r)!=="all-markup"?chunkBNZF6DYC_cjs.Z(o):o,toggleByChangeBar:()=>{t&&n(r==="simple-markup"?"all-markup":"simple-markup");}}}function cS(e){let{document:t,pagesLayer:n,session:r}=e,o=false,a=null,i;function s(A){let w=Wr(A?.anchorNode,n)??Wr(A?.focusNode,n);w!==void 0&&(i=w);}function l(A){return i??Wr(A?.anchorNode,n)??Wr(A?.focusNode,n)}let d=false,u=false,f=false,p=null,m=false;function h(){let A=t.getSelection(),w=To(n,A);return !w||(s(A),qt(w,e.selection()))?false:(e.adoptSelection(w),true)}function x(){let A=t.activeElement;if(A&&n.contains(A))return true;if(A&&A!==t.body&&A!==t.documentElement)return false;let w=t.getSelection();if(!w||w.rangeCount===0)return true;let P=w.anchorNode;return !P||!P.isConnected?true:n.contains(P)}let b=()=>{let A=t.getSelection(),w=To(n,A);if(!w){if(!Hu(n,A))return;d=false;let P=$e(e.selection().head);if(qt(P,e.selection()))return;e.setSelection(P);return}d=false,s(A),!qt(w,e.selection())&&e.setSelection(w);};function y(A){let w=e.textOf(A),P=Qv(n,A,w,t.getSelection()?.anchorNode??null);if(P===null)return;let R=Jv(A,w,P);if(!R)return;let N=R.ops.find(Z=>Z.op==="deleteText"),B=R.ops.find(Z=>Z.op==="insertText"),U=B&&N?e.replacementOffset?.(A,N.start,N.end):void 0,F=B&&U!==void 0&&U!==B.offset?R.ops.map(Z=>Z===B?{...B,offset:U}:Z):R.ops,_=B?e.pendingFormatOps?.(A,U??B.offset,B.text.length,N?{start:N.start,end:N.end}:void 0)??[]:[],$=e.storyScope();e.commit(()=>{let Z=e.applyOps([...F,..._],e.selectionMark(),$);return _.length===0||!Z.rejected?Z:e.applyOps(F,e.selectionMark(),$)}),e.setSelection($e({paragraphId:A,offset:B&&U!==void 0?U+B.text.length:R.caret}));}function I(){o||f||e.isGesturing?.()||e.holdsCellSelection?.()||k()||d&&b();}function k(){if(!u||d)return false;if(!a)return true;let A=To(n,t.getSelection());return A!==null&&qt(A,a)}function E(A){A instanceof PointerEvent&&A.button!==0||(d=true);}let C=false;function H(A=false){if(e.updateCaret(),!A&&!x())return;o=true;let w=e.now(),P=e.domSelection?.()??e.selection();d=false;let R=t.getSelection(),N=l(R),B=Bv(n,P,R,N!==void 0?{preferredPageIndex:N}:void 0);B&&s(R),a=B?P:null,B||(u=true),e.recordSelectionMs(e.now()-w),queueMicrotask(()=>{o=false;});}return n.addEventListener("pointerdown",E,true),n.addEventListener("selectstart",E,true),{adoptBeforePaint(){let A=e.holdsCellSelection?.()===true||e.isGesturing?.()===true||e.hasPendingInput?.()===true,w=u||A||!d?false:h();return e.hasPendingInput?.()!==true&&(u=false),w},noteModelMoved(){u=true;},noteSelectionSettled(){u=false;},mirrorToDom:H,adoptBeforeInput:I,isComposing:()=>f,noteBrowserSelectionFixup(){C=true;},onSelectionChange:()=>{if(!o&&!f&&!e.isGesturing?.()&&!e.holdsCellSelection?.()){if(C&&Hu(n,t.getSelection())){let A=To(n,t.getSelection());if((A===null||!qt(A,e.selection()))&&(C=false,!d)){H();return}}k()||b();}},onCompositionStart:()=>{I(),f=true;let A=e.selection();m=A.anchor.paragraphId!==A.head.paragraphId,p=A.head.paragraphId,r.beginComposition(e.storyScope());},onCompositionEnd:A=>{f=false;let w=p??e.selection().head.paragraphId;p=null;let P=m;m=false;let R=e.storyScope(),N=r.revisionFor(R);if(P){let B=A?.data??"";B.length>0&&e.replaceSelectionWith?.(B);}else y(w);r.endComposition(),r.revisionFor(R)===N&&e.discardPaint?.(),e.flushToPaint()||e.render();},selectionPageIndex:()=>i,destroy(){n.removeEventListener("pointerdown",E,true),n.removeEventListener("selectstart",E,true),d=false;}}}var VE=32;function fS(e,t,n,r){if(!(e.kind==="textValue"||r>VE)){if(e.kind==="paragraph"){n.has(e.id)||n.set(e.id,t);return}for(let o of e.children)fS(o,t,n,r+1);}}function WE(e){let t=chunkBNZF6DYC_cjs.Ha(e),n=chunkBNZF6DYC_cjs.cc(e),r=new Map;for(let o=0;o<n.length;o+=1){let a=n[o];for(let i=a.blockStart;i<a.blockEndExclusive;i+=1){let s=t[i];s&&fS(s,o,r,0);}}return r}var uS=new WeakMap;function UE(e){return !(!e.story||e.origin===chunkMXOO7KRI_cjs.b.mutationUndo||e.origin===chunkMXOO7KRI_cjs.b.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.includes(chunkMXOO7KRI_cjs.g.section))}function GE(e,t){t.story&&t.story.kind!=="body"||UE(t)||(e.map=null);}function XE(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>GE(t,n)));}function YE(e,t){let n=uS.get(e);return n||(n={map:null,subscribed:false},uS.set(e,n)),XE(e,n),n.map||(n.map=WE(t)),n.map}function pS(e,t,n){return n.startsWith(`${t.name}#`)?YE(e,t).get(n)??null:null}var mS=32;function ai(e,t,n,r,o="all-markup",a){let i=e.part(),s=chunkBNZF6DYC_cjs.cc(i,o,a);if(s.length<=1)return 0;let l=chunkBNZF6DYC_cjs.dc(i,o,a),d=p=>{let m=l.indexOf(p);if(m!==-1)return m;let h=l.findIndex(x=>x>p);return h===-1?Math.max(0,l.length-1):h},u=lf(e,t);if(u!==null)return d(u);if(n.kind==="headerFooter"){if(r!==void 0&&s[r]!==void 0)return r;let p=e.headerFooterResolutionBySection().findIndex(m=>[m.headers,m.footers].some(h=>[...h.values()].some(x=>x.rId===n.rId)));return p===-1?0:d(p)}let f=JE(e,t);if(f!==null){let p=lf(e,f);if(p!==null)return d(p)}return 0}function gS(e,t,n,r,o="all-markup",a){let i=e.part(),s=chunkBNZF6DYC_cjs.cc(i);if(s.length<=1)return {kind:"whole-document"};let l=chunkBNZF6DYC_cjs.dc(i,o,a),d=lf(e,t),u=ai(e,t,n,r,o,a),f=l[u]??u;if(d!==null&&d===f)return {kind:"anchor",paragraphId:t};let p=s[f];if(!p)return {kind:"unaddressable"};let m=chunkBNZF6DYC_cjs.Ha(i);for(let h=p.blockStart;h<p.blockEndExclusive;h+=1){let x=QE(m[h]);if(x!==null)return {kind:"anchor",paragraphId:x}}return {kind:"unaddressable"}}function QE(e){if(!e)return null;let t=(n,r)=>{if(n.kind==="textValue"||r>mS)return null;if(n.kind==="paragraph")return n.id;for(let o of n.children){let a=t(o,r+1);if(a!==null)return a}return null};return t(e,0)}function lf(e,t){return pS(e,e.part(),t)}function JE(e,t){let n=e.currentPackage();for(let r of ["footnote","endnote"]){let o=chunkMXOO7KRI_cjs.Wf(n,r);if(!(!o||!t.startsWith(`${o.name}#`)))for(let a of chunkMXOO7KRI_cjs.td(o.root)){let i=chunkMXOO7KRI_cjs.id(a);if(i===null||!e1(a,t))continue;return chunkMXOO7KRI_cjs.Xf(e.part()).find(l=>l.noteKind===r&&l.noteId===i)?.paragraphId??null}}return null}function e1(e,t){let n=(r,o)=>{if(r.kind==="textValue"||o>mS)return false;if(r.kind==="paragraph"&&r.id===t)return true;for(let a of r.children)if(n(a,o+1))return true;return false};return n(e,0)}function Fo(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 cl(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 hS(e){return {val:e?"1":"0"}}var t1="list paragraph",n1="ListParagraph";function yS(e){return e.find(t=>t.localName==="pStyle")?.attributes?.val}function bS(e){let{session:t}=e;function n(){let a=null;for(let i of t.documentStyles())if(i.type==="paragraph"){if(i.name.trim().toLowerCase()===t1)return i.styleId;a===null&&i.styleId===n1&&(a=i.styleId);}return a}let r;function o(){let a=t.stylesRoot();return (r===void 0||r.root!==a)&&(r={root:a,styleId:chunkBNZF6DYC_cjs.Eb(a,t.documentThemeFonts()).defaultParagraphStyleId}),r.styleId}return {applyOps(a){let i=n();if(i===null)return [];let s=o(),l=e.storyPart(),d=[];for(let u of a){let f=chunkITNK6C5M_cjs.ra(l,u),p=yS(f);p!==void 0&&p!==s||d.push({op:"setParagraphProperties",paragraphId:u,properties:chunkITNK6C5M_cjs.ta(f,{localName:"pStyle",attributes:{val:i}})});}return d},clearOp(a){let i=n();if(i===null)return null;let s=chunkITNK6C5M_cjs.ra(e.storyPart(),a);return yS(s)!==i?null:{op:"setParagraphProperties",paragraphId:a,properties:s.filter(l=>l.localName!=="pStyle")}}}}var df="a section break that changes where the next section starts cannot be suggested; turn off suggesting to insert it",fl="a section break cannot be inserted inside a table cell",vS="a section break cannot change a section that a locked or linked content control holds",uf="a section break cannot be inserted in locked or linked content";function r1(e){let t=new Set,n=new Set,r=a=>{if(a.kind==="textValue"||!("localName"in a)||a.localName!=="sdt")return false;let i=a.children?.find(s=>s.kind!=="textValue"&&"localName"in s&&s.localName==="sdtPr");return !i||i.kind==="textValue"?false:(i.children??[]).some(s=>{if(s.kind==="textValue"||!("localName"in s)||s.namespaceUri!==chunkMXOO7KRI_cjs.da)return false;if(s.localName==="dataBinding")return true;if(s.localName!=="lock")return false;let l=s.attributes?.find(d=>d.localName==="val"&&d.namespaceUri===chunkMXOO7KRI_cjs.da)?.value;return l==="contentLocked"||l==="sdtContentLocked"})},o=(a,i,s)=>{if(a.kind==="textValue")return;if(a.kind==="paragraph"){i&&t.add(a.id),s&&n.add(a.id);return}let l=i||a.kind==="table",d=s||r(a);for(let u of a.children??[])o(u,l,d);};return o(e.root,false,false),{inCell:t,held:n}}var o1=32;function a1(e){let t=new Set(chunkMXOO7KRI_cjs.Ph(e).map(n=>chunkMXOO7KRI_cjs.Sh(n)));return chunkMXOO7KRI_cjs.Oh(e)||t.add("nextPage"),t.size===1?[...t][0]:null}function ff(e,t){let n=t.replaceAt??t.collapseTo;return chunkMXOO7KRI_cjs.Qh(e,n.paragraphId)?t.collapseTo:n}var cf=(e,t)=>chunkMXOO7KRI_cjs.Me(e,t)||chunkMXOO7KRI_cjs.Je(e,t).content;function ul(e,t,n,r){if(chunkMXOO7KRI_cjs.Qh(e,t))return fl;if(cf(e,t))return uf;let{section:o,ownerId:a}=chunkMXOO7KRI_cjs.Rh(e,t);return chunkMXOO7KRI_cjs.Sh(o)===n?null:a!==null&&cf(e,a)?vS:r?df:null}function xS(e){let{breakType:t,suggesting:n}=e;if(e.cellRectangle)return fl;if(e.caretParagraphId!==null)return ul(e.part(),e.caretParagraphId,t,n);let r=r1(e.part());if(!n&&r.inCell.size===0&&r.held.size===0)return null;let{from:o,to:a}=e.orderedRange(),i=e.part(),s=chunkMXOO7KRI_cjs.Rh(i,o.paragraphId),l=chunkMXOO7KRI_cjs.Rh(i,a.paragraphId),d=s.section===l.section,u=d?chunkMXOO7KRI_cjs.Sh(s.section):a1(i),f=e.paragraphOrder(),p=f.indexOf(o.paragraphId),m=f.indexOf(a.paragraphId),h=p===-1||m===-1?null:f.slice(p,m+1),x=h!==null&&!h.some(y=>r.inCell.has(y))&&!h.some(y=>r.held.has(y));if(u!==null&&u!==t){if(x&&d&&s.ownerId!==null&&cf(i,s.ownerId))return vS;if(n&&x)return df}if(x&&u!==null)return null;if(h===null||h.length-1>o1)return n&&u!==null&&u!==t?df:null;let b=ff(i,e.deleteSelectionPlan());return ul(i,b.paragraphId,t,n)}var i1=[["contextualSpacing","contextualSpacing"],["keepNext","keepNext"],["keepLines","keepLines"],["widowControl","widowControl"],["pageBreakBefore","pageBreakBefore"]];function s1(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 pl(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 a=String(r),i=e[n]!==void 0;return i&&(o[n]=a),(!i||e[t]!==void 0)&&(o[t]=a),o}function SS(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 wS(e){let{session:t,commit:n,orderedStart:r,orderedRange:o,selectionMark:a,collapsedAt:i}=e,s=e.deleteSelectionPlan,l=()=>t.partFor(e.storyScope())??t.part(),d=(P,R,N)=>t.applyTreeOps(P,R,N,e.storyScope()),u=bS({session:t,storyPart:l}),f=()=>e.paragraphOrder(),p={get value(){return e.layout()}};function m(){let P=e.selectedCells?.();return P&&P.length>0?P:null}function h(P){let R=false;return n(()=>{let N=P();return R=N.committed,N},void 0,{keepCellSelection:m()!==null}),R}function x(){if(m()!==null)return [...chunkWQFNWLNY_cjs.ua(p.value,m())];let{from:P,to:R}=o(),N=f(),B=N.indexOf(P.paragraphId),U=N.indexOf(R.paragraphId);return B===-1||U===-1?null:N.slice(B,U+1)}let b=720,y=8;function I(P){return k(P)?.level??null}function k(P){return chunkBNZF6DYC_cjs.U(p.value,P)?.marker??null}function E(P){let R=k(P);return R?R.numFmt==="bullet"?"bullet":"ordered":null}function C(P,R){let N=f(),B=N.indexOf(P[0]??""),U=N.indexOf(P[P.length-1]??"");if(B===-1||U===-1)return null;for(let F of [B-1,U+1]){let _=N[F];if(!_)continue;let $=k(_);if($&&($.numFmt==="bullet"?"bullet":"ordered")===R)return $.numId}return null}function H(P,R){return R<0||R>y?false:e.numberingLevelExists(P.numId,R)}function A(P,R){return R<0||R>y?false:e.numberingLevelExists(P.numId,R)?true:t.ensureNumberingLevel(P.numId,R,P.numFmt==="bullet"?"bullet":"ordered")&&e.numberingLevelExists(P.numId,R)}function w(P){let R;for(let N of P){if(N.localName!=="ind")continue;let B=N.attributes?.left??N.attributes?.start;B!==void 0&&(R=B);}return !R||!/^-?\d{1,7}$/.test(R)?0:Number(R)}return {insertTab(){let P=s(),R=P.replaceAt??P.collapseTo;n(()=>d([...P.ops,{op:"insertTab",paragraphId:R.paragraphId,offset:R.offset}],a()),()=>i({...R,offset:R.offset+1}));},insertLineBreak(){let P=s(),R=P.replaceAt??P.collapseTo;n(()=>d([...P.ops,{op:"insertHardBreak",paragraphId:R.paragraphId,offset:R.offset}],a()),()=>i({...R,offset:R.offset+1}));},insertPageBreak(){let P=s(),R=P.replaceAt??P.collapseTo;n(()=>d([...P.ops,{op:"insertPageBreak",paragraphId:R.paragraphId,offset:R.offset}],a()),()=>i({...R,offset:R.offset+1}));},exitListOnEmptyItem(){let{from:P,to:R}=o();if(P.paragraphId!==R.paragraphId||P.offset!==R.offset)return false;let N=k(P.paragraphId);if(!N||e.paragraphTextOf(P.paragraphId).length>0)return false;let U=N.level>0&&H(N,N.level-1),F=[];if(U)F.push({op:"setListLevel",paragraphId:P.paragraphId,level:N.level-1});else {let $=u.clearOp(P.paragraphId);$&&F.push($),F.push({op:"setListNumbering",paragraphId:P.paragraphId,numId:null});}let _=false;return n(()=>{let $=d(F,a());return _=$.committed,$}),_},isListParagraph(){let{paragraphId:P}=r();return I(P)!==null},isListActive(P){let R=x();if(R===null)return false;let N=P==="bullet"?"bullet":"ordered";return R.length>0&&R.every(B=>E(B)===N)},toggleList(P){let R=x();if(R===null||R.length===0)return false;let N=R.every(F=>E(F)===P),B=N?null:C(R,P)??t.ensureListDefinition(P);if(!N&&B===null)return false;let U=N?[]:u.applyOps(R);for(let F of R){let _=I(F);U.push({op:"setListNumbering",paragraphId:F,numId:B,..._!==null?{level:_}:{}});}return h(()=>d(U,a()))},canAdjustIndent(P){let R=x();if(R===null)return false;let N=P==="increase"?1:-1;return R.some(B=>{let U=k(B);if(U){let _=U.level+N;return _>=0&&_<=y}let F=w(Eo(p.value,B));return Math.max(0,F+N*b)!==F})},adjustIndent(P){let R=x();if(R===null)return false;let N=P==="increase"?1:-1,B=[];for(let U of R){let F=Eo(p.value,U),_=k(U),$=_?.level??null;if(_&&$!==null){let Te=$+N;if(Te<0||Te>y||!A(_,Te))continue;B.push({op:"setListLevel",paragraphId:U,level:Te});continue}let Z=w(F),Y=Math.max(0,Z+N*b);if(Y===Z)continue;let oe=chunkITNK6C5M_cjs.ra(l(),U),ue=oe.find(Te=>Te.localName==="ind");B.push({op:"setParagraphProperties",paragraphId:U,properties:chunkITNK6C5M_cjs.ta(oe,{localName:"ind",attributes:s1(ue?.attributes,String(Y))})});}return B.length===0?false:h(()=>d(B,a()))},setIndent(P){if(P.left===void 0&&P.right===void 0&&P.firstLine===void 0)return false;let R=x();if(R===null)return false;let N=[];for(let B of R){let U=chunkITNK6C5M_cjs.ra(l(),B),_={...U.find($=>$.localName==="ind")?.attributes??{}};P.left!==void 0&&(_=pl(_,"left","start",P.left)),P.right!==void 0&&(_=pl(_,"right","end",P.right)),P.firstLine!==void 0&&(_=SS(_,P.firstLine)),N.push({op:"setParagraphProperties",paragraphId:B,properties:chunkITNK6C5M_cjs.ta(U,{localName:"ind",...Object.keys(_).length>0?{attributes:_}:{}})});}return N.length===0?false:h(()=>d(N,a()))},setParagraphFormat(P){let R=x();if(R===null||R.length===0)return false;let N=[];P.alignment!==void 0&&N.push({localName:"jc",attributes:{val:P.alignment}});let B={...Fo("before",P.spaceBeforePt),...Fo("after",P.spaceAfterPt),...cl(P.lineSpacing)};Object.keys(B).length>0&&N.push({localName:"spacing",attributes:B,mergeAttributes:true});for(let[$,Z]of i1){let Y=P[$];Y!==void 0&&N.push({localName:Z,attributes:hS(Y)});}let U=P.tabStops!==void 0,F=P.indentLeftTwips!==void 0||P.indentRightTwips!==void 0||P.indentFirstLineTwips!==void 0;if(N.length===0&&!F&&!U)return false;let _=[];for(let $ of R){let Z=chunkITNK6C5M_cjs.ra(l(),$),Y=Z;if(F){let ue={...Z.find(Te=>Te.localName==="ind")?.attributes??{}};P.indentLeftTwips!==void 0&&(ue=pl(ue,"left","start",P.indentLeftTwips)),P.indentRightTwips!==void 0&&(ue=pl(ue,"right","end",P.indentRightTwips)),P.indentFirstLineTwips!==void 0&&(ue=SS(ue,P.indentFirstLineTwips)),Y=chunkITNK6C5M_cjs.ta(Y,{localName:"ind",...Object.keys(ue).length>0?{attributes:ue}:{}});}for(let oe of N){let ue=oe.mergeAttributes?{...Y.find(ce=>ce.localName===oe.localName)?.attributes??{},...oe.attributes}:oe.attributes??{},Te=Object.fromEntries(Object.entries(ue).filter(([,ce])=>ce!=null));Y=chunkITNK6C5M_cjs.ta(Y,{localName:oe.localName,...Object.keys(Te).length>0?{attributes:Te}:{}});}if((N.length>0||F)&&_.push({op:"setParagraphProperties",paragraphId:$,properties:Y}),U){let oe=ri(e.layout(),$);_.push({op:"setParagraphTabStops",paragraphId:$,stops:P.tabStops.map(ue=>({positionTwips:Math.round(ue.positionTwips),alignment:ue.alignment,...ue.leader&&ue.leader!=="none"?{leader:ue.leader}:{}})),...oe?{inForcePositionsTwips:oe.stops.map(ue=>Math.round(ue.positionPt*20))}:{}});}}return _.length===0?false:h(()=>d(_,a()))},sectionProperties:()=>chunkBNZF6DYC_cjs.bc(t.part()),sectionPropertiesAt(P){let R=chunkBNZF6DYC_cjs.cc(t.part(),e.revisionDisplayMode(),e.revisionAuthorFilter()),N=ai(t,P,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter());return (R[N]??R[R.length-1]).properties},sectionAnchorParagraphAt(P){return gS(t,P,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter())},setSectionProperties(P){let R=false;return n(()=>{let N=e.storyScope().kind==="body",B=t.applyTreeOps([{op:"setSectionProperties",...P}],N?a():void 0,void 0,{kind:"body"});return R=B.committed,B}),R},sectionBreakRefusal(P="nextPage"){return e.storyScope().kind!=="body"?null:xS({part:()=>t.part(),breakType:P,suggesting:e.editingMode?.()==="suggest",cellRectangle:(e.selectedCells?.()?.length??0)>0,caretParagraphId:e.caretParagraphId?.()??null,orderedRange:o,paragraphOrder:f,deleteSelectionPlan:s})},insertSectionBreak(P="nextPage"){if(e.storyScope().kind!=="body")return false;let R=s(),N=ff(t.part(),R),B=(chunkMXOO7KRI_cjs.Qh(t.part(),N.paragraphId)?fl:null)??ul(t.part(),N.paragraphId,P,e.editingMode?.()==="suggest");if(B!==null)return e.publishRefusal?.(B),false;let U=new Set(t.paragraphIds()),F=false,_=false;return n(()=>{let $=t.applyTreeOps([...R.ops,{op:"splitParagraph",paragraphId:N.paragraphId,offset:N.offset},{op:"setSectionMark",paragraphId:N.paragraphId,breakType:P}],a(),void 0,{kind:"body"});return F=$.committed,_=$.reason==="locked"||$.reason==="bound",$},()=>{let $=t.paragraphIds().find(Z=>!U.has(Z));return $?i({paragraphId:$,offset:0}):null}),!F&&_&&e.publishRefusal?.(uf),F}}}var PS="http://schemas.openxmlformats.org/wordprocessingml/2006/main";function RS(e){return e.kind==="textValue"?false:e.kind==="contentControl"?true:e.kind==="generic"&&e.localName==="sdt"&&e.namespaceUri===PS}function l1(e){return e.kind==="textValue"?false:e.kind==="contentControlContent"?true:e.kind==="generic"&&e.localName==="sdtContent"&&e.namespaceUri===PS}function pf(e){return e.kind==="textValue"?[]:e.children}function ES(e,t=0){if(e.kind==="textValue")return e.value;if(t>=chunkMXOO7KRI_cjs.la||e.kind==="deletedText"||d1(e.kind)||chunkMXOO7KRI_cjs.de(e)||e.kind==="runProperties"||e.kind==="generic"&&!chunkMXOO7KRI_cjs.na(e)&&!RS(e))return "";if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return chunkMXOO7KRI_cjs.Xd(e);let n=chunkMXOO7KRI_cjs.ma(e,t),r="";for(let o of e.children)r+=ES(o,n);return r}function d1(e){return e==="revisionDelete"||e==="revisionMoveFrom"}function mf(e,t,n){if(!(t>=chunkMXOO7KRI_cjs.la))for(let r of e){if(r.kind==="hyperlink"){chunkMXOO7KRI_cjs.ma(r,t)<chunkMXOO7KRI_cjs.la&&n(r,t);continue}if(chunkMXOO7KRI_cjs.na(r)){mf(pf(r),chunkMXOO7KRI_cjs.ma(r,t),n);continue}if(RS(r)){for(let o of pf(r))l1(o)&&mf(pf(o),chunkMXOO7KRI_cjs.ma(r,t),n);continue}n(r,t);}}function IS(e,t,n){let r=c1(e,t);if(!r||r.kind!=="paragraph")return [];let o=chunkMXOO7KRI_cjs.Ue(r),a=[],i=0;return mf(r.children,0,(s,l)=>{let d=o.spanOf(s);if(d&&(i=Math.max(i,d.end)),s.kind!=="hyperlink")return;let u=d?d.start:i,f=d?d.end:i,p=chunkMXOO7KRI_cjs.ab(s,n);a.push({id:s.id,paragraphId:t,start:u,end:f,text:ES(s,l),kind:p.kind,href:p.href,authored:p.authored,...p.anchor!==void 0?{anchor:p.anchor}:{},...p.tooltip!==void 0?{tooltip:p.tooltip}:{}});}),a}function c1(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 a=n(o);if(a)return a}return null};return n(e.root)}function u1(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 f1(e,t){for(let n of chunkBNZF6DYC_cjs.K(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 OS(e){let t=()=>e.storyScope(),n=()=>e.session.partFor(t()),r=d=>e.session.relationshipTarget(d,t()),o=(d,u,f)=>e.session.applyTreeOps(d,u,f,t()),a=d=>{let u=n();return u?IS(u,d,r):[]},i=()=>u1(a(e.selection().head.paragraphId),e.selection().head),s=()=>{let d=e.selection().head,u=f1(e.layout(),d);return u===null?null:e.fieldLinkById(u)},l=d=>{let u=e.selection().head.paragraphId,f=a(u).find(p=>p.id===d);if(f)return f;for(let p of e.session.storyParts()){let m=h=>chunkMXOO7KRI_cjs.Af(e.session.currentPackage(),p.name,h);for(let h of chunkMXOO7KRI_cjs.yd(p))for(let x of chunkMXOO7KRI_cjs.Bd(h.root)){let b=x.id,y=IS(p,b,m).find(I=>I.id===d);if(y)return y}}return null};return {linksInCaretParagraph:()=>a(e.selection().head.paragraphId),linkAtCaret:i,fieldLinkAtCaret:s,linkById:l,applyHyperlink(d){let 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 m;if(u){let P=()=>e.session.ensureHyperlinkRelationship(d.url,p),R=e.withMintActor?e.withMintActor(P):P();if(!R)return false;m=R;}let h={...m!==void 0?{relationshipId:m}:{},...f?{anchor:d.anchor}:{},...d.tooltip!==void 0?{tooltip:d.tooltip}:{}},x=i(),b=e.orderedRange(),y=b.from.paragraphId===b.to.paragraphId&&b.from.offset===b.to.offset;if(x&&(y||p1(x,b))){let P=[];if(d.text!==void 0&&d.text!==x.text){if(d.text.length===0)return false;let N=e.replacementLanding?.(x.paragraphId,x.start,x.end),B=e.textOf(x.paragraphId).slice(x.start,x.start+2),U=x.start+(B.length===2&&B.charCodeAt(0)>=55296&&B.charCodeAt(0)<=56319&&B.charCodeAt(1)>=56320&&B.charCodeAt(1)<=57343?2:1);if(N!=null&&N>x.start&&U<x.end)P.push({op:"setHyperlinkTarget",linkId:x.id,...h},{op:"deleteText",paragraphId:x.paragraphId,start:x.start,end:x.end},{op:"insertText",paragraphId:x.paragraphId,offset:U,text:d.text});else if(N!=null){let F=kS(e.session);P.push({op:"setHyperlinkTarget",linkId:x.id,...h},...TS(x,N,d.text),{op:"insertHyperlink",paragraphId:x.paragraphId,start:N,end:N+d.text.length,...h,...F?{styleId:F}:{}});}else {let F=CS(x.paragraphId,x.start,x.end,d.text);if(!F)return false;P.push({op:"setHyperlinkTarget",linkId:x.id,...h},...F);}}else P.push({op:"setHyperlinkTarget",linkId:x.id,...h});let R=false;return e.commit(()=>{let N=o(P,e.selectionMark());return R=N.committed,N},()=>null),R}let I=b.from.paragraphId;if(b.to.paragraphId!==I)return false;let k=[],E=b.from.offset,C=b.to.offset;if(y){let P=d.text??d.url??d.anchor??"";if(P.length===0)return false;E=e.insertionLanding?.(I,E)??E,k.push({op:"insertText",paragraphId:I,offset:E,text:P}),C=E+P.length;}else {let P=e.replacementLanding?.(I,E,C);if(P!=null){let R=d.text??e.textOf(I).slice(E,C);if(R.length===0)return false;k.push(...TS({paragraphId:I,start:E,end:C},P,R)),E=P,C=P+R.length;}else if(d.text!==void 0&&d.text!==e.textOf(I).slice(E,C)){let R=CS(I,E,C,d.text);if(!R)return false;k.push(...R),C=E+d.text.length;}}if(C<=E)return false;let H=kS(e.session);k.push({op:"insertHyperlink",paragraphId:I,start:E,end:C,...h,...H?{styleId:H}:{}});let A=false,w={paragraphId:I,offset:C};return e.commit(()=>{let P=o(k,e.selectionMark(),{paragraphId:I,start:C,end:C});return A=P.committed,P},()=>({anchor:w,head:w})),A},removeHyperlink(d){if(!n())return false;let u=d?l(d):i();if(!u)return false;let f=false,p={paragraphId:u.paragraphId,offset:u.end};return e.commit(()=>{let m=o([{op:"removeHyperlink",linkId:u.id}],e.selectionMark());return f=m.committed,m},()=>({anchor:p,head:p})),f}}}function kS(e){for(let t of e.documentStyles())if(t.type==="character"&&t.styleId.toLowerCase()==="hyperlink")return t.styleId;return null}function p1(e,t){return t.from.paragraphId===e.paragraphId&&t.to.paragraphId===e.paragraphId&&t.from.offset>=e.start&&t.to.offset<=e.end}function TS(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 CS(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}var m1="equation replacement and removal are not supported in suggesting mode",FS=new WeakMap;function MS(e,t){let n=chunkMXOO7KRI_cjs.Ha(e,t);if(!n||n.kind!=="paragraph")return [];let r=FS.get(n);if(r)return r;let o=[];for(let i of chunkMXOO7KRI_cjs.Se(n)){let s=i.node;if(s.kind==="textValue"||s.kind!=="generic"||s.namespaceUri!==chunkMXOO7KRI_cjs.rc||s.localName!=="oMath")continue;let l=chunkMXOO7KRI_cjs.tc(s);l&&o.push(Object.freeze({id:s.id,paragraphId:t,start:i.start,end:i.end,linear:chunkMXOO7KRI_cjs.vc(l.expression),fallbackText:l.fallbackText,supported:en(l.expression)}));}let a=Object.freeze(o);return FS.set(n,a),a}function en(e){switch(e.kind){case "fallback":return false;case "text":return true;case "row":return e.items.every(en);case "fraction":return en(e.numerator)&&en(e.denominator);case "radical":return en(e.radicand)&&(e.degree===void 0||en(e.degree));case "script":return en(e.base)&&(e.subscript===void 0||en(e.subscript))&&(e.superscript===void 0||en(e.superscript));case "nary":return en(e.body)&&(e.lowerLimit===void 0||en(e.lowerLimit))&&(e.upperLimit===void 0||en(e.upperLimit))}}function AS(e,t){return e.find(n=>n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)??null}function LS(e){let t=null,n=i=>{let s=e.pagesLayer.ownerDocument.defaultView;if(!s||!(i instanceof s.Element))return null;let l=i.closest("[data-docx-equation]");return l&&e.pagesLayer.contains(l)?l:null},r=(i,s)=>{let l=e.equationById(i);l&&(e.setSelection({anchor:{paragraphId:l.paragraphId,offset:l.start},head:{paragraphId:l.paragraphId,offset:l.end}}),e.onPopover?.({equation:l,rect:s}));},o=i=>{t=null;let s=n(i.target),l=s?.dataset.docxEquation;if(!s||!l)return;let d=s.getBoundingClientRect();t={equationId:l,rect:{left:d.left,top:d.top,right:d.right,bottom:d.bottom}};},a=i=>{let s=n(i.target),l=s?.dataset.docxEquation,d=t;if(t=null,!s||!l){if(!d)return;i.preventDefault(),r(d.equationId,d.rect);return}let u=s.getBoundingClientRect();i.preventDefault(),r(l,{left:u.left,top:u.top,right:u.right,bottom:u.bottom});};return e.pagesLayer.addEventListener("pointerdown",o,true),e.pagesLayer.addEventListener("click",a),{destroy:()=>{e.pagesLayer.removeEventListener("pointerdown",o,true),e.pagesLayer.removeEventListener("click",a);}}}function NS(e){let t=()=>e.session.partFor(e.storyScope()),n=l=>{let d=t();return d?MS(d,l):[]},r=()=>{let l=e.selection().head;return AS(n(l.paragraphId),l)},o=l=>{let d=n(e.selection().head.paragraphId).find(u=>u.id===l);if(d)return d;for(let u of e.session.storyParts()){let f=chunkMXOO7KRI_cjs.Ha(u,l);if(!f||f.kind!=="generic"||f.namespaceUri!==chunkMXOO7KRI_cjs.rc||f.localName!=="oMath")continue;let p=f;for(;p&&p.kind!=="paragraph";)p=chunkMXOO7KRI_cjs.Ia(u,p.id);return !p||p.kind!=="paragraph"?null:MS(u,p.id).find(m=>m.id===l)??null}return null},a=(l,d)=>{let u=false,f={paragraphId:l.paragraphId,offset:l.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},i=(l,d)=>{let u=o(l);if(!u)return {ok:false,code:"notFound",reason:"no equation with that id"};if(e.editingMode()==="suggest")return {ok:false,code:"unsupported",reason:m1};let f=d==="replace"?{op:"setMathEquation",equationId:l,linear:u.linear}:{op:"removeMathEquation",equationId:l},p=e.writeRefusal(f);return p===null?{ok:true}:{ok:false,code:"locked",reason:p}},s=l=>(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:l.reason})),false);return {equationsInCaretParagraph:()=>[...n(e.selection().head.paragraphId)],equationAtCaret:r,equationById:o,can:i,applyEquation(l,d){let u=o(l);if(!u)return false;let f=i(l,"replace");return f.ok?u.supported&&u.linear===d?true:a(u,{op:"setMathEquation",equationId:l,linear:d}):s(f)},removeEquation(l){let d=o(l);if(!d)return false;let u=i(l,"remove");return u.ok?a(d,{op:"removeMathEquation",equationId:l}):s(u)}}}var g1=24;function DS(e){let{pagesLayer:t}=e,n=t.ownerDocument.defaultView;function r(){return e.container.closest(".docx-editor__scroll-container")}let o=p=>{if(!p||p.length===0||p.startsWith("#"))return false;let m=chunkMXOO7KRI_cjs.L(p);return !m.ok||!m.href||!n?false:(n.open(m.href,"_blank","noopener,noreferrer"),true)},a=p=>{if(e.enterStoryFor&&!e.enterStoryFor(p.paragraphId))return false;let m=e.layout(),h=chunkBNZF6DYC_cjs.ne(m,p);if(!h)return false;let x=m.pages[h.pageIndex];if(!x)return false;let b=x.box.y+(x.contentBox.y-x.box.y)+h.y,y=r();return y&&(y.scrollTop=Math.max(0,b*e.scale()-g1),e.onScrolled?.()),e.setSelection(p),true},i=p=>{let m=e.bookmarks().get(p);return m?a(m):false},s=null;function l(p){if(!p||p.closest("[data-docx-hf]"))return null;let m=p.closest("a.docx-hyperlink");if(m){let x=m.dataset.docxLink;return x?{linkId:x,drawing:false}:null}let h=p.closest("[data-docx-drawing-link]");if(h){let x=h.dataset.docxDrawingLink;return x?{linkId:x,drawing:true}:null}return null}let d=p=>{s=null;let m=p.target,h=l(m);if(!h)return;let b=m.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();s={linkId:h.linkId,drawing:h.drawing,rect:{left:b.left,top:b.top,bottom:b.bottom,right:b.right}};},u=p=>{let m=p.target,h=l(m);if(!h){let y=s;if(s=null,!y)return;p.preventDefault(),f(y.linkId,y.rect,p,y.drawing);return}s=null,p.preventDefault();let b=m.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();f(h.linkId,{left:b.left,top:b.top,bottom:b.bottom,right:b.right},p,h.drawing);};function f(p,m,h,x){let b=x?e.drawingLinkById?.(p)??null:e.linkById(p);if(!b)return;if(h.metaKey||h.ctrlKey){b.kind==="external"?o(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:m});}}return t.addEventListener("pointerdown",d,true),t.addEventListener("click",u),{goToPosition:a,goToBookmark:i,openExternal:o,destroy(){t.removeEventListener("pointerdown",d,true),t.removeEventListener("click",u);}}}function h1(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 gf(e,t){return e.drawingNodeId!==t?null:h1(e)}function HS(e,t){if(!e)return null;for(let n of e.anchoredDrawings??[]){let r=gf(n,t);if(r)return r}return null}function y1(e,t){for(let r of e.anchoredDrawings??[]){let o=gf(r,t);if(o)return o}for(let r of e.fragments){if(r.kind==="table"){for(let a of r.rows)for(let i of a.cells)for(let s of i.blocks){let l=BS(s,t);if(l)return l}continue}let o=_S(r,t);if(o)return o}let n=HS(e.header,t);return n||HS(e.footer,t)}function _S(e,t){for(let n of e.lines)for(let r of n.drawings??[]){let o=gf(r,t);if(o)return o}return null}function BS(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 a=BS(o,t);if(a)return a}return null}return _S(e,t)}function $S(e,t){for(let n of e.pages){let r=y1(n,t);if(r)return r}return null}function qS(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 ii="the document is open for viewing",hf="image changes are not supported in suggesting mode",ZS="tracked changes need a non-empty author";function KS(e){function t(){return {committed:false,rejected:true,opCount:0,reason:ii}}function n(){return {committed:false,rejected:true,opCount:0,reason:hf}}return {applyDrawingOps(r){if(e.editingMode()==="view")return t();if(e.editingMode()==="suggest")return n();let o=e.selectionMark(),a={committed:false,rejected:true,opCount:0};return e.commit(()=>(a=e.applyOps(r,o,o),a)),a},applyImageProperties(r){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:ii};if(e.editingMode()==="suggest")return {ok:false,reason:"invalidArgs",detail:hf};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:ii};let o=e.editingMode()==="suggest",a=e.author();if(o&&(a===void 0||a===""))return {ok:false,reason:"invalidArgs",detail:ZS};let i={ok:false,reason:"invalidArgs"};return e.commit(()=>(i=o?e.session.deleteImageTracked(e.storyScope(),r,{author:a,date:e.trackedDate()}):e.session.deleteImage(e.storyScope(),r),{committed:i.ok,rejected:!i.ok,opCount:i.ok?1:0,...i.ok?{}:{reason:i.detail??i.reason}})),i},insertImage(r){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:ii});let o=e.editingMode()==="suggest",a=e.author();if(o&&(a===void 0||a===""))return Promise.resolve({ok:false,reason:"invalidArgs",detail:ZS});let i=e.actorId();return e.session.insertImage(e.storyScope(),{...r,decodePort:e.decodePort(),...o?{revision:{author:a,date:e.trackedDate()}}:{},...i?{actorId:i}:{}})},replaceImage(r,o,a,i){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:ii});if(e.editingMode()==="suggest")return Promise.resolve({ok:false,reason:"invalidArgs",detail:hf});let s=e.actorId();return e.session.replaceImage(e.storyScope(),r,o,a,e.decodePort(),{...i,commitGuard:()=>e.editingMode()==="edit"&&i.commitGuard?.()!==false,...s?{actorId:s}:{}})}}}function VS(e){let t=null,n=null,r="",o=()=>{let d=e.session.part(),u=e.revisionDisplayMode(),f=e.revisionAuthorFilter();return {sections:chunkBNZF6DYC_cjs.cc(d,u,f),sourceIndexes:chunkBNZF6DYC_cjs.dc(d,u,f)}},a=d=>{let{sourceIndexes:u}=o(),f=u.indexOf(d);if(f!==-1)return f;let p=u.findIndex(m=>m>d);return p===-1?Math.max(0,u.length-1):p},i=()=>{if(!t)return;let d=Gy(e.layout(),t,e.materializedPages?.());d!==t.pageIndex&&(t={...t,pageIndex:d,sectionIndex:e.sectionAtPage(d).sectionIndex});},s=d=>{if(e.entryRefused?.()===true&&t?.scope.rId!==d.rId||!d.rId||e.session.partFor({kind:"headerFooter",rId:d.rId})===null)return false;t?.scope.rId!==d.rId&&e.leaveOtherStories?.();let u=e.layout(),f=jy(u,d.rId),p=t,m=p?.scope.rId===d.rId,h=f?null:b1(e.session,d.rId);if(!f&&!h)return false;let x=d.pageIndex??(m&&p?p.pageIndex:f?.pageIndex??0),b=d.kind??(m&&p?p.kind:f?.kind??h.kind),y=d.variant??(m&&p?p.variant:f?.story.variant??h.variant),I=m&&p?p.partName:f?.story.partName??h.partName,k=u.pages[x]??u.pages[f?.pageIndex??0],E=(k?vo(k,{scope:{kind:"headerFooter",rId:d.rId},kind:b,partName:I}):null)??f?.story??{scope:{rId:d.rId},variant:y,partName:I},C=e.selection(),H=p?p.savedBodySelection:{anchor:{...C.anchor},head:{...C.head}},A=m&&p?.sectionIndex!==void 0&&x===p.pageIndex,w=d.sectionIndex??(A?p.sectionIndex:f?e.sectionAtPage(x).sectionIndex:h?a(h.sectionIndex):void 0);t={scope:{kind:"headerFooter",rId:d.rId},pageIndex:x,...w!==void 0?{sectionIndex:w}:{},kind:b,variant:E.variant,partName:E.partName,savedBodySelection:H};let R=e.session.paragraphIdsIn(ys(t))[0];if(!R)return t=null,false;let N=d.position?bs(u,{anchor:d.position,head:d.position},t):m?bs(u,C,t):{anchor:{paragraphId:R,offset:0},head:{paragraphId:R,offset:0}};return e.setScopeSelection(N),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify(),true},l=()=>{if(!t)return;let d=t.savedBodySelection;t=null,e.setScopeSelection(bs(e.layout(),d,null)),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify();};return {getActive:()=>t,activeScope:()=>zy(t),setActiveScope(d){return d.kind==="body"?(l(),true):d.kind==="headerFooter"?s({rId:d.rId}):false},enterHeaderFooter:s,exitHeaderFooter:l,reconcileOccurrence:i,headerFooterState(){if(!t)return null;let d=e.session.headerFooterResolutionBySection(),u=t.sectionIndex??0,f=o(),p,m,h,x=k=>{let E=f.sourceIndexes[k]??k,C=d[E];if(!C)return false;let A=(t.kind==="header"?C.headers:C.footers).get(t.variant);return !A||A.rId!==t.scope.rId?false:(u=k,p=A.inherited,m=C.titlePage,h=C.evenAndOddHeaders,true)};if(!(t.sectionIndex!==void 0&&x(t.sectionIndex))){let k;d.forEach((E,C)=>{let A=(t.kind==="header"?E.headers:E.footers).get(t.variant);!A||A.rId!==t.scope.rId||!(k===void 0||k&&!A.inherited||k===A.inherited&&a(C)<u)||(u=a(C),p=A.inherited,m=E.titlePage,h=E.evenAndOddHeaders,k=A.inherited);});}let b=f.sections[u]?.properties??f.sections.at(-1)?.properties,y=b?.margins.headerTwips,I=b?.margins.footerTwips;return {editing:t.kind,sectionIndex:u,variant:t.variant,rId:t.scope.rId,partName:t.partName,...p!==void 0?{inherited:p}:{},...m!==void 0?{titlePage:m}:{},...h!==void 0?{evenAndOddHeaders:h}:{},...y!==void 0?{headerDistanceTwips:y}:{},...I!==void 0?{footerDistanceTwips:I}:{}}},headerFooterStateStable(d){if(!t)return n=null,r="",null;let u=this.headerFooterState();if(!u)return null;let f=[d,u.editing,u.sectionIndex,u.variant??"",u.rId??"",u.partName??"",String(u.inherited),String(u.titlePage),String(u.evenAndOddHeaders),String(u.headerDistanceTwips??""),String(u.footerDistanceTwips??"")].join("|");return n&&r===f||(n=Object.freeze({...u}),r=f),n}}}function zS(e){return e.length>0&&e.every(t=>t.op==="setDocumentProtection")}function b1(e,t){let n=e.headerFooterResolutionBySection();for(let r=0;r<n.length;r+=1){let o=n[r];for(let a of ["header","footer"]){let i=a==="header"?o.headers:o.footers;for(let[s,l]of i)if(l.rId===t)return {sectionIndex:r,kind:a,variant:s,partName:l.partName}}}return null}function WS(e){let t=null,n=null,r=null,o=(i,s)=>(e.setLastRejection(null),e.commit(()=>{let l=e.applyOps(Array.isArray(i)?i:[i],e.selectionMark());return l.rejected&&e.setLastRejection(String(l.reason??"rejected")),l},s),e.lastRejection()===null),a=(i,s,l)=>{let d=chunkMXOO7KRI_cjs.$c(i);if(!d)return e.setLastRejection("invalid note scope id"),false;let u=e.session.currentPackage(),f=chunkMXOO7KRI_cjs.Wf(u,d.noteKind),p=f?chunkMXOO7KRI_cjs.vd(f.root,d.noteId):null;if(!f||!p)return e.setLastRejection("note not found"),false;if(e.exitHeaderFooter?.(),e.activeScope().kind==="body"){let m=e.selection();r={anchor:{paragraphId:m.anchor.paragraphId,offset:m.anchor.offset},head:{paragraphId:m.head.paragraphId,offset:m.head.offset}};}if(t={kind:"note",id:chunkMXOO7KRI_cjs._c(d.noteKind,d.noteId)},n=Number.isInteger(l)?l:null,s)e.setSelection({anchor:s,head:s});else {let m=v1(p),h=new Set(e.session.paragraphIdsIn({kind:"notesPart",noteKind:d.noteKind})),x=m.find(b=>h.has(b.id));if(x){let b=x1(x);e.setSelection({anchor:{paragraphId:x.id,offset:b},head:{paragraphId:x.id,offset:b}});}}return e.noteModelMoved(),e.render(),n??=e.revealNote(t.id),e.notify(),true};return {insertNote(i){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 u=jS(e.session.currentPackage(),i);if(!o({op:"insertNote",noteKind:i,paragraphId:l.paragraphId,offset:l.offset},()=>{let h={paragraphId:l.paragraphId,offset:l.offset+1};return {anchor:h,head:h}}))return s.ops.length>0&&e.undo(),false;let m=[...jS(e.session.currentPackage(),i)].find(h=>!u.has(h));return m===void 0?true:a(chunkMXOO7KRI_cjs._c(i,m))},deleteNote(i,s){return o({op:"deleteNote",noteKind:i,noteId:s})},convertNote(i,s){return o({op:"convertNote",fromKind:i,noteId:s})},convertAllNotes(i){return o({op:"convertAllNotes",fromKind:i})},setNoteProperties(i){return o({op:"setNoteProperties",scope:i.scope,sectionIndex:i.sectionIndex,footnote:i.footnote,endnote:i.endnote})},enterNote:a,exitNote(i=true){if(!t)return;let s=r;t=null,n=null,r=null,e.setActiveScopeBodyOrHf({kind:"body"}),i&&s&&e.setSelection(s),e.noteModelMoved(),e.render(),e.notify();},activeNoteScope(){return t},activeNotePageIndex(){return n},setActiveNotePageIndex(i){!t||!Number.isInteger(i)||n!==i&&(n=i);}}}function v1(e){let t=[],n=(r,o)=>{if(!(o>32)){if(r.kind==="paragraph"){t.push(r);return}if("children"in r)for(let a of r.children)n(a,o+1);}};return n(e,0),t}function x1(e){let t=chunkMXOO7KRI_cjs.Se(e)[0];return t&&chunkMXOO7KRI_cjs.ed(t.node)?t.end:0}function jS(e,t){let n=chunkMXOO7KRI_cjs.Wf(e,t),r=new Set;if(!n)return r;for(let o of chunkMXOO7KRI_cjs.td(n.root)){if(!chunkMXOO7KRI_cjs.kd(o))continue;let a=chunkMXOO7KRI_cjs.id(o);a!==null&&r.add(a);}return r}var S1=500;function w1(e,t,n,r){let o=e.part(),a=chunkBNZF6DYC_cjs.Ha(o,n,r),i=chunkBNZF6DYC_cjs.$b(o);return t.map((s,l)=>{let d=s.blockStart<s.blockEndExclusive?a[s.blockEndExclusive-1]:void 0,u=d?.kind==="paragraph"?chunkBNZF6DYC_cjs.ac(d):void 0;return u||(l===t.length-1&&i?.kind!=="textValue"?i:void 0)})}function US(e,t){if(!e)return null;let n=e.session,r=chunkBNZF6DYC_cjs.X(e.revisionDisplayMode()),o=e.state().selection.head.paragraphId,a=ai(n,o,e.activeScope().kind==="headerFooter"?{kind:"headerFooter",rId:e.headerFooterState()?.rId??""}:vt(n,o,{kind:"body"}),e.headerFooterState()?.sectionIndex,r,t),i=n.currentPackage(),s=chunkMXOO7KRI_cjs.Lf(i),l=chunkMXOO7KRI_cjs.Mf(s),d=chunkMXOO7KRI_cjs.Nf(s),u=chunkBNZF6DYC_cjs.cc(n.part(),r,t),f=w1(n,u,r,t),p=chunkMXOO7KRI_cjs.Jf(f[a]),m=chunkMXOO7KRI_cjs.Kf(f[a]),h=chunkMXOO7KRI_cjs.Of(p,l),x=chunkMXOO7KRI_cjs.Pf(m,d);return {sectionIndex:a,footnote:{resolved:h,...l?{documentAuthored:l}:{},...p?{sectionAuthored:p}:{}},endnote:{resolved:x,...d?{documentAuthored:d}:{},...m?{sectionAuthored:m}:{}}}}function GS(e,t){let n=chunkMXOO7KRI_cjs.$c(t);if(!n)return null;let r=chunkMXOO7KRI_cjs.Wf(e.currentPackage(),n.noteKind);if(!r)return null;let o=r,a=chunkMXOO7KRI_cjs.vd(o.root,n.noteId);if(!a)return null;let i=[],s=S1,l=(u,f)=>{if(!(f>32||s<=0)){if(u.kind==="paragraph"&&typeof u.id=="string"){let p=(chunkMXOO7KRI_cjs.Di(o,u.id)??"").replace(/\uFFFC/g,"").trim();if(p){let m=p.slice(0,s);i.push(m),s-=m.length;}return}if(u.kind!=="textValue")for(let p of u.children)l(p,f+1);}};l(a,0);let d=i.filter(Boolean).join(" ").trim();return d.length>0?d:null}function XS(e){return [()=>{chunkMXOO7KRI_cjs.Ib(e().root);},()=>{chunkMXOO7KRI_cjs.Vh(e());},()=>{chunkMXOO7KRI_cjs.Ih(e());}]}var I1=50,k1=16;function YS(e){let t=e.schedule??((s,l)=>{let d=setTimeout(s,l);return ()=>clearTimeout(d)}),n=false,r=null,o=0,a=0,i=s=>{r=t(()=>{if(r=null,!(n||a>=e.steps.length||!e.shouldRun())){if(e.hasPendingInput()){if(o+=1,o>I1)return;i(k1);return}try{e.steps[a]();}catch{return}a+=1,a<e.steps.length&&i(0);}},s);};return i(0),()=>{n=true,r&&r(),r=null;}}var Yn=null;function si(e,t,n){let r=Yn;Yn=t===void 0?null:{owner:e,group:t};try{return n()}finally{Yn=r;}}function T1(e){if(Yn===null||Yn.owner!==e)return;let{group:t}=Yn;return Yn=null,t}function C1(e,t){Yn===null&&(Yn={owner:e,group:t});}var ml=class{current;get value(){return this.current}around(t,n,r){let o=this.current,a=T1(t);this.current=a;let i;try{i=n();}finally{this.current=o;}return a!==void 0&&!r(i)&&C1(t,a),i}};var P1=new Set(["comment-add","comment-delete","comment-reply","comment-resolve","package-scoped","revision-resolve"]);function QS(e,t){let n=e.setScale;return typeof n!="function"?false:n.call(e,t)}function yf(e,t,n={}){let r=n,o=chunkB4KZSKF7_cjs.j(t,n.reviewModel?{reviewModel:n.reviewModel}:{});if(!o.ok)return {ok:false,reason:o.reason,...o.detail?{detail:o.detail}:{}};let a=o.session,i=n.collaborationModel?.session,s=n.author,l=n.scale??96/72,d={resolve:n.tableInteractionLabel??(c=>mu(c))},u="the document is open for viewing",f="the table of contents is generated and read-only",p="\0range\0",m=()=>`${new Date().toISOString().slice(0,19)}Z`,h=n.measurer?null:chunkWQFNWLNY_cjs.ea(l,{context:ko(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),x=n.measurer??h.measurer,b=chunkBNZF6DYC_cjs.La(),y=chunkBNZF6DYC_cjs.Yd();function I(){return n.measurer?n.producer??"host-measurer":`${n.producer??h?.producer??"fixed-measurer"}@scale:${l}`}let k=I(),E=e.ownerDocument,C=E.createElement("div");C.className="docx-pages",C.style.position="relative",C.contentEditable="true",C.spellcheck=false,C.setAttribute("role","textbox"),C.setAttribute("aria-multiline","true"),C.style.outline="none";let H=E.createElement("div");H.className="docx-selection-overlay",H.contentEditable="false",H.setAttribute("aria-hidden","true"),H.style.position="absolute",H.style.left="0",H.style.top="0",H.style.pointerEvents="none";let A=E.createElement("div");A.className="docx-comment-overlay",A.contentEditable="false",A.setAttribute("aria-hidden","true"),A.style.position="absolute",A.style.left="0",A.style.top="0",A.style.pointerEvents="none";let w=E.createElement("div");w.className="docx-remote-selection-overlay",w.contentEditable="false",w.setAttribute("aria-hidden","true"),w.style.position="absolute",w.style.left="0",w.style.top="0",w.style.pointerEvents="none";let P=E.createElement("div");P.className="docx-table-furniture",P.contentEditable="false",P.style.position="absolute",P.style.left="0",P.style.top="0",P.style.pointerEvents="none",e.style.position="relative",e.replaceChildren(C,P,A,w,H);let R=Gx(C,()=>l,()=>{let c=fe?.getActive()??null,g=we?.activeNoteScope()??null,v=we?.activeNotePageIndex()??null,T=c?Wy(C,c.pageIndex):g?Uy(C,g.id,v):null;return {layout:re,selection:F,measurer:x,...ee()?{typingStyle:()=>{let L=Ho.formatting();return L.fontSizeHalfPoints?{fontSizePt:L.fontSizeHalfPoints/2,fontFamily:L.fontFamily,bold:L.bold,italic:L.italic,verticalAlign:L.superscript?"superscript":L.subscript?"subscript":"baseline"}:null}}:{},...c?{preferredPageIndex:c.pageIndex}:v!==null?{preferredPageIndex:v}:je.selectionPageIndex()!==void 0?{preferredPageIndex:je.selectionPageIndex()}:{},scopedHost:T,...c?{scopedHostKind:"headerFooter"}:g?{scopedHostKind:"note"}:{}}}),N=ws(a.part()),B=a.paragraphIds(),U=B.find(c=>!N.has(c))??B[0]??"",F=r.initialSelection??{anchor:{paragraphId:U,offset:0},head:{paragraphId:U,offset:0}},_=r.initialDrawingSelectionIntent??{kind:"none"};function $(c,g){c.kind===_.kind&&(c.kind!=="pointer"||_.kind==="pointer"&&c.drawingNodeId===_.drawingNodeId)||(_=c,g&&n.onChange?.(nt()));}let Z=null,Y=null;function oe(c){return Y=c,n.onChange?.(nt()),false}let ue=new ml,Te="suggesting needs an author before it can propose a change",ce=false,D=false,M=null,q=new Map;function z(){M=null;for(let c of q.values())M=c;}function X(c,g){if(c.paragraphId===g.paragraphId)return c.offset-g.offset;let v=Fe();return v.indexOf(c.paragraphId)-v.indexOf(g.paragraphId)}function O(c){if(!M)return;let{from:g,to:v}=js(re,M),T=c.head;X(T,g)>=0&&X(T,v)<=0||(q.clear(),M=null);}let V=null;function j(){return ee()?.properties??null}function ee(){if(!V)return null;let c=V.position,g=v=>v.paragraphId===c.paragraphId&&v.offset===c.offset;return g(F.anchor)&&g(F.head)?V:null}function ne(c){if(!V)return;let g=V.position;c.anchor.paragraphId===g.paragraphId&&c.anchor.offset===g.offset&&c.head.paragraphId===g.paragraphId&&c.head.offset===g.offset||(V=null);}function te(c,g,v,T){let L=Xe([...c],v,T);return c.length===g.length||!L.rejected?L:Xe([...g],v,T)}function le(c,g,v,T){let L=ee()??(kt(F.head.paragraphId).length===0?{base:[],properties:ol(Ue(a,F.head.paragraphId)??a.part(),F.head.paragraphId,F.head.offset,Mt(),ht())}:null);if(!L||v===0||L.properties.length===0&&L.base.length===0)return [];let K=V?.position??F.head,W=T&&K.paragraphId===c&&K.offset>=T.start&&K.offset<=T.end?{paragraphId:c,offset:jl({paragraphId:c,offset:T.start},{paragraphId:c,offset:T.end})}:chunkBNZF6DYC_cjs.ae(re,K);return W.paragraphId!==c||W.offset!==g?[]:[{op:"setRunProperties",paragraphId:c,start:g,end:g+v,properties:L.properties.reduce((Q,se)=>chunkITNK6C5M_cjs.ta(Q,chunkITNK6C5M_cjs.xa(Q,se)),[...L.base])}]}let fe=null,we=null,ot=null,Oe=()=>ys(fe?.getActive()??null,we?.activeNoteScope()??null),_e=()=>we?.activeNoteScope()?.id??null,Re=c=>{let g=y.multi?.spans,v=0,T=0;if(g&&g.length>0)for(let L=0;L<g.length;L+=1){let K=g[L];if(v=L,T=K.startIndex,c<K.startIndex+K.pageCount)break}return {sectionIndex:v,sectionStart:T}},Fe=()=>xo(re,fe?.getActive()??null,_e()),Ge=()=>globalThis.performance?.now()??Date.now(),Ee=0,he=0,Ve=0,{styleCascade:Le,numberingIndex:Nt,defaultTabStopPt:ze,compatibilityMode:vr}=Px(a),Kt=Cx({styleCascade:Le,partOf:c=>Ue(a,c)??a.part()}),Jr=null,xr=n.imageDecodePort??Lx(E)??Nx(),Pt=chunkBNZF6DYC_cjs.Ac({session:a,decodePort:xr,onResourcesChanged:()=>Jr?.()}),tn=n.drawingStrings??chunkS35UK656_cjs.h,fi=n.tocLabels,pi=()=>F.anchor.paragraphId!==F.head.paragraphId||F.anchor.offset!==F.head.offset?null:{paragraphId:F.head.paragraphId,offset:F.head.offset},Pl=R0(a),Lo=Dx({mintValidatedBytes:(c,g)=>Pt.mintValidatedBytes(c,g)}),St=false,Cn=dS(n.revisionDisplayMode,!!n.reviewModel,c=>Ae.setRevisionDisplayMode(c)),Pn=Cn.view,Mt=Cn.projection,mi=Cn.changeBars,pn=r.revisionAuthorVisibility??Vs(n.hiddenRevisionAuthors),ht=()=>Cn.filter(pn.filterForSession(a)),Sr=c=>{let g=Ue(a,c)??a.part(),v=chunkMXOO7KRI_cjs.Ha(g,c);if(v?.kind!=="paragraph")return false;let T=Mt(),L=ht();if(!chunkBNZF6DYC_cjs.Ea(v,T,L))return true;let K=chunkMXOO7KRI_cjs.Ia(g,c);return K?chunkBNZF6DYC_cjs.Ga(K.children,T,L).some(W=>W.kind==="paragraph"&&W.id===c):false},nn,No=chunkBNZF6DYC_cjs.sd(a),Qn=chunkBNZF6DYC_cjs.td(),Rn=(c,g=St)=>Rx({session:a,measurer:x,producer:k,cache:b,styleCascade:Le,numberingIndex:Nt,defaultTabStopPt:ze,compatibilityMode:vr,displayMode:Mt(),showFieldCodes:g,revisionAuthorFilter:c,inlineDrawingLayoutForPart:v=>Pt.contextForPart(v),drawingLayoutTokenForPart:v=>Pt.cacheTokenForPart(v),drawingTokenForParagraphForPart:(v,T)=>Pt.drawingTokenForParagraph(T,v),linkProjectors:No,projectFieldLink:v=>Qn.project(v)});nn=Rn(ht());let Jn={...a,applyTreeOps:(c,g,v,T)=>Xe(c,g,v,T),ensureListDefinition:c=>chunkMXOO7KRI_cjs.Nb(i?.identity.actorId,()=>a.ensureListDefinition(c)),applyPmDoc:c=>Be==="view"?{committed:false,rejected:true,opCount:0,reason:u}:i?{committed:false,rejected:true,opCount:0,reason:"collaboration-pm-doc-unproven"}:ql()?{committed:false,rejected:true,opCount:0,reason:f}:a.applyPmDoc(c)},re=S(),En=n.revisionStyles,Do=V0(n.showParagraphMarks??false,He,()=>It(false)),gi=r.reviewAuthorSlots??chunkS35UK656_cjs.e(),er=vv({layout:()=>re,items:()=>a.reviewItems(),styles:()=>En,slots:gi});function hi(c){if(c===null||c.length===0){if(!V)return;V=null;}else {let{anchor:g,head:v}=F;if(g.paragraphId!==v.paragraphId||g.offset!==v.offset)return;let T=ee()?.base??ol(a.partFor(Oe())??a.part(),v.paragraphId,v.offset,Mt(),ht());V={position:v,properties:c,base:T};}R.update(),n.onChange?.(nt());}let Ho=tS({runFormatRefusal:()=>wn({type:"toggleMark"},Ae)?.reason??null,session:Jn,storyScope:Oe,paragraphOrder:Fe,layout:()=>re,selection:()=>F,displayMode:()=>Mt(),authorFilter:ht,paragraphMarkVisible:Sr,commit:(c,g,v)=>Ne(c,g,v),orderedRange:()=>ir(),selectionMark:()=>We(),textOf:c=>kt(c),selectedCells:()=>Z?.cellIds,defaultParagraphStyleId:()=>Le()?.defaultParagraphStyleId??null,defaultFontFamily:()=>n.defaultFontFamily??null,pendingFormats:()=>j(),setPendingFormats:hi}),On=rS({session:Jn,storyScope:Oe,layout:()=>re,selection:()=>F,displayMode:()=>Mt(),authorFilter:ht,paragraphMarkVisible:Sr,commit:(c,g,v)=>Ne(c,g,v),orderedRange:()=>ir(),selectionMark:()=>We(),textOf:c=>kt(c),paragraphOrder:Fe,selectedCells:()=>Z?.cellIds,armPendingFormats:c=>hi(c),now:Ge,publish:()=>{On.state().mode!=="off"?C.dataset.formatPainter="":delete C.dataset.formatPainter,n.onChange?.(nt());}}),Fn=wS({session:Jn,storyScope:Oe,headerFooterSectionIndex:()=>fe?.getActive()?.sectionIndex,revisionDisplayMode:Mt,revisionAuthorFilter:ht,paragraphOrder:Fe,selectedCells:()=>Z?.cellIds,editingMode:()=>Be,publishRefusal:oe,caretParagraphId:()=>F.anchor.paragraphId===F.head.paragraphId&&F.anchor.offset===F.head.offset?F.head.paragraphId:null,layout:()=>re,commit:(c,g,v)=>Ne(c,g,{rearmPending:ee()??void 0,...v?.keepCellSelection?{keepCellSelection:true}:{}}),orderedStart:()=>zl(),orderedRange:()=>ir(),selectionMark:()=>We(),collapsedAt:c=>$e(c),deleteSelectionPlan:()=>Hn(),paragraphTextOf:c=>kt(c),numberingLevelExists:(c,g)=>chunkBNZF6DYC_cjs.xc(chunkBNZF6DYC_cjs.Lb(Nt(),Le()),c,g)!==null});function wr(c,g,v){return Be!=="suggest"?null:jl({paragraphId:c,offset:g},{paragraphId:c,offset:v})}let _o=OS({session:Jn,layout:()=>re,fieldLinkById:c=>Qn.linkById(c),refusesWrite:()=>rr(true)!==null,withMintActor:c=>chunkMXOO7KRI_cjs.Nb(i?.identity.actorId,c),storyScope:Oe,replacementLanding:wr,insertionLanding:(c,g)=>chunkBNZF6DYC_cjs.ae(re,{paragraphId:c,offset:g}).offset,selection:()=>F,orderedRange:()=>ir(),selectionMark:()=>We(),textOf:c=>kt(c),commit:(c,g)=>Ne(c,g)}),tr=NS({session:Jn,storyScope:Oe,editingMode:()=>Be,writeRefusal:c=>rr(true,[c]),selection:()=>F,selectionMark:()=>We(),commit:(c,g)=>Ne(c,g)}),Ir=c=>{let g=vt(a,c,{kind:"body"});if(g.kind==="body")return we?.exitNote(),fe?.exitHeaderFooter(),true;if(g.kind==="headerFooter"){let T=fe?.activeScope();return T?.kind==="headerFooter"&&T.rId===g.rId?true:(we?.exitNote(),fe?.enterHeaderFooter({rId:g.rId})??false)}let v=Rl(c);return v?we?.activeNoteScope()?.id===v?true:(fe?.exitHeaderFooter(),we?.enterNote(v)??false):false},Rl=c=>{for(let g of re.pages)for(let v of [g.footnotes,g.endnotes])if(v){for(let T of v.notes)for(let L of chunkBNZF6DYC_cjs.C(T.fragments))if(L.paragraphId===c)return T.scopeId}return null},kr=DS({pagesLayer:C,container:e,scale:()=>l,layout:()=>re,bookmarks:()=>a.bookmarks(),linkById:c=>Qn.linkById(c)??_o.linkById(c),drawingLinkById:c=>$S(re,c),setSelection:c=>pt($e(c)),enterStoryFor:c=>Ir(c),isCollapsedSelection:()=>F.anchor.paragraphId===F.head.paragraphId&&F.anchor.offset===F.head.offset,onScrolled:()=>xi(),...n.onHyperlinkPopover?{onPopover:n.onHyperlinkPopover}:{}}),eo=LS({pagesLayer:C,equationById:c=>tr.equationById(c),setSelection:pt,...n.onEquationPopover?{onPopover:n.onEquationPopover}:{}});C.addEventListener("contextmenu",zf),C.addEventListener("click",jf),C.addEventListener("pointermove",Hf),C.addEventListener("pointerleave",Bf);let Bo=q0(C),Vt=null;function Mn(c,g,v){let T=v?v.authorFilter:ht(),L=v?.layoutSession??y,K=v?.furnitureSource??nn;return g&&chunkBNZF6DYC_cjs.Jb(L,g),Pt.sync(a),chunkTE43S3LX_cjs.a({view:a,revision:c,measurer:x,cache:b,session:L,producer:k,styleCascade:Le,defaultTabStopPt:ze,numberingIndex:Nt,furniture:K,compatibilityMode:vr,linkProjectors:No,projectFieldLink:W=>Qn.project(W),inlineDrawingLayout:Pt.bodyContext,inlineDrawingLayoutForPart:W=>Pt.contextForPart(W),drawingTokenForParagraph:W=>Pt.drawingTokenForParagraph(W,a.part().name),drawingTokenForParagraphForPart:(W,Q)=>Pt.drawingTokenForParagraph(Q,W),drawingLayoutEpoch:Pt.cacheTokenForPart(a.part().name),drawingLayoutEpochForPart:W=>Pt.cacheTokenForPart(W),displayMode:Mt(),showFieldCodes:v?false:St,revisionAuthorFilter:T})}function An(){return Mn(a.packageRevision(),void 0,{layoutSession:chunkBNZF6DYC_cjs.Yd(),furnitureSource:Rn(void 0,false)})}function S(){let c=Ge(),g=Mn(a.packageRevision());return Ee=Ge()-c,g}let G=null,J=null,Se=false;function ye(){if(Se)return;Se=true;let c=a.packageRevision();J=YS({steps:XS(()=>a.part()),shouldRun:()=>Be!=="view"&&a.editable&&a.packageRevision()===c,hasPendingInput:Ce});}function Ce(c=true){return e.ownerDocument.defaultView?.navigator?.scheduling?.isInputPending?.({includeContinuous:c})??false}function qe(){if(!Ce()){It(),ye();return}G===null&&(G=setTimeout(()=>{G=null,Qe.pending()===null&&(It(),ye());},0));}let ve="",ae=null,Me=false;function Ie(){if(Me||(ae!==null&&(clearTimeout(ae),ae=null),ve.length===0))return;let c=ve;ve="",Me=true;try{si(Ae,void 0,()=>Ae.type(c));}catch(g){throw ve=c+ve,g}finally{Me=false;}}function dt(c){ve+=c,ae===null&&(ae=setTimeout(()=>{ae=null,Ie();},0));}function mn(c,g,v){Ie();let T=v?.trim()||s?.trim();if(!T)return oe("tracked changes need a non-empty author");if(c!=="deletion"&&g.length===0)return oe(`${c} requires non-empty text`);if(c!=="deletion"&&/[\r\n\v\f\u2028\u2029]/.test(g))return oe(`${c} requires text without a paragraph mark`);let L={author:T,date:m()},K=ir(),W=K.from.paragraphId===K.to.paragraphId&&K.from.offset===K.to.offset;if(c!=="insertion"&&W&&!(c==="replacement"&&Z))return oe(`${c} needs a non-collapsed selection`);let Q=c==="insertion"?{ops:[],collapseTo:chunkBNZF6DYC_cjs.ae(re,K.from)}:Hn(T),se=Jf(Q.ops,L,Qf()),be=Q.collapseTo;if(c==="insertion"||c==="replacement"){let ie=c==="replacement"?Q.replaceAt??Q.collapseTo:Q.collapseTo;se.push({op:"insertText",paragraphId:ie.paragraphId,offset:ie.offset,text:g,revision:L}),be={paragraphId:ie.paragraphId,offset:ie.offset+g.length};}let ge=false;return Ne(()=>{let ie=Xe(se,We(),or(be));return ge=ie.committed,ie},()=>$e(be)),ge}let Qe=chunkWQFNWLNY_cjs.ra({run:c=>{let g=Ge(),v=Mn(c.revision,c);return Ee=Ge()-g,v},currentRevision:()=>a.packageRevision(),schedule:c=>{let g=setTimeout(c,0);return ()=>clearTimeout(g)},publish:c=>{er.releaseLayout(),re=c,qe();}}),ct=false;Jr=()=>{Qe.invalidateAll(a.packageRevision(),"drawing-resources"),!ct&&(ct=true,setTimeout(()=>{ct=false,Ze();},0));};let wt=a.subscribe(c=>{tk(c),V=null,Qe.notify(c);}),gn=i?a.collaborationPort(i.documentId):null,$o=()=>{},qo=()=>{},Tr=false,to=null,Cr=null,Zo=i?i.subscribeRemoteSelections(()=>{Tr&&ki();}):()=>{};function Ke(){let c=Fx(e,re,F,l),g=fe?.getActive()?.pageIndex??je.selectionPageIndex();return g===void 0||c===void 0||c.has(g)?c:new Set([...c,g])}function Ze(){return Qe.pending()?Qe.flush():false}let no=8;function Pr(c){!c&&Qe.pending()!==null&&Ee>no&&Ce(false)||Ze()||It();}function He(){Ie(),Ze();}function Ln(){Ie();let c=Ze();return G!==null?(It(),ye(),true):c}let Rr=null;function Ko(c){return lb(c,a.part())}function Vo(){for(let c of C.querySelectorAll(".docx-content-control-chrome[data-docx-toc]")){if(c.getAttribute("data-docx-content-control")===Rr){c.dataset.hover="",c.dataset.boundaryVisible="";continue}delete c.dataset.hover,ce||delete c.dataset.boundaryVisible;}}function Df(c){Rr!==c&&(Rr=c,Vo());}function El(c){return db(a.part(),_f(c),c.target)}function Hf(c){let g=El(c);Df(g?Ko(g):null);}function _f(c){let g=c.target,v=g?.isConnected?g.closest("[data-paragraph-id]"):void 0;if(v)return v.dataset.paragraphId;let T=C.ownerDocument;return typeof T.elementFromPoint!="function"?void 0:T.elementFromPoint(c.clientX,c.clientY)?.closest("[data-paragraph-id]")?.dataset.paragraphId}function Bf(){Df(null);}function LI(){let c=nr(),g=chunkBNZF6DYC_cjs.wd(a.part()),v=chunkMXOO7KRI_cjs.Be(a.part()),T=v.map(ie=>{let yt=O0(ie,re,a.part(),x);return yt?{...yt,empty:g.has(ie.beginParagraphId)}:null}).filter(ie=>ie!==null),L=new Set(T.map(ie=>ie.boundary.id)),K=new Set(T.filter(ie=>ie.empty).map(ie=>ie.boundary.id));for(let ie of v)ie.contentControlId&&Ko(ie)!==ie.contentControlId&&K.add(ie.contentControlId);let W=c&&!L.has(c.id)?new Set([c.id]):void 0,Q=Rr?new Set([Rr]):void 0,se=new Set(chunkBNZF6DYC_cjs.qe(re).filter(ie=>ie.controlType==="checkbox"&&Ol(ie.id)).map(ie=>ie.id)),be=T.filter(ie=>ie.additional&&!ie.empty).map(ie=>ie.boundary),ge=Yf()!==null;if(!(!ce&&!W&&!Q&&!ge&&se.size===0&&be.length===0&&L.size===0))return {...ge?{readOnly:true}:{},...ce?{showAll:true}:{},...W?{activeIds:W}:{},...Q?{hoverIds:Q}:{},...se.size>0?{checkedIds:se}:{},...be.length>0?{additionalBoundaries:be}:{},...L.size>0?{tocControlIds:L}:{},...K.size>0?{suppressedIds:K}:{}}}let zo=null;function nr(){let c=Oe();if(c.kind!=="body")return HI(c);if(zo&&zo.layout===re&&zo.selection===F)return zo.result;let g=NI();return zo={layout:re,selection:F,result:g},g}function NI(){let c=Z0(re,F,x);return c&&DI(c.id)===a.part().name?c:null}function DI(c){let g=c.indexOf("#");return g===-1?"":c.slice(0,g)}function HI(c){let g=a.partFor(c);return g?chunkBNZF6DYC_cjs.Cd(g,F.head.paragraphId):null}function $f(c){return c.bound?"bound":c.effectiveLock==="contentLocked"||c.effectiveLock==="sdtContentLocked"?"locked":null}function _I(c){return c.effectiveLock==="sdtLocked"||c.effectiveLock==="sdtContentLocked"?"locked":null}function BI(c){return chunkMXOO7KRI_cjs.Ed(c)}function hn(c){let g=Ue(a,c),v=chunkMXOO7KRI_cjs.Ha(g??a.part(),c);return !v||!BI(v)?null:v}function qf(c){let g=hn(c);if(!g)return null;for(let v of g.children)if(v.kind!=="textValue"&&(v.kind==="contentControlProperties"||v.localName==="sdtPr"))for(let T of v.children){if(T.kind==="textValue"||T.localName!=="tabIndex")continue;let L=T.attributes.find(W=>W.localName==="val")?.value;if(L===void 0)return null;let K=Number(L);return Number.isFinite(K)?K:null}return null}function $I(){let c=Oe(),g=c.kind==="body"?null:a.partFor(c),v=c.kind==="notesPart"?new Set(Fe()):void 0;return (g?[...chunkBNZF6DYC_cjs.Bd(g,v)]:[...chunkBNZF6DYC_cjs.qe(re)]).filter(L=>$f(L)===null).sort((L,K)=>{let W=qf(L.id),Q=qf(K.id);return W!==null&&Q!==null&&W!==Q?W-Q:W!==null&&Q===null?-1:W===null&&Q!==null?1:0})}function Zf(c){for(let g of c.children)if(g.kind!=="textValue"&&(g.kind==="contentControlContent"||g.localName==="sdtContent"))return g.children;return []}function qI(c){let g=hn(c);if(!g)return false;let v=Zf(g),T=[],L=be=>{for(let ge of be){if(ge.kind==="paragraph"){T.push({id:ge.id,length:chunkMXOO7KRI_cjs.Ue(ge).length});continue}if(ge.kind==="textValue")continue;if(ge.kind==="contentControl"){L(Zf(ge));continue}L(ge.children);}};if(L(v),T.length>0){let be=T[0],ge=T[T.length-1];return pt({anchor:{paragraphId:be.id,offset:0},head:{paragraphId:ge.id,offset:ge.length}}),true}let K=null,W=0,Q=0,se=be=>{for(let ge of be){if(ge.kind==="paragraph"){let ie=chunkMXOO7KRI_cjs.Ue(ge).spanOf(g);if(!ie)continue;return K=ge.id,W=ie.start,Q=ie.end,true}if(ge.kind!=="textValue"&&se(ge.children))return true}return false};return se((a.partFor(vt(a,c,Oe()))??a.part()).root.children),K?(pt({anchor:{paragraphId:K,offset:W},head:{paragraphId:K,offset:Q}}),true):false}let Kf=c=>k0(hn(c),()=>a.currentPackage());function Ol(c){let g=hn(c);if(!g)return false;for(let v of g.children)if(v.kind!=="textValue"&&!(v.kind!=="contentControlProperties"&&v.localName!=="sdtPr")){for(let T of v.children)if(T.kind==="contentControlCheckbox")for(let L of T.children){if(L.kind!=="contentControlChecked")continue;let K=L.attributes.find(W=>W.localName==="val")?.value;return !(K==="0"||K==="false"||K==="off")}}return false}let Vf=c=>T0(hn(c));function yi(c,g){for(let v of C.querySelectorAll("[data-docx-content-control]"))v.getAttribute("data-docx-content-control")===c&&(g?v.dataset.open="":delete v.dataset.open);}let ro=H0({document:E,layer:C,find:hn,layout:()=>re,selectDrawing:(c,g)=>Ae.selectDrawing(c,g),allowed:c=>!Nn.disabledReason(c,"edit"),translate:c=>Uo?.(c)??c,replaceImage:(c,g,v,T)=>Ae.replaceImage(c,g,v,{expectedPackageRevision:a.packageRevision(),commitGuard:T}),setOpen:yi,reject:oe}),Fl=I0({find:hn,allowed:c=>!Nn.disabledReason(c,"edit"),apply:(c,g)=>Nn.setValue(c,g),items:Kf,date:Vf,checked:Ol,picture:ro.drawingOf,replaceImage:ro.replace,locale:()=>wi.get(),layer:C,setOpen:yi,request:n.onRequestContentControlWidget}),bi=null,Ml;function Al(c){bi===c&&(bi=null,Ml?.(),Ml=void 0);let g=c.dataset.docxCcId,v=c.contains(E.activeElement);c.remove(),g&&yi(g,false),v&&C.focus({preventScroll:true});}function Ll(){Fl.cancel();let c=bi;return c&&Al(c),c}function zf(c){let g=El(c);ZI(g&&Vl(g.id)?g.id:null);}let jo=null;function ZI(c){jo!==c&&(jo=c,n.onChange?.(nt()));}function jf(c){if(c.button!==0||c.target?.closest("a.docx-hyperlink")||F.anchor.paragraphId!==F.head.paragraphId||F.anchor.offset!==F.head.offset)return;let g=_f(c);if(!g)return;let v=chunkMXOO7KRI_cjs.Be(a.part()).find(K=>K.resultParagraphIds.includes(g));if(!v||El(c)?.id!==v.id)return;let L=chunkMXOO7KRI_cjs.lf(a.part(),v,a.documentOutline(),Zl(v))[v.resultParagraphIds.indexOf(g)];L&&(c.preventDefault(),kr.goToPosition({paragraphId:L,offset:0}));}let Wf={document:E,locale:()=>wi.get(),translate:c=>Uo?.(c)??c,setValue:(c,g)=>Nn.setValue(c,g),close:c=>Al(c)};function KI(c,g){let v=Nn.disabledReason(c,"edit");if(v){Y=v,n.onChange?.(nt());return}if(ro.cancel(),Ll()?.dataset.docxCcId===c||(g==="picture"&&ro.select(c),Fl.open(c,g)))return;if(g==="picture")return ro.pick(c);if(g==="checkbox"){Nn.setValue(c,Ol(c)?"false":"true");return}let T=chunkBNZF6DYC_cjs.qe(re).find(K=>K.id===c)?.alias,L;if(g==="dropdown"||g==="comboBox"||g==="buildingBlockGallery"){let K=Kf(c);if(K.length===0&&g==="dropdown")return;L=sv(Wf,c,g,K,T,bu(hn(c),K));}else if(g==="date")L=lv(Wf,c,Vf(c),T);else return;bi=L,iv(L,C,x0(re,l,c,C,at?.pageOffsetX)),yi(c,true),Ml=Fs(L,()=>Al(L)),g==="date"?Zs(L):(L.querySelector("input")??L.querySelector('[role=option][tabindex="0"]')??L.querySelector("button,[data-docx-part=empty]"))?.focus({preventScroll:true});}let Nn={setShowAll(c){ce!==c&&(ce=c,It());},setFormFill(c){D!==c&&(D=c,n.onChange?.(nt()));},showAll:()=>ce,formFill:()=>D,atCaret:()=>nr(),navigate(c){let g=$I();if(g.length===0)return false;let v=nr(),T=v?g.findIndex(K=>K.id===v.id):-1;c==="next"?T=T<0?0:(T+1)%g.length:T=T<0?g.length-1:(T-1+g.length)%g.length;let L=g[T];return qI(L.id)},setValue(c,g){let v=Nn.disabledReason(c,"edit");if(v)return oe(v);let T=P0(hn(c),()=>a.currentPackage(),c,g);if(!T)return oe("unknown-building-block");let L=false;return Ne(()=>{let K=Xe(T,We(),void 0,vt(a,c,Oe()),false);return L=K.committed,K}),L},remove(c){let g=c??nr()?.id;if(!g)return oe("notFound");let v=Nn.disabledReason(g,"remove");if(v)return oe(v);let T=false;return Ne(()=>{let L=Xe([{op:"removeContentControl",controlId:g}],We(),void 0,vt(a,g,Oe()),false);return T=L.committed,L}),T},disabledReason(c,g){let v=Yf();if(v!==null)return v;let T=chunkBNZF6DYC_cjs.qe(re).find(K=>K.id===c);if(T)return g==="remove"?_I(T):$f(T);let L=hn(c);if(!L)return "notFound";for(let K of L.children)if(K.kind!=="textValue"&&!(K.kind!=="contentControlProperties"&&K.localName!=="sdtPr")){if(K.children.some(W=>W.kind!=="textValue"&&W.localName==="dataBinding")&&g==="edit")return "bound";for(let W of K.children){if(W.kind==="textValue"||W.localName!=="lock")continue;let Q=W.attributes.find(se=>se.localName==="val")?.value;if(g==="remove"){if(Q==="sdtLocked"||Q==="sdtContentLocked")return "locked"}else if(Q==="contentLocked"||Q==="sdtContentLocked")return "locked"}}return null}};function Nl(){let c=Gf&&Be!=="view";C.contentEditable=c?"true":"false",C.setAttribute("aria-readonly",c?"false":"true");}function nt(){return {revision:a.packageRevision(),pageCount:re.pages.length,selection:F,cellSelection:Z,canUndo:i?.canUndo()??a.canUndo(),canRedo:i?.canRedo()??a.canRedo(),collaborationStatus:i?.status()??"inactive",lastRejection:Y,pendingFormat:j(),contentControls:{showAll:ce,formFill:D,activeControlId:nr()?.id??null},contextTocId:jo,formatPainter:On.state(),perf:{layoutMs:Ee,paintMs:he,selectionMs:Ve,placed:y.stats.placed,total:y.stats.total,reusedPages:y.stats.reusedPages,fullPasses:y.stats.fullPasses,staleDiscards:Qe.staleDiscards,cancelledRuns:Qe.cancelledRuns}}}let Dt,at,Dl=null,vi=false,Wo=null,Hl=null;function VI(c){for(let g of re.pages){let v=C.children.item(g.index);if(v?.dataset.pageIndex!==String(g.index))continue;let T=c.pageOffsetX.get(g.index)??0;v.style.left=`${(g.box.x+T)*l}px`;}}function It(c=true){G!==null&&(clearTimeout(G),G=null,c=true);let g=je.adoptBeforePaint(),v=Ge();Dt=Ke(),fe?.reconcileOccurrence();let T=fe?.getActive()??null,L=LI(),K=chunkBNZF6DYC_cjs.wd(a.part());chunkS35UK656_cjs.n(C,re,{scale:l,readOnlyParagraphIds:ws(a.part()),...K.size>0?{emptyTocPlaceholderIds:K}:{},...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},materialize:Dt,ariaHidden:false,drawingStrings:tn,...n.fieldShading?{fieldShading:n.fieldShading}:{},...En!==void 0?{revisionStyles:En}:{},shadeFormFields:Pl(),showParagraphMarks:Do.get(),changeBars:mi(),changeBarsToggle:!!n.reviewModel,...Lo?{imageUrlPort:Lo}:{},...T?{activeHeaderFooterRId:T.scope.rId,activeHeaderFooterPageIndex:T.pageIndex}:{},...L?{contentControlChrome:L}:{}},er.get().value),Fu(C,pi(),{domReplaced:true}),Yy(e,C,T!=null),wc(e,Be),at=tl(re,Dt),VI(at),C.style.width=`${at.width*l}px`,C.style.height=`${at.height*l}px`,e.style.width=`${at.width*l}px`,e.style.height=`${at.height*l}px`,H.style.width=`${at.width*l}px`,H.style.height=`${at.height*l}px`,A.style.width=H.style.width,A.style.height=H.style.height,w.style.width=H.style.width,w.style.height=H.style.height,P.style.width=H.style.width,P.style.height=H.style.height,oa.update(),he=Ge()-v,ea(),ki(),ao(true),Op(),je.mirrorToDom(),Uf(vi),vi=false,(c||g)&&n.onChange?.(nt());}function xi(){He();let c=Ke(),g=tl(re,c);at&&Gu(c,Dt)&&Mx(g,at)||It(false);}function Uf(c=false){if(fe?.getActive()||we?.activeNoteScope()||F.anchor.paragraphId!==F.head.paragraphId||F.anchor.offset!==F.head.offset)return;let g=E.activeElement;if(g!==C&&(!g||!C.contains(g)))return;let v=chunkBNZF6DYC_cjs.ne(re,F.head,{measurer:x,...je.selectionPageIndex()!==void 0?{preferredPageIndex:je.selectionPageIndex()}:{}});if(!v)return;let T=Dl!==null&&Dl!==v.pageIndex;if(Dl=v.pageIndex,!c&&!T)return;let L=re.pages[v.pageIndex],K=Zt(e);if(!L||!K||K.clientHeight<=0)return;let W=24,Q=L.contentBox.y-L.box.y,se=(L.box.y+Q+v.y)*l+e.offsetTop,be=se+v.height*l,ge=K.scrollTop,ie=ge+K.clientHeight,yt=ge;if(se<ge+W)yt=se-W;else if(be>ie-W)yt=be+W-K.clientHeight;else return;let aa=Math.max(0,K.scrollHeight-K.clientHeight),Or=Math.max(0,Math.min(yt,aa));Math.abs(Or-K.scrollTop)<.5||(K.scrollTop=Or,Gl());}let Be=n.editingMode??"edit",Gf=true,Si=Object.freeze({kind:"body"}),Xf=0,wi=tv(n.locale,Ie),Uo=n.translate,it=null,Ii=null,_l=null;function Xe(c,g,v,T=Oe(),L=true,K){Ie();let W=rr(c.some(zI)||!!K?.length,c,L);if(W!==null)return {committed:false,rejected:true,opCount:0,reason:W};let Q=WI(L&&it?it.annotate(c):c),se=Go(Q,g,v,T,K);return L&&it?.afterApply(se.committed),se.committed&&Q.some(Eu)&&r.onTrackedChange?.(),se}function Go(c,g,v,T=Oe(),L){let K=i?.gateOperations(c,T);if(K)return {committed:false,rejected:true,opCount:0,reason:K};Xf+=1;let W=ue.value;return a.applyTreeOps(c,g,v,T,i?{packageEdits:L,origin:chunkMXOO7KRI_cjs.b.mutationHuman,actorId:i.identity.actorId,operationId:`${i.identity.actorId}:${i.sessionId}:browser:${Xf}`,recordsHistory:false,historyGroup:W}:{packageEdits:L,historyGroup:W})}function rr(c,g=[],v=true){let T=zS(g);return Be==="view"&&!T?u:St&&c&&v&&!T&&E0(L=>Ue(a,L),F)?Ms:c&&!T&&(v&&ql()||g.some(L=>ak(L)))?f:Be==="suggest"&&!s?.trim()&&c?Te:Be==="suggest"&&g.some(L=>L.op==="deleteNote")?"suggesting cannot delete a note outright; strike its reference to propose the deletion":null}let Yf=$b(()=>rr(true,[],false),()=>a.editable);function zI(c){return c.op!=="acceptRevision"&&c.op!=="rejectRevision"&&c.op!=="acceptAllRevisions"&&c.op!=="rejectAllRevisions"}let jI=c=>chunkMXOO7KRI_cjs.Fh.has(c),Qf=()=>!a.trackingSettings().doNotTrackFormatting;function Jf(c,g,v){return c.flatMap(T=>Ru(T)?!v&&jI(T.op)?[T]:[T.revision!==void 0?T:{...T,revision:g}]:T.op==="splitParagraphMany"?[{...T,revision:g}]:T.op==="splitParagraph"?[T,{op:"setParagraphMarkRevision",paragraphId:T.paragraphId,kind:"ins",revision:g}]:T.op==="joinParagraphs"?[{op:"proposeParagraphMerge",paragraphId:T.secondId,revision:g}]:[T])}function ep(){let c=s?.trim();return Be==="suggest"&&c?c:void 0}function WI(c){let g=ep();return g===void 0?[...c]:Jf(c,{author:g,date:m()},Qf())}function UI(c,g,v){let T=kt(g);if(T===v)return c;let L=0;for(;L<v.length&&L<T.length&&v[L]===T[L];)L+=1;let K=0;for(;K<v.length-L&&K<T.length-L&&v[v.length-1-K]===T[T.length-1-K];)K+=1;let W=T.length-v.length,Q=se=>se.paragraphId!==g||se.offset<=L?se:se.offset>=v.length-K?{...se,offset:se.offset+W}:{...se,offset:L};return {anchor:Q(c.anchor),head:Q(c.head)}}function GI(c,g){let v=a.partFor(Oe())??a.part(),T=chunkMXOO7KRI_cjs.Ia(v,c),L=chunkMXOO7KRI_cjs.Ia(v,g);return T!==null&&L!==null&&T.id===L.id}function or(c){return {paragraphId:c.paragraphId,start:c.offset,end:c.offset}}function Ne(...c){let g=Y0(e);try{XI(...c);}finally{g();}}function XI(c,g,v={}){Ie(),v?.keepCellSelection||(Z=null),V=null,je.noteModelMoved();let T=ue.around(Ae,c,K=>typeof K=="boolean"?K:K.committed),L=typeof T=="boolean"||!T.rejected?null:T;if(L)Y=_b(String(L.reason??"rejected"),a.settingsRoot());else {Y=null;let K=g?.();K&&(Qo(),F=K,$({kind:"none"},false),Vt=null,vi=true);let W=v?.rearmPending;if(W&&W.properties.length>0){let{anchor:Q,head:se}=F;Q.paragraphId===se.paragraphId&&Q.offset===se.offset&&(V={properties:W.properties,base:W.base,position:se});}}oo(),Pr(L!==null);}function YI(){if(!Dt)return true;for(let c of [F.anchor,F.head]){let g=chunkBNZF6DYC_cjs.ne(re,c);if(g&&!Dt.has(g.pageIndex))return false}return true}function oo(){let c=i;if(!c)return;let g=gn?wv(Z?.text??F,T=>{let L=Ue(a,T)??a.part();return Iv(L,T)},Z?"cells":void 0):null,v=g?`${g.anchor.paragraphId}:${g.anchor.offset}|${g.head.paragraphId}:${g.head.offset}|${g.kind??""}`:"";v!==Cr&&(Cr=v,c.setLocalSelection(g));}function pt(c,g=false){let v=!qt(c,F);ve.length>0&&v&&Ie();let T=it?.beforeSelect(c);if(T===null)return;c=T??c,ne(c),O(c);let L=nr()?.id??null,K=Ut(a.part(),F.head)?.id;Qo(),F=c,Z=null,g||(Vt=null),YI()||(je.noteModelMoved(),It(false)),je.noteSelectionSettled(),je.mirrorToDom(true),Uf(true),ea(),Er.clear(),ao();let W=nr()?.id??null,Q=Ut(a.part(),F.head)?.id;(L!==W||K!==Q)&&It(false),oo(),n.onChange?.(nt());}let je=cS({session:a,storyScope:Oe,document:E,pagesLayer:C,selection:()=>F,setSelection:c=>pt(c),adoptSelection:c=>{let g=it?.beforeSelect(c);g!==null&&(c=g??c,ne(c),O(c),Qo(),F=c,Vt=null,vi=true,oo());},commit:c=>Ne(c),applyOps:(c,g,v)=>Xe(c,g,void 0,v),hasPendingInput:()=>ve.length>0,replacementOffset:(c,g,v)=>jl({paragraphId:c,offset:g},{paragraphId:c,offset:v}),render:()=>It(),flushLayout:()=>Ze(),flushToPaint:()=>Ln(),updateCaret:()=>{R.update(),Fu(C,pi());},textOf:c=>kt(c),pendingFormatOps:(c,g,v,T)=>le(c,g,v,T),selectionMark:()=>We(),now:Ge,recordSelectionMs:c=>{Ve=c;},isGesturing:()=>Wl?.dragging()??false,domSelection:()=>Z?$e(Z.text.anchor):F,holdsCellSelection:()=>Z!==null,replaceSelectionWith:c=>Ae.type(c),discardPaint:()=>chunkS35UK656_cjs.l(C)});fe=VS({session:a,layout:()=>re,sectionAtPage:Re,revisionDisplayMode:Mt,revisionAuthorFilter:ht,selection:()=>F,setScopeSelection:c=>{Ie(),Qo(),ne(c),Er.clear(),F=c,Z=null,Vt=null,oo();},noteModelMoved:()=>je.noteModelMoved(),render:()=>It(),mirrorToDom:()=>je.mirrorToDom(),notify:()=>n.onChange?.(nt()),materializedPages:()=>Dt,entryRefused:()=>Be==="view",leaveOtherStories:()=>we?.exitNote()}),we=WS({session:a,exitHeaderFooter:()=>fe?.exitHeaderFooter(),applyOps:Xe,commit:Ne,selection:()=>F,selectionMark:()=>We(),orderedStart:()=>zl(),deleteSelectionPlan:()=>Hn(),undo:()=>Ae.undo(),activeScope:()=>{let c=we?.activeNoteScope();return c||(fe?.activeScope()??{kind:"body"})},setActiveScopeBodyOrHf:c=>fe.setActiveScope(c),setSelection:c=>pt(c),noteModelMoved:()=>je.noteModelMoved(),render:()=>{Ze()||It();},revealNote:c=>{Ze();for(let g of re.pages){let v=[...g.footnotes?.notes??[],...g.endnotes?.notes??[]].find(T=>T.scopeId===c);if(v)return ra(v.box.y,v.box.height,{block:"nearest",offsetPx:48}),g.index}return null},notify:()=>n.onChange?.(nt()),lastRejection:()=>Y,setLastRejection:c=>{Y=c;}});function tp(c){c&&Ie(),Z=c,c&&(ne(c.text),Qo(),F=c.text),Vt=null,je.noteSelectionSettled(),je.mirrorToDom(),ea(),Er.clear(),ao(),oo(),n.onChange?.(nt());}let ar=null;function QI(){let g=chunkBNZF6DYC_cjs.ne(re,F.head)?.pageIndex??0,v=new Set;for(let T=g-1;T<=g+1;T+=1)T>=0&&T<re.pages.length&&v.add(T);return v}let np=new WeakMap;function JI(c){let g=np.get(c);if(g)return g;let v=new Map;for(let T of c.pages)for(let L of chunkBNZF6DYC_cjs.B(T))v.has(L.paragraphId)||v.set(L.paragraphId,T.index);return np.set(c,v),v}function ek(){let c=a.revision(),g=Dt??QI();if(ar?.layout===re&&ar.revision===c&&Gu(ar.pages,g))return ar.rects;let v=JI(re),T=(Q,se)=>{if(!g)return true;let be=v.get(Q),ge=v.get(se);if(be===void 0||ge===void 0)return true;for(let ie=Math.min(be,ge);ie<=Math.max(be,ge);ie+=1)if(g.has(ie))return true;return false},L=[];for(let Q of Jo()){if(Q.kind==="comment"){if(Q.range===null||!T(Q.range.start.paragraphId,Q.range.end.paragraphId))continue;L.push({key:chunkITNK6C5M_cjs.Fa(Q),from:{paragraphId:Q.range.start.paragraphId,offset:Q.range.start.offset},to:{paragraphId:Q.range.end.paragraphId,offset:Q.range.end.offset}});continue}let se=chunkITNK6C5M_cjs.Fa(Q),be=Q.kind==="revision"?Q.ranges:Q.range?[Q.range]:[];for(let[ge,ie]of be.entries())T(ie.start.paragraphId,ie.end.paragraphId)&&L.push({key:be.length===1?se:`${se}${p}${ge}`,from:{paragraphId:ie.start.paragraphId,offset:ie.start.offset},to:{paragraphId:ie.end.paragraphId,offset:ie.end.offset}});}let K=chunkBNZF6DYC_cjs.ge(re,L,g,x),W=[];for(let[Q,se]of K)for(let be of se)W.push({...be,key:Q});return ar={layout:re,revision:c,pages:g,rects:W},W}let Dn=null;function tk(c){Dn&&(c.impact==="text-local"&&c.created.length===0&&c.deleted.length===0&&c.splitJoin.length===0?Dn={packageRevision:a.packageRevision(),bodyRoot:a.part().root,index:Dn.index}:Dn=null);}function nk(){let c=a.packageRevision(),g=a.part().root;if(Dn&&Dn.packageRevision===c&&Dn.bodyRoot===g)return Dn.index;let v=new Map,T=K=>{let W=v.size;for(let[Q,se]of K)v.has(Q)||v.set(Q,W+se);};T(chunkMXOO7KRI_cjs.Vh(a.part()));let L=new Set([a.part()]);for(let K of a.headerFooterPartsBySection())for(let W of [K.headers,K.footers])for(let Q of W.values())L.has(Q)||(L.add(Q),T(chunkMXOO7KRI_cjs.Vh(Q)));for(let K of ["footnote","endnote"]){let W=a.partFor({kind:"notesPart",noteKind:K});!W||L.has(W)||(L.add(W),T(chunkMXOO7KRI_cjs.Vh(W)));}return Dn={packageRevision:c,bodyRoot:g,index:v},v}let Er=new Set,Xo=null,Yo=null,Bl=false,rp=false;function Qo(){Bl||(Yo=null);}function op(){let c=Yo;if(!c||!F)return null;let g=(T,L)=>T.paragraphId===L.paragraphId&&T.offset===L.offset;if(!g(F.anchor,c.anchor)||!g(F.head,c.head))return null;let v=Jo().find(T=>chunkITNK6C5M_cjs.Fa(T)===c.key);return !v||v.kind==="revision"&&Xo!==null&&Xo.has(v.revisionKind)&&!rp?null:v}function $l(){let c=op();if(c)return ap(c);let g=F?.head;if(!g)return null;let T=chunkITNK6C5M_cjs.Ja(Jo(),g,nk()).filter(L=>!(L.kind==="comment"&&L.resolved)&&!Er.has(chunkITNK6C5M_cjs.Fa(L))&&!(L.kind==="revision"&&Xo!==null&&Xo.has(L.revisionKind)))[0];return T?ap(T):null}function ap(c){if(c.kind!=="comment")return c;let g=chunkITNK6C5M_cjs.La(Jo(),c);return Er.has(chunkITNK6C5M_cjs.Fa(g))?null:g}function Jo(){return pn.filterItems(a.reviewItems())}let ip=xv({roster:er.get,styles:()=>En,slots:gi}),sp=ip.forAuthor,rk=ip.declaredFor;function ok(c,g,v){let T=c.split(p),L=T[0],K=g!==null&&L===chunkITNK6C5M_cjs.Fa(g);if(c.startsWith("comment-")){let ge=v.get(L),ie=ge?.kind==="comment"&&ge.resolved;return ie&&!K?null:K?`docx-comment-band docx-comment-band--active${ie?" docx-comment-band--resolved-active":""}`:"docx-comment-band"}if(c.startsWith("custom-"))return K?"docx-comment-band docx-comment-band--active":null;let W=v.get(L);if(!W||W.kind!=="revision")return null;let Q=T.length>1?Number(T[1]):0;return `docx-revision-band docx-revision-band--${(ge=>ge==="delete"||ge==="moveFrom"?"delete":ge==="insert"||ge==="moveTo"?"insert":ge==="replace"&&W.replacedRangeCount!==void 0?Q<W.replacedRangeCount?"delete":"insert":"other")(W.revisionKind)}${K?" docx-revision-band--active":""}`}let lp=null,dp,cp=null;function ao(c=false){let g=$l(),v=g?chunkITNK6C5M_cjs.Fa(g):null,T=er.get();if(!c&&lp===re&&dp===v&&cp===T.resolved)return;let L=new Map;for(let W of Jo())L.set(chunkITNK6C5M_cjs.Fa(W),W);let K=[];for(let W of ek()){let Q=ok(W.key,g,L);if(!Q)continue;let se=W.key.split(p)[0],be=L.get(se),ge=be?Au(be):null,ie=ge===null||ge===""?void 0:T.resolved.get(ge),yt=be?.kind==="revision"&&g!==null&&se===chunkITNK6C5M_cjs.Fa(g)?ie?.style?.activeBackground:void 0;K.push({...W,className:Q,...ie?{reviewAuthor:ie}:{},...yt!==void 0?{activeBackground:yt}:{}});}chunkS35UK656_cjs.o(A,re,K,{scale:l,...at?{pageOffsetX:at.pageOffsetX}:{}}),lp=re,dp=v,cp=T.resolved;}function ea(){it?.update();let c=Z?chunkWQFNWLNY_cjs.wa(re,Z.cellIds):M?chunkBNZF6DYC_cjs.ee(re,M,Fe(),x):chunkBNZF6DYC_cjs.fe(re,F,Fe(),x);chunkS35UK656_cjs.o(H,re,c,{scale:l,pageOffsetX:at?.pageOffsetX,...Z?{}:{className:M?"docx-retained-selection-rect":"docx-selection-mark-rect"}});}function ki(){if(!Tr){w.replaceChildren();return}let c=i;if(!c){w.replaceChildren();return}kv(w,re,c.remoteSelections(),{scale:l,pageOffsetX:at?.pageOffsetX,...Dt?{pages:Dt}:{},colorForAuthor:sp,declaredColorFor:rk,labelHost:to,measurer:x});}function Ti(c){let g=chunkMXOO7KRI_cjs.Be(a.part());if(c)return g.find(L=>L.id===c)??null;let v=jo?g.find(L=>L.id===jo):void 0;if(v)return v;let T=F.head.paragraphId;return g.find(L=>L.beginParagraphId===T||L.endParagraphId===T||L.resultParagraphIds.includes(T))??(g.length===1?g[0]:null)}function ql(){return ab(a.part(),F)}function ak(c){return ib(a.part(),c)}function up(){return new Set(chunkMXOO7KRI_cjs.Be(a.part()).flatMap(c=>[c.beginParagraphId,...c.resultParagraphIds,c.endParagraphId]))}function Zl(c){return new Set([c.beginParagraphId,c.endParagraphId,...c.resultParagraphIds])}function ik(c){let g=0;for(let v of re.pages)for(let T of chunkBNZF6DYC_cjs.B(v))c.has(T.paragraphId)&&(g+=T.lines.length);return g}function Kl(c,g){let v=new Set(g),T=new Map;for(let L of c.pages)for(let K of chunkBNZF6DYC_cjs.B(L)){if(!v.has(K.paragraphId)||T.has(K.paragraphId))continue;let W=L.pageFieldSource;T.set(K.paragraphId,chunkBNZF6DYC_cjs.lc(W?.pageNumber??L.index+1,W?.format));}return T}function Vl(c){if(Be==="view"||!a.editable)return false;let g=Ti(c);return !g||!chunkMXOO7KRI_cjs.De(a.part(),a.documentOutline(),g.instruction)?false:chunkMXOO7KRI_cjs.Ji(a.part(),{op:"rewriteTocPageNumbers",tocId:g.id,updates:[]})===null}function fp(c,g){if(!Number.isInteger(c)||!Number.isInteger(g)||c<1||g<1)return null;let v=Fn.sectionPropertiesAt(F.head.paragraphId),T=v.pageSize.widthTwips-v.margins.leftTwips-v.margins.rightTwips-v.margins.gutterTwips,L=Math.max(300,Math.floor(T/g));return {op:"insertTable",beforeParagraphId:F.head.paragraphId,rows:c,cols:g,columnWidthTwips:L}}function pp(c,g){if(Be==="view"||!a.editable)return false;let v=fp(c,g),T=a.partFor(Oe())??a.part();return v!==null&&chunkMXOO7KRI_cjs.Ji(T,v)===null}function sk(c,g){if(!pp(c,g))return false;let v=fp(c,g);if(!v)return false;let T=null,L=a.subscribe(W=>{W.caret&&(T=W.caret);}),K=false;try{Ne(()=>{let W=Xe([v],We());return W.committed||(Y=W.reason??"the table could not be inserted here"),K=W.committed,W},()=>{let W=T;return W?$e({paragraphId:W.paragraphId,offset:W.start}):null});}finally{L();}return K}let mp='TOC \\o "1-3" \\h';function gp(){let c=chunkMXOO7KRI_cjs.ze(mp);if(!c)return null;let g=a.documentOutline(),v=chunkMXOO7KRI_cjs.jf(a.part(),g,c,Kl(Ae.layout(),g.map(T=>T.blockId)),up(),i?.identity.actorId);return {op:"insertToc",beforeParagraphId:F.head.paragraphId,instruction:mp,alias:fi?.title??"TOC",entries:v.entries,bookmarksToCreate:v.bookmarksToCreate}}function hp(){if(Be==="view"||!a.editable||ql())return false;let c=gp();return c!==null&&chunkMXOO7KRI_cjs.Ji(a.part(),c)===null}function lk(){if(!hp())return false;let c=gp();if(!c)return false;let g=new Set(chunkMXOO7KRI_cjs.Be(a.part()).map(L=>L.id)),v=Go([c],void 0,void 0,Si);if(!v.committed)return Y=v.reason??"the table of contents could not be inserted",false;let T=chunkMXOO7KRI_cjs.Be(a.part()).find(L=>!g.has(L.id));return T?yp(T.id,"pageNumbers"):true}function yp(c,g="entire"){let v=Ti(c);if(!v||!Vl(v.id))return false;let T=Ae.layout(),L=a.documentOutline(),K=chunkMXOO7KRI_cjs.De(a.part(),L,v.instruction);if(!K)return false;let W=K.map(se=>se.blockId);if(g==="entire"){let se=chunkMXOO7KRI_cjs.jf(a.part(),L,v.instruction,Kl(T,W),Zl(v),i?.identity.actorId),be=Go([{op:"replaceTocResult",tocId:v.id,entries:se.entries,bookmarksToCreate:se.bookmarksToCreate}],void 0,void 0,Si);if(!be.committed)return Y=be.reason??"the table of contents could not be refreshed",false;if(T=Ae.layout(),v=Ti(v.id),!v)return true}let Q="";for(let se=0;se<3;se+=1){let be=Kl(T,W),ge=chunkMXOO7KRI_cjs.lf(a.part(),v,L,Zl(v)),ie=v.resultParagraphIds.flatMap((Or,bk)=>{let Fp=ge[bk],Mp=Fp?be.get(Fp):void 0;return Mp===void 0?[]:[{paragraphId:Or,pageNumberText:Mp}]});if(ie.length===0)break;let yt=ie.map(Or=>`${Or.paragraphId}\0${Or.pageNumberText}`).join("");if(yt===Q)break;Q=yt;let aa=Go([{op:"rewriteTocPageNumbers",tocId:v.id,updates:ie}],void 0,void 0,Si);if(!aa.committed){if(aa.rejected)return Y=aa.reason??"the table of contents page numbers were refused",false;break}T=Ae.layout(),v=Ti(v.id)??v;}return true}function dk(){return gv({session:a,editingMode:Be,collaborationActive:i!==void 0,reviewerFilterActive:ht()!==void 0,layout:Ae.layout(),canonicalUnfilteredLayout:An,styleCascade:Le(),numberingIndex:Nt(),displayMode:Mt()})}let{selectionMark:We,orderedRange:ir,orderedStart:zl,textOf:kt,inlineControlBeside:bp,splitEndsTheParagraph:ck,deleteSelectionPlan:Hn,deleteSelectionOps:uk,replacementOffset:jl}=Tx({session:a,layout:()=>re,selection:()=>F,cellSelection:()=>Z,editingMode:()=>Be,author:()=>s,trackedDate:m,storyScope:Oe,paragraphOrder:Fe,flushPendingInputAndLayout:He,trackedAuthorOrNone:ep,atParagraphEnd:(c,g)=>Kt.atParagraphEnd(c,g)}),{insertPlainText:vp,copyFlavoursNow:fk,pasteRichNow:pk,armForcePlainPaste:mk}=kx({session:a,textFormFieldId:()=>it?.fieldId()??null,layout:()=>re,cellSelection:()=>Z,editingMode:()=>Be,storyScope:Oe,paragraphOrder:Fe,actorId:()=>i?.identity.actorId,collaborationGate:(c,g)=>i?.gateOperations(c,g)??null,now:Ge,flushPendingInputAndLayout:He,orderedRange:ir,selectionMark:We,deleteSelectionPlan:Hn,consumePendingFormatOps:le,withoutPendingOnRejection:te,caretMark:or,commit:Ne});function ta(c){c&&(ot=null,He(),nn=Rn(ht()),Qe.invalidateAll(a.packageRevision(),"tracked-change-filter"),Qe.flush(),n.onChange?.(nt()));}let na=false,Ae={session:a,applyGatedTreeOps:(c,g,v,T)=>Go(c,g,v,T??Oe()),storyScope:Oe,imageDecodePort:()=>xr,layout:()=>(He(),re),state:nt,currentPage:(c="caret")=>{if(He(),c==="viewport"){let v=Ox(e,re,l);if(v!==null)return v}let g=chunkBNZF6DYC_cjs.ne(re,F.head);return g?g.pageIndex+1:1},setScale(c){if(!(c>0)||!Number.isFinite(c))return false;if(c===l)return true;let g={scale:l,defaults:h,measurer:x,producer:k,furnitureSource:nn};try{let v=Zt(e),T=v?{x:(v.scrollLeft-e.offsetLeft+v.clientWidth/2)/l,y:(v.scrollTop-e.offsetTop+v.clientHeight/2)/l}:null;if(l=c,n.measurer||(h=chunkWQFNWLNY_cjs.ea(l,{context:ko(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{}}),x=h.measurer),k=I(),nn=Rn(ht()),Dt=void 0,at=void 0,ar=null,Qe.invalidateAll(a.packageRevision(),"zoom"),Qe.flush(),v&&T){let L=Math.max(0,T.x*l+e.offsetLeft-v.clientWidth/2),K=Math.max(0,T.y*l+e.offsetTop-v.clientHeight/2),W=Number.isFinite(v.scrollWidth)?Math.max(0,v.scrollWidth-v.clientWidth):null,Q=Number.isFinite(v.scrollHeight)?Math.max(0,v.scrollHeight-v.clientHeight):null;v.scrollLeft=W===null?L:Math.min(L,W),v.scrollTop=Q===null?K:Math.min(K,Q),xi();}return !0}catch{(({scale:l,defaults:h,measurer:x,producer:k,furnitureSource:nn}=g)),Dt=void 0,at=void 0,ar=null;try{Qe.invalidateAll(a.packageRevision(),"zoom-rollback"),Qe.flush();}catch{}return false}},enqueueType:dt,flushPendingInput:He,type(c){let g=Hn(),v=g.replaceAt??g.collapseTo,T=le(v.paragraphId,v.offset,c.length),L=g.ops.length===0?B0(nr()):void 0,K=[...g.ops,$0(v,c,L)],W=_0(Ue(a,v.paragraphId)??a.part(),v.paragraphId,v.offset,c.length),Q={paragraphId:v.paragraphId,start:W,end:W};Ne(()=>te([...K,...T],K,We(),Q),()=>$e({paragraphId:v.paragraphId,offset:W}));},proposeTextChange:(c,g,v)=>mn(c,g,v),insertPlainText:c=>vp(c),deleteBackward(){if(it?.selectForDeletion("backward"))return;let c=Hn();if(c.ops.length>0){Ne(()=>Xe(c.ops,We(),or(c.collapseTo)),()=>$e(c.collapseTo));return}let g=ee()??void 0,v=F.head;if(v.offset===0){for(let se of chunkBNZF6DYC_cjs.S(re,v.paragraphId)){let be=kt(se);if(be.length!==0){Ne(()=>Xe([{op:"deleteText",paragraphId:se,start:be.length-1,end:be.length}],We(),or({paragraphId:se,offset:be.length-1})),()=>$e({paragraphId:se,offset:be.length-1}),{rearmPending:g});return}}let L=Fe(),K=L.indexOf(v.paragraphId),W=L[K-1];if(!W)return;if(!GI(W,v.paragraphId)){pt($e({paragraphId:W,offset:kt(W).length}));return}let Q=kt(W).length;Ne(()=>Xe([{op:"joinParagraphs",firstId:W,secondId:v.paragraphId}],We(),or({paragraphId:W,offset:Q})),()=>$e({paragraphId:W,offset:Q}),{rearmPending:g});return}let T=bp(v,"before");if(T){Ne(()=>Xe([{op:"removeContentControl",controlId:T.controlId,keepContent:false}],We(),or({paragraphId:v.paragraphId,offset:T.start})),()=>$e({paragraphId:v.paragraphId,offset:T.start}),{rearmPending:g});return}Ne(()=>Xe([{op:"deleteText",paragraphId:v.paragraphId,start:v.offset-1,end:v.offset}],We(),or({...v,offset:v.offset-1})),()=>$e({...v,offset:v.offset-1}),{rearmPending:g});},splitParagraph(){let c=Hn(),g=c.replaceAt??c.collapseTo,v=new Set(a.paragraphIdsIn(Oe())),T=ee()??{properties:ol(Ue(a,g.paragraphId)??a.part(),g.paragraphId,g.offset,Mt(),ht()),base:[]},L=ck(g),K=L?Kt.followerStyleId(g.paragraphId):void 0,W=T.properties.reduce((be,ge)=>chunkITNK6C5M_cjs.ta(be,chunkITNK6C5M_cjs.xa(be,ge)),[...T.base]),Q=L&&Be==="edit"&&W.length>0?[{op:"setParagraphMarkProperties",paragraphId:g.paragraphId,properties:W}]:[],se={op:"splitParagraph",paragraphId:g.paragraphId,offset:g.offset,tailStyleId:K};Ne(()=>te([...c.ops,...Q,se],[...c.ops,se],We()),()=>{let be=a.paragraphIdsIn(Oe()).find(ge=>!v.has(ge));return be?$e({paragraphId:be,offset:0}):null},{rearmPending:T});},navigate(c,g=false){if(He(),!g&&(c==="left"||c==="right")&&(F.anchor.paragraphId!==F.head.paragraphId||F.anchor.offset!==F.head.offset)){let W=ir();Vt=null;let Q=K0(re,W,Fe(),c,x);pt($e(Q),true);return}let v=Ic(re,F.head,c,Vt,fe?.getActive()??null,_e(),x);if(!v)return;let T=up(),L=sb(a.part(),v.position,["left","wordLeft","lineStart","up","pageUp"].includes(c));if(L&&(v={...v,position:L}),Ut(a.part(),v.position)){if(g)return;let Q=new Set(["left","wordLeft","lineStart","up","pageUp"]).has(c)?"up":"down",se=ik(T)+4;for(let be=0;be<se;be+=1){let ge=Ic(re,v.position,Q,v.desiredX,fe?.getActive()??null,_e(),x);if(!ge||ge.position.paragraphId===v.position.paragraphId&&ge.position.offset===v.position.offset)return;if(v=ge,!Ut(a.part(),v.position))break}if(Ut(a.part(),v.position))return}Vt=v.desiredX,we?.activeNoteScope()&&v.pageIndex!==void 0&&Number.isInteger(v.pageIndex)&&we.setActiveNotePageIndex(v.pageIndex);let K={anchor:g?F.anchor:v.position,head:v.position};pt(g?K:dl(re,K),true);},deleteWordBackward(){if(Ae.deleteSelection())return;let c=F.head,g=(it?.wordDeletionBoundary??chunkBNZF6DYC_cjs.be)(kt(c.paragraphId),c.offset,-1,chunkBNZF6DYC_cjs.se(re,c.paragraphId));if(g===c.offset){Ae.deleteBackward();return}Ne(()=>Xe([{op:"deleteText",paragraphId:c.paragraphId,start:g,end:c.offset}],We()),()=>$e({...c,offset:g}),{rearmPending:ee()??void 0});},deleteWordForward(){if(Ae.deleteSelection())return;let c=F.head,g=(it?.wordDeletionBoundary??chunkBNZF6DYC_cjs.be)(kt(c.paragraphId),c.offset,1,chunkBNZF6DYC_cjs.se(re,c.paragraphId));if(g===c.offset){Ae.deleteForward();return}Ne(()=>Xe([{op:"deleteText",paragraphId:c.paragraphId,start:c.offset,end:g}],We()),void 0,{rearmPending:ee()??void 0});},deleteForward(){if(it?.selectForDeletion("forward")||Ae.deleteSelection())return;let c=ee()??void 0,g=F.head,v=kt(g.paragraphId);if(g.offset<v.length){let K=bp(g,"after");if(K){Ne(()=>Xe([{op:"removeContentControl",controlId:K.controlId,keepContent:false}],We()),()=>$e(g),{rearmPending:c});return}Ne(()=>Xe([{op:"deleteText",paragraphId:g.paragraphId,start:g.offset,end:g.offset+1}],We()),void 0,{rearmPending:c});return}let T=Fe(),L=T[T.indexOf(g.paragraphId)+1];if(L){if(chunkBNZF6DYC_cjs.S(re,L).includes(g.paragraphId)){if(kt(L).length===0)return;Ne(()=>Xe([{op:"deleteText",paragraphId:L,start:0,end:1}],We()),()=>$e(g),{rearmPending:c});return}Ne(()=>Xe([{op:"joinParagraphs",firstId:g.paragraphId,secondId:L}],We()),()=>$e(g),{rearmPending:c});}},...Fn,...Ho,setSelection:c=>{qt(c,F)||$({kind:"programmatic"},false),pt(c);},selectDrawing(c,g){Ze();let v=Ks(re,c,g);if(!v)return false;let T=$e(v);return $({kind:"pointer",drawingNodeId:c},qt(T,F)),pt(T),Ka(Ae)?.drawingNodeId===c},revealPage(c,g){Ze();let v=re.pages.find(T=>T.index===c);return v?ra(v.box.y,v.box.height,g):false},revealParagraph(c,g){Ze();let v=chunkBNZF6DYC_cjs.ne(re,{paragraphId:c,offset:0});if(!v)return false;let T=re.pages.find(L=>L.index===v.pageIndex);return T?ra(T.contentBox.y+v.y,v.height,g):false},revealPosition(c,g){Ze();let v=chunkBNZF6DYC_cjs.ne(re,c);if(!v)return false;let T=re.pages.find(L=>L.index===v.pageIndex);return T?ra(T.contentBox.y+v.y,v.height,{block:"nearest",...g}):false},setEditable(c){Gf=c,Nl();},selectAll(){let c=Fe(),g=c[0],v=c[c.length-1];!g||!v||pt({anchor:{paragraphId:g,offset:0},head:{paragraphId:v,offset:kt(v).length}});},hyperlinks:_o,equations:tr,contentControls:Nn,formatPainter:On,canInsertTable:pp,insertTable:sk,canInsertToc:hp,insertToc:lk,canRefreshToc:Vl,canEditTextFormField:()=>it?.canEdit()??false,editTextFormField:()=>it?.edit()??false,refreshToc:yp,refreshRefFieldResults:dk,save:()=>J0(Ae,e,()=>na),isInsideToc:c=>chunkMXOO7KRI_cjs.Be(a.part()).some(g=>g.beginParagraphId===c||g.endParagraphId===c||g.resultParagraphIds.includes(c)),retainSelection:()=>{let c=Symbol("selection-pin");return q.set(c,F),M=F,ea(),c},releaseSelection:c=>{q.delete(c)&&(z(),ea());},retainedSelection:()=>M,publishedLayout:()=>re,drawingSelectionIntent:()=>_,overlayCoordinates:()=>Object.freeze({paintScale:l,pageOffsetX:at?.pageOffsetX??new Map}),commitReviewOps:(c,g)=>{He();let v=F.head.paragraphId,T=kt(v);return Ne(()=>{if(Be==="view")return {committed:false,rejected:true,opCount:0,reason:u};if(i&&(g===void 0||!P1.has(g)))return {committed:false,rejected:true,opCount:0,reason:"experimental-collaboration-body-text-only"};if(i){let K=i.gateOperations([],Oe());if(K)return {committed:false,rejected:true,opCount:0,reason:K}}let L=chunkMXOO7KRI_cjs.Nb(i?.identity.actorId,c);return {committed:L.committed,rejected:!L.committed,opCount:0,...typeof L.reason=="string"?{reason:L.reason}:{}}},()=>{Ze(),je.noteModelMoved();let L=Fe();if(L.length===0)return null;let K=UI(F,v,T);return Ja(re,L,K)})},revisionDisplayMode:Pn,replacementLanding:wr,applyAutomationOps:(c,g,v)=>{let T={committed:false,rejected:false,opCount:0},L=g??Si;return Ne(()=>{let K=rr(false);if(K!==null)return T={committed:false,rejected:true,opCount:0,reason:K};let W=null,Q=c(se=>{let be=rr(true,[],false);return be===null?chunkMXOO7KRI_cjs.Nb(i?.identity.actorId,()=>a.ensureHyperlinkRelationship(se,L)):(W=be,null)});return Q===null?T={committed:false,rejected:true,opCount:0,reason:W??"this engine will not author that hyperlink target"}:!n.reviewModel&&Q.some(Eu)?T={committed:false,rejected:true,opCount:0,reason:"review-module-required"}:T=Xe(Q,void 0,void 0,L,false,v)},()=>{Ze(),je.noteModelMoved();let K=Fe();return K.length===0?null:Ja(re,K,F)}),T},editingMode:()=>Be,setAuthor:c=>{s!==c&&(Ie(),s=c,c?.trim()&&fv(Y)&&(Y=null,n.onChange?.(nt())));},setDrawingStrings:c=>{tn!==c&&chunkS35UK656_cjs.g(tn)!==chunkS35UK656_cjs.g(c)&&(tn=c,He(),It(false));},setLocale:wi.set,setTranslate:c=>{Uo!==c&&(Uo=c,it?.update());},setTocLabels:c=>{fi=c;},setEditingMode:c=>{He();let g=Be!==c;Be=c,g&&c==="view"&&fe?.exitHeaderFooter(),g&&c==="view"&&On.disarm(),Ll(),Nl(),wc(e,Be),g&&It(false),Y=null,n.onChange?.(nt());},revisionAuthors:()=>er.get().value,setRevisionDisplayMode(c){na||c===Cn.view()||(He(),Cn.set(c),ta(true));},hiddenRevisionAuthors:()=>pn.hiddenAuthors,setRevisionAuthorVisible(c,g){ta(pn.setVisible(c,g));},setAllRevisionAuthorsVisible(c){ta(pn.setAllVisible(er.get().value.keys(),c));},showAllRevisionAuthors(){ta(pn.showAll());},setTrackedChangesFilter(c,g){ta(pn.setPredicate(c,g));},collaborationSession:()=>i??null,remotePresenceColor:sp,setShowParagraphMarks:Do.set,setRevisionStyles:c=>{c!==En&&(En=c,He(),It(false));},setRemoteCaretLabelHost:c=>{c!==to&&(to=c,ki());},setReviewActivationExclusions(c){Xo=c===null?null:new Set(c),ao(),n.onChange?.(nt());},activeReviewKey:()=>{let c=$l();return c?chunkITNK6C5M_cjs.Fa(c):null},activateReview:(c,g,v)=>{if(Er.clear(),rp=v?.allowExcluded??false,Yo=g?{key:c,anchor:g.anchor,head:g.head}:{key:c,anchor:F.anchor,head:F.head},g){Bl=true;try{pt(g);}finally{Bl=false;}return}ao(),n.onChange?.(nt());},activatedReviewKey:()=>op()===null?null:Yo?.key??null,dismissActiveReview:()=>{let c=$l();c&&(Er.add(chunkITNK6C5M_cjs.Fa(c)),Yo=null,ao(),n.onChange?.(nt()));},navigation:kr,bookmarks:()=>a.bookmarks(),selectedText(){if(Z)return chunkWQFNWLNY_cjs.xa(re,Z);let{from:c,to:g}=ir();return Ws(re,c,g,Fe())},copyFlavours:()=>fk(),pasteRich:(c,g)=>pk(c,g),armForcePlainPaste:mk,deleteSelection(){let c=Hn();return c.ops.length===0?false:(Ne(()=>Xe(c.ops,We(),or(c.collapseTo)),()=>$e(c.collapseTo)),true)},setCellSelection:tp,layoutSession:()=>y,undo:()=>{if(Be==="view"){Y=u,n.onChange?.(nt());return}if(Ie(),i){i.undo()&&Ci(null);return}let c=a.packageRevision(),g=a.undo();a.packageRevision()!==c&&Ci(g);},redo:()=>{if(Be==="view"){Y=u,n.onChange?.(nt());return}if(Ie(),i){i.redo()&&Ci(null);return}let c=a.packageRevision(),g=a.redo();a.packageRevision()!==c&&Ci(g);},sectionAtPage:Re,activeScope:()=>{let c=we?.activeNoteScope();return c||fe.activeScope()},setActiveScope:c=>(He(),c.kind==="note"?we.enterNote(c.id):c.kind!=="body"&&c.kind!=="headerFooter"?false:(we?.exitNote(),fe.setActiveScope(c))),insertNote:c=>(He(),we.insertNote(c)),deleteNote:(c,g)=>we.deleteNote(c,g),convertNote:(c,g)=>we.convertNote(c,g),convertAllNotes:c=>we.convertAllNotes(c),setNoteProperties:c=>we.setNoteProperties(c),enterNote:(c,g)=>(He(),we.enterNote(c,g)),exitNote:()=>(He(),we.exitNote()),notePropertiesState:()=>{let c=Ae.state().selection.head.paragraphId,g=a.packageRevision(),v=a.currentPackage(),T=a.part(),L=chunkMXOO7KRI_cjs.Lf(v),K=chunkMXOO7KRI_cjs.Wf(v,"footnote"),W=chunkMXOO7KRI_cjs.Wf(v,"endnote"),Q=Ae.activeScope().kind==="headerFooter",se=Ae.headerFooterState(),be=se?.rId??null,ge=se?.sectionIndex??null,ie=ot;if(ie&&ie.packageRevision===g&&ie.paragraphId===c&&ie.bodyPart===T&&ie.settingsPart===L&&ie.footnotesPart===K&&ie.endnotesPart===W&&ie.headerFooterOpen===Q&&ie.headerFooterRId===be&&ie.headerFooterSectionIndex===ge)return ie.result;let yt=US(Ae,ht());return ot={packageRevision:g,paragraphId:c,bodyPart:T,settingsPart:L,footnotesPart:K,endnotesPart:W,headerFooterOpen:Q,headerFooterRId:be,headerFooterSectionIndex:ge,result:yt},yt},notePreviewText:c=>GS(a,c),applyTableCommandPlan(c){if(!c.ok)return {ok:false,code:c.code,reason:c.reason};let g=null,v=a.subscribe(T=>{T.caret&&(g=T.caret);});try{let T=We(),L=c.selection.kind==="adoptCommittedCaret";Ne(()=>Xe(c.ops,T),L?()=>{let K=g;return K?$e({paragraphId:K.paragraphId,offset:K.start}):null}:void 0,c.selection.kind==="preserveSelection"?{keepCellSelection:!0}:void 0);}finally{v();}return Y?{ok:false,code:"invalidArgs",reason:Y}:{ok:true,changed:true}},enterHeaderFooter:c=>{He();let g=fe.enterHeaderFooter(c);if(!g)return g;let v=fe.getActive(),T=v?re.pages[v.pageIndex]:void 0;if(v&&T){let L=v.kind==="header"?T.header:T.footer,K=L?.box.y??(v.kind==="header"?T.box.y:T.box.y+T.box.height-1),W=L?.box.height??1;ra(K,W,{block:"nearest"});}return g},exitHeaderFooter:()=>(He(),fe.exitHeaderFooter()),headerFooterState:()=>fe.headerFooterStateStable(a.packageRevision()),...qS({applyOps:Xe,commit:Ne,deleteSelectionOps:uk,deleteSelectionPlan:()=>Hn(),orderedStart:zl,selectionMark:We,collapsedAt:$e,isHeaderFooterOpen:()=>fe?.getActive()!==null,lastRejection:()=>Y}),...KS({session:a,applyOps:Xe,commit:Ne,storyScope:Oe,selectionMark:We,editingMode:()=>Be,author:()=>s,trackedDate:m,decodePort:()=>xr,actorId:()=>i?.identity.actorId}),focus:()=>{E.activeElement!==C&&(C.focus({preventScroll:true}),je.mirrorToDom(true));},setTableInteractionLabel(c){d.resolve=c;},refreshTableInteractionLabels(){oa.refreshLabels();},destroy(){if(!na){na=true;try{Ln();}finally{E.removeEventListener("selectionchange",xp),C.removeEventListener("pointerdown",Rp,{capture:true}),C.removeEventListener("keydown",Pi,{capture:true}),C.removeEventListener("beforeinput",Pi,{capture:true}),C.removeEventListener("keydown",Ip),C.removeEventListener("beforeinput",Pp),C.removeEventListener("copy",kp),C.removeEventListener("cut",Tp),C.removeEventListener("paste",Cp),C.removeEventListener("compositionstart",wp),C.removeEventListener("compositionend",Sp),E.removeEventListener("scroll",Ep,{capture:true}),e.ownerDocument.defaultView?.removeEventListener("resize",Xl),Wo?.disconnect(),Hl=null,Ll(),Fl.destroy(),ro.destroy(),it?.destroy(),Ii?.destroy(),_l?.destroy(),Wl?.destroy(),oa.destroy(),kr.destroy(),eo.destroy(),je.destroy(),C.removeEventListener("contextmenu",zf),C.removeEventListener("click",jf),C.removeEventListener("pointermove",Hf),C.removeEventListener("pointerleave",Bf),Bo.destroy(),Qe.cancel(),G!==null&&clearTimeout(G),G=null,J&&J(),J=null,Pt.dispose(),chunkS35UK656_cjs.f(C),R.destroy(),Zo(),qo(),$o(),wt(),e.replaceChildren();}}}};function Ci(c){V=null;let g=it?.restoreAfterHistory();if(!c&&g&&(F=g),je.noteModelMoved(),Ze(),!c){pt(Ja(re,Fe(),F));return}let v={anchor:{paragraphId:c.paragraphId,offset:c.start},head:{paragraphId:c.paragraphId,offset:c.end}};pt(Fe().includes(c.paragraphId)?v:Ja(re,Fe(),v));}function ra(c,g,v){let T=Zt(e);if(!T||T.clientHeight===0)return false;let L=c*l+e.offsetTop,K=g*l,W=v?.offsetPx??24,Q=v?.block??"start",se=T.clientHeight;if(Q==="nearest"||Q==="centerIfNeeded"){let ie=L<T.scrollTop,yt=L+K>T.scrollTop+se;if(!ie&&!yt)return true}let be=Q==="center"||Q==="centerIfNeeded"?L-Math.max(0,(se-K)/2):Q==="nearest"&&L>T.scrollTop?L+K+W-se:L-W,ge=Math.max(0,T.scrollHeight-se);return T.scrollTo({top:Math.max(0,Math.min(be,ge)),behavior:v?.behavior??"auto"}),xi(),true}let{onSelectionChange:xp,onCompositionEnd:Sp}=je,wp=(...c)=>{je.adoptBeforeInput(),Ln(),je.onCompositionStart(...c);},Wl=null;it=X0({onRequest:n.onRequestTextFormField,onInvalidRequest:n.onRequestInvalidTextFormField,locale:wi.get,translate:(c,g)=>Uo?.(c,g)??c,pagesLayer:C,container:e,part:c=>Ue(a,c??F.head.paragraphId)??a.part(),parts:()=>a.storyParts(),protected:(c=F.head.paragraphId)=>chunkMXOO7KRI_cjs.Zh(a.settingsRoot())&&chunkMXOO7KRI_cjs._h(Ue(a,c)??a.part(),c),selection:()=>F,select:c=>pt(c),editable:()=>Be==="edit"&&!St,apply:c=>Hs(c,Ne,Xe),save:(c,g)=>ev(c,g,{session:a,commit:Ne,refusal:()=>rr(true,c,false),gate:(v,T)=>i?.gateOperations(v,T)??null,collaborationActive:i!==void 0})},r.initialTextFormInput),Hb(Ae,it.fieldId),_l=cv({pagesLayer:C,part:c=>Ue(a,c??F.head.paragraphId)??a.part(),editable:()=>Be==="edit"&&!St,protected:c=>chunkMXOO7KRI_cjs.Zh(a.settingsRoot())&&chunkMXOO7KRI_cjs._h(Ue(a,c)??a.part(),c),selection:()=>F,select:c=>pt(c),apply:c=>Hs(c,Ne,Xe)}),Ii=v0({pagesLayer:C,settings:()=>chunkMXOO7KRI_cjs.Lf(a.currentPackage()),part:c=>Ue(a,c??F.head.paragraphId)??a.part(),editable:()=>Be==="edit"&&!St,select:pt,canApply:c=>a.editable&&rr(true,[c],false)===null,history:c=>Ae[c](),apply:c=>Hs(c,Ne,Xe)});let gk=Gv(Ae,{...n,onToggleFieldCodes:()=>{He(),St=!St,nn=Rn(ht()),Qe.invalidateAll(a.packageRevision(),"field-code-view"),Qe.flush();}}),Ip=c=>{Ii?.keydown(c)||(c.defaultPrevented||je.adoptBeforeInput(),!(_l?.keydown(c)||it?.keydown(c))&&gk(c));},{onCopy:kp,onCut:Tp,onPaste:Cp}=Xv(Ae),hk=Yv(Ae,{isComposing:()=>je.isComposing(),insertPlainText:vp,onBrowserSelectionFixup:()=>{je.mirrorToDom(),je.noteBrowserSelectionFixup();}}),Pp=c=>{je.adoptBeforeInput(),hk(c);};E.addEventListener("selectionchange",xp);let yk=new Set(["Shift","Control","Alt","Meta","CapsLock","NumLock","ScrollLock","ContextMenu"]),Rp=c=>{if(c instanceof PointerEvent&&c.button!==0)return;let v=(c.target instanceof Element?c.target:null)?.closest("[data-drawing-node-id]")?.getAttribute("data-drawing-node-id");$(v?{kind:"pointer",drawingNodeId:v}:{kind:"none"},true);},Pi=c=>{if(c instanceof KeyboardEvent&&yk.has(c.key))return;if((c instanceof KeyboardEvent&&(c.key==="Delete"||c.key==="Backspace")&&!c.altKey&&!c.ctrlKey&&!c.metaKey||c instanceof InputEvent&&(c.inputType==="deleteContentBackward"||c.inputType==="deleteContentForward"))&&_.kind==="pointer"){let v=Ka(Ae);if(v!==null){c.preventDefault(),c.stopImmediatePropagation(),$({kind:"none"},true),Ae.deleteImage(v.drawingNodeId);return}}$({kind:"none"},true);};C.addEventListener("pointerdown",Rp,{capture:true}),C.addEventListener("keydown",Pi,{capture:true}),C.addEventListener("beforeinput",Pi,{capture:true}),C.addEventListener("keydown",Ip),C.addEventListener("beforeinput",Pp),C.addEventListener("copy",kp),C.addEventListener("cut",Tp),C.addEventListener("paste",Cp),C.addEventListener("compositionstart",wp),C.addEventListener("compositionend",Sp);let Ul=false;function Gl(){if(Ul)return;Ul=true;let c=e.ownerDocument.defaultView?.requestAnimationFrame,g=()=>{Ul=false,xi();};c?c(g):queueMicrotask(g);}let Ep=c=>{let g=Zt(e);!g||c.target!==g||Gl();};E.addEventListener("scroll",Ep,{capture:true,passive:true});let Xl=()=>{Gl();},Yl=e.ownerDocument.defaultView;Yl?.addEventListener("resize",Xl,{passive:true}),Wo=typeof Yl?.ResizeObserver=="function"?new Yl.ResizeObserver(Xl):null;function Op(){if(!Wo)return;let c=Zt(e);c!==Hl&&(Wo.disconnect(),Hl=c,c&&Wo.observe(c));}Op(),Wl=lS({onTextFormDoubleClick:c=>it?.doubleClick(c)??false,onTextFormPointerUp:c=>it?.pointerUp(c),pagesLayer:C,container:e,scale:()=>l,pageOffsetX:c=>at?.pageOffsetX.get(c)??0,layout:()=>(Ze(),re),measurer:()=>x,selection:()=>F,setSelection:c=>pt(c),cellSelection:()=>Z,setCellSelection:c=>tp(c),focus:()=>C.focus({preventScroll:true}),onSelectionSettled:()=>On.applyIfArmed(),activeHeaderFooter:()=>Xy(fe?.getActive()??null),activeNote:()=>{let c=we?.activeNoteScope();return c?{scopeId:c.id,pageIndex:we?.activeNotePageIndex()??null}:null},enterHeaderFooter:c=>{He(),fe?.enterHeaderFooter({rId:c.rId,pageIndex:c.pageIndex,sectionIndex:Re(c.pageIndex).sectionIndex,kind:c.kind,...c.position?{position:c.position}:{}});},enterNote:(c,g,v)=>{He(),we?.enterNote(c,g,v);},exitNote:c=>{He(),we?.exitNote(c);},exitHeaderFooter:()=>(He(),fe?.exitHeaderFooter()),enterEmptyHeaderFooter:(c,g)=>{if(Be==="view")return;He();let{sectionIndex:v,sectionStart:T}=Re(g),L=a.headerFooterResolutionBySection(),K=L[Math.min(v,Math.max(0,L.length-1))],W=re.pages[g]?.pageFieldSource?.pageNumber??g+1,Q=K?.evenAndOddHeaders&&W%2===0?"even":K?.titlePage&&g===T?"first":"default",se=ge=>{let ie=ge[Math.min(v,Math.max(0,ge.length-1))];return c==="header"?ie?.headers:ie?.footers},be=se(L)?.get(Q)?.rId;if(!be){if(!Ae.applyHeaderFooterLifecycle?.({op:"createHeaderFooter",sectionIndex:v,kind:c,variant:Q,...Q==="first"?{titlePage:true}:{},...Q==="even"?{evenAndOddHeaders:true}:{}})?.ok)return;be=se(a.headerFooterResolutionBySection())?.get(Q)?.rId,Ze();}be&&fe?.enterHeaderFooter({rId:be,pageIndex:g,sectionIndex:v,kind:c,variant:Q});},onContentControlWidget:(c,g)=>KI(c,g),...n.reviewModel?{onChangeBarToggle:Cn.toggleByChangeBar}:{},isReadOnlyPosition:c=>Ut(a.part(),c)!==void 0},n.pointer?{mode:n.pointer}:{});let oa=eS({pagesLayer:C,furnitureLayer:P,scale:()=>l,pageOffsetX:c=>at?.pageOffsetX.get(c)??0,read:()=>({layout:re,storeRevision:a.packageRevision(),selection:F,cellSelection:Z,editingMode:Be,themeColors:a.documentThemeColors()}),session:()=>a,applyTableCommandPlan:c=>Ae.applyTableCommandPlan(c),label:c=>d.resolve(c)});if(It(),Ii?.sync(),Tr=true,ki(),i&&(qo=i.subscribeStatus(()=>{n.onChange?.(nt());})),i&&gn)try{$o=i.attach(gn);}catch{try{i.destroy();}catch{}}return oo(),Nl(),Ae.setTableInteractionLabel=c=>{d.resolve=c,oa.refreshLabels();},Ae.refreshTableInteractionLabels=()=>{oa.refreshLabels();},M0(Ae,()=>({measurer:n.measurer,producer:n.producer,fontAlias:n.fontAlias,defaultFontFamily:n.defaultFontFamily}),c=>{n={...n,...c},x=n.measurer??h.measurer,k=I();},()=>{na||(nn=Rn(ht()),Dt=void 0,at=void 0,ar=null,Qe.invalidateAll(a.packageRevision(),"fonts"),Qe.flush());}),{ok:true,surface:Ae}}function JS(e,t,n,r,o){let a=new Map,i=chunkWQFNWLNY_cjs.pa(e,{resolveFont:l=>{let d=l.fontFamily??t.defaultFont.family;if(d.trim().length===0)return null;let u={family:d,weight:l.bold?700:400,style:l.italic?"italic":"normal"},f=chunkWQFNWLNY_cjs.g(u);if(a.has(f))return a.get(f)??null;let p;try{p=e.fonts.resolve(u);}catch{return a.set(f,null),null}let m=p instanceof chunkWQFNWLNY_cjs.d?null:p;return a.set(f,m),m},fallback:n.measurer}),s=`shaped:${e.operation.extensionFingerprint}+algorithm:${e.operation.shapingHash}+producer:${e.operation.producerVersion}+fallback:${n.producer}@scale:${r}+fonts:${o}`;return {measurer:i,producer:s}}function ew(e,t){let n,r=false,o=()=>{r=false;let i=e();if(!i)return;let s=n?.generation!==i.generation;s&&(n={generation:i.generation,requested:new Set,running:false});let l=n;if(l.running||!s&&!i.dynamic)return;let d=i.dynamic?i.families().filter(u=>!l.requested.has(u.toLowerCase())):[];if(!(!s&&d.length===0)){for(let u of d)l.requested.add(u.toLowerCase());l.running=true,t(d).finally(()=>{l.running=false,n===l&&a();});}},a=(i=false)=>{if(i){o();return}r||(r=true,queueMicrotask(o));};return {schedule:a}}function bf(e){let t=[],n=(r,o)=>{let a=o.kind,i=r.handlers.kinds??e;return typeof a!="string"||!i||i.includes(a)};return {request(r){let o=t.filter(l=>n(l,r)),a=[...o].reverse().find(l=>!l.fallback)??o.at(-1);if(!a?.handlers.onRequest)return false;let{sessions:i,handlers:s}=a;return i.add(r),r.signal.addEventListener("abort",()=>i.delete(r),{once:true}),s.onRequest(r),true},register(r,o){let a={handlers:r,fallback:o?.fallback===true,sessions:new Set};return t.push(a),()=>{let i=t.indexOf(a);if(!(i<0)){t.splice(i,1);for(let s of a.sessions)s.cancel();}}}}}var R1=()=>bf();function tw(){let e=R1(),t=bf(["dropdown","comboBox","date","buildingBlockGallery"]),n=bf();return {surfaceOptions:{onRequestTextFormField:e.request,onRequestContentControlWidget:t.request,onRequestInvalidTextFormField:n.request},setters:{setTextFormFieldChrome:e.register,setContentControlWidgetChrome:t.register,setInvalidTextFormFieldChrome:n.register}}}function nw(e,t){let n=e.review;return n?{reviewModel:{...n,collectReviewItems:r=>n.collectReviewItems(e.customNodes.length>0?{...r,customNodes:e.customNodes,...e.customNodeDiagnostics.length>0?{reportCustomNodeDiagnostic:t}:{}}:r)}}:{}}var E1=["all-markup","simple-markup","proposed","original"];function rw(e){let t=()=>e.placements().filter(l=>l.kind==="revision"&&(l.activatable||l.revisionKind==="format")),n=()=>e.surface()?.session.reviewItems().filter(l=>l.kind==="revision")??[],r=l=>{let d=n(),u=new Set(l.keys??(l.scope==="document"?d:e.visible()).filter(b=>b.kind==="revision").map(chunkITNK6C5M_cjs.Fa)),f=new Map;for(let b of d){let y=e.scope(b),I=Ue(e.surface().session,chunkITNK6C5M_cjs.Ea(b)[0]);if(!I)continue;let k=f.get(I.name);k||(k={scope:y,part:I,keys:[]},f.set(I.name,k));let E=chunkITNK6C5M_cjs.Fa(b);u.delete(E)&&k.keys.push(E);}let p=[],m=[...u].map(b=>({key:b,reason:"unknown-revision"})),h=[],x=0;for(let{scope:b,part:y,keys:I}of f.values()){let k=chunkITNK6C5M_cjs._a(y,l.action,I);p.push(...k.result.resolved),m.push(...k.result.skipped),x+=k.result.remaining,k.ops.length&&h.push({scope:b,ops:k.ops});}return {groups:h,result:{resolved:p,skipped:m,remaining:x}}},o=()=>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:un},a=l=>{if(l.type!=="navigateReviewChange"&&l.type!=="resolveAllReviewChanges"&&l.type!=="setReviewDisplayMode")return null;let d=o();if(!d.ok)return d;if(l.type==="setReviewDisplayMode")return E1.includes(l.mode)?{ok:true}:{ok:false,code:"invalidArgs",reason:"unknown review display mode"};if(l.type==="navigateReviewChange"&&!["next","previous"].includes(l.direction))return {ok:false,code:"invalidArgs",reason:"unknown review navigation direction"};if(l.type==="resolveAllReviewChanges"&&!["accept","reject"].includes(l.action))return {ok:false,code:"invalidArgs",reason:"unknown review resolution action"};if(l.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 u=wn(l,e.surface());if(u)return u;if(l.scope!==void 0&&!["visible","document"].includes(l.scope)||l.unsupported!==void 0&&!["skip","fail"].includes(l.unsupported)||l.keys!==void 0&&(!Array.isArray(l.keys)||l.keys.some(p=>typeof p!="string")))return {ok:false,code:"invalidArgs",reason:"invalid bulk revision selection"};let{result:f}=r(l);return l.unsupported==="fail"&&f.skipped.length?{ok:false,code:"unsupported",reason:"some selected changes cannot be resolved"}:f.resolved.length?{ok:true}:{ok:false,code:f.skipped.length?"unsupported":"notFound",reason:"no eligible selected changes to review"}};return {can:a,exec:l=>{if(!["navigateReviewChange","resolveAllReviewChanges","setReviewDisplayMode"].includes(l.type))return null;e.surface()?.flushPendingInput();let d=a(l);if(!d)return null;if(!d.ok){if(l.type==="resolveAllReviewChanges"&&(d.code==="notFound"||d.code==="unsupported")&&o().ok&&!e.viewing()){let{result:h}=r(l);return {...d,revisions:{...h,resolved:[],remaining:h.remaining+h.resolved.length}}}return d}let u=e.surface();if(l.type==="setReviewDisplayMode")return e.setDisplayMode(l.mode),{ok:true,changed:false};if(l.type==="navigateReviewChange"){let h=t(),x=h.findIndex(k=>k.isActive),b=l.direction==="next"?1:-1,y=x<0?O1(h,u,b):(x+b+h.length)%h.length,I=h[y];return e.activate(I.key,!I.activatable&&I.revisionKind==="format")}if(l.type!=="resolveAllReviewChanges")return null;let{groups:f,result:p}=r(l),m;return u.commitReviewOps(()=>(m=u.session.applyTreeOpsAtomic(f),m),"revision-resolve"),m?.committed?(e.activate(null),{ok:true,changed:true,revisions:{...p,remaining:n().length}}):{ok:false,code:"unsupported",reason:typeof m?.reason=="string"?m.reason:"the revisions were refused"}},resolveReviewItem:(l,d)=>{let u=o();if(!u.ok)return u;if(e.viewing())return e.surface().commitReviewOps(()=>({committed:false,reason:"the document is open for viewing"}),"revision-resolve"),{ok:false,code:"locked",reason:"the document is open for viewing"};let f=wn({type:"resolveAllReviewChanges"},e.surface());if(f)return f;e.surface().flushPendingInput();let p=e.placements().find(h=>h.key===l)?.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:"this revision kind has no structural accept/reject yet"};let m;return e.surface().commitReviewOps(()=>(m=e.surface().session.applyTreeOps(F1(p,d,e.surface().session.partFor(e.scope(p))),void 0,void 0,e.scope(p)),m),"revision-resolve"),m?.committed?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:typeof m?.reason=="string"?m.reason:"the revision was refused"}}}}function O1(e,t,n){let r=t.state().selection.head,o=t.session.storyParts().find(s=>r.paragraphId.startsWith(`${s.name}#`)),a=o?chunkMXOO7KRI_cjs.Vh(o):new Map,i=a.get(r.paragraphId);if(i!==void 0)for(let s=n>0?0:e.length-1;s>=0&&s<e.length;s+=n){let l=e[s],d=l.kind==="revision"?l.item.ranges[0]?.start:void 0,u=d?a.get(d.paragraphId):void 0;if(d&&u!==void 0&&(n>0?u>i||u===i&&d.offset>=r.offset:u<i||u===i&&d.offset<=r.offset))return s}return n>0?0:e.length-1}function F1(e,t,n){let r=t==="accept"?"acceptRevision":"rejectRevision";if(!n)return [];let o=new Set(chunkITNK6C5M_cjs.Ea(e)),a=new Map;for(let i of chunkMXOO7KRI_cjs.Ih(n)){if(!o.has(i.node.id))continue;let s=p=>i.node.attributes.find(m=>m.namespaceUri===chunkMXOO7KRI_cjs.da&&m.localName===p)?.value,l=e.addresses.find(p=>p.id===s("id")&&p.author===s("author")&&(p.date??"")===(s("date")??""));if(!l)continue;let d=e.revisionKind==="structural"?void 0:i.node.localName,u=JSON.stringify([l,d]),f=a.get(u);f?f.siteNodeIds.push(i.node.id):a.set(u,{revision:l,localName:d,siteNodeIds:[i.node.id]});}return [...a.values()].map(({revision:i,localName:s,siteNodeIds:l})=>({op:r,revision:i,...s===void 0?{}:{localName:s},siteNodeIds:l}))}function vf(e){return e.kind==="comment"?e.comment.date:e.kind==="revision"?e.date:void 0}function xf(e,t,n,r){return e.type!=="toggleReviewPane"&&e.type!=="toggleParagraphMarks"&&e.type!=="setEditingMode"?null:t?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.type==="toggleReviewPane"&&!n?{ok:false,code:"unsupported",reason:un}:e.type==="setEditingMode"?r(e.mode)??{ok:true}:{ok:true}}function ow(e){let t=false;return {get:()=>t,toggle:()=>{t=!t,e(t);}}}function aw(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 "setAlignment":return t.alignment===(e.align==="justify"?"both":e.align);case "toggleList":return n(e.kind);default:return false}}function M1(e){return e==="password"?{ok:false,code:"locked",reason:iw}: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 iw="this document is protected with a password; open it in Word to change that";function sw(e){let t=null,n=null,r=()=>{let l=e.tracking();return [l.restrictedToReadOnly,l.restrictedToComments,l.restrictedToForms,l.restrictedToTrackedChanges].join("|")},o,a=null,i=()=>{let l=e.surface();if(!l)return null;let d=l.session.settingsRoot();return (d!==o||a===null)&&(o=d,a=d?chunkMXOO7KRI_cjs.Df(d):chunkMXOO7KRI_cjs.Cf),a},s=()=>{if(e.destroyed())return {ok:false,code:"notFound",reason:"the editor was destroyed"};let l=i();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:iw}:!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 d=r();d!==t&&(t=d,e.adopt(e.decision()));},prime:()=>{n=e.surface()?.session.settingsRoot()??null,t=r();},state:i,isActive:()=>i()?.enforced===true,can(l){return l.type!=="toggleDocumentProtection"?null:s()??{ok:true}},exec(l){if(l.type!=="toggleDocumentProtection")return null;let d=s();if(d&&!d.ok)return d;let u=e.surface(),f=!i().enforced,p=u.applyHeaderFooterLifecycle?.({op:"setDocumentProtection",enforce:f});return p?p.ok?(e.publish(),{ok:true,changed:true}):M1(p.reason):{ok:false,code:"unsupported",reason:"document protection is not available"}}}}var A1=e=>chunkBNZF6DYC_cjs.B(e);function dw(){let e=new WeakMap;return t=>{let n=e.get(t);if(n)return n;let r=chunkWQFNWLNY_cjs.ka(t,A1);for(let o of t.pages){for(let a of [o.header,o.footer])a&&lw(r,a.fragments,o.index,a.box.y);for(let a of [o.footnotes,o.endnotes])if(a)for(let i of a.notes)lw(r,i.fragments,o.index,i.box.y);}return e.set(t,r),r}}function lw(e,t,n,r){for(let o of chunkBNZF6DYC_cjs.C(t))for(let a of chunkBNZF6DYC_cjs.T(o))e.has(a)||e.set(a,{pageIndex:n,contentY:r,fragmentY:o.box.y,...o.lines?{lines:o.lines}:{}});}function gl(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 L1(e){return e?.kind==="headerFooter"||e?.kind==="note"}function cw(e,t){return t!=="viewing"&&typeof e.enterHeaderFooter=="function"&&typeof e.enterNote=="function"?"all":"body"}function hl(e,t){e.activeScope().kind!=="body"&&e.session.paragraphIds().includes(t)&&(e.exitNote?.(),e.exitHeaderFooter?.());}function uw(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 a={ok:false,code:"unsupported",reason:"the text box drawing could not be selected"};if(!Ks(e.layout(),r,o))return a;let i=t.scope.owner;if(i){let s=gl(e,i,{paragraphId:o,offset:0});if(!s.ok)return s}else hl(e,o);return e.revealParagraph(o),e.selectDrawing(r,o)?{ok:true,changed:false}:a}let n={paragraphId:t.blockId,offset:t.start};if(L1(t.scope)){let r=gl(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"};hl(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 fw(e){if(e==="")return;let t=globalThis.navigator?.clipboard;if(t?.writeText)try{t.writeText(e).catch(()=>{});}catch{}}function Sf(e,t){if(e===""&&(t===null||t===""))return;let n=globalThis.navigator?.clipboard;if(!n)return;let r=globalThis.ClipboardItem;if(t&&n.write&&r&&typeof Blob<"u")try{let o=new r({"text/plain":new Blob([e],{type:"text/plain"}),"text/html":new Blob([t],{type:"text/html"})});n.write([o]).catch(()=>{fw(e);});return}catch{}fw(e);}function N1(e){return typeof e=="object"&&e!==null&&"container"in e&&Array.isArray(e.path)}function D1(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function pw(e){return mw(e.children)}function mw(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||chunkMXOO7KRI_cjs.Ac(n))&&t.push(n);return t}function H1(e){if(chunkMXOO7KRI_cjs.Ac(e))return mw(chunkMXOO7KRI_cjs.Dc(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(...pw(r));return t}function _1(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"},a=e.session.partFor(o);if(!a)return {ok:false,code:"notFound",reason:"the target story was not found"};let i="noteId"in r?r.noteId:null,s=r.part==="body"?chunkMXOO7KRI_cjs.Ad(a):chunkMXOO7KRI_cjs.yd(a).find(m=>r.part==="header"||r.part==="footer"?m.kind===r.part:m.kind==="note"&&chunkMXOO7KRI_cjs.id(m.root)===i)?.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=pw(s),d;for(let m=0;m<t.path.length;m+=1){let h=t.path[m];if(!Number.isInteger(h)||h<0)return {ok:false,code:"invalidArgs",reason:"DocLocation indices must be non-negative"};if(d=l[h],!d)return {ok:false,code:"notFound",reason:`block index ${h} is out of range`};m<t.path.length-1&&(l=H1(d));}if(!d||d.kind!=="paragraph"||!chunkMXOO7KRI_cjs.Ha(a,d.id))return {ok:false,code:"invalidArgs",reason:"DocLocation must resolve to a paragraph"};let u=(chunkMXOO7KRI_cjs.Di(a,d.id)??"").length,f=t.offset??(n==="start"?0:u);if(!Number.isInteger(f)||f<0||f>u)return {ok:false,code:"invalidArgs",reason:"DocLocation offset is outside the paragraph"};let p={paragraphId:d.id,offset:f};return {ok:true,selection:{anchor:p,head:p}}}function yl(e,t,n){if(N1(t))return _1(e,t,n);if(!Tt(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 a=vt(e.session,o,{kind:"body"}),i=e.session.partFor(a);if(!i)return {ok:false,code:"notFound",reason:"the target story was not found"};let s=cn(i,r,t);if(!s.ok)return s;let l=n==="start"?s.span.start:s.span.end,d={paragraphId:s.span.nodeId,offset:l};return {ok:true,selection:{anchor:d,head:d}}}function bl(e,t){if(!D1(t)){let o=yl(e,t,"start");if(!o.ok)return o;let a=yl(e,t,"end");return a.ok?{ok:true,selection:{anchor:o.selection.anchor,head:a.selection.head}}:a}let n=yl(e,t.from,"start");if(!n.ok)return n;let r=yl(e,t.to,"end");return r.ok?{ok:true,selection:{anchor:n.selection.anchor,head:r.selection.head}}:r}function B1(e){return e.evenPage?"even":e.firstPage?"first":"default"}function gw(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'"}:B1(e)}function wf(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 a=t.variant!==void 0||t.firstPage!==void 0||t.evenPage!==void 0?gw(t):n?.variant??"default";if(typeof a=="object"&&a.ok===false)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:a.reason}};let i=a,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:i}}function $1(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 li(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}:$1(n.reason)}function vl(e,t,n,r){let a=e.session.headerFooterResolutionBySection()[t];if(!a)return null;let s=(n==="header"?a.headers:a.footers).get(r);return s?{rId:s.rId,partName:s.partName,inherited:s.inherited,titlePage:a.titlePage,evenAndOddHeaders:a.evenAndOddHeaders}:null}function hw(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=gw(t);if(typeof o=="object"&&o.ok===false)return {ok:false,code:"invalidArgs",reason:o.reason};let a=o,s=vl(e,n,r,a)?.rId,l=false;if(!s){let u=li(e,{op:"createHeaderFooter",sectionIndex:n,kind:r,variant:a,...a==="first"?{titlePage:true}:{},...a==="even"?{evenAndOddHeaders:true}:{}});if(!u.ok)return u;l=true,s=vl(e,n,r,a)?.rId;}return s?e.enterHeaderFooter({rId:s,kind:r,sectionIndex:n,variant:a})?{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 yw(e,t){let n=wf(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=r?.rId,a=li(e,{op:"deleteHeaderFooter",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});return a.ok&&o&&r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant&&e.exitHeaderFooter(),a}function bw(e,t){let n=wf(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,a=li(e,{op:"linkToPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!a.ok)return a;if(o){let i=vl(e,n.sectionIndex,n.kind,n.variant);i?e.enterHeaderFooter({rId:i.rId,kind:n.kind,sectionIndex:n.sectionIndex}):e.exitHeaderFooter();}return a}function vw(e,t){let n=wf(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,a=r?.rId,i=li(e,{op:"unlinkFromPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!i.ok)return i;let s=vl(e,n.sectionIndex,n.kind,n.variant);return o&&s&&s.rId!==a&&e.enterHeaderFooter({rId:s.rId,kind:n.kind,sectionIndex:n.sectionIndex}),i}function xw(e,t){let n=e.headerFooterState(),r=t.sectionIndex??n?.sectionIndex;return li(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 Sw(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 ww(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 Iw(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 kw(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 Tw(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 Cw(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 Rw(e,t,n){switch(t.type){case "toggleMark":{let r=Kc.get(t.mark);e.toggleRunProperty(r.localName,r.attributes);break}case "setMarkAttr":{let r=Vc(t);if(!r.ok)return {ok:false,code:r.code,reason:r.reason};e.setRunProperty(r.localName,r.attributes);break}case "clearFormatting":e.clearFormatting();break;case "copyFormatting":return e.formatPainter.capture()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:xs};case "pasteFormatting":{let r=e.formatPainter.apply();if(r==="nothingToPaint")return {ok:false,code:"notFound",reason:Rc};if(r==="refused")return {ok:false,code:"locked",reason:e.state().lastRejection??Rc};break}case "setLineSpacing":e.setParagraphProperty("spacing",cl({rule:t.rule,value:t.value}),{mergeAttributes:true});break;case "setParagraphSpacing":e.setParagraphProperty("spacing",{...Fo("before",t.beforePt),...Fo("after",t.afterPt)},{mergeAttributes:true});break;case "setAlignment":e.setParagraphProperty("jc",{val:t.align==="justify"?"both":t.align});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.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,a=t.pageHeight;if(t.orientation!==void 0&&(o!==void 0||a!==void 0)){let s=r?e.sectionPropertiesAt(r):e.sectionProperties(),l=o??s.pageSize.widthTwips,d=a??s.pageSize.heightTwips;o=t.orientation==="landscape"?Math.max(l,d):Math.min(l,d),a=t.orientation==="landscape"?Math.min(l,d):Math.max(l,d);}if(!e.setSectionProperties({...o!==void 0?{pageWidthTwips:o}:{},...a!==void 0?{pageHeightTwips:a}:{},...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 "insertText":if(e.type(t.text),e.state().lastRejection==="the table of contents is generated and read-only"||e.state().lastRejection===Ms)return {ok:false,code:"invalidArgs",reason:e.state().lastRejection};break;case "deleteText":e.deleteSelection();break;case "proposeInsertion":case "proposeDeletion":case "proposeReplacement":{if(t.target!==void 0){let a=bl(e,t.target);if(!a.ok)return {ok:false,code:a.code,reason:a.reason};e.setSelection(a.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 "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 hw(e,t);case "exitHeaderFooter":return typeof e.exitHeaderFooter=="function"&&e.exitHeaderFooter(),{ok:true,changed:false};case "removeHeaderFooter":return yw(e,t);case "linkHeaderFooterToPrevious":return bw(e,t);case "unlinkHeaderFooterFromPrevious":return vw(e,t);case "setHeaderFooterOptions":return xw(e,t);case "insertPageField":return Sw(e,t);case "insertNote":return ww(e,t);case "deleteNote":return Iw(e,t);case "convertNote":return kw(e,t);case "convertAllNotes":return Tw(e,t);case "setNoteProperties":return Cw(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(!mr(t))return {ok:false,code:"unsupported",reason:"unsupported command"};let r=n?.admittedTablePlan??Wn({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 Sf(r.text,r.html),{ok:true,changed:false}}case "cut":{let r=e.copyFlavours();Sf(r.text,r.html),e.deleteSelection();break}case "paste":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&&zc(t.range))return e.setSelection(t.range),e.revealPosition(t.range.head,{block:"centerIfNeeded"}),{ok:true,changed:false};let r="anchor"in t&&Tt(t.anchor)?{anchor:t.anchor}:"range"in t&&Kr(t.range)?{range:t.range}:null;if(r===null)return {ok:false,code:"unsupported",reason:"unsupported selection form"};let o=Cb(e.session.part(),e.session.paragraphAnchors(),r);if(!o.ok)return o;let a=K1(e,o.selection);return a.ok?(e.setSelection(o.selection),e.revealPosition(o.selection.head,{block:"centerIfNeeded"}),{ok:true,changed:false}):a}default:return Va(t)?Yb(e,t,n?.editor):{ok:false,code:"unsupported",reason:"unsupported command"}}return null}function Pw(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 a of chunkBNZF6DYC_cjs.C(o.fragments))if(a.paragraphId===t)return o.scopeId}return null}function q1(e,t){let n=e.layout().pages;for(let r=0;r<n.length;r+=1){let o=n[r];for(let a of [o.header,o.footer])if(a){for(let i of chunkBNZF6DYC_cjs.C(a.fragments))if(i.paragraphId===t)return {pageIndex:r,sectionIndex:e.sectionAtPage(r).sectionIndex}}}return null}function Z1(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 K1(e,t){let n=vt(e.session,t.head.paragraphId,{kind:"body"}),r=vt(e.session,t.anchor.paragraphId,{kind:"body"});if(!Z1(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=q1(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 a=Pw(e,t.head.paragraphId);return a?(t.anchor.paragraphId===t.head.paragraphId?a:Pw(e,t.anchor.paragraphId))!==a?{ok:false,code:"unsupported",reason:"a selection cannot span two stories"}:o.kind==="note"&&o.id===a?{ok:true,changed:false}:(e.exitHeaderFooter?.(),e.enterNote?.(a)?{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 V1=new Set(["toggleMark","setMarkAttr","setAlignment","clearFormatting","setLineSpacing","setParagraphSpacing","setParagraphStyle","setParagraphFormat"]),xl=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()}`,a=Date.now(),i=this.burst,s=i?.key===o&&a-i.time<=250?i.count+1:1;this.burst={key:o,time:a,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},r=z1(n,new WeakRef(this));return this.records.set(r,n),r}owns(t){return t!==void 0&&t===this.owner()}gate(t,n){let r=n?.historyGroup;return r===void 0?null:!this.records.get(r)||r.state!=="open"?{ok:false,code:"unsupported",reason:"historyGroup must be an open handle from this editor and document"}:V1.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 a=r?.historyGroup,i=a&&this.records.get(a);if(!i){let m=si(t,void 0,o);return this.diagnoseWrites(n,m),m}let s=i.committed,l,d,u=chunkMXOO7KRI_cjs.Li(i.token,(m,h)=>{l=m,d=h;},()=>si(t,i.token,o));if(!u.ok)return u;let p=l===void 0?{kind:"none",reason:"no-history"}:l==="split"||l==="started"&&s?{kind:"split",reason:d??(i.undoEpoch!==this.undoEpoch?"undo-redo":"history-boundary")}:{kind:l};return l&&(i.committed=true,i.undoEpoch=this.undoEpoch),p.kind==="started"?this.diagnoseWrites(n,u,true):this.burst=void 0,p.kind==="split"&&this.diagnose({kind:"split",reason:p.reason??"history-boundary"}),{...u,history:p}}};function z1(e,t){return Object.freeze({get state(){return !e.closed&&t.deref()?.owns(e.owner?.deref())?"open":"closed"},end(){e.closed=true,e.owner=void 0;}})}var Ew={selection:null,pendingFormat:null,headerFooter:null,drawingIntent:"none",formatPainter:"off/none"};function Ow(e,t){let n=t.headerFooterState?.();return {selection:e.selection,pendingFormat:e.pendingFormat,headerFooter:n?.editing&&n.rId?`${n.editing}:${n.rId}`:null,drawingIntent:qb(t.drawingSelectionIntent()),formatPainter:`${e.formatPainter.mode}/${e.formatPainter.level}`}}function Fw(){let e={...Ew};return {moved(t,n){let r=Ow(t,n),o=Cs(r.selection,e.selection)&&r.pendingFormat===e.pendingFormat&&r.headerFooter===e.headerFooter&&r.drawingIntent===e.drawingIntent&&r.formatPainter===e.formatPainter;return e=r,!o},adopt(t){e=Ow(t.state(),t);},reset(){e={...Ew};}}}function j1(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)),a=-1;for(let d=n-22;d>=o;d-=1)if(r.getUint32(d,true)===101010256){a=d;break}if(a<0)return false;let i=r.getUint16(a+10,true),s=r.getUint32(a+16,true),l=0;for(let d=0;d<i;d+=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}function Mw(e){let t=null,n=()=>{if(!t)return null;let{bytes:r}=t;return t.cancel(),t=null,r};return {shouldYield:r=>typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"&&(r.byteLength>=524288||j1(r,524288)),schedule(r){let o=null,a=null,i=()=>{t=null,e.mount(r);},s=requestAnimationFrame(()=>{a!==null&&clearTimeout(a),a=null,o=setTimeout(i,0);});a=setTimeout(()=>{cancelAnimationFrame(s),i();},250),t={bytes:r,cancel:()=>{cancelAnimationFrame(s),o!==null&&clearTimeout(o),a!==null&&clearTimeout(a);}},e.scheduled();},cancel:n,flush(){let r=n();r&&e.mount(r);},isScheduled:()=>t!==null}}function Aw(e){return t=>{for(let n of e.customNodeDiagnostics)try{n(t);}catch{}}}function Lw(e,t){t.customNodePayloadNamespaces.length!==0&&e.session.sweepCustomNodePayloads(t.customNodePayloadNamespaces);}function Nw(e){return e.kind==="comment"}function Dw(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 a=e.bodyOrder(),i=a.get(r.paragraphId)??-1,s=a.get(o.paragraphId)??-1;if(i===-1||s===-1){let d=e.openStoryOrder();i=d.get(r.paragraphId)??-1,s=d.get(o.paragraphId)??-1;}return i===-1||s===-1?null:i<s||i===s&&r.offset<=o.offset?{from:r,to:o}:{from:o,to:r}}function W1(e){let t=new Map;for(let n of e){let r=n.item;if(!Nw(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 U1(e,t){let n=e.filter(a=>a.key===t);if(n.length===0)return {ok:false,code:"notFound",reason:"no review item with that key"};let r=n.map(a=>a.item).filter(Nw);if(r.length===0)return {ok:false,code:"kindMismatch",reason:"the review item is not a comment"};let o=r[0];for(let a of r)if(a.comment!==o.comment)return {ok:false,code:"ambiguous",reason:"duplicate comment records share that key"};return o}function Hw(e,t,n){if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:e.proReviewReason};if(e.editingMode==="viewing")return {ok:false,code:"locked",reason:"the document is open for viewing"};let r=e.placements(),o=U1(r,t);if(!("kind"in o))return o;if(!e.surface)return {ok:false,code:"notFound",reason:"no review item with that key"};let a=W1(r);if(a==="ambiguous")return {ok:false,code:"ambiguous",reason:"duplicate comment records share an id"};let i=o,s=new Set;for(;i.parentId!==void 0&&!s.has(i.id);){s.add(i.id);let u=a.get(i.parentId);if(!u)break;i=u;}let l=false,d=false;return e.surface.commitReviewOps(()=>{let u=e.surface.session.packageRevision();return l=e.surface.session.setCommentResolved(i.id,n),d=l&&e.surface.session.packageRevision()!==u,{committed:d}},"comment-resolve"),l?(d&&e.bump(),{ok:true,changed:d}):{ok:false,code:"notFound",reason:"the comment could not be resolved"}}function _w(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 Bw=new WeakMap;function Q1(e){return !(!e.story||e.origin===chunkMXOO7KRI_cjs.b.mutationUndo||e.origin===chunkMXOO7KRI_cjs.b.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.some(t=>t!==chunkMXOO7KRI_cjs.g.story))}function J1(e,t){Q1(t)||(e.summaries=null);}function eO(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>J1(t,n)));}function qw(e){}function Zw(e,t){let n=Bw.get(e);return n||(n={summaries:null,subscribed:false},Bw.set(e,n)),eO(e,n),n.summaries||(n.summaries=t()),n.summaries}var tO=new Map([["richText","richText"],["plainText","plainText"],["dropdown","dropDownList"],["dropDownList","dropDownList"],["comboBox","comboBox"],["date","date"]]);function nO(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function rO(e,t){let n=e.session.part(),r=e.session.paragraphAnchors();if(Tt(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(nO(t)){if(!Tt(t.from)||!Tt(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 a=cn(n,r,t.to);if(!a.ok)return {ok:false,code:a.code,reason:a.reason,target:t};if(o.span.nodeId!==a.span.nodeId)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported",target:t};let i=Math.min(o.span.start,a.span.start),s=Math.max(o.span.end,a.span.end);return {ok:true,span:{paragraphId:o.span.nodeId,start:i,end:s}}}return {ok:false,code:"unsupported",reason:"address the span with a paraId anchor; DocLocation targeting is not supported",target:t}}function If(e,t){let n=tO.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=jr(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=rO(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 oO="http://schemas.microsoft.com/office/word/2010/wordml",aO="http://schemas.microsoft.com/office/word/2012/wordml";function Yr(e){return chunkMXOO7KRI_cjs.Ed(e)}function di(e){for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="contentControlProperties"||t.localName==="sdtPr"))return t}function iO(e){if(e.kind!=="textValue"){for(let t of e.attributes)if(t.localName==="val"&&t.namespaceUri===chunkMXOO7KRI_cjs.da)return t.value}}function kf(e,t){if(e){for(let n of e.children)if(n.kind!=="textValue"&&n.localName===t)return iO(n)}}function sO(e){if(!e)return "richText";for(let t of e.children){if(t.kind==="textValue")continue;let n=lO(t);if(n!==void 0)return n}return "richText"}function lO(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===oO||t==="contentControlCheckbox"))return "checkbox";if(n==="repeatingSection"&&r===aO)return "repeatingSection"}function Sl(e){let t=kf(e,"lock");return t==="contentLocked"||t==="sdtContentLocked"}function dO(e,t){if(Sl(di(t)))return true;let n=chunkMXOO7KRI_cjs.Ia(e,t.id);for(;n;){if(Yr(n)&&Sl(di(n)))return true;n=chunkMXOO7KRI_cjs.Ia(e,n.id);}return false}function Cf(e,t){let n=di(e),r=kf(n,"tag"),o=kf(n,"alias"),a=t?dO(t,e):Sl(n);return {id:e.id,controlType:sO(n),...r!==void 0?{tag:r}:{},...o!==void 0?{alias:o}:{},...a?{locked:true}:{}}}var Kw=new WeakMap;function cO(e,t){let n=[],r=chunkMXOO7KRI_cjs.Ia(e,t.id);for(;r;)Yr(r)&&n.push(`${r.id}:${Sl(di(r))?1:0}`),r=chunkMXOO7KRI_cjs.Ia(e,r.id);return n.join("|")}function zw(e){return Object.freeze({...e,...e.tag!==void 0?{tag:e.tag}:{},...e.alias!==void 0?{alias:e.alias}:{},...e.locked?{locked:true}:{}})}function uO(e){return Object.freeze(e.map(t=>zw(t)))}function fO(e,t){let n=e.node,r=di(n),o=cO(t,n),a=Kw.get(n);if(a&&a.properties===r&&a.lockAncestors===o)return a.summary;let i=zw(Cf(n,t));return Kw.set(n,{properties:r,lockAncestors:o,summary:i}),i}function pO(e){let t=chunkMXOO7KRI_cjs.Lc(e.root);return qw(t.length),t.map(n=>fO(n,e))}function mO(e){return uO(e.storyParts().flatMap(t=>pO(t)))}function gO(e){return Zw(e,()=>mO(e))}function Tf(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 hO(e){let t=[];if(e.kind!=="paragraph")return t;let n=(r,o,a,i)=>{if(i>=chunkMXOO7KRI_cjs.la)return o;let s=o;for(let l of r)if(l.kind!=="paragraphProperties"){if(l.kind==="run"){s+=chunkMXOO7KRI_cjs.Ve(e,l);continue}if(chunkMXOO7KRI_cjs.na(l)){s=n(l.children,s,a,i+1);continue}if(Yr(l)){let d=s,u=a+1;s=n(chunkMXOO7KRI_cjs.Dc(l),s,u,i+1),t.push({control:l,start:d,end:s,depth:u});continue}s+=chunkMXOO7KRI_cjs.Ve(e,l);}return s};return n(e.children,0,-1,0),t}function Pf(e,t,n){return hO(e).filter(r=>t>=r.start&&t<r.end).sort((r,o)=>o.depth-r.depth).map(r=>Cf(r.control,n))}function Rf(e,t){let n=[],r=chunkMXOO7KRI_cjs.Ia(e,t);for(;r;)Yr(r)&&n.push(Cf(r,e)),r=chunkMXOO7KRI_cjs.Ia(e,r.id);return n.reverse()}function jw(e,t){if(!e)return [];let n=gO(e.session);return t?n.filter(r=>Tf(r,t)):n}function Ef(e,t){if(!e)return null;let{paragraphId:n,offset:r}=e.state().selection.head,o=Ue(e.session,n)??e.session.part(),a=chunkMXOO7KRI_cjs.Ha(o,n);if(a&&a.kind==="paragraph"){for(let s of Pf(a,r,o))if(Tf(s,t))return s}let i=Rf(o,n);for(let s=i.length-1;s>=0;s-=1){let l=i[s];if(Tf(l,t))return l}return null}function Of(e){return e.type==="insertContentControl"||e.type==="setContentControlValue"||e.type==="removeContentControl"}function yO(e){return typeof e=="object"&&e!==null&&"container"in e&&"path"in e}function bO(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function vO(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 wl(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||Yr(n))&&t.push(n);return t}function xO(e){let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(...wl(r.children));return t}function SO(e){return e.kind==="table"?xO(e):Yr(e)?wl(chunkMXOO7KRI_cjs.Dc(e)):e.kind==="body"?wl(e.children):[]}function wO(e,t,n){if(Yr(t))return {ok:true,controlId:t.id};if(t.kind==="paragraph"){let r=n??0;for(let i of Pf(t,r,e))return {ok:true,controlId:i.id};let a=Rf(e,t.id).at(-1);if(a)return {ok:true,controlId:a.id}}return {ok:false,code:"notFound",reason:"no content control at the addressed block"}}function IO(e,t){if(t.container.part!=="body")return {ok:false,code:"unsupported",reason:"only the body container is supported",target:t};let n=vO(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=wl(n.children),o=null;for(let i=0;i<t.path.length;i+=1){if(o=r[t.path[i]]??null,!o)return {ok:false,code:"notFound",reason:`block index ${t.path[i]} is out of range`,target:t};i<t.path.length-1&&(r=SO(o));}if(!o)return {ok:false,code:"notFound",reason:"the addressed block was not found",target:t};let a=wO(e,o,t.offset);return a.ok?a:{...a,target:t}}function kO(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,a=chunkMXOO7KRI_cjs.Ha(o,r.span.nodeId);if(!a||a.kind!=="paragraph")return {ok:false,code:"notFound",reason:`paragraph '${n.paraId}' was not found`,target:n};let i=r.span.start;for(let d of Pf(a,i,o))return {ok:true,controlId:d.id};let l=Rf(o,a.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 Ww(e,t){if(t===void 0){let r=Ef(e);return r?{ok:true,controlId:r.id}:{ok:false,code:"notFound",reason:"no content control at the current selection"}}if(bO(t))return {ok:false,code:"unsupported",reason:"DocRange targeting is not supported for content controls",target:t};let n=e.session.part();return yO(t)?IO(n,t):Tt(t)?kO(n,e.session.paragraphAnchors(),t):{ok:false,code:"invalidArgs",reason:"unrecognized target shape",target:t}}function Uw(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 Gw(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 Xw(e,t){return {ok:false,code:Uw(e),reason:Gw(e),...t!==void 0?{target:t}:{}}}function TO(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 Ff(e){return e==="viewing"?"view":e==="suggesting"?"suggesting":"edit"}function Mf(e,t,n,r){let o=TO(e,t,n,r);if(!o.ok)return o.refusal;if(e.type==="insertContentControl"){let s=If(t,e);return s.ok?Vw(t,s.op,s.span.paragraphId):{ok:false,code:s.code,reason:s.reason}}let a=Ww(t,e.target);if(!a.ok)return {ok:false,code:a.code,reason:a.reason};let i=e.type==="setContentControlValue"?{op:"setContentControlValue",controlId:a.controlId,value:e.value}:{op:"removeContentControl",controlId:a.controlId};return Vw(t,i,a.controlId)}function Vw(e,t,n){let r=Ue(e.session,n)??e.session.part(),o=chunkMXOO7KRI_cjs.Lf(e.session.currentPackage()),a=chunkMXOO7KRI_cjs.Xh(o,t)??chunkMXOO7KRI_cjs.ei(r,o,t)??chunkMXOO7KRI_cjs.Ji(r,t);return a?{ok:false,code:Uw(a),reason:Gw(a)}:{ok:true}}function Yw(e,t,n,r){t?.flushPendingInput();let o=Mf(e,t,n,r);return o.ok?CO(t,e):o}function Qw(e,t,n,r,o){let a=e.applyGatedTreeOps;return typeof a=="function"?a.call(e,t,n,r,o):e.session.applyTreeOps(t,n,r,o)}function CO(e,t){if(t.type==="insertContentControl")return PO(e,t);let n=Ww(e,t.target);if(!n.ok){let i=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...i!==void 0?{target:i}:{}}}e.flushPendingInput();let r=jr(e.state().selection),o=t.type==="setContentControlValue"?{op:"setContentControlValue",controlId:n.controlId,value:t.value}:{op:"removeContentControl",controlId:n.controlId},a=Qw(e,[o],r,r,vt(e.session,n.controlId,{kind:"body"}));return a.rejected?Xw(a.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:a.committed})}function PO(e,t){e.flushPendingInput();let n=If(e,t);if(!n.ok){let d=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...d!==void 0?{target:d}:{}}}let{paragraphId:r,start:o,end:a}=n.span,i=jr(e.state().selection),s={paragraphId:r,start:o,end:a},l=Qw(e,[n.op],i,s,vt(e.session,r,{kind:"body"}));return l.rejected?Xw(l.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:l.committed})}var RO=Object.freeze(["Arial","Calibri","Cambria","Consolas","Courier New","Garamond","Georgia","Helvetica","Open Sans","Roboto","Times New Roman","Verdana"]),EO=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function Jw(e,t){let n=new Map,r=s=>{if(s===void 0||!EO.test(s))return;let l=s.toLowerCase();n.has(l)||n.set(l,s);};r(chunkXZY4Q6PJ_cjs.f(e));let o=e?.substitutions??[],a=new Set(o.map(s=>s.to.family.toLowerCase()));for(let s of o)r(s.from.family);for(let s of e?.sources??[])a.has(s.request.family.toLowerCase())||r(s.request.family);for(let s of chunkXZY4Q6PJ_cjs.a([e?.supportedFamilies]))r(s);for(let s of RO)r(s);for(let s of t)r(s);let i=[...n.values()];return i.sort((s,l)=>s<l?-1:s>l?1:0),i}var eI=e=>new chunkUKVVUHZL_cjs.a("overLimit",`font source ${e.id} exceeds the font byte budget`,{request:e.request}),tI=e=>new chunkUKVVUHZL_cjs.a(e.reason,e.reason==="overLimit"?`embedded font ${e.request.family} (${e.partName}) exceeds the font byte budget`:`embedded font part ${e.partName} declares an invalid family name`,{request:e.request});function nI(e,t){return chunkXZY4Q6PJ_cjs.m(e,t)}function Af(e,t,n){return chunkXZY4Q6PJ_cjs.n(e,t,n)}var OO="The quick brown fox 0123 \u2014 {}#@",FO=["monospace","serif"],MO=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function oI(e){if(!e)return ()=>true;let t=new Map,n=r=>(e.font=r,e.measureText(OO).width);return r=>{let o=t.get(r);if(o!==void 0)return o;if(!MO.test(r))return t.set(r,true),true;let a=false;for(let i of FO){let s=n(`32px ${i}`);if(n(`32px "${r}", ${i}`)!==s){a=true;break}}return t.set(r,a),a}}var rI=4;function aI(e,t,n){let r=new Set,o=[];for(let u of t){let f=u.toLowerCase();r.has(f)||(r.add(f),o.push(u));}let a=u=>new Set(e.slice(0,Math.max(u,0)).map(f=>f.toLowerCase())),i=0;for(let u=0;u<=rI;u+=1){let f=a(n-i),p=o.filter(h=>!f.has(h.toLowerCase())).length,m=Math.min(p,rI,Math.floor(n/2));if(m===i)break;i=m;}let s=e.slice(0,Math.max(n-i,0)),l=a(n-i),d=o.filter(u=>!l.has(u.toLowerCase()));return [...s,...d].slice(0,n)}function iI(e,t,n){let r=[];for(let o of e){if(t(o)||n(o))continue;let a=chunkWQFNWLNY_cjs.ba.get(o.toLowerCase());a!==void 0&&n(a)||r.push(o);}return r}function sI(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 a of t){let i=a.from.family.toLowerCase();n.has(i)||!n.has(a.to.family.toLowerCase())||(n.add(i),o=true);}if(!o)break}return n}var lI=new WeakMap,AO=0,LO=chunkXZY4Q6PJ_cjs.p((e,t)=>{if(e.kind==="paragraphProperties"){let n=lI.get(e);return n||(n=String(++AO),lI.set(e,n)),{families:[n],children:[]}}return {families:e.kind==="paragraph"&&!e.children.some(n=>n.kind==="paragraphProperties")?["default-paragraph"]:[],children:chunkXZY4Q6PJ_cjs.q(e,t)}});function dI(e){return LO(e,{key:""})}var cI=new WeakMap;function uI(e){let t=e.packageRevision(),n=cI.get(e);if(n?.revision===t)return n.families;let r=n?.eastAsianFonts??chunkXZY4Q6PJ_cjs.r(),o=e.storyParts().map(p=>p.root),a=e.stylesRoot(),i=e.numberingRoot(),s=e.documentThemeFonts(),l=dI(o),u=n&&n.stylesRoot===a&&n.numberingRoot===i&&n.theme===s&&n.numberingInputs.length===l.length&&n.numberingInputs.every((p,m)=>p===l[m])?n.numberingFamilies:chunkXZY4Q6PJ_cjs.v(o,i,a,s),f=[...e.symbolFontFamilies(),...r(o,a,s),...chunkXZY4Q6PJ_cjs.t(o),...u];return cI.set(e,{eastAsianFonts:r,revision:t,families:f,numberingInputs:l,numberingFamilies:u,numberingRoot:i,stylesRoot:a,theme:s}),f}var fI=Object.freeze({installed:0,alias:()=>{},dispose(){}});function NO(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 Il=e=>e.trim().toLowerCase();function DO(){let t=(typeof document<"u"?document:void 0)?.fonts;return !t||typeof FontFace>"u"?{}:{fontSet:t,createFontFace:(n,r,o)=>new FontFace(n,r.slice().buffer,o)}}async function pI(e,t=DO(),n=[]){let{fontSet:r,createFontFace:o}=t;if(!r||!o||e.length===0)return fI;let a=new Map;for(let d of e){let u=Il(d.request.family),f=a.get(u);f?f.push(d):a.set(u,[d]);}let i=new Map,s=[];if(await Promise.all([...a].map(async([d,u])=>{let f=NO(u.map(m=>m.hash)),p=false;await Promise.all(u.map(async m=>{try{let h=o(f,m.bytes,{weight:String(m.request.weight),style:m.request.style});await h.load(),r.add(h),s.push(h),p=!0;}catch{}})),p&&i.set(d,f);})),s.length===0)return fI;for(let d of n){let u=Il(d.from.family);if(i.has(u))continue;let f=i.get(Il(d.to.family));f!==void 0&&i.set(u,f);}let l=false;return {installed:s.length,alias:d=>l?void 0:i.get(Il(d)),dispose(){if(!l){l=true;for(let d of s)try{r.delete(d);}catch{}}}}}var ci=.1,ui=5;var Mo={type:"fit",fit:"pageWidth",minZoom:.5,maxZoom:1},HO={type:"fit",fit:"pageWidth"},kl={type:"fixed"};function Tl(e){return e==="auto"?Mo:!e||typeof e!="object"?null:e.type==="fixed"?kl:e.type==="fit"&&e.fit==="pageWidth"?Cl(e,Mo)?Mo:e:null}function Cl(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 Ao(e){return e.type==="fit"}function gI({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 a=Number.isFinite(n)&&n>0?n:0,i=Math.max(e-2*a,e*.5),s=Number.isFinite(r)?mI(r):.1,l=Number.isFinite(o)?mI(o):5,d=Math.floor(i/t*100)/100;return Math.min(Math.max(d,s),Math.max(l,s))}function mI(e){return Math.min(Math.max(e,.1),5)}function _O(e){let t=Zt(e);if(!t)return null;let n=t.clientWidth;if(!Number.isFinite(n)||n<=0)return null;let r=t.ownerDocument.defaultView?.getComputedStyle(t);if(!r)return n;let o=Number.parseFloat(r.paddingLeft)||0,a=Number.parseFloat(r.paddingRight)||0;return Math.max(n-o-a,0)}function hI(e){let t=null,n=null,r=null,o=null;function a(){if(r===null)return;n?.ownerDocument.defaultView?.cancelAnimationFrame(r),r=null;}function i(){let l=e.mode();if(!Ao(l))return;let d=e.container();if(!d)return;let u=_O(d);if(u===null)return;let f=e.pageWidthPx();if(f===null)return;o=e.pageWidthTwips();let p=gI({availableWidthPx:u,pageWidthPx:f,...l.minZoom!==void 0?{minZoom:l.minZoom}:{},...l.maxZoom!==void 0?{maxZoom:l.maxZoom}:{}});p===null||p===e.zoom()||e.applyZoom(p);}function s(){let l=n?.ownerDocument.defaultView;if(!l?.requestAnimationFrame){i();return}r===null&&(r=l.requestAnimationFrame(()=>{r=null,i();}));}return {refitIfPageResized(){let l=e.pageWidthTwips();l===null||l===o||i();},attach(){this.detach();let l=e.container();if(!l)return;let d=Zt(l);d&&(n=d,typeof ResizeObserver<"u"&&(t=new ResizeObserver(s),t.observe(d)),i());},refit:i,detach(){a(),t?.disconnect(),t=null,n=null,o=null;}}}function bI(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=Tl(e.zoomMode??(n!==null?kl:"auto"))??Mo;function a(l,d){if(l===r)return d?.(),true;let u=t.surface();return u&&!QS(u,l*(96/72))?false:(r=l,d?.(),t.bump(),t.emitSelectionChange(),true)}function i(){o=kl,s.detach();}let s=hI({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=>{a(l);}});return {zoom:()=>r,mode:()=>o,scale:()=>r*(96/72),attach:()=>{Ao(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 d=Ao(o);return l===r?d?(i(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:true,changed:false}:a(l,d?i:void 0)?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:`the mounted surface could not apply zoom ${l}`}},setZoomMode(l){let d=Tl(l);return d?Cl(d,o)?{ok:true,changed:false}:(o=d,Ao(d)?s.attach():s.detach(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:false,code:"invalidArgs",reason:`unknown zoom mode ${JSON.stringify(l)}`}}}}function yI(e){let t=1.3333333333333333;return {x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t}}function vI(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:yI(r.box),contentBox:yI(r.contentBox)})):[]}}}var xI=new Map;function SI(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 a=chunkS35UK656_cjs.c(o,t);return n={slots:o,colors:t,value:a},a},styleFor:o=>((!r||r.colors!==t)&&(r={colors:t,value:chunkS35UK656_cjs.b(t)}),r.value.get(o))}}function Lf(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 wI(e){let t=chunkMXOO7KRI_cjs.ih(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}),a=n||o||"en",i=i18n.createT(i18n.deepMerge(i18n.en,a==="en"?void 0:i18n.locales[a]),a);return {locale:t,labels:{title:i("toolbar.tableOfContents")}}}function II(e){let t=e.mode,n=e.translate,r=n?chunkS35UK656_cjs.i(n):chunkS35UK656_cjs.h,o=wI(e.locale);return {mode:()=>t,modeForGate:()=>t??"edit",openingModeDecision:a=>Gc(t,a),setMode(a){return t===a?false:(t=a,true)},translate:()=>n,drawingStrings:()=>r,setTranslate(a){if(n===a)return null;n=a;let i=a?chunkS35UK656_cjs.i(a):chunkS35UK656_cjs.h;return chunkS35UK656_cjs.g(r)===chunkS35UK656_cjs.g(i)?(r=i,null):(r=i,r)},locale:()=>o.locale,tocLabels:()=>o.labels,setLocale(a){let i=wI(a);return o.locale===i.locale?null:(o=i,o.labels)}}}function kI(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 ZO=Object.freeze({kind:"body"}),KO=Object.freeze([]);function VO(e){let t=II(e),n=Ou(e.author),r=e.container??null,o=chunkTKQH7BNE_cjs.a(e.modules),a=Aw(o),i=o.review!==null,s=null,l=new WeakMap,d=Mw({mount:S=>xr(S),scheduled:()=>{he(),ze();}}),u=t.mode()==="view"?"viewing":"editing",f=null,p=false,m=Vs(),h=SI(e.revisionStyles),x=chunkS35UK656_cjs.e(),b=false,y=false,I=null,k=()=>({reviewEnabled:i,hasAuthor:!!n}),E=false,C=null,H=Ab({stillMissing:()=>!$&&n===void 0&&Ir(null)===gr,emit:S=>Le(S)}),A=t.openingModeDecision(k());A.mode!==null&&(u=A.mode),A.rejection!==null&&(I=A.rejection),H.report(A.rejection);let w=null,P=null,R=null,N=null,B=Fw(),U=tw(),F=Lf({}),_=Lf({}),$=false,Z,Y,oe=null,ue=()=>{},Te=0;function ce(){oe?.dispose(),oe=null;}let D=0,M,q=()=>typeof e.fonts=="function"?M:e.fonts,z=ew(()=>{if($||!w)return null;let{session:S}=w,[G]=chunkXZY4Q6PJ_cjs.a([[St().formatting?.fontFamily]]);return {generation:D,dynamic:typeof e.fonts=="function",families:()=>aI([...new Set([...G&&G!==chunkXZY4Q6PJ_cjs.f(q())?[G]:[],...S.documentFonts()])],uI(S),chunkXZY4Q6PJ_cjs.c)}},async S=>{w&&await fi(D,w,S);}),X=false,O=null,V=S=>(O||(O=oI(r?ko(r.ownerDocument):null)),O(S)),j=new Set,ee=S=>j.has(S.toLowerCase())||oe?.alias(S)!==void 0,ne=()=>!w||X?KO:iI(w.session.renderedFontFamilies(),ee,V),te=0,le=null,fe,we=null,ot=-1,Oe=0,_e=-1,Re=false,Fe="all-markup",Ge=ow(S=>{w?.setShowParagraphMarks(S),he(),ze();}),Ee=sw({surface:()=>w,destroyed:()=>$,editingMode:()=>u,hostViewOnly:()=>t.mode()==="view",publish:()=>{he(),ze();},decision:()=>_o(),tracking:wr,adopt:S=>{I=S.rejection??Ir(null),S.mode!==null&&(y=S.mode==="viewing",tr(S.mode)),he(),ze();}});function he(){te+=1;}let Ve={change:new Set,selectionChange:new Set,error:new Set,historyDiagnostic:new Set};function Le(S){for(let G of [...Ve.error])G(S);}function Nt(S){for(let G of [...Ve.change])G(S);}function ze(){if(Ve.selectionChange.size===0)return;let S=St();for(let G of [...Ve.selectionChange])G(S);}function vr(){N?.(),N=null,w?.destroy(),w=null,B.reset(),Oe+=1;}let Kt=bI(e,{container:()=>r,surface:()=>w,bump:he,emitSelectionChange:ze}),Jr=()=>Kt.scale();function xr(S,G,J){if(J??=l.get(S),l.delete(S),!r){s=S,J&&l.set(S,J),R=null,he();return}vr();let Se=m.stateKey,ye=yf(r,S,{scale:Jr(),showParagraphMarks:Ge.get(),onToggleParagraphMarks:Ge.toggle,defaultFontFamily:chunkXZY4Q6PJ_cjs.f(q()),translate:t.translate(),drawingStrings:t.drawingStrings(),locale:t.locale(),...n?{author:n}:{},...h.current()!==void 0?{revisionStyles:h.current()}:{},reviewAuthorSlots:x,revisionAuthorVisibility:m,initialSelection:G,initialTextFormInput:J,editingMode:u==="suggesting"?"suggest":u==="viewing"?"view":"edit",revisionDisplayMode:i?Fe:"proposed",...nw(o,a),...Z?{measurer:Z,...Y?{producer:Y}:{}}:{},...oe?{fontAlias:oe.alias}:{},...e.tableInteractionLabel?{tableInteractionLabel:e.tableInteractionLabel}:{},...e.imageDecodePort?{imageDecodePort:e.imageDecodePort}:{},...o.collaboration?{collaborationModel:o.collaboration}:{},onHyperlinkPopover:Ce=>F.current().onPopover?.(Ce),...U.surfaceOptions,onRequestHyperlink:()=>F.current().onRequest?.(),onEquationPopover:Ce=>_.current().onPopover?.(Ce),onTrackedChange:()=>{Re||(Re=true,he(),ze());},tocLabels:t.tocLabels(),onChange:Ce=>{if(!w)return;he(),Ee.sync(),z.schedule();let qe=i&&Fe!==w.revisionDisplayMode();qe&&(Fe=w.revisionDisplayMode());let ve=Se!==m.stateKey||qe;Se=m.stateKey,!(!ve&&!B.moved(Ce,w))&&ze();}});if(!ye.ok){R=ye.detail?`${ye.reason}: ${ye.detail}`:ye.reason,he(),Le($t(ye.reason,`failed to open document: ${R}`));return}R=null,w=ye.surface,Ee.prime(),Re=i&&w.session.reviewItems().length>0,B.adopt(w),C!==null?kr(C,false):Rl(),Lw(w,o),Oe+=1,w.setEditable(u!=="viewing"),P!==null&&w.setRemoteCaretLabelHost(P),f!==null&&w.setReviewActivationExclusions(f),N=ye.surface.session.subscribe(Ce=>{let qe={revision:ye.surface.session.packageRevision(),created:Ce.created,deleted:Ce.deleted,dirty:Ce.dirty};Kt.refitIfPageResized(),he(),Nt(qe);}),Kt.attach(),he(),Nt({revision:w.session.packageRevision()}),ze(),z.schedule(true);}function Pt(S){if(d.cancel(),l=new WeakMap,Re=false,D+=1,x=chunkS35UK656_cjs.e(),m.showAll(),Z=void 0,Y=void 0,M=void 0,j=new Set,ce(),ue(),ue=()=>{},X=false,r){let G=Zt(r);G&&(G.scrollTop=0,G.scrollLeft=0);}r&&d.shouldYield(S)?d.schedule(S):xr(S);}function tn(S){(S.code==="wasmUnavailable"||S.cause instanceof chunkWQFNWLNY_cjs.u&&S.cause.code==="unsupportedRuntime")&&!e.onFontError&&Ve.error.size===0&&hh(S);try{e.onFontError?.(S);}catch{}Le(S);}async function fi(S,G,J){let Se=e.fonts,ye=G.session.embeddedFonts();if(!(!Se&&ye.length===0)){X=true,he();try{let Ce={families:J,defaultFamily:chunkXZY4Q6PJ_cjs.f(q())},qe=typeof Se!="function"?Se:M?await chunkXZY4Q6PJ_cjs.k([M,chunkXZY4Q6PJ_cjs.i(Ke=>Se(Ke))],Ce,{onOriginFailure:({cause:Ke})=>tn(go(Ke))}):await Se(Ce),ve=typeof Se=="function"?chunkXZY4Q6PJ_cjs.b(qe):qe;if($||S!==D){S===D&&(X=!1);return}if(M=qe,ye.length===0&&(!ve||qe?.supportedFamilies?.length&&!chunkXZY4Q6PJ_cjs.b(qe))){X=!1,he(),ze();return}let ae=(ve&&"maxFontBytes"in ve?ve.maxFontBytes:void 0)??chunkWQFNWLNY_cjs.a,Me=nI(ve?.sources??[],ae),Ie=Me.sources;for(let Ke of Me.dropped)tn(eI(Ke));let dt=Af(ye,Ie,ae),mn=!1,Qe=()=>{if(!mn){mn=!0;for(let Ke of dt.dropped)tn(tI(Ke));}},ct=chunkXZY4Q6PJ_cjs.e({epoch:S,...ve,sources:Ie},dt);if(ct.sources.length===0){Qe(),X=!1,he(),ve&&tn(new chunkUKVVUHZL_cjs.a("missing","the supplied font configuration contains no usable sources; the fixed measurer stays in effect"));return}let wt=await Ma(ct),gn=()=>!$&&S===D?!1:(chunkWQFNWLNY_cjs.I(wt),S===D&&(X=!1),!0);if(gn())return;let $o=Ke=>{Qe(),Ke&&chunkWQFNWLNY_cjs.I(Ke),X=!1,he();},qo=(Ke,Ze)=>{let no=new Set;for(let Pr of Ze.sources??[]){let He=Ke.fonts.resolve(Pr.request);He instanceof chunkWQFNWLNY_cjs.d&&(tn(go(He)),no.add(chunkWQFNWLNY_cjs.g(Pr.request)));}return no},Tr=qo(wt,ct);try{if(Tr.size>0){let Ke=Ie.filter(Ln=>!Tr.has(chunkWQFNWLNY_cjs.g(Ln.request))),Ze=Ke.length!==Ie.length;Ze&&(dt=Af(ye,Ke,ae));let no=dt.sources.filter(Ln=>Ze||!Tr.has(chunkWQFNWLNY_cjs.g(Ln.request))),Pr=wt;if(ct=chunkXZY4Q6PJ_cjs.e({epoch:S,...ve,sources:Ke},{sources:no}),ct.sources.length===0)return $o(Pr);if(wt=await Ma(ct),chunkWQFNWLNY_cjs.I(Pr),gn())return;let He=qo(wt,ct);if(He.size>0){let Ln=Ke.filter(Vo=>!He.has(chunkWQFNWLNY_cjs.g(Vo.request))),Rr=dt.sources.filter(Vo=>!He.has(chunkWQFNWLNY_cjs.g(Vo.request))),Ko=wt;if(ct=chunkXZY4Q6PJ_cjs.e({epoch:S,...ve,sources:Ln},{sources:Rr}),ct.sources.length===0)return $o(Ko);if(wt=await Ma(ct),chunkWQFNWLNY_cjs.I(Ko),gn())return}}}finally{Qe();}let to=ct.sources.map(Ke=>{let Ze=wt.fonts.resolve(Ke.request);return Ze instanceof chunkWQFNWLNY_cjs.d||Ze.id!==Ke.id?null:{request:Ke.request,id:Ze.id,bytes:Ze.bytes,hash:Ze.hash,faceIndex:Ze.faceIndex}}).filter(Ke=>Ke!==null),Cr=await pI(to,void 0,ct.substitutions??[]);if($||S!==D){Cr.dispose(),gn();return}let Zo={embeddedFaces:oe,coveredFontFamilies:j,shapedMeasurer:Z,shapedProducer:Y,disposeShapedFonts:ue};try{oe=Cr,j=sI(to,ct.substitutions??[]);let Ke=chunkWQFNWLNY_cjs.ea(Jr(),{context:r?ko(r.ownerDocument):null,...oe?{fontAlias:oe.alias}:{}}),Ze=JS(wt,ct,Ke,Jr(),++Te);if(Z=Ze.measurer,Y=Ze.producer,X=!1,w&&A0(w,{measurer:Z,producer:Y,fontAlias:oe?.alias,defaultFontFamily:chunkXZY4Q6PJ_cjs.f(q())}),$||S!==D){Cr.dispose(),chunkWQFNWLNY_cjs.I(wt);return}}catch(Ke){throw !$&&S===D&&({embeddedFaces:oe,coveredFontFamilies:j,shapedMeasurer:Z,shapedProducer:Y,disposeShapedFonts:ue}=Zo),Cr.dispose(),chunkWQFNWLNY_cjs.I(wt),Ke}ue=()=>chunkWQFNWLNY_cjs.I(wt),Zo.disposeShapedFonts(),Zo.embeddedFaces?.dispose(),he(),ze();}catch(Ce){if($||S!==D)return;X=false,he(),tn(go(Ce));}}}let pi=qc();function Pl(){let S=w?.state()??null;return {scope:w?.activeScope?.()??ZO,isLoading:R===null&&w===null&&s===null&&!d.isScheduled(),isOpening:d.isScheduled(),parseError:R,editable:w!==null&&w.session.editable&&t.mode()!=="view"&&u!=="viewing",zoom:Kt.zoom(),zoomMode:Kt.mode(),selection:cu(w),selectionCollapsed:S===null||S.selection.anchor.paragraphId===S.selection.head.paragraphId&&S.selection.anchor.offset===S.selection.head.offset,formatting:Qb(w),table:pu(w),tocContext:pi(S?.contextTocId??null),image:In(w),page:{current:fu(w),total:uu(w)},canUndo:S?.canUndo??false,canRedo:S?.canRedo??false,pageSetup:du(w),reviewPaneOpen:Re,showParagraphMarks:Ge.get(),documentProtection:Ee.state(),reviewDisplayMode:w&&i?w.revisionDisplayMode():Fe,hasReviewContent:w?.session.hasReviewContent()??false,hiddenReviewAuthors:m.hiddenAuthorList,collaborationStatus:S?.collaborationStatus??"inactive",editingMode:u,lastRejection:I??S?.lastRejection??null,fontSubstitutions:ne(),formatPainter:S?.formatPainter??Ss}}let Lo;function St(){if(le&&_e===te)return le;let S=le,G=q()===Lo;Lo=q();let J=n===fe;fe=n;let Se=w?.state().selection??null,ye=Cs(Se,we);we=Se;let Ce=w?.session.packageRevision()??-1,qe=Ce===ot;ot=Ce;let ve=Pl(),ae=ve;if(S){let Me=Hc(ve.formatting,S.formatting)?S.formatting:ve.formatting,Ie=_c(ve.page,S.page)?S.page:ve.page,dt=Bc(ve.pageSetup??null,S.pageSetup??null)?S.pageSetup:ve.pageSetup,mn=$c(ve.selection,S.selection)?S.selection:ve.selection,Qe=zb(ve.image,S.image)?S.image:ve.image,ct=S.fontSubstitutions!==void 0&&ve.fontSubstitutions!==void 0&&S.fontSubstitutions.length===ve.fontSubstitutions.length&&ve.fontSubstitutions.every((wt,gn)=>S.fontSubstitutions[gn]===wt)?S.fontSubstitutions:ve.fontSubstitutions;ae={...ve,formatting:Me,page:Ie,pageSetup:dt,selection:mn,image:Qe,fontSubstitutions:ct},Zc(ae,S)&&ye&&qe&&J&&G&&(ae=S);}return le=Ts(ae),_e=te,le}if(e.document){let S=jc(e.document);S?Pt(S):(R=Wc(e.document),Le($t("unsupported",R)));}let Cn=yv({surface:()=>w,activeKey:On,paneOpen:()=>Re,selectionAnchor:()=>Ho()?.anchorY??null,authorFilterKey:()=>m.stateKey});function Pn(S){return S.kind==="revision"?S.ranges[0]??null:S.range}function Mt(S){return Pn(S)===null?false:!(S.kind==="revision"&&f!==null&&f.includes(S.revisionKind))}let mi=dw(),pn=new WeakMap;function ht(S){let G=pn.get(S);if(G)return G;let J=new Map;for(let Se of S.pages)for(let ye of [Se.footnotes,Se.endnotes])if(ye)for(let Ce of ye.notes)for(let qe of chunkBNZF6DYC_cjs.C(Ce.fragments))for(let ve of chunkBNZF6DYC_cjs.T(qe))J.has(ve)||J.set(ve,Ce.scopeId);return pn.set(S,J),J}function Sr(S){let G=Pn(S)?.partName;if(!G||!w||G===w.session.part().name)return null;for(let J of w.session.headerFooterResolutionBySection())for(let Se of ["header","footer"]){let ye=Se==="header"?J.headers:J.footers;for(let Ce of ye.values())if(Ce.partName===G)return {kind:Se,rId:Ce.rId}}return null}function nn(S){let G=Pn(S),J=w?.publishedLayout();return !G||!J?null:ht(J).get(G.start.paragraphId)??null}function No(S){let G=Pn(S)?.partName;if(!G||!w)return null;for(let J of ["footnote","endnote"])if(chunkMXOO7KRI_cjs.Wf(w.session.currentPackage(),J)?.name===G)return {kind:"notesPart",noteKind:J};return null}function Qn(S){let G=Sr(S);return G!==null?{kind:"headerFooter",rId:G.rId}:No(S)??{kind:"body"}}let Rn=()=>`${new Date().toISOString().slice(0,19)}Z`,Jn=new WeakMap;function re(S){let G=Jn.get(S);if(G)return G;let J=new Map;for(let[Se,ye]of chunkBNZF6DYC_cjs.V(S).entries())J.set(ye,Se);return Jn.set(S,J),J}function En(){return Dw({surface:w,bodyOrder:()=>{let S=w?.publishedLayout();return S?re(S):new Map},openStoryOrder:er})}function Do(){let S=w?.activeScope();if(S?.kind==="headerFooter")return {kind:"headerFooter",rId:S.rId};if(S?.kind==="note"){let G=chunkMXOO7KRI_cjs.$c(S.id);if(G)return {kind:"notesPart",noteKind:G.noteKind}}return {kind:"body"}}function gi(S){if(!w)return {kind:"body"};let G=S.slice(0,S.indexOf("#"));if(G.length===0||G===w.session.part().name)return {kind:"body"};for(let J of w.session.headerFooterResolutionBySection())for(let Se of [J.headers,J.footers])for(let ye of Se.values())if(ye.partName===G)return {kind:"headerFooter",rId:ye.rId};for(let J of ["footnote","endnote"])if(chunkMXOO7KRI_cjs.Wf(w.session.currentPackage(),J)?.name===G)return {kind:"notesPart",noteKind:J};return Do()}function er(){if(!w)return new Map;let S=Do();if(S.kind==="body")return new Map;let G=new Map;for(let[J,Se]of w.session.paragraphIdsIn(S).entries())G.set(Se,J);return G}function hi(S){if(S.kind==="revision"){let J=S.ranges;if(J.length===0)return null;let ye=S.revisionKind==="replace"||S.revisionKind==="insert"||S.revisionKind==="delete"?J[J.length-1]:J[0];return {start:J[0].start,end:ye.end}}let G=Pn(S);return G?{start:G.start,end:G.end}:null}function Ho(){if(w&&w.activatedReviewKey()!==null)return null;let S=En(),G=w?.publishedLayout();if(!S||!G)return null;let J=mi(G).get(S.from.paragraphId);return J?{pageIndex:J.pageIndex,anchorY:J.contentY+chunkWQFNWLNY_cjs.ja(J,S.from.paragraphId,S.from.offset)}:null}function On(){return w?.activeReviewKey()??null}function Fn(S){if(!i)return [];let G=Mu(w?.session.reviewItems()??[],m),J=S?.excludeRevisionKinds;if(J&&J.length>0){let ae=new Set(J);G=G.filter(Ie=>Ie.kind!=="revision"||!ae.has(Ie.revisionKind));let Me=new Set(G.filter(Ie=>Ie.kind==="revision").map(Ie=>Ie.id));G=G.map(Ie=>{if(Ie.kind!=="comment"||Ie.parentRevisionId===void 0||Me.has(Ie.parentRevisionId))return Ie;let{parentRevisionId:dt,...mn}=Ie;return mn});}let Se=S?.placement!==false,ye=null;if(Se&&G.length>0){let ae=w?.publishedLayout()??null;ae&&(ye=mi(ae));}let Ce=On(),qe=ae=>{let Me=Sr(ae);return Me===null?1:Me.kind==="header"?0:2},ve=G.map((ae,Me)=>({item:ae,position:Me,pageIndex:ye?chunkWQFNWLNY_cjs.la(ae,ye)?.pageIndex??null:null,group:qe(ae)}));return ve.sort((ae,Me)=>{let Ie=ae.pageIndex??Number.MAX_SAFE_INTEGER,dt=Me.pageIndex??Number.MAX_SAFE_INTEGER;return Ie!==dt?Ie-dt:ae.group!==Me.group?ae.group-Me.group:ae.position-Me.position}),ve.map(({item:ae})=>{let Me=chunkITNK6C5M_cjs.Fa(ae),Ie=ye?chunkWQFNWLNY_cjs.la(ae,ye):null,dt={key:Me,id:ae.id,...vf(ae)!==void 0?{date:vf(ae)}:{},activatable:Mt(ae),anchorY:Ie?.y??null,pageIndex:Ie?.pageIndex??null,isActive:Me===Ce};return ae.kind==="comment"?{...dt,kind:"comment",author:ae.comment.author,initials:chunkITNK6C5M_cjs.Da(ae.comment),text:chunkITNK6C5M_cjs.Ca(ae.comment),resolved:ae.resolved,...ae.parentId!==void 0?{parentId:ae.parentId}:{},...ae.parentRevisionId!==void 0?{parentRevisionId:ae.parentRevisionId}:{},replyIds:ae.replyIds,readOnly:false,item:ae}:ae.kind==="revision"?{...dt,kind:"revision",revisionKind:ae.revisionKind,author:ae.author,initials:uv(ae.author),text:ae.text,...ae.replacedText?{replacedText:ae.replacedText}:{},replyIds:ae.replyIds,readOnly:ae.readOnly||Bb(w),item:ae}:{...dt,kind:"custom",author:"",initials:"",text:ae.detail??ae.text,replyIds:[],readOnly:true,item:ae}})}function wr(){return w?.session.trackingSettings()??chunkMXOO7KRI_cjs.Gg}function _o(S=u,G=b){let J=wr();return Yc({...k(),viewOnly:t.mode()==="view",hostChoseMode:t.mode()!==void 0,readerChoseMode:G,currentMode:S,trackRevisions:J.trackRevisions,restrictedToTrackedChanges:J.restrictedToTrackedChanges,restrictedToForms:J.restrictedToForms,restrictedToReadOnly:J.restrictedToReadOnly,restrictedToComments:J.restrictedToComments,engineAdoptedViewing:y})}function tr(S){C=null,u=S,w?.setEditingMode(S==="suggesting"?"suggest":S==="viewing"?"view":"edit"),w?.setEditable(S!=="viewing");}function Ir(S){return S!==null?S:u==="suggesting"&&n===void 0?gr:E?gr:b?null:t.openingModeDecision(k()).rejection}function Rl(){let S=_o();I=Ir(S.rejection),S.mode!==null&&(y=S.mode==="viewing",tr(S.mode));}function kr(S="editing",G=true){if(d.isScheduled()){C=S;return}C=null;let J=Nb(t.mode(),k(),wr(),u,S,y);y=J.mode==="viewing"&&t.mode()!=="view",J.mode!==u&&tr(J.mode),I=Ir(J.rejection),H.report(J.configurationRejection),G&&(he(),ze());}function eo(S){return t.mode()==="view"&&S!=="viewing"?{ok:false,code:"locked",reason:"this document was opened for viewing"}:(S==="suggesting"?Xc(k()):null)??Qc(wr(),S)}let Bo=rw({surface:()=>w,enabled:()=>i,destroyed:()=>$,viewing:()=>u==="viewing",placements:()=>Fn(),visible:()=>Mu(w?.session.reviewItems()??[],m),scope:Qn,activate:(S,G)=>{p=G??false;try{return An.setActiveReviewItem(S)}finally{p=false;}},setDisplayMode:S=>{Fe=S,w?.setRevisionDisplayMode(S),he(),ze();}}),{resolveReviewItem:Vt}=Bo,Mn=new xl(()=>w,S=>{for(let G of [...Ve.historyDiagnostic])G(S);},()=>JSON.stringify(w?.state().selection)),An={beginHistoryGroup(){return d.flush(),Mn.begin()},get mountGeneration(){return Oe},get surface(){return w},...U.setters,setHyperlinkChrome:F.push,setEquationChrome:_.push,stateVersion:()=>te,fontMeasurement:()=>({measurer:Z?"shaped":"fixed",resolving:X,...Z&&Y?{producer:Y}:{}}),attach(S){if($){Le($t("destroyed","this editor was destroyed; create a new instance to remount"));return}if(w&&r===S)return;if(w){w.flushPendingInput(),s=w.session.save();let Se=r?xu(r):void 0;Se&&l.set(s,Se),vr();}let G=d.cancel();G&&(s=G),Kt.detach(),r=S,O=null;let J=s;s=null,J&&d.shouldYield(J)?d.schedule(J):J?xr(J):he();},detach(){if($)return;Kt.detach();let S=d.cancel();if(w){w.flushPendingInput(),s=w.session.save();let G=r?xu(r):void 0;G&&l.set(s,G),vr();}S&&(s=S),r=null,O=null,he();},load(S){let G=jc(S);if(!G){Le($t("unsupported",Wc(S)));return}Pt(G);},save(){return d.flush(),Q0(w,r,()=>w)},getDocumentHandle(){return Object.freeze({revision:w?.session.packageRevision()??0})},exec(S,G){d.flush();let J=Mn.gate(S,G);if(J)return J;Mn.note(S);let Se=xf(S,$,i,eo);if($&&Se&&!Se.ok)return Se;if(S.type==="setEditingMode"){let Ie=eo(S.mode);return Ie!==null?(Ie.reason===gr&&(E=true,I=Ie.reason,H.report(Ie.reason),he(),ze()),Ie):(b=true,E=false,I=null,tr(S.mode),he(),ze(),{ok:true,changed:false})}if(S.type==="toggleParagraphMarks")return Ge.toggle(),{ok:true,changed:false};if(S.type==="toggleReviewPane")return i?(Re=!Re,he(),ze(),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:un};let ye=Ee.exec(S);if(ye)return ye;let Ce=Bo.exec(S);if(Ce)return Ce;if(Of(S))return Yw(S,w,Ff(u),G);let qe=Ha(S);if(u==="viewing"&&qe.supported&&qe.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let ve=Ua(S,w,t.modeForGate(),G);if(!ve.ok)return ve.refusal;let ae=w,Me=ae.session.packageRevision();return Mn.run(ae,S,G,()=>{let Ie=Rw(ae,S,{...ve.tablePlan?{admittedTablePlan:ve.tablePlan}:{},editor:An});return Ie||{ok:true,changed:ae.session.packageRevision()!==Me}})},can(S,G){let J=Mn.gate(S,G);if(J)return J;if(S.type==="insertImage"||S.type==="replaceImage"){if($)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(G?.scope){let ae=Ua(S,w,t.modeForGate(),G);if(!ae.ok)return ae.refusal}return Xb(S,w)}let Se=xf(S,$,i,eo);if(Se)return Se;let ye=Ee.can(S);if(ye)return ye;let Ce=Bo.can(S);if(Ce)return Ce;if(Of(S))return Mf(S,w,Ff(u),G);let qe=Ha(S);if(u==="viewing"&&qe.supported&&qe.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let ve=Ua(S,w,t.modeForGate(),G);if(!ve.ok)return ve.refusal;if(S.type==="proposeInsertion"||S.type==="proposeDeletion"||S.type==="proposeReplacement"){if(!(S.author??n??"").trim())return {ok:false,code:"invalidArgs",reason:`${S.type} requires a non-empty author`};let Me=S.target===void 0?{ok:true,selection:w.state().selection}:bl(w,S.target);if(!Me.ok)return Me;let{anchor:Ie,head:dt}=Me.selection,mn=Ie.paragraphId===dt.paragraphId&&Ie.offset===dt.offset,Qe=S.type==="proposeReplacement"&&S.target===void 0&&w.state().cellSelection!==null;if(S.type!=="proposeInsertion"&&mn&&!Qe)return {ok:false,code:"invalidArgs",reason:`${S.type} needs a non-collapsed selection`}}if(Va(S)&&ou(S)){let ae=za(An);if(ae){let Me=au(An,S,ae);if(Me)return Me}}return {ok:true}},isActive(S){return S.type==="toggleParagraphMarks"?Ge.get():S.type==="toggleDocumentProtection"?Ee.isActive():S.type==="setReviewDisplayMode"?Fe===S.mode:S.type==="toggleReviewPane"?Re:S.type==="setEditingMode"?u===S.mode:aw(S,w?St().formatting:null,G=>w?.isListActive(G)??false)},getDocumentStyles:()=>w?.session.documentStyles()??[],getDocumentFonts:()=>w?.session.documentFonts()??[],getAvailableFonts:()=>Jw(q(),w?.session.documentFonts()??[]),getDocumentThemeColors:()=>w?.session.documentThemeColors()??[],getOutline:()=>w?.session.documentOutline()??[],getComments:()=>[],getSelectionFormatting:()=>r0(w?St().formatting:null),findMatches:(S,G)=>w?.session.findText(S,{...G?.matchCase!==void 0?{matchCase:G.matchCase}:{},...G?.wholeWord!==void 0?{wholeWord:G.wholeWord}:{},stories:cw(w,u)}).matches??[],selectMatch(S){return d.flush(),w?uw(w,S):{ok:false,code:"notFound",reason:"no document is loaded"}},getSelectedImage:()=>St().image,getSelectedTable:()=>n0(w),getTableCellSelection:()=>{let S=w?.state().cellSelection;return S?{tableId:S.tableId,rows:S.rows,columns:S.columns,cellIds:S.cellIds}:null},setTableInteractionLabel(S){w?.setTableInteractionLabel(S);},canExecuteImageCommand(S,G){if($)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(G?.scope){let J=Ua(S,w,t.modeForGate(),G);if(!J.ok)return J.refusal}return iu(S,w)},executeImageCommand(S){return $?Promise.resolve({ok:false,code:"notFound",reason:"the editor was destroyed"}):su(An,S)},getPageSetup:()=>du(w),getWatermark:()=>null,getTrackedChanges:()=>(w?.session.reviewItems()??[]).filter(S=>S.kind==="revision").map(S=>{let G=Sr(S);return {id:S.id,kind:S.kind==="revision"?S.revisionKind:"revision",...S.kind==="revision"&&S.author?{author:S.author}:{},story:G!==null?G.kind:No(S)?.noteKind??"body"}}),getReviewItems:S=>Fn(S),getCustomNodeDefinitions:()=>o.customNodes,reportCustomNodeDiagnostic:a,addComment(S,G){if(!i)return {ok:false,code:"unsupported",reason:un};w?.flushPendingInput();let J=En();if(!J||!w)return {ok:false,code:"invalidArgs",reason:"a comment needs a selected range"};let Se=(G??n??"").trim();if(Se.length===0||S.trim().length===0)return {ok:false,code:"invalidArgs",reason:"a comment needs both an author and text"};let ye=null;return w.commitReviewOps(()=>(ye=w.session.replyToComment(null,{paragraphId:J.from.paragraphId,start:J.from.offset,end:J.to.offset,...J.to.paragraphId===J.from.paragraphId?{}:{endParagraphId:J.to.paragraphId}},S,Se,Rn(),gi(J.from.paragraphId)),{committed:ye!==null}),"comment-add"),ye===null?{ok:false,code:"unsupported",reason:"the comment could not be committed"}:{ok:true,changed:true}},getSelectionPlacement:()=>Ho(),isReviewPaneOpen:()=>Re,getEditingMode:()=>u,getReviewAuthors:()=>h.authorsFor(w?.revisionAuthors()??xI),...bv(m,{enabled:i,surface:()=>w,notify:()=>{he(),ze();}}),setTrackedChangesFilter(S,G){if(w)return w.setTrackedChangesFilter(S,G);m.setPredicate(S,G)&&(he(),ze());},getConfiguredAuthor:()=>n??null,setAuthor(S){let G=Ou(S);if(n!==G){if(n=G,w?.setAuthor(n),n!==void 0&&E){E=false;let J=Lb(eo("suggesting"));if(J.enter)b=true,tr("suggesting");else {I=J.rejection,he(),ze();return}}else if(!b){let J=C??u;kr(t.mode()===void 0?J:"editing");return}I=Ir(null),H.report(I),he(),ze();}},setMode(S){t.setMode(S)&&(b=false,E=false,kr());},...kI(t,{surface:()=>w,bump:he,emitSelectionChange:ze}),presenceColorFor:S=>w?.remotePresenceColor(S)??"var(--doc-accent)",collaborationSession:()=>w?.collaborationSession()??null,getReviewAuthorStyle:S=>h.styleFor(S),setRemoteCaretLabelHost(S){P=S,w?.setRemoteCaretLabelHost(S);},setRevisionStyles(S){h.set(S),w?.setRevisionStyles(S),he(),ze();},setEditingMode:S=>An.exec({type:"setEditingMode",mode:S}),getReviewRevision:()=>Cn(),setActiveReviewItem(S,G){if(S===null)return w?.dismissActiveReview(),he(),ze(),{ok:true,changed:false};if(!w)return {ok:false,code:"notFound",reason:"no document is open"};w.flushPendingInput();let Se=Fn().find(ve=>ve.key===S)?.item;if(!Se)return {ok:false,code:"notFound",reason:"no review item with that key"};let ye=Pn(Se);if(!ye)return {ok:false,code:"unsupported",reason:"this review item has no resolvable range"};if(!Mt(Se)&&!(p&&Se.kind==="revision"&&Se.revisionKind==="format"))return {ok:false,code:"unsupported",reason:`review items of kind '${Se.revisionKind}' are excluded from activation`};let Ce=Se?Sr(Se):null,qe=Ce===null&&Se?nn(Se):null;if(Ce!==null||qe!==null){let ve=Ce!==null?{kind:"headerFooter",rId:Ce.rId,furnitureKind:Ce.kind}:{kind:"note",id:qe},ae=gl(w,ve,ye.start);if(!ae.ok)return ae}else {w.exitNote?.(),w.exitHeaderFooter?.();let ve=hi(Se)??ye,ae={paragraphId:ve.start.paragraphId,offset:ve.start.offset};w.activateReview(S,{anchor:ae,head:ae},{allowExcluded:p});let Me=G?.reveal??"centerIfNeeded";Me!==false&&w.revealPosition?.(ve.start,{block:Me});}return (Ce!==null||qe!==null)&&w.activateReview(S,void 0,{allowExcluded:p}),he(),ze(),{ok:true,changed:false}},setReviewActivationExclusions(S){f=S===null?null:[...S],w?.setReviewActivationExclusions(f);},acceptReviewItem:S=>Vt(S,"accept"),rejectReviewItem:S=>Vt(S,"reject"),setCommentResolved(S,G){return Hw({reviewEnabled:i,editingMode:u,placements:Fn,surface:w,proReviewReason:un,bump:he},S,G)},deleteReviewItem(S){if(!i)return {ok:false,code:"unsupported",reason:un};let J=Fn().find(ye=>ye.key===S)?.item;if(!J||!w)return {ok:false,code:"notFound",reason:"no review item with that key"};if(J.kind==="revision")return Vt(S,"reject");if(J.kind!=="comment")return {ok:false,code:"unsupported",reason:"a custom node card cannot be deleted"};On()===S&&w.dismissActiveReview();let Se=false;return w.commitReviewOps(()=>{let ye=nn(J),Ce=ye===null?null:chunkMXOO7KRI_cjs.$c(ye);return Se=w.session.deleteComment(J.id,Qn(J),Ce?.noteId),{committed:Se}},"comment-delete"),Se?(he(),{ok:true,changed:true}):{ok:false,code:"unsupported",reason:"the comment could not be deleted"}},replyToReviewItem(S,G,J){if(!i)return {ok:false,code:"unsupported",reason:un};w?.flushPendingInput();let ye=Fn().find(Ie=>Ie.key===S)?.item;if(!ye||!w)return {ok:false,code:"notFound",reason:"no review item with that key"};let Ce=Pn(ye);if(!Ce)return {ok:false,code:"invalidArgs",reason:"the item has no anchorable range"};let qe=(J??n??"").trim(),ve=_w(ye,G,qe);if(ve)return ve;let ae=ye.kind==="comment"?ye.id:null,Me=null;return w.commitReviewOps(()=>(Me=w.session.replyToComment(ae,{paragraphId:Ce.start.paragraphId,start:Ce.start.offset,end:Ce.end.offset},G,qe,Rn(),Qn(ye)),{committed:Me!==null}),"comment-reply"),Me===null?{ok:false,code:"unsupported",reason:"the reply could not be committed"}:{ok:true,changed:true}},getHeaderFooterState:()=>w?.headerFooterState()??null,getNotePropertiesState:()=>w?.notePropertiesState?.()??null,getNotePreviewText:S=>w?.notePreviewText?.(S)??null,setActiveScope(S){w?.setActiveScope(S)&&he();},getActiveScope:()=>w?.activeScope()??{kind:"body"},query(S){switch(S.type){case "selectedText":return w?.selectedText()??"";case "selectionFormatting":return w?St().formatting:null;case "selection":return cu(w);case "paragraphs":return e0(w,S.container);case "isInsideToc":return o0(w);case "hyperlinkAt":return Jb(w);case "contentControls":return jw(w,S.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 Ef(w,S.filter);case "tableContext":return pu(w);default:return null}},snapshot:()=>St(),getTotalPages:()=>uu(w),getCurrentPage:S=>fu(w,S),scrollToPage:S=>!Number.isInteger(S)||S<1?false:(d.flush(),w?.revealPage(S-1)??false),scrollToBlock:S=>typeof S!="string"||S.length===0?false:(d.flush(),w&&hl(w,S),w?.revealParagraph(S)??false),...vI(Kt,()=>w),relayout(S){S?.sync,w?.layout();},retainSelection:()=>w?.retainSelection()??null,releaseSelection:S=>w?.releaseSelection(S),focus(S){return d.flush(),w?S&&S.kind==="all"?{ok:false,code:"invalidTarget",reason:"the all scope cannot take focus"}:S&&!w.setActiveScope(S)?{ok:false,code:"invalidTarget",reason:"that scope cannot be opened"}:(w.focus(),{ok:true,value:void 0}):{ok:false,code:"invalidTarget",reason:"no document is loaded"}},destroy(){$=true,H.dispose(),d.cancel(),Kt.detach(),ce(),ue(),ue=()=>{},vr(),r=null,s=null,l=new WeakMap,Oe+=1,he();for(let S of Object.values(Ve))S.clear();},on(S,G){return Ve[S].add(G),()=>{Ve[S].delete(G);}}};return An}var TI=Object.freeze({document:true,save:true,events:true,selection:true,scrolling:true,layout:true});function zO(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 jO(e){let t=chunkAFG7Q622_cjs.k({port:WO(e),capabilities:TI}),n=false;return {...t,save:()=>{try{return t.save()}catch(r){return {ok:false,error:{code:"transaction-refused",message:r instanceof Error?r.message:"Cannot save the document."}}}},dispose:()=>{n=true,t.dispose();},execute:r=>(n||e.surface?.flushPendingInput(),t.execute(r))}}function WO(e){let t=0,n=0,r=null,o=false,a=false,i=()=>{if(a)return null;let d=e.surface?.session??null;return d!==r&&(o&&(t+=n+1),o=true,r=d,n=0),d&&(n=d.packageRevision()),d},s,l=null;return {localChangeTracking:true,suggesting:()=>e.surface?.editingMode()==="suggest",async prepare(d){if(!d.operations.some(p=>p.op==="updateFieldResult"))return;s=void 0,l=null;let u=e.surface;if(!u)return;let f=u.layout();s=chunkAFG7Q622_cjs.a(f),l=i()?.currentPackage()??null;},fieldPageContext(d,u,f){let p=i()?.currentPackage()??null;if(!p||p!==l)return null;let m=chunkAFG7Q622_cjs.e(p).story(d);return m?chunkAFG7Q622_cjs.b(s,m.part,u,f):null},revision(){return i(),t+n},currentPackage:()=>i()?.currentPackage()??null,revisionDisplayMode:()=>e.surface?chunkBNZF6DYC_cjs.X(e.surface.revisionDisplayMode()):chunkITNK6C5M_cjs.ja,replacementLanding:(d,u,f)=>e.surface?.replacementLanding(d,u,f)??null,apply(d,u,f=[]){i();let p=e.surface;if(!p)return {ok:false,reason:"no-document"};let m=p.applyAutomationOps(d,u,f);return m.rejected?{ok:false,reason:String(m.reason??"refused")}:{ok:true,changed:m.committed}},applyLifecycle(d){i();let u=e.surface;if(!u)return {ok:false,reason:"no-document"};let f=u.applyAutomationOps(()=>[d]);return f.rejected?{ok:false,reason:String(f.reason??"refused")}:{ok:true,changed:f.committed}},applyCommentWrites(d,u){let f=e.surface,p=i();if(!f||!p)return {ok:false,reason:"no-document"};if(d.length===0)return {ok:true,changed:false};if(u.kind!=="body")return {ok:false,reason:"unsupported-story"};let m=e.can({type:"toggleReviewPane"});if(!m.ok)return {ok:false,reason:m.reason??"review-module-required"};let h={ok:false,reason:"refused"};return f.commitReviewOps(()=>{if(d.every(y=>y.kind==="delete")){let y=d.find(k=>k.kind==="delete"),I=p.deleteComments(d.map(k=>{if(k.kind!=="delete")throw new Error("unreachable mixed comment write");return {commentId:k.commentId,...k.parentCommentId===void 0?{}:{parentCommentId:k.parentCommentId}}}),u,y?.kind==="delete"?y.noteId:void 0);return h=I?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:I}}if(d.length!==1)return h={ok:false,reason:"mixed-comment-writes"},{committed:false};let x=d[0];if(x.kind==="resolve"){let y=p.setCommentResolved(x.commentId,x.resolved);return h=y?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:y}}if(x.kind!=="create"&&x.kind!=="reply")return h={ok:false,reason:"unsupported-comment-write"},{committed:false};let b=p.replyToComment(x.kind==="reply"?x.parentCommentId:null,x.anchor,x.text,x.author,x.date);return h=b===null?{ok:false,reason:"refused"}:{ok:true,changed:true,commentId:b},{committed:b!==null}},zO(d)),h},applyCustomNodeWrite(d,u){let f=e.surface,p=i();if(!f||!p)return {ok:false,reason:"no-document"};if(u.kind!=="body")return {ok:false,reason:"unsupported-story"};let m={ok:false,reason:"refused"};return f.commitReviewOps(()=>{let h=p.insertCustomNode(d);return m=h.ok?{ok:true,changed:h.change!==null}:{ok:false,reason:h.detail?`${h.reason}: ${h.detail}`:h.reason},{committed:h.ok}},"package-scoped"),m},save:()=>i()?e.surface?.save()??null:null,select(d,u){if(!e.surface)return;let p=u==="end"?d.end:d.start,m=u==="start"?d.start:d.end;e.exec({type:"setSelection",range:{anchor:{paragraphId:p.paragraphId,offset:p.offset},head:{paragraphId:m.paragraphId,offset:m.offset}}});},subscribe:d=>e.on("change",()=>d()),dispose(){a=true,r=null;}}}function UO(e){return e*(96/72)}function GO(e,t){return e*t}function XO(e,t){return e/t}function YO(e,t,n){let r=e.pages.find(i=>i.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,a=n.paintScale;return Object.freeze({left:(r.contentBox.x+t.x+o)*a,top:(r.contentBox.y+t.y)*a,width:t.width*a,height:t.height*a})}function QO(e){return Object.freeze(e?{left:e.offsetLeft,top:e.offsetTop}:{left:0,top:0})}function PI(e,t,n){return t?true:e.length===1?false:!n}var CI=["e","se","s","sw","w","nw","n","ne"];function JO(e,t){let n=CI.indexOf(e);t.flipHorizontal&&(n=(4-n+8)%8),t.flipVertical&&(n=(8-n)%8);let r=Math.round(t.rotationDegrees/45)%8;return CI[(n-r+8)%8]}function eF(e,t,n){let r=e,o=t,a=-n.rotationDegrees*Math.PI/180,i=Math.cos(a),s=Math.sin(a),l=r*i-o*s,d=r*s+o*i;return r=l,o=d,n.flipHorizontal&&(r=-r),n.flipVertical&&(o=-o),Object.freeze({x:r,y:o})}function Qr(e){return e/Wa}function RI(e){let t=eF(e.deltaXPt,e.deltaYPt,e.transform),n=Qr(e.startWidthEmu),r=Qr(e.startHeightEmu),o=n/r,a=JO(e.handle,e.transform),i=a.includes("e")?t.x:a.includes("w")?-t.x:0,s=a.includes("s")?t.y:a.includes("n")?-t.y:0;if(n=Math.max(1,n+i),r=Math.max(1,r+s),e.preserveAspect)if(a.length===2){let k=Math.max(n/Qr(e.startWidthEmu),r/Qr(e.startHeightEmu));n=Math.max(1,Qr(e.startWidthEmu)*k),r=Math.max(1,n/o);}else a==="e"||a==="w"?r=Math.max(1,n/o):n=Math.max(1,r*o);let l=Qr(e.startWidthEmu),d=Qr(e.startHeightEmu),u=n/l,f=r/d,p=Math.max(1,e.startBounds.width*u),m=Math.max(1,e.startBounds.height*f),h=e.startBounds.x,x=e.startBounds.y,b=e.handle;b.includes("w")&&(h=e.startBounds.x+e.startBounds.width-p),b.includes("n")&&(x=e.startBounds.y+e.startBounds.height-m);let y=null;if(e.kind==="anchored"&&e.startPosition&&(b.includes("w")||b.includes("n")))if(e.startPosition.mode==="simple"){let I=b.includes("w")?Ct(h-e.startBounds.x):0,k=b.includes("n")?Ct(x-e.startBounds.y):0;y=Object.freeze({mode:"simple",horizontalEmu:(e.startPosition.horizontalEmu??0)+I,verticalEmu:(e.startPosition.verticalEmu??0)+k});}else if(e.anchorFrameOrigin)y=Object.freeze({mode:"frame",...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{},...b.includes("w")?{horizontalEmu:Ct(h-e.anchorFrameOrigin.x)}:e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu}:{},...b.includes("n")?{verticalEmu:Ct(x-e.anchorFrameOrigin.y)}:e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu}:{}});else {let I=b.includes("w")?Ct(h-e.startBounds.x):0,k=b.includes("n")?Ct(x-e.startBounds.y):0;y=Object.freeze({mode:"frame",...e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu+I}:{},...e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu+k}:{},...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{}});}return Object.freeze({widthEmu:Ct(n),heightEmu:Ct(r),previewBounds:Object.freeze({x:h,y:x,width:p,height:m}),position:y})}function tF(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 nF(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&&lu(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?RI({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:PI(e.session.handle,e.aspectLocked,e.shiftKey),kind:e.session.kind}):Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:e.session.startBounds,position:null})}var EI=e=>Math.round(e/1440*100)/100,rF=e=>EI(e).toLocaleString(void 0,{maximumFractionDigits:2}),oF=e=>Math.round(e*1440),aF={left:"dialogs.paragraph.tabAlignLeft",center:"dialogs.paragraph.tabAlignCenter",right:"dialogs.paragraph.tabAlignRight",decimal:"dialogs.paragraph.tabAlignDecimal",bar:"dialogs.paragraph.tabAlignBar"},OI=e=>e===null||e===0?"none":e<0?"hanging":"firstLine",FI=(e,t)=>e==="none"?0:e==="hanging"?-Math.abs(t):Math.abs(t);function iF(e){let t=e.indentFirstLineTwips;return {alignment:e.alignment??"left",indentLeft:e.indentLeftTwips??0,indentRight:e.indentRightTwips??0,special:OI(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 MI={contextualSpacing:false,keepNext:false,keepLines:false,widowControl:false,pageBreakBefore:false,tabStops:false,alignment:false,indentLeft:false,indentRight:false,special:false,spaceBefore:false,spaceAfter:false,lineSpacing:false};function sF(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,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 AI(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 lF(e,t,n=MI,r=n){let o={},a=false,i=(l,d)=>{o[l]=d,a=true;},s=l=>n[l]&&!r[l];return (e.alignment!==t.alignment||s("alignment"))&&i("alignment",t.alignment),(e.indentLeft!==t.indentLeft||s("indentLeft"))&&i("indentLeftTwips",t.indentLeft),(e.indentRight!==t.indentRight||s("indentRight"))&&i("indentRightTwips",t.indentRight),(e.special!==t.special||e.specialBy!==t.specialBy||s("special"))&&i("indentFirstLineTwips",FI(t.special,t.specialBy)),(e.spaceBefore!==t.spaceBefore||s("spaceBefore"))&&i("spaceBeforePt",t.spaceBefore),(e.spaceAfter!==t.spaceAfter||s("spaceAfter"))&&i("spaceAfterPt",t.spaceAfter),!r.lineSpacing&&(e.lineRule!==t.lineRule||e.lineValue!==t.lineValue||s("lineSpacing"))&&i("lineSpacing",{rule:t.lineRule,value:t.lineValue}),(e.contextualSpacing!==t.contextualSpacing||s("contextualSpacing"))&&i("contextualSpacing",t.contextualSpacing),(e.keepNext!==t.keepNext||s("keepNext"))&&i("keepNext",t.keepNext),(e.keepLines!==t.keepLines||s("keepLines"))&&i("keepLines",t.keepLines),(e.widowControl!==t.widowControl||s("widowControl"))&&i("widowControl",t.widowControl),(e.pageBreakBefore!==t.pageBreakBefore||s("pageBreakBefore"))&&i("pageBreakBefore",t.pageBreakBefore),(!AI(e.tabStops,t.tabStops)||s("tabStops")&&t.clearedAllTabStops)&&i("tabStops",t.tabStops),a?o:null}function dF(e,t){return [...e.filter(r=>r.positionTwips!==t.positionTwips),t].sort((r,o)=>r.positionTwips-o.positionTwips)}function cF(e,t){if(t.key!=="Tab")return false;let n=[...e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(i=>!i.hasAttribute("disabled")&&i.tabIndex!==-1);if(n.length===0)return false;let r=n[0],o=n[n.length-1],a=e.ownerDocument.activeElement;return t.shiftKey&&(a===r||a===e)?(o.focus(),true):!t.shiftKey&&a===o?(r.focus(),true):false}function uF(e,t,n){let r,o=false,a,i,s=new Set,l=[],d=()=>{clearTimeout(i),i=void 0,r?.end(),r=void 0,a=void 0,s.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 x=r;a=void 0,s.clear(),clearTimeout(i),i=setTimeout(()=>{r===x&&d();},0);},m=(x,b,y,I=false)=>{x.addEventListener(b,y,I),l.push(()=>x.removeEventListener(b,y,I));},h=x=>n.kind==="native-color"?x==="Enter"||x===" ":["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"," ","Enter"].includes(x);if(m(t,"pointerdown",x=>{let b=x;if(!(b.button!==0||n.kind==="keyboard")&&(f(),a=b.pointerId,n.kind!=="native-color"))try{t.setPointerCapture?.(b.pointerId);}catch{}},true),m(t,"keydown",x=>{let b=x;if(b.key==="Escape"){p();return}!h(b.key)||b.altKey||b.ctrlKey||b.metaKey||(!b.repeat&&s.size===0&&f(),s.add(b.key),u());},true),m(t.ownerDocument,"keyup",x=>{let b=x.key;s.delete(b)&&n.kind!=="native-color"&&s.size===0&&p();},true),n.kind!=="native-color")for(let x of ["pointerup","pointercancel","lostpointercapture"])m(x==="lostpointercapture"?t:t.ownerDocument,x,b=>{a!==void 0&&b.pointerId===a&&p();},true);return m(t,"input",()=>{i!==void 0?f():u();},true),m(t,"change",()=>{(n.kind==="native-color"||a===void 0&&s.size===0)&&p();}),m(t,"blur",p,true),t.ownerDocument.defaultView&&m(t.ownerDocument.defaultView,"blur",p),{options:()=>({historyGroup:u()}),dispose(){if(!o){o=true,d();for(let x of l)x();}}}}
|
|
20
|
-
exports.$=Ga;exports.$a=HO;exports.A=Ac;exports.Aa=b0;exports.Ab=cF;exports.B=Lc;exports.Ba=YP;exports.Bb=uF;exports.C=PC;exports.Ca=QP;exports.D=Jc;exports.Da=JP;exports.E=oP;exports.Ea=D0;exports.F=qa;exports.Fa=Xa;exports.G=Za;exports.Ga=Ya;exports.H=eu;exports.Ha=oR;exports.I=aP;exports.Ia=vu;exports.J=tu;exports.Ja=zr;exports.K=In;exports.Ka=Un;exports.L=za;exports.La=_s;exports.M=iu;exports.Ma=rv;exports.N=su;exports.Na=ov;exports.O=vP;exports.Oa=wu;exports.P=xP;exports.Pa=Bs;exports.Q=Wa;exports.Qa=Iu;exports.R=wP;exports.Ra=$s;exports.S=Ct;exports.Sa=ku;exports.T=So;exports.Ta=Tu;exports.U=IP;exports.Ua=Cu;exports.V=lu;exports.Va=tl;exports.W=kP;exports.Wa=AS;exports.X=Rs;exports.Xa=yf;exports.Y=Io;exports.Ya=ci;exports.Z=i0;exports.Za=ui;exports._=mu;exports._a=Mo;exports.a=go;exports.aa=EP;exports.ab=Tl;exports.b=Ma;exports.ba=s0;exports.bb=Cl;exports.c=xk;exports.ca=l0;exports.cb=VO;exports.d=Vd;exports.da=OP;exports.db=TI;exports.e=tC;exports.ea=Vr;exports.eb=jO;exports.f=nC;exports.fa=gu;exports.fb=UO;exports.g=Ue;exports.ga=LP;exports.gb=GO;exports.h=Pc;exports.ha=NP;exports.hb=XO;exports.i=uC;exports.ia=HP;exports.ib=YO;exports.j=pC;exports.ja=Os;exports.jb=QO;exports.k=mC;exports.ka=f0;exports.kb=PI;exports.l=tb;exports.la=Es;exports.lb=RI;exports.m=gC;exports.ma=p0;exports.mb=tF;exports.n=hC;exports.na=m0;exports.nb=nF;exports.o=yC;exports.oa=$P;exports.ob=EI;exports.p=bC;exports.pa=qP;exports.pb=rF;exports.q=vC;exports.qa=ZP;exports.qb=oF;exports.r=xC;exports.ra=VP;exports.rb=aF;exports.s=SC;exports.sa=zP;exports.sb=OI;exports.t=nb;exports.ta=jP;exports.tb=FI;exports.u=wC;exports.ua=WP;exports.ub=iF;exports.v=IC;exports.va=UP;exports.vb=MI;exports.w=Fc;exports.wa=yu;exports.wb=sF;exports.x=pb;exports.xa=GP;exports.xb=AI;exports.y=mb;exports.ya=y0;exports.yb=lF;exports.z=ks;exports.za=XP;exports.zb=dF;
|