@docx-editor.dev/core 2.36.0 → 2.37.0-canary.20261110032710.sha-525df6f
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/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +6 -6
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +11 -11
- package/dist/binding.js +1 -1
- package/dist/{chrome-print-B9U_PiqL.d.ts → chrome-print-BSsqYQtt.d.ts} +51 -19
- package/dist/chunk-36NJQDWI.cjs +31 -0
- package/dist/chunk-3OKDY5TX.cjs +3 -0
- package/dist/{chunk-I34OVDHO.cjs → chunk-4QLFADOG.cjs} +1 -1
- package/dist/chunk-6EGRB3J4.js +6 -0
- package/dist/chunk-6I6V2JDF.cjs +7 -0
- package/dist/chunk-77L2HX42.js +1 -0
- package/dist/chunk-ATU65CUF.cjs +32 -0
- package/dist/chunk-EB5XLX3A.js +4 -0
- package/dist/chunk-G7GO4CNK.cjs +2 -0
- package/dist/chunk-JK4HBRVP.js +7 -0
- package/dist/{chunk-D75AXVLG.cjs → chunk-JZXMWGF4.cjs} +1 -1
- package/dist/{chunk-HLMY6NFI.js → chunk-MLJJL4QG.js} +1 -1
- package/dist/chunk-MYNOUTWY.js +1 -0
- package/dist/{chunk-QTRRXJXQ.cjs → chunk-NPPHSBFT.cjs} +3 -3
- package/dist/{chunk-7ZSPY7WH.cjs → chunk-OTZNA6FP.cjs} +1 -1
- package/dist/chunk-Q3FUAUL4.js +31 -0
- package/dist/chunk-RFMMFHWX.cjs +6 -0
- package/dist/chunk-T6MYXF6V.js +32 -0
- package/dist/chunk-TTPQZXYS.js +3 -0
- package/dist/{chunk-4RDU6QVH.cjs → chunk-UMDB6PEV.cjs} +1 -1
- package/dist/{chunk-NTDLU6W6.cjs → chunk-UP5TM6T6.cjs} +1 -1
- package/dist/{chunk-2BVJFI6B.js → chunk-WMM772MS.js} +1 -1
- package/dist/chunk-XI5HK3TZ.js +282 -0
- package/dist/chunk-XMJFDVE2.js +4 -0
- package/dist/chunk-XPBKJQTG.cjs +282 -0
- package/dist/{chunk-VS2MXS62.js → chunk-YCOHPEF2.js} +1 -1
- package/dist/{chunk-IMTQS6N5.cjs → chunk-YVK3NMR6.cjs} +1 -1
- package/dist/{chunk-K3UKJU4K.js → chunk-YVLF7HBD.js} +1 -1
- package/dist/chunk-Z6NPBOE6.js +2 -0
- package/dist/chunk-ZY7HJR3R.cjs +4 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +2 -2
- package/dist/collaboration/replication.js +1 -1
- package/dist/contracts/document.d.ts +2 -2
- package/dist/contracts/editor.d.ts +8 -8
- package/dist/contracts/modules.d.ts +9 -9
- package/dist/contracts/types.d.ts +3 -3
- package/dist/{custom-node-writes-DqzeiTpY.d.ts → custom-node-writes-Buryuzow.d.ts} +2 -2
- package/dist/{document-protection-CGnc6WX7.d.ts → document-protection-Denp0lhl.d.ts} +1 -1
- package/dist/{drawing-graphic-kind-Dw4Qu9VA.d.ts → drawing-graphic-kind-DjGMFeSM.d.ts} +2 -2
- package/dist/{drawing-preview-package-BuFluWSg.d.ts → drawing-preview-package-LHyHuTVq.d.ts} +1 -1
- package/dist/{editor-CoU0Ipa9.d.ts → editor-B0xPJSXd.d.ts} +233 -9
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +2 -2
- package/dist/editor.d.ts +309 -26
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +2 -2
- package/dist/export.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-B7ifvgm-.d.ts → layout-shaping-CFTk9pWQ.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +16 -14
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CrO9A0Ju.d.ts → note-properties-C8_cURo1.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +9 -9
- package/dist/output.js +1 -1
- package/dist/{protocol-C-LfGgrt.d.ts → protocol-CG_ybtKt.d.ts} +2 -2
- package/dist/{review-paragraph-order-gZ8-oIWd.d.ts → review-paragraph-order-3oV2aI2q.d.ts} +1 -1
- package/dist/{revision-projection-BAUauksK.d.ts → revision-projection-C9oujZwA.d.ts} +1 -1
- package/dist/{semantic-cell-selection--xgumqWx.d.ts → semantic-cell-selection-BiYMYlbf.d.ts} +2 -2
- package/dist/{semantic-interaction-B_AAT9S2.d.ts → semantic-interaction-BTba0_1e.d.ts} +1 -1
- package/dist/{semantic-paint-Cl4VyItm.d.ts → semantic-paint-B_xi9H5m.d.ts} +4 -4
- package/dist/{semantic-record-queries-BKX8sDqa.d.ts → semantic-record-queries-TdjLU-AU.d.ts} +1 -1
- package/dist/{semantic-records-DkDc4E1z.d.ts → semantic-records-C5qbT1sK.d.ts} +29 -5
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +12 -12
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-BJTz6t_O.d.ts → tree-op-types-DzstjXTb.d.ts} +12 -2
- package/dist/{tree-package-fragment-DDV5xjSI.d.ts → tree-package-fragment-DLbxcboK.d.ts} +67 -65
- package/dist/{tree-session-contract-CAsZn-VN.d.ts → tree-session-contract-BiKgucBu.d.ts} +92 -11
- package/dist/{unsupported-elements-1Tj829Bk.d.ts → unsupported-elements-KboafN7A.d.ts} +1 -1
- package/package.json +2 -2
- package/dist/chunk-3DLIAAXE.js +0 -2
- package/dist/chunk-3KSO2I22.js +0 -4
- package/dist/chunk-4K5QXGVN.js +0 -31
- package/dist/chunk-5JHQHJRH.js +0 -3
- package/dist/chunk-5W6DLXVG.cjs +0 -3
- package/dist/chunk-6VTHQTM3.js +0 -1
- package/dist/chunk-7MOZVKCN.js +0 -282
- package/dist/chunk-BR7AQCGM.cjs +0 -31
- package/dist/chunk-DZO5K26E.js +0 -1
- package/dist/chunk-K5FZYV6Z.cjs +0 -32
- package/dist/chunk-MK4MO7RT.cjs +0 -7
- package/dist/chunk-N5RYSQN5.js +0 -4
- package/dist/chunk-O2AEJ5T4.js +0 -5
- package/dist/chunk-PSVIEQUU.js +0 -32
- package/dist/chunk-PXF5BBEK.cjs +0 -2
- package/dist/chunk-R42NW5FO.js +0 -7
- package/dist/chunk-TCWCSTAF.cjs +0 -282
- package/dist/chunk-XFDDD65J.cjs +0 -4
- package/dist/chunk-XTNY4DBY.cjs +0 -5
package/dist/chunk-4K5QXGVN.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-YD3KSZJM.js';import {s,o as o$1,j,i,v,w as w$1,q as q$1,k as k$1,n as n$1,p,f as f$1,g as g$1,e as e$1,d as d$1,h,t}from'./chunk-3KSO2I22.js';import {w,x,o,s as s$1,u,g as g$2,a as a$4,k as k$2,j as j$3,i as i$2,F as F$2,I as I$1,h as h$1,b as b$3,G as G$3,f as f$4,D as D$3,v as v$1,l as l$3,J as J$2,K as K$2,C as C$1,A as A$1,y,c as c$3}from'./chunk-3DLIAAXE.js';import {k,e,r,Z,ha,oa as oa$1,ma as ma$2,ga,j as j$2,_,$,aa as aa$1,pa as pa$1,ka,qa,ja,ra as ra$1,sa as sa$1,ta as ta$1,ia as ia$1,na as na$1,la as la$1,G as G$2,W,c as c$2,t as t$1,fa as fa$1}from'./chunk-5JHQHJRH.js';import {B,D,u as u$1,q,s as s$2,r as r$1,j as j$1,c,x as x$1,G,L,K,E,I,M,A,F,i as i$1,e as e$2,C,N,O,a as a$6,b as b$1,d as d$3,g as g$3,f as f$3,h as h$3}from'./chunk-R42NW5FO.js';import {b,a as a$5,f as f$2,e as e$3,g as g$4}from'./chunk-DZO5K26E.js';import {d,ib as ib$1,a as a$1,l,Ge,jf as jf$1,Cg,Df as Df$1,Sf as Sf$1,Tf as Tf$1,zg as zg$1,Se,mb as mb$1,Yf as Yf$1,Md,Wf as Wf$1,Te,Fb as Fb$1,ab as ab$1,Ie,Le,ma as ma$1,Yb as Yb$1,fe,Wd,Db as Db$1,Bf as Bf$1,nb as nb$1,ob as ob$1,qb as qb$1,pb as pb$1,fd,gd,hd,Pf as Pf$2,ce,be,Rb as Rb$1,Zb as Zb$2,Vf as Vf$1,Ze as Ze$1,$e,_e,ef as ef$1,gb as gb$1,df as df$1,Ka as Ka$1,id,Ve,La,Je,Xb as Xb$1,We,db as db$1,Ld,nf as nf$1,_b as _b$1,ac as ac$1,ff as ff$1,ad,Hd,Ja,Ff as Ff$2,ue as ue$1,jc as jc$1,ra as ra$2,Ue,Ae as Ae$1,we,Jf as Jf$1,Gf as Gf$2,Hf as Hf$1,If as If$1,jb as jb$1,kc as kc$1,de as de$1,vf as vf$1,xf as xf$1,Ed,Pe as Pe$1,af as af$1,fb as fb$2,$d,eb as eb$2,_a,Re as Re$1,Me,Ye,E as E$2,D as D$1,U as U$1,da as da$1,$ as $$1,Dd,sf as sf$1,Ha,vc as vc$2,uf as uf$1,ye as ye$1,ze,Ce,Ne,pe,Wb as Wb$1,$a,Ta,$b as $b$1,Cf as Cf$2,re,Bb as Bb$1,gf as gf$1,cd as cd$1,Ya,bb as bb$1,mf as mf$1,ba,Cd,Kd,Sa,uc as uc$1,xc as xc$1,Uf as Uf$2,cb as cb$1,pd as pd$1,lf as lf$1,dd,Yc as Yc$1,Bd,J as J$1,zb as zb$1,pg,qd,Nd,Bg as Bg$1,Ag as Ag$1,h as h$2,hf as hf$1,q as q$2,p as p$1,og as og$1,$c as $c$1,ng as ng$1,Fd}from'./chunk-PSVIEQUU.js';import {m,n,d as d$2,i as i$3,k as k$3,j as j$4,l as l$2}from'./chunk-O2AEJ5T4.js';import {a as a$7}from'./chunk-2BVJFI6B.js';import {S,Ia,Aa,E as E$1,G as G$1,F as F$1,D as D$2,M as M$1,J,L as L$1}from'./chunk-N5RYSQN5.js';import {a as a$3,b as b$2}from'./chunk-WN7ICTA5.js';import {c as c$1}from'./chunk-HLMY6NFI.js';import {eb as eb$1,f,Cf as Cf$1,tm,Pe,Ek,Fk,Gk,g,Ch as Ch$1,Qi as Qi$1,Vh as Vh$1,Zi as Zi$1,Xi as Xi$1,Yi as Yi$1,nl,zn as zn$1,Fh as Fh$1,Oi,qj as qj$1,Hb as Hb$1,mi,Pf as Pf$1,Uf as Uf$1,kn,Xe,Qe as Qe$1,Re,Te as Te$1,tn,un,U,on as on$1,qn as qn$1,ln,pn,ck,Zm,Pn as Pn$1,Nn,wb as wb$1,hm,Nk,si as si$1,ei as ei$1,di as di$1,fi,Ka,Zk,Jk,Ik,Rk,ml,mg,Ic as Ic$1,gn,Zb as Zb$1,ld,cj as cj$1,kj as kj$1,Hc as Hc$1,wl,yh as yh$1,cd,Df as Df$2,Ef as Ef$1,Af as Af$1,Bf as Bf$2,Ff as Ff$1,Gf as Gf$1,wi,xi,pi,oi as oi$1,ci as ci$1,bi,$h as $h$1,Ck,Nb as Nb$1,id as id$1,ij as ij$1,Km,$k,Qm,Rm,Um,Vm,Wg as Wg$1,Bh as Bh$1,Fi,ce as ce$1,Wh as Wh$1,hi,yi,ai as ai$1,oe,l as l$1,vb,Tk,Ak,an,Dk,Vk,Fj as Fj$1,Dj as Dj$1,hn,in as _in,Qd,fd as fd$1,Fg as Fg$1,fb as fb$1,$j as $j$1,ad as ad$1,Tc as Tc$1,Rc as Rc$1,yl,zi as zi$1,Ai,Mh as Mh$1,qc as qc$1,r as r$2,ni as ni$1,pa as pa$2,md,pd,zm,Mn,dn,ol,Yj as Yj$1,tl,Lh as Lh$1,sc as sc$1,pm,wc as wc$1,vc as vc$1,_d,ag,$f as $f$1,Hi,Ud,ma as ma$3,va,oa as oa$2,Tm,Cl,Dl,Vg as Vg$1,ae,_i,Ua,rm,km,mm,Pl,im,Ph as Ph$1,fn,en as en$1,rj as rj$1,Di,Nc as Nc$1,Ng as Ng$1,Hg as Hg$1,Jg as Jg$1,Ok,Xk,Yk,el,_l,am,_b as _b$2,jj,hd as hd$1,Pa,ud,lb as lb$1,sg,Hk,Sm,Uh as Uh$1,kl,Gl as Gl$1,jm,Th as Th$1,Rh as Rh$1,Aa as Aa$1,Ba,Ca,ql,pl,ll,Ej as Ej$1,Gn as Gn$1,ug,Rb as Rb$2,Kk,kc as kc$2,hc as hc$1,In as In$1,E as E$3,Kh as Kh$1,Gi as Gi$1,zh as zh$1,dm,eh as eh$1,og,cf as cf$1,W as W$1,bf as bf$1,ba as ba$1,Mg as Mg$1,nd,ya,Lg as Lg$1,Og as Og$1,V,Z as Z$1,wa,K as K$1,Ie as Ie$1,Yb as Yb$2,ch as ch$1,Ub as Ub$1,cc as cc$1,gj as gj$1,zb as zb$2,qh as qh$1,ng,ab as ab$2}from'./chunk-7MOZVKCN.js';import {a}from'./chunk-S6J4O5XP.js';import {zipSync,strToU8}from'fflate';import {createT,en,isApplePlatform,locales,deepMerge}from'@docx-editor.dev/i18n';function tR(e){return e===void 0?void 0:Object.freeze({maxFontBytes:j$2(e).maxFontBytes})}function e6(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}var eR=false;function nR(e){if(eR)return;eR=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 $i(e$1){if(e$1 instanceof a)return e$1;if(e$1 instanceof d)return new a(e$1.code,e$1.message,{request:e6(e$1.request),diagnostic:e$1.diagnostic});if(e$1 instanceof k)return new a("overLimit",e$1.message,{diagnostic:e$1.message});if(e$1 instanceof e){let t=e$1.code==="wasmUnavailable"||e$1.code==="shapingLibraryMismatch"?"wasmUnavailable":"initializationFailed";return new a(t,e$1.message,{diagnostic:e$1.diagnostic??e$1.message,cause:e$1})}return new a("initializationFailed",e$1 instanceof Error?e$1.message:"Font initialization failed",{diagnostic:e$1 instanceof Error?e$1.message:String(e$1),cause:e$1})}async function Kl(e,t,n){try{return await r(e,t,n)}catch(r){throw $i(r)}}var Ou=Object.freeze({opening:"auto",overflow:"float",revisionsIn:"pane",commentMarkers:"icon"}),Og={opening:["auto","manual"],overflow:["float","shrinkPage","scroll"],revisionsIn:["pane","balloons"],commentMarkers:["initials","icon"]};function Mu(e,t=Ou){if(e===void 0)return t;if(e===null||typeof e!="object")throw new TypeError("review pane settings must be an object");let n=t;for(let[r,o]of Object.entries(e)){if(o===void 0)continue;if(!Object.hasOwn(Og,r))throw new TypeError(`unknown review pane setting ${r}`);let i=r;if(typeof o!="string"||!Og[i].includes(o))throw new TypeError(`review pane ${i} must be ${Og[i].join(" or ")}`);n[i]!==o&&(n={...n,[i]:o});}return n===t?t:Object.freeze(n)}function Mg(e,t){return e==="pane"?true:t.kind==="revision"?false:!(t.kind==="comment"&&t.parentRevisionId!==void 0)}var t6=Object.freeze({revisionMarkup:ib$1,reviewPane:Ou,scope:Object.freeze({kind:"body"}),isLoading:true,isOpening:false,parseError:null,openFailure:null,editable:false,zoom:1,selection:null,selectionCollapsed:true,formatting:null,table:null,tocContext:null,image:null,page:Object.freeze({current:0,total:0}),canUndo:false,canRedo:false,collaborationStatus:"inactive"});function n6(e){return o(t=>{let n=[],r=s$1([e],t,{onOriginFailure:o=>n.push(o.cause)}).then(o=>n.length>0?{sources:[],...o,failures:n}:o,o=>t.signal?.aborted?void 0:{sources:[],failures:[o]});return {sources:[],deferred:r}})}var oR="http://schemas.openxmlformats.org/wordprocessingml/2006/main",o6="http://schemas.openxmlformats.org/package/2006/content-types",iR="http://schemas.openxmlformats.org/package/2006/relationships",i6="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",a6="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",s6=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="${o6}"><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>`,l6=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${iR}"><Relationship Id="rId1" Type="${i6}" Target="word/document.xml"/></Relationships>`,c6=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Relationships xmlns="${iR}"><Relationship Id="rId1" Type="${a6}" Target="styles.xml"/></Relationships>`,d6=[{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}],u6=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>",f6=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:styles xmlns:w="${oR}"><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>`+d6.map(u6).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>',rR=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:document xmlns:w="${oR}"><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>`,p6=/^[A-Za-z]{2,8}(?:-[A-Za-z0-9]{1,8}){0,4}$/;function Ag(e={}){let t=e.direction==="rtl",n=e.bidiLanguage!==void 0&&p6.test(e.bidiLanguage)?e.bidiLanguage:null,r=f6.replace('<w:sz w:val="22"/><w:szCs w:val="22"/>',`<w:sz w:val="22"/><w:szCs w:val="22"/>${n?`<w:lang w:bidi="${n}"/>`:""}`).replace("<w:pPrDefault><w:pPr>",`<w:pPrDefault><w:pPr>${t?"<w:bidi/>":""}`),o=t?rR.replace("</w:sectPr>","<w:bidi/></w:sectPr>"):rR;return zipSync({"[Content_Types].xml":strToU8(s6),"_rels/.rels":strToU8(l6),"word/_rels/document.xml.rels":strToU8(c6),"word/document.xml":strToU8(o),"word/styles.xml":strToU8(r)})}function Wi(e){if(e){if(e.nodeType===9)return e;if(e.ownerDocument)return e.ownerDocument}return globalThis.document}function Ae(e){return Wi(e)?.defaultView??globalThis}var aR=new WeakMap;function sR(e,t){aR.set(e,t);}function m6(e){return So(e)}function So(e){return aR.get(e)?.()??null}function lR(e){let t=e.ownerDocument?.defaultView;return t?t.closed?"attach() needs an element in an open window; this window has closed":null:"attach() needs an element in a document with a window; this one has none"}function g6(e){return Wi(So(e))}function h6(e){return Ae(So(e))}function Wt(e){return typeof e=="object"&&e!==null&&e.nodeType===1}function Gr(e){return Wt(e)&&e.namespaceURI==="http://www.w3.org/1999/xhtml"}function y6(e){return typeof e=="object"&&e!==null&&e.nodeType===3}function wo(e){return typeof e=="object"&&e!==null&&typeof e.nodeType=="number"&&typeof e.nodeName=="string"}function Au(e,t){return Gr(e)&&e.localName===t}function Lg(){return globalThis}function nt(e){let t=0,n=new Map,r=new Map;function o(f,p){f.win=p,f.native=f.kind==="frame"&&typeof p.requestAnimationFrame=="function"?p.requestAnimationFrame(f.fire):p.setTimeout(()=>f.fire(p.performance?.now()??Date.now()),Math.max(0,f.dueAt-Date.now())),a(p);}function i(f){f.kind==="frame"&&typeof f.win.cancelAnimationFrame=="function"?f.win.cancelAnimationFrame(f.native):f.win.clearTimeout(f.native);}function a(f){if(r.has(f)||f===Lg())return;let p=()=>{s(f);let g=Ae(e()),y=g===f?Lg():g;for(let h of n.values())h.win===f&&(i(h),o(h,y));};f.addEventListener("pagehide",p),r.set(f,p);}function s(f){let p=r.get(f);p&&(r.delete(f),f.removeEventListener("pagehide",p));}function l(f){let p=n.get(f);if(p){n.delete(f);for(let g of n.values())if(g.win===p.win)return;s(p.win);}}function c(){if(n.size===0)return;let f=Ae(e());for(let p of n.values()){if(p.win===f)continue;let g=p.win;i(p),o(p,f);let y=false;for(let h of n.values())h.win===g&&(y=true);y||s(g);}}function d(f,p,g=0){c();let y=++t,h={kind:f,win:Lg(),native:0,dueAt:Date.now()+g,fire:b=>{l(y),p(b);}};return n.set(y,h),o(h,Ae(e())),y}function u(f){if(f==null)return;let p=n.get(f);p&&(i(p),l(f));}return {setTimeout:(f,p)=>d("timeout",()=>f(),p),clearTimeout:u,requestAnimationFrame:f=>d("frame",f),cancelAnimationFrame:u,migrate:c}}function ns(e){return typeof e.key=="string"&&"repeat"in e}function Lu(e){return typeof e.pointerId=="number"}function b6(e){return typeof e.button=="number"&&"clientX"in e}function Fg(e){return typeof e.inputType=="string"}var v6=1;function x6(e){let t=Ae(e);if(t.getComputedStyle(e).direction==="rtl")return ()=>{};let n=()=>e.scrollWidth-e.clientWidth,r=true,o=null,i=()=>{r&&(e.scrollLeft=n(),o=e.scrollLeft);},a=()=>{e.scrollLeft!==o&&(o=null,r=e.scrollLeft>=n()-v6);};i(),e.addEventListener("scroll",a,{passive:true}),e.addEventListener("transitionend",i);let s=null;if(typeof t.ResizeObserver=="function"){s=new t.ResizeObserver(i),s.observe(e);for(let l of Array.from(e.children))s.observe(l);}return ()=>{s?.disconnect(),e.removeEventListener("scroll",a),e.removeEventListener("transitionend",i);}}function S6(e,t,n,r){let o=Math.min(e.right,n.width-t.width-8),i=Math.max(8,e.left-t.width),a=e.right+t.width<=n.width-8,s=e.left-t.width>=8,l=r?s?i:o:a?o:i,c=Math.max(8,Math.min(e.top-4,n.height-t.height-8));return {left:l,top:c}}function w6(e){return e?{open:"ArrowLeft",close:"ArrowRight"}:{open:"ArrowRight",close:"ArrowLeft"}}function Dg(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode();return "host"in t?t.host??null:null}function k6(e){for(let t=e;t;t=Dg(t)){let n=t.getAttribute("dir")?.toLowerCase();if(n==="rtl"||n==="ltr")return n}return "ltr"}function I6(e,t){let n=Ae(e);if(typeof n.MutationObserver!="function")return ()=>{};let r=a=>{for(let s=e;s;s=Dg(s))if(s===a)return true;return false},o=new n.MutationObserver(a=>{a.some(s=>r(s.target))&&t();}),i={attributes:true,attributeFilter:["dir"],subtree:true};o.observe(e.ownerDocument.documentElement,i);for(let a=e;a;a=Dg(a)){let s=a.getRootNode();s!==e.ownerDocument&&!a.parentElement&&o.observe(s,i);}return ()=>o.disconnect()}var cR="http://schemas.microsoft.com/office/2004/12/omml",R6="http://www.w3.org/1998/Math/MathML",P6=4096,dR=32;function uR(e,t){return e.failed||t>dR||e.left<=0?(e.failed=true,false):(e.left-=1,true)}function jl(e,t){return e.kind!=="textValue"&&e.namespaceUri===Fg$1&&(t===void 0||e.localName===t)}function Ng(e,t){if(e.kind!=="textValue")return e.attributes.find(n=>n.localName==="val"&&n.namespaceUri===t)?.value}function fR(e,t,n){if(!uR(t,n))return "";if(e.kind==="textValue")return e.value;let r="";for(let o of e.children)r+=fR(o,t,n+1);return r}function T6(e,t,n){if(e.kind==="textValue")return "";let r="",o,i=false,a;for(let d of e.children)if(jl(d,"t"))r+=fR(d,t,n+1);else if(jl(d,"rPr")&&d.kind!=="textValue")for(let u of d.children)jl(u,"sty")&&(o=Ng(u,Fg$1)),jl(u,"nor")&&(i=true);else if(d.kind!=="textValue"&&d.namespaceUri===pa$2&&d.localName==="rPr"){let u=d.children.find(p=>p.kind!=="textValue"&&p.localName==="color"),f=u?Ng(u,pa$2):void 0;f&&/^[0-9A-Fa-f]{6}$/.test(f)&&(a=f.toUpperCase());}if(r.length===0)return "";let s=`<m:r>${V(r)}</m:r>`;a!==void 0&&(s=`<span style="color:#${a}">${s}</span>`);let l=!i&&(o===void 0||o==="i"||o==="bi"),c=o==="b"||o==="bi";return l&&(s=`<i>${s}</i>`),c&&(s=`<b>${s}</b>`),s}function pR(e,t,n){if(e.kind==="textValue"||!jl(e)||!uR(t,n))return "";if(e.localName==="r")return T6(e,t,n);if(e.localName==="ctrlPr")return "";let r=Ng(e,Fg$1),o=r===void 0?"":` m:val="${W$1(r)}"`,i="";for(let a of e.children)i+=pR(a,t,n+1);return i.length>0?`<m:${e.localName}${o}>${i}</m:${e.localName}>`:`<m:${e.localName}${o}/>`}function E6(e){let t="";for(let n of e.match(/\d+(?:\.\d+)?|\p{L}|\s+|./gu)??[]){if(/^\s+$/.test(n))continue;let r=V(n);/^\d/.test(n)?t+=`<mn>${r}</mn>`:/^\p{L}$/u.test(n)?t+=`<mi>${r}</mi>`:t+=`<mo>${r}</mo>`;}return t}function Hg(e,t){if(t>dR)return "";let n=r=>`<mrow>${Hg(r,t+1)}</mrow>`;switch(e.kind){case "text":return e.format?.normalText?`<mtext>${V(e.value)}</mtext>`:E6(e.value);case "fallback":return `<mtext>${V(e.text)}</mtext>`;case "row":return e.items.map(r=>Hg(r,t+1)).join("");case "bar":return e.position==="top"?`<mover accent="true">${n(e.body)}<mo>\xAF</mo></mover>`:`<munder accentunder="true">${n(e.body)}<mo>\xAF</mo></munder>`;case "borderBox":return `<menclose notation="${[e.hidden.top?"":"top",e.hidden.bottom?"":"bottom",e.hidden.left?"":"left",e.hidden.right?"":"right",e.strikes.horizontal?"horizontalstrike":"",e.strikes.vertical?"verticalstrike":"",e.strikes.bottomLeftToTopRight?"updiagonalstrike":"",e.strikes.topLeftToBottomRight?"downdiagonalstrike":""].filter(Boolean).join(" ")}">${n(e.body)}</menclose>`;case "fraction":return `<mfrac>${n(e.numerator)}${n(e.denominator)}</mfrac>`;case "radical":return e.degree===void 0?`<msqrt>${n(e.radicand)}</msqrt>`:`<mroot>${n(e.radicand)}${n(e.degree)}</mroot>`;case "script":{let r=n(e.base);return e.subscript&&e.superscript?`<msubsup>${r}${n(e.subscript)}${n(e.superscript)}</msubsup>`:e.subscript?`<msub>${r}${n(e.subscript)}</msub>`:e.superscript?`<msup>${r}${n(e.superscript)}</msup>`:r}case "nary":{let r=`<mo>${V(e.operator)}</mo>`,o=e.lowerLimit?n(e.lowerLimit):"",i=e.upperLimit?n(e.upperLimit):"",[a,s,l]=e.limitLocation==="subSup"?["msubsup","msub","msup"]:["munderover","munder","mover"];return `<mrow>${o&&i?`<${a}>${r}${o}${i}</${a}>`:o?`<${s}>${r}${o}</${s}>`:i?`<${l}>${r}${i}</${l}>`:r}${n(e.body)}</mrow>`}}}function mR(e){if(!Mg$1(e))return "";let t=Lg$1(e),n=t?Og$1(e):Hg$1(e),r={left:P6,failed:false},o=pR(e,r,0),i=n===null?"":`<math xmlns="${R6}"${t?' display="block"':""}>${Hg(n.expression,0)}</math>`;return r.failed||o.length===0?i:`<!--[if gte msEquation 12]>${o}<![endif]--><![if !msEquation]>${i}<![endif]>`}function gR(e){return e.includes("<!--[if gte msEquation 12]>")}var rs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C6=(()=>{let e=new Int16Array(128).fill(-1);for(let t=0;t<rs.length;t+=1)e[rs.charCodeAt(t)]=t;return e})();function Fu(e,t){if(e.length===0)return null;let n=e.length%4;if(n===1)return null;let r=n===0?e:e+"=".repeat(4-n),o=r.endsWith("==")?2:r.endsWith("=")?1:0,i=r.length/4*3-o;if(i<=0||i>t)return null;let a=new Uint8Array(i),s=0;for(let l=0;l<r.length;l+=4){let c=0,d=0;for(let u=0;u<4;u+=1){let f=r.charCodeAt(l+u);if(f===61){if(l+u<r.length-o)return null;continue}let p=f<128?C6[f]:-1;if(p<0)return null;c=c<<6|p,d+=6;}c<<=24-d,d>=12&&(a[s++]=c>>>16&255),d>=18&&(a[s++]=c>>>8&255),d>=24&&(a[s++]=c&255);}return s===i?a:null}function Du(e){let t=[],n="";for(let r=0;r<e.length;r+=3){let o=e[r],i=r+1<e.length?e[r+1]:0,a=r+2<e.length?e[r+2]:0;n+=rs[o>>2]+rs[(o&3)<<4|i>>4],n+=r+1<e.length?rs[(i&15)<<2|a>>6]:"=",n+=r+2<e.length?rs[a&63]:"=",n.length>=32768&&(t.push(n),n="");}return t.push(n),t.join("")}var O6=16*1024*1024,yR=64*1024*1024,bR="data-docx-fragment",vR="data-docx-fragment-end",M6=Du;function xR(e,t){let n=t?.lastMarkCovered?"covered":"open",r=t?`<div ${bR}="${M6(t.bytes)}" ${vR}="${n}">${e}</div>`:`<div>${e}</div>`;return gR(e)?`<html xmlns:m="${cR}"><body>${r}</body></html>`:r}function hR(e,t){let n=`${t}="`,r=e.indexOf(n);if(r===-1||r>yR)return null;let o=r+n.length,i=e.indexOf('"',o);return i===-1?null:e.slice(o,i)}function jo(e,t=O6){if(e.length>yR)return null;let n=hR(e,bR);if(n===null||n.length===0)return null;let r=Fu(n,t);if(r===null||r.byteLength===0)return null;let o=hR(e,vR);return {bytes:r,lastMarkCovered:o==="covered"}}function qi(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}function Wn(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}var _g="Unknown",Wg=255,Bg='w:id="?"';function SR(e){let t=Wn(e??"").replace(/[\t\n\r]+/g," ").trim().slice(0,Wg);return t.length>0?t:_g}function A6(e){if(e===null||e.length>4*Wg)return _g;let t=/^\s*mailto:(.*)$/i.exec(e);if(!t)return _g;let n=t[1];try{n=decodeURIComponent(n);}catch{}return SR(n)}function Vl(e,t,n){let r=Number(e);return r>=t&&r<=n}function wR(e,t,n,r,o){if(!Vl(e,1,9999)||!Vl(t,1,12)||!Vl(r,0,23)||!Vl(o,0,59))return;let i=new Date(Date.UTC(2e3,Number(t),0)).getUTCDate(),a=Number(e)%4===0&&(Number(e)%100!==0||Number(e)%400===0);if(Vl(n,1,t==="02"&&!a?28:i))return `${e}-${t}-${n}T${r}:${o}:00Z`}function L6(e){let t=/^\s*(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.exec(e??"");return t?wR(t[1],t[2],t[3],t[4],t[5]):void 0}function $g(e){if(e===void 0||e.length>4*Wg)return null;let t=/^\s*"([^"]*)"\s+(\d{4})(\d{2})(\d{2})T(\d{2})(\d{2})/.exec(e);if(!t)return null;let n=wR(t[2],t[3],t[4],t[5],t[6]);return {author:SR(t[1]),...n===void 0?{}:{date:n}}}function kR(e,t,n){if(t!=="ins"&&t!=="del")return null;let r=e.getAttribute("cite");if(!n&&!/^\s*mailto:/i.test(r??""))return null;let o=L6(e.getAttribute("datetime"));return {kind:t,author:A6(r),...o===void 0?{}:{date:o}}}function Vo(e){return `${Bg} w:author="${W$1(e.author)}"`+(e.date===void 0?"":` w:date="${e.date}"`)}function IR(e){return e.replace(/<w:t(?=[ >/])/g,"<w:delText").replace(/<\/w:t>/g,"</w:delText>")}var F6=/^(?:<w:bookmark(?:Start|End)\b[^>]*\/>)+$/;function RR(e,t){let n=[],r="",o=()=>{r.length!==0&&(n.push(`<w:${e.kind} ${Vo(e)}>${r}</w:${e.kind}>`),r="");};for(let i of t){let a=e.kind==="del"?IR(i):i;a.includes("<w:hyperlink")||F6.test(a)?(o(),n.push(a)):r+=a;}return o(),n}function PR(e,t){let n=t;for(let r=e.length-1;r>=0;r-=1){let o=e[r],i=o.kind==="del"?IR(n):n;n=`<w:${o.kind} ${Vo(o)}>${i}</w:${o.kind}>`;}return n}function TR(e){let t=e.find(r=>r.kind==="ins"),n=e.find(r=>r.kind==="del");return (t?`<w:ins ${Vo(t)}/>`:"")+(n?`<w:del ${Vo(n)}/>`:"")}function qg(e){return $g(e.get("mso-prop-change"))}function ER(e){let t=$g(e.get("mso-table-inserted")),n=$g(e.get("mso-table-deleted"));return (t?`<w:ins ${Vo(t)}/>`:"")+(n?`<w:del ${Vo(n)}/>`:"")}function Kg(e){return /!\s*msorm\s*$/i.test(e)}function Ug(e,t){let n=e.getAttribute("style");if(!n||n.length>8192||!/msorm/i.test(n))return t;let r=new Map(t);for(let o of n.split(";")){let i=o.indexOf(":");if(i<=0)continue;let a=o.slice(i+1).trim();if(!Kg(a))continue;let s=o.slice(0,i).trim().toLowerCase();r.set(s,a.replace(/!\s*msorm\s*$/i,"").trim());}return r}function CR(e,t){return `<w:rPrChange ${Vo(e)}>${t||"<w:rPr/>"}</w:rPrChange>`}function OR(e,t){return `<w:pPrChange ${Vo(e)}>${t||"<w:pPr/>"}</w:pPrChange>`}function MR(e){if(e.changeXml===void 0)return e;let{changeXml:t,...n}=e;return n}function AR(e){let t=0;for(let n of e)for(let r=0;r<n.length;r+=1){let o=n[r];o.includes(Bg)&&(n[r]=o.replaceAll(Bg,()=>`w:id="${t++}"`));}}var Vg=["single","words","double","thick","dotted","dottedHeavy","dash","dashedHeavy","dashLong","dashLongHeavy","dotDash","dashDotHeavy","dotDotDash","dashDotDotHeavy","wave","wavyHeavy","wavyDouble"],jg={Normal:"MsoNormal",ListParagraph:"MsoListParagraph",Title:"MsoTitle",Subtitle:"MsoSubtitle",Caption:"MsoCaption",Quote:"MsoQuote",IntenseQuote:"MsoIntenseQuote",BodyText:"MsoBodyText",FootnoteText:"MsoFootnoteText",TOCHeading:"MsoTocHeading",...Object.fromEntries(Array.from({length:9},(e,t)=>[`TOC${t+1}`,`MsoToc${t+1}`]))},Gg=new Map([...Object.entries(jg).filter(([e])=>e!=="Normal").map(([e,t])=>[t,e]),["MsoListParagraphCxSpFirst","ListParagraph"],["MsoListParagraphCxSpMiddle","ListParagraph"],["MsoListParagraphCxSpLast","ListParagraph"]]);function LR(e){return e===void 0?null:/^Heading[7-9]$/.test(e)?`Mso${e}`:Object.hasOwn(jg,e)?jg[e]:null}var zg=Object.fromEntries(s),Zg={left:"left",start:"left",center:"center",right:"right",end:"right",both:"justify",distribute:"justify"};function FR(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:`"${Z$1(n)}"`}var D6=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 Ki(e){if(e===null)return null;let t=Kh$1(e,"val",pa$2);if(t===void 0||t==="nil"||t==="none")return null;let n=D6.get(t)??"solid",r=Kh$1(e,"sz",pa$2),o=r!==void 0&&/^\d{1,4}$/.test(r)?Number.parseInt(r,10):0,i=o>0?o/8:.5,a=`${Math.round(i*100)/100}pt`,s=Kh$1(e,"color",pa$2),l=s!==void 0&&/^[0-9A-Fa-f]{6}$/.test(s)?`#${s}`:"#000000";return `${a} ${n} ${l.toLowerCase()}`}function DR(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 N6=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"]]),H6=new Set(Vg);function NR(e){if(e===null)return [];let t=Kh$1(e,"val",pa$2),n=[],r=t===void 0?void 0:N6.get(t);r!==void 0&&n.push(`text-decoration-style:${r}`),t!==void 0&&t!=="single"&&H6.has(t)&&n.push(`text-underline:${t}`);let o=Kh$1(e,"color",pa$2);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 HR(e,t){return e===null||e<=0?"":`height:${Math.round(e/20*100)/100}pt;mso-height-rule:${t==="exact"?"exactly":"at-least"}`}function _R(e,t,n,r){if(e.namespaceUri!==pa$2)return "";let o=e.localName==="footnoteRef"?"footnote":e.localName==="endnoteRef"?"endnote":null,i=e.localName==="footnoteReference"?"footnote":e.localName==="endnoteReference"?"endnote":null,a=o??i;if(a===null)return "";let s=Kh$1(e,"id",pa$2),l=o===null?s!==void 0&&/^\d{1,10}$/.test(s)?Number.parseInt(s,10):void 0:t?.id;if(l===void 0||!Number.isInteger(l)||l<1||o!==null&&t?.kind!==o||l>2147483647||o===null&&!r(a,l))return "";let c=a==="footnote",d=o!==null,u=c?"MsoFootnoteReference":"MsoEndnoteReference",f=c?"ftn":"edn",p=d?`#_${f}ref${l}`:`#_${f}${l}`,g=d?`_${f}${l}`:`_${f}ref${l}`;return `<a style="mso-${c?"footnote":"endnote"}-id:${f}${l}" href="${p}" name="${g}"><span class="${u}"><span style="mso-special-character:footnote">[${n(a,l)}]</span></span></a>`}function BR(e){if(e.namespaceUri!==pa$2||e.localName!=="ptab")return "";let t=Kh$1(e,"alignment",pa$2),n=Kh$1(e,"relativeTo",pa$2),r=Kh$1(e,"leader",pa$2)??"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 Tt(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 qR(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 KR(e,t){for(let r of e.classList){let o=/^MsoHeading([1-9])$/.exec(r);if(o)return `Heading${o[1]}`;let i=/^Heading([1-9])$/.exec(r);if(i)return `Heading${i[1]}`;let a=Gg.get(r);if(a!==void 0)return a}if(e.classList.contains("docx-outline"))return;let n=t?/^h([1-6])$/.exec(Qe(e)):null;return n?`Heading${n[1]}`:void 0}var UR=262144,_6=4096,B6=256,$6=2048,W6=8,q6=new Set(["MsoNormal",...Gg.keys(),...Array.from({length:9},(e,t)=>`MsoHeading${t+1}`),...Array.from({length:9},(e,t)=>`Heading${t+1}`)]),K6=new Map([["left","left"],["start","start"],["center","center"],["right","right"],["end","end"],["justify","both"]]),U6=/^\s*(p|li|div)\.([A-Za-z][A-Za-z0-9]{0,31})\s*$/i;function j6(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 V6(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 G6(e,t){for(let n=t+1;n<e.length;n+=1){let r=e[n];if(r===";")return n+1;if(r==="{")return V6(e,n)}return null}function z6(e){let t=e.split(",");if(t.length===0||t.length>W6)return null;let n=[];for(let r of t){let o=U6.exec(r);if(!o)return null;let i=o[2];if(!q6.has(i))return null;n.includes(i)||n.push(i);}return n}function Z6(e){let t;for(let n of e.split(";")){let r=n.indexOf(":");if(r<=0||n.slice(0,r).trim().toLowerCase()!=="text-align")continue;let i=n.slice(r+1).trim().toLowerCase();if(i.length===0||i.length>32||i.includes("("))continue;let a=0;for(;a<i.length&&i.charCodeAt(a)>32;)a+=1;let s=K6.get(i.slice(0,a));s!==void 0&&(t=s);}return t}function X6(e){let t=new Map,n=()=>({ok:false,alignments:new Map});if(e.length===0)return {ok:true,alignments:t};if(e.length>UR)return n();let r=j6(e),o=0,i=0;for(;o<r.length&&i<_6;){for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;if(o>=r.length)break;if(r[o]==="@"){let f=G6(r,o);if(f===null)return n();o=f;continue}let a=r.indexOf("{",o);if(a<0)return n();let s=r.slice(o,a),l=r.indexOf("}",a+1);if(l<0)return n();let c=r.slice(a+1,l);if(i+=1,o=l+1,s.length>B6||c.length>$6||c.includes("{"))return n();let d=z6(s),u=Z6(c);if(!(!d||u===void 0))for(let f of d)t.set(f,u);}for(;o<r.length&&r.charCodeAt(o)<=32;)o+=1;return o<r.length?n():{ok:true,alignments:t}}function jR(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>UR)return new Map;let i=X6(o);if(!i.ok)return new Map;for(let[a,s]of i.alignments)t.set(a,s);}return t}var Y6=262144;function VR(e,t=Y6){let n=e.getElementsByTagName("style"),r="";for(let o=0;o<n.length&&o<16;o+=1){let i=n[o]?.textContent??"";i.length>t||r.length+i.length>t||(r+=`
|
|
3
|
-
${i}`);}return r}function GR(e,t,n){for(let o of t.classList){let i=n.get(o);if(i!==void 0){e.jc=i;break}}let r=t.getAttribute("align")?.trim().toLowerCase();r==="left"||r==="center"||r==="right"?e.jc=r:r==="justify"&&(e.jc="both");}function Xg(e,t,n,r){let o=Tt(t.get(n)??"");if(o!==null&&o>0)return o/.75;let i=e.getAttribute(n)?.trim()??"";if(!/^[1-9]\d{0,4}$/.test(i))return null;let a=Number.parseInt(i,10);return r?a/.75:a}function os(e){return e.nodeType===1}function Qe(e){return e.tagName.toLowerCase()}var Q6=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(":"))),J6=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"]]),eB=/url\s*\(|image\s*\(|image-set\s*\(|element\s*\(|cross-fade\s*\(/i,tB=new Map(Vg.map(e=>[e.toLowerCase(),e])),$R=new WeakMap;function It(e){let t=$R.get(e);if(t!==void 0)return t;let n=new Map;$R.set(e,n);let r=e.getAttribute("style");if(!r||r.length>8192)return n;for(let o of r.split(";")){let i=o.indexOf(":");if(i<=0)continue;let a=o.slice(0,i).trim().toLowerCase(),s=o.slice(i+1).trim();a.length>0&&s.length>0&&!Kg(s)&&(n.delete(a),n.set(a,s));}return n}function Go(e){let t=e.trim().toLowerCase(),n=Q6.get(t);if(n)return n;let r=/^#([0-9a-f]{6})$/.exec(t);if(r)return r[1].toUpperCase();let o=/^#([0-9a-f]{3})$/.exec(t);if(o){let[a,s,l]=o[1];return `${a}${a}${s}${s}${l}${l}`.toUpperCase()}let i=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,[^)]*)?\)$/.exec(t);if(i){let a=s=>Math.min(255,Number.parseInt(s,10)).toString(16).padStart(2,"0");return `${a(i[1])}${a(i[2])}${a(i[3])}`.toUpperCase()}return null}function nB(e){if(e===void 0)return;let t=e.trim().toLowerCase();if(!(t.length===0||t.length>32||/[^a-z]/.test(t)))return J6.get(t)}function WR(e){if(e===void 0)return null;let t=e.trim();if(t.length===0||t.length>128||eB.test(t))return null;let n=t.toLowerCase();return n==="transparent"||n==="none"?null:Go(t)}function qn(e,t,n){return Math.min(n,Math.max(t,e))}function Hu(e){let t=null;for(let[n,r]of e)if(n==="background")t=WR(r);else if(n==="background-color"){let o=r.trim().toLowerCase();if(o==="transparent"||o==="none"||o==="initial"){t=null;continue}let i=WR(r);i!==null&&(t=i);}return t}var rB=new Set(["left","center","right","decimal","bar"]),oB=new Map([["dotted","dot"],["dot","dot"],["dashed","hyphen"],["hyphen","hyphen"],["lined","underscore"],["underscore","underscore"],["middledot","middleDot"],["heavy","heavy"]]);function iB(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(rB.has(o)){t=o;continue}if(o==="list"){t="left";continue}let i=oB.get(o);if(i!==void 0){n=i;continue}let a=Tt(o);if(!(a===null||a<0)){if(r.push({val:t,posTwips:qn(Math.round(a*20),0,31680),...n===void 0?{}:{leader:n}}),r.length>=32)break;t="left",n=void 0;}}return r.length>0?r:void 0}var aB=new Map([["solid","single"],["single","single"],["double","double"],["dotted","dotted"],["dashed","dashed"]]);function Yg(e){return e.trim().replace(/\([^)]*\)/g,t=>t.replace(/\s+/g,"")).split(/\s+/)}var sB=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function Nu(e){if(e===void 0||e.length===0||e.length>128)return;let t,n=false,r,o;for(let i of Yg(e)){let a=i.toLowerCase();if(a==="none"||a==="hidden"){n=true;continue}let s=aB.get(a);if(s!==void 0){t=s;continue}let l=sB.get(i.toLowerCase())??Tt(i);if(l!==null){r=l;continue}let c=Go(i);if(c!==null){o=c;continue}return}if(n)return "suppressed";if(t!==void 0)return r===void 0?{val:t,szEighthPoints:4,color:o??"000000"}:r<=0?"suppressed":{val:t,szEighthPoints:qn(Math.round(r*8),2,96),color:o??"000000"}}function _u(e){let t=e.getAttribute("style");return t?/mso-list\s*:[^;]{0,128}ignore/i.test(t.slice(0,8192)):false}function Gl(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 Ui(e,t){if(t.size===0)return e;let n={...e},r=t.get("font-weight")?.toLowerCase();if(r!==void 0){let S=Number.parseInt(r,10);r==="bold"||S>=600?n.bold=true:(r==="normal"||S<600)&&(n.bold=false);}let o=t.get("font-style");o!==void 0&&(n.italic=o.toLowerCase().includes("italic"));let i=(t.get("text-decoration")??t.get("text-decoration-line"))?.toLowerCase();i!==void 0&&(i.includes("underline")&&(n.underline=true),i.includes("line-through")&&(n.strike=true),i.includes("none")&&(n.underline=n.strike=false));let a=t.get("font-variant")?.toLowerCase();a!==void 0&&(a.includes("small-caps")?n.smallCaps=true:(a.includes("normal")||a.includes("none"))&&(n.smallCaps=false));let s=t.get("text-transform")?.trim().toLowerCase();s==="uppercase"?n.caps=true:s==="none"&&(n.caps=false);let l=t.get("text-underline");if(l!==void 0&&l.length<=128)for(let S of l.trim().split(/\s+/)){let v=S.toLowerCase(),k=tB.get(v);if(k!==void 0)n.underline=true,n.underlineVal=k;else {let E=Go(S);E!==null&&(n.underlineColor=E);}}let c=t.get("text-decoration-style")?.trim().toLowerCase();if(c==="double"&&n.strike&&!n.underline&&(n.doubleStrike=true),n.underline){c==="double"?n.underlineVal="double":c==="dotted"?n.underlineVal="dotted":c==="dashed"?n.underlineVal="dash":c==="wavy"&&(n.underlineVal="wave");let S=Go(t.get("text-decoration-color")??"");S!==null&&(n.underlineColor=S);}let d=Go(t.get("color")??"");d&&(n.color=d);let u=nB(t.get("mso-highlight"));if(u)n.highlight=u,delete n.shdFill;else {let S=Hu(t);S&&(n.shdFill=S);}let f=Tt(t.get("font-size")??"");f!==null&&f>0&&(n.szHalfPoints=qn(Math.round(f*2),2,3276));let p=t.get("font-family");if(p!==void 0){let S=p.split(",")[0].trim().replace(/^['"]|['"]$/g,"");S.length>0&&S.length<=64&&(n.font=S);}let g=Tt(t.get("letter-spacing")??"");g!==null&&(n.charSpacingTwentieths=qn(Math.round(g*20),-31680,31680));let y=t.get("vertical-align")?.trim().toLowerCase();y==="sub"?n.vertAlign="subscript":y==="super"&&(n.vertAlign="superscript");let h=qi(t.get("mso-ansi-language")),b=qi(t.get("mso-fareast-language")),x=qi(t.get("mso-bidi-language"));return h!==null&&(n.langVal=h),b!==null&&(n.langEastAsia=b),x!==null&&(n.langBidi=x),t.get("direction")?.trim().toLowerCase()==="rtl"&&(n.rtl=true),n}function ji(e,t){let n=Ui(e,It(t)),r=qi(t.getAttribute("lang"));return r!==null&&(n={...n,lang:r}),t.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(n={...n,rtl:true}),n}function Bu(e,t){let n=t.get("text-align")?.toLowerCase();n==="left"||n==="right"||n==="start"||n==="end"?e.jc=n:n==="center"?e.jc="center":n==="justify"&&(e.jc="both"),t.get("direction")?.trim().toLowerCase()==="rtl"&&(e.bidi=true);let r={top:null,right:null,bottom:null,left:null},o=t.get("margin");if(o!==void 0&&o.length<=128){let b=o.trim().split(/\s+/).map(x=>Tt(x));if(b.length>=1&&b.length<=4&&!b.some(x=>x===null)){let[x,S=x,v=x,k=S]=b.length===2?[b[0],b[1],b[0],b[1]]:b.length===3?[b[0],b[1],b[2],b[1]]:b;r.top=x??null,r.right=S??null,r.bottom=v??null,r.left=k??null;}}let i=Tt(t.get("margin-left")??"")??r.left;i!==null&&(i>0||i===0&&!e.numPr)&&(e.indLeftTwips=qn(Math.round(i*20),0,31680));let a=Tt(t.get("margin-right")??"")??r.right;a!==null&&a>=0&&(e.indRightTwips=qn(Math.round(a*20),0,31680));let s=Tt(t.get("mso-text-indent-alt")??"");if(s!==null)e.firstLineTwips=qn(Math.round(s*20),-31680,31680);else {let b=Tt(t.get("text-indent")??"");if(b!==null&&b!==0){let x=qn(Math.round(b*20),-31680,31680);x!==0&&(e.firstLineTwips=x);}}let l=Tt(t.get("margin-top")??"")??r.top;l!==null&&l>=0&&(e.spacingBeforeTwips=qn(Math.round(l*20),0,31680));let c=Tt(t.get("margin-bottom")??"")??r.bottom;c!==null&&c>=0&&(e.spacingAfterTwips=qn(Math.round(c*20),0,31680));let d=t.get("line-height")?.trim()??"",u=t.get("mso-line-height-rule")?.trim().toLowerCase(),f=Tt(d);if(f!==null&&f>0)e.lineTwentieths=qn(Math.round(f*20),24,31680),e.lineRule=u==="exactly"?"exact":"atLeast";else if(/^\d+(\.\d+)?$/.test(d)&&Number.parseFloat(d)>0)e.lineTwentieths=qn(Math.round(240*Number.parseFloat(d)),24,9600),e.lineRule="auto";else if(/^\d+(\.\d+)?%$/.test(d)){let b=Number.parseFloat(d);b>0&&(e.lineTwentieths=qn(Math.round(2.4*b),24,9600),e.lineRule="auto");}(t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page")&&(e.pageBreakBefore=true),t.get("page-break-after")?.trim().toLowerCase()==="avoid"&&(e.keepNext=true),t.get("page-break-inside")?.trim().toLowerCase()==="avoid"&&(e.keepLines=true),(/^[2-9]\d?$/.test(t.get("widows")?.trim()??"")||/^[2-9]\d?$/.test(t.get("orphans")?.trim()??""))&&(e.widowControl=true);let p=Hu(t);p&&(e.shdFill=p);let g=iB(t.get("tab-stops"));g!==void 0&&(e.tabs=g);let y=Nu(t.get("mso-border-alt"))??Nu(t.get("border")),h={};for(let b of ["top","left","bottom","right"]){let x=Nu(t.get(`mso-border-${b}-alt`))??Nu(t.get(`border-${b}`))??y;x!==void 0&&x!=="suppressed"&&(h[b]=x);}Object.keys(h).length>0&&(e.borders=h);}var lB="http://schemas.openxmlformats.org/drawingml/2006/picture",cB=/^data:image\/(?:png|jpeg|jpg|gif|bmp|webp|svg\+xml|tiff|tif|x-emf|emf|x-wmf|wmf);base64,([A-Za-z0-9+/=]+)$/i,dB=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 zR(e,t,n){return Math.min(n,Math.max(t,e))}function ZR(e,t,n,r){let o=e.getAttribute("src");if(o===null||o.length>n.maxImageBytes*2)return;let i=cB.exec(o);if(!i)return;let a=n.mediaBySrc.get(o),s=a===void 0?void 0:n.media.get(a),l=s??Fu(i[1],n.maxImageBytes);if(l==null)return;let c=Pf$1(l),d=dB.get(c);if(d===void 0)return;let u=c==="image/png"||c==="image/jpeg"||c==="image/gif"||c==="image/bmp"||c==="image/webp"?Uf$1(l,c):null,f=It(e),p=Xg(e,f,"width",n.wordHtml),g=Xg(e,f,"height",n.wordHtml);u!==null?p===null&&g===null?(p=u.pixelWidth*96/(u.dpiX??96),g=u.pixelHeight*96/(u.dpiY??96)):p!==null&&g===null?g=p*u.pixelHeight/u.pixelWidth:p===null&&g!==null&&(p=g*u.pixelWidth/u.pixelHeight):p!==null&&g===null?g=p*2/3:p===null&&g!==null&&(p=g*3/2);let y=p===null?381e4:zR(Math.round(p*9525),9525,3e7),h=g===null?254e4:zR(Math.round(g*9525),9525,3e7),b=s===void 0?void 0:a;b===void 0&&(n.imageCount+=1,b=`word/media/image${n.imageCount}.${d}`,n.media.set(b,l),n.mediaBySrc.set(o,b),n.mediaExtensions.has(d)||n.mediaExtensions.set(d,c));let x=r(b.replace("word/",""));n.docPrId+=1,t.push(`<w:r><w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${y}" cy="${h}"/><wp:docPr id="${n.docPrId}" name=""/><wp:cNvGraphicFramePr/><a:graphic><a:graphicData uri="${lB}"><pic:pic><pic:nvPicPr><pic:cNvPr id="0" name="" descr=""/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${x}"/><a:srcRect/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${y}" cy="${h}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing></w:r>`);}function In(e){let t="";if(e.rStyle!==void 0&&(t+=`<w:rStyle w:val="${W$1(e.rStyle)}"/>`),e.font!==void 0){let a=W$1(Wn(e.font));t+=e.rtl?`<w:rFonts w:cs="${a}"/>`:`<w:rFonts w:ascii="${a}" w:hAnsi="${a}"/>`;}e.bold?t+="<w:b/>":e.bold===false&&(t+='<w:b w:val="0"/>'),e.italic?t+="<w:i/>":e.italic===false&&(t+='<w:i w:val="0"/>'),e.caps?t+="<w:caps/>":e.caps===false&&(t+='<w:caps w:val="0"/>'),e.smallCaps?t+="<w:smallCaps/>":e.smallCaps===false&&(t+='<w:smallCaps w:val="0"/>'),e.doubleStrike?t+="<w:dstrike/>":e.strike?t+="<w:strike/>":e.strike===false&&(t+='<w:strike w:val="0"/>'),e.color!==void 0&&(t+=`<w:color w:val="${e.color}"/>`),e.charSpacingTwentieths!==void 0&&(t+=`<w:spacing w:val="${e.charSpacingTwentieths}"/>`),e.szHalfPoints!==void 0&&(t+=`<w:sz w:val="${e.szHalfPoints}"/>`),e.highlight!==void 0&&(t+=`<w:highlight w:val="${W$1(e.highlight)}"/>`),e.underline?t+=`<w:u w:val="${e.underlineVal??"single"}"${e.underlineColor===void 0?"":` w:color="${e.underlineColor}"`}/>`:e.underline===false&&(t+='<w:u w:val="none"/>'),e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.vertAlign!==void 0&&(t+=`<w:vertAlign w:val="${e.vertAlign}"/>`),e.rtl&&(t+="<w:rtl/>");let n=e.langVal,r=e.langEastAsia,o=e.langBidi;e.lang!==void 0&&(e.rtl?o??=e.lang:/^(?:zh|ja|ko)(?:-|$)/i.test(e.lang)?r??=e.lang:n??=e.lang);let i=`${n===void 0?"":` w:val="${W$1(n)}"`}${r===void 0?"":` w:eastAsia="${W$1(r)}"`}${o===void 0?"":` w:bidi="${W$1(o)}"`}`;return i.length>0&&(t+=`<w:lang${i}/>`),e.changeXml!==void 0&&(t+=e.changeXml),t.length>0?`<w:rPr>${t}</w:rPr>`:""}function $u(e,t){return `<w:r>${In(t)}<w:t xml:space="preserve">${V(Wn(e))}</w:t></w:r>`}function Qg(e){let t="";if(e.styleId!==void 0&&(t+=`<w:pStyle w:val="${W$1(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="${W$1(e.numPr.numId)}"/></w:numPr>`),e.borders!==void 0){let a="";for(let s of ["top","left","bottom","right"]){let l=e.borders[s];l!==void 0&&(a+=`<w:${s} w:val="${l.val}" w:sz="${l.szEighthPoints}" w:space="0" w:color="${l.color}"/>`);}a.length>0&&(t+=`<w:pBdr>${a}</w:pBdr>`);}if(e.shdFill!==void 0&&(t+=`<w:shd w:val="clear" w:color="auto" w:fill="${e.shdFill}"/>`),e.tabs!==void 0&&e.tabs.length>0&&(t+=`<w:tabs>${e.tabs.map(a=>`<w:tab w:val="${a.val}" w:pos="${a.posTwips}"`+(a.leader===void 0?"/>":` w:leader="${a.leader}"/>`)).join("")}</w:tabs>`),e.bidi&&(t+="<w:bidi/>"),e.spacingBeforeTwips!==void 0||e.spacingAfterTwips!==void 0||e.lineTwentieths!==void 0){let a="<w:spacing";e.spacingBeforeTwips!==void 0&&(a+=` w:before="${e.spacingBeforeTwips}"`),e.spacingAfterTwips!==void 0&&(a+=` w:after="${e.spacingAfterTwips}"`),e.lineTwentieths!==void 0&&(a+=` w:line="${e.lineTwentieths}" w:lineRule="${e.lineRule??"auto"}"`),t+=`${a}/>`;}let n=e.firstLineTwips,[r,o]=e.bidi?[e.indRightTwips,e.indLeftTwips]:[e.indLeftTwips,e.indRightTwips];if(r!==void 0||o!==void 0||n!==void 0){let a="<w:ind";r!==void 0&&(a+=` w:left="${r}"`),o!==void 0&&(a+=` w:right="${o}"`),n!==void 0&&(a+=n>=0?` w:firstLine="${n}"`:` w:hanging="${-n}"`),t+=`${a}/>`;}let i=e.jc==="start"?"left":e.jc==="end"?"right":e.bidi&&(e.jc==="left"||e.jc==="right")?e.jc==="left"?"right":"left":e.jc;return i!==void 0&&(t+=`<w:jc w:val="${i}"/>`),e.markRevisionXml&&(t+=`<w:rPr>${e.markRevisionXml}</w:rPr>`),e.changeXml!==void 0&&(t+=e.changeXml),t.length>0?`<w:pPr>${t}</w:pPr>`:""}function Vi(e,t){return `<w:p>${Qg(e)}${t.join("")}</w:p>`}var YR={h1:64,h2:52,h3:44,h4:36,h5:32,h6:28};function Wu(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 uB=/^(?:<w:bookmark(?:Start|End)\b[^>]*\/>)+$/,XR=new WeakMap;function Jg(e){let t=XR.get(e);for(t||(t={checked:0,furniture:true},XR.set(e,t));t.furniture&&t.checked<e.length;)t.furniture=uB.test(e[t.checked]),t.checked+=1;return t.furniture}var fB=64,th=31680;function QR(e){let t=new Map,n=i=>{let a=i.indexOf(":");if(a<=0)return;let s=i.slice(0,a).trim().toLowerCase(),l=i.slice(a+1).trim();s.length===0||s.length>64||(t.delete(s),t.set(s,l));},r=0,o=null;for(let i=0;i<e.length;i+=1){let a=e[i];if(a==="\\"){i+=1;continue}if(o!==null){a===o&&(o=null);continue}a==='"'||a==="'"?o=a:a===";"&&(n(e.slice(r,i)),r=i+1);}return n(e.slice(r)),t}function pB(e){let t=e.trim(),n=t[0];(n==='"'||n==="'")&&t.length>=2&&t.endsWith(n)&&(t=t.slice(1,-1));let r="";for(let o=0;o<t.length;o+=1){let i=t[o];if(i!=="\\"){r+=i;continue}let a=/^[0-9a-fA-F]{1,6}/.exec(t.slice(o+1,o+7));if(a===null){o+1<t.length&&(r+=t[o+1]),o+=1;continue}let s=Number.parseInt(a[0],16);o+=a[0].length,/\s/.test(t[o+1]??"")&&(o+=1),s>0&&s<=1114111&&(s<55296||s>57343)&&(r+=String.fromCodePoint(s));}return r}var eh=(e,t)=>{let n=Tt(e??"");if(n!==null)return Math.min(th,Math.max(t,Math.round(n*20)))};function mB(e){let t=new Map,n=(o,i=o)=>{let a=e.get(o);a!==void 0&&t.set(i,a);};if(n("font-family"),n("color"),n("font-weight"),n("mso-ansi-font-weight","font-weight"),n("font-style"),n("mso-ansi-font-style","font-style"),n("font-size"),n("mso-ansi-font-size","font-size"),n("text-decoration"),n("text-underline"),t.size===0)return;let r=In(Ui({},t));return r.length>0?r:void 0}function JR(e){let t=e.get("mso-level-text"),n=t===void 0?void 0:Wn(pB(t)),r=mB(e),o=eh(e.get("margin-left"),-th),i=eh(e.get("text-indent"),-th),a=eh(e.get("mso-level-tab-stop"),0),s={...n!==void 0&&n.length<=fB?{text:n}:{},...r!==void 0?{runXml:r}:{},...o!==void 0?{leftTwips:o}:{},...i!==void 0?{firstLineTwips:i}:{},...a!==void 0?{tabTwips:a}:{}};return Object.keys(s).length>0?s:void 0}var gB="http://schemas.openxmlformats.org/wordprocessingml/2006/main",hB='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',eP=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}];function tP(e,t,n){let r=e?.leftTwips??720*(t+1),o=e?.firstLineTwips??-n,i=e?.tabTwips!==void 0&&e.tabTwips>0?`<w:tabs><w:tab w:val="num" w:pos="${e.tabTwips}"/></w:tabs>`:"",a=o<0?`w:hanging="${-o}"`:`w:firstLine="${o}"`;return `<w:pPr>${i}<w:ind w:left="${r}" ${a}/></w:pPr>`}function nP({kind:e,start:t,align:n,format:r},o){if(e==="bullet"){let s=eP[o%eP.length],l=r?.text!==void 0?r.runXml??"":`<w:rPr><w:rFonts w:ascii="${s.font}" w:hAnsi="${s.font}" w:hint="default"/></w:rPr>`;return `<w:lvl w:ilvl="${o}"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="${W$1(r?.text??s.text)}"/><w:lvlJc w:val="${n??"left"}"/>${tP(r,o,360)}${l}</w:lvl>`}let i=n??(e==="lowerRoman"||e==="upperRoman"?"right":"left"),a=r?.text??`%${o+1}.`;return `<w:lvl w:ilvl="${o}"><w:start w:val="${t}"/><w:numFmt w:val="${e}"/><w:lvlText w:val="${W$1(a)}"/><w:lvlJc w:val="${i}"/>${tP(r,o,i==="right"?180:360)}${r?.runXml??""}</w:lvl>`}var yB=new Map([["i",1],["v",5],["x",10],["l",50],["c",100],["d",500],["m",1e3]]),bB=new Map([["alpha-lower","lowerLetter"],["alpha-upper","upperLetter"],["roman-lower","lowerRoman"],["roman-upper","upperRoman"],["bullet","bullet"],["image","bullet"],["decimal","decimal"],["arabic","decimal"]]),vB=new Map([["left","left"],["center","center"],["right","right"]]),rP=/@list\s+l(\d{1,4}):level([1-9])(?:[\s:]+lfo(\d{1,4}))?\s*\{([^{}]{0,2048})\}/g;function oP(e){let t=new Map;if(e.length===0||e.length>262200)return t;rP.lastIndex=0;let n,r=0;for(;(n=rP.exec(e))!==null&&r<512;){r+=1;let o="decimal",i=null,a,s=QR(n[4]);for(let[d,u]of s){let f=u.toLowerCase();d==="mso-level-number-format"?o=bB.get(f)??null:d==="mso-level-start-at"&&/^\d{1,5}$/.test(f)?i=Math.min(32767,Number.parseInt(f,10)):d==="mso-level-number-position"&&(a=vB.get(f));}if(o===null)continue;let l=n[3]===void 0?`l${n[1]}:level${n[2]}`:`l${n[1]}:level${n[2]}:lfo${n[3]}`,c=JR(s);t.has(l)||t.set(l,{kind:o,start:i,...a?{align:a}:{},...c?{format:c}:{}});}return t}function iP(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?aP(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 xB=/^m{0,4}(cm|cd|d?c{0,3})(xc|xl|l?x{0,3})(ix|iv|v?i{0,3})$/;function aP(e){let t=e.toLowerCase();if(!xB.test(t))return null;let n=0,r=0;for(let o of t){let i=yB.get(o);if(i===void 0)return null;n+=i,r>0&&r<i&&(n-=2*r),r=i;}return n>0&&n<=32767?n:null}function sP(e){let t=e.trim().replace(/^\(/,""),n=/^(\d{1,5}(?:\.\d{1,5})*)[.)]/.exec(t);if(n){let a=n[1].split(".");return {kind:"decimal",start:Math.min(32767,Number.parseInt(a[a.length-1],10))}}let r=/^([A-Za-z])[.)]/.exec(t);if(r){let a=r[1].toLowerCase();if(a==="i"||a==="v"||a==="x"){let l=a==="i"?1:a==="v"?5:10;return {kind:r[1]===a?"lowerRoman":"upperRoman",start:l}}let s=r[1].charCodeAt(0);return s>=97?{kind:"lowerLetter",start:s-96}:{kind:"upperLetter",start:s-64}}let o=/^([A-Za-z]{2,8})[.)]/.exec(t);if(o){let a=o[1],s=a===a.toLowerCase(),l=/^([A-Za-z])\1+$/.test(a);if(!l||/^[iI]+$/.test(a)){let c=aP(a);if(c!==null)return {kind:s?"lowerRoman":"upperRoman",start:c}}if(l){let c=a.toLowerCase().charCodeAt(0),d=Math.min(32767,(a.length-1)*26+(c-96));return {kind:s?"lowerLetter":"upperLetter",start:d}}}let i=/\d{1,5}/.exec(t);return i?{kind:"decimal",start:Math.min(32767,Number.parseInt(i[0],10))}:{kind:"bullet",start:1}}var SB=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 qu(e){if(e.localName.toLowerCase()!=="ol")return "bullet";let t=It(e).get("list-style-type")?.trim().toLowerCase(),n=t===void 0?void 0:SB.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 zl(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 lP(e){let t=e.map((r,o)=>{let i=r.levels.get(0)??r.levels.values().next().value??{kind:"decimal"},a=Array.from({length:9},(s,l)=>{let c=r.levels.get(l);return nP(c||{kind:i.kind==="bullet"?"bullet":"decimal",start:1},l)}).join("");return `<w:abstractNum w:abstractNumId="${o}"><w:multiLevelType w:val="hybridMultilevel"/>${a}</w:abstractNum>`}).join(""),n=e.map((r,o)=>`<w:num w:numId="${r.numId}"><w:abstractNumId w:val="${o}"/></w:num>`).join("");return `${hB}<w:numbering xmlns:w="${gB}">${t}${n}</w:numbering>`}function Rr(e){if(e==null)return null;let t=e.trim();if(t.length===0||t.length>256)return null;if(/^[A-Za-z_][A-Za-z0-9_]{0,39}$/.test(t))return t;let n=t.replace(/[^A-Za-z0-9_]/g,"_");if(n.replace(/_/g,"").length===0)return null;let r=5381;for(let a=0;a<t.length;a+=1)r=(Math.imul(r,33)^t.charCodeAt(a))>>>0;let o=`_${r.toString(36)}`,i=n.slice(0,40-o.length);return /^[A-Za-z_]/.test(i)||(i=`_${i.slice(0,39-o.length)}`),`${i}${o}`}function cP(e){if(e===null)return false;if(e.startsWith("#"))return Rr(e.slice(1))!==null;let t=U(e);return t?.ok===true&&t.href.length>0}function dP(e,t){if(e!==void 0&&e.startsWith("#")){let o=Rr(e.slice(1)),i=Rr(t)??o;return i===null?null:`#${i}`}let n=e===void 0?null:U(e),r=Rr(t);return n?.ok===true&&n.href.length>0?r===null?n.href:`${n.href.split("#")[0]}#${r}`:r===null?null:`#${r}`}function uP(){let e=null;return (t,n,r)=>{if(e!==null&&e.html===t&&e.key===n){let a=e.value;return e=null,a}let o=r(),i={html:t,key:n,value:o};return e=i,globalThis.setTimeout(()=>{e===i&&(e=null);},0),o}}var wB=new Set(["HYPERLINK","NOTEREF","IF","MERGEFIELD","SECTIONPAGES","SECTION","NUMWORDS","NUMCHARS","AUTHOR","TITLE","SUBJECT","CREATEDATE","SAVEDATE","PRINTDATE","DOCPROPERTY","SYMBOL","EQ","LISTNUM","SET","XE","TC","INDEX"]),kB=/^(?:https?|mailto|tel|ftp):/i;function IB(e){let t=Yc$1(e);if(!t)return false;if(t.target===null)return t.anchor!==null;let n=U(t.target);return n.ok&&kB.test(n.href)}function RB(e){let t=e.trim().split(/\s+/)[0]?.toUpperCase()??"";return t==="HYPERLINK"?IB(e):ba$1(e)||wB.has(t)}var PB=16384,fP=2048,TB=3e4,EB='<w:r><w:fldChar w:fldCharType="begin"/></w:r>',CB='<w:r><w:fldChar w:fldCharType="separate"/></w:r>',OB='<w:r><w:fldChar w:fldCharType="end"/></w:r>',hP=/<w:r><w:fldChar w:fldCharType="(begin|separate|end)"\/><\/w:r>|<w:r><w:instrText xml:space="preserve">([^<]*)<\/w:instrText><\/w:r>/g,pP={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function yP(e){return e.replace(/&(#x[0-9a-fA-F]{1,6}|#[0-9]{1,7}|[a-zA-Z]{2,8});/g,(t,n)=>{let r=String(n);if(r.startsWith("#")){let o=r[1]==="x"?Number.parseInt(r.slice(2),16):Number(r.slice(1));return Number.isInteger(o)&&o>=32&&o<=1114111&&!(o>=55296&&o<=57343)?String.fromCodePoint(o):""}return Object.hasOwn(pP,r)?pP[r]:t})}function MB(e){let t=yP(e).replace(/[\t\r\n\f\v ]+/g," ");return t.trim()===""?"":`<w:r><w:instrText xml:space="preserve">${V(t)}</w:instrText></w:r>`}var mP=new WeakMap,gP=new WeakMap;function bP(e,t){if(!e.startsWith("[if supportFields]>")||e.length>PB)return [];let n=e.slice(19).replace(/<!\[endif\]\s*$/,""),r=[],o="",i=gP.get(t);i||gP.set(t,i=[]);let a=i,s=()=>a.length>0&&a[a.length-1]===true,l=()=>{if(o.length>fP)return false;let c=s()?MB(o):"";return c&&r.push(c),o="",true};for(let c of n.matchAll(/<([^<>]{0,1024})>|([^<]+)/g)){if(c[2]!==void 0){if(s()&&(o+=c[2]),o.length>fP)return [];continue}let d=/mso-element:\s*field-(begin|separator|end)/i.exec(c[1])?.[1];if(!d)continue;if(!l())return [];let u=mP.get(t)??TB;if(u<=0)return [];mP.set(t,u-1);let f=d.toLowerCase();r.push(f==="begin"?EB:f==="separator"?CB:OB),f==="begin"?a.push(true):f==="separator"?a[a.length-1]=false:a.pop();}return l()?r:[]}function AB(e){let t=e.map(()=>true),n=[];for(let[r,o]of e.entries()){let i=n[n.length-1];if(o.kind==="begin")i&&!i.separated&&i.instruction.trim()===""&&(i.nestedFirst=true),n.push({separated:false,own:[r],instruction:"",begin:r,separator:-1,nestedFirst:false});else if(o.kind==="instruction")i&&!i.separated?(i.own.push(r),i.instruction+=yP(o.text)):t[r]=false;else if(o.kind==="separate"){if(!i||i.separated)return e.map(()=>false);i.separated=true,i.separator=r,i.own.push(r);}else {let a=n.pop();if(!a)return e.map(()=>false);if(a.own.push(r),a.nestedFirst||!RB(a.instruction)){for(let l of a.own)t[l]=false;let s=a.separator<0?r:a.separator;for(let l=a.begin;l<s;l+=1)t[l]=false;}}}return n.length===0?t:e.map(()=>false)}function LB(e){let t=[];for(let n of e)for(let r of n.matchAll(hP))t.push(r[1]!==void 0?{kind:r[1],text:""}:{kind:"instruction",text:r[2]});return t}function nh(e){if(!e.some(r=>r.includes("<w:fldChar")||r.includes("<w:instrText")))return e;let t=AB(LB(e));if(t.every(Boolean))return e;let n=0;return e.map(r=>r.replace(hP,o=>t[n++]?o:""))}function vP(e){let t={};for(let n of Object.keys(e)){let r=new Map;for(let[o,i]of e[n])r.set(o,nh(i));t[n]=r;}return t}var FB=/^(ftn|edn)([1-9]\d{0,9})$/i,DB={footnote:"ftn",endnote:"edn"};function xP(e,t){let n=e===null?null:FB.exec(e);if(!n||n[1].toLowerCase()!==DB[t])return null;let r=Number.parseInt(n[2],10);return r<=2147483647?r:null}function rh(e){for(let t of ["footnote","endnote"]){let n=e.get(`mso-${t}-id`),r=xP(n??null,t);if(r!==null)return {kind:t,id:r}}return null}function NB(e,t){let n=t.get("mso-element")?.trim().toLowerCase();if(n!=="footnote"&&n!=="endnote")return null;let r=xP(e.getAttribute("id"),n);return r===null?null:{kind:n,id:r}}function SP(e){let t=[],n=e.getElementsByTagName("div");for(let r=0;r<n.length&&t.length<2048;r+=1){let o=n[r],i=NB(o,It(o));i!==null&&t.push({...i,element:o});}return t}function wP(e,t,n){let r=new Map(t.map(a=>[a.element,a])),o=a=>{let s=a.parentElement;for(let l=0;s!==null&&l<128;l+=1){let c=r.get(s);if(c!==void 0)return c;s=s.parentElement;}return null},i=e.getElementsByTagName("a");for(let a=0;a<i.length&&a<2e4;a+=1){let s=i[a],l=rh(It(s));if(l===null)continue;let c=o(s);c!==null&&c.kind===l.kind&&c.id===l.id||n[l.kind].add(l.id);}}function kP(e){let t=e.get("mso-element")?.trim().toLowerCase();return t==="footnote-list"||t==="endnote-list"}var HB=/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(footnote|endnote)Reference w:id="(\d{1,10})"\/><\/w:r>/g;function is(e,t,n){return e.replace(HB,(r,o,i)=>{let a=`${o}:${i}`;return t.has(a)?n?.get(a)??"":r})}function oh(e,t){let n="";for(let[r,o]of t)n+=`<w:${e} w:id="${r}">${o.join("")}</w:${e}>`;return `<?xml version="1.0" encoding="UTF-8" standalone="yes"?><w:${e}s xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math">${n}</w:${e}s>`}function IP(e,t,n,r){let o=new Set,i={footnote:new Set,endnote:new Set},a=()=>{i.footnote.clear(),i.endnote.clear();let s=[],l=(c,d)=>{o.has(`${c}:${d}`)||!e.notes[c].has(d)||i[c].has(d)||(i[c].add(d),s.push({kind:c,id:d}));};for(let c of ["footnote","endnote"])for(let d of e.bodyNoteRefs[c])l(c,d);for(let c of o)for(let d of e.noteNoteRefs.get(c)??[])l(d.kind,d.id);for(;s.length>0;){let c=s.pop();for(let d of e.noteNoteRefs.get(`${c.kind}:${c.id}`)??[])l(d.kind,d.id);}};for(;;){a();let s=false;for(let l of ["footnote","endnote"]){for(let c of e.notes[l].keys()){let d=`${l}:${c}`;if(!(i[l].has(c)||o.has(d))){o.add(d),s=true;break}}if(s)break}if(!s)break}if(o.size>0)for(let s of ["footnote","endnote"])for(let[l,c]of e.notes[s])o.has(`${s}:${l}`)||e.notes[s].set(l,c.map(d=>is(d,o,e.noteMarkFallbacks)));for(let s of ["footnote","endnote"])for(let[l,c]of [...e.notes[s]]){if(!o.has(`${s}:${l}`))continue;e.notes[s].delete(l),t[s].delete(l);let d=new Map;for(let u of c){let f=is(u.replace(/<w:r>(?:<w:rPr>(?:(?!<\/w:r>)[\s\S])*?<\/w:rPr>)?<w:(?:footnote|endnote)Ref\/><\/w:r>/g,""),o,e.noteMarkFallbacks).replace(/ r:(id|embed)="([^"]{1,32})"/g,(p,g,y)=>{let h=d.get(y);if(h===void 0){let b=e.noteRels[s].find(x=>x.id===y);if(b===void 0)return p;h=r(e,b.type,b.target,b.external),d.set(y,h);}return ` r:${g}="${h}"`});n.push(f),e.lastMarkCovered=false;}}}function ih(e,t,n,r=0){let o=e.lists.get(t);if(o)return o.levels.has(r)||o.levels.set(r,n),o.numId;let i=String(1001+e.lists.size),a={numId:i,levels:new Map([[r,n]])};return e.lists.set(t,a),e.listsByNumId.set(i,a),i}function RP(e,t,n,r){let o=t.get("mso-list");if(o===void 0)return;let i=/\bl(\d{1,4})\s+level(\d{1,2})\b/i.exec(o);if(!i)return;let a=Math.min(Math.max(Number.parseInt(i[2],10)-1,0),8),s=BB(e,n),l=/\blfo(\d{1,4})\b/i.exec(o),c=(l!==null?n.listDefinitions.get(`l${i[1]}:level${i[2]}:lfo${l[1]}`):void 0)??n.listDefinitions.get(`l${i[1]}:level${i[2]}`),d=c!==void 0?{kind:c.kind,start:iP(s,c.kind)??c.start??1,...c.align?{align:c.align}:{},...c.format?{format:c.format}:{}}:s.trim().length>0?sP(s):_B(e),f=`mso:${r===void 0?"":`${r.kind}${r.id}:`}l${i[1]}${l?`:lfo${l[1]}`:""}`;return {numId:ih(n,f,d,a),ilvl:a}}function _B(e){let t=e.parentElement;return t===null||Qe(t)!=="ol"&&Qe(t)!=="ul"?{kind:"bullet",start:1}:{kind:qu(t),start:zl(t)}}function BB(e,t){let n="",r=(o,i)=>{if(!(n.length>0||i>8||t.nodesLeft<=0)&&os(o)){if(_u(o)){n=(o.textContent??"").slice(0,16);return}for(let a of Array.from(o.childNodes))r(a,i+1);}};for(let o of Array.from(e.childNodes))r(o,0);return n}var $B="http://schemas.openxmlformats.org/package/2006/relationships",WB="http://schemas.openxmlformats.org/package/2006/content-types",qB="application/vnd.openxmlformats-package.relationships+xml",lh='<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',KB="http://schemas.openxmlformats.org/wordprocessingml/2006/main",sh="http://schemas.openxmlformats.org/officeDocument/2006/relationships",UB="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",jB="http://schemas.openxmlformats.org/drawingml/2006/main",VB="http://schemas.openxmlformats.org/drawingml/2006/picture",GB="http://schemas.openxmlformats.org/officeDocument/2006/math",PP={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 ah(e){let t=e.map(n=>`<Relationship Id="${W$1(n.id)}" Type="${W$1(n.type)}" Target="${W$1(n.target)}"${n.external?' TargetMode="External"':""}/>`).join("");return `${lh}<Relationships xmlns="${$B}">${t}</Relationships>`}function zB(e){let t=new Map;t.set("word/document.xml",cf$1(e.documentXml)),t.set("word/_rels/document.xml.rels",cf$1(ah(e.rels))),t.set("_rels/.rels",cf$1(ah([{id:"rId1",type:`${sh}/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="${PP.document}"/>`;for(let[i,a]of n)a!==void 0&&(t.set(`word/${i}.xml`,cf$1(a)),r+=`<Override PartName="/word/${i}.xml" ContentType="${PP[i]}"/>`);for(let[i,a]of [["footnotes",e.footnotesRels],["endnotes",e.endnotesRels]])a!==void 0&&a.length>0&&t.set(`word/_rels/${i}.xml.rels`,cf$1(ah(a)));for(let[i,a]of e.media)t.set(i,a);let o=`<Default Extension="rels" ContentType="${qB}"/><Default Extension="xml" ContentType="application/xml"/>`;for(let[i,a]of e.mediaExtensions)o+=`<Default Extension="${W$1(i)}" ContentType="${W$1(a)}"/>`;return t.set("[Content_Types].xml",cf$1(`${lh}<Types xmlns="${WB}">${o}${r}</Types>`)),bf$1(t)}function TP(e){let t=[...e.rels],n=o=>{t.push({id:`rId${t.length+1}`,type:`${sh}/${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=`${lh}<w:document xmlns:w="${KB}" xmlns:r="${sh}" xmlns:wp="${UB}" xmlns:a="${jB}" xmlns:pic="${VB}" xmlns:m="${GB}"><w:body>${e.blocks.join("")}</w:body></w:document>`;return zB({documentXml:r,rels:t,...e.lists.length>0?{numberingXml:lP(e.lists)}:{},...e.notes.footnote.size>0?{footnotesXml:oh("footnote",e.notes.footnote),footnotesRels:e.noteRels.footnote}:{},...e.notes.endnote.size>0?{endnotesXml:oh("endnote",e.notes.endnote),endnotesRels:e.noteRels.endnote}:{},media:e.media,mediaExtensions:e.mediaExtensions})}var Gi=32;function ir(e){return e.left<=0?(e.truncated=true,false):(e.left-=1,e.visited+=1,true)}var EP=Object.freeze({});function CP(e,t){let n={...t};return e.bold!==void 0&&(n.bold=e.bold),e.italic!==void 0&&(n.italic=e.italic),e.color!==void 0&&(n.color=e.color),e.highlight!==void 0&&(n.highlight=e.highlight),e.shdFill!==void 0&&(n.shdFill=e.shdFill),e.szHalfPoints!==void 0&&(n.szHalfPoints=e.szHalfPoints),n}function ZB(e){return e.replace(/ /g," ").replace(/[-]/g,"").replace(/[ \t\r\n\f\v]+/g," ")}function ko(e,t,n){let r=V(Wn(ZB(e)));if(r.length===0)return "";let i=n.uprightUnlessItalic===true&&n.italic!==true?n.bold?"b":"p":n.bold?"bi":null,a=t.length>0?t:i?`<m:sty m:val="${i}"/>`:"",s=In({...n.color!==void 0?{color:n.color}:{},...n.highlight!==void 0?{highlight:n.highlight}:{},...n.shdFill!==void 0?{shdFill:n.shdFill}:{},...n.szHalfPoints!==void 0?{szHalfPoints:n.szHalfPoints}:{}});return `<m:r>${a.length>0?`<m:rPr>${a}</m:rPr>`:""}${s}<m:t xml:space="preserve">${r}</m:t></m:r>`}var XB=512,OP=new Set(["\u2211","\u220F","\u2210","\u222B","\u222C","\u222D","\u222E","\u222F","\u2230","\u22C0","\u22C1","\u22C2","\u22C3","\u2A00","\u2A01","\u2A02","\u2A04","\u2A06"]),YB=new Map([["^","\u0302"],["\u02C6","\u0302"],["\u0302","\u0302"],["~","\u0303"],["\u02DC","\u0303"],["\u0303","\u0303"],["\u02D9","\u0307"],["\u0307","\u0307"],["\xA8","\u0308"],["\u0308","\u0308"],["\u2192","\u20D7"],["\u20D7","\u20D7"],["\xB4","\u0301"],["`","\u0300"],["\u02C7","\u030C"],["\u02D8","\u0306"]]),MP=new Set(["\xAF","\u203E","_","\u2015","\u2014","\u0305","-"]),AP=new Map([["(",")"],["[","]"],["{","}"],["|","|"],["\u2016","\u2016"],["\u27E8","\u27E9"],["\u2329","\u232A"],["\u230A","\u230B"],["\u2308","\u2309"]]),QB=new Set(["annotation","annotation-xml","none","mprescripts","mspace","maligngroup","malignmark","mphantom"]),JB=new Set(["msub","msup","msubsup","munder","mover","munderover"]);function Io(e){return e.localName.toLowerCase()}function Xl(e){return Array.from(e.children)}function zo(e){return (e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim().slice(0,XB)}function zi(e){return W$1(Wn(e))}function qe(e,t){return t.length>0?`<m:${e}>${t}</m:${e}>`:`<m:${e}/>`}function LP(e,t){let n=t,r=e.getAttribute("mathcolor")?.trim()??"",o=/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(r)?.[1];if(o!==void 0){let a=o.length===3?o.replace(/./g,s=>s+s):o;n={...n,color:a.toUpperCase()};}let i=e.getAttribute("mathvariant")?.trim().toLowerCase();return (i==="bold"||i==="bold-italic")&&(n={...n,bold:true}),n}function Zl(e){if(e===void 0||Io(e)!=="mo")return null;let t=zo(e);return [...t].length===1?t:null}var ch=class{constructor(t){this.state=t;}state;node(t,n,r){if(n>Gi)return this.state.truncated=true,"";if(!ir(this.state))return "";let o=Io(t),i=LP(t,r),a=Xl(t),s=l=>a[l]?this.node(a[l],n+1,i):"";if(QB.has(o))return "";switch(o){case "semantics":return s(0);case "mi":return this.identifier(t,i);case "mn":case "mo":return ko(zo(t),"",i);case "mtext":return ko(zo(t),"<m:nor/>",i);case "ms":return ko(`"${zo(t)}"`,"<m:nor/>",i);case "msub":return `<m:sSub>${qe("e",s(0))}${qe("sub",s(1))}</m:sSub>`;case "msup":return `<m:sSup>${qe("e",s(0))}${qe("sup",s(1))}</m:sSup>`;case "msubsup":return `<m:sSubSup>${qe("e",s(0))}${qe("sub",s(1))}${qe("sup",s(2))}</m:sSubSup>`;case "mfrac":return this.fraction(t,s(0),s(1));case "msqrt":return `<m:rad><m:radPr><m:degHide m:val="1"/></m:radPr><m:deg/>${qe("e",this.row(a,n+1,i))}</m:rad>`;case "mroot":return `<m:rad>${qe("deg",s(1))}${qe("e",s(0))}</m:rad>`;case "munder":return this.under(a[1],s(0),s(1));case "mover":return this.over(t,a[1],s(0),s(1));case "munderover":return `<m:limUpp>${qe("e",`<m:limLow>${qe("e",s(0))}${qe("lim",s(1))}</m:limLow>`)}${qe("lim",s(2))}</m:limUpp>`;case "mfenced":return this.fenced(t,a,n,i);case "menclose":return `<m:borderBox>${qe("e",this.row(a,n+1,i))}</m:borderBox>`;case "mtable":return this.table(a,n,i);case "mmultiscripts":return this.multiscripts(a,n,i);default:return this.row(a,n+1,i)}}identifier(t,n){let r=zo(t),o=t.getAttribute("mathvariant")?.trim().toLowerCase(),i="";return o==="normal"||o===void 0&&[...r].length>1?i='<m:sty m:val="p"/>':o==="bold"?i='<m:sty m:val="b"/>':o==="bold-italic"&&(i='<m:sty m:val="bi"/>'),ko(r,i,n)}fraction(t,n,r){let o=t.getAttribute("linethickness")?.trim().toLowerCase(),i=t.getAttribute("bevelled")?.trim().toLowerCase()==="true",a=o!==void 0&&/^0(?:\.0*)?(?:px|pt|em|ex|%)?$/.test(o)?"noBar":i?"skw":null;return `<m:f>${a===null?"":`<m:fPr><m:type m:val="${a}"/></m:fPr>`}${qe("num",n)}${qe("den",r)}</m:f>`}under(t,n,r){let o=Zl(t);return o!==null&&MP.has(o)?`<m:bar><m:barPr><m:pos m:val="bot"/></m:barPr>${qe("e",n)}</m:bar>`:`<m:limLow>${qe("e",n)}${qe("lim",r)}</m:limLow>`}over(t,n,r,o){let i=Zl(n);if(i!==null&&MP.has(i))return `<m:bar><m:barPr><m:pos m:val="top"/></m:barPr>${qe("e",r)}</m:bar>`;let a=i===null?void 0:YB.get(i);return a!==void 0||i!==null&&t.getAttribute("accent")?.trim()==="true"?`<m:acc><m:accPr><m:chr m:val="${zi(a??i)}"/></m:accPr>${qe("e",r)}</m:acc>`:`<m:limUpp>${qe("e",r)}${qe("lim",o)}</m:limUpp>`}fenced(t,n,r,o){let i=[...t.getAttribute("open")??"("].slice(0,1).join(""),a=[...t.getAttribute("close")??")"].slice(0,1).join(""),s=[...(t.getAttribute("separators")??",").trim()][0]??"",l=n.map(c=>qe("e",this.node(c,r+1,o)));return `<m:d><m:dPr><m:begChr m:val="${zi(i)}"/>${s.length>0?`<m:sepChr m:val="${zi(s)}"/>`:""}<m:endChr m:val="${zi(a)}"/></m:dPr>${l.join("")||"<m:e/>"}</m:d>`}table(t,n,r){let o="";for(let i of t){if(!ir(this.state))break;let a=Io(i);if(a!=="mtr"&&a!=="mlabeledtr")continue;let s=Xl(i).slice(a==="mlabeledtr"?1:0);o+="<m:mr>"+s.map(l=>qe("e",Io(l)==="mtd"?this.row(Xl(l),n+2,r):this.node(l,n+2,r))).join("")+"</m:mr>";}return o.length>0?`<m:m>${o}</m:m>`:""}multiscripts(t,n,r){let o=c=>c===void 0||Io(c)==="none"?"":this.node(c,n+1,r),i=t.findIndex(c=>Io(c)==="mprescripts"),a=i<0?t.slice(1):t.slice(1,i),s=i<0?[]:t.slice(i+1),l=o(t[0]);return a.length>0&&(l=`<m:sSubSup>${qe("e",l)}${qe("sub",o(a[0]))}${qe("sup",o(a[1]))}</m:sSubSup>`),s.length>0?`<m:sPre>${qe("sub",o(s[0]))}${qe("sup",o(s[1]))}${qe("e",l)}</m:sPre>`:l}nary(t,n,r,o){let i=Io(t),a=Xl(t),s=zo(i==="mo"?t:a[0]),l=g=>a[g]?this.node(a[g],r+1,o):"",c="",d="";i==="msub"||i==="munder"?c=l(1):i==="msup"||i==="mover"?d=l(1):(i==="msubsup"||i==="munderover")&&(c=l(1),d=l(2));let u=i==="munder"||i==="mover"||i==="munderover"?"undOvr":"subSup",f=`<m:chr m:val="${zi(s)}"/><m:limLoc m:val="${u}"/>${c.length===0?'<m:subHide m:val="1"/>':""}${d.length===0?'<m:supHide m:val="1"/>':""}`,p=n?this.node(n,r+1,o):"";return `<m:nary><m:naryPr>${f}</m:naryPr>${qe("sub",c)}${qe("sup",d)}${qe("e",p)}</m:nary>`}isNary(t){let n=Io(t);if(n==="mo")return OP.has(zo(t));if(!JB.has(n))return false;let r=t.children[0];return r!==void 0&&OP.has(Zl(r)??"")}row(t,n,r){if(n>Gi)return this.state.truncated=true,"";let o=Zl(t[0]),i=Zl(t[t.length-1]);if(t.length>=2&&o!==null&&i!==null&&AP.has(o)&&[...AP.values()].includes(i)){let l=this.row(t.slice(1,-1),n+1,r);return `<m:d><m:dPr><m:begChr m:val="${zi(o)}"/><m:endChr m:val="${zi(i)}"/></m:dPr>${qe("e",l)}</m:d>`}let a="";for(let s=0;s<t.length;s+=1){let l=t[s];if(this.isNary(l)){let c=t[s+1];a+=this.nary(l,c,n,r),c!==void 0&&(s+=1);continue}a+=this.node(l,n,r);}return a}};function dh(e){return Io(e)==="math"}function FP(e){return e.getAttribute("display")?.trim().toLowerCase()==="block"||e.getAttribute("mode")?.trim().toLowerCase()==="display"}function DP(e,t,n){return new ch(t).row(Xl(e),1,LP(e,n))}var e5="acc accPr aln alnScr argPr argSz bar barPr baseJc begChr borderBox borderBoxPr box boxPr brk brkBin brkBinSub cGp cGpRule chr count cSp ctrlPr d defJc deg degHide den diff dispDef dPr e endChr eqArr eqArrPr f fName fPr func funcPr groupChr groupChrPr grow hideBot hideLeft hideRight hideTop interSp intLim intraSp jc lim limLoc limLow limLowPr limUpp limUppPr lit lMargin m mathFont mathPr maxDist mc mcJc mcPr mcs mPr mr nary naryLim naryPr noBreak nor num objDist oMath oMathPara oMathParaPr opEmu phant phantPr plcHide pos postSp preSp r rad radPr rMargin rPr rSp rSpRule scr sepChr show shp smallFrac sPre sPrePr sSub sSubPr sSubSup sSubSupPr sSup sSupPr strikeBLTR strikeH strikeTLBR strikeV sty sub subHide sup supHide t transp type vertJc wrapIndent wrapRight zeroAsc zeroDesc zeroWid".split(" "),HP=new Map(e5.map(e=>[`m:${e.toLowerCase()}`,e])),t5=new Set(["oMath","e","num","den","sub","sup","deg","lim","fName"]),n5=512,r5=512,o5=64,i5=64,a5=2,s5=256,NP=/^\[if\s+gte\s+msEquation\b[^\]]*\]>([\s\S]*)<!\[endif\]$/i,l5=/^\[if\s+!msEquation\s*\]$/i,c5=/^\[if\b[^\]]*\]$/i,d5=/^\[endif\]$/i,u5=Object.freeze({byElement:new Map,visited:0,truncated:false});function _P(e){return /<m:omath|msEquation|<math[\s>]/i.test(e)}function Yl(e){return e.nodeType===1?HP.get(Qe(e)):void 0}function BP(e,t,n,r){if(!(n>Gi||!ir(t))){if(e.nodeType===3){r.push(e.nodeValue??"");return}if(!(e.nodeType!==1||Qe(e)==="o:p"))for(let o of Array.from(e.childNodes))BP(o,t,n+1,r);}}function uh(e,t){return CP(ji(Gl({},Qe(e)),e),t)}function f5(e,t,n,r){let o="",i=[],a=r;for(let s of Array.from(e.childNodes)){let l=Yl(s);if(l==="rPr")o+=Ku(s,"rPr",t,n+1,r);else {if(s.nodeType===1&&Qe(s)==="w:rpr")continue;s.nodeType===1&&l===void 0&&(a=uh(s,a)),BP(s,t,n+1,i);}}return ko(i.join(""),o,a)}function Ku(e,t,n,r,o){let i="",a="",s=t5.has(t);for(let l of Array.from(e.childNodes)){if(l.nodeType===3){if(!ir(n))break;s&&(a+=l.nodeValue??"");continue}l.nodeType===1&&(a.trim().length>0&&(i+=ko(a,"",o)),a="",i+=$P(l,t,n,r+1,o));}return a.trim().length>0&&(i+=ko(a,"",o)),i}function $P(e,t,n,r,o){if(r>Gi)return n.truncated=true,"";if(!ir(n))return "";let i=HP.get(Qe(e));if(i===void 0)return Qe(e)==="o:p"?"":Ku(e,t,n,r,uh(e,o));if(i==="ctrlPr"||i==="oMathPara"||i==="oMath")return "";if(i==="r"||i==="t")return f5(e,n,r,o);let a=e.getAttribute("m:val"),s=a!==null&&a.length<=o5?` m:val="${W$1(Wn(a))}"`:"",l=Ku(e,i,n,r,o);return l.length>0?`<m:${i}${s}>${l}</m:${i}>`:`<m:${i}${s}/>`}function WP(e,t,n){if(!ir(t))return null;let r=Ku(e,"oMath",t,1,n);return r.length>0?`<m:oMath>${r}</m:oMath>`:null}function qP(e,t,n,r,o){if(!(n>Gi||!ir(t)))for(let i of Array.from(e.children)){let a=Yl(i);if(a==="oMath"){let s=WP(i,t,r);s!==null&&o.equations.push(s);}else a==="oMathParaPr"&&o.properties.length===0?o.properties=$P(i,"oMathPara",t,n+1,r):a===void 0&&qP(i,t,n+1,uh(i,r),o);}}function p5(e){let t=Yl(e);return t==="oMath"||t==="oMathPara"||dh(e)}function m5(e){let t=0;for(let n=e.parentElement;n!==null;n=n.parentElement)if((t+=1)>s5||p5(n))return true;return false}function g5(e,t){if(typeof e.createTreeWalker!="function")return;let n=e.createTreeWalker(e.body,128),r=[];for(let o=n.nextNode();o!==null;o=n.nextNode()){if(!ir(t))return;let i=o.data;if(/<m:omath|<math[\s>]/i.test(i)&&NP.test(i)){if(r.length>=r5){t.truncated=true;break}r.push(o);}}for(let o of r){let i=NP.exec(o.data)?.[1]??"",a;try{a=new DOMParser().parseFromString(i,"text/html");}catch{continue}let s=o.parentNode;if(!(s===null||a.body===null)){for(let l of Array.from(a.body.childNodes))s.insertBefore(e.importNode(l,true),o);s.removeChild(o);}}}function h5(e){return e.nodeType===3?(e.nodeValue??"").replace(/[\s ]/g,"").length>0:e.nodeType===1||e.nodeType===8}function y5(e){let t=e;for(let n=0;n<=a5;n+=1){let r=t.nextSibling;for(;r!==null&&!h5(r);)r=r.nextSibling;if(r!==null){if(r.nodeType!==8||!l5.test(r.data.trim()))return;let a=[r],s=1;for(let l=r.nextSibling;l!==null&&a.length<=i5;l=l.nextSibling)if(a.push(l),l.nodeType===8){let c=l.data.trim();if(d5.test(c)?s-=1:c5.test(c)&&(s+=1),s===0){for(let d of a)d.parentNode?.removeChild(d);return}}return}let o=t.parentElement;if(o===null||Yl(o)!==void 0)return;let i=Qe(o);if(i!=="span"&&i!=="i"&&i!=="b"&&i!=="font")return;t=o;}}function b5(e,t){let n=e.getElementsByTagName("i").length>0?{uprightUnlessItalic:true}:EP;if(dh(e)){if(!ir(t))return null;let r=DP(e,t,n);return r.length===0?null:FP(e)?`<m:oMathPara><m:oMath>${r}</m:oMath></m:oMathPara>`:`<m:oMath>${r}</m:oMath>`}if(Yl(e)==="oMathPara"){let r={properties:"",equations:[]};return qP(e,t,1,n,r),r.equations.length===0?null:`<m:oMathPara>${r.properties}${r.equations.join("")}</m:oMathPara>`}return WP(e,t,n)}function KP(e,t){if(e.body===null||t<=0)return u5;let n={left:t,visited:0,truncated:false};g5(e,n);let r=new Map,o=[];for(let i of ["m:omathpara","m:omath","math"]){let a=e.body.getElementsByTagName(i);for(let s=0;s<a.length;s+=1){if(o.length>=n5){n.truncated=true;break}if(!ir(n))break;let l=a[s];m5(l)||o.push(l);}}for(let i of o){if(n.left<=0){n.truncated=true;break}let a=b5(i,n);a===null||n.truncated||(r.set(i,[a]),y5(i));}return {byElement:r,visited:n.visited,truncated:n.truncated}}function fh(e){return e.startsWith("<m:oMath>")||e.startsWith("<m:oMathPara>")}var UP=new Map;function jP(e,t,n,r){let o=qg(n)??e.runChange,i=Ug(t,e.originalRunStyle);if(r===null&&o===void 0&&i===void 0)return e;let a=e.run;if(o!==void 0){let s=MR(a),l=Ui(s,i??UP);a={...s,changeXml:CR(o,In(l))};}return {...e,run:a,...r===null?{}:{revisions:[...e.revisions??[],r]},...o===void 0?{}:{runChange:o},...i===void 0?{}:{originalRunStyle:i}}}function VP(e,t,n){let r=qg(n);if(r===null)return;let o={...e};Bu(o,Ug(t,void 0)??UP),e.changeXml=OR(r,Qg(o));}function Uu(e,t){let n=t.markRevision;return t.markRevisionTaken=n!==null,n===null?e:(t.markRevision=null,{...e,markRevisionXml:n})}function GP(e,t){let n=[e],r=[];for(let o of ["footnote","endnote"])for(let[i,a]of t[o]){let s=[...a];r.push({kind:o,id:i,blocks:s}),n.push(s);}AR(n);for(let o of r)t[o.kind].set(o.id,o.blocks);}function Pr(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var Zo=31680;function Ro(e,t,n){return Math.min(n,Math.max(t,e))}function zP(e){let t=Tt(It(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 v5(e){return Zi(e,"colspan",63)}function ZP(e){return Array.from(e.children).flatMap(t=>{let n=Qe(t);return n==="tr"?[t]:n!=="thead"&&n!=="tbody"&&n!=="tfoot"?[]:Array.from(t.children).filter(r=>Qe(r)==="tr")})}function Zi(e,t,n){let r=e.getAttribute(t);return r===null||!/^\d{1,4}$/.test(r.trim())?1:Ro(Number.parseInt(r,10),1,n)}function XP(e,t){let n=(It(e).get("width")??e.getAttribute("width")??"").trim(),r=/^(\d{1,3}(?:\.\d+)?)%$/.exec(n);if(r)return {xml:`<w:tblW w:w="${Ro(Math.round(Number.parseFloat(r[1])*50),50,5e3)}" w:type="pct"/>`,twips:t};let o=zP(e);if(o===null)return {xml:'<w:tblW w:w="0" w:type="auto"/>',twips:t};let i=Ro(Math.round(o*20),1,Zo);return {xml:`<w:tblW w:w="${i}" w:type="dxa"/>`,twips:i}}function YP(e){let n=It(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 QP(e){let t=It(e),n=t.get("mso-table-anchor-horizontal")?.trim().toLowerCase(),r=t.get("mso-table-anchor-vertical")?.trim().toLowerCase();if(n===void 0&&r===void 0)return "";let o=l=>l==="margin"||l==="page"?l:"text",i=` w:horzAnchor="${o(n)}" w:vertAnchor="${o(r)}"`,a=t.get("mso-table-left")?.trim().toLowerCase();if(a==="left"||a==="center"||a==="right")i+=` w:tblpXSpec="${a}"`;else {let l=Tt(a??"");l!==null&&(i+=` w:tblpX="${Ro(Math.round(l*20),-Zo,Zo)}"`);}let s=Tt(t.get("mso-table-top")??"");return s!==null&&(i+=` w:tblpY="${Ro(Math.round(s*20),-Zo,Zo)}"`),`<w:tblpPr${i}/>`}function JP(e,t,n){let r=Math.max(1,Math.floor(n/t)),o=-1,i=Array.from({length:t},()=>r),a=new Array(t).fill(null);for(let d of e){let u=Array.from({length:t},()=>r),f=0,p=0,g=a.map(b=>b?b.span:null);for(let b=0;b<t;b+=1){let x=a[b];x&&(x.remaining-=1,x.remaining<=0&&(a[b]=null));}let y=Array.from(d.children).filter(b=>/^t[dh]$/.test(Qe(b))),h=0;for(;p<t;){let b=g[p];if(b!==null){p+=b;continue}let x=y[h];if(x===void 0)break;h+=1;let S=Math.min(v5(x),t-p);for(let E=p+1;E<p+S;E+=1)if(g[E]!==null){S=E-p;break}let v=Zi(x,"rowspan",1e3);v>1&&(a[p]={remaining:v-1,span:S});let k=zP(x);if(k!==null){let E=Ro(Math.round(k*20/S),1,Zo);for(let I=0;I<S;I+=1)u[p+I]=E;f+=S;}p+=S;}f>o&&(o=f,i=u);}let s=i.reduce((d,u)=>d+u,0);if(s<=0)return i;let l=i.map(d=>Math.max(1,Math.round(d*n/s))),c=n-l.reduce((d,u)=>d+u,0);return l[l.length-1]=Math.max(1,l[l.length-1]+c),l}function ph(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 eT=new Map([["solid","single"],["double","double"],["dotted","dotted"],["dashed","dashed"],["none","nil"],["hidden","nil"]]),tT=new Map([["thin",.75],["medium",2.25],["thick",3.75]]);function nT(e){return Ro(Math.round(e*8),2,96)}function zr(e){if(e===void 0||e.length===0||e.length>128)return;let t,n,r;for(let o of Yg(e)){let i=eT.get(o.toLowerCase());if(i!==void 0){t=i;continue}let a=tT.get(o.toLowerCase())??Tt(o);if(a!==null){n=a;continue}let s=Go(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:nT(n),color:r??"000000"}}}function ju(e,t){let n=e.get(`${t}-style`)?.trim();if(n===void 0||n.length===0||n.length>64)return;let r=eT.get(n.split(/\s+/)[0].toLowerCase());if(r===void 0)return;if(r==="nil")return {val:r,size:0,color:"auto"};let o=e.get(`${t}-width`)?.trim().split(/\s+/)[0],i=o===void 0||o.length>64?null:tT.get(o.toLowerCase())??Tt(o);if(i!==null&&i<=0)return;let a=e.get(`${t}-color`)?.trim().split(/\s+/)[0],s=a===void 0||a.length>64?null:Go(a);return {val:r,size:i===null?4:nT(i),color:s??"000000"}}function rT(e,t){return `<w:${e} w:val="${t.val}" w:sz="${t.size}" w:space="0" w:color="${t.color}"/>`}function oT(e,t=false){let n=It(e),o=zr(n.get("mso-border-alt"))??zr(n.get("border"))??ju(n,"border")??(e.getAttribute("border")?.trim()&&e.getAttribute("border")?.trim()!=="0"?{val:"single",size:4,color:"auto"}:void 0),i=[["top","top"],["left","left"],["bottom","bottom"],["right","right"],["insideH","insideh"],["insideV","insidev"]],a="";for(let[s,l]of i){let c=Pr(l,t),d=zr(n.get(`mso-border-${c}-alt`))??zr(n.get(`mso-border-${c}`))??zr(n.get(`border-${c}`))??ju(n,`border-${c}`)??o;d!==void 0&&(a+=rT(s,d));}return a.length>0?`<w:tblBorders>${a}</w:tblBorders>`:""}function iT(e){let t=It(e),n=ER(t),r=Tt(t.get("height")??"");if(r===null||r<=0)return n?`<w:trPr>${n}</w:trPr>`:"";let o=Ro(Math.round(r*20),1,Zo),a=t.get("mso-height-rule")?.trim().toLowerCase()==="exactly"?"exact":"atLeast";return `<w:trPr><w:trHeight w:val="${o}" w:hRule="${a}"/>${n}</w:trPr>`}function x5(e,t){let n={top:null,right:null,bottom:null,left:null},r=e.get("padding");if(r!==void 0&&r.length<=128){let i=r.trim().split(/\s+/).map(a=>Tt(a));if(i.length>=1&&i.length<=4&&!i.some(a=>a===null||a<0)){let[a,s=a,l=a,c=s]=i.length===2?[i[0],i[1],i[0],i[1]]:i.length===3?[i[0],i[1],i[2],i[1]]:i;n.top=a??null,n.right=s??null,n.bottom=l??null,n.left=c??null;}}for(let i of ["top","right","bottom","left"]){let a=Tt(e.get(`padding-${i}`)??"");a!==null&&a>=0&&(n[i]=a);}let o="";for(let i of ["top","left","bottom","right"]){let a=Pr(i,t),s=n[a];s!==null&&(o+=`<w:${i} w:w="${Ro(Math.round(s*20),0,Zo)}" w:type="dxa"/>`);}return o.length>0?`<w:tcMar>${o}</w:tcMar>`:""}function aT(e,t=false){let n=It(e),r=zr(n.get("mso-border-alt"))??zr(n.get("border"))??ju(n,"border"),o="";for(let l of ["top","left","bottom","right"]){let c=Pr(l,t),d=zr(n.get(`mso-border-${c}-alt`))??zr(n.get(`mso-border-${c}`))??zr(n.get(`border-${c}`))??ju(n,`border-${c}`)??r;d!==void 0&&(o+=rT(l,d));}let i=o.length>0?`<w:tcBorders>${o}</w:tcBorders>`:"",a=Hu(n);a&&(i+=`<w:shd w:val="clear" w:color="auto" w:fill="${a}"/>`),i+=x5(n,t);let s=n.get("vertical-align")?.toLowerCase()??e.getAttribute("valign")?.toLowerCase();return s==="top"?i+='<w:vAlign w:val="top"/>':s==="middle"||s==="center"?i+='<w:vAlign w:val="center"/>':s==="bottom"&&(i+='<w:vAlign w:val="bottom"/>'),i}var S5=9360;function sT(e,t,n,r,o,i){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;for(let I of Array.from(e.children))Qe(I)==="caption"&&i(Array.from(I.childNodes),t+1,n,r,o,true);let a=ZP(e);if(a.length===0)return;let s=1,l=r.nodesLeft,c=[];for(let I of a){if(l<=0||s>=63)break;let R=c.map(T=>T?T.span:null);for(let T=0;T<c.length;T+=1){let $=c[T];$&&($.remaining-=1,$.remaining<=0&&(c[T]=null));}let O=Array.from(I.children).filter(T=>/^t[dh]$/.test(Qe(T))),C=0,w=0;for(;w<63&&(l-=1,!(l<=0));){let T=w<R.length?R[w]:null;if(T!=null){w+=T;continue}let $=O[C];if($===void 0)break;C+=1;let W=Math.min(Zi($,"colspan",63),63-w);for(let K=w+1;K<w+W;K+=1)if(K<R.length&&R[K]!=null){W=K-w;break}let q=Zi($,"rowspan",1e3);if(q>1){for(;c.length<=w;)c.push(null);c[w]={remaining:q-1,span:W};}w+=W;}for(let T=w;T<R.length&&T<63;T+=1){let $=R[T];$!=null&&(w=Math.max(w,T+$));}s=Math.max(s,w);}s=Math.min(Math.max(s,1),63);let d=XP(e,S5),u=d.twips,f=a.length>r.nodesLeft?a.slice(0,Math.max(1,r.nodesLeft)):a,p=JP(f,s,u),y=(It(e).get("direction")??e.getAttribute("dir"))?.trim().toLowerCase()==="rtl",h=oT(e,y),b=QP(e),x=YP(e)??(y?"left":void 0),S=x===void 0?"":`<w:jc w:val="${Pr(x,y)}"/>`,v=p.map(I=>`<w:gridCol w:w="${I}"/>`).join(""),k=new Array(s).fill(null),E=[];for(let I of a){if(r.nodesLeft<=0){r.truncated=true;break}r.nodesLeft-=1;let R=k.map(W=>W?W.span:null);for(let W=0;W<s;W+=1){let q=k[W];q&&(q.remaining-=1,q.remaining<=0&&(k[W]=null));}let O=Array.from(I.children).filter(W=>/^t[dh]$/.test(Qe(W))),C=0,w=[],T=0,$=true;for(;T<s;){if(r.nodesLeft-=1,r.nodesLeft<=0){r.truncated=true,$=false;break}let W=R[T];if(W!==null){let M=W>1?`<w:gridSpan w:val="${W}"/>`:"";w.push(`<w:tc><w:tcPr><w:tcW w:w="${ph(p,T,W)}" w:type="dxa"/>${M}<w:vMerge/></w:tcPr><w:p/></w:tc>`),T+=W;continue}let q=O[C];if(q===void 0){w.push(`<w:tc><w:tcPr><w:tcW w:w="${p[T]}" w:type="dxa"/></w:tcPr><w:p/></w:tc>`),T+=1;continue}C+=1;let K=Math.min(Zi(q,"colspan",63),s-T);for(let M=T+1;M<T+K;M+=1)if(R[M]!==null){K=M-T;break}let Z=Zi(q,"rowspan",1e3);Z>1&&(k[T]={remaining:Z-1,span:K}),w.push(w5(q,K,ph(p,T,K),Z>1,t,n,r,i,y)),T+=K;}if(!$)break;E.push(`<w:tr>${iT(I)}${w.join("")}</w:tr>`);}E.length!==0&&(o.push(`<w:tbl><w:tblPr>${y?"<w:bidiVisual/>":""}${b}${d.xml}${S}${h}</w:tblPr><w:tblGrid>${v}</w:tblGrid>${E.join("")}</w:tbl>`),r.lastMarkCovered=false);}function w5(e,t,n,r,o,i,a,s,l){let c=Qe(e)==="th",d=`<w:tcW w:w="${n}" w:type="dxa"/>`;t>1&&(d+=`<w:gridSpan w:val="${t}"/>`),r&&(d+='<w:vMerge w:val="restart"/>'),d+=aT(e,l);let u={run:c?{...i.run,bold:true}:i.run,para:c?{jc:"center"}:{},paragraphMarkCovered:false,pre:false,list:null,...i.noteBody?{noteBody:i.noteBody}:{},...i.rels?{rels:i.rels}:{}},f=[];return s(Array.from(e.childNodes),o+2,u,a,f,true),(f.length===0||f[f.length-1].endsWith("</w:tbl>"))&&f.push("<w:p/>"),`<w:tc><w:tcPr>${d}</w:tcPr>${f.join("")}</w:tc>`}function lT(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 cT(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 dT(e){if(Qe(e)!=="br")return false;let t=It(e);return t.get("page-break-before")?.trim().toLowerCase()==="always"||t.get("break-before")?.trim().toLowerCase()==="page"}function uT(e){if(dT(e))return true;if(Qe(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||!dT(r))return false;t=true;}}return t}function fT(e){if(Qe(e)!=="p")return false;let t=null;for(let o=0;o<e.childNodes.length;o+=1){let i=e.childNodes[o];if(i.nodeType===3){if((i.nodeValue??"").replace(/[\s\u00a0]/g,"").length===0)continue;return false}if(i.nodeType!==1||t!==null)return false;t=i;}if(t===null)return false;let n=It(e);for(let o of n.keys())if(o==="background"||o==="background-color"||o.startsWith("border"))return false;if(Qe(t)!=="o:p"||t.childNodes.length>3)return false;let r="";for(let o=0;o<t.childNodes.length;o+=1){let i=t.childNodes[o];if(i.nodeType!==3)return false;r+=i.nodeValue??"";}return r.includes("\xA0")&&r.replace(/[\s\u00a0]/g,"").length===0}function mh(e){let t=0,n=e.parentElement;for(;n!==null&&t<256;)t+=1,n=n.parentElement;return t}var gh=new Set("script style head template iframe object embed noscript svg math meta link title base select textarea hr w:sdtpr".split(" ")),hh=new Set("p div h1 h2 h3 h4 h5 h6 li blockquote pre".split(" ")),yh=new Set("thead tbody tfoot tr section article main header footer aside nav figure form body html".split(" ")),k5=new Set([...hh,...yh,"table","ol","ul","w:sdt"]);function bh(e){for(let t=0;t<e.children.length;t+=1)if(k5.has(Qe(e.children[t])))return true;return false}var I5=new Set(["p","div","table","ol","ul","section","article","main","h1","h2","h3","h4","h5","h6"]);function pT(e){if(Qe(e)!=="w:sdt")return null;let t=[e],n=0;for(let r=0;r<t.length&&n<64;r+=1){let o=t[r];for(let i=0;i<o.children.length&&n<64;i+=1){let a=o.children[i];n+=1;let s=Qe(a);if(I5.has(s))return Array.from(e.childNodes);s!=="w:sdtpr"&&t.push(a);}}return null}var R5=4*1024*1024,P5=1e5,T5=64,E5=2*1024*1024,mT="http://schemas.openxmlformats.org/officeDocument/2006/relationships";function vh(e,t,n,r,o=e.rels){let i=`rId${o.length+1}`;return o.push({id:i,type:t,target:n,external:r}),i}var C5=/<w:br\/><\/w:r>(?:<\/w:(?:ins|del)>)*$/;function Ql(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 x=e.nodeValue??"";if(n.pre){let v=x.replace(/\r\n?/g,`
|
|
4
|
-
`).split(`
|
|
5
|
-
`);for(let k=0;k<v.length;k+=1){if(k>0){if(o.nodesLeft-=1,o.nodesLeft<=0){o.truncated=true;return}r.push(`<w:r>${In(n.run)}<w:br/></w:r>`);}let E=v[k];E.length>0&&r.push($u(E,n.run));}return}let S=x.replace(/[ \t\r\n\f\v]+/g," ");if(S.startsWith(" ")&&C5.test(r[r.length-1]??"")&&(S=S.slice(1)),S.length===0||S===" "&&Jg(r))return;r.push($u(S,n.run));return}if(e.nodeType===8&&o.wordHtml)for(let x of bP(e.nodeValue??"",o))r.push(x);if(!os(e))return;let i=o.equations.get(e);if(i!==void 0){for(let x of i)r.push(x);return}let a=Qe(e);if(gh.has(a))return;let s=It(e);if(_u(e)&&n.para.numPr!==void 0||s.get("mso-element")?.trim().toLowerCase()==="comment-reference"||s.get("mso-special-character")?.trim().toLowerCase()==="comment"||e.classList.contains("msocomanchor")||o.definedNoteElements.has(e))return;if(a==="w:ptab"){let x=cT(e);x.length>0&&r.push(`<w:r>${In(n.run)}${x}</w:r>`);return}let c=lT(s.get("mso-tab-count"));if(c.length>0){if(o.nodesLeft-=c.split("<w:tab/>").length-2,o.nodesLeft<=0){o.truncated=true;return}let x=Ui(Gl(n.run,a),s);if(r.push(`<w:r>${In(x)}${c}</w:r>`),(e.textContent??"").trim().length===0&&e.children.length===0)return}if(a==="br"){let x=s.get("page-break-before")?.trim().toLowerCase()==="always"||s.get("break-before")?.trim().toLowerCase()==="page";r.push(`<w:r>${In(n.run)}${x?'<w:br w:type="page"/>':"<w:br/>"}</w:r>`);return}if(a==="img"){ZR(e,r,o,x=>vh(o,`${mT}/image`,x,false,n.rels??o.rels));return}let d=kR(e,a,o.wordHtml),f=d?.kind==="ins"&&n.revisions?.some(x=>x.kind==="del")?null:d,p=d===null?Gl(n.run,a):n.run,g=a==="a"?e.getAttribute("href"):null,y=a==="a"?rh(s):null;y===null&&cP(g)&&(p={...p,rStyle:"Hyperlink"});let h=ji(p,e),b=jP({...n,run:h,pre:n.pre||a==="pre"},e,s,f);if(f!==null){let x=[];for(let S of Array.from(e.childNodes))Ql(S,t+1,b,x,o);for(let S of RR(f,x))r.push(S);return}if(y!==null){let x={...b.run,vertAlign:"superscript"};if(n.noteBody!==void 0&&n.noteBody.kind===y.kind&&n.noteBody.id===y.id){let S=y.kind==="footnote"?"footnoteRef":"endnoteRef";r.push(`<w:r>${In(x)}<w:${S}/></w:r>`);return}if(o.definedNotes[y.kind].has(y.id)){let S=y.kind==="footnote"?"footnoteReference":"endnoteReference";r.push(`<w:r>${In(x)}<w:${S} w:id="${y.id}"/></w:r>`);let v=(e.textContent??"").replace(/[ \t\r\n\f\v]+/g," ").trim(),k=`${y.kind}:${y.id}`;if(v.length>0&&!o.noteMarkFallbacks.has(k)&&o.noteMarkFallbacks.set(k,$u(v,x)),n.noteBody===void 0)o.bodyNoteRefs[y.kind].add(y.id);else {let E=`${n.noteBody.kind}:${n.noteBody.id}`,I=o.noteNoteRefs.get(E)??[];I.push({kind:y.kind,id:y.id}),o.noteNoteRefs.set(E,I);}return}for(let S of Array.from(e.childNodes))Ql(S,t+1,b,r,o);return}if(a==="a"){let x=e.getAttribute("href"),S=Rr(e.getAttribute("name")||e.getAttribute("id")),v=[];for(let R of Array.from(e.childNodes))Ql(R,t+1,b,v,o);let k=x?.startsWith("#")?Rr(x.slice(1)):null,E=v.join(""),I=()=>b.revisions===void 0?E:PR(b.revisions,E);if(k!==null)E=`<w:hyperlink w:anchor="${W$1(k)}">${I()}</w:hyperlink>`;else if(x!==null&&!x.startsWith("#")){let R=U(x);R.ok&&R.href.length>0&&(E=`<w:hyperlink r:id="${vh(o,`${mT}/hyperlink`,R.href,true,n.rels??o.rels)}">${I()}</w:hyperlink>`);}if(S!==null){let R=String(o.nextBookmarkId++);E=`<w:bookmarkStart w:id="${R}" w:name="${W$1(S)}"/>${E}<w:bookmarkEnd w:id="${R}"/>`;}E.length>0&&r.push(E);return}a==="o:p"&&n.revisions!==void 0&&(o.markRevision=TR(n.revisions));for(let x of Array.from(e.childNodes))Ql(x,t+1,b,r,o);}function gT(e,t,n,r){let o=Qe(e),i=It(e),a={};r&&(a.pageBreakBefore=true);let s=KR(e,n.wordHtml);s!==void 0&&(a.styleId=s),t.para.numPr&&(a.numPr=t.para.numPr),t.para.jc&&(a.jc=t.para.jc),t.para.bidi&&(a.bidi=true);let l={...t.run},c=YR[o];c!==void 0&&s===void 0&&!e.classList.contains("docx-outline")&&(l.bold=true,l.szHalfPoints=c);let d=t.pre||o==="pre";o==="pre"&&(l.font="Courier New");let u=RP(e,i,n,t.noteBody);return u&&(a.numPr=u),GR(a,e,n.classAlignments),Bu(a,i),VP(a,e,i),l=ji(l,e),e.getAttribute("dir")?.trim().toLowerCase()==="rtl"&&(a.bidi=true),{run:l,para:a,paragraphMarkCovered:a.styleId!==void 0||a.numPr!==void 0,pre:d,list:t.list,...t.noteBody?{noteBody:t.noteBody}:{},...t.rels?{rels:t.rels}:{}}}function hT(e,t,n,r,o,i=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.markRevision=null;let a=gT(e,n,r,i);Xo(Array.from(e.childNodes),t+1,a,r,o,true,void 0,false);}function yT(e,t,n,r,o,i=false){if(r.nodesLeft<=0){r.truncated=true;return}if(t>r.maxDepth)return;r.nodesLeft-=1;let a=qu(e);n.list||(r.semanticListCount+=1);let s=n.list?{numId:n.list.numId,level:Math.min(n.list.level+1,8)}:{numId:ih(r,`sem:${r.semanticListCount}`,{kind:a,start:zl(e)}),level:0};if(n.list){let d=r.listsByNumId.get(s.numId);d!==void 0&&!d.levels.has(s.level)&&d.levels.set(s.level,{kind:a,start:zl(e)});}let l={...n,list:s,para:{numPr:{numId:s.numId,ilvl:s.level}}},c=i;for(let d of Array.from(e.childNodes)){if(r.nodesLeft<=0){r.truncated=true;break}if(!os(d))continue;let u=Qe(d);if(u==="li")r.nodesLeft-=1,hT(d,t+1,l,r,o,c),c=false;else if(u==="ol"||u==="ul"){let f=o.length;yT(d,t+1,{...n,list:s},r,o,c),o.length>f&&(c=false);}}}function Xo(e,t,n,r,o,i=false,a,s=true){if(t>r.maxDepth)return;let l=o.length,c=a===void 0,d=[],u=[],f=n.para,p=a??{pending:false,skipSpacer:false},g=()=>({...f,pageBreakBefore:void 0,numPr:void 0}),y=()=>{if(d.length===0)return;if(!d.some(b=>b.includes("<w:r")||fh(b))){if(o.length===l){u=u.concat(d),d=[];return}let b=o[o.length-1];b?.endsWith("</w:p>")?(o[o.length-1]=`${b.slice(0,-6)}${d.join("")}</w:p>`,d=[]):b!==void 0&&d.length>0&&(o.push(Vi(g(),d)),d=[],r.lastMarkCovered=false);return}let h=p.pending?{...f,pageBreakBefore:true}:f;o.push(Vi(Uu(h,r),d)),f.pageBreakBefore&&(f={...f,pageBreakBefore:void 0}),p.pending=false,p.skipSpacer=false,r.lastMarkCovered=n.paragraphMarkCovered||r.markRevisionTaken,d=[];};for(let h of e){if(r.nodesLeft<=0){r.truncated=true;break}if(os(h)){let b=Qe(h),x=b==="w:sdt"?pT(h):null;if(s&&uT(h)){y(),r.nodesLeft-=1,p.pending&&Wu(o),p.pending=true,p.skipSpacer=true;continue}if(gh.has(b)&&!r.equations.has(h)){r.nodesLeft-=1;continue}let S=It(h);if(S.get("mso-element")?.trim().toLowerCase()==="comment-list"){r.nodesLeft-=1;continue}if(kP(S)){y(),r.nodesLeft-=1,Xo(Array.from(h.childNodes),t+1,n,r,o,false,p,s);continue}if(r.definedNoteElements.has(h)){r.nodesLeft-=1;continue}if(hh.has(b)){if(y(),r.nodesLeft-=1,p.pending&&p.skipSpacer&&fT(h)){p.skipSpacer=false;continue}if(b==="div"&&bh(h)){let k=gT(h,n,r,false);k.para.pageBreakBefore&&(p.pending=true),Xo(Array.from(h.childNodes),t+1,k,r,o,false,p,s);continue}let v=o.length;hT(h,t,n,r,o,p.pending),o.length>v&&(p.pending=false,p.skipSpacer=false);continue}if(b==="ol"||b==="ul"){y();let v=o.length;yT(h,t,n,r,o,p.pending),o.length>v&&(p.pending=false,p.skipSpacer=false);continue}if(b==="table"){y(),p.pending&&Wu(o),O5(h,t,n,r,o),p.pending=false,p.skipSpacer=false;continue}if(yh.has(b)||x!==null||b==="span"&&bh(h)){y(),r.nodesLeft-=1,Xo(x??Array.from(h.childNodes),t+1,n,r,o,false,p,s);continue}}if(h.nodeType===3&&/^[\s\u00a0]+$/.test(h.nodeValue??"")&&Jg(d)){r.nodesLeft-=1;continue}Ql(h,t,n,d,r);}if(i&&o.length===l&&d.length>0&&!d.some(h=>h.includes("<w:r")||fh(h))&&(o.push(Vi(Uu(f,r),d)),d=[],r.lastMarkCovered=n.paragraphMarkCovered||r.markRevisionTaken),y(),u.length>0){let h=o[l];h!==void 0&&h.startsWith("<w:p>")?o[l]=h.replace(/^(<w:p>(?:<w:pPr>(?:(?!<\/w:pPr>)[\s\S])*?<\/w:pPr>)?)/,`$1${u.join("")}`):h!==void 0?o.splice(l,0,Vi(g(),u)):d=u.concat(d),u=[];}d.length>0&&(o.push(Vi(g(),d)),d=[],r.lastMarkCovered=false),c&&p.pending&&(Wu(o),p.pending=false,p.skipSpacer=false,r.lastMarkCovered=false),i&&o.length===l&&(o.push(Vi(Uu(f,r),d)),d=[],r.lastMarkCovered=n.paragraphMarkCovered||r.markRevisionTaken);}function O5(e,t,n,r,o){sT(e,t,n,r,o,Xo);}function M5(e,t){return TP({blocks:nh(t),rels:e.rels,lists:[...e.lists.values()],notes:vP(e.notes),noteRels:e.noteRels,media:e.media,mediaExtensions:e.mediaExtensions})}function A5(e,t){let n=t.maxHtmlBytes??R5;if(e.length>n)return {ok:false,reason:"too-large"};if(e.length*3>n&&new TextEncoder().encode(e).byteLength>n)return {ok:false,reason:"too-large"};if(typeof DOMParser>"u")return {ok:false,reason:"parse-unavailable"};let r;try{r=new DOMParser().parseFromString(e,"text/html");}catch{return {ok:false,reason:"parse-unavailable"}}let o=r.body;if(!o)return {ok:false,reason:"no-content"};let i=t.maxNodes??P5,a=_P(e)?KP(r,i):null,s=SP(r),l={footnote:new Set,endnote:new Set},c=new Set,d={footnote:new Set,endnote:new Set};wP(r,s,d);let u={nodesLeft:i-(a?.visited??0),maxDepth:t.maxDepth??T5,maxImageBytes:t.maxImageBytes??E5,wordHtml:qR(e),truncated:false,lastMarkCovered:false,markRevision:null,markRevisionTaken: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:jR(r),listDefinitions:oP(VR(r)),notes:{footnote:new Map,endnote:new Map},noteRels:{footnote:[],endnote:[]},definedNotes:l,bodyNoteRefs:{footnote:new Set,endnote:new Set},noteNoteRefs:new Map,noteMarkFallbacks:new Map,definedNoteElements:c,equations:a?.byElement??new Map},f={};f=ji(f,r.documentElement),f=ji(f,o);let p={run:f,para:f.rtl?{bidi:true}:{},paragraphMarkCovered:false,pre:false,list:null},g=[];for(let S of s)d[S.kind].has(S.id)&&(l[S.kind].has(S.id)||(l[S.kind].add(S.id),c.add(S.element),g.push(S)));g.sort((S,v)=>mh(v.element)-mh(S.element)),u.lastMarkCovered=false;let y=[];Xo(Array.from(o.childNodes),0,p,u,y);let h=u.lastMarkCovered,b=u.truncated,x=false;for(let S=0;S<g.length;S+=1){let v=g[S];u.truncated=false;let k=u.nodesLeft,E=[];if(Xo(Array.from(v.element.childNodes),0,{...p,noteBody:{kind:v.kind,id:v.id},rels:u.noteRels[v.kind]},u,E,true),u.truncated||E.length===0){x=true;let I=new Set;for(let R=S;R<g.length;R+=1){let O=g[R];l[O.kind].delete(O.id),c.delete(O.element),u.notes[O.kind].delete(O.id),u.bodyNoteRefs[O.kind].delete(O.id),I.add(`${O.kind}:${O.id}`);}if(I.size>0){for(let R=0;R<y.length;R+=1)y[R]=is(y[R],I,u.noteMarkFallbacks);for(let R of ["footnote","endnote"])for(let[O,C]of u.notes[R])u.notes[R].set(O,C.map(w=>is(w,I,u.noteMarkFallbacks)));}u.nodesLeft=k;for(let R=S;R<g.length&&u.nodesLeft>0;R+=1)Xo(Array.from(g[R].element.childNodes),0,p,u,y);break}u.notes[v.kind].set(v.id,E);}return u.truncated=b||x,u.lastMarkCovered=h,IP(u,l,y,vh),y.length===0?{ok:false,reason:"no-content"}:(GP(y,u.notes),{ok:true,projection:u,blocks:y})}var L5=uP();function bT(e,t){let n=`${t.maxHtmlBytes??""}:${t.maxNodes??""}:${t.maxDepth??""}:${t.maxImageBytes??""}`;return L5(e,n,()=>A5(e,t))}function vT(e,t={}){let n=bT(e,t);return n.ok?{ok:true,fragmentBytes:M5(n.projection,n.blocks),lastMarkCovered:n.projection.lastMarkCovered,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:n}function xT(e,t={}){let n=bT(e,t);return n.ok?{lands:true,imageCount:n.projection.imageCount,truncated:n.projection.truncated}:{lands:false,imageCount:0,truncated:false}}var F5={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:"\xA0"};function ST(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 F5[n.toLowerCase()]??t})}var D5=new Set(["script","style","title","template"]),N5=new Set(["p","div","li","tr","h1","h2","h3","h4","h5","h6","blockquote","section","article","pre","table"]),H5=new Set(["td","th"]),wT=e=>e!==void 0&&(e>="a"&&e<="z"||e>="A"&&e<="Z"),_5=e=>wT(e)||e!==void 0&&e>="0"&&e<="9",kT=e=>e===" "||e===" "||e===`
|
|
6
|
-
`||e==="\r"||e==="\f";function B5(e,t){let n=t+1,r=e[n]==="/";if(r&&(n+=1),!wT(e[n]))return null;let o=n;for(;n<e.length&&_5(e[n]);)n+=1;let i=e.slice(o,n).toLowerCase(),a="",s=false;for(;n<e.length;){let l=e[n];if(a!=="")l===a&&(a="");else if(l==="=")s=true;else if(s&&(l==='"'||l==="'"))a=l,s=false;else {if(l===">")return {name:i,closing:r,end:n+1};kT(l)||(s=false);}n+=1;}return {name:i,closing:r,end:e.length}}function $5(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 W5(e,t,n){for(let r=n;r<e.length;){let o=e.indexOf("</",r);if(o===-1)return e.length;let i=o+2;if(e.slice(i,i+t.length).toLowerCase()===t){for(i+=t.length;i<e.length&&kT(e[i]);)i+=1;if(e[i]===">")return i+1}r=o+2;}return e.length}function*IT(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=B5(e,n);if(r===null){yield "<",t=n+1;continue}t=r.end,!r.closing&&D5.has(r.name)?t=W5(e,r.name,r.end):!r.closing&&r.name==="br"?yield `
|
|
7
|
-
`:r.closing&&H5.has(r.name)?yield " ":r.closing&&N5.has(r.name)&&(yield `
|
|
8
|
-
`);}}function q5(e){let t=e.length>2e6?e.slice(0,2e6):e,n="";for(let r of IT(t))n+=r;return ST(n).replace(/\r\n?/g,`
|
|
9
|
-
`).split(`
|
|
10
|
-
`).map($5).join(`
|
|
11
|
-
`).replace(/\n{3,}/g,`
|
|
12
|
-
|
|
13
|
-
`).trim()}function Vu(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 RT=/[^\s\u200B-\u200F\u2060\u2066-\u2069\u061C\uFEFF\u00AD]/;function PT(e){return RT.test(e)}function xh(e){let t=e.length>2e6?e.slice(0,2e6):e;for(let n of IT(t)){let r=n.includes("&")?ST(n):n;if(RT.test(r))return true}return false}function Sh(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?q5(n):""}function wh(e,t){if(typeof e.getData!="function")return "";try{return e.getData(t)??""}catch{return ""}}function K5(e){if(!e)return false;if(PT(wh(e,"text/plain")))return true;let t=wh(e,"text/html");if(t.length===0)return false;if(xh(t))return true;let n=jo(t);return n!==null&&n.bytes[0]===80&&n.bytes[1]===75?true:xT(t).imageCount>0}function U5(e){return e?xh(wh(e,"text/html")):false}var j5="popup,width=1000,height=900",TT=["class","style","data-theme","data-color-mode","dir","lang"];async function V5(e={}){let t=globalThis.window;if(!t?.open)return null;let n=e.url??"about:blank",r=t.open(n,e.name??"docx-editor",e.features??j5);if(!r)return null;n!=="about:blank"&&await G5(r);let o=r.document;e.title&&(o.title=e.title),o.body.style.margin="0";let i=o.createElement("div");i.style.height="100vh",o.body.append(i);let a=e.styles??true,s=a===false?()=>{}:a===true?CT(t.document,o):a(t.document,o),l=new Set,c=false,d=()=>{if(!c){c=true,r.removeEventListener("pagehide",d),t.removeEventListener("pagehide",u),s();for(let f of [...l])try{f();}catch(p){console.error(p);}l.clear();}},u=()=>{d(),r.close();};return r.addEventListener("pagehide",d),t.addEventListener("pagehide",u),{window:r,element:i,onClose(f){return l.add(f),()=>l.delete(f)},close:u}}function G5(e){return new Promise(t=>{let n=false,r=()=>{n||(n=true,t());};e.addEventListener("load",r,{once:true});try{e.document.readyState==="complete"&&e.location.href!=="about:blank"&&r();}catch{}})}function CT(e,t){let n=new Map,r=y=>{if(n.has(y))return;let h=t.importNode(y,true),b=y.sheet;y.localName==="style"&&b&&!(y.textContent??"").trim()&&(h.textContent=kh(b)),t.head.append(h),n.set(y,h);},o=y=>y.nodeType===1&&(y.localName==="style"||y.localName==="link"&&(y.getAttribute("rel")??"").split(/\s+/).includes("stylesheet"));for(let y of Array.from(e.querySelectorAll('link[rel~="stylesheet"], style')))r(y);let i=t.createElement("style");i.dataset.docxAdopted="",t.head.append(i);let a="",s=()=>{let y=e.adoptedStyleSheets??[],h=y.map(b=>ET(b)).join(",");h!==a&&(a=h,i.textContent=y.map(kh).join(`
|
|
16
|
-
`));};s();let l=()=>{for(let y of TT){let h=e.documentElement.getAttribute(y);h===null?t.documentElement.removeAttribute(y):t.documentElement.setAttribute(y,h);}};l();let c=new Map,d=()=>{for(let[y,h]of n){let b=y.sheet;if(y.localName!=="style"||!b)continue;let x=ET(b);if(c.get(y)===x)continue;let S=!c.has(y);c.set(y,x),S||(h.textContent=kh(b));}s();};d();let u=t.defaultView?.setInterval(d,z5),f=()=>{u!==void 0&&t.defaultView?.clearInterval(u);},p=e.defaultView?.MutationObserver;if(typeof p!="function")return f;let g=new p(y=>{for(let h of y){if(h.type==="attributes"){l();continue}for(let x of Array.from(h.addedNodes))if(o(x))r(x);else if(x.nodeType===1)for(let S of Array.from(x.querySelectorAll("style, link")))o(S)&&r(S);for(let x of Array.from(h.removedNodes)){let S=n.get(x);S&&(n.delete(x),S.parentNode?.removeChild(S));}let b=h.target;if(h.type==="characterData"||b.localName==="style"&&n.has(b)){let x=h.type==="characterData"?h.target.parentNode:b,S=x&&n.get(x);S&&(S.textContent=x.textContent);}}});return g.observe(e.head,{childList:true,subtree:true,characterData:true}),g.observe(e.documentElement,{attributes:true,attributeFilter:TT}),()=>{g.disconnect(),f();}}var z5=250;function ET(e){try{return e.cssRules.length}catch{return -1}}function kh(e){try{return Array.from(e.cssRules,t=>t.cssText).join(`
|
|
17
|
-
`)}catch{return ""}}function Z5(e,t,n,r){let o=e.top-n-r;return t!==void 0&&o<t?e.bottom+r:o}var OT=new WeakMap;function Jl(e){let t=OT.get(e);if(t)return t;let n=[],r=e.contentBox;for(let i of [e.header,e.footer]){if(!i)continue;let a=(s,l)=>{!s.textboxStory||s.accessibility.hidden||n.push(Object.freeze({drawing:s,kind:i.kind,...i.rId!==void 0?{rId:i.rId}:{},origin:Object.freeze({x:l.x-r.x,y:l.y-r.y})}));};for(let s of i.anchoredDrawings??[])a(s,Ja(s,i.box,e.box));for(let s of La(i.fragments,true))for(let l of s.lines)for(let c of l.drawings??[])a(c,{x:i.box.x+c.x,y:i.box.y+c.y});}let o=Object.freeze(n);return OT.set(e,o),o}function X5(e,t){let n=fb$1(e,t),r=n&&fb$1(e,n.id);if(!r)return false;let o=Ud(r.children,{namespaceUri:ma$3,localName:"spPr"}),i=o&&Ud(o.children,{namespaceUri:va,localName:"xfrm"}),a=Ud(r.children,{namespaceUri:ma$3,localName:"bodyPr"}),s=i&&oa$2(i.attributes,"rot"),l=a&&oa$2(a.attributes,"rot"),c=a&&oa$2(a.attributes,"vert");return !!s&&Number(s)!==0||!!l&&Number(l)!==0||!!c&&c!=="horz"}function Gu(e,t,n){let r=n.textboxStory;return !!r&&!X5(e,t)&&n.transform.rotationDegrees===0&&r.contentRotation===void 0&&r.fragments.length>0&&r.fragments.every(o=>o.kind==="paragraph")}function MT(e,t,n){if(!t.owner)return Ge(e,t.drawingNodeId);let r=e.pages[n],o=r?.index===n?[r,...e.pages]:e.pages;for(let i of o){let a=Jl(i).find(d=>d.drawing.drawingNodeId===t.drawingNodeId);if(!a)continue;let{drawing:s,origin:l}=a,c=s.paintBounds;return c.width<=0||c.height<=0?null:Object.freeze({pageIndex:i.index,x:l.x+c.x-s.x,y:l.y+c.y-s.y,width:c.width,height:c.height,record:s})}return null}function AT(e,t){if(!e.textboxStory)return {};let n=ck(t).find(r=>r.drawingNodeId===e.drawingNodeId);return {textEditable:!!n&&Gu(t,n.root.id,e)}}function Y5(e,t){return !e.textbox||t==="view"?null:e.textEditable===false?"imageOverlay.textLocked":!e.canMove&&!e.canResize?"imageOverlay.locked":null}var Q5=Object.freeze({kind:"body"});function de(e,t){if(t===void 0)return null;let n=t.indexOf("#");return n===-1?e.storyParts?.().find(r=>eb$1(r,t)!==null)??null:n===0?null:e.currentPackage().parts.get(t.slice(0,n))??null}function zu(e,t,n){let r=t.indexOf("#"),o=n.indexOf("#");if(r>0&&o>0)return r===o&&t.startsWith(n.slice(0,o+1));let i=de(e,t);return i!==null&&i.name===de(e,n)?.name}function Et(e,t,n){let r=t?.indexOf("#")??-1,o=r===-1?de(e,t)?.name??"":t.slice(0,r);return Ih(e,o,n)}function Ih(e,t,n){if(t.length===0||t===e.part().name)return {kind:"body"};for(let r of e.headerFooterResolutionBySection())for(let o of [r.headers,r.footers])for(let i of o.values())if(i.partName===t)return {kind:"headerFooter",rId:i.rId};for(let r of ["footnote","endnote"])if(e.partFor({kind:"notesPart",noteKind:r})?.name===t)return {kind:"notesPart",noteKind:r};return n}function Zu(e,t){if(e)return {kind:"headerFooter",rId:e.scope.rId};if(t){let n=Ic$1(t.id);if(n)return {kind:"notesPart",noteKind:n.noteKind}}return {kind:"body"}}function FT(e,t){return e?e.scope:t||Q5}function J5(e,t,n){if(n){let o=[];for(let i of [e.footnotes,e.endnotes])if(i)for(let a of i.notes)a.scopeId===n&&o.push(...LT(a.fragments));return o}if(!t)return Ka$1(e);let r=as(e,t);return r?LT(r.fragments):[]}function as(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 DT(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 Xu(e,t){return !!(e.rId&&e.rId===t.scope.rId||!e.rId&&e.partName===t.partName&&e.kind===t.kind)}function Yu(e,t,n){let r=we(e,t.y),o=e.pages[r];if(!o)return false;let i=t.x-n(r),a=t.y,s=o.contentBox;return i>=s.x&&i<s.x+s.width&&a>=s.y&&a<s.y+s.height}function Rh(e,t,n,r,o={}){return Ae$1(e,t,n.fragments,r,o)}function e4(e,t,n){let r=e.pages[t.pageIndex]??e.pages[0];if(!r)return null;let o=as(r,t);return o?Re$1(e,t.pageIndex,o.fragments,n):null}function t4(e,t,n){let r=[];for(let o of e.pages)for(let i of [o.footnotes,o.endnotes]){let a=i?.notes.find(s=>s.scopeId===t);a&&r.push(...Re$1(e,o.index,a.fragments,n));}return r.length>0?r:null}function NT(e,t){return e.querySelector(`[data-page-index="${t}"] > [data-docx-hf-active]`)??e.querySelector("[data-docx-hf-active]")}function HT(e,t,n){let r=e.querySelectorAll("[data-docx-note-scope]"),o=null;for(let i of r){if(i.dataset.docxNoteScope!==t||!i.matches("[data-docx-note]"))continue;o??=i;let a=Number(i.closest("[data-page-index]")?.dataset.pageIndex);if(n!==null&&a===n)return i}return o}function _T(e,t,n){if((i=>{let a=e.pages[i];return !!a&&!!as(a,t)})(t.pageIndex)&&(n===void 0||n.has(t.pageIndex)))return t.pageIndex;let o=null;for(let i of e.pages)if(as(i,t)&&(o===null&&(o=i.index),n===void 0||n.has(i.index)))return i.index;return o??t.pageIndex}function BT(e){return e?{rId:e.scope.rId,pageIndex:e.pageIndex,kind:e.kind,partName:e.partName,variant:e.variant}:null}function $T(e,t,n){e.classList.toggle("docx-paginated-surface--hf-editing",n),t.classList.toggle("docx-pages--hf-editing",n);}function Ph(e,t){e.classList.toggle("docx-paginated-surface--viewing",t==="view");}function Th(e,t,n,r,o,i,a,s){let l=o?e4(e,o,a):i?t4(e,i,a):null,c=We(e,t,n,r,{...a?{measurer:a}:{},...l?{stops:l}:{},...s!==void 0?{lineId:s}:{}});if(!c)return null;let u=(l?.find(p=>p.position.paragraphId===c.position.paragraphId&&p.position.offset===c.position.offset&&(c.lineId===void 0||p.lineId===c.lineId))??l?.find(p=>p.position.paragraphId===c.position.paragraphId&&p.position.offset===c.position.offset))?.pageIndex,f=c.lineId===void 0?null:Se(e,c.position,{...a?{measurer:a}:{},...u!==void 0?{preferredPageIndex:u}:{},preferredLineId:c.lineId});return {position:c.position,desiredX:c.desiredX,...u!==void 0?{pageIndex:u}:{},...f?{caret:f}:{}}}function Qu(e,t,n){for(let r of e.pages){let o=n(r.index);for(let i of [r.footnotes,r.endnotes])if(i)for(let a of i.notes){let s=a.box,l=s.x+o,c=s.y;if(t.x>=l&&t.x<l+s.width&&t.y>=c&&t.y<c+s.height)return {pageIndex:r.index,scopeId:a.scopeId,noteKind:a.noteKind,noteId:a.noteId,local:{x:t.x-l,y:t.y-c},fragments:a.fragments}}}return null}function WT(e,t){let n=e[t],r=e.contentBox,o=e.box;if(t==="header"){let c=o.y,d=r.y,u=n?Math.max(d,n.box.y+n.box.height):d,f=n?Math.min(c,n.box.y):c;return u<=f?null:{x:r.x,y:f,width:r.width,height:u-f}}let i=r.y+r.height,a=o.y+o.height,s=n?Math.min(i,n.box.y):i,l=n?Math.max(a,n.box.y+n.box.height):a;return l<=s?null:{x:r.x,y:s,width:r.width,height:l-s}}function Eh(e,t,n){for(let r of e.pages){if(r.parityBlank)continue;let o=n(r.index);for(let i of ["header","footer"]){if(r[i])continue;let a=WT(r,i);if(!a)continue;let s=a.x+o;if(t.x>=s&&t.x<s+a.width&&t.y>=a.y&&t.y<a.y+a.height)return {pageIndex:r.index,kind:i}}}return null}function Ch(e,t,n){for(let r of e.pages){let o=n(r.index);for(let i of ["header","footer"]){let a=r[i];if(!a)continue;let s=a.box,l=WT(r,i)??s,c=l.x+o,d=l.y;if(t.x>=c&&t.x<c+l.width&&t.y>=d&&t.y<d+l.height)return {pageIndex:r.index,kind:i,story:a,local:{x:t.x-(s.x+o),y:t.y-s.y}}}}return null}function qT(e,t,n,r,o,i){let a=e.pages[t.pageIndex];if(!a)return false;let s=a.contentBox,l=n.x-r(a.index)-s.x,c=n.y-s.y;if(l<0||l>=s.width||c<0||c>=s.height)return false;let d=i?{measurer:i}:{},{story:u,local:f}=t,p=ye$1(u.anchoredDrawings,f,a.index)!==null||Ae$1(e,a.index,u.fragments,f,d)?.onGlyphs===true;if(o&&p)return false;let g=ze(e,a.index,{x:l,y:c},d),y=Qu(e,n,r),h=g?.onGlyphs===true&&g.pageIndex===a.index||y?.pageIndex===a.index&&Ae$1(e,a.index,y.fragments,y.local,d)?.onGlyphs===true;return o?h:h||!p}function ss(e,t,n){if(!t&&!n)return eb$2(e);let r=new Set,o=[];for(let i of e.pages)for(let a of J5(i,t,n)){for(let s of a.lines)for(let l of _a(s))r.has(l.paragraphId)||(r.add(l.paragraphId),o.push(l.paragraphId));a.lines.length===0&&!r.has(a.paragraphId)&&(r.add(a.paragraphId),o.push(a.paragraphId));}return o}function Ju(e,t,n,r){let o=ss(e,n,r);if(o.length===0)return t;let i=new Set(o),a=s=>i.has(s.paragraphId)?s:{paragraphId:o[0],offset:0};return {anchor:a(t.anchor),head:a(t.head)}}function LT(e){let t=[],n=r=>{for(let o of r){if(o.kind==="paragraph"){t.push(o);continue}for(let i of o.rows)if(!i.isHeaderRepeat)for(let a of i.cells)n(a.blocks);}};return n(e),t}function KT(e,t){for(let n of e.pages)for(let r of [n.footnotes,n.endnotes])if(r){for(let o of r.notes)for(let i of La(o.fragments))if(i.paragraphId===t)return o.scopeId}return null}function UT(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 n4(e){try{return typeof caches>"u"?Promise.resolve(null):caches.open(e).catch(()=>null)}catch{return Promise.resolve(null)}}async function r4(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 o4(e,t,n){if(e)try{await e.put(t,new Response(n.slice(),{headers:{"Content-Length":String(n.byteLength)}}));}catch{}}async function i4(e,t){if(e)try{await e.delete(t);}catch{}}async function Oh(e){let t=()=>{if(e.signal?.aborted)throw e.signal.reason};t();let n=e.fetcher??fetch,r=e.maxFontBytes??a$1,o=await n4(e.cacheName??"docx-editor-fonts");t();async function i(c){t();let d=Object.freeze({family:c.family,weight:c.weight,style:c.style}),u=UT(d);if(u)return {failure:{url:c.url,request:d,reason:"invalidRequest",diagnostic:u}};let f$1=(b,x)=>{if(b.byteLength===0)return {url:c.url,request:d,reason:"emptyResponse"};if(b.byteLength>r)return {url:c.url,request:d,reason:"overLimit"};let S=l(b,c.faceIndex??0);if(!S.valid)return {url:c.url,request:d,reason:"malformed",diagnostic:S.diagnostic};let v=f(b);return c.hash!==void 0&&c.hash!==v?{url:c.url,request:d,reason:"hashMismatch",expectedHash:c.hash,actualHash:v,...x?{diagnostic:"cached bytes failed revalidation"}:{}}:{request:d,id:`url:${c.url}`,bytes:b,hash:v,faceIndex:c.faceIndex??0}},p=await r4(o,c.url);if(t(),p){let b=f$1(p,true);if(!("reason"in b))return {source:b};await i4(o,c.url),t();}let g;try{g=e.signal?await n(c.url,{signal:e.signal}):await n(c.url),t();}catch(b){return t(),{failure:{url:c.url,request:d,reason:"networkError",diagnostic:b instanceof Error?b.message:String(b)}}}if(!g.ok)return {failure:{url:c.url,request:d,reason:"httpError",status:g.status}};let y;try{y=new Uint8Array(await g.arrayBuffer()),t();}catch(b){return t(),{failure:{url:c.url,request:d,reason:"networkError",diagnostic:b instanceof Error?b.message:String(b)}}}let h=f$1(y,false);return "reason"in h?{failure:h}:(await o4(o,c.url,y),t(),{source:h})}let a=await Promise.all(e.sources.map(c=>i(c)));t();let s=[],l$1=[];for(let c of a)"source"in c?s.push(c.source):l$1.push(c.failure);return {sources:s,failures:l$1}}function a4(e,t,n={}){let r=Object.freeze({family:t.family,weight:t.weight,style:t.style}),o=n.id??`bytes:${r.family}#${r.weight}#${r.style}`,i=UT(r);if(i)return {failure:{url:o,request:r,reason:"invalidRequest",diagnostic:i}};if(e.byteLength===0)return {failure:{url:o,request:r,reason:"emptyResponse"}};if(e.byteLength>(n.maxFontBytes??a$1))return {failure:{url:o,request:r,reason:"overLimit"}};let a=t.faceIndex??0,s=l(e,a);return s.valid?{source:{request:r,id:o,bytes:e,hash:f(e),faceIndex:a}}:{failure:{url:o,request:r,reason:"malformed",diagnostic:s.diagnostic}}}var s4=e=>e.trim().toLowerCase(),jT=e=>JSON.stringify([s4(e.family),e.weight,e.style]);function l4(e){return o(async t=>{if(t.signal?.aborted)throw t.signal.reason;let n=new Set((t.resolvedFaces??[]).map(jT)),r=e.sources.filter(s=>!n.has(jT(s)));if(r.length===0)return {sources:[],failures:[]};let{onFailure:o,...i}=e,a=await Oh({...i,sources:r,signal:t.signal});if(t.signal?.aborted)throw t.signal.reason;for(let s of a.failures)o?o(s):console.warn(`[fonts] ${s.request.family} (${s.url}): ${s.reason}`);return a})}var c4=96,VT=37.79527559055118;function d4(e,t){if(!Number.isFinite(e)||e<=0)return [];let n=[];if(t==="inch"){let a=Math.floor(e/12);for(let s=0;s<=a;s+=1){let l=s*12;if(s%8===0){let c=s/8;n.push({position:l,height:10,...c>0?{label:String(c)}:{}});}else s%4===0?n.push({position:l,height:6}):s%2===0?n.push({position:l,height:4}):n.push({position:l,height:2});}return n}let r=VT/10,o=Math.floor(e/r);for(let i=0;i<=o;i+=1){let a=i*r;if(i%10===0){let s=i/10;n.push({position:a,height:10,...s>0?{label:String(s)}:{}});}else i%5===0?n.push({position:a,height:6}):n.push({position:a,height:3});}return n}function u4(e){let t=[...e].sort((n,r)=>n.index-r.index)[0];return t?t.box:null}var f4=1440,p4=567,m4=180,g4=56.7,GT=e=>({pageWidth:e.pageWidth,leftMargin:e.rightMargin,rightMargin:e.leftMargin}),ef=(e,t,n)=>n<t||e<t?t:e>n?n:e;function zT(e,t,n){if(t.rtl)return n.pageWidth-zT(e,{...t,rtl:false},GT(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 ZT(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 XT(e,t,n,r,o={}){if(n.rtl)return {...XT(e,r.pageWidth-t,{...n,rtl:false},GT(r),o),rtl:true};let i=ZT(t,o.unit??"inch",o.precise??false),a=r.pageWidth-r.rightMargin-n.right,s=r.leftMargin+n.left+Math.max(0,n.firstLine);switch(e){case "firstLine":{let l=ef(i,0,a);return {...n,firstLine:l-r.leftMargin-n.left}}case "left":{let l=-r.leftMargin-Math.min(0,n.firstLine),c=a-r.leftMargin-Math.max(0,n.firstLine);return {...n,left:ef(i-r.leftMargin,l,c)}}case "hanging":{let l=ef(i-r.leftMargin,-r.leftMargin,a-r.leftMargin);return {...n,left:l,firstLine:n.firstLine+(n.left-l)}}case "right":{let l=ef(i,s,r.pageWidth);return {...n,right:r.pageWidth-r.rightMargin-l}}}}function h4(e,t,n){return n.rtl?t.pageWidth-t.rightMargin-e:t.leftMargin+e}function y4(e,t,n){if(!Number.isFinite(e.pageWidth)||e.pageWidth<=0)return [];let r=t.rtl?e.pageWidth-e.rightMargin:e.leftMargin,o=n==="inch"?8:10,i=(n==="inch"?1440:567)/o,a=[],s=-Math.floor(r/i),l=Math.floor((e.pageWidth-r)/i);for(let c=s;c<=l;c+=1){let d=r+c*i,u=Math.abs(c)%o;if(u===0){let f=Math.abs(c)/o,p=f>0&&d>0&&d<e.pageWidth;a.push({position:d,height:8,...p?{label:String(f)}:{}});}else u===o/2?a.push({position:d,height:5}):n==="cm"||u%2===0?a.push({position:d,height:3}):a.push({position:d,height:2});}return a}function YT(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 b4(e){if(!(!e||typeof e!="object"||"preventDefault"in e))return e}var QT="no formatting has been copied",tf="there is nothing at the selection to copy",Mh="the selection has nothing to paint",nf=Object.freeze({mode:"off",level:"none"});function JT(e,t){let n=Math.round(t*12700),r=1143e3,o=`<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:body><w:p><w:r>
|
|
18
|
-
<w:drawing xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape">
|
|
19
|
-
<wp:anchor distT="0" distB="0" distL="91440" distR="91440" simplePos="0" relativeHeight="251658240" behindDoc="0" locked="0" layoutInCell="1" allowOverlap="1">
|
|
20
|
-
<wp:simplePos x="0" y="0"/><wp:positionH relativeFrom="column"><wp:posOffset>0</wp:posOffset></wp:positionH><wp:positionV relativeFrom="paragraph"><wp:posOffset>0</wp:posOffset></wp:positionV>
|
|
21
|
-
<wp:extent cx="${n}" cy="${r}"/><wp:effectExtent l="0" t="0" r="0" b="0"/><wp:wrapNone/><wp:docPr id="${e}" name="Text Box ${e}"/><wp:cNvGraphicFramePr/>
|
|
22
|
-
<a:graphic><a:graphicData uri="http://schemas.microsoft.com/office/word/2010/wordprocessingShape"><wps:wsp><wps:cNvSpPr txBox="1"/><wps:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${n}" cy="${r}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom><a:solidFill><a:srgbClr val="FFFFFF"/></a:solidFill><a:ln w="12700"><a:solidFill><a:srgbClr val="000000"/></a:solidFill></a:ln></wps:spPr><wps:txbx><w:txbxContent><w:p/></w:txbxContent></wps:txbx><wps:bodyPr lIns="91440" rIns="91440" tIns="45720" bIns="45720" anchor="t"><a:noAutofit/></wps:bodyPr></wps:wsp></a:graphicData></a:graphic>
|
|
23
|
-
</wp:anchor></w:drawing></w:r></w:p></w:body></w:document>`,i=Pa(o,{name:"/word/document.xml",contentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"});if(!i.ok)throw new Error("Cannot build textbox drawing");let a=l=>{if(l.kind==="drawing")return l;if(l.kind==="textValue")return null;for(let c of l.children){let d=a(c);if(d)return d}return null},s=a(i.part.root);if(!s)throw new Error("Textbox drawing is missing");return s}function Ah(e){let t=e.activeScope();if(e.editingMode()!=="edit"||t.kind!=="body"&&t.kind!=="frame")return {ok:false,code:"unsupported",reason:"Textboxes can only be inserted in body editing mode"};let n=t.kind==="frame"?t.hostParagraphId:e.state().selection.head.paragraphId;return e.layout().pages.some(r=>r.fragments.some(o=>o.kind==="paragraph"&&o.paragraphId===n))?null:{ok:false,code:"unsupported",reason:"Select a body paragraph outside a table to insert a textbox"}}function eE(e){let t=Ah(e);if(t)return t;let n=e.activeScope(),r=n.kind==="frame"?n.hostParagraphId:e.state().selection.head.paragraphId,o=e.session.part(),i=eb$1(o,r);if(!i||i.kind!=="paragraph")return {ok:false,code:"notFound",reason:"Textbox anchor is missing"};let a=$f$1(e.session.currentPackage(),e.collaborationSession()?.identity.actorId);if(!a.ok)return {ok:false,code:"invalidArgs",reason:"Cannot allocate textbox identity"};let s=new Set(ck(o).map(p=>p.root.id)),l=e.layout().pages.flatMap(p=>p.fragments).find(p=>p.kind==="paragraph"&&p.paragraphId===r),c=Math.min(300,l?.box.width??300);n.kind==="frame"&&e.setActiveScope({kind:"body"});let d=Hi(i);e.setSelection({anchor:{paragraphId:r,offset:d},head:{paragraphId:r,offset:d}});let u=e.applyDrawingOps([{op:"insertDrawing",paragraphId:r,offset:d,drawing:JT(a.id,c)}]);if(u.rejected)return {ok:false,code:"invalidArgs",reason:u.reason??"Textbox insertion was refused"};let f=ck(e.session.part()).find(p=>!s.has(p.root.id));return f&&e.setActiveScope({kind:"frame",id:f.root.id,drawingNodeId:f.drawingNodeId,hostParagraphId:f.hostParagraphId}),e.focus(),{ok:true,changed:u.committed}}var Lh=new WeakMap;function Po(e){let t=Lh.get(e);if(t)return t;let n=Ch$1(e);if(n.length===0)return Lh.set(e,[]),[];let r=[];for(let o of n){let i=Bh$1(o);for(let a of new Set([o.beginParagraphId,...o.resultParagraphIds,o.endParagraphId])){let s=eb$1(e,a);if(s?.kind!=="paragraph")continue;let l=Fi(s),c=a===o.beginParagraphId,d=a===o.endParagraphId;r.push({toc:o,paragraphId:a,length:l.length,startsHere:c,endsHere:d,start:c?l.spanOf(o.beginNodeId)?.start??0:0,end:d&&i?l.spanOf(i.endNodeId)?.end??l.length:l.length});}}return Lh.set(e,r),r}function rf(e){return new Set(Po(e).filter(t=>t.start===0&&t.end===t.length&&!(t.endsHere&&!t.startsHere&&t.end===0)).map(t=>t.paragraphId))}function Fh(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 ar(e,t){return Po(e).find(n=>n.paragraphId===t.paragraphId&&Fh(n,t.offset))?.toc}function tE(e,t){let{anchor:n,head:r}=t;if(n.paragraphId===r.paragraphId){let o=Math.min(n.offset,r.offset),i=Math.max(n.offset,r.offset);return Po(e).some(a=>a.paragraphId===n.paragraphId&&(o===i?Fh(a,o):o<a.end&&i>a.start))}return ar(e,n)!==void 0||ar(e,r)!==void 0}function nE(e,t){let n=Po(e);if(n.length===0)return false;let r=rm(t);if(r.kind==="nodes")return r.targets.some(a=>n.some(s=>{if(a.nodeId!==s.paragraphId)return false;if(a.range){let{start:l,end:c}=a.range;return l===c?Fh(s,l):l<s.end&&c>s.start}return t.op==="joinParagraphs"&&t.firstId===s.paragraphId&&s.endsHere&&s.end===0?false:a.removes||a.structural?true:s.end>s.start||s.length===0&&!s.endsHere}));let o=new Set(n.map(a=>a.paragraphId)),i=(a,s="")=>typeof a=="string"?/(?:Id|Ids)$/.test(s)&&o.has(a):Array.isArray(a)?a.some(l=>i(l,s)):!!a&&typeof a=="object"&&Object.entries(a).some(([l,c])=>i(c,l));return i(t)}function rE(e,t,n){let r=ar(e,t);if(!r)return null;let o=Po(e).find(i=>i.toc.id===r.id&&(n?i.startsHere&&i.start>0:i.endsHere&&i.end<i.length));return o?{paragraphId:o.paragraphId,offset:n?o.start:o.end}:null}function oE(e,t){return !Po(t).some(r=>r.toc.id===e.id&&(r.start>0||r.end<r.length))&&e.contentControlId?e.contentControlId:`toc:${e.id}`}function iE(e,t,n){if(!t)return;let r=n?.closest("[data-start]");return Po(e).find(o=>o.paragraphId===t&&(r?Number(r.dataset.start)<o.end&&Number(r.dataset.end)>o.start:rf(e).has(t)))?.toc}function aE(e,t){return Ch$1(e).some(n=>n.beginParagraphId===t||n.endParagraphId===t||n.resultParagraphIds.includes(t))}var lE="suggesting cannot merge or split cells; stop suggesting to change the table structure",v4="select two or more cells that form a rectangle to merge them",x4="select two or more cells to merge them";function cE(e){switch(e){case "cells-not-rectangle":return {code:"invalidArgs",reason:v4};case "split-rows-not-divisor":return {code:"invalidArgs",reason:"a merged cell splits only into a number of rows that divides its rows"};case "split-needs-grid":return {code:"invalidArgs",reason:"this table has no column grid, so the cell splits only into a divisor of its columns"};case "cell-too-narrow":return {code:"invalidArgs",reason:"the cell is too narrow to split into that many columns"};case "cell-has-revision":return {code:"unsupported",reason:"the cells have a tracked change; accept or reject it first"};default:return null}}function sE(e){return typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=Tm}function dE(e){return sE(e.rows)&&sE(e.cols)&&e.rows*e.cols>=2?null:`splitCell rows and cols must be whole numbers from 1 to ${Tm}, and not both 1`}function of(e){let t=e.author()?.trim();return e.editingMode()==="suggest"&&t?{suggestingAuthor:t}:{}}function uE(e,t,n){return !n||t.op!=="mergeTableCells"&&t.op!=="splitTableCell"?t:Zm(e.root,t.tableId,n)?{...t,revision:{author:n}}:t}function fE(e,t,n){return e.type==="mergeCells"?!n||t.cellIds.length<2?{ok:false,code:"invalidArgs",reason:x4}:{ok:true,op:{op:"mergeTableCells",tableId:t.tableId,cellIds:t.cellIds}}:t.cellIds.length>1?{ok:false,code:"invalidArgs",reason:"select one cell to split it"}:{ok:true,op:{op:"splitTableCell",tableId:t.tableId,cellId:t.cellId,rows:e.rows,columns:e.cols}}}function pE(e,t,n){let r=Um(e,t.tableId);if(!r.ok)return null;let o=null;for(let i of t.cellIds){let a=r.table.index.byId.get(i);if(!a)continue;let s=Vm(r.table,a),l=n==="above"?s.rowFrom:s.rowTo;o=o===null?l:n==="above"?Math.min(o,l):Math.max(o,l);}return o===null?null:r.table.topology.rows[o]?.row.id??null}function mE(e,t,n){let r=Um(e,t.tableId);if(!r.ok)return null;let o=null;for(let i of t.cellIds){let a=r.table.index.byId.get(i);if(!a)continue;let s=Vm(r.table,a),l=n==="left"?s.colFrom:s.colTo;o=o===null?l:n==="left"?Math.min(o,l):Math.max(o,l);}return o===null?null:r.table.topology.gridColumns[o]?.id??null}var ec=/^[0-9A-Fa-f]{6}$/,gE={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"},S4={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 Dh(e){return typeof e=="number"&&Number.isFinite(e)&&e>0&&e<=1}function af(e){return Math.max(0,Math.min(1,e))}function hE(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 yE(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 bE(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "FFFFFF";let r=Math.max(0,Math.min(255,Math.round((1-af(t))*255)))/255,o=hE(e);return yE(r*255+(1-r)*o.r,r*255+(1-r)*o.g,r*255+(1-r)*o.b)}function vE(e,t){if(t>=1)return e.toUpperCase();if(t<=0)return "000000";let r=Math.max(0,Math.min(255,Math.round(af(t)*255)))/255,o=hE(e);return yE(r*o.r,r*o.g,r*o.b)}function Nh(e){return gE[e]??gE[e.toLowerCase()]??null}function w4(e,t){let n=Nh(e);if(!n)return null;let r=t.find(i=>i.slot===n)?.hex;if(r&&ec.test(r))return r.toUpperCase();let o=S4[n];return o&&ec.test(o)?o.toUpperCase():null}function sf(e,t){let n=w4(e.slot,t);if(!n)return {ok:false,reason:"the theme colour could not be resolved for this document"};if(e.tint!==void 0&&!Dh(e.tint))return {ok:false,reason:"theme tint is out of range"};if(e.shade!==void 0&&!Dh(e.shade))return {ok:false,reason:"theme shade is out of range"};let r=n;return e.tint!==void 0?r=bE(r,af(e.tint)):e.shade!==void 0&&(r=vE(r,af(e.shade))),{ok:true,hex:r}}var k4="000000";function Hh(e,t){if(e.kind==="hex"){let o=e.value.toUpperCase();return ec.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:k4}};let n=sf(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:Nh(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function _h(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 ec.test(o)?{ok:true,color:{kind:"hex",value:o}}:{ok:false,reason:"fill colour requires a six-digit hex value"}}let n=sf(e,t);return n.ok?{ok:true,color:{kind:"theme",slot:Nh(e.slot)??e.slot,resolvedHex:n.hex,...e.tint!==void 0?{tint:e.tint}:{},...e.shade!==void 0?{shade:e.shade}:{}}}:n}function I4(e,t,n="000000"){if(!e||e.kind==="auto")return `#${n}`;if(e.kind==="hex"){let o=e.value.replace(/^#/,"").toUpperCase();return ec.test(o)?`#${o}`:`#${n}`}let r=sf(e,t);return `#${r.ok?r.hex:n}`}function xE(e,t){if(t.region!=="table")return {ok:false,code:"unsupported",reason:`selecting a table ${t.region} is not supported yet`};let n=e.cellSelection?.tableId??qa(e.layout,e.selection.head.paragraphId)?.tableId,r=n===void 0?null:ja(e.layout,n);return r?{ok:true,ops:[],selection:{kind:"selectCells",cells:r}}:{ok:false,code:"unsupported",reason:"the selection is not inside a table"}}function SE(e,t,n){return n==="suggest"||!t||!ka(e,t)?null:{ok:true,ops:[{op:"deleteBlock",blockId:t.tableId}],selection:{kind:"adoptCommittedCaret"}}}function Bh(e,t){return Ff$2(e).occurrences.some(n=>n.table.tableId===t&&n.row.cells.some(r=>r.logicalGridColumn!==void 0))}function wE(e,t){return t?e==="left"?"right":e==="right"?"left":e:e}var E4=new Set(["insertRow","deleteRow","insertColumn","deleteColumn","deleteTable","setCellFill","setTableCellVerticalAlignment","setTableBorders","commitTableColumnDividerResize","commitTableRightEdgeResize","mergeCells","splitCell","toggleHeaderRow","selectTableRegion","setTableProperties"]);function Yo(e){return E4.has(e.type)}function ye(e,t){return {ok:false,code:e,reason:t}}function $h(e,t){let n=cE(e);if(n)return ye(n.code,n.reason);switch(e){case "unknown-table":case "unknown-row":case "unknown-grid-column":return ye("invalidArgs","the table target is no longer valid");case "table-has-merge":return ye("unsupported","this table uses a legacy horizontal merge the editor cannot change");case "row-hides-cell":case "tree-invariant":return ye("unsupported","this table has a cell the editor cannot place in the grid");case "block-required":return ye("unsupported","the table must keep at least one row or column");case "resource-limit":return ye("unsupported","the table has reached the supported size limit");case "invalidArgs":case "invalid-property-value":case "unsupported-property":return ye("invalidArgs","the table command arguments are invalid");default:return ye("unsupported",`the table operation was refused (${e})`)}}function rn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Un(e,t){return !rn(e)||Object.keys(e).length!==t.length?false:t.every(r=>Object.prototype.hasOwnProperty.call(e,r))}function PE(e){if(!rn(e))return false;let t=e.kind;if(t==="hex")return Un(e,["kind","value"])&&typeof e.value=="string";if(t==="auto")return Un(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 Un(e,n)}return false}function TE(e){return rn(e)&&Un(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 EE(e){return rn(e)&&Un(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 C4(e){return rn(e)&&Un(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 O4(e){return rn(e)&&Un(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 M4(e){return !rn(e)||!Un(e,["style","size","color"])?false:typeof e.style=="string"&&typeof e.size=="number"&&Number.isInteger(e.size)&&PE(e.color)}function kE(e){return !("target"in e)||e.target===void 0||TE(e.target)}function IE(e){return !("target"in e)||e.target===void 0||EE(e.target)}function A4(e){switch(e.type){case "splitCell":{let t=dE(e);return t?ye("invalidArgs",t):null}case "insertRow":return !rn(e)||e.type!=="insertRow"?ye("invalidArgs","insertRow command shape is invalid"):e.where!=="above"&&e.where!=="below"?ye("invalidArgs","insertRow where must be above or below"):kE(e)?null:ye("invalidArgs","insertRow target shape is invalid");case "deleteRow":return !rn(e)||e.type!=="deleteRow"?ye("invalidArgs","deleteRow command shape is invalid"):kE(e)?null:ye("invalidArgs","deleteRow target shape is invalid");case "insertColumn":return !rn(e)||e.type!=="insertColumn"?ye("invalidArgs","insertColumn command shape is invalid"):e.where!=="left"&&e.where!=="right"?ye("invalidArgs","insertColumn where must be left or right"):IE(e)?null:ye("invalidArgs","insertColumn target shape is invalid");case "deleteColumn":return !rn(e)||e.type!=="deleteColumn"?ye("invalidArgs","deleteColumn command shape is invalid"):IE(e)?null:ye("invalidArgs","deleteColumn target shape is invalid");case "deleteTable":return !rn(e)||!Un(e,["type"])?ye("invalidArgs","deleteTable command shape is invalid"):null;case "setCellFill":return !rn(e)||!Un(e,["type","color"])?ye("invalidArgs","setCellFill command shape is invalid"):e.color!==null&&!PE(e.color)?ye("invalidArgs","setCellFill color shape is invalid"):null;case "setTableCellVerticalAlignment":return !rn(e)||!Un(e,["type","alignment"])||!["top","center","bottom"].includes(e.alignment)?ye("invalidArgs","cell vertical alignment command shape is invalid"):null;case "setTableBorders":return !rn(e)||e.type!=="setTableBorders"?ye("invalidArgs","setTableBorders command shape is invalid"):e.scope==="none"?typeof e.target!="string"?ye("invalidArgs","border none scope requires a target edge"):null:!("spec"in e)||!M4(e.spec)?ye("invalidArgs","concrete border scopes require a complete spec"):null;case "commitTableColumnDividerResize":return !rn(e)||!Un(e,["type","target","leftWidthTwips","rightWidthTwips"])||!C4(e.target)||typeof e.leftWidthTwips!="number"||typeof e.rightWidthTwips!="number"?ye("invalidArgs","column divider resize command shape is invalid"):null;case "commitTableRightEdgeResize":return !rn(e)||!Un(e,["type","target","columnWidthTwips","tableWidthTwips"])||!O4(e.target)||typeof e.columnWidthTwips!="number"||typeof e.tableWidthTwips!="number"?ye("invalidArgs","right-edge resize command shape is invalid"):null;default:return null}}function L4(e){return !("target"in e)||e.target===void 0?null:TE(e.target)?e.target:null}function F4(e){return !("target"in e)||e.target===void 0?null:EE(e.target)?e.target:null}function D4(e,t){let n=Qm(e.root,t.tableId);if(!n.ok)return {rowIds:[t.rowId],wholeTable:false};let r=new Set(t.cellIds),o=n.topology.rows.filter(i=>i.cells.some(a=>r.has(a.id))).map(i=>i.row.id);return o.length===0?{rowIds:[t.rowId],wholeTable:false}:{rowIds:o,wholeTable:o.length===n.topology.rows.length}}function N4(e,t){let n=Qm(e.root,t.tableId);if(!n.ok||!n.topology.grid)return {gridColumnIds:[],wholeTable:false};let r=new Set(t.cellIds),o=new Set;for(let i of n.topology.rows){let a=0;for(let s of i.cells){let l=CE(s);if(r.has(s.id))for(let c=0;c<l;c+=1){let d=n.topology.gridColumns[a+c];d&&o.add(d.id);}a+=l;}}return {gridColumnIds:[...o],wholeTable:o.size>0&&o.size===n.topology.gridColumns.length}}function RE(e,t,n){let r=Qm(e.root,t);return !r.ok||!r.topology.grid?null:r.topology.gridColumns[n]?.id??null}function H4(e){let t=ra$1(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 CE(e){let t=Cl(e,"tcPr"),n=t&&Cl(t,"gridSpan"),r=n&&Dl(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 _4(e,t,n){let r=e.gridColumns.findIndex(o=>o.id===n);if(r===-1)return null;for(let{row:o,cells:i}of e.rows){let a=0;for(let s of i){let l=CE(s);if(r>=a&&r<a+l)return {tableId:t,rowId:o.id,cellId:s.id,cellIds:[s.id],gridColumnIndex:r,isHeaderRepeat:false};a+=l;}}return null}function B4(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=Qm(e.part.root,t.tableId);if(!n.ok)return null;let r=n.topology.rows.findIndex(a=>a.row.id===t.rowId);if(r===-1)return null;let i=n.topology.rows[r].cells[0];return i?{tableId:t.tableId,rowId:t.rowId,cellId:i.id,cellIds:[i.id],gridColumnIndex:0,isHeaderRepeat:false}:null}function $4(e,t){if(t.sourceRevision!==e.storeRevision||t.isHeaderRepeat)return null;let n=Qm(e.part.root,t.tableId);return n.ok?_4(n.topology,t.tableId,t.gridColumnId):null}function OE(e,t){for(let n of t){let r=zn$1(e,n);if(r)return $h(r)}return null}function Kn(e,t,n){let r=OE(e,t);return r||{ok:true,ops:t,selection:n}}function W4(e,t){if(!Rm.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=Hh(e.color,t);return n.ok?{ok:true,spec:{style:e.style,size:e.size,color:n.color}}:{ok:false,reason:n.reason}}function tc(e,t,n){return n!==e.storeRevision?ye("invalidArgs","the table target is stale"):Qm(e.part.root,t).ok?null:ye("invalidArgs","the table target is no longer valid")}function q4(e){return e?.isHeaderRepeat?ye("unsupported","repeated header rows cannot be edited"):null}function K4(e,t,n,r){let o=tc(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return ye("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return ye("invalidArgs","column widths must be whole twips");if(n<300||r<300)return ye("invalidArgs","column widths are below the minimum");let i=Qm(e.part.root,t.tableId);if(!i.ok){let u=i.reason==="duplicate-node-id"?"unknown-table":i.reason;return $h(u)}let a=i.topology.gridColumns.find(u=>u.id===t.leftGridColumnId),s=i.topology.gridColumns.find(u=>u.id===t.rightGridColumnId);if(!a||!s)return ye("invalidArgs","the table target is no longer valid");let l=i.topology.gridColumns.indexOf(a),c=i.topology.gridColumns.indexOf(s);if(Math.abs(c-l)!==1)return ye("invalidArgs","the column divider target is not adjacent");let d={op:"setTableColumnWidths",tableId:t.tableId,leftGridColumnId:l<c?t.leftGridColumnId:t.rightGridColumnId,rightGridColumnId:l<c?t.rightGridColumnId:t.leftGridColumnId,leftWidthTwips:l<c?n:r,rightWidthTwips:l<c?r:n};return Kn(e.part,[d],{kind:"preserveSelection"})}function U4(e,t,n,r){let o=tc(e,t.tableId,t.sourceRevision);if(o)return o;if(t.isHeaderRepeat)return ye("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||!Number.isInteger(r))return ye("invalidArgs","column widths must be whole twips");if(n<300)return ye("invalidArgs","column widths are below the minimum");let i=Qm(e.part.root,t.tableId);if(!i.ok){let l=i.reason==="duplicate-node-id"?"unknown-table":i.reason;return $h(l)}let a=i.topology.gridColumns[i.topology.gridColumns.length-1];if(!a||a.id!==t.gridColumnId)return ye("invalidArgs","the resize target is not the table right edge");let s={op:"setTableRightEdgeWidth",tableId:t.tableId,gridColumnId:t.gridColumnId,columnWidthTwips:n,tableWidthTwips:r};return Kn(e.part,[s],{kind:"preserveSelection"})}function ME(e,t,n){if(e.viewing||!e.editable)return ye("locked","the document is open for viewing");let r=tc(e,t.tableId,t.sourceRevision);if(r)return r;if(t.isHeaderRepeat)return ye("unsupported","repeated header rows cannot be edited");if(!Number.isInteger(n)||n<20||n>31680)return ye("invalidArgs","row height is outside the supported range");let o={op:"setTableRowHeight",tableId:t.tableId,rowId:t.rowId,heightTwips:n};return Kn(e.part,[o],{kind:"preserveSelection"})}function Tr(e){let{command:t,part:n,viewing:r,editable:o}=e;if(t.type==="selectTableRegion")return xE(e,t);if(r||!o)return ye("locked","the document is open for viewing");switch(t.type){case "toggleHeaderRow":case "setTableProperties":return ye("unsupported",`command '${t.type}' is not supported by the tree editor`);}let i=A4(t);if(i)return i;let a=L4(t),s=F4(t),l=q4(a??s);if(l)return l;if(a){let d=tc(e,a.tableId,a.sourceRevision);if(d)return d}if(s){let d=tc(e,s.tableId,s.sourceRevision);if(d)return d}let c=a!==null?B4(e,a):s!==null?$4(e,s):H4(e);if(t.type!=="commitTableColumnDividerResize"&&t.type!=="commitTableRightEdgeResize"&&!c)return a||s?ye("invalidArgs","the table target is no longer valid"):ye("unsupported","the selection is not inside a table");if(c?.isHeaderRepeat)return ye("unsupported","repeated header rows cannot be edited");switch(t.type){case "mergeCells":case "splitCell":{if(!c)return ye("unsupported","the selection is not inside a table");let d=fE(t,c,e.cellSelection!==null);if(!d.ok)return ye(d.code,d.reason);let u=uE(n,d.op,e.suggestingAuthor);return OE(n,[u])??{ok:true,ops:[d.op],selection:{kind:"adoptCommittedCaret"}}}case "insertRow":{if(!c)return ye("unsupported","the selection is not inside a table");let d=(a?null:pE(n,c,t.where))??c.rowId,u={op:"insertTableRow",tableId:c.tableId,rowId:d,where:t.where};return Kn(n,[u],{kind:"adoptCommittedCaret"})}case "deleteRow":{if(!c)return ye("unsupported","the selection is not inside a table");let d=D4(n,c),u=d.wholeTable?[{op:"deleteBlock",blockId:c.tableId}]:d.rowIds.map(f=>({op:"deleteTableRow",tableId:c.tableId,rowId:f,...f===c.rowId?{referenceCellId:c.cellId}:{}}));return Kn(n,u,{kind:"adoptCommittedCaret"})}case "insertColumn":{if(!c)return ye("unsupported","the selection is not inside a table");let d=s?.tableId??c.tableId,u=Bh(e.layout,d)?t.where==="left"?"right":"left":t.where,f=s?.gridColumnId??mE(n,c,u)??RE(n,d,c.gridColumnIndex),p=f?{op:"insertTableColumn",tableId:d,where:u,gridColumnId:f}:{op:"insertTableColumn",tableId:d,where:u,referenceCellId:c.cellId};return Kn(n,[p],{kind:"adoptCommittedCaret"})}case "deleteColumn":{if(!c)return ye("unsupported","the selection is not inside a table");let d=s?.tableId??c.tableId,u=s?.gridColumnId??RE(n,d,c.gridColumnIndex);if(!u)return ye("invalidArgs","the table has no grid column to delete");let f=s?.gridColumnId===void 0?N4(n,c):{gridColumnIds:[u],wholeTable:false};if(f.wholeTable)return Kn(n,[{op:"deleteBlock",blockId:d}],{kind:"adoptCommittedCaret"});let g=(f.gridColumnIds.length>0?f.gridColumnIds:[u]).map(y=>({op:"deleteTableColumn",tableId:d,gridColumnId:y}));return Kn(n,g,{kind:"adoptCommittedCaret"})}case "deleteTable":{if(!c)return ye("unsupported","the selection is not inside a table");let d={op:"deleteBlock",blockId:c.tableId};return Kn(n,[d],{kind:"adoptCommittedCaret"})}case "setCellFill":{if(!c)return ye("unsupported","the selection is not inside a table");let d;if(t.color===null)d=null;else {let f=_h(t.color,e.themeColors);if(!f.ok)return ye("invalidArgs",f.reason);d=f.color;}let u={op:"setTableCellFill",tableId:c.tableId,cellIds:c.cellIds,color:d};return Kn(n,[u],{kind:"preserveSelection"})}case "setTableCellVerticalAlignment":{if(!c)return ye("unsupported","the selection is not inside a table");let d={op:"setTableCellVerticalAlignment",tableId:c.tableId,cellIds:c.cellIds,alignment:t.alignment};return Kn(n,[d],{kind:"preserveSelection"})}case "setTableBorders":{if(!c)return ye("unsupported","the selection is not inside a table");if(t.scope==="none"){let f={op:"setTableCellBorders",tableId:c.tableId,cellIds:c.cellIds,scope:"none",target:wE(t.target,Bh(e.layout,c.tableId))};return Kn(n,[f],{kind:"preserveSelection"})}let d=W4(t.spec,e.themeColors);if(!d.ok)return ye("invalidArgs",d.reason);let u={op:"setTableCellBorders",tableId:c.tableId,cellIds:c.cellIds,scope:wE(t.scope,Bh(e.layout,c.tableId)),spec:d.spec};return Kn(n,[u],{kind:"preserveSelection"})}case "commitTableColumnDividerResize":return K4(e,t.target,t.leftWidthTwips,t.rightWidthTwips);case "commitTableRightEdgeResize":return U4(e,t.target,t.columnWidthTwips,t.tableWidthTwips);default:return ye("unsupported",`command '${t.type}' is not a table command`)}}function AE(e){if(!Yo(e))return {supported:false,reason:`command '${e.type}' is not a table command`};switch(e.type){case "toggleHeaderRow":case "setTableProperties":return {supported:false,reason:`command '${e.type}' is not supported by the tree editor`};default:return {supported:true}}}var lf="Calibri",Wh=new Set(["image/png","image/jpeg","image/gif","image/bmp","image/webp"]),j4=4e3,ls=e=>Math.max(1,Math.min(j4,e));function V4(e,t,n,r){let o={...ma$1,fontFamily:t.fontFamily,bold:t.bold,italic:t.italic,fontSizePt:t.size??100},i=r?.measure(e,o)??NaN,a=r?.lineMetrics(o).height??NaN;if(i>0||(i=.55*o.fontSizePt*Array.from(e).length),a>0||(a=1.22*o.fontSizePt),t.size!==null)return {width:ls(i),height:ls(a)};let s=a/i,l=Math.min(n.width,n.height),c=t.diagonal?l*Math.SQRT2/(1+s):n.width;return {width:ls(c),height:ls(c*s)}}function G4(e,t,n){let r=Pf$1(e);if(!Wh.has(r))return null;let o=Uf$1(e,r);if(!o)return null;let i=o.pixelWidth*72/(o.dpiX&&o.dpiX>0?o.dpiX:96),a=o.pixelHeight*72/(o.dpiY&&o.dpiY>0?o.dpiY:96);if(!(i>0)||!(a>0))return null;let s=t??Math.min(n.width/i,n.height/a);return {width:ls(i*s),height:ls(a*s)}}function nc(e,t,n){if(e.imageData)return G4(e.imageData,e.scale??null,t);let r=e.text??"";return r===""?null:V4(r,{fontFamily:e.fontFamily?.trim()||lf,bold:e.bold??false,italic:e.italic??false,size:e.fontSizePt??null,diagonal:(e.layout??"diagonal")==="diagonal"},t,n)}var z4="C0C0C0",Z4=.5,X4=/^[^"';{}<>\\\u0000-\u001f]{1,64}$/u;function cf(e){if(!e)return null;let t=ij$1(e.session.currentPackage());return t?t.kind==="picture"?Object.freeze({kind:"image",washout:t.washout}):Object.freeze({kind:"text",text:t.text,fontFamily:t.fontFamily,fontSizePt:t.fontSizePt,bold:t.bold,italic:t.italic,color:t.colorHex,transparency:Math.round((1-t.opacity)*1e3)/1e3,layout:t.diagonal?"diagonal":"horizontal"}):null}function FE(e){let t=cf(e);if(!t||!e)return null;if(t.kind==="text"){let{kind:i,...a}=t;return Object.freeze(a)}let n=e.session.currentPackage(),r=ij$1(n),o=r?.kind==="picture"&&r.mediaPartName?n.partBytes.get(r.mediaPartName):void 0;return Object.freeze({washout:t.washout??false,scale:null,...o?{imageData:o}:{}})}var qh=(e,t,n)=>typeof e=="number"&&Number.isFinite(e)&&e>=t&&e<=n;function Kh(e){if(e===null)return null;if(typeof e!="object"||e===void 0)return "watermark must be an object or null";let t=e,n=t.text!==void 0,r=t.imageData!==void 0;if(n===r)return "set exactly one of text and imageData";if(n){if(typeof t.text!="string"||!t.text.trim())return "text must be a non-empty string";if(t.text.length>_d)return `text is longer than ${_d}`;if(/[\r\n\v\f\u2028\u2029]/u.test(t.text))return "text must be one line";if(/[\u0000-\u0008\u000e-\u001f]/u.test(t.text))return "text holds a control character";if(t.fontFamily!==void 0&&(typeof t.fontFamily!="string"||!X4.test(t.fontFamily.trim())))return "fontFamily is not a font name";if(t.fontSizePt!==void 0&&t.fontSizePt!==null&&!qh(t.fontSizePt,1,1e3))return "fontSizePt must be from 1 to 1000";if(t.color!==void 0&&(typeof t.color!="string"||!/^[0-9a-f]{6}$/iu.test(t.color)))return "color must be RRGGBB";if(t.transparency!==void 0&&!qh(t.transparency,0,1))return "transparency must be from 0 to 1";if(t.layout!==void 0&&t.layout!=="diagonal"&&t.layout!=="horizontal")return "layout must be 'diagonal' or 'horizontal'";for(let i of ["bold","italic"])if(t[i]!==void 0&&typeof t[i]!="boolean")return `${i} must be a boolean`;return t.scale!==void 0||t.washout!==void 0?"scale and washout apply to a picture watermark":null}if(!(t.imageData instanceof Uint8Array))return "imageData must be a Uint8Array";let o=Pf$1(t.imageData);if(!Wh.has(o))return "imageData is not a PNG, JPEG, GIF, BMP or WebP picture";if(!ag(t.imageData,o))return "imageData is not a readable picture";if(t.scale!==void 0&&t.scale!==null&&!qh(t.scale,.01,10))return "scale must be from 0.01 to 10";if(t.washout!==void 0&&typeof t.washout!="boolean")return "washout must be a boolean";for(let i of ["fontFamily","fontSizePt","bold","italic","color","transparency","layout"])if(t[i]!==void 0)return `${i} applies to a text watermark`;return null}function DE(e){let{pageSize:t,margins:n}=e,r=(t.widthTwips-n.leftTwips-n.rightTwips-n.gutterTwips)/20,o=(t.heightTwips-n.topTwips-n.bottomTwips)/20;return {width:Math.max(72,r),height:Math.max(72,o)}}function LE(e,t,n){let r=e.session.currentPackage(),o=r.parts.get(r.mainDocumentPart);if(o)return ce(o).map(i=>{let a=nc(t,DE(i.properties),n);return a?{widthPt:a.width,heightPt:a.height}:null})}function Y4(e,t){let n=DE(e.sectionPropertiesAt(e.state().selection.head.paragraphId)),r=e.textMeasurer?.();if(t.imageData){let u=Pf$1(t.imageData),f=nc(t,n);return f?{kind:"picture",washout:t.washout??true,widthPt:f.width,heightPt:f.height,sectionSizes:LE(e,t,r),image:{bytes:t.imageData,mime:u}}:null}let o=t.text??"",i=t.fontFamily?.trim()||lf,a=t.bold??false,s=t.italic??false,l=(t.layout??"diagonal")==="diagonal",c=t.fontSizePt??null,d=nc(t,n,r);return {kind:"text",text:o,fontFamily:i,fontSizePt:c,bold:a,italic:s,colorHex:(t.color??z4).toUpperCase(),opacity:1-(t.transparency??Z4),diagonal:l,widthPt:d.width,heightPt:d.height,sectionSizes:LE(e,t,r)}}function NE(e,t){let n=Kh(t);if(n)return {ok:false,code:"invalidArgs",reason:n};if(typeof e.applyHeaderFooterLifecycle!="function")return {ok:false,code:"unsupported",reason:"watermarks are not available"};let r=t?Y4(e,t):null;if(t&&!r)return {ok:false,code:"invalidArgs",reason:"imageData is not a readable picture"};if(!t&&!ij$1(e.session.currentPackage()))return {ok:true,changed:false};let o={op:"setWatermark",watermark:r},i=e.applyHeaderFooterLifecycle(o);return i.ok?{ok:true,changed:true}:{ok:false,code:i.reason==="locked"?"locked":"invalidArgs",reason:`the watermark was not written: ${i.reason}`}}function Vt(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 Xi(e){if(typeof e!="object"||e===null)return false;let t=e;return Vt(t.from)&&Vt(t.to)}function HE(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 jn(e,t,n){if(typeof n.paraId!="string"||n.paraId.length===0)return {ok:false,code:"invalidArgs",reason:"paraId must be a non-empty string"};let r=n.paraId.toUpperCase();if(t.ambiguousParaIds.has(r))return {ok:false,code:"ambiguous",reason:`paraId '${n.paraId}' is claimed by more than one story`};let o=t.nodeByParaId.get(r);if(o===void 0)return {ok:false,code:"notFound",reason:`no paragraph with paraId '${n.paraId}'`};let i=Km(t.partByNode.get(o)??e,o)??"";if(n.search===void 0)return {ok:true,span:{nodeId:o,start:0,end:i.length}};if(n.search.length===0)return {ok:false,code:"invalidArgs",reason:"search must be a non-empty phrase"};if(n.occurrence!==void 0){if(!Number.isInteger(n.occurrence)||n.occurrence<1)return {ok:false,code:"invalidArgs",reason:"occurrence must be a positive integer (1-based)"};let s=HE(i,n.search,n.occurrence),l=s[n.occurrence-1];return l===void 0?{ok:false,code:"notFound",reason:`'${n.search}' matches ${s.length} time(s) in paragraph '${n.paraId}'; occurrence ${n.occurrence} does not exist`}:{ok:true,span:{nodeId:o,start:l,end:l+n.search.length}}}let a=HE(i,n.search,2);return a.length===0?{ok:false,code:"notFound",reason:`'${n.search}' does not occur in paragraph '${n.paraId}'`}:a.length>1?{ok:false,code:"ambiguous",reason:`'${n.search}' matches more than once in paragraph '${n.paraId}'; pass occurrence to disambiguate`}:{ok:true,span:{nodeId:o,start:a[0],end:a[0]+n.search.length}}}function _E(e,t,n){if("anchor"in n){let s=jn(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(!Vt(r)||!Vt(o))return {ok:false,code:"unsupported",reason:"DocLocation endpoints are not supported; address paragraphs by paraId",target:n.range};let i=jn(e,t,r);if(!i.ok)return {ok:false,code:i.code,reason:i.reason,target:r};let a=jn(e,t,o);return a.ok?{ok:true,selection:{anchor:{paragraphId:i.span.nodeId,offset:i.span.start},head:{paragraphId:a.span.nodeId,offset:a.span.end}}}:{ok:false,code:a.code,reason:a.reason,target:o}}function BE(e){let t=e.match;return typeof t?.blockId!="string"||t.blockId.length===0||!Number.isInteger(t.start)||t.start<0||!Number.isInteger(t.length)||t.length<0?"match must carry a blockId and offsets":typeof e.text!="string"?"replaceMatch requires text":/[\r\n\v\f\u2028\u2029]/.test(e.text)?"replaceMatch requires text without a paragraph mark":null}function Uh(e,t){let n=t.scope??{kind:"body"},r=e.activeScope();return (n.kind==="body"?r.kind==="body":n.kind==="headerFooter"?r.kind==="headerFooter"&&r.rId===n.rId:n.kind==="note"?r.kind==="note"&&r.id===n.id:false)?null:{ok:false,code:"unsupported",reason:n.kind==="frame"?"replaceMatch does not replace text in a text box":"replaceMatch replaces text only in the open story"}}function $E(e,t){let n=Uh(e,t.match);if(n)return n;let{blockId:r,start:o,length:i}=t.match;return e.replaceTextInPlace(r,o,o+i,t.text)?null:{ok:false,code:"invalidArgs",reason:e.state().lastRejection??"replaceMatch was refused"}}var Q4=["alignment","direction","spaceBeforePt","spaceAfterPt","lineSpacing","tabStops"];function J4(e,t){return e===t?true:!e||!t?false:Q4.every(n=>e[n]===t[n])}function jh(e,t){if(e===t)return true;if(!e||!t||e.bold!==t.bold||e.italic!==t.italic||e.underline!==t.underline||e.strike!==t.strike||e.superscript!==t.superscript||e.subscript!==t.subscript||e.highlight!==t.highlight||e.fontFamily!==t.fontFamily||e.fontSizePt!==t.fontSizePt||e.alignment!==t.alignment||e.direction!==t.direction||e.styleId!==t.styleId||e.spaceBeforePt!==t.spaceBeforePt||e.spaceAfterPt!==t.spaceAfterPt||e.lineSpacing?.rule!==t.lineSpacing?.rule||e.lineSpacing?.value!==t.lineSpacing?.value||e.indent?.left!==t.indent?.left||e.indent?.right!==t.indent?.right||e.indent?.firstLine!==t.indent?.firstLine||e.indent?.mixed.left!==t.indent?.mixed.left||e.indent?.mixed.right!==t.indent?.mixed.right||e.indent?.mixed.firstLine!==t.indent?.mixed.firstLine||e.indent?.rtl!==t.indent?.rtl||e.paragraphFlags?.contextualSpacing!==t.paragraphFlags?.contextualSpacing||e.paragraphFlags?.keepNext!==t.paragraphFlags?.keepNext||e.paragraphFlags?.keepLines!==t.paragraphFlags?.keepLines||e.paragraphFlags?.widowControl!==t.paragraphFlags?.widowControl||e.paragraphFlags?.pageBreakBefore!==t.paragraphFlags?.pageBreakBefore||!J4(e.disagrees,t.disagrees)||e.tabStops?.length!==t.tabStops?.length||(e.tabStops??[]).some((i,a)=>i.positionTwips!==t.tabStops?.[a]?.positionTwips||i.alignment!==t.tabStops?.[a]?.alignment||(i.leader??"none")!==(t.tabStops?.[a]?.leader??"none")))return false;if(e.color===t.color)return true;if(!e.color||!t.color)return false;let n=e.color,r=t.color,o=new Set([...Object.keys(n),...Object.keys(r)]);for(let i of o)if(n[i]!==r[i])return false;return true}function Vh(e,t){return e.current===t.current&&e.total===t.total}function Gh(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 WE(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 zh(e,t){return e===t?true:!e||!t||!Xi(e)||!Xi(t)?false:WE(e.from,t.from)&&WE(e.to,t.to)}function Zh(){let e=null;return t=>(t===null?e=null:e?.id!==t&&(e=Object.freeze({id:t})),e)}var e3={scope:"compared",isLoading:"compared",isOpening:"compared",parseError:"compared",openFailure:"compared",editable:"compared",zoom:"compared",zoomMode:"compared",selection:"compared",selectionCollapsed:"compared",formatting:"compared",table:"compared",tocContext:"compared",image:"compared",page:"compared",canUndo:"compared",canRedo:"compared",pageSetup:"compared",reviewPaneOpen:"compared",reviewPane:"compared",showParagraphMarks:"compared",showBookmarks:"compared",documentProtection:"compared",reviewDisplayMode:"compared",revisionMarkup:"compared",hasReviewContent:"compared",hiddenReviewAuthors:"compared",collaborationStatus:"compared",editingMode:"compared",lastRejection:"compared",fontSubstitutions:"compared",formatPainter:"compared"},t3=Object.keys(e3);function Xh(e,t){return t3.every(n=>e[n]===t[n])}function df(e){if(e===null||typeof e!="object"||Object.isFrozen(e))return e;if(Array.isArray(e)){for(let n of e)df(n);return Object.freeze(e)}let t=e;for(let n of Object.keys(t))df(t[n]);return Object.freeze(e)}var Yh=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"}}]]),n3=new Set(["none","black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","red","yellow","white"]),r3=/^[0-9A-Fa-f]{6}$/;function Qh(e){let{mark:t,value:n}=e;switch(t){case "fontFamily":return typeof n!="string"||a$7(n)===null?{ok:false,code:"invalidArgs",reason:"fontFamily requires a family name of 1-64 letters, digits, or [ -.+_,;]"}:{ok:true,localName:"rFonts",attributes:{ascii:n,hAnsi:n}};case "fontSize":return typeof n!="number"||!Number.isInteger(n)||n<2||n>3276?{ok:false,code:"invalidArgs",reason:"fontSize requires an integer half-point value between 2 and 3276"}:{ok:true,localName:"sz",attributes:{val:String(n)}};case "color":return typeof n!="string"||n!=="auto"&&!r3.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"||!n3.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 jE(e){return typeof e=="object"&&e!==null&&typeof e.paragraphId=="string"&&typeof e.offset=="number"}function Jh(e){return typeof e=="object"&&e!==null&&jE(e.anchor)&&jE(e.head)}function on(e,t){let n=new Error(t);return n.code=e,n}function uf(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 ey(e){return e==="blank"?Ag():e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):null}function VE(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 Yi(e){switch(e.type){case "toggleMark":return Yh.has(e.mark)?{supported:true,mutating:true}:{supported:false,reason:`mark '${e.mark}' is not supported`};case "setMarkAttr":{let t=Qh(e);return t.ok?{supported:true,mutating:true}:{supported:false,reason:t.reason,code:t.code}}case "setAlignment":return {supported:true,mutating:true};case "setParagraphDirection":return e.direction==="ltr"||e.direction==="rtl"?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"setParagraphDirection requires a direction of 'ltr' or 'rtl'"};case "clearFormatting":return {supported:true,mutating:true};case "copyFormatting":return {supported:true,mutating:false};case "pasteFormatting":return {supported:true,mutating:true};case "setLineSpacing":{if(!["multiple","exact","atLeast"].includes(e.rule))return {supported:false,code:"invalidArgs",reason:"setLineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let n=e.rule==="multiple"?e.value*240:e.value*20;return !Number.isFinite(e.value)||e.value<=0||Math.round(n)>31680?{supported:false,code:"invalidArgs",reason:"setLineSpacing requires a positive value no taller than 1584pt"}:{supported:true,mutating:true}}case "setParagraphSpacing":{for(let t of ["beforePt","afterPt"]){let n=e[t];if(n!=null&&(!Number.isFinite(n)||n<0||n>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphSpacing requires ${t} between 0 and 1584 points`}}return {supported:true,mutating:true}}case "setParagraphStyle":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; the style applies at the selection"}:typeof e.styleId!="string"||e.styleId.length===0||e.styleId.length>128||/[\u0000-\u001f\u007f-\u009f]/.test(e.styleId)?{supported:false,code:"invalidArgs",reason:"setParagraphStyle requires a styleId of 1-128 printable characters"}:{supported:true,mutating:true};case "insertHyperlink":return e.target!==void 0?{supported:false,reason:"DocTarget addressing is not supported; a link applies at the selection"}:typeof e.href!="string"||e.href.length===0?{supported:false,code:"invalidArgs",reason:"insertHyperlink requires an href"}:{supported:true,mutating:true};case "removeHyperlink":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; unlink acts at the selection"};case "setParagraphFormat":{let t=[e.indentLeftTwips,e.indentRightTwips,e.indentFirstLineTwips];for(let r of t)if(r!=null&&(!Number.isInteger(r)||Math.abs(r)>Hd))return {supported:false,code:"invalidArgs",reason:`indent values must be whole twips within \xB1${Hd}`};for(let r of ["spaceBeforePt","spaceAfterPt"]){let o=e[r];if(o!=null&&(!Number.isFinite(o)||o<0||o>1584))return {supported:false,code:"invalidArgs",reason:`setParagraphFormat requires ${r} between 0 and 1584 points`}}let n=e.lineSpacing;if(n!=null){if(n.rule!=="multiple"&&n.rule!=="exact"&&n.rule!=="atLeast")return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a rule of 'multiple', 'exact' or 'atLeast'"};let r=n.rule==="multiple"?n.value*240:n.value*20;if(!Number.isFinite(n.value)||n.value<=0||Math.round(r)>31680)return {supported:false,code:"invalidArgs",reason:"lineSpacing requires a positive value no taller than 1584pt"}}if(e.alignment!==void 0&&!["left","center","right","justify"].includes(e.alignment))return {supported:false,code:"invalidArgs",reason:"unknown alignment"};if(e.direction!==void 0&&!["ltr","rtl"].includes(e.direction))return {supported:false,code:"invalidArgs",reason:"unknown direction"};if(e.tabStops!==void 0){if(e.tabStops.length>64)return {supported:false,code:"invalidArgs",reason:"setParagraphFormat accepts at most 64 tab stops"};let r=new Set;for(let o of e.tabStops){if(typeof o!="object"||o===null)return {supported:false,code:"invalidArgs",reason:"a tab stop must be an object"};if(!Number.isInteger(o.positionTwips)||o.positionTwips<0||o.positionTwips>31680)return {supported:false,code:"invalidArgs",reason:"tab stop positions must be whole twips between 0 and 31680"};if(!["left","center","right","decimal"].includes(o.alignment))return {supported:false,code:"invalidArgs",reason:"unknown tab alignment"};if(o.leader!==void 0&&!["none","dot","hyphen","underscore","heavy","middleDot"].includes(o.leader))return {supported:false,code:"invalidArgs",reason:"unknown tab leader"};if(r.has(o.positionTwips))return {supported:false,code:"invalidArgs",reason:"two tab stops cannot share a position"};r.add(o.positionTwips);}}return {supported:true,mutating:true}}case "setIndent":{let t=[e.left,e.right,e.firstLine];if(t.every(n=>n===void 0))return {supported:false,reason:"setIndent requires at least one indent field"};for(let n of t)if(n!=null){if(!Number.isInteger(n))return {supported:false,reason:"indent values must be whole twips"};if(Math.abs(n)>Hd)return {supported:false,reason:`indent values must be within \xB1${Hd} twips`}}return {supported:true,mutating:true}}case "toggleList":return e.kind==="bullet"||e.kind==="ordered"?{supported:true,mutating:true}:{supported:false,reason:`list kind '${e.kind}' is not supported`};case "adjustIndent":return e.direction==="increase"||e.direction==="decrease"?{supported:true,mutating:true}:{supported:false,reason:`indent direction '${e.direction}' is not supported`};case "insertBreak":return e.kind==="line"||e.kind==="page"||e.kind==="section"||e.kind==="sectionContinuous"?{supported:true,mutating:true}:{supported:false,reason:`break kind '${e.kind}' is not supported`};case "insertText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; text inserts at the selection"};case "deleteText":return e.target===void 0?{supported:true,mutating:true}:{supported:false,reason:"DocTarget addressing is not supported; deletion removes the selection"};case "proposeInsertion":case "proposeReplacement":{let t=e.type==="proposeInsertion"?e.text:e.replaceWith;return typeof t!="string"||t.length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires non-empty text`}:/[\r\n\v\f\u2028\u2029]/.test(t)?{supported:false,code:"invalidArgs",reason:`${e.type} requires text without a paragraph mark`}:e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:`${e.type} requires a non-empty author`}:{supported:true,mutating:true}}case "replaceMatch":{let t=BE(e);return t?{supported:false,code:"invalidArgs",reason:t}:{supported:true,mutating:true}}case "proposeDeletion":return e.author!==void 0&&e.author.trim().length===0?{supported:false,code:"invalidArgs",reason:"proposeDeletion requires a non-empty author"}:{supported:true,mutating:true};case "setPageSetup":{let t=[e.pageWidth,e.pageHeight],n=[e.marginTop,e.marginRight,e.marginBottom,e.marginLeft];if(t.every(r=>r===void 0)&&n.every(r=>r===void 0)&&e.orientation===void 0)return {supported:false,reason:"setPageSetup requires at least one field"};for(let r of t)if(r!==void 0&&(!Number.isInteger(r)||r<1||r>63360))return {supported:false,code:"invalidArgs",reason:"page dimensions must be integer twips between 1 and 63360"};for(let r of n)if(r!==void 0&&(!Number.isInteger(r)||r<0||r>31680))return {supported:false,code:"invalidArgs",reason:"margins must be integer twips between 0 and 31680"};return e.orientation!==void 0&&e.orientation!=="portrait"&&e.orientation!=="landscape"?{supported:false,code:"invalidArgs",reason:"orientation must be 'portrait' or 'landscape'"}:e.scope!==void 0&&e.scope!=="document"&&e.scope!=="section"?{supported:false,code:"invalidArgs",reason:"scope must be 'document' or 'section'"}:{supported:true,mutating:true}}case "undo":case "redo":return {supported:true,mutating:true};case "insertTable":return Number.isInteger(e.rows)&&Number.isInteger(e.cols)&&e.rows>=1&&e.cols>=1&&e.rows<=32767&&e.cols<=63&&e.rows*e.cols<=2e4?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:`insertTable needs whole rows and cols of at least 1, at most ${32767}\xD7${63}, and at most ${2e4} cells`};case "insertToc":return {supported:true,mutating:true};case "editTextFormField":return {supported:true,mutating:false};case "refreshToc":return e.mode!==void 0&&e.mode!=="entire"&&e.mode!=="pageNumbers"?{supported:false,code:"invalidArgs",reason:"refreshToc mode must be 'entire' or 'pageNumbers'"}:e.tocId!==void 0&&(typeof e.tocId!="string"||e.tocId.length===0)?{supported:false,code:"invalidArgs",reason:"refreshToc tocId must be a non-empty string"}:{supported:true,mutating:true};case "removeToc":return e.tocId!==void 0&&(typeof e.tocId!="string"||e.tocId.length===0)?{supported:false,code:"invalidArgs",reason:"removeToc 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 "setTableProperties":{let t=AE(e);return t.supported?{supported:true,mutating:true}:{supported:false,reason:t.reason??"unsupported table command"}}case "selectTableRegion":return e.region==="table"?{supported:true,mutating:false}:{supported:false,reason:`selecting a table ${e.region} is not supported yet`};case "setSelection":return "range"in e&&(Jh(e.range)||Xi(e.range))||"anchor"in e&&Vt(e.anchor)?{supported:true,mutating:false}:{supported:false,reason:"setSelection accepts { anchor: { paraId } }, a { range } whose from/to are paraId anchors, or a { range } carrying a semantic { anchor: { paragraphId, offset }, head } selection"};case "insertTextBox":return {supported:true,mutating:true};case "insertImage":return e.data instanceof Uint8Array&&(e.mime==="image/png"||e.mime==="image/jpeg"||e.mime==="image/gif")&&Number.isFinite(e.widthPoints)&&Number.isFinite(e.heightPoints)&&e.widthPoints>0&&e.heightPoints>0?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"insertImage requires png/jpeg/gif bytes and finite dimensions"};case "replaceImage":return e.data instanceof Uint8Array?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};case "deleteImage":return {supported:true,mutating:true};case "setImageWrapType":return ["inline","square","squareLeft","squareRight","tight","through","topAndBottom","behind","inFront"].includes(e.target)?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported wrap target"};case "transformImage":return e.action==="rotateCW"||e.action==="rotateCCW"||e.action==="flipH"||e.action==="flipV"?{supported:true,mutating:true}:{supported:false,code:"invalidArgs",reason:"unsupported transform action"};case "setImagePosition":return {supported:true,mutating:true};case "setImageProperties":return {supported:true,mutating:true};case "insertBookmark":case "deleteBookmark":case "keepFirstBookmark":case "goToBookmark":return typeof e.name=="string"&&e.name.length>0?{supported:true,mutating:e.type!=="goToBookmark"}:{supported:false,code:"invalidArgs",reason:`${e.type} needs a name`};case "setWatermark":{let t=Kh(e.watermark);return t?{supported:false,code:"invalidArgs",reason:t}:{supported:true,mutating:true}}default:return {supported:false,reason:ty(e.type)}}}function ty(e){return `command '${e}' is not supported by the tree editor`}var qt="comments and tracked changes require the pro review module (@docx-editor.dev/pro)",GE="realtime collaboration requires the pro collaboration module (@docx-editor.dev/pro)",Zr="suggesting mode needs an author; configure author before enabling it",o3="this document asks for tracked changes, but no author is configured",ff="this document is protected for filling in forms, which does not track changes",ry="this document permits editing only as tracked changes",pf="image changes are not supported in suggesting mode",cs="this revision kind has no structural accept/reject yet",Qi="this document is protected against editing; open it in Word to change that",Ji="this document is protected for comments only",ny={mode:null,rejection:null};function oy(e,t){if(e===void 0||e==="view")return ny;if(e==="edit")return {mode:"editing",rejection:null};let n=zE(t);return n!==null?{mode:null,rejection:n.reason}:{mode:"suggesting",rejection:null}}function zE(e){return e.reviewEnabled?e.hasAuthor?null:{ok:false,code:"invalidArgs",reason:Zr}:{ok:false,code:"unsupported",reason:qt}}function ZE(e){let t=false,n=null,r=e.log??(o=>console.error(o));return {report(o){o!==Zr||t||n!==null||(n=globalThis.setTimeout(()=>{if(n=null,!e.stillMissing())return;t=true;let i=`${Zr}. Edits are not tracked until an author is set (the author option at construction, setAuthor(), or the adapter author prop).`;e.emit(on("suggestingNeedsAuthor",i)),r(`[@docx-editor.dev/core] ${i}`);},0));},dispose(){n!==null&&globalThis.clearTimeout(n),n=null;}}}function iy(e){if(e.restrictedToReadOnly)return e.currentMode==="viewing"?ny:{mode:"viewing",rejection:Qi};let t=e.currentMode,n=null;e.engineAdoptedViewing&&t==="viewing"&&!e.viewOnly&&(n="editing",t="editing");let r=n===null?ny:{mode:n,rejection:null};return e.restrictedToComments?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:Ji}:r:e.restrictedToForms?t==="suggesting"&&!e.viewOnly?{mode:"editing",rejection:ff}: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:o3}}function XE(e){return e===null?{enter:true,rejection:null}:{enter:false,rejection:e.reason}}function YE(e,t){return t!=="viewing"&&e.restrictedToReadOnly?{ok:false,code:"locked",reason:Qi}:t==="suggesting"&&e.restrictedToComments?{ok:false,code:"locked",reason:Ji}:t==="suggesting"&&e.restrictedToForms?{ok:false,code:"locked",reason:ff}:t!=="editing"||!e.restrictedToTrackedChanges?null:{ok:false,code:"locked",reason:ry}}function QE(e,t,n,r){return e&&r!=="viewing"?{ok:false,code:"locked",reason:"this document was opened for viewing"}:(r==="suggesting"?zE(t()):null)??YE(n(),r)}function JE(e,t,n,r,o,i=false){let a=oy(e,t),s=e==="view"?"viewing":a.mode??o,l=iy({...t,...n,viewOnly:e==="view",hostChoseMode:e!==void 0,readerChoseMode:false,currentMode:s,engineAdoptedViewing:i});l.mode!==null&&(s=l.mode);let c=YE(n,s),d=n.restrictedToReadOnly?"viewing":r;return {mode:c===null?s:d,rejection:l.rejection??c?.reason??null,configurationRejection:a.rejection}}function eC(e,t,n,r,o=false){return o?n+r:(zm(e,t,n)?.offset??n)+r}function ds(e){if(e&&!(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")&&!e.bound&&!(e.controlType==="checkbox"||e.controlType==="picture"))return e.id}function tC(e,t,n){return {op:"insertText",paragraphId:e.paragraphId,offset:e.offset,text:t,...n===void 0?{}:{inside:n}}}var nC=new WeakMap;function rC(e,t){nC.set(e,t);}var ay=new WeakMap;function oC(e,t){let n=Rk(t);n&&ay.set(e,n);}function sy(e){return ay.get(e)}var ly="this document is protected for tracked changes; their authors cannot change",ea="this document is protected; only form fields can be filled";function Vn(e,t){if(e.type==="undo"||e.type==="redo"||e.type==="toggleDocumentProtection")return null;let n=Cf$1(t.session.currentPackage()),r=kj$1(n?.root);if(!r.enforced)return null;if(r.edit==="readOnly"||r.edit==="comments")return {ok:false,code:"locked",reason:r.edit==="comments"?Ji:Qi};if(r.edit==="trackedChanges"&&e.type==="setReviewChangesAuthor")return {ok:false,code:"locked",reason:ly};if(r.edit!=="forms"||Yo(e))return null;let o="structure",i,a=false;switch(e.type){case "insertText":o="text",i=e.text;break;case "paste":case "pasteWithoutFormatting":o="text",i=e.text,a=true;break;case "deleteText":case "cut":o="text";break;case "toggleMark":case "setMarkAttr":case "pasteFormatting":o="runFormat";break;case "clearFormatting":case "setAlignment":case "setParagraphDirection":case "setLineSpacing":case "setParagraphSpacing":case "setIndent":case "adjustIndent":case "toggleList":case "setParagraphStyle":case "setParagraphFormat":case "removeTabMark":o="paragraph";break;case "setPageSetup":case "setHeaderFooterOptions":case "setWatermark":case "convertAllNotes":case "insertToc":case "refreshToc":case "removeToc":case "replaceAllMatches":case "resolveAllReviewChanges":case "setReviewChangesAuthor":case "acceptRevision":case "rejectRevision":case "acceptAllRevisions":case "rejectAllRevisions":o="document";break}let s=t.state().selection,l=de(t.session,s.head.paragraphId);if(!l)return {ok:false,code:"locked",reason:ea};let c=s.anchor.paragraphId===s.head.paragraphId&&s.anchor.offset===s.head.offset,d=o==="text"&&i!==void 0&&!Vu(i).includes(`
|
|
24
|
-
`)&&c?ds(t.contentControls.atCaret()):void 0,u=t.state().cellSelection;return (u&&(o==="runFormat"||o==="paragraph")?[...ma$2(t.layout(),u.cellIds)].map(g=>({anchor:{paragraphId:g,offset:0},head:{paragraphId:g,offset:(Km(l,g)??"").length}})):[s]).some(g=>$k(l,n,{selection:g,intent:o,text:i,paste:a,fieldId:nC.get(t)?.()??void 0,...d===void 0?{}:{inside:d},contentLockPolicy:ay.get(t)}))?{ok:false,code:"locked",reason:ea}:null}function iC(e,t){if(e!=="locked")return e;let n=kj$1(t);return n.enforced?n.edit==="comments"?Ji:n.edit==="forms"?ea:Qi:"this content is locked"}function aC(e){return e!==null&&Vn({type:"resolveAllReviewChanges"},e)!==null}function sC(e,t){return ()=>e()??(t()?null:"the document is read-only")}var cy="this content is locked",i3=new Set(["toggleMark","setMarkAttr","clearFormatting"]),mf=Number.MAX_SAFE_INTEGER;function a3(e){let t=e.state(),n=t.cellSelection;if(n)return [...ma$2(e.layout(),n.cellIds)].map(y=>({paragraphId:y,start:0,end:mf}));let{anchor:r,head:o}=t.selection;if(r.paragraphId===o.paragraphId)return r.offset===o.offset?[{paragraphId:o.paragraphId,start:o.offset,end:o.offset}]:[{paragraphId:r.paragraphId,start:Math.min(r.offset,o.offset),end:Math.max(r.offset,o.offset)}];let i=Et(e.session,r.paragraphId,{kind:"body"}),a=e.session.paragraphIdsIn(i),s=a.indexOf(r.paragraphId),l=a.indexOf(o.paragraphId);if(s===-1||l===-1)return [{paragraphId:r.paragraphId,start:0,end:mf},{paragraphId:o.paragraphId,start:0,end:mf}];let[c,d]=s<l?[r,o]:[o,r],[u,f]=s<l?[s,l]:[l,s],p=a.slice(u,f+1).map((y,h,b)=>({paragraphId:y,start:h===0?c.offset:0,end:h===b.length-1?d.offset:mf})),g=p[p.length-1];return g&&g.end===0?p.slice(0,-1):p}function s3(e){return sc$1(e.root).some(t=>wc$1(qc$1(t.node).lock))}function lC(e,t,n){if(!i3.has(e.type))return null;let r=e.type==="clearFormatting",o=t.editingMode()==="suggest"&&!!t.author()?.trim()&&!t.session.trackingSettings().doNotTrackFormatting,i=n?.allowFormattingInLockedContent===true&&!o,{selection:a,cellSelection:s}=t.state(),l=!s&&a.anchor.paragraphId===a.head.paragraphId&&a.anchor.offset===a.head.offset;if(i&&!r&&!l)return null;let c={ok:false,code:"locked",reason:cy};for(let d of a3(t)){let u=de(t.session,d.paragraphId)??t.session.part();if(!s3(u))continue;let f=eb$1(u,d.paragraphId);if(!f||f.kind!=="paragraph")continue;if(Lh$1(u,d.paragraphId).content)return c;if(i&&!l)continue;let p=sc$1(f);if(p.length===0)continue;let g=Fi(f),y=d.start===d.end;for(let h of p){let b=g.spanOf(h.node);if(!b||!(y?b.start<d.start&&d.start<b.end:b.end>d.start&&b.start<d.end))continue;let S=pm(u,h.node.id).map(v=>qc$1(v).lock);if(wc$1(vc$1(S)))return c}}return null}var dy="this content is locked; only alignment, indents, spacing, and line and page breaks can change",l3=new Set(["setAlignment","setParagraphDirection","setLineSpacing","setParagraphSpacing","setIndent","adjustIndent","toggleList","setParagraphStyle","setParagraphFormat"]),c3=["direction","contextualSpacing","tabStops"];function d3(e){switch(e.type){case "setAlignment":return "alignment";case "setLineSpacing":case "setParagraphSpacing":case "setIndent":return "placement";case "adjustIndent":return "indentStep";case "setParagraphDirection":case "toggleList":case "setParagraphStyle":return "locked";case "setParagraphFormat":{if(c3.some(i=>e[i]!==void 0))return "locked";let{type:t,alignment:n,...r}=e;return n!==void 0&&Object.values(r).every(i=>i===void 0)?"alignment":"placement"}}}function u3(e){let t=e.state(),n=t.cellSelection;if(n)return [...ma$2(e.layout(),n.cellIds)];let{anchor:r,head:o}=t.selection;if(r.paragraphId===o.paragraphId)return [o.paragraphId];let i=Et(e.session,r.paragraphId,{kind:"body"}),a=e.session.paragraphIdsIn(i),s=a.indexOf(r.paragraphId),l=a.indexOf(o.paragraphId);return s===-1||l===-1?[r.paragraphId,o.paragraphId]:a.slice(Math.min(s,l),Math.max(s,l)+1)}var cC=new WeakMap;function f3(e){let t=cC.get(e.root);if(t)return t;let n=new Set;for(let r of sc$1(e.root)){if(!wc$1(qc$1(r.node).lock))continue;let o=[r.node];for(;o.length>0;){let i=o.pop();if(i.kind!=="textValue"){i.kind==="paragraph"&&n.add(i.id);for(let a of i.children)o.push(a);}}}return cC.set(e.root,n),n}var dC=new WeakMap;function p3(e){let t=dC.get(e);if(t)return t;let n=new Set;for(let r of e.pages)for(let o of Ya(r))if(o.marker){n.add(o.paragraphId);for(let i of bb$1(o))n.add(i);}return dC.set(e,n),n}function m3(e,t){let n=eb$1(e,t);if(n?.kind!=="paragraph")return false;let r=bi(n,"paragraphProperties","pPr");return r!==void 0&&r.kind!=="textValue"&&r.children.some(o=>o.kind!=="textValue"&&o.localName==="pPrChange")}function g3(e,t,n){let r=di$1(e,t),o=r.filter(i=>i.localName!==n);return o.length===r.length?[...r,{localName:n}]:o}function h3(e,t,n,r){let o=r!==void 0?{revision:{author:r}}:{};return n==="alignment"?{op:"setParagraphProperties",paragraphId:t,properties:[...di$1(e,t).filter(i=>i.localName!=="jc"),{localName:"jc",attributes:{val:"center"}}],...o}:{op:"setParagraphProperties",paragraphId:t,properties:g3(e,t,n==="placement"?"ind":"contextualSpacing"),...n==="placement"?o:{}}}function uC(e,t,n){if(!l3.has(e.type))return null;let r=d3(e),o=t.author()?.trim(),i=t.editingMode()==="suggest"&&o&&!t.session.trackingSettings().doNotTrackFormatting?o:void 0,a=t.state().selection.head.paragraphId,s=de(t.session,a)??t.session.part(),l=f3(s);if(l.size===0)return null;let c=r==="indentStep"?p3(t.layout()):null;for(let d of u3(t)){if(!l.has(d))continue;let u=r!=="indentStep"?r:c?.has(d)?"locked":"placement";if(u!=="locked"&&(i===void 0||!m3(s,d)))continue;if(zn$1(s,h3(s,d,u,i),{contentLockPolicy:n})==="locked")return {ok:false,code:"locked",reason:u==="locked"?dy:cy}}return null}function fC(e){return e.borderWidthEmu!==void 0||e.borderColor!==void 0}function pC(e){return e.horizontalEmu!==void 0||e.verticalEmu!==void 0||e.relativeToH!==void 0||e.relativeToV!==void 0}function mC(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||on$1(e)}function gC(e,t){for(let n of e.pages){let r=y3(n.fragments,t);if(r!==void 0)return r}return null}function y3(e,t){for(let n of e)if(n.kind==="paragraph")for(let r of n.lines)for(let o of r.drawings??[]){if(o.drawingNodeId!==t)continue;if(n.fragmentIndex!==0||n.positionedFrame||n.outOfFlow)return null;let i=Math.round(o.x*12700),a=Math.round((o.y-n.box.y)*12700);return !Number.isFinite(i)||!Number.isFinite(a)?null:Object.freeze({mode:"frame",horizontalEmu:i,verticalEmu:a,relativeToH:"margin",relativeToV:"paragraph"})}}function b3(e,t,n=e.extentEmu){let r=e.picture?.transform.rotationDegrees;return e.kind==="inline"==(t==="inline")||r===void 0||Math.abs(r%180)!==90||n.cx===n.cy?null:{cx:n.cy,cy:n.cx}}function hC(e,t,n,r,o=e.drawingNodeId){let i=b3(e,t);if(!i)return;let a=n.findIndex(l=>l.op==="resizeDrawing"),s=n[a];s?.op==="resizeDrawing"?n[a]={...s,extentEmu:{cx:r?.widthEmu!==void 0||r?.resetToNaturalSize?s.extentEmu.cx:i.cx,cy:r?.heightEmu!==void 0||r?.resetToNaturalSize?s.extentEmu.cy:i.cy}}:n.push({op:"resizeDrawing",drawingNodeId:o,extentEmu:i});}var yC=new WeakMap;function bC(e,t){yC.set(e,t);}function vC(e,t,n){yC.get(e)?.(t,n);}var v3="this drawing is a chart; only delete applies, and it removes the whole chart";function x3(e,t){let n=de(e.session,t)??e.session.part();return tn(n,t)!==null}function uy(e,t,n){let r=de(e.session,t)??e.session.part(),o=tn(r,t);return o?{chart:true,locks:un(o.chartDrawing)??n.locks}:{chart:false,locks:n.locks}}function fy(e,t,n){return t.type==="deleteImage"||!x3(e,n)?null:{ok:false,code:"unsupported",reason:v3}}function py(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 S3(e){return [e.left,e.top,e.right,e.bottom]}function my(e){return Object.freeze({left:e.left*100,top:e.top*100,right:e.right*100,bottom:e.bottom*100})}function w3(e){return Object.freeze({left:e.left/100,top:e.top/100,right:e.right/100,bottom:e.bottom/100})}function rc(e){return Math.round(e*1e3)}function oc(e){return e/1e3}function gy(e){return Object.freeze({left:rc(e.left),top:rc(e.top),right:rc(e.right),bottom:rc(e.bottom)})}function k3(e){return Object.freeze({left:oc(e.left),top:oc(e.top),right:oc(e.right),bottom:oc(e.bottom)})}function hy(e){return S3(e).some(n=>!Number.isFinite(n)||n<0||n>100)?false:e.left+e.right<100&&e.top+e.bottom<100}var gf=12700;function At(e){return Math.round(e*12700)}function ta(e){return e/12700}function xC(e,t,n,r,o,i){let a=ta(e),s=ta(t),l=a/s,c=n.includes("e")?r:n.includes("w")?-r:0,d=n.includes("s")?o:n.includes("n")?-o:0;if(a=Math.max(1,a+c),s=Math.max(1,s+d),i)if(n.length===2){let f=Math.max(a/ta(e),s/ta(t));a=Math.max(1,ta(e)*f),s=Math.max(1,a/l);}else n==="e"||n==="w"?s=Math.max(1,a/l):a=Math.max(1,s*l);return Object.freeze({cx:At(a),cy:At(s)})}function hf(e,t,n){return e.mode==="simple"?Object.freeze({mode:"simple",horizontalEmu:(e.horizontalEmu??0)+At(t),verticalEmu:(e.verticalEmu??0)+At(n)}):Object.freeze({mode:"frame",...e.horizontalEmu!==void 0?{horizontalEmu:e.horizontalEmu+At(t)}:{},...e.verticalEmu!==void 0?{verticalEmu:e.verticalEmu+At(n)}:{},...e.relativeToH!==void 0?{relativeToH:e.relativeToH}:{},...e.relativeToV!==void 0?{relativeToV:e.relativeToV}:{}})}var I3=new Set(["insertImage","replaceImage"]),R3=new Set(["insertImage","replaceImage","deleteImage","setImageWrapType","transformImage","setImagePosition","setImageProperties"]);function yy(e,t,n){return e.accessibility.hidden||n!==null&&e.drawingNodeId!==n?false:e.start===t||e.start+1===t}function P3(e,t,n,r){if(!e)return null;for(let o of e.drawings??[])if(o.paragraphId===t&&yy(o,n,r))return o;return null}function T3(e,t,n,r){let o=e.layout();for(let i of o.pages){for(let a of i.anchoredDrawings??[])if(a.anchorParagraphId===t&&yy(a,n,r))return a;for(let a of [i.header,i.footer])if(a){for(let s of a.anchoredDrawings??[])if(s.anchorParagraphId===t&&yy(s,n,r))return s}}return null}function wC(e){return e.kind==="pointer"?`pointer:${e.drawingNodeId}`:e.kind}function Gn(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=Yb$1(e.layout(),n.paragraphId,n.offset),i=t.kind==="pointer"?t.drawingNodeId:null;return P3(o,n.paragraphId,n.offset,i)??T3(e,n.paragraphId,n.offset,i)}function vy(e,t){let n=e.storyScope(),r=e.session.partFor(n)??e.session.part(),o=eb$1(r,t.drawingNodeId);return o?o.kind!=="drawing"?kn(r,t.drawingNodeId):Xe(o,{ownerPartName:t.ownerPartName,supportedMcRequires:Re,limits:Qe$1,resolveRelationship:Te$1(e.session.currentPackage(),t.ownerPartName)}):null}function kC(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 E3(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 IC(e,t){let n=t?{resize:true,move:true,changeAspect:true}:e.locks,r=e.kind==="inline"&&e.textboxStory!==null;return Object.freeze({canResize:!n.resize&&!e.hidden,canMove:!r&&!n.move&&!e.hidden,canChangeWrap:!t&&e.picture!==null&&!n.move&&!e.hidden,canCrop:e.picture!==null&&!n.resize&&!n.changeAspect&&!e.hidden})}function C3(e){return e.kind==="inlineDrawing"?"inline":e.wrap}var RC=e=>e.placeholderGraphicKind===null||!!e.textboxStory||e.placeholderGraphicKind==="chart"||!!e.chart;function Xr(e){let t=Gn(e);if(!t||!RC(t))return null;let n=e?vy(e,t):null;if(!n)return null;let{chart:r,locks:o}=uy(e,t.drawingNodeId,n);if(n.hidden||o.select)return null;let i=t.transform;return Object.freeze({id:t.drawingNodeId,kind:n.kind,widthEmu:n.extentEmu.cx,heightEmu:n.extentEmu.cy,crop:my(t.crop),rotationDegrees:i.rotationDegrees,wrap:C3(t),position:kC(n),name:n.name,title:n.title,description:n.description,hyperlink:n.hyperlinkHref,locks:o,hidden:n.hidden,resourceStatus:t.resource.kind,intrinsic:E3(t),...IC(n,r)})}function xy(e){if("drawingNodeId"in e&&typeof e.drawingNodeId=="string")return e.drawingNodeId}function PC(e){if("expectedPackageRevision"in e&&typeof e.expectedPackageRevision=="number")return e.expectedPackageRevision}function Sy(e){return xy(e)!==void 0||PC(e)!==void 0||e.type==="setImageProperties"&&e.selectionParagraphId!==void 0}function wy(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};let o=PC(t);if(o!==void 0&&r.session.packageRevision()!==o)return {ok:false,code:"notFound",reason:"stale package revision"};let i=xy(t),a=Xr(r);if(i!==void 0&&(!a||a.id!==i))return {ok:false,code:"notFound",reason:"stale drawing selection"};if(t.type==="setImageProperties"&&t.selectionParagraphId!==void 0&&t.selectionOffset!==void 0){let{anchor:s,head:l}=r.state().selection;if(s.paragraphId!==t.selectionParagraphId||s.offset!==t.selectionOffset||l.paragraphId!==t.selectionParagraphId||l.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return us(e,n,{requireDrawing:i!==void 0||n.drawingNodeId!==null,drawingNodeId:i??n.drawingNodeId??void 0})}function Qo(e,t){let n=Xr(e),r=xy(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 O3(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 SC(e,t,n){if(n==="inline")return [];let r=gC(e.layout(),t);return r?[{op:"positionDrawing",drawingNodeId:t,position:r}]:[]}function by(e,t,n,r){let o=Gn(e),i=o&&vy(e,o);i&&hC(i,t,n,r,o.drawingNodeId);}function yf(e,t){return O3(e.applyDrawingOps(t))}function M3(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 TC(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 ic(e){return R3.has(e.type)}function A3(e){return I3.has(e.type)}function EC(e){return {ok:false,code:"unsupported",reason:`${e.type} is asynchronous; use executeImageCommand`}}function CC(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:pf}:null}function ac(e){let t=e.surface;if(!t)return null;let{anchor:n}=t.state().selection,r=Xr(t);return Object.freeze({mountGeneration:e.mountGeneration,packageRevision:t.session.packageRevision(),drawingNodeId:r?.id??null,selectionParagraphId:n.paragraphId,selectionOffset:n.offset})}function us(e,t,n){let r=e.surface;if(!r)return {ok:false,code:"notFound",reason:"no document is loaded"};if(e.mountGeneration!==t.mountGeneration)return {ok:false,code:"notFound",reason:"the editor is no longer attached"};let{anchor:o,head:i}=r.state().selection;if(o.paragraphId!==t.selectionParagraphId||o.offset!==t.selectionOffset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(o.paragraphId!==i.paragraphId||o.offset!==i.offset)return {ok:false,code:"notFound",reason:"stale drawing selection"};if(n?.requireDrawing){let a=Xr(r),s=n.drawingNodeId??t.drawingNodeId;if(!a||!s||a.id!==s)return {ok:false,code:"notFound",reason:"stale drawing selection"}}return null}var ky="a picture is selected; place the caret in text to insert a picture";function fs(e,t){if(!ic(e))return null;if(!t)return {ok:false,code:"notFound",reason:"no document is loaded"};let n=Vn(e,t);if(n)return n;if(e.type==="insertImage")return Gn(t)?{ok:false,code:"invalidArgs",reason:ky}:!(e.data instanceof Uint8Array)||e.data.byteLength===0?{ok:false,code:"invalidArgs",reason:"insertImage requires image bytes"}:!Number.isFinite(e.widthPoints)||!Number.isFinite(e.heightPoints)?{ok:false,code:"invalidArgs",reason:"insertImage requires finite dimensions"}:e.widthPoints<=0||e.heightPoints<=0?{ok:false,code:"invalidArgs",reason:"insertImage dimensions must be positive"}:null;let r=Gn(t);if(r&&"textboxStory"in r&&r.textboxStory&&(e.type==="replaceImage"||e.type==="transformImage"||e.type==="setImageProperties"&&e.hyperlink!==void 0))return {ok:false,code:"unsupported",reason:"this operation is not supported for textboxes"};if(e.type==="replaceImage"){if(!(e.data instanceof Uint8Array)||e.data.byteLength===0)return {ok:false,code:"invalidArgs",reason:"replaceImage requires image bytes"};let c=Qo(t,e);return "ok"in c?c:fy(t,e,c.id)}let i=Qo(t,e);if("ok"in i)return i;let a=fy(t,e,i.id);if(a)return a;let s=Xr(t);if(!s)return {ok:false,code:"notFound",reason:"no drawing is selected"};let l=e.type==="setImageWrapType"?e.target:e.type==="setImageProperties"?e.wrap:void 0;if(l!==void 0&&s.locks.resize){let c=[];if(by(t,l,c),c.length)return {ok:false,code:"locked",reason:"the drawing size is locked"}}switch(e.type){case "deleteImage":return s.locks.select?{ok:false,code:"locked",reason:"the drawing cannot be selected"}:null;case "setImageWrapType":return s.canChangeWrap?null:{ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};case "transformImage":return s.locks.changeAspect||s.locks.resize?{ok:false,code:"locked",reason:"the drawing is locked"}:null;case "setImagePosition":if(!s.canMove||s.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};if(!pC(e))return {ok:false,code:"invalidArgs",reason:"setImagePosition requires at least one field"};let c=s.position?.mode??"frame";return qn$1(e,c)?ln(TC(e,s))?null:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"}:{ok:false,code:"invalidArgs",reason:"setImagePosition carries invalid position values"};case "setImageProperties":{if(fC(e))return {ok:false,code:"unsupported",reason:"image border properties are not supported yet"};if(!mC(e))return {ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"};if(e.resetToNaturalSize&&!s.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&&!s.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.heightEmu!==void 0&&!s.canResize)return {ok:false,code:"locked",reason:"the drawing is locked"};if(e.crop!==void 0&&!hy(e.crop))return {ok:false,code:"invalidArgs",reason:"crop values are out of range"};if(e.crop!==void 0&&!s.canCrop)return {ok:false,code:"locked",reason:"crop cannot be changed on this drawing"};if(e.hyperlink!==void 0&&e.hyperlink!==null&&!U(e.hyperlink).ok)return {ok:false,code:"invalidArgs",reason:"unsafe hyperlink URL"};if(e.wrap!==void 0&&!s.canChangeWrap)return {ok:false,code:"locked",reason:"wrap cannot be changed on this drawing"};if(on$1(e)){if(!s.canMove||s.kind!=="anchored")return {ok:false,code:"locked",reason:"position cannot be changed on this drawing"};let d=s.position?.mode??"frame";if(!qn$1(e,d))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"};if(!ln(pn(e,s)))return {ok:false,code:"invalidArgs",reason:"setImageProperties carries invalid position values"}}return null}default:return null}}function Iy(e,t){let n=CC(t,e.type);if(n)return n;let r=fs(e,t);return r||{ok:true}}function OC(e,t){let n=fs(e,t);return n||EC(e)}function Ry(e,t,n){if(A3(t))return EC(t);let r=n&&Sy(t)?ac(n):null;if(r&&n){let o=wy(n,t,r);if(o)return o}switch(t.type){case "deleteImage":{let o=Qo(e,t);if("ok"in o)return o;let i=e.deleteImage(o.id);return i.ok?null:{ok:false,code:"invalidArgs",reason:i.detail??i.reason??"deleteImage was refused"}}case "setImageWrapType":{let o=Qo(e,t);if("ok"in o)return o;let i=[];return by(e,t.target,i),yf(e,[...i,{op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.target},...SC(e,o.id,t.target)])}case "transformImage":{let o=Qo(e,t);return "ok"in o?o:yf(e,[{op:"transformDrawing",drawingNodeId:o.id,action:t.action}])}case "setImagePosition":{let o=Qo(e,t);if("ok"in o)return o;let i=Xr(e),a=TC(t,i);return yf(e,[{op:"positionDrawing",drawingNodeId:o.id,position:a}])}case "setImageProperties":{let o=Qo(e,t);if("ok"in o)return o;let i=Xr(e);if(!i)return {ok:false,code:"notFound",reason:"no drawing is selected"};let a=[];if(t.resetToNaturalSize){let c=M3(i);if(!c)return {ok:false,code:"invalidArgs",reason:"natural size is unavailable for this image"};a.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:c});}else (t.widthEmu!==void 0||t.heightEmu!==void 0)&&a.push({op:"resizeDrawing",drawingNodeId:o.id,extentEmu:{cx:t.widthEmu??i.widthEmu,cy:t.heightEmu??i.heightEmu}});t.crop!==void 0&&a.push({op:"cropDrawing",drawingNodeId:o.id,crop:gy(t.crop)});let s=t.title??t.alt,l=t.description??t.alt;if((s!==void 0||l!==void 0)&&a.push({op:"setDrawingMetadata",drawingNodeId:o.id,title:s??i.title,description:l??i.description}),t.wrap!==void 0&&(by(e,t.wrap,a,t),a.push({op:"setDrawingWrap",drawingNodeId:o.id,wrap:t.wrap}),a.push(...SC(e,o.id,t.wrap))),on$1(t)){let c=pn(t,i);a.push({op:"positionDrawing",drawingNodeId:o.id,position:c});}if(t.hyperlink!==void 0){let c=e.applyImageProperties({drawingNodeId:o.id,ops:a,hyperlink:t.hyperlink});return c.ok?null:{ok:false,code:"invalidArgs",reason:c.detail??c.reason??"setImageProperties was refused"}}return a.length===0?{ok:false,code:"invalidArgs",reason:"setImageProperties requires at least one field"}:yf(e,a)}default:return null}}function L3(e,t,n,r,o){let i=fe(e.sectionPropertiesAt(t)),a=i.width-i.margin.left-i.margin.right,s=Wd(i),l=i.height-s.top-s.bottom,c=Yb$1(e.layout(),t,n),d=c&&c.box.width>0?Math.min(c.box.width,a):a,u=Math.min(1,d/r,l/o);return u>=1?{widthPoints:r,heightPoints:o}:{widthPoints:r*u,heightPoints:o*u}}async function Py(e,t){let n=await F3(e,t);return vC(e,t,n),n}async function F3(e,t){let n=e.surface;if(!n)return {ok:false,code:"notFound",reason:"no document is loaded"};let r=CC(n,t.type);if(r)return r;let o=fs(t,n);if(o)return o;let i=ac(e);if(!i)return {ok:false,code:"notFound",reason:"no document is loaded"};if(t.type==="insertImage"){let{anchor:u}=n.state().selection,f=t.expectedPackageRevision??i.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let p=L3(n,u.paragraphId,u.offset,t.widthPoints,t.heightPoints),g=await n.insertImage({paragraphId:u.paragraphId,offset:u.offset,bytes:t.data,mime:t.mime,widthPoints:p.widthPoints,heightPoints:p.heightPoints,expectedPackageRevision:f,commitGuard:()=>us(e,i)===null,...t.title!==void 0?{title:t.title}:{},...t.description!==void 0?{description:t.description}:{},...t.hyperlink!==void 0?{hyperlink:t.hyperlink}:{}}),y=us(e,i);return y||(g.ok?{ok:true,changed:g.change!==null}:{ok:false,code:"invalidArgs",reason:g.detail==="stale-package-epoch"?"stale package revision":g.detail??g.reason??"insertImage was refused"})}let a=Qo(n,t);if("ok"in a)return a;let s=t.expectedPackageRevision??i.packageRevision;if(t.expectedPackageRevision!==void 0&&n.session.packageRevision()!==t.expectedPackageRevision)return {ok:false,code:"notFound",reason:"stale package revision"};let l=t.mime??"image/png",c=await n.replaceImage(a.id,t.data,l,{expectedPackageRevision:s,commitGuard:()=>us(e,i,{requireDrawing:true,drawingNodeId:a.id})===null}),d=us(e,i,{requireDrawing:true,drawingNodeId:a.id});return d||(c.ok?{ok:true,changed:c.change!==null}:{ok:false,code:"invalidArgs",reason:c.detail==="stale-package-epoch"?"stale package revision":c.detail??c.reason??"replaceImage was refused"})}var D3=1,N3=10;function H3(e,t,n){if(!t||t.hidden||!RC(e))return Object.freeze({canResize:false,canMove:false,aspectLocked:true});let r=IC(t,n);return Object.freeze({canResize:r.canResize,canMove:r.canMove,aspectLocked:n||t.locks.changeAspect})}function _3(e){if(!e)return null;let t=e.activeScope(),{anchor:n,head:r}=e.state().selection;if(t.kind!=="frame"&&(n.paragraphId!==r.paragraphId||n.offset!==r.offset))return null;let o=t.kind==="frame"?null:Gn(e);if(t.kind!=="frame"&&!o)return null;let i=e.layout(),a=t.kind==="frame"?MT(i,t,e.currentPage("caret")-1):null,s=t.kind==="frame"?a?.record:o;if(!s||s.accessibility.hidden)return null;let l=a??Ge(i,s.drawingNodeId);if(!l)return null;let c=vy(e,s),d=c?uy(e,s.drawingNodeId,c):null,u=d!==null&&!d.locks.select;if(!u&&t.kind!=="frame")return null;let f=u?H3(s,c,d.chart):{canResize:false,canMove:false,aspectLocked:true},g=e.editingMode()!=="view"&&e.session.editable?f:{...f,canResize:false,canMove:false},y=s.kind==="anchoredDrawing"?Object.freeze({x:s.horizontalFrameOrigin+l.x-s.paintBounds.x,y:s.verticalFrameOrigin+l.y-s.paintBounds.y}):null;return Object.freeze({id:s.drawingNodeId,textbox:"textboxStory"in s&&!!s.textboxStory,...AT(s,de(e.session,s.drawingNodeId)??e.session.part()),pageIndex:l.pageIndex,x:l.x,y:l.y,width:l.width,height:l.height,kind:s.kind==="inlineDrawing"?"inline":"anchored",widthEmu:c?.extentEmu.cx??At(l.width),heightEmu:c?.extentEmu.cy??At(l.height),position:c?kC(c):null,anchorFrameOrigin:y,transform:s.transform,...g})}function B3(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"}:us(e,t.preconditions,{requireDrawing:true,drawingNodeId:t.drawingNodeId}):{ok:false,code:"notFound",reason:"no document is loaded"}}var Ty="suggesting cannot move a table; stop suggesting to move it",Ey="suggesting cannot change a form field checkbox or dropdown; stop suggesting to change it",Cy="suggesting cannot delete a whole table; stop suggesting to delete it, or delete its rows one at a time";function $3(e){return t=>{let n=de(e,t);return n!==null&&eb$1(n,t)?.kind==="table"}}function Oy(e,t){return n=>{let r=t?.trim()?de(e,n):null;return r!==null&&Zm(r.root,n,t)}}function MC(e,t,n){return My(n,$3(e),Oy(e,t))}function My(e,t,n=()=>false){if(e.some(i=>i.op==="deleteNote"))return "suggesting cannot delete a note outright; strike its reference to propose the deletion";let r=i=>i.op==="removeContentControl"&&i.keepContent===false;if(e.some(r))return "suggesting cannot remove a content control outright";if(e.some(i=>i.op==="removeToc"))return "suggesting cannot remove a table of contents outright";let o=i=>(i.op==="mergeTableCells"||i.op==="splitTableCell")&&!n(i.tableId);return e.some(o)?lE:e.some(i=>i.op==="deleteBlock"&&t(i.blockId))?Cy:e.some(i=>i.op==="moveTable")?Ty:e.some(i=>i.op==="setLegacyCheckbox"||i.op==="setLegacyDropdown")?Ey:null}function Ay(e,t){for(let n of [e.footnotes,e.endnotes]){let r=n?.notes.find(o=>La(o.fragments).some(i=>i.paragraphId===t));if(r)return r}}function sc(e,t){for(let n of [e.header,e.footer]){if(!n)continue;if(La(n.fragments).some(o=>o.paragraphId===t))return n.box}return Ay(e,t)?.box??e.contentBox}var W3={empty:"a bookmark needs a name",tooLong:"a bookmark name has at most 40 characters",invalidStart:"a bookmark name starts with a letter",invalidCharacter:"a bookmark name holds only letters, digits and underscores"};function Ly(e){let t=Xi$1(e);return t?W3[t]:e.startsWith("_")?"a bookmark name starts with a letter":null}var AC=new WeakMap;function q3(e){let t=AC.get(e);return t||(t=_i(e),AC.set(e,t)),t}function K3(e,t){return e.kind==="body"?"body":e.kind==="notesPart"?e.noteKind:t.root.localName==="ftr"?"footer":"header"}function LC(e){return e.kind==="body"?"body":e.kind==="headerFooter"?"headerFooter":"note"}function NC(e){let t=e.options.showBookmarks===true,n=null;e.options.bookmarkMarks?.onChange(()=>{t&&n?.isConnected&&e.repaint();});let r=null,o=()=>{let c=e.session.storyParts();if(r?.parts.length===c.length&&r.parts.every((u,f)=>u===c[f]))return r.entries;let d=[];for(let u of c){let f=Ih(e.session,u.name,{kind:"body"}),p=K3(f,u);for(let g of q3(u))d.push({record:g,scope:f,partName:u.name,place:p});}return r={parts:c,entries:d},d},i=c=>{let d=Zi$1(c);return o().find(u=>Zi$1(u.record.name)===d)??null},a=(c,d,u=[])=>{let f=false;return e.commit(()=>(f=e.session.applyTreeOps([c],void 0,void 0,d,{packageEdits:u}).committed,f)),f},s=c=>Ly(c)??e.writeRefusal(),l=()=>{let c=e.orderedRange().from,d=JSON.stringify(e.storyScope()),u,f=g=>(u??=new Map(e.session.paragraphIdsIn(e.storyScope()).map((y,h)=>[y,h]))).get(g)??-1,p=(g,y)=>g===c.paragraphId?[0,y-c.offset]:[f(g)-f(c.paragraphId),0];return (g,y)=>{if(JSON.stringify(y)!==d)return false;let[h,b]=p(g.start.paragraphId,g.start.offset),[x,S]=p(g.end.paragraphId,g.end.offset),v=h<0||h===0&&b<=0,k=x>0||x===0&&S>=0;return v&&k}};return {list(){let c=l(),d=new Map;for(let{record:p}of o()){let g=Zi$1(p.name);d.set(g,(d.get(g)??0)+p.copies);}let u=new Set,f=[];for(let{record:p,scope:g,place:y}of o()){let h=Zi$1(p.name);u.has(h)||(u.add(h),f.push(Object.freeze({name:p.name,hidden:p.hidden,story:LC(g),place:y,order:f.length,empty:p.start.paragraphId===p.end.paragraphId&&p.start.offset===p.end.offset,atSelection:c(p,g),duplicates:(d.get(h)??1)-1})));}return f},insertRefusal:s,insert(c){if(s(c))return false;let d=e.storyScope(),u=e.orderedRange(),f=Zi$1(c),p=new Set(o().filter(g=>Zi$1(g.record.name)===f&&JSON.stringify(g.scope)!==JSON.stringify(d)).map(g=>g.partName));return a({op:"insertBookmark",name:c,start:{paragraphId:u.from.paragraphId,offset:u.from.offset},end:{paragraphId:u.to.paragraphId,offset:u.to.offset}},d,[...p].map(g=>y=>Nk(y,g,c)))},remove(c){let d=i(c);if(!d||e.writeRefusal()!==null)return false;let u=Zi$1(c),f=new Set(o().filter(p=>Zi$1(p.record.name)===u&&p.partName!==d.partName).map(p=>p.partName));return a({op:"deleteBookmark",name:c},d.scope,[...f].map(p=>g=>Nk(g,p,c)))},keepFirst(c){let d=i(c);if(!d||e.writeRefusal()!==null)return false;let u=Zi$1(c),p=[...new Set(o().filter(y=>Zi$1(y.record.name)===u&&y.partName!==d.partName).map(y=>y.partName))].map(y=>h=>Nk(h,y,c));if(d.record.copies>1)return a({op:"deleteBookmark",name:c,keepFirst:true},d.scope,p);if(p.length===0)return false;let g=false;return e.commit(()=>(g=e.session.applyTreeOps([],void 0,void 0,d.scope,{packageEdits:p}).committed,g)),g},writeRefusal:()=>e.writeRefusal(),goTo(c){let d=i(c);if(!d)return false;let{start:u,end:f}=d.record,p=e.goToPosition(u,{orShow:true,center:true});return p?(p===true&&e.setSelection({anchor:u,head:f}),true):false},shown:()=>t,setShown(c){c!==t&&(e.beforeChange(),t=c,e.repaint());},paint(c){if(n=c.layer,!t){c.layer.replaceChildren();return}let d=e.options.bookmarkMarks?.current()??{};c.layer.classList.toggle("docx-bookmark-overlay--print",d.print===true);let u=d.include??"visible",f=[],p=new Set;for(let{record:g,scope:y,partName:h}of o()){let b=Zi$1(g.name);if(p.has(b))continue;p.add(b);let x={name:g.name,hidden:g.hidden,story:LC(y)};if(u==="visible"?g.hidden:u!=="all"&&!u(x))continue;let S=g.start.paragraphId===g.end.paragraphId&&g.start.offset===g.end.offset,v=y.kind==="headerFooter"?h:void 0;if(S){f.push({...x,edge:"point",...g.start,repeats:v});continue}f.push({...x,edge:"start",...g.start,repeats:v},{...x,edge:"end",...g.end,repeats:v});}j3(c,f,d.decorate,e.options.bookmarkMarks?.reportError);}}}var FC=new WeakMap,DC=new WeakSet;function U3(e){DC.has(e)||(DC.add(e),e.addEventListener("mousedown",t=>{let r=t.target?.localName;r==="input"||r==="select"||r==="textarea"||t.preventDefault();}));}function j3(e,t,n,r){let{layer:o,layout:i,scale:a}=e,s=o.ownerDocument;U3(o),o.style.setProperty("--docx-bookmark-scale",String(a));let l=[],c=e.pages?[...e.pages]:i.pages.map((f,p)=>p),d=FC.get(i);d||FC.set(i,d=new Map);let u=d;for(let f of t){let p={paragraphId:f.paragraphId,offset:f.offset},g=(b,x)=>{let S=`${f.paragraphId}:${b}:${x??""}`;if(u.has(S))return u.get(S);let v=Se(i,{paragraphId:f.paragraphId,offset:b},{...e.measurer?{measurer:e.measurer}:{},...x!==void 0?{preferredPageIndex:x}:{}});return u.set(S,v),v},y=f.repeats?c.map(b=>g(p.offset,b)):[g(p.offset)],h=new Set;for(let b of y){if(!b||!(b.height>0)||h.has(b.pageIndex)||e.pages&&!e.pages.has(b.pageIndex))continue;let x=i.pages[b.pageIndex];if(!x)continue;let S=e.pageOffsetX?.get(b.pageIndex)??0,v=f.repeats?[x.header,x.footer].find(C=>C?.partName===f.repeats):f.story==="note"?Ay(x,f.paragraphId):void 0;if((f.repeats||f.story==="note")&&!v)continue;let k=v?.box??x.contentBox;h.add(b.pageIndex);let E=s.createElement("div");E.className=`docx-bookmark-mark docx-bookmark-mark--${f.edge}`;let I=f.edge==="end"?p.offset-1:p.offset+1,R=I>=0?g(I,f.repeats?b.pageIndex:void 0):null;R?.lineId===b.lineId&&(f.edge==="end"?R.x>b.x:R.x<b.x)&&E.classList.add("docx-bookmark-mark--rtl");let O={name:f.name,hidden:f.hidden,story:f.story,edge:f.edge};try{E=n?.(E,O)??E;}catch(C){r?.(C);}E.dataset.bookmarkName=f.name,E.dataset.bookmarkHidden=String(f.hidden),E.dataset.bookmarkEdge=f.edge,E.dataset.bookmarkStory=f.story,E.dataset.docxMarker="",E.setAttribute("contenteditable","false"),E.style.position="absolute",E.style.left=`${(k.x+b.x+S)*a}px`,E.style.top=`${(k.y+b.y)*a}px`,E.style.height=`${b.height*a}px`,l.push(E);}}o.replaceChildren(...l);}function V3(e){return e.type==="insertBookmark"||e.type==="deleteBookmark"||e.type==="keepFirstBookmark"||e.type==="goToBookmark"}function G3(e,t){let n=Zi$1(t);return e.bookmarkEditing.list().some(r=>Zi$1(r.name)===n)}function Fy(e,t){if(!V3(t))return null;if(t.type==="insertBookmark"){let n=Ly(t.name);if(n)return {ok:false,code:"invalidArgs",reason:n};let r=e.bookmarkEditing.insertRefusal(t.name);return r?{ok:false,code:"locked",reason:r}:null}if(!G3(e,t.name))return {ok:false,code:"notFound",reason:"the document has no bookmark with that name"};if(t.type==="keepFirstBookmark"){let n=Zi$1(t.name);if(!e.bookmarkEditing.list().find(o=>Zi$1(o.name)===n)?.duplicates)return {ok:false,code:"unsupported",reason:"the bookmark has no copies"}}if(t.type!=="goToBookmark"){let n=e.bookmarkEditing.writeRefusal();if(n)return {ok:false,code:"locked",reason:n}}return null}function Dy(e,t,n,r="bookmark dialog"){return t?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.canOpen()?(n&&e.open(),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:`no ${r} is registered`}}function HC(e,t){let n=Fy(e,t);return n||(t.type==="goToBookmark"?e.bookmarkEditing.goTo(t.name)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"the bookmark cannot be shown"}:(t.type==="insertBookmark"?e.bookmarkEditing.insert(t.name):t.type==="keepFirstBookmark"?e.bookmarkEditing.keepFirst(t.name):e.bookmarkEditing.remove(t.name))?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:e.state().lastRejection??`${t.type} was refused`})}function _C(e){if(!e)return null;let t=e.formatting();return {bold:t.bold,italic:t.italic,underline:t.underline,strike:t.strikethrough,superscript:t.superscript,subscript:t.subscript,...t.color?{color:{kind:"hex",value:t.color}}:{},...t.highlight?{highlight:t.highlight}:{},...t.fontFamily?{fontFamily:t.fontFamily}:{},...t.fontSizeHalfPoints!==null?{fontSizePt:t.fontSizeHalfPoints/2}:{},...t.alignment?{alignment:t.alignment}:{},...t.direction?{direction:t.direction}:{},...t.styleId?{styleId:t.styleId}:{},...t.lineSpacing?{lineSpacing:t.lineSpacing}:{},...t.spaceBeforePt!==null?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==null?{spaceAfterPt:t.spaceAfterPt}:{},...t.indent!==null?{indent:t.indent}:{},paragraphFlags:t.paragraphFlags,disagrees:t.disagrees,...t.tabStops!==null?{tabStops:t.tabStops}:{}}}var Ny=new WeakMap;function BC(e,t){let n=e.isScheduled(),r=Hy(t);return r?Ny.set(e,r):n||Ny.delete(e),r??(n?Ny.get(e)??null:null)}function Hy(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 bf(e){if(!e)return null;let{anchor:t,head:n}=e.state().selection;if(t.paragraphId===n.paragraphId){let c=e.session.paraIdOf(t.paragraphId);return c===null?null:{from:{paraId:c},to:{paraId:c}}}let r=e.session.paragraphAnchors(),o=r.paraIdByNode.get(t.paragraphId),i=r.paraIdByNode.get(n.paragraphId);if(o===void 0||i===void 0)return null;let a=r.ordinalByNode.get(t.paragraphId)??0,s=r.ordinalByNode.get(n.paragraphId)??0;return s<a||s===a&&n.offset<t.offset?{from:{paraId:i},to:{paraId:o}}:{from:{paraId:o},to:{paraId:i}}}function $C(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 WC(e,t){if(!e)return [];if(t!==void 0&&t.part!=="body")return [];let n=e.session.part(),r=e.session.paragraphAnchors();return d$2(n).map(o=>{let i=r.paraIdByNode.get(o.id),a=o.kind==="textValue"?void 0:i$3(o);return {...i!==void 0?{paraId:i}:{},text:Km(n,o.id)??"",...a!==void 0?{styleId:a}:{}}})}function ps(e){return e?e.state().pageCount:0}function _y(e,t="caret"){return e?e.currentPage(t):1}function z3(e,t){if(!Yo(e))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"not a table command"}};let n=vf(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 qC(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",...of(t)}}function vf(e,t){let n=qC(e,t),r=Tr(n),o=Cf$1(t.session.currentPackage());if(r.ok&&r.ops.some(i=>tm(n.part,o,i))&&(r={ok:false,code:"locked",reason:ea}),r.ok&&t.editingMode()==="suggest"){let i=My(r.ops,a=>eb$1(n.part,a)?.kind==="table",Oy(t.session,t.author()));i&&(r={ok:false,code:"unsupported",reason:i});}return r.ok?{can:{ok:true},plan:r}:{can:{ok:false,code:r.code,reason:r.reason},plan:r}}function lc(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 d=t?.activeScope?.()??{kind:"body"};if(d.kind!=="headerFooter"||d.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=Yi(e);if(!o.supported)return {ok:false,refusal:{ok:false,code:o.code??"unsupported",reason:o.reason}};if(!t)return {ok:false,refusal:{ok:false,code:"notFound",reason:"no document is loaded"}};if(o.mutating&&(n==="view"||!t.session.editable))return {ok:false,refusal:{ok:false,code:"locked",reason:"the document is read-only"}};let i=o.mutating?Vn(e,t):null;if(i)return {ok:false,refusal:i};let a=lC(e,t,sy(t));if(a)return {ok:false,refusal:a};let s=uC(e,t,sy(t));if(s)return {ok:false,refusal:s};if(e.type==="insertTextBox"){let d=Ah(t);return d?{ok:false,refusal:d}:{ok:true}}if(e.type==="adjustIndent"&&!t.canAdjustIndent(e.direction))return {ok:false,refusal:{ok:false,code:"unsupported",reason:e.direction==="decrease"?"the selection is already at the outermost level":"the selection cannot indent any further"}};if(e.type==="deleteText"&&Gn(t)){let d=fs({type:"deleteImage"},t);return d&&!d.ok?{ok:false,refusal:d}:{ok:true}}if(e.type==="copy"||e.type==="cut"||e.type==="deleteText"){let{anchor:d,head:u}=t.state().selection;if(d.paragraphId===u.paragraphId&&d.offset===u.offset)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing is selected"}}}if(e.type==="setParagraphStyle"&&!t.session.documentStyles().some(d=>d.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:QT}};if(e.type==="undo"&&!t.state().canUndo)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to undo"}};if(e.type==="redo"&&!t.state().canRedo)return {ok:false,refusal:{ok:false,code:"unsupported",reason:"nothing to redo"}};if(e.type==="insertTable"&&!t.canInsertTable(e.rows,e.cols))return {ok:false,refusal:{ok:false,code:"unsupported",reason:"a table can only be inserted at a caret in editable body, cell, or note text"}};let l=Fy(t,e);if(l)return {ok:false,refusal:l};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==="removeToc"){let d=t.removeTocRefusal(e.tocId);if(d)return {ok:false,refusal:{ok:false,...d}}}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 u=t.sectionBreakRefusal(e.kind==="section"?"nextPage":"continuous");if(u)return {ok:false,refusal:{ok:false,code:"unsupported",reason:u}}}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 d=t.headerFooterState?.();if((e.sectionIndex??d?.sectionIndex??0)===0)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"}}}if(Yo(e)){let d=z3(e,t);return d.ok?{ok:true,tablePlan:d.tablePlan}:d}let c=fs(e,t);return c&&!c.ok?{ok:false,refusal:c}:{ok:true}}function KC(e,t){let n=e.session.part();if(!t.startsWith(`${n.name}#`)||!eb$1(n,t))return true;let r=fb$1(n,t),o=0;for(;r;){if(r.kind==="tableCell"||r.kind==="generic"&&r.localName==="tc"||(o+=1)>64)return true;r=fb$1(n,r.id);}return false}function UC(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!KC(e,t.selection.head.paragraphId))return null;let r=qa(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 xf(e){if(!e)return null;let t=e.state(),n=t.cellSelection;if(!n&&!KC(e,t.selection.head.paragraphId))return null;let r=qa(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 jC(e){if(!e)return null;let t=qC({type:"splitCell",rows:1,cols:2},e),n=ra$1(t.layout,t.selection.head.paragraphId,t.cellSelection);if(!n||n.cellIds.length>1)return null;let r=dn(t.part,n.tableId,n.cellId);return r?{...r}:null}function VC(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 GC(e){return !!e&&ar(e.session.part(),e.state().selection.head)!==void 0}var ue={undo:["M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"],redo:["M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"],print:["M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"],file_download:["M480-320 280-520l56-58 104 104v-326h80v326l104-104 56 58-200 200ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],file_upload:["M440-320v-326L336-542l-56-58 200-200 200 200-56 58-104-104v326h-80ZM240-160q-33 0-56.5-23.5T160-240v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-160H240Z"],format_bold:["M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"],format_italic:["M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"],format_underlined:["M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"],strikethrough_s:["M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"],superscript:["M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"],subscript:["M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"],link:["M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"],format_clear:["m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"],format_paragraph:["M360-160v-240q-83 0-141.5-58.5T160-600q0-83 58.5-141.5T360-800h360v80h-80v560h-80v-560H440v560h-80Z"],format_shapes:["M40-40v-240h80v-400H40v-240h240v80h400v-80h240v240h-80v400h80v240H680v-80H280v80H40Zm240-160h400v-80h80v-400h-80v-80H280v80h-80v400h80v80Zm32-120 136-360h64l136 360h-62l-32-92H408l-32 92h-64Zm114-144h108l-52-150h-4l-52 150ZM120-760h80v-80h-80v80Zm640 0h80v-80h-80v80Zm0 640h80v-80h-80v80Zm-640 0h80v-80h-80v80Zm80-640Zm560 0Zm0 560Zm-560 0Z"],lock:["M240-80q-33 0-56.5-23.5T160-160v-400q0-33 23.5-56.5T240-640h40v-80q0-83 58.5-141.5T480-920q83 0 141.5 58.5T680-720v80h40q33 0 56.5 23.5T800-560v400q0 33-23.5 56.5T720-80H240Zm0-80h480v-400H240v400Zm240-120q33 0 56.5-23.5T560-360q0-33-23.5-56.5T480-440q-33 0-56.5 23.5T400-360q0 33 23.5 56.5T480-280ZM360-640h240v-80q0-50-35-85t-85-35q-50 0-85 35t-35 85v80Zm-120 480v-400 400Z"],format_align_left:["M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"],format_align_center:["M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"],format_align_right:["M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"],format_align_justify:["M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"],format_line_spacing:["M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"],format_list_bulleted:["M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"],format_list_numbered:["M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"],format_indent_increase:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"],format_indent_decrease:["M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"],format_color_text:["M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"],ink_highlighter:["M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"],format_color_reset:["M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"],arrow_drop_down:["M480-360 280-560h400L480-360Z"],table:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"],table_chart:["M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"],grid_on:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"],table_rows:["M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"],view_column:["M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"],border_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],select_all:["M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"],border_outer:["M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"],border_inner:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"],border_clear:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],add:["M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"],remove:["M200-440v-80h560v80H200Z"],delete:["M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"],delete_sweep:["M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"],call_merge:["m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"],call_split:["M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"],drag_indicator:["M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"],image:["M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"],format_image_left:["M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"],format_image_right:["M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"],horizontal_rule:["M160-440v-80h640v80H160Z"],flip_to_back:["M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],flip_to_front:["M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],open_with:["M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"],tune:["M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"],rotate_right:["M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"],rotate_left:["M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"],swap_horiz:["M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"],swap_vert:["M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"],shapes:["M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"],format_paint:["M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"],expand_more:["M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"],expand_less:["m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"],border_top:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_bottom:["M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_left:["M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"],border_right:["M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"],border_horizontal:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h720v60H120Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-660v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],border_vertical:["M120-120v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-720h60v720h-60Zm165 0v-60h60v60h-60Zm0-330v-60h60v60h-60Zm0-330v-60h60v60h-60Zm165 660v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Zm0-165v-60h60v60h-60Z"],padding:["M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"],text_rotation_none:["M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"],wrap_text:["M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"],height:["M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"],fit_width:["M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"],settings:["m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"],border_color:["M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"],format_color_fill:["m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"],vertical_align_top:["M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"],vertical_align_center:["M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"],vertical_align_bottom:["M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"],line_weight:["M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"],keyboard_arrow_up:["M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"],keyboard_arrow_down:["M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"],keyboard_arrow_left:["M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"],keyboard_arrow_right:["M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"],more_vert:["M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"],page_break:["M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"],branding_watermark:["M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h640q33 0 56.5 23.5T880-720v480q0 33-23.5 56.5T800-160H160Zm0-80h640v-480H160v480Zm320-60q66 0 113-37t47-93q0-29-13-58t-34-55q-21-26-50-49t-50-31q-21 8-50 31t-50 49q-21 26-34 55t-13 58q0 56 47 93t140 37Z"],arrow_back:["M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"],search:["M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z"],toc:["M120-240v-80h240v80H120Zm0-200v-80h480v80H120Zm0-200v-80h720v80H120Z"],bookmark:["M200-120v-640q0-33 23.5-56.5T280-840h400q33 0 56.5 23.5T760-760v640L480-240 200-120Zm80-122 200-86 200 86v-518H280v518Zm0-518h400-400Z"],bookmarks:["M120-40v-640q0-33 23.5-56.5T200-760h400q33 0 56.5 23.5T680-680v640L400-160 120-40Zm80-122 200-86 200 86v-518H200v518Zm560 2v-680H240v-80h520q33 0 56.5 23.5T840-840v680h-80ZM200-680h400-400Z"],done_all:["M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 57 57-425 424Zm0-226-57-56 198-198 57 56-198 198Z"],check_circle:["m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"],chat_bubble_outline:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],chat_bubble_check:["M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],check:["M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"],close:["m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"],add_comment:["M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],comment:["M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"],edit_note:["M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"],difference:["M500-520h80v-80h80v-80h-80v-80h-80v80h-80v80h80v80Zm-80 160h240v-80H420v80ZM320-200q-33 0-56.5-23.5T240-280v-560q0-33 23.5-56.5T320-920h280l240 240v400q0 33-23.5 56.5T760-200H320Zm0-80h440v-360L560-840H320v560ZM160-40q-33 0-56.5-23.5T80-120v-560h80v560h440v80H160Zm160-240v-560 560Z"],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 ms={activeTarget:"all",spec:{style:"single",size:8,color:{kind:"hex",value:"000000"}}},ZC=["table.borderTarget","table.borderColor","table.borderStyle","table.borderWidth","table.cellFill"];function By(e){return createT(en)(e)}function cc(e){return ZC.includes(e)}function Y3(e){return e!=null}var XC=[{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"}],YC=[{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"}],Q3=[{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 J3(e){return e==="all"||e==="outside"||e==="inside"||e==="top"||e==="bottom"||e==="left"||e==="right"}function e$(e){return e==="none"||J3(e)}function zC(e){if(!e||typeof e!="object")return false;let t=e.kind;return t==="hex"||t==="theme"||t==="auto"}function t$(e){return YC.some(t=>t.value===e)}function na(e,t,n){switch(t){case "table.borderTarget":return e$(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(!zC(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(!t$(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&&!zC(n)?null:{command:{type:"setCellFill",color:n},nextDraft:e};default:return null}}function $y(e,t=ms){switch(e){case "table.borderTarget":return {type:"setTableBorders",scope:t.activeTarget,spec:t.spec};case "table.borderColor":return na(t,e,{kind:"hex",value:"000000"})?.command??null;case "table.borderStyle":return na(t,e,"single")?.command??null;case "table.borderWidth":return na(t,e,8)?.command??null;case "table.cellFill":return {type:"setCellFill",color:{kind:"hex",value:"FFFF00"}};default:return null}}function n$(e){return XC.find(n=>n.value===e)?.labelKey??"table.borders.all"}function Wy(e){return ue[e]}var r$=new RegExp("^[\\p{L}\\p{M}\\p{N}'\\u2019\\u001F\\u00AD\\u200C\\u200D]$","u"),o$=/[\p{Script=Thai}\p{Script=Lao}\p{Script=Khmer}\p{Script=Myanmar}]/u;function qy(e,t){let n=e.charCodeAt(t);if(Number.isNaN(n))return false;let r=n>=56320&&n<=57343&&t>0?t-1:t,o=e.codePointAt(r);return o!==void 0&&r$.test(String.fromCodePoint(o))}function Sf(e,t,n,r,o){let i=[],a=0;for(let s of si$1(e,t,0,n,r,o))s.start>a&&i.push({start:a,end:s.start}),a=Math.max(a,s.end);return a<n&&i.push({start:a,end:n}),i}function Ky(e,t,n){let r=Ve(e,t).split("");for(let{line:i}of Xb$1(e,t)??[]){let a=$a(i,t);if(a)for(let s of a.spans){if(!(s.fieldAtom||s.noteNav||s.equation||s.unsupported))continue;let l=Math.min(s.range.end,r.length);for(let c=s.range.start;c<l;c+=1)r[c]=i$;}}let o=r.join("");for(let{start:i,end:a}of n){let s=Math.min(a,r.length);if(!(i<=0||s>=r.length||i>=s)&&!(!qy(o,i-1)||!qy(o,s)))for(let l=i;l<s;l+=1)r[l]="a";}return r.join("")}var i$="\uFFFC";function Uy(e,t,n){let r=s=>qy(e,s);if(t<=0||t>=e.length||n.has(t)||!r(t-1)||!r(t))return null;let o=t-1;for(;o>0&&r(o-1)&&!n.has(o);)o-=1;let i=t+1;for(;i<e.length&&r(i)&&!n.has(i);)i+=1;let a=s$(e,o,i,t);return a===void 0?{start:o,end:i}:a}function jy(e,t,n,r){return a$(e,t,n)?null:Uy(Ky(e,t,r),n,Me(e,t))}function wf(e,t){let{anchor:n,head:r}=t;if(n.paragraphId!==r.paragraphId||n.offset!==r.offset)return null;let o=jy(e,r.paragraphId,r.offset,[]);return o?{from:{paragraphId:r.paragraphId,offset:o.start},to:{paragraphId:r.paragraphId,offset:o.end}}:null}function a$(e,t,n){for(let{line:r}of Xb$1(e,t)??[]){let o=$a(r,t);if(o)for(let i of o.spans){let{start:a,end:s}=i.range;if(!(a===s||a>n||s<n)&&i.revisions?.some(l=>l.kind==="delete"||l.kind==="moveFrom"))return true}}return false}function s$(e,t,n,r){let o=e.slice(t,n);if(o$.test(o)){for(let i of G$2(o)){let a=t+i.utf16From,s=t+i.utf16To;if(r===a)return null;if(r>a&&r<s)return {start:a,end:s}}return null}}function dc(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 gs(e){let t=dc({}),n=false,r=false,o=()=>t.current().onRequest!==void 0,i=()=>{o()!==n&&(n=o(),e?.());};return {canOpen:o,open(){let a=t.current().onRequest;return a?.(),a!==void 0},shortcutOn:()=>t.current().shortcut!==false,openFromShortcut(){if(t.current().shortcut===false)return false;let a=t.current().onRequest;return a?.(),a!==void 0},current:()=>t.current(),register(a){let s=t.push(a);return i(),()=>{s(),!r&&(r=true,globalThis.queueMicrotask(()=>{r=false,i();}));}}}}function QC(e={}){let t=gs(e.changed),n=gs(e.changed),r=dc({}),o=null,i={current:r.current,onChange:a=>{o=a;},reportError:a=>e.error?.(a)};return {surfaceOptions:{onRequestBookmark:t.open,onRequestGoTo:n.openFromShortcut,bookmarkMarks:i},bookmarkDialog:t,goTo:n,setters:{setBookmarkChrome:a=>t.register(a),setGoToChrome:a=>n.register(a),setBookmarkMarks(a){let s=r.push(a);return o?.(),()=>{s(),o?.();}}}}}var l$=256,JC=new WeakMap;function c$(e){let t=ck(e),n=JC.get(t);return n||(n=new Map(t.map(r=>[r.root.id,r])),JC.set(t,n)),n}function tO(e,t){let n=c$(e);if(n.size===0||!eb$1(e,t))return null;let r=fb$1(e,t);for(let o=0;r&&o<l$;o+=1){let i=r.id,a=n.get(i);if(a)return {kind:"frame",id:a.root.id,drawingNodeId:a.drawingNodeId,hostParagraphId:a.hostParagraphId};r=fb$1(e,i);}return null}var eO=new WeakMap;function kf(e,t){let n=e&&de(e.session,t);if(!n)return null;let r=eO.get(n.root);r||eO.set(n.root,r=new Map);let o=r.get(t);if(o!==void 0)return o;let i=tO(n,t)?.hostParagraphId??null;return r.set(t,i),i}function Vy(e,t,n){let r=de(e.session,t.paragraphId),o=r&&tO(r,t.paragraphId);o&&e.setActiveScope(n?{...o,owner:{kind:"headerFooter",rId:n}}:o)&&e.setSelection({anchor:t,head:t});}function nO(e){let t=new Map,n=e.activeScope();if(n.kind!=="frame")return t;let r=de(e.session,n.id),o=r&&eb$1(r,n.id);if(!o)return t;let i=[o];for(;i.length>0;){let a=i.pop();a.kind==="paragraph"&&t.set(a.id,t.size);let s="children"in a?a.children:void 0;if(s)for(let l=s.length-1;l>=0;l-=1)i.push(s[l]);}return t}function rO(e,t){e.exitNote?.(),e.exitHeaderFooter?.(),Vy(e,t);}var If="no comment draft view is registered",oO=new WeakMap;function iO(e={}){let t=gs(e.changed);return {requests:{canOpen:t.canOpen,open:t.open},setters:{setCommentDraftChrome:r=>t.register(r)}}}function aO(e,t){oO.set(e,t);}function Gy(e){return oO.get(e)??null}function zy(e){let t=e.surface;if(!t||t.activatedReviewKey()!==null)return null;let n=t.state().selection;return wf(t.publishedLayout(),n)??d$(t,n)}function d$(e,{anchor:t,head:n}){if(t.paragraphId!==n.paragraphId||t.offset!==n.offset||kf(e,n.paragraphId)===null)return null;let r=de(e.session,n.paragraphId),o=r&&Km(r,n.paragraphId),i=o?Uy(o,n.offset,new Set):null;return i?{from:{paragraphId:n.paragraphId,offset:i.start},to:{paragraphId:n.paragraphId,offset:i.end}}:null}var Rf="no link view is registered",Zy={type:"insertHyperlink",href:"https://example.com"},sO=new WeakMap;function lO(e){let t=gs(e);return {requests:{canOpen:t.canOpen,open:t.open},current:t.current,open:t.open,register:r=>t.register(r)}}function cO(e,t){sO.set(e,t);}function Xy(e){return sO.get(e)??null}function Yy(e){let t=r=>({id:"text.link",enabled:false,disabledReason:r,active:false}),n=e.can(Zy);return n.ok?Xy(e)?.canOpen()?{id:"text.link",enabled:true,disabledReason:null,active:false}:t(Rf):t(n.reason)}function To(e){return e.surface??null}var u$={"review.revisionMarkup":{type:"openRevisionMarkupDialog"},"review.compareDocuments":{type:"openCompareDocumentsDialog"},"review.comments":{type:"toggleReviewPane"},"review.paragraphMarks":{type:"toggleParagraphMarks"},"review.bookmarks":{type:"toggleBookmarks"},"insert.bookmark":{type:"openBookmarkDialog"},"insert.goToBookmark":{type:"openGoTo"},"review.protectDocument":{type:"toggleDocumentProtection"},"review.simpleMarkup":{type:"setReviewDisplayMode",mode:"simple-markup"},"review.allMarkup":{type:"setReviewDisplayMode",mode:"all-markup"},"review.noMarkup":{type:"setReviewDisplayMode",mode:"proposed"},"review.original":{type:"setReviewDisplayMode",mode:"original"},"review.previousChange":{type:"navigateReviewChange",direction:"previous"},"review.nextChange":{type:"navigateReviewChange",direction:"next"},"review.acceptAllChanges":{type:"resolveAllReviewChanges",action:"accept"},"review.rejectAllChanges":{type:"resolveAllReviewChanges",action:"reject"},"history.undo":{type:"undo"},"history.redo":{type:"redo"},"text.bold":{type:"toggleMark",mark:"bold"},"text.italic":{type:"toggleMark",mark:"italic"},"text.underline":{type:"toggleMark",mark:"underline"},"text.strike":{type:"toggleMark",mark:"strike"},"script.super":{type:"toggleMark",mark:"superscript"},"script.sub":{type:"toggleMark",mark:"subscript"},"format.clear":{type:"clearFormatting"},"alignment.left":{type:"setAlignment",align:"left"},"alignment.center":{type:"setAlignment",align:"center"},"alignment.right":{type:"setAlignment",align:"right"},"alignment.justify":{type:"setAlignment",align:"justify"},"direction.ltr":{type:"setParagraphDirection",direction:"ltr"},"direction.rtl":{type:"setParagraphDirection",direction:"rtl"},"list.bullet":{type:"toggleList",kind:"bullet"},"list.numbered":{type:"toggleList",kind:"ordered"},"list.indent":{type:"adjustIndent",direction:"increase"},"list.outdent":{type:"adjustIndent",direction:"decrease"},"insert.textBox":{type:"insertTextBox"},"insert.footnote":{type:"insertNote",noteKind:"footnote"},"insert.endnote":{type:"insertNote",noteKind:"endnote"},"insert.pageNumber":{type:"insertPageField",field:"PAGE"},"insert.totalPages":{type:"insertPageField",field:"NUMPAGES"},"insert.sectionPages":{type:"insertPageField",field:"SECTIONPAGES"},"insert.pageXofY":{type:"insertPageField",field:"PAGE_X_OF_Y"},"insert.pageBreak":{type:"insertBreak",kind:"page"},"insert.sectionBreakNextPage":{type:"insertBreak",kind:"section"},"insert.sectionBreakContinuous":{type:"insertBreak",kind:"sectionContinuous"},"insert.toc":{type:"insertToc"},"contentControl.remove":{type:"removeContentControl"},"table.mergeCells":{type:"mergeCells"}};function f$(e){return fO[e]??null}var dO=Uint8Array.from(atob("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),e=>e.charCodeAt(0)),uO={"file.pageSetup":"page setup is not a command; render DocxEditor.PageSetupDialog with open and onClose","paragraph.dialog":"the paragraph dialog is not a command; render DocxEditor.ParagraphDialog with open and onClose"},fO={"text.link":Zy,"image.insert":{type:"insertImage",data:dO,mime:"image/png",widthPoints:72,heightPoints:72},"image.properties":{type:"setImageProperties",description:"probe"},"table.insert":{type:"insertTable",rows:1,cols:1},"file.pageSetup":{type:"setPageSetup",orientation:"portrait"},"paragraph.dialog":{type:"setParagraphFormat",alignment:"left"},"insert.watermark":{type:"setWatermark",watermark:{text:"DRAFT"}},"table.splitCell":{type:"splitCell",rows:1,cols:2}};function Tf(e){return u$[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"}},pO={"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 mO(e,t,n){return na(n,e,t)?.command??null}function Pf(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(cc(e))return mO(e,t,ms);if(e==="image.wrap")return typeof t!="string"||!Pe.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 gO(e,t,n=ms){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let r=$y(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 m$=["editing","suggesting","viewing"];function hO(e){let t="review.addComment",n=o=>({id:t,enabled:false,disabledReason:o,active:false}),r=e.can({type:"toggleReviewPane"});return r.ok?(e.getEditingMode?.()??"editing")==="viewing"?n("the document is open for viewing"):Gy(e)?.canOpen()?e.getSelectionPlacement()===null&&!zy(e)?n("a comment needs a selected range"):{id:t,enabled:true,disabledReason:null,active:false}:n(If):n(r.reason)}function yO(e,t){if(!e)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};if(cc(t))return gO(e,t);if(t==="review.editingMode"){let i=e.getEditingMode?.()??"editing",a=m$.filter(c=>c!==i).map(c=>e.can(Pf(t,c))),s=a.some(c=>c.ok),l=a.find(c=>!c.ok);return {id:t,enabled:s,disabledReason:!s&&l&&!l.ok?l.reason:null,active:false,value:i}}if(t==="format.painter"){let i=To(e);if(!i)return {id:t,enabled:false,disabledReason:"editor is not ready",active:false};let a=i.formatPainter.state();if(a.mode!=="off")return {id:t,enabled:true,disabledReason:null,active:true,value:a.mode};let s=e.can({type:"clearFormatting"});return s.ok?{id:t,enabled:true,disabledReason:null,active:false,value:a.mode}:{id:t,enabled:false,disabledReason:s.reason,active:false,value:a.mode}}if(t==="contentControl.showAll"||t==="contentControl.formFill"){let i=To(e),a=i?.state().contentControls,s=t==="contentControl.showAll"?a?.showAll??false:a?.formFill??false;return {id:t,enabled:i!==null,disabledReason:i?null:"editor is not ready",active:s}}if(t==="contentControl.inspector"){let i=To(e);return i?i.state().contentControls.activeControlId?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"no content control at the selection",active:false}:{id:t,enabled:false,disabledReason:"editor is not ready",active:false}}if(t==="review.addComment")return hO(e);if(t==="text.link")return Yy(e);if(t==="review.authors"){let i=e.can({type:"toggleReviewPane"});return i.ok?(e.getReviewAuthors?.().length??0)>0?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:"the document has no review authors",active:false}:{id:t,enabled:false,disabledReason:i.reason,active:false}}let n=Tf(t);if(!n){let i=pO[t];if(i!==void 0){let s=Pf(t,i);if(!s)return {id:t,enabled:false,disabledReason:"not wired to an editor command",active:false};let l=e.can(s),c=e.getSelectedImage?.()??null,d=t==="image.wrap"?c?.wrap:t==="image.altText"?c?.description:YT(e,t);return l.ok?{id:t,enabled:true,disabledReason:null,active:false,...d!==void 0?{value:d}:{}}:{id:t,enabled:false,disabledReason:l.reason,active:false,...d!==void 0?{value:d}:{}}}let a=fO[t];if(a){if(t==="image.insert"&&a.type==="insertImage"){let c=e.canExecuteImageCommand?.({type:"insertImage",data:dO,mime:"image/png",widthPoints:72,heightPoints:72})??e.can(a);return c.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:c.reason,active:false}}if(t==="image.properties"&&a.type==="setImageProperties"){let c=e.can(a);return c.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:c.reason,active:false}}if(t==="table.insert"&&a.type==="insertTable"){let c=e.can(a);return c.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:c.reason,active:false}}if(t==="table.splitCell"&&a.type==="splitCell"){let c=e.can(a),d=c.ok?null:e.query({type:"splitCellConfig"});for(let u of d?[2,d.maxRows]:[]){if(c.ok||u<2)break;let f=e.can({type:"splitCell",rows:u,cols:1});f.ok&&(c=f);}return c.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:c.reason,active:false}}if(t==="paragraph.dialog"&&a.type==="setParagraphFormat"){let c=e.can(a);return c.ok?{id:t,enabled:true,disabledReason:null,active:false}:{id:t,enabled:false,disabledReason:c.reason,active:false}}let s=e.can(a);if(!s.ok)return {id:t,enabled:false,disabledReason:s.reason,active:false};let l=uO[t];if(l)return {id:t,enabled:false,disabledReason:l,active:false}}return t==="file.exportMarkdown"||t==="file.exportPdf"?{id:t,enabled:false,active:false,disabledReason:"export is not a command; run it with runChromeExport(editor, format, handlers)"}:t==="file.print"?{id:t,enabled:false,active:false,disabledReason:"print is not a command; run it with runChromePrint(editor, handlers)"}:t==="file.save"?{id:t,enabled:false,disabledReason:"save is not a command; run it with runSave(editor)",active:false}:t==="file.open"?{id:t,enabled:false,disabledReason:"open is not a command; run it with editor.load(bytes)",active:false}:{id:t,enabled:false,disabledReason:"not wired to an editor command",active:false}}let r=e.can(n),o=e.isActive?.(n)??false;return r.ok?{id:t,enabled:true,disabledReason:null,active:o}:{id:t,enabled:false,disabledReason:r.reason,active:o}}function g$(e){if(e==="format.painter")return true;let t=Tf(e);return t?.type==="toggleMark"||t?.type==="toggleParagraphMarks"||t?.type==="toggleBookmarks"||t?.type==="toggleDocumentProtection"||t?.type==="setReviewDisplayMode"||t?.type==="setAlignment"||t?.type==="setParagraphDirection"}function h$(e,t){return t.map(n=>yO(e,n))}function y$(e,t,n,r){if(!e)return {result:{ok:false,code:"unsupported",reason:"editor is not ready"},nextDraft:null};let o=na(r,t,n);if(!o)return {result:{ok:false,code:"unsupported",reason:"invalid table chrome value"},nextDraft:null};let i=e.can(o.command);if(!i.ok)return {result:{ok:false,code:i.code,reason:i.reason},nextDraft:null};let a=e.exec(o.command);return a.ok?{result:a,nextDraft:o.nextDraft}:{result:a,nextDraft:null}}var b$=new Set(["format.painter","contentControl.showAll","contentControl.formFill","contentControl.inspector","contentControl.remove","review.addComment"]);function v$(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||pO[t]!==void 0||cc(t))return {ok:false,code:"invalidArgs",reason:"pass a toolbar value before command options"};r=n,n=void 0;}if(r?.historyGroup!==void 0&&b$.has(t))return {ok:false,code:"unsupported",reason:`${t} does not take a history group`};if(t==="format.painter"){let a=To(e);if(!a)return {ok:false,code:"unsupported",reason:"editor is not ready"};if(a.formatPainter.state().mode==="off"){let s=e.can({type:"clearFormatting"});if(!s.ok)return {ok:false,code:s.code,reason:s.reason}}return a.formatPainter.press()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:tf}}if(t==="text.link"){let a=Yy(e);return a.enabled?Xy(e)?.open()?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:Rf}:{ok:false,code:"unsupported",reason:a.disabledReason??Rf}}if(t==="review.addComment"){let a=hO(e);if(!a.enabled)return {ok:false,code:"unsupported",reason:a.disabledReason??If};let s=e.getSelectionPlacement()===null?zy(e):null,l=s?To(e):null,c=l?.state().selection;return s&&l?.setSelection({anchor:s.from,head:s.to}),Gy(e)?.open()?{ok:true,changed:false}:(c&&l?.setSelection(c),{ok:false,code:"unsupported",reason:If})}if(t==="contentControl.showAll"){let a=To(e);return a?(a.contentControls.setShowAll(!a.contentControls.showAll()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.formFill"){let a=To(e);return a?(a.contentControls.setFormFill(!a.contentControls.formFill()),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.inspector"){let a=To(e);return a?a.state().contentControls.activeControlId?{ok:true,changed:false}:{ok:false,code:"notFound",reason:"no content control at the selection"}:{ok:false,code:"unsupported",reason:"editor is not ready"}}if(t==="contentControl.remove"){let a=To(e);if(!a)return {ok:false,code:"unsupported",reason:"editor is not ready"};let s=a.state().contentControls.activeControlId;if(!s)return {ok:false,code:"notFound",reason:"no content control at the selection"};let l=a.contentControls.disabledReason(s,"remove");return l?{ok:false,code:l==="bound"?"bound":"locked",reason:l}:a.contentControls.remove(s)?{ok:true,changed:true}:{ok:false,code:a.state().lastRejection??"unsupported",reason:a.state().lastRejection??"removeContentControl was refused"}}let o=n===void 0?Tf(t):Pf(t,n);if(!o){if(n!==void 0)return {ok:false,code:"unsupported",reason:"invalid value for toolbar command"};if(t==="file.exportMarkdown"||t==="file.exportPdf")return {ok:false,code:"unsupported",reason:"export is not a command; run it with runChromeExport(editor, format, handlers)"};if(t==="file.print")return {ok:false,code:"unsupported",reason:"print is not a command; run it with runChromePrint(editor, handlers)"};if(t==="file.save")return {ok:false,code:"unsupported",reason:"save is not a command; run it with runSave(editor)"};if(t==="file.open")return {ok:false,code:"unsupported",reason:"open is not a command; run it with editor.load(bytes)"};let a=uO[t];return a?{ok:false,code:"unsupported",reason:a}:{ok:false,code:"unsupported",reason:"not wired to an editor command"}}let i=e.can(o,r);return i.ok?e.exec(o,r):{ok:false,code:i.code,reason:i.reason}}function x$(e){return e?e.save():Promise.reject(new Error("editor is not ready"))}function S$(e,t){if(!e)return {enabled:false,disabledReason:"editor is not ready"};let n=vf(t,e);return n.can.ok?{enabled:true,disabledReason:null}:{enabled:false,disabledReason:n.can.reason}}function w$(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 Qy(e){return e instanceof Uint8Array?Array.from(e):Array.isArray(e)?e.map(Qy):e===null||typeof e!="object"?e:Object.fromEntries(Object.keys(e).sort().map(t=>[t,Qy(e[t])]))}function k$(e){return JSON.stringify(Qy(e))}var Jy=["zoom","script","format","list","alignment","styles","font","text","history"],I$=new Set(["review"]),eb=24;function bO(e,t=Jy){let n=t.indexOf(e);return n===-1?void 0:(n+1)*10}function R$(e,t=Jy,n){let r=[],o=[];return e.forEach((i,a)=>{let s=n?.get(i)??bO(i,t);s===void 0||Number.isNaN(s)?o.push(i):r.push({id:i,priority:s,position:a});}),r.sort((i,a)=>i.priority-a.priority||a.position-i.position),[...o.reverse(),...r.map(i=>i.id)]}function P$(e,t){let n=[...e],r=new Map,o=t.filter(i=>!e.includes(i.id));for(;o.length>0;){let i=[];for(let a of o){let s=a.after;if(s===void 0||s===a.id){n.push(a.id);continue}if(!n.includes(s)){i.push(a);continue}let l=r.get(s)??s;n.splice(n.indexOf(l)+1,0,a.id),r.set(s,a.id);}if(i.length===o.length){n.push(...i.map(a=>a.id));break}o=i;}return n}var tb=8;function T$(e){let t=e.margin??tb,n=Math.max(0,e.viewportWidth-t*2),r=Math.min(e.panelWidth,n),o=t,i=e.viewportWidth-t-r,a=e.triggerRight-r;if(a>=o&&a<=i)return {left:a,maxWidth:n,anchor:"end"};let s=e.triggerLeft;return s>=o&&s<=i?{left:s,maxWidth:n,anchor:"start"}:{left:Math.max(o,Math.min(a,i)),maxWidth:n,anchor:"clamped"}}function E$(e){let t=e.margin??tb,n=e.viewportWidth-t-e.popupWidth;return Math.max(t,Math.min(e.anchorLeft,n))}var Cf="data-toolbar-item",nb="host-content",xO=new Map;function SO(e,t){return `${e}\0${t}`}function C$(e){return e.map(t=>[t.id,...t.items].join("")).join("\0")}function O$(e,t){return t?[...e,nb]:[...e]}function M$(e,t){return e?t.includes(nb):t.length>0}function wO(e,t,n){return Math.max(0,n-(e.get(t)??0))}function kO(e,t,n){return e.itemWidths.get(SO(t,n))??0}function uc(e,t,n){if(n<=0)return 0;let r=0,o=0;for(let a=0;a<n&&a<t.items.length;a+=1){let s=kO(e,t.id,t.items[a]);s>0&&(r+=s,o+=1);}let i=e.groupGaps?.get(t.id)??e.gap;return (e.groupBases.get(t.id)??0)+r+Math.max(0,o-1)*i}function vO(e,t){let n=e.fixed;for(let i of e.groups)n+=uc(e,i,i.items.length);if(n<=t)return xO;n+=e.more;let r=new Map(e.groups.map(i=>[i.id,i])),o=new Map;for(let i of e.order){if(n<=t)break;let a=r.get(i);if(!a||o.has(i))continue;let s=a.items.length;for(let l=s-1;l>=0;l-=1){let c=uc(e,a,l+1)-uc(e,a,l);if(!(c<=0)){if(n-=c,o.set(i,s-l),l>0&&!A$(e,a,l)){n-=uc(e,a,l),o.set(i,s);break}if(n<=t)break}}}return o}function A$(e,t,n){for(let r=0;r<n&&r<t.items.length;r+=1)if(kO(e,t.id,t.items[r])>0)return true;return false}function L$(e,t){let n=e.fixed;for(let r of e.groups)n+=uc(e,r,wO(t,r.id,r.items.length));return t.size>0?n+e.more:n}function Ef(e){let t=0;for(let n of e.values())t+=n;return t}function IO(e,t){if(e===t)return true;if(e.size!==t.size)return false;for(let[n,r]of e)if(t.get(n)!==r)return false;return true}function F$(e,t){let n=new Map(t.map(r=>[r.id,r.items.length]));for(let[r,o]of e){let i=n.get(r);if(i===void 0||o>i)return null}return e}function D$(e){if(!(e.available>0))return xO;let t=vO(e,e.available),n=e.previous?F$(e.previous,e.groups):null;if(!n||n.size===0||Ef(t)>=Ef(n))return t;let r=vO(e,e.available-(e.hysteresis??eb));return IO(r,n)?n:Ef(r)>Ef(n)?L$(e,n)<=e.available?n:t:r}function RO(e,t,n,r){return e+t+n+r*2}function rb(e,t){return e+t}function PO(e){let t=Number.parseFloat(e.marginInlineStart||e.marginLeft),n=Number.parseFloat(e.marginInlineEnd||e.marginRight);return {start:Number.isFinite(t)?t:0,end:Number.isFinite(n)?n:0}}function Er(e){let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function TO(e){return Er(e.columnGap)}function EO(e){if(!(e.parentContent>0))return e.own;let t=e.parentContent-e.siblings-e.margins;return e.maxWidth!==null&&(t=Math.min(t,e.maxWidth)),Math.max(e.own,t-e.chrome)}function CO(e){return e.position==="absolute"||e.position==="fixed"||e.display==="none"}function OO(e){let t=e.computedStyleMap;if(typeof t!="function")return null;try{return t.call(e)}catch{return null}}function ob(e,t){let n=e?.get(t);return n&&typeof n.value=="string"?n.value:null}var N$=new Set(["auto","max-content","fit-content","min-content"]);function MO(e){return e.display.includes("flex")&&!e.flexDirection.startsWith("column")&&!e.flexWrap.startsWith("wrap")}function Mf(e,t,n){return ob(e,`margin-${n}`)==="auto"?0:Er(n==="left"?t.marginLeft:t.marginRight)}function H$(e){return /^(input|textarea|select|button|img|video|canvas|iframe|svg)$/i.test(e.tagName)?true:e.children.length>0||(e.textContent??"").trim().length>0}function _$(e,t,n){let r=t.flexBasis.trim(),o=r.endsWith("px")?Er(r):0,i=ob(n,"min-width")??t.minWidth.trim();return i==="auto"||i===""?H$(e)?null:o:/^[\d.]+px$/.test(i)?Math.max(o,Er(i)):null}function AO(e,t,n){for(let r of e.childNodes){if(r.nodeType===3&&(r.textContent??"").trim().length>0)return false;if(!Wt(r))continue;let o=Ae(r).getComputedStyle(r);if(o.display==="contents"){if(!AO(r,t,n))return false;continue}if(CO(o)||(n.items+=1,r===t))continue;let i=OO(r),s=Number.parseFloat(o.flexGrow)>0?_$(r,o,i):r.getBoundingClientRect().width;if(s===null)return false;n.width+=s+Mf(i,o,"left")+Mf(i,o,"right");}return true}function B$(e,t){if(!MO(t)||!e.parentElement)return 0;let n={width:0,items:0};return AO(e.parentElement,e,n)?n.width+Math.max(0,n.items-1)*Er(t.columnGap):null}function $$(e,t,n){let r=e.maxWidth.trim();if(r==="none"||r==="")return null;let o;if(/^-?[\d.]+%$/.test(r))o=Number.parseFloat(r)/100*t;else if(/^-?[\d.]+px$/.test(r))o=Number.parseFloat(r);else return;if(Number.isFinite(o))return e.boxSizing==="border-box"?o:o+n}var W$="[data-toolbar-group], [data-toolbar-fixed], [data-toolbar-more]";function ib(e,t){let n=e.getBoundingClientRect();if(!(n.width>0))return null;let r=n.left+e.clientLeft+Er(t.paddingLeft),o=n.left+e.clientLeft+e.clientWidth-Er(t.paddingRight);for(let i of e.querySelectorAll(W$)){let a=i.getBoundingClientRect();if(a.width!==0&&(a.right>o+1||a.left<r-1))return true}return false}var fc=new WeakMap,Of=new WeakMap;function q$(e,t,n,r){let o=e.parentElement;if(!o||CO(t)||(t.cssFloat||t.getPropertyValue("float")||"none")!=="none")return null;let i=OO(e),a=ob(i,"width");if(a===null||!N$.has(a))return null;let s=Ae(o).getComputedStyle(o),l=MO(s),c=s.display.includes("flex")&&s.flexDirection.startsWith("column"),d=(s.display==="block"||s.display==="flow-root"||c)&&!t.display.startsWith("inline");if(!l&&!d||l&&Number.parseFloat(t.flexGrow)>0)return null;let u=o.clientWidth-Er(s.paddingLeft)-Er(s.paddingRight),f=Math.max(0,e.offsetWidth-e.clientWidth)+r,p=B$(e,s),g=$$(t,u,f);return p===null||g===void 0?null:{room:EO({own:n,parentContent:u,siblings:p,margins:Mf(i,t,"left")+Mf(i,t,"right"),chrome:f,maxWidth:g}),parentContent:u}}function LO(e,t){let n=Er(t.paddingLeft)+Er(t.paddingRight),r=e.clientWidth-n,o=q$(e,t,r,n);if(!o)return fc.delete(e),Of.delete(e),r;let i=fc.get(e);if(i&&i.parentContent!==o.parentContent&&fc.delete(e),ib(e,t)===true)return Of.get(e)&&fc.set(e,{parentContent:o.parentContent,cap:r}),Of.set(e,false),r;let a=fc.get(e)?.cap??Number.POSITIVE_INFINITY,s=Math.max(r,Math.min(o.room,a));return Of.set(e,s>r),s}function K$(e){let t=e.getBoundingClientRect().width;return t>0&&e.offsetWidth>0?e.offsetWidth/t:1}function pc(e,t){let n=e.getBoundingClientRect().width;if(n>0)return n*t;let r=e.offsetWidth;return typeof r=="number"&&r>0?r:0}function U$(e){if(e.children.length>0)return true;for(let t of e.childNodes)if(t.nodeType===3&&(t.textContent??"").length>0)return true;return false}function j$(e,t,n){let r=e.getComputedStyle(t).columnGap.trim();return r==="normal"?0:/^-?[\d.]+px$/.test(r)?Number.parseFloat(r):n}function V$(e,t,n){let r=Ae(e),o=r.getComputedStyle(e),i=TO(o),a=LO(e,o),s=K$(e),l=e.querySelector(".docx-toolbar__separator"),c=i*2;if(l){let f=PO(r.getComputedStyle(l));c=RO(pc(l,s),f.start,f.end,i);}for(let f of e.querySelectorAll("[data-toolbar-group]")){let p=f.getAttribute("data-toolbar-group"),g=pc(f,s);if(!p||!(g>0))continue;let y=[];for(let v of f.children)v.hasAttribute(Cf)&&y.push(v);if(y.length===0){t.itemWidths.set(n(p,p),g),t.groupBases.set(p,c);continue}let h=j$(r,f,i);t.groupGaps.set(p,h);let b=0,x=0;for(let v of y){let k=v.getAttribute(Cf)??"";if(!U$(v)){t.itemWidths.set(n(p,k),0);continue}let E=pc(v,s);E>0&&(t.itemWidths.set(n(p,k),E),b+=E,x+=1);}let S=Math.max(0,g-b-Math.max(0,x-1)*h);t.groupBases.set(p,c+S);}let d=0;for(let f of e.querySelectorAll("[data-toolbar-fixed]")){let p=pc(f,s);p>0&&(d+=rb(p,i));}let u=e.querySelector("[data-toolbar-more]");if(u){let f=pc(u,s);f>0&&(t.more=rb(f,i));}return {available:a,gap:i,fixed:d,more:t.more,overflowing:ib(e,o)}}var z$=/^[a-z]$/;function Af(e){let t=e.key.toLowerCase();if(z$.test(t))return t;let n=e.code??"";return n.length===4&&n.startsWith("Key")?n[3].toLowerCase():""}function ab(e,t=isApplePlatform()){if(e.shiftKey||e.isComposing)return false;if(t){if(!e.metaKey||!e.altKey||e.ctrlKey)return false}else if(!e.ctrlKey||e.metaKey||e.altKey)return false;return Af(e)==="g"}function FO(e){let t=[],n=r=>{for(let o of r)o.kind==="item"?t.push(o.slot):o.kind==="submenu"&&n(o.items);};for(let r of e)n(r.entries);return t}var DO={id:"file",labelKey:"toolbar.file",contextual:true,controls:[{id:"open",labelKey:"toolbar.open",paths:ue.file_upload,state:{kind:"load"}},{id:"save",labelKey:"toolbar.saveShortcut",paths:ue.file_download,state:{kind:"save"}},{id:"exportMarkdown",labelKey:"toolbar.exportMarkdown",paths:ue.file_download,state:{kind:"export"}},{id:"exportPdf",labelKey:"toolbar.exportPdf",paths:ue.file_download,state:{kind:"export"}},{id:"print",labelKey:"toolbar.print",paths:ue.print,state:{kind:"export"}},{id:"pageSetup",labelKey:"toolbar.pageSetup",paths:ue.settings,state:{kind:"command"}}]};var NO={id:"review",labelKey:"formattingBar.commentsAndChanges",controls:[{id:"revisionMarkup",shape:"icon",labelKey:"revisionMarkup.title",defaultToolbar:false,paths:ue.edit_note,state:{kind:"command"}},{id:"simpleMarkup",shape:"icon",labelKey:"review.simpleMarkup",defaultToolbar:false,paths:ue.visibility,state:{kind:"command"}},{id:"allMarkup",shape:"icon",labelKey:"review.allMarkup",defaultToolbar:false,paths:ue.visibility,state:{kind:"command"}},{id:"noMarkup",shape:"icon",labelKey:"review.noMarkup",defaultToolbar:false,paths:ue.visibility,state:{kind:"command"}},{id:"original",shape:"icon",labelKey:"review.original",defaultToolbar:false,paths:ue.visibility,state:{kind:"command"}},{id:"previousChange",shape:"icon",labelKey:"review.previousChange",defaultToolbar:false,paths:ue.keyboard_arrow_up,state:{kind:"command"}},{id:"nextChange",shape:"icon",labelKey:"review.nextChange",defaultToolbar:false,paths:ue.keyboard_arrow_down,state:{kind:"command"}},{id:"acceptAllChanges",shape:"icon",labelKey:"review.acceptAllChanges",defaultToolbar:false,paths:ue.check,state:{kind:"command"}},{id:"rejectAllChanges",shape:"icon",labelKey:"review.rejectAllChanges",defaultToolbar:false,paths:ue.close,state:{kind:"command"}},{id:"paragraphMarks",shape:"icon",labelKey:"formattingBar.paragraphMarks",defaultToolbar:false,paths:ue.format_paragraph,state:{kind:"command"}},{id:"bookmarks",shape:"icon",labelKey:"formattingBar.showBookmarks",defaultToolbar:false,paths:ue.bookmarks,state:{kind:"command"}},{id:"protectDocument",shape:"icon",labelKey:"review.protectDocument",defaultToolbar:false,paths:ue.lock,state:{kind:"command"}},{id:"compareDocuments",shape:"icon",labelKey:"review.compareDocuments",defaultToolbar:false,paths:ue.difference,state:{kind:"command"}},{id:"comments",shape:"icon",labelKey:"formattingBar.commentsAndChanges",paths:ue.comment,state:{kind:"command"}},{id:"addComment",shape:"icon",labelKey:"formattingBar.addComment",defaultToolbar:false,paths:ue.add_comment,state:{kind:"command"}},{id:"authors",shape:"dropdown",labelKey:"reviewers.label",paths:ue.visibility,defaultToolbar:false,state:{kind:"command"}},{id:"editingMode",shape:"dropdown",labelKey:"editingMode.label",valueKey:"editingMode.editing",paths:ue.edit_note,state:{kind:"command"}}]};var lb=[{id:"history",labelKey:"formattingBar.groups.history",controls:[{id:"undo",labelKey:"formattingBar.undoShortcut",paths:ue.undo,state:{kind:"command"}},{id:"redo",labelKey:"formattingBar.redoShortcut",paths:ue.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:ue.format_bold,state:{kind:"command"}},{id:"italic",labelKey:"formattingBar.italicShortcut",paths:ue.format_italic,state:{kind:"command"}},{id:"underline",labelKey:"formattingBar.underlineShortcut",paths:ue.format_underlined,state:{kind:"command"}},{id:"strike",labelKey:"formattingBar.strikethrough",paths:ue.strikethrough_s,state:{kind:"command"}},{id:"color",shape:"colorSplit",swatch:"#ff0000",labelKey:"formattingBar.fontColor",paths:ue.format_color_text,state:{kind:"value"}},{id:"highlight",shape:"colorSplit",swatch:"#ffff00",labelKey:"formattingBar.highlightColor",paths:ue.ink_highlighter,state:{kind:"value"}},{id:"link",labelKey:"formattingBar.insertLinkShortcut",paths:ue.link,state:{kind:"command"}}]},{id:"script",labelKey:"formattingBar.groups.script",controls:[{id:"super",labelKey:"formattingBar.superscript",paths:ue.superscript,state:{kind:"command"}},{id:"sub",labelKey:"formattingBar.subscript",paths:ue.subscript,state:{kind:"command"}}]},{id:"alignment",labelKey:"formattingBar.groups.alignment",controls:[{id:"left",labelKey:"alignment.alignLeft",paths:ue.format_align_left,state:{kind:"command"}},{id:"center",labelKey:"alignment.center",paths:ue.format_align_center,state:{kind:"command"}},{id:"right",labelKey:"alignment.alignRight",paths:ue.format_align_right,state:{kind:"command"}},{id:"justify",labelKey:"alignment.justify",paths:ue.format_align_justify,state:{kind:"command"}}]},{id:"direction",labelKey:"formattingBar.groups.direction",contextual:true,controls:[{id:"ltr",labelKey:"toolbar.leftToRight",paths:ue.format_textdirection_l_to_r,state:{kind:"command"}},{id:"rtl",labelKey:"toolbar.rightToLeft",paths:ue.format_textdirection_r_to_l,state:{kind:"command"}}]},{id:"list",labelKey:"formattingBar.groups.listFormatting",controls:[{id:"bullet",labelKey:"lists.bulletList",paths:ue.format_list_bulleted,state:{kind:"command"}},{id:"numbered",labelKey:"lists.numberedList",paths:ue.format_list_numbered,state:{kind:"command"}},{id:"outdent",labelKey:"lists.decreaseIndent",paths:ue.format_indent_decrease,state:{kind:"command"}},{id:"indent",labelKey:"lists.increaseIndent",paths:ue.format_indent_increase,state:{kind:"command"}},{id:"lineSpacing",shape:"dropdown",labelKey:"lineSpacing.label",paths:ue.format_line_spacing,state:{kind:"command"}}]},{id:"format",labelKey:"formattingBar.groups.format",controls:[{id:"painter",labelKey:"formattingBar.formatPainterShortcut",paths:ue.format_paint,state:{kind:"command"}},{id:"clear",labelKey:"formattingBar.clearFormatting",paths:ue.format_clear,state:{kind:"command"}}]},NO,{id:"contentControl",labelKey:"contentControl.group",contextual:true,controls:[{id:"showAll",labelKey:"contentControl.showAll",paths:ue.visibility,state:{kind:"command"}},{id:"formFill",labelKey:"contentControl.formFill",paths:ue.edit_note,state:{kind:"command"}},{id:"inspector",labelKey:"contentControl.inspector",paths:ue.tune,state:{kind:"command"}},{id:"remove",labelKey:"contentControl.remove",paths:ue.delete,state:{kind:"command"}}]},{id:"image",labelKey:"formattingBar.groups.image",contextual:true,controls:[{id:"insert",labelKey:"toolbar.image",paths:ue.image,state:{kind:"command"}},{id:"properties",labelKey:"formattingBar.imagePropertiesShortcut",paths:ue.tune,state:{kind:"command"}},{id:"wrap",shape:"dropdown",labelKey:"formattingBar.imageWrap",paths:ue.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:ue.table,state:{kind:"command"}},{id:"borderTarget",shape:"dropdown",labelKey:"table.borders.tooltip",paths:ue.border_all,state:{kind:"value"}},{id:"borderColor",shape:"colorSplit",swatch:"#000000",labelKey:"table.borderColor",paths:ue.border_color,state:{kind:"value"}},{id:"borderStyle",shape:"dropdown",labelKey:"table.borders.styleAriaLabel",paths:ue.border_horizontal,state:{kind:"value"}},{id:"borderWidth",shape:"dropdown",labelKey:"table.borderWidth",paths:ue.line_weight,state:{kind:"value"}},{id:"cellFill",shape:"colorSplit",swatch:"#ffffff",labelKey:"table.cellFillColor",paths:ue.format_color_fill,state:{kind:"value"}},{id:"mergeCells",labelKey:"table.mergeCells",paths:ue.call_merge,state:{kind:"command"}},{id:"splitCell",labelKey:"table.splitCell",paths:ue.call_split,state:{kind:"command"}}]},{id:"paragraph",labelKey:"dialogs.paragraph.title",contextual:true,controls:[{id:"dialog",labelKey:"lineSpacing.options",paths:ue.format_line_spacing,state:{kind:"command"}}]},DO,{id:"insert",labelKey:"toolbar.insert",contextual:true,controls:[{id:"textBox",labelKey:"toolbar.insertTextBox",paths:ue.format_shapes,state:{kind:"command"}},{id:"footnote",labelKey:"toolbar.insertFootnote",paths:ue.superscript,state:{kind:"command"}},{id:"endnote",labelKey:"toolbar.insertEndnote",paths:ue.edit_note,state:{kind:"command"}},{id:"pageNumber",labelKey:"headerFooter.insertPageNumber",paths:ue.format_list_numbered,state:{kind:"command"}},{id:"totalPages",labelKey:"headerFooter.insertTotalPages",paths:ue.format_list_numbered,state:{kind:"command"}},{id:"sectionPages",labelKey:"headerFooter.insertSectionPages",paths:ue.format_list_numbered,state:{kind:"command"}},{id:"pageXofY",labelKey:"headerFooter.insertPageXofY",paths:ue.format_list_numbered,state:{kind:"command"}},{id:"pageBreak",labelKey:"toolbar.pageBreak",paths:ue.page_break,state:{kind:"command"}},{id:"sectionBreakNextPage",labelKey:"toolbar.sectionBreakNextPage",paths:ue.horizontal_rule,state:{kind:"command"}},{id:"sectionBreakContinuous",labelKey:"toolbar.sectionBreakContinuous",paths:ue.border_horizontal,state:{kind:"command"}},{id:"toc",labelKey:"toolbar.tableOfContents",paths:ue.toc,state:{kind:"command"}},{id:"bookmark",labelKey:"toolbar.bookmark",paths:ue.bookmark,state:{kind:"command"}},{id:"goToBookmark",labelKey:"toolbar.goToBookmark",paths:ue.bookmarks,state:{kind:"command"}},{id:"watermark",labelKey:"toolbar.watermark",paths:ue.branding_watermark,state:{kind:"command"}}]}],sb=lb;function Z$(e,t){return `${e.id}.${t.id}`}function HO(){return sb.filter(e=>!e.contextual).map(e=>({...e,controls:e.controls.filter(t=>t.defaultToolbar!==false)}))}function X$(e,t){let n=HO(),r=t?.direction?sb.find(a=>a.id==="direction"):void 0,o=n.findIndex(a=>a.id==="alignment")+1;if(r&&o>0&&(n=[...n.slice(0,o),r,...n.slice(o)]),!e)return n;let i=sb.find(a=>a.id==="image");return i?[...n,i]:n}var _O=[{id:"file",labelKey:"toolbar.file",entries:[{kind:"item",slot:"file.open",shortcutKey:"toolbar.openShortcut"},{kind:"item",slot:"file.save",labelKey:"toolbar.save",shortcutKey:"toolbar.saveShortcut"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.export",paths:ue.file_download,items:[{kind:"item",slot:"file.exportMarkdown"},{kind:"item",slot:"file.exportPdf"}]},{kind:"item",slot:"file.print",shortcutKey:"toolbar.printShortcut"},{kind:"item",slot:"file.pageSetup"}]},{id:"format",labelKey:"toolbar.format",entries:[{kind:"item",slot:"text.bold",labelKey:"formattingBar.bold"},{kind:"item",slot:"text.italic",labelKey:"formattingBar.italic"},{kind:"item",slot:"text.underline",labelKey:"formattingBar.underline"},{kind:"item",slot:"text.strike"},{kind:"separator"},{kind:"item",slot:"alignment.left"},{kind:"item",slot:"alignment.center"},{kind:"item",slot:"alignment.right"},{kind:"item",slot:"alignment.justify"},{kind:"separator"},{kind:"item",slot:"direction.ltr"},{kind:"item",slot:"direction.rtl"},{kind:"separator"},{kind:"item",slot:"paragraph.dialog"},{kind:"separator"},{kind:"item",slot:"format.painter",labelKey:"formattingBar.formatPainter"},{kind:"item",slot:"format.clear"}]},{id:"insert",labelKey:"toolbar.insert",entries:[{kind:"item",slot:"image.insert"},{kind:"item",slot:"insert.textBox"},{kind:"item",slot:"table.insert",picker:"tableGrid"},{kind:"separator"},{kind:"item",slot:"insert.footnote"},{kind:"item",slot:"insert.endnote"},{kind:"separator"},{kind:"submenu",labelKey:"toolbar.break",paths:ue.page_break,items:[{kind:"item",slot:"insert.pageBreak"},{kind:"item",slot:"insert.sectionBreakNextPage"},{kind:"item",slot:"insert.sectionBreakContinuous"}]},{kind:"item",slot:"insert.toc"},{kind:"item",slot:"insert.bookmark",shortcutKey:"toolbar.bookmarkShortcut"},{kind:"item",slot:"insert.goToBookmark"},{kind:"item",slot:"insert.watermark"}]},{id:"review",labelKey:"toolbar.review",entries:[{kind:"submenu",labelKey:"review.displayForReview",paths:ue.visibility,items:[{kind:"item",slot:"review.simpleMarkup"},{kind:"item",slot:"review.allMarkup"},{kind:"item",slot:"review.noMarkup"},{kind:"item",slot:"review.original"}]},{kind:"separator"},{kind:"item",slot:"review.revisionMarkup"},{kind:"item",slot:"review.previousChange"},{kind:"item",slot:"review.nextChange"},{kind:"separator"},{kind:"item",slot:"review.acceptAllChanges"},{kind:"item",slot:"review.rejectAllChanges"},{kind:"separator"},{kind:"item",slot:"review.paragraphMarks"},{kind:"item",slot:"review.bookmarks"},{kind:"separator"},{kind:"item",slot:"review.protectDocument"},{kind:"separator"},{kind:"item",slot:"review.compareDocuments"}]},{id:"help",labelKey:"toolbar.help",entries:[]}];function Y$(){return FO(_O)}function Q$(){return lb.reduce((e,t)=>e+t.controls.length,0)}var J$="formattingBar.unavailableInPreview";function eW(e,t){let n=eb$1(e,t);if(!n||n.kind==="textValue")return null;let r=fb$1(e,t),o="http://schemas.openxmlformats.org/markup-compatibility/2006";if(r?.namespaceUri===o&&(r.localName==="Choice"||r.localName==="Fallback")){let i=fb$1(e,r.id);if(i?.namespaceUri===o&&i.localName==="AlternateContent")return i}return n}function mc(e){return e.map(t=>{if(t.match!==void 0&&typeof t.match!="function")throw new TypeError("UnsupportedElement match must be a function.");if(t.includePartial!==void 0&&typeof t.includePartial!="boolean")throw new TypeError("UnsupportedElement includePartial must be a boolean.");let n=t.layout;if(n&&(!Number.isFinite(n.width)||!Number.isFinite(n.height)||n.width<=0||n.height<=0||n.width>1e5||n.height>1e5))throw new RangeError("UnsupportedElement layout requires positive dimensions up to 100000 points.");return Object.freeze({...t,...n?{layout:Object.freeze({...n})}:{}})})}function cb(e){let t=new Map;return {...Db$1(r=>{let o=e.find(a=>a.match?.(r)??true),i=o?o.layout??(r.placement==="block"?{width:240,height:96}:{width:120,height:24}):null;return t.set(`${r.ownerPartName}\0${r.nodeId}`,i?`${i.width},${i.height}`:"hidden"),i}),includePartial:e.some(r=>r.includePartial===true),geometryKey:()=>JSON.stringify([...t].sort(([r],[o])=>r.localeCompare(o)))}}function BO(e,t){let n=mc(e??[]);return {current:()=>n,set(r){let o=mc(r);t()?.setUnsupportedElementRules(o),n=o;}}}function $O(e,t){return {includePartial:e.includePartial,unsupportedOwnerPartName:n=>de(t,n)?.name??t.part().name,unsupportedSource:(n,r)=>{let o=r?t.currentPackage().parts.get(r):de(t,n);return o?eW(o,n):null}}}var Lf=class{constructor(t,n,r,o){this.selection=n;this.part=r;this.revision=o;this.position=t?Pn$1(t):void 0;}selection;part;revision;entries=new WeakMap;position;save(){let t=this.part(),n=o=>{let i=eb$1(t,o.paragraphId);return {nodeId:o.paragraphId,stableId:i&&i.kind!=="textValue"?wb$1(i):null,offset:o.offset}},r=this.selection();return {partName:t.name,anchor:n(r.anchor),head:n(r.head)}}begin(){if(!this.position)return ()=>{};let t=this.revision(),n=this.save();return ()=>{let r=this.position.current();!r||t===this.revision()||this.entries.set(r,{before:this.entries.get(r)?.before??n,after:this.save()});}}step(t,n){let r=this.position?.current(),o=n(),i=t==="undo"?r:this.position?.current(),a=i?this.entries.get(i):void 0,s=t==="undo"?a?.before:a?.after;return {changed:o,selection:s?this.resolve(s):null}}resolve(t){let n=this.part();if(n.name!==t.partName)return null;let r=new Map,o=[n.root];for(;o.length;){let l=o.pop();for(let d of l.children)d.kind!=="textValue"&&o.push(d);if(l.kind!=="paragraph")continue;let c=wb$1(l);c&&r.set(c,l.id);}let i=l=>{let c=l.stableId?r.get(l.stableId):l.nodeId;return c?{paragraphId:c,offset:l.offset}:null},a=i(t.anchor),s=i(t.head);return a&&s?{anchor:a,head:s}:null}};var tW=new Set(["Shift","Control","Alt","AltGraph","Meta","OS","Hyper","Super","Symbol","Fn","FnLock","CapsLock","NumLock","ScrollLock","SymbolLock"]),nW=["opening","fonts","drawing-resources"];function WO(e){return !tW.has(e.key)}function qO(e){return e.paragraphIds.size>0||!nW.some(t=>e.dependencyKeys.has(t))}var rW=new Set;function gc(e,t){let n=uf$1(e,t.displayMode,t.authorFilter),r=xc$1(n);if(r===n)return rW;let o=new Set(n.map(i=>i.id));return new Set(r.flatMap(i=>o.has(i.id)?[]:[i.id]))}function oW(e,t,n){let r=uf$1(e,n.displayMode,n.authorFilter),o=xc$1(r);if(o===r)return null;let i=new Set(r.map(l=>l.id));if(i.has(t))return null;let a=o.findIndex(l=>l.id===t);if(a===-1)return null;let s=o.slice(a+1).find(l=>i.has(l.id));return s?.kind==="paragraph"?s.id:null}function iW(e,t,n,r){let o=c=>e.findIndex(d=>d.kind!=="textValue"&&d.id===c),i=o(t),a=o(n);if(i===-1||a<=i)return null;let s=[];for(let c=i+1;c<a;c+=1){let d=e[c];if(d.kind==="textValue")return null;s.push(d.id);}if(s.length===0)return s;let l=r();return s.every(c=>l.has(c))?s:null}function KO(e,t,n,r){let o=fb$1(e,t);if(o===null||fb$1(e,n)?.id!==o.id)return null;let i=iW(o.children,t,n,()=>gc(o.children,r));return i===null?null:[...i,n].map(a=>({op:"joinParagraphs",firstId:t,secondId:a}))}function UO(e,t,n,r){if(Xb$1(e,n.paragraphId).length>0)return n;let o=fb$1(t,n.paragraphId);if(o===null)return n;let i=oW(o.children,n.paragraphId,r);return i===null?n:{paragraphId:i,offset:0}}function aW(e,t,n,r,o){if(Xb$1(e,n.paragraphId).length>0)return null;let i=fb$1(t,n.paragraphId);if(i===null||!gc(i.children,r).has(n.paragraphId))return null;let a=i.children,s=a.findIndex(d=>d.kind!=="textValue"&&d.id===n.paragraphId),l;for(let d=s-1;d>=0&&l===void 0;d-=1)a[d].kind!=="textValue"&&(l=a[d]);if(l===void 0||l.kind!=="paragraph")return null;let c=o==="backward"?{paragraphId:l.id,offset:(Km(t,l.id)??"").length}:UO(e,t,n,r);return {ops:[{op:"joinParagraphs",firstId:l.id,secondId:n.paragraphId}],caret:c}}function sW(e,t,n){let r=fb$1(e,t);if(r===null)return null;let o=r.children,i=o.findIndex(l=>l.kind!=="textValue"&&l.id===t);if(i===-1)return null;let a=null,s=[];for(let l=i+1;l<o.length;l+=1){let c=o[l];if(c.kind!=="textValue"){if(a??=gc(o,n),!a.has(c.id))break;s.push({op:"joinParagraphs",firstId:t,secondId:c.id});}}return s.length>0?s:null}function jO(e){let t=n=>UO(e.layout(),e.part(),n,e.view());return {joinOps:(n,r)=>KO(e.part(),n,r,e.view()),forwardJoinOps:(n,r)=>KO(e.part(),n,r,e.view())??sW(e.part(),n,e.view()),shown:t,removedCaretEdit:(n,r)=>aW(e.layout(),e.part(),n,e.view(),r),shownRange:n=>{let{from:r,to:o}=n;if(r.paragraphId!==o.paragraphId||r.offset!==o.offset)return n;let i=t(r);return i===r?n:{from:i,to:i}},shownSelection:n=>{let{anchor:r,head:o}=n;if(r.paragraphId!==o.paragraphId||r.offset!==o.offset)return n;let i=t(o);return i===o?n:{...n,anchor:i,head:i}}}}function lW(e){return e.level==="inline"&&e.range!==void 0&&e.range.start<e.range.end&&(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")}function db(e,t,n){let r=(e.contentControls??[]).filter(l=>lW(l)&&l.range.paragraphId===t.paragraphId&&l.range.start>=t.offset&&l.range.end<=n.offset),o=r.filter(l=>!r.some(c=>c!==l&&c.range.start<=l.range.start&&c.range.end>=l.range.end&&c.nestingDepth<l.nestingDepth)).sort((l,c)=>c.range.start-l.range.start);if(o.length===0)return null;let i=t.paragraphId,a=[],s=n.offset;for(let l of o)l.range.end<s&&a.push({op:"deleteText",paragraphId:i,start:l.range.end,end:s}),a.push({op:"removeContentControl",controlId:l.id,keepContent:false}),s=l.range.start;return t.offset<s&&a.push({op:"deleteText",paragraphId:i,start:t.offset,end:s}),a}function VO(e){let{anchor:t,head:n}=e.selection;if(t.paragraphId!==n.paragraphId)return null;if(t.offset!==n.offset){if(e.tracked)return null;let[l,c]=t.offset<n.offset?[t,n]:[n,t],d=db(e.layout,l,c);return d?{kind:"remove",ops:d,collapseTo:l}:null}let r=e.shown(n),o=e.direction==="backward",i=e.controlBeside(r,o?"before":"after");if(!i)return null;let a={paragraphId:r.paragraphId,offset:i.start},s={paragraphId:r.paragraphId,offset:i.end};if(i.struck){let l=o?a:s;return {kind:"select",selection:{anchor:l,head:l}}}return i.contentLocked?{kind:"select",selection:o?{anchor:s,head:a}:{anchor:a,head:s}}:{kind:"remove",ops:e.tracked?[{op:"deleteText",paragraphId:r.paragraphId,start:i.start,end:i.end}]:[{op:"removeContentControl",controlId:i.controlId,keepContent:false}],collapseTo:o?a:e.tracked?s:r}}var GO="\uFFFC",Ff="\0";function zO(e,t){return (n,r)=>{let o=e(n,r),i=new Uint8Array(o.length);for(let{line:s}of Xb$1(n,r)??[]){let l=$a(s,r);if(l){for(let c of l.spans)i.fill(1,Math.min(c.range.start,o.length),Math.min(c.range.end,o.length));for(let c of l.drawings)c.start<o.length&&(i[c.start]=1);}}if(!t)for(let s of Zb$2(n,r))i.fill(0,Math.min(s.start,o.length),Math.min(s.end,o.length));if(!i.includes(0))return o;let a="";for(let s=0;s<o.length;s+=1)a+=i[s]?o[s]:Ff;return a}}function cW(e,t){let n=new Map,r=new Set,o=Xb$1(e,t),i=o[0],a=i&&e.pages.find(l=>l.index===i.pageIndex),s=i&&[a?.header,a?.footer].some(l=>l?La(l.fragments).some(c=>c.lines.includes(i.line)):false);for(let{line:l,pageIndex:c}of o)if(!(s&&c!==i.pageIndex)&&!r.has(l)){r.add(l);for(let d of $a(l,t)?.spans??[])!d.fieldAtom&&!d.projected||d.range.end-d.range.start===1&&n.set(d.range.start,(n.get(d.range.start)??"")+d.text);}for(let[l,c]of n)c.length<=1&&n.delete(l);return n}function hc(e,t){let n=new Map,r=i=>{let a=n.get(i);return a||n.set(i,a=cW(e,i)),a},o=i=>{let a=t(e,i).split("");for(let s of r(i).keys())s<a.length&&a[s]!==Ff&&(a[s]=GO);return a};return {markedText:(i,a)=>o(a).join(""),resultAt:(i,a)=>r(i).get(a)??null,spelledText:(i,a)=>{let s=r(a);return o(a).map((l,c)=>l===GO?s.get(c)??l:l).join("")}}}var dW=/[\p{L}\p{N}_'’]/u,ub=e=>e!==void 0&&dW.test(e);function Df(e,t,n,r="after",o=Ve(e,t.paragraphId)){let i=t.paragraphId,a=Math.max(0,Math.min(t.offset,o.length)),s=-1;if(r==="before"&&a>0&&ub(o[a-1])?s=a-1:ub(o[a])?s=a:a>0&&ub(o[a-1])&&(s=a-1),s===-1){let l=a,c=a;for(;l>0&&/\s/.test(o[l-1]??"");)l-=1;for(;c<o.length&&/\s/.test(o[c]??"");)c+=1;return l===c&&c<o.length&&(c+=1),{from:{paragraphId:i,offset:l},to:{paragraphId:i,offset:c}}}return {from:{paragraphId:i,offset:Ie(o,s+1,-1,n)},to:{paragraphId:i,offset:Ie(o,s,1,n)}}}function Ke(e){return {anchor:e,head:e}}function ra(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 Nf(e,t,n){let{anchor:r,head:o}=t;if(r.paragraphId===o.paragraphId)return r.offset<=o.offset?{from:r,to:o}:{from:o,to:r};let i=n??eb$2(e);return i.indexOf(r.paragraphId)<=i.indexOf(o.paragraphId)?{from:r,to:o}:{from:o,to:r}}function Jo(e,t,n){let r=t[0],o=i=>{let a=t.includes(i.paragraphId),s=a?i.paragraphId:r??i.paragraphId,l=a?i.offset:0,c=Ve(e,s).length;return {paragraphId:s,offset:Math.max(0,Math.min(l,c))}};return {anchor:o(n.anchor),head:o(n.head)}}function fb(e,t,n,r,o,i=Ve,a){let s=(p,g,y)=>o===void 0||!g.includes("\uFFFC")?g:g.replace(/\uFFFC/g,(h,b)=>o(p,y+b)??h);if(t.paragraphId===n.paragraphId)return s(t.paragraphId,i(e,t.paragraphId).slice(t.offset,n.offset),t.offset);let l=r??eb$2(e),c=l.indexOf(t.paragraphId),d=l.indexOf(n.paragraphId);if(c===-1||d===-1)return "";let u=l.slice(c,d+1),f=s(t.paragraphId,i(e,t.paragraphId).slice(t.offset),t.offset);for(let p=1;p<u.length;p+=1){let g=u[p],y=i(e,g),h=ab$1(e,g).includes(u[p-1])||a?.(u[p-1])?"":`
|
|
25
|
-
`;f+=h+s(g,p===u.length-1?y.slice(0,n.offset):y,0);}return f}function XO(e,t,n,r){let o=hc(e,Ve);return fb(e,t,n,r,o.resultAt,o.markedText)}function YO(e,t){return pa$1(e,t,hc(e,Ve).spelledText)}function pb(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 QO(e){return e.kind}function JO(e){return e.kind!=="textValue"&&QO(e)==="contentControl"}function ZO(e){return e.kind!=="textValue"&&QO(e)==="contentControlContent"}function uW(e,t){let n=new Map,r=o=>{if(o.kind!=="textValue"){if(o.kind==="table"){let i=pb(o);if(i.length>0&&i.every(a=>t.has(a))){n.set(o.id,i);return}}for(let i of o.children)r(i);}};return r(e.root),n}function fW(e,t,n){let r=new Set,o=(i,a)=>{if(i.kind!=="textValue"){if(i.kind==="table"&&n.has(i.id)){for(let s of i.children)o(s,true);return}if(JO(i)){let s=pb(i);!a&&s.length>0&&s.every(l=>t.has(l))&&r.add(i.id);for(let l of i.children)o(l,a);return}for(let s of i.children)o(s,a);}};return o(e.root,false),r}function eM(e,t,n,r,o,i){let a=new Set;for(let s=n;s<=r;s+=1){let l=t[s];(s===n?o.offset===0&&(s!==r||i.offset===e(l).length):s!==r||i.offset===e(l).length)&&a.add(l);}return a}function pW(e,t,n){let r=[],o=i=>{if(i.kind!=="textValue"){if(i.kind==="table"||JO(i)){let s=pb(i).filter(l=>n.has(l));if(s.length>0&&s.every(l=>t.has(l))){r.push(i.id);return}}for(let a of i.children)o(a);}};return o(e.root),r}function tM(e,t,n,r,o){let i=f=>Ve(e,f);if(n.paragraphId===r.paragraphId&&n.offset===r.offset)return null;let a=o??eb$2(e),s=a.indexOf(n.paragraphId),l=a.indexOf(r.paragraphId);if(s===-1||l===-1||s>l)return null;let c=a.slice(s,l+1),d=eM(i,a,s,l,n,r),u=a[l];return {partName:t.name,paragraphIds:c,startOffset:n.offset,endOffset:r.offset,coveredParagraphIds:[...d],fullyCoveredBlockIds:pW(t,d,new Set(a)),lastMarkCovered:r.offset===i(u).length}}function nM(e,t,n,r,o,i={displayMode:e.displayMode??"all-markup",authorFilter:void 0},a=false){let s=w=>Ve(e,w),l=(w,T,$)=>(a?null:db(e,{paragraphId:w,offset:T},{offset:$}))??[{op:"deleteText",paragraphId:w,start:T,end:$}];if(n.paragraphId===r.paragraphId)return n.offset===r.offset?{ops:[],collapseTo:n}:{ops:l(n.paragraphId,n.offset,r.offset),collapseTo:n};let c=o??eb$2(e),d=c.indexOf(n.paragraphId),u=c.indexOf(r.paragraphId);if(d===-1||u===-1)return {ops:[],collapseTo:n};let f=eM(s,c,d,u,n,r),p=a?new Map:uW(t,f),g=new Map;for(let[w,T]of p)for(let $ of T)g.set($,w);let y=fW(t,f,p),h=d;if(g.has(n.paragraphId)){h=-1;for(let w=d+1;w<=u;w+=1)if(!g.has(c[w])){h=w;break}if(h===-1){let w=g.get(n.paragraphId);for(let T of p.get(w)??[])g.delete(T);p.delete(w),h=d;}}let b=c[h],x=h===d?n:{paragraphId:b,offset:0},S=[];for(let w=d;w<=u;w+=1){let T=c[w];if(g.has(T))continue;let $=s(T).length,W=w===d?n.offset:0,q=w===u?r.offset:$;W<q&&S.push(...l(T,W,q));}for(let w of p.keys())S.push({op:"deleteBlock",blockId:w});for(let w of y)S.push({op:"removeContentControl",controlId:w});let v=w=>{let T=fb$1(t,w);for(;T&&ZO(T);){let $=fb$1(t,T.id);if(!$||!y.has($.id))break;T=fb$1(t,$.id);}return T},k=new Map,E=w=>{let T=k.get(w.id);return T||k.set(w.id,T=gc(w.children,i)),T},I=w=>{let T=[],$=W=>{for(let q of W)if(q.kind!=="textValue"&&!p.has(q.id)){if(y.has(q.id)){let K=q.children.find(ZO);K&&K.kind!=="textValue"&&$(K.children);continue}if(q.kind==="paragraph"){T.push(q.id);continue}T.push(`\0barrier:${q.id}`);}};return $(w.children),T},R=(w,T)=>{let $=v(w);if(!$||v(T)!==$)return null;let W=I($),q=W.indexOf(w),K=W.indexOf(T);if(q===-1||K<=q)return null;let Z=W.slice(q+1,K);if(Z.length===0)return Z;let M=E($);return Z.every(ee=>M.has(ee))?Z:null},O=b,C=b;for(let w=h+1;w<=u;w+=1){let T=c[w];if(g.has(T))continue;let $=R(C,T);if($)for(let W of [...$,T])S.push({op:"joinParagraphs",firstId:O,secondId:W});else O=T;C=T;}return {ops:S,collapseTo:x}}function rM(e,t,n,r){return t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset?[]:_e(e,t,n(),r)}function mb(e,t){if(!e)return null;let n=e.position,r=o=>o.paragraphId===n.paragraphId&&o.offset===n.offset;return r(t.anchor)&&r(t.head)?e:null}function oM(e,t,n,r){if(n===null||n.length===0)return t?null:void 0;let{anchor:o,head:i}=e;if(!(o.paragraphId!==i.paragraphId||o.offset!==i.offset))return {position:i,properties:n,base:mb(t,e)?.base??r()}}function iM(e,t,n){let r=Jo(t,n,e.selection),o=n.includes(e.selection.head.paragraphId);return {selection:r,format:o&&e.format?{...e.format,position:r.head}:null}}var Hf=class{undo=[];redo=[];moving=false;group;position;constructor(t){this.position=Pn$1(t);}get canUndo(){return this.matches(this.undo.at(-1))}get canRedo(){return this.matches(this.redo.at(-1))}matches(t){return !!t&&!!this.position&&t.anchor===this.position.current()}record(t,n,r){if(!this.position)return;let o=this.undo.at(-1);if(r!==void 0&&r===this.group&&this.matches(o)){this.undo[this.undo.length-1]={...o,after:n},Nn(r,"extended");return}this.group=r,this.position.split(),this.redo.length=0,this.undo.push({anchor:this.position.current(),before:t,after:n}),this.undo.length>200&&this.undo.shift(),Nn(r,"started");}endGroup(){this.group=void 0;}noteEdit(){this.endGroup(),this.moving||(this.redo.length=0);}step(t,n,r){let o=t==="undo"?this.undo:this.redo,i=t==="undo"?this.redo:this.undo;this.endGroup(),this.moving=true;try{if(this.matches(o.at(-1))){let a=o.pop();i.push(a),n(t==="undo"?a.before:a.after);}else r();}finally{this.moving=false;}}};var lM=32,aM=new WeakMap,sM=new WeakMap,mW=new WeakMap,gW=new WeakMap;function _f(e){let t=aM.get(e);if(t)return t;let n=[e.fragments];e.header&&n.push(e.header.fragments),e.footer&&n.push(e.footer.fragments);for(let o of [e.footnotes,e.endnotes])if(o)for(let i of o.notes)n.push(i.fragments);let r={stories:n,sparse:new Map,complete:null};return aM.set(e,r),r}function cM(e,t){let n=t?gW:mW,r=n.get(e);return r||(r={fragment:e,indent:{indent:e.indent,inTable:t},emptyStyle:e.emptyParagraphStyle},n.set(e,r)),r}function dM(e,t){return e?!e.emptyStyle&&t.emptyStyle?{...e,emptyStyle:t.emptyStyle}:e:t}function yc(e,t,n){let r=e.get(t),o=dM(r,n);o!==r&&e.set(t,o);}function hW(e,t){let n=(r,o)=>{for(let i of r){if(i.kind==="paragraph"){t(i,o);continue}for(let a of i.rows)if(!a.isHeaderRepeat)for(let s of a.cells)n(s.blocks,true);}};for(let r of e)n(r,false);}function gb(e){if(e.complete)return e.complete;let t=new Map;hW(e.stories,(n,r)=>{let o=cM(n,r);for(let i of bb$1(n))yc(t,i,o);});for(let[n,r]of e.sparse)r&&t.set(n,r);return e.sparse.clear(),e.complete=t,t}function yW(e,t){if(e.paragraphId===t)return true;for(let n of e.lines??[])if(n.range.paragraphId===t||n.spans.some(r=>r.range.paragraphId===t)||(n.drawings??[]).some(r=>r.paragraphId===t))return bb$1(e).includes(t);return false}function uM(e,t){if(e.complete)return e.complete.get(t);let n=e.sparse.get(t);if(n!==void 0)return n??void 0;if(e.sparse.size>=lM)return gb(e).get(t);let r,o=(i,a)=>{for(let s of i){if(s.kind==="paragraph"){if(!yW(s,t))continue;if(r=dM(r,cM(s,a)),r.emptyStyle)return true;continue}if(Uf$2(s).has(t)){for(let l of s.rows)if(!l.isHeaderRepeat){for(let c of l.cells)if(o(c.blocks,true))return true}}}return false};for(let i of e.stories)if(o(i,false))break;return e.sparse.set(t,r??null),r}function bW(e,t,n){for(let[r,o]of n)fM(e,t,r,o);for(let r=0;r<t.frontier;r+=1)for(let[o,i]of gb(_f(e.pages[r])))n.has(o)||yc(t.entries,o,i);t.progress=null;}function fM(e,t,n,r){for(let o=r;o<t.frontier;o+=1){let i=uM(_f(e.pages[o]),n);i&&yc(t.entries,n,i);}}function bc(e,t,n=false){let r=sM.get(e);r||(r={frontier:0,entries:new Map,progress:new Map},sM.set(e,r));let o=()=>{let s=r.entries.get(t);return s&&(!n||s.emptyStyle)?s:void 0},i=r.progress;if(i&&!i.has(t)&&i.size>=lM&&bW(e,r,i),r.progress){fM(e,r,t,r.progress.get(t)??0);let s=o();for(;!s&&r.frontier<e.pages.length;){let l=uM(_f(e.pages[r.frontier++]),t);l&&yc(r.entries,t,l),s=o();}return r.progress.set(t,r.frontier),s??r.entries.get(t)}let a=o();for(;!a&&r.frontier<e.pages.length;){for(let[s,l]of gb(_f(e.pages[r.frontier++])))yc(r.entries,s,l);a=o();}return a??r.entries.get(t)}var hb=e=>xf$1(e)?"rtl":"ltr";function mM(e,t){return bc(e,t,true)?.emptyStyle}var gM=Object.freeze([]);function zn(e,t){return bc(e,t)?.fragment.props??gM}function vc(e,t){return bc(e,t)?.fragment.tabStops??null}function Bf(e){return Math.round((e.hanging>0?-e.hanging:e.firstLine)*20)}function xc(e,t){return bc(e,t)?.indent??null}function hM(e,t,n,r,o=Vh$1,i){let a=eb$1(e,t);if(!a||a.kind!=="paragraph")return false;for(let s of Wh$1(a,hi(a),n,r,o,i))if(ci$1(bi(s.run,"runProperties","rPr"),$h$1).length>0)return true;return false}function ei(e,t,n,r=Vh$1,o){let i=eb$1(e,t);if(!i||i.kind!=="paragraph")return [];let a=wi(i,n)?xi(i,n):void 0;if(a?.kind==="none")return [];if(!a&&pi(i,n)===null)return [];let s=oi$1(i,n,r,o);return s?ci$1(bi(s,"runProperties","rPr"),$h$1):ei$1(e,t)}function oa(e,t,n){let r=e?.find(i=>i.localName===t);if(!r)return null;let o=r.attributes?.val;return t==="vertAlign"?o===n:(t==="u"||o!=="0"&&o!=="false"&&o!=="off")&&o!=="none"}function yM(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:oa(t,"b")===true};break;case "i":n={...n,italic:oa(t,"i")===true};break;case "u":n={...n,underline:oa(t,"u")===true};break;case "strike":n={...n,strikethrough:oa(t,"strike")===true};break;case "vertAlign":n={...n,superscript:o==="superscript",subscript:o==="subscript"};break;case "rFonts":n={...n,fontFamily:r.attributes?.ascii??n.fontFamily};break;case "sz":{let i=Number(o);Number.isFinite(i)&&(n={...n,fontSizeHalfPoints:i});break}case "color":n={...n,color:o==="auto"?null:o??n.color};break;case "highlight":n={...n,highlight:o==="none"?null:o??n.highlight};break;}}return n}function yb(e,t,n,r){return (n&&n.length>0?na$1(e,n):Ye(e,t,r??(t.anchor.paragraphId===t.head.paragraphId?[]:gb$1(e)))).map(i=>{let a=E$2(D$1(i.style));return a===i.style?i:{...i,style:a}})}function $f(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 Wf(e,t,n,r){return yb(e,t,n,r)[0]?.style??null}function bM(e,t,n,r,o,i){let a=yb(e,t,r,i),s=a.length===0&&!r?.length&&t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset?mM(e,t.head.paragraphId):void 0,l=a.length>0?a.map(d=>d.style):s?[s]:[];if(l.length===0)return false;let c=d=>{switch(n){case "b":return d.bold;case "i":return d.italic;case "u":return d.underline!==null;case "strike":return d.strike;case "vertAlign":return d.verticalAlign===o;default:return false}};return l.every(c)}var vW=/\p{L}/u;function xW(e,t,n){let r=e.range.paragraphId===t.paragraphId?t.offset:e.range.start,o=e.range.paragraphId===n.paragraphId?n.offset:e.range.end;return e.text.slice(Math.max(0,r-e.range.start),Math.max(0,o-e.range.start))}function vM(e,t,n,r,o,i,a,s=true){let l=s?yb(e,t,r,i):[],c=l.length===0?pM(e,t,r,i).map(D=>mM(e,D)).filter(D=>D!==void 0):[],d=c.length>0?c:l.map(D=>D.style),u=D=>{if(d.length===0)return null;let j=D(d[0]);return d.every(H=>D(H)===j)?j:null},f=(D,j=(H,N)=>H===N)=>D.length>0&&D.every(H=>j(H,D[0]))?D[0]:null,p=(D,j)=>D.props.some(H=>H.localName===j),g=l.some(D=>D.fontSlot==="eastAsia"),{anchor:y,head:h}=t,b=y.paragraphId===h.paragraphId&&y.offset===h.offset,x=!g||b||r?.length?null:Ue(t,y.paragraphId===h.paragraphId?[]:i??gb$1(e)),S=g?l.filter(D=>vW.test(x?xW(D,x.from,x.to):D.text)):[],v=S.length>0?S:l,k=D=>Ha(D.style,D.fontSlot).fontFamily??n?.(D.range.paragraphId,D.props).fontFamily??null,E=D=>p(D,"sz")?Math.round(D.style.fontSizePt*2):n?.(D.range.paragraphId,D.props).fontSizeHalfPoints??Math.round(D.style.fontSizePt*2),I=c.length>0?{fontFamily:u(D=>D.fontFamily??a??null),fontSizeHalfPoints:u(D=>Math.round(D.fontSizePt*2))}:l.length===0?n?.(t.head.paragraphId,[]):void 0,R=pM(e,t,r,i),O=D=>f(R.map(j=>D(zn(e,j)))),C=(D,j=(H,N)=>H===N)=>{if(R.length<2)return false;let H=D(zn(e,R[0]));return R.some((N,z)=>z>0&&!j(D(zn(e,N)),H))},w=O(D=>Dd(D)),T=O(hb),$=O(D=>$$1(D,"pStyle")?.val??o??void 0)??null,W=D=>$$1(D,"spacing")??void 0,q=D=>{if(D===gM)return "";let j=ba(D),H=N=>Math.round(N*100)/100;return j.rule==="auto"?`multiple:${H(j.value/240)}`:`${j.rule}:${H(j.value)}`},K=O(q),Z=(()=>{if(!K)return null;let[D,j]=K.split(":");return {rule:D,value:Number(j)}})(),M=(D,j)=>{let H=Qd(W(D)?.[j]);return H===null?null:Math.round(H/20*100)/100},ee=D=>O(j=>M(j,D)),J=(()=>{let D=Y=>hb(zn(e,Y))==="rtl",j=R.map(Y=>{let le=xc(e,Y);return !le||!D(Y)?le:{...le,indent:{...le.indent,left:le.indent.right,right:le.indent.left}}}),H=j[0];if(!H||j.some(Y=>Y===null||Y.inTable))return null;let N=D(R[0]),z=Y=>Math.round(Y*20),X=j,F=z(H.indent.left),U=z(H.indent.right),G=Bf(H.indent);return {left:F,right:U,firstLine:G,mixed:{left:X.some(Y=>z(Y.indent.left)!==F),right:X.some(Y=>z(Y.indent.right)!==U),firstLine:X.some(Y=>Bf(Y.indent)!==G)},...N?{rtl:N}:{}}})(),fe=D=>O(j=>D(sf$1(j))),se=O(U$1),B=O(da$1);return {bold:d.length>0&&d.every(D=>D.bold),italic:d.length>0&&d.every(D=>D.italic),underline:d.length>0&&d.every(D=>D.underline!==null),strikethrough:d.length>0&&d.every(D=>D.strike),superscript:d.length>0&&d.every(D=>D.verticalAlign==="superscript"),subscript:d.length>0&&d.every(D=>D.verticalAlign==="subscript"),fontFamily:l.length>0?f(v.map(k)):I?.fontFamily??null,fontSizeHalfPoints:l.length>0?f(l.map(E)):I?.fontSizeHalfPoints??null,color:u(D=>D.color),highlight:u(D=>D.highlight),alignment:w,direction:T,styleId:$,lineSpacing:Z,spaceBeforePt:ee("before"),spaceAfterPt:ee("after"),disagrees:{alignment:C(D=>Dd(D)),direction:C(hb),spaceBeforePt:C(D=>M(D,"before")),spaceAfterPt:C(D=>M(D,"after")),lineSpacing:C(q),tabStops:(()=>{if(R.length<2)return false;let D=JSON.stringify(vc(e,R[0])?.stops??null);return R.some((j,H)=>H>0&&JSON.stringify(vc(e,j)?.stops??null)!==D)})()},indent:J,tabStops:f(R.map(D=>vc(e,D)?.stops??null),(D,j)=>D===null||j===null?D===j:D.length===j.length&&D.every((H,N)=>Math.round(H.positionPt*20)===Math.round(j[N].positionPt*20)&&H.alignment===j[N].alignment&&(H.leader??"none")===(j[N].leader??"none")))?.map(D=>({positionTwips:Math.round(D.positionPt*20),alignment:D.alignment,...D.leader?{leader:D.leader}:{}}))??null,paragraphFlags:{contextualSpacing:B,keepNext:fe(D=>D.keepNext),keepLines:fe(D=>D.keepLines),widowControl:fe(D=>D.widowControl),pageBreakBefore:se}}}function pM(e,t,n,r){if(n&&n.length>0)return [...ma$2(e,n)];if(t.anchor.paragraphId===t.head.paragraphId)return [t.head.paragraphId];let o=r??gb$1(e),i=o.indexOf(t.anchor.paragraphId),a=o.indexOf(t.head.paragraphId);return i===-1||a===-1?[t.head.paragraphId]:o.slice(Math.min(i,a),Math.max(i,a)+1)}function xM(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 SW=/\p{L}/u;function wW(e){for(let t of e)if(SW.test(t))return Bb$1.test(t)?"rtl":"ltr";return null}function SM(e,t,n){return (r,o,i,a)=>{let{paragraphId:s,offset:l}=r,c=o-i.length;if(wW(i)!=="rtl")return [...a];let d=t(),u=n(),f=de(e,s)??e.part();if(ni$1(f,s,l,b$1(e.stylesRoot(),e.settingsRoot(),d,u),d,u))return [...a];let g=h=>[...h.filter(b=>b.localName!=="rtl"),{localName:"rtl"}],y=a.findIndex(h=>h.op==="setRunProperties"&&h.paragraphId===s&&h.start===c&&h.end===c+i.length);return y>=0?a.map((h,b)=>b===y&&h.op==="setRunProperties"?{...h,properties:g(h.properties)}:h):[...a,{op:"setRunProperties",paragraphId:s,start:c,end:c+i.length,properties:g(ei(f,s,l,d,u))}]}}function wM(e,t,n,r){let o=e??ib$1,i,a,s;return {current:()=>o,filter(){let l=t();return (!s||l!==i||o!==a)&&(i=l,a=o,s={...l,hiddenAuthors:l?.hiddenAuthors??new Set,revisionMarkup:o,cacheKey:`${l?.cacheKey??""}|markup:${JSON.stringify(o)}`}),s},set(l){JSON.stringify(l)!==JSON.stringify(o)&&(n(),o=l,r());}}}function kM(e){return e?.root.children.some(t=>t.kind!=="textValue"&&(t.localName==="mirrorMargins"||t.localName==="evenAndOddHeaders")&&!t.attributes.some(n=>n.localName==="val"&&["0","false","off"].includes(n.value)))??false}function IM(e,t,n,r){let o=eb$1(e,t);if(o?.kind!=="paragraph")return false;if(!vc$2(o,n,r))return true;let i=fb$1(e,t);return i?uf$1(i.children,n,r).some(a=>a.kind==="paragraph"&&a.id===t):false}var kW=new Set(["Shift","Control","Alt","Meta","CapsLock","NumLock","ScrollLock","ContextMenu"]),bb=new WeakSet;function RM(e){return bb.has(e)}function PM(e){let t=null,n=o=>{if(!Lu(o))return;let{clientX:i,clientY:a}=o,s=Date.now(),l=t===null?-1:s-t.time,c=t!==null&&l>=0&&l<=500&&Math.abs(i-t.x)<=4&&Math.abs(a-t.y)<=4;return t=c?null:{time:s,x:i,y:a},{clientX:i,clientY:a,double:c}},r=(o,i)=>e.surface.selectDrawing(o,i)?(e.setIntent({kind:"pointer",drawingNodeId:o}),true):false;return {onDrawingPointerGesture(o){if(Lu(o)&&o.button!==0||e.surface.editingMode()==="view")return;let i=Wt(o.target)?o.target:null,a=e.textbox()?.preparePointer(i,n(o));a&&bb.add(o);let s=a?null:e.textbox()?.takeRefusedPress();if(s&&r(s.drawingNodeId,s.hostParagraphId)){bb.add(o),o.preventDefault(),o.stopImmediatePropagation();return}let l=!a&&i?.closest("[data-drawing-node-id]")?.getAttribute("data-drawing-node-id");if(l&&i?.closest(".docx-drawing-textbox")){let c;for(let d of e.surface.layout().pages)if(c=ac$1(d,l),c)break;if(c&&r(l,c.paragraphId)){o.preventDefault(),o.stopImmediatePropagation();return}}e.setIntent(l?{kind:"pointer",drawingNodeId:l}:{kind:"none"});},onDrawingKeyGesture(o){if(ns(o)&&kW.has(o.key))return;let i=e.textbox(),a=i?.active();if(ns(o)&&o.key==="Escape"&&a){i.exit(),r(a.drawingNodeId,a.hostParagraphId),o.preventDefault(),o.stopImmediatePropagation();return}let s=ns(o)&&o.key==="Enter"&&!o.shiftKey&&!o.altKey&&!o.ctrlKey&&!o.metaKey,l=e.intent();if(s&&!a&&l.kind==="pointer"&&i?.enterDrawing(l.drawingNodeId)){e.setIntent({kind:"none"}),o.preventDefault(),o.stopImmediatePropagation();return}if((ns(o)&&(o.key==="Delete"||o.key==="Backspace")&&!o.altKey&&!o.ctrlKey&&!o.metaKey||Fg(o)&&(o.inputType==="deleteContentBackward"||o.inputType==="deleteContentForward"))&&e.intent().kind==="pointer"){let d=Gn(e.surface);if(d!==null){o.preventDefault(),o.stopImmediatePropagation(),e.setIntent({kind:"none"}),e.surface.deleteImage(d.drawingNodeId);return}}e.setIntent({kind:"none"});}}}function TM(e,t,n){let r=t.owner;if(!r){for(let a of e.pages){let s=ac$1(a,t.drawingNodeId);if(s)return {pageIndex:a.index,drawing:s,origin:s}}return null}if(r.kind!=="headerFooter")return null;let o=n===void 0?void 0:e.pages[n],i=o?.index===n?o:void 0;for(let a of i?[i,...e.pages]:e.pages){let s=Jl(a).find(l=>l.drawing.drawingNodeId===t.drawingNodeId&&(l.rId===void 0||l.rId===r.rId));if(s)return {pageIndex:a.index,drawing:s.drawing,origin:s.origin,kind:s.kind}}return null}function IW(e,t,n){if(!t.double&&n===void 0)return null;let r=e?.closest("[data-page-index]");if(!r)return null;let o=n!==void 0&&!!e?.closest("[data-docx-hf-active] [data-start]"),i=[...r.querySelectorAll(".docx-drawing-textbox-content")].reverse();for(let a of i){let s=a.closest("[data-docx-hf], [data-docx-hf-front], [data-docx-hf-behind]"),l=!!s?.hasAttribute("data-docx-hf-behind");if(!s||l&&(n===void 0||o))continue;let c=a.getBoundingClientRect();if(t.clientX>=c.left&&t.clientX<=c.right&&t.clientY>=c.top&&t.clientY<=c.bottom)return a}return null}function RW(e){let n=e.closest(".docx-editor__scroll-container")?.getBoundingClientRect()??{top:0,bottom:e.ownerDocument.defaultView?.innerHeight??0};for(let r of e.querySelectorAll(".docx-page[data-page-index]")){let o=r.getBoundingClientRect();if(o.bottom>n.top&&o.top<n.bottom)return Number(r.dataset.pageIndex)}}function EM(e){let t=null,n,r=null,o=null,i=y=>y.owner?e.partOf(y.drawingNodeId):e.session.part(),a=y=>{let h=i(y);return h?ck(h).find(b=>b.root.id===y.id&&b.drawingNodeId===y.drawingNodeId):void 0},s=()=>t&&a(t),l=y=>!y.owner||y.owner.kind==="headerFooter"&&e.headerFooter.active()?.rId===y.owner.rId,c=()=>{if(t&&!l(t)){d(false);return}if(t&&!s()){d();return}let h=t?.owner?.kind==="headerFooter"?e.headerFooter.active():null;h&&n!==h.pageIndex&&(n=h.pageIndex,o=null);for(let b of e.pagesLayer.querySelectorAll(".docx-drawing-textbox")){let x=b.dataset.drawingNodeId===t?.drawingNodeId&&(n===void 0||b.closest("[data-page-index]")?.getAttribute("data-page-index")===String(n)),S=b.dataset.docxTextboxActive;if(S!==String(x)){if(b.dataset.docxTextboxActive=String(x),b.contentEditable=x?"true":"false",b.setAttribute("role",x?"textbox":"img"),x)b.removeAttribute("aria-hidden"),b.setAttribute("aria-multiline","true");else if(b.removeAttribute("aria-multiline"),b.hasAttribute("aria-label")||b.setAttribute("aria-hidden","true"),S!=="true")continue;for(let v of b.querySelectorAll("[data-textbox-paragraph-id]"))x?v.dataset.paragraphId=v.dataset.textboxParagraphId:delete v.dataset.paragraphId;}}},d=(y=true)=>{t&&(e.flush(),t=null,n=void 0,o=null,c(),y&&r&&e.setSelection(r),r=null);},u=(y,h)=>{if(y.owner&&y.owner.kind!=="headerFooter"||!e.writable())return false;e.flush();let b=i(y),x=b&&ck(b).find(C=>C.root.id===y.id&&C.drawingNodeId===y.drawingNodeId&&C.hostParagraphId===y.hostParagraphId),S=e.headerFooter.active(),v=y.owner,k=h??(v?S?.rId===v.rId?S.pageIndex:RW(e.pagesLayer):void 0),E=TM(e.layout(),y,k),I=E?.drawing;if(!b||!x||!E||!I||!Gu(b,x.root.id,I))return false;let R=I.textboxStory.fragments[0];if(!R||R.kind!=="paragraph")return false;if(t?.id===y.id&&n===(v?E.pageIndex:void 0))return true;if(d(),v&&(S?.rId!==v.rId||S.pageIndex!==E.pageIndex)&&(!E.kind||!e.headerFooter.enter(v.rId,E.pageIndex,E.kind)))return false;e.leaveOtherStories(v),r=e.selection(),t=y,n=v?E.pageIndex:void 0,o=null,c();let O={paragraphId:R.paragraphId,offset:R.range.start};return e.setSelection({anchor:O,head:O}),true},f=y=>t?TM(y,t,n):null,p=null,g=(y,h)=>{let b=ck(e.session.part()).find(I=>I.drawingNodeId===y);if(b)return {scope:{kind:"frame",id:b.root.id,drawingNodeId:y,hostParagraphId:b.hostParagraphId}};let x=e.partOf(y),S=x&&ck(x).find(I=>I.drawingNodeId===y);if(!S)return null;let v=e.layout(),k=h===void 0?void 0:v.pages[h],E=k&&k.index===h?[k,...v.pages]:v.pages;for(let I of E){let R=Jl(I).find(O=>O.drawing.drawingNodeId===y);if(R?.rId)return {scope:{kind:"frame",id:S.root.id,drawingNodeId:y,hostParagraphId:S.hostParagraphId,owner:{kind:"headerFooter",rId:R.rId}},pageIndex:I.index,kind:R.kind}}return null};return {active:()=>t,replacementFormatOps(y,h,b){let{anchor:x,head:S}=e.selection(),v=t&&i(t);if(!v||b===0||x.paragraphId===S.paragraphId&&x.offset===S.offset)return [];let k=ei(v,y,h);return k.length?[{op:"setRunProperties",paragraphId:y,start:h,end:h+b,properties:k}]:[]},enter:y=>u(y),exit:d,syncDom:c,contains:y=>{let h=s();return !!h&&id$1(h.root).some(b=>b.id===y)},paragraphIds:()=>{let y=s();return y?id$1(y.root).map(h=>h.id):[]},caretInput(y){let h=f(y);if(!h)return {};let b=h.drawing.drawingNodeId,S=[...e.pagesLayer.querySelectorAll(".docx-drawing-textbox")].find(k=>k.dataset.drawingNodeId===b&&k.closest("[data-page-index]")?.dataset.pageIndex===String(h.pageIndex))?.querySelector(".docx-drawing-textbox-content");if(!S)return {};let v=h.drawing.textboxStory;return {scopedHost:S,scopedHostKind:"textbox",scopedOrigin:{x:h.origin.x+v.contentOffset.x,y:h.origin.y+v.contentOffset.y}}},layout(y){if(!t)return y;if(o?.base===y&&o.id===t.id)return o.layout;let h=f(y),b=h?.drawing.textboxStory,x=h&&b?b.fragments.flatMap(v=>v.kind==="paragraph"?[Cf$2(v,h.origin.x+b.contentOffset.x,h.origin.y+b.contentOffset.y)]:[]):[],S={...y,pages:y.pages.map(v=>({...v,header:void 0,footer:void 0,footnotes:void 0,endnotes:void 0,anchoredDrawings:[],fragments:t.owner?v.index===h?.pageIndex?x:[]:ac$1(v,t.drawingNodeId)?x:[]}))};return o={base:y,id:t.id,layout:S},S},enterDrawing(y){let h=e.headerFooter.active(),b=g(y,h?.pageIndex);return !!b&&u(b.scope,b.pageIndex)},takeRefusedPress(){let y=p;return p=null,y},preparePointer(y,h){p=null;let b=y?.closest(".docx-drawing-textbox-content")??(h?IW(y,h,e.headerFooter.active()?.rId):null),x=b?.closest("[data-drawing-node-id]")?.dataset.drawingNodeId,S=Number(b?.closest("[data-page-index]")?.dataset.pageIndex),v=x?g(x,Number.isInteger(S)?S:void 0):null;if(v&&u(v.scope,v.pageIndex))return true;d(false);let k=v?.scope.owner;if(v&&k?.kind==="headerFooter"&&v.kind&&v.pageIndex!==void 0){let E=e.headerFooter.active();(E?.rId===k.rId&&E.pageIndex===v.pageIndex||e.headerFooter.enter(k.rId,v.pageIndex,v.kind))&&(p={drawingNodeId:v.scope.drawingNodeId,hostParagraphId:v.scope.hostParagraphId});}return false}}}function CM(e,t){return e?.active()?null:t?.getActive()??null}function OM(e,t,n){let r={session:e,headerFooter:()=>n().hfScope,sectionAtPage:t,exitNote:()=>n().noteOps?.exitNote()};return {partOf:o=>de(r.session,o)??null,leaveOtherStories:o=>{r.exitNote();let i=r.headerFooter();o&&i?.getActive()?.scope.rId===o.rId||i?.exitHeaderFooter();},headerFooter:{active:()=>{let o=r.headerFooter()?.getActive();return o?{rId:o.scope.rId,pageIndex:o.pageIndex}:null},enter:(o,i,a)=>r.headerFooter()?.enterHeaderFooter({rId:o,pageIndex:i,sectionIndex:r.sectionAtPage(i).sectionIndex,kind:a})??false}}}function MM(e,t,n){return (r,o)=>{let i=t(),a=n();return ni$1(de(e,r)??e.part(),r,o,a$6(e.stylesRoot(),e.settingsRoot(),i,a),i,a)}}var TW=[["--docx-hf-add-header","headerFooter.addHeaderHint"],["--docx-hf-add-footer","headerFooter.addFooterHint"],["--docx-hf-edit-header","headerFooter.editHeaderHint"],["--docx-hf-edit-footer","headerFooter.editFooterHint"]];function EW(e){return `"${e.replace(/[\\"]/g,"\\$&").replace(/[\n\r\f]/g," ")}"`}function xb(e,t){e.setAttribute("aria-label",t?.("editor.documentContent")??en.editor.documentContent);for(let[n,r]of TW){let o=t?.(r);o&&o!==r?e.style.setProperty(n,EW(o)):e.style.removeProperty(n);}}var kc="An external document refresh is in progress.",Ic="rejected",Cr="A preview is open. Commit or discard it before editing.",ys=new WeakSet,wc=new WeakSet,AM=new WeakMap,lr=e=>ys.has(e)||wc.has(e),LM=e=>ys.has(e),bs=e=>!ys.has(e)&&wc.has(e)?Cr:kc;function ti(e,t){t?ys.add(e):ys.delete(e);}function Sb(e,t){t?wc.add(e):wc.delete(e);}function FM(e,t){AM.set(e,t);}var qf=e=>AM.get(e)?.()??false,CW=new Set(["toggleReviewPane","toggleParagraphMarks","selectAll","setSelection","copyFormatting"]),OW=(e,t)=>!ys.has(e)&&wc.has(e)&&CW.has(t.type),wb=(e,t)=>e&&lr(e)&&!OW(e,t)?{ok:false,code:"unsupported",reason:bs(e)}:null;function DM(e){let t="select[data-docx-form-dropdown]",n=c=>Wt(c)?c.closest(t):null,r=c=>{let d=c.closest("[data-start][data-paragraph-id]"),u=d?.dataset.paragraphId;if(!d||!u)return null;let f=e.part(u),p=eb$1(f,u);if(p?.kind!=="paragraph")return null;let g=Number(d.dataset.start),y=Dk(p).find(b=>b.start<=g&&g<b.end);if(!y)return null;let h={op:"setLegacyDropdown",paragraphId:u,fieldNodeId:y.fieldNodeId,selectedIndex:c.selectedIndex};return {field:y,paragraphId:u,op:h,enabled:e.editable()&&e.canApply(h)&&Vk(e.settings(),h)===null&&zn$1(f,h)===null}},o=()=>{for(let c of e.pagesLayer.querySelectorAll(t))c.disabled=!r(c)?.enabled;},i=c=>{let d=n(c.target);d&&(c.stopPropagation(),r(d)?.enabled||c.preventDefault());},a=c=>{let d=n(c.target);d&&(d.disabled=!r(d)?.enabled);},s=c=>{let d=n(c.target);if(!d)return;c.stopPropagation();let u=r(d);if(!u)return;if(!u.enabled||!e.apply(u.op)){d.selectedIndex=u.field.selectedIndex;return}e.select({anchor:{paragraphId:u.paragraphId,offset:u.field.start},head:{paragraphId:u.paragraphId,offset:u.field.end}}),[...e.pagesLayer.querySelectorAll(t)].find(p=>{let g=p.closest("[data-start][data-paragraph-id]");return g?.dataset.paragraphId===u.paragraphId&&Number(g.dataset.start)===u.field.start})?.focus({preventScroll:true});},l=new(Ae(e.pagesLayer)).MutationObserver(c=>{for(let d of c)for(let u of d.addedNodes){if(!Wt(u))continue;let f=u.matches(t)?[u]:u.querySelectorAll(t);for(let p of f)p.disabled=!r(p)?.enabled;}});return l.observe(e.pagesLayer,{childList:true,subtree:true}),e.pagesLayer.addEventListener("pointerdown",i,true),e.pagesLayer.addEventListener("focusin",a),e.pagesLayer.addEventListener("change",s),o(),{sync:o,keydown(c){let d=n(c.target);if(!d)return false;c.stopPropagation();let u=c.key.toLowerCase();return (c.ctrlKey||c.metaKey)&&!c.altKey&&(u==="z"||u==="y")?(c.preventDefault(),e.pagesLayer.focus({preventScroll:true}),e.history(u==="y"||c.shiftKey?"redo":"undo"),true):(!r(d)?.enabled&&c.key!=="Tab"&&c.preventDefault(),true)},destroy(){l.disconnect(),e.pagesLayer.removeEventListener("pointerdown",i,true),e.pagesLayer.removeEventListener("focusin",a),e.pagesLayer.removeEventListener("change",s);}}}function NM(e,t){let n=fb$1(e,t.id);for(let i=0;n&&i<64&&(n.namespaceUri===pa$2&&n.localName==="customXml"||ld(n)||md(n));i+=1)n=fb$1(e,n.id);if(!n)return [];let r=pd(n.children),o=r.findIndex(i=>i.id===t.id);return o>=2?r.slice(o-2,o):[]}function HM(e){let t=n=>n.kind==="textValue"?/^[ \t\u00a0]*$/.test(n.value):n.namespaceUri!==pa$2?false:n.localName==="pPr"?!n.children.some(r=>r.kind!=="textValue"&&r.localName==="sectPr"):n.localName==="rPr"||n.localName==="tab"||["bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","proofErr"].includes(n.localName)?true:["p","r","t","hyperlink"].includes(n.localName)?n.children.every(t):false;return t(e)}function _M(e,t,n,r,o,i,a,s){let l=eb$1(e,n.paragraphId);if(l?.kind!=="paragraph")return null;let[c,d]=NM(e,l);if(d?.kind!=="paragraph"||c?.kind!=="paragraph"||!HM(d))return null;let u=db$1(t,l.id),f=db$1(t,c.id);if(!u||u.numId!==f?.numId||u.level!==f.level||db$1(t,d.id))return null;let p=(E,I,R,O)=>({id:E,kind:I,localName:R,namespaceUri:pa$2,prefix:"w",namespaceBindings:[],attributes:[],children:O}),g=l.children.find(E=>E.kind==="paragraphProperties"),y=g&&{...g,children:g.children.filter(E=>E.localName!=="sectPr")},h=Ck({localName:"pStyle",attributes:{val:o}},"separator-style"),b=r.map((E,I)=>Ck(E,`separator-format-${I}`));a&&b.push(Ck({localName:"ins",attributes:{id:Nb$1(e,s)(),author:a.author,...a.date?{date:a.date}:{}}},"separator-insertion"));let x=p("separator-mark","runProperties","rPr",b),S=p("separator-properties","paragraphProperties","pPr",[...h?[h]:[],...b.length?[x]:[]]),v=[...S.children],k=i?.styles.has(o)?S:p("separator-defaults","paragraphProperties","pPr",[]);return i&&Ld(nf$1(i,k).paragraphPropertyNodes)&&v.splice(h?1:0,0,p("separator-numbering","generic","numPr",[Ck({localName:"numId",attributes:{val:"0"}},"separator-number-id")])),{op:"insertFragment",paragraphId:l.id,offset:n.offset,blocks:[p("separator-head","paragraph","p",y?[y]:[]),p("separator-blank","paragraph","p",[p("separator-properties-final","paragraphProperties","pPr",v)])],lastMarkCovered:true}}function BM(e,t=true){return e.ownerDocument.defaultView?.navigator?.scheduling?.isInputPending?.({includeContinuous:t})??false}function kb(e,t){let n=e.setScale;return typeof n!="function"?false:n.call(e,t)}var $M=new Set(["comment-add","comment-delete","comment-reply","comment-resolve","package-scoped","revision-resolve","revision-attribution"]);var MW="list paragraph",AW="ListParagraph",Ib=e=>e.localName==="ind";function LW(e,t){if(!t||!Ib(e))return e;if(t==="all")return null;let n=Object.entries(e.attributes??{}).filter(([r])=>!In$1.has(r));return n.length>0?{...e,attributes:Object.fromEntries(n)}:null}function WM(e){return e.find(t=>t.localName==="pStyle")?.attributes?.val}function Kf(e){let t=null;for(let n of e)if(n.type==="paragraph"){if(n.name.trim().toLowerCase()===MW)return n.styleId;t===null&&n.styleId===AW&&(t=n.styleId);}return t}function qM(e){let{session:t}=e,n;function r(){let o=t.stylesRoot();return (n===void 0||n.root!==o)&&(n={root:o,styleId:mf$1(o,t.documentThemeFonts()).defaultParagraphStyleId}),n.styleId}return {applyOps(o,i){let a=Kf(t.documentStyles()),s=r(),l=e.storyPart(),c=[];for(let d of o){let u=di$1(l,d),f=i?.(d)===true&&u.some(Ib),p=f?u.filter(h=>!Ib(h)):u,g=WM(u),y=a!==null&&(g===void 0||g===s);!y&&!f||c.push({op:"setParagraphProperties",paragraphId:d,properties:y&&a!==null?fi(p,{localName:"pStyle",attributes:{val:a}}):p});}return c},linkedStyleOp(o,i,a=false){if(!t.documentStyles().some(c=>c.type==="paragraph"&&c.styleId===i))return null;let l=di$1(e.storyPart(),o).flatMap(c=>{if(c.localName==="numPr")return [];let d=LW(c,a);return d?[d]:[]});return {op:"setParagraphProperties",paragraphId:o,properties:fi(l,{localName:"pStyle",attributes:{val:i}})}},clearOp(o){let i=Kf(t.documentStyles());if(i===null)return null;let a=di$1(e.storyPart(),o);return WM(a)!==i?null:{op:"setParagraphProperties",paragraphId:o,properties:a.filter(s=>s.localName!=="pStyle")}}}}function KM(e,t){return h$3(t,n=>n("style",{type:"paragraph",styleId:t},[n("name",{val:"List Paragraph"}),...e?[n("basedOn",{val:e})]:[],n("uiPriority",{val:"34"}),n("qFormat"),n("pPr",{},[n("ind",{left:"720"}),n("contextualSpacing")])]))}function Uf(e,t){let n=e.ownerDocument,r=e.dataset.docxCcId,o=()=>{n.removeEventListener("pointerdown",i,true),n.removeEventListener("keydown",a,true);},i=s=>{if(e.parentNode===null){o();return}let l=s.target,c=Wt(l)?l.closest("[data-docx-cc-widget]"):null;l&&(e.contains(l)||c?.getAttribute("data-docx-cc-id")===r)||(o(),t());},a=s=>{s.key!=="Escape"||s.isComposing||(s.preventDefault(),o(),e.parentNode!==null&&(s.stopPropagation(),t()));};return n.addEventListener("pointerdown",i,true),n.addEventListener("keydown",a,true),o}function UM(e,t,n,r,o){let a=Te(e).find(u=>u.id===n)?.fragments[0],s=a?e.pages[a.pageIndex]:void 0;if(!a||!s)return null;let l=o?.get(a.pageIndex)??0,c=s.contentBox.x-s.box.x,d=s.contentBox.y-s.box.y;return {left:(s.box.x+l+c+a.box.x)*t,top:(s.box.y+d+a.box.y+a.box.height)*t,element:[...r.querySelectorAll("[data-docx-content-control]")].find(u=>u.dataset.docxContentControl===n)?.querySelector(".docx-content-control-boundary")??void 0,sheetLeft:(s.box.x+l)*t,sheetRight:(s.box.x+l+s.box.width)*t}}function jM(e){return e.kind==="textValue"?e.value:e.localName==="sdtPr"?"":e.children.map(jM).join("")}function Rb(e,t){let n=e?jM(e):"";return t.find(r=>r.displayText===n)?.value??n}function VM(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 FW=["dropdown","comboBox","date","checkbox","picture","buildingBlockGallery"];function GM(e){let t=null,n=false,r=()=>{let o=t;t=null,o&&(e.setOpen(o.id,false),o.controller.abort());};return {cancel:r,destroy(){n=true,r();},open(o,i){if(r(),n||!e.request||!FW.includes(i))return false;let a=new AbortController;t={controller:a,id:o};let s=()=>!n&&t?.controller===a&&!a.signal.aborted,l=()=>s()&&VM(e.find(o))===i&&e.allowed(o),c=e.find(o),d=e.items(o).map(y=>({...y})),u=Rb(c,d),f=i==="picture"?e.picture(o):void 0;if(i==="picture"&&!f)return r(),false;let p=false,g={controlId:o,kind:i,items:d,value:i==="date"?e.date(o)??"":i==="checkbox"?String(e.checked(o)):i==="picture"?f:i==="buildingBlockGallery"?"":u,locale:e.locale(),anchor:[...e.layer.querySelectorAll("[data-docx-content-control]")].find(y=>y.getAttribute("data-docx-content-control")===o)?.querySelector(".docx-content-control-boundary")??null,signal:a.signal,canApply:l,apply(y){return i==="picture"||!l()||!e.apply(o,y)?false:(s()&&r(),true)},cancel(){s()&&r();},...i==="picture"?{async replaceImage(y){if(p||!l())return false;p=true;try{return await e.replaceImage(o,y,()=>l()&&e.picture(o)===f)?(s()&&r(),!0):!1}finally{p=false;}}}:{}};return e.setOpen(o,true),e.request(g)?true:(g.cancel(),false)}}}function zM(e,t){if(!e)return [];if(t&&XM(e))return cj$1(t(),e).map(n=>({displayText:n.name,value:n.name}));for(let n of e.children)if(n.kind!=="textValue"&&!(n.kind!=="contentControlProperties"&&n.localName!=="sdtPr"))for(let r of n.children){if(r.kind==="textValue"||r.localName!=="dropDownList"&&r.localName!=="comboBox")continue;let o=[];for(let i of r.children){if(i.kind==="textValue"||i.localName!=="listItem")continue;let a=i.attributes.find(l=>l.localName==="value")?.value??"",s=i.attributes.find(l=>l.localName==="displayText")?.value??a;o.push({displayText:s,value:a});}return o}return []}function ZM(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 XM(e){return VM(e&&e.kind!=="textValue"?e:null)==="buildingBlockGallery"}function YM(e,t,n,r){if(!e||!XM(e))return [{op:"setContentControlValue",controlId:n,value:r}];let o=cj$1(t(),e).filter(a=>a.name===r),i=o.length===1?o[0]:void 0;return i?[{op:"insertBuildingBlock",controlId:n,name:i.name,blocks:i.blocks}]:null}function QM(e){let t=-1,n=true;return ()=>{let r=e.packageRevision();return t!==r&&(t=r,n=!$j$1(e.settingsRoot()).doNotShadeFormData),n}}var ia="switch to field results before editing a form value";function JM(e,t){let{anchor:n,head:r}=t,o=n.paragraphId===r.paragraphId;for(let i of [n,r]){let a=e(i.paragraphId),s=a&&eb$1(a,i.paragraphId);if(s?.kind!=="paragraph")continue;let l=o?Math.min(n.offset,r.offset):i.offset,c=o?Math.max(n.offset,r.offset):i.offset,d=Fi(s);if(qh$1(s).filter(f=>f.addressing==="editable-result").map(f=>{let p=d.spanOf(f.node)?.start??0,g=p;for(let y of f.removeNodeIds)g=Math.max(g,d.spanOf(y)?.end??g);return {start:p,end:g}}).some(f=>l===c?l>=f.start&&(l<f.end||f.start===f.end):l<f.end&&c>f.start))return true}return false}function eA(e,t,n,r){let o=e.contentControlId?Te(t).find(d=>d.id===e.contentControlId):void 0,i=Po(n).filter(d=>d.toc.id===e.id),a=i.some(d=>d.start>0||d.end<d.length);if(o&&!a)return {tocId:e.id,boundary:o,additional:false};let s=new Map(i.map(d=>[d.paragraphId,d])),l=i.filter(d=>d.start>0||d.end<d.length).flatMap(d=>Ze$1(t,{anchor:{paragraphId:d.paragraphId,offset:d.start},head:{paragraphId:d.paragraphId,offset:d.end}},[d.paragraphId],r)),c=t.pages.flatMap(d=>{let u=Ka$1(d).filter(h=>{let b=s.get(h.paragraphId);return b&&b.start===0&&b.end===b.length}).map(kc$1);if(u.push(...l.filter(h=>h.pageIndex===d.index)),u.length===0)return [];let f=Math.min(...u.map(h=>h.x)),p=Math.min(...u.map(h=>h.y)),g=Math.max(...u.map(h=>h.x+h.width)),y=Math.max(...u.map(h=>h.y+h.height));return [{pageIndex:d.index,box:{x:f,y:p,width:g-f,height:y-p}}]});return c.length===0?null:{tocId:e.id,additional:true,boundary:{id:`toc:${e.id}`,controlType:"richText",lock:"unlocked",effectiveLock:"unlocked",placeholder:false,bound:false,nestingDepth:0,level:"block",fragments:c}}}var DW="there is no table of contents to remove",jf="the table of contents cannot be removed",tA={locked:"the table of contents is locked",bound:"the table of contents is bound to data","carries-section-mark":"the table of contents holds a section break","not-a-block":"the table of contents holds a table or a content control"};function NW(e,t){let n=t.indexOf(e.endParagraphId),r=t.indexOf(e.beginParagraphId),o=(n>=0?t[n+1]:void 0)??(r>0?t[r-1]:void 0);return o===void 0?void 0:{paragraphId:o,start:0,end:0}}function nA(e){function t(a){let s=NW(a,e.session.paragraphIds());return s&&e.pointedTocId()===a.id&&e.select({paragraphId:s.paragraphId,offset:0}),s}function n(a){if(e.editingMode()==="view"||!e.session.editable)return false;let s=e.target(a);if(!s||!Fh$1(e.session.part(),e.session.documentOutline(),s.instruction))return false;let l={op:"rewriteTocPageNumbers",tocId:s.id,updates:[]};return zn$1(e.session.part(),l)===null}function r(a){let s=e.target(a);if(!s)return {refusal:{code:"notFound",reason:DW}};let l={op:"removeToc",tocId:s.id},c=zn$1(e.session.part(),l),d=c?tA[c]??jf:e.writeRefusal([l]);return {op:l,toc:s,refusal:d?{code:"unsupported",reason:d}:null}}function o(a){return e.session.editable?r(a).refusal:{code:"unsupported",reason:jf}}function i(a){let{op:s,toc:l,refusal:c}=r(a);if(!s||!l||c)return e.refuse(c?.reason??jf,"table-of-contents-refused"),false;let d,u=e.session.subscribe(p=>{p.caret&&(d=p.caret);}),f;try{f=e.apply([s],t(l));}finally{u();}if(!f.committed){let p=f.reason??jf;return e.refuse(tA[p]??p,p),false}return d&&e.select({paragraphId:d.paragraphId,offset:d.start}),e.removed(),true}return {canRefreshToc:n,pointAtToc:t,removal:{removeTocRefusal:o,removeToc:i}}}var rA=new WeakMap;function oA(e,t,n,r){rA.set(e,(o,i)=>{let a=t();e.flushPendingInput();try{n(o),r();}catch(s){throw i&&(n(a),r()),s}});}function Pb(e,t,n=true){let r=rA.get(e);if(!r)throw new Error("Surface does not support measurement updates");r(t,n);}var Vf=new WeakMap,HW=96;function iA(e){if(e.host){e.status.replaceChildren();return}let t=e.status.ownerDocument.createElement("span");t.className="docx-editor__loading-spinner",t.setAttribute("aria-hidden","true"),e.status.replaceChildren(t);}function aA(e,t){let n=t.ownerDocument,r=n.createElement("div");r.className="docx-opening-indicator",r.contentEditable="false";let o=n.createElement("div");o.className="docx-editor__loading-page-status",o.setAttribute("role","status"),r.append(o);let i={frame:r,status:o,host:null};Vf.set(e,i),iA(i);let a=()=>{let s=r.parentElement?.querySelector(":scope > .docx-pages"),l=s?.querySelector(":scope > .docx-page");r.hidden=!s||!l,!(!s||!l)&&(r.style.left=l.style.left,r.style.top=s.style.height,r.style.width=l.style.width,r.style.height=`${HW}px`);};return t.append(r),a(),{place:a,remove:()=>{Vf.get(e)===i&&(Vf.delete(e),r.remove(),i.host?.publish(null));}}}function Tb(e,t){let n=Vf.get(e);if(!n||n.host===t)return;let r=n.host;n.host=t,r?.publish(null),iA(n),t?.publish(n.status);}var Rc=64,Eo=new WeakMap,ni=new WeakMap,_W=48;function $W(e,t){Eo.set(e,t);}function Pc(e,t){let n=Eo.get(e);if(!n)return true;let r=n(t);return r&&Eo.delete(e),r}function Or(e){return Eo.has(e)}var WW=6e4,qW=300,KW=16,lA=4096;function UW(e,t,n){let r=0,o=e;for(;o<t&&o-e<lA&&(o-e<KW||r<WW);)r+=VW(n(o)),o+=1;return o}function jW(e,t,n){let r=[];for(let o=e;o<t;o+=1){let i=n(o);if(i?.kind==="table"){for(let a of i.children)r.push(a);r.push(i);}}return r}var sA=new WeakMap;function VW(e){if(typeof e!="object"||e===null)return 1;let t=sA.get(e);if(t!==void 0)return t;let n=1,r=[e];for(;r.length>0;){let o=r.pop();if(o.kind==="textValue")n+=o.value?.length??0;else if(o.children)for(let i of o.children)r.push(i);}return sA.set(e,n),n}function cA(e,t,n,r){let o=r,i=n.now(),a=null,s=null,l=[],c=0,d=()=>{let x=a;a=null,x&&Yf$1(x);},u=(x,S=false)=>{if(!S&&n.composing())return false;let v=n.now()+(ni.has(e)?Math.max(x,_W):x);for(;n.limit()!==null&&!n.destroyed();){if(!a){if(n.busy()){if(!S)return false;n.finishBusy();}let R=n.limit(),O=n.bodyBlockCount();if(O!==void 0&&R>=O)return n.finish(),S&&n.busy()&&n.finishBusy(),true;s===null&&(s=O===void 0?R+o:UW(R,O,C=>n.bodyBlock(C)),l=jW(R,s,C=>n.bodyBlock(C)),c=0);for(let C=0;c<l.length;C+=1){if(C>0&&(n.now()>=v||n.inputPending()))return false;hf$1([l[c++]]);}if(s<=n.limit()){s=null;continue}n.setLimit(s),a=n.prefixPass(s),s=null;}let k;do k=a.next();while(!k.done&&n.now()<v&&!n.inputPending());if(!k.done)return false;a=null;let E=ni.get(e),I=E?.covers(k.value)===true;if(n.limit()!==null&&(I||n.now()-i>=qW)&&(n.publish(k.value),i=n.now()),I&&(ni.delete(e),E.reveal()),o=Math.min(lA,o*2),n.now()>=v||n.inputPending())return false}return true};if(t().removeAttribute("data-docx-opening-preview"),n.limit()===null)return {finishPaused:d,stop:()=>{}};t().setAttribute("data-docx-opening-preview",""),t().setAttribute("data-docx-layout-pending","");let f=aA(e,t()),p=()=>{ni.delete(e);},g=["pointerdown","keydown","wheel"],y=n.pages();for(let x of g)y.addEventListener(x,p,{capture:true});let h=false,b=()=>{if(!h){h=true,Eo.delete(e),a=null,s=null,l=[];for(let x of g)y.removeEventListener(x,p,true);t().removeAttribute("data-docx-opening-preview"),n.busy()||t().removeAttribute("data-docx-layout-pending"),f.remove();}};return $W(e,(x,S)=>{if(!u(x,S))return f.place(),false;b();let k=ni.get(e);return ni.delete(e),n.destroyed()||k?.reveal(),true}),{finishPaused:d,stop:b}}function ri(e){if(!Eo.has(e))return false;for(;!Eo.get(e)?.(Number.POSITIVE_INFINITY,true)&&Eo.has(e););return true}function GW(e){ni.delete(e);}function zW(e,t,n,r,o){if(!Eo.has(e)||typeof t!="number"&&!r(t.paragraphId))return false;let i=s=>typeof t=="number"?s.pages.length>t:Se(s,t)!==null,a=o();return ni.set(e,{covers:i,reveal:()=>{Math.abs(o()-a)<1&&n();}}),true}function dA(e,t){return {begin(){t.flushLayout(),GW(e());},later(n,r){return t.scroller()!==null&&zW(e(),n,r,o=>t.paragraphIds().includes(o),()=>t.scroller()?.scrollTop??0)}}}function uA(e,t,n,r){let o=r?.offsetPx??24,i=r?.block??"start",a=e.clientHeight;if(i==="nearest"||i==="centerIfNeeded"){let c=t<e.scrollTop,d=t+n>e.scrollTop+a;if(!c&&!d)return false}let s=i==="center"||i==="centerIfNeeded"?t-Math.max(0,(a-n)/2):i==="nearest"&&t>e.scrollTop?t+n+o-a:t-o,l=Math.max(0,e.scrollHeight-a);return e.scrollTo({top:Math.max(0,Math.min(s,l)),behavior:r?.behavior??"auto"}),true}var ZW=40,XW=12,YW=8;function Eb(e,t){if(typeof MessageChannel=="function"){let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),e();},n.port2.postMessage(null);return}(t??globalThis).setTimeout(e,0);}function JW(e,t){let n=t??globalThis;if(typeof n.requestAnimationFrame=="function"){n.requestAnimationFrame(()=>Eb(e,t));return}Eb(e,t);}function fA(e){let t=null,n=0,r=(l,c)=>{l&&e.passTimed?.(c);},o=l=>{let c=t===null!=(l===null);t=l,c&&e.pendingChanged?.(l!==null);},i=(l,c)=>{e.revision()===c&&e.publish(l);},a=()=>{let l=t;if(!l)return;let c=e.now(),d=c+XW;for(;;){let u=l.steps.next();if(!u.done&&u.value?.wrapUp&&(l.wrapUp=u.value.wrapUp),u.done){o(null),i(u.value,l.revision),r(l.timed,l.spent+e.now()-c);return}if(e.now()>=d)break}l.spent+=e.now()-c,Eb(a,e.view?.());},s=()=>{let l=t;if(!l)return;let c=e.now();o(null),i(Yf$1(l.steps),l.revision),r(l.timed,l.spent+e.now()-c);};return {run(l,c,d=true){let u=e.snapshot(),f=e.now(),p=d?n:0;d&&(n=0);let g=f+ZW,y=e.pageAfterView(),h=e.current(),b=e.partial?.()===true,x=null;for(;;){let S=l.next();if(S.done)return r(d,p+e.now()-f),S.value;if(S.value&&(x=S.value),y===void 0||!x?.finalize||x.pages.length<=y||e.now()<g||!h||!b&&!x.settled&&h.pages.length-x.pages.length<YW)continue;let v=x.settled?x.pages:[...x.pages,...h.pages.slice(x.pages.length)];return o({steps:l,revision:c,restore:u,spent:p+e.now()-f,timed:d,restorable:x.restorable!==false,wrapUp:x.wrapUp,settled:x.settled===true}),JW(a,e.view?.()),x.finalize(v)}},finish:s,abandon(){let l=t;if(l){if(l.settled){o(null),l.timed&&(n+=l.spent);return}if(!l.restorable)return l.wrapUp?.(),s();o(null),l.restore(),l.timed&&(n+=l.spent);}},pending:()=>t!==null,cancel(){o(null);}}}var eq=1e3,tq=12,pA=100;function mA(e,t){let n=o=>{let i=o.fragments[0];if(!i)return "";let a=i.kind==="paragraph"?i.lines[0]:void 0;return `${i.id}:${a?.range.start??""}`},r=o=>(o.footnotes?.notes??[]).map(i=>`${i.noteId}${i.continuation?"c":""}:${i.box.height}`).join(",");return `${e.pages.map(o=>`${n(o)}/${r(o)}`).join("|")}#${og$1(t)}`}function gA(e){let t=null,n=false,r=false,o=null,i=()=>{t?.(),t=null;},a=(l,c)=>{i(),!r&&(t=e.schedule(()=>{t=null,r||l();},c));},s=()=>{if(e.busy())return a(s,pA);let l=e.live().notePageBottomReserves,c=e.current();if(!l||!c)return;let d=mA(c,l);if(d===o)return;let u=e.revision(),f=e.createSession(),p=e.pass(u,f),g=()=>{if(e.revision()!==u)return;let h=e.now()+tq;for(;;){let b=p.next();if(b.done)return y(b.value);if(e.now()>=h)break}a(g,0);},y=h=>{if(e.revision()!==u)return;if(e.busy())return a(()=>y(h),pA);let b=e.live().notePageBottomReserves,x=f.notePageBottomReserves??new Map;if(b&&ng$1(b,x)){o=d;return}n=true;try{e.adopt(f,h);}finally{n=false;}o=mA(h,x);};g();};return {request(){n||r||a(s,eq);},cancel(){r=true,i();}}}var nq=1e4;function hA(e){let t=null,n=()=>{let a=[],s=new Set([e.part()]);for(let l of e.headerFooterPartsBySection())for(let c of [l.headers,l.footers])for(let d of c.values())s.has(d)||(s.add(d),a.push(d));for(let l of ["footnote","endnote"]){let c=e.partFor({kind:"notesPart",noteKind:l});!c||s.has(c)||(s.add(c),a.push(c));}return a},r=(a,s)=>a.length===s.length&&a.every((l,c)=>l===s[c]),o=a=>{let s=eb$1(e.part(),a);if(!s||s.kind!=="paragraph")return false;let l=0,c=[...s.children];for(;c.length>0;){let d=c.pop();if(++l>nq)return false;if(d.kind!=="textValue"){if(d.namespaceUri===pa$2&&d.localName==="p")return false;for(let u of d.children)c.push(u);}}return true},i=(a,s)=>{if(a.splitJoin.length!==1||a.story!==void 0&&a.story.kind!=="body")return false;let l=a.splitJoin[0];if("split"in l){let{from:u,tail:f}=l.split,p=s.get(u);if(p===void 0||s.has(f)||a.deleted.length>0||a.created.length!==1||a.created[0]!==f||!o(u)||!o(f))return false;for(let[g,y]of s)y>p&&s.set(g,y+1);return s.set(f,p+1),true}let{kept:c,removed:d}=l.join;return !s.has(c)||a.created.length>0||a.deleted.length!==1||a.deleted[0]!==d||!o(c)?false:(s.delete(d),true)};return {retain(a){if(!t)return;let s=a.created.length>0||a.deleted.length>0||a.splitJoin.length>0,l=a.impact==="text-local"&&!s?t.otherParts:n();a.impact!=="global"&&(a.impact==="text-local"||r(t.otherParts,l))&&(!s||r(t.otherParts,l)&&i(a,t.index))?t={packageRevision:e.packageRevision(),bodyRoot:e.part().root,index:t.index,otherParts:l}:t=null;},index(){let a=e.packageRevision(),s=e.part().root;if(t&&t.packageRevision===a&&t.bodyRoot===s)return t.index;let l=new Map,c=u=>{let f=l.size;for(let[p,g]of u)l.has(p)||l.set(p,f+g);};c(Tk(e.part()));let d=n();for(let u of d)c(Tk(u));return t={packageRevision:a,bodyRoot:s,index:l,otherParts:d},l}}}var rq=`revision-${ol}`,vs=new WeakMap;function xs(e){return e?vs.get(e)??null:null}function Gf(e){let t=vs.get(e);return t?[e,t.deletion,t.insertion]:[e]}var yA=ql,bA=new WeakMap;function oq(e,t,n){let r=bA.get(e);if(r&&vs.get(r)?.insertion===t)return r;let o=t.date??e.date,i={kind:"revision",id:pl(e.id,t.id),address:n.address,addresses:[...e.addresses,...t.addresses],replacedText:e.text,revisionKind:"replace",author:t.author,...o!==void 0?{date:o}:{},text:t.text,ranges:[...e.ranges,...t.ranges],nesting:e.nesting,replacedRangeCount:e.ranges.length,readOnly:e.readOnly||t.readOnly,replyIds:[...e.replyIds,...t.replyIds]};return vs.set(i,{deletion:e,insertion:t}),bA.set(e,i),ll(i,[...ml(e),...ml(t)])}function SA(e){let t=e.filter(a=>a.kind==="revision"),n=new Map,r=new Set,o=new Map;for(let a=0;a+1<t.length;a+=1){let s=t[a],l=t[a+1],c=s.revisionKind==="insert",d=t[a+2];if(c&&d&&yA(l,d))continue;let[u,f]=c?[l,s]:[s,l];if(!yA(u,f))continue;let p=oq(u,f,s);n.set(s,p),r.add(l),o.set(u.id,p.id),o.set(f.id,p.id),a+=1;}if(n.size===0)return {items:e,renamed:o};let i=[];for(let a of e)r.has(a)||i.push(n.get(a)??a);return {items:i,renamed:o}}function wA(e,t){let n=`${Cb(t)}|${[...t?.excludeRevisionKinds??[]].sort().join(",")}`,r=vA.get(e),o=r?.get(n);if(o)return o;let i=iq(e,t);return r||vA.set(e,r=new Map),r.set(n,i),i}var vA=new WeakMap;function iq(e,t){let n=new Set(t?.excludeRevisionKinds??[]),r=s=>s.kind!=="revision"||!n.has(s.revisionKind),o=n.size>0?e.filter(r):e,i=new Map;if(Cb(t)){let s=SA(o);i=s.renamed,o=n.size>0?s.items.filter(r):s.items;}if(n.size===0&&i.size===0)return o;let a=new Set(o.filter(s=>s.kind==="revision").map(s=>s.id));return o.map(s=>{if(s.kind!=="comment"||s.parentRevisionId===void 0)return s;let l=i.get(s.parentRevisionId)??s.parentRevisionId;if(a.has(l))return l===s.parentRevisionId?s:{...s,parentRevisionId:l};let{parentRevisionId:c,...d}=s;return d})}function zf(e,t,n){if(t===null)return new Set;let r=n?aq(e(),t):null;return new Set(r===null?[t]:[t,r])}function aq(e,t){for(let n of SA(e).items){let r=vs.get(n);if(!r)continue;let o=nl(r.deletion),i=nl(r.insertion);if(o===t)return i;if(i===t)return o}return null}function kA(e,t){let n=null;return {set:r=>n=r,lightsPair:()=>e()||n!==null&&t()?.activatedReviewKey()===n}}function Cb(e){return e?.pairReplacements!==false}function oi(e){return e.startsWith(rq)}function Yr(e,t){let n={placement:false,pairReplacements:oi(t)};return e(n).find(r=>r.key===t)}function Ss(e){let t=vs.get(e);return t?[nl(t.deletion),nl(t.insertion)]:[nl(e)]}function Ob(e,t,n){return t===null||!Cb(n)?t:e({...n,placement:false}).find(o=>oi(o.key)&&Ss(o.item).includes(t))?.key??t}function Mb(e,t){let n=oi(t.key)?t.key:Ob(e,t.key,{pairReplacements:true});return n!==null&&oi(n)?{...t,pairKey:n}:t}function IA(e,t){if(!t.skipped.length)return t;let n=new Map;for(let r of e({placement:false,pairReplacements:true}))if(oi(r.key))for(let o of Ss(r.item))n.set(o,r.key);return {...t,skipped:t.skipped.map(r=>{let o=n.get(r.key);return o===void 0?r:{...r,pairKey:o}})}}var xA=new WeakMap;function RA(e){let t=xA.get(e);if(!t){let n=new Map;for(let r of e)n.set(nl(r),r);xA.set(e,t=n);}return t}var PA=2,TA=100;function*EA(e,t){if(!t||t.size===0)return yield*e;let n=1/0,r=-1/0;for(let l of t)n=Math.min(n,l),r=Math.max(r,l);let o=l=>l<n-PA||l>r+PA,i;for(;;){let l=fd(o,()=>e.next());if(l.done){i=l.value;break}let c=l.value,d=c?.finalize;yield c&&d?{...c,finalize:u=>fd(o,()=>d(u))}:c;}let a=i.pages.length,s=i.pages.findIndex(l=>gd(l,a));if(s<0)return i;for(;s<a;s+=TA){let l=i;yield {pages:l.pages,finalize:()=>l,settled:true},i=hd(i,s,s+TA);}return i}var cq=createT(en);function cr(e){return t=>{try{let n=e?.(t);if(typeof n=="string"&&n&&n!==t)return n}catch{}return cq(t)}}var CA=new WeakMap;function Zf(e,t){let n=new Map;return CA.set(e,n),(r,o,i="textContent")=>{let a=n.get(r);a||n.set(r,a=new Map),a.set(i,o),i==="textContent"?r.textContent=t(o):r.setAttribute(i,t(o));}}function OA(e,t){let n=CA.get(e);if(n)for(let[r,o]of n){if(r!==e&&!e.contains(r)){n.delete(r);continue}for(let[i,a]of o)i==="textContent"?r.textContent=t(a):r.setAttribute(i,t(a));}}function MA(e,t){let n=e.ownerDocument.defaultView;if(!n)return;if(n.getComputedStyle(e).position==="fixed"){let R=t.getBoundingClientRect();e.style.maxHeight="";let O=Number.parseFloat(n.getComputedStyle(e).maxHeight),C=Number.isFinite(O)?O:n.innerHeight;e.style.maxWidth=`${Math.max(0,n.innerWidth-16)}px`,e.style.maxHeight=`${Math.max(0,Math.min(C,n.innerHeight-16))}px`;let w=e.getBoundingClientRect(),T=Math.max(0,n.innerHeight-8-R.bottom-4),$=Math.max(0,R.top-8-4),W=w.height>T&&$>T,q=Math.min(w.height,W?$:T);e.style.maxHeight=`${q}px`,e.style.left=`${Math.max(8,Math.min(R.left,n.innerWidth-8-w.width))}px`;let K=W?R.top-4-q:R.bottom+4;e.style.top=`${Math.max(8,Math.min(K,n.innerHeight-8-q))}px`,e.dataset.placement=W?"top":"bottom";return}let r=e.offsetParent;if(!r)return;let o=t.getBoundingClientRect(),i=t.closest(".docx-page")?.getBoundingClientRect(),a=t.closest(".docx-editor__scroll-container")?.getBoundingClientRect(),s=Math.max(0,i?.left??0,a?.left??0),l=Math.min(n.innerWidth,i?.right??n.innerWidth,a?.right??n.innerWidth),c=Math.max(0,a?.top??0),d=Math.min(n.innerHeight,a?.bottom??n.innerHeight);e.style.maxWidth=`${Math.max(0,l-s)}px`,e.style.maxHeight=`${Math.max(0,d-c)}px`;let u=e.getBoundingClientRect(),f=d-o.bottom,p=o.top-c,g=u.height>f&&p>f,y=Math.max(0,g?p:f);e.style.maxHeight=`${Math.max(0,Math.min(d-c,y))}px`;let h=Math.min(u.height,y),b=Math.max(s,Math.min(o.left,l-u.width)),x=Math.max(c,g?o.top-h:o.bottom),S=r.getBoundingClientRect(),v=r.offsetWidth?S.width/r.offsetWidth:1,k=r.offsetHeight?S.height/r.offsetHeight:1;e.style.left=`${(b-S.left)/v-r.clientLeft+r.scrollLeft}px`,e.style.top=`${(x-S.top)/k-r.clientTop+r.scrollTop}px`,e.dataset.placement=g?"top":"bottom";}function Tc(e,t){let n=e.ownerDocument.defaultView,r=t.closest(".docx-pages")??e.closest(".docx-editor")?.querySelector(".docx-pages"),o=t.closest("[data-docx-content-control]")?.dataset.docxContentControl,i=t,a=()=>{if(!i.isConnected&&r&&o){let c=[...r.querySelectorAll("[data-docx-content-control]")].find(d=>d.dataset.docxContentControl===o)?.querySelector(".docx-content-control-boundary");c&&(s?.unobserve(i),i=c,s?.observe(i));}i.isConnected&&MA(e,i);},s=typeof n?.ResizeObserver=="function"?new n.ResizeObserver(a):null;s?.observe(e),s?.observe(i);let l=typeof n?.MutationObserver=="function"?new n.MutationObserver(a):null;return r&&l?.observe(r,{childList:true,subtree:true}),a(),n?.addEventListener("resize",a),e.ownerDocument.addEventListener("scroll",a,true),()=>{s?.disconnect(),l?.disconnect(),n?.removeEventListener("resize",a),e.ownerDocument.removeEventListener("scroll",a,true);}}function Ec(e,t,n){if(t.stopPropagation(),t.isComposing||(t.key==="Escape"&&(t.preventDefault(),n()),t.key!=="Tab"))return;let r=[...e.querySelectorAll("button,input,select,textarea,[href],[tabindex]")].filter(a=>a.tabIndex>=0&&!a.hasAttribute("disabled")&&!a.closest("[hidden]")&&e.ownerDocument.defaultView?.getComputedStyle(a).display!=="none");if(!r.length){t.preventDefault(),e.focus();return}let o=e.ownerDocument.activeElement,i=t.shiftKey&&(o===r[0]||o===e)?r.at(-1):!t.shiftKey&&(o===r.at(-1)||o===e)?r[0]:null;i&&(t.preventDefault(),i.focus());}function dq(e){let t=e?.ownerDocument??(typeof globalThis.document>"u"?null:globalThis.document),n=t?.activeElement;return n&&n!==t?.body?n:e?.closest(".docx-pages")??null}var Ab="image/png,image/jpeg,image/gif,image/bmp,image/webp",uq=new Set(Ab.split(",")),fq=8;function pq(e){if(!e||e.kind==="textValue")return;let t=(n,r)=>{if(!(n.kind==="textValue"||r>fq)){if(n.kind==="drawing")return n.id;if(n.localName!=="sdtPr")for(let o of n.children){let i=t(o,r+1);if(i)return i}}};return t(e,0)}function AA(e){let t=null,n=null,r=null,o,i,a=0,s=false,l=()=>{a++,o?.(),i?.(),r?.remove(),r=null;let u=n;t?.remove(),t=null,n=null,u&&(e.setOpen(u,false),s||e.layer.focus({preventScroll:true}));},c=u=>pq(e.find(u)),d=async(u,f,p=()=>true)=>{if(s||!p()||!e.allowed(u))return false;if(f.byteLength>r$2.maxEncodedBytes)return e.reject("image-resource-limit"),false;let g=c(u);if(!g)return e.reject("no-picture"),false;let y=Pf$1(f);if(!uq.has(y))return e.reject("unsupported-image"),false;let h=await e.replaceImage(g,f,y,()=>!s&&p()&&e.allowed(u)&&c(u)===g);return h.ok?true:(e.reject(h.detail??h.reason),false)};return {drawingOf:c,replace:d,cancel:l,select(u){let f=c(u),p=f?Ge(e.layout(),f):null;return p?e.selectDrawing(f,p.record.paragraphId):false},pick(u){if(l(),s||!e.allowed(u))return;let f=a,p=()=>!s&&a===f;if(!c(u)){e.reject("no-picture");return}let g=e.document.createElement("input");g.type="file",g.accept=Ab,g.className="docx-content-control-picture-picker",g.dataset.docxMarker="",g.dataset.docxCcId=u,g.setAttribute("contenteditable","false"),g.setAttribute("aria-hidden","true"),g.tabIndex=-1;let y=cr(e.translate),h=e.document.createElement("div");h.className="docx-content-control-menu",h.style.position="absolute",h.style.zIndex="20",h.style.pointerEvents="auto",h.dataset.docxCcId=u,h.dataset.docxMarker="",h.setAttribute("role","dialog"),h.setAttribute("aria-label",y("contentControl.types.picture")),h.setAttribute("contenteditable","false"),h.hidden=true;let b=e.document.createElement("div");b.className="docx-content-control-widget-error",b.setAttribute("role","alert"),b.textContent=y("disabledReason.invalidValue");let x=e.document.createElement("button");x.type="button",x.textContent=y("common.cancel"),x.addEventListener("click",l),h.addEventListener("pointerdown",S=>S.stopPropagation()),h.addEventListener("keydown",S=>{Ec(h,S,l),S.stopPropagation();}),h.append(b,x),g.addEventListener("change",()=>{let S=g.files?.[0];!S||!p()||(g.value="",g.disabled=true,(async()=>{let v=false;try{S.size>r$2.maxEncodedBytes?e.reject("image-resource-limit"):v=await d(u,new Uint8Array(await S.arrayBuffer()),p);}catch{p()&&e.reject("image-read-failed");}if(!p())return;if(v){l();return}g.disabled=false,g.className="docx-content-control-picture-input",g.removeAttribute("aria-hidden"),g.tabIndex=0,g.setAttribute("aria-label",y("contentControl.types.picture")),g.setAttribute("aria-invalid","true"),h.prepend(g),h.hidden=false;let k=[...e.layer.querySelectorAll("[data-docx-content-control]")].find(E=>E.getAttribute("data-docx-content-control")===u)?.querySelector(".docx-content-control-boundary");i?.(),o?.(),k&&(i=Tc(h,k)),o=Uf(h,l),g.focus();})());}),g.addEventListener("cancel",l),e.layer.append(g),(e.layer.closest(".docx-editor__scroll-container")??e.layer).append(h),r=h,t=g,n=u,e.setOpen(u,true),g.click();},destroy(){s=true,l();}}}var mq=22,Lb=3;function gq(e,t,n){let r=e.ownerDocument;if(typeof r.elementFromPoint!="function")return null;let o=r.elementFromPoint(t,n)?.closest(".docx-page");if(!o)return null;for(let i of o.querySelectorAll("[data-docx-content-control]:not([data-docx-toc])"))for(let a of i.querySelectorAll(".docx-content-control-boundary")){let s=a.getBoundingClientRect();if(t>=s.left-Lb&&t<=s.right+mq&&n>=s.top-Lb&&n<=s.bottom+Lb)return i}return null}function LA(e){let t=null,n=nt(()=>e),r=0,o=null,i=c=>{c!==t&&(t?.isConnected&&delete t.dataset.hover,t=c,c&&(c.dataset.hover=""));},a=()=>{r=0,o&&i(gq(e,o.x,o.y));},s=c=>{o={x:c.clientX,y:c.clientY},n.migrate(),r===0&&(r=n.requestAnimationFrame(a));},l=()=>{o=null,i(null);};return e.addEventListener("pointermove",s),e.addEventListener("pointerleave",l),{destroy(){e.removeEventListener("pointermove",s),e.removeEventListener("pointerleave",l),n.cancelAnimationFrame(r),i(null);}}}var Cc=.25;function FA(e,t,n){let r=(s,l)=>{let c=Se(e,s,n);return c?Pe$1(e,{x:c.x+l,y:c.y+c.height/2,pageIndex:c.pageIndex}):null},o=r(t.head,0);if(o)return o;if(t.anchor.paragraphId===t.head.paragraphId&&t.anchor.offset===t.head.offset)return hq(e,t.head)??r(t.head,-Cc);let a=t.head.paragraphId===t.anchor.paragraphId&&t.head.offset<t.anchor.offset;return r(t.head,a?Cc:-Cc)??r(t.anchor,a?-Cc:Cc)}function hq(e,t){let n=null;for(let r of e.contentControls??[]){let o=r.range;!o||o.paragraphId!==t.paragraphId||o.end!==t.offset||o.start===o.end||(!n||r.nestingDepth>n.nestingDepth)&&(n=r);}return n}function DA(e,t,n,r,o){let i=r==="left"?-1:1,a=Se(e,t.from,o),s=Se(e,t.to,o),l=a?Je(e,a)??1:1,c=i*l===-1?t.from:t.to;if(!a||!s||a.lineId!==s.lineId||a.pageIndex!==s.pageIndex)return c;let d=Xb$1(e,t.from.paragraphId)?.find(({line:g})=>g.id===a.lineId)?.line;if(!d?.spans.some(g=>g.style.shaping))return c;let u=n.indexOf(t.from.paragraphId),f=n.indexOf(t.to.paragraphId),p;for(let g of d.spans){let y=g.range.paragraphId,h=n.indexOf(y);if(h<u||h>f)continue;let b=Math.max(g.range.start,y===t.from.paragraphId?t.from.offset:0),x=Math.min(g.range.end,y===t.to.paragraphId?t.to.offset:1/0);if(!(b>=x))for(let S of [b,x]){let v={paragraphId:y,offset:S},k=Se(e,v,o);if(!k||k.lineId!==a.lineId||k.pageIndex!==a.pageIndex)continue;let E=k.x;(!p||(E-p.x)*i>0)&&(p={position:v,x:E});}}return p?.position??c}function NA(e,t,n){let r=e;return {get:()=>r,set(o){o!==r&&(t(),r=o,n());}}}function HA(e,t,n,r){let o=cr(r),i=e.ownerDocument,a=i.createElement("dialog"),s=Zf(a,o);a.className="docx-text-form-dialog",a.setAttribute("role","alertdialog"),a.setAttribute("data-docx-modal",""),s(a,"textFormField.invalidTitle","aria-label"),s(a,`textFormField.invalid${t==="number"?"Number":"Date"}`,"aria-description");let l=i.createElement("h2");l.className="docx-text-form-dialog__header",s(l,"textFormField.invalidTitle");let c=i.createElement("div");c.className="docx-text-form-dialog__body",s(c,`textFormField.invalid${t==="number"?"Number":"Date"}`);let d=i.createElement("div");d.className="docx-text-form-dialog__footer";let u=i.createElement("button");u.type="button",u.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",s(u,"textFormField.apply");let f=false,p=()=>{f||(f=true,n());};return u.addEventListener("click",p),a.addEventListener("keydown",g=>{g.key!=="Enter"||g.isComposing||(g.preventDefault(),g.stopPropagation(),p());}),a.addEventListener("cancel",g=>{g.preventDefault(),p();}),d.append(u),a.append(l,c,d),e.append(a),a.showModal(),u.focus(),a}function _A(e,t,n,r,o){let i=cr(o),a=e.ownerDocument,s=a.createElement("dialog"),l=Zf(s,i);s.className="docx-text-form-dialog",s.setAttribute("data-docx-modal",""),l(s,"textFormField.title","aria-label");let c=a.createElement("h2");c.className="docx-text-form-dialog__header",l(c,"textFormField.title");let d=a.createElement("div");d.className="docx-text-form-dialog__body";let u=a.createElement("div");u.className="docx-text-form-dialog__footer",s.append(c,d,u);let f=(C,w)=>{let T=a.createElement("label");T.className="docx-text-form-dialog__row";let $=a.createElement("span");$.className="docx-text-form-dialog__label",l($,C),w.className="docx-text-form-dialog__input",T.append($,w),d.append(T);},p=a.createElement("input");p.type="text",p.value=t.defaultText,f("textFormField.defaultText",p);let g=a.createElement("select"),y=["regular","number","date"];for(let C of y){let w=a.createElement("option");w.value=C,l(w,`textFormField.${C}`),g.append(w);}if(!y.includes(t.type)){let C=a.createElement("option");C.value=t.type,l(C,"textFormField.preservedType"),C.disabled=true,g.append(C);}g.value=t.type,f("textFormField.type",g);let h=a.createElement("input");h.type="number",h.min="0",h.max="32767",h.step="1",h.value=String(t.maxLength),f("textFormField.maxLength",h);let b=a.createElement("select"),x=C=>{b.replaceChildren();let w=Hk[g.value]??[];for(let T of w){let $=a.createElement("option");$.value=T;let q={Uppercase:"textFormField.uppercase",Lowercase:"textFormField.lowercase","First capital":"textFormField.firstCapital","Title case":"textFormField.titleCase"}[T];q||!T?l($,q??"textFormField.noFormat"):$.textContent=T,b.append($);}if(!w.includes(C)){let T=a.createElement("option");T.value=C,C?T.textContent=C:l(T,"textFormField.noFormat"),T.disabled=true,b.append(T);}b.value=C;};x(t.format),g.addEventListener("change",()=>x("")),f("textFormField.format",b);let S=a.createElement("input");S.type="checkbox",S.checked=t.enabled;let v=a.createElement("label");v.className="docx-text-form-dialog__checkbox-row";let k=a.createElement("span");l(k,"textFormField.enabled"),v.append(S,k),d.append(v);let E=a.createElement("p");E.className="docx-text-form-dialog__error",E.setAttribute("role","alert"),d.append(E);let I=a.createElement("button");I.type="button",I.className="docx-text-form-dialog__button",l(I,"textFormField.cancel"),I.addEventListener("click",r);let R=a.createElement("button");R.type="button",R.className="docx-text-form-dialog__button docx-text-form-dialog__button--primary",l(R,"textFormField.apply");let O=()=>{if(!h.value||!h.checkValidity()||!n(p.value,{type:g.value,maxLength:Number(h.value),format:b.value,enabled:S.checked})){l(E,"textFormField.invalidOptions");return}r();};return R.addEventListener("click",O),s.addEventListener("keydown",C=>{C.key==="Enter"&&!C.isComposing&&Au(C.target,"input")&&(C.preventDefault(),O());}),s.addEventListener("cancel",C=>{C.preventDefault(),r();}),u.append(I,R),e.append(s),s.showModal(),p.focus(),p.select(),s}function BA(e,t,n){let r=[],o=[];for(let a of e)for(let s of Tk(a).keys()){let l=eb$1(a,s);if(l?.kind==="paragraph")for(let c of Zk(l)){let d=t.get(c.fieldNodeId);if(!d)continue;let u=(Km(a,s)??"").slice(c.start,c.end),f=Ik(u,c,"fill",d.locale);if(f===null)return {reason:"invalidArgs"};if(f===u)continue;let p={op:"commitTextFormField",paragraphId:s,fieldNodeId:c.fieldNodeId,locale:d.locale},g=zn$1(a,p);if(g)return {reason:g};r.push(p),o.push({paragraphId:s,start:c.start,end:c.end,length:f.length});}}let i=a=>{let s=a.offset;for(let l of o)l.paragraphId!==a.paragraphId||a.offset<=l.start||(s+=a.offset>=l.end?l.length-(l.end-l.start):Math.min(a.offset-l.start,l.length)-(a.offset-l.start));return s===a.offset?a:{...a,offset:s}};return {ops:r,selection:{anchor:i(n.anchor),head:i(n.head)}}}var Fb=new WeakMap,Xf=new WeakMap;function yq(e){for(let t of Array.from(e.children))if(t.classList.contains("docx-pages"))return t;return null}function WA(e){let t=yq(e);return (t&&Xf.get(t)?.())??null}function $A(e){return [...Tk(e).keys()].flatMap(t=>{let n=eb$1(e,t);return n?.kind==="paragraph"?Zk(n):[]})}function qA(e,t){let n=cr(e.translate),r,o=false,i=new Map,a=()=>e.parts?.()??[e.part()];if(t?.length)for(let B of a()){let D=t.filter(H=>H.partName===B.name);if(!D.length)continue;let j=$A(B);for(let H of D){let N=j[H.fieldIndex];N&&i.set(N.fieldNodeId,{text:H.text,locale:H.locale});}}let s=new WeakMap,l=new WeakMap,c=(B=e.part())=>{s.set(B,new Map([...i].filter(([D])=>D.startsWith(`${B.name}#`))));},d=()=>(i=new Map(a().flatMap(B=>[...s.get(B)??[]])),l.get(e.part())??null),u=B=>{i.delete(B),c();};a().forEach(c);let f=()=>{if(!i.size)return null;if(o)return "invalidState";let B=BA(a(),i,e.selection());if("reason"in B)return B.reason;if(B.ops.length&&!e.editable())return "locked";let D=a();a().forEach(c);let j=i;B.ops.length&&l.set(e.part(),e.selection()),i=new Map,o=true;try{let H=B.ops.length?e.save?e.save(B.ops,B.selection):"unsupported":null;return H?i=j:(delete se.dataset.fieldError,B.ops.length&&l.set(e.part(),B.selection)),a().forEach(c),H}catch(H){throw a().every(N=>D.includes(N))&&(i=j),a().forEach(c),H}finally{o=false;}};Xf.set(e.pagesLayer,f);let p=()=>i.size?a().flatMap(B=>$A(B).flatMap((D,j)=>{let H=i.get(D.fieldNodeId);return H?[{partName:B.name,fieldIndex:j,...H}]:[]})):[];Fb.set(e.pagesLayer,p);let g,y=(B,D)=>(Km(e.part(),B)??"").slice(D.start,D.end),h=null,b=null,x=null,S=false,v=false,k=()=>{let B=x;x=null,v=false,h?.remove(),h=null,B?.abort();},E=()=>{if(!h&&!x)return;let B=e.selection();k(),!S&&(e.pagesLayer.focus({preventScroll:true}),e.select(B));};function I(B,D,j="plain"){g={paragraphId:B,fieldNodeId:D.fieldNodeId},e.select({anchor:{paragraphId:B,offset:D.start},head:{paragraphId:B,offset:D.end}},j==="press"?"pressed":void 0);let H=e.selection().head.paragraphId===B&&e.selection().head.offset>=D.start&&e.selection().head.offset<=D.end;H&&(b=g??b),g=void 0,H&&j==="travel"&&e.reveal?.({paragraphId:B,offset:D.start});}function R(B,D){if(S)return;E();let j=e.locale?.()??"en-US",H=new AbortController;x=H;let N=()=>{if(S||H.signal.aborted||x!==H)return false;let X=eb$1(e.part(B),B);return X?.kind==="paragraph"&&Zk(X).some(F=>F.fieldNodeId===D.fieldNodeId)&&e.editable()&&!e.protected(B)},z={field:{...D},signal:H.signal,canApply:N,apply(X,F){if(!N()||!e.apply({op:"setTextFormFieldDefault",locale:j,paragraphId:B,fieldNodeId:D.fieldNodeId,text:X,options:F}))return false;if(S||x!==H||H.signal.aborted)return true;let U=eb$1(e.part(B),B),G=U?.kind==="paragraph"?Zk(U).find(Y=>Y.fieldNodeId===D.fieldNodeId):null;return G&&I(B,G),E(),true},cancel(){x===H&&!H.signal.aborted&&E();}};e.onRequest?.(z)||H.signal.aborted||(h=_A(e.container,D,z.apply,z.cancel,n));}let O=B=>{let j=B.target?.closest('[data-field-atom="form"][data-start]'),H=j?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!j||!H||!e.editable())return null;let N=eb$1(e.part(),H);if(N?.kind!=="paragraph")return null;let z=Number(j.dataset.start),X=Zk(N).find(F=>F.start<=z&&z<F.end);return X?{paragraphId:H,field:X}:null},C=null,w=B=>B.shiftKey||B.altKey||B.ctrlKey||B.metaKey,T=B=>{if(r=void 0,C=null,B.button!==0)return;let D=O(B);D&&!w(B)&&!e.protected(D.paragraphId)&&(C={x:B.clientX,y:B.clientY,paragraphId:D.paragraphId,fieldNodeId:D.field.fieldNodeId,moved:false}),g=D?{paragraphId:D.paragraphId,fieldNodeId:D.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("pointerdown",T,{capture:true});let $=B=>{C&&Math.hypot(B.clientX-C.x,B.clientY-C.y)>4&&(C.moved=true);},W=()=>{C=null;},q=(B,D=false)=>{let j=C;if(C=null,!j||j.moved||h||B.button!==0||B.detail>1||Math.hypot(B.clientX-j.x,B.clientY-j.y)>4||!e.editable()||w(B)||e.protected(j.paragraphId))return;let H=eb$1(e.part(),j.paragraphId),N=H?.kind==="paragraph"?Zk(H).find(X=>X.fieldNodeId===j.fieldNodeId):null;if(!N)return;let z=e.selection();D&&(z.anchor.paragraphId!==z.head.paragraphId||z.anchor.offset!==z.head.offset)&&!(z.anchor.paragraphId===j.paragraphId&&z.head.paragraphId===j.paragraphId&&Math.min(z.anchor.offset,z.head.offset)===N.start&&Math.max(z.anchor.offset,z.head.offset)===N.end)||I(j.paragraphId,N,"press");},K=[e.listeners.onDocument("pointermove",$),e.listeners.onDocument("pointercancel",W)];e.pagesLayer.addEventListener("click",q);let Z=B=>{if(B.shiftKey||B.altKey||B.ctrlKey||B.metaKey||e.pagesLayer.contentEditable==="false")return false;let D=O(B);if(!D)return false;let{paragraphId:j,field:H}=D;return B.preventDefault(),I(j,H,"press"),e.protected(j)||R(j,H),true};e.pagesLayer.addEventListener("dblclick",Z);function M(){let B=e.selection();if(B.anchor.paragraphId!==B.head.paragraphId)return null;let D=B.head.paragraphId,j=eb$1(e.part(),D);if(j?.kind!=="paragraph")return null;let H=Math.min(B.anchor.offset,B.head.offset),N=Math.max(B.anchor.offset,B.head.offset),z=Zk(j).filter(F=>F.start<=H&&F.end>=N&&(F.start===F.end||H!==N||H<F.end||e.protected(D))),X=z.find(F=>b?.paragraphId===D&&F.fieldNodeId===b.fieldNodeId)??z.find(F=>F.start===H&&F.end===N)??z[0];return X?{paragraphId:D,field:X}:null}function ee(){if(r===void 0)return M();if(!r)return null;let B=eb$1(e.part(),r.paragraphId),D=B?.kind==="paragraph"?Zk(B).find(j=>j.fieldNodeId===r.fieldNodeId):null;return D?{paragraphId:r.paragraphId,field:D}:null}let J=B=>{let D=B.button===-1||B.clientX===0&&B.clientY===0?M():O(B);r=D?{paragraphId:D.paragraphId,fieldNodeId:D.field.fieldNodeId}:null;};e.pagesLayer.addEventListener("contextmenu",J);let fe=()=>{let B=ee();return !!B&&e.editable()&&!e.protected(B.paragraphId)&&!zn$1(e.part(),{op:"setTextFormFieldDefault",paragraphId:B.paragraphId,fieldNodeId:B.field.fieldNodeId,text:"",options:{type:"regular",maxLength:0,format:"",enabled:true}})},se=e.pagesLayer.ownerDocument.createElement("span");return se.className="docx-text-form-status",e.container.append(se),{doubleClick:Z,pointerUp:B=>q(B,true),canEdit:fe,edit(){if(!fe())return false;let B=ee();return I(B.paragraphId,B.field,"travel"),R(B.paragraphId,B.field),true},selectForDeletion(B){let D=e.selection(),{paragraphId:j,offset:H}=D.head;if(!e.editable()||e.protected(j)||D.anchor.paragraphId!==j||D.anchor.offset!==H)return false;let N=eb$1(e.part(),j);if(N?.kind!=="paragraph")return false;let z=Zk(N).find(X=>X.start<X.end&&(B==="backward"?X.end===H:X.start===H));return z?(I(j,z),true):false},wordDeletionBoundary(B,D,j,H){let N=Ie(B,D,j,H),z=e.selection().head.paragraphId;if(e.protected(z))return N;let X=eb$1(e.part(z),z);if(X?.kind!=="paragraph")return N;let F=Zk(X),U=F.find(Y=>Y.start<Y.end&&(j===-1?Y.end===D:Y.start===D));if(U)return j===-1?U.start:U.end;let G=N;for(let Y of F)for(let le of [Y.start,Y.end])j===-1&&le<D&&le>G&&(G=le),j===1&&le>D&&le<G&&(G=le);return G},beforeSelect(B){let D=we=>{if(g!==void 0)b=g;else if(B.anchor.paragraphId!==B.head.paragraphId||b?.paragraphId!==B.head.paragraphId)b=null;else {let Ue=eb$1(e.part(),B.head.paragraphId),_e=Ue?.kind==="paragraph"?Zk(Ue).find(Je=>Je.fieldNodeId===b?.fieldNodeId):null;(!_e||Math.min(B.anchor.offset,B.head.offset)<_e.start||Math.max(B.anchor.offset,B.head.offset)>_e.end)&&(b=null);}return g=void 0,delete se.dataset.fieldError,we};if(o||v)return null;if(!e.editable())return B;let j=M();if(!j||!e.protected(j.paragraphId)||!j.field.enabled||!Jk(j.field))return D(B);let{field:H,paragraphId:N}=j;if((!g||g.fieldNodeId===H.fieldNodeId)&&B.anchor.paragraphId===N&&B.head.paragraphId===N&&Math.min(B.anchor.offset,B.head.offset)>=H.start&&Math.max(B.anchor.offset,B.head.offset)<=H.end)return D(B);let z=i.get(H.fieldNodeId),X=z?.text,F=z?.locale??e.locale?.()??"en-US",U=y(N,H);if(H.type==="date"&&X===void 0)return u(H.fieldNodeId),D(B);let G=Ik(U,H,"fill",F);if(G===U||G===null&&(X===void 0||X===U))return u(H.fieldNodeId),D(B);o=true;let Y=e.part();c(Y);let le=i;i=new Map(le),i.delete(H.fieldNodeId);let oe;try{oe=e.apply({op:"commitTextFormField",locale:F,paragraphId:N,fieldNodeId:H.fieldNodeId}),oe||(i=le);}catch(we){throw e.part()===Y&&(i=le),we}finally{c(),o=false;}if(!oe){if(g=void 0,se.setAttribute("role","alert"),se.dataset.fieldError="true",se.textContent=n("textFormField.invalidValue"),G===null&&(H.type==="number"||H.type==="date")){k();let we=new AbortController;x=we,v=true;let Ue=()=>{if(S||we.signal.aborted||x!==we||(k(),S))return;let Je=e.selection(),et=()=>{e.pagesLayer.focus({preventScroll:true}),e.select(Je);},He=eb$1(e.part(),N),st=He?.kind==="paragraph"?Zk(He).find(an=>an.fieldNodeId===H.fieldNodeId):null;if(!st||!e.editable()||!e.protected(N)||y(N,st)!==U||!st.enabled||!Jk(st)||st.type!==H.type||st.format!==H.format||Ik(U,st,"fill",F)!==null){et();return}o=true;try{if(e.apply({op:"deleteText",paragraphId:N,start:st.start,end:st.end,textFormFieldId:st.fieldNodeId})){u(st.fieldNodeId),delete se.dataset.fieldError,e.pagesLayer.focus({preventScroll:!0});let an={paragraphId:N,offset:st.start};o=!1,e.select({anchor:an,head:an}),b={paragraphId:N,fieldNodeId:st.fieldNodeId};}else o=!1,et();}finally{o=false;}},_e={type:H.type,signal:we.signal,acknowledge:Ue,cancel(){x===we&&!we.signal.aborted&&E();}};!e.onInvalidRequest?.(_e)&&!we.signal.aborted&&(h=HA(e.container,H.type,Ue,n));}return null}u(H.fieldNodeId);let ae=eb$1(e.part(),N),xe=ae?.kind==="paragraph"?Zk(ae).find(we=>we.fieldNodeId===H.fieldNodeId):null,Se=xe?xe.end-H.end:0,at=we=>we.paragraphId===N&&we.offset>=H.end?{...we,offset:we.offset+Se}:we;return D({anchor:at(B.anchor),head:at(B.head)})},update(){h&&OA(h,n);let B=M(),D=e.selection(),j=!!B&&D.anchor.offset!==D.head.offset&&Math.min(D.anchor.offset,D.head.offset)===B.field.start&&Math.max(D.anchor.offset,D.head.offset)===B.field.end;for(let H of e.pagesLayer.querySelectorAll('[data-field-atom="form"][data-start]')){let N=H.closest("[data-paragraph-id]")?.dataset.paragraphId,z=Number(H.dataset.start);!!B&&N===B.paragraphId&&z>=B.field.start&&z<B.field.end?H.dataset.textFormSelection=j?"whole":"caret":delete H.dataset.textFormSelection;}if(se.dataset.fieldError){se.textContent=n("textFormField.invalidValue");return}B?se.setAttribute("role","status"):se.removeAttribute("role"),se.textContent=B?n(j?"textFormField.selected":"textFormField.editing"):"";},fieldId:()=>M()?.field.fieldNodeId??null,afterApply(B){B?c():d();},restoreAfterHistory:d,annotate(B){(!o||B.some(j=>j.op!=="commitTextFormField"))&&c(),B.some(j=>j.op==="insertText"||j.op==="deleteText")&&delete se.dataset.fieldError;let D=M();return b=D?{paragraphId:D.paragraphId,fieldNodeId:D.field.fieldNodeId}:null,B.map(j=>{if(!b||j.op!=="insertText"&&j.op!=="deleteText"||j.revision||j.paragraphId!==b.paragraphId||!e.protected(j.paragraphId))return j;let H=eb$1(e.part(),j.paragraphId),N=H?.kind==="paragraph"?Zk(H).find(F=>F.fieldNodeId===b.fieldNodeId):null,z=j.op==="insertText"?j.offset:j.start,X=j.op==="insertText"?j.offset:j.end;return !N||z<N.start||X>N.end?j:(i.has(N.fieldNodeId)||i.set(N.fieldNodeId,{text:y(j.paragraphId,N),locale:e.locale?.()??"en-US"}),{...j,textFormFieldId:N.fieldNodeId})})},keydown(B){if(B.key==="F10"&&B.shiftKey&&!B.altKey&&!B.ctrlKey&&!B.metaKey)return r=void 0,B.preventDefault(),e.pagesLayer.dispatchEvent(new(Ae(e.pagesLayer)).MouseEvent("contextmenu",{bubbles:true,cancelable:true,button:-1})),true;if(B.key!=="Tab"||B.altKey||B.ctrlKey||B.metaKey||!e.editable()||!e.protected(e.selection().head.paragraphId))return false;let D=[],j=[e.part().root];for(;j.length;){let G=j.pop();if(G.kind==="paragraph")for(let Y of Zk(G))e.protected(G.id)&&Y.enabled&&Jk(Y)&&!zn$1(e.part(),{op:"insertText",paragraphId:G.id,offset:Y.start,text:"x"})&&D.push({paragraphId:G.id,field:Y});else for(let Y=G.children.length-1;Y>=0;Y--){let le=G.children[Y];le.kind!=="textValue"&&j.push(le);}}if(!D.length)return false;let H=e.selection(),N=H.head,z=b?D.findIndex(G=>G.paragraphId===b.paragraphId&&G.field.fieldNodeId===b.fieldNodeId&&G.field.start<=Math.min(H.anchor.offset,N.offset)&&G.field.end>=Math.max(H.anchor.offset,N.offset)):-1,X=z>=0?z:D.findIndex(G=>G.paragraphId===N.paragraphId&&G.field.start<=Math.min(H.anchor.offset,N.offset)&&G.field.end>=Math.max(H.anchor.offset,N.offset)),F=X<0?B.shiftKey?D.length-1:0:(X+(B.shiftKey?-1:1)+D.length)%D.length,U=D[F];return B.preventDefault(),I(U.paragraphId,U.field,"travel"),true},destroy(){S=true,k(),Xf.get(e.pagesLayer)===f&&Xf.delete(e.pagesLayer),Fb.get(e.pagesLayer)===p&&Fb.delete(e.pagesLayer);for(let B of K)B();e.pagesLayer.removeEventListener("click",q),e.pagesLayer.removeEventListener("contextmenu",J),se.remove(),e.pagesLayer.removeEventListener("dblclick",Z),e.pagesLayer.removeEventListener("pointerdown",T,{capture:true}),h?.remove(),h=null;}}}function KA(e,t,n,r=o=>o){let o,i=e.subscribe(a=>{for(let s of a.splitJoin)"split"in s&&s.split.from===t&&(o=s.split.tail);});try{n(()=>{let a=o&&r(o,t);if(!a)return null;let s={paragraphId:a,offset:0};return {anchor:s,head:s}});}finally{i();}}var Yf=new WeakMap;function Oc(e){let t=Yf.get(e);if(t)return t.settled??=new Promise(n=>{t.resolve=n;}),t.settled}function UA(e){let t=Yf.get(e)??{depth:0};return t.depth++,Yf.set(e,t),()=>{--t.depth===0&&(Yf.delete(e),t.resolve?.());}}var bq=12;function Mc(e,t){if(typeof MessageChannel!="function"){t.setTimeout(e,0);return}let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),e();},n.port2.postMessage(null);}function jA(e,t,n=bq){let r=globalThis.performance??Date;return new Promise((o,i)=>{let a=()=>{let s=r.now()+n;try{for(;;){let l=e.next();if(l.done){o(l.value);return}if(r.now()>=s)break}}catch(l){i(l);return}Mc(a,Ae(t));};a();})}async function VA(e,t,n){if(!e)throw on("notFound","no document is loaded");let r=t?Oc(t):void 0;if(r&&(await r,n()!==e))throw on("invalidState","The document changed before the pending save could finish.");return (await jA(e.saveSteps(),t)).slice().buffer}function GA(e,t,n){return ZA(e,t,n,()=>e.session.save())}function zA(e,t,n){return ZA(e,t,n,()=>e.session.saveSteps())}function ZA(e,t,n,r){let o=()=>{if(n())throw on("destroyed","Cannot save a destroyed surface.")};if(o(),Oc(t))throw on("invalidState","Cannot save during an active edit. Retry after the edit finishes.");e.flushPendingInput(),o();let i=WA(t);if(i)throw on(i,"Cannot save pending text form input. Enter a valid value in each field.");o(),e.refreshRefFieldResults(),o();let a=LM(t);ti(t,true);try{return r()}finally{ti(t,a);}}function Qf(e,t,n){let r=false;return t(()=>{let o=n([e]);return r=!o.rejected,o}),r}function XA(e,t,n){let r=n.refusal();if(r)return r;let o=new Map;for(let a of e){if(a.op!=="commitTextFormField")return "invalidArgs";let s=Et(n.session,a.paragraphId,{kind:"body"}),l=JSON.stringify(s),c=o.get(l)??{scope:s,ops:[]};c.ops.push(a),o.set(l,c);}for(let a of o.values()){let s=n.gate(a.ops,a.scope);if(s)return s}if(n.collaborationActive)return "unsupported";let i;return n.commit(()=>i=n.session.applyTreeOpsAtomic([...o.values()]),()=>t),i?.rejected?i.reason??"invalidArgs":null}function YA(e,t){let n=Ek(e);return {get:()=>n,set(r){let o=Ek(r);n!==o&&(t(),n=o);}}}var vq=42,xq=/^(\d{4})-(\d{2})-(\d{2})/,Sq=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"]),wq=new Set(["AE","AF","BH","DJ","DZ","EG","IQ","IR","JO","KW","LY","OM","QA","SD","SY"]);function aa(e){return `${String(e.getFullYear()).padStart(4,"0")}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`}function Co(e){let t=xq.exec(e);if(!t)return null;let n=Number(t[1]),r=Number(t[2]),o=Number(t[3]);if(r<1||r>12||o<1||o>31)return null;let i=new Date(n,r-1,o);return i.getFullYear()!==n||i.getMonth()!==r-1||i.getDate()!==o?null:i}function Jf(e){let t=Ek(e);try{let n=new Intl.Locale(t),r=n,o=r.getWeekInfo?.().firstDay??r.weekInfo?.firstDay;if(typeof o=="number"&&o>=1&&o<=7)return o%7;let i=n.maximize().region;if(i&&Sq.has(i))return 0;if(i&&wq.has(i))return 6}catch{}return 1}function QA(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}function JA(e,t,n){return new Intl.DateTimeFormat(Ek(n),{calendar:"gregory",month:"long",year:"numeric"}).format(new Date(e,t,1))}function eL(e){let t=Ek(e),n=new Intl.DateTimeFormat(t,{calendar:"gregory",weekday:"narrow"}),r=Jf(t);return Array.from({length:7},(o,i)=>n.format(new Date(2024,0,7+(r+i)%7)))}function Db(e,t,n={}){let r=Ek(n.locale),o=n.selected?Co(n.selected):null,i=n.today??new Date,a=new Intl.DateTimeFormat(r,{calendar:"gregory",weekday:"long",year:"numeric",month:"long",day:"numeric"}),s=Jf(r),l=(new Date(e,t,1).getDay()-s+7)%7,c=[];for(let d=0;d<vq;d+=1){let u=new Date(e,t,d-l+1);c.push({iso:aa(u),day:u.getDate(),label:a.format(u),otherMonth:u.getMonth()!==t,selected:o!==null&&QA(u,o),today:QA(u,i)});}return {year:e,month:t,title:JA(e,t,r),weekdays:eL(r),days:c}}function ep(e,t,n){let r=new Date(e,t+n,1);return {year:r.getFullYear(),month:r.getMonth()}}function Nb(e,t,n,r=false){let o=Co(e);if(!o)return null;let i={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7},a=(o.getDay()-Jf(n)+7)%7;if(t==="PageUp"||t==="PageDown"){let s=o.getDate();o.setDate(1),o.setMonth(o.getMonth()+(t==="PageUp"?-1:1)*(r?12:1));let l=new Date(o.getFullYear(),o.getMonth()+1,0).getDate();o.setDate(Math.min(s,l));}else {let s=t==="Home"?-a:t==="End"?6-a:i[t];if(s===void 0)return null;o.setDate(o.getDate()+s);}return o.getFullYear()>=100&&o.getFullYear()<=9999?aa(o):null}function tp(e,t){let n=Co(e);if(!n)return "";let r=Ek(t),o=new Intl.NumberFormat(r,{useGrouping:false}).format(0);return new Intl.DateTimeFormat(r,{calendar:"gregory",year:"numeric",month:"numeric",day:"numeric"}).formatToParts(n).map(i=>i.type==="year"?i.value.padStart(4,o):i.value).join("")}function Hb(e,t){if(e.length>100)return null;let n=e.trim();if(/^\d{4}-\d{2}-\d{2}$/.test(n)){let s=Co(n);return s?aa(s):null}let r=Fk(Ek(t)),o=r.pattern.exec(Gk(n,r));if(!o)return null;let i={year:"",month:"",day:""};if(r.order.forEach((s,l)=>{i[s]=o[l+1];}),i.year.length!==4)return null;let a=`${i.year}-${i.month.padStart(2,"0")}-${i.day.padStart(2,"0")}`;return Co(a)?a:null}function _b(e){let t=new Intl.DateTimeFormat(Ek(e),{calendar:"gregory",month:"long"});return Array.from({length:12},(n,r)=>t.format(new Date(2e3,r,1)))}function Bb(e){let t="",n=0,r=new Intl.Collator(Ek(e),{usage:"search",sensitivity:"base"});return {reset(){t="",n=0;},keyDown(o,i){if(o.defaultPrevented||o.isComposing||o.altKey||o.ctrlKey||o.metaKey)return;let a=o.target.tagName==="INPUT",s=[...i.querySelectorAll('[role="option"]')].filter(d=>!d.hasAttribute("disabled"));if(!s.length)return;let l=s.indexOf(i.ownerDocument.activeElement),c;if(o.key==="ArrowDown")c=Math.min(s.length-1,l+1);else if(o.key==="ArrowUp")c=l<0?s.length-1:Math.max(0,l-1);else if(!a&&o.key==="Home")c=0;else if(!a&&o.key==="End")c=s.length-1;else if(!a&&o.key.length===1&&o.key!==" "){let d=Date.now();t=d-n>700?o.key:(t+o.key).slice(-100),n=d;let u=[...t].every(f=>r.compare(f,o.key)===0)?o.key:t;for(let f=1;f<=s.length;f++){let p=(Math.max(-1,l)+f)%s.length;if(r.compare((s[p].textContent??"").slice(0,u.length),u)===0){c=p;break}}}c!==void 0&&(o.preventDefault(),s.forEach((d,u)=>{d.tabIndex=u===c?0:-1;}),s[c]?.focus({preventScroll:true}),s[c]?.scrollIntoView?.({block:"nearest"}));}}}var kq=0;function tL(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=>Ec(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 nL(e,t,n){if(!n){t.append(e);return}e.style.left=`${n.left}px`,e.style.top=`${n.top}px`;let r=n.element?t.closest(".docx-editor__scroll-container")??t.parentElement??t:t;if(r.append(e),n.element){let a=Tc(e,n.element),s=new(Ae(e)).MutationObserver(()=>{e.isConnected||(a(),s.disconnect());});s.observe(r,{childList:true});return}let o=e.offsetWidth;if(o<=0)return;let i=n.left+o-n.sheetRight;i>0&&(e.style.left=`${Math.max(n.sheetLeft,n.left-i)}px`);}function np(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=cr(e.translate)("disabledReason.invalidValue"),false}function rL(e,t,n,r,o,i){let a=tL(e,t),s=cr(e.translate);a.setAttribute("role","dialog"),a.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let l=e.document.createElement("div");l.className="docx-content-control-menu-list",l.dataset.docxPart="list",l.id=`docx-engine-cc-list-${++kq}`,l.setAttribute("role","listbox"),l.setAttribute("aria-label",o||s(`contentControl.types.${n}`));let c=Bb(e.locale());a.addEventListener("keydown",u=>c.keyDown(u,a));let d=r.findIndex(u=>u.value===i);for(let[u,f]of r.entries()){let p=e.document.createElement("button");p.type="button",p.className="docx-content-control-menu-item",p.dataset.docxPart="item",p.dataset.value=f.value,p.setAttribute("role","option"),p.setAttribute("aria-selected",String(f.value===i)),p.tabIndex=u===Math.max(0,d)?0:-1,p.textContent=f.displayText,p.addEventListener("click",()=>{np(e,a,t,f.value);}),l.append(p);}if(n==="buildingBlockGallery"&&r.length===0){let u=e.document.createElement("div");u.className="docx-content-control-menu-empty",u.dataset.docxPart="empty",u.setAttribute("role","note"),u.tabIndex=0,u.textContent=s("contentControl.gallery.empty"),l.append(u);}if(n==="comboBox"){let u=e.document.createElement("input");u.type="text",u.className="docx-content-control-menu-input",u.dataset.docxPart="input",u.value=i??"",u.setAttribute("aria-label",o||s("contentControl.types.comboBox")),u.setAttribute("aria-autocomplete","list"),u.setAttribute("role","combobox"),u.setAttribute("aria-expanded","true"),u.setAttribute("aria-controls",l.id),u.addEventListener("keydown",p=>{p.key!=="Enter"||p.isComposing||(p.preventDefault(),np(e,a,t,u.value));}),a.append(u);let f=e.document.createElement("div");f.className="docx-dialog__footer",f.dataset.docxPart="footer";for(let p of ["cancel","apply"]){let g=e.document.createElement("button");g.type="button",g.className=`docx-dialog__button${p==="apply"?" docx-dialog__button--primary":""}`,g.dataset.docxPart=p,g.textContent=s(`common.${p}`),g.addEventListener("click",()=>{p==="apply"?np(e,a,t,u.value):e.close(a);}),f.append(g);}a.append(l,f);}else a.append(l);return a}function rp(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 oL(e,t,n,r){let o=cr(e.translate),i=tL(e,t);i.classList.add("docx-content-control-calendar"),i.setAttribute("role","dialog"),i.setAttribute("aria-label",r||o("contentControl.types.date"));let a=n?Co(n):null,s=a?aa(a):null,l=new Date,c={year:(a??l).getFullYear(),month:(a??l).getMonth()},d=null,u=tp(s??"",e.locale()),f=b=>{np(e,i,t,b);},p=b=>{b.addEventListener("mousedown",x=>x.stopPropagation());},g=e.document.createElement("div");g.className="docx-content-control-calendar-title docx-content-control-calendar-announcement",g.dataset.docxPart="title",g.setAttribute("aria-live","polite");let y=()=>{let b=e.document.activeElement?.dataset.docxCalendarNav,x=Db(c.year,c.month,{locale:e.locale(),selected:s,today:l}),S=e.document.createElement("div");S.className="docx-content-control-calendar-header",S.dataset.docxPart="header";let v=e.document.createElement("button");v.type="button",v.className="docx-content-control-calendar-nav",v.dataset.docxPart="previousMonth",v.dataset.docxCalendarNav="previous",v.textContent="\u2039",v.setAttribute("aria-label",o("contentControl.calendar.previousMonth")),g.textContent=x.title;let k=e.document.createElement("button");k.type="button",k.className="docx-content-control-calendar-nav",k.dataset.docxPart="nextMonth",k.dataset.docxCalendarNav="next",k.textContent="\u203A",k.setAttribute("aria-label",o("contentControl.calendar.nextMonth")),p(v),p(k),v.addEventListener("click",()=>{c=ep(c.year,c.month,-1),d=null,y();}),k.addEventListener("click",()=>{c=ep(c.year,c.month,1),d=null,y();});let E=e.document.createElement("div");E.className="docx-content-control-calendar-navigation",E.dataset.docxPart="navigation";let I=e.document.createElement("select");I.className="docx-content-control-calendar-month",I.dataset.docxPart="month",I.dataset.docxCalendarNav="month",I.setAttribute("aria-label",o("contentControl.calendar.month"));for(let[Z,M]of _b(e.locale()).entries()){let ee=e.document.createElement("option");ee.value=String(Z),ee.textContent=M,I.append(ee);}I.value=String(c.month);let R=e.document.createElement("input");R.type="number",R.min="100",R.max="9999",R.value=String(c.year),R.className="docx-content-control-calendar-year",R.dataset.docxPart="year",R.dataset.docxCalendarNav="year",R.addEventListener("keydown",Z=>{Z.key==="Enter"&&!Z.isComposing&&(Z.preventDefault(),R.blur());}),R.setAttribute("aria-label",o("contentControl.calendar.year")),I.addEventListener("change",()=>{c.month=Number(I.value),d=null,y();}),R.addEventListener("change",()=>{let Z=Number(R.value);if(!Number.isInteger(Z)||Z<100||Z>9999){R.value=String(c.year);return}c.year=Z,d=null,y();}),E.append(I,R);let O=e.document.createElement("div");O.className="docx-content-control-calendar-weekdays",O.dataset.docxPart="weekdays";for(let Z of x.weekdays){let M=e.document.createElement("span");M.textContent=Z,O.append(M);}let C=e.document.createElement("div");C.className="docx-content-control-calendar-grid",C.dataset.docxPart="grid",C.setAttribute("role","grid"),C.setAttribute("aria-label",x.title);for(let Z=0;Z<x.days.length;Z+=7){let M=e.document.createElement("div");M.className="docx-content-control-calendar-week",M.setAttribute("role","row");for(let ee of x.days.slice(Z,Z+7))M.append(h(ee));C.append(M);}let w=e.document.createElement("div");w.className="docx-content-control-calendar-entry",w.dataset.docxPart="dateEntry";let T=e.document.createElement("button");T.type="button",T.className="docx-content-control-calendar-today",T.dataset.docxPart="today",T.textContent=o("contentControl.calendar.today"),p(T),T.addEventListener("click",()=>f(aa(l)));let $=e.document.createElement("input");$.type="text",$.className="docx-content-control-menu-input",$.dataset.docxPart="input",$.setAttribute("aria-label",o("contentControl.types.date")),$.placeholder=tp("2006-11-22",e.locale()),$.value=u,$.addEventListener("input",()=>{u=$.value,$.removeAttribute("aria-invalid"),W.hidden=true;});let W=e.document.createElement("div");W.className="docx-content-control-widget-error",W.dataset.docxPart="error",W.setAttribute("role","alert"),W.hidden=true,W.textContent=o("disabledReason.invalidValue");let q=()=>{let Z=Hb(u,e.locale());Z?f(Z):(W.hidden=false,$.setAttribute("aria-invalid","true"),$.focus());};$.addEventListener("keydown",Z=>{Z.key==="Enter"&&!Z.isComposing&&(Z.preventDefault(),q());});let K=e.document.createElement("div");K.className="docx-dialog__footer",K.dataset.docxPart="footer";for(let Z of ["cancel","apply"]){let M=e.document.createElement("button");M.type="button",M.dataset.docxPart=Z,M.className=`docx-dialog__button${Z==="apply"?" docx-dialog__button--primary":""}`,M.textContent=o(`common.${Z}`),M.addEventListener("click",Z==="apply"?q:()=>e.close(i)),K.append(M);}S.append(v,E,k,g),w.append(T,$),i.replaceChildren(S,O,C,w,W,K),rp(i,d),b==="previous"&&v.focus({preventScroll:true}),b==="next"&&k.focus({preventScroll:true}),b==="month"&&I.focus({preventScroll:true}),b==="year"&&R.focus({preventScroll:true});},h=b=>{let x=e.document.createElement("button");return x.type="button",x.className="docx-content-control-calendar-day",x.dataset.docxPart="day",x.textContent=String(b.day),x.dataset.iso=b.iso,x.setAttribute("role","gridcell"),x.setAttribute("aria-label",b.label),b.otherMonth&&(x.dataset.otherMonth=""),b.selected&&(x.dataset.selected="",x.setAttribute("aria-selected","true")),x.setAttribute("aria-selected",String(b.selected)),b.today&&(x.dataset.today="",x.setAttribute("aria-current","date")),p(x),x.addEventListener("click",()=>f(b.iso)),x.addEventListener("keydown",S=>{if(S.isComposing||S.altKey||S.ctrlKey||S.metaKey)return;let v=Nb(b.iso,S.key,e.locale(),S.shiftKey);if(!v)return;S.preventDefault();let k=Co(v);if(d=v,k.getFullYear()!==c.year||k.getMonth()!==c.month){c={year:k.getFullYear(),month:k.getMonth()},y();return}rp(i,d);}),x};return y(),i}function $b(e,t){let r=(Wt(t)?t:null)?.closest("[data-docx-form-checkbox][data-start]"),o=r?.closest("[data-paragraph-id]")?.dataset.paragraphId;if(!r||!o)return null;let i=eb$1(e.part(o),o);if(i?.kind!=="paragraph")return null;let a=Number(r.dataset.start),s=an(i).find(l=>l.start<=a&&a<l.end);return s?{paragraphId:o,field:s}:null}function iL(e){return e.shiftKey||e.altKey||e.ctrlKey||e.metaKey}function aL(e){let t=(i,a)=>{if(!e.editable()||!a.enabled)return false;let s=e.apply({op:"setLegacyCheckbox",paragraphId:i,fieldNodeId:a.fieldNodeId,checked:!a.checked});return s&&(e.pagesLayer.focus({preventScroll:true}),e.select({anchor:{paragraphId:i,offset:a.start},head:{paragraphId:i,offset:a.end}})),s},n=i=>{if(i.button!==0||iL(i))return;let a=$b(e,i.target);!a||!e.editable()||!a.field.enabled||(i.preventDefault(),i.stopPropagation(),t(a.paragraphId,a.field));};e.pagesLayer.addEventListener("pointerdown",n,{capture:true});let r=i=>{let a=$b(e,i.target);a&&Gr(i.target)&&i.target.setAttribute("aria-disabled",String(!e.editable()||!a.field.enabled));};e.pagesLayer.addEventListener("focusin",r);let o=()=>{let i=e.selection();if(i.anchor.paragraphId!==i.head.paragraphId)return null;let a=i.head.paragraphId,s=eb$1(e.part(a),a);if(s?.kind!=="paragraph")return null;let l=Math.min(i.anchor.offset,i.head.offset),c=Math.max(i.anchor.offset,i.head.offset),d=an(s).find(u=>u.start===l&&u.end===c||l===c&&l===u.start&&e.protected(a));return d?{paragraphId:a,field:d}:null};return {keydown(i){let a=$b(e,i.target);if(a&&i.key==="Tab")return true;if(a&&i.key.length===1&&i.key!==" "&&!i.ctrlKey&&!i.metaKey&&!i.altKey)return i.preventDefault(),true;if(i.key!==" "||iL(i)||i.isComposing)return false;let s=a??o();if(!s)return false;if(!e.editable()||!s.field.enabled)return a?(i.preventDefault(),true):false;i.preventDefault();let l=t(s.paragraphId,s.field);return a&&l&&[...e.pagesLayer.querySelectorAll("[data-docx-form-checkbox][data-start]")].find(c=>c.dataset.paragraphId===s.paragraphId&&Number(c.dataset.start)===s.field.start)?.focus({preventScroll:true}),true},destroy(){e.pagesLayer.removeEventListener("pointerdown",n,{capture:true}),e.pagesLayer.removeEventListener("focusin",r);}}}var Iq=new Set(["insertText","deleteText","insertTab","insertHardBreak","insertPageBreak","insertPageField","insertComplexField","insertEquation","setFieldResult","insertInlineContentControl","insertNote","insertTable","insertTableRow","deleteTableRow","mergeTableCells","splitTableCell","setRunProperties","setParagraphProperties","setParagraphMarkProperties","setListNumbering","setListLevel","setContentControlValue"]);function sL(e){return Iq.has(e.op)}function Ac(e){if(sL(e))return e.revision!==void 0;switch(e.op){case "setParagraphMarkRevision":case "proposeParagraphMerge":return true;case "insertContentControl":case "authorTable":case "splitParagraphMany":return e.revision!==void 0;default:return false}}var Rq=e=>el.has(e);function Lc(e,t,n){return e.flatMap(r=>sL(r)?!n&&Rq(r.op)?[r]:[r.revision!==void 0?r:{...r,revision:t}]:r.op==="splitParagraphMany"?[{...r,revision:t}]:r.op==="splitParagraph"?[r,{op:"setParagraphMarkRevision",paragraphId:r.paragraphId,kind:"ins",revision:t}]:r.op==="joinParagraphs"?[{op:"proposeParagraphMerge",paragraphId:r.secondId,revision:t}]:[r])}function op(e,t,n,r,o){let{past:i,landing:a}=Fj$1(e,{start:t,end:n},n,r,o),s=Dj$1(e,t,i,r);return (i-t>s?a:i)-s}function qb(e){return e?.trim()||void 0}var Wb=new Map;function lL(e){let t=Wb.get(e);if(t!==void 0)return t;let n=e.trim().split(/\s+/).filter(Boolean),r=n.length===0?"?":n.slice(0,2).map(o=>o[0].toUpperCase()).join("");return Wb.size<256&&Wb.set(e,r),r}function ip(e){return e==="suggesting needs an author before it can propose a change"||e==="tracked changes need a non-empty author"}function ws(e,t,n){if(!e)return null;let r=Ge(e,t);return !r||r.record.paragraphId!==n?null:{paragraphId:n,offset:r.record.start}}var cL="docx-field-atom--active",Pq="docx-field-atom",dL=new WeakMap;function Kb(e,t,n){let r=dL.get(e);r||(r={caretKey:null,marked:[]},dL.set(e,r));let o=t?`${t.paragraphId}\0${t.offset}`:null;if(!n?.domReplaced&&o===r.caretKey)return;for(let a of r.marked)a.classList.remove(cL);if(r.marked=[],r.caretKey=o,!t)return;let i=e.querySelectorAll(`.${Pq}`);for(let a of i){if(a.dataset.paragraphId!==t.paragraphId)continue;let s=Number(a.dataset.fieldResultStart??a.dataset.start),l=Number(a.dataset.fieldResultEnd??a.dataset.end);!Number.isFinite(s)||!Number.isFinite(l)||t.offset<s||t.offset>l||(a.classList.add(cL),r.marked.push(a));}}var uL=new WeakMap;function Tq(e){let t=[],n={x:e.box.x,y:e.box.y};for(let r of [e.header,e.footer]){if(!r)continue;let o={x:r.box.x,y:r.box.y};Sa(r,(i,a)=>{a.textboxDepth===0||a.textboxOwner?.accessibility.hidden||a.textboxOwner?.textboxStory?.contentRotation||t.push(Cf$2(i,a.storyOrigin.x-e.contentBox.x,a.storyOrigin.y-e.contentBox.y));},o,i=>Ja(i,o,n));}return t}function sa(e){let t=uL.get(e);if(t)return t;let n=e.pages.map(o=>{let i=mL(o);return i.length?{...o,fragments:[...o.fragments,...i]}:o}),r=n.every((o,i)=>o===e.pages[i])?e:{...e,pages:n};return uL.set(e,r),r}function mL(e){let t=$b$1(e).flatMap(n=>{let r=n.textboxStory;return r.contentRotation?[]:r.fragments.flatMap(o=>o.kind==="paragraph"?[Cf$2(o,n.x+r.contentOffset.x,n.y+r.contentOffset.y)]:[])});return t.push(...Tq(e)),t}var fL=new WeakMap,pL=new WeakMap;function Ub(e){let t=fL.get(e);if(t)return t;let n=e.pages.map(o=>{let i=pL.get(o);if(!i){let{header:a,footer:s,footnotes:l,endnotes:c,...d}=o;i={...d,fragments:mL(o)},pL.set(o,i);}return i}),r={...e,pages:n};return fL.set(e,r),r}function gL(e,t,n,r){let o=af$1(e,t,n,r),i=null,a=t.filter(s=>o.has(s.key)||!s.key.startsWith("comment-")?false:(i??=fb$2(e),!i.has(s.from.paragraphId)));if(a.length===0)return o;for(let[s,l]of af$1(Ub(e),a,n,r))o.set(s,l);return o}var Eq={kind:"body"};function hL(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??=_(e.canonicalUnfilteredLayout()),n(l)):_(e.layout),o={package:t.currentPackage(),styleCascade:e.styleCascade,numberingIndex:e.numberingIndex,displayMode:e.displayMode,pageRefPageNumberOf:r},i=$(t.part(),o),a=aa$1(t.part(),o);if(!i&&a.length===0)return true;let s=[];i&&s.push({scope:Eq,ops:[i]});for(let l of a)s.push({scope:{kind:"notesPart",noteKind:l.noteKind},ops:[l.op]});return t.applyTreeOpsAtomic(s).committed}function Cq(e,t,n){return t==="all-markup"||t==="simple-markup"?pe(e,k$3(n.reviewItems()),t==="simple-markup"):e}function yL(e,t,n){return e.filter(Cq(t.filterForSession(n),e.view(),n))}function bL(){let e=new WeakMap;return {record(t,n){e.set(t,[n?.cacheKey,n?.unlisted]);},moved(t,n){let[r,o]=e.get(t)??[];return n?.cacheKey!==r||n?.unlisted!==o}}}function xL(e){let t=0,n=null,r="",o=null,i=true,a=null,s="";return ()=>{let l=e.surface(),c=`${l?.session.packageRevision()??-1}:${l?.session.revision()??-1}`,d=e.activeKey(),u=e.paneOpen(),f=e.selectionAnchor(),p=e.authorFilterKey();return (l!==n||c!==r||d!==o||u!==i||f!==a||p!==s)&&(n=l,r=c,o=d,i=u,a=f,s=p,t+=1),t}}function ap(e=[]){let t=new Set(e),n=Object.freeze([...t]),r=qb$1(t),o=null,i="accept",a=null,s="accept",l=new WeakMap,c=null,d=false,u=0,f=null,p=[],g=null,y=[],h=r,b=t,x=new Set,S="accept",v=new WeakSet,k=new WeakMap,E=new Map,I=()=>{u+=1,f=null,p=[],g=null;},R=w=>JSON.stringify([w.id,ml(w)]),O=(w,T,$)=>{let W=Oq($),q=t,K=r?.hiddenAuthors??pb$1,Z=i,M;q===b&&Mq(W,x)&&(W.size===0||Z===S)?M=h:W.size===0&&q.size===0?M=void 0:M=Object.freeze({hiddenAuthors:K,includes:J=>!q.has(J.author)&&!W.has(J.nodeId),includesNode:(J,fe)=>!q.has(fe)&&!W.has(J),excludedNodeMode:(J,fe)=>q.has(fe)?"proposed":W.has(J)&&Z==="reject"?"original":"proposed",cacheKey:Aq(q,W,Z)});let ee=[];for(let J of w){let fe=vL(J);fe!==null&&q.has(fe)||J.kind==="revision"&&T.has(J)||ee.push(J);}y=ee.length===w.length?w:hm(ee),g=w,v=T,h=M,b=q,x=W,S=Z,d=false,a=null,s="accept",l=new WeakMap,c=null;},C=w=>{if(w===g)return;let T=new WeakSet,$=[],W=[];try{for(let K of w){if(K.kind!=="revision")continue;let Z=!t.has(K.author),M=k.get(K);M===void 0&&(M=o?.(K)??!0,W.push([K,M])),!(Z&&M)&&(T.add(K),M||$.push(K));}}catch(K){if(d)o=a,i=s,k=l,g=c,a=null,s="accept",l=new WeakMap,c=null,u+=1;else {let Z=new WeakSet,M=[];for(let ee of w){if(ee.kind!=="revision")continue;let J=E.get(R(ee))??true;(t.has(ee.author)||!J)&&Z.add(ee),J||M.push(ee);}O(w,Z,M);}throw d=false,K}for(let[K,Z]of W)k.set(K,Z);let q=new Map;for(let K of w)K.kind==="revision"&&q.set(R(K),k.get(K)??true);E=q,O(w,T,$);};return {get hiddenAuthors(){return r?.hiddenAuthors??pb$1},get hiddenAuthorList(){return n},get stateKey(){return String(u)},get hasFilter(){return t.size>0||o!==null},get hasPredicate(){return o!==null},filterFor(w){return o?(C(w),h):r},filterForSession(w){return o?(C(w.reviewItems()),h):r},filterItems(w){if(!o){if(t.size===0)return w;if(w===f)return p;let T=w.filter($=>{let W=vL($);return W===null||!t.has(W)});return f=w,p=T.length===w.length?w:hm(T),p}return C(w),y},includesRevisionItem(w){return !v.has(w)},setPredicate(w,T="accept"){return o===null&&w===null?false:w===null?(o=null,i="accept",a=null,s="accept",d=false,k=new WeakMap,l=new WeakMap,E=new Map,c=null,y=[],v=new WeakSet,h=r,b=t,x=new Set,S="accept",I(),true):(a=o,s=i,l=k,c=g,d=true,o=w,i=T,k=new WeakMap,I(),true)},isVisible:w=>!t.has(w),setVisible(w,T){if(T===!t.has(w))return false;let $=new Set(t);return T?$.delete(w):$.add(w),t=$,n=Object.freeze([...$]),r=qb$1($),I(),true},setAllVisible(w,T){let $=T?new Set:new Set(w);return $.size===t.size&&[...$].every(W=>t.has(W))?false:(t=$,n=Object.freeze([...$]),r=qb$1($),I(),true)},showAll(){return t.size===0?false:(t=new Set,n=Object.freeze([]),r=void 0,I(),true)}}}function SL(e,t){return t.filterItems(e)}function Oq(e){let t=new Set;for(let n of e)for(let r of ml(n))t.add(r);return t}function Mq(e,t){if(e.size!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function Aq(e,t,n){return JSON.stringify({hiddenAuthors:[...e].sort(),excludedNodeIds:[...t].sort(),mode:t.size===0?"accept":n})}function vL(e){return e.kind==="comment"?e.comment?.author??"":e.author??null}function wL(e,t){let n=r=>{if(!t.enabled)return;let o=t.surface();if(o)return o.setAllRevisionAuthorsVisible(r);!r||!e.showAll()||t.notify();};return {isReviewAuthorVisible:e.isVisible,setReviewAuthorVisible(r,o){if(!t.enabled)return;let i=t.surface();if(i)return i.setRevisionAuthorVisible(r,o);e.setVisible(r,o)&&t.notify();},setAllReviewAuthorsVisible:n,showAllReviewAuthors:()=>n(true)}}var Lq=Object.freeze({mode:"atomic",run:e=>e(),wrap:e=>e,methods:e=>e,listeners:()=>{},selectsWholeFieldWhen:()=>{},edits:e=>e});function Fq(e){if(e===void 0||e==="atomic")return "atomic";if(e==="editable")return "editable";throw new TypeError('Invalid fieldResults: use "atomic" or "editable"')}var jb='fieldResults "editable" is not supported in a collaboration session: shared paragraph text keeps each field one unit';function Dq(e){if(e==="atomic")return Lq;let t=o=>Vg$1(e,o),n=o=>function(...i){return t(()=>o.apply(this,i))},r=()=>false;return {mode:e,run:t,wrap:n,selectsWholeFieldWhen(o){r=o;},edits:o=>function(...i){return r()?Wg$1(()=>o.apply(this,i)):o.apply(this,i)},methods(o){for(let i of Reflect.ownKeys(o)){let a=Object.getOwnPropertyDescriptor(o,i);if(a?.configurable){if(typeof a.value=="function")a.value=n(a.value);else if(a.get||a.set)a.get&&(a.get=n(a.get)),a.set&&(a.set=n(a.set));else continue;Object.defineProperty(o,i,a);}}return o},listeners(o){let i=o.addEventListener,a=o.removeEventListener,s=new WeakMap,l=c=>{let d=s.get(c);return d||(d=typeof c=="function"?function(u){return t(()=>c.call(this,u))}:u=>t(()=>c.handleEvent(u)),s.set(c,d)),d};Object.defineProperty(o,"addEventListener",{configurable:true,writable:true,value(c,d,u){d&&i.call(o,c,l(d),u);}}),Object.defineProperty(o,"removeEventListener",{configurable:true,writable:true,value(c,d,u){d&&a.call(o,c,s.get(d)??d,u);}});}}}function kL(e,t){if(t.mode==="atomic")return e;let n=e,r=n.subscribe.bind(n),o=n.applyTreeOps.bind(n),i=n.applyTreeOpsAtomic.bind(n);return n.subscribe=a=>r(t.wrap(a)),n.applyTreeOps=t.edits(o),n.applyTreeOpsAtomic=t.edits(i),t.methods(e)}function sp(e){let t=Fq(e.fieldResults);if(t==="editable"&&e.collaborationModel)throw new TypeError(jb);return Dq(t)}function lp(e,t){let n=e.part(t),r=n?eb$1(n,t):null;return r?.kind!=="paragraph"?[]:Ak(r).filter(o=>o.start<o.end)}function Nq(e,t){return lp(e,t.paragraphId).find(n=>t.offset>n.start&&t.offset<n.end)}function Hq(e,t){let n=(i,a)=>{let s=Nq(e,i);if(!s||a.paragraphId===i.paragraphId&&a.offset>=s.start&&a.offset<=s.end)return i;let l=e.compare(a,i)<0?s.end:s.start;return {paragraphId:i.paragraphId,offset:l}},r=n(t.anchor,t.head),o=n(t.head,t.anchor);return r===t.anchor&&o===t.head?t:{anchor:r,head:o}}function _q(e,t){if(t.length!==2)return t;let[n,r]=t;if(n?.op!=="deleteText"||r?.op!=="insertText"||r.paragraphId!==n.paragraphId||n.start>=n.end||r.offset!==n.start&&r.offset!==n.end)return t;let{start:o,end:i}=n,a=lp(e,n.paragraphId).find(l=>l.start<=o&&i<=l.end);if(!a||o!==a.start&&i!==a.end)return t;let s=r.text.length;return [{...r,offset:o,...o===a.start?{bias:"right"}:{}},{...n,start:o+s,end:i+s}]}function IL(e,t,n){if(n.mode==="atomic")return e;let{selectForDeletion:r,wordDeletionBoundary:o,beforeSelect:i,annotate:a}=e,s=null,l=d=>s!==null&&d.anchor.paragraphId===s.anchor.paragraphId&&d.head.paragraphId===s.head.paragraphId&&d.anchor.offset===s.anchor.offset&&d.head.offset===s.head.offset;n.selectsWholeFieldWhen(()=>l(t.selection()));let c=d=>{let{anchor:u,head:f}=t.selection();if(!(u.paragraphId!==f.paragraphId||u.offset!==f.offset))return lp(t,f.paragraphId).find(p=>d===-1?p.end===f.offset:p.start===f.offset)};return Object.assign(e,{annotate:n.wrap(d=>a.call(e,l(t.selection())?d:_q(t,d))),selectForDeletion:n.wrap(d=>{let u=t.writable()?c(d==="backward"?-1:1):void 0;if(!u)return r.call(e,d);let{paragraphId:f}=t.selection().head;return s={anchor:{paragraphId:f,offset:u.start},head:{paragraphId:f,offset:u.end}},t.select(s),true}),wordDeletionBoundary:n.wrap((d,u,f,p)=>{let g=o.call(e,d,u,f,p),y=lp(t,t.selection().head.paragraphId),h=y.find(x=>f===-1?x.end===u:x.start===u);if(h)return f===-1?h.start:h.end;let b=g;for(let x of y)for(let S of [x.start,x.end])f===-1&&S<u&&S>b&&(b=S),f===1&&S>u&&S<b&&(b=S);return b}),beforeSelect:n.wrap(d=>(l(d)||(s=null),i.call(e,Hq(t,d))))})}function RL(e,t){let n,r=()=>{n!==void 0&&(n=void 0,t());};return ()=>{let o=e.ownerDocument?.defaultView??null;n!==void 0&&n===o||(n=o,o&&typeof o.requestAnimationFrame=="function"?o.requestAnimationFrame(r):queueMicrotask(r));}}var PL=Bf$1;function TL(e){let{session:t,...n}=e;return Pf$2({view:t,...n})}function Nt(e){return e.closest(".docx-editor__scroll-container")}function EL(e){return Number.isFinite(e.scrollWidth)?Math.max(0,e.scrollWidth-e.clientWidth):Number.POSITIVE_INFINITY}function CL(e){return Ae(e).getComputedStyle(e).direction==="rtl"}function Is(e){let t=EL(e);return CL(e)&&Number.isFinite(t)?e.scrollLeft+t:e.scrollLeft}function ks(e,t){let n=EL(e),r=Math.min(Math.max(0,t),n);e.scrollLeft=CL(e)&&Number.isFinite(n)?r-n:r;}function OL(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.width!==0||r.width!==0}function ML(e,t,n){let r=t.clientWidth/2;return OL(e,t)?(t.getBoundingClientRect().left+t.clientLeft+r-e.getBoundingClientRect().left)/n:(Is(t)-e.offsetLeft+r)/n}function AL(e,t,n,r){let o=t.clientWidth/2;if(!OL(e,t)){ks(t,n*r+e.offsetLeft-o);return}let i=t.getBoundingClientRect().left+t.clientLeft,a=e.getBoundingClientRect().left+n*r-(i+o);ks(t,Is(t)+a);}function LL(e){let t=Nt(e);t&&(t.scrollTop=0,t.scrollLeft=0);}function FL(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 DL(e,t,n){let r=Nt(e);if(!r||r.clientHeight<=0||t.pages.length===0||n<=0)return null;let o=FL(e,r,n),i=o.top+o.height/2;for(let a of t.pages)if(i<a.box.y+a.box.height)return a.index+1;return t.pages.length}function NL(e,t,n,r){let o=Nt(e);if(!o||o.clientHeight===0)return;let i=FL(e,o,r),a=[];for(let s of [n.anchor,n.head]){let l=Se(t,s);l&&a.push(l.pageIndex);}return ga({layout:t,viewport:i,overscanPages:1,pinnedPages:a})}function Vb(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 cp(e,t){let n=e.pages[e.pages.length-1],r=n?n.box.y+n.box.height:0,o=t?e.pages.filter(s=>t.has(s.index)):e.pages,i=0;for(let s of o)i=Math.max(i,s.box.x+s.box.width);let a=new Map;if(new Set(o.map(s=>s.box.width)).size>1)for(let s of e.pages)a.set(s.index,(i-s.box.width)/2-s.box.x);return {width:i,height:r,pageOffsetX:a}}function HL(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 _L(e,t,n,r){for(let o of t.pages){let i=e.children.item(o.index);if(i?.dataset.pageIndex!==String(o.index))continue;let a=n.pageOffsetX.get(o.index)??0;i.style.left=`${(o.box.x+a)*r}px`;}}function BL(e){let{pagesLayer:t,listeners:n}=e,r=n.onDocument("selectionchange",e.onSelectionChange),o=RL(t,e.rematerialize),i=n.onDocument("scroll",p=>{let g=Nt(e.container());!g||p.target!==g||o();},{capture:true,passive:true}),a=n.onWindow("resize",o,{passive:true}),s=null,l=null,c=null,d=false;function u(){s?.disconnect(),s=null,l=null,c=null;}function f(){if(d)return;let p=Ae(t);if(p!==l&&(u(),l=p,s=typeof p.ResizeObserver=="function"?new p.ResizeObserver(o):null),!s)return;let g=Nt(e.container());g!==c&&(s.disconnect(),c=g,g&&s.observe(g));}return f(),{schedule:o,watchScrollerSize:f,rebind(){d=false,f(),o();},suspend(){d=true,u();},destroy(){r(),i(),a(),u();}}}function $L(e){let t=new Set,n=false;function r(s){return s==="document"?Wi(e()):Ae(e())}function o(s){s.bound?.removeEventListener(s.type,s.listener,s.options),s.bound=null;}function i(s){let l=r(s.target);s.bound!==l&&(o(s),l.addEventListener(s.type,s.listener,s.options),s.bound=l);}function a(s,l,c,d){let u={target:s,type:l,listener:c,options:d,bound:null};return t.add(u),n||i(u),()=>{o(u),t.delete(u);}}return {onDocument(s,l,c){return a("document",s,l,c)},onWindow(s,l,c){return a("window",s,l,c)},rebind(){n=false;for(let s of t)i(s);},suspend(){n=true;for(let s of t)o(s);},clear(){for(let s of t)o(s);t.clear();},stale(){if(n)return false;for(let s of t)if(s.bound!==r(s.target))return true;return false}}}var Bq=["docx-paginated-surface--viewing","docx-paginated-surface--hf-editing"],$q=["data-docx-layout-pending","data-docx-opening-preview"];function Wq(e,t){if(e===t)return;t.style.position="relative";let n=Array.from(e.childNodes);t.replaceChildren();for(let r of n)t.appendChild(r);for(let r of Bq)e.classList.contains(r)&&(e.classList.remove(r),t.classList.add(r));for(let r of $q){let o=e.getAttribute(r);o!==null&&(e.removeAttribute(r),t.setAttribute(r,o));}e.style.removeProperty("position"),e.style.removeProperty("width"),e.style.removeProperty("height");}var WL=["focusin","pointerdown","pointerenter","wheel"],qq=5,Kq=2e3;function Uq(e){return Wt(e)?e.localName==="input"||e.localName==="textarea"||e.localName==="select"||Gr(e)&&e.isContentEditable:false}function qL(e){let t=null,n=null,r=false,o=Number.NEGATIVE_INFINITY,i=f=>{let p=f.relatedTarget;wo(p)&&e.pagesLayer.contains(p)||(o=Uq(p)?Number.NEGATIVE_INFINITY:Date.now());};e.pagesLayer.addEventListener("focusout",i);let a=nt(()=>e.pagesLayer);function s(f){if(t!==null)return;let p=Nt(f),g=e.scale();n=p?{x:(Is(p)-f.offsetLeft)/g,y:(p.scrollTop-f.offsetTop)/g}:null;let y=e.pagesLayer.ownerDocument.activeElement;r=!!y&&e.pagesLayer.contains(y)||Date.now()-o<Kq;}function l(){let f=n;if(n=null,!f)return;let p=()=>{let h=e.container(),b=Nt(h);if(!b)return false;let x=e.scale();return b.scrollTop=Math.max(0,f.y*x+h.offsetTop),ks(b,f.x*x+h.offsetLeft),true};p();let g=0,y=()=>{t!==null||p()||++g>qq||a.requestAnimationFrame(y);};queueMicrotask(y);}function c(f){s(e.container()),e.settle(),e.listeners.suspend(),e.viewport()?.suspend(),Wq(e.container(),f),e.setContainer(f);}let d=false;function u(){if(!(d||t!==null||e.destroyed()||!e.listeners.stale())){d=true;try{e.listeners.rebind(),e.viewport()?.rebind(),e.settle(),e.onHostMoved?.(e.pagesLayer.ownerDocument);}finally{d=false;}}}for(let f of WL)e.pagesLayer.addEventListener(f,u,{capture:true,passive:true});return {moveTo(f,p){if(!e.destroyed()){if(f===e.container()&&t===null)return u();c(f),t=null,e.listeners.rebind(),e.viewport()?.rebind(),(p?.focus??r)&&e.pagesLayer.focus({preventScroll:true}),e.repaint(),l();}},park(){if(e.destroyed()||t!==null)return;let f=e.pagesLayer.ownerDocument.createElement("div");c(f),t=f;},parked:()=>t!==null,heal:u,destroy(){for(let f of WL)e.pagesLayer.removeEventListener(f,u,{capture:true});e.pagesLayer.removeEventListener("focusout",i);}}}function Gb(e){return e.kind==="comment"?e.comment.author:e.kind==="revision"?e.author:null}function KL(e){let t=null;return {get(){let n=e.layout(),r=e.items(),o=e.styles(),i=t;if(i?.layout===n&&i.items===r&&i.styles===o)return i;let a=e.slots.resolve(h(n),(function*(){for(let f of r){let p=Gb(f);p!==null&&(yield p);}})()),s=i?.value,l=s!==void 0&&s.size===a.size&&[...a].every(([u,f])=>s.get(u)===f),c=l?s:a,d=i!==null&&l&&i.styles===o?i.resolved:new Map(g$1(c,o).map(u=>[u.author,u]));return t={layout:n,items:r,styles:o,value:c,resolved:d},t},releaseLayout(){t!==null&&(t={...t,layout:null,items:null});}}}function UL(e){let t=null;return {forAuthor(n){let r=e.roster(),o=r.resolved.get(n);if(o)return a$3(o.color)??e$1(o.slot);let i=e.slots.resolve(r.value,[n]).get(n);return i===void 0?void 0:e$1(i)},declaredFor(n){let r=e.styles();return (t===null||t.styles!==r)&&(t={styles:r,resolved:f$1(r)}),a$3(t.resolved.get(n)?.color)}}}function ii(e){try{return e.createElement("canvas").getContext("2d")}catch{return null}}function VL(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 GL(e,t){let n=eb$1(e,t);if(!n||n.kind==="textValue")return null;let r=wb$1(n);return !r||!vb(r)?null:{paragraphId:r.toUpperCase(),nodeId:t,text:""}}var zb=new WeakMap;function jq(e,t,n){return e.map(r=>a$3(n?.(r.name))??a$3(r.color)??a$3(t?.(r.name)))}function Vq(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}
|
|
26
|
-
`;return n}function Gq(e){if(!e)return "*";let t=[];for(let n of e)t.push(n);return t.sort((n,r)=>n-r),t.join(",")}function zq(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 Zq(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 jL(e){return e.anchor.nodeId===e.head.nodeId&&e.anchor.offset===e.head.offset}function Xq(e,t){let n=sa$1(e,t.anchor.nodeId),r=sa$1(e,t.head.nodeId);if(!n||!r)return [];let o=ia$1(e,n,r);return o?oa$1(e,o.cellIds).map(i=>({...i,className:"docx-remote-selection-rect"})):[]}function zL(e,t,n,r){t=sa(t);let{scale:o,pageOffsetX:i,pages:a,colorForAuthor:s,declaredColorFor:l}=r,c=r.labelHost??null,d=jq(n,s,l),u={layout:t,fingerprint:Vq(n,d),pagesKey:Gq(a),scale:o,offsetKey:zq(i),labelHost:c},f=zb.get(e);if(f&&Zq(f,e,u))return;zb.delete(e);let p=[],g=[],y=[],h=[];for(let[v,k]of n.entries())k.kind==="cells"||jL(k)||h.push({key:String(v),from:{paragraphId:k.anchor.nodeId,offset:k.anchor.offset},to:{paragraphId:k.head.nodeId,offset:k.head.offset}});let b=h.length>0?ef$1(t,h,gb$1(t),a,r.measurer):null;for(let[v,k]of n.entries()){let E=d[v],I=Se(t,{paragraphId:k.head.nodeId,offset:k.head.offset},r.measurer);if(I){let O=df$1(t,k.head.nodeId,I.pageIndex);y.push({selection:k,...E?{color:E}:{},pageIndex:I.pageIndex,x:I.x+O.x,y:I.y+O.y});}if(k.kind==="cells"){let O=Xq(t,k);if(O.length>0){for(let C of O)p.push(C),g.push(E);continue}}if(jL(k)){let O=Se(t,{paragraphId:k.anchor.nodeId,offset:k.anchor.offset},r.measurer);if(!O)continue;let C=df$1(t,k.anchor.nodeId,O.pageIndex);p.push({pageIndex:O.pageIndex,x:O.x+C.x,y:O.y+C.y,width:Math.max(1/o,1),height:O.height,className:"docx-remote-caret"}),g.push(E);continue}let R=b?.get(String(v));if(R)for(let O of R)p.push({...O,className:"docx-remote-selection-rect"}),g.push(E);}w$1(e,t,p,{scale:o,pageOffsetX:i}),[...e.children].forEach((v,k)=>{let E=a$3(g[k]);!E||!Gr(v)||v.style.setProperty("--doc-remote-color",E);});let x=e.ownerDocument,S=[];for(let v of y){let k=t.pages[v.pageIndex];if(!k)continue;let E=x.createElement("div");E.className="docx-remote-caret-label",c?(E.setAttribute("data-docx-remote-actor",v.selection.actorId),S.push({element:E,selection:v.selection})):E.textContent=v.selection.name,E.style.left=`${(k.contentBox.x+v.x+(i?.get(v.pageIndex)??0))*o}px`,E.style.top=`${(k.contentBox.y+v.y)*o}px`;let I=a$3(v.color);I&&E.style.setProperty("--doc-remote-color",I),e.append(E);}zb.set(e,{...u,childCount:e.childElementCount}),c&&c.publish(S);}function dp(e,t,n){if(n<e+40){let r=Math.max(0,e+40-n);return -Math.min(12,r/40*12)}if(n>t-40){let r=Math.max(0,n-(t-40));return Math.min(12,r/40*12)}return 0}function ZL(e){let t=null,n=0,r=i=>{let a=i.getBoundingClientRect();return dp(a.top,a.bottom,n)},o=()=>{t=null;let i=e.scroller(),a=i?r(i):0;!i||a===0||(i.scrollTop+=a,e.onScroll(),t=e.frames.requestAnimationFrame(o));};return {follow(i){n=i;let a=e.scroller();t===null&&a&&r(a)!==0&&(t=e.frames.requestAnimationFrame(o));},stop(){t!==null&&e.frames.cancelAnimationFrame(t),t=null;}}}function XL(e,t,n){let r=Uh$1(t,n);if(!r)return [];let o=r.children.filter(c=>c.kind==="paragraph"||c.kind==="table"),i=o.findIndex(c=>c.id===n),a=new Map(o.map((c,d)=>[c.id,d===i||d===i+1])),s=[],l=(c,d,u)=>{for(let f of c){let p=f.kind==="paragraph"?f.paragraphId:f.tableId,g=a.get(p);if(f.fragmentIndex===0&&g!==void 0){let{x:y,y:h,width:b}=f.box;s.push({beforeBlockId:p,stays:g,pageIndex:d,x:y,y:h,width:b,origin:u});}if(f.kind==="table")for(let y of f.rows)for(let h of y.cells)l(h.blocks,d,u);}};return e.pages.forEach((c,d)=>{l(c.fragments,d,c.contentBox);for(let u of [c.header,c.footer])u&&l(u.fragments,d,u.box);}),s}function YL(e,t,n,r){let o=l=>l.origin.x+l.x+r(l.pageIndex),i=l=>{let c=Math.abs(l.origin.y+l.y-n),d=o(l);if(t>=d&&t<=d+l.width)return [0,c];let u=Math.min(Math.abs(t-d),Math.abs(t-d-l.width));return [1,Math.hypot(u,c)]},a=null,s=[2,0];for(let l of e){let[c,d]=i(l);(c<s[0]||c===s[0]&&d<s[1])&&(a=l,s=[c,d]);}return a}var Yq=4;function QL(e,t){return {ok:true,ops:[{op:"moveTable",tableId:e,beforeBlockId:t}],selection:{kind:"preserveSelection"}}}function JL(e){let t=null,n=null,r=e.layer.ownerDocument.createElement("div");r.className="docx-table-drop-indicator",r.style.position="absolute",r.style.pointerEvents="none";let o=ZL({scroller:()=>e.pagesLayer.closest(".docx-editor__scroll-container"),frames:e.frames,onScroll:()=>i()});function i(){if(!t?.slots)return;let u=e.pagesLayer.getBoundingClientRect(),f=e.scale();t.slot=YL(t.slots,(t.lastX-u.left)/f,(t.lastY-u.top)/f,e.pageOffsetX);let p=t.slot;if(!p||p.stays){r.remove();return}let g=p.origin.x+p.x+e.pageOffsetX(p.pageIndex);r.style.left=`${g*f}px`,r.style.top=`${(p.origin.y+p.y)*f-1}px`,r.style.width=`${p.width*f}px`,r.parentNode!==e.layer&&e.layer.append(r);}function a(u){if(!(!t||u.pointerId!==t.pointerId)){if(t.lastX=u.clientX,t.lastY=u.clientY,!t.slots){if(Math.hypot(u.clientX-t.startX,u.clientY-t.startY)<Yq)return;t.slots=t.mode==="move"?XL(e.layout(),e.partOf(t.tableId),t.tableId):[],t.handle.dataset.dragging="true";}i(),o.follow(u.clientY);}}function s(u){if(!t||u.pointerId!==t.pointerId)return;let{tableId:f,slot:p,slots:g,mode:y}=t;d(),p&&!p.stays?e.applyTableCommandPlan(QL(f,p.beforeBlockId)):y==="refuse"&&g&&e.applyTableCommandPlan(QL(f,f));}function l(u){t&&u.pointerId===t.pointerId&&d();}function c(u){u.key!=="Escape"||!t?.slots||(u.preventDefault(),d());}function d(){if(o.stop(),r.remove(),n?.(),n=null,!t)return;let{handle:u,pointerId:f}=t;delete u.dataset.dragging,u.hasPointerCapture?.(f)&&u.releasePointerCapture(f),u.removeEventListener("pointermove",a),u.removeEventListener("pointerup",s),u.removeEventListener("pointercancel",l),t=null;}return {press(u,f,p,g){u.button===0&&(d(),t={pointerId:u.pointerId,startX:u.clientX,startY:u.clientY,tableId:f,handle:p,mode:g,lastX:u.clientX,lastY:u.clientY,slots:null,slot:null},p.setPointerCapture?.(u.pointerId),p.addEventListener("pointermove",a),p.addEventListener("pointerup",s),p.addEventListener("pointercancel",l),n=e.listeners.onDocument("keydown",c));},dragging:()=>(t?.slots??null)!==null,cancel:d,destroy:d}}function Oo(e,t){return de(e,t)??e.part()}function Zb(e,t,n){return !t||t.kind==="tableBody"?null:zu(e,t.tableId,n)?t:null}function Fc(e,t,n){let r=a=>{for(let s of a)if(s.kind==="table"){if(s.tableId===t)return s;for(let l of s.rows)for(let c of l.cells){let d=r(c.blocks);if(d)return d}}return null},o=e.pages[n];if(!o)return null;let i=r(o.fragments);if(i)return {table:i,origin:o.contentBox};for(let a of [o.header,o.footer]){if(!a)continue;let s=r(a.fragments);if(s)return {table:s,origin:a.box}}return null}var Qq=120,Jq=16,eK=2;function nF(e,t){return e.tableId===t?true:e.rows.some(n=>n.cells.some(r=>r.blocks.some(o=>o.kind==="table"&&nF(o,t))))}function eF(e,t,n){let r=e.pages[n];if(!r)return null;let o=a=>a.find(s=>s.kind==="table"&&nF(s,t))??null,i=o(r.fragments);if(i)return {table:i,origin:r.contentBox};for(let a of [r.header,r.footer]){let s=a?o(a.fragments):null;if(s&&a)return {table:s,origin:a.box}}return null}var tF="http://www.w3.org/2000/svg";function tK(e){let t=e.createElementNS(tF,"svg");t.setAttribute("viewBox","0 -960 960 960"),t.setAttribute("aria-hidden","true"),t.setAttribute("focusable","false");for(let n of Wy("open_with")){let r=e.createElementNS(tF,"path");r.setAttribute("d",n),t.append(r);}return t}function rF(e){let{layer:t}=e,n=nt(()=>t),r=null,o=null,i=null,a=false,s=JL({pagesLayer:e.pagesLayer,layer:t,listeners:e.listeners,frames:n,scale:()=>e.scale(),pageOffsetX:y=>e.pageOffsetX(y),layout:()=>e.read().layout,partOf:y=>Oo(e.session(),y),applyTableCommandPlan:y=>e.applyTableCommandPlan(y)}),l=t.ownerDocument.createElement("button");l.type="button",l.className="docx-table-select-handle",l.append(tK(t.ownerDocument)),l.style.position="absolute",l.style.pointerEvents="auto";let c=y=>{y.preventDefault(),y.stopPropagation();};l.addEventListener("pointerdown",y=>{c(y);let h=e.read().editingMode;!i||a||h==="view"||(d(),s.press(y,i,l,h==="suggest"?"refuse":"move"));}),l.addEventListener("mousedown",c),l.addEventListener("click",y=>{c(y);let h=i?ja(e.read().layout,i):null;h&&(e.setCellSelection(h),e.pagesLayer.focus({preventScroll:true}));}),l.addEventListener("pointerenter",()=>d());function d(){o!==null&&(n.clearTimeout(o),o=null);}function u(y,h){let b=qa(y,h.head.paragraphId)?.tableId,x=b===void 0?void 0:Se(y,h.head)?.pageIndex;return b===void 0||x===void 0?null:{tableId:b,pageIndex:x}}function f(){let{layout:y,selection:h,editingMode:b}=e.read(),x=h.head.paragraphId,S=r?eF(y,r.tableId,r.pageIndex):null;r&&!S&&(r=null,d());let v=b!=="view"&&r!==null&&S!==null&&zu(e.session(),r.tableId,x),k=b==="view"?null:v?r:u(y,h),E=k?v?S:eF(y,k.tableId,k.pageIndex):null;if(!k||!E){i=null,s.dragging()&&s.cancel(),l.remove();return}let{table:I,origin:R}=E,O=e.scale(),C=e.pageOffsetX(k.pageIndex);i=I.tableId,a=I.floatingWrap!==void 0,l.dataset.tableId=I.tableId,l.dataset.draggable=String(!a&&b==="edit"),l.setAttribute("aria-label",e.label("table.selectTable")),l.title=e.label("table.selectTable");let w=Jq+eK;l.style.left=`${(R.x+I.box.x+C)*O-w}px`,l.style.top=`${(R.y+I.box.y)*O-w}px`,l.parentNode!==t&&t.append(l);}function p(y){if(l.contains(y.target)||s.dragging())return;let{layout:b}=e.read(),x=e.pagesLayer.getBoundingClientRect(),S=e.scale(),v=(y.clientX-x.left)/S,k=(y.clientY-x.top)/S,E=we(b,k),I=E>=0?Jf$1(Ff$2(b),v,k,b,e.pageOffsetX(E),E):null;if(I){if(d(),r?.tableId===I.tableId&&r.pageIndex===I.pageIndex)return;r={tableId:I.tableId,pageIndex:I.pageIndex},f();return}!r||o!==null||(n.migrate(),o=n.setTimeout(()=>{o=null,r=null,f();},Qq));}let g=e.listeners.onDocument("pointermove",p);return {update:f,destroy(){d(),s.destroy(),g(),t.remove();}}}function nK(e,t){let n=Math.max(0,e.end-e.start);return e.start+Math.max(0,Math.min(t,n))}var cF=/^[^\s]{1,512}$/,Xb=/["\\\u0000-\u001f\u007f]/;function dF(e,t){return !e||t===void 0||!/^\d{1,9}$/.test(t)||!cF.test(e)||e==="__proto__"?null:{paragraphId:e,offset:Number(t)}}function ai(e){let t=dF(e.dataset?.paragraphId,e.dataset?.start);if(!t)return null;let{paragraphId:n,offset:r}=t,o=e.dataset?.end,i=o!==void 0&&/^\d{1,9}$/.test(o)&&Number(o)>=r?Number(o):r+(e.textContent?.length??0);return {paragraphId:n,start:r,end:i}}function Rs(e){if(!e||e.nodeType!==Node.ELEMENT_NODE)return null;let t=e;return !t.classList.contains("docx-inline-drawing-advance")||t.parentElement?.dataset.paragraphId===void 0?null:dF(t.dataset.drawingParagraphId,t.dataset.drawingStart)}function rK(e,t){let n=Xb.test(t)?"[data-paragraph-id][data-start], .docx-inline-drawing-advance":`[data-paragraph-id="${t}"][data-start], .docx-inline-drawing-advance[data-drawing-paragraph-id="${t}"]`,r=[],o=[];for(let i of e.querySelectorAll(n))i.classList.contains("docx-inline-drawing-advance")?Rs(i)?.paragraphId===t&&o.push(i):r.push(i);return {spans:r,spacers:o}}function fp(e,t,n){return Xb.test(t)?e.querySelectorAll(`[data-paragraph-id]${n}`):e.querySelectorAll(`[data-paragraph-id="${t}"]${n}`)}function uF(e){let t=e.nodeType===Node.TEXT_NODE?e.parentNode:e;for(;t&&t.nodeType===Node.ELEMENT_NODE;){let n=ai(t);if(n)return {element:t,identity:n};t=t.parentNode;}return null}function fF(e){return e.querySelector("[data-docx-hf-active]")}function la(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 oK(e,t){return t===void 0||!Number.isInteger(t)||t<0?null:e.querySelector(`[data-page-index="${t}"]`)}function up(e,t){let n=fF(e),r=n?.closest(".docx-page");if(n)return r&&r!==e?[n,r,e]:[n,e];let o=oK(e,t);return o&&o!==e?[o,e]:[e]}function oF(e,t){let n=l=>({paragraphId:l.paragraphId,offset:t?l.end:l.start}),r=l=>t?{...l,offset:l.offset+1}:l,o=uF(e);if(o)return n(o.identity);let i=Rs(e);if(i)return r(i);if(e.nodeType!==Node.ELEMENT_NODE)return null;let a=e.querySelectorAll("[data-paragraph-id][data-start], .docx-inline-drawing-advance"),s=t?[...a].reverse():[...a];for(let l of s){let c=Rs(l);if(c)return r(c);let d=ai(l);if(d)return n(d)}return null}function iF(e,t,n=false){let r=[...e.childNodes];if(r.length===0)return null;let o=Rs(r[t-1]);if(o)return {paragraphId:o.paragraphId,offset:o.offset+1};for(let i=Math.max(0,t);!n&&i<r.length;i+=1){let a=oF(r[i],false);if(a)return a}for(let i=Math.min(t,r.length)-1;i>=0;i-=1){let a=oF(r[i],true);if(a)return a}return null}function aF(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")||fF(n)&&r?.closest(".docx-page-content"))return null;let i=r?.closest("[data-docx-marker]"),a=Rs(i??void 0);if(a)return t>0?{...a,offset:a.offset+1}:a;let s=r?.closest(".docx-terminator-seat");if(s?.querySelector(".docx-line-break-mark")&&s.parentElement){let d=s.parentElement,u=[...d.querySelectorAll(".layout-run[data-start]")].filter(g=>g.closest(".docx-line")===d).flatMap(g=>{let y=ai(g);return y?[{run:g,identity:y}]:[]}),f=u.at(-1)?.identity.paragraphId,p;for(let g of u)g.identity.paragraphId===f&&(!p||g.identity.start>p.identity.start)&&(p=g);if(p){let g=p.run.textContent===`
|
|
27
|
-
`,{start:y,end:h}=p.identity;return {paragraphId:p.identity.paragraphId,offset:g?y:h}}}let l=s??(i?.classList.contains("docx-wrap-advance")?i:null);if(l?.parentElement){let d=[...l.parentElement.childNodes],u=d.indexOf(l);if(s){let g="[data-start], a, br, .docx-inline-drawing-advance, .docx-wrap-advance";for(;u>0&&!d[u-1].matches?.(g);)u-=1;}let f=!s&&t>0?1:0,p=iF(l.parentElement,u+f,!!s);if(p)return p}if(i)return i.parentElement?pF(i.parentElement):null;if(r?.closest("[data-docx-tab-leader]"))return null;if(e.nodeType===Node.ELEMENT_NODE){let d=e,u=ai(d);if(u)return {paragraphId:u.paragraphId,offset:t>0?u.end:u.start};let f=iF(d,t);return f||lK(d)}let c=uF(e);return c?{paragraphId:c.identity.paragraphId,offset:nK(c.identity,t)}:null}function Ps(e,t){if(!t||t.rangeCount===0)return null;let{anchorNode:n,anchorOffset:r,focusNode:o,focusOffset:i}=t;if(!n||!o)return null;let a=aF(n,r,e),s=aF(o,i,e);if(!a||!s){let l=a??s;return l?{anchor:l,head:l}:null}return {anchor:a,head:s}}function Yb(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 sF(e,t,n,r){if(r!==void 0)for(let o of up(e,n)){let i=Xb.test(r)?"[data-line-id]":`[data-line-id="${r}"]`;for(let a of o.querySelectorAll(i)){if(a.dataset.lineId!==r)continue;let s=lF(a,t);if(s)return s}}for(let o of up(e,n)){let i=lF(o,t);if(i)return i}return null}function iK(e,t){let n=null;for(let r of e){if(!r.hasAttribute("data-docx-field")||!r.parentNode)continue;let o=ai(r);if(o?.paragraphId===t.paragraphId){if(o.start===t.offset)return {node:r.parentNode,offset:[...r.parentNode.childNodes].indexOf(r)};o.end===t.offset&&(n=r);}}if(n){let r=ai(n);for(let o of e){let i=ai(o);i?.paragraphId===t.paragraphId&&i.start===r.start&&i.end===r.end&&(n=o);}}return n?.parentNode?{node:n.parentNode,offset:[...n.parentNode.childNodes].indexOf(n)+1}:null}function lF(e,t){let{spans:n,spacers:r}=rK(e,t.paragraphId),o=iK(n,t);if(o)return o;let i=null,a=false;for(let p of n){let g=ai(p);if(!g||g.paragraphId!==t.paragraphId)continue;let y=aK(p),h=p.textContent?.length??0,b=g.end;if(y){if(p.closest?.("[data-docx-field]")){a=true;continue}if(a=true,t.offset>=g.start&&t.offset<=b){let x={node:y,offset:Math.min(t.offset-g.start,h)};if(t.offset<b)return x;i=x;}}}let s=p=>r.find(g=>Rs(g)?.offset===p)??null,l=s(t.offset);if(i&&l?.parentNode&&!l.parentNode.contains(i.node))return {node:l.parentNode,offset:[...l.parentNode.childNodes].indexOf(l)};if(i)return i;let c=l,d=c?null:s(t.offset-1),u=c??d;if(u?.parentNode)return {node:u.parentNode,offset:[...u.parentNode.childNodes].indexOf(u)+(d?1:0)};if(a||=r.length>0,a)return null;let f=sK(e,t.paragraphId);return f?{node:f,offset:0}:null}function aK(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 sK(e,t){let n=null;for(let r of fp(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 pF(e){let t=e.closest("[data-paragraph-id]");if(!t||t.dataset.start!==void 0)return null;let n=t.dataset.paragraphId;return !n||!cF.test(n)||n==="__proto__"?null:{paragraphId:n,offset:0}}function lK(e){let t=pF(e);return !t||e.closest("[data-paragraph-id]").querySelector("[data-paragraph-id][data-start]")?null:t}function mF(e,t,n,r){if(!n)return false;let o=r?.preferredPageIndex??la(n.anchorNode,e),a=Ht(t,{anchor:t.head,head:t.head})?r?.preferredLineId:void 0,s=sF(e,t.anchor,o,a),l=sF(e,t.head,o,a);if(!s||!l)return false;let c=Ps(e,n);if(c&&Ht(c,t)){let d=la(n.anchorNode,e),f=(n.focusNode?.nodeType===Node.ELEMENT_NODE?n.focusNode:n.focusNode?.parentElement)?.closest("[data-line-id]")?.dataset.lineId;if((o===void 0||d===o)&&(a===void 0||f===a))return true}try{return n.setBaseAndExtent(s.node,s.offset,l.node,l.offset),!0}catch{return false}}function Ht(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 cK='[data-docx-marker],[data-docx-tab-leader],[aria-hidden="true"],[contenteditable="false"],[data-drawing-node-id]';function gF(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 hF(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 dK(e){return e?(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest(".docx-page")??null:null}function uK(e,t,n){return t&&e.contains(t)?2:n?.contains(e)?1:0}function yF(e,t,n,r){if(e.dataset.docxField!==void 0){let i=gF(e,t,t);return {start:t,end:i,text:n.slice(t,i),seq:r}}let o=e.textContent??"";return {start:t,end:gF(e,t,t+o.length),text:o,seq:r}}function bF(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=hF(r,t.paragraphId);if(o===null){if(r.dataset?.start!==void 0)continue;let s=r.dataset?.drawingStart;if(r.dataset?.drawingParagraphId===t.paragraphId&&s!==void 0&&/^\d{1,9}$/.test(s)){t.end=Math.max(t.end,Number(s)+1);continue}if(r.matches?.(cK))continue;bF(r,t);continue}let i=yF(r,o,t.modelText,t.seq);t.seq+=1,t.end=Math.max(t.end,i.end);let a=`${i.start}:${i.end}`;t.ranges.has(a)||(t.ranges.add(a),t.pieces.push(i));}}function fK(e,t,n,r){let o=[];for(let a of fp(e,t,"")){let s=a;s.dataset.paragraphId===t&&s.dataset.start===void 0&&(o.some(l=>l.contains(s))||o.push(s));}let i=new Map;for(let a of o){let s=a.dataset.fragmentIndex??"",l=uK(a,n,r),c=i.get(s);(!c||l>c.affinity)&&i.set(s,{element:a,affinity:l});}return [...i.values()].map(a=>a.element)}function pK(e,t,n){for(let r of fp(e,n.paragraphId,"[data-start]")){let o=r,i=hF(o,n.paragraphId);if(i===null||t.some(l=>l.contains(o)))continue;let a=yF(o,i,n.modelText,n.seq);n.seq+=1;let s=`${a.start}:${a.end}`;n.ranges.has(s)||(n.ranges.add(s),n.pieces.push(a));}}function mK(e,t){let n=[...e].sort((i,a)=>i.start-a.start||i.seq-a.seq),r="",o=0;for(let i of n)i.start>o&&(r+=t.slice(o,i.start)),r+=i.text,o=Math.max(o,i.end);return o<t.length&&(r+=t.slice(o)),r}function vF(e,t,n,r){let o=fK(e,t,r,dK(r)),i={paragraphId:t,modelText:n,pieces:[],ranges:new Set,end:0,seq:0};for(let a of o)bF(a,i);return pK(e,o,i),i.pieces.length===0?null:mK(i.pieces,n)}function Qb(e){if(!(e.metaKey||e.ctrlKey))return null;let t=e.key.toLowerCase();return t==="y"?"redo":t==="z"?e.shiftKey?"redo":"undo":null}function SF(e){return e.altKey||e.ctrlKey}function wF(e){return sa$1(e.layout(),e.state().selection.head.paragraphId)!==null}function kF(e,t){let{selection:n,cellSelection:r}=e.state(),o=ta$1(e.layout(),n.head.paragraphId,t);if(o===null)return false;let i=r&&r.cellIds.length>1&&r.cellIds[0];return i?(xF(e,ma$2(e.layout(),[i])),true):o==="end"?(t==="next"&&gK(e),true):(xF(e,o.paragraphIds),true)}function xF(e,t){let n=t[0],r=t.at(-1);if(n===void 0||r===void 0)return;let o=eb$1(de(e.session,r)??e.session.part(),r),i=o?.kind==="paragraph"?Hi(o):0;e.setSelection({anchor:{paragraphId:n,offset:0},head:{paragraphId:r,offset:i}});}function gK(e){let t=e.state(),n=Tr({command:{type:"insertRow",where:"below"},part:de(e.session,t.selection.head.paragraphId)??e.session.part(),layout:e.layout(),storeRevision:e.session.packageRevision(),selection:t.selection,cellSelection:t.cellSelection,themeColors:e.session.documentThemeColors(),editable:e.session.editable,viewing:e.editingMode()==="view"});if(!e.applyTableCommandPlan(n).ok)return;let r=ta$1(e.layout(),t.selection.head.paragraphId,"next"),o=typeof r=="object"?r?.paragraphIds[0]:void 0;o!==void 0&&e.setSelection({anchor:{paragraphId:o,offset:0},head:{paragraphId:o,offset:0}});}var EF={ArrowLeft:"left",ArrowRight:"right",ArrowUp:"up",ArrowDown:"down",Home:"lineStart",End:"lineEnd"};function hK(e){return EF[e.key]||e.key==="PageUp"||e.key==="PageDown"?e.shiftKey:(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="a"}var IF={l:"left",e:"center",r:"right",j:"both"},RF={1:"240",5:"360",2:"480"},PF={b:{localName:"b"},i:{localName:"i"},u:{localName:"u",attributes:{val:"single"}}};function yK(e,t){return e.altKey?e.metaKey?true:e.ctrlKey?e.getModifierState?.("AltGraph")??false?e.key.toLowerCase()===t:true:false:false}function CF(e,t={}){return n=>{if(n.defaultPrevented)return;let r=e.editingMode()==="view"||n.currentTarget?.contentEditable==="false";if(n.key==="F5"&&n.shiftKey&&(n.ctrlKey||n.metaKey)&&!n.altKey&&!n.isComposing&&t.onRequestBookmark?.()){n.preventDefault();return}if(ab(n)&&t.onRequestGoTo?.()){n.preventDefault();return}if(n.key==="F9"&&n.altKey&&!n.ctrlKey&&!n.metaKey&&!n.shiftKey&&!n.isComposing&&t.onToggleFieldCodes){n.preventDefault(),t.onToggleFieldCodes();return}if(!n.altKey&&!n.isComposing&&(n.metaKey&&!n.ctrlKey&&!n.shiftKey&&n.key==="8"||n.ctrlKey&&!n.metaKey&&n.shiftKey&&(n.code==="Digit8"||n.key==="*"))&&t.onToggleParagraphMarks){n.preventDefault(),t.onToggleParagraphMarks();return}if(r&&!hK(n))return;if(n.key==="Escape"&&e.formatPainter.state().mode!=="off"){e.formatPainter.disarm(),n.preventDefault();return}if(n.key==="Escape"&&e.activeScope().kind==="headerFooter"){e.exitHeaderFooter(),n.preventDefault();return}if(n.key==="Escape"&&e.activeScope().kind==="note"){e.exitNote(),n.preventDefault();return}let o=Af(n);if(yK(n,o)&&!n.shiftKey){let l=o;if(l==="f"){n.preventDefault(),e.insertNote("footnote");return}if(l==="d"){n.preventDefault(),e.insertNote("endnote");return}if(l==="c"){n.preventDefault(),e.formatPainter.capture();return}if(l==="v"){n.preventDefault(),e.formatPainter.apply();return}}let i=n.metaKey||n.ctrlKey,a=EF[n.key];if(a){let l=a;n.key==="Home"||n.key==="End"?i&&(l=n.key==="Home"?"documentStart":"documentEnd"):(n.key==="ArrowLeft"||n.key==="ArrowRight")&&(n.altKey||n.ctrlKey)?l=n.key==="ArrowLeft"?"wordLeft":"wordRight":n.metaKey&&(n.key==="ArrowLeft"||n.key==="ArrowRight")?l=n.key==="ArrowLeft"?"lineStart":"lineEnd":i&&(n.key==="ArrowUp"||n.key==="ArrowDown")&&(l=n.key==="ArrowUp"?"documentStart":"documentEnd"),e.navigate(l,n.shiftKey),n.preventDefault();return}if(n.key==="PageUp"||n.key==="PageDown"){e.navigate(i?n.key==="PageUp"?"documentStart":"documentEnd":n.key==="PageUp"?"pageUp":"pageDown",n.shiftKey),n.preventDefault();return}if(n.key==="Backspace"){i||n.altKey?e.deleteWordBackward():e.deleteBackward(),n.preventDefault();return}if(n.key==="Delete"){i||n.altKey?e.deleteWordForward():e.deleteForward(),n.preventDefault();return}if(n.key==="Tab"){if(e.contentControls.formFill()&&e.contentControls.navigate(n.shiftKey?"previous":"next")){n.preventDefault();return}if(SF(n)&&!n.isComposing){if(wF(e)){(e.state().cellSelection?.cellIds.length??0)<=1&&e.insertTab(),n.preventDefault();return}}else if(!n.isComposing&&kF(e,n.shiftKey?"previous":"next")){n.preventDefault();return}let l=n.shiftKey?"decrease":"increase";e.isListParagraph()?e.adjustIndent(l):e.indentWithTab(l)||(n.shiftKey?e.adjustIndent("decrease"):e.insertTab()),n.preventDefault();return}if(n.key==="Enter"){i?e.insertPageBreak():n.shiftKey?e.insertLineBreak():e.exitListOnEmptyItem()||e.splitParagraph(),n.preventDefault();return}if(i&&n.key.toLowerCase()==="a"){e.selectAll(),n.preventDefault();return}if(i&&n.shiftKey&&n.key.toLowerCase()==="v"){e.armForcePlainPaste();return}if(i&&!n.shiftKey&&n.key.toLowerCase()==="k"&&t.onRequestHyperlink){if(t.onRequestHyperlink()===false)return;n.preventDefault();return}if(i&&!n.shiftKey&&PF[n.key.toLowerCase()]){let l=PF[n.key.toLowerCase()];e.toggleRunProperty(l.localName,l.attributes),n.preventDefault();return}if(i&&(n.key==="="||n.key==="+"||n.code==="Equal")){e.toggleRunProperty("vertAlign",{val:n.shiftKey?"superscript":"subscript"}),n.preventDefault();return}if(i&&n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("decrease"),n.preventDefault();return}if(i&&!n.shiftKey&&n.key.toLowerCase()==="m"){e.adjustIndent("increase"),n.preventDefault();return}if(i&&!n.shiftKey&&IF[n.key.toLowerCase()]){if(n.metaKey&&n.key.toLowerCase()==="r")return;e.setParagraphProperties([{localName:"jc",attributes:{val:IF[n.key.toLowerCase()]},physicalAlignment:true}]),n.preventDefault();return}if(i&&!n.shiftKey&&RF[n.key]){e.setParagraphProperty("spacing",{line:RF[n.key],lineRule:"auto"},{mergeAttributes:true}),n.preventDefault();return}let s=Qb(n);s&&(s==="redo"?e.redo():e.undo(),n.preventDefault());}}function OF(e){let t=i=>{let a=e.copyFlavours();return a.reason?(i.preventDefault(),false):!a.text||!i.clipboardData?false:(i.clipboardData?.setData("text/plain",a.text),a.html&&i.clipboardData?.setData("text/html",a.html),true)};return {onCopy:i=>{t(i)&&i.preventDefault();},onCut:i=>{if(e.editingMode()==="view"){i.preventDefault();return}t(i)&&(e.deleteSelection(),i.preventDefault());},onPaste:i=>{let a=Sh(i.clipboardData),s=i.clipboardData?.getData("text/html")??"";i.preventDefault(),!(!a&&!s)&&e.pasteRich(a,s.length>0?s:null);}}}function TF(e){let t=Sh(e.dataTransfer);return t.length>0?t:null}function MF(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??TF(n);if(!r)return;SK(e,vK(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=TF(n);r&&t.insertPlainText(r);return}n.inputType==="insertParagraph"&&e.splitParagraph();}}}}function bK(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 vK(e){if(typeof e.getTargetRanges!="function")return null;let t=e.getTargetRanges();if(t.length!==1)return null;let n=t[0],r=bK(n);return r?{text:r,paragraphId:xK(n)}:null}function xK(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 SK(e,t,n){if(t!==null){e.flushPendingInput();let r=e.state(),o=r.selection.head,i=t.text;if(Ht(r.selection,Ke(o))&&o.offset>=i.length&&(t.paragraphId===null||t.paragraphId===o.paragraphId)&&r.pendingFormat===null){let a=de(e.session,o.paragraphId)??e.session.part(),s=Km(a,o.paragraphId);s!==null&&s.slice(o.offset-i.length,o.offset)===i&&e.setSelection({anchor:{paragraphId:o.paragraphId,offset:o.offset-i.length},head:o});}}e.type(n);}function AF(e,t,n,r=null){for(let o of up(e)){let i=vF(o,t,n,r);if(i!==null)return i}return null}function LF(e,t,n){if(n===t)return null;let r=0;for(;r<n.length&&r<t.length&&n[r]===t[r];)r+=1;let o=0;for(;o<n.length-r&&o<t.length-r&&n[n.length-1-o]===t[t.length-1-o];)o+=1;let i=n.slice(r,n.length-o),a=[];return t.length-o>r&&a.push({op:"deleteText",paragraphId:e,start:r,end:t.length-o}),i.length>0&&a.push({op:"insertText",paragraphId:e,offset:r,text:i}),a.length===0?null:{ops:a,caret:r+i.length}}var wK="equation replacement is not supported in suggesting mode",kK="in suggesting mode, remove the whole equation block rather than one equation",FF=new WeakMap,DF=new WeakSet,IK="compact linear text cannot spell this equation";function Jb(e,t){let n=eb$1(e,t);if(!n||n.kind!=="paragraph")return [];let r=FF.get(n);if(r)return r;let o=[];for(let a of Di(n))for(let s of Ng$1(a.node)){let l=Hg$1(s);if(!l)continue;let c=Object.freeze({id:s.id,paragraphId:t,start:a.start,end:a.end,linear:Jg$1(l.expression),fallbackText:l.fallbackText,supported:ur(l.expression)});dr(l.expression)&&DF.add(c),o.push(c);}let i=Object.freeze(o);return FF.set(n,i),i}function NF(e,t,n){let r=Jb(e,t).filter(o=>o.start===n);return r.length===0?null:r.map(o=>o.linear||o.fallbackText).join(" ")}function HF(e){return "controlProperties"in e&&e.controlProperties===true}function dr(e){if(HF(e))return true;switch(e.kind){case "bar":case "borderBox":return true;case "text":return e.format!==void 0;case "fallback":return false;case "row":return e.items.some(dr);case "fraction":return dr(e.numerator)||dr(e.denominator);case "radical":return dr(e.radicand)||e.degree!==void 0&&dr(e.degree);case "script":return dr(e.base)||e.subscript!==void 0&&dr(e.subscript)||e.superscript!==void 0&&dr(e.superscript);case "nary":return e.limitLocation==="subSup"||dr(e.body)||e.lowerLimit!==void 0&&dr(e.lowerLimit)||e.upperLimit!==void 0&&dr(e.upperLimit)}}function ur(e){if(HF(e))return false;switch(e.kind){case "fallback":case "bar":case "borderBox":return false;case "text":return e.format===void 0;case "row":return e.items.every(ur);case "fraction":return ur(e.numerator)&&ur(e.denominator);case "radical":return ur(e.radicand)&&(e.degree===void 0||ur(e.degree));case "script":return ur(e.base)&&(e.subscript===void 0||ur(e.subscript))&&(e.superscript===void 0||ur(e.superscript));case "nary":return ur(e.body)&&(e.lowerLimit===void 0||ur(e.lowerLimit))&&(e.upperLimit===void 0||ur(e.upperLimit))}}function _F(e,t){return e.find(n=>n.paragraphId===t.paragraphId&&t.offset>=n.start&&t.offset<=n.end)??null}function BF(e){let t=null,n=a=>{if(d$1(a)||!e.pagesLayer.ownerDocument.defaultView||!Wt(a))return null;let l=a.closest("[data-docx-equation]");return l&&e.pagesLayer.contains(l)?l:null},r=(a,s)=>{let l=e.equationById(a);l&&(e.pagesLayer.contentEditable!=="false"&&e.setSelection({anchor:{paragraphId:l.paragraphId,offset:l.start},head:{paragraphId:l.paragraphId,offset:l.end}}),e.onPopover?.({equation:l,rect:s}));},o=a=>{t=null;let s=n(a.target),l=s?.dataset.docxEquation;if(!s||!l)return;let c=s.getBoundingClientRect();t={equationId:l,rect:{left:c.left,top:c.top,right:c.right,bottom:c.bottom}};},i=a=>{let s=n(a.target),l=s?.dataset.docxEquation,c=t;if(t=null,!s||!l){if(!c)return;a.preventDefault(),r(c.equationId,c.rect);return}let d=s.getBoundingClientRect();a.preventDefault(),r(l,{left:d.left,top:d.top,right:d.right,bottom:d.bottom});};return e.pagesLayer.addEventListener("pointerdown",o,true),e.pagesLayer.addEventListener("click",i),{destroy:()=>{e.pagesLayer.removeEventListener("pointerdown",o,true),e.pagesLayer.removeEventListener("click",i);}}}function $F(e){let t=()=>e.session.partFor(e.storyScope()),n=c=>{let d=t();return d?Jb(d,c):[]},r=()=>{let c=e.selection().head;return _F(n(c.paragraphId),c)},o=c=>{let d=n(e.selection().head.paragraphId).find(u=>u.id===c);if(d)return d;for(let u of e.session.storyParts()){let f=eb$1(u,c);if(!f||f.kind!=="generic"||f.namespaceUri!==Fg$1||f.localName!=="oMath")continue;let p=f;for(;p&&p.kind!=="paragraph";)p=fb$1(u,p.id);return !p||p.kind!=="paragraph"?null:Jb(u,p.id).find(g=>g.id===c)??null}return null},i=c=>e.editingMode()==="suggest"?e.trackedOps([{op:"deleteText",paragraphId:c.paragraphId,start:c.start,end:c.end}]):[{op:"removeMathEquation",equationId:c.id}],a=(c,d)=>{let u=false,f={paragraphId:c.paragraphId,offset:c.start};return e.commit(()=>{let p=e.session.applyTreeOps([...d],e.selectionMark(),{paragraphId:f.paragraphId,start:f.offset,end:f.offset},e.storyScope());return u=p.committed,p},()=>({anchor:f,head:f})),u},s=(c,d)=>{let u=o(c);if(!u)return {ok:false,code:"notFound",reason:"no equation with that id"};if(e.editingMode()==="suggest"){if(d==="replace")return {ok:false,code:"unsupported",reason:wK};if(n(u.paragraphId).filter(y=>y.start===u.start).length>1)return {ok:false,code:"unsupported",reason:kK}}if(d==="replace"&&DF.has(u))return {ok:false,code:"unsupported",reason:"compact linear editing cannot preserve this equation source formatting"};if(d==="replace"&&u.supported&&u.linear===""&&u.fallbackText!=="")return {ok:false,code:"unsupported",reason:IK};let[f]=d==="replace"?[{op:"setMathEquation",equationId:c,linear:u.linear}]:i(u),p=f?e.writeRefusal(f):null;return p===null?{ok:true}:{ok:false,code:"locked",reason:p}},l=c=>(e.commit(()=>({committed:false,rejected:true,opCount:0,reason:c.reason})),false);return {equationsInCaretParagraph:()=>[...n(e.selection().head.paragraphId)],equationAtCaret:r,equationById:o,can:s,applyEquation(c,d){let u=o(c);if(!u)return false;let f=s(c,"replace");return f.ok?u.supported&&u.linear===d?true:a(u,[{op:"setMathEquation",equationId:c,linear:d}]):l(f)},removeEquation(c){let d=o(c);if(!d)return false;let u=s(c,"remove");return u.ok?a(d,i(d)):l(u)}}}var Dc="the selection contains a chart; a chart cannot be copied, cut or pasted";function ev(e,t,n=E$1){for(let[r,o]of t){let i=eb$1(e,r);if(i&&i.kind!=="textValue"&&i.kind==="paragraph"&&o&&o.end>o.start){let a=Fi(i),s=[...i.children];for(;s.length;){let l=s.pop();if(l.kind!=="textValue"){if(n(l)){let c=a.spanOf(l);if(c?c.end>o.start&&c.start<o.end:o.start===0&&o.end===1/0)return true}for(let c of l.children)s.push(c);}}}}return false}function WF(e,t){return ev(e,t,D$2)}function qF(e){return Nc(e)!==null}function Nc(e){let t=mg(e);if(!t.ok)return null;let n=[...t.package.parts.values()].map(r=>r.root);return G$1(n)?"chart":F$1(n)?"object":null}function Ze(e){return e.kind!=="textValue"}function me(e,t){if(!e||e.kind==="textValue")return null;for(let n of e.children)if(Ze(n)&&n.localName===t&&n.namespaceUri===pa$2)return n;return null}function mt(e,t="val"){return e?Kh$1(e,t,pa$2):void 0}function fr(e,t,n){return e?Kh$1(e,t,n):void 0}function tv(e){if(e.kind==="textValue")return e.value;let t="";for(let n of e.children)t+=tv(n);return t}function Ts(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=Ts(r,t,n);if(o)return o}return null}function si(e){if(e===void 0||!/^-?\d+$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function Rn(e){return Qd(e)}function nv(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var Qr=nv;function KF(e){return e===void 0||e.toLowerCase()==="auto"?null:/^[0-9A-Fa-f]{6}$/.test(e)?`#${e.toLowerCase()}`:null}function Hc(e){let t=J$1(e);return typeof t=="string"?`#${t.toLowerCase()}`:t}function Mr(e){return `${Math.round(e/20*100)/100}pt`}var RK="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",PK=Bd;function _c(e,t,n){for(let o of ug(e,e.mainDocumentPart)){if(o.type!==t||o.targetMode==="External")continue;let i=E$3(o.ownerPart,o.rawTarget);if(i.ok){let a=e.parts.get(i.partName);if(a&&Ze(a.root))return a.root}}let r=e.parts.get(n);return r&&Ze(r.root)?r.root:null}function UF(e){let t=_c(e,RK,"/word/styles.xml"),n=new Map,r=null,o=null,i=null,a=null,s=null;if(!t)return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:i,defaultCharacterStyleId:a,defaultTableStyleId:s};let l=0,c=null;for(let d of t.children){if(!Ze(d)||d.namespaceUri!==pa$2)continue;if(d.localName==="docDefaults"){c=d,r=me(me(d,"rPrDefault"),"rPr"),o=me(me(d,"pPrDefault"),"pPr");continue}if(d.localName!=="style")continue;if(l>=lf$1)break;l+=1;let u=Kh$1(d,"styleId",pa$2);if(!u)continue;n.set(u,d);let f=Kh$1(d,"default",pa$2),p=Kh$1(d,"type",pa$2);f==="1"||f==="true"||f==="on"?p==="paragraph"?i=u:p==="character"?a=u:p==="table"&&(s=u):(i===u&&(i=null),a===u&&(a=null),s===u&&(s=null));}if(t.namespaceUri===pa$2){let d=J(c);d.run&&(r=L$1("rPr","application")),d.paragraph&&(o=L$1("pPr","application"));}return {byId:n,docDefaultsRPr:r,docDefaultsPPr:o,defaultParagraphStyleId:i,defaultCharacterStyleId:a,defaultTableStyleId:s}}function Mo(e,t,n){let r=[],o=new Set,i=t;for(;i&&!o.has(i)&&r.length<PK;){o.add(i);let a=e.byId.get(i);if(!a)break;if(r.length===0&&n!==void 0){let s=Kh$1(a,"type",pa$2);if(s!==void 0&&s!==n)return []}r.unshift(a),i=mt(me(a,"basedOn"));}return r}function rv(e,t,n){let r=[];if(e.docDefaultsPPr&&r.push(e.docDefaultsPPr),n)for(let i of n)r.push(i);let o=mt(me(t,"pStyle"));for(let i of Mo(e,o??e.defaultParagraphStyleId??void 0,"paragraph")){let a=me(i,"pPr");a&&r.push(a);}return t&&r.push(t),r}function pp(e,t,n,r){let o=[];e.docDefaultsRPr&&o.push(e.docDefaultsRPr);let i=[];if(r)for(let u of r)i.push(u);let a=[],s=mt(me(t,"pStyle"));for(let u of Mo(e,s??e.defaultParagraphStyleId??void 0,"paragraph")){let f=me(u,"rPr");f&&a.push(f);}let l=[],c=mt(me(n,"rStyle"))??void 0;for(let u of Mo(e,c,"character")){let f=Kh$1(u,"styleId",pa$2);if(f!==void 0&&f===e.defaultCharacterStyleId)continue;let p=me(u,"rPr");p&&l.push(p);}let d=[...o,...i,...a,...l];return n&&d.push(n),{all:d,defaults:o,tableLevel:i,paragraphLevel:a,characterLevel:l,direct:n}}function Pn(e,t){let n=null;for(let r of e){let o=me(r,t);o&&(n=o);}return n}function Gt(e,t,n){let r;for(let o of e){let i=me(o,t);if(!i)continue;let a=Kh$1(i,n,pa$2);a!==void 0&&(r=a);}return r}function mp(e){return !(e==="0"||e==="false"||e==="off")}function Jr(e,t){let n=false;for(let r of e){let o=me(r,t);o&&(n=mp(mt(o)));}return n}function li(e,t){let n;for(let r of e){let o=me(r,t);o&&(n=mp(mt(o)));}return n}function Ar(e,t){let n=e.direct?me(e.direct,t):null;if(n)return mp(mt(n));let r=li(e.tableLevel,t),o=li(e.paragraphLevel,t),i=li(e.characterLevel,t);return i===false||i===void 0&&o===false||i===void 0&&o===void 0&&r===false?false:li(e.defaults,t)===true?true:r===true!=(o===true)!=(i===true)}function ov(e,t){let n=e.direct?me(e.direct,t):null;if(n)return mp(mt(n));let r=li(e.characterLevel,t);if(r!==void 0)return r;let o=li(e.paragraphLevel,t);if(o!==void 0)return o;let i=li(e.tableLevel,t);return i!==void 0?i:li(e.defaults,t)===true}function jF(e){return e.isLgl?"decimal":e.numFmt}function VF(e){let t=pd$1(e),n=new Map,r=new Map,o=new Map,i=new Map,a=new Map,s=new Map;for(let[l,c]of t.abstractNums){c.numStyleLink!==void 0&&s.set(l,c.numStyleLink);let d=new Map,u=new Map;for(let[f,p]of c.levels)d.set(String(f),jF(p)),u.set(String(f),p.start);r.set(l,d),o.set(l,u);}for(let[l,c]of t.nums){n.set(l,c.abstractNumId);for(let[d,u]of c.overrides){let f=`${l}:${d}`,p=u.startOverride??u.level?.start;p!==void 0&&i.set(f,p),u.level!==void 0&&a.set(f,jF(u.level));}}return {numToAbstract:n,levelFormats:r,levelStarts:o,startOverrides:i,formatOverrides:a,styleLinks:s}}function GF(e,t){return e===null?null:Qd(Kh$1(e,t,pa$2))}function iv(e){return Hc(me(e,"shd"))}function zF(e){return `${Math.round(e/20*100)/100}pt`}var TK=["wholeTable","firstRow","lastRow","firstCol","lastCol","band1Horz","band2Horz","band1Vert","band2Vert","nwCell","neCell","swCell","seCell"];function Es(e,t,n){if(e===null)return null;let r=Kh$1(e,t,pa$2);if(r!==void 0)return !(r==="0"||r==="false"||r==="off");let o=Kh$1(e,"val",pa$2);return o===void 0||!/^[0-9A-Fa-f]{1,4}$/.test(o)?null:(Number.parseInt(o,16)&n)!==0}function av(e,t){let n=new Map,r=new Set(TK),o=null;for(let i of e){let a=iv(me(i,"tcPr"));a!==void 0&&(o=a);for(let s of i.children){if(s.kind==="textValue"||s.localName!=="tblStylePr"||s.namespaceUri!==pa$2)continue;let l=Kh$1(s,"type",pa$2);l===void 0||!r.has(l)||n.set(l,{fill:iv(me(s,"tcPr")),rPr:me(s,"rPr"),pPr:me(s,"pPr")});}}return {byType:n,styleFill:o,firstRowEnabled:Es(t,"firstRow",32)??false,lastRowEnabled:Es(t,"lastRow",64)??false,firstColumnEnabled:Es(t,"firstColumn",128)??false,lastColumnEnabled:Es(t,"lastColumn",256)??false,hBandingEnabled:!(Es(t,"noHBand",512)??false),vBandingEnabled:!(Es(t,"noVBand",1024)??false)}}function sv(e,t,n,r,o,i){let a=e.firstRowEnabled&&t===0,s=e.lastRowEnabled&&t===n-1,l=e.firstColumnEnabled&&r,c=e.lastColumnEnabled&&o,d=u=>e.byType.get(u)??null;if(s&&l&&d("swCell"))return d("swCell");if(s&&c&&d("seCell"))return d("seCell");if(a&&l&&d("nwCell"))return d("nwCell");if(a&&c&&d("neCell"))return d("neCell");if(s&&d("lastRow"))return d("lastRow");if(a&&d("firstRow"))return d("firstRow");if(c&&d("lastCol"))return d("lastCol");if(l&&d("firstCol"))return d("firstCol");if(e.hBandingEnabled){let u=t-(e.firstRowEnabled?1:0);if(u>=0){let f=d(u%2===0?"band1Horz":"band2Horz");if(f)return f}}if(e.vBandingEnabled){let u=i-(e.firstColumnEnabled?1:0);if(u>=0){let f=d(u%2===0?"band1Vert":"band2Vert");if(f)return f}}return null}function ZF(e,t,n,r,o,i,a,s,l=false,c=[]){let d=[],u=me(e,"tcBorders"),f={top:n===0?"top":"insideH",bottom:n+o>=r?"bottom":"insideH",left:i?"left":"insideV",right:a?"right":"insideV"};for(let k of ["top","left","bottom","right"]){let E=k==="left"?"start":k==="right"?"end":k,I=me(u,k)??me(u,E),R=f[k],O=R==="left"?"start":R==="right"?"end":R,C=I!==null?Ki(I):Ki(me(t,R)??me(t,O));C&&d.push(`border-${Pr(k,l)}:${C}`);}let p=iv(e),g=p!==void 0?p:s;g&&d.push(`background-color:${g}`);let y=me(e,"vAlign"),h=y===null?void 0:Kh$1(y,"val",pa$2);h==="center"?d.push("vertical-align:middle"):(h==="bottom"||h==="top")&&d.push(`vertical-align:${h}`);let b=me(e,"tcW"),x=GF(b,"w"),S=b===null?void 0:Kh$1(b,"type",pa$2);x!==null&&x>0&&(S===void 0||S==="dxa")&&d.push(`width:${zF(x)}`);let v=me(e,"tcMar");for(let k of ["top","right","bottom","left"]){let E=k==="left"?"start":k==="right"?"end":k,I=me(v,k)??me(v,E)??c.map(C=>me(C,k)??me(C,E)).find(C=>C!==null)??null,R=GF(I,"w"),O=I===null?void 0:Kh$1(I,"type",pa$2);R!==null&&R>=0&&(O===void 0||O==="dxa")&&d.push(`padding-${Pr(k,l)}:${zF(R)}`);}return d.join(";")}function EK(e){return e.kind==="tableCell"?true:e.localName==="tc"&&e.namespaceUri===pa$2}function XF(e){return e.localName==="customXml"&&e.namespaceUri===pa$2}function YF(e){let t=[],n=[],r=o=>{for(let i of o)if(Ze(i)){if(i.kind==="tableRow"||i.localName==="tr"&&i.namespaceUri===pa$2){n.push({row:t.length}),t.push(i);continue}if(i.kind==="contentControl"){let a=i.children.find(s=>s.kind==="contentControlContent");a&&Ze(a)&&r(a.children);continue}if(XF(i)){r(i.children);continue}n.push({skip:i});}};return r(e.children),{rows:t,tableItems:n}}function QF(e){let t=[],n=[],r=new Set;for(let o of e){let i=new Set,a=[],s=[],l=0,c=d=>{for(let u of d)if(Ze(u)){if(EK(u)){let f=me(u,"tcPr"),p=Math.min(Math.max(si(mt(me(f,"gridSpan")))??1,1),63),g=me(f,"vMerge"),y=g===null?null:mt(g)==="restart"?"restart":"continue",h=y==="continue"&&!r.has(l)?"restart":y;y!==null&&i.add(l);let b={cell:u,startColumn:l,span:p,vMerge:h};a.push(b),s.push({placement:b}),l+=p;continue}if(u.kind==="contentControl"){let f=u.children.find(p=>p.kind==="contentControlContent");f&&Ze(f)&&c(f.children);continue}if(XF(u)){c(u.children);continue}s.push({skip:u});}};c(o.children),r=i,t.push(a),n.push(s);}return {placements:t,items:n}}function JF(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 eD(e,t,n,r){let o=new Map,i=t.byType.get("wholeTable")??null;for(let a=0;a<n.length;a+=1)for(let s of n[a]??[]){if(s.vMerge==="continue")continue;let l=sv(t,a,n.length,s.startColumn===0,s.startColumn+s.span>=r,s.startColumn),c=[],d=[];i?.rPr&&c.push(i.rPr),i?.pPr&&d.push(i.pPr),l?.rPr&&c.push(l.rPr),l?.pPr&&d.push(l.pPr),o.set(s.cell,c.length>0||d.length>0?{...e,tableRPr:c,tablePPr:d}:e);}return o}function tD(e,t){let n=Mo(e.styles,mt(me(t,"tblStyle")),"table");return n.length>0?n:Mo(e.styles,e.styles.defaultTableStyleId??void 0,"table")}function nD(e,t){let n=t.children.find(l=>l.kind==="tableProperties"),r=n&&Ze(n)?n:null,o=tD(e,r),i=av(o,me(r,"tblLook")),{rows:a}=YF(t),{placements:s}=QF(a);return eD(e,i,s,JF(s))}function rD(e,t,n,r){let o=t.children.find(O=>O.kind==="tableProperties"),i=o&&Ze(o)?o:null,a=null,s=tD(e,i);for(let O of s){let C=me(me(O,"tblPr"),"tblBorders");C&&(a=C);}let l=s.map(O=>me(O,"tblPr")).filter(O=>O!==null);i&&l.push(i);let c=Jr(l,"bidiVisual"),d=[],u;for(let O of l){let C=me(O,"tblCellMar");C&&d.unshift(C),u=mt(me(O,"jc"))??u;}let f=me(i,"tblBorders");f&&(a=f);let p=av(s,me(i,"tblLook")),{rows:g,tableItems:y}=YF(t),{placements:h,items:b}=QF(g),x=JF(h),S=eD(e,p,h,x),v=["border-collapse:collapse"],k=me(i,"tblW"),E=Rn(fr(k,"w",pa$2));E!==null&&E>0&&fr(k,"type",pa$2)==="dxa"&&v.push(`width:${Mr(E)}`);let I=Pr(u==="right"||u==="end"?"right":u==="center"?"center":"left",c);I==="center"?v.push("margin-left:auto","margin-right:auto"):I==="right"?v.push("margin-left:auto","margin-right:0"):v.push("margin-left:0","margin-right:auto");for(let[O,C]of [["insideH","insideh"],["insideV","insidev"]]){let w=Ki(me(a,O));w&&v.push(`mso-border-${C}-alt:${w}`);}let R=`<table dir="${c?"rtl":"ltr"}" align="${I}" style="${v.join(";")}">`;for(let O of y){if("skip"in O){r.advanceFieldState(O.skip,n);continue}let C=O.row,w=me(me(g[C]??null,"trPr"),"trHeight"),T=Rn(fr(w,"val",pa$2)),$=HR(T,fr(w,"hRule",pa$2)),W=$===""?"":` style="${$}"`;R+=`<tr${W}>`;for(let q of b[C]??[]){if("skip"in q){r.advanceFieldState(q.skip,n);continue}let K=q.placement;if(K.vMerge==="continue"){r.advanceFieldState(K.cell,n);continue}let Z=1;if(K.vMerge==="restart")for(let D=C+1;D<h.length&&h[D].find(H=>H.startColumn===K.startColumn&&H.vMerge==="continue");D+=1)Z+=1;let M=me(K.cell,"tcPr"),ee=K.startColumn+K.span>=x,J=sv(p,C,h.length,K.startColumn===0,ee,K.startColumn),fe=ZF(M,a,C,h.length,Z,K.startColumn===0,ee,J?.fill!==void 0?J.fill:p.styleFill,c,d),se=(K.span>1?` colspan="${K.span}"`:"")+(Z>1?` rowspan="${Z}"`:"")+(fe===""?"":` style="${Qr(fe)}"`),B=S.get(K.cell)??e;R+=`<td dir="ltr"${se}>${r.renderBlocks(B,K.cell.children,n)}</td>`;}R+="</tr>";}return `${R}</table>`}function gp(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 lv(e){let t=Kh$1(e,"type",pa$2);return t==="separator"||t==="continuationSeparator"}function cv(e,t){let n=new Set;if(e===null)return n;for(let r of e.children){if(!Ze(r)||r.namespaceUri!==pa$2||r.localName!==t||lv(r))continue;let o=gp(Kh$1(r,"id",pa$2));o!==null&&n.add(o);}return n}function Bc(e,t,n,r,o,i,a){for(let s of t.children)if(Ze(s)&&s.kind!=="drawing"){if(s.kind==="revisionDelete"||s.kind==="revisionMoveFrom"){r.inert||o(s,r);continue}if(s.kind==="table"){Bc(e,s,n,r,o,i,nD(e,s));continue}if(s.kind==="tableCell"||s.namespaceUri===pa$2&&s.localName==="tc"){let l=a?.get(s);if(l===void 0){r.inert||o(s,r);continue}Bc(l,s,n,r,o,i,a);continue}if(s.kind==="paragraph"){let l=s.children.find(c=>c.kind==="paragraphProperties");Bc(e,s,n,r,o,l&&Ze(l)?l:null,a);continue}if(s.kind==="run"){if(s.children.some(d=>d.kind==="fldChar")){r.inert||o(s,r);continue}if(s.children.some(d=>d.kind==="instrText")||!r.inert&&r.stack.some(d=>d==="instr"))continue;let l=s.children.find(d=>d.kind==="runProperties"),c=pp(e.styles,i,l&&Ze(l)?l:null,e.tableRPr);if(Ar(c,"vanish"))continue}if(s.namespaceUri===pa$2&&(s.localName==="footnoteReference"||s.localName==="endnoteReference")){let l=gp(Kh$1(s,"id",pa$2));l!==null&&n.push({kind:s.localName==="footnoteReference"?"footnote":"endnote",id:l});continue}Bc(e,s,n,r,o,i,a);}}function CK(e,t,n){if(e===null)return null;for(let r of e.children)if(!(!Ze(r)||r.namespaceUri!==pa$2)&&!(r.localName!==t||lv(r))&&gp(Kh$1(r,"id",pa$2))===n)return r;return null}function oD(e,t,n){let r={footnote:new Set(e.noteOrdinals.footnote.keys()),endnote:new Set(e.noteOrdinals.endnote.keys())},o=[];for(let i of ["footnote","endnote"])for(let a of r[i])o.push({kind:i,id:a});for(;o.length>0;){let i=o.pop(),a=CK(t[i.kind],i.kind,i.id);if(a===null)continue;let s={stack:[],inert:false};n(a,s);let l={stack:[],inert:s.stack.length>0},c=[];Bc(e,a,c,l,n,null);for(let d of c)e.availableNotes[d.kind].has(d.id)&&(r[d.kind].has(d.id)||(r[d.kind].add(d.id),o.push(d)));}return r}function dv(e,t,n,r,o){if(n===null)return "";let i=`/word/${t}s.xml`;for(let[l,c]of e.pkg.parts)c.root===n&&(i=l);let a=ug(e.pkg,i),s="";for(let l of n.children){if(!Ze(l)||l.namespaceUri!==pa$2||l.localName!==t||lv(l))continue;let c=Kh$1(l,"id",pa$2),d=gp(c);if(c===void 0||d===null||!r.has(d))continue;let u=o({...e,noteBody:{kind:t,id:d},docRels:a},l.children);s+=`<div style="mso-element:${t}" id="${t==="footnote"?"ftn":"edn"}${d}">${u===""?"<p></p>":u}</div>`;}return s===""?"":`<div style="mso-element:${t}-list">${s}</div>`}function iD(e){if(!e)return null;let t=[];for(let n of e.children){if(!Ze(n)||n.localName!=="tab")continue;let r=mt(n),o=Rn(Kh$1(n,"pos",pa$2));if(o===null||o<0||r!=="left"&&r!=="center"&&r!=="right"&&r!=="decimal"&&r!=="bar")continue;let i=mt(n,"leader"),a=i==="dot"?"dotted":i==="hyphen"?"dashed":i==="underscore"?"lined":i==="middleDot"?"middledot":i==="heavy"?"heavy":"";t.push(`${r}${a?` ${a}`:""} ${Mr(o)}`);}return t.length>0?`tab-stops:${t.join(" ")}`:null}var uv="http://schemas.openxmlformats.org/officeDocument/2006/relationships",OK=`${uv}/numbering`,MK=`${uv}/footnotes`,AK=`${uv}/endnotes`,LK=2*1024*1024,FK=8*1024*1024,aD=9525,DK=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 hp(e,t,n,r){let o=e.direct!==null&&me(e.direct,r)!==null||Pn(e.defaults,r)!==null||Pn(e.tableLevel,r)!==null||Pn(e.paragraphLevel,r)!==null||Pn(e.characterLevel,r)!==null;return Ar(e,t&&o?r:n)}function NK(e){let t=e.all;if(Ar(e,"vanish"))return {css:"",vanish:true,vertAlign:null,lang:null,rtl:false};let n=[],r=Jr(t,"rtl"),o=(r?Gt(t,"rFonts","cs"):void 0)??Gt(t,"rFonts","ascii")??Gt(t,"rFonts","hAnsi")??Gt(t,"rFonts","eastAsia")??(r?void 0:Gt(t,"rFonts","cs"));if(o!==void 0){let v=FR(o);v&&n.push(`font-family:${v}`);}let i=si((r?Gt(t,"szCs","val"):void 0)??Gt(t,"sz","val")??(r?void 0:Gt(t,"szCs","val")));i!==null&&i>0&&n.push(`font-size:${Math.round(i/2*100)/100}pt`);let a={...e,direct:null},s=e.direct?t.slice(0,-1):t;hp(e,r,"b","bCs")?n.push("font-weight:bold"):hp(a,r,"b","bCs")&&n.push("font-weight:normal"),hp(e,r,"i","iCs")?n.push("font-style:italic"):hp(a,r,"i","iCs")&&n.push("font-style:normal");let l=[],c=Pn(t,"u"),d=c!==null&&mt(c)!=="none";d&&l.push("underline");let u=ov(e,"dstrike");if((Ar(e,"strike")||u)&&l.push("line-through"),l.length>0)n.push(`text-decoration:${l.join(" ")}`);else {let v=Pn(s,"u");(v!==null&&mt(v)!=="none"||Ar(a,"strike")||ov(a,"dstrike"))&&n.push("text-decoration:none");}d&&n.push(...NR(c)),u&&!d&&n.push("text-decoration-style:double");let f=KF(Gt(t,"color","val"));f&&n.push(`color:${f}`);let p=Rn(Gt(t,"spacing","val"));p!==null&&n.push(`letter-spacing:${Math.round(p/20*100)/100}pt`);let g=mt(Pn(t,"highlight")),y=g!==void 0&&Object.hasOwn(zg,g)?zg[g]:void 0,h=Hc(Pn(t,"shd"));y?n.push(`background-color:${y}`,`mso-highlight:${g}`):h&&n.push(`background-color:${h}`),Ar(e,"caps")?n.push("text-transform:uppercase"):Ar(a,"caps")&&n.push("text-transform:none"),Ar(e,"smallCaps")?n.push("font-variant:small-caps"):Ar(a,"smallCaps")&&n.push("font-variant:normal");let b=mt(Pn(t,"vertAlign")),x=b==="superscript"||b==="subscript"?b:null,S=qi((r?Gt(t,"lang","bidi"):void 0)??Gt(t,"lang","val")??Gt(t,"lang","bidi")??Gt(t,"lang","eastAsia"));return {css:n.join(";"),vanish:false,vertAlign:x,lang:S,rtl:r}}function HK(e,t,n=false){let r=[],o=mt(Pn(e,"jc")),i=o!==void 0&&Object.hasOwn(Zg,o)?Zg[o]:void 0;i&&r.push(`text-align:${n&&i!=="center"&&i!=="justify"?i==="left"?"right":"left":i}`);let a=Rn(Gt(e,"spacing","before"));a!==null&&a>=0&&r.push(`margin-top:${Mr(a)}`);let s=Rn(Gt(e,"spacing","after"));s!==null&&s>=0&&r.push(`margin-bottom:${Mr(s)}`);let l=Rn(Gt(e,"spacing","line")),c=Gt(e,"spacing","lineRule");r.push(...DR(l,c));let d=null,u=null,f=null,p=null;for(let b of e){let x=me(b,"ind");if(!x)continue;let S=Rn(fr(x,"left",pa$2)??fr(x,"start",pa$2));S!==null&&(d=S);let v=Rn(fr(x,"right",pa$2)??fr(x,"end",pa$2));v!==null&&(u=v);let k=Rn(fr(x,"hanging",pa$2)),E=Rn(fr(x,"firstLine",pa$2));k!==null?(f=k,p=null):E!==null&&(p=E,f=null);}!t&&d!==null&&r.push(`margin-${n?"right":"left"}:${Mr(d)}`),u!==null&&r.push(`margin-${n?"left":"right"}:${Mr(u)}`),f!==null&&f!==0?r.push(`text-indent:${Mr(-f)}`):p!==null&&p!==0&&r.push(`text-indent:${Mr(p)}`);let g=iD(Pn(e,"tabs"));g&&r.push(g),Jr(e,"pageBreakBefore")&&r.push("page-break-before:always"),Jr(e,"keepNext")&&r.push("page-break-after:avoid"),Jr(e,"keepLines")&&r.push("page-break-inside:avoid"),Jr(e,"widowControl")&&r.push("widows:2","orphans:2");let y=Hc(Pn(e,"shd"));y&&r.push(`background-color:${y}`);let h=Pn(e,"pBdr");if(h)for(let b of ["top","left","bottom","right"]){let x=Ki(me(h,b));x&&r.push(`border-${b}:${x}`,`mso-border-${b}-alt:${x}`);}return r.join(";")}function _K(e,t,n){let r=e.noteOrdinals[t],o=r.get(n);if(o!==void 0)return o;let i=r.size+1;return r.set(n,i),i}var sD={decimal:"decimal",decimalZero:"decimal-leading-zero",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",none:"none"};function cD(e,t,n,r){let o=e.numbering.formatOverrides.get(`${t}:${r}`)??e.numbering.levelFormats.get(n)?.get(String(r))??"decimal",i=e.numbering.startOverrides.get(`${t}:${r}`)??e.numbering.levelStarts.get(n)?.get(String(r))??1;return {fmt:o,start:i}}function BK(e,t){let n,r;for(let s of t){let l=me(s,"numPr");if(!l)continue;let c=mt(me(l,"numId"));c!==void 0&&(n=c);let d=mt(me(l,"ilvl"));d!==void 0&&(r=d);}if(n===void 0||n==="0")return null;let o=e.numbering.numToAbstract.get(n);if(o===void 0)return null;for(let s=0;s<8&&!((e.numbering.levelFormats.get(o)?.size??0)>0);s+=1){let l=e.numbering.styleLinks.get(o),c=l===void 0?void 0:e.styles.byId.get(l),d=mt(me(me(me(c??null,"pPr"),"numPr"),"numId")),u=d===void 0?void 0:e.numbering.numToAbstract.get(d);if(u===void 0||u===o)break;o=u;}let i=Math.min(Math.max(si(r)??0,0),8),a=cD(e,n,o,i);return {numId:n,abstractId:o,level:i,fmt:a.fmt,start:a.start}}function $K(e,t){let n=K$1(e.pkg.contentTypes,t);if(n.ok){let i=DK.get(n.contentType.toLowerCase());if(i!==void 0)return i}let r=t.lastIndexOf("."),o=r===-1?"":t.slice(r+1).toLowerCase();return o==="png"?"image/png":o==="jpg"||o==="jpeg"?"image/jpeg":o==="gif"?"image/gif":o==="bmp"?"image/bmp":o==="webp"?"image/webp":o==="svg"?"image/svg+xml":o==="tif"||o==="tiff"?"image/tiff":o==="emf"?"image/x-emf":o==="wmf"?"image/x-wmf":null}function WK(e,t){let n=Ts(t,"inline",wa)??Ts(t,"anchor",wa);if(!n)return "";let r=Ts(n,"blip",va);if(!r)return "";let o=Kh$1(r,"embed",ya);if(!o)return "";let i=e.docRels.find(y=>y.id===o&&y.targetMode!=="External");if(!i)return "";let a=E$3(i.ownerPart,i.rawTarget);if(!a.ok)return "";let s=e.pkg.partBytes.get(a.partName.replace(/^\//,""))??e.pkg.partBytes.get(a.partName);if(!s)return "";let l=$K(e,a.partName);if(!l||s.byteLength>e.maxImageBytes||e.imageBudget.used+s.byteLength>e.maxTotalImageBytes)return "";e.imageBudget.used+=s.byteLength;let c=e.imageDataUris.get(a.partName);c==null&&(c=`data:${l};base64,${Du(s)}`,e.imageDataUris.set(a.partName,c));let d=Ts(n,"extent",wa),u=d?si(Kh$1(d,"cx","")):null,f=d?si(Kh$1(d,"cy","")):null,p=y=>Math.round(y/12700*100)/100,g=u!==null&&f!==null&&u>0&&f>0?` width="${Math.round(u/aD)}" height="${Math.round(f/aD)}" style="width:${p(u)}pt;height:${p(f)}pt"`:"";return `<img src="${c}"${g}>`}function da(e,t,n=0){if(n>=Aa$1)return;let r=eh$1(e)?n+1:Ba(e,n);for(let o of e.children)if(Ze(o)&&o.kind!=="drawing"){if(o.kind==="contentControl"){let i=o.children.find(a=>a.kind==="contentControlContent");i&&Ze(i)&&da(i,t,r+1);continue}if(o.kind==="fldChar"){dD(o,t);continue}da(o,t,r);}}function dD(e,t){let n=Kh$1(e,"fldCharType",pa$2);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 qK(e,t,n,r){let o=t.children.find(c=>c.kind==="runProperties"),i=pp(e.styles,n,o&&Ze(o)?o:null,e.tableRPr),a=NK(i),s="";for(let c of t.children){if(!Ze(c))continue;if(c.kind==="fldChar"){r.inert||dD(c,r);continue}if(c.kind==="instrText"||!r.inert&&r.stack.some(f=>f==="instr")||a.vanish)continue;let d=BR(c);if(d!==""){s+=d;continue}let u=_R(c,e.noteBody,(f,p)=>_K(e,f,p),(f,p)=>e.availableNotes[f].has(p));if(u!==""){s+=u;continue}switch(c.kind){case "text":s+=nv(tv(c));break;case "tab":s+='<span style="white-space:pre;mso-tab-count:1"> </span>';break;case "hardBreak":{let f=Kh$1(c,"type",pa$2);s+=f==="page"?'<br style="page-break-before:always">':"<br>";break}case "bookmarkStart":{let f=Rr(Kh$1(c,"name",pa$2));f!==null&&(s+=`<a id="${Qr(f)}"></a>`);break}case "drawing":s+=WK(e,c);break;default:s+=zb$1(c)?.text??"";break}}if(s==="")return "";a.vertAlign==="superscript"?s=`<sup>${s}</sup>`:a.vertAlign==="subscript"&&(s=`<sub>${s}</sub>`);let l=`${a.lang===null?"":` lang="${a.lang}"`}${a.rtl?' dir="rtl"':""}${a.css===""?"":` style="${Qr(a.css)}"`}`;return l===""?s:`<span${l}>${s}</span>`}function ca(e,t,n,r,o=0){if(o>=Aa$1)return "";let i="";for(let a of t)if(Ze(a))switch(eh$1(a)?"fldSimple":a.kind){case "run":i+=qK(e,a,n,r);break;case "hyperlink":{let s=ca(e,a.children,n,r,o+1);if(s==="")break;let l=Kh$1(a,"id",ya),c=l?e.docRels.find(f=>f.id===l):void 0,d=c===void 0?void 0:c.targetMode==="External"||c.rawTarget.startsWith("#")?c.rawTarget:void 0,u=dP(d,Kh$1(a,"anchor",pa$2));i+=u!==null?`<a href="${Qr(u)}">${s}</a>`:s;break}case "bookmarkStart":{let s=Rr(Kh$1(a,"name",pa$2));s!==null&&(i+=`<a id="${Qr(s)}"></a>`);break}case "fldSimple":i+=ca(e,a.children,n,r,o+1);break;case "contentControl":{let s=a.children.find(l=>l.kind==="contentControlContent");s&&Ze(s)&&(i+=ca(e,s.children,n,r,o+1));break}case "revisionInsert":case "revisionMoveTo":i+=ca(e,a.children,n,r,o+1);break;case "revisionDelete":case "revisionMoveFrom":da(a,r,o);break;case "generic":if(Mg$1(a))i+=mR(a);else if(Ca(a))i+=ca(e,a.children,n,r,o+1);else {let s=nd(a);s&&(i+=ca(e,s,n,r,o+1));}break}return i}function KK(e,t){let n=mt(me(t,"pStyle")),r=Mo(e.styles,n,"paragraph");for(let o=r.length-1;o>=0;o-=1){let i=Kh$1(r[o],"styleId",pa$2),a=i?/^Heading([1-6])$/.exec(i):null;if(a)return {level:Number(a[1]),fromStyle:true}}if(n===void 0){let o=si(mt(me(t,"outlineLvl")));if(o!==null&&o>=0&&o<=5)return {level:o+1,fromStyle:false}}return null}function UK(e,t){let n=Mo(e.styles,mt(me(t,"pStyle")),"paragraph");for(let r=n.length-1;r>=0;r-=1){let o=LR(Kh$1(n[r],"styleId",pa$2));if(o!==null)return o}return null}function lD(e,t,n,r){let o=t.children.find(h=>h.kind==="paragraphProperties"),i=o&&Ze(o)?o:null,a=rv(e.styles,i,e.tablePPr),s=HK(a,n.asListItem,Jr(a,"bidi")),l=ca(e,t.children,i,r),c=s===""?"":` style="${Qr(s)}"`,d=Jr(a,"bidi")?' dir="rtl"':"",u=UK(e,i),f=u===null?"":` class="${u}"`,p=KK(e,i);if(n.asListItem)return `<li${p?.fromStyle===true?` class="Heading${p.level}"`:f}${d}${c}>${l}</li>`;let g=p===null?"p":`h${p.level}`,y=p===null?f:p.fromStyle?` class="Heading${p.level}"`:' class="docx-outline"';return `<${g}${y}${d}${c}>${l}</${g}>`}var jK={renderBlocks:(e,t,n)=>yp(e,t,n),advanceFieldState:da};function yp(e,t,n){let r="",o=[],i=null,a=new Map,s=n;if(s===void 0){let f={stack:[]};for(let p of t)Ze(p)&&da(p,f);s={stack:[],inert:f.stack.length>0};}let l=()=>{let f=o.pop();f&&(r+=`</${f.tag}>`);},c=()=>{for(;o.length>0;)l();i=null;},d=(f,p)=>{for(i!==null&&p.level<i&&c();o.length>0&&o[o.length-1].abstractId!==p.abstractId;)l();o.length===0&&(i=p.level);let g=i??p.level,y=p.level-g+1;for(;o.length>y;)l();for(o.length===y&&o[y-1].numId!==p.numId&&l();o.length<y;){let x=g+o.length,S=cD(e,p.numId,p.abstractId,x),v=a.get(`${p.abstractId}:${p.numId}:${x}`)??0,k=S.start+v,E=S.fmt==="bullet"?"ul":"ol",I=E==="ol"?Object.hasOwn(sD,S.fmt)?sD[S.fmt]:"decimal":null,R=E==="ol"&&k!==1?` start="${k}"`:"";r+=I?`<${E}${R} style="list-style-type:${Qr(I)}">`:`<${E}>`,o.push({tag:E,numId:p.numId,abstractId:p.abstractId});}let h=`${p.abstractId}:${p.numId}:${p.level}`;a.set(h,(a.get(h)??0)+1);let b=`${p.abstractId}:`;for(let x of a.keys()){if(!x.startsWith(b))continue;let S=x.slice(x.lastIndexOf(":")+1);/^\d+$/.test(S)&&Number(S)>p.level&&a.delete(x);}r+=lD(e,f,{asListItem:true},s);},u=f=>{for(let p of f)if(Ze(p))switch(p.kind){case "paragraph":{let g=p.children.find(b=>b.kind==="paragraphProperties"),y=g&&Ze(g)?g:null,h=BK(e,rv(e.styles,y));h?d(p,h):(c(),r+=lD(e,p,{asListItem:false},s));break}case "table":c(),r+=rD(e,p,s,jK);break;case "contentControl":{let g=p.children.find(y=>y.kind==="contentControlContent");g&&Ze(g)&&u(g.children);break}case "generic":u(p.children);break;case "bookmarkStart":{let g=Rr(Kh$1(p,"name",pa$2));g!==null&&(r+=`<a id="${Qr(g)}"></a>`);break}default:s.inert||da(p,s);break}};return u(t),c(),r}function uD(e,t){let n=e.parts.get(e.mainDocumentPart);if(!n||!Ze(n.root))return "";let r=n.root.children.find(c=>c.kind==="body");if(!r||!Ze(r))return "";let o=_c(e,MK,"/word/footnotes.xml"),i=_c(e,AK,"/word/endnotes.xml"),a={pkg:e,styles:UF(e),numbering:VF(_c(e,OK,"/word/numbering.xml")),docRels:ug(e,e.mainDocumentPart),maxImageBytes:LK,maxTotalImageBytes:FK,imageBudget:{used:0},imageDataUris:new Map,noteOrdinals:{footnote:new Map,endnote:new Map},availableNotes:{footnote:cv(o,"footnote"),endnote:cv(i,"endnote")},noteBody:null},s=yp(a,r.children),l=oD(a,{footnote:o,endnote:i},da);return s+dv(a,"footnote",o,l.footnote,yp)+dv(a,"endnote",i,l.endnote,yp)}var VK=12*1024*1024;function GK(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function zK(e){return `<div><table>${e.split(`
|
|
28
|
-
`).map(n=>`<tr>${n.split(" ").map(r=>`<td>${GK(r)}</td>`).join("")}</tr>`).join("")}</table></div>`}function fv(e){if(e.cellRectangle)return {text:e.text,html:zK(e.text)};if(!e.coverage||!e.pkg)return {text:e.text,html:null};let t=M$1(e.pkg,e.coverage);if(!t.ok)return {text:e.text,html:null,...t.reason==="unsupported-content"?{reason:t.reason}:{}};let n=e.maxFragmentBytes??VK,r=t.bytes;if(t.bytes.byteLength>n){let a=M$1(e.pkg,e.coverage,{omitMedia:true});r=a.ok&&a.bytes.byteLength<=n?a.bytes:null;}let o;try{o=uD(t.package);}catch(a){console.error("docx-editor: copy HTML flavour failed to render",a),o="";}let i=xR(o,r?{bytes:r,lastMarkCovered:t.lastMarkCovered}:null);return {text:e.text,html:i}}function fD(e,t){let n=()=>t.text.length===0?"none":(e.insertPlainText(t.text),"plain");if(t.forcePlain)return n();let r=t.html;if(r===null||r.length===0)return n();let o=jo(r);if(!e.richLaneOpen)return o&&qF(o.bytes)?"unsupported-content":n();if(o){let a=e.pasteFragment(o.bytes,o.lastMarkCovered);if(a==="unsupported-content")return "unsupported-content";if(a)return "fragment"}let i=vT(r);if(i.ok&&i.truncated&&t.text.length>0)return n();if(i.ok){let a=e.pasteFragment(i.fragmentBytes,i.lastMarkCovered);if(a==="unsupported-content")return "unsupported-content";if(a)return "external-html"}return n()}function pD(e,t){let n=Ve(e,t);if(!n.includes("\xAD"))return n;let r=n.split("");for(let{line:o}of Xb$1(e,t)??[])for(let i of $a(o,t)?.spans??[])Fd(i)&&i.range.start<r.length&&(r[i.range.start]=Rb$2);return r.join("")}function mD(e){return e.includes(Rb$2)?e.replaceAll(Rb$2,""):e}function gD(e,t,n,r,o){if(!o||t.paragraphId!==n.paragraphId||/[\r\n\t]/.test(r)||!Xk(e.settingsRoot()))return r;let i=de(e,t.paragraphId)??e.part();if(!Yk(i,t.paragraphId))return r;let a=eb$1(i,t.paragraphId);if(a?.kind!=="paragraph")return r;let s=Zk(a).find(h=>h.fieldNodeId===o&&h.start<=t.offset&&h.end>=n.offset);if(!s?.enabled||!Jk(s)||s.maxLength<=0)return r;let l=(Km(i,t.paragraphId)??"").slice(s.start,s.end),c=l.slice(0,t.offset-s.start),d=l.slice(n.offset-s.start),u=c+d,f=h=>Kk(c+h+d,s,u)<=s.maxLength;if(f(r))return r;let p=[...r],g=s.maxLength-[...u].length;if(s.type==="number"&&s.format)for(let h of u)(h===","&&s.format.includes(",")||h==="%"&&s.format.endsWith("%"))&&g++;let y=new Set;if(s.type==="date"){let h=0;for(let b=0;b<p.length;b++)if(/\S/.test(p[b])){if(++h>18)break;y.add(b+1);}else (b+1===p.length||/\S/.test(p[b+1]))&&y.add(b+1);}else if(s.type==="number"&&s.format)for(let h=1;h<=3;h++)y.add(g+h);for(let h of [...y].sort((b,x)=>x-b)){if(h<=Math.max(0,g)||h>p.length)continue;let b=p.slice(0,h).join("");if(f(b))return b}return p.slice(0,Math.max(0,g)).join("")}function ZK(e,t){let n=eb$1(e,t);if(!n||!uc$1(n))return false;let r=fb$1(e,t)?.children??[];return r[r.findIndex(i=>i.id===t)+1]?.kind==="paragraph"}var XK=2e3;function hD(e){let{session:t}=e,n=null;function r(s){let l=Vu(s),c=e.orderedRange(),d=gD(t,c.from,c.to,l,e.textFormFieldId?.()??null).split(`
|
|
29
|
-
`),u=e.deleteSelectionPlan(),f=u.replaceAt??u.collapseTo,p=d.join(""),g=[...u.ops],y=e.consumePendingFormatOps(f.paragraphId,f.offset,p.length);if(p.length>0){let E=u.ops.length===0&&d.length===1?e.insertOwner?.():void 0;g.push({op:"insertText",paragraphId:f.paragraphId,offset:f.offset,text:p,...E===void 0?{}:{inside:E}}),g.push(...y);}let h=[],b=0;for(let E=0;E<d.length-1;E+=1)b+=d[E].length,h.push(f.offset+b);if(h.length>0&&g.push({op:"splitParagraphMany",paragraphId:f.paragraphId,offsets:h}),g.length===0)return;let x=new Set(e.paragraphIds?.()??t.paragraphIdsIn(e.storyScope())),S=d[d.length-1],v=h.length===0?e.caretMark({paragraphId:f.paragraphId,offset:f.offset+S.length}):void 0,k=g.filter(E=>!y.includes(E));e.commit(()=>e.withoutPendingOnRejection(g,k,e.selectionMark(),v),()=>{if(h.length===0)return Ke({paragraphId:f.paragraphId,offset:f.offset+S.length});let E=(e.paragraphIds?.()??t.paragraphIdsIn(e.storyScope())).filter(R=>!x.has(R)),I=E[E.length-1];return I?Ke({paragraphId:I,offset:S.length}):null});}function o(){e.flushPendingInputAndLayout();let s=e.cellSelection(),l=e.orderedRange(),c=e.paragraphOrder(),d=s?ma$2(e.layout(),s.cellIds):c.slice(c.indexOf(l.from.paragraphId),c.indexOf(l.to.paragraphId)+1),u=new Map(d.map(C=>[C,{start:!s&&C===l.from.paragraphId?l.from.offset:0,end:!s&&C===l.to.paragraphId?l.to.offset:1/0}])),p=e.storyScope().kind==="body"?t.part():de(t,d[0]??l.from.paragraphId);if(p&&ev(p,u)){let C=WF(p,u);return e.commit(()=>({committed:false,rejected:true,opCount:0,reason:C?Dc:"unsupported-content"})),{text:"",html:null,reason:C?"chart-content":"unsupported-content"}}let g=e.revisionDisplayMode?.()!=="original",y=zO(pD,!g),h=C=>mD(C).replaceAll(Ff,""),b=hc(e.layout(),y);if(s)return fv({text:h(pa$1(e.layout(),s,b.spelledText)),cellRectangle:true,coverage:null,pkg:null});let{from:x,to:S}=e.orderedRange(),v=t.part(),k=h(fb(e.layout(),x,S,e.paragraphOrder(),(C,w)=>b.resultAt(C,w)??(v?NF(v,C,w):null),b.markedText,g&&v?C=>ZK(v,C):void 0)),E=e.storyScope();if(x.paragraphId===S.paragraphId&&x.offset===S.offset||E.kind!=="body")return {text:k,html:null};let R=t.part(),O=tM(e.layout(),R,x,S,e.paragraphOrder());return fv({text:k,cellRectangle:false,coverage:O,pkg:t.currentPackage()})}function i(s,l){let c=e.editingMode()==="suggest"?e.suggestion?.():void 0;if(e.editingMode()!=="edit"&&c===void 0||e.storyScope().kind!=="body"||e.cellSelection())return false;e.flushPendingInputAndLayout();let d=e.deleteSelectionPlan(),u=c?e.trackedOps?.(d.ops,c.date)??d.ops:d.ops,f=d.replaceAt??d.collapseTo,p=false,g=false;return e.commit(()=>{let y=e.collaborationGate(u,{kind:"body"});if(y)return {committed:false,rejected:true,opCount:0,reason:y};let h=e.actorId(),b=t.applyFragmentPaste({kind:"body"},{paragraphId:f.paragraphId,offset:f.offset,fragmentBytes:s,lastMarkCovered:l,priorOps:u,...h!==void 0?{actorId:h}:{},...c?{revision:c}:{}});return p=b.ok,p&&c&&e.trackedChangeLanded?.(),g=!b.ok&&b.detail==="fragment-merge:unsupported-content",{committed:b.ok,rejected:!b.ok,opCount:b.ok?1:0,...b.ok?{}:{reason:b.detail??b.reason}}},()=>Ke(f)),g?"unsupported-content":p}function a(s,l){let c=n!==null&&e.now()-n<XK;n=null;let d=fD({richLaneOpen:(e.richPasteAllowed?.()??true)&&(e.editingMode()==="edit"||e.editingMode()==="suggest"&&e.suggestion?.()!==void 0)&&e.storyScope().kind==="body"&&e.cellSelection()===null,pasteFragment:(u,f)=>i(u,f),insertPlainText:r},{html:l,text:s,forcePlain:c});if(d==="unsupported-content"){let u=l?jo(l):null,f=u!==null&&Nc(u.bytes)==="chart";return e.commit(()=>({committed:false,rejected:true,opCount:0,reason:f?Dc:"unsupported-content"})),false}return d!=="none"}return {insertPlainText:r,copyFlavoursNow:o,pasteRichNow:a,armForcePlainPaste:()=>{n=e.now();}}}function yD(e){let{session:t}=e,n=null,r=()=>n??e.selection(),o=()=>n?null:e.cellSelection();function i(){return ra(e.selection())}function a(){e.flushPendingInputAndLayout();let v=r(),k=v.anchor.paragraphId===v.head.paragraphId?void 0:e.paragraphOrder();return Nf(e.layout(),v,k)}function s(){return a().from}function l(v){return Ve(e.layout(),v)}function c(v,k){let E=t.partFor(e.storyScope())??t.part(),I=eb$1(E,v.paragraphId);if(!I||I.kind!=="paragraph")return null;let R=k==="before"?zi$1(I,v.offset):Ai(I,v.offset);if(!R)return null;let O=Mh$1(E,R.controlId),C=O?qc$1(O):null;if(!C)return null;let w=C.lock==="contentLocked"||C.lock==="sdtContentLocked";if(!(w||C.type==="checkbox"||C.type==="picture")||!O)return null;let $=false,W=e.trackedAuthorOrNone()!==void 0;for(let q=W?fb$1(E,O.id):null;q&&(q.kind==="revisionDelete"&&($=true),!($||q.kind==="paragraph"));q=fb$1(E,q.id));return {...R,contentLocked:w,...$?{struck:$}:{}}}function d(v,k){return e.flushPendingInputAndLayout(),e.cellSelection()?null:VO({layout:e.layout(),selection:e.selection(),direction:v,shown:k,controlBeside:c,tracked:e.trackedAuthorOrNone()!==void 0})}function u(v){if(e.trackedAuthorOrNone()!==void 0||e.cellSelection())return false;let k=a();return k.from.paragraphId===k.to.paragraphId&&k.from.offset===k.to.offset?e.atParagraphEnd(v.paragraphId,v.offset):e.atParagraphEnd(k.to.paragraphId,k.to.offset)}function f(v){let k=v?.trim()||void 0,E=p(g(k!==void 0||e.trackedAuthorOrNone()!==void 0),!k&&e.editingMode()!=="suggest"),I=o(),R=null;return {...E,get replaceAt(){return R??=x(E,k,I),R}}}function p(v,k){if(!k||v.ops.length===0||o())return v;let{from:E,to:I}=a();if(E.paragraphId===I.paragraphId)return v;let R=de(t,E.paragraphId)??t.part(),O=Ok(R,E,I,e.paragraphOrder());return O.length===0?v:{...v,ops:[...O,...v.ops]}}function g(v=e.trackedAuthorOrNone()!==void 0){e.flushPendingInputAndLayout();let k=o();if(k){let O=[];for(let C of ma$2(e.layout(),k.cellIds)){let w=Ve(e.layout(),C).length;w>0&&O.push({op:"deleteText",paragraphId:C,start:0,end:w});}return {ops:O,collapseTo:s()}}let E=r();if(E.anchor.paragraphId===E.head.paragraphId&&E.anchor.offset===E.head.offset)return {ops:[],collapseTo:_b$1(e.layout(),E.head)};let{from:I,to:R}=a();return nM(e.layout(),t.partFor(e.storyScope())??t.part(),I,R,e.paragraphOrder(),e.revisionView(),v)}function y(){return f().ops}function h(v){let k=n;n=v;try{let E=f();return {ops:E.ops,replaceAt:E.replaceAt??E.collapseTo}}finally{n=k;}}function b(v,k,E){if(!(E!==void 0||e.editingMode()==="suggest")||v.paragraphId!==k.paragraphId||k.offset<=v.offset)return v.offset;let R=(E??e.author())?.trim();if(!R)return _b$1(e.layout(),k).offset;let O=de(t,k.paragraphId)??t.part(),C=eb$1(O,k.paragraphId);return !C||C.kind!=="paragraph"?_b$1(e.layout(),k).offset:op(C,v.offset,k.offset,R,e.trackedDate())}function x(v,k,E){let I=v.collapseTo;if(k===void 0&&e.editingMode()!=="suggest")return I;if(E){for(let J of E.cellIds){let fe=la$1(e.layout(),[J]),se=fe.length>0?fe:ma$2(e.layout(),[J]);if(se.length===0)continue;let B=new Map,D=z=>{let X=B.get(z);return X===void 0&&(X=b({paragraphId:z,offset:0},{paragraphId:z,offset:l(z).length},k),B.set(z,X)),X},j=(k??e.author())?.trim(),H=z=>{let X=l(z);if(!j)return /\S/.test(X);let F=eb$1(de(t,z)??t.part(),z);if(!F||F.kind!=="paragraph")return /\S/.test(X);let U="",G=0;for(let Y of Ej$1(F,0,X.length,j))U+=X.slice(G,Math.max(G,Y.start)),G=Math.max(G,Y.end);return U+=X.slice(G),/\S/.test(U)},N=null;for(let z=se.length-1;z>=0;z-=1){let X=se[z];if(H(X)){N=X;break}}if(N===null)for(let z=se.length-1;z>=0;z-=1){let X=se[z];if(D(X)!==0){N=X;break}}return N??=se[se.length-1],{paragraphId:N,offset:D(N)}}return I}let{from:R,to:O}=a();if(R.paragraphId===O.paragraphId&&R.offset===O.offset)return I;if(R.paragraphId===O.paragraphId)return {paragraphId:O.paragraphId,offset:b(R,O,k)};let C=new Set(v.ops.flatMap(J=>J.op==="deleteBlock"?[J.blockId]:[])),w=de(t,O.paragraphId)??t.part();if(C.size>0)for(let J=fb$1(w,O.paragraphId);J;J=fb$1(w,J.id)){if(!C.has(J.id))continue;let fe={paragraphId:I.paragraphId,offset:l(I.paragraphId).length};return {paragraphId:I.paragraphId,offset:b(I,fe,k)}}let T=(k??e.author())?.trim();if(!T)return I;let $=new Set(v.ops.flatMap(J=>J.op==="joinParagraphs"?[J.secondId]:[])),W=e.paragraphOrder(),q=W.indexOf(R.paragraphId),K=W.indexOf(O.paragraphId);if(q===-1||K===-1)return I;let Z=J=>{let fe=eb$1(w,J);return fe?.kind==="paragraph"&&Gn$1(fe,T)},M=K;for(;M>q&&$.has(W[M])&&Z(W[M-1]);)M-=1;let ee=0;for(let J=M;J<=K;J+=1){let fe=W[J],se={paragraphId:fe,offset:fe===R.paragraphId?R.offset:0},B=fe===O.paragraphId?_b$1(e.layout(),O):{paragraphId:fe,offset:l(fe).length};J===M&&(ee+=se.offset),ee+=B.offset-se.offset-S(se,B,T);}return {paragraphId:W[M],offset:ee}}function S(v,k,E){let I=E?.trim();if(!I||v.paragraphId!==k.paragraphId)return 0;let R=de(t,k.paragraphId)??t.partFor(e.storyScope())??t.part(),O=eb$1(R,k.paragraphId);return !O||O.kind!=="paragraph"?0:Dj$1(O,v.offset,k.offset,I)}return {selectionMark:i,orderedRange:a,orderedStart:s,textOf:l,inlineControlBeside:c,atomicControlDeletion:d,splitEndsTheParagraph:u,deleteSelectionPlan:f,deleteSelectionOps:y,deleteRangePlan:h,replacementOffset:b}}function $c(e,t,n,r){if(r===n)return e;let o=i=>i.paragraphId===t?{...i,offset:c$1(i.offset,n,r)}:i;return {anchor:o(e.anchor),head:o(e.head)}}var vD=[24,16,12,8,6,4],YK=8;function bD(e,t,n,r,o){let i=r.textOf(e.paragraphId)??"",a=n.after.slice(0,YK);if(a&&i.slice(e.offset,e.offset+a.length)===a)return e;let s=new Set;for(let l of [e.paragraphId,t.paragraphId]){let c=o.indexOf(l);if(!(c<0))for(let d of [c,c-1,c+1])o[d]&&s.add(o[d]);}for(let l of vD){if(n.before.length<l)continue;let c=n.before.slice(-l);if(i.slice(Math.max(0,e.offset-l),e.offset)===c)return e;let d=null;for(let u of s){let f=r.textOf(u)??"";for(let p=f.indexOf(c);p>=0;p=f.indexOf(c,p+1)){if(d)return e;d={...e,paragraphId:u,offset:p+c.length};}}if(d)return d}return e}var bp="stale",QK=16;function vp(e,t){return e.anchor.paragraphId===t.anchor.paragraphId&&e.anchor.offset===t.anchor.offset&&e.head.paragraphId===t.head.paragraphId&&e.head.offset===t.head.offset}function xD(e){let t=null,n=false,r=i=>{let a=new Set(e.order());return i.filter(s=>a.has(s)).slice(0,QK).map(s=>({id:s,text:e.textOf(s)??""}))};return {expectHistory(i){n=i;},note(i,a,s){let l=n;if(n=false,t!==null){l&&t!==bp&&t.history.length===0&&(t={...t,history:r(a)});return}if(!s){t=bp;return}let c=new Map;for(let u of [i.anchor.paragraphId,i.head.paragraphId]){let f=e.textOf(u);f!==null&&c.set(u,f);}let d=u=>{let f=c.get(u.paragraphId)??"",p=vD[0];return {before:f.slice(Math.max(0,u.offset-p),u.offset),after:f.slice(u.offset,u.offset+p)}};t={selection:i,before:c,order:e.order(),context:{anchor:d(i.anchor),head:d(i.head)},history:l?r(a):[]};},noteLocal(){t!==null&&(t=bp);},discard(){t=null;},map(i){let a=o(i);return vp(a,i)?i:a}};function o(i){let a=t;if(t=null,!a)return i;let s=e.carried?.()??null,l=v=>s&&vp(s.from,v)&&vp(i,v)&&e.textOf(s.to.anchor.paragraphId)!==null&&e.textOf(s.to.head.paragraphId)!==null?s.to:null;if(a===bp)return l(i)??i;let c=e.order(),d=new Set(c);for(let{id:v,text:k}of a.history){if(!d.has(v))continue;let E=e.textOf(v)??k;if(E===k)continue;let I=0;for(;I<k.length&&I<E.length&&k[I]===E[I];)I+=1;let R={paragraphId:v,offset:I+Math.max(0,E.length-k.length)};return {anchor:R,head:R}}let u=new Set(c),f=l(a.selection);if(f)return f;let p=new Set(a.order),g=v=>{let k=a.before.get(v.paragraphId),E=e.textOf(v.paragraphId);if(k===void 0||E===null||E.length>=k.length||!k.startsWith(E)||v.offset<=E.length)return null;let I=c[c.indexOf(v.paragraphId)+1];return I===void 0||p.has(I)||!(e.textOf(I)??"").startsWith(k.slice(E.length))?null:{paragraphId:I,offset:v.offset-E.length}},y=g(i.anchor),h=g(i.head),b=i;for(let[v,k]of a.before)u.has(v)&&(b=$c(b,v,k,e.textOf(v)??k));b={anchor:y??b.anchor,head:h??b.head};let x=v=>{if(u.has(v.paragraphId))return v;let k=a.order.indexOf(v.paragraphId),E=null;for(let O=k-1;O>=0&&E===null;O-=1)u.has(a.order[O])&&(E=a.order[O]);let I=a.before.get(v.paragraphId),R=E===null?"":e.textOf(E)??"";if(E!==null&&I!==void 0&&R.endsWith(I)){let O=R.length-I.length+v.offset;return {paragraphId:E,offset:O}}for(let O=k+1;k>=0&&O<a.order.length;O+=1){let C=a.order[O];if(u.has(C))return {paragraphId:C,offset:0}}return E===null?v:{paragraphId:E,offset:R.length}};return !(c.length!==a.order.length||c.some((v,k)=>v!==a.order[k]))||!vp(i,a.selection)?{anchor:x(b.anchor),head:x(b.head)}:{anchor:bD(x(b.anchor),i.anchor,a.context.anchor,e,c),head:bD(x(b.head),i.head,a.context.head,e,c)}}}function SD(e,t){let n=e?.historySelection?.()??null;return n&&t?JK(n,t):null}function wD(e){let t=e?.remoteSelectionMove?.();if(!t)return null;let n=o=>({paragraphId:o.nodeId,offset:o.offset}),r=o=>({anchor:n(o.anchor),head:n(o.head)});return {from:r(t.from),to:r(t.to)}}function JK(e,t){let n=i=>{let a=t.paragraphByStableId(i.paragraphId);return a?{paragraphId:a.nodeId,offset:Math.min(i.offset,a.text.length)}:null},r=n(e.anchor),o=n(e.head);return r&&o?{anchor:r,head:o}:null}function kD(e){return {atParagraphEnd(t,n){let r=Km(e.partOf(t),t);return r!==null&&n===r.length},followerStyleId(t){let n=e.partOf(t),r=e.styleCascade();if(!r)return;let i=di$1(n,t).find(l=>l.localName==="pStyle")?.attributes?.val??r.defaultParagraphStyleId;if(i==null)return;let a=r.styles.get(i)?.next;if(!a||a===i)return;let s=r.styles.get(a);if(!(!s||s.type!=="paragraph"))return a===r.defaultParagraphStyleId?null:a}}}var pv=4096;function ID(e){if(typeof e.defaultView?.createImageBitmap!="function")return null;let t=e.defaultView;return Object.freeze({async decode(n,r,o){let i=new Blob([new Uint8Array(n)],{type:r}),a;try{a=await t.createImageBitmap(i,{imageOrientation:"from-image"});}catch(s){if(s?.name!=="TypeError")throw s;a=await t.createImageBitmap(i);}try{let s=a.width,l=a.height;if(s<=0||l<=0)throw new Error("image dimensions invalid");if(s*l>o.maxPixels)throw new Error("image dimensions exceed limits");return Object.freeze({pixelWidth:s,pixelHeight:l,dpiX:96,dpiY:96})}finally{a.close();}},convertPreserved(n,r,o){return r==="image/tiff"?nU(e,n,o):eU(n,r)}})}async function eU(e,t,n){let r=ce$1().metafile?.rasterize;if(!r)return tU(e);let o=await r(e,t,{maxEdge:pv});return o?Object.freeze({bytes:o.bytes,mime:o.mime}):null}async function tU(e){let{convertMetafileToDataUrl:t,getMetafileInfo:n}=await import('emf-converter'),r=new Uint8Array(e),o=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength),i=await n(o),a=await t(o,{dpiScale:ae(Math.max(i?.width??0,i?.height??0)),maxWidth:pv,maxHeight:pv}),s="data:image/png;base64,";if(!a?.startsWith(s))return null;let l=atob(a.slice(s.length)),c=new Uint8Array(l.length);for(let d=0;d<l.length;d+=1)c[d]=l.charCodeAt(d);return Object.freeze({bytes:c,mime:"image/png"})}async function nU(e,t,n){let r=await a$5(t,n);if(r===null)return null;let o=await rU(e,r.rgba,r.pixelWidth,r.pixelHeight);return o===null?null:Object.freeze({bytes:o,mime:"image/png"})}async function rU(e,t,n,r){let o=e.createElement("canvas");if(o.width=n,o.height=r,o.width!==n||o.height!==r)return null;let i=o.getContext("2d");if(!i)return null;let a=i.createImageData(n,r);a.data.set(t),i.putImageData(a,0,0);let s=await new Promise(l=>{o.toBlob(c=>l(c),"image/png");});return s?new Uint8Array(await s.arrayBuffer()):null}function RD(){return Object.freeze({async decode(){throw new Error("Image decode unavailable in headless environment")}})}function PD(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 TD(e,t){e.contentEditable=t?"true":"false",e.setAttribute("aria-readonly",t?"false":"true"),t?e.removeAttribute("tabindex"):e.tabIndex=0;}var oU="docx-editor-one-surface__caret",mv="docx-editor-one-surface__caret--steady",iU=530;function ED(e,t,n){let r=e.ownerDocument.createElement("div");r.className=oU,r.dataset.docxCaret="",r.dataset.docxMarker="",r.setAttribute("contenteditable","false"),r.setAttribute("aria-hidden","true"),r.dataset.noColorInvert="",r.style.position="absolute",r.style.pointerEvents="none",r.style.userSelect="none",r.style.setProperty("-webkit-user-select","none");let o=false,i=nt(()=>e),a=null,s=null,l=null;function c(){let x=e.ownerDocument.activeElement;return x===e||!!x&&e.contains(x)}function d(x){return x.anchor.paragraphId===x.head.paragraphId&&x.anchor.offset===x.head.offset}function u(){s=null,a!==null&&(i.clearTimeout(a),a=null),r.classList.remove(mv),r.remove(),e.style.removeProperty("caret-color"),l?.style.removeProperty("caret-color"),l=null;}function f(){r.classList.add(mv),a!==null&&i.clearTimeout(a),a=i.setTimeout(()=>{a=null,r.classList.remove(mv);},iU);}function p(){if(o||!c()||n().suppress){u();return}let{layout:x,selection:S,scopedHost:v,scopedHostKind:k,scopedOrigin:E,preferredPageIndex:I,preferredLineId:R,measurer:O,typingStyle:C}=n(),w=t();if(!d(S)){u();return}let T=Se(x,S.head,{...O?{measurer:O}:{},...I!==void 0?{preferredPageIndex:I}:{},...R!==void 0?{preferredLineId:R}:{}});if(!T||!Number.isInteger(T.pageIndex)){u();return}if(C&&O){let{pageIndex:Z,lineId:M}=T,ee=Xb$1(x,S.head.paragraphId)?.find(fe=>fe.pageIndex===Z&&fe.line.id===M),J=ee?.line;if(J&&!J.drawings?.length&&!ue$1(T)&&(J.spans.length>0||J.box.height>0)){let fe=C();if(fe){let se={...Wf(x,S)??ma$1,...fe},B=O.lineMetrics(se);if(B.height>0){let D=jc$1({...T,width:0,y:J.spans.length>0?J.box.y+J.baseline-B.baseline-ra$2(se):T.y,height:B.height},ee?.clipBox);if(!D){u();return}T=D;}}}}let $=v??e.querySelector(`[data-page-index="${T.pageIndex}"] > .docx-page-content`);if(!$){u();return}if(!(T.height>0)){u();return}r.style.left=`${(T.x-(E?.x??0))*w}px`,r.style.top=`${(T.y-(E?.y??0))*w}px`,r.style.height=`${T.height*w}px`;let W=ue$1(T);r.style.transformOrigin=W?"0 0":"",r.style.transform=W?"rotate(-90deg)":"",r.parentNode!==$&&$.append(r),e.style.caretColor="transparent",l&&l!==v&&l.style.removeProperty("caret-color"),l=v??null,l?.style.setProperty("caret-color","transparent");let q=$===v?k??"scoped":"body",K=`${T.pageIndex}:${q}:${T.x}:${T.y}:${T.height}`;K!==s&&(s=K,f());}let g=()=>{o=true,p();},y=()=>{o=false,p();},h=()=>p(),b=x=>{let S=x.relatedTarget;S&&e.contains(S)||u();};return e.addEventListener("compositionstart",g),e.addEventListener("compositionend",y),e.addEventListener("focusin",h),e.addEventListener("focusout",b),{update:p,destroy(){e.removeEventListener("compositionstart",g),e.removeEventListener("compositionend",y),e.removeEventListener("focusin",h),e.removeEventListener("focusout",b),u();}}}function gv(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)gv(o.blocks,t);}}function aU(e,t){for(let n of e.pages){let r=o=>{for(let i=0;i<o.rows.length;i+=1)t({table:o,row:o.rows[i],rowIndex:i});};gv(n.fragments,r);for(let o of [n.header,n.footer])o&&gv(o.fragments,r);}}function hv(e,t,n,r){let o=null;return aU(e,i=>{i.table.tableId===t&&i.row.id===n&&i.row.isHeaderRepeat===r&&(o=i);}),o}function yv(e,t){return {sourceRevision:e,tableId:t.table.tableId,rowId:t.row.id,isHeaderRepeat:t.row.isHeaderRepeat}}function CD(e,t,n){let r=n.gridColumnId;return r?{sourceRevision:e,tableId:t.table.tableId,gridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}:null}function OD(e,t,n,r){return {sourceRevision:e,tableId:t.table.tableId,leftGridColumnId:n,rightGridColumnId:r,isHeaderRepeat:t.row.isHeaderRepeat}}function MD(e,t,n){return {sourceRevision:e,tableId:t.table.tableId,gridColumnId:n,isHeaderRepeat:t.row.isHeaderRepeat}}var lU=120,AD=20;function xp(e){return Qd(Dl(e,"w"))??0}function cU(e,t,n){let r=e.pagesLayer.getBoundingClientRect(),o=e.scale();return {x:(t-r.left)/o,y:(n-r.top)/o}}function bv(e){let t=e.editingMode==="view";return {editable:!t,viewing:t}}function vv(e,t){return t.kind==="insertColumn"?hv(e,t.tableId,t.rowId,t.isHeaderRepeat):"rowId"in t?hv(e,t.tableId,t.rowId,t.isHeaderRepeat):null}function LD(e){return Math.min(160,e)}function FD(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=nt(()=>t),r=null,o=null,i=null,a=null,s=null,l=null,c=false,d=0,u=0,f=null,p=null,g=null;function y(F){return Au(F,"button")&&(F.classList.contains("docx-table-insert-row")||F.classList.contains("docx-table-insert-column"))}function h(){let F=t.ownerDocument.activeElement;return F!==null&&y(F)&&F.closest(".docx-table-furniture")===t?F:null}function b(F){for(let U of [...t.children])y(U)&&U!==F&&U.remove();}function x(){p=null,g=null;}function S(){r!==null&&(n.clearTimeout(r),r=null);}function v(){for(let U of [...t.children])y(U)||U.remove();let F=h();if(!F){b(null),x();return}p=F,b(F);}function k(F){let U=p??h(),G=U!==null&&t.ownerDocument.activeElement===U;x(),t.replaceChildren(),F&&G&&e.pagesLayer.focus({preventScroll:true});}function E(){for(let F of [...t.children])y(F)||F.remove();}function I(F,U,G,Y){let oe=e.read().layout.pages[F];if(!oe)return {left:0,top:0};let ae=Y??oe.contentBox,xe=e.scale(),Se=e.pageOffsetX(F);return {left:(ae.x+U+Se)*xe,top:(ae.y+G)*xe}}function R(F,U){let G=e.read(),Y=Fc(G.layout,U.tableId,U.pageIndex);if(!Y)return;let{table:le,origin:oe}=Y,ae=t.ownerDocument.createElement("div");ae.className="docx-table-resize-preview",ae.style.position="absolute",ae.style.pointerEvents="none";let xe=U.kind!=="rowDivider",Se=I(U.pageIndex,xe?le.box.x+F:le.box.x,xe?le.box.y:le.box.y+F,oe);ae.style.left=`${Se.left}px`,ae.style.top=`${Se.top}px`,ae.style.width=xe?"2px":`${le.box.width*e.scale()}px`,ae.style.height=xe?`${le.box.height*e.scale()}px`:"2px",t.append(ae);}function O(){let F=t.ownerDocument.createElement("button");return F.type="button",F.textContent="+",F.style.position="absolute",F.style.pointerEvents="auto",F}function C(F){W(F);let U=g;if(!U)return;let G=e.read();U.kind==="insertRow"?K(U,G):U.kind==="insertColumn"&&Z(U,G);}function w(){queueMicrotask(()=>{!p||t.ownerDocument.activeElement===p||c||o?.kind==="insertRow"||o?.kind==="insertColumn"||(p.remove(),x());});}function T(){if(p&&t.contains(p))return p;let F=h();if(F)return p=F,F;let U=O();return U.addEventListener("pointerenter",()=>{c=true,S();}),U.addEventListener("pointerleave",()=>{c=false;}),U.addEventListener("pointerdown",W),U.addEventListener("mousedown",W),U.addEventListener("click",C),U.addEventListener("blur",w),p=U,U}function $(F,U){let G=Fc(U.layout,F.tableId,F.pageIndex);if(!G)return;let{table:Y,origin:le}=G,oe=T();if(b(oe),g=F,oe.dataset.tableId=F.tableId,F.kind==="insertRow"){let ae=Y.rows.find(at=>at.id===F.rowId);if(!ae)return;oe.dataset.rowId=F.rowId,delete oe.dataset.gridColumnId,oe.className="docx-table-insert-row",oe.setAttribute("aria-label",e.label("table.insertRowBelow"));let xe=ae.box.y+ae.box.height/2,Se=I(F.pageIndex,Y.box.x-14,xe,le);oe.style.left=`${Se.left}px`,oe.style.top=`${Se.top-8}px`;}else {let ae=Y.rows[0]?.cells.find(we=>we.gridColumnId===F.gridColumnId);if(!ae)return;oe.dataset.gridColumnId=F.gridColumnId,delete oe.dataset.rowId;let xe=Y.columnEdges[ae.gridColumn]??0,Se=Y.columnEdges[ae.gridColumn+1]??Y.box.width;oe.className="docx-table-insert-column",oe.setAttribute("aria-label",e.label("table.insertColumnRight"));let at=I(F.pageIndex,Y.box.x+(xe+Se)/2-8,Y.box.y-14,le);oe.style.left=`${at.left}px`,oe.style.top=`${at.top}px`;}t.contains(oe)||t.append(oe);}function W(F){F.preventDefault(),F.stopPropagation();}function q(F,U){if(E(),b(p??h()),!(l||U.editingMode==="view")){if((F.kind==="columnDivider"||F.kind==="rightEdge")&&!F.isHeaderRepeat){let G=Fc(U.layout,F.tableId,F.pageIndex);if(!G)return;let{table:Y,origin:le}=G,oe=t.ownerDocument.createElement("div");oe.className=F.kind==="rightEdge"?"docx-table-edge-handle-right layout-table-edge-handle-right":"docx-table-divider-handle layout-table-resize-handle",oe.style.position="absolute",oe.style.pointerEvents="auto",oe.style.cursor="col-resize",oe.dataset.active="true";let ae=I(F.pageIndex,Y.box.x+F.edgeX,Y.box.y,le);oe.style.left=`${ae.left-3}px`,oe.style.top=`${ae.top}px`,oe.style.width="6px",oe.style.height=`${Y.box.height*e.scale()}px`,oe.addEventListener("pointerdown",M),t.append(oe);}if(F.kind==="rowDivider"&&!F.isHeaderRepeat){let G=Fc(U.layout,F.tableId,F.pageIndex);if(!G)return;let{table:Y,origin:le}=G,oe=t.ownerDocument.createElement("div");oe.className="docx-table-row-divider-handle layout-table-row-resize-handle",oe.style.position="absolute",oe.style.pointerEvents="auto",oe.style.cursor="row-resize",oe.dataset.active="true";let ae=I(F.pageIndex,Y.box.x,Y.box.y+F.edgeY,le);oe.style.left=`${ae.left}px`,oe.style.top=`${ae.top-3}px`,oe.style.width=`${Y.box.width*e.scale()}px`,oe.style.height="6px",oe.addEventListener("pointerdown",M),t.append(oe);}F.kind==="insertRow"&&!F.isHeaderRepeat&&$(F,U),F.kind==="insertColumn"&&!F.isHeaderRepeat&&$(F,U);}}function K(F,U){let G=vv(U.layout,F);if(!G)return;let Y=bv(U),le=Tr({command:{type:"insertRow",where:"below",target:yv(F.sourceRevision,G)},part:Oo(e.session(),F.tableId),layout:U.layout,storeRevision:U.storeRevision,selection:U.selection,cellSelection:U.cellSelection,themeColors:U.themeColors,...Y});e.applyTableCommandPlan(le);}function Z(F,U){let G=vv(U.layout,F);if(!G)return;let Y=G.row.cells.find(xe=>xe.gridColumnId===F.gridColumnId);if(!Y)return;let le=CD(F.sourceRevision,G,Y);if(!le)return;let oe=bv(U),ae=Tr({command:{type:"insertColumn",where:"right",target:le},part:Oo(e.session(),F.tableId),layout:U.layout,storeRevision:U.storeRevision,selection:U.selection,cellSelection:U.cellSelection,themeColors:U.themeColors,...oe});e.applyTableCommandPlan(ae);}function M(F){if(F.button!==0)return;let U=e.read();if(U.editingMode==="view"||!o||o.kind!=="columnDivider"&&o.kind!=="rightEdge"&&o.kind!=="rowDivider")return;F.preventDefault(),F.stopPropagation();let G=o,Y=vv(U.layout,G);if(!Y)return;let le=Qm(Oo(e.session(),G.tableId).root,G.tableId);if(!le.ok||G.kind!=="rowDivider"&&Sm(le.topology)!==null)return;let oe=0,ae=0,xe=0,Se=le.topology.gridColumns.reduce((Ue,_e)=>Ue+xp(_e),0),at;if(G.kind==="columnDivider"){let Ue=le.topology.gridColumns.find(Je=>Je.id===G.leftGridColumnId),_e=le.topology.gridColumns.find(Je=>Je.id===G.rightGridColumnId);if(!Ue||!_e)return;oe=xp(Ue),ae=xp(_e),at=OD(G.sourceRevision,Y,G.leftGridColumnId,G.rightGridColumnId);}else if(G.kind==="rightEdge"){let Ue=le.topology.gridColumns.find(_e=>_e.id===G.gridColumnId);if(!Ue)return;oe=xp(Ue),ae=0,at=MD(G.sourceRevision,Y,G.gridColumnId);}else xe=Math.max(20,Math.round(Y.row.box.height*AD)),at=yv(G.sourceRevision,Y);let we=F.currentTarget;we.setPointerCapture(F.pointerId),d=F.clientX,u=F.clientY,l={pointerId:F.pointerId,startClientX:F.clientX,startClientY:F.clientY,startEdgePt:G.kind==="rowDivider"?G.edgeY:G.edgeX,leftTwips:oe,rightTwips:ae,tableWidthTwips:Se,rowHeightTwips:xe,target:G,ref:Y,resizeTarget:at,captureElement:we,rightEdge:G.kind==="rightEdge",vertical:G.kind==="rowDivider",cancelled:false};for(let Ue of [...t.children])Ue!==we&&Ue.remove();R(G.kind==="rowDivider"?G.edgeY:G.edgeX,G);}function ee(){if(l){try{l.captureElement.hasPointerCapture(l.pointerId)&&l.captureElement.releasePointerCapture(l.pointerId);}catch{}l.cancelled=true,l=null,v(),o=null;}}function J(){if(!l||l.cancelled){l=null,v();return}let F=l;l=null;try{F.captureElement.hasPointerCapture(F.pointerId)&&F.captureElement.releasePointerCapture(F.pointerId);}catch{}if(F.vertical?u===F.startClientY:d===F.startClientX){v();return}let U=e.read(),G=bv(U),Y=(F.vertical?u-F.startClientY:d-F.startClientX)/e.scale(),le=Math.round(Y*AD),oe;if(F.target.kind==="rowDivider")oe=ME({part:Oo(e.session(),F.target.tableId),layout:U.layout,storeRevision:U.storeRevision,selection:U.selection,cellSelection:U.cellSelection,themeColors:U.themeColors,...G},F.resizeTarget,Math.max(LD(F.rowHeightTwips),F.rowHeightTwips+le));else if(F.rightEdge&&F.target.kind==="rightEdge"){let ae=Math.max(300,F.leftTwips+le),xe=Math.max(ae,F.tableWidthTwips+le);oe=Tr({command:{type:"commitTableRightEdgeResize",target:F.resizeTarget,columnWidthTwips:ae,tableWidthTwips:xe},part:Oo(e.session(),F.target.tableId),layout:U.layout,storeRevision:U.storeRevision,selection:U.selection,cellSelection:U.cellSelection,themeColors:U.themeColors,...G});}else if(F.target.kind==="columnDivider"){let ae=F.leftTwips+le,xe=F.rightTwips-le;ae=Math.max(300,ae),xe=Math.max(300,xe);let Se=F.leftTwips+F.rightTwips;ae+xe!==Se&&(ae>Se-300?(ae=Se-300,xe=300):xe=Se-ae),oe=Tr({command:{type:"commitTableColumnDividerResize",target:F.resizeTarget,leftWidthTwips:ae,rightWidthTwips:xe},part:Oo(e.session(),F.target.tableId),layout:U.layout,storeRevision:U.storeRevision,selection:U.selection,cellSelection:U.cellSelection,themeColors:U.themeColors,...G});}else {v();return}e.applyTableCommandPlan(oe),v();}function fe(F){if(!f)return null;i??=Ff$2(F.layout);let U=e.pageOffsetX(f.pageIndex);return Jf$1(i,f.x,f.y,F.layout,U,f.pageIndex)}function se(F){if(!o||l||F.editingMode==="view")return;S();let U=fe(F),G=Zb(e.session(),U,F.selection.head.paragraphId);if(!G){o=null,v();return}if(Hf$1(G)!==Hf$1(o)){o=null,v();return}o=G,q(G,F);}function B(){let F=p??h(),U=F!==null&&t.ownerDocument.activeElement===F;x(),F&&t.contains(F)&&F.remove(),U&&e.pagesLayer.focus({preventScroll:true});}function D(F){if(l||F.editingMode==="view")return;let U=p??h();if(!U||!t.contains(U)){g&&x();return}if(p=U,!g||g.kind!=="insertRow"&&g.kind!=="insertColumn")return;i??=Ff$2(F.layout);let G=Hf$1(g),Y=If$1(i,g);if(!Y||Hf$1(Y)!==G){B();return}g=Y,$(Y,F);}function j(F){let U=e.read();if(l&&F.pointerId===l.pointerId){d=F.clientX,u=F.clientY;let xe=(l.vertical?F.clientY-l.startClientY:F.clientX-l.startClientX)/e.scale();l.target.kind==="rowDivider"&&(xe=Math.max(xe,(LD(l.rowHeightTwips)-l.rowHeightTwips)/20));for(let Se of [...t.children])Se!==l.captureElement&&Se.remove();R(l.startEdgePt+xe,l.target);return}if(U.editingMode==="view"){k(false);return}if(wo(F.target)&&p?.contains(F.target)){S();return}let G=cU(e,F.clientX,F.clientY),Y=we(U.layout,G.y);Y>=0&&(f={x:G.x,y:G.y,pageIndex:Y});let le=Y>=0?e.pageOffsetX(Y):0;i??=Ff$2(U.layout);let oe=i?Jf$1(i,G.x,G.y,U.layout,le,Y>=0?Y:void 0):null,ae=Zb(e.session(),oe,U.selection.head.paragraphId);if(!ae){if(c)return;n.migrate(),!r&&o&&(r=n.setTimeout(()=>{r=null,o=null,v();},lU));return}r&&(n.clearTimeout(r),r=null),!(o&&Gf$2(ae)===Gf$2(o))&&(o=ae,q(ae,U));}function H(F){if(!(!l||F.pointerId!==l.pointerId)){if(e.read().editingMode==="view"){ee();return}J();}}function N(F){!l||F.pointerId!==l.pointerId||ee();}function z(F){F.key!=="Escape"||!l||ee();}e.pagesLayer.addEventListener("pointermove",j);let X=[e.listeners.onDocument("pointermove",j),e.listeners.onDocument("pointerup",H),e.listeners.onDocument("pointercancel",N)];return e.pagesLayer.addEventListener("keydown",z),{update(){let F=e.read(),U=a,G=s;i=null,a=F.layout.revision,s=F.storeRevision,F.editingMode==="view"?(ee(),o=null,S(),k(true)):U!==null&&(U!==F.layout.revision||G!==F.storeRevision)&&(o!==null&&se(F),D(F)),t.style.width=e.pagesLayer.style.width,t.style.height=e.pagesLayer.style.height;},cancelDrag:ee,refreshLabels(){let F=e.read();if(F.editingMode==="view")return;let U=p??h();if(U&&t.contains(U)&&g&&(g.kind==="insertRow"||g.kind==="insertColumn")){$(g,F);return}o&&(o.kind==="insertRow"||o.kind==="insertColumn")&&$(o,F);},destroy(){S(),ee(),x(),v(),e.pagesLayer.removeEventListener("pointermove",j);for(let F of X)F();e.pagesLayer.removeEventListener("keydown",z),t.remove();}}}var Sp={},DD=new WeakMap;function dU(e,t){let n=DD.get(e??Sp);n||DD.set(e??Sp,n=new WeakMap);let r=n.get(t??Sp);return r||(r=mf$1(e,void 0,t),n.set(t??Sp,r)),r}function ND(e,t,n=null){return nf$1(dU(t,n),bi(e,"paragraphProperties","pPr")).markRunProperties}var uU=e=>e==="left"||e==="center"||e==="right"||e==="both";function HD(e,t){if(!t.some(r=>r.localName==="bidi"))return e;let n=e.map(r=>r.localName).lastIndexOf("bidi");return n===-1?e:e.filter((r,o)=>o!==n)}function wp(e,t,n,r=n){let o=()=>xf$1([...t,...n]);if(e.paragraphDirection!==void 0&&e.localName==="bidi"){let a=e.paragraphDirection==="rtl";return o()===a?null:a?xf$1(HD(t,r))?{localName:"bidi",remove:true}:{localName:"bidi"}:xf$1(HD(t,r))?{localName:"bidi",attributes:{val:"0"}}:{localName:"bidi",remove:true}}let i=e.attributes?.val;return !e.physicalAlignment||e.localName!=="jc"||!uU(i)?e:{localName:"jc",attributes:{val:Ed(i,o())}}}function _D(e){let{runPropertyEdits:t,mergedParagraphMarkProperties:n}=c(()=>e.session.stylesRoot(),()=>e.session.settingsRoot(),()=>e.displayMode(),()=>e.authorFilter()),{session:r,commit:o,orderedRange:i,selectionMark:a,textOf:s}=e,l=()=>e.displayMode(),c$1=()=>e.authorFilter(),d=()=>r.partFor(e.storyScope())??r.part(),u=R=>{let{anchor:O,head:C}=R;if(O.paragraphId!==C.paragraphId||O.offset!==C.offset)return {selection:R,caretSpan:true};let w=eb$1(d(),C.paragraphId);if(w?.kind!=="paragraph")return {selection:R,caretSpan:true};let T=wi(w,C.offset)!==void 0,$=T?yi(w,C.offset):pi(w,C.offset);if($===void 0)return {selection:R,caretSpan:!T};if($===null&&T){let q=ND(w,r.stylesRoot(),r.settingsRoot());return {selection:R,caretSpan:false,markFace:q}}if($===null)return {selection:R,caretSpan:false};let W=$.end<=C.offset?$.end-1:$.start;return {selection:{anchor:{paragraphId:C.paragraphId,offset:W},head:{paragraphId:C.paragraphId,offset:W+1}},caretSpan:true}},f=R=>{let O=R?.ascii;return !O||R.hAnsi!==O||Object.keys(R).length!==2?R:oe(O)?{...R,eastAsia:O}:R},p=(R,O,C)=>{let w=T=>r.applyTreeOps(T,O,C,e.storyScope());return e.applyOutsideToc?e.applyOutsideToc(R,w):w(R)},g=()=>{let R=e.runFormatRefusal?.();return R?e.commit(()=>({committed:false,rejected:true,opCount:0,reason:R}))??R:null},y={get value(){return e.layout()}},h={get value(){return e.selection()}},b=(R,O,C)=>{let w=d();if(R.paragraphId===O.paragraphId){let K=t(w,R.paragraphId,R.offset,O.offset,C,l(),c$1());if(K.length===0)return null;let Z=n(w,R.paragraphId,C);return o(()=>p([...K.map(M=>({op:"setRunProperties",paragraphId:R.paragraphId,start:M.start,end:M.end,properties:M.properties,...M.targetRunIds?{targetRunIds:M.targetRunIds}:{}})),...e.paragraphMarkVisible(R.paragraphId)?xM(s(R.paragraphId),R,O,Z):[]],a()))}let T=e.paragraphOrder(),$=T.indexOf(R.paragraphId),W=T.indexOf(O.paragraphId);if($===-1||W===-1)return null;let q=[];for(let K=$;K<=W;K+=1){let Z=T[K],M=s(Z),ee=K===$?R.offset:0,J=K===W?O.offset:M.length,fe=ee<J?t(w,Z,ee,J,C,l(),c$1()):[];for(let B of fe)q.push({op:"setRunProperties",paragraphId:Z,start:B.start,end:B.end,properties:B.properties,...B.targetRunIds?{targetRunIds:B.targetRunIds}:{}});(K<W||ee===0&&J===M.length&&M.length>0)&&e.paragraphMarkVisible(Z)&&q.push({op:"setParagraphMarkProperties",paragraphId:Z,properties:n(w,Z,C)});}return q.length===0?null:o(()=>p(q,a()))},x=(R,O)=>{let C=d(),w=[];for(let T of ma$2(y.value,R)){let $=s(T);for(let W of t(C,T,0,$.length,O,l(),c$1()))w.push({op:"setRunProperties",paragraphId:T,start:W.start,end:W.end,properties:W.properties,...W.targetRunIds?{targetRunIds:W.targetRunIds}:{}});e.paragraphMarkVisible(T)&&w.push({op:"setParagraphMarkProperties",paragraphId:T,properties:n(C,T,O)});}return w.length===0?null:o(()=>p(w,a()),void 0,{keepCellSelection:true})},S=R=>{ai$1(R.localName)&&e.setPendingFormats(fi(e.pendingFormats()??[],R));},v=(R,O)=>R.paragraphId===O.paragraphId&&R.offset===O.offset&&s(R.paragraphId).length===0&&e.paragraphMarkVisible(R.paragraphId)&&!e.pendingFormats()?.length?R.paragraphId:null,k=(R,O)=>{let C=d(),w=n(C,R,O);return JSON.stringify(w)===JSON.stringify(ei$1(C,R))?null:o(()=>p([{op:"setParagraphMarkProperties",paragraphId:R,properties:w}],a()))},E=(R,O)=>{if(R.paragraphId!==O.paragraphId||R.offset!==O.offset||e.pendingFormats()?.length)return null;let C=Sf(d(),R.paragraphId,s(R.paragraphId).length,l(),c$1()),w=jy(y.value,R.paragraphId,R.offset,C);return w?{from:{paragraphId:R.paragraphId,offset:w.start},to:{paragraphId:R.paragraphId,offset:w.end}}:null},I=R=>{if(R.length===0)return;let O=e.selectedCells?.(),C=O&&O.length>0?[...ma$2(y.value,O)]:null,{from:w,to:T}=i(),$=C??e.paragraphOrder(),W=C?0:$.indexOf(w.paragraphId),q=C?$.length-1:$.indexOf(T.paragraphId);if(W===-1||q===-1)return;let K=d(),Z=$.slice(W,q+1).filter(M=>e.paragraphMarkVisible(M)).flatMap(M=>{let ee=di$1(K,M),J=ee,fe=zn(y.value,M),se=false;for(let B of R){let D=wp(B,fe,J,ee);if(!D)continue;if(se=true,D.remove){J=J.filter(N=>N.localName!==D.localName);continue}let j=D.mergeAttributes?{...J.find(N=>N.localName===D.localName)?.attributes??{},...D.attributes}:D.attributes??{},H=Object.fromEntries(Object.entries(j).filter(([,N])=>N!=null));J=fi(J,{localName:D.localName,...Object.keys(H).length>0?{attributes:H}:{}});}return se?[{op:"setParagraphProperties",paragraphId:M,properties:J}]:[]});Z.length!==0&&o(()=>p(Z,a()),void 0,{keepCellSelection:C!==null});};return {setRunProperty(R,O){let C=g();if(C)return C;let w=R==="rFonts"?f(O):O,T={localName:R,...w?{attributes:w}:{}},$=e.selectedCells?.();if($&&$.length>0)return x($,T);let{from:W,to:q}=i(),K=v(W,q);if(K)return k(K,T);let Z=R==="highlight"?null:E(W,q);return Z?b(Z.from,Z.to,T):W.paragraphId===q.paragraphId&&W.offset===q.offset?(S(T),null):b(W,q,T)},setParagraphProperty(R,O,C){I([{localName:R,...O?{attributes:O}:{},...C??{}}]);},setParagraphProperties:I,formatting:()=>{let R=u(h.value);return yM(vM(y.value,R.selection,(O,C)=>{let w=r.effectiveRunDefaults(O,C);if(w.fontFamily!==null)return w;let T=e.defaultFontFamily?.()??null;return T===null?w:{...w,fontFamily:T}},e.selectedCells?.(),e.defaultParagraphStyleId?.()??null,h.value.anchor.paragraphId===h.value.head.paragraphId?[h.value.head.paragraphId]:e.paragraphOrder(),e.defaultFontFamily?.()??null,R.caretSpan),fi(R.markFace??[],e.pendingFormats()??[]))},toggleRunProperty(R,O){let C=g();if(C)return C;let w=e.selectedCells?.(),T=O?.val,$=u(h.value),{from:W,to:q}=i(),K=w&&w.length>0?null:E(W,q),Z=$.caretSpan?bM(y.value,$.selection,R,w,T,e.paragraphOrder()):oa($.markFace??null,R,T)===true,M=oa(e.pendingFormats(),R,T)??Z,ee=M?{localName:R,attributes:{val:fU[R]??"0"}}:{localName:R,...O?{attributes:O}:{}};if(w&&w.length>0)return x(w,ee);let J=v(W,q);if(J)return k(J,ee);if(K)return b(K.from,K.to,ee);if(W.paragraphId===q.paragraphId&&W.offset===q.offset){let fe=e.pendingFormats()??[];if(!M===Z){let se=fe.filter(B=>B.localName!==R);e.setPendingFormats(se.length>0?se:null);}else S(ee);return null}return b(W,q,ee)},clearFormatting(){if(g())return;e.setPendingFormats(null);let R=y.value,O=e.paragraphOrder(),C=e.selectedCells?.(),w=C&&C.length>0?[...ma$2(R,C)]:$f(O,i());if(w.length===0)return;let T=C!==void 0&&C.length>0,$=i(),{from:W,to:q}=!T&&E($.from,$.to)||$,K=d(),Z=[];for(let M of w){let ee=s(M),J=T||M!==W.paragraphId?0:W.offset,fe=T||M!==q.paragraphId?ee.length:q.offset;for(let D of si$1(K,M,J,fe,l(),c$1()))hM(K,M,D.start,D.end,l(),c$1())&&Z.push({op:"setRunProperties",paragraphId:M,start:D.start,end:D.end,properties:[]});e.paragraphMarkVisible(M)&&ei$1(K,M).length>0&&Z.push({op:"setParagraphMarkProperties",paragraphId:M,properties:[]});let se=di$1(K,M),B=se.filter(D=>D.localName==="bidi");e.paragraphMarkVisible(M)&&se.length>B.length&&Z.push({op:"setParagraphProperties",paragraphId:M,properties:B});}Z.length!==0&&o(()=>p(Z,a()),void 0,{keepCellSelection:T});}}}var fU={u:"none",vertAlign:"baseline"};var BD=500;function pU(e){let t=l=>({val:l?"1":"0"}),n=l=>String(Math.max(2,Math.min(3276,Math.round(l*2)))),r=e.latinLane??e,o=e.complexLane??e,i=n(r.fontSizePt),a=[{localName:"b",attributes:t(r.bold)},{localName:"i",attributes:t(r.italic)},{localName:"bCs",attributes:t(o.bold)},{localName:"iCs",attributes:t(o.italic)},{localName:"u",attributes:{val:e.underline?e.underline.variant:"none",color:e.underline?.color??"auto",themeColor:"none"}},{localName:"strike",attributes:t(e.strike)},{localName:"dstrike",attributes:t(e.doubleStrike)},{localName:"caps",attributes:t(e.caps)},{localName:"smallCaps",attributes:t(e.smallCaps)},{localName:"vertAlign",attributes:{val:e.verticalAlign}},{localName:"color",attributes:{val:e.color??"auto"}},{localName:"highlight",attributes:{val:e.highlight??"none"}},{localName:"sz",attributes:{val:i}},{localName:"szCs",attributes:{val:n(o.fontSizePt)}},{localName:"spacing",attributes:{val:String(Math.round(e.characterSpacingPt*20))}},{localName:"position",attributes:{val:String(Math.round(e.baselineShiftPt*2))}},{localName:"w",attributes:{val:String(Math.round(e.horizontalScalePercent))}},{localName:"kern",attributes:{val:String(Math.round(e.kerningMinPt*2))}}],s=e.complexLane?.fontFamily??null;return (r.fontFamily||r.fontFamilyEastAsia||s)&&a.push({localName:"rFonts",attributes:{...r.fontFamily?{ascii:r.fontFamily,hAnsi:r.fontFamily}:{},...r.fontFamilyEastAsia?{eastAsia:r.fontFamilyEastAsia}:{},...s?{cs:s}:{}}}),a}function $D(e){let{runPropertyEdits:t,mergedParagraphMarkProperties:n}=c(()=>e.session.stylesRoot(),()=>e.session.settingsRoot(),()=>e.displayMode(),()=>e.authorFilter()),r=e.session,o=()=>r.partFor(e.storyScope())??r.part(),i="off",a=null,s=null,l=null,c$1=nf,d=()=>{let x=a===null?"none":a.paragraphProperties?"paragraph":"run";return (c$1.mode!==i||c$1.level!==x)&&(c$1={mode:i,level:x}),c$1},u=(x,S,v)=>{if(v||x.paragraphId!==S.paragraphId||x.offset===S.offset)return true;let k=e.textOf(x.paragraphId);return x.offset===0&&S.offset===k.length&&k.length>0},f=()=>{let x=e.selectedCells?.(),S=x!==void 0&&x.length>0,{from:v,to:k}=e.orderedRange();if(!e.paragraphOrder().includes(v.paragraphId))return false;let E=Wf(e.layout(),e.selection(),x,e.paragraphOrder()),I=u(v,k,S)?di$1(o(),v.paragraphId):null;return !E&&I===null?false:(a={runProperties:E?pU(E):[],paragraphProperties:I},true)},p=()=>f()?(e.publish(),true):false,g=()=>{let x=a;if(!x)return {wrote:false,armed:false,built:false};let S=e.selectedCells?.(),v=S!==void 0&&S.length>0,{from:k,to:E}=e.orderedRange(),I=!v&&k.paragraphId===E.paragraphId&&k.offset===E.offset,R=I?Df(e.layout(),k,Me(e.layout(),k.paragraphId),"after",Ky(e.layout(),k.paragraphId,Sf(o(),k.paragraphId,e.textOf(k.paragraphId).length,e.displayMode(),e.authorFilter()))):null,O=R?.from??k,C=R?.to??E,w=I&&O.offset===C.offset,T=v?[...ma$2(e.layout(),S)]:$f(e.paragraphOrder(),{from:O,to:C});if(T.length===0)return {wrote:false,armed:false,built:false};let $=o(),W=e.displayMode(),q=[];for(let ee of T){let J=e.textOf(ee),fe=v||ee!==O.paragraphId?0:O.offset,se=v||ee!==C.paragraphId?J.length:C.offset;if(fe<se&&x.runProperties.length>0)for(let j of t($,ee,fe,se,x.runProperties,W,e.authorFilter()))q.push({op:"setRunProperties",paragraphId:ee,start:j.start,end:j.end,properties:j.properties,...j.targetRunIds?{targetRunIds:j.targetRunIds}:{}});let B=x.paragraphProperties!==null||v||ee!==C.paragraphId||fe===0&&se===J.length&&J.length>0,D=e.paragraphMarkVisible(ee);B&&D&&x.runProperties.length>0&&q.push({op:"setParagraphMarkProperties",paragraphId:ee,properties:n($,ee,x.runProperties)}),x.paragraphProperties&&D&&q.push({op:"setParagraphProperties",paragraphId:ee,properties:[...x.paragraphProperties]});}let K=r.packageRevision();q.length>0&&e.commit(()=>r.applyTreeOps(q,e.selectionMark(),void 0,e.storyScope()),void 0,{keepCellSelection:v});let Z=r.packageRevision()!==K,M=w&&x.runProperties.length>0&&(Z||q.length===0);return M&&e.armPendingFormats(x.runProperties),{wrote:Z,armed:M,built:q.length>0}},y=()=>{let x=g();return x.wrote&&i==="once"&&b(),x.wrote?"painted":x.armed?"armed":x.built?"refused":"nothingToPaint"},h=()=>{i!=="off"&&(i="off",e.publish());},b=()=>{s=null,l=null,h();};return {state:d,capture:p,apply:y,disarm:b,press(){let x=e.now(),S=s!==null&&x-s<BD,v=i;s=x;let k=()=>(s=null,false);return v==="once"&&S?f()?(i="locked",e.publish(),true):(h(),k()):v!=="off"?(h(),l=v==="locked"?x:null,true):l!==null&&x-l<BD?(l=null,true):f()?(i="once",l=null,e.publish(),true):k()},applyIfArmed(){i==="off"||a===null||g().wrote&&i==="once"&&b();}}}var WD=new WeakMap;function mU(e){let t=WD.get(e);if(t!==void 0)return t;let n=[e],r=false;for(;n.length>0&&!r;){let o=n.pop();if(o.kind!=="textValue"){(o.localName==="bidi"||o.localName==="rtl")&&(r=true);for(let i of o.children)n.push(i);}}return WD.set(e,r),r}function qD(e,t=()=>null){let n=null;return {keydown(r){if(r.key==="Shift"&&(r.location===1||r.location===2)&&r.ctrlKey&&!r.altKey&&!r.metaKey&&!r.isComposing&&!r.defaultPrevented){n=r.location===2?"rtl":"ltr";return}r.key!=="Control"&&(n=null);},keyup(r){if(n===null||r.key!=="Shift"&&r.key!=="Control")return;let o=n;if(n=null,r.defaultPrevented)return;let i=t();i===null||!mU(i)||e.setParagraphProperties([{localName:"bidi",paragraphDirection:o}]);},disarm(){n=null;}}}function KD(e,t){return e.addEventListener("keyup",t.keyup),e.addEventListener("pointerdown",t.disarm,{capture:true}),e.addEventListener("focusout",t.disarm),()=>{e.removeEventListener("keyup",t.keyup),e.removeEventListener("pointerdown",t.disarm,{capture:true}),e.removeEventListener("focusout",t.disarm);}}function gU(e,t){let n=Math.max(e.x,t.x),r=Math.max(e.y,t.y),o=Math.min(e.x+e.width,t.x+t.width),i=Math.min(e.y+e.height,t.y+t.height);return o<=n||i<=r?0:(o-n)*(i-r)}function hU(e,t){return gU(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 eo(e,t,n){if(t.paragraphId===n.paragraphId)return t.offset-n.offset;let r=eb$2(e);return r.indexOf(t.paragraphId)-r.indexOf(n.paragraphId)}function jD(e,t,n){if(!(t>re))for(let r of e){if(r.kind==="paragraph"){n(r);continue}if(!(t>=re)){for(let o of r.rows)if(!o.isHeaderRepeat)for(let i of o.cells)jD(i.blocks,t+1,n);}}}function xv(e,t){if(t.range){let{paragraphId:o,start:i,end:a}=t.range;return {from:{paragraphId:o,offset:i},to:{paragraphId:o,offset:a}}}if(t.level==="inline"||t.fragments.length===0)return null;let n=null,r=null;for(let o of t.fragments){let i=e.pages[o.pageIndex];i&&jD(i.fragments,0,a=>{if(!hU(o.box,a.box))return;let s={paragraphId:a.paragraphId,offset:0},l={paragraphId:a.paragraphId,offset:Ve(e,a.paragraphId).length};(!n||eo(e,s,n)<0)&&(n=s),(!r||eo(e,l,r)>0)&&(r=l);});}return n&&r?{from:n,to:r}:null}function Cs(e,t){return t.placeholder?xv(e,t):null}function VD(e){return !e.placeholder&&e.level==="inline"&&e.range!==void 0&&(e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked")}function yU(e){return e.placeholder}var UD=new WeakMap;function bU(e,t){let n=UD.get(e);if(!n){n=new Map;for(let r of e.contentControls??[]){if(!VD(r))continue;let o=xv(e,r),i=n.get(o.from.paragraphId)??[];i.push(o),n.set(o.from.paragraphId,i);}UD.set(e,n);}return n.get(t)??[]}function Sv(e,t){let n=null;for(let r of bU(e,t.paragraphId))t.offset<=r.from.offset||t.offset>=r.to.offset||(!n||r.from.offset<n.from.offset||r.from.offset===n.from.offset&&r.to.offset>n.to.offset)&&(n=r);return n}function GD(e,t,n){let r=Sv(e,n);if(!r)return n;let o=t.paragraphId===n.paragraphId?n.offset-t.offset:0;if(o>0)return r.to;if(o<0)return r.from;let i=(r.from.offset+r.to.offset)/2;return n.offset<i?r.from:r.to}function Wc(e,t,n={}){let r=e.contentControls??[];if(r.length===0)return t;let o=eo(e,t.anchor,t.head)<=0,i=o?t.anchor:t.head,a=o?t.head:t.anchor,s=true;for(;s;){s=false;for(let l of r){let c=n.atomic===true&&VD(l);if(!l.placeholder&&!c)continue;let d=xv(e,l);if(!d)continue;let u=eo(e,i,a)===0,f=eo(e,i,d.from);(u?(yU(l)?f>=0:f>0)&&eo(e,i,d.to)<0:eo(e,i,d.to)<0&&eo(e,a,d.from)>0)&&(eo(e,d.from,i)<0&&(i=d.from,s=true),eo(e,d.to,a)>0&&(a=d.to,s=true));}}return o?{anchor:i,head:a}:{anchor:a,head:i}}function xU(e,t){return (e.contentControls??[]).find(n=>n.id===t)??null}function wv(e,t){let n=t.contentControlId;if(!n){let o={x:t.caret.x,y:t.caret.y+t.caret.height/2},i=Ce(e,t.pageIndex,o);return i?.placeholder?i:null}let r=xU(e,n);return r?.placeholder?r:null}var SU=new Set(["dropdown","comboBox","date","buildingBlockGallery"]);function zD(e,t={}){if(t.mode==="native")return {dragging:()=>false,cancelGesture:()=>{},destroy:()=>{}};let{pagesLayer:n}=e,r=t.atomicInlineControls===true,o=nt(()=>n),i=null,a=null,s=null,l=0,c=0,d=0,u=0,f=null;function p(H,N){if(!s){let X=n.getBoundingClientRect();s={left:X.left,top:X.top};}let z=e.scale()||1;return {x:(H-s.left)/z,y:(N-s.top)/z}}function g(H){return {scope:{kind:"headerFooter",rId:H.rId},pageIndex:H.pageIndex,kind:H.kind,partName:H.partName,variant:H.variant}}function y(H,N){let z=e.layout(),X=p(H,N),F=we(z,X.y),U=z.pages[F];if(!U)return null;let G=e.measurer();return ze(z,F,{x:X.x-U.contentBox.x-e.pageOffsetX(F),y:X.y-U.contentBox.y},G?{measurer:G}:{})}function h(H,N){let z=e.activeNote?.()??null;if(z){let Y=e.layout(),le=Qu(Y,p(H,N),e.pageOffsetX);if(!le||le.scopeId!==z.scopeId)return null;let oe=e.measurer();return Ae$1(Y,le.pageIndex,le.fragments,le.local,{...oe?{measurer:oe}:{}})}let X=e.activeHeaderFooter?.()??null;if(!X)return y(H,N);let F=e.layout(),U=p(H,N),G=Ch(F,U,e.pageOffsetX);if(G&&Xu(G.story,g(X))){let Y=e.measurer();return Rh(F,G.pageIndex,G.story,G.local,Y?{measurer:Y}:{})}return null}function b(H,N){let{story:z,pageIndex:X,kind:F}=H;return {rId:z.rId,pageIndex:X,kind:F,partName:z.partName,variant:z.variant,...N?{position:N}:{}}}function x(H){let N=e.measurer();return Rh(e.layout(),H.pageIndex,H.story,H.local,N?{measurer:N}:{})?.position??void 0}let S=new WeakMap;function v(H,N){let z=e.activeNote?.();if(z){let G=ss(H,null,z.scopeId).indexOf(N);return G===-1?-1:G}let X=e.activeHeaderFooter?.();if(X){let G=ss(H,g(X)).indexOf(N);return G===-1?-1:G}let F=S.get(H);return F||(F=new Map(eb$2(H).map((U,G)=>[U,G])),S.set(H,F)),F.get(N)??-1}function k(H,N,z){let X=v(H,N.paragraphId),F=v(H,z.paragraphId);return X!==F?X<F:N.offset<z.offset}function E(H,N,z,X=null){if(z==="character")return {from:N,to:N};let F=N.paragraphId;if(z==="paragraph"){let G=Ve(H,F);return {from:{paragraphId:F,offset:0},to:{paragraphId:F,offset:G.length}}}let U=Ne(H,N,X);return Df(H,N,Le(H,F),U)}function I(H,N,z,X,F){let U=F?wv(H,F):null,G=U?Cs(H,U)??E(H,z,X,F?.contentControlId):E(H,z,X,F?.contentControlId),Y=k(H,G.from,N.from)?{anchor:N.to,head:G.from}:{anchor:N.from,head:G.to};return Wc(H,Y,{atomic:r})}function R(){return e.container.closest(".docx-editor__scroll-container")}function O(){f!==null&&(o.cancelAnimationFrame(f),f=null);}function C(){f=null;let H=a,N=R();if(!H||!N)return;let z=N.getBoundingClientRect(),X=dp(z.top,z.bottom,H.clientY);X!==0&&(N.scrollTop+=X,s=null,T(H.clientX,H.clientY),f=o.requestAnimationFrame(C));}function w(){if(f!==null||!a)return;let H=R();if(!H)return;let N=H.getBoundingClientRect();dp(N.top,N.bottom,a.clientY)!==0&&(f=o.requestAnimationFrame(C));}function T(H,N){let z=a;if(!z)return;let X=h(H,N);X&&((e.isReadOnlyPosition?.(X.position)??e.isReadOnlyParagraph?.(X.position.paragraphId))||$(z,X)||(z.caret=X.caret,e.setSelection(I(e.layout(),z.anchorRange,X.position,z.granularity,X),X.caret)));}function $(H,N){let z=H.anchorCell;if(!z)return false;if(!N.cell||N.cell.tableId!==z.tableId)return H.cellDragging;if(!H.cellDragging&&N.cell.cellId===z.cellId)return false;let X=ia$1(e.layout(),z,N.cell);return X?(H.cellDragging=true,e.setCellSelection(X),true):H.cellDragging}function W(H){let N=Date.now(),z=N-c;return l=Math.abs(H.clientX-d)<=4&&Math.abs(H.clientY-u)<=4&&z>=0&&z<=500?l+1:1,c=N,d=H.clientX,u=H.clientY,l}let q=["character","word","paragraph"],K="[data-docx-hf], [data-docx-cc-widget], [data-docx-note-ref], [data-drawing-paragraph-id], .docx-image-selection-overlay, .docx-drawing-textbox, input, textarea, select",Z=H=>H.button===0&&H.ctrlKey&&!H.metaKey&&isApplePlatform();function M(H){if(H.pointerType==="touch"||H.button!==2&&!Z(H)||e.activeHeaderFooter?.()||e.activeNote?.()||H.target?.closest?.(K))return;let z=e.layout();if(!Yu(z,p(H.clientX,H.clientY),e.pageOffsetX))return;let X=y(H.clientX,H.clientY);if(!X||(e.isReadOnlyPosition?.(X.position)??e.isReadOnlyParagraph?.(X.position.paragraphId)))return;let F=e.selection(),U=k(z,F.head,F.anchor),G=U?F.head:F.anchor,Y=U?F.anchor:F.head;if(!k(z,X.position,G)&&!k(z,Y,X.position))return;e.focus();let le=wv(z,X);if(le){if(e.selectContentControl?.(le.id))return;let oe=Cs(z,le);if(oe){e.setSelection({anchor:oe.from,head:oe.to});return}}e.setSelection({anchor:X.position,head:X.position},X.caret);}let ee=H=>{if(Z(H)){H.target?.closest?.("input, textarea, select")||H.preventDefault(),M(H);return}if(H.button!==0){M(H);return}if(e.onChangeBarToggle&&H.target?.closest?.("[data-docx-change-bar-toggle]")){H.preventDefault(),H.stopPropagation(),e.onChangeBarToggle();return}let N=H.target?.closest?.("[data-docx-cc-widget]");if(N){if(H.preventDefault(),H.stopPropagation(),N.hasAttribute("disabled")||N.dataset.disabledReason)return;let $e=N.dataset.docxCcId,lt=N.dataset.docxCcWidget;$e&<&&e.onContentControlWidget?.($e,lt);return}if(H.pointerType==="touch")return;a&&B(),s=null;let z=e.layout(),X=p(H.clientX,H.clientY),F=e.activeHeaderFooter?.()??null,U=e.activeNote?.()??null,G=Ch(z,X,e.pageOffsetX),Y=G!==null&&qT(z,G,X,e.pageOffsetX,F!==null&&Xu(G.story,g(F)),e.measurer()),le=RM(H)||H.target?.closest('.docx-drawing-textbox[data-docx-textbox-active="true"]'),oe=Y||le?null:G,ae=Qu(z,X,e.pageOffsetX),xe=Y||le?null:H.target?.closest("[data-docx-hf]"),Se=!!(xe||oe),at=H.target,we=at?.closest("[data-docx-note-ref]"),Ue=at?.closest("[data-docx-note-mark-back]"),_e=null,Je=()=>_e??=W(H);if(we?.dataset.docxNoteScope){H.preventDefault(),e.focus(),e.enterNote?.(we.dataset.docxNoteScope);return}if(Ue){H.preventDefault(),e.focus(),e.exitNote?.(true);return}if(ae&&!Se){let $e=e.measurer?.(),lt=Ae$1(z,ae.pageIndex,ae.fragments,ae.local,{...$e?{measurer:$e}:{}});if(!U||U.scopeId!==ae.scopeId){H.preventDefault(),e.focus(),e.enterNote?.(ae.scopeId,lt?{paragraphId:lt.position.paragraphId,offset:lt.position.offset}:void 0,ae.pageIndex);return}if(U.pageIndex!==ae.pageIndex){H.preventDefault(),e.focus(),e.enterNote?.(ae.scopeId,lt?{paragraphId:lt.position.paragraphId,offset:lt.position.offset}:void 0,ae.pageIndex);return}}else if(U){if(!Yu(z,X,e.pageOffsetX))return;e.exitNote?.(false),e.focus();}if(F)if(oe&&Xu(oe.story,g(F)))oe.pageIndex!==F.pageIndex&&e.enterHeaderFooter?.(b(oe,x(oe)));else if(oe&&oe.story.rId){H.preventDefault(),e.focus(),e.enterHeaderFooter?.(b(oe,x(oe)));return}else if(Yu(z,X,e.pageOffsetX)){H.preventDefault(),e.exitHeaderFooter?.(true),e.focus();return}else {let $e=Je()>=2?Eh(z,X,e.pageOffsetX):null;$e&&(H.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.($e.kind,$e.pageIndex));return}else if(Se&&Je()>=2){if(oe?.story.rId)H.preventDefault(),e.focus(),e.enterHeaderFooter?.(b(oe,x(oe)));else if(Gr(xe)){let $e=xe.dataset.docxRId,lt=xe.dataset.docxHf,Mt=xe.closest("[data-page-index]")?.getAttribute("data-page-index"),_t=Mt!=null?Number(Mt):NaN;if((lt==="header"||lt==="footer")&&Number.isInteger(_t))if($e){let mr=z.pages[_t]?.[lt];H.preventDefault(),e.focus(),e.enterHeaderFooter?.({rId:$e,pageIndex:_t,kind:lt,partName:mr?.partName??"",variant:mr?.variant??"default"});}else z.pages[_t]?.[lt]||(H.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.(lt,_t));}return}else if(Je()>=2&&!le){let $e=Eh(z,X,e.pageOffsetX);if($e){H.preventDefault(),e.focus(),e.enterEmptyHeaderFooter?.($e.kind,$e.pageIndex);return}}let et=h(H.clientX,H.clientY);if(!et)return;if(e.isReadOnlyPosition?.(et.position)??e.isReadOnlyParagraph?.(et.position.paragraphId)){H.preventDefault();return}if(Je()===2&&e.onTextFormDoubleClick?.(H))return;H.preventDefault(),e.focus();try{n.setPointerCapture(H.pointerId);}catch{}i=n.ownerDocument,i.addEventListener("pointermove",fe),i.addEventListener("pointerup",se),i.addEventListener("pointercancel",se);let He=Je(),st=H.shiftKey?"character":q[(He-1)%q.length],an=wv(z,et);if(an&&!H.shiftKey){let $e=()=>{n.contentEditable!=="false"&&He===1&&SU.has(an.controlType)&&e.onContentControlWidget?.(an.id,an.controlType);};if(e.selectContentControl?.(an.id)){let Mt=e.selection(),_t=k(z,Mt.anchor,Mt.head)||Mt.anchor.paragraphId===Mt.head.paragraphId&&Mt.anchor.offset===Mt.head.offset?{from:Mt.anchor,to:Mt.head}:{from:Mt.head,to:Mt.anchor};a={pointerId:H.pointerId,granularity:"character",anchorRange:_t,anchorCell:et.cell,cellDragging:false,clientX:H.clientX,clientY:H.clientY},$e();return}let lt=Cs(z,an);if(lt){a={pointerId:H.pointerId,granularity:"character",anchorRange:lt,anchorCell:et.cell,cellDragging:false,clientX:H.clientX,clientY:H.clientY},J(()=>e.setSelection({anchor:lt.from,head:lt.to})),$e();return}}if(H.shiftKey){let $e=e.selection();a={pointerId:H.pointerId,granularity:st,caret:et.caret,anchorRange:{from:$e.anchor,to:$e.anchor},anchorCell:et.cell,cellDragging:false,clientX:H.clientX,clientY:H.clientY},J(()=>e.setSelection(I(z,{from:$e.anchor,to:$e.anchor},et.position,st,et),et.caret));}else {let $e=(r&&st==="word"?Sv(z,et.position):null)??E(z,et.position,st,et.contentControlId);a={pointerId:H.pointerId,granularity:st,caret:et.caret,anchorRange:$e,anchorCell:et.cell,cellDragging:false,clientX:H.clientX,clientY:H.clientY},J(()=>e.setSelection(Wc(z,{anchor:$e.from,head:$e.to},{atomic:r}),et.caret));}};function J(H){try{H();}catch(N){throw B(),N}}let fe=H=>{let N=a;!N||H.pointerId!==N.pointerId||(H.preventDefault(),N.clientX=H.clientX,N.clientY=H.clientY,T(H.clientX,H.clientY),w());},se=H=>{let N=a;if(!N||H.pointerId!==N.pointerId)return;B();try{n.releasePointerCapture(N.pointerId);}catch{}let z=e.cellSelection();z?e.setCellSelection(z):e.setSelection(e.selection(),N.caret),H.type==="pointerup"&&(e.onTextFormPointerUp?.(H),e.onSelectionSettled?.());};function B(){if(a)try{n.releasePointerCapture(a.pointerId);}catch{}a=null,s=null,O(),i?.removeEventListener("pointermove",fe),i?.removeEventListener("pointerup",se),i?.removeEventListener("pointercancel",se),i=null;}let D=()=>{s=null;};n.addEventListener("pointerdown",ee);let j=[e.listeners.onWindow("scroll",D,{capture:true,passive:true}),e.listeners.onWindow("resize",D,{passive:true})];return {dragging:()=>a!==null,cancelGesture:B,destroy(){B(),n.removeEventListener("pointerdown",ee);for(let H of j)H();}}}function ZD(e,t,n){let r=e??nb$1;return {view:()=>r,projection:()=>mb$1(r),changeBars:()=>t?r==="all-markup"||r==="simple-markup"?r:"none":"all-markup",set:o=>{r=o;},filter:o=>t&&mb$1(r)!=="all-markup"?ob$1(o):o,toggleByChangeBar:()=>{t&&n(r==="simple-markup"?"all-markup":"simple-markup");}}}function XD(e){let{pagesLayer:t,session:n}=e,r=()=>t.ownerDocument,o=false,i=null,a,s;function l(){let{head:C}=e.selection();return s&&s.position.paragraphId===C.paragraphId&&s.position.offset===C.offset?s.lineId:void 0}function c(C){let w=la(C?.anchorNode,t)??la(C?.focusNode,t);w!==void 0&&(a=w);}function d(C){return a??la(C?.anchorNode,t)??la(C?.focusNode,t)}let u=false,f=false,p=false,g=null,y=false,h=null;function b(){let C=r().getSelection(),w=Ps(t,C);return !w||(c(C),Ht(w,e.selection()))?false:(e.adoptSelection(w),true)}function x(){let C=r().activeElement;if(C&&t.contains(C))return true;if(C&&C!==r().body&&C!==r().documentElement)return false;let w=r().getSelection();if(!w||w.rangeCount===0)return true;let T=w.anchorNode;return !T||!T.isConnected?true:t.contains(T)}let S=()=>{let C=r().getSelection(),w=Ps(t,C);if(!w){if(!Yb(t,C))return;u=false;let T=Ke(e.selection().head);if(Ht(T,e.selection()))return;e.setSelection(T);return}u=false,c(C),!Ht(w,e.selection())&&e.setSelection(w);};function v(C,w){let T=e.textOf(C),$=AF(t,C,T,r().getSelection()?.anchorNode??null);if($===null)return;let W=LF(C,T,$);if(!W)return;let q=W.ops.find(D=>D.op==="deleteText"),K=W.ops.find(D=>D.op==="insertText"),Z=K&&q?e.replacementOffset?.(C,q.start,q.end):void 0,M=K&&!q&&w!==null&&K.offset>=w.offset?$.slice(w.offset,w.offset+K.text.length):null,ee=K&&w!==null&&M!==null&&T.slice(0,w.offset)+M+T.slice(w.offset)===$?{...K,offset:w.offset,text:M,inside:w.controlId}:null,J=K&&Z!==void 0&&Z!==K.offset?W.ops.map(D=>D===K?{...K,offset:Z}:D):ee?W.ops.map(D=>D===K?ee:D):W.ops,fe=K?e.pendingFormatOps?.(C,ee?.offset??Z??K.offset,K.text.length,q?{start:q.start,end:q.end}:void 0)??[]:[],se=ee?e.promptLanding?.(C,ee.offset,ee.text.length)??ee.offset+ee.text.length:void 0,B=e.storyScope();e.commit(()=>{let D=e.applyOps([...J,...fe],e.selectionMark(),B);return fe.length===0||!D.rejected?D:e.applyOps(J,e.selectionMark(),B)}),e.setSelection(Ke({paragraphId:C,offset:se!==void 0?se:K&&Z!==void 0?Z+K.text.length:W.caret}));}function k(){o||p||e.isGesturing?.()||e.holdsCellSelection?.()||E()||u&&S();}function E(){if(!f||u)return false;if(!i)return true;let C=Ps(t,r().getSelection());return C!==null&&Ht(C,i)}function I(C){C.type.startsWith("pointer")&&C.button!==0||(u=true);}let R=false;function O(C=false){if(e.updateCaret(),!C&&!x())return;o=true;let w=e.now(),T=e.domSelection?.()??e.selection();u=false;let $=r().getSelection(),W=d($),q=l(),K=mF(t,T,$,{...W!==void 0?{preferredPageIndex:W}:{},...q!==void 0?{preferredLineId:q}:{}});K&&c($),i=K?T:null,K||(f=true),e.recordSelectionMs(e.now()-w),queueMicrotask(()=>{o=false;});}return t.addEventListener("pointerdown",I,true),t.addEventListener("selectstart",I,true),{adoptBeforePaint(){let C=e.holdsCellSelection?.()===true||e.isGesturing?.()===true||e.hasPendingInput?.()===true,w=f||C||!u?false:b();return e.hasPendingInput?.()!==true&&(f=false),w},noteModelMoved(){f=true,s=void 0;},noteSelectionSettled(){f=false;},mirrorToDom:O,adoptBeforeInput:k,isComposing:()=>p,noteBrowserSelectionFixup(){R=true;},onSelectionChange:()=>{if(!o&&!p&&!e.isGesturing?.()&&!e.holdsCellSelection?.()){if(R&&Yb(t,r().getSelection())){let C=Ps(t,r().getSelection());if((C===null||!Ht(C,e.selection()))&&(R=false,!u)){O();return}}E()||S();}},onCompositionStart:()=>{k(),p=true;let C=e.selection();y=C.anchor.paragraphId!==C.head.paragraphId,g=C.head.paragraphId;let T=!y&&C.anchor.offset===C.head.offset?e.insertOwner?.():void 0;h=T===void 0?null:{offset:C.head.offset,controlId:T},n.beginComposition(e.storyScope());},onCompositionEnd:C=>{p=false;let w=g??e.selection().head.paragraphId;g=null;let T=h;h=null;let $=y;y=false;let W=e.storyScope(),q=n.revisionFor(W);if($){let K=C?.data??"";K.length>0&&e.replaceSelectionWith?.(K);}else v(w,T);n.endComposition(),n.revisionFor(W)===q&&e.discardPaint?.(),e.flushToPaint()||e.render();},selectionPageIndex:()=>a,selectionLineId:l,caretPreference(C=a){let w=l();return {...C!==void 0?{preferredPageIndex:C}:{},...w!==void 0?{preferredLineId:w}:{}}},notePointerCaret(C){s=C,C&&(a=C.pageIndex);},destroy(){t.removeEventListener("pointerdown",I,true),t.removeEventListener("selectstart",I,true),u=false;}}}function QD(e){let t=null,n=null,r=null,o=(a,s)=>(e.setLastRejection(null),e.commit(()=>{let l=e.applyOps(Array.isArray(a)?a:[a],e.selectionMark());return l.rejected&&e.setLastRejection(String(l.reason??"rejected")),l},s),e.lastRejection()===null),i=(a,s,l)=>{let c=Ic$1(a);if(!c)return e.setLastRejection("invalid note scope id"),false;let d=e.session.currentPackage(),u=qj$1(d,c.noteKind),f=u?cd(u.root,c.noteId):null;if(!u||!f)return e.setLastRejection("note not found"),false;if(e.exitHeaderFooter?.(),e.activeScope().kind==="body"){let p=e.selection();r={anchor:{paragraphId:p.anchor.paragraphId,offset:p.anchor.offset},head:{paragraphId:p.head.paragraphId,offset:p.head.offset}};}if(t={kind:"note",id:Hc$1(c.noteKind,c.noteId)},n=Number.isInteger(l)?l:null,s)e.setSelection({anchor:s,head:s});else {let p=wU(f),g=new Set(e.session.paragraphIdsIn({kind:"notesPart",noteKind:c.noteKind})),y=p.find(h=>g.has(h.id));if(y){let h=kv(y);e.setSelection({anchor:{paragraphId:y.id,offset:h},head:{paragraphId:y.id,offset:h}});}}return e.noteModelMoved(),e.render(),n??=e.revealNote(t.id),e.notify(),true};return {insertNote(a){if(e.activeScope().kind!=="body")return e.setLastRejection("insertNote requires body scope"),false;let s=e.deleteSelectionPlan(),l=s.collapseTo;if(!(s.ops.length===0||o(s.ops,()=>({anchor:{...l},head:{...l}}))))return false;let d=YD(e.session.currentPackage(),a);if(!o({op:"insertNote",noteKind:a,paragraphId:l.paragraphId,offset:l.offset},()=>{let g={paragraphId:l.paragraphId,offset:l.offset+1};return {anchor:g,head:g}}))return s.ops.length>0&&e.undo(),false;let p=[...YD(e.session.currentPackage(),a)].find(g=>!d.has(g));return p===void 0?true:i(Hc$1(a,p))},deleteNote(a,s){return o({op:"deleteNote",noteKind:a,noteId:s})},convertNote(a,s){return o({op:"convertNote",fromKind:a,noteId:s})},convertAllNotes(a){return o({op:"convertAllNotes",fromKind:a})},setNoteProperties(a){return o({op:"setNoteProperties",scope:a.scope,sectionIndex:a.sectionIndex,footnote:a.footnote,endnote:a.endnote})},enterNote:i,exitNote(a=true){if(!t)return;let s=r;t=null,n=null,r=null,e.setActiveScopeBodyOrHf({kind:"body"}),a&&s&&e.setSelection(s),e.noteModelMoved(),e.render(),e.notify();},activeNoteScope(){return t},activeNotePageIndex(){return n},setActiveNotePageIndex(a){!t||!Number.isInteger(a)||n!==a&&(n=a);}}}function wU(e){let t=[],n=(r,o)=>{if(!(o>32)){if(r.kind==="paragraph"){t.push(r);return}if("children"in r)for(let i of r.children)n(i,o+1);}};return n(e,0),t}function kv(e){let t=Di(e)[0];return t&&Nc$1(t.node)?t.end:0}function YD(e,t){let n=qj$1(e,t),r=new Set;if(!n)return r;for(let o of ad$1(n.root)){if(!Tc$1(o))continue;let i=Rc$1(o);i!==null&&r.add(i);}return r}var kU=720;function Iv(e,t,n=kU){return t1(e,t,e+t*n)}function e1(e,t,n){let r=t>0?Math.floor(e/n)+1:Math.ceil(e/n)-1;return t1(e,t,r*n)}function t1(e,t,n){return t>0?Math.max(e,Math.min(Hd,n)):Math.max(0,n)}function ci(e){let t;for(let r of e){if(r.localName!=="ind")continue;let o=r.attributes?.left??r.attributes?.start;o!==void 0&&(t=o);}let n=Qd(t);return n===null||Math.abs(n)>9999999?0:n}function JD(e,t){return e.kind==="midLine"?false:e.kind==="empty"||t<=e.offset}function n1(e,t,n,r,o){let{from:i,to:a}=e;if(i.paragraphId===a.paragraphId&&i.offset===a.offset)return null;let s=t.length>1?n.start(a.paragraphId):null,c=s!==null&&JD(s,a.offset)&&!(s.kind==="empty"&&n.endsStory(a.paragraphId))?t.slice(0,-1):t;if(c.length>1)return {write:"stepLeft",paragraphs:c};if(!JD(n.start(i.paragraphId),i.offset))return null;let{resolved:d,direct:u}=n.firstLine(i.paragraphId);return r==="increase"?{write:d>=0&&d<o?"setFirstLine":"stepLeft",paragraphs:c}:{write:u&&d>0?"clearFirstLine":"stepLeft",paragraphs:c}}function IU(e,t){let n=Number.POSITIVE_INFINITY,r=false;for(let{line:o}of Wb$1(e).get(t)??[]){if(!r&&(r=true,_a(o)[0]?.paragraphId!==t))return {kind:"midLine"};let i=$a(o,t);if(i){for(let a of i.spans)a.range.end>a.range.start&&(n=Math.min(n,a.range.start));for(let a of i.drawings)n=Math.min(n,a.start);if(Number.isFinite(n))break}}return Number.isFinite(n)?{kind:"start",offset:n}:{kind:"empty"}}var RU=["firstLine","hanging","firstLineChars","hangingChars"];function r1(e,t,n){let r=new Map;return {start(o){let i=r.get(o);if(i)return i;let a=IU(e,o);if(a.kind==="start"){let s=eb$1(t,o),l=s?.kind==="paragraph"?kv(s):0;l>a.offset&&(a={kind:"start",offset:l});}return r.set(o,a),a},endsStory:o=>n[n.length-1]===o,firstLine(o){let i=xc(e,o),a=di$1(t,o).find(l=>l.localName==="ind")?.attributes,s=RU.some(l=>a?.[l]!==void 0);return {resolved:i?Bf(i.indent):0,direct:s}}}}function o1(e,t){let n=(r,o)=>r.paragraphId===o.paragraphId&&r.offset===o.offset;return (e.contentControls??[]).some(r=>{if(!r.placeholder)return false;let o=Cs(e,r);return o!==null&&n(o.from,t.from)&&n(o.to,t.to)})}var PU=new Set(["ind"]);function i1(e){let t=r=>cb$1(e.layout(),r)?.paragraphId!==r;function n(r){let o=e.styleCascade(),i=eb$1(e.storyPart(),r);if(!o||!i)return null;let a=Rh$1(i),s=nf$1(o,a).paragraphPropertyNodes;return Ld(s.filter(l=>l!==a))}return {levelOps(r,o,i,a){let s=eb$1(e.storyPart(),r),c=!(s&&Th$1(Rh$1(s),"numPr"))&&!t(r)&&n(r)?.numId===o,d={op:"setListLevel",paragraphId:r,level:a};return c?[{op:"setListNumbering",paragraphId:r,numId:o,level:i},d]:[d]},styleIndent(r,o=false){let i=e.styleCascade(),a=eb$1(e.storyPart(),r);if(!i||!a)return {left:0,firstLine:0,inChars:false,leftInChars:false};let s=Rh$1(a),c=nf$1(i,o?void 0:s).paragraphPropertyNodes.filter(p=>p!==s).flatMap(p=>ci$1(p,PU)),d=0,u=false,f=false;for(let{attributes:p}of c){let g=Qd(p?.hanging),y=Qd(p?.firstLine);g!==null?d=-g:y!==null&&(d=y);let h=Number(p?.hangingChars??p?.firstLineChars??NaN);Number.isFinite(h)&&(u=h!==0);let b=Number(p?.leftChars??p?.startChars??NaN);Number.isFinite(b)&&(f=b!==0);}return {left:ci(c),firstLine:d,inChars:u,leftInChars:f}},styleNumbered(r){return !t(r)&&n(r)!==null},numbered(r){if(t(r))return false;let o=eb$1(e.storyPart(),r);if(!o)return false;let a=Th$1(Th$1(Rh$1(o),"numPr"),"numId")?.attributes.find(s=>s.localName==="val")?.value;return a!==void 0?a!=="0":n(r)!==null},leaveOp(r){let o=!t(r)&&n(r)!==null;return {op:"setListNumbering",paragraphId:r,numId:o?"0":null}}}}var TU=9,kp=e=>Math.round(e*20);function EU(e,t){return e>0||t<0?{hanging:kp(e>0?e:-t)}:{firstLine:kp(t)}}function CU(e,t){return Array.from({length:TU},(n,r)=>{let o=qd(e,t,r)?.level;if(!o)return;let i=$c$1(o),{indent:a}=o,s=a.stated;return {...s?.left?{left:kp(a.left)}:{},...s?.right?{right:kp(a.right)}:{},...s?.firstLineOffset?EU(a.hanging,a.firstLine):{},suffix:o.suff,align:o.lvlJc,...i?{paragraphProperties:i}:{}}})}function Rv(e){let t=(...n)=>e.some(r=>r.localName==="ind"&&n.some(o=>r.attributes?.[o]!==void 0));return {left:t("left","start"),right:t("right","end"),offset:t("hanging","firstLine")}}function a1(e,t){if(!e)return null;let n=t.children.find(a=>a.kind==="paragraphProperties"),r=nf$1(e,n).styleId,o=r?Cd(e,r,"paragraph"):[],i=Kd(o,n);return i>=o.length?null:Rv(o.slice(i).flatMap(a=>a.paragraphProperties))}function s1(e,t){if(!e)return false;let n=Cd(e,t,"paragraph");for(let r=n.length-1;r>=0;r-=1){let o=n[r];if(o.paragraphPropertiesNode?.children.find(a=>a.kind!=="textValue"&&a.localName==="outlineLvl"))return o.outlineLevel!==null;if(o.outlineLevel!==null)return true}return false}function l1(e,t){if(!e)return null;let n=Cd(e,t,"paragraph").flatMap(r=>r.paragraphPropertiesNode?[r.paragraphPropertiesNode]:[]);return Ld(n)}function c1(e){return {listGeometryOf:t=>CU(e(),t),listLevelKindOf:(t,n)=>OU(e(),t,n),listLevelStyleOf:(t,n)=>qd(e(),t,n)?.level.pStyle??null,listAbstractOf:t=>e().nums.get(t)?.abstractNumId??null}}function OU(e,t,n){let r=qd(e,t,n)?.level;return r?r.numFmt==="bullet"?"bullet":"ordered":null}function MU(e,t){for(let n=0;n<=8;n+=1)if(e.listLevelStyleOf(t,n)!==null)return true;return false}function d1(e,t,n){if(!MU(e,n.numId))return n.level;let r=e.indentOf(t),o=Math.round(e.defaultTabStopPt()*20);if(!r||!(o>0))return 0;let i=Math.round((r.left+r.firstLine-r.hanging)*20);return i>0?Math.min(8,Math.floor(i/o)):0}var AU=e=>e.numFmt==="bullet"?"bullet":"ordered",Ip=e=>Math.round(e*20);function Pv(e,t,n){let r=e.order(),o=r.indexOf(t[0]??""),i=o>0?r[o-1]:void 0,a=i?e.markerOf(i):null;return a&&AU(a)===n?a:null}function Tv(e,t){let n=false,r=false;for(let o of t){let i=e.markerOf(o);i===null?n=true:e.headingLevel(i.numId,i.level)||(r=true);}return !n||!r?null:e.markerOf(t[0]??"")===null?"plain-first":"item-first"}function u1(e,t,n){let r=n?e.styleNumberedIndentSides(t):null,o=r?e.indentOf(t):null;if(!n||!r||!o)return null;let i=e.directIndentSides(t),a={},s=Ip(o.left),l=Ip(o.right);r.left&&!i.left&&n.left!==void 0&&n.left!==s&&(a.left=s),r.right&&!i.right&&n.right!==void 0&&n.right!==l&&(a.right=l);let c=o.hanging>0?-Ip(o.hanging):Ip(o.firstLine),d=n.hanging!==void 0?-n.hanging:n.firstLine;return r.offset&&!i.offset&&d!==void 0&&d!==c&&(a.firstLine=c),Object.keys(a).length>0?a:null}var f1=(e,t)=>e.left===t.left&&e.right===t.right&&e.firstLine===t.firstLine;function p1(e,t){let{hanging:n,firstLine:r,...o}=e,i=t.firstLine===void 0?{...n!==void 0?{hanging:n}:{},...r!==void 0?{firstLine:r}:{}}:t.firstLine<0?{hanging:-t.firstLine}:{firstLine:t.firstLine};return {...o,...t.left!==void 0?{left:t.left}:{},...t.right!==void 0?{right:t.right}:{},...i}}function m1(e,t,n,r=()=>0,o=Tv(e,t)){let i=t.map(x=>{let S=e.markerOf(x);return S&&!e.headingLevel(S.numId,S.level)?S:null}),a=x=>x===null?null:new Map(t.map(S=>[S,x])),s=x=>typeof x=="string"&&i.every(S=>e.listLevelKindOf(x,S?.level??0)===n),l=Pv(e,t,n);if(o==="item-first"||o&&l&&e.headingLevel(l.numId,l.level))return a(e.ensureListDefinition(n));let c=l?.numId,d=o==="plain-first"?r(t[0]):null;if(typeof c=="string"&&t.every((x,S)=>{let v=i[S],k=v?d??v.level:e.markerOf(x)?0:r(x);return e.listLevelKindOf(c,k)===n}))return a(c);if(o!==null)return a(e.ensureListDefinition(n));let f=i.find(x=>s(x?.numId))?.numId;if(f)return a(f);let p=LU(i);if(p===null)return a(e.ensureListDefinition(n));if(n==="ordered"){let x=e.listGeometryOf(p),S=new Map;t.forEach((k,E)=>{let I=i[E],R=I?.level??0,O=I?.numId===p?u1(e,k,x[R]):null,C=S.get(R);C===void 0?S.set(R,O):C&&!(O&&f1(C,O))&&S.set(R,null);});let v=x.map((k,E)=>{let I=S.get(E);return k&&I?p1(k,I):k});return a(e.ensureListDefinition(n,v))}let g=new Map,y=x=>{let S=g.get(x);return S||(S=e.listGeometryOf(x),g.set(x,S)),S},h=[];t.forEach((x,S)=>{let v=i[S],k=v?.numId??p,E=v?.level??0,I=v?u1(e,x,y(k)[E]):null,R=h.find(O=>{if(O.numId!==k)return false;let C=O.shown.get(E);return C===void 0?true:I?C!==null&&f1(C,I):C===null});R||(R={numId:k,shown:new Map,items:[]},h.push(R)),R.shown.set(E,I),R.items.push(x);});let b=new Map;for(let x of h){let S=y(x.numId).map((k,E)=>{let I=x.shown.get(E);return k&&I?p1(k,I):k}),v=e.ensureListDefinition(n,S);if(v===null)return null;for(let k of x.items)b.set(k,v);}return b}function LU(e){let t=new Map,n=null;for(let r of e){if(!r)continue;let o=(t.get(r.numId)??0)+1;t.set(r.numId,o),(n===null||o>t.get(n))&&(n=r.numId);}return n}function g1(e,t){let n=new Map;for(let[r,o]of e){let i=t.levelOf(r)??0,a=t.listLevelStyleOf(o,i),s=a?t.styleNumberingOf(a):null;if(!a||!s||s.ilvl!==i)continue;let l=t.listAbstractOf(o);if(l===null||t.listAbstractOf(s.numId)!==l)continue;let c=t.linkedStyleOp(r,a);c&&n.set(r,c);}return n}function h1(e,t,n){if(t.every(y=>e.kindOf(y)===n))return t.map(y=>e.leaveOp(y));let r=Pv(e.listSwitch,t,n),o={...e,listLevelStyleOf:e.listSwitch.listLevelStyleOf},i=new Map,a=y=>{let h=i.get(y);return h===void 0&&(h=r?d1(o,y,r):0,i.set(y,h)),h},s=Tv(e.listSwitch,t),l=m1(e.listSwitch,t,n,a,s);if(l===null)return null;let c=new Map;if(r)for(let y of t){if(e.levelOf(y)!==null||l.get(y)!==r.numId)continue;let h=a(y);e.listSwitch.listLevelKindOf(r.numId,h)===n&&c.set(y,h);}let d=c.get(t[0]??""),u=new Map;if(d!==void 0&&s==="plain-first")for(let y of t){let h=e.listSwitch.markerOf(y);!h||e.listSwitch.headingLevel(h.numId,h.level)||h.level!==d&&u.set(y,d);}let f=y=>c.get(y)??e.levelOf(y),p=g1(l,{listLevelStyleOf:e.listSwitch.listLevelStyleOf,listAbstractOf:e.listSwitch.listAbstractOf,levelOf:y=>u.get(y)??f(y),styleNumberingOf:y=>l1(e.styleCascade(),y),linkedStyleOp:(y,h)=>e.listStyle.linkedStyleOp(y,h,c.has(y)?"all":u.has(y)?"level":false)}),g=[...e.listStyle.applyOps(t.filter(y=>!p.has(y)),y=>c.has(y)),...p.values()];for(let y of t){if(p.has(y))continue;let h=f(y);g.push({op:"setListNumbering",paragraphId:y,numId:l.get(y)??null,...h!==null?{level:h}:{}});let b=u.get(y);b!==void 0&&g.push({op:"setListLevel",paragraphId:y,level:b});}return g}var FU=32;function Ev(e,t,n,r){if(!(e.kind==="textValue"||r>FU)){if(e.kind==="paragraph"){n.has(e.id)||n.set(e.id,t);return}for(let o of e.children)Ev(o,t,n,r+1);}}var y1=new WeakMap;function b1(e,t,n,r){if(e.kind==="paragraph"||e.kind==="textValue"){Ev(e,t,n,0);return}let o=y1.get(e);if(!o){let i=new Map;Ev(e,0,i,0),o=[...i.keys()],y1.set(e,o);}for(let i of o)n.has(i)||n.set(i,t);}function HU(e,t){let n=vf$1(e),r=xc$1(n),o=0,i=ce(e),a=new Map;for(let s=0;s<i.length;s+=1){let l=i[s];for(let c=l.blockStart;c<l.blockEndExclusive;c+=1){let d=n[c];if(d){for(;o<r.length&&r[o]!==d;)b1(r[o],s,a),o+=1;o+=1,b1(d,s,a);}}}return a}var v1=new WeakMap;function _U(e){return !(!e.story||e.origin===g.mutationUndo||e.origin===g.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.includes(l$1.section))}function BU(e,t){t.story&&t.story.kind!=="body"||_U(t)||(e.map=null);}function $U(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>BU(t,n)));}function WU(e,t){let n=v1.get(e);return n||(n={map:null,subscribed:false},v1.set(e,n)),$U(e,n),n.map||(n.map=HU(t)),n.map}function x1(e,t,n){return n.includes("#")&&!n.startsWith(`${t.name}#`)?null:WU(e,t).get(n)??null}var S1=32;function qc(e,t,n,r,o="all-markup",i){let a=e.part(),s=ce(a,o,i);if(s.length<=1)return 0;let l=de$1(a,o,i),c=f=>{let p=l.indexOf(f);if(p!==-1)return p;let g=l.findIndex(y=>y>f);return g===-1?Math.max(0,l.length-1):g},d=Cv(e,t);if(d!==null)return c(d);if(n.kind==="headerFooter"){if(r!==void 0&&s[r]!==void 0)return r;let f=e.headerFooterResolutionBySection().findIndex(p=>[p.headers,p.footers].some(g=>[...g.values()].some(y=>y.rId===n.rId)));return f===-1?0:c(f)}let u=KU(e,t);if(u!==null){let f=Cv(e,u);if(f!==null)return c(f)}return 0}function w1(e,t,n,r,o="all-markup",i){let a=e.part(),s=ce(a);if(s.length<=1)return {kind:"whole-document"};let l=de$1(a,o,i),c=Cv(e,t),d=qc(e,t,n,r,o,i),u=l[d]??d;if(c!==null&&c===u)return {kind:"anchor",paragraphId:t};let f=s[u];if(!f)return {kind:"unaddressable"};let p=vf$1(a);for(let g=f.blockStart;g<f.blockEndExclusive;g+=1){let y=qU(p[g]);if(y!==null)return {kind:"anchor",paragraphId:y}}return {kind:"unaddressable"}}function qU(e){if(!e)return null;let t=(n,r)=>{if(n.kind==="textValue"||r>S1)return null;if(n.kind==="paragraph")return n.id;for(let o of n.children){let i=t(o,r+1);if(i!==null)return i}return null};return t(e,0)}function Cv(e,t){return x1(e,e.part(),t)}function KU(e,t){let n=e.currentPackage();for(let r of ["footnote","endnote"]){let o=qj$1(n,r);if(!(!o||!UU(o,t)))for(let i of ad$1(o.root)){let a=Rc$1(i);if(a===null||!jU(i,t))continue;return rj$1(e.part()).find(l=>l.noteKind===r&&l.noteId===a)?.paragraphId??null}}return null}function UU(e,t){return t.includes("#")?t.startsWith(`${e.name}#`):eb$1(e,t)!==null}function jU(e,t){let n=(r,o)=>{if(r.kind==="textValue"||o>S1)return false;if(r.kind==="paragraph"&&r.id===t)return true;for(let i of r.children)if(n(i,o+1))return true;return false};return n(e,0)}function Os(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 Rp(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 k1(e){return {val:e?"1":"0"}}function Ov(e){return e.bound?"bound":e.effectiveLock==="contentLocked"||e.effectiveLock==="sdtContentLocked"?"locked":null}function I1(e){return e.effectiveLock==="sdtLocked"||e.effectiveLock==="sdtContentLocked"?"locked":null}function Pp(e,t){for(let n of e.children)if(n.kind!=="textValue"&&!(n.kind!=="contentControlProperties"&&n.localName!=="sdtPr")){if(n.children.some(r=>r.kind!=="textValue"&&r.localName==="dataBinding")&&t==="edit")return "bound";for(let r of n.children){if(r.kind==="textValue"||r.localName!=="lock")continue;let o=r.attributes.find(i=>i.localName==="val")?.value;if(t==="remove"){if(o==="sdtLocked"||o==="sdtContentLocked")return "locked"}else if(o==="contentLocked"||o==="sdtContentLocked")return "locked"}}return null}var R1=["firstLine","hanging","firstLineChars","hangingChars"],VU=["left","start","leftChars","startChars"],GU=new Set(["bookmarkStart","bookmarkEnd","commentRangeStart","commentRangeEnd","permStart","permEnd","proofErr","moveFromRangeStart","moveFromRangeEnd","moveToRangeStart","moveToRangeEnd"]),zU=["leftChars","startChars","firstLineChars","hangingChars"];function P1(e){function t(){let{from:s,to:l}=e.orderedRange();if(s.paragraphId!==l.paragraphId||s.offset!==l.offset)return null;let c=e.markerOf(s.paragraphId);return c?{position:s,marker:c}:null}function n(s){let l=ci(zn(e.layout(),s)),c=di$1(e.storyPart(),s),d=c.find(h=>h.localName==="ind")?.attributes,u=e.listNumbering.styleNumbered(s),f=e.listNumbering.styleIndent(s),p=u||d!==void 0||f.left!==l,g=!u&&(f.firstLine!==0||f.inChars);if(!p&&!g)return null;let y={...d??{}};for(let h of R1)delete y[h];if(g&&(y.firstLine="0"),g&&f.inChars&&(y.firstLineChars="0"),p){delete y.leftChars,delete y.startChars;let h=String(l);d?.start!==void 0&&(y.start=h),(d?.start===void 0||d.left!==void 0)&&(y.left=h);}return {op:"setParagraphProperties",paragraphId:s,properties:[...c.filter(h=>h.localName!=="ind"),{localName:"ind",attributes:y}]}}function r(s){let l=e.storyPart(),c=Uh$1(l,s)?.children??[],d=c.findIndex(u=>u.kind!=="textValue"&&u.id===s);for(let u=d-1;u>=0;u-=1){let f=c[u];if(!(f.kind==="textValue"||GU.has(f.localName)))return f.kind==="paragraph"?f.id:null}return null}function o(s){let l=e.storyPart();for(let c=Uh$1(l,s);c;c=Uh$1(l,c.id))if(c.localName==="sdt"&&Pp(c,"edit")==="locked")return true;return false}function i(s){let l=zn(e.layout(),s),c=0,d=false;for(let u of l){if(u.localName!=="ind")continue;let f=u.attributes??{},p=Qd(f.hanging),g=Qd(f.firstLine);p!==null?c=-p:g!==null&&(c=g);for(let y of zU){let h=Number(f[y]??NaN);Number.isFinite(h)&&h!==0&&(d=true);}}return {left:ci(l),firstLine:c,inChars:d}}function a(s,l){let c=r(s);if(l.firstLine!==0||l.inChars||c===null||!e.markerOf(c))return 0;let d=i(c);if(d.inChars||d.left!==l.left)return 0;let u=d.left+d.firstLine;return u>0&&u<l.left?u:0}return {exitListOnEmptyItem(){let s=t();if(!s)return false;let{position:l,marker:c}=s;if(e.paragraphTextOf(l.paragraphId).length>0)return false;let d=c.level>0&&e.listLevelExists(c,c.level-1),u=[];if(d)u.push(...e.listNumbering.levelOps(l.paragraphId,c.numId,c.level,c.level-1));else {let f=e.listStyle.clearOp(l.paragraphId);f&&u.push(f),u.push(e.listNumbering.leaveOp(l.paragraphId));}return e.commitOps(u)},removeListNumber(s){if(!e.markerOf(s)||!e.listNumbering.numbered(s))return false;let l=n(s);return e.commitOps([...l?[l]:[],e.listNumbering.leaveOp(s)]),true},removeParagraphIndent(s){if(e.markerOf(s)||e.paragraphTextOf(s).length===0||o(s))return false;let l=i(s);if(l.left===0&&l.firstLine===0&&!l.inChars)return false;let c=a(s,l),d=e.listStyle.clearOp(s)!==null,u=e.listNumbering.styleIndent(s,d),f=di$1(e.storyPart(),s),p=f.find(b=>b.localName==="ind")?.attributes,g={...p??{}};for(let b of [...VU,...R1])delete g[b];(c!==0||u.left!==0||u.leftInChars)&&(g.left=String(c)),u.leftInChars&&(g.leftChars="0"),(u.firstLine!==0||u.inChars)&&(g.firstLine="0"),u.inChars&&(g.firstLineChars="0");let y=f.filter(b=>b.localName!=="ind"&&!(d&&b.localName==="pStyle"));if(!d&&ZU(g,p??{}))return false;let h=Object.keys(g).length>0?[{localName:"ind",attributes:g}]:[];return e.commitOps([{op:"setParagraphProperties",paragraphId:s,properties:[...y,...h]}]),true}}}function ZU(e,t){let n=Object.keys(e);return n.length===Object.keys(t).length&&n.every(r=>e[r]===t[r])}function T1(e,t,n){let r=false;return e(()=>{let o=t([...n]);return r=o.committed,o}),r}var Kc="a section break that changes where the next section starts cannot be suggested; turn off suggesting to insert it",Ms="a section break cannot be inserted inside a table cell",Ep="a section break cannot change a section that a locked or linked content control holds",Uc="a section break cannot be inserted in locked or linked content";function XU(e){let t=new Set,n=new Set,r=i=>{if(i.kind==="textValue"||!("localName"in i)||i.localName!=="sdt")return false;let a=i.children?.find(s=>s.kind!=="textValue"&&"localName"in s&&s.localName==="sdtPr");return !a||a.kind==="textValue"?false:(a.children??[]).some(s=>{if(s.kind==="textValue"||!("localName"in s)||s.namespaceUri!==pa$2)return false;if(s.localName==="dataBinding")return true;if(s.localName!=="lock")return false;let l=s.attributes?.find(c=>c.localName==="val"&&c.namespaceUri===pa$2)?.value;return l==="contentLocked"||l==="sdtContentLocked"})},o=(i,a,s)=>{if(i.kind==="textValue")return;if(i.kind==="paragraph"){a&&t.add(i.id),s&&n.add(i.id);return}let l=a||i.kind==="table",c=s||r(i);for(let d of i.children??[])o(d,l,c);};return o(e.root,false,false),{inCell:t,held:n}}var YU=32;function QU(e){let t=new Set(fn(e).map(n=>_in(n)));return en$1(e)||t.add("nextPage"),t.size===1?[...t][0]:null}function Av(e,t){let n=t.replaceAt??t.collapseTo;return gn(e,n.paragraphId)?t.collapseTo:n}var Mv=(e,t)=>Ph$1(e,t)||Lh$1(e,t).content;function Tp(e,t,n,r){if(gn(e,t))return Ms;if(Mv(e,t))return Uc;let{section:o,ownerId:i}=hn(e,t);return _in(o)===n?null:i!==null&&Mv(e,i)?Ep:r?Kc:null}function E1(e){let{breakType:t,suggesting:n}=e;if(e.cellRectangle)return Ms;if(e.caretParagraphId!==null)return Tp(e.part(),e.caretParagraphId,t,n);let r=XU(e.part());if(!n&&r.inCell.size===0&&r.held.size===0)return null;let{from:o,to:i}=e.orderedRange(),a=e.part(),s=hn(a,o.paragraphId),l=hn(a,i.paragraphId),c=s.section===l.section,d=c?_in(s.section):QU(a),u=e.paragraphOrder(),f=u.indexOf(o.paragraphId),p=u.indexOf(i.paragraphId),g=f===-1||p===-1?null:u.slice(f,p+1),y=g!==null&&!g.some(b=>r.inCell.has(b))&&!g.some(b=>r.held.has(b));if(d!==null&&d!==t){if(y&&c&&s.ownerId!==null&&Mv(a,s.ownerId))return Ep;if(n&&y)return Kc}if(y&&d!==null)return null;if(g===null||g.length-1>YU)return n&&d!==null&&d!==t?Kc:null;let h=Av(a,e.deleteSelectionPlan());return Tp(a,h.paragraphId,t,n)}var JU=[["contextualSpacing","contextualSpacing"],["keepNext","keepNext"],["keepLines","keepLines"],["widowControl","widowControl"],["pageBreakBefore","pageBreakBefore"]];function ej(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 Cp(e,t,n,r){let o={...e};if(delete o[`${t}Chars`],delete o[`${n}Chars`],r===null)return delete o[t],delete o[n],o;let i=String(r),a=e[n]!==void 0;return a&&(o[n]=i),(!a||e[t]!==void 0)&&(o[t]=i),o}function C1(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 O1(e){let{session:t,commit:n,orderedStart:r,orderedRange:o,selectionMark:i,collapsedAt:a}=e,s=e.deleteSelectionPlan,l=()=>t.partFor(e.storyScope())??t.part(),c=(w,T,$)=>t.applyTreeOps(w,T,$,e.storyScope()),d=qM({session:t,storyPart:l}),u=i1({storyPart:l,styleCascade:e.styleCascade,layout:e.layout}),f=P1({orderedRange:o,layout:e.layout,storyPart:l,markerOf:v,listLevelExists:I,paragraphTextOf:e.paragraphTextOf,listNumbering:u,listStyle:d,commitOps:w=>T1(n,T=>c(T,i()),w)}),p=()=>e.paragraphOrder(),g={get value(){return e.layout()}};function y(){let w=e.selectedCells?.();return w&&w.length>0?w:null}function h(w){let T=false;return n(()=>{let $=w();return T=$.committed,$},void 0,{keepCellSelection:y()!==null}),T}function b(w=o()){if(y()!==null)return [...ma$2(g.value,y())];let{from:T,to:$}=w,W=p(),q=W.indexOf(T.paragraphId),K=W.indexOf($.paragraphId);return q===-1||K===-1?null:W.slice(q,K+1)}let x=8;function S(w){return v(w)?.level??null}function v(w){return db$1(g.value,w)}function k(w){let T=v(w);return T?T.numFmt==="bullet"?"bullet":"ordered":null}let E={listGeometryOf:e.listGeometryOf,listLevelKindOf:e.listLevelKindOf,listLevelStyleOf:e.listLevelStyleOf,listAbstractOf:e.listAbstractOf,order:p,markerOf:v,ensureListDefinition:(w,T)=>t.ensureListDefinition(w,T),headingLevel:(w,T)=>{let $=e.listLevelStyleOf(w,T);return $!==null&&s1(e.styleCascade(),$)},indentOf:w=>xc(g.value,w)?.indent??null,directIndentSides:w=>Rv(di$1(l(),w)),styleNumberedIndentSides:w=>{let T=eb$1(l(),w);return T&&T.kind!=="textValue"?a1(e.styleCascade(),T):null}};function I(w,T){return T<0||T>x?false:e.numberingLevelExists(w.numId,T)}function R(w,T){return T<0||T>x?false:e.numberingLevelExists(w.numId,T)?true:t.ensureNumberingLevel(w.numId,T,w.numFmt==="bullet"?"bullet":"ordered")&&e.numberingLevelExists(w.numId,T)}function O(w,T,$){let W=T==="increase"?1:-1,q=[];for(let K of w){let Z=zn(g.value,K),M=v(K),ee=M?.level??null;if(M&&ee!==null){let D=ee+W;if(D<0||D>x||!R(M,D))continue;q.push(...u.levelOps(K,M.numId,ee,D));continue}let J=ci(Z),fe=$===void 0?Iv(J,W):e1(J,W,$);if(fe===J)continue;let se=di$1(l(),K),B=se.find(D=>D.localName==="ind");q.push({op:"setParagraphProperties",paragraphId:K,properties:fi(se,{localName:"ind",attributes:ej(B?.attributes,String(fe))})});}return q.length===0?false:h(()=>c(q,i()))}function C(w,T){let $=[];for(let W of w){let q=di$1(l(),W),Z={...q.find(M=>M.localName==="ind")?.attributes??{}};T.left!==void 0&&(Z=Cp(Z,"left","start",T.left)),T.right!==void 0&&(Z=Cp(Z,"right","end",T.right)),T.firstLine!==void 0&&(Z=C1(Z,T.firstLine)),$.push({op:"setParagraphProperties",paragraphId:W,properties:fi(q,{localName:"ind",...Object.keys(Z).length>0?{attributes:Z}:{}})});}return $.length===0?false:h(()=>c($,i()))}return {insertTab(){let w=s(),T=w.replaceAt??w.collapseTo;n(()=>c([...w.ops,{op:"insertTab",paragraphId:T.paragraphId,offset:T.offset}],i()),()=>a({...T,offset:T.offset+1}));},insertLineBreak(){let w=s(),T=w.replaceAt??w.collapseTo;n(()=>c([...w.ops,{op:"insertHardBreak",paragraphId:T.paragraphId,offset:T.offset}],i()),()=>a({...T,offset:T.offset+1}));},insertPageBreak(){let w=s(),T=w.replaceAt??w.collapseTo;n(()=>c([...w.ops,{op:"insertPageBreak",paragraphId:T.paragraphId,offset:T.offset}],i()),()=>a({...T,offset:T.offset+1}));},exitListOnEmptyItem:f.exitListOnEmptyItem,removeListNumber:f.removeListNumber,removeParagraphIndent:f.removeParagraphIndent,isListParagraph(){let{paragraphId:w}=r();return S(w)!==null},isListActive(w){let T=b();if(T===null)return false;let $=w==="bullet"?"bullet":"ordered";return T.length>0&&T.every(W=>k(W)===$)},toggleList(w){let T=b();if(T===null||T.length===0)return false;let $=h1({listSwitch:E,listStyle:d,leaveOp:u.leaveOp,levelOf:S,kindOf:k,styleCascade:e.styleCascade,indentOf:E.indentOf,defaultTabStopPt:e.defaultTabStopPt},T,w);return $===null?false:h(()=>c($,i()))},canAdjustIndent(w){let T=b();if(T===null)return false;let $=w==="increase"?1:-1;return T.some(W=>{let q=v(W);if(q){let Z=q.level+$;return Z>=0&&Z<=x}let K=ci(zn(g.value,W));return Iv(K,$)!==K})},adjustIndent(w){let T=b();return T!==null&&O(T,w)},setIndent(w){if(w.left===void 0&&w.right===void 0&&w.firstLine===void 0)return false;let T=b();return T!==null&&C(T,w)},indentWithTab(w){let T=o();if(T.from.paragraphId===T.to.paragraphId&&T.from.offset===T.to.offset&&y()===null||o1(g.value,T))return false;let W=b(T);if(W===null)return false;let q=Math.round(Rb$1(t.settingsRoot())*20),K=r1(g.value,l(),p()),Z=y()===null?n1(T,W,K,w,q):{write:"stepLeft",paragraphs:W};return Z===null?false:(Z.write==="stepLeft"?O(Z.paragraphs,w,q):C(Z.paragraphs,{firstLine:Z.write==="setFirstLine"?q:null}),true)},setParagraphFormat(w){let T=b();if(T===null||T.length===0)return false;let $=[];w.direction!==void 0&&$.push({localName:"bidi",paragraphDirection:w.direction}),w.alignment!==void 0&&$.push({localName:"jc",attributes:{val:w.alignment},physicalAlignment:true});let W={...Os("before",w.spaceBeforePt),...Os("after",w.spaceAfterPt),...Rp(w.lineSpacing)};Object.keys(W).length>0&&$.push({localName:"spacing",attributes:W,mergeAttributes:true});for(let[M,ee]of JU){let J=w[M];J!==void 0&&$.push({localName:ee,attributes:k1(J)});}let q=w.tabStops!==void 0,K=w.indentLeftTwips!==void 0||w.indentRightTwips!==void 0||w.indentFirstLineTwips!==void 0;if($.length===0&&!K&&!q)return false;let Z=[];for(let M of T){let ee=di$1(l(),M),J=ee;if(K){let j={...ee.find(H=>H.localName==="ind")?.attributes??{}};w.indentLeftTwips!==void 0&&(j=Cp(j,"left","start",w.indentLeftTwips)),w.indentRightTwips!==void 0&&(j=Cp(j,"right","end",w.indentRightTwips)),w.indentFirstLineTwips!==void 0&&(j=C1(j,w.indentFirstLineTwips)),J=fi(J,{localName:"ind",...Object.keys(j).length>0?{attributes:j}:{}});}let fe=zn(g.value,M),se=ee,B=false;for(let D of $){let j=wp(D,fe,J,se);if(!j)continue;if(B=true,j.remove){J=J.filter(z=>z.localName!==j.localName);continue}let H=j.mergeAttributes?{...J.find(z=>z.localName===j.localName)?.attributes??{},...j.attributes}:j.attributes??{},N=Object.fromEntries(Object.entries(H).filter(([,z])=>z!=null));J=fi(J,{localName:j.localName,...Object.keys(N).length>0?{attributes:N}:{}});}if((B||K)&&Z.push({op:"setParagraphProperties",paragraphId:M,properties:J}),q){let D=vc(e.layout(),M);Z.push({op:"setParagraphTabStops",paragraphId:M,stops:w.tabStops.map(j=>({positionTwips:Math.round(j.positionTwips),alignment:j.alignment,...j.leader&&j.leader!=="none"?{leader:j.leader}:{}})),...D?{inForcePositionsTwips:D.stops.map(j=>Math.round(j.positionPt*20))}:{}});}}return Z.length===0?true:h(()=>c(Z,i()))},sectionProperties:()=>be(t.part()),sectionPropertiesAt(w){let T=ce(t.part(),e.revisionDisplayMode(),e.revisionAuthorFilter()),$=qc(t,w,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter());return (T[$]??T[T.length-1]).properties},sectionAnchorParagraphAt(w){return w1(t,w,e.storyScope(),e.headerFooterSectionIndex?.(),e.revisionDisplayMode(),e.revisionAuthorFilter())},setSectionProperties(w){let T=false;return n(()=>{let $=e.storyScope().kind==="body",W=t.applyTreeOps([{op:"setSectionProperties",...w}],$?i():void 0,void 0,{kind:"body"});return T=W.committed,W}),T},sectionBreakRefusal(w="nextPage"){return e.storyScope().kind!=="body"?null:E1({part:()=>t.part(),breakType:w,suggesting:e.editingMode?.()==="suggest",cellRectangle:(e.selectedCells?.()?.length??0)>0,caretParagraphId:e.caretParagraphId?.()??null,orderedRange:o,paragraphOrder:p,deleteSelectionPlan:s})},insertSectionBreak(w="nextPage"){if(e.storyScope().kind!=="body")return false;let T=s(),$=Av(t.part(),T),W=(gn(t.part(),$.paragraphId)?Ms:null)??Tp(t.part(),$.paragraphId,w,e.editingMode?.()==="suggest");if(W!==null)return e.publishRefusal?.(W),false;let q=new Set(t.paragraphIds()),K=false,Z=false;return n(()=>{let M=t.applyTreeOps([...T.ops,{op:"splitParagraph",paragraphId:$.paragraphId,offset:$.offset},{op:"setSectionMark",paragraphId:$.paragraphId,breakType:w}],i(),void 0,{kind:"body"});return K=M.committed,Z=M.reason==="locked"||M.reason==="bound",M},()=>{let M=t.paragraphIds().find(ee=>!q.has(ee));return M?a({paragraphId:M,offset:0}):null}),!K&&Z&&e.publishRefusal?.(Uc),K}}}var F1="http://schemas.openxmlformats.org/wordprocessingml/2006/main";function D1(e){return e.kind==="textValue"?false:e.kind==="contentControl"?true:e.kind==="generic"&&e.localName==="sdt"&&e.namespaceUri===F1}function tj(e){return e.kind==="textValue"?false:e.kind==="contentControlContent"?true:e.kind==="generic"&&e.localName==="sdtContent"&&e.namespaceUri===F1}function Lv(e){return e.kind==="textValue"?[]:e.children}function N1(e,t=0){if(e.kind==="textValue")return e.value;if(t>=Aa$1||e.kind==="deletedText"||nj(e.kind)||ch$1(e)||e.kind==="runProperties")return "";let n=Ub$1(e);if(n!==null)return n;if(e.kind==="generic"&&!Ca(e)&&!D1(e))return "";if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return cc$1(e);let r=Ba(e,t),o="";for(let i of e.children)o+=N1(i,r);return o}function nj(e){return e==="revisionDelete"||e==="revisionMoveFrom"}function Fv(e,t,n){if(!(t>=Aa$1))for(let r of e){if(r.kind==="hyperlink"){Ba(r,t)<Aa$1&&n(r,t);continue}if(Ca(r)){Fv(Lv(r),Ba(r,t),n);continue}if(D1(r)){for(let o of Lv(r))tj(o)&&Fv(Lv(o),Ba(r,t),n);continue}n(r,t);}}function M1(e,t,n){let r=rj(e,t);if(!r||r.kind!=="paragraph")return [];let o=Fi(r),i=[],a=0;return Fv(r.children,0,(s,l)=>{let c=o.spanOf(s);if(c&&(a=Math.max(a,c.end)),s.kind!=="hyperlink")return;let d=c?c.start:a,u=c?c.end:a,f=Ie$1(s,n);i.push({id:s.id,paragraphId:t,start:d,end:u,text:Yb$2(N1(s,l)),kind:f.kind,href:f.href,authored:f.authored,...f.anchor!==void 0?{anchor:f.anchor}:{},...f.tooltip!==void 0?{tooltip:f.tooltip}:{}});}),i}function rj(e,t){let n=r=>{if(r.kind==="textValue")return r.id===t?r:null;if(r.id===t)return r;for(let o of r.children){let i=n(o);if(i)return i}return null};return n(e.root)}function oj(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 ij(e,t){for(let n of Ta(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 H1(e){let t=()=>e.storyScope(),n=()=>e.session.partFor(t()),r=d=>e.session.relationshipTarget(d,t()),o=(d,u,f,p)=>e.session.applyTreeOps(d,u,f,t(),p?.length?{packageEdits:p}:void 0),i=d=>{let u=n();return u?M1(u,d,r):[]},a=()=>oj(i(e.selection().head.paragraphId),e.selection().head),s=()=>{let d=e.selection().head,u=ij(e.layout(),d);return u===null?null:e.fieldLinkById(u)},l=d=>{let u=e.selection().head.paragraphId,f=i(u).find(p=>p.id===d);if(f)return f;for(let p of e.session.storyParts()){let g=y=>gj$1(e.session.currentPackage(),p.name,y);for(let y of fd$1(p))for(let h of id$1(y.root)){let b=h.id,x=M1(p,b,g).find(S=>S.id===d);if(x)return x}}return null};return {linksInCaretParagraph:()=>i(e.selection().head.paragraphId),linkAtCaret:a,fieldLinkAtCaret:s,linkById:l,selectionIsPendingDeletion:()=>{let{anchor:d,head:u}=e.selection();if(d.paragraphId!==u.paragraphId||d.offset===u.offset)return false;let f=Math.min(d.offset,u.offset),p=Math.max(d.offset,u.offset);return Zb$2(e.layout(),u.paragraphId).some(g=>g.start<=f&&p<=g.end)},wordAtCaret(){return a()||s()?null:wf(e.layout(),e.selection())},applyHyperlink(d){let u=d.text===void 0?d:{...d,text:Zb$1(d.text)},f=u.url!==void 0&&u.url.length>0,p=u.anchor!==void 0&&u.anchor.length>0;if(f===p)return false;let g=t();if(!n()||e.refusesWrite())return false;let y;if(f){let $=()=>e.session.ensureHyperlinkRelationship(u.url,g),W=e.withMintActor?e.withMintActor($):$();if(!W)return false;y=W;}let h={...y!==void 0?{relationshipId:y}:{},...p?{anchor:u.anchor}:{},...u.tooltip!==void 0?{tooltip:u.tooltip}:{}},b=a(),x=e.orderedRange(),S=x.from.paragraphId===x.to.paragraphId&&x.from.offset===x.to.offset;if(b&&(S||aj(b,x))){let $=[],W;if(u.text!==void 0&&u.text!==Zb$1(b.text)){if(u.text.length===0)return false;let K=e.replacementLanding?.(b.paragraphId,b.start,b.end),Z=e.textOf(b.paragraphId).slice(b.start,b.start+2),M=b.start+(Z.length===2&&Z.charCodeAt(0)>=55296&&Z.charCodeAt(0)<=56319&&Z.charCodeAt(1)>=56320&&Z.charCodeAt(1)<=57343?2:1);if(K!=null&&K>b.start&&M<b.end)$.push({op:"setHyperlinkTarget",linkId:b.id,...h},{op:"deleteText",paragraphId:b.paragraphId,start:b.start,end:b.end},{op:"insertText",paragraphId:b.paragraphId,offset:M,text:u.text});else if(K!=null){let ee=i$1(e.session.currentPackage(),{createPart:!e.collaborative});ee.edit&&(W=[ee.edit]),$.push({op:"setHyperlinkTarget",linkId:b.id,...h},...A1(b,K,u.text),{op:"insertHyperlink",paragraphId:b.paragraphId,start:K,end:K+u.text.length,...h,...ee.styleId?{styleId:ee.styleId}:{}});}else {let ee=L1(b.paragraphId,b.start,b.end,u.text);if(!ee)return false;$.push({op:"setHyperlinkTarget",linkId:b.id,...h},...ee);}}else $.push({op:"setHyperlinkTarget",linkId:b.id,...h});let q=false;return e.commit(()=>{let K=o($,e.selectionMark(),void 0,W);return q=K.committed,K},()=>null),q}let v=x.from.paragraphId;if(x.to.paragraphId!==v)return false;let k=[],E=x.from.offset,I=x.to.offset;if(S){let $=u.text??u.url??u.anchor??"";if($.length===0)return false;E=e.insertionLanding?.(v,E)??E,k.push({op:"insertText",paragraphId:v,offset:E,text:$}),I=E+$.length;}else {let $=e.replacementLanding?.(v,E,I);if($!=null){let W=u.text??e.textOf(v).slice(E,I);if(W.length===0)return false;k.push(...A1({paragraphId:v,start:E,end:I},$,W)),E=$,I=$+W.length;}else if(u.text!==void 0&&u.text!==e.textOf(v).slice(E,I)){let W=L1(v,E,I,u.text);if(!W)return false;k.push(...W),I=E+u.text.length;}}if(I<=E)return false;let{styleId:R,edit:O}=i$1(e.session.currentPackage(),{createPart:!e.collaborative}),C=O?[O]:void 0;k.push({op:"insertHyperlink",paragraphId:v,start:E,end:I,...h,...R?{styleId:R}:{}});let w=false,T={paragraphId:v,offset:I};return e.commit(()=>{let $=o(k,e.selectionMark(),{paragraphId:v,start:I,end:I},C);return w=$.committed,$},()=>({anchor:T,head:T})),w},removeHyperlink(d){if(!n())return false;let u=d?l(d):a();if(!u)return false;let f=false,p={paragraphId:u.paragraphId,offset:u.end};return e.commit(()=>{let g=o([{op:"removeHyperlink",linkId:u.id}],e.selectionMark());return f=g.committed,g},()=>({anchor:p,head:p})),f}}}function aj(e,t){return t.from.paragraphId===e.paragraphId&&t.to.paragraphId===e.paragraphId&&t.from.offset>=e.start&&t.to.offset<=e.end}function A1(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 L1(e,t,n,r){if(r.length===0)return null;let o=[{op:"insertText",paragraphId:e,offset:t,text:r,bias:"right"}];return n>t&&o.push({op:"deleteText",paragraphId:e,start:t+r.length,end:n+r.length}),o}function Dv(e){if(e.kind==="textValue")return JSON.stringify(e.value);let t=e.attributes.map(n=>`${n.namespaceUri??""}|${n.localName}=${n.value}`).sort().join(",");return `<${e.namespaceUri??""}|${e.localName} ${t}>${e.children.map(Dv).join("")}</>`}function _1(e){let t=ud(e)?.root;if(!t)return [];let n=new Map,r=[];for(let o of g$3(t)){let i=f$3(o,"styleId");if(!i)continue;let a=n.get(i);a?Dv(a)===Dv(o)&&r.push(o.id):n.set(i,o);}return r}function B1(e){return _1(e).length===0?null:d$3(t=>{let n=ud(t);if(!n)return t;for(let r of _1(t)){let o=lb$1(n,r);if(!o.ok)return t;n=o.part;}return sg(t,n)})}function $1(e){let{session:t,collaboration:n}=e,r=0,o=(d,u)=>{if(!n)return {packageEdits:d,historyToken:u};r+=1;let f=n.identity.actorId;return {packageEdits:d,origin:g.mutationHuman,actorId:f,operationId:`${f}:${n.sessionId}:browser:${r}`,recordsHistory:false,historyToken:u}},i=(d,u)=>Ua(()=>t.applyTreeOps([],void 0,void 0,u,o(d,void 0)));function a(d,u,f,p=e.defaultScope(),g){let y=n?.gateOperations(d,p);if(y)return {committed:false,rejected:true,opCount:0,reason:y};let h=n?(g??[]).filter(e$2):[];if(h.length>0){let x=i(h,p);if(x.rejected)return x}let b=g?.filter(x=>!h.includes(x));return t.applyTreeOps(d,u,f,p,o(b?.length?b:void 0,e.historyGroup()))}function s(){if(!n||!e.canRepair()||n.gateOperations([],{kind:"body"}))return;let d=B1(t.currentPackage());d&&i([d],{kind:"body"});}let l=false;function c(d){if(!n||l)return;let u=d.dependencyKeys;u.length>0&&u.every(f=>f===l$1.story)||(l=true,e.later(()=>{l=false,s();}));}return {apply:a,noteRemoteChange:c}}function sj(e,t,n){if(!t)return 0;let r=t.scrollTop;return e.pages.find(i=>(i.box.y+i.box.height)*n>r)?.index??0}var lj=24;function cj(e,t,n){if(!n)return Math.max(0,t-lj);let r=e.clientHeight,o=e.scrollTop;return t>=o+r*.2&&t<=o+r*.8?o:Math.max(0,t-r/2)}function W1(e){let{pagesLayer:t}=e;function n(){return e.container.closest(".docx-editor__scroll-container")}let r=u=>{if(!u||u.length===0||u.startsWith("#"))return false;let f=U(u);if(!f.ok||!f.href)return false;let p=t.ownerDocument.defaultView;return p?(p.open(f.href,"_blank","noopener,noreferrer"),true):false},o=(u,f)=>{e.beginJump?.();let p=!e.enterStoryFor||e.enterStoryFor(u.paragraphId);if(!p&&!f?.orShow)return false;let g=e.layout(),y=n(),h=Se(g,u,p?void 0:{preferredPageIndex:sj(g,y,e.scale())});if(!h)return !p||!e.whenLaidOut?.(u,()=>o(u,f))?false:(e.setSelection(u),true);let b=g.pages[h.pageIndex];if(!b)return false;let x=sc(b,u.paragraphId).y+h.y;return y&&(y.scrollTop=cj(y,x*e.scale(),f?.center===true),e.onScrolled?.()),p?(e.setSelection(u),true):"shown"},i=u=>{let f=e.bookmarks().get(u);return f?o(f)===true:false},a=null;function s(u){if(!u||u.closest("[data-docx-hf]"))return null;let f=u.closest("a.docx-hyperlink");if(f){let g=f.dataset.docxLink;return g?{linkId:g,drawing:false}:null}let p=u.closest("[data-docx-drawing-link]");if(p){let g=p.dataset.docxDrawingLink;return g?{linkId:g,drawing:true}:null}return null}let l=u=>{if(d$1(u.target))return;a=null;let f=u.target,p=s(f);if(!p)return;let y=f.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();a={linkId:p.linkId,drawing:p.drawing,rect:{left:y.left,top:y.top,bottom:y.bottom,right:y.right}};},c=u=>{if(d$1(u.target))return;let f=u.target,p=s(f);if(!p){let h=a;if(a=null,!h)return;u.preventDefault(),d(h.linkId,h.rect,u,h.drawing);return}a=null,u.preventDefault();let y=f.closest("[data-docx-drawing-link], a.docx-hyperlink").getBoundingClientRect();d(p.linkId,{left:y.left,top:y.top,bottom:y.bottom,right:y.right},u,p.drawing);};function d(u,f,p,g){let y=g?e.drawingLinkById?.(u)??null:e.linkById(u);if(!y)return;if(p.metaKey||p.ctrlKey){y.kind==="external"?r(y.href):y.anchor&&i(y.anchor);return}if(e.isCollapsedSelection()){if(y.kind==="internal"){y.anchor&&i(y.anchor);return}e.onPopover?.({link:y,rect:f});}}return t.addEventListener("pointerdown",l,true),t.addEventListener("click",c),{goToPosition:o,goToBookmark:i,openExternal:r,destroy(){t.removeEventListener("pointerdown",l,true),t.removeEventListener("click",c);}}}function dj(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 Nv(e,t){return e.drawingNodeId!==t?null:dj(e)}function q1(e,t){if(!e)return null;for(let n of e.anchoredDrawings??[]){let r=Nv(n,t);if(r)return r}return null}function uj(e,t){for(let r of e.anchoredDrawings??[]){let o=Nv(r,t);if(o)return o}for(let r of e.fragments){if(r.kind==="table"){for(let i of r.rows)for(let a of i.cells)for(let s of a.blocks){let l=U1(s,t);if(l)return l}continue}let o=K1(r,t);if(o)return o}let n=q1(e.header,t);return n||q1(e.footer,t)}function K1(e,t){for(let n of e.lines)for(let r of n.drawings??[]){let o=Nv(r,t);if(o)return o}return null}function U1(e,t){if(e.kind==="table"){for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks){let i=U1(o,t);if(i)return i}return null}return K1(e,t)}function j1(e,t){for(let n of e.pages){let r=uj(n,t);if(r)return r}return null}var Op=24;function V1(e){let t=null,n=false;return {without(r){let o=n;n=true;try{return r()}finally{n=o;}},follow(r,o){let i=n?"none":o;if(e.storyScopeOpen())return;let a=e.selection();if(!(a.anchor.paragraphId===a.head.paragraphId&&a.anchor.offset===a.head.offset)&&i!=="head")return;let l=e.pagesLayer.ownerDocument.activeElement;if(!(l===e.pagesLayer||!!l&&e.pagesLayer.contains(l))&&i!=="none")return;let d=e.preferredPageIndex(),u=e.preferredLineId?.(),f=e.layout(),p=Se(f,a.head,{measurer:e.measurer(),...d!==void 0?{preferredPageIndex:d}:{},...u!==void 0?{preferredLineId:u}:{}});if(!p)return;let g=t!==null&&t!==p.pageIndex;if(t=p.pageIndex,i==="none"||!r&&!g)return;let y=f.pages[p.pageIndex],h=e.scroller();if(!y||!h||h.clientHeight<=0)return;let b=e.scale(),x=y.contentBox.y-y.box.y,S=(y.box.y+x+p.y)*b+e.container.offsetTop,v=S+p.height*b,k=h.scrollTop,E=k+h.clientHeight,I=k;if(S<k+Op)I=S-Op;else if(v>E-Op)I=v+Op-h.clientHeight;else return;let R=Math.max(0,h.scrollHeight-h.clientHeight),O=Math.max(0,Math.min(I,R));Math.abs(O-h.scrollTop)<.5||(h.scrollTop=O,e.scheduleRematerialize());}}}function G1(e){return (t,n,r,o)=>{if(e.settle(),/[\r\n\v\f\u2028\u2029]/.test(o))return e.refuse("replacement requires text without a paragraph mark");if(!e.storyParagraphs().includes(t))return e.refuse("that text is not in the story being edited");let i=e.textOf(t);if(n<0||r<n||r>i.length)return e.refuse("that range is outside the paragraph");let a={paragraphId:t,offset:n},s=r>n?e.rangePlan({anchor:a,head:{paragraphId:t,offset:r}}):{ops:[],replaceAt:e.insertionPoint(a)},l=[...s.ops],{paragraphId:c,offset:d}=s.replaceAt;if(o.length>0&&l.push({op:"insertText",paragraphId:c,offset:d,text:o}),l.length===0)return true;let u=e.selection();return e.commitWithoutFollow(l,e.selectionMark()??void 0,()=>{e.flushLayout();let f=e.textOf(t),p=$c(u,t,i,f);return e.selectionsEqual(p,u)?null:(e.noteModelMoved(),p)})}}function z1(e,t){let n=[],r=a=>{for(let s of a){if(s.kind==="paragraph"){n.push({id:s.id,length:Fi(s).length});continue}if(s.kind==="textValue")continue;if(s.kind==="contentControl"){r(t.contentChildrenOf(s));continue}r(s.children);}};if(r(t.contentChildrenOf(e)),n.length>0){let a=n[0],s=n[n.length-1];return {anchor:{paragraphId:a.id,offset:0},head:{paragraphId:s.id,offset:s.length}}}let o=null,i=a=>{for(let s of a){if(s.kind==="paragraph"){let l=Fi(s).spanOf(e);if(!l)continue;return o={anchor:{paragraphId:s.id,offset:l.start},head:{paragraphId:s.id,offset:l.end}},true}if(s.kind!=="textValue"&&i(s.children))return true}return false};return i(t.searchRoots()),o}function Z1(e){for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="contentControlContent"||t.localName==="sdtContent"))return t.children;return []}function X1(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 jc="the document is open for viewing",fj="image changes are not supported in suggesting mode",Y1="tracked changes need a non-empty author";function Q1(e){function t(){return {committed:false,rejected:true,opCount:0,reason:jc}}return {applyDrawingOps(n){if(e.editingMode()==="view")return t();let r=e.selectionMark(),o={committed:false,rejected:true,opCount:0};return e.commit(()=>(o=e.applyOps(n,r,r),o)),o},applyImageProperties(n){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:jc};let r={ok:false,reason:"invalidArgs"};return e.commit(()=>(r=e.session.applyImageProperties(e.storyScope(),n),{committed:r.ok,rejected:!r.ok,opCount:r.ok?1:0,...r.ok?{}:{reason:r.detail??r.reason}})),r},deleteImage(n){if(e.editingMode()==="view")return {ok:false,reason:"invalidArgs",detail:jc};let r=e.editingMode()==="suggest",o=e.author();if(r&&(o===void 0||o===""))return {ok:false,reason:"invalidArgs",detail:Y1};let i={ok:false,reason:"invalidArgs"};return e.commit(()=>(i=r?e.session.deleteImageTracked(e.storyScope(),n,{author:o,date:e.trackedDate()}):e.session.deleteImage(e.storyScope(),n),{committed:i.ok,rejected:!i.ok,opCount:i.ok?1:0,...i.ok?{}:{reason:i.detail??i.reason}})),i},insertImage(n){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:jc});let r=e.editingMode()==="suggest",o=e.author();if(r&&(o===void 0||o===""))return Promise.resolve({ok:false,reason:"invalidArgs",detail:Y1});let i=e.actorId();return e.session.insertImage(e.storyScope(),{...n,decodePort:e.decodePort(),...r?{revision:{author:o,date:e.trackedDate()}}:{},...i?{actorId:i}:{}})},replaceImage(n,r,o,i){if(e.editingMode()==="view")return Promise.resolve({ok:false,reason:"invalidArgs",detail:jc});if(e.editingMode()==="suggest")return Promise.resolve({ok:false,reason:"invalidArgs",detail:fj});let a=e.actorId();return e.session.replaceImage(e.storyScope(),n,r,o,e.decodePort(),{...i,commitGuard:()=>e.editingMode()==="edit"&&i.commitGuard?.()!==false,...a?{actorId:a}:{}})}}}function J1(e){let t=null,n=null,r="",o=()=>{let c=e.session.part(),d=e.revisionDisplayMode(),u=e.revisionAuthorFilter();return {sections:ce(c,d,u),sourceIndexes:de$1(c,d,u)}},i=c=>{let{sourceIndexes:d}=o(),u=d.indexOf(c);if(u!==-1)return u;let f=d.findIndex(p=>p>c);return f===-1?Math.max(0,d.length-1):f},a=()=>{if(!t)return;let c=_T(e.layout(),t,e.materializedPages?.());c!==t.pageIndex&&(t={...t,pageIndex:c,sectionIndex:e.sectionAtPage(c).sectionIndex});},s=c=>{if(e.entryRefused?.()===true&&t?.scope.rId!==c.rId||!c.rId||e.session.partFor({kind:"headerFooter",rId:c.rId})===null)return false;e.leaveOtherStories?.();let d=e.layout(),u=DT(d,c.rId),f=t,p=f?.scope.rId===c.rId,g=u?null:pj(e.session,c.rId);if(!u&&!g)return false;let y=c.pageIndex??(p&&f?f.pageIndex:u?.pageIndex??0),h=c.kind??(p&&f?f.kind:u?.kind??g.kind),b=c.variant??(p&&f?f.variant:u?.story.variant??g.variant),x=p&&f?f.partName:u?.story.partName??g.partName,S=d.pages[y]??d.pages[u?.pageIndex??0],v=(S?as(S,{scope:{kind:"headerFooter",rId:c.rId},kind:h,partName:x}):null)??u?.story??{scope:{rId:c.rId},variant:b,partName:x},k=e.selection(),E=f?f.savedBodySelection:{anchor:{...k.anchor},head:{...k.head}},I=p&&f?.sectionIndex!==void 0&&y===f.pageIndex,R=c.sectionIndex??(I?f.sectionIndex:u?e.sectionAtPage(y).sectionIndex:g?i(g.sectionIndex):void 0);t={scope:{kind:"headerFooter",rId:c.rId},pageIndex:y,...R!==void 0?{sectionIndex:R}:{},kind:h,variant:v.variant,partName:v.partName,savedBodySelection:E};let C=e.session.paragraphIdsIn(Zu(t))[0];if(!C)return t=null,false;let w=c.position?Ju(d,{anchor:c.position,head:c.position},t):p?Ju(d,k,t):{anchor:{paragraphId:C,offset:0},head:{paragraphId:C,offset:0}};return e.setScopeSelection(w),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify(),true},l=()=>{if(!t)return;e.leaveOtherStories?.();let c=t.savedBodySelection;t=null,e.setScopeSelection(Ju(e.layout(),c,null)),e.noteModelMoved(),e.render(),e.mirrorToDom(),e.notify();};return {getActive:()=>t,activeScope:()=>FT(t),setActiveScope(c){return c.kind==="body"?(l(),true):c.kind==="headerFooter"?s({rId:c.rId}):false},enterHeaderFooter:s,exitHeaderFooter:l,reconcileOccurrence:a,headerFooterState(){if(!t)return null;let c=e.session.headerFooterResolutionBySection(),d=t.sectionIndex??0,u=o(),f,p,g,y=S=>{let v=u.sourceIndexes[S]??S,k=c[v];if(!k)return false;let I=(t.kind==="header"?k.headers:k.footers).get(t.variant);return !I||I.rId!==t.scope.rId?false:(d=S,f=I.inherited,p=k.titlePage,g=k.evenAndOddHeaders,true)};if(!(t.sectionIndex!==void 0&&y(t.sectionIndex))){let S;c.forEach((v,k)=>{let I=(t.kind==="header"?v.headers:v.footers).get(t.variant);!I||I.rId!==t.scope.rId||!(S===void 0||S&&!I.inherited||S===I.inherited&&i(k)<d)||(d=i(k),f=I.inherited,p=v.titlePage,g=v.evenAndOddHeaders,S=I.inherited);});}let h=u.sections[d]?.properties??u.sections.at(-1)?.properties,b=h?.margins.headerTwips,x=h?.margins.footerTwips;return {editing:t.kind,sectionIndex:d,variant:t.variant,rId:t.scope.rId,partName:t.partName,...f!==void 0?{inherited:f}:{},...p!==void 0?{titlePage:p}:{},...g!==void 0?{evenAndOddHeaders:g}:{},...b!==void 0?{headerDistanceTwips:b}:{},...x!==void 0?{footerDistanceTwips:x}:{}}},headerFooterStateStable(c){if(!t)return n=null,r="",null;let d=this.headerFooterState();if(!d)return null;let u=[c,d.editing,d.sectionIndex,d.variant??"",d.rId??"",d.partName??"",String(d.inherited),String(d.titlePage),String(d.evenAndOddHeaders),String(d.headerDistanceTwips??""),String(d.footerDistanceTwips??"")].join("|");return n&&r===u||(n=Object.freeze({...d}),r=u),n}}}function eN(e){return e.length>0&&e.every(t=>t.op==="setDocumentProtection")}function pj(e,t){let n=e.headerFooterResolutionBySection();for(let r=0;r<n.length;r+=1){let o=n[r];for(let i of ["header","footer"]){let a=i==="header"?o.headers:o.footers;for(let[s,l]of a)if(l.rId===t)return {sectionIndex:r,kind:i,variant:s,partName:l.partName}}}return null}function tN(e,t,n){let{sectionIndex:r,sectionStart:o}=e.sectionAtPage(n),i=f=>f[Math.min(r,Math.max(0,f.length-1))],a=f=>{let p=i(f);return t==="header"?p?.headers:p?.footers},s=e.session.headerFooterResolutionBySection(),l=i(s),c=e.layout.pages[n]?.pageFieldSource?.pageNumber??n+1,d=l?.evenAndOddHeaders&&c%2===0?"even":l?.titlePage&&n===o?"first":"default",u=a(s)?.get(d)?.rId;if(!u){if(!e.create({op:"createHeaderFooter",sectionIndex:r,kind:t,variant:d,...d==="first"?{titlePage:true}:{},...d==="even"?{evenAndOddHeaders:true}:{}})?.ok)return;u=a(e.session.headerFooterResolutionBySection())?.get(d)?.rId,e.flushLayout();}u&&e.enter({rId:u,pageIndex:n,sectionIndex:r,kind:t,variant:d});}var mj=500;function gj(e,t,n,r){let o=e.part();return $d(o,vf$1(o,n,r),t)}function nN(e,t){if(!e)return null;let n=e.session,r=mb$1(e.revisionDisplayMode()),o=e.state().selection.head.paragraphId,i=qc(n,o,e.activeScope().kind==="headerFooter"?{kind:"headerFooter",rId:e.headerFooterState()?.rId??""}:Et(n,o,{kind:"body"}),e.headerFooterState()?.sectionIndex,r,t),a=n.currentPackage(),s=Cf$1(a),l=Df$2(s),c=Ef$1(s),d=ce(n.part(),r,t),u=gj(n,d,r,t),f=Af$1(u[i]),p=Bf$2(u[i]),g=Ff$1(f),y=Gf$1(p,c);return {sectionIndex:i,footnote:{resolved:g,...l?{documentAuthored:l}:{},...f?{sectionAuthored:f}:{}},endnote:{resolved:y,...c?{documentAuthored:c}:{},...p?{sectionAuthored:p}:{}}}}function rN(e,t){let n=Ic$1(t);if(!n)return null;let r=qj$1(e.currentPackage(),n.noteKind);if(!r)return null;let o=r,i=cd(o.root,n.noteId);if(!i)return null;let a=[],s=mj,l=(d,u)=>{if(!(u>32||s<=0)){if(d.kind==="paragraph"&&typeof d.id=="string"){let f=(Km(o,d.id)??"").replace(/\uFFFC/g,"").trim();if(f){let p=f.slice(0,s);a.push(p),s-=p.length;}return}if(d.kind!=="textValue")for(let f of d.children)l(f,u+1);}};l(i,0);let c=a.filter(Boolean).join(" ").trim();return c.length>0?c:null}function oN(e){return [()=>{zb$2(e().root);},()=>{Tk(e());},()=>{Pl(e());}]}var hj=50,yj=16;function iN(e){let t=e.schedule??((s,l)=>{let c=globalThis.setTimeout(s,l);return ()=>globalThis.clearTimeout(c)}),n=false,r=null,o=0,i=0,a=s=>{r=t(()=>{if(r=null,!(n||i>=e.steps.length||!e.shouldRun())){if(e.hasPendingInput()){if(o+=1,o>hj)return;a(yj);return}try{e.steps[i]();}catch{return}i+=1,i<e.steps.length&&a(0);}},s);};return a(0),()=>{n=true,r&&r(),r=null;}}var Ao=null;function As(e,t,n){let r=Ao;Ao=t===void 0?null:{owner:e,group:t};try{return n()}finally{Ao=r;}}function Hv(e){if(Ao===null||Ao.owner!==e)return;let{group:t}=Ao;return Ao=null,t}function bj(e,t){Ao===null&&(Ao={owner:e,group:t});}var Mp=class{current;get value(){return this.current}around(t,n,r,o=true){let i=this.current,a=Hv(t);this.current=a??(o?Symbol("command"):void 0);let s;try{s=n();}finally{this.current=i;}return a!==void 0&&!r(s)&&bj(t,a),s}};function aN(e,t){let n=t.indexOf("#"),r=n>0?t.slice(0,n):e.mainDocumentPart,o=e.parts.get(r);return o?eb$1(o,t):null}function sN(e){let{anchor:t,head:n}=e;return t.paragraphId!==n.paragraphId||t.offset!==n.offset?null:`${n.paragraphId}\0${n.offset}`}var vj=1e3,xj=2e3,Ap=class{constructor(t,n=()=>performance.now()){this.currentPackage=t;this.now=n;}currentPackage;now;group;expected=null;startedAt=0;lastTypedAt=0;paragraphId=null;landedNode=null;groupAt(t){let n=this.now();return (this.group===void 0||sN(t)!==this.expected||n-this.lastTypedAt>=vj||n-this.startedAt>=xj||n<this.lastTypedAt)&&(this.group=Symbol("typing"),this.startedAt=n),this.lastTypedAt=n,this.group}landed(t){this.expected=sN(t),this.paragraphId=this.expected===null?null:t.head.paragraphId;let n=this.paragraphId;this.landedNode=n===null?null:aN(this.currentPackage(),n),this.expected===null&&(this.group=void 0);}noteForeignChange(t){let n=this.paragraphId;if(n===null||t.origin===g.projection||t.origin===g.awareness)return;if(t.dirty.includes(n)||t.deleted.includes(n))return this.end();if(t.dirty.length>0||t.deleted.length>0)return;let r=this.landedNode,o=aN(this.currentPackage(),n);r!==o&&(r===null||o===null||!Ka(r,o))&&this.end();}end(){this.group=void 0,this.expected=null,this.paragraphId=null,this.landedNode=null;}};function di(e,t,n=true){let r=e.createElement("div");return r.className=t,r.contentEditable="false",n&&r.setAttribute("aria-hidden","true"),r.style.position="absolute",r.style.left="0",r.style.top="0",r.style.pointerEvents="none",r}function lN(e,t,n){for(let r of e)r.style.width=t,r.style.height=n;}function Vc(e,t$1,n={}){let r=n,o=sp(n),i$1=r.openedSession??m(t$1,{...n.reviewModel?{reviewModel:n.reviewModel}:{},...n.contentLockPolicy?{contentLockPolicy:n.contentLockPolicy}:{}});if(!i$1.ok)return {ok:false,reason:i$1.reason,...i$1.detail?{detail:i$1.detail}:{},..."limit"in i$1&&i$1.limit?{limit:i$1.limit}:{}};let a=kL(i$1.session,o),s=cb(mc(n.unsupportedElementRules??[])),l=hA(a),c=l.index,d=n.collaborationModel?.session,u$1=n.author,f=n.scale??96/72,p={resolve:n.tableInteractionLabel??(m=>By(m))},g$1="the document is open for viewing",y="the table of contents is generated and read-only",h=false,b$1="\0range\0",x=u(a.currentPackage()),S=n.measurer?null:Z(f,{context:ii(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{},serifHangulFace:x}),v$1=n.measurer??S.measurer,k=jf$1(),E=Cg();function I(){return n.measurer?n.producer??"host-measurer":`${n.producer??S?.producer??"fixed-measurer"}@scale:${f}`}let R=I(),O=n.lockedControlNavigation==="atomic",C=e.ownerDocument,w=C.createElement("div"),T=$L(()=>w);w.className="docx-pages",w.style.position="relative",o.listeners(w),w.contentEditable="true",w.spellcheck=false,w.setAttribute("role","textbox"),w.setAttribute("aria-multiline","true"),xb(w,n.translate),w.style.outline="none";let $=di(C,"docx-selection-overlay"),W=di(C,"docx-comment-overlay"),q=di(C,"docx-text-highlight-overlay"),K=null,Z$1=di(C,"docx-remote-selection-overlay"),M=di(C,"docx-bookmark-overlay"),ee=di(C,"docx-table-furniture",false),J=di(C,"docx-table-select-layer",false),fe=null;e.style.position="relative";let se=[ee,J,W,M,q,Z$1,$];e.replaceChildren(w,...se);let B=ED(w,()=>f,()=>{let m=Xe?.getActive()??null,P=Ye?.activeNoteScope()??null,L=Ye?.activeNotePageIndex()??null,_=m?NT(w,m.pageIndex):P?HT(w,P.id,L):null;return {layout:Re(),selection:Bt.shownSelection(N),...ze.caretPreference(m?.pageIndex??L??void 0),measurer:v$1,..._t()?{typingStyle:()=>{let V=On.formatting();return V.fontSizeHalfPoints?{fontSizePt:V.fontSizeHalfPoints/2,fontFamily:V.fontFamily,bold:V.bold,italic:V.italic,verticalAlign:V.superscript?"superscript":V.subscript?"subscript":"baseline"}:null}}:{},scopedHost:_,...m?{scopedHostKind:"headerFooter"}:P?{scopedHostKind:"note"}:{},...gt?.caretInput(be),suppress:De==="view"}}),D=rf(a.part()),j$2=a.paragraphIds(),H=j$2.find(m=>!D.has(m))??j$2[0]??"",N=r.initialSelection??{anchor:{paragraphId:H,offset:0},head:{paragraphId:H,offset:0}},z=r.initialDrawingSelectionIntent??{kind:"none"};function X(m,P){m.kind===z.kind&&(m.kind!=="pointer"||z.kind==="pointer"&&m.drawingNodeId===z.drawingNodeId)||(z=m,P&&n.onChange?.(xt()));}let F=null,U=null;function G(m){return U=Y(m),n.onChange?.(xt()),false}function Y(m,P=m){return n.onRejection?.(P),m}let le=()=>n.onEdit?.(Ln),oe=new Mp,ae=new Ap(()=>a.currentPackage()),xe="suggesting needs an author before it can propose a change",Se$1=false,at=false,we=null,Ue=new Map;function _e(){we=null;for(let m of Ue.values())we=m;}function Je(m,P){if(m.paragraphId===P.paragraphId)return m.offset-P.offset;let L=rt();return L.indexOf(m.paragraphId)-L.indexOf(P.paragraphId)}function et(m){if(!we)return;let{from:P,to:L}=Nf(Re(),we),_=m.head;Je(_,P)>=0&&Je(_,L)<=0||(Ue.clear(),we=null);}let He=null,st=new Hf(d??a),an=new Lf(d??a,()=>N,()=>de(a,N.head.paragraphId)??a.part(),()=>a.packageRevision());function $e$1(m){let P=null;d&&no.expectHistory(true);let L;try{L=an.step(m,()=>{if(d)return d[m]();let V=a.packageRevision();return P=a[m](),a.packageRevision()!==V});}finally{d&&no.expectHistory(false);}if(!L.changed)return;le();let _=m==="undo"?SD(d,Do):null;G8(_??L.selection??P);}function lt(m){ze.noteModelMoved(),$t();let P=iM(m,Re(),rt());St(P.selection),He=P.format,B.update(),n.onChange?.(xt());}function Mt(){return _t()?.properties??null}function _t(){return mb(He,N)}function fi(m){if(!He)return;let P=He.position;m.anchor.paragraphId===P.paragraphId&&m.anchor.offset===P.offset&&m.head.paragraphId===P.paragraphId&&m.head.offset===P.offset||(He=null);}function mr(m,P,L,_,V){let Q=dt([...m],L,_,je(),true,V);return m.length===P.length||!Q.rejected?Q:dt([...P],L,_,je(),true,V)}function to(m,P,L,_){let V=gt?.replacementFormatOps(m,P,L);if(V?.length)return V;let Q=_t()??(zt(N.head.paragraphId).length===0?{base:[],properties:ei(de(a,N.head.paragraphId)??a.part(),N.head.paragraphId,N.head.offset,Yt(),vt())}:null);if(!Q||L===0||Q.properties.length===0&&Q.base.length===0)return [];let te=He?.position??N.head,pe=_&&te.paragraphId===m&&te.offset>=_.start&&te.offset<=_.end?{paragraphId:m,offset:xm({paragraphId:m,offset:_.start},{paragraphId:m,offset:_.end})}:_b$1(Re(),te);return pe.paragraphId!==m||pe.offset!==P?[]:[{op:"setRunProperties",paragraphId:m,start:P,end:P+L,properties:mi(Q.base,Q.properties,qs(m,P))}]}let Xe=null,Ye=null,gt=null,Re=()=>gt?.layout(be)??be,ga=()=>gt?.active()?gt.paragraphIds():a.paragraphIdsIn(je()),sn=null,je=()=>Zu(Xe?.getActive()??null,Ye?.activeNoteScope()??null),pi=()=>Ye?.activeNoteScope()?.id??null,Zn=m=>{let P=E.multi?.spans,L=0,_=0;if(P&&P.length>0)for(let V=0;V<P.length;V+=1){let Q=P[V];if(L=V,_=Q.startIndex,m<Q.startIndex+Q.pageCount)break}return {sectionIndex:L,sectionStart:_}},Ce=(m,P)=>{if(gt?.active()){let te=gt.paragraphIds();return te.includes(m)?m:te[te.indexOf(P)+1]??null}let L=de(a,m)??de(a,P)??a.part();if(eb$1(L,m))return m;let _=fb$1(L,P),V=_?_.children.findIndex(te=>te.id===P):-1,Q=_&&V>=0?_.children[V+1]:void 0;return Q?.kind==="paragraph"?Q.id:null},pn=()=>CM(gt,Xe),rt=()=>ss(Re(),pn(),pi()),no=xD({textOf:m=>zt(m),order:rt,carried:()=>wD(d)}),Ee=()=>globalThis.performance?.now()??Date.now(),Lt=0,ha$1=0,Tn=0,mi$1=m=>{WO(m)&&n.onTiming?.("input",m.timeStamp);},{styleCascade:mn,numberingIndex:Xn,defaultTabStopPt:ln,compatibilityMode:gi}=PL(a),Lo=kD({styleCascade:mn,partOf:m=>de(a,m)??a.part()}),ya=null,ba=n.imageDecodePort??ID(C)??RD(),Sn=Df$1({session:a,decodePort:ba,onResourcesChanged:()=>ya?.()}),ro=n.drawingStrings??o$1,va=j(n.translate),$s=n.tocLabels,Ws=()=>N.anchor.paragraphId!==N.head.paragraphId||N.anchor.offset!==N.head.offset?null:{paragraphId:N.head.paragraphId,offset:N.head.offset},em=QM(a),Qc=PD({mintValidatedBytes:(m,P)=>Sn.mintValidatedBytes(m,P)}),gr=false,Fr=ZD(n.revisionDisplayMode,!!n.reviewModel,m=>ve.setRevisionDisplayMode(m)),oo=Fr.view,Yt=Fr.projection,Jc=Fr.changeBars,Yn=r.revisionAuthorVisibility??ap(n.hiddenRevisionAuthors),Bt=jO({layout:Re,part:()=>a.partFor(je())??a.part(),view:Zx}),hi=wM(n.revisionMarkup,()=>yL(Fr,Yn,a),()=>ot(),()=>{Qt=En(vt()),yt.invalidateAll(a.packageRevision(),"revision-markup"),yt.flush(),Pt(false);}),vt=hi.filter,qs=MM(a,Yt,vt),ed=SM(a,Yt,vt),xa=m=>{let P=de(a,m)??a.part();return IM(P,m,Yt(),vt())},Qt,td=Sf$1(a),yi=Tf$1(),Ks=bL(),En=(m,P=gr)=>{let L=TL({session:s.view(a),measurer:v$1,producer:R,cache:k,styleCascade:mn,numberingIndex:Xn,defaultTabStopPt:ln,compatibilityMode:gi,displayMode:Yt(),showFieldCodes:P,revisionAuthorFilter:m,inlineDrawingLayoutForPart:_=>Sn.contextForPart(_),drawingLayoutTokenForPart:_=>Sn.cacheTokenForPart(_),drawingTokenForParagraphForPart:(_,V)=>Sn.drawingTokenForParagraph(V,_),linkProjectors:td,projectFieldLink:_=>yi.project(_)});return Ks.record(L,m),L};Qt=En(vt());let Fo={...a,applyTreeOps:(m,P,L,_,V)=>dt(m,P,L,_,true,V?.packageEdits),ensureListDefinition:(m,P)=>Hb$1(d?.identity.actorId,()=>a.ensureListDefinition(m,P)),applyPmDoc:m=>De==="view"?{committed:false,rejected:true,opCount:0,reason:g$1}:d?{committed:false,rejected:true,opCount:0,reason:"collaboration-pm-doc-unproven"}:gm()?{committed:false,rejected:true,opCount:0,reason:y}:a.applyPmDoc(m)},Sa=()=>{},Qn=()=>{},Cn=fA({now:Ee,view:()=>Ae(w),pageAfterView:()=>{let m=Ta();return m&&m.size>0?Math.max(...m)+1:void 0},current:()=>be,partial:()=>cn!==null,revision:()=>a.packageRevision(),publish:m=>o.wrap(()=>vi(m))(),snapshot:()=>pg(E),pendingChanged:m=>e.toggleAttribute("data-docx-layout-pending",m||cn!==null),passTimed:m=>n.onTiming?.("layout",m)}),cn=r.progressiveOpen?Rc:null,be=Ft(),Jn=n.revisionStyles,Us=NA(n.showParagraphMarks??false,ot,()=>Pt(false)),wa=NC({session:Fo,storyScope:je,orderedRange:()=>fo(),writeRefusal:()=>vr(true),commit:(m,P)=>Be(m,P),goToPosition:(m,P)=>Oe.goToPosition(m,P),setSelection:m=>St(m),beforeChange:ot,repaint:()=>Pt(false),options:n}),ka=r.reviewAuthorSlots??i(),hr=KL({layout:Re,items:()=>a.reviewItems(),styles:()=>Jn,slots:ka});function nd(m){en(),d?.flushPendingJournals();let P={selection:N,format:He},L=JSON.stringify(On.formatting()),_=oM(N,He,m,()=>ei(a.partFor(je())??a.part(),N.head.paragraphId,N.head.offset,Yt(),vt()));_!==void 0&&(He=_,L!==JSON.stringify(On.formatting())&&st.record(P,{selection:N,format:He},Hv(ve)),ae.end(),B.update(),n.onChange?.(xt()));}let On=_D({runFormatRefusal:()=>Vn({type:"toggleMark"},ve)?.reason??null,session:Fo,applyOutsideToc:(m,P)=>{let L=m.filter(_=>!a0(_));if(L.length===0)return P(m);h=true;try{return P(L)}finally{h=false;}},storyScope:je,paragraphOrder:rt,layout:Re,selection:()=>Bt.shownSelection(N),displayMode:()=>Yt(),authorFilter:vt,paragraphMarkVisible:xa,commit:(m,P,L)=>Be(m,P,L),orderedRange:()=>Bt.shownRange(fo()),selectionMark:()=>it(),textOf:m=>zt(m),selectedCells:()=>F?.cellIds,defaultParagraphStyleId:()=>mn()?.defaultParagraphStyleId??null,defaultFontFamily:()=>n.defaultFontFamily??null,pendingFormats:()=>Mt(),setPendingFormats:nd}),bi=$D({session:Fo,storyScope:je,layout:Re,selection:()=>Bt.shownSelection(N),displayMode:()=>Yt(),authorFilter:vt,paragraphMarkVisible:xa,commit:(m,P,L)=>Be(m,P,L),orderedRange:()=>Bt.shownRange(fo()),selectionMark:()=>it(),textOf:m=>zt(m),paragraphOrder:rt,selectedCells:()=>F?.cellIds,armPendingFormats:m=>nd(m),now:Ee,publish:()=>{bi.state().mode!=="off"?w.dataset.formatPainter="":delete w.dataset.formatPainter,n.onChange?.(xt());}}),Mn=O1({session:Fo,storyScope:je,headerFooterSectionIndex:()=>Xe?.getActive()?.sectionIndex,revisionDisplayMode:Yt,revisionAuthorFilter:vt,paragraphOrder:rt,selectedCells:()=>F?.cellIds,editingMode:()=>De,publishRefusal:G,caretParagraphId:()=>N.anchor.paragraphId===N.head.paragraphId&&N.anchor.offset===N.head.offset?N.head.paragraphId:null,layout:Re,commit:(m,P,L)=>Be(m,P,{rearmPending:_t()??void 0,...L?.keepCellSelection?{keepCellSelection:true}:{}}),orderedStart:()=>vm(),orderedRange:()=>fo(),selectionMark:()=>it(),collapsedAt:m=>Ke(m),deleteSelectionPlan:()=>po(),paragraphTextOf:m=>zt(m),numberingLevelExists:(m,P)=>qd(Nd(Xn(),mn()),m,P)!==null,...c1(()=>Nd(Xn(),mn())),styleCascade:mn,defaultTabStopPt:ln});function io(m,P,L){return De!=="suggest"?null:xm({paragraphId:m,offset:P},{paragraphId:m,offset:L})}let A=H1({session:Fo,collaborative:!!d,layout:Re,fieldLinkById:m=>yi.linkById(m),refusesWrite:()=>vr(true)!==null,withMintActor:m=>Hb$1(d?.identity.actorId,m),storyScope:je,replacementLanding:io,insertionLanding:(m,P)=>_b$1(Re(),{paragraphId:m,offset:P}).offset,selection:()=>N,orderedRange:()=>fo(),selectionMark:()=>it(),textOf:m=>zt(m),commit:(m,P)=>Be(m,P)}),ne=$F({session:Fo,storyScope:je,editingMode:()=>De,writeRefusal:m=>vr(true,[m]),trackedOps:um,selection:()=>N,selectionMark:()=>it(),commit:(m,P)=>Be(m,P)}),ie=m=>{let P=Et(a,m,{kind:"body"});if(P.kind==="body")return Ye?.exitNote(),Xe?.exitHeaderFooter(),true;if(P.kind==="headerFooter"){let _=Xe?.activeScope();return _?.kind==="headerFooter"&&_.rId===P.rId?true:(Ye?.exitNote(),Xe?.enterHeaderFooter({rId:P.rId})??false)}let L=KT(be,m);return L?Ye?.activeNoteScope()?.id===L?true:(Xe?.exitHeaderFooter(),Ye?.enterNote(L)??false):false},Oe=W1({pagesLayer:w,get container(){return e},scale:()=>f,layout:Re,bookmarks:()=>a.bookmarks(),linkById:m=>yi.linkById(m)??A.linkById(m),drawingLinkById:m=>j1(be,m),setSelection:m=>St(Ke(m)),whenLaidOut:(m,P)=>id$1(m,P),beginJump:()=>od(),enterStoryFor:m=>ie(m),isCollapsedSelection:()=>Ht(N,Ke(N.head)),onScrolled:()=>cd(),...n.onHyperlinkPopover?{onPopover:n.onHyperlinkPopover}:{}}),Te$1=BF({pagesLayer:w,equationById:m=>ne.equationById(m),setSelection:m=>St(m,false,"none"),...n.onEquationPopover?{onPopover:n.onEquationPopover}:{}});w.addEventListener("contextmenu",Wx),w.addEventListener("click",qx),w.addEventListener("pointermove",Dx),w.addEventListener("pointerleave",Hx);let Ve=LA(w),Le$1=null;function ht(m,P,L,_){return Sa(),Cn.finish(),Yf$1(Fe(m,P,L,_))}function*Fe(m,P,L,_){let V=L?L.authorFilter:vt(),Q=!L||L.furnitureSource===Qt;Q&&Ks.moved(Qt,V)&&(Qt=En(V));let te=L?.layoutSession??E,pe=Q||!L?Qt:L.furnitureSource;return P&&Md(te,P),!L&&_===void 0&&(cn=null),Sn.sync(a),yield*b({view:s.view(a),revision:m,measurer:v$1,cache:k,session:te,producer:R,styleCascade:mn,defaultTabStopPt:ln,numberingIndex:Xn,furniture:pe,compatibilityMode:gi,linkProjectors:td,projectFieldLink:he=>yi.project(he),inlineDrawingLayout:Sn.bodyContext,inlineDrawingLayoutForPart:he=>Sn.contextForPart(he),drawingTokenForParagraph:he=>Sn.drawingTokenForParagraph(he,a.part().name),drawingTokenForParagraphForPart:(he,Ie)=>Sn.drawingTokenForParagraph(Ie,he),drawingLayoutEpoch:Sn.cacheTokenForPart(a.part().name),drawingLayoutEpochForPart:he=>Sn.cacheTokenForPart(he),displayMode:Yt(),showFieldCodes:L&&!L.live?false:gr,fieldResults:o.mode,revisionAuthorFilter:V,bodyBlockLimit:_})}function Ge(){return ht(a.packageRevision(),void 0,{layoutSession:Cg(),furnitureSource:En(void 0,false)})}function Ft(){let m=Ee(),P=ht(a.packageRevision(),void 0,void 0,cn??void 0);return Lt=Ee()-m,P}let Ne=nt(()=>w),We=null,ct=0,Jt=false,er=null,An=false;function ao(){if(An)return;An=true;let m=a.packageRevision();er=iN({steps:oN(()=>a.part()),shouldRun:()=>De!=="view"&&a.editable&&a.packageRevision()===m,hasPendingInput:gn,schedule:(P,L)=>{let _=Ne.setTimeout(P,L);return ()=>Ne.clearTimeout(_)}});}function gn(m=true){return BM(e,m)}function js(){if(ct>0){Jt=true,ao();return}if(!gn()){Pt(),ao();return}We===null&&(We=Ne.setTimeout(o.wrap(()=>{We=null,yt.pending()===null&&(Pt(),ao());}),0));}let yr="",br=null,Ln=false;function en(){if(Ln||(br!==null&&(Ne.clearTimeout(br),br=null),yr.length===0))return;let m=yr;yr="",Ln=true;try{As(ve,ae.groupAt(N),()=>ve.type(m)),ae.landed(N);}catch(P){throw yr=m+yr,P}finally{Ln=false;}}function Vs(m){yr+=m,br===null&&(br=Ne.setTimeout(o.wrap(()=>{br=null,en();}),0));}function tn(m,P,L){en();let _=L?.trim()||u$1?.trim();if(!_)return G("tracked changes need a non-empty author");if(m!=="deletion"&&P.length===0)return G(`${m} requires non-empty text`);if(m!=="deletion"&&/[\r\n\v\f\u2028\u2029]/.test(P))return G(`${m} requires text without a paragraph mark`);let V={author:_,date:j$1()},Q=fo(),te=Q.from.paragraphId===Q.to.paragraphId&&Q.from.offset===Q.to.offset;if(m!=="insertion"&&te&&!(m==="replacement"&&F))return G(`${m} needs a non-collapsed selection`);let pe=m==="insertion"?{ops:[],collapseTo:_b$1(Re(),Q.from)}:po(_),he=Lc(pe.ops,V,Gx()),Ie=pe.collapseTo;if(m==="insertion"||m==="replacement"){let ge=m==="replacement"?pe.replaceAt??pe.collapseTo:pe.collapseTo;he.push({op:"insertText",paragraphId:ge.paragraphId,offset:ge.offset,text:P,revision:V}),Ie={paragraphId:ge.paragraphId,offset:ge.offset+P.length};}let ke=false;return Be(()=>{let ge=dt(he,it(),uo(Ie));return ke=ge.committed,ge},()=>Ke(Ie)),ke}function nn(m){ki=false,dd.without(m),ki=false;}let Ia=G1({settle:()=>ot(),refuse:m=>G(m),storyParagraphs:()=>rt(),textOf:m=>zt(m),rangePlan:m=>K8(m),insertionPoint:m=>_b$1(Re(),m),selection:()=>N,selectionMark:()=>it(),commitWithoutFollow:(m,P,L)=>{let _=false;return nn(()=>Be(()=>{let V=dt(m,P,P,je(),false);return _=V.committed,V},L)),_},flushLayout:()=>$t(),noteModelMoved:()=>ze.noteModelMoved(),selectionsEqual:Ht}),yt=ha({run:m=>{let P=Ee();Sa(),Cn.abandon();let L=EA(Fe(m.revision,m,void 0,cn??void 0),Ta()),_=Cn.run(L,m.revision,qO(m));return cn=zg$1(E,cn),Lt=Ee()-P,_},currentRevision:()=>a.packageRevision(),schedule:m=>{let P=Ne.setTimeout(o.wrap(m),0);return ()=>Ne.clearTimeout(P)},publish:m=>vi(m)});function vi(m){hr.releaseLayout(),be=m;let P=no.map(N);P!==N&&(N=P,ze.noteModelMoved(),Ii()),js(),Ra.request();}let Ra=gA({now:Ee,schedule:(m,P)=>Ne.clearTimeout.bind(null,Ne.setTimeout(o.wrap(m),P)),revision:()=>a.packageRevision(),live:()=>E,current:()=>be,busy:()=>Cn.pending()||cn!==null,pass:(m,P)=>Fe(m,void 0,{authorFilter:vt(),layoutSession:P,furnitureSource:Qt,live:true}),createSession:Cg,adopt:(m,P)=>{E=m,vi(P);}}),Pa=false;ya=()=>{cn===null&&(yt.invalidateAll(a.packageRevision(),"drawing-resources"),!Pa&&(Pa=true,Ne.setTimeout(o.wrap(()=>{Pa=false,$t();}),0)));};let xi=a.subscribe(m=>{l.retain(m),m.origin!==g.mutationRemote&&m.origin!==g.mutationUndo&&m.origin!==g.mutationRedo&&st.noteEdit(),He=null,Ln||ae.noteForeignChange(m),m.origin===g.mutationRemote?(E8(m),no.note(N,m.dirty,be.revision===m.fromRevision)):no.noteLocal(),yt.notify(m);}),Do=d?a.collaborationPort(d.documentId):null,Rt=()=>{},Dr=()=>{},Nr=false,so=null,lo=null,Si=d?d.subscribeRemoteSelections(()=>{Nr&&gd();}):()=>{};function Ta(){let m=NL(e,be,N,f),P=Xe?.getActive()?.pageIndex??ze.selectionPageIndex();return P===void 0||m===void 0||m.has(P)?m:new Set([...m,P])}function Gs(){Jt&&Pt();}function $t(){return yt.pending()?yt.flush():false}let v8=8;function x8(m){!m&&yt.pending()!==null&&Lt>v8&&gn(false)||(!$t()||m&&Jt)&&Pt();}function ot(){en(),$t();}function rd(){en();let m=$t();return We!==null||Jt?(Pt(),ao(),true):m}let zs=null;function Lx(m){return oE(m,a.part())}function S8(){for(let m of w.querySelectorAll(".docx-content-control-chrome[data-docx-toc]")){if(m.getAttribute("data-docx-content-control")===zs){m.dataset.hover="",m.dataset.boundaryVisible="";continue}delete m.dataset.hover,Se$1||delete m.dataset.boundaryVisible;}}function Fx(m){zs!==m&&(zs=m,S8());}function tm(m){return iE(a.part(),Nx(m),m.target)}function Dx(m){let P=tm(m);Fx(P?Lx(P):null);}function Nx(m){let P=m.target,L=P?.isConnected?P.closest("[data-paragraph-id]"):void 0;if(L)return L.dataset.paragraphId;let _=w.ownerDocument;return typeof _.elementFromPoint!="function"?void 0:_.elementFromPoint(m.clientX,m.clientY)?.closest("[data-paragraph-id]")?.dataset.paragraphId}function Hx(){Fx(null);}function w8(){let m=Hr(),P=Fb$1(a.part()),L=Ch$1(a.part()),_=L.map(ge=>{let wt=eA(ge,be,a.part(),v$1);return wt?{...wt,empty:P.has(ge.beginParagraphId)}:null}).filter(ge=>ge!==null),V=new Set(_.map(ge=>ge.boundary.id)),Q=new Set(_.filter(ge=>ge.empty).map(ge=>ge.boundary.id));for(let ge of L)ge.contentControlId&&Lx(ge)!==ge.contentControlId&&Q.add(ge.contentControlId);let te=m&&!V.has(m.id)?new Set([m.id]):void 0,pe=zs?new Set([zs]):void 0,he=new Set(Te(be).filter(ge=>ge.controlType==="checkbox"&&rm(ge.id)).map(ge=>ge.id)),Ie=_.filter(ge=>ge.additional&&!ge.empty).map(ge=>ge.boundary),ke=jx()!==null;if(!(!Se$1&&!te&&!pe&&!ke&&he.size===0&&Ie.length===0&&V.size===0))return {...ke?{readOnly:true}:{},...Se$1?{showAll:true}:{},...te?{activeIds:te}:{},...pe?{hoverIds:pe}:{},...he.size>0?{checkedIds:he}:{},...Ie.length>0?{additionalBoundaries:Ie}:{},...V.size>0?{tocControlIds:V}:{},...Q.size>0?{suppressedIds:Q}:{}}}let Zs=null;function Hr(){let m=je();if(m.kind!=="body")return I8(m);if(Zs&&Zs.layout===be&&Zs.selection===N)return Zs.result;let P=k8();return Zs={layout:be,selection:N,result:P},P}function k8(){let m=FA(be,N,v$1);return m&&de(a,m.id)?.name===a.part().name?m:null}function I8(m){let P=a.partFor(m);return P?Wf$1(P,N.head.paragraphId):null}function _r(m){let P=de(a,m),L=eb$1(P??a.part(),m);return !L||!ld(L)?null:L}function _x(m){let P=_r(m);if(!P)return null;for(let L of P.children)if(L.kind!=="textValue"&&(L.kind==="contentControlProperties"||L.localName==="sdtPr"))for(let _ of L.children){if(_.kind==="textValue"||_.localName!=="tabIndex")continue;let V=_.attributes.find(te=>te.localName==="val")?.value;if(V===void 0)return null;let Q=Number(V);return Number.isFinite(Q)?Q:null}return null}function R8(){let m=je(),P=m.kind==="body"?null:a.partFor(m),L=m.kind==="notesPart"?new Set(rt()):void 0;return (P?[...Vf$1(P,L)]:[...Te(be)]).filter(V=>Ov(V)===null).sort((V,Q)=>{let te=_x(V.id),pe=_x(Q.id);return te!==null&&pe!==null&&te!==pe?te-pe:te!==null&&pe===null?-1:te===null&&pe!==null?1:0})}let{begin:od,later:id$1}=dA(()=>ve,{flushLayout:()=>{$t();},paragraphIds:()=>a.paragraphIds(),scroller:()=>Nt(e)});function nm(m){Xe?.getActive()||Ye?.activeNoteScope()||Et(a,m.paragraphId,{kind:"body"}).kind==="body"&&ve.revealPosition(m);}function P8(m){let P=_r(m);if(!P)return false;let L=z1(P,{contentChildrenOf:Z1,searchRoots:()=>(a.partFor(Et(a,m,je()))??a.part()).root.children});if(!L)return false;let _=N;return St(L,false,"none"),(N!==_||Ht(N,L))&&nm(N.anchor),true}let Bx=m=>zM(_r(m),()=>a.currentPackage());function rm(m){let P=_r(m);if(!P)return false;for(let L of P.children)if(L.kind!=="textValue"&&!(L.kind!=="contentControlProperties"&&L.localName!=="sdtPr")){for(let _ of L.children)if(_.kind==="contentControlCheckbox")for(let V of _.children){if(V.kind!=="contentControlChecked")continue;let Q=V.attributes.find(te=>te.localName==="val")?.value;return !(Q==="0"||Q==="false"||Q==="off")}}return false}let $x=m=>ZM(_r(m));function ad(m,P){for(let L of w.querySelectorAll("[data-docx-content-control]"))L.getAttribute("data-docx-content-control")===m&&(P?L.dataset.open="":delete L.dataset.open);}let wi=AA({get document(){return w.ownerDocument},layer:w,find:_r,layout:Re,selectDrawing:(m,P)=>ve.selectDrawing(m,P),allowed:m=>!co.disabledReason(m,"edit"),translate:m=>Qs?.(m)??m,replaceImage:(m,P,L,_)=>ve.replaceImage(m,P,L,{expectedPackageRevision:a.packageRevision(),commitGuard:_}),setOpen:ad,reject:G}),om=GM({find:_r,allowed:m=>!co.disabledReason(m,"edit"),apply:(m,P)=>co.setValue(m,P),items:Bx,date:$x,checked:rm,picture:wi.drawingOf,replaceImage:wi.replace,locale:()=>ud.get(),layer:w,setOpen:ad,request:n.onRequestContentControlWidget}),sd=null,im;function am(m){sd===m&&(sd=null,im?.(),im=void 0);let P=m.dataset.docxCcId,L=m.contains(w.ownerDocument.activeElement);m.remove(),P&&ad(P,false),L&&w.focus({preventScroll:true});}function ld$1(){om.cancel();let m=sd;return m&&am(m),m}function Wx(m){let P=tm(m),L=P&&(bm(P.id)||!l0.removeTocRefusal(P.id));sm(L?P.id:null);}let Ea=null;function sm(m){Ea!==m&&(Ea=m,n.onChange?.(xt()));}function qx(m){if(m.button===0&&sm(null),m.button!==0||m.target?.closest("a.docx-hyperlink")||!Ht(N,Ke(N.head)))return;let P=Nx(m);if(!P)return;let L=Ch$1(a.part()).find(Q=>Q.resultParagraphIds.includes(P));if(!L||tm(m)?.id!==L.id)return;let V=Qi$1(a.part(),L,a.documentOutline(),hm(L))[L.resultParagraphIds.indexOf(P)];V&&(m.preventDefault(),Oe.goToPosition({paragraphId:V,offset:0}));}let Kx={get document(){return w.ownerDocument},locale:()=>ud.get(),translate:m=>Qs?.(m)??m,setValue:(m,P)=>co.setValue(m,P),close:m=>am(m)};function T8(m,P){let L=co.disabledReason(m,"edit");if(L){U=Y(L),n.onChange?.(xt());return}if(wi.cancel(),ld$1()?.dataset.docxCcId===m||(P==="picture"&&wi.select(m),om.open(m,P)))return;if(P==="picture")return wi.pick(m);if(P==="checkbox"){co.setValue(m,rm(m)?"false":"true");return}let _=Te(be).find(Q=>Q.id===m)?.alias,V;if(P==="dropdown"||P==="comboBox"||P==="buildingBlockGallery"){let Q=Bx(m);if(Q.length===0&&P==="dropdown")return;V=rL(Kx,m,P,Q,_,Rb(_r(m),Q));}else if(P==="date")V=oL(Kx,m,$x(m),_);else return;sd=V,nL(V,w,UM(be,f,m,w,Ct?.pageOffsetX)),ad(m,true),im=Uf(V,()=>am(V)),P==="date"?rp(V):(V.querySelector("input")??V.querySelector('[role=option][tabindex="0"]')??V.querySelector("button,[data-docx-part=empty]"))?.focus({preventScroll:true});}let co={setShowAll(m){Se$1!==m&&(Se$1=m,Pt());},setFormFill(m){at!==m&&(at=m,n.onChange?.(xt()));},showAll:()=>Se$1,formFill:()=>at,atCaret:()=>Hr(),navigate(m){let P=R8();if(P.length===0)return false;let L=Hr(),_=L?P.findIndex(Q=>Q.id===L.id):-1;m==="next"?_=_<0?0:(_+1)%P.length:_=_<0?P.length-1:(_-1+P.length)%P.length;let V=P[_];return P8(V.id)},setValue(m,P){let L=co.disabledReason(m,"edit");if(L)return G(L);let _=YM(_r(m),()=>a.currentPackage(),m,P);if(!_)return G("unknown-building-block");let V=false;return Be(()=>{let Q=dt(_,it(),void 0,Et(a,m,je()),false);return V=Q.committed,Q}),V},remove(m){let P=m??Hr()?.id;if(!P)return G("notFound");let L=co.disabledReason(P,"remove");if(L)return G(L);let _=false;return Be(()=>{let V=dt([{op:"removeContentControl",controlId:P}],it(),void 0,Et(a,P,je()),false);return _=V.committed,V}),_},disabledReason(m,P){let L=jx();if(L!==null)return L;let _=Te(be).find(Q=>Q.id===m);if(_)return P==="remove"?I1(_):Ov(_);let V=_r(m);return V?Pp(V,P):"notFound"}},lm=()=>TD(w,cm&&De!=="view");function xt(){return {revision:a.packageRevision(),pageCount:be.pages.length,selection:N,cellSelection:F,canUndo:st.canUndo||(d?.canUndo()??a.canUndo()),canRedo:st.canRedo||(d?.canRedo()??a.canRedo()),collaborationStatus:d?.status()??"inactive",lastRejection:U,pendingFormat:Mt(),contentControls:{showAll:Se$1,formFill:at,activeControlId:Hr()?.id??null},contextTocId:Ea,formatPainter:bi.state(),perf:{layoutMs:Lt,paintMs:ha$1,selectionMs:Tn,placed:E.stats.placed,total:E.stats.total,reusedPages:E.stats.reusedPages,fullPasses:E.stats.fullPasses,staleDiscards:yt.staleDiscards,cancelledRuns:yt.cancelledRuns}}}let hn,Ct,ki=false,Xs=null,Ca=qL({pagesLayer:w,listeners:T,viewport:()=>Xs,container:()=>e,setContainer:m=>e=m,destroyed:()=>mo,scale:()=>f,settle:()=>{rd(),Sa(),Cn.finish(),ld$1(),wi.cancel(),yd?.cancelGesture(),La.cancelDrag();},repaint:()=>Pt(false),onHostMoved:m=>n.onHostMoved?.(m)});function Pt(m=true){if(We!==null&&(Ne.clearTimeout(We),We=null,m=true),Ca.heal(),Ca.parked()){Jt=false,md(),m&&n.onChange?.(xt());return}Jt=false;let P=ze.adoptBeforePaint(),L=Ee();hn=Ta(),Xe?.reconcileOccurrence();let _=Xe?.getActive()??null,V=w8(),Q=Fb$1(a.part());v(w,be,{scale:f,readOnlyParagraphIds:rf(a.part()),...Q.size>0?{emptyTocPlaceholderIds:Q}:{},...n.fontAlias?{fontAlias:n.fontAlias}:{},serifHangulFace:x,...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},materialize:hn,ariaHidden:false,drawingStrings:ro,...$O(s,a),breakMarkStrings:va,...n.fieldShading?{fieldShading:n.fieldShading}:{},...Jn!==void 0?{revisionStyles:Jn}:{},revisionMarkup:hi.current(),facingPages:kM(Cf$1(a.currentPackage())),shadeFormFields:em(),showParagraphMarks:Us.get(),changeBars:Jc(),changeBarsToggle:!!n.reviewModel,...Qc?{imageUrlPort:Qc}:{},..._?{activeHeaderFooterRId:_.scope.rId,activeHeaderFooterPageIndex:_.pageIndex}:{},...V?{contentControlChrome:V}:{}},hr.get().value),gt?.syncDom(),Kb(w,Ws(),{domReplaced:true}),$T(e,w,_!=null),Ph(e,De),Ct=cp(be,hn),_L(w,be,Ct,f),w.style.width=`${Ct.width*f}px`,w.style.height=`${Ct.height*f}px`,e.style.width=`${Ct.width*f}px`,e.style.height=`${Ct.height*f}px`;let{width:te,height:pe}=Ct;lN(se,`${te*f}px`,`${pe*f}px`),La.update(),ha$1=Ee()-L,n.onTiming?.("paint",ha$1),ol(),gd(),Aa(true),wa.paint(i0(M)),md(),Xs?.watchScrollerSize(),ze.mirrorToDom(),Ux(ki),ki=false,(m||P)&&n.onChange?.(xt());}function cd(){ot();let m=Ta(),P=cp(be,m);Ct&&Vb(m,hn)&&HL(P,Ct)||Pt(false);}let dd=V1({storyScopeOpen:()=>!!(Xe?.getActive()||Ye?.activeNoteScope()),selection:()=>Bt.shownSelection(N),layout:Re,measurer:()=>v$1,preferredPageIndex:()=>ze.selectionPageIndex(),preferredLineId:()=>ze.selectionLineId(),pagesLayer:w,get container(){return e},scroller:()=>Nt(e),scale:()=>f,scheduleRematerialize:()=>Xs?.schedule()});function Ux(m=false,P="caret"){dd.follow(m,P);}let De=n.editingMode??"edit",cm=true,Ys=Object.freeze({kind:"body"}),ud=YA(n.locale,en),Qs=n.translate,Dt=null,fd=null,dm=null;function dt(m,P,L,_=je(),V=true,Q){en();let te=vr(m.some(Vx)||!!Q?.length,m,V);if(te!==null)return {committed:false,rejected:true,opCount:0,reason:te};let pe=um(V&&Dt?Dt.annotate(m):m),he=Oa(pe,P,L,_,Q);return V&&Dt?.afterApply(he.committed),he.committed&&pe.some(Ac)&&r.onTrackedChange?.(),he}let{apply:Oa,noteRemoteChange:E8}=$1({session:a,collaboration:d,historyGroup:()=>oe.value,defaultScope:()=>je(),canRepair:()=>!mo&&De!=="view"&&a.editable,later:m=>Ne.setTimeout(o.wrap(m),0)});function vr(m,P=[],L=true){if(lr(e))return bs(e);let _=eN(P);return De==="view"&&!_?g$1:gr&&m&&L&&!_&&JM(V=>de(a,V),N)?ia:m&&!_&&(L&&!h&&gm()||P.some(V=>a0(V)))?y:De==="suggest"&&!u$1?.trim()&&m?xe:De==="suggest"?MC(a,u$1,P):null}let jx=sC(()=>vr(true,[],false),()=>a.editable);function Vx(m){return m.op!=="acceptRevision"&&m.op!=="rejectRevision"&&m.op!=="acceptAllRevisions"&&m.op!=="rejectAllRevisions"&&m.op!=="setRevisionAttribution"}let Gx=()=>hi.current().trackFormatting&&!a.trackingSettings().doNotTrackFormatting;function Js(){let m=u$1?.trim();return De==="suggest"&&m?m:void 0}function zx(m,P,L){let _=de(a,m)??a.part(),V=Js()!==void 0;return eC(_,m,P,L,V)}function um(m,P=j$1()){let L=Js();return L===void 0?[...m]:Lc(m,{author:L,date:P},Gx())}function Zx(){return {displayMode:Yt(),authorFilter:vt()}}function Xx(m){let P=Bt.removedCaretEdit(N.head,m);return P===null?false:(Be(()=>dt(P.ops,it(),uo(P.caret)),()=>Ke(P.caret)),true)}function fm(m){let P=$8(m,L=>Bt.shown(L));if(P?.kind==="select")St(P.selection);else if(P){let L=_t()??void 0;Be(()=>dt(P.ops,it(),uo(P.collapseTo)),()=>Ke(P.collapseTo),{rearmPending:L});}return P!==null}function uo(m){return {paragraphId:m.paragraphId,start:m.offset,end:m.offset}}function Be(...m){if(lr(e))return Y(bs(e));let P=UA(e);try{return C8(...m)}finally{P();}}function C8(m,P,L={}){en(),Ln||ae.end();let _=an.begin();L?.keepCellSelection||(F=null),He=null,ze.noteModelMoved(),ct+=1;let V=null;try{let Q=oe.around(ve,m,pe=>typeof pe=="boolean"?pe:pe.committed,!L?.automation),te=typeof Q=="boolean"||!Q.rejected?null:Q;if(te){let pe=String(te.reason??Ic);V=U=Y(iC(pe,a.settingsRoot()),pe);}else {U=null,(typeof Q=="boolean"?Q:Q.committed)&&le();let pe=P?.();pe&&(rl(),N=pe,X({kind:"none"},!1),Le$1=null,ki=!0);let he=L?.rearmPending;if(he&&he.properties.length>0){let{anchor:Ie,head:ke}=N;Ie.paragraphId===ke.paragraphId&&Ie.offset===ke.offset&&(He={properties:he.properties,base:he.base,position:ke});}}_(),Ii();}catch(Q){if((ct-=1)===0&&Jt)try{Pt();}catch{}throw Q}return ct-=1,x8(V!==null),V}function O8(){if(!hn)return true;for(let m of [N.anchor,N.head]){let P=Se(Re(),m);if(P&&!hn.has(P.pageIndex))return false}return true}function Ii(){let m=d;if(!m)return;let P=Do?VL(F?.text??N,_=>{let V=de(a,_)??a.part();return GL(V,_)},F?"cells":void 0):null,L=P?`${P.anchor.paragraphId}:${P.anchor.offset}|${P.head.paragraphId}:${P.head.offset}|${P.kind??""}`:"";L!==lo&&(lo=L,m.setLocalSelection(P));}function St(m,P=false,L="caret",_){let V=!Ht(m,N);gt?.active()&&(!gt.contains(m.anchor.paragraphId)||!gt.contains(m.head.paragraphId))&>.exit(false),V&&yr.length>0&&en();let Q=Dt?.beforeSelect(m);if(Q===null)return;V&&!Ln&&(ae.end(),st.endGroup()),m=Q??m,fi(m),et(m);let te=Hr()?.id??null,pe=ar(a.part(),N.head)?.id;rl(),N=m,F=null,P||(Le$1=null),O8()||(ze.noteModelMoved(),L==="none"?dd.without(()=>Pt(!1)):Pt(false)),ze.noteSelectionSettled(),ze.notePointerCaret(_),ze.mirrorToDom(true),Ux(true,L),ol(),Ri.clear(),Aa();let he=Hr()?.id??null,Ie=ar(a.part(),N.head)?.id;(te!==he||pe!==Ie)&&Pt(false),Ii(),n.onChange?.(xt());}let ze=XD({session:a,storyScope:je,pagesLayer:w,selection:()=>N,setSelection:m=>St(m),adoptSelection:m=>{let P=Dt?.beforeSelect(m);P!==null&&(m=P??m,fi(m),et(m),rl(),N=m,Le$1=null,ki=true,Ii());},commit:m=>Be(m),insertOwner:()=>ds(Hr()),promptLanding:zx,applyOps:(m,P,L)=>dt(m,P,void 0,L),hasPendingInput:()=>yr.length>0,replacementOffset:(m,P,L)=>xm({paragraphId:m,offset:P},{paragraphId:m,offset:L}),render:()=>Pt(),flushLayout:()=>$t(),flushToPaint:()=>rd(),updateCaret:()=>{B.update(),Kb(w,Ws());},textOf:m=>zt(m),pendingFormatOps:(m,P,L,_)=>to(m,P,L,_),selectionMark:()=>it(),now:Ee,recordSelectionMs:m=>{Tn=m;},isGesturing:()=>z.kind==="pointer"||(yd?.dragging()??false),domSelection:()=>F?Ke(F.text.anchor):N,holdsCellSelection:()=>F!==null,replaceSelectionWith:m=>ve.type(m),discardPaint:()=>t(w)});Xe=J1({session:a,layout:()=>be,sectionAtPage:Zn,revisionDisplayMode:Yt,revisionAuthorFilter:vt,selection:()=>N,setScopeSelection:m=>{en(),rl(),fi(m),Ri.clear(),N=m,F=null,Le$1=null,Ii();},noteModelMoved:()=>ze.noteModelMoved(),render:()=>Pt(),mirrorToDom:()=>ze.mirrorToDom(),notify:()=>n.onChange?.(xt()),materializedPages:()=>hn,entryRefused:()=>De==="view",leaveOtherStories:()=>{Ye?.exitNote(),gt?.exit();}}),Ye=QD({session:a,exitHeaderFooter:()=>{Xe?.exitHeaderFooter(),gt?.exit();},applyOps:dt,commit:Be,selection:()=>N,selectionMark:()=>it(),orderedStart:()=>vm(),deleteSelectionPlan:()=>po(),undo:()=>ve.undo(),activeScope:()=>{let m=gt?.active();if(m)return m;let P=Ye?.activeNoteScope();return P||(Xe?.activeScope()??{kind:"body"})},setActiveScopeBodyOrHf:m=>Xe.setActiveScope(m),setSelection:m=>St(m),noteModelMoved:()=>ze.noteModelMoved(),render:()=>{$t()||Pt();},revealNote:m=>{$t();for(let P of be.pages){let L=[...P.footnotes?.notes??[],...P.endnotes?.notes??[]].find(_=>_.scopeId===m);if(L)return al(L.box.y,L.box.height,{block:"nearest",offsetPx:48}),P.index}return null},notify:()=>n.onChange?.(xt()),lastRejection:()=>U,setLastRejection:m=>{U=m===null?null:Y(m);}});function pd(m){m&&en(),F=m,m&&(fi(m.text),rl(),N=m.text),Le$1=null,ze.noteSelectionSettled(),ze.mirrorToDom(),ol(),Ri.clear(),Aa(),Ii(),n.onChange?.(xt());}let No=null;function M8(){let P=Se(Re(),N.head)?.pageIndex??0,L=new Set;for(let _=P-1;_<=P+1;_+=1)_>=0&&_<be.pages.length&&L.add(_);return L}function A8(){let m=a.revision(),P=hn??M8();if(No?.layout===be&&No.revision===m&&Vb(No.pages,P))return No.rects;let L=P?$e(be,P):()=>true,_=[];for(let te of Ma()){if(te.kind==="comment"){if(te.range===null||!L(te.range.start.paragraphId,te.range.end.paragraphId))continue;_.push({key:nl(te),from:{paragraphId:te.range.start.paragraphId,offset:te.range.start.offset},to:{paragraphId:te.range.end.paragraphId,offset:te.range.end.offset}});continue}let pe=nl(te),he=te.kind==="revision"?te.ranges:te.range?[te.range]:[];for(let[Ie,ke]of he.entries())L(ke.start.paragraphId,ke.end.paragraphId)&&_.push({key:he.length===1?pe:`${pe}${b$1}${Ie}`,from:{paragraphId:ke.start.paragraphId,offset:ke.start.offset},to:{paragraphId:ke.end.paragraphId,offset:ke.end.offset}});}let V=gL(be,_,P,v$1),Q=[];for(let[te,pe]of V)for(let he of pe)Q.push({...he,key:te});return No={layout:be,revision:m,pages:P,rects:Q},Q}let Ri=new Set,el=null,tl,nl$1=null,pm=false,Yx=false;function rl(){pm||(nl$1=null);}function Qx(){let m=nl$1;if(!m||!N)return null;let P=(_,V)=>_.paragraphId===V.paragraphId&&_.offset===V.offset;if(!P(N.anchor,m.anchor)||!P(N.head,m.head))return null;let L=Ma().find(_=>nl(_)===m.key);return !L||L.kind==="custom"&&!L.carded||L.kind==="revision"&&el!==null&&el.has(L.revisionKind)&&(L.revisionKind!=="format"||tl===void 0||tl.has(L.formattingKind??""))&&!Yx?null:L}function mm(){let m=Qx();if(m)return Jx(m);if(!N)return null;let L=wl(Ma(),N.anchor,N.head,c()).filter(_=>!(_.kind==="comment"&&_.resolved)&&!Ri.has(nl(_))&&!(_.kind==="custom"&&!_.carded)&&!(_.kind==="revision"&&el!==null&&el.has(_.revisionKind)&&(_.revisionKind!=="format"||tl===void 0||tl.has(_.formattingKind??""))))[0];return L?Jx(L):null}function Jx(m){if(m.kind!=="comment")return m;let P=yl(Ma(),m);return Ri.has(nl(P))?null:P}function Ma(){return Yn.filterItems(a.reviewItems())}let e0=UL({roster:hr.get,styles:()=>Jn,slots:ka}),t0=e0.forAuthor,L8=e0.declaredFor;function F8(m,P,L){let _=m.split(b$1),V=_[0],Q=P.has(V);if(m.startsWith("comment-")){let ke=L.get(V),ge=ke?.kind==="comment"&&ke.resolved;return ge&&!Q?null:Q?`docx-comment-band docx-comment-band--active${ge?" docx-comment-band--resolved-active":""}`:"docx-comment-band"}if(m.startsWith("custom-"))return Q?"docx-comment-band docx-comment-band--active":null;let te=L.get(V);if(!te||te.kind!=="revision")return null;let pe=_.length>1?Number(_[1]):0;return `docx-revision-band docx-revision-band--${(ke=>ke==="delete"||ke==="moveFrom"?"delete":ke==="insert"||ke==="moveTo"?"insert":ke==="replace"&&te.replacedRangeCount!==void 0?pe<te.replacedRangeCount?"delete":"insert":"other")(te.revisionKind)}${Q?" docx-revision-band--active":""}`}let n0=null,r0,o0=null;function Aa(m=false){let P=mm(),L=P&&nl(P),_=zf(Ma,L,n.pairsReplacements?.()),V=[..._].join(`
|
|
30
|
-
`),Q=hr.get();if(!m&&n0===be&&r0===V&&o0===Q.resolved)return;let te=RA(Ma()),pe=[];for(let he of A8()){let Ie=F8(he.key,_,te);if(!Ie)continue;let ke=he.key.split(b$1)[0],ge=te.get(ke),wt=ge?Gb(ge):null,Br=wt===null||wt===""?void 0:Q.resolved.get(wt),Zt=ge?.kind==="revision"&&_.has(ke)?Br?.style?.activeBackground:void 0;pe.push({...he,className:Ie,...Br?{reviewAuthor:Br}:{},...Zt!==void 0?{activeBackground:Zt}:{}});}w$1(W,be,pe,{scale:f,...Ct?{pageOffsetX:Ct.pageOffsetX}:{}}),n0=be,r0=V,o0=Q.resolved;}function ol(){Dt?.update(),fe?.update();let m=F?oa$1(be,F.cellIds):we?Ze$1(Re(),we,rt(),v$1):rM(Re(),N,rt,v$1);w$1($,be,m,{scale:f,pageOffsetX:Ct?.pageOffsetX,...F?{}:{className:we?"docx-retained-selection-rect":"docx-selection-mark-rect"}});}function i0(m){return {layer:m,layout:be,revision:a.packageRevision(),scale:f,measurer:v$1,...hn?{pages:hn}:{},...Ct?{pageOffsetX:Ct.pageOffsetX}:{}}}function md(){K?.(i0(q));}function gd(){if(!Nr){Z$1.replaceChildren();return}let m=d;if(!m){Z$1.replaceChildren();return}zL(Z$1,be,m.remoteSelections(),{scale:f,pageOffsetX:Ct?.pageOffsetX,...hn?{pages:hn}:{},colorForAuthor:t0,declaredColorFor:L8,labelHost:so,measurer:v$1});}function hd(m){let P=Ch$1(a.part());if(m)return P.find(V=>V.id===m)??null;let L=Ea?P.find(V=>V.id===Ea):void 0;if(L)return L;let _=N.head.paragraphId;return P.find(V=>V.beginParagraphId===_||V.endParagraphId===_||V.resultParagraphIds.includes(_))??(P.length===1?P[0]:null)}function gm(){return tE(a.part(),N)}function a0(m){return nE(a.part(),m)}function s0(){return new Set(Ch$1(a.part()).flatMap(m=>[m.beginParagraphId,...m.resultParagraphIds,m.endParagraphId]))}function hm(m){return new Set([m.beginParagraphId,m.endParagraphId,...m.resultParagraphIds])}function D8(m){let P=0;for(let L of be.pages)for(let _ of Ka$1(L))m.has(_.paragraphId)&&(P+=_.lines.length);return P}function ym(m,P){let L=new Set(P),_=new Map;for(let V of m.pages)for(let Q of Ka$1(V)){if(!L.has(Q.paragraphId)||_.has(Q.paragraphId))continue;let te=V.pageFieldSource;_.set(Q.paragraphId,id(te?.pageNumber??V.index+1,te?.format));}return _}let{canRefreshToc:bm,pointAtToc:N8,removal:l0}=nA({session:a,editingMode:()=>De,target:hd,writeRefusal:m=>vr(true,m,false),apply:(m,P)=>Oa(m,P,void 0,Ys),removed:()=>sm(null),select:m=>St(Ke(m)),pointedTocId:()=>Ea,refuse:(m,P)=>{U=Y(m,P);}});function c0(m,P){if(!Number.isInteger(m)||!Number.isInteger(P)||m<1||P<1)return null;let L=Mn.sectionPropertiesAt(N.head.paragraphId),_=L.pageSize.widthTwips-L.margins.leftTwips-L.margins.rightTwips-L.margins.gutterTwips,V=Math.max(300,Math.floor(_/P));return {op:"insertTable",beforeParagraphId:N.head.paragraphId,rows:m,cols:P,columnWidthTwips:V}}function d0(m,P){if(gt?.active()||De==="view"||!a.editable)return false;let L=c0(m,P),_=a.partFor(je())??a.part();return L!==null&&zn$1(_,L)===null}function H8(m,P){if(!d0(m,P))return false;let L=c0(m,P);if(!L)return false;let _=null,V=a.subscribe(te=>{te.caret&&(_=te.caret);}),Q=false;try{Be(()=>{let te=dt([L],it());return te.committed||(U=Y(te.reason??"the table could not be inserted here",te.reason??"table-insert-refused")),Q=te.committed,te},()=>{let te=_;return te?Ke({paragraphId:te.paragraphId,offset:te.start}):null});}finally{V();}return Q}let u0='TOC \\o "1-3" \\h';function f0(){let m=yh$1(u0);if(!m)return null;let P=a.documentOutline(),L=Oi(a.part(),P,m,ym(ve.layout(),P.map(_=>_.blockId)),s0(),d?.identity.actorId);return {op:"insertToc",beforeParagraphId:N.head.paragraphId,instruction:u0,alias:$s?.title??"TOC",entries:L.entries,bookmarksToCreate:L.bookmarksToCreate}}function p0(){if(De==="view"||!a.editable||gm())return false;let m=f0();return m!==null&&zn$1(a.part(),m)===null}function _8(){if(!p0())return false;let m=f0();if(!m)return false;let P=new Set(Ch$1(a.part()).map(V=>V.id)),L=Oa([m],it(),void 0,Ys);if(!L.committed)return U=Y(L.reason??"the table of contents could not be inserted",L.reason??"table-of-contents-refused"),false;let _=Ch$1(a.part()).find(V=>!P.has(V.id));return _?m0(_.id,"pageNumbers"):true}function m0(m,P="entire"){let L=hd(m);if(!L||!bm(L.id))return false;ri(ve);let _=ve.layout(),V=a.documentOutline(),Q=Fh$1(a.part(),V,L.instruction);if(!Q)return false;let te=Q.map(Ie=>Ie.blockId),pe=N8(L);if(P==="entire"){let Ie=Oi(a.part(),V,L.instruction,ym(_,te),hm(L),d?.identity.actorId),ke=Oa([{op:"replaceTocResult",tocId:L.id,entries:Ie.entries,bookmarksToCreate:Ie.bookmarksToCreate}],pe,void 0,Ys);if(!ke.committed)return U=Y(ke.reason??"the table of contents could not be refreshed",ke.reason??"table-of-contents-refused"),false;if(_=ve.layout(),L=hd(L.id),!L)return true}let he="";for(let Ie=0;Ie<3;Ie+=1){let ke=ym(_,te),ge=Qi$1(a.part(),L,V,hm(L)),wt=L.resultParagraphIds.flatMap((tr,Sm)=>{let sl=ge[Sm],nr=sl?ke.get(sl):void 0;return nr===void 0?[]:[{paragraphId:tr,pageNumberText:nr}]});if(wt.length===0)break;let Br=wt.map(tr=>`${tr.paragraphId}\0${tr.pageNumberText}`).join("");if(Br===he)break;he=Br;let Zt=Oa([{op:"rewriteTocPageNumbers",tocId:L.id,updates:wt}],pe,void 0,Ys);if(!Zt.committed){if(Zt.rejected)return U=Y(Zt.reason??"the table of contents page numbers were refused",Zt.reason??"table-of-contents-refused"),false;break}_=ve.layout(),L=hd(L.id)??L;}return true}function B8(){return ri(ve),hL({session:a,editingMode:De,collaborationActive:d!==void 0,reviewerFilterActive:Yn.filterForSession(a)!==void 0,layout:ve.layout(),canonicalUnfilteredLayout:Ge,styleCascade:mn(),numberingIndex:Xn(),displayMode:Yt()})}let{selectionMark:it,orderedRange:fo,orderedStart:vm,textOf:zt,atomicControlDeletion:$8,splitEndsTheParagraph:W8,deleteSelectionPlan:po,deleteSelectionOps:q8,deleteRangePlan:K8,replacementOffset:xm}=yD({session:a,layout:Re,selection:()=>N,cellSelection:()=>F,editingMode:()=>De,author:()=>u$1,trackedDate:j$1,storyScope:je,paragraphOrder:rt,flushPendingInputAndLayout:ot,trackedAuthorOrNone:Js,atParagraphEnd:(m,P)=>Lo.atParagraphEnd(m,P),revisionView:Zx}),{insertPlainText:g0,copyFlavoursNow:U8,pasteRichNow:j8,armForcePlainPaste:V8}=hD({session:a,textFormFieldId:()=>Dt?.fieldId()??null,insertOwner:()=>ds(Hr()),richPasteAllowed:()=>!gt?.active(),paragraphIds:ga,layout:Re,cellSelection:()=>F,editingMode:()=>De,storyScope:je,paragraphOrder:rt,actorId:()=>d?.identity.actorId,collaborationGate:(m,P)=>d?.gateOperations(m,P)??null,now:Ee,flushPendingInputAndLayout:ot,orderedRange:fo,selectionMark:it,deleteSelectionPlan:po,consumePendingFormatOps:to,withoutPendingOnRejection:mr,caretMark:uo,suggestion:()=>{let m=Js();return m===void 0?void 0:{author:m,date:j$1()}},trackedOps:um,trackedChangeLanded:()=>r.onTrackedChange?.(),revisionDisplayMode:Yt,commit:Be});function il(m){m&&(sn=null,ot(),Qt=En(vt()),yt.invalidateAll(a.packageRevision(),"tracked-change-filter"),yt.flush(),n.onChange?.(xt()));}let mo=false,ve={session:a,applyGatedTreeOps:(m,P,L,_)=>Oa(m,P,L,_??je()),storyScope:je,imageDecodePort:()=>ba,textMeasurer:()=>v$1,layout:()=>(ot(),be),state:xt,currentPage:(m="caret")=>{if(ot(),m==="viewport"){let L=DL(e,be,f);if(L!==null)return L}let P=Se(Re(),N.head);return P?P.pageIndex+1:1},automationWriteRefusal:(m,P)=>vr(m.some(Vx)||P,m,false),setScale(m){if(!(m>0)||!Number.isFinite(m))return false;if(m===f)return true;let P={scale:f,defaults:S,measurer:v$1,producer:R,furnitureSource:Qt};try{let L=Nt(e),_=L?{x:ML(e,L,f),y:(L.scrollTop-e.offsetTop+L.clientHeight/2)/f}:null;if(f=m,n.measurer||(S=Z(f,{context:ii(e.ownerDocument),...n.fontAlias?{fontAlias:n.fontAlias}:{},serifHangulFace:x}),v$1=S.measurer),R=I(),Qt=En(vt()),hn=void 0,Ct=void 0,No=null,yt.invalidateAll(a.packageRevision(),"zoom"),yt.flush(),Gs(),L&&_){let V=Math.max(0,_.y*f+e.offsetTop-L.clientHeight/2),Q=Number.isFinite(L.scrollHeight)?Math.max(0,L.scrollHeight-L.clientHeight):null;AL(e,L,_.x,f),L.scrollTop=Q===null?V:Math.min(V,Q),cd();}return !0}catch{(({scale:f,defaults:S,measurer:v$1,producer:R,furnitureSource:Qt}=P)),hn=void 0,Ct=void 0,No=null;try{yt.invalidateAll(a.packageRevision(),"zoom-rollback"),yt.flush();}catch{}return false}},enqueueType:Vs,flushPendingInput:ot,type(m){let P=po(),L=P.replaceAt??P.collapseTo,_=to(L.paragraphId,L.offset,m.length),V=P.ops.length===0?ds(Hr()):void 0,Q=[...P.ops,tC(L,m,V)],te=zx(L.paragraphId,L.offset,m.length),pe={paragraphId:L.paragraphId,start:te,end:te},he=ed(L,te,m,_);Be(()=>mr([...Q,...he],Q,it(),pe),()=>Ke({paragraphId:L.paragraphId,offset:te}));},proposeTextChange:(m,P,L)=>tn(m,P,L),replaceTextInPlace:Ia,insertPlainText:m=>g0(m),deleteBackward(){let m=SE(Re(),F,De);if(m)return void ve.applyTableCommandPlan(m);if(Dt?.selectForDeletion("backward")||fm("backward"))return;let P=po();if(P.ops.length>0){Be(()=>dt(P.ops,it(),uo(P.collapseTo)),()=>Ke(P.collapseTo));return}if(Xx("backward"))return;let L=_t()??void 0,_=Bt.shown(N.head);if(_.offset===0){for(let Ie of ab$1(Re(),_.paragraphId)){let ke=zt(Ie);if(ke.length!==0){Be(()=>dt([{op:"deleteText",paragraphId:Ie,start:ke.length-1,end:ke.length}],it(),uo({paragraphId:Ie,offset:ke.length-1})),()=>Ke({paragraphId:Ie,offset:ke.length-1}),{rearmPending:L});return}}if(ve.removeListNumber(_.paragraphId)||ve.removeParagraphIndent(_.paragraphId))return;let V=rt(),Q=V.indexOf(_.paragraphId),te=V[Q-1];if(!te)return;let pe=Bt.joinOps(te,_.paragraphId);if(!pe){St(Ke({paragraphId:te,offset:zt(te).length}));return}let he=zt(te).length;Be(()=>dt(pe,it(),uo({paragraphId:te,offset:he})),()=>Ke({paragraphId:te,offset:he}),{rearmPending:L});return}Be(()=>dt([{op:"deleteText",paragraphId:_.paragraphId,start:_.offset-1,end:_.offset}],it(),uo({..._,offset:_.offset-1})),()=>Ke({..._,offset:_.offset-1}),{rearmPending:L});},splitParagraph(){let m=po(),P=m.replaceAt??m.collapseTo,L=_t()??{properties:ei(de(a,P.paragraphId)??a.part(),P.paragraphId,P.offset,Yt(),vt()),base:[]},_=W8(P),V=_?Lo.followerStyleId(P.paragraphId):void 0,Q=mi(L.base,L.properties,qs(P.paragraphId,P.offset)),te=_&&De==="edit"&&Q.length>0?[{op:"setParagraphMarkProperties",paragraphId:P.paragraphId,properties:Q}]:[],pe={op:"splitParagraph",paragraphId:P.paragraphId,offset:P.offset,tailStyleId:V},he=Js(),Ie=he?{author:he,date:j$1()}:void 0,ke=a.documentStyles(),ge=Kf(ke),wt=ge??"ListParagraph",Br=new Set(ke.map(nr=>nr.styleId));for(let nr=1;!ge&&Br.has(wt);nr++)wt=`ListParagraph${nr}`;let Zt=De!=="view"&&m.ops.every(nr=>nr.op==="deleteText"&&nr.paragraphId===P.paragraphId)&&V===void 0?_M(de(a,P.paragraphId)??a.part(),be,P,Q,wt,mn(),Ie,d?.identity.actorId):null,tr=Ie?[{op:"setParagraphMarkRevision",paragraphId:P.paragraphId,kind:"ins",revision:Ie}]:[],Sm=Zt?[Zt,...te,...tr]:[pe],sl=Zt?new Set(ga()):null;KA(a,P.paragraphId,nr=>Be(()=>mr([...m.ops,...te,...Sm],[...m.ops,...Zt?[Zt,...tr]:[pe]],it(),void 0,Zt&&!ge?[KM(mn()?.defaultParagraphStyleId??null,wt)]:void 0),()=>{if(!sl)return nr();let R0=ga().filter(J8=>!sl.has(J8)),P0=Zt?R0.at(-1):R0[0];return P0?Ke({paragraphId:P0,offset:0}):null},{rearmPending:L}),Ce);},navigate(m,P=false){if(m==="documentEnd"&&ri(ve),ot(),!P&&(m==="left"||m==="right")&&(N.anchor.paragraphId!==N.head.paragraphId||N.anchor.offset!==N.head.offset)){let ge=fo();Le$1=null;let wt=DA(Re(),ge,rt(),m,v$1);St(Ke(wt),true);return}let L=Re(),_=Th(L,Bt.shown(N.head),m,Le$1,Xe?.getActive()??null,pi(),v$1,ze.selectionLineId());if(!_)return;let V=s0(),Q=rE(a.part(),_.position,["left","wordLeft","lineStart","up","pageUp"].includes(m));if(Q&&(_={..._,position:Q,caret:void 0}),O){let ge=GD(L,N.head,_.position);ge!==_.position&&(_={..._,position:ge,caret:void 0});}if(ar(a.part(),_.position)){if(P)return;let wt=new Set(["left","wordLeft","lineStart","up","pageUp"]).has(m)?"up":"down",Br=D8(V)+4;for(let Zt=0;Zt<Br;Zt+=1){let tr=Th(Re(),_.position,wt,_.desiredX,Xe?.getActive()??null,pi(),v$1);if(!tr||tr.position.paragraphId===_.position.paragraphId&&tr.position.offset===_.position.offset)return;if(_=tr,!ar(a.part(),_.position))break}if(ar(a.part(),_.position))return}Le$1=_.desiredX,Ye?.activeNoteScope()&&_.pageIndex!==void 0&&Number.isInteger(_.pageIndex)&&Ye.setActiveNotePageIndex(_.pageIndex);let pe={anchor:P?Bt.shown(N.anchor):_.position,head:_.position},he=P&&!O?pe:Wc(L,pe,{atomic:P&&O}),Ie=!P&&!Ht(he,pe),ke=N;St(he,true,Ie?"none":"head",Ie?void 0:_.caret),Ie&&(N!==ke||Ht(N,he))&&nm(N.anchor);},deleteWordBackward(){if(ve.deleteSelection())return;let m=N.head,P=(Dt?.wordDeletionBoundary??Ie)(zt(m.paragraphId),m.offset,-1,Le(Re(),m.paragraphId));if(P===m.offset){ve.deleteBackward();return}Be(()=>dt([{op:"deleteText",paragraphId:m.paragraphId,start:P,end:m.offset}],it()),()=>Ke({...m,offset:P}),{rearmPending:_t()??void 0});},deleteWordForward(){if(ve.deleteSelection())return;let m=N.head,P=(Dt?.wordDeletionBoundary??Ie)(zt(m.paragraphId),m.offset,1,Le(Re(),m.paragraphId));if(P===m.offset){ve.deleteForward();return}Be(()=>dt([{op:"deleteText",paragraphId:m.paragraphId,start:m.offset,end:P}],it()),void 0,{rearmPending:_t()??void 0});},deleteForward(){if(Dt?.selectForDeletion("forward")||fm("forward")||ve.deleteSelection()||Xx("forward"))return;let m=_t()??void 0,P=Bt.shown(N.head),L=zt(P.paragraphId);if(P.offset<L.length){Be(()=>dt([{op:"deleteText",paragraphId:P.paragraphId,start:P.offset,end:P.offset+1}],it()),void 0,{rearmPending:m});return}rt().at(-1)===P.paragraphId&&ri(ve);let _=rt(),V=_[_.indexOf(P.paragraphId)+1];if(V){if(ab$1(Re(),V).includes(P.paragraphId)){if(zt(V).length===0)return;Be(()=>dt([{op:"deleteText",paragraphId:V,start:0,end:1}],it()),()=>Ke(P),{rearmPending:m});return}Be(()=>dt(Bt.forwardJoinOps(P.paragraphId,V)??[{op:"joinParagraphs",firstId:P.paragraphId,secondId:V}],it()),()=>Ke(P),{rearmPending:m});}},...Mn,...On,setSelection:m=>{Ht(m,N)||X({kind:"programmatic"},false),no.discard(),St(m);},selectDrawing(m,P){$t();let L=ws(be,m,P);if(!L)return false;let _=Ke(L);return X({kind:"pointer",drawingNodeId:m},Ht(_,N)),St(_,true,"none"),Gn(ve)?.drawingNodeId===m},revealPage(m,P){od();let L=be.pages.find(_=>_.index===m);return !L&&id$1(m,()=>ve.revealPage(m,P))?true:L?al(L.box.y,L.box.height,P):false},revealParagraph(m,P){od();let L={paragraphId:m,offset:0},_=Se(Re(),L);if(!_&&id$1(L,()=>ve.revealParagraph(m,P)))return true;if(!_)return false;let V=be.pages.find(Q=>Q.index===_.pageIndex);return V?al(V.contentBox.y+_.y,_.height,P):false},revealPosition(m,P){od();let L=Se(Re(),m);if(!L&&id$1(m,()=>ve.revealPosition(m,P)))return true;if(!L)return false;let _=be.pages.find(Q=>Q.index===L.pageIndex);if(!_)return false;let V=sc(_,m.paragraphId).y+L.y;return al(V,L.height,{block:"nearest",...P})},setEditable(m){cm=m,m||gt?.exit(),lm();},selectAll(){ri(ve);let m=rt(),P=m[0],L=m[m.length-1];!P||!L||St({anchor:{paragraphId:P,offset:0},head:{paragraphId:L,offset:zt(L).length}});},hyperlinks:A,equations:ne,contentControls:co,formatPainter:bi,canInsertTable:d0,insertTable:H8,canInsertToc:p0,insertToc:_8,canRefreshToc:bm,canEditTextFormField:()=>Dt?.canEdit()??false,editTextFormField:()=>Dt?.edit()??false,refreshToc:m0,...l0,refreshRefFieldResults:B8,save:()=>GA(ve,e,()=>mo),saveSteps:()=>zA(ve,e,()=>mo),isInsideToc:m=>aE(a.part(),m),retainSelection:()=>{let m=Symbol("selection-pin");return Ue.set(m,N),we=N,ol(),m},releaseSelection:m=>{Ue.delete(m)&&(_e(),ol());},retainedSelection:()=>we,publishedLayout:()=>be,drawingSelectionIntent:()=>z,overlayCoordinates:()=>Object.freeze({paintScale:f,pageOffsetX:Ct?.pageOffsetX??new Map}),commitReviewOps:(m,P)=>{ot();let L=N.head.paragraphId,_=zt(L),V=null;return nn(()=>{V=Be(()=>{if(De==="view")return {committed:false,rejected:true,opCount:0,reason:g$1};if(d&&(P===void 0||!$M.has(P)))return {committed:false,rejected:true,opCount:0,reason:"experimental-collaboration-body-text-only"};if(d){let Ie=d.gateOperations([],je());if(Ie)return {committed:false,rejected:true,opCount:0,reason:Ie}}let Q=d?.identity.actorId,te=Hb$1(Q,()=>m(oe.value)),pe=typeof te.reason=="string"?{reason:te.reason}:{},he=te.committed;return {committed:he,rejected:!he,opCount:0,...pe}},()=>{$t(),ze.noteModelMoved();let Q=rt();if(Q.length===0)return null;let te=$c(N,L,_,zt(L));return Jo(Re(),Q,te)});}),V},revisionDisplayMode:oo,replacementLanding:io,applyAutomationOps:(m,P,L,_=false)=>{let V=null,Q=P??Ys,pe=Be(()=>{let he=vr(false);if(he!==null)return V={committed:false,rejected:true,opCount:0,reason:he};let Ie=null,ke=m(ge=>{let wt=vr(true,[],false);return wt===null?Hb$1(d?.identity.actorId,()=>a.ensureHyperlinkRelationship(ge,Q)):(Ie=wt,null)});return ke===null?V={committed:false,rejected:true,opCount:0,reason:Ie??"this engine will not author that hyperlink target"}:!n.reviewModel&&(_||ke.some(Ac))?V={committed:false,rejected:true,opCount:0,reason:"review-module-required"}:V=dt(ke,void 0,void 0,Q,false,L)},()=>{$t(),ze.noteModelMoved();let he=rt();return he.length===0?null:Jo(Re(),he,N)},{automation:true})??Ic;return V??{committed:false,rejected:true,opCount:0,reason:pe}},editingMode:()=>De,author:()=>u$1,setAuthor:m=>{u$1!==m&&(en(),u$1=m,m?.trim()&&ip(U)&&(U=null,n.onChange?.(xt())));},setDrawingStrings:m=>{ro!==m&&n$1(ro)!==n$1(m)&&(ro=m,ot(),Pt(false));},setLocale:ud.set,setTranslate:m=>{if(Qs===m)return;Qs=m,xb(w,m),Dt?.update();let P=j(m),L=k$1(P)!==k$1(va);va=P,L&&Us.get()&&(ot(),Pt(false));},setTocLabels:m=>{$s=m;},setEditingMode:m=>{ot();let P=De!==m;De=m,P&&m==="view"&>?.exit(),P&&m==="view"&&Xe?.exitHeaderFooter(),P&&m==="view"&&Ye?.exitNote(),P&&m==="view"&&bi.disarm(),ld$1(),lm(),Ph(e,De),P&&Pt(false),U=null,n.onChange?.(xt());},revisionAuthors:()=>hr.get().value,setRevisionDisplayMode(m){mo||m===Fr.view()||(ot(),Fr.set(m),il(true));},hiddenRevisionAuthors:()=>Yn.hiddenAuthors,setRevisionAuthorVisible(m,P){il(Yn.setVisible(m,P));},setAllRevisionAuthorsVisible(m){il(Yn.setAllVisible(hr.get().value.keys(),m));},showAllRevisionAuthors(){il(Yn.showAll());},setTrackedChangesFilter(m,P){il(Yn.setPredicate(m,P));},collaborationSession:()=>d??null,remotePresenceColor:t0,setShowParagraphMarks:Us.set,setRevisionMarkup:hi.set,setUnsupportedElementRules:m=>{let P=cb(mc(m));if(P.view(a).currentPackage(),s.view(a).currentPackage(),P.geometryKey()===s.geometryKey()){let _=P.includePartial!==s.includePartial;s=P,Qt=En(vt()),_&&Pt(false);return}ot(),s=P,Qt=En(vt()),yt.invalidateAll(a.packageRevision(),"unsupported-content"),yt.flush(),n.onChange?.(xt());},setRevisionStyles:m=>{m!==Jn&&(Jn=m,ot(),Pt(false));},setHighlightPainter(m){K=m,m||q.replaceChildren(),md();},repaintHighlights:md,setRemoteCaretLabelHost:m=>{m!==so&&(so=m,gd());},setReviewActivationExclusions(m,P){tl=P?.formattingKinds?new Set(P.formattingKinds):void 0,el=m===null?null:new Set(m),Aa(),n.onChange?.(xt());},activeReviewKey:()=>{let m=mm();return m?nl(m):null},activateReview:(m,P,L)=>{if(Ri.clear(),Yx=L?.allowExcluded??false,nl$1=P?{key:m,anchor:P.anchor,head:P.head}:{key:m,anchor:N.anchor,head:N.head},P){let _=()=>{pm=true;try{St(P,!1,L?.preventScroll?"none":"caret");}finally{pm=false;}};L?.preventScroll?nn(_):_();return}Aa(),n.onChange?.(xt());},activatedReviewKey:()=>Qx()===null?null:nl$1?.key??null,dismissActiveReview:()=>{let m=mm();m&&(Ri.add(nl(m)),nl$1=null,Aa(),n.onChange?.(xt()));},navigation:Oe,bookmarkEditing:wa,bookmarks:()=>a.bookmarks(),selectedText(){if(F)return YO(be,F);let{from:m,to:P}=fo();return XO(Re(),m,P,rt())},copyFlavours:()=>U8(),pasteRich:(m,P)=>j8(m,P),armForcePlainPaste:V8,deleteSelection(){if(!Ht(N,Ke(N.head))&&fm("backward"))return true;let P=po();return P.ops.length===0?false:(Be(()=>dt(P.ops,it(),uo(P.collapseTo)),()=>Ke(P.collapseTo)),true)},setCellSelection:pd,layoutSession:()=>E,undo:()=>{if(De==="view"||lr(e)){U=Y(g$1),n.onChange?.(xt());return}en(),ae.end(),d?.flushPendingJournals(),st.step("undo",lt,()=>$e$1("undo"));},redo:()=>{if(De==="view"||lr(e)){U=Y(g$1),n.onChange?.(xt());return}en(),ae.end(),d?.flushPendingJournals(),st.step("redo",lt,()=>$e$1("redo"));},sectionAtPage:Zn,activeScope:()=>{let m=gt?.active();if(m)return m;let P=Ye?.activeNoteScope();return P||Xe.activeScope()},setActiveScope:m=>(ot(),m.kind==="frame"?gt.enter(m):m.kind!=="body"&&m.kind!=="headerFooter"&&m.kind!=="note"?false:(gt?.exit(),m.kind==="note"?Ye.enterNote(m.id):(Ye?.exitNote(),Xe.setActiveScope(m)))),insertNote:m=>(ot(),Ye.insertNote(m)),deleteNote:(m,P)=>Ye.deleteNote(m,P),convertNote:(m,P)=>Ye.convertNote(m,P),convertAllNotes:m=>Ye.convertAllNotes(m),setNoteProperties:m=>Ye.setNoteProperties(m),enterNote:(m,P)=>(ot(),Ye.enterNote(m,P)),exitNote:()=>(ot(),Ye.exitNote()),notePropertiesState:()=>{let m=ve.state().selection.head.paragraphId,P=a.packageRevision(),L=a.currentPackage(),_=a.part(),V=Cf$1(L),Q=qj$1(L,"footnote"),te=qj$1(L,"endnote"),pe=ve.activeScope().kind==="headerFooter",he=ve.headerFooterState(),Ie=he?.rId??null,ke=he?.sectionIndex??null,ge=sn;if(ge&&ge.packageRevision===P&&ge.paragraphId===m&&ge.bodyPart===_&&ge.settingsPart===V&&ge.footnotesPart===Q&&ge.endnotesPart===te&&ge.headerFooterOpen===pe&&ge.headerFooterRId===Ie&&ge.headerFooterSectionIndex===ke)return ge.result;let wt=nN(ve,vt());return sn={packageRevision:P,paragraphId:m,bodyPart:_,settingsPart:V,footnotesPart:Q,endnotesPart:te,headerFooterOpen:pe,headerFooterRId:Ie,headerFooterSectionIndex:ke,result:wt},wt},notePreviewText:m=>rN(a,m),applyTableCommandPlan(m){if(!m.ok)return {ok:false,code:m.code,reason:m.reason};if(m.selection.kind==="selectCells")return pd(m.selection.cells),{ok:true,changed:false};let P=null,L=a.subscribe(_=>{_.caret&&(P=_.caret);});try{let _=it(),V=m.selection.kind==="adoptCommittedCaret";Be(()=>dt(m.ops,_),V?()=>{let Q=P;return Q?Ke({paragraphId:Q.paragraphId,offset:Q.start}):null}:void 0,m.selection.kind==="preserveSelection"?{keepCellSelection:!0}:void 0);}finally{L();}return U?{ok:false,code:"invalidArgs",reason:U}:{ok:true,changed:true}},enterHeaderFooter:m=>{ot();let P=Xe.enterHeaderFooter(m);if(!P)return P;let L=Xe.getActive(),_=L?be.pages[L.pageIndex]:void 0;if(L&&_){let V=L.kind==="header"?_.header:_.footer,Q=V?.box.y??(L.kind==="header"?_.box.y:_.box.y+_.box.height-1),te=V?.box.height??1;al(Q,te,{block:"nearest"});}return P},exitHeaderFooter:()=>(ot(),Xe.exitHeaderFooter()),headerFooterState:()=>Xe.headerFooterStateStable(a.packageRevision()),...X1({applyOps:dt,commit:Be,deleteSelectionOps:q8,deleteSelectionPlan:()=>po(),orderedStart:vm,selectionMark:it,collapsedAt:Ke,isHeaderFooterOpen:()=>Xe?.getActive()!==null,lastRejection:()=>U}),...Q1({session:a,applyOps:dt,commit:Be,storyScope:je,selectionMark:it,editingMode:()=>De,author:()=>u$1,trackedDate:j$1,decodePort:()=>ba,actorId:()=>d?.identity.actorId}),focus:()=>{w.ownerDocument.activeElement!==w&&(w.focus({preventScroll:true}),ze.mirrorToDom(true));},setTableInteractionLabel(m){p.resolve=m;},refreshTableInteractionLabels(){La.refreshLabels();},moveTo:Ca.moveTo,park:Ca.park,parked:Ca.parked,hostElement:()=>e,destroy(){if(!mo){mo=true,Qn(),cn=null,Cn.cancel(),Ra.cancel();try{rd();}finally{w.removeEventListener("pointerdown",I0,{capture:true}),w.removeEventListener("keydown",bd,{capture:true}),w.removeEventListener("keydown",mi$1,{capture:true}),w.removeEventListener("pointerdown",mi$1,{capture:true}),w.removeEventListener("beforeinput",bd,{capture:true}),w.removeEventListener("keydown",v0),Q8(),w.removeEventListener("beforeinput",k0),w.removeEventListener("copy",x0),w.removeEventListener("cut",S0),w.removeEventListener("paste",w0),w.removeEventListener("compositionstart",y0),w.removeEventListener("compositionend",h0),Xs?.destroy(),T.clear(),Ca.destroy(),ld$1(),om.destroy(),wi.destroy(),Dt?.destroy(),fd?.destroy(),dm?.destroy(),yd?.destroy(),La.destroy(),fe?.destroy(),Oe.destroy(),Te$1.destroy(),ze.destroy(),w.removeEventListener("contextmenu",Wx),w.removeEventListener("click",qx),w.removeEventListener("pointermove",Dx),w.removeEventListener("pointerleave",Hx),Ve.destroy(),yt.cancel(),We!==null&&Ne.clearTimeout(We),We=null,er&&er(),er=null,Sn.dispose(),q$1(w),B.destroy(),Si(),Dr(),Rt(),xi(),e.replaceChildren();}}}};function G8(m){He=null;let P=Dt?.restoreAfterHistory();if(!m&&P&&(N=P),ze.noteModelMoved(),$t(),!m){St(Jo(Re(),rt(),N));return}if("anchor"in m){let _=rt(),V=!d&&[m.anchor,m.head].every(Q=>_.includes(Q.paragraphId));St(V?m:Jo(Re(),_,m));return}let L={anchor:{paragraphId:m.paragraphId,offset:m.start},head:{paragraphId:m.paragraphId,offset:m.end}};St(rt().includes(m.paragraphId)?L:Jo(Re(),rt(),L));}function al(m,P,L){let _=Nt(e);if(!_||_.clientHeight===0)return false;Gs();let V=m*f+e.offsetTop;return uA(_,V,P*f,L)&&cd(),true}let{onSelectionChange:z8,onCompositionEnd:h0}=o.methods({...ze}),y0=(...m)=>{ze.adoptBeforeInput(),rd(),ze.onCompositionStart(...m);},yd=null,Z8=qA({onRequest:n.onRequestTextFormField,onInvalidRequest:n.onRequestInvalidTextFormField,locale:ud.get,translate:(m,P)=>Qs?.(m,P)??m,pagesLayer:w,get container(){return e},listeners:T,part:m=>de(a,m??N.head.paragraphId)??a.part(),parts:()=>a.storyParts(),protected:(m=N.head.paragraphId)=>Xk(a.settingsRoot())&&Yk(de(a,m)??a.part(),m),selection:()=>N,select:(m,P)=>St(m,false,P?"none":"caret"),reveal:nm,editable:()=>De==="edit"&&!gr,apply:m=>Qf(m,Be,dt),save:(m,P)=>XA(m,P,{session:a,commit:Be,refusal:()=>vr(true,m,false),gate:(L,_)=>d?.gateOperations(L,_)??null,collaborationActive:d!==void 0})},r.initialTextFormInput);Dt=IL(Z8,{part:m=>de(a,m),selection:()=>N,select:m=>St(m),writable:()=>De!=="view"&&!gr,compare:Je},o),rC(ve,Dt.fieldId),oC(ve,n.contentLockPolicy),dm=aL({pagesLayer:w,part:m=>de(a,m??N.head.paragraphId)??a.part(),editable:()=>De!=="view"&&!gr,protected:m=>Xk(a.settingsRoot())&&Yk(de(a,m)??a.part(),m),selection:()=>N,select:m=>St(m,false,"none"),apply:m=>Qf(m,Be,dt)}),fd=DM({pagesLayer:w,settings:()=>Cf$1(a.currentPackage()),part:m=>de(a,m??N.head.paragraphId)??a.part(),editable:()=>De==="edit"&&!gr,select:m=>St(m,false,"none"),canApply:m=>a.editable&&vr(true,[m],false)===null,history:m=>ve[m](),apply:m=>Qf(m,Be,dt)});let X8=CF(ve,{...n,onToggleFieldCodes:()=>{ot(),gr=!gr,Qt=En(vt()),yt.invalidateAll(a.packageRevision(),"field-code-view"),yt.flush();}}),b0=qD(ve,()=>(de(a,N.head.paragraphId)??a.part()).root),v0=m=>{b0.keydown(m),!fd?.keydown(m)&&(m.defaultPrevented||ze.adoptBeforeInput(),!(dm?.keydown(m)||Dt?.keydown(m))&&X8(m));},{onCopy:x0,onCut:S0,onPaste:w0}=OF(ve),Y8=MF(ve,{isComposing:()=>ze.isComposing(),insertPlainText:g0,onBrowserSelectionFixup:()=>{ze.mirrorToDom(),ze.noteBrowserSelectionFixup();}}),k0=m=>{ze.adoptBeforeInput(),Y8(m);},{onDrawingPointerGesture:I0,onDrawingKeyGesture:bd}=PM({surface:ve,textbox:()=>gt,intent:()=>z,setIntent:m=>X(m,true)});w.addEventListener("pointerdown",I0,{capture:true}),w.addEventListener("keydown",bd,{capture:true}),w.addEventListener("beforeinput",bd,{capture:true}),w.addEventListener("keydown",mi$1,{capture:true}),w.addEventListener("pointerdown",mi$1,{capture:true}),w.addEventListener("keydown",v0);let Q8=KD(w,b0);w.addEventListener("beforeinput",k0),w.addEventListener("copy",x0),w.addEventListener("cut",S0),w.addEventListener("paste",w0),w.addEventListener("compositionstart",y0),w.addEventListener("compositionend",h0),Xs=BL({pagesLayer:w,container:()=>e,listeners:T,onSelectionChange:z8,rematerialize:o.wrap(cd)}),gt=EM({session:a,pagesLayer:w,layout:()=>be,selection:()=>N,setSelection:m=>St(m,false,"none"),flush:ot,...OM(a,Zn,()=>({hfScope:Xe,noteOps:Ye})),writable:()=>cm&&De!=="view"&&a.editable}),yd=zD({onTextFormDoubleClick:m=>Dt?.doubleClick(m)??false,onTextFormPointerUp:m=>Dt?.pointerUp(m),pagesLayer:w,get container(){return e},listeners:T,scale:()=>f,pageOffsetX:m=>Ct?.pageOffsetX.get(m)??0,layout:()=>(ki=false,dd.without($t),Re()),measurer:()=>v$1,selection:()=>Bt.shownSelection(N),setSelection:(m,P)=>St(m,false,"none",P),cellSelection:()=>F,setCellSelection:m=>pd(m),focus:()=>w.focus({preventScroll:true}),onSelectionSettled:()=>bi.applyIfArmed(),activeHeaderFooter:()=>BT(pn()),activeNote:()=>{let m=Ye?.activeNoteScope();return m?{scopeId:m.id,pageIndex:Ye?.activeNotePageIndex()??null}:null},enterHeaderFooter:m=>{ot(),Xe?.enterHeaderFooter({rId:m.rId,pageIndex:m.pageIndex,sectionIndex:Zn(m.pageIndex).sectionIndex,kind:m.kind,...m.position?{position:m.position}:{}});},enterNote:(m,P,L)=>{De!=="view"&&(ot(),Ye?.enterNote(m,P,L));},exitNote:m=>{ot(),Ye?.exitNote(m);},exitHeaderFooter:()=>(ot(),Xe?.exitHeaderFooter()),enterEmptyHeaderFooter:(m,P)=>{if(De==="view")return;ot();let L=Xe;L&&tN({session:a,layout:be,sectionAtPage:Zn,create:_=>ve.applyHeaderFooterLifecycle?.(_),flushLayout:$t,enter:_=>L.enterHeaderFooter(_)},m,P);},onContentControlWidget:(m,P)=>T8(m,P),...n.reviewModel?{onChangeBarToggle:Fr.toggleByChangeBar}:{},isReadOnlyPosition:m=>ar(a.part(),m)!==void 0},{...n.pointer?{mode:n.pointer}:{},...O?{atomicInlineControls:true}:{}});let La=FD({pagesLayer:w,furnitureLayer:ee,listeners:T,scale:()=>f,pageOffsetX:m=>Ct?.pageOffsetX.get(m)??0,read:()=>({layout:be,storeRevision:a.packageRevision(),selection:N,cellSelection:F,editingMode:De,themeColors:a.documentThemeColors()}),session:()=>a,applyTableCommandPlan:m=>ve.applyTableCommandPlan(m),label:m=>p.resolve(m)});if(fe=rF({pagesLayer:w,layer:J,listeners:T,scale:()=>f,pageOffsetX:m=>Ct?.pageOffsetX.get(m)??0,read:()=>({layout:be,selection:N,editingMode:De}),label:m=>p.resolve(m),setCellSelection:m=>pd(m),session:()=>a,applyTableCommandPlan:m=>ve.applyTableCommandPlan(m)}),Pt(),fd?.sync(),Nr=true,gd(),d&&(Dr=d.subscribeStatus(()=>{n.onChange?.(xt());})),d&&Do)try{Rt=d.attach(Do);}catch{try{d.destroy();}catch{}}return Ii(),lm(),ve.setTableInteractionLabel=m=>{p.resolve=m,La.refreshLabels(),fe?.update();},ve.refreshTableInteractionLabels=()=>{La.refreshLabels(),fe?.update();},oA(ve,()=>({measurer:n.measurer,producer:n.producer,fontAlias:n.fontAlias,defaultFontFamily:n.defaultFontFamily}),m=>{n={...n,...m},v$1=n.measurer??S.measurer,R=I();},()=>{mo||(Qt=En(vt()),hn=void 0,Ct=void 0,No=null,yt.invalidateAll(a.packageRevision(),"fonts"),yt.flush());}),FM(ve,()=>ze.isComposing()),{finishPaused:Sa,stop:Qn}=cA(ve,()=>e,{pages:()=>w,now:Ee,destroyed:()=>mo,limit:()=>cn,setLimit:m=>cn=m,bodyBlockCount:()=>Ag$1(E),bodyBlock:m=>Bg$1(E)?.[m],publish:m=>vi(m),inputPending:()=>gn(false),busy:()=>Cn.pending(),finishBusy:()=>Cn.finish(),composing:()=>ze.isComposing(),prefixPass:m=>Fe(a.packageRevision(),void 0,void 0,m),finish:o.wrap(()=>{cn=null,yt.invalidateAll(a.packageRevision(),"opening"),yt.flush();})},Rc),{ok:true,surface:o.methods(ve)}}function cN(e,t=()=>null){let n,r={change:new Set,selectionChange:new Set,error:new Set,historyDiagnostic:new Set,diagnostic:new Set,revisionMarkupChange:new Set,reviewItemReveal:new Set,reviewChangesResolved:new Set,hostChange:new Set},o=()=>{let c=t();if(c===n||n===void 0&&c===null)return;n=c;let d=Object.freeze({document:c});for(let u of [...r.hostChange])u(d);},i=0,a=false,s=[],l=c=>{i>0||a?s.push(c):c();};return {defer(c){i+=1;try{return c()}finally{if(i-=1,i===0&&!a){a=true;try{for(;s.length>0;){let d=s;s=[];for(let u of d)try{u();}catch{}}}finally{a=false;}}}},emitError(c,d){l(()=>{for(let u of [...r.error]){if(d&&!d())return;u(c);}});},emitDocumentChange(c){l(()=>{for(let d of [...r.change])d(c);});},emitSelectionChange(){l(()=>{if(o(),!r.selectionChange.size)return;let c=e();for(let d of [...r.selectionChange])d(c);});},emitHistoryDiagnostic(c){l(()=>{for(let d of [...r.historyDiagnostic])d(c);});},emitDiagnostic(c){l(()=>{for(let d of [...r.diagnostic])d(c);});},emitRevisionMarkupChange(c){l(()=>{for(let d of [...r.revisionMarkupChange])d(c);});},emitReviewChangesResolved(c){l(()=>{let d=Object.freeze({...c,skipped:Object.freeze([...c.skipped])});for(let u of [...r.reviewChangesResolved])u(d);});},emitReviewItemReveal(c){l(()=>{let d=Object.freeze({...c});for(let u of [...r.reviewItemReveal])u(d);});},hasErrorHandlers:()=>r.error.size>0,hasDiagnosticHandlers:()=>r.diagnostic.size>0,hasReviewChangesResolvedHandlers:()=>r.reviewChangesResolved.size>0,clear(){s=[];for(let c of Object.values(r))c.clear();},on(c,d){return r[c].add(d),()=>{r[c].delete(d);}}}}var Lp="content controls lock every remaining change; remove the locks to decide them",Fp="every remaining change is in a data-bound content control";var dN={"paragraph-count-unexplained":"edit.unmapped-change","paragraph-reordered":"edit.unmapped-change","unknown-paragraph-id":"edit.unmapped-change","unknown-content-moved":"edit.unmapped-change","unsupported-node":"edit.unsupported-content","split-not-clean":"edit.unmapped-change","join-not-clean":"edit.unmapped-change"},pN=new Map([["the document is open for viewing","edit.read-only"],["the document is read-only","edit.read-only"],["this content is locked","edit.protected-content"],[dy,"edit.protected-content"],[Qi,"edit.read-only"],[Ji,"edit.protected-content"],[ea,"edit.protected-content"],[ff,"edit.protected-content"],[Zr,"edit.suggesting-needs-author"],[ly,"edit.suggesting-needs-author"],[qt,"edit.review-module-required"],[GE,"edit.unsupported-content"],[jb,"edit.unsupported-story"],[ia,"edit.field-structure"],[Kc,"edit.tracked-structure-unsupported"],[Cy,"edit.tracked-structure-unsupported"],[Ty,"edit.tracked-structure-unsupported"],[Ey,"edit.tracked-structure-unsupported"],[Ms,"edit.section-mark"],[Ep,"edit.protected-content"],[Uc,"edit.protected-content"],[kc,"edit.refresh-in-progress"],[Cr,"edit.preview-active"],["invalid note scope id","edit.stale-target"],[ry,"edit.tracking-required"],[pf,"edit.tracked-image-replace-unsupported"],[ky,"edit.picture-selected"],[cs,"edit.revision-unsupported"],["note not found","edit.stale-target"]]);function Ls(e){let t=String(e??"refused");return pN.get(t)??t}function Fs(e,t){return (Object.hasOwn(dN,e)?dN[e]:void 0)??B(e)??pN.get(e)??(t!==void 0&&Object.hasOwn(uN,t)?uN[t]:void 0)??"edit.refused"}function xge(e){return e===Lp?"review.locked-content":e===Fp?"review.bound-content":D(e.split(":",1)[0])}var uN={notFound:"edit.stale-target",ambiguous:"edit.invalid-argument",locked:"edit.protected-content",bound:"edit.protected-content",typeMismatch:"edit.invalid-argument",kindMismatch:"edit.invalid-argument",outOfBounds:"edit.invalid-argument",unsupported:"edit.unsupported-content",invalidArgs:"edit.invalid-argument"},fN={wasmUnavailable:"font.shaper-unavailable",initializationFailed:"font.shaper-unavailable",missing:"font.missing",forbidden:"font.load-failed",overLimit:"font.size-limit",malformed:"font.malformed",fontFaceLoadFailed:"font.load-failed",loadFailed:"font.load-failed",missingFont:"font.missing",hashMismatch:"font.integrity-mismatch",hashInvalid:"font.integrity-mismatch",metadataMismatch:"font.integrity-mismatch",fontMismatch:"font.integrity-mismatch",unsupportedFaceIndex:"font.unsupported-face",unsupportedFace:"font.unsupported-face"};function mN(e){return e!==void 0&&Object.hasOwn(fN,e)?fN[e]:"font.load-failed"}var _v=Object.freeze([16,33,50,100,200,500,1e3]),gN=2048,Sj=6e4,wj=200,kj=20,Ij=256,Rj=6e4;function Pj(){return {now:()=>globalThis.performance?.now()??Date.now(),afterNextFrame(t,n){let r=globalThis.requestAnimationFrame;return typeof r!="function"?false:(r(()=>{t(),globalThis.setTimeout(n,0);}),true)},setTimer(t,n){let r=globalThis.setTimeout(t,n);return r.unref?.(),r},clearTimer:t=>globalThis.clearTimeout(t)}}function Ds(){return {count:0,max:0,bands:new Array(_v.length+1).fill(0),samples:[]}}function hN(e,t){return e[Math.min(e.length-1,Math.ceil(t*e.length)-1)]}function Tj(e){let t=[...e.samples].sort((n,r)=>n-r);return Object.freeze({count:e.count,p50Ms:Math.round(hN(t,.5)),p95Ms:Math.round(hN(t,.95)),maxMs:Math.round(e.max),bands:Object.freeze([...e.bands])})}function yN(e){let t=e.clock??Pj(),n=e.windowMs??Sj,r={interaction:Ds(),layout:Ds(),paint:Ds()},o=null,i=null,a=null,s=[],l=false;function c(p,g){if(!Number.isFinite(g)||g<0)return;let y=r[p];y.count+=1,y.max=Math.max(y.max,g);let h=_v.findIndex(b=>g<=b);if(y.bands[h===-1?_v.length:h]+=1,y.samples.length<gN)y.samples.push(g);else {let b=Math.floor(Math.random()*y.count);b<gN&&(y.samples[b]=g);}o===null&&(o=t.now(),i=t.setTimer(d,n));}function d(){i!==null&&t.clearTimer(i),i=null;let p=o;o=null;let g=r;if(r={interaction:Ds(),layout:Ds(),paint:Ds()},p===null)return;let y={};for(let b of ["interaction","layout","paint"])g[b].count>0&&(y[b]=Tj(g[b]));let h=(y.interaction?.count??0)>=kj&&y.interaction.p95Ms>wj;e.deliver({kind:"performance",...h?{code:"performance.slow-interaction"}:{},windowMs:Math.max(0,Math.round(t.now()-p)),...a===null?{}:{pagesBucket:F(a)},...y});}let u=()=>{globalThis.document?.visibilityState==="hidden"&&(s=[],d());};globalThis.document?.addEventListener?.("visibilitychange",u);let f=()=>globalThis.document?.visibilityState==="hidden";return {timing(p,g,y){if(l||!e.enabled())return;if(y&&(a=y()),p!=="input"){c(p,g);return}if(s.length>=Ij||f())return;let h=t.now(),b=g>0&&g<=h?g:h;if(s.push(b),s.length>1)return;let x=s,S=false;t.afterNextFrame(()=>{x===s&&(s=[],S=true);},()=>{if(!S||l)return;let k=t.now();for(let E of x)k-E<=Rj&&c("interaction",k-E);})||(s=[]);},flush:d,dispose(){l||(d(),l=true,globalThis.document?.removeEventListener?.("visibilitychange",u));}}}function Ej(){return {now:()=>globalThis.performance?.now()??Date.now(),setTimer:(e,t)=>{let n=globalThis.setTimeout(e,t);return n.unref?.(),n},clearTimer:e=>globalThis.clearTimeout(e)}}var Bv=()=>({activeMs:0,inputEdits:0,commandEdits:0,automationEdits:0}),Cj={input:"inputEdits",command:"commandEdits",automation:"automationEdits"};function bN(e){let t=e.clock??Ej(),n=e.windowMs??6e4,r=t.now(),o=Bv(),i=Bv(),a=null,s=null,l=null,c=false,d=false;queueMicrotask(()=>{c||!e.enabled()||(d=true,e.deliver({kind:"session",phase:"start"}));});function u(){s!==null&&t.clearTimer(s),s=null;let y=a;a=null;let h=o;if(o=Bv(),!(y===null||!d)){for(let b of Object.keys(h))i[b]+=h[b];e.deliver({kind:"session",phase:"active",durationMs:Math.max(0,Math.round(t.now()-y)),...h,activeMs:Math.round(h.activeMs)});}}function f(){if(c)return;let y=t.now();l!==null&&y-l<=3e4&&(o.activeMs+=Math.max(0,y-l)),l=y,a===null&&(a=y,s=t.setTimer(u,n));}let p=()=>{globalThis.document?.visibilityState==="hidden"&&u();};globalThis.document?.addEventListener?.("visibilitychange",p);function g(){c||(u(),c=true,globalThis.document?.removeEventListener?.("visibilitychange",p),d&&e.deliver({kind:"session",phase:"end",durationMs:Math.max(0,Math.round(t.now()-r)),...i,activeMs:Math.round(i.activeMs)}));}return {activity:f,edit(y){c||(o[Cj[y]]+=1,f());},flush:u,end:g}}var $v=new Set,Oj=e=>{if(!e.persisted)for(let t of [...$v])try{t();}catch{}};globalThis.addEventListener?.("pagehide",Oj);function vN(e){return $v.add(e),()=>{$v.delete(e);}}function Mj(e){let t=e.split(":",1)[0];return D(t)?t:"unsupported-revision"}var Aj=new Set(["insertImage","openBookmarkDialog","openGoTo","openRevisionMarkupDialog","openCompareDocumentsDialog","compareDocuments","proposeDeletion","proposeInsertion","proposeReplacement","replaceImage","setEditingMode","setReviewDisplayMode","toggleDocumentProtection","toggleParagraphMarks","toggleReviewPane"]);function xN(e){if(Aj.has(e.type))return e.type;try{let t=Yi(e);return t.supported||t.reason!==ty(e.type)?e.type:void 0}catch{return}}function Lj(e){let t=e.type;if(t==="acceptRevision"||t==="acceptAllRevisions")return "accept";if(t==="rejectRevision"||t==="rejectAllRevisions")return "reject";let n=e.action;return n==="accept"||n==="reject"?n:void 0}var SN=new WeakMap;function wN(e,t){let n=SN.get(e);return n?n(t):t()}var Wv=new WeakMap;function Fj(e,t,n,r){Wv.get(e)?.(t,n,r);}var kN=new WeakMap;function Dj(e,t,n,r){kN.get(e)?.(t,n,r);}function Nj(e,t,n){Wv.get(e)?.("edit.internal-invariant",n,"exception",{thrown:t});}function Hj(e){let t=e?.code;return t==="notFound"?"save.no-document":t==="invalidState"?"save.document-changed":"save.failed"}var _j=new Set(["split","possible-ungrouped-gesture","possible-fragmented-gesture"]);function IN(e){let t=()=>globalThis.performance?.now()??Date.now(),n=G(()=>[...e.modules.diagnosticListeners,e.events.emitDiagnostic],e.now),r=n.deliver,o=null,i=0,a=0,s=0,l=false;e.events.on("historyDiagnostic",x=>{_j.has(x.kind)&&r({kind:"history",code:`history.${x.kind}`});}),e.customNodes?.observe(x=>{let S=x?.code;(S==="payload-invalid"||S==="payload-missing")&&r({kind:"custom-node",code:`custom-node.${S}`});});let c=e.modules.collaboration?.session,d=c?$j(c,r,t):()=>{},u=yN({deliver:r,enabled:()=>e.events.hasDiagnosticHandlers?.()===true||e.modules.wantsDiagnostic("performance"),...e.performance}),f=bN({deliver:r,enabled:()=>e.events.hasDiagnosticHandlers?.()===true||e.modules.wantsDiagnostic("session"),...e.session}),p=vN(()=>{u.flush(),f.end();}),g=x=>{let S=new Map;for(let[v,k]of x)for(let{reason:E,revision:I$1,detail:R}of v){let O$1=C({reason:E,...R===void 0?{}:{detail:R}});if(!O$1)continue;let C$1=N(I$1?.revisionKind),w=C$1==="format"?O(I$1?.formattingKind):void 0,T=M(I$1?.partName),$=I(R),W=[O$1,$,k,C$1,w,T].join("|"),q=S.get(W);q?q.count+=1:S.set(W,{count:1,event:{code:O$1,...k?{operation:k}:{},...C$1?{changeKind:C$1}:{},...w?{formattingKind:w}:{},...T?{part:T}:{},...$?{cause:$}:{}}});}for(let{event:v,count:k}of S.values())r({kind:"review.skipped",...v,count:k});},y=(x,S)=>g([[S.revisions?.skipped??[],Lj(x)],[S.revisionAuthors?.skipped??[],"reassign"]]),h=(x,S,v)=>{try{r({kind:"edit.rejected",code:"edit.internal-invariant",origin:"command",...v,cause:K(),errorName:L(x),stage:S});}catch{}},b=x=>{if(x||i===0&&a===0){f.edit("input");return}l||(l=true,f.edit(a>0?"automation":"command"));};return {editorSessionId:n.editorSessionId,surfaceHooks(x,S){return {onRejection:v=>this.inputRejected(v,x()),onTiming:(v,k)=>this.timing(v,k,S()??void 0),onEdit:b}},openStarted(x){o={sizeBucket:E(x.byteLength),start:t()};},openDeferred(){o&&(o.start=null);},openMounting(){o&&o.start===null&&(o.start=t());},openSettled(x){if(!o)return;let{sizeBucket:S,start:v}=o;o=null,r({kind:"document.open",outcome:"opened",sizeBucket:S,pagesBucket:F(ps(x)),durationMs:v===null?0:Math.max(0,Math.round(t()-v)),...Bj(x)});},openRejected(x,S,v){let k=o?.sizeBucket;o=null;let E=I(x),I$1=M(v);r({kind:"document.open",outcome:"rejected",code:A(x,S),...k?{sizeBucket:k}:{},...E?{cause:E}:{},...I$1?{part:I$1}:{}});},openCrashed(x,S="open-mount"){if(!o)return;let{sizeBucket:v}=o;o=null,r({kind:"document.open",outcome:"rejected",code:"open.failed",sizeBucket:v,cause:K(),errorName:L(x),stage:S}),e.onOpenCrash?.();},continueOpen(x){try{return x()}catch(S){throw this.openCrashed(S,"open-layout"),S}},reviewItem(x,S,v,k){return (E,I$1)=>{let R=S(E),O=s,C;try{C=x(E,I$1);}catch(q){throw i===0&&h(q,"review-item",{tracked:k()}),q}if(C.ok||i>0)return C;let w=Fs(C.reason,C.code),T=w==="edit.refresh-in-progress"||w==="edit.collaboration-not-ready",$=C.code==="locked"&&C.reason.startsWith("locked-content:")||C.code==="bound"&&C.reason.startsWith("bound-content:");if($&&s===O&&r({kind:"edit.rejected",code:w,origin:"command",tracked:k()}),C.code==="notFound"||(C.code==="unsupported"||$)&&R&&!T){let q=R?v(R,I$1):{},K=R&&{revisionKind:R.revisionKind,partName:q.partName??"",...R.formattingKind?{formattingKind:R.formattingKind}:{}},Z=D(C.reason.split(":",1)[0])!==null,M=C.reason===cs?q.detail??"read-only":Z?q.detail??I(C.reason):I(C.reason)??q.detail;return g([[[{reason:C.code==="notFound"?"unknown-revision":Mj(C.reason),...K?{revision:K}:{},detail:M}],I$1]]),C}if(s!==O)return C;let W=I(C.reason);return r({kind:"edit.rejected",code:w,origin:"command",tracked:k(),...W?{cause:W}:{}}),C}},exec(x,S,v,k){i===0&&a===0&&(l=false),i+=1;let E;try{E=v();}catch(I){if(i===1){let R;try{R=xN(x);}catch{R=void 0;}h(I,"command",{tracked:S,...R?{command:R}:{}});}throw I}finally{i-=1;}if(i>0)return E;if(E.ok&&!l&&k?.()&&(l=true,f.edit(a>0?"automation":"command")),!E.ok){let I$1=xN(x),R=I(E.reason);r({kind:"edit.rejected",code:Fs(E.reason,E.code),origin:"command",tracked:S,...I$1?{command:I$1}:{},...R?{cause:R}:{}});}return y(x,E),E},inputRejected(x,S){if(i>0||a>0)return;s+=1;let v=Fs(x),k=I(x);r({kind:"edit.rejected",code:v,origin:"input",tracked:S,...k?{cause:k}:{}});},fontFailed(x){r({kind:"font.failed",code:mN(x)});},attach(x,S){let v=x.exec,k=()=>x.getDocumentHandle().revision;x.exec=(I,R)=>{let O=k();return this.exec(I,S(),()=>v(I,R),()=>k()!==O)};let E=x.save;x.save=()=>this.save(()=>E.call(x)),SN.set(x,I=>{i===0&&a===0&&(l=false),a+=1;try{return I()}finally{a-=1;}}),bC(x,(I,R)=>{this.exec(I,S(),()=>R);}),kN.set(x,(I$1,R,O)=>{let C=I(O);r({kind:"review.skipped",code:I$1,count:1,...R?{operation:R}:{},...C?{cause:C}:{}});}),Wv.set(x,(I$1,R,O,C)=>{let w=I(O);r({kind:"edit.rejected",code:I$1,origin:"automation",tracked:R,...w?{cause:w}:{},...C?{errorName:L(C.thrown),stage:"automation"}:{}});});},async save(x){let S=t(),v=()=>Math.max(0,Math.round(t()-S)),k;try{k=await x();}catch(E){try{let I=Hj(E);r({kind:"document.save",outcome:"rejected",code:I,durationMs:v(),...I==="save.failed"?{cause:K(),errorName:L(E),stage:"save"}:{}});}catch{}throw E}return r({kind:"document.save",outcome:"saved",sizeBucket:E(k.byteLength),durationMs:v()}),k},timing(x,S,v){x==="input"&&f.activity(),u.timing(x,S,x==="paint"&&v?()=>ps(v):void 0);},dispose(){u.dispose(),d(),f.end(),p();}}}function Bj(e){try{let{session:t}=e;return {shape:{parts:F(t.currentPackage().parts.size),paragraphs:F(t.paragraphIds().length),reviewItems:F(t.reviewItems().length),embeddedFonts:F(t.embeddedFonts().length)}}}catch{return {}}}function $j(e,t,n){let r=n(),o="none",i,a=false,s=false,l=-1,c=()=>{let f=e.statusSnapshot(),p=f.reason?.code,g=f.recovering===true;if(f.status===o&&p===i&&g===a)return;let y=f.status==="ready"&&!s,h=y&&o!=="none";y&&(s=true),t({kind:"collab.status",status:f.status,previous:o,...p?{code:`collab.${p}`}:{},recovering:g,...h?{connectMs:Math.max(0,Math.round(n()-r))}:{}}),o=f.status,i=p,a=g;},d=()=>{let f=e.participants().length;f!==l&&(l=f,t({kind:"collab.participants",count:f}));},u=[e.subscribeStatus(c),e.subscribeParticipants(d)];return c(),()=>{for(let f of u)f();}}function RN(e$1,t,n=()=>true){if(!n())return;let r=e$1.code==="wasmUnavailable"||e$1.cause instanceof e&&e$1.cause.code==="unsupportedRuntime";r&&!t.config.onFontError&&!t.events.hasErrorHandlers()&&nR(e$1);try{t.config.onFontError?.(e$1);}catch{}n()&&(t.events.emitError(e$1,n),n()&&t.diagnostics.fontFailed(r?"wasmUnavailable":e$1.code));}var Wj=50,qj=7e3,Kj="docx-editor-announcer";function PN(e){let t=nt(e),n=null,r=null;return {announce(o){let i=e();if(!i||!o)return;(!n||n.parentElement!==i)&&(n?.remove(),n=i.ownerDocument.createElement("div"),n.className=`docx-editor-sr-only ${Kj}`,n.setAttribute("role","status"),n.setAttribute("aria-live","polite"),n.setAttribute("aria-atomic","true"),n.setAttribute("data-docx-marker",""),n.contentEditable="false",i.append(n));let a=n;a.textContent="",r!==null&&t.clearTimeout(r),t.setTimeout(()=>{a.textContent=o;},Wj),r=t.setTimeout(()=>{r=null,a.remove(),n===a&&(n=null);},qj);},dispose(){r!==null&&t.clearTimeout(r),r=null,n?.remove(),n=null;}}}function ua(e){let t=[],n=(r,o)=>{let i=o.kind,a=r.handlers.kinds??e;return typeof i!="string"||!a||a.includes(i)};return {request(r){let o=t.filter(l=>n(l,r)),i=[...o].reverse().find(l=>!l.fallback)??o.at(-1);if(!i?.handlers.onRequest)return false;let{sessions:a,handlers:s}=i;return a.add(r),r.signal.addEventListener("abort",()=>a.delete(r),{once:true}),s.onRequest(r),true},register(r,o){let i={handlers:r,fallback:o?.fallback===true,sessions:new Set};return t.push(i),()=>{let a=t.indexOf(i);if(!(a<0)){t.splice(a,1);for(let s of i.sessions)s.cancel();}}}}}var Uj=()=>ua();function TN(e={}){let t=lO(e.changed),n=dc({}),r=QC(e),o=iO(e),i=Uj(),a=ua(["dropdown","comboBox","date","buildingBlockGallery"]),s=ua();return {surfaceOptions:{onRequestTextFormField:i.request,onRequestContentControlWidget:a.request,onRequestInvalidTextFormField:s.request,onHyperlinkPopover:l=>t.current().onPopover?.(l),onRequestHyperlink:()=>t.open(),onEquationPopover:l=>n.current().onPopover?.(l),...r.surfaceOptions},bookmarkDialog:r.bookmarkDialog,goTo:r.goTo,commentDraft:o.requests,link:t.requests,setters:{setTextFormFieldChrome:i.register,setContentControlWidgetChrome:a.register,setInvalidTextFormFieldChrome:s.register,setHyperlinkChrome:t.register,setEquationChrome:n.push,...r.setters,...o.setters}}}function EN(e,t){aO(e,t.commentDraft),cO(e,t.link);}var ON="documents cannot be compared while a collaboration session is attached",Gj="this document is protected; only form fields can be filled",zj="this document is protected against edits",MN="the document is open for viewing",AN="the revised document is empty",Dp="the dialog is closed",LN="another compare of this dialog is running",qv="the document changed while the compare ran",Zj="revised must be a Uint8Array",Xj=createT(en),Yj=.95,CN=e=>e.engineReason===void 0?{}:{reason:e.engineReason};function Np(e,t){return t||(e.reason===ON?"collaboration":e.reason===MN?"viewing":e.reason===AN?"empty":e.reason===Dp?"closed":e.reason===LN||e.reason===kc||e.reason===Cr?"busy":e.reason===qv?"documentChanged":e.reason===qt||e.code==="notFound"?"unavailable":e.code==="locked"||e.code==="protected"?"protected":"failed")}var Qj=e=>Object.prototype.toString.call(e)==="[object Uint8Array]",Jj={protected:"locked",invalidOriginal:"unsupported",tooLarge:"unsupported",unsupportedContent:"unsupported"};function eV(e){if(e.authorName!==void 0&&typeof e.authorName!="string")return "authorName must be a string";for(let t of ["detectFormatChanges","removeDateAndTime"])if(e[t]!==void 0&&typeof e[t]!="boolean")return `${t} must be a boolean`;return null}function FN(e,t){return e.type!=="compareDocuments"?t:{...t,compareDocuments:{ok:false,code:Np(t),message:t.reason}}}function DN(e){let t=null,n=null,r=ua(),o=nt(()=>e.container()),i=PN(()=>e.container()),a=S=>{let v=e.translate()??Xj;i.announce(S>0?v("compareDocuments.recorded",{count:S}):v("compareDocuments.recordedNoRevisions"));},s=()=>new Promise(S=>{let v=o.setTimeout(()=>{o.cancelAnimationFrame(k),S();},250),k=o.requestAnimationFrame(()=>{o.clearTimeout(v),o.setTimeout(S,0);});}),l=()=>{if(e.destroyed())return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(!e.contribution()?.compareDocuments)return {ok:false,code:"unsupported",reason:qt};let S=e.surface();if(!S)return {ok:false,code:"notFound",reason:"no document is open"};if(S.collaborationSession())return {ok:false,code:"unsupported",reason:ON};if(e.viewing())return {ok:false,code:"locked",reason:MN};let v=e.container();if(v&&lr(v))return {ok:false,code:"unsupported",reason:bs(v)};let k=Vn({type:"compareDocuments"},S);if(k)return k;let E=kj$1(Cf$1(S.session.currentPackage())?.root);return E.enforced&&E.edit==="forms"?{ok:false,code:"locked",reason:Gj}:E.enforced&&(E.edit==="comments"||E.edit==="trackedChanges")?{ok:false,code:"locked",reason:zj}:{ok:true}},c=()=>{let S=l();return S.ok?e.contribution()?.createCompareDocumentsDialog?e.container()?{ok:true}:{ok:false,code:"notFound",reason:"the editor is not attached"}:{ok:false,code:"unsupported",reason:qt}:S},d=S=>{let v=l();if(!v.ok)return {refused:v};if(!Qj(S.revised))return {refused:{ok:false,code:"invalidArgs",reason:Zj,engineCode:"invalidOptions"}};if(S.revised.byteLength===0)return {refused:{ok:false,code:"invalidArgs",reason:AN}};let k=eV(S);if(k)return {refused:{ok:false,code:"invalidArgs",reason:k,engineCode:"invalidOptions"}};let E=e.surface();E.flushPendingInput();let I=S.authorName?.trim()||E.author();return {options:{...I?{authorName:I}:{},detectFormatChanges:S.detectFormatChanges!==false,...S.removeDateAndTime===true?{removeDateAndTime:true}:{}}}},u=S=>({ok:false,code:Jj[S.code]??"invalidArgs",reason:S.message,engineCode:S.code,...S.reason===void 0?{}:{engineReason:S.reason}}),f=(S,v)=>{let k=e.surface().session.replacePackage(S);return k.ok?{ok:true,changed:k.change!==null,revisionCount:v}:{ok:false,code:"unsupported",reason:`the compare result was refused: ${k.reason}`}},p=S=>{let v=d(S);if("refused"in v)return v.refused;let k=e.surface(),E=e.contribution().compareDocuments(k.session.currentPackage(),S.revised,v.options);return E.ok?f(E.package,E.revisionCount):u(E)},g=async(S,v,k,E)=>{let I=d(S);if("refused"in I)return I.refused;let R=e.surface(),O=R.session.currentPackage(),C=false,w;try{w=await v(og(O),S.revised,I.options,{signal:k,onProgress:K=>{C=!0,E(K);}});}catch(K){if(C||k.aborted)throw K;return E({phase:"comparing",fraction:0}),await s(),k.throwIfAborted(),e.surface()!==R||R.session.currentPackage()!==O?{ok:false,code:"unsupported",reason:qv}:p(S)}if(!w.ok)return u(w);let T=()=>{let K=l();return K.ok&&(e.surface()!==R||R.session.currentPackage()!==O)?{ok:false,code:"unsupported",reason:qv}:K},$=T();if(!$.ok)return $;if(!w.changed||!w.bytes)return {ok:true,changed:false,revisionCount:w.revisionCount};E({phase:"applying",fraction:Yj}),await s(),k.throwIfAborted();let W=T();if(!W.ok)return W;let q=mg(w.bytes);return q.ok?f(q.package,w.revisionCount):{ok:false,code:"unsupported",reason:"the compare result cannot be read"}},y=()=>{if(n){n.cancel();return}let S=t;t=null,S?.destroy();},h=()=>{let S=new AbortController,v=e.contribution()?.compareDocumentsInBackground,k=false,E={signal:S.signal,defaultAuthor:e.surface()?.author()??"",originalHasTrackedChanges:e.surface()?.session.reviewItems().some(I=>I.kind==="revision")??false,canApply:()=>n===E&&!S.signal.aborted&&!k&&l().ok,cancelable:v!==void 0,async apply(I,R){let O=0,C=w=>{S.signal.aborted||w.fraction<O||(O=w.fraction,R?.onProgress?.(w));};if(!E.canApply()){if(k&&n===E&&!S.signal.aborted)return {ok:false,code:"busy",message:LN};let w=l();return w.ok?{ok:false,code:"closed",message:Dp}:{ok:false,code:Np(w),message:w.reason}}k=true,await s();try{if(S.signal.aborted)return {ok:!1,code:"closed",message:Dp};let w=v?await g(I,v,S.signal,C):p(I);if(!w.ok)return {ok:!1,code:Np(w,w.engineCode),...CN(w),message:w.reason};let T=w.revisionCount??0;return w.changed&&(E.cancel(),e.surface()?.focus(),a(T)),{ok:!0,revisionCount:T,changed:w.changed}}catch(w){return S.signal.aborted?{ok:false,code:"closed",message:Dp}:{ok:false,code:"failed",message:w instanceof Error?w.message:String(w)}}finally{k=false;}},cancel(){if(S.signal.aborted)return;n===E&&(n=null);let I=t;t=null,S.abort(),I?.destroy();}};return E},b=S=>{t=e.contribution().createCompareDocumentsDialog({signal:S.signal,defaultAuthor:S.defaultAuthor,originalHasTrackedChanges:S.originalHasTrackedChanges,cancelable:S.cancelable,canApply:S.canApply,apply:S.apply,cancel:S.cancel,container:e.container(),translate:v=>e.translate()?.(v)}),S.signal.aborted?y():t.open();},x=()=>{let S=c();if(!S.ok)return S;y();let v=h();n=v;try{r.request(v)||b(v);}catch(k){throw v.cancel(),k}return {ok:true,changed:false}};return {canOpen:c,canCompare:l,open:x,compare:p,destroyDialog:y,register(S,v){return r.register(S??{onRequest:b},v)},exec(S){if(S.type==="openCompareDocumentsDialog")return x();if(S.type!=="compareDocuments")return null;let v;try{v=p(S);}catch(k){let E=k instanceof Error?k.message:String(k);return {ok:false,code:"unsupported",reason:E,compareDocuments:{ok:false,code:"failed",message:E}}}return v.ok?{ok:true,changed:v.changed,compareDocuments:{ok:true,revisionCount:v.revisionCount??0,changed:v.changed}}:{ok:false,code:v.code,reason:v.reason,compareDocuments:{ok:false,code:Np(v,v.engineCode),...CN(v),message:v.reason}}},can(S){return S.type==="openCompareDocumentsDialog"?c():S.type==="compareDocuments"?l():null}}}function NN(e,t){let n=jb$1(e),r=null,o=null,i=null,a=ua(),s=()=>t.destroyed()?{ok:false,code:"notFound",reason:"the editor was destroyed"}:t.contribution()?.createRevisionMarkupDialog?t.container()?{ok:true}:{ok:false,code:"notFound",reason:"the editor is not attached"}:{ok:false,code:"unsupported",reason:"the review module does not supply a settings dialog"},l=f=>{if(t.destroyed())return;let p=jb$1(f,n);JSON.stringify(p)!==JSON.stringify(n)&&(n=p,t.apply(n),i?.(),t.changed(n));},c=()=>{if(o){o.cancel();return}let f=r;r=null,f?.destroy();},d=()=>{let f=new AbortController,p=new Set,g=n,y=b=>{if(!(f.signal.aborted||JSON.stringify(b)===JSON.stringify(g))){g=b;for(let x of [...p])x();}},h={signal:f.signal,get:()=>g,set(b){f.signal.aborted||y(jb$1(b,g));},reset:()=>y(ib$1),subscribe(b){return f.signal.aborted?()=>{}:(p.add(b),()=>{p.delete(b);})},canApply:()=>o===h&&!f.signal.aborted&&s().ok,apply(){return h.canApply()?(l(g),h.cancel(),true):false},cancel(){if(f.signal.aborted)return;o===h&&(o=null,i=null),p.clear();let b=r;r=null,f.abort(),b?.destroy();}};return i=()=>y(n),h},u=f=>{r=t.contribution().createRevisionMarkupDialog({...f,container:t.container(),translate:p=>t.translate()?.(p)}),f.signal.aborted?c():r.open();};return {current:()=>n,set:l,canOpen:s,register(f,p){return a.register(f??{onRequest:u},p)},open(){let f=s();if(!f.ok)return f;c();let p=d();o=p;try{a.request(p)||u(p);}catch(g){throw p.cancel(),g}return {ok:true,changed:false}},destroyDialog:c}}function HN(e,t){let n=NN(e,t),r=DN(t);return {markup:n,compare:r,destroyDialogs(){n.destroyDialog(),r.destroyDialog();},exec(o){return o.type==="openRevisionMarkupDialog"?n.open():r.exec(o)},can(o){return o.type==="openRevisionMarkupDialog"?n.canOpen():r.can(o)}}}var _N=new WeakMap;function oV(e){return !(!e.story||e.origin===g.mutationUndo||e.origin===g.mutationRedo||e.impact!=="text-local"||e.created.length>0||e.deleted.length>0||e.splitJoin.length>0||e.dependencyKeys.some(t=>t!==l$1.story))}function iV(e,t){oV(t)||(e.summaries=null);}function aV(e,t){t.subscribed||(t.subscribed=true,e.subscribe(n=>iV(t,n)));}function $N(e){}function WN(e,t){let n=_N.get(e);return n||(n={summaries:null,subscribed:false},_N.set(e,n)),aV(e,n),n.summaries||(n.summaries=t()),n.summaries}var sV=new Map([["richText","richText"],["plainText","plainText"],["dropdown","dropDownList"],["dropDownList","dropDownList"],["comboBox","comboBox"],["date","date"]]);function lV(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function cV(e,t){let n=e.session.part(),r=e.session.paragraphAnchors();if(Vt(t)){let o=jn(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(lV(t)){if(!Vt(t.from)||!Vt(t.to))return {ok:false,code:"unsupported",reason:"address the span with paraId anchors; DocLocation endpoints are not supported",target:t};let o=jn(n,r,t.from);if(!o.ok)return {ok:false,code:o.code,reason:o.reason,target:t};let i=jn(n,r,t.to);if(!i.ok)return {ok:false,code:i.code,reason:i.reason,target:t};if(o.span.nodeId!==i.span.nodeId)return {ok:false,code:"unsupported",reason:"wrapping several paragraphs in one content control is not supported",target:t};let a=Math.min(o.span.start,i.span.start),s=Math.max(o.span.end,i.span.end);return {ok:true,span:{paragraphId:o.span.nodeId,start:a,end:s}}}return {ok:false,code:"unsupported",reason:"address the span with a paraId anchor; DocLocation targeting is not supported",target:t}}function Kv(e,t){let n=sV.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=ra(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=cV(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 dV="http://schemas.microsoft.com/office/word/2010/wordml",uV="http://schemas.microsoft.com/office/word/2012/wordml";function fa(e){return ld(e)}function Gc(e){for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="contentControlProperties"||t.localName==="sdtPr"))return t}function fV(e){if(e.kind!=="textValue"){for(let t of e.attributes)if(t.localName==="val"&&t.namespaceUri===pa$2)return t.value}}function Uv(e,t){if(e){for(let n of e.children)if(n.kind!=="textValue"&&n.localName===t)return fV(n)}}function pV(e){if(!e)return "richText";for(let t of e.children){if(t.kind==="textValue")continue;let n=mV(t);if(n!==void 0)return n}return "richText"}function mV(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===dV||t==="contentControlCheckbox"))return "checkbox";if(n==="repeatingSection"&&r===uV)return "repeatingSection"}function Hp(e){let t=Uv(e,"lock");return t==="contentLocked"||t==="sdtContentLocked"}function gV(e,t){if(Hp(Gc(t)))return true;let n=fb$1(e,t.id);for(;n;){if(fa(n)&&Hp(Gc(n)))return true;n=fb$1(e,n.id);}return false}function Vv(e,t){let n=Gc(e),r=Uv(n,"tag"),o=Uv(n,"alias"),i=t?gV(t,e):Hp(n);return {id:e.id,controlType:pV(n),...r!==void 0?{tag:r}:{},...o!==void 0?{alias:o}:{},...i?{locked:true}:{}}}var qN=new WeakMap;function hV(e,t){let n=[],r=fb$1(e,t.id);for(;r;)fa(r)&&n.push(`${r.id}:${Hp(Gc(r))?1:0}`),r=fb$1(e,r.id);return n.join("|")}function UN(e){return Object.freeze({...e,...e.tag!==void 0?{tag:e.tag}:{},...e.alias!==void 0?{alias:e.alias}:{},...e.locked?{locked:true}:{}})}function yV(e){return Object.freeze(e.map(t=>UN(t)))}function bV(e,t){let n=e.node,r=Gc(n),o=hV(t,n),i=qN.get(n);if(i&&i.properties===r&&i.lockAncestors===o)return i.summary;let a=UN(Vv(n,t));return qN.set(n,{properties:r,lockAncestors:o,summary:a}),a}function vV(e){let t=sc$1(e.root);return $N(t.length),t.map(n=>bV(n,e))}function xV(e){return yV(e.storyParts().flatMap(t=>vV(t)))}function SV(e){return WN(e,()=>xV(e))}function jv(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 wV(e){let t=[];if(e.kind!=="paragraph")return t;let n=(r,o,i,a)=>{if(a>=Aa$1)return o;let s=o;for(let l of r)if(l.kind!=="paragraphProperties"){if(l.kind==="run"){s+=Gi$1(e,l);continue}if(Ca(l)){s=n(l.children,s,i,a+1);continue}if(fa(l)){let c=s,d=i+1;s=n(kc$2(l),s,d,a+1),t.push({control:l,start:c,end:s,depth:d});continue}s+=Gi$1(e,l);}return s};return n(e.children,0,-1,0),t}function Gv(e,t,n){return wV(e).filter(r=>t>=r.start&&t<r.end).sort((r,o)=>o.depth-r.depth).map(r=>Vv(r.control,n))}function zv(e,t){let n=[],r=fb$1(e,t);for(;r;)fa(r)&&n.push(Vv(r,e)),r=fb$1(e,r.id);return n.reverse()}function jN(e,t){if(!e)return [];let n=SV(e.session);return t?n.filter(r=>jv(r,t)):n}function Zv(e,t){if(!e)return null;let{paragraphId:n,offset:r}=e.state().selection.head,o=de(e.session,n)??e.session.part(),i=eb$1(o,n);if(i&&i.kind==="paragraph"){for(let s of Gv(i,r,o))if(jv(s,t))return s}let a=zv(o,n);for(let s=a.length-1;s>=0;s-=1){let l=a[s];if(jv(l,t))return l}return null}function Xv(e){return e.type==="insertContentControl"||e.type==="setContentControlValue"||e.type==="removeContentControl"}function kV(e){return typeof e=="object"&&e!==null&&"container"in e&&"path"in e}function IV(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function RV(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 _p(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||fa(n))&&t.push(n);return t}function PV(e){let t=[];for(let n of e.children)if(n.kind==="tableRow")for(let r of n.children)r.kind==="tableCell"&&t.push(..._p(r.children));return t}function TV(e){return e.kind==="table"?PV(e):fa(e)?_p(kc$2(e)):e.kind==="body"?_p(e.children):[]}function EV(e,t,n){if(fa(t))return {ok:true,controlId:t.id};if(t.kind==="paragraph"){let r=n??0;for(let a of Gv(t,r,e))return {ok:true,controlId:a.id};let i=zv(e,t.id).at(-1);if(i)return {ok:true,controlId:i.id}}return {ok:false,code:"notFound",reason:"no content control at the addressed block"}}function CV(e,t){if(t.container.part!=="body")return {ok:false,code:"unsupported",reason:"only the body container is supported",target:t};let n=RV(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=_p(n.children),o=null;for(let a=0;a<t.path.length;a+=1){if(o=r[t.path[a]]??null,!o)return {ok:false,code:"notFound",reason:`block index ${t.path[a]} is out of range`,target:t};a<t.path.length-1&&(r=TV(o));}if(!o)return {ok:false,code:"notFound",reason:"the addressed block was not found",target:t};let i=EV(e,o,t.offset);return i.ok?i:{...i,target:t}}function OV(e,t,n){let r=jn(e,t,n);if(!r.ok)return {ok:false,code:r.code,reason:r.reason,target:n};let o=t.partByNode.get(r.span.nodeId)??e,i=eb$1(o,r.span.nodeId);if(!i||i.kind!=="paragraph")return {ok:false,code:"notFound",reason:`paragraph '${n.paraId}' was not found`,target:n};let a=r.span.start;for(let c of Gv(i,a,o))return {ok:true,controlId:c.id};let l=zv(o,i.id).at(-1);return l?{ok:true,controlId:l.id}:{ok:false,code:"notFound",reason:`no content control encloses paragraph '${n.paraId}'`,target:n}}function VN(e,t){if(t===void 0){let r=Zv(e);return r?{ok:true,controlId:r.id}:{ok:false,code:"notFound",reason:"no content control at the current selection"}}if(IV(t))return {ok:false,code:"unsupported",reason:"DocRange targeting is not supported for content controls",target:t};let n=e.session.part();return kV(t)?CV(n,t):Vt(t)?OV(n,e.session.paragraphAnchors(),t):{ok:false,code:"invalidArgs",reason:"unrecognized target shape",target:t}}function GN(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 zN(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 ZN(e,t){return {ok:false,code:GN(e),reason:zN(e),...t!==void 0?{target:t}:{}}}function MV(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 Yv(e){return e==="viewing"?"view":e==="suggesting"?"suggesting":"edit"}function Qv(e,t,n,r){let o=MV(e,t,n,r);if(!o.ok)return o.refusal;if(e.type==="insertContentControl"){let s=Kv(t,e);return s.ok?KN(t,s.op,s.span.paragraphId):{ok:false,code:s.code,reason:s.reason}}let i=VN(t,e.target);if(!i.ok)return {ok:false,code:i.code,reason:i.reason};let a=e.type==="setContentControlValue"?{op:"setContentControlValue",controlId:i.controlId,value:e.value}:{op:"removeContentControl",controlId:i.controlId};return KN(t,a,i.controlId)}function KN(e,t,n){let r=de(e.session,n)??e.session.part(),o=Cf$1(e.session.currentPackage()),i=Vk(o,t)??tm(r,o,t)??zn$1(r,t);return i?{ok:false,code:GN(i),reason:zN(i)}:{ok:true}}function XN(e,t,n,r){t?.flushPendingInput();let o=Qv(e,t,n,r);return o.ok?AV(t,e):o}function YN(e,t,n,r,o){let i=e.applyGatedTreeOps;return typeof i=="function"?i.call(e,t,n,r,o):e.session.applyTreeOps(t,n,r,o)}function AV(e,t){if(t.type==="insertContentControl")return LV(e,t);let n=VN(e,t.target);if(!n.ok){let a=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...a!==void 0?{target:a}:{}}}e.flushPendingInput();let r=ra(e.state().selection),o=t.type==="setContentControlValue"?{op:"setContentControlValue",controlId:n.controlId,value:t.value}:{op:"removeContentControl",controlId:n.controlId},i=YN(e,[o],r,r,Et(e.session,n.controlId,{kind:"body"}));return i.rejected?ZN(i.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:i.committed})}function LV(e,t){e.flushPendingInput();let n=Kv(e,t);if(!n.ok){let c=n.target??t.target;return {ok:false,code:n.code,reason:n.reason,...c!==void 0?{target:c}:{}}}let{paragraphId:r,start:o,end:i}=n.span,a=ra(e.state().selection),s={paragraphId:r,start:o,end:i},l=YN(e,[n.op],a,s,Et(e.session,r,{kind:"body"}));return l.rejected?ZN(l.reason??"unsupported",t.target):(e.layout(),{ok:true,changed:l.committed})}function QN(e,t,n){switch(n.type){case "selectedText":return e?.selectedText()??"";case "selectionFormatting":return e?t():null;case "selection":return bf(e);case "paragraphs":return WC(e,n.container);case "isInsideToc":return GC(e);case "hyperlinkAt":return $C(e);case "contentControls":return jN(e,n.filter);case "trackedChanges":case "revisions":case "findText":case "comments":return [];case "styles":return {paragraph:new Map,character:new Map,table:new Map};case "variables":return {};case "contentControlAt":return Zv(e,n.filter);case "tableContext":return xf(e);case "splitCellConfig":return jC(e);case "watermark":return FE(e);case "bookmarks":return e?.bookmarkEditing.list()??[];default:return null}}var FV=40,DV="docx-preview-surface",JN="data-docx-previewing";function NV(e){let t=e.ownerDocument.defaultView;for(let n=e.parentElement;n;n=n.parentElement){let r=t?.getComputedStyle(n),o=`${r?.overflowY??""} ${r?.overflowX??""}`;if(/(auto|scroll|overlay)/.test(o))return n}return null}function eH(e,t,n){let r=e.parentElement;if(!r)return null;let o=e.ownerDocument,i=NV(e),a=i?.scrollTop??0,s=i?.scrollLeft??0,l=o.createElement("div");l.className=DV,l.setAttribute("data-docx-preview",""),l.setAttribute("role","region"),l.setAttribute("aria-label",t),l.style.position="absolute",l.style.margin="0";let c=I=>{I.stopPropagation(),I.type!=="contextmenu"&&I.preventDefault();};for(let I of ["contextmenu","paste","cut","drop","dragover"])l.addEventListener(I,c);let d=()=>{l.style.top=`${e.offsetTop}px`,l.style.left=`${e.offsetLeft}px`,l.style.width=`${e.offsetWidth}px`,l.style.minHeight=`${e.offsetHeight}px`;};d(),r.insertBefore(l,e.nextSibling);let u=n(l);if(!u)return l.remove(),null;l.style.position="absolute",d();let f=o.activeElement,p=f&&e.contains(f)?f:null;p?.blur();let g=e.style.visibility;e.style.visibility="hidden",i&&(i.scrollTop=a,i.scrollLeft=s);let h=o.defaultView,b=h?.ResizeObserver,x=b?new b(d):null;x?.observe(e),x?.observe(r),h?.addEventListener("resize",d);let S=e.closest(".docx-editor")??r;S.setAttribute(JN,"");let v=nt(()=>l),k=null,E=()=>{k=null,Pc(u,FV)||(k=v.setTimeout(E,0));};return Or(u)&&(k=v.setTimeout(E,0)),{surface:u,place:d,finishOpening(){for(k!==null&&v.clearTimeout(k),k=null;!Pc(u,Number.POSITIVE_INFINITY););},remove(){k!==null&&v.clearTimeout(k),k=null,x?.disconnect(),h?.removeEventListener("resize",d),S.removeAttribute(JN);let I=i?.scrollTop??0,R=i?.scrollLeft??0;e.style.visibility=g,u.destroy(),l.remove(),i&&(i.scrollTop=I,i.scrollLeft=R),p?.isConnected&&p.focus({preventScroll:true});}}}function Bp(e){if(e.kind==="paragraph")return e.id;if(!("children"in e)||!Array.isArray(e.children))return null;for(let t of e.children){let n=Bp(t);if(n)return n}return null}function tH(e,t){let n=e.parts.get(e.mainDocumentPart)?.root,r=t.parts.get(t.mainDocumentPart)?.root;if(!n||!r||n===r)return null;let o=(a,s)=>{let l=a.children,c=s.children;for(let u=0;u<c.length;u+=1){let f=c[u],p=l[u];if(p!==f)return f.kind==="paragraph"?f.id:p&&p.kind===f.kind&&"children"in p&&"children"in f?o(p,f)??Bp(f):Bp(f)}let d=c[c.length-1];return d?Bp(d):null},i=o(n,r);return i&&eb$1(t.parts.get(t.mainDocumentPart),i)?i:null}var Jv="review-module-required",nH="preview-operation-unsupported";function rH(e,t,n){let r=x$1(e),o=t,i=t.collaborationSession(),a=i?.identity.actorId,s=()=>n().reviewModel!==void 0,l=()=>{let u=t.author()?.trim();return t.editingMode()==="suggest"&&u?u:void 0},c=()=>(n().revisionMarkup??ib$1).trackFormatting&&!t.session.trackingSettings().doNotTrackFormatting,d=u=>{let f=l();return f===void 0?u:Lc(u,{author:f,date:j$1()},c())};return {...r,collaborative:()=>!!i,trackedRangeReplacement:()=>!i,suggesting:()=>t.editingMode()==="suggest",revisionDisplayMode:()=>mb$1(t.revisionDisplayMode()),replacementLanding(u,f,p){let g=l();if(g===void 0)return null;if(p<=f)return f;let y=HV(e,u);return y?op(y,f,p,g,j$1()):f},apply(u,f,p=[],g=false){let y=o.automationWriteRefusal([],false);if(y!==null)return {ok:false,reason:y};if(g&&!s())return {ok:false,reason:Jv};let h=Hb$1(a,()=>r.apply(b=>{let x=u(b);if(x===null||(y=o.automationWriteRefusal(x,p.length>0),y!==null))return null;let S=d(x);return S.some(Ac)&&!s()?y=Jv:y=i?.gateOperations(S,f)??null,y===null?S:null},f,p));return y!==null?{ok:false,reason:y}:h},applyCommentWrites(u,f){let p=o.automationWriteRefusal([],false);if(p!==null)return {ok:false,reason:p};if(f.kind!=="body")return {ok:false,reason:"unsupported-story"};if(!s())return {ok:false,reason:Jv};let g=i?.gateOperations([],f);return g?{ok:false,reason:g}:Hb$1(a,()=>r.applyCommentWrites(u,f))},applyCustomNodeWrite:()=>({ok:false,reason:nH}),applyLifecycle:()=>({ok:false,reason:nH})}}function HV(e,t){let n=e.currentPackage(),r=n.parts.get(n.mainDocumentPart),o=r?[r,...n.parts.values()]:[...n.parts.values()];for(let i of o){if(!i.root)continue;let a=eb$1(i,t);if(a?.kind==="paragraph")return a}return null}var $p=new WeakMap;function oH(e,t){$p.set(e,{...t,active:null});}function iH(e){$p.get(e)?.active?.end();}function Ns(e){let t=$p.get(e)?.active;return !!t&&!t.ended&&t.shown}var BV=Object.freeze({document:true,save:false,events:false,selection:false,scrolling:false,layout:false}),$V=new Uint8Array(0);function WV(e){let t=$p.get(e),n$1=e.surface;if(!t||!n$1||n$1.parked())return {ok:false,reason:"no-document"};if(t.active&&!t.active.ended)return {ok:false,reason:"preview-active"};let r=n$1.hostElement();if(lr(r))return {ok:false,reason:"blocked"};if(n$1.editingMode()==="view")return {ok:false,reason:"viewing"};if(qf(n$1))return {ok:false,reason:"composing"};n$1.flushPendingInput();let o=n$1.session.currentPackage(),i=o.parts.get(o.mainDocumentPart);if(!i)return {ok:false,reason:"no-document"};let a=t.displayOptions(),s=new S(o,i,a.contentLockPolicy?{contentLockPolicy:a.contentLockPolicy}:{}),l=u$1({port:rH(s,n$1,t.displayOptions),capabilities:BV}),c=e.mountGeneration,d=new Set,u=null,f=false,p=e.on("change",()=>{if(f)return;if(e.surface!==n$1||e.mountGeneration!==c){g.end();return}if(!u)return;let{scale:y,showParagraphMarks:h}=t.displayOptions();y!==void 0&&u.surface.setScale(y)&&u.place(),u.surface.setShowParagraphMarks(h??false);}),g={deferEvents:t.deferEvents,host:l,get shown(){return u!==null},get ended(){return f},show(){if(f||u)return false;let y=t.displayOptions(),h=n({ok:true,package:s.currentPackage()},{...y.reviewModel?{reviewModel:y.reviewModel}:{},...y.contentLockPolicy?{contentLockPolicy:y.contentLockPolicy}:{}});if(!h.ok)return false;let b=y.translate?.("editor.previewContent")??en.editor.previewContent;return u=eH(r,b,x=>{let S={...y,editingMode:"view",revisionDisplayMode:n$1.revisionDisplayMode(),openedSession:h,progressiveOpen:true},v=Vc(x,$V,S);return v.ok?(v.surface.setEditable(false),v.surface):null}),u?(Sb(r,true),t.changed(),true):false},reveal(){if(!u)return false;let y=tH(o,s.currentPackage());return y===null?false:(u.finishOpening(),u.surface.revealPosition({paragraphId:y,offset:0}),true)},end(){if(f)return;f=true,p();let y=u!==null;u?.remove(),u=null,y&&Sb(r,false),t.active===g&&(t.active=null),y&&t.changed();for(let h of [...d])try{h();}catch{}d.clear();},onEnd(y){return f?(y(),()=>{}):(d.add(y),()=>d.delete(y))}};return t.active=g,{ok:true,fork:g}}var aH=new WeakMap;function sH(e){let t=aH.get(e);if(!t)throw new Error("External refresh requires a mounted createDocxEditor instance.");return t}function lH(e,t){let n=null,r=null,o={...t,epoch:0,revision:0,mountedRevision:0,source:void 0,invalidated:new Set,cancel(){if(!r||r.mountedRevision!==null)return;t.cancelLoad();let i=r;r=null,ti(i.container,false),t.surface()?.setEditable(e.snapshot().editingMode!=="viewing"),o.source=void 0,i.resolve(false);try{t.changed();}catch{}},invalidate(){o.cancel(),o.epoch++,n=null,r&&(ti(r.container,false),r.resolve(false),r=null),o.source=void 0;for(let i of o.invalidated)i();},contentMounted(i){r?.bytes===i&&(r.mountedRevision=o.revision);},mounted(i,a){if(!r||r.bytes!==i)return;let s=r,l=!a&&!!t.surface();o.mountedRevision=s.mountedRevision??o.revision,l?n=null:n={top:s.top,left:s.left};let c=Nt(s.container);if(l&&c&&(c.scrollTop=Math.max(0,Math.min(s.top,c.scrollHeight-c.clientHeight)),ks(c,s.left),c.dispatchEvent(new(Ae(c)).Event("scroll"))),r===s){r=null,ti(s.container,false),t.surface()?.setEditable(e.snapshot().editingMode!=="viewing"),o.source=void 0,s.resolve(l);try{t.changed();}catch{}}},replace(i,a){let s=t.container();if(!s||r)return Promise.resolve(false);let l=Nt(s);return new Promise(c=>{r={bytes:i,resolve:c,container:s,top:a==="recovery"&&n?n.top:l?.scrollTop??0,left:a==="recovery"&&n?n.left:l?Is(l):0,mountedRevision:null},o.source=a,ti(s,true),t.surface()?.setEditable(false);try{t.load(i);}catch(d){o.mounted(i,d);}})}};return e.on("change",i=>{i.source||o.revision++;}),aH.set(e,o),o}function cH(){let e=new WeakMap,t=new WeakMap;return (n,r,o,i)=>{let a=r?e:t,s=a.get(n);if(s&&s.anchors===r&&s.revision===o)return s;let l=n.map(g=>r?cd$1(g,r):null),c=n.map(i),d=g=>l[g]?.pageIndex??null,u=s!==void 0&&n.every((g,y)=>d(y)===(s.geometries[y]?.pageIndex??null)&&c[y]===s.groups[y]),f=s?.order;if(!u||!f){let g=n.map((y,h)=>h);g.sort((y,h)=>{let b=d(y)??Number.MAX_SAFE_INTEGER,x=d(h)??Number.MAX_SAFE_INTEGER;return b!==x?b-x:c[y]!==c[h]?c[y]-c[h]:y-h}),f=g;}let p={anchors:r,revision:o,geometries:l,groups:c,order:f};return a.set(n,p),p}}function dH(){let e=new WeakMap,t=new WeakMap;return (n,r,o)=>{let i=r?e:t,a=i.get(n);return a&&a.length===o.length&&a.every((s,l)=>s===o[l])?a:(i.set(n,o),o)}}function ex(e,t,n,r){return Z(t,{context:e?ii(e.ownerDocument):null,...r?{fontAlias:r}:{},serifHangulFace:u(n.currentPackage())})}function uH(e$1,t,n,r,o,i){let a$1=new Map,s=new Set,l=p=>{let{family:g,weight:y,style:h}=p.request;return `${p.identity}|${g}|${y}|${h}`},c=i?{shape(p){try{return e$1.shaper.shape(p)}catch(g){let y=p.environment.font;if(g instanceof e&&g.code==="fontOverLimit"&&!s.has(l(y))){s.add(l(y));let{family:h,weight:b,style:x}=y.request;try{i(new a("overLimit",g.message,{request:Object.freeze({family:h,weight:b,style:x}),diagnostic:g.diagnostic??g.message,cause:g}));}catch{}}throw g}}}:e$1.shaper,d$1=c!==e$1.shaper&&q$2(e$1.shaper)?p$1(c):c,u=fa$1({...e$1,shaper:d$1},{resolveFont:p=>{let g=p.fontFamily??t.defaultFont.family;if(g.trim().length===0)return null;let y={family:g,weight:p.bold?700:400,style:p.italic?"italic":"normal"},h=h$2(y);if(a$1.has(h))return a$1.get(h)??null;let b;try{b=e$1.fonts.resolve(y);}catch{return a$1.set(h,null),null}let x=b instanceof d?null:b;return a$1.set(h,x),x},fallback:n.measurer}),f=`shaped:${e$1.operation.extensionFingerprint}+algorithm:${e$1.operation.shapingHash}+producer:${e$1.operation.producerVersion}+fallback:${n.producer}@scale:${r}+fonts:${o}`;return {measurer:u,producer:f}}var qV="The quick brown fox 0123 \u2014 {}#@\uF021\uF041\uF061\uF0A1\uF0E1\uE700\uE710",KV=["monospace","serif"],UV=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function pH(e){if(!e)return ()=>true;let t=new Map,n=r=>(e.font=r,e.measureText(qV).width);return r=>{let o=t.get(r);if(o!==void 0)return o;if(!UV.test(r))return t.set(r,true),true;let i=false;for(let a of KV){let s=n(`32px ${a}`);if(n(`32px "${r}", ${a}`)!==s){i=true;break}}return t.set(r,i),i}}var fH=4;function mH(e,t,n){let r=new Set,o=[];for(let d of t){let u=d.toLowerCase();r.has(u)||(r.add(u),o.push(d));}let i=d=>new Set(e.slice(0,Math.max(d,0)).map(u=>u.toLowerCase())),a=0;for(let d=0;d<=fH;d+=1){let u=i(n-a),f=o.filter(g=>!u.has(g.toLowerCase())).length,p=Math.min(f,fH,Math.floor(n/2));if(p===a)break;a=p;}let s=e.slice(0,Math.max(n-a,0)),l=i(n-a),c=o.filter(d=>!l.has(d.toLowerCase()));return [...s,...c].slice(0,n)}function gH(e,t,n,r=new Set){let o=[];for(let i of e){if(r.has(i.toLowerCase())){o.push(i);continue}if(t(i)||n(i))continue;let a=W.get(i.toLowerCase());a!==void 0&&n(a)||o.push(i);}return o}function hH(e,t){let n=new Set(e.map(r=>r.request.family.toLowerCase()));for(let r=0;r<t.length;r+=1){let o=false;for(let i of t){let a=i.from.family.toLowerCase();n.has(a)||!n.has(i.to.family.toLowerCase())||(n.add(a),o=true);}if(!o)break}return n}var yH=new WeakMap,jV=0,VV=w((e,t)=>{if(e.kind==="paragraphProperties"){let n=yH.get(e);return n||(n=String(++jV),yH.set(e,n)),{families:[n],children:[]}}return {families:e.kind==="paragraph"&&!e.children.some(n=>n.kind==="paragraphProperties")?["default-paragraph"]:[],children:x(e,t)}});function Wp(e){return VV(e,{key:""})}var bH=new WeakMap,vH=new WeakMap;function tx(e){let t=vH.get(e);return t||vH.set(e,t=y()),t}function nx(e,t){tx(e)(t,e.stylesRoot(),e.documentThemeFonts()),A$1(t),Wp(t);}function xH(e,t,n,r){let o=tx(e).warmTableRows(t,n,r,e.stylesRoot(),e.documentThemeFonts()),i=t.children.slice(n,r);return A$1(i),Wp(i),Math.max(o,t.children.length)}function SH(e){let t=e.packageRevision(),n=bH.get(e);if(n?.revision===t)return n.families;let r=n?.eastAsianFonts??tx(e),o=e.storyParts().map(f=>f.root),i=e.stylesRoot(),a=e.numberingRoot(),s=e.documentThemeFonts(),l=Wp(o),d=n&&n.stylesRoot===i&&n.numberingRoot===a&&n.theme===s&&n.numberingInputs.length===l.length&&n.numberingInputs.every((f,p)=>f===l[p])?n.numberingFamilies:C$1(o,a,i,s),u=[...e.symbolFontFamilies(),...r(o,i,s),...A$1(o),...d];return bH.set(e,{eastAsianFonts:r,revision:t,families:u,numberingInputs:l,numberingFamilies:d,numberingRoot:a,stylesRoot:i,theme:s}),u}function wH(e,t,n){let[r]=a$4([[t]]);return mH([...new Set([...r&&r!==n?[r]:[],...e.documentFonts(),...v$1(e.currentPackage(),e.documentThemeFonts())])],SH(e),c$3)}function kH(e,t){let n,r=false,o=()=>{r=false;let s=e();if(!s)return;let l=n?.generation!==s.generation;l&&(n={generation:s.generation,requested:new Set,running:false,late:[]});let c=n;if(c.running)return;let d=c.late.shift();if(d!==void 0){c.running=true;let p=t(s.families(),d);return p.finally(()=>{c.running=false,n===c&&i();}),p}if(!l&&!s.dynamic)return;let u=s.families().filter(p=>!c.requested.has(p.toLowerCase()));if(!l&&u.length===0)return;for(let p of u)c.requested.add(p.toLowerCase());c.running=true;let f=t(u);return f.finally(()=>{c.running=false,n===c&&i();}),f},i=(s=false)=>{if(s)return o();r||(r=true,queueMicrotask(o));};return {schedule:i,deliver:(s,l)=>{n?.generation===s&&(n.late.push(l),i());}}}function IH(){let e=0,t=new AbortController,n=()=>{let r=t;return {generation:e,signal:r.signal,current:()=>t===r&&!r.signal.aborted}};return {get generation(){return e},capture:n,advance(){let r=t;return t=new AbortController,e+=1,{...n(),cancelPrevious:()=>r.abort()}},dispose:()=>t.abort()}}function pr(e,t,n="unsupported"){if(e===null||e===Ic)return {ok:false,code:n,reason:t};if(e.startsWith("locked-content:"))return {ok:false,code:"locked",reason:e};if(e.startsWith("bound-content:"))return {ok:false,code:"bound",reason:e};let r=Fs(e);return {ok:false,code:r==="edit.read-only"||r==="edit.protected-content"?"locked":"unsupported",reason:e}}function PH(e){return e.kind==="custom"?`custom node '${e.name}' has no reviewCard, so it has no card to activate`:`review items of kind '${e.kind==="revision"?e.revisionKind:e.kind}' are excluded from activation`}function rx(e,t){let n=e.review;return n?{reviewModel:j$4({...n,collectReviewItems:r=>n.collectReviewItems(e.customNodes.length>0?{...r,customNodes:e.customNodes,...e.customNodeDiagnostics.length>0?{reportCustomNodeDiagnostic:t}:{}}:r)},f$2)}:{}}var GV=["all-markup","simple-markup","proposed","original"];function TH(e){let t=()=>e.placements({pairReplacements:true}).filter(v=>v.kind==="revision"&&(v.activatable||v.revisionKind==="format")),n=()=>e.surface()?.session.reviewItems().filter(v=>v.kind==="revision")??[],r=()=>{let v=e.surface()?.session;if(!v)return [];let k=e$3(v.currentPackage());return v.storyParts().flatMap(E=>g$4(dm(E),k))},o=(v,k)=>v.keys!==void 0||v.scope==="document"||e.authorVisibility.hasPredicate?[]:k().filter(E=>e.authorVisibility.isVisible(E.author)),i=(v,k=false)=>{let E=n(),I,R=M=>(I??=new Map(e.placements({placement:false,pairReplacements:true}).filter(ee=>oi(ee.key)).map(ee=>[ee.key,ee])),I.get(M)),O=new Set(v.keys?.flatMap(M=>{if(!oi(M))return [M];let ee=R(M);return ee?Ss(ee.item):[M]})??(v.scope==="document"?E:SL(e.surface()?.session.reviewItems()??[],e.authorVisibility)).filter(M=>M.kind==="revision").map(nl)),C=new Map,w=v.keys===void 0&&(v.scope==="document"||!e.authorVisibility.hasFilter);if(w){let M=e.surface().session,ee=v.scope==="document"?null:new Set(E.flatMap(J=>{let fe=J.kind==="revision"?ml(J):[],se=fe.length?de(M,fe[0]):null;return se?[se.name]:[]}));for(let J of M.storyParts())(!ee||ee.has(J.name))&&C.set(J.name,{scope:Et(M,J.root.id,{kind:"body"}),part:J,keys:[]});}let T=null,$=()=>T??=r(),W=k?o(v,$):[];for(let M of W)O.add(nl(M));let q=M=>{let ee=e.scope(M),J=de(e.surface().session,ml(M)[0]);if(!J)return;let fe=C.get(J.name);fe||(fe={scope:ee,part:J,keys:[]},C.set(J.name,fe));let se=nl(M);O.delete(se)&&fe.keys.push(se);};for(let M of E)q(M);for(let M of W)q(M);let K=new Set(v.keys??[]);if(K.size>0&&O.size>0)for(let M of $())O.has(nl(M))&&q(M);let Z=k?new Set($().flatMap(M=>K.has(nl(M))?[]:[nl(M)])):new Set;return {scopes:[...C.values()],missing:[...O],unfilteredDocument:w,silent:Z}},a=v=>!e.surface().session.storyParts().some(k=>k.name===v.name),s=v=>{let k=[],E=[];for(let{scope:I,part:R,ops:O}of v)O.length&&(a(R)?E.push({partName:R.name,ops:O}):k.push({scope:I,ops:O}));return {groups:k,partOps:E}},l=(v,k=false)=>{let{scopes:E,missing:I,unfilteredDocument:R,silent:O}=i(v,k),C=[],w=I.filter(W=>!O.has(W)).map(W=>({key:W,reason:"unknown-revision"})),T=[],$=0;for(let{scope:W,part:q,keys:K}of E){let Z=Aa(q,v.action,R?void 0:K,void 0,{countRemaining:false,explicit:v.keys!==void 0});for(let M of Z.result.resolved)O.has(M.key)||C.push(M);for(let M of Z.result.skipped)O.has(M.key)||w.push(M);$+=Z.result.remaining,T.push({scope:W,part:q,ops:Z.ops});}return {...s(T),result:{resolved:C,skipped:w,remaining:$}}},c=v=>v.author===void 0?e.surface()?.author():v.author,d=v=>{let{scopes:k,missing:E}=i(v),I={author:c(v)??"",...v.date===void 0?{}:{date:v.date}},R=E.map(w=>({key:w,reason:"unknown-revision"})),O=[];for(let{scope:w,part:T,keys:$}of k){if(!$.length)continue;let W=jm(T,I,$,void 0,v.authors);O.push({scope:w,part:T,ops:W.ops,plan:W});}let C=w=>({updated:w.flatMap(T=>T.updated),skipped:[...R,...w.flatMap(T=>T.skipped)]});return {...s(O),result:C(O.map(({plan:w})=>w.result)),finish:()=>{let w=e.surface().session.currentPackage().parts;return C(O.map(({part:T,plan:$})=>{let W=w.get(T.name);return W?$.finish(W):$.result}))}}},u=()=>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:qt},f=v=>v.scope!==void 0&&!["visible","document"].includes(v.scope)||v.unsupported!==void 0&&!["skip","fail"].includes(v.unsupported)||v.keys!==void 0&&(!Array.isArray(v.keys)||v.keys.some(k=>typeof k!="string"))?{ok:false,code:"invalidArgs",reason:"invalid bulk revision selection"}:null,p=v=>{let k=u();if(!k.ok)return {gate:k};if(e.viewing())return {gate:{ok:false,code:"locked",reason:"the document is open for viewing"}};let E=Vn(v,e.surface());if(E)return {gate:E};let I=c(v);if(I===void 0)return {gate:{ok:false,code:"invalidArgs",reason:"pass an author, or configure the editor author, to change the author"}};if(typeof I!="string"||v.date!==void 0&&typeof v.date!="string"||im({author:I,...v.date===void 0?{}:{date:v.date}}))return {gate:{ok:false,code:"invalidArgs",reason:"author must be nonblank text, and date an ISO 8601 date and time"}};let R=f(v);if(R)return {gate:R};if(v.keys!==void 0&&(v.scope!==void 0||v.authors!==void 0)||v.authors!==void 0&&(!Array.isArray(v.authors)||v.authors.some(w=>typeof w!="string")))return {gate:{ok:false,code:"invalidArgs",reason:"select by keys, or by scope and authors; authors must be a list of names"}};let O=d(v),{result:C}=O;return v.unsupported==="fail"&&C.skipped.length?{gate:{ok:false,code:"unsupported",reason:"some selected changes cannot change author"},plan:O}:C.updated.length?{gate:{ok:true},plan:O}:{gate:{ok:false,code:C.skipped.some(w=>w.reason==="unsupported-revision")?"unsupported":"notFound",reason:"no eligible selected changes to update"},plan:O}},g=v=>{e.surface()?.flushPendingInput();let{gate:k,plan:E}=p(v);if(!k.ok)return E?{...k,revisionAuthors:{...E.result,updated:[]}}:k;let I=e.surface(),{groups:R,partOps:O}=E;if(!R.length&&!O.length)return {ok:true,changed:false,revisionAuthors:E.result};let C=e.placements({placement:false,pairReplacements:false}).find(q=>q.isActive)?.key,w,T=I.commitReviewOps(q=>(w=I.session.applyTreeOpsAtomic(R,{partOps:O,historyToken:q}),w),"revision-attribution");if(!w?.committed)return pr(T,"the changes were refused");let $=E.finish(),W=$.updated.find(q=>q.previousKey===C);return W&&e.activate(W.key),{ok:true,changed:true,revisionAuthors:$}},y=v=>{if(v.type==="setReviewChangesAuthor")return p(v).gate;if(v.type!=="navigateReviewChange"&&v.type!=="resolveAllReviewChanges"&&v.type!=="setReviewDisplayMode")return null;let k=u();if(!k.ok)return k;if(v.type==="setReviewDisplayMode")return GV.includes(v.mode)?{ok:true}:{ok:false,code:"invalidArgs",reason:"unknown review display mode"};if(v.type==="navigateReviewChange"&&!["next","previous"].includes(v.direction))return {ok:false,code:"invalidArgs",reason:"unknown review navigation direction"};if(v.type==="resolveAllReviewChanges"&&!["accept","reject"].includes(v.action))return {ok:false,code:"invalidArgs",reason:"unknown review resolution action"};if(v.type==="navigateReviewChange")return t().length?{ok:true}:{ok:false,code:"notFound",reason:"no visible changes to review"};if(e.viewing())return {ok:false,code:"locked",reason:"the document is open for viewing"};let E=Vn(v,e.surface());if(E)return E;let I=f(v);if(I)return I;let{result:R,groups:O,partOps:C}=l(v);return v.unsupported==="fail"&&R.skipped.length?{ok:false,code:"unsupported",reason:JV}:!R.resolved.length&&!O.length&&!C.length?{ok:false,code:eG(R.skipped),reason:tG(R.skipped,e.authorVisibility.hasFilter)}:{ok:true}},h=(v,k)=>{let E=u();if(!E.ok)return E;if(e.viewing()){let T=e.surface().commitReviewOps(()=>({committed:false,reason:"the document is open for viewing"}),"revision-resolve");return pr(T,"the document is open for viewing","locked")}let I=Vn({type:"resolveAllReviewChanges"},e.surface());if(I)return I;e.surface().flushPendingInput();let R=Yr(e.placements,v)?.item;if(!R||R.kind!=="revision")return {ok:false,code:"notFound",reason:"unknown-revision: no revision with that key"};if(R.readOnly)return {ok:false,code:"unsupported",reason:cs};let O=oG(de(e.surface().session,ml(R)[0]),R,k);if(O)return O;let C,w=e.surface().commitReviewOps(T=>{let $=e.surface().session,W=de($,ml(R)[0]);if(W&&a(W)){let Z=RH(R,k,W);return Z.refusal?(C={committed:false,reason:Z.refusal},C):(C=$.applyTreeOpsAtomic([],{partOps:[{partName:W.name,ops:Z.ops}],historyToken:T}),C)}let q=e.surface().session.partFor(e.scope(R)),K=RH(R,k,q);return K.refusal?(C={committed:false,reason:K.refusal},C):(C=e.surface().session.applyTreeOps(K.ops,void 0,void 0,e.scope(R),{historyToken:T}),C)},"revision-resolve");return C?.committed?{ok:true,changed:true}:pr(w??(typeof C?.reason=="string"?C.reason:null),"the revision was refused")},b=v=>{if(v.type==="setReviewChangesAuthor")return g(v);if(!["navigateReviewChange","resolveAllReviewChanges","setReviewDisplayMode"].includes(v.type))return null;e.surface()?.flushPendingInput();let k=y(v);if(!k)return null;if(!k.ok){if(v.type==="resolveAllReviewChanges"&&(k.code==="notFound"||k.code==="unsupported"||k.code==="locked"||k.code==="bound")&&u().ok&&!e.viewing()){let{result:T}=l(v);return {...k,revisions:{...T,resolved:[],remaining:n().length}}}return k}let E=e.surface();if(v.type==="setReviewDisplayMode")return e.setDisplayMode(v.mode),{ok:true,changed:false};if(v.type==="navigateReviewChange"){let T=t(),$=T.findIndex(J=>J.isActive),W=v.direction==="next"?1:-1,q=$<0?zV(T,E,W):($+W+T.length)%T.length,K=T[q],Z=xs(K.item),M=Z?nl(Z.deletion):K.key,ee=e.activate(K.key,!K.activatable&&K.revisionKind==="format");return ee.ok&&e.reveal({key:M,source:"navigate"}),ee}if(v.type!=="resolveAllReviewChanges")return null;let{groups:I,partOps:R,result:O}=l(v,true),C,w=E.commitReviewOps(T=>(C=E.session.applyTreeOpsAtomic(I,{partOps:R,historyToken:T}),C),"revision-resolve");return C?.committed?(e.activate(null),e.resolved?.({action:v.action,resolvedCount:O.resolved.length,skipped:O.skipped.map(({key:T,reason:$,detail:W})=>({key:T,reason:$,...W?{detail:W}:{}}))}),{ok:true,changed:true,revisions:{...O,remaining:n().length}}):pr(w,"the revisions were refused")},x=v=>{let k=Yr(e.placements,v)?.item;return k?.kind==="revision"?k:void 0},S=e.report?e.report.diagnostics.reviewItem(h,x,(v,k)=>{let E=e.surface()?.session,I=E&&de(E,ml(v)[0]);if(!I)return {};try{let O=Aa(I,k,Ss(v),void 0,{countRemaining:!1,explicit:!0}).result.skipped[0]?.detail;return {partName:I.name,...O?{detail:O}:{}}}catch{return {partName:I.name}}},e.report.tracked):h;return {can:y,exec:b,resolveReviewItem:S}}function zV(e,t,n){let r=t.state().selection.head,o=de(t.session,r.paragraphId),i=o?Tk(o):new Map,a=i.get(r.paragraphId);if(a!==void 0)for(let s=n>0?0:e.length-1;s>=0&&s<e.length;s+=n){let l=e[s],c=l.kind==="revision"?l.item.ranges[0]?.start:void 0,d=c?i.get(c.paragraphId):void 0;if(c&&d!==void 0&&(n>0?d>a||d===a&&c.offset>=r.offset:d<a||d===a&&c.offset<=r.offset))return s}return n>0?0:e.length-1}var ZV="no eligible selected changes to review",XV="these changes would also resolve changes the filter hides; clear the filter to review them first",YV="these changes would also resolve changes the selection leaves out; decide each card",QV="none of the selected changes can be resolved",JV="some selected changes cannot be resolved";function eG(e){return e.length?e.every(t=>t.detail==="locked-content")?"locked":e.every(t=>t.detail==="bound-content")?"bound":"unsupported":"notFound"}function tG(e,t){return e.length?e.every(n=>n.reason==="incomplete-group")?t?XV:YV:e.every(n=>n.detail==="locked-content")?Lp:e.every(n=>n.detail==="bound-content")?Fp:QV:ZV}var nG="retained-structure: the row stays because it holds a nested table with untracked rows",rG="incomplete-group: this change resolves only together with another change, such as the deleted row that holds it; decide that change first";function EH(e){return e.reason==="retained-structure"?nG:e.reason==="incomplete-group"?rG:e.detail==="locked-content"||e.detail==="bound-content"?`${e.detail}: the change stays pending`:e.detail?`${e.reason}: ${e.detail}`:e.reason}function oG(e,t,n){let r=e&&km(e)?mm(e,ml(t),n):null;return r?{ok:false,code:r==="locked-content"?"locked":"bound",reason:EH({reason:"unsupported-revision",detail:r})}:null}function iG(e,t){let n=new Set(ml(t)),r=Pl(e).filter(o=>n.has(o.node.id));return r.some(o=>o.paragraphMark)&&Gl$1(e,r,"accept").size>0}function aG(e,t){let n=kl(e.root);return n==="everywhere"?true:n.size>0&&(t.ranges.length===0||t.ranges.some(r=>n.has(r.start.paragraphId)||n.has(r.end.paragraphId)))}function RH(e,t,n){let r=t==="accept"?"acceptRevision":"rejectRevision";if(!n)return {ops:[]};if(e.revisionKind==="structural"||e.revisionKind==="moveFrom"||e.revisionKind==="moveTo"||e.revisionKind==="paragraphMark"||aG(n,e)||e.revisionKind==="format"||t==="accept"&&iG(n,e)||sG(n,e)){let a=Aa(n,t,Ss(e),void 0,{countRemaining:false,explicit:true}),s=a.result.skipped[0];return s?{ops:[],refusal:EH(s)}:{ops:a.ops}}let o=new Set(ml(e)),i=new Map;for(let a of Pl(n)){if(!o.has(a.node.id))continue;let s=f=>a.node.attributes.find(p=>p.namespaceUri===pa$2&&p.localName===f)?.value,l=e.addresses.find(f=>f.id===s("id")&&f.author===(s("author")??"")&&(f.date??"")===(s("date")??""));if(!l)continue;let c=a.node.localName,d=JSON.stringify([l,c]),u=i.get(d);u?u.siteNodeIds.push(a.node.id):i.set(d,{revision:l,localName:c,siteNodeIds:[a.node.id]});}return {ops:[...i.values()].map(({revision:a,localName:s,siteNodeIds:l})=>({op:r,revision:a,...s===void 0?{}:{localName:s},siteNodeIds:l}))}}function sG(e,t){if(t.revisionKind!=="insert"&&t.revisionKind!=="delete")return false;let n=new Set(ml(t));return n.size>1&&Pl(e).some(r=>r.paragraphMark&&n.has(r.node.id))}function CH(e){return e.kind==="comment"?e.comment.date:e.kind==="revision"?e.date:void 0}function MH(e,t,n,r){return e.type!=="toggleReviewPane"&&e.type!=="toggleParagraphMarks"&&e.type!=="toggleBookmarks"&&e.type!=="setEditingMode"?null:t?{ok:false,code:"notFound",reason:"the editor was destroyed"}:e.type==="toggleReviewPane"&&!n?{ok:false,code:"unsupported",reason:qt}:e.type==="setEditingMode"?r(e.mode)??{ok:true}:{ok:true}}function OH(e){let t=false;return {get:()=>t,toggle:()=>{t=!t,e(t);}}}function AH(e){let t=0,n=0,r=TN({changed:()=>{t+=1,e.changed();},error:a=>e.emitError(on("hostCallback",`a bookmark mark callback failed: ${a instanceof Error?a.message:String(a)}`))}),o=OH(a=>{e.surface()?.setShowParagraphMarks(a),e.changed();}),i=OH(a=>{e.surface()?.bookmarkEditing.setShown(a),e.changed();});return {popupChrome:r,chromeSettled(){let a=n===t;return n=t,a},capability:e.capability,surfaceOptions:()=>({showParagraphMarks:o.get(),onToggleParagraphMarks:o.toggle,showBookmarks:i.get(),...r.surfaceOptions}),snapshot:()=>({showParagraphMarks:o.get(),showBookmarks:i.get()}),dialog(a,s){if(a.type==="openGoTo"){let l=r.goTo,c=a.fromShortcut===true;return c&&l.canOpen()&&!l.shortcutOn()&&!e.destroyed()?{ok:false,code:"unsupported",reason:"the Go To shortcut is turned off"}:Dy(c?{canOpen:l.canOpen,open:l.openFromShortcut}:l,e.destroyed(),s,"Go To view")}return a.type!=="openBookmarkDialog"?null:Dy(r.bookmarkDialog,e.destroyed(),s)},toggle(a){if(a.type==="toggleParagraphMarks")o.toggle();else if(a.type==="toggleBookmarks")i.toggle();else return null;return {ok:true,changed:false}},isActive(a){return a.type==="toggleParagraphMarks"?o.get():a.type==="toggleBookmarks"?i.get():null}}}function LH(e,t){return e.session.subscribe(n=>{let r={revision:e.session.packageRevision(),created:n.created,deleted:n.deleted,dirty:n.dirty};n.impact!=="text-local"&&t.refitIfPageResized(),t.bump(),t.emit(r);})}var lG=12;function FH(e,t){if(typeof MessageChannel=="function"){let n=new MessageChannel;n.port1.onmessage=()=>{n.port1.close(),e();},n.port2.postMessage(null);return}t.setTimeout(e,0);}function DH(e,t){if(!Or(e))return;let n=()=>{t.current()!==e||!Or(e)||(t.slice(()=>Pc(e,lG))?t.settled():FH(n,t.view()));};FH(n,t.view());}function NH(e,t){let n=false;return {...e,slice:r=>{try{return e.slice(r)}catch(o){let i=t.take();if(!i)throw o;return t.crashed(o),t.mounted(i,o),n=true,true}},settled:()=>{if(n)return;let r=t.take();e.settled(),r&&t.mounted(r);}}}function HH(e,t,n){if(!t)return false;switch(e.type){case "toggleMark":switch(e.mark){case "bold":return t.bold===true;case "italic":return t.italic===true;case "underline":return t.underline===true;case "strike":return t.strike===true;case "superscript":return t.superscript===true;case "subscript":return t.subscript===true;default:return false}case "setParagraphDirection":return t.direction===e.direction;case "setAlignment":return t.alignment===(e.align==="justify"?"both":e.align);case "toggleList":return n(e.kind);default:return false}}var _H=new WeakMap;function ox(e,t){let n=t(e?.matches??[]);return _H.set(n,e?.truncated??false),n}function BH(e){return _H.get(e)}function qp(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}))?(Vy(e,n,t.rId),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:"the header or footer could not be opened"}}function cG(e){return e?.kind==="headerFooter"||e?.kind==="note"}function dG(e,t){return t!=="viewing"&&typeof e.enterHeaderFooter=="function"&&typeof e.enterNote=="function"?"all":"body"}function Kp(e,t){e.activeScope().kind!=="body"&&e.session.paragraphIds().includes(t)&&(e.activeScope().kind==="frame"&&e.setActiveScope({kind:"body"}),e.exitNote?.(),e.exitHeaderFooter?.());}function $H(e,t){if(typeof t?.blockId!="string"||t.blockId.length===0||!Number.isInteger(t.start)||t.start<0||!Number.isInteger(t.length)||t.length<0)return {ok:false,code:"invalidArgs",reason:"match must carry a blockId and offsets"};if(t.scope?.kind==="frame"){let{drawingNodeId:r,hostParagraphId:o}=t.scope;if(typeof r!="string"||r.length===0||typeof o!="string"||o.length===0)return {ok:false,code:"invalidArgs",reason:"a frame match must carry drawing and host paragraph ids"};let i={ok:false,code:"unsupported",reason:"the text box drawing could not be selected"};if(!ws(e.layout(),r,o))return i;let a=t.scope.owner;if(a){let s=qp(e,a,{paragraphId:o,offset:0});if(!s.ok)return s}else Kp(e,o);return e.revealParagraph(o),e.selectDrawing(r,o)?{ok:true,changed:false}:i}let n={paragraphId:t.blockId,offset:t.start};if(cG(t.scope)){let r=qp(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"};Kp(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 WH(e,t,n,r,o){let i={...o?.matchCase!==void 0?{matchCase:o.matchCase}:{},...o?.wholeWord!==void 0?{wholeWord:o.wholeWord}:{},...e?{stories:dG(e,t)}:{}};if(typeof r=="string")return ox(e?.session.findText(r,i),n);let a=e?.session.findText(r,i);return r.map((s,l)=>ox(a?.[l],n))}function Hs(e,t,n){let r=e.block??t,o=e.behavior??"instant",i=e.offsetPx??24;if(!["start","center","centerIfNeeded","nearest"].includes(r))throw new TypeError("block must be start, center, centerIfNeeded, or nearest.");if(!["instant","smooth"].includes(o))throw new TypeError("behavior must be instant or smooth.");if(!Number.isFinite(i)||i<0)throw new RangeError("offsetPx must be finite and nonnegative.");let a=n?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)").matches??false;return {block:r,offsetPx:i,behavior:a?"instant":o}}function qH(e,t,n=()=>null){return {scrollToPage(r){return !Number.isInteger(r)||r<1?false:(t(),e()?.revealPage(r-1)??false)},scrollToBlock(r,o){if(typeof r!="string"||r.length===0)return false;let i;try{i=Hs(o??{},"start",n());}catch{return false}t();let a=e();return a&&Kp(a,r),a?.revealParagraph(r,i)??false}}}var KH="cubic-bezier(0.23, 1, 0.32, 1)";function pa(e,t,n,r=1/0){let o=e??t;if(!Number.isFinite(o)||o<0||o>r)throw new RangeError(r===1/0?`${n} must be a finite, nonnegative number.`:`${n} must be finite and between 0 and ${r}.`);return o}function UH(e,t=180){if(e!==void 0&&typeof e!="boolean"&&(typeof e!="object"||e===null||Array.isArray(e)))throw new TypeError("animation must be a boolean or a durationMs settings object.");return e===false?0:pa(typeof e=="object"?e.durationMs:void 0,e===true||typeof e=="object"?180:t,"animation.durationMs",1e4)}function Up(e,t,{marker:n,defaultColor:r},o){let i=[],a=new Map,s=new Set,l=null,c=null,d=r,u=.14,f=4,p=6,g=0,y=r,h="solid",b="",x=180,S=180,v,k=KH,E=nt(()=>t.container()),I,R=0,O=()=>{R++,I!==void 0&&E.clearTimeout(I),I=void 0;},C=B=>{let D=t.container()?.ownerDocument.defaultView?.CSS??globalThis.CSS;if(B!==void 0&&(typeof B!="string"||!B.trim()||/var\(|^(inherit|initial|unset|revert|revert-layer)$/i.test(B.trim())||D?.supports&&!D.supports("animation-timing-function",B)))throw new TypeError("animation.easing must be a CSS timing function without variables.");let j=t.container()?.ownerDocument.defaultView?.KeyframeEffect??globalThis.KeyframeEffect;if(B!==void 0&&j)try{new j(null,[],{easing:B});}catch{throw new TypeError("animation.easing must be one valid animation timing function.")}return B},w=(B,D)=>pa(typeof B=="object"?B.exitDurationMs:void 0,D,"animation.exitDurationMs",1e4),T=(B={})=>{if(B.includePrevious!==void 0&&typeof B.includePrevious!="boolean")throw new TypeError("includePrevious must be a boolean.");let D=pa(B.opacity,.14,"opacity",1),j=pa(B.padding,4,"padding"),H=pa(B.borderRadius,6,"borderRadius"),N=UH(B.animation),z=w(B.animation,N),X=C(typeof B.animation=="object"?B.animation.easing:void 0),F=B.timeoutMs===null?null:pa(B.timeoutMs,3e3,"timeoutMs",2147483647),U=B.color??r,G=pa(B.borderWidth,0,"borderWidth"),Y=B.borderColor??U,le=B.borderStyle??"solid",oe=B.className??"";if(!["solid","dashed","dotted"].includes(le))throw new TypeError("borderStyle must be solid, dashed, or dotted.");if(typeof oe!="string")throw new TypeError("className must be a string.");let ae=t.container()?.ownerDocument.defaultView?.CSS??globalThis.CSS;if(typeof U!="string"||!U.trim()||ae?.supports&&!ae.supports("color",U))throw new TypeError("color must be a CSS color or var() expression.");if(ae?.supports&&!ae.supports("color",`color-mix(in srgb, ${U} ${D*100}%, transparent)`))throw new TypeError("color must be valid inside color-mix(), including var() expressions.");if(typeof Y!="string"||!Y.trim()||ae?.supports&&!ae.supports("color",Y))throw new TypeError("borderColor must be a CSS color or var() expression.");if(B.changeIds!==void 0&&(!Array.isArray(B.changeIds)||B.changeIds.length>1e4||B.changeIds.some(xe=>typeof xe!="string"||!xe)))throw new TypeError("changeIds must contain at most 10000 nonempty string IDs.");return {nextOpacity:D,nextPadding:j,nextRadius:H,nextDuration:N,nextExitDuration:z,nextEasing:X,nextTimeout:F,nextColor:U,nextBorderWidth:G,nextBorderColor:Y,nextBorderStyle:le,nextClassName:oe}},$=()=>v||t.container()?.ownerDocument.defaultView?.getComputedStyle(t.container()).getPropertyValue("--doc-motion-ease-out").trim()||KH,W=B=>{B.animation&&(B.animation.onfinish=null,B.animation.cancel(),B.animation=void 0);},q=(B,D)=>{W(D),D.element.remove(),a.get(B)===D&&a.delete(B);},K=()=>(c||(c=t.container()?.ownerDocument.defaultView?.matchMedia?.("(prefers-reduced-motion: reduce)")??null,c?.addEventListener("change",M)),c?.matches??false),Z=()=>{c?.removeEventListener("change",M),c=null;};function M(){if(c?.matches){for(let[B,D]of a)W(D),D.exiting&&q(B,D);a.size||Z();}}let ee=(B,D,j,H,N=false)=>{if(!N&&D.target===j&&!D.exiting)return;let z=D.element.ownerDocument.defaultView,X=N?0:Number.parseFloat(z?.getComputedStyle(D.element).opacity??String(D.target));W(D),D.target=j,D.element.style.opacity=String(j);let F=K()?Math.min(H,125):H;if(F===0||typeof D.element.animate!="function"){D.exiting&&q(B,D);return}try{let U=D.element.animate([{opacity:Number.isFinite(X)?X:j},{opacity:j}],{duration:F,easing:k});D.animation=U,U.onfinish=()=>{D.animation===U&&(D.animation=void 0,D.exiting&&q(B,D),a.size||Z());};}catch{D.exiting&&q(B,D);}},J=()=>{l?.disconnect();let B=t.surface(),D=t.container();if(!B||!D||i.length===0)return;k=$();let j=new Set(i.map(F=>F.paragraphId)),H=e.getRenderScale(),N=e.snapshot().zoom,z=new Set,X=new Set;for(let F of B.layout().pages){let U=D.querySelector(`[data-page-index="${F.index}"] > .docx-page-content`);if(U)for(let G of Ka$1(F)){if(!j.has(G.paragraphId))continue;let Y=`${F.index}:${G.id}`;z.add(Y);let le=kc$1(G),oe=G.lines.length&&!G.clipToBox?1/0:le.y,ae=G.lines.length&&!G.clipToBox?-1/0:le.y+le.height;for(let He of G.clipToBox?[]:G.lines)oe=Math.min(oe,He.box.y),ae=Math.max(ae,He.box.y+He.box.height);let xe=G.clipToBox?0:f*N,Se=F.contentBox.x-F.box.x,at=F.contentBox.y-F.box.y,we=Math.max(-Se*H,le.x*H-xe),Ue=Math.min((F.box.width-Se)*H,(le.x+le.width)*H+xe);oe=Math.max(-at*H,oe*H-xe),ae=Math.min((F.box.height-at)*H,ae*H+xe);let _e=a.get(Y);_e&&_e.element.parentElement!==U&&(q(Y,_e),_e=void 0);let Je=!_e;if(!_e){let He=D.ownerDocument.createElement("div");He.setAttribute("data-docx-marker",""),He.setAttribute(n,""),He.setAttribute("contenteditable","false"),He.setAttribute("aria-hidden","true"),He.style.cssText="position:absolute;pointer-events:none;box-sizing:border-box;",_e={element:He,paragraphId:G.paragraphId,target:-1,exiting:false},a.set(Y,_e),U.append(He);}let et=_e.exiting;_e.exiting=false,et&&(_e.target=-1),_e.element.className=b,Object.assign(_e.element.style,{border:g?`${g*N}px ${h} ${y}`:"0",backgroundColor:`color-mix(in srgb, ${d} ${u*100}%, transparent)`,borderRadius:`${p*N}px`,left:`${we}px`,top:`${oe}px`,width:`${Math.max(0,Ue-we)}px`,height:`${Math.max(0,ae-oe)}px`}),ee(Y,_e,1,Je&&s.has(G.paragraphId)?0:x,Je),X.add(G.paragraphId);}}for(let F of X)s.add(F);for(let[F,U]of a)z.has(F)||(!U.element.isConnected||j.has(U.paragraphId)||S===0?q(F,U):U.exiting||(U.exiting=true,ee(F,U,0,S)));l??=new(Ae(D)).MutationObserver(J),l.observe(D,{childList:true,subtree:true});},fe=()=>{O(),i=[],s.clear(),l?.disconnect();for(let[B,D]of a)q(B,D);Z();},se=(B={})=>{let D=w(B.animation,UH(B.animation,S));k=C(typeof B.animation=="object"?B.animation.easing:void 0)??$(),O(),i=[],s.clear(),l?.disconnect();for(let[H,N]of a)N.exiting&&D>0||(N.exiting=true,ee(H,N,0,D));a.size||Z();};return e.on("selectionChange",()=>{i.length&&J();}),{show(B,D={}){let{nextOpacity:j,nextPadding:H,nextRadius:N,nextDuration:z,nextExitDuration:X,nextEasing:F,nextTimeout:U,nextColor:G,nextBorderWidth:Y,nextBorderColor:le,nextBorderStyle:oe,nextClassName:ae}=T(D),xe=new Set(i.map(Se=>Se.paragraphId));if(s=new Set([...s].filter(Se=>xe.has(Se))),d=G,g=Y,y=le,h=oe,b=ae,u=j,f=H,p=N,x=z,S=X,v=F,i=B,x===0)for(let Se of a.values())Se.exiting||W(Se);if(!i.length){se();return}if(J(),O(),U!==null){let Se=R;I=E.setTimeout(()=>{Se===R&&(I=void 0,se(),o());},U);}},validate:T,hide:se,clear:fe,repaint:J}}function jH(e,t){e.flushPendingInput();let n=jn(e.session.part(),e.session.paragraphAnchors(),t);return n.ok?n.span:null}function VH(e,t,n){let r=null,o=i=>{if(r)return r;let a=e(),s=Up(a,i,{marker:"data-docx-anchor-highlight",defaultColor:"var(--doc-anchor-highlight-color)"},()=>{});return i.invalidated.add(()=>s.clear()),a.on("change",l=>{l.source&&s.clear();}),r=s,s};return {scrollToAnchor(i,a={}){let s=t(),l=Hs(a,"centerIfNeeded",s?.container()??null);if(!Vt(i))return false;n();let c=s?.surface();if(!c)return false;let d=jH(c,i);return !!d&&c.revealPosition({paragraphId:d.nodeId,offset:d.start},l)},highlightAnchor(i,a){let s=t();if(!s)return false;let l=o(s);if(l.validate(a),!Vt(i))return false;n();let c=s.surface();if(!c||!s.container()||s.source)return false;let d=jH(c,i)?.nodeId;return !d||!c.layout().pages.some(f=>Ka$1(f).some(p=>p.paragraphId===d))&&!(Or(c)&&c.session.paragraphIds().includes(d))?false:(l.show([{paragraphId:d}],a),true)},clearAnchorHighlight(i){let a=t();a&&o(a).hide(i);}}}function GH(e,t){if(!t.some(o=>o.scope?.kind==="frame"))return t;let n=e.publishedLayout();if(n.revision!==e.session.packageRevision())return t;let r=new Map;return t.filter(o=>{let i=o.scope;if(i?.kind!=="frame")return true;let a=`${i.drawingNodeId}\0${i.hostParagraphId}`,s=r.get(a);return s===void 0&&(s=!!ws(n,i.drawingNodeId,i.hostParagraphId),r.set(a,s)),s})}var uG=/^[A-Za-z][A-Za-z0-9_-]{0,63}$/,fG=/^-?[A-Za-z_][A-Za-z0-9_-]*$/,pG=1e4,zH=32,ix=1e3;function mG(e,t,n){let r=e?.ownerDocument.defaultView?.CSS??globalThis.CSS;return !r?.supports||r.supports(t,n)}function ZH(e,t,n){if(e!==void 0){if(typeof e!="string"||!e.trim()||!mG(n,"color",e))throw new TypeError(`${t} must be a CSS color or var() expression.`);return e}}function XH(e){if(typeof e!="string"||!uG.test(e))throw new TypeError('Highlight set names are 1 to 64 letters, digits, "-", or "_", starting with a letter.');return e}function gG(e,t,n,r,o){if(!Array.isArray(t))throw new TypeError("ranges must be an array of HighlightRange.");if(n!==void 0&&(typeof n!="object"||n===null))throw new TypeError("options must be an object.");let i=t.slice(0,pG),a=t.length-i.length,s=[],l=new Int32Array(i.length),c=new Int32Array(i.length);for(let[h,b]of i.entries()){if(!(typeof b=="object"&&b!==null&&typeof b.blockId=="string"&&b.blockId.length>0&&Number.isSafeInteger(b.start)&&b.start>=0&&Number.isSafeInteger(b.length)&&b.length>=0&&b.start+b.length<=2147483647&&(b.expectedText===void 0||typeof b.expectedText=="string")))throw new TypeError(`ranges[${h}] must have a blockId string, nonnegative integer start and length, and an optional expectedText string.`);s.push(b.blockId),l[h]=b.start,c[h]=b.start+b.length;}let d=n?.activeIndex??-1;if(!Number.isInteger(d)||d<-1)throw new RangeError("activeIndex must be an integer of -1 or more.");let u=n?.priority??0;if(!Number.isInteger(u)||Math.abs(u)>ix)throw new RangeError(`priority must be an integer from -${ix} to ${ix}.`);let f=n?.className??"";if(typeof f!="string")throw new TypeError("className must be a string.");let p=f.split(/\s+/).filter(Boolean);if(p.some(h=>!fG.test(h)))throw new TypeError("className must hold space-separated CSS class names.");let g=ZH(n?.color,"color",o),y=ZH(n?.activeColor,"activeColor",o);return {name:e,ranges:i,overflow:a,blockIds:s,starts:l,ends:c,...g!==void 0?{color:g}:{},...y!==void 0?{activeColor:y}:{},activeIndex:d,classes:p,priority:u,order:r,expected:null,seen:new Array(i.length).fill(null),resolved:new Uint8Array(i.length),live:new Uint8Array(i.length),checkedAt:null}}function hG(e,t){let n=Math.min(e.length,t.length),r=0;for(;r<n&&e.charCodeAt(r)===t.charCodeAt(r);)r+=1;let o=0;for(;o<n-r&&e.charCodeAt(e.length-1-o)===t.charCodeAt(t.length-1-o);)o+=1;return {from:r,oldTo:e.length-o,delta:t.length-e.length}}function yG(e,t,n){return t<=n.from?0:e>=n.oldTo?n.delta:0}var cx=new WeakMap,n2=new WeakMap,YH=new WeakSet,ax=new WeakMap,sx=new WeakMap;function bG(e,t){return cx.has(e)?cx.get(e):typeof e.expectedText=="string"?e.expectedText:(ax.has(e)||ax.set(e,t),ax.get(e))}var lx=new WeakMap;function r2(e){let t=new Map;return n=>{if(t.has(n))return t.get(n);let r=de(e.session,n),o=r?eb$1(r,n):null,i=null;return r&&o&&(lx.has(o)?i=lx.get(o):(i=Km(r,n),lx.set(o,i))),t.set(n,i),i}}function QH(e,t,n){let r=t.session,o=r.packageRevision(),i=e.checkedAt;if(i?.session===r&&i.revision===o&&i.layout===n)return;let a=r2(t),s=gf$1(n),l=e.expected===null,c=e.expected??new Array(e.ranges.length).fill(null),d=new Map;for(let u=0;u<e.ranges.length;u+=1){let f=e.ranges[u],p=e.ends[u]>e.starts[u]?a(e.blockIds[u]):null;if(!l&&p!==null&&p===e.seen[u]){e.live[u]=e.resolved[u]&&s.has(e.blockIds[u])?1:0;continue}let g=l?n2.get(f)??sx.get(f)??p:e.seen[u];if(p!==null&&g!==null&&g!==p){let S=e.blockIds[u],v=d.get(S);v?.seen!==g&&(v={seen:g,edit:hG(g,p)},d.set(S,v));let k=yG(e.starts[u],e.ends[u],v.edit);e.starts[u]=e.starts[u]+k,e.ends[u]=e.ends[u]+k;}e.seen[u]=p;let y=e.starts[u],h=e.ends[u],b=p!==null&&h<=p.length?p.slice(y,h):null;if(!l&&p!==null&&b!==c[u]&&g!==null){let S=p.length-g.length,v=y+S>=0?p.slice(y+S,h+S):null;S!==0&&v!==null&&v===c[u]&&(e.starts[u]=y+S,e.ends[u]=h+S,b=v);}l&&(c[u]=bG(f,b),p!==null&&!sx.has(f)&&sx.set(f,p));let x=b!==null&&b===c[u];e.resolved[u]=x?1:0,e.live[u]=x&&s.has(e.blockIds[u])?1:0;}e.expected=c,e.checkedAt={session:r,revision:o,layout:n};}var JH=new WeakMap,e2=new WeakMap,t2=new WeakMap;function vG(e){let t=new Map;for(let n=0;n<e.ranges.length;n+=1){if(!e.live[n])continue;let r=e.blockIds[n],o=t.get(r)??[];o.push({key:n,start:e.starts[n],end:e.ends[n]}),t.set(r,o);}return t}function xG(e,t,n,r,o){let i=t.children[n];i||(i=e.createElement("div"),i.style.position="absolute",t.append(i));let a=r.index===o.activeIndex,s=`${r.index}|${a?1:0}|${r.left}|${r.top}|${r.width}|${r.height}`;t2.get(i)?.key!==s&&(i.className=a?"docx-text-highlight docx-text-highlight--active":"docx-text-highlight",o.classes.length>0&&i.classList.add(...o.classes),i.setAttribute("data-highlight-index",String(r.index)),i.style.left=`${r.left}px`,i.style.top=`${r.top}px`,i.style.width=`${r.width}px`,i.style.height=`${r.height}px`,t2.set(i,{key:s}));}function SG(e){return e?[...e].sort((t,n)=>t-n).join(","):"*"}function wG(e){return e?[...e].map(([t,n])=>`${t}:${n}`).join(","):""}function o2(e){let t=new Map,n=0,r=0,o=[],i=null,a=null,s=null,l=null,c=()=>[...t.values()].sort((h,b)=>h.priority-b.priority||h.order-b.order);function d(h){let b=e.surface();if(i=h.layer,l=h,!b||t.size===0){h.layer.childElementCount>0&&h.layer.replaceChildren(),o=[],a=null;return}let x=c();for(let O of x)QH(O,b,h.layout);let S=sa(h.layout),v=[r,b.session.packageRevision(),SG(h.pages),h.scale,wG(h.pageOffsetX)].join("|");if(v===a&&S===s&&h.layer.childElementCount>0)return;a=v,s=S;let k=h.layer.ownerDocument,E=[],I=[];for(let O of x){let C=u(O,S,h),w=f(k,O),T=0;for(let $ of C){let W=S.pages[$.pageIndex];if(!W)continue;let q=h.pageOffsetX?.get($.pageIndex)??0,K={set:O,index:$.key,left:(W.contentBox.x+$.x+q)*h.scale,top:(W.contentBox.y+$.y)*h.scale,width:$.width*h.scale,height:$.height*h.scale};xG(k,w,T,K,O),T+=1,I.push(K);}for(;w.childElementCount>T;)w.lastElementChild.remove();E.push(w);}let R=h.layer.children;(R.length!==E.length||E.some((O,C)=>R[C]!==O))&&h.layer.replaceChildren(...E),o=I;}function u(h,b,x){let S=JH.get(h);S||(S=new WeakMap,JH.set(h,S));let v=[],k=new Map;for(let I of b.pages)x.pages&&!x.pages.has(I.index)||(v.push(I),S.has(I)||k.set(I.index,{page:I,rects:[]}));if(k.size>0){let I=ff$1(b,vG(h),new Set(k.keys()),x.measurer);for(let R of I)k.get(R.pageIndex).rects.push(R);for(let{page:R,rects:O}of k.values())S.set(R,O);}let E=[];for(let I of v)for(let R of S.get(I))E.push(R);return h.activeIndex>=0&&E.sort((I,R)=>+(I.key===h.activeIndex)-+(R.key===h.activeIndex)),E}function f(h,b){let x=e2.get(b);if(x)return x;let S=h.createElement("div");return S.className="docx-text-highlight-set",S.setAttribute("data-highlight-set",b.name),b.color&&S.style.setProperty("--doc-text-highlight-set-color",b.color),b.activeColor&&S.style.setProperty("--doc-text-highlight-set-active-color",b.activeColor),e2.set(b,S),S}function p(){r+=1,e.surface()?.repaintHighlights();}function g(h){let b=e.surface();if(!b)return {applied:0,unavailable:h.ranges.length+h.overflow};let x=b.publishedLayout();QH(h,b,x);let S=x.revision!==b.session.packageRevision(),v=0;for(let k=0;k<h.ranges.length;k+=1)v+=S?h.resolved[k]:h.live[k];return {applied:v,unavailable:h.ranges.length-v+h.overflow}}return {members:{setHighlights(h,b,x){XH(h),Array.isArray(b)&&b.length>0&&e.flushOpen();let S=t.get(h),v=gG(h,b,x,S?.order??n,e.container());if(!S&&v.ranges.length>0&&t.size>=zH)throw new RangeError(`At most ${zH} highlight sets exist at once.`);if(v.ranges.length===0)return S&&(t.delete(h),p()),{applied:0,unavailable:0};S||(n+=1),t.set(h,v);let k=g(v);return p(),k},clearHighlights(h){if(h===void 0){if(t.size===0)return;t.clear();}else if(!t.delete(XH(h)))return;p();},getHighlightsAt(h,b){if(!Number.isFinite(h)||!Number.isFinite(b))return [];let x=i;if(!x?.isConnected||o.length===0)return [];let S=x.getBoundingClientRect(),v=h-S.left,k=b-S.top,E=[],I=new Set;for(let R=o.length-1;R>=0;R-=1){let O=o[R];if(v<O.left||v>=O.left+O.width||k<O.top||k>=O.top+O.height)continue;let C=`${O.set.name}\0${O.index}`;if(I.has(C)||t.get(O.set.name)!==O.set)continue;I.add(C);let w=S.left+O.left,T=S.top+O.top;E.push({name:O.set.name,index:O.index,range:O.set.ranges[O.index],start:O.set.starts[O.index],length:O.set.ends[O.index]-O.set.starts[O.index],active:O.index===O.set.activeIndex,rect:{x:w,y:T,left:w,top:T,width:O.width,height:O.height,right:w+O.width,bottom:T+O.height}});}return E}},frame:()=>{let h=e.surface();if(!l||!h)return l;let b=h.session.packageRevision();if(l.layout.revision===b)return l;let x=h.layout();return l.layout===x?l:{...l,layout:x,revision:b}},noteMatches(h){let b=e.surface();if(!b||YH.has(h))return h;let x=GH(b,h);YH.add(x);let S=r2(b);for(let v of x){let k=S(v.blockId);k!==null&&n2.set(v,k);let E=v.start+v.length;cx.set(v,k!==null&&E<=k.length?k.slice(v.start,E):null);}return x},attach(h,b=false){a=null,l=null,b&&t.clear(),h?.setHighlightPainter(d);},reset(){t.size!==0&&(t.clear(),p());}}}var i2=new WeakMap;function a2(e){let t=i2.get(e);if(t)return t;let n=new Map,r=new Map,o=(s,l)=>{if(n.has(l))return;let c=r.get(s);c||(c=[],r.set(s,c)),n.set(l,{story:s,index:c.length}),c.push(l);},i=(s,l)=>{for(let c of La(l)){for(let d of c.lines)for(let u of _a(d))o(s,u.paragraphId);c.lines.length===0&&o(s,c.paragraphId);}};for(let s of e.pages){i("body",s.fragments);for(let l of [s.header,s.footer])l&&i(`part:${l.partName}`,l.fragments);for(let l of [s.footnotes,s.endnotes])for(let c of l?.notes??[])i(`notes:${c.noteKind}`,c.fragments);}let a={positions:n,paragraphs:r};return i2.set(e,a),a}function kG(e,t,n,r){let o=(d,u,f)=>{if(f<=u)return;let p=r.get(d);p?p.push({key:t,start:u,end:f}):r.set(d,[{key:t,start:u,end:f}]);},{start:i,end:a}=e;if(i.paragraphId===a.paragraphId){o(i.paragraphId,i.offset,a.offset);return}let s=n.positions.get(i.paragraphId),l=n.positions.get(a.paragraphId);if(o(i.paragraphId,i.offset,Number.POSITIVE_INFINITY),o(a.paragraphId,0,a.offset),!s||!l||s.story!==l.story||l.index<=s.index)return;let c=n.paragraphs.get(s.story);for(let d=s.index+1;d<l.index;d+=1)o(c[d],0,Number.POSITIVE_INFINITY);}function IG(e,t){if(e.start.paragraphId===e.end.paragraphId)return e.end.offset-e.start.offset;let n=t.positions.get(e.start.paragraphId),r=t.positions.get(e.end.paragraphId);return !n||!r||n.story!==r.story?Number.MAX_SAFE_INTEGER:(r.index-n.index)*1e6+(e.end.offset-e.start.offset)}function RG(e){let t=e.item;return t.kind==="revision"?t.ranges:t.range?[t.range]:[]}var s2={comment:0,custom:1,revision:2};function l2(e,t){let n=new Map,r=[];return e.forEach((o,i)=>{for(let a of RG(o)){let s=r.length;r.push({placement:i,width:IG(a,t)}),kG(a,s,t,n);}}),{byParagraph:n,sources:r}}function c2(e,t){return !e.pages||e.pages.has(t.index)}function d2(e,t,n,r){let o=e.pageOffsetX?.get(n.index)??0,i=t.left+(n.contentBox.x+r.x+o)*e.scale,a=t.top+(n.contentBox.y+r.y)*e.scale,s=r.width*e.scale,l=r.height*e.scale;return {x:i,y:a,left:i,top:a,width:s,height:l,right:i+s,bottom:a+l}}function u2(e){function t(){let n=e.frame();return !n?.layer.isConnected||!(n.scale>0)?null:{frame:n,origin:n.layer.getBoundingClientRect()}}return {getReviewItemsAt(n,r,o){if(!Number.isFinite(n)||!Number.isFinite(r))return [];let i=t();if(!i)return [];let{frame:a,origin:s}=i,l=(n-s.left)/a.scale,c=(r-s.top)/a.scale,d=a.layout.pages.find(v=>{if(!c2(a,v))return false;let k=v.box.x+(a.pageOffsetX?.get(v.index)??0);return l>=k&&l<k+v.box.width&&c>=v.box.y&&c<v.box.y+v.box.height});if(!d)return [];let u=e.placements(o);if(u.length===0)return [];let f=a2(a.layout),{byParagraph:p,sources:g}=l2(u,f),y=l-(a.pageOffsetX?.get(d.index)??0)-d.contentBox.x,h=c-d.contentBox.y,b=new Map,x=ff$1(sa(a.layout),p,new Set([d.index]),a.measurer);for(let v of x){if(y<v.x||y>=v.x+v.width||h<v.y||h>=v.y+v.height)continue;let k=g[v.key],E=b.get(k.placement);(!E||k.width<E.width)&&b.set(k.placement,{width:k.width,rect:v});}let S=[...b.entries()].map(([v,k])=>({at:v,...k}));return S.sort((v,k)=>{if(v.width!==k.width)return v.width-k.width;let E=u[v.at],I=u[k.at];if(E.kind!==I.kind)return s2[E.kind]-s2[I.kind];if(E.kind==="revision"&&I.kind==="revision"){let R=I.item.nesting-E.item.nesting;if(R!==0)return R}return v.at-k.at}),S.map(v=>({placement:u[v.at],rect:d2(a,s,d,v.rect)}))},getReviewItemRects(n){if(typeof n!="string"||n.length===0)return [];let r=t();if(!r)return [];let{frame:o,origin:i}=r,a=Yr(e.placements,n);if(!a)return [];let s=new Set(o.layout.pages.filter(c=>c2(o,c)).map(c=>c.index)),{byParagraph:l}=l2([a],a2(o.layout));return ff$1(sa(o.layout),l,s,o.measurer).map(c=>d2(o,i,o.layout.pages[c.pageIndex],c))}}}var PG=new WeakMap,TG=new WeakMap;function EG(e,t){return e.anchorY===t.anchorY&&e.pageIndex===t.pageIndex&&e.activatable===t.activatable&&e.isActive===t.isActive&&e.locked===t.locked}function f2(e,t){let n=t.anchorY===null&&t.pageIndex===null?TG:PG,r=n.get(e);if(r&&EG(r.inputs,t))return r.placement;let o=CG(e,t);return n.set(e,{inputs:t,placement:o}),o}function CG(e,t){let n=CH(e),r={key:nl(e),id:e.id,...n!==void 0?{date:n}:{},activatable:t.activatable,anchorY:t.anchorY,pageIndex:t.pageIndex,isActive:t.isActive};return e.kind==="comment"?{...r,kind:"comment",author:e.comment.author,initials:am(e.comment),text:_l(e.comment),resolved:e.resolved,...e.parentId!==void 0?{parentId:e.parentId}:{},...e.parentRevisionId!==void 0?{parentRevisionId:e.parentRevisionId}:{},replyIds:e.replyIds,readOnly:false,item:e}:e.kind==="revision"?{...r,kind:"revision",revisionKind:e.revisionKind,author:e.author,initials:lL(e.author),text:_b$2(e.text),...e.replacedText?{replacedText:_b$2(e.replacedText)}:{},replyIds:e.replyIds,readOnly:e.readOnly||t.locked,item:e}:{...r,kind:"custom",author:"",initials:"",text:e.detail??e.text,replyIds:[],readOnly:true,item:e}}function OG(e){return e==="password"?{ok:false,code:"locked",reason:p2}: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 p2="this document is protected with a password; open it in Word to change that";function m2(e){let t=null,n=null,r=()=>{let l=e.tracking();return [l.restrictedToReadOnly,l.restrictedToComments,l.restrictedToForms,l.restrictedToTrackedChanges].join("|")},o,i=null,a=()=>{let l=e.surface();if(!l)return null;let c=l.session.settingsRoot();return (c!==o||i===null)&&(o=c,i=c?kj$1(c):jj),i},s=()=>{if(e.destroyed())return {ok:false,code:"notFound",reason:"the editor was destroyed"};let l=a();return l===null?{ok:false,code:"notFound",reason:"no document is loaded"}:e.hostViewOnly()?{ok:false,code:"locked",reason:"this document was opened for viewing"}:l.enforced&&l.password?{ok:false,code:"locked",reason:p2}:!l.enforced&&l.edit!=="none"&&l.edit!=="forms"?{ok:false,code:"locked",reason:"this document declares a different editing restriction; open it in Word to change that"}:null};return {sync(){let l=e.surface()?.session.settingsRoot()??null;if(l===n&&t!==null)return;n=l;let c=r();c!==t&&(t=c,e.adopt(e.decision()));},prime:()=>{n=e.surface()?.session.settingsRoot()??null,t=r();},state:a,isActive:()=>a()?.enforced===true,can(l){return l.type!=="toggleDocumentProtection"?null:s()??{ok:true}},exec(l){if(l.type!=="toggleDocumentProtection")return null;let c=s();if(c&&!c.ok)return c;let d=e.surface(),u=!a().enforced,f=d.applyHeaderFooterLifecycle?.({op:"setDocumentProtection",enforce:u});return f?f.ok?(e.publish(),{ok:true,changed:true}):OG(f.reason):{ok:false,code:"unsupported",reason:"document protection is not available"}}}}function g2(e,t){return Mg(e.revisionsIn,t)}function h2(e,t){let n=Mu(e);return {current:()=>n,set(r){if(!t.enabled)return {ok:false,code:"unsupported",reason:qt};let o;try{o=Mu(r,n);}catch(a){return {ok:false,code:"invalidArgs",reason:a.message}}if(o===n)return {ok:true,changed:false};let i=n;return n=o,t.changed(n,i),{ok:true,changed:false}},shows:r=>r.some(o=>g2(n,o)),opensOnLoad:r=>n.opening==="auto"&&r.some(o=>g2(n,o)),opensOnTrackedChange:()=>n.opening==="auto"&&n.revisionsIn==="pane",pairsReplacements:()=>n.revisionsIn==="balloons"}}function y2(e,t){let n=tl(t)?.partName;if(!n||!e||n===e.part().name)return null;for(let r of e.headerFooterResolutionBySection())for(let o of ["header","footer"]){let i=o==="header"?r.headers:r.footers;for(let a of i.values())if(a.partName===n)return {kind:o,rId:a.rId}}return null}function b2(e,t){let n=tl(t)?.partName;if(!n||!e)return null;for(let r of ["footnote","endnote"])if(qj$1(e.currentPackage(),r)?.name===n)return {kind:"notesPart",noteKind:r};return null}var jp=class e{constructor(t,n){this.positions=t;this.blocks=n;}positions;blocks;[Symbol.toStringTag]="Map";static from(t){let n=new Map,r=[];for(let[o,i]of t){let a=n.size;n.set(o,a);let s=Math.floor(a/64);(r[s]??=[]).push(i);}return new e(n,r)}updated(t){let n,r=new Map;for(let[o,i]of t){let a=this.positions.get(o);if(a===void 0)throw new Error("Cannot update an absent review anchor");let s=Math.floor(a/64),l=a%64;if(this.blocks[s][l]===i)continue;let c=r.get(s);c||(c=[...this.blocks[s]],r.set(s,c),(n??=[...this.blocks])[s]=c),c[l]=i;}return n?new e(this.positions,n):this}get size(){return this.positions.size}has(t){return this.positions.has(t)}get(t){let n=this.positions.get(t);return n===void 0?void 0:this.blocks[Math.floor(n/64)][n%64]}keys(){return this.positions.keys()}*values(){for(let t of this.blocks)yield*t;}*entries(){for(let[t,n]of this.positions)yield [t,this.blocks[Math.floor(n/64)][n%64]];}[Symbol.iterator](){return this.entries()}forEach(t,n){for(let[r,o]of this)t.call(n,o,r,this);}};function I2(e){let t=v2();if(!e)return t;let n=v2(),r=new WeakMap;return o=>{let i=t(o),a=r.get(i);if(!a){let s=()=>n(Ub(o));r.set(i,a=new ux(i,s,e));}return a}}var ux=class{constructor(t,n,r){this.stories=t;this.boxes=n;this.hostOf=r;}stories;boxes;hostOf;[Symbol.toStringTag]="Map";hosted=new Map;get(t){let n=this.stories.get(t);if(n)return n;let r=this.hosted.get(t);if(r===void 0){let o=this.boxes().get(t);if(o)return this.hosted.set(t,o),o;let i=this.hostOf(t),a=i===null?void 0:this.stories.get(i);r=a?{pageIndex:a.pageIndex,contentY:a.contentY,fragmentY:a.fragmentY}:null,this.hosted.set(t,r);}return r??void 0}has(t){return this.get(t)!==void 0}get size(){return this.stories.size}forEach(t,n){this.stories.forEach((r,o)=>t.call(n,r,o,this));}entries(){return this.stories.entries()}keys(){return this.stories.keys()}values(){return this.stories.values()}[Symbol.iterator](){return this.stories[Symbol.iterator]()}};function v2(){let e=new WeakMap,t=null;return n=>{let r=e.get(n);if(r)return r;let o=t&&MG(t,n);if(o)return e.set(n,o),t={pages:zh$1(n.pages),index:zh$1(o)},o;let i=new Map;for(let s of n.pages)for(let[l,c]of dd(s))i.has(l)||i.set(l,c);for(let s of n.pages)for(let[l,c]of fx(s))i.has(l)||i.set(l,c);let a=jp.from(i);return e.set(n,a),t={pages:zh$1(n.pages),index:zh$1(a)},a}}function x2(e,t){if(e.size!==t.size)return false;for(let n of e.keys())if(!t.has(n))return false;return true}var S2=new WeakMap;function fx(e){let t=S2.get(e);if(t)return t;let n=new Map;for(let r of [e.header,e.footer])r&&k2(n,r.fragments,e.index,r.box.y);for(let r of [e.footnotes,e.endnotes])if(r)for(let o of r.notes)k2(n,o.fragments,e.index,o.box.y);return S2.set(e,n),n}var w2=e=>dd(e);function MG(e,t){let n=e.pages.deref(),r=e.index.deref();if(!n||!r||n.length!==t.pages.length)return null;let o=null;for(let[i,a]of t.pages.entries()){let s=n[i];if(a===s)continue;let l=w2(a),c=w2(s);if(!x2(l,c))return null;let d=fx(a),u=fx(s);if(!x2(d,u))return null;o??=new Map;for(let[f,p]of l)r.get(f)===c.get(f)&&o.set(f,p);for(let[f,p]of d)r.get(f)===u.get(f)&&o.set(f,p);}return o?r.updated(o):r}function k2(e,t,n,r){for(let o of La(t))for(let i of bb$1(o))e.has(i)||e.set(i,{pageIndex:n,contentY:r,fragmentY:o.box.y,...o.lines?{lines:o.lines}:{}});}var dx=new WeakSet;function R2(e,t,n){if(dx.has(e))return;dx.add(e);let r=()=>{dx.delete(e),n();};typeof t.requestIdleCallback=="function"?t.requestIdleCallback(r,{timeout:1e3}):t.setTimeout(r,200);}var P2=new WeakMap;function E2(e){let t=P2.get(e);if(t)return t;let n=new Map;for(let r of e.pages)for(let o of [r.footnotes,r.endnotes])if(o)for(let i of o.notes)for(let a of La(i.fragments))for(let s of bb$1(a))n.has(s)||n.set(s,i.scopeId);return P2.set(e,n),n}var T2=new WeakMap;function C2(e){let t=T2.get(e);if(t)return t;let n=new Map;for(let[r,o]of eb$2(e).entries())n.set(o,r);return T2.set(e,n),n}var AG={"open.zip-corrupt":"damaged","open.zip-invalid-entry-name":"damaged","open.xml-malformed":"damaged","open.content-types-invalid":"damaged","open.relationships-invalid":"damaged","open.unsupported-source":"not-docx","open.missing-main-document":"not-docx","open.zip-entry-limit":"too-large","open.zip-size-limit":"too-large","open.zip-ratio-limit":"too-large","open.xml-part-size-limit":"too-large","open.xml-depth-limit":"too-large","open.xml-element-limit":"too-large","open.relationship-limit":"too-large","open.part-limit":"too-large","open.xml-dtd-forbidden":"blocked","open.invalid-limits":"unknown","open.failed":"unknown"};function px(e){return Object.freeze({code:e,reason:AG[e]??"unknown"})}function O2(e){let t=null,n=null;return {get parseError(){return t},get failure(){return n},reject(r,o,i){t=i?`${r}: ${i}`:r,n=px(A(r,o));},refuseSource(r,o=false){let i=VE(r);return o||(t=i,n=px("open.unsupported-source"),e()),i},crash(){t="open failed",n=px("open.failed"),e();},clear(){t=null,n=null;}}}function M2(e,t){if(e==="")return;let n=(t??globalThis).navigator?.clipboard;if(n?.writeText)try{n.writeText(e).catch(()=>{});}catch{}}function mx(e,t,n){if(e===""&&(t===null||t===""))return;let r=n??globalThis,o=r.navigator?.clipboard;if(!o)return;let i=r.ClipboardItem,a=r.Blob;if(t&&o.write&&i&&a)try{let s=new i({"text/plain":new a([e],{type:"text/plain"}),"text/html":new a([t],{type:"text/html"})});o.write([s]).catch(()=>{M2(e,n);});return}catch{}M2(e,n);}function LG(e){return typeof e=="object"&&e!==null&&"container"in e&&Array.isArray(e.path)}function FG(e){return typeof e=="object"&&e!==null&&"from"in e&&"to"in e}function A2(e){return L2(e.children)}function L2(e){let t=[];for(let n of e)n.kind!=="textValue"&&(n.kind==="paragraph"||n.kind==="table"||hc$1(n))&&t.push(n);return t}function DG(e){if(hc$1(e))return L2(kc$2(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(...A2(r));return t}function NG(e,t,n){let r=t.container,o=r.part==="body"?{kind:"body"}:r.part==="header"||r.part==="footer"?{kind:"headerFooter",rId:r.rId}:{kind:"notesPart",noteKind:r.part==="footnote"?"footnote":"endnote"},i=e.session.partFor(o);if(!i)return {ok:false,code:"notFound",reason:"the target story was not found"};let a="noteId"in r?r.noteId:null,s=r.part==="body"?hd$1(i):fd$1(i).find(p=>r.part==="header"||r.part==="footer"?p.kind===r.part:p.kind==="note"&&Rc$1(p.root)===a)?.root;if(!s||s.kind==="textValue")return {ok:false,code:"notFound",reason:"the target story was not found"};if(t.path.length===0)return {ok:false,code:"invalidArgs",reason:"DocLocation path must not be empty"};let l=A2(s),c;for(let p=0;p<t.path.length;p+=1){let g=t.path[p];if(!Number.isInteger(g)||g<0)return {ok:false,code:"invalidArgs",reason:"DocLocation indices must be non-negative"};if(c=l[g],!c)return {ok:false,code:"notFound",reason:`block index ${g} is out of range`};p<t.path.length-1&&(l=DG(c));}if(!c||c.kind!=="paragraph"||!eb$1(i,c.id))return {ok:false,code:"invalidArgs",reason:"DocLocation must resolve to a paragraph"};let d=(Km(i,c.id)??"").length,u=t.offset??(n==="start"?0:d);if(!Number.isInteger(u)||u<0||u>d)return {ok:false,code:"invalidArgs",reason:"DocLocation offset is outside the paragraph"};let f={paragraphId:c.id,offset:u};return {ok:true,selection:{anchor:f,head:f}}}function Vp(e,t,n){if(LG(t))return NG(e,t,n);if(!Vt(t))return {ok:false,code:"invalidArgs",reason:"unrecognized DocTarget endpoint"};let r=e.session.paragraphAnchors(),o=r.nodeByParaId.get(t.paraId.toUpperCase());if(!o)return {ok:false,code:"notFound",reason:"the paragraph was not found"};let i=Et(e.session,o,{kind:"body"}),a=e.session.partFor(i);if(!a)return {ok:false,code:"notFound",reason:"the target story was not found"};let s=jn(a,r,t);if(!s.ok)return s;let l=n==="start"?s.span.start:s.span.end,c={paragraphId:s.span.nodeId,offset:l};return {ok:true,selection:{anchor:c,head:c}}}function Gp(e,t){if(!FG(t)){let o=Vp(e,t,"start");if(!o.ok)return o;let i=Vp(e,t,"end");return i.ok?{ok:true,selection:{anchor:o.selection.anchor,head:i.selection.head}}:i}let n=Vp(e,t.from,"start");if(!n.ok)return n;let r=Vp(e,t.to,"end");return r.ok?{ok:true,selection:{anchor:n.selection.anchor,head:r.selection.head}}:r}function HG(e){return e.evenPage?"even":e.firstPage?"first":"default"}function F2(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'"}:HG(e)}function gx(e,t){let n=e.headerFooterState(),r=t.position??n?.editing??null;if(r!=="header"&&r!=="footer")return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:"header/footer position is required when no furniture scope is open"}};let i=t.variant!==void 0||t.firstPage!==void 0||t.evenPage!==void 0?F2(t):n?.variant??"default";if(typeof i=="object"&&i.ok===false)return {ok:false,refusal:{ok:false,code:"invalidArgs",reason:i.reason}};let a=i,s=t.sectionIndex??n?.sectionIndex??0;return !Number.isInteger(s)||s<0?{ok:false,refusal:{ok:false,code:"invalidArgs",reason:"sectionIndex must be a non-negative integer"}}:{ok:true,sectionIndex:s,kind:r,variant:a}}function _G(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 zc(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}:_G(n.reason)}function zp(e,t,n,r){let i=e.session.headerFooterResolutionBySection()[t];if(!i)return null;let s=(n==="header"?i.headers:i.footers).get(r);return s?{rId:s.rId,partName:s.partName,inherited:s.inherited,titlePage:i.titlePage,evenAndOddHeaders:i.evenAndOddHeaders}:null}function D2(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=F2(t);if(typeof o=="object"&&o.ok===false)return {ok:false,code:"invalidArgs",reason:o.reason};let i=o,s=zp(e,n,r,i)?.rId,l=false;if(!s){let d=zc(e,{op:"createHeaderFooter",sectionIndex:n,kind:r,variant:i,...i==="first"?{titlePage:true}:{},...i==="even"?{evenAndOddHeaders:true}:{}});if(!d.ok)return d;l=true,s=zp(e,n,r,i)?.rId;}return s?e.enterHeaderFooter({rId:s,kind:r,sectionIndex:n,variant:i})?{ok:true,changed:l}:{ok:false,code:"invalidArgs",reason:"the header/footer relationship could not be opened"}:{ok:false,code:"notFound",reason:`no ${r} story is available to edit`}}function N2(e,t){let n=gx(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=r?.rId,i=zc(e,{op:"deleteHeaderFooter",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});return i.ok&&o&&r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant&&e.exitHeaderFooter(),i}function H2(e,t){let n=gx(e,t);if(!n.ok)return n.refusal;if(n.sectionIndex===0)return {ok:false,code:"invalidArgs",reason:"the first section cannot link to a previous header or footer"};let r=e.headerFooterState(),o=r?.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,i=zc(e,{op:"linkToPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!i.ok)return i;if(o){let a=zp(e,n.sectionIndex,n.kind,n.variant);a?e.enterHeaderFooter({rId:a.rId,kind:n.kind,sectionIndex:n.sectionIndex}):e.exitHeaderFooter();}return i}function _2(e,t){let n=gx(e,t);if(!n.ok)return n.refusal;let r=e.headerFooterState(),o=!!r&&r.editing===n.kind&&r.sectionIndex===n.sectionIndex&&r.variant===n.variant,i=r?.rId,a=zc(e,{op:"unlinkFromPrevious",sectionIndex:n.sectionIndex,kind:n.kind,variant:n.variant});if(!a.ok)return a;let s=zp(e,n.sectionIndex,n.kind,n.variant);return o&&s&&s.rId!==i&&e.enterHeaderFooter({rId:s.rId,kind:n.kind,sectionIndex:n.sectionIndex}),a}function B2(e,t){let n=e.headerFooterState(),r=t.sectionIndex??n?.sectionIndex;return zc(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 $2(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 W2(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 q2(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 K2(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 U2(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 j2(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 V2(e){return b$2(e)?{ok:false,code:"unsupported",reason:e}:{ok:false,code:ip(e)||e==="the table of contents is generated and read-only"||e===ia?"invalidArgs":"locked",reason:e}}function X2(e,t,n){switch(t.type){case "toggleMark":{let r=Yh.get(t.mark),o=e.toggleRunProperty(r.localName,r.attributes);if(o)return V2(o);break}case "setMarkAttr":{let r=Qh(t);if(!r.ok)return {ok:false,code:r.code,reason:r.reason};let o=e.setRunProperty(r.localName,r.attributes);if(o)return V2(o);break}case "clearFormatting":e.clearFormatting();break;case "copyFormatting":return e.formatPainter.capture()?{ok:true,changed:false}:{ok:false,code:"notFound",reason:tf};case "pasteFormatting":{let r=e.formatPainter.apply();if(r==="nothingToPaint")return {ok:false,code:"notFound",reason:Mh};if(r==="refused")return {ok:false,code:"locked",reason:e.state().lastRejection??Mh};break}case "setLineSpacing":e.setParagraphProperty("spacing",Rp({rule:t.rule,value:t.value}),{mergeAttributes:true});break;case "setParagraphSpacing":e.setParagraphProperty("spacing",{...Os("before",t.beforePt),...Os("after",t.afterPt)},{mergeAttributes:true});break;case "setAlignment":e.setParagraphProperties([{localName:"jc",attributes:{val:t.align==="justify"?"both":t.align},physicalAlignment:true}]);break;case "setParagraphDirection":e.setParagraphProperties([{localName:"bidi",paragraphDirection:t.direction}]);break;case "setParagraphStyle":{if(!e.session.documentStyles().some(o=>o.type==="paragraph"&&o.styleId===t.styleId))return {ok:false,code:"invalidArgs",reason:`style '${t.styleId}' is not a paragraph style of this document`};e.setParagraphProperty("pStyle",{val:t.styleId});break}case "setIndent":{e.setIndent({...t.left!==void 0?{left:t.left}:{},...t.right!==void 0?{right:t.right}:{},...t.firstLine!==void 0?{firstLine:t.firstLine}:{}});break}case "setParagraphFormat":{if(!e.setParagraphFormat({...t.alignment!==void 0?{alignment:t.alignment==="justify"?"both":t.alignment}:{},...t.direction!==void 0?{direction:t.direction}:{},...t.spaceBeforePt!==void 0?{spaceBeforePt:t.spaceBeforePt}:{},...t.spaceAfterPt!==void 0?{spaceAfterPt:t.spaceAfterPt}:{},...t.lineSpacing!==void 0?{lineSpacing:t.lineSpacing}:{},...t.indentLeftTwips!==void 0?{indentLeftTwips:t.indentLeftTwips}:{},...t.indentRightTwips!==void 0?{indentRightTwips:t.indentRightTwips}:{},...t.indentFirstLineTwips!==void 0?{indentFirstLineTwips:t.indentFirstLineTwips}:{},...t.contextualSpacing!==void 0?{contextualSpacing:t.contextualSpacing}:{},...t.keepNext!==void 0?{keepNext:t.keepNext}:{},...t.keepLines!==void 0?{keepLines:t.keepLines}:{},...t.widowControl!==void 0?{widowControl:t.widowControl}:{},...t.pageBreakBefore!==void 0?{pageBreakBefore:t.pageBreakBefore}:{},...t.tabStops!==void 0?{tabStops:t.tabStops}:{}}))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the paragraph format could not be written here"};break}case "setPageSetup":{let r;if(t.scope==="section"){let s=e.sectionAnchorParagraphAt(e.state().selection.head.paragraphId);if(s.kind==="unaddressable")return {ok:false,code:"unsupported",reason:"this section holds no paragraph to address it by"};r=s.kind==="anchor"?s.paragraphId:void 0;}let o=t.pageWidth,i=t.pageHeight;if(t.orientation!==void 0&&(o!==void 0||i!==void 0)){let s=r?e.sectionPropertiesAt(r):e.sectionProperties(),l=o??s.pageSize.widthTwips,c=i??s.pageSize.heightTwips;o=t.orientation==="landscape"?Math.max(l,c):Math.min(l,c),i=t.orientation==="landscape"?Math.min(l,c):Math.max(l,c);}if(!e.setSectionProperties({...o!==void 0?{pageWidthTwips:o}:{},...i!==void 0?{pageHeightTwips:i}:{},...t.orientation!==void 0?{orientation:t.orientation}:{},...t.marginTop!==void 0?{marginTopTwips:t.marginTop}:{},...t.marginRight!==void 0?{marginRightTwips:t.marginRight}:{},...t.marginBottom!==void 0?{marginBottomTwips:t.marginBottom}:{},...t.marginLeft!==void 0?{marginLeftTwips:t.marginLeft}:{},...r!==void 0?{anchorParagraphId:r}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the page setup change was refused"};break}case "toggleList":if(!e.toggleList(t.kind))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the list change was refused"};break;case "adjustIndent":if(!e.adjustIndent(t.direction))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the selection is already at that indent level"};break;case "insertBreak":if(t.kind==="section"||t.kind==="sectionContinuous"){let r=t.kind==="section"?"nextPage":"continuous";if(!e.insertSectionBreak(r))return {ok:false,code:"invalidArgs",reason:e.sectionBreakRefusal(r)??e.state().lastRejection??"the section break was refused"};break}if(t.kind==="page"){e.insertPageBreak();break}e.insertLineBreak();break;case "insertHyperlink":{let r=t.href.startsWith("#");if(!e.hyperlinks.applyHyperlink({...r?{anchor:t.href.slice(1)}:{url:t.href},...t.text!==void 0?{text:t.text}:{}}))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??"the link was refused: the target is not an allowed scheme, or there is no text to link"};break}case "removeHyperlink":if(!e.hyperlinks.removeHyperlink())return {ok:false,code:"notFound",reason:"there is no hyperlink at the selection"};break;case "insertTextBox":return eE(e);case "insertText":if(e.type(t.text),e.state().lastRejection==="the table of contents is generated and read-only"||e.state().lastRejection===ia)return {ok:false,code:"invalidArgs",reason:e.state().lastRejection};break;case "deleteText":if(Gn(e))return Ry(e,{type:"deleteImage"},n?.editor);e.deleteSelection();break;case "proposeInsertion":case "proposeDeletion":case "proposeReplacement":{if(t.target!==void 0){let i=Gp(e,t.target);if(!i.ok)return {ok:false,code:i.code,reason:i.reason};e.setSelection(i.selection);}let r=t.type==="proposeInsertion"?"insertion":t.type==="proposeDeletion"?"deletion":"replacement",o=t.type==="proposeInsertion"?t.text:t.type==="proposeReplacement"?t.replaceWith:"";if(!e.proposeTextChange(r,o,t.author))return {ok:false,code:"invalidArgs",reason:e.state().lastRejection??`${t.type} was refused`};break}case "replaceMatch":return $E(e,t);case "undo":e.undo();break;case "redo":e.redo();break;case "insertTable":if(!e.insertTable(t.rows,t.cols))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table could not be inserted here"};break;case "insertToc":if(!e.insertToc())return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be inserted"};break;case "editTextFormField":return e.editTextFormField()?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"field options are unavailable"};case "refreshToc":if(!e.refreshToc(t.tocId,t.mode))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be refreshed"};break;case "removeToc":if(!e.removeToc(t.tocId))return {ok:false,code:"unsupported",reason:e.state().lastRejection??"the table of contents could not be removed"};break;case "editHeaderFooter":return D2(e,t);case "exitHeaderFooter":return typeof e.exitHeaderFooter=="function"&&e.exitHeaderFooter(),{ok:true,changed:false};case "removeHeaderFooter":return N2(e,t);case "linkHeaderFooterToPrevious":return H2(e,t);case "unlinkHeaderFooterFromPrevious":return _2(e,t);case "setHeaderFooterOptions":return B2(e,t);case "setWatermark":return NE(e,t.watermark);case "insertBookmark":case "deleteBookmark":case "keepFirstBookmark":case "goToBookmark":return HC(e,t);case "insertPageField":return $2(e,t);case "insertNote":return W2(e,t);case "deleteNote":return q2(e,t);case "convertNote":return K2(e,t);case "convertAllNotes":return U2(e,t);case "setNoteProperties":return j2(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(!Yo(t))return {ok:false,code:"unsupported",reason:"unsupported command"};let r=n?.admittedTablePlan??Tr({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",...of(e)});return e.applyTableCommandPlan(r)}case "selectAll":return e.selectAll(),{ok:true,changed:false};case "copy":{let r=e.copyFlavours();return r.reason?hx(r.reason):(mx(r.text,r.html,G2(n?.editor)),{ok:true,changed:false})}case "cut":{let r=e.copyFlavours();if(r.reason)return hx(r.reason);mx(r.text,r.html,G2(n?.editor)),e.deleteSelection();break}case "paste":{let r=t.html?jo(t.html):null,o=r?Nc(r.bytes):null;if(o)return hx(o==="chart"?"chart-content":"unsupported-content");if(!e.pasteRich(t.text,t.html??null))return {ok:true,changed:false};break}case "pasteWithoutFormatting":e.insertPlainText(t.text);break;case "setSelection":{if("range"in t&&Jh(t.range)){let a=Z2(e,t.range);return a.ok?(e.setSelection(t.range),e.revealPosition(t.range.head,{block:"centerIfNeeded"}),{ok:true,changed:false}):a}let r="anchor"in t&&Vt(t.anchor)?{anchor:t.anchor}:"range"in t&&Xi(t.range)?{range:t.range}:null;if(r===null)return {ok:false,code:"unsupported",reason:"unsupported selection form"};let o=_E(e.session.part(),e.session.paragraphAnchors(),r);if(!o.ok)return o;let i=Z2(e,o.selection);return i.ok?(e.setSelection(o.selection),e.revealPosition(o.selection.head,{block:"centerIfNeeded"}),{ok:true,changed:false}):i}default:return ic(t)?Ry(e,t,n?.editor):{ok:false,code:"unsupported",reason:"unsupported command"}}return null}function hx(e){return {ok:false,code:"unsupported",reason:e==="chart-content"?Dc:e}}function G2(e){return e?Ae(So(e)):void 0}function z2(e,t){for(let n of e.layout().pages)for(let r of [n.footnotes,n.endnotes])if(r){for(let o of r.notes)for(let i of La(o.fragments))if(i.paragraphId===t)return o.scopeId}return null}function BG(e,t){let n=e.layout().pages;for(let r=0;r<n.length;r+=1){let o=n[r];for(let i of [o.header,o.footer])if(i){for(let a of La(i.fragments))if(a.paragraphId===t)return {pageIndex:r,sectionIndex:e.sectionAtPage(r).sectionIndex}}}return null}function $G(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 Z2(e,t){let n=Et(e.session,t.head.paragraphId,{kind:"body"}),r=Et(e.session,t.anchor.paragraphId,{kind:"body"});if(!$G(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=BG(e,t.head.paragraphId);return e.enterHeaderFooter?.({rId:n.rId,...l?{pageIndex:l.pageIndex,sectionIndex:l.sectionIndex}:{}})?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that header or footer could not be opened"}}let i=z2(e,t.head.paragraphId);return i?(t.anchor.paragraphId===t.head.paragraphId?i:z2(e,t.anchor.paragraphId))!==i?{ok:false,code:"unsupported",reason:"a selection cannot span two stories"}:o.kind==="note"&&o.id===i?{ok:true,changed:false}:(e.exitHeaderFooter?.(),e.enterNote?.(i)?{ok:true,changed:false}:{ok:false,code:"unsupported",reason:"that note could not be opened"}):{ok:false,code:"notFound",reason:"that note is not laid out"}}var WG=new Set(["resolveAllReviewChanges","setReviewChangesAuthor","proposeInsertion","proposeDeletion","proposeReplacement","replaceMatch","toggleMark","setMarkAttr","setAlignment","setParagraphDirection","clearFormatting","setLineSpacing","setParagraphSpacing","setParagraphStyle","setParagraphFormat"]),qG=Object.freeze({ok:false,code:"unsupported",reason:"historyGroup must be an open handle from this editor and document; begin a new group after end(), detach, or load"}),yx=class{constructor(t,n,r){this.owner=t;this.diagnose=n;this.target=r;}owner;diagnose;target;records=new WeakMap;undoEpoch=0;burst;diagnoseWrites(t,n,r=false){if(t.type!=="setMarkAttr"||!n.ok||!n.changed)return;let o=`${r}:${t.mark}:${t.attr}:${this.target()}`,i=Date.now(),a=this.burst,s=a?.key===o&&i-a.time<=250?a.count+1:1;this.burst={key:o,time:i,count:s},s===3&&this.diagnose({kind:r?"possible-fragmented-gesture":"possible-ungrouped-gesture",reason:"Three rapid formatting writes started separate groups at the same selection. For a continuous control, retain one handle with bindHistoryGroup; separate clicks may be intentional."});}begin(){let t=this.owner(),n={token:Symbol("gesture"),owner:t?new WeakRef(t):void 0,closed:false,committed:false,undoEpoch:this.undoEpoch,lastOutcome:null},r=KG(n,new WeakRef(this));return this.records.set(r,n),r}owns(t){return t!==void 0&&t===this.owner()}validate(t){let n=t?.historyGroup;return n===void 0?null:this.token(n)===void 0?qG:null}token(t){let n=this.records.get(t);return n&&t.state==="open"?n.token:void 0}gate(t,n){let r=this.validate(n);return r||n?.historyGroup===void 0?r:WG.has(t.type)?null:{ok:false,code:"unsupported",reason:`${t.type} does not support history grouping`}}note(t){(t.type==="undo"||t.type==="redo")&&this.undoEpoch++;}run(t,n,r,o){let i=r?.historyGroup,a=i&&this.records.get(i);if(!a){let d=As(t,void 0,o);return n&&this.diagnoseWrites(n,d),d}let s,l=Mn(a.token,(d,u)=>s={kind:d,reason:u},()=>As(t,a.token,o));if(!l.ok)return l;let c=this.settle(a,s);return c.kind==="started"&&n?this.diagnoseWrites(n,l,true):this.burst=void 0,{...l,history:c}}automationFrames(t){let n=this.token(t)===void 0?void 0:this.records.get(t);if(!n)return null;let r=[];return {bind:(o,i)=>{let a,s=Mn(n.token,(l,c)=>a={kind:l,reason:c},()=>As(o,n.token,i));return a&&r.push(a),s},finish:()=>{if(r.length===0)return null;this.burst=void 0;let o=r.find((i,a)=>i.kind==="split"||a>0&&i.kind==="started");return this.settle(n,o?{kind:"split",reason:o.reason}:r[0])}}}settle(t,n){let r=n?.kind==="split"||n?.kind==="started"&&t.committed,o=n===void 0?{kind:"none",reason:"no-history"}:r?{kind:"split",reason:n.reason??(t.undoEpoch!==this.undoEpoch?"undo-redo":"history-boundary")}:{kind:n.kind};return n&&(t.committed=true,t.undoEpoch=this.undoEpoch),t.lastOutcome=o,o.kind==="split"&&this.diagnose({kind:"split",reason:o.reason??"history-boundary"}),o}};function KG(e,t){return Object.freeze({get state(){return !e.closed&&t.deref()?.owns(e.owner?.deref())?"open":"closed"},get lastOutcome(){return e.lastOutcome},end(){e.closed=true,e.owner=void 0;}})}function Y2(e,t,n){let r={generation:-1,token:{}};return new yx(()=>{let{mounted:o,generation:i}=e();return o?(r.generation!==i&&(r={generation:i,token:{}}),r.token):null},t,n)}var Q2={selection:null,pendingFormat:null,headerFooter:null,drawingIntent:"none",formatPainter:"off/none",collaborationStatus:"inactive",pageCount:0};function J2(e,t){let n=t.headerFooterState?.();return {selection:e.selection,pendingFormat:e.pendingFormat,headerFooter:n?.editing&&n.rId?`${n.editing}:${n.rId}`:null,drawingIntent:wC(t.drawingSelectionIntent()),formatPainter:`${e.formatPainter.mode}/${e.formatPainter.level}`,collaborationStatus:e.collaborationStatus,pageCount:e.pageCount}}function e_(){let e={...Q2};return {moved(t,n){let r=J2(t,n),o=uf(r.selection,e.selection)&&r.pendingFormat===e.pendingFormat&&r.headerFooter===e.headerFooter&&r.drawingIntent===e.drawingIntent&&r.formatPainter===e.formatPainter&&r.collaborationStatus===e.collaborationStatus,i=r.pageCount!==e.pageCount;return e=r,o?i?"pages":"nothing":"state"},adopt(t){e=J2(t.state(),t);},reset(){e={...Q2};}}}var t_=512*1024;function UG(e,t){let n=e.byteLength;if(n<22)return false;let r=new DataView(e.buffer,e.byteOffset,n),o=Math.max(0,n-(64*1024+22)),i=-1;for(let c=n-22;c>=o;c-=1)if(r.getUint32(c,true)===101010256){i=c;break}if(i<0)return false;let a=r.getUint16(i+10,true),s=r.getUint32(i+16,true),l=0;for(let c=0;c<a;c+=1){if(s+46>n||r.getUint32(s,true)!==33639248)return false;if(l+=r.getUint32(s+24,true),l>=t)return true;s+=46+r.getUint16(s+28,true)+r.getUint16(s+30,true)+r.getUint16(s+32,true);}return false}var jG=2e3,VG=40;function n_(e){let t=null,n=()=>Ae(e.node?.()??null),r=()=>{if(!t)return null;let{bytes:o}=t;return t.cancel(),t=null,o};return {shouldYield:o=>typeof n().requestAnimationFrame=="function"&&typeof n().cancelAnimationFrame=="function"&&(o.byteLength>=t_||UG(o,t_)),schedule(o){let i=nt(()=>e.node?.()??null),a=null,s=null,l=e.prepare?()=>e.prepare(o):null,c=false,d=false,u=y=>{try{return y()}catch(h){throw t===g&&(t=null,e.scheduled()),h}},f=()=>{if(c)return;if(l){let h=l;l=null;let b;try{b=h();}catch{}if(typeof b=="function"){l=b,Mc(f,n());return}if(!b){a=i.setTimeout(f,0);return}let x=true,S=()=>{x&&(x=false,a!==null&&i.clearTimeout(a),a=i.setTimeout(f,0));};a=i.setTimeout(S,jG),b.then(S,S);return}d=true,u(()=>e.mount(o));let y=()=>{if(c||t!==g)return;let h=!e.continueOpen||u(()=>e.continueOpen(VG));if(!(c||t!==g)){if(!h){Mc(y,n());return}t=null,e.continueOpen&&e.scheduled();}};e.continueOpen?Mc(y,n()):t===g&&(t=null,e.scheduled());},p=i.requestAnimationFrame(()=>{s!==null&&i.clearTimeout(s),s=null,a=i.setTimeout(f,0);});s=i.setTimeout(()=>{i.cancelAnimationFrame(p),f();},250);let g={bytes:o,mounted:()=>d,cancel:()=>{c=true,i.cancelAnimationFrame(p),a!==null&&i.clearTimeout(a),s!==null&&i.clearTimeout(s);}};t=g,e.scheduled();},cancel:r,flush(){let o=t;if(!o)return;let i=o.mounted();r();try{if(i||e.mount(o.bytes),e.continueOpen)for(;!e.continueOpen(Number.POSITIVE_INFINITY););}catch(a){throw e.scheduled(),a}i&&e.scheduled();},isScheduled:()=>t!==null}}var vx=40,bx=16,r_=32,xx=new WeakMap;function Sx(e,t){let n=Rk(t.contentLockPolicy);return n?{...e,contentLockPolicy:n}:e}function GG(e,t,n$1){let r=ng(e),o=()=>{let i=performance.now()+vx;for(;;){let a=r.next();if(a.done){let s=n(a.value,t);return xx.set(e,s),n$1(s)}if(performance.now()>=i)return o}};return o}function o_(e){let t=xx.get(e);return t===void 0?{}:(xx.delete(e),{openedSession:t,progressiveOpen:true})}function i_(e,t,n){return r=>GG(r,e(),o=>{let i=o.ok?t(r,o.session):null;return o.ok&&i?zG(o.session,i,n):void 0})}function a_(e){let t=null;return {set(n){t=n;let r=e();r&&Tb(r,n);},adopt:n=>Tb(n,t)}}function zG(e,t,n){let r=e.part().root.children.find(g=>g.kind==="body"),o=r?.kind==="body"?r.children:[],i=[];for(let g of o.slice(0,Rc)){if(g.kind==="table")for(let y of g.children)i.push(y);i.push(g);}let a=[];for(let g=0;g<o.length;){let y=o[g];if(y.kind==="table"){for(let x=0;x<y.children.length;x+=r_){let S=x;a.push(()=>{xH(e,y,S,S+r_);});}a.push(()=>nx(e,[y])),g+=1;continue}let h=g;for(;h<o.length&&h-g<bx&&o[h].kind!=="table";)h+=1;let b=o.slice(g,h);a.push(()=>nx(e,b)),g=h;}let s=0,l=0,c=false,d,u=ab$2(e.part().root),f=[()=>{let g=performance.now()+vx;return u(()=>performance.now()>=g)},()=>(e.reviewItems(),true)],p=()=>{if(!t())return;let g=performance.now()+vx;if(!c){for(;s<a.length&&performance.now()<g;)a[s++]();return s<a.length||(c=true,d=n()),p}if(l<i.length){for(;l<i.length&&performance.now()<g;)hf$1(i.slice(l,l+bx)),l+=bx;return p}let y=f[0];return y?(y()&&f.shift(),p):d};return p}function s_(e){return {...e.tableInteractionLabel?{tableInteractionLabel:e.tableInteractionLabel}:{},...e.imageDecodePort?{imageDecodePort:e.imageDecodePort}:{},...e.lockedControlNavigation==="atomic"?{lockedControlNavigation:"atomic"}:{}}}function l_(e){let t=[];return Object.assign(r=>{for(let o of [...e.customNodeDiagnostics,...t])try{o(r);}catch{}},{observe(r){t.push(r);}})}function c_(e,t){t.customNodePayloadNamespaces.length!==0&&e.session.sweepCustomNodePayloads(t.customNodePayloadNamespaces);}function d_(e){return e.kind==="comment"}function u_(e){let{surface:t}=e,n=t?.retainedSelection()??t?.state().selection??null;if(!n)return null;let{anchor:r,head:o}=n;if(r.paragraphId===o.paragraphId&&r.offset===o.offset||!t?.publishedLayout())return null;let i=e.bodyOrder(),a=i.get(r.paragraphId)??-1,s=i.get(o.paragraphId)??-1;if(a===-1||s===-1){let c=e.openStoryOrder();a=c.get(r.paragraphId)??-1,s=c.get(o.paragraphId)??-1;}if(a===-1||s===-1){let c=nO(t);a=c.get(r.paragraphId)??-1,s=c.get(o.paragraphId)??-1;}return a===-1||s===-1?null:a<s||a===s&&r.offset<=o.offset?{from:r,to:o}:{from:o,to:r}}function XG(e){let t=new Map;for(let n of e){let r=n.item;if(!d_(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 YG(e,t){let n=e.filter(i=>i.key===t);if(n.length===0)return {ok:false,code:"notFound",reason:"no review item with that key"};let r=n.map(i=>i.item).filter(d_);if(r.length===0)return {ok:false,code:"kindMismatch",reason:"the review item is not a comment"};let o=r[0];for(let i of r)if(i.comment!==o.comment)return {ok:false,code:"ambiguous",reason:"duplicate comment records share that key"};return o}function f_(e,t,n){if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:e.proReviewReason};if(e.editingMode==="viewing"){let u=e.surface?.commitReviewOps(()=>({committed:false,reason:"the document is open for viewing"}),"comment-resolve"),f="the document is open for viewing";return pr(u??f,f,"locked")}let r=e.placements({pairReplacements:false}),o=YG(r,t);if(!("kind"in o))return o;if(!e.surface)return {ok:false,code:"notFound",reason:"no review item with that key"};let i=XG(r);if(i==="ambiguous")return {ok:false,code:"ambiguous",reason:"duplicate comment records share an id"};let a=o,s=new Set;for(;a.parentId!==void 0&&!s.has(a.id);){s.add(a.id);let u=i.get(a.parentId);if(!u)break;a=u;}let l=false,c=false,d=e.surface.commitReviewOps(u=>{let f=e.surface.session.packageRevision();return l=e.surface.session.setCommentResolved(a.id,n,{historyToken:u}),c=l&&e.surface.session.packageRevision()!==f,{committed:c}},"comment-resolve");return l?(c&&e.bump(),{ok:true,changed:c}):pr(d,"the comment could not be resolved","notFound")}function p_(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 QG=Object.freeze({ok:false,code:"invalidArgs",reason:"pass the author as a string and options last, or options alone in place of the author"});function m_(e,t){if(e==null||typeof e=="string")return [e??void 0,t];let n=typeof e=="object"?Object.getPrototypeOf(e):void 0;return !(n===null||n!==void 0&&Object.getPrototypeOf(n)===null)||Array.isArray(e)||t!==void 0?QG:[void 0,e]}function g_(e){let t=(i,a)=>{let s=e.historyGroups.validate(i);if(s)return s;let l=e.surface();return l?e.historyGroups.run(l,void 0,i,a):a()},n=(i,a)=>{if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:qt};let s=e.surface();s?.flushPendingInput();let l=e.commentTargetRange();if(!l||!s)return {ok:false,code:"invalidArgs",reason:"a comment needs a selected range"};let c=(a??e.author()??"").trim();if(c.length===0||i.trim().length===0)return {ok:false,code:"invalidArgs",reason:"a comment needs both an author and text"};let d=null,u=s.commitReviewOps(f=>(d=s.session.replyToComment(null,{paragraphId:l.from.paragraphId,start:l.from.offset,end:l.to.offset,...l.to.paragraphId===l.from.paragraphId?{}:{endParagraphId:l.to.paragraphId}},i,c,j$1(),e.storyScopeOfParagraph(l.from.paragraphId),void 0,{historyToken:f}),{committed:d!==null}),"comment-add");return d===null?pr(u,"the comment could not be committed"):{ok:true,changed:true}},r=i=>{if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:qt};let a=e.surface(),s=Yr(e.placements,i)?.item;if(!s||!a)return {ok:false,code:"notFound",reason:"no review item with that key"};if(s.kind==="revision")return e.resolveReviewItem(i,"reject");if(s.kind!=="comment")return {ok:false,code:"unsupported",reason:"a custom node card cannot be deleted"};let l=false,c=a.commitReviewOps(d=>{let u=e.noteHomeOf(s),f=u===null?null:Ic$1(u);return l=a.session.deleteComment(s.id,e.storyScopeOfReviewItem(s),f?.noteId,{historyToken:d}),{committed:l}},"comment-delete");return l?(e.bump(),{ok:true,changed:true}):pr(c,"the comment could not be deleted")},o=(i,a,s)=>{if(!e.reviewEnabled)return {ok:false,code:"unsupported",reason:qt};let l=e.surface();l?.flushPendingInput();let c=Yr(e.placements,i)?.item,d=xs(c)?.insertion??c;if(!d||!l)return {ok:false,code:"notFound",reason:"no review item with that key"};let u=tl(d);if(!u)return {ok:false,code:"invalidArgs",reason:"the item has no anchorable range"};let f=(s??e.author()??"").trim(),p=p_(d,a,f);if(p)return p;let g=d.kind==="comment"?d.id:null,y=null,h=l.commitReviewOps(b=>(y=l.session.replyToComment(g,{paragraphId:u.start.paragraphId,start:u.start.offset,end:u.end.offset},a,f,j$1(),e.storyScopeOfReviewItem(d),void 0,{historyToken:b}),{committed:y!==null}),"comment-reply");return y===null?pr(h,"the reply could not be committed"):{ok:true,changed:true}};return {addComment:(i,a,s)=>{let l=m_(a,s);if(!Array.isArray(l))return l;let[c,d]=l;return t(d,()=>n(i,c))},acceptReviewItem:(i,a)=>t(a,()=>e.resolveReviewItem(i,"accept")),rejectReviewItem:(i,a)=>t(a,()=>e.resolveReviewItem(i,"reject")),setCommentResolved:(i,a,s)=>t(s,()=>f_({reviewEnabled:e.reviewEnabled,editingMode:e.editingMode(),placements:e.placements,surface:e.surface(),proReviewReason:qt,bump:e.bump},i,a)),deleteReviewItem:(i,a)=>t(a,()=>r(i)),replyToReviewItem:(i,a,s,l)=>{let c=m_(s,l);if(!Array.isArray(c))return c;let[d,u]=c;return t(u,()=>o(i,a,d))}}}var h_=new WeakMap;function y_(e,t){t&&h_.set(e,t);}function b_(e){return h_.get(e)}var wx=new WeakMap;function v_(e,t){wx.set(e,t);}function x_(e,t){return wx.get(e)?.automationFrames(t)??null}function S_(e,t){return wx.get(e)?.token(t)!==void 0}function w_(e,t,n){v_(e,t),y_(e,n);}var JG=1e4;function k_(e,t){return t?[e,l$3(t)]:[e]}function I_(e,t){if(!t)return false;try{let n=new Set((t.sources??[]).map(o=>h$2(o.request))),r=new Set((t.substitutions??[]).map(o=>`${h$2(o.from)}>${h$2(o.to)}`));return (e.sources??[]).every(o=>n.has(h$2(o.request)))&&(e.substitutions??[]).every(o=>r.has(`${h$2(o.from)}>${h$2(o.to)}`))}catch{return false}}function R_(e){let t=new Map,n=(r,o=false)=>{let i=t.get(r);i!==void 0&&(globalThis.clearTimeout(i),t.delete(r),o||e.changed());};return {pending:()=>t.size>0,clear:()=>{for(let r of t.values())globalThis.clearTimeout(r);t.clear();},settle:r=>{r&&n(r.token,true);},track(r,o,i,a){let s={};t.set(s,globalThis.setTimeout(()=>n(s),e.waitMs??JG)),r.then(l=>{if(!a())return n(s);let c;try{if(typeof l!="object"||l===null)return n(s);for(let d of k$2(l))e.report(d);if(!j$3(l))return n(s);c=i$2(o,l);}catch(d){return e.report(d),n(s)}e.deliver(i,{full:c,token:s});},()=>n(s));}}}var ez=Object.freeze(["Arial","Calibri","Cambria","Consolas","Courier New","Garamond","Georgia","Helvetica","Open Sans","Roboto","Times New Roman","Verdana"]),tz=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function P_(e,t,n){let r=new Map,o=l=>{if(l===void 0||!tz.test(l))return;let c=l.toLowerCase();r.has(c)||r.set(c,l);};o(g$2(e));let i=e?.substitutions??[],a=new Set(i.map(l=>l.to.family.toLowerCase()));for(let l of i)o(l.from.family);for(let l of e?.sources??[])a.has(l.request.family.toLowerCase())||o(l.request.family);for(let l of a$4([e?.supportedFamilies]))o(l);for(let l of ez)(r.has(l.toLowerCase())||!n||n(l))&&o(l);for(let l of t)o(l);let s=[...r.values()];return s.sort((l,c)=>l<c?-1:l>c?1:0),s}var T_=e=>new a("overLimit",`font source ${e.id} exceeds the font byte budget`,{request:e.request}),E_=e=>new a(e.reason,e.reason==="overLimit"?"an embedded font exceeds the font byte budget":"an embedded font part declares an invalid family name",{request:e.request});function C_(e,t){return J$2(e,t)}function kx(e,t,n){return K$2(e,t,n)}var O_=new WeakMap;function nz(e){let t=e.packageRevision(),n=O_.get(e);if(n?.revision===t)return n.faces;let r=e.symbolFontFamilies().length>0?l$2(e.storyParts().map(o=>o.root)):[];return O_.set(e,{revision:t,faces:r}),r}function M_(e){let t=e.renderedFontFamilies(),n=nz(e);if(n.length===0)return t;let r=new Set(t.map(i=>i.toLowerCase())),o=n.filter(i=>!r.has(i.toLowerCase()));return o.length===0?t:[...t,...o]}var A_=a$1;function xn(e,t){if(!e)throw new Error(t)}function L_(e){let t=0;for(let n=0;n<e.length;n+=4){let r=(e[n]||0)*16777216+(e[n+1]||0)*65536+(e[n+2]||0)*256+(e[n+3]||0)>>>0;t=t+r>>>0;}return t}function F_(e,t=0){xn(e instanceof Uint8Array&&e.length>=12&&e.length<=A_,"Unsupported font byte length"),xn(Number.isSafeInteger(t)&&t>=0,"Invalid face index");let n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=(v,k)=>{xn(Number.isSafeInteger(v)&&Number.isSafeInteger(k)&&v>=0&&k>=0&&v+k<=e.length,"Font range exceeds source");},o=v=>String.fromCharCode(...e.subarray(v,v+4));if(o(0)!=="ttcf")return xn(t===0,"Face index requires a collection"),xn([65536,1330926671,1953658213].includes(n.getUint32(0)),"Unsupported SFNT version"),e.slice();let i=n.getUint32(4);xn(i===65536||i===131072,"Unsupported TTC version");let a=n.getUint32(8);xn(a>0&&t<a,"Collection face absent"),r(12,a*4+(i===131072?12:0));let s=12+a*4+(i===131072?12:0),l=n.getUint32(12+t*4);r(l,12);let c=n.getUint32(l);xn([65536,1330926671,1953658213,1954115633].includes(c),"Unsupported face version");let d=n.getUint16(l+4);xn(d>0,"Missing face tables"),r(l,12+d*16),xn(l>=s,"Selected directory overlaps collection header");let u=[[0,s],[l,l+12+d*16]],f=[],p=new Set;for(let v=0;v<d;v++){let k=l+12+v*16,E=o(k),I=n.getUint32(k+8),R=n.getUint32(k+12);xn(/^[\x20-\x7e]{4}$/.test(E)&&!p.has(E),"Invalid or duplicate table tag"),p.add(E),r(I,R);for(let[O,C]of u)xn(R===0||I>=C||I+R<=O,"Table overlaps collection directory");f.push({name:E,offset:I,length:R,destination:0});}let g=f.filter(v=>v.length>0).sort((v,k)=>v.offset-k.offset);for(let v=1;v<g.length;v++)xn(g[v].offset>=g[v-1].offset+g[v-1].length,"Selected face tables overlap");let y=f.find(v=>v.name==="head");xn(y&&y.length>=54,"Missing or truncated head table"),f.sort((v,k)=>v.name<k.name?-1:v.name>k.name?1:0);let h=12+d*16;for(let v of f)v.destination=h,h+=v.length+3&-4,xn(h<=A_,"Standalone face exceeds byte ceiling");let b=new Uint8Array(h),x=new DataView(b.buffer);x.setUint32(0,c),x.setUint16(4,d);let S=2**Math.floor(Math.log2(d));x.setUint16(6,S*16),x.setUint16(8,Math.log2(S)),x.setUint16(10,d*16-S*16);for(let[v,k]of f.entries()){let E=12+v*16;for(let I=0;I<4;I++)b[E+I]=k.name.charCodeAt(I);b.set(e.subarray(k.offset,k.offset+k.length),k.destination),k.name==="head"&&x.setUint32(k.destination+8,0),x.setUint32(E+4,L_(b.subarray(k.destination,k.destination+k.length))),x.setUint32(E+8,k.destination),x.setUint32(E+12,k.length);}return x.setUint32(y.destination+8,2981146554-L_(b)>>>0),b}var D_=Object.freeze({installed:0,alias:()=>{},showIn(){},dispose(){}});function rz(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 Zp=e=>e.trim().toLowerCase();function Xp(e){let t=e??(typeof globalThis.document<"u"?globalThis.document:void 0),n=t?.fonts,r=t?.defaultView?.FontFace;return !n||typeof r!="function"?{}:{fontSet:n,createFontFace:(o,i,a)=>new r(o,i.slice().buffer,a)}}async function N_(e,t=Xp(),n=[]){let{fontSet:r,createFontFace:o}=t;if(!r||!o||e.length===0)return D_;let i=new Map;for(let f of e){let p=Zp(f.request.family),g=i.get(p);g?g.push(f):i.set(p,[f]);}let a=new Map,s=[],l$1=[],c=f=>{let p=f.bytes,g=p.length>=4&&p[0]===116&&p[1]===116&&p[2]===99&&p[3]===102;if(g&&f.faceIndex===0&&!l(p,0).valid)throw new Error("Invalid collection face");if(!g&&f.faceIndex!==0)throw new Error("Font face index requires a collection");return g&&f.faceIndex!==0?F_(p,f.faceIndex):p};if(await Promise.all([...i].map(async([f,p])=>{let g=rz(p.map(h=>`${h.hash}:face:${h.faceIndex}`)),y=false;await Promise.all(p.map(async h=>{try{let b=c(h),x={weight:String(h.request.weight),style:h.request.style},S=o(g,b,x);await S.load(),r.add(S),s.push({set:r,face:S}),l$1.push({alias:g,source:h,descriptors:x}),y=!0;}catch{}})),y&&a.set(f,g);})),s.length===0)return D_;for(let f of n){let p=Zp(f.from.family);if(a.has(p))continue;let g=a.get(Zp(f.to.family));g!==void 0&&a.set(p,g);}let d=false,u=new WeakSet([r]);return {installed:s.length,alias:f=>d?void 0:a.get(Zp(f)),showIn(f){if(d)return;let p=Xp(f);if(!(!p.fontSet||!p.createFontFace||u.has(p.fontSet))){u.add(p.fontSet);for(let{alias:g,source:y,descriptors:h}of l$1)try{let b=p.createFontFace(g,c(y),h);p.fontSet.add(b),s.push({set:p.fontSet,face:b}),b.load().catch(()=>{});}catch{}}},dispose(){if(!d){d=true;for(let{set:f,face:p}of s)try{f.delete(p);}catch{}}}}}function H_(e,t){let n=[];for(let r of e){let o=t.resolve(r.request);if(o instanceof d||o.id!==r.id)continue;let{id:i,hash:a,faceIndex:s}=o;n.push({request:r.request,id:i,get bytes(){return o.bytes},hash:a,faceIndex:s});}return n}var Rx=44,Zc=.1,Xc=5;var _s={type:"fit",fit:"pageWidth",minZoom:.5,maxZoom:1},oz={type:"fit",fit:"pageWidth"},Yp={type:"fixed"};function Qp(e){return e==="auto"?_s:!e||typeof e!="object"?null:e.type==="fixed"?Yp:e.type==="fit"&&e.fit==="pageWidth"?Jp(e,_s)?_s:e:null}function Jp(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 Px(e,t,n="float"){return e?.type!=="fit"?t:n==="shrinkPage"?e.minZoom!==void 0&&Number.isFinite(e.minZoom)?Ix(e.minZoom):.1:e.maxZoom!==void 0&&e.maxZoom<5?e.maxZoom:null}function Bs(e){return e.type==="fit"}function __({availableWidthPx:e,pageWidthPx:t,gutterPx:n=24,minZoom:r=.1,maxZoom:o=5}){if(!Number.isFinite(e)||e<=0||!Number.isFinite(t)||t<=0)return null;let i=Number.isFinite(n)&&n>0?n:0,a=Math.max(e-2*i,e*.5),s=Number.isFinite(r)?Ix(r):.1,l=Number.isFinite(o)?Ix(o):5,c=Math.floor(a/t*100)/100;return Math.min(Math.max(c,s),Math.max(l,s))}function Ix(e){return Math.min(Math.max(e,.1),5)}var iz=88;function az(e,t=false){let n=Nt(e);if(!n)return null;let r=n.clientWidth;if(!Number.isFinite(r)||r<=0)return null;let o=n.ownerDocument.defaultView?.getComputedStyle(n);if(t&&n.hasAttribute("data-review-pane")){let s=Number.parseFloat(o?.getPropertyValue("--docx-review-strip")??""),l=Number.isFinite(s)?s:iz,c=l/2,d=Number.parseFloat(o?.getPropertyValue("--docx-nav-shift")??""),u=Number.parseFloat(o?.getPropertyValue("--docx-review-gutter-start")??""),f=(Number.isFinite(d)?d:0)+(Number.isFinite(u)?u:c)-c;return Math.max(r-l-Math.max(f,0),0)}if(!o)return r;let i=Number.parseFloat(o.paddingLeft)||0,a=Number.parseFloat(o.paddingRight)||0;return Math.max(r-i-a,0)}function B_(e){let t=null,n=null,r=nt(()=>n),o=null,i=null;function a(){o!==null&&(r.cancelAnimationFrame(o),o=null);}function s(){let c=e.mode();if(!Bs(c))return;let d=e.container();if(!d)return;let u=e.reviewPaneScrolls?.()===true&&Px(c,e.zoom())!==null,f=az(d,u);if(f===null)return;let p=e.pageWidthPx();if(p===null)return;i=e.pageWidthTwips();let g=__({availableWidthPx:f,pageWidthPx:p,...c.minZoom!==void 0?{minZoom:c.minZoom}:{},...c.maxZoom!==void 0?{maxZoom:c.maxZoom}:{}});if(g===null||g===e.zoom())return;let y=Nt(d),h=y!==null&&y.scrollLeft===0;e.applyZoom(g),h&&y&&y.scrollLeft!==0&&(y.scrollLeft=0);}function l(){if(!n||typeof Ae(n).requestAnimationFrame!="function"){s();return}r.migrate(),o===null&&(o=r.requestAnimationFrame(()=>{o=null,s();}));}return {refitIfPageResized(){let c=e.pageWidthTwips();c===null||c===i||s();},attach(){this.detach();let c=e.container();if(!c)return;let d=Nt(c);if(!d)return;n=d;let u=Ae(d);typeof u.ResizeObserver=="function"&&(t=new u.ResizeObserver(l),t.observe(d)),s();},refit:s,detach(){a(),t?.disconnect(),t=null,n=null,i=null;}}}function W_(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=Qp(e.zoomMode??(n!==null?Yp:"auto"))??_s;function i(l,c){if(l===r)return c?.(),true;let d=t.surface();return d&&!kb(d,l*(96/72))?false:(r=l,c?.(),t.bump(),t.emitSelectionChange(),true)}function a(){o=Yp,s.detach();}let s=B_({container:t.container,mode:()=>o,pageWidthPx:()=>{let l=t.surface()?.layout().pages[0]?.box;return l?l.width*(96/72):null},pageWidthTwips:()=>t.surface()?.sectionProperties().pageSize.widthTwips??null,zoom:()=>r,applyZoom:l=>{i(l);},reviewPaneScrolls:()=>t.reviewPaneScrolls?.()===true});return {zoom:()=>r,mode:()=>o,scale:()=>r*(96/72),attach:()=>{Bs(o)&&s.attach();},detach:()=>s.detach(),refit:()=>s.refit(),refitIfPageResized:()=>s.refitIfPageResized(),setZoom(l){if(!Number.isFinite(l)||l<.1||l>5)return {ok:false,code:"invalidArgs",reason:`zoom must be between ${.1} and ${5}, got ${l}`};let c=Bs(o);return l===r?c?(a(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:true,changed:false}:i(l,c?a:void 0)?{ok:true,changed:true}:{ok:false,code:"unsupported",reason:`the mounted surface could not apply zoom ${l}`}},setZoomMode(l){let c=Qp(l);return c?Jp(c,o)?{ok:true,changed:false}:(o=c,Bs(c)?s.attach():s.detach(),t.bump(),t.emitSelectionChange(),{ok:true,changed:true}):{ok:false,code:"invalidArgs",reason:`unknown zoom mode ${JSON.stringify(l)}`}}}}function $_(e){let t=1.3333333333333333;return {x:e.x*t,y:e.y*t,width:e.width*t,height:e.height*t}}function q_(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:$_(r.box),contentBox:$_(r.contentBox)})):[]}}}var K_=new Map;function U_(e){let t=e,n=null,r=null;return {current:()=>t,set:o=>{t=o;},authorsFor:o=>{if(n&&n.slots===o&&n.colors===t)return n.value;let i=g$1(o,t);return n={slots:o,colors:t,value:i},i},styleFor:o=>((!r||r.colors!==t)&&(r={colors:t,value:f$1(t)}),r.value.get(o))}}function j_(e){let t=Ek(e),n=new Intl.Locale(t).baseName;for(;n&&!Object.hasOwn(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(locales).find(s=>{let l=new Intl.Locale(s).maximize();return l.language===r.language&&l.script===r.script}),i=n||o||"en",a=createT(deepMerge(en,i==="en"?void 0:locales[i]),i);return {locale:t,labels:{title:a("toolbar.tableOfContents")}}}function V_(e){let t=e.mode,n=e.translate,r=n?p(n):o$1,o=j_(e.locale);return {mode:()=>t,modeForGate:()=>t??"edit",openingModeDecision:i=>oy(t,i),setMode(i){return t===i?false:(t=i,true)},translate:()=>n,drawingStrings:()=>r,setTranslate(i){if(n===i)return null;n=i;let a=i?p(i):o$1;return n$1(r)===n$1(a)?(r=a,null):(r=a,r)},locale:()=>o.locale,tocLabels:()=>o.labels,setLocale(i){let a=j_(i);return o.locale===a.locale?null:(o=a,o.labels)}}}function G_(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 dz=Object.freeze({kind:"body"}),uz=Object.freeze([]);function fz(e){let t=tR(e.fontShaping),n,r=null,o$1=null,i$1=null,a$3=-1,s=()=>i$1!==null,l=V_(e),c=qb(e.author),d$1=e.container??null,u=a$2(e.modules),f=l_(u),p=u.review!==null,g=h2(u.review?.pane,{enabled:p,changed:(A,ne)=>{sn&&A.revisionsIn!==ne.revisionsIn&&!g.shows(M?.session.reviewItems()??[])&&(sn=false),Ce(),Ee(),ln.refit();}}),y=null,h=new WeakMap,b=n_({mount:A=>ya(A),prepare:i_(()=>Sx(rx(u,f),e),(A,ne)=>r===A?null:(i$1=ne,()=>i$1===ne),()=>_e.schedule(true)),scheduled:()=>{Ce(),Ee();},node:()=>d$1}),x=l.mode()==="view"?"viewing":"editing",S=null,v,k=false,E=kA(g.pairsReplacements,()=>M),I=ap(),R=U_(e.revisionStyles),O=i(),C=false,w=false,T=null,$=()=>({reviewEnabled:p,hasAuthor:!!c}),W=false,q=null,K=ZE({stillMissing:()=>!X&&c===void 0&&Jn(null)===Zr,emit:A=>rt(A)}),Z=l.openingModeDecision($());Z.mode!==null&&(x=Z.mode),Z.rejection!==null&&(T=Z.rejection),K.report(Z.rejection);let M=null,ee=BO(e.unsupportedElementRules,()=>M),J=null,fe=a_(()=>M),se=O2(()=>{Ce(),Ee();}),B=null,D=e_(),j=false,H=()=>{j||(j=true,globalThis.queueMicrotask(()=>{j=false,X||Ee();}));},N,z=AH({surface:()=>M,destroyed:()=>X,changed:()=>(Ce(),Ee()),emitError:A=>rt(A),capability:A=>MH(A,X,p,ka)}),X=false,F,U,G=null,Y=()=>{},le=0;function oe(){G?.dispose(),G=null;}let ae=0,xe=0,Se=IH(),at=e.fonts,we,Ue=()=>typeof at=="function"?we:at,_e=kH(()=>{let A=i$1??M?.session;if(X||!A)return null;let ne=i$1?void 0:oo().formatting?.fontFamily;return {generation:Se.generation,dynamic:typeof at=="function",families:()=>wH(A,ne,g$2(Ue()))}},async(A,ne)=>{let ie=i$1?{session:i$1}:M;et.settle(ne);try{ie&&await em(ae,ie,A,ne?.full);}finally{ne&&!X&&(Ce(),Ee());}}),Je=false,et=R_({deliver:(A,ne)=>_e.deliver(A,ne),changed:()=>(Ce(),Ee()),report:A=>Ws($i(A))}),He=null,st=()=>M?.session.documentFonts()??[],an=A=>!!at&&!Ue()||$e(A),$e=A=>(He||(He=pH(d$1?ii(d$1.ownerDocument):null)),He(A)),lt=new Set,Mt=new Set,_t=A=>lt.has(A.toLowerCase())||G?.alias(A)!==void 0,fi=()=>!M||Je||et.pending()?uz:gH(M_(M.session),_t,$e,Mt),mr=0,to=null,Xe,Ye=null,gt=-1,Re=0,ga=-1,sn=false,je=e.reviewDisplayMode??(p?"all-markup":"proposed");if(!["all-markup","simple-markup","proposed","original"].includes(je))throw new TypeError("Invalid reviewDisplayMode");if(e.reviewDisplayMode&&e.reviewDisplayMode!=="proposed"&&!p)throw new TypeError("reviewDisplayMode requires a review module");let pi=sp({fieldResults:e.fieldResults,collaborationModel:u.collaboration??void 0}),Zn=m2({surface:()=>M,destroyed:()=>X,editingMode:()=>x,hostViewOnly:()=>l.mode()==="view",publish:()=>{Ce(),Ee();},decision:()=>cn(),tracking:Cn,adopt:A=>{T=A.rejection??Jn(null),A.mode!==null&&(w=A.mode==="viewing",be(A.mode)),Ce(),Ee();}});function Ce(){mr+=1;}let pn=cN(oo,()=>d$1?.ownerDocument??null),{emitError:rt,emitDocumentChange:no,emitSelectionChange:Ee}=pn,Lt=IN({modules:u,events:pn,customNodes:f,onOpenCrash:se.crash}),ha=()=>x==="suggesting",Tn=HN(e.revisionMarkup,{container:()=>d$1,surface:()=>M,viewing:()=>x==="viewing"||l.mode()==="view",destroyed:()=>X,contribution:()=>u.review,translate:()=>l.translate(),apply:A=>{M?.setRevisionMarkup(A),Ce();},changed:A=>{Ee(),pn.emitRevisionMarkupChange(A);}});function mi(A){Tn.destroyDialogs(),G?.showIn(A),ln.detach(),ln.attach(),Ce(),Ee();}let mn=()=>{};function Xn(){mn(),Tn.destroyDialogs(),B?.(),B=null,M?.destroy(),M=null,D.reset(),Re+=1;}let ln=W_(e,{container:()=>d$1,surface:()=>M,bump:Ce,emitSelectionChange:Ee,reviewPaneScrolls:()=>g.current().overflow==="scroll"}),gi=()=>ln.scale(),Lo=o2({surface:()=>M,container:()=>d$1,flushOpen:()=>b.flush()});function ya(...A){let ne=n?.source!==void 0;try{if(r===A[0]){r=null,ro(A[0],{immediate:!0,continueDeferredRefresh:!0});return}Sn(...A),ne&&M&&Or(M)?o$1=A[0]:n?.mounted(A[0]);}catch(ie){if(Lt.openCrashed(ie),n?.mounted(A[0],ie),!ne)throw ie}}function ba(){return {unsupportedElementRules:ee.current(),scale:gi(),...z.snapshot(),defaultFontFamily:g$2(Ue()),translate:l.translate(),drawingStrings:l.drawingStrings(),locale:l.locale(),...c?{author:c}:{},...R.current()!==void 0?{revisionStyles:R.current()}:{},reviewAuthorSlots:O,revisionAuthorVisibility:I,revisionMarkup:Tn.markup.current(),...Sx(rx(u,f),e),pairsReplacements:E.lightsPair,...F?{measurer:F,...U?{producer:U}:{}}:{},...G?{fontAlias:G.alias}:{},...s_(e),...pi.mode==="editable"?{fieldResults:pi.mode}:{}}}function Sn(A,ne,ie){if(ie??=h.get(A),h.delete(A),i$1=null,!d$1){Xn(),y=A,ie&&h.set(A,ie),se.clear(),Lt.openDeferred(),Ce();return}Lt.openMounting(),Xn();let Oe=I.stateKey,Te=Vc(d$1,A,{...ba(),...z.surfaceOptions(),initialSelection:ne,initialTextFormInput:ie,editingMode:x==="suggesting"?"suggest":x==="viewing"?"view":"edit",revisionDisplayMode:p?je:"proposed",...Lt.surfaceHooks(ha,()=>M),...o_(A),...u.collaboration?{collaborationModel:u.collaboration}:{},onHostMoved:mi,onTrackedChange:()=>{sn||!g.opensOnTrackedChange()||(sn=true,Ce(),Ee());},tocLabels:l.tocLabels(),onChange:Le=>{if(!M)return;Ce(),Zn.sync(),_e.schedule();let ht=M?.session.packageRevision(),Fe=ht!==N;if(N=ht,p&&d$1&&M&&!Fe){let We=M;R2(We,Ae(d$1),()=>{M===We&&We.session.reviewItems().length>0&&Yn(We.publishedLayout());});}let Ge=p&&je!==M.revisionDisplayMode();Ge&&(je=M.revisionDisplayMode());let Ft=Oe!==I.stateKey||Ge;Oe=I.stateKey;let Ne=D.moved(Le,M);!Ft&&Ne==="nothing"||(!Ft&&Ne==="pages"?H():Ee());}});if(!Te.ok){se.reject(Te.reason,Te.limit,Te.detail),Ce(),rt(on(Te.reason,`failed to open document: ${Te.reason}`)),Lt.openRejected(Te.reason,Te.limit,Te.detail);return}se.clear(),M=Te.surface,G?.showIn(d$1.ownerDocument),a$3=ae,Lo.attach(M,n?.source!==void 0),Zn.prime(),sn=p&&g.opensOnLoad(M.session.reviewItems()),D.adopt(M),q!==null?wa(q,false):Us(),c_(M,u);let Ve=M;Or(Ve)?DH(Ve,NH({current:()=>M,view:()=>Ae(d$1),slice:Le=>Lt.continueOpen(Le),settled:()=>Lt.openSettled(Ve)},{take:()=>[o$1,o$1=null][0],crashed:Le=>Lt.openCrashed(Le),mounted:(Le,ht)=>n?.mounted(Le,ht)})):Lt.openSettled(Ve),Re+=1,M.setEditable(x!=="viewing"),J!==null&&M.setRemoteCaretLabelHost(J),fe.adopt(M),S!==null&&M.setReviewActivationExclusions(S,{formattingKinds:v}),B=LH(Te.surface,{refitIfPageResized:()=>ln.refitIfPageResized(),bump:Ce,emit:no}),n?.contentMounted(A),ln.attach(),Ce(),no({revision:M.session.packageRevision(),source:n?.source??"load"}),Ee(),_e.schedule(true);}function ro(A,ne={}){let ie=ne.immediate??false;if(ne.continueDeferredRefresh||(xe+=1),ie||(b.cancel(),o$1=null),se.clear(),i$1=null,r=null,n?.source&&!ie&&d$1&&b.shouldYield(A)){r=A,b.schedule(A);return}h=new WeakMap,Lt.openStarted(A),sn=false,ae+=1;let Oe=Se.advance();try{O=i(),I.showAll(),va(),et.clear(),d$1&&!n?.source&&LL(d$1),!ie&&d$1&&b.shouldYield(A)?(Xn(),b.schedule(A)):ya(A);}finally{Oe.cancelPrevious();}}function va(){F=void 0,U=void 0,we=void 0,lt=new Set,Mt=new Set,oe(),Y(),Y=()=>{},Je=false;}function $s(){if(va(),M){let A=ex(d$1,gi(),M.session),ne=`${A.producer}+fonts:${++le}`,ie=g$2(Ue()),Oe={measurer:A.measurer,producer:ne,defaultFontFamily:ie};Pb(M,{...Oe,fontAlias:void 0},false);}Ce(),Ee();}function Ws(A,ne=ae,ie=Se.generation){RN(A,{config:e,events:pn,diagnostics:Lt},()=>!X&&ne===ae&&ie===Se.generation);}async function em(A,ne,ie,Oe){let Te=Se.capture(),Ve=()=>!X&&A===ae&&Te.current(),Le=Ge=>Ws(Ge,A,Te.generation),ht=at,Fe=ne.session.embeddedFonts();if(!(!ht&&Fe.length===0)&&!(Oe&&I_(Oe,we))){!Oe&&!we&&c$2().catch(()=>{}),Je=true,Ce();try{let{plan:Ge,request:Ft}=F$2(ne.session,ie,Ue()),Ne={...Ft,signal:Te.signal},ct=!!d$1&&ii(d$1.ownerDocument)!==null?I$1(Ge.fallbacks,$e):Ge.fallbacks,Jt=({cause:Rt})=>Le($i(Rt)),er=Oe?await s$1(k_(Oe,we),Ne,{onOriginFailure:Jt}):typeof ht!="function"?ht:we?await s$1([we,o(Rt=>ht(Rt))],Ne,{onOriginFailure:Jt}):await ht(Ne),{now:An,later:ao}=er?h$1(er):{now:er},gn=typeof ht=="function"||Oe?b$3(An):An;if(!Ve()){A===ae&&Te.current()&&(Je=!1);return}if(we=An,ao&&et.track(ao,An,Te.generation,Ve),Fe.length===0&&(!gn||An?.supportedFamilies?.length&&!b$3(An))){Je=!1,Ce(),Ee();return}let js=(gn&&"maxFontBytes"in gn?gn.maxFontBytes:void 0)??a$1,yr=C_(gn?.sources??[],js),br=yr.sources;for(let Rt of yr.dropped)Le(T_(Rt));let Ln=kx(Fe,br,js),en=!1,Vs=()=>{if(!en){en=!0;for(let Rt of Ln.dropped)Le(E_(Rt));}},tn=G$3(f$4({epoch:A,...gn,sources:br},Ln),Ge,ct);if(tn.sources.length===0){Vs(),Je=!1,Ce(),gn&&Le(new a("missing","the supplied font configuration contains no usable sources; the fixed measurer stays in effect"));return}let nn=await Kl(tn,void 0,t),Ia=()=>Ve()?!1:(t$1(nn),A===ae&&Te.current()&&(Je=!1),!0);if(Ia())return;let yt=Rt=>{Vs(),Rt&&t$1(Rt),Je=!1,Ce();},vi=(Rt,Dr)=>{let Nr=new Set;for(let so of Dr.sources??[]){let lo=Rt.fonts.resolve(so.request);lo instanceof d&&(Le($i(lo)),Nr.add(h$2(so.request)));}return Nr},Ra=vi(nn,tn);try{if(Ra.size>0){let Rt=br.filter(Si=>!Ra.has(h$2(Si.request))),Dr=Rt.length!==br.length;Dr&&(Ln=kx(Fe,Rt,js));let Nr=Ln.sources.filter(Si=>Dr||!Ra.has(h$2(Si.request))),so=nn;if(tn=G$3(f$4({epoch:A,...gn,sources:Rt},{sources:Nr}),Ge,ct),tn.sources.length===0)return yt(so);if(nn=await Kl(tn,void 0,t),t$1(so),Ia())return;let lo=vi(nn,tn);if(lo.size>0){let Si=Rt.filter($t=>!lo.has(h$2($t.request))),Ta=Ln.sources.filter($t=>!lo.has(h$2($t.request))),Gs=nn;if(tn=G$3(f$4({epoch:A,...gn,sources:Si},{sources:Ta}),Ge,ct),tn.sources.length===0)return yt(Gs);if(nn=await Kl(tn,void 0,t),t$1(Gs),Ia())return}}}finally{Vs();}let Pa=H_(tn.sources,nn.fonts),xi=await N_(Pa,Xp(d$1?.ownerDocument),tn.substitutions??[]);if(!Ve()){xi.dispose(),Ia();return}let Do={embeddedFaces:G,coveredFontFamilies:lt,documentSubstitutedFamilies:Mt,shapedMeasurer:F,shapedProducer:U,disposeShapedFonts:Y};try{G=xi,d$1&&xi.showIn(d$1.ownerDocument),lt=hH(Pa,tn.substitutions??[]),Mt=D$3(tn,Ge,nn.fonts,gn?.substitutions);let Rt=ex(d$1,gi(),ne.session,G?.alias),Dr=uH(nn,tn,Rt,gi(),++le,Nr=>Ve()&&Le(Nr));if(F=Dr.measurer,U=Dr.producer,Je=!1,M&&a$3===A&&Pb(M,{measurer:F,producer:U,fontAlias:G?.alias,defaultFontFamily:g$2(Ue())}),!Ve()){xi.dispose(),t$1(nn);return}}catch(Rt){throw Ve()&&({embeddedFaces:G,coveredFontFamilies:lt,documentSubstitutedFamilies:Mt,shapedMeasurer:F,shapedProducer:U,disposeShapedFonts:Y}=Do),xi.dispose(),t$1(nn),Rt}Y=()=>t$1(nn),Do.disposeShapedFonts(),Do.embeddedFaces?.dispose(),Ce(),Ee();}catch(Ge){if(!Ve())return;Je=false,Ce(),Le($i(Ge));}}}let Qc=Zh();function gr(){let A=M?.state()??null;return {scope:M?.activeScope?.()??dz,isLoading:se.parseError===null&&M===null&&y===null&&!b.isScheduled(),isOpening:b.isScheduled()&&!n?.source,parseError:se.parseError,openFailure:se.failure,editable:M!==null&&M.session.editable&&l.mode()!=="view"&&x!=="viewing"&&!(d$1&&lr(d$1)),zoom:ln.zoom(),zoomMode:ln.mode(),selection:bf(M),selectionCollapsed:A===null||A.selection.anchor.paragraphId===A.selection.head.paragraphId&&A.selection.anchor.offset===A.selection.head.offset,formatting:_C(M),table:xf(M),tocContext:Qc(A?.contextTocId??null),image:Xr(M),page:{current:_y(M),total:ps(M)},canUndo:A?.canUndo??false,canRedo:A?.canRedo??false,pageSetup:BC(b,M),reviewPaneOpen:sn,reviewPane:g.current(),...z.snapshot(),documentProtection:Zn.state(),revisionMarkup:Tn.markup.current(),reviewDisplayMode:M&&p?M.revisionDisplayMode():je,hasReviewContent:M?.session.hasReviewContent()??false,hiddenReviewAuthors:I.hiddenAuthorList,collaborationStatus:A?.collaborationStatus??"inactive",editingMode:x,lastRejection:T??A?.lastRejection??null,fontSubstitutions:fi(),formatPainter:A?.formatPainter??nf}}let Fr;function oo(){if(to&&ga===mr)return to;let A=to,ne=Ue()===Fr;Fr=Ue();let ie=z.chromeSettled(),Oe=c===Xe&&ie;Xe=c;let Te=M?.state().selection??null,Ve=uf(Te,Ye);Ye=Te;let Le=M?.session.packageRevision()??-1,ht=Le===gt;gt=Le;let Fe=gr(),Ge=Fe;if(A){let Ft=jh(Fe.formatting,A.formatting)?A.formatting:Fe.formatting,Ne=Vh(Fe.page,A.page)?A.page:Fe.page,We=Gh(Fe.pageSetup??null,A.pageSetup??null)?A.pageSetup:Fe.pageSetup,ct=zh(Fe.selection,A.selection)?A.selection:Fe.selection,Jt=py(Fe.image,A.image)?A.image:Fe.image,er=A.fontSubstitutions!==void 0&&Fe.fontSubstitutions!==void 0&&A.fontSubstitutions.length===Fe.fontSubstitutions.length&&Fe.fontSubstitutions.every((An,ao)=>A.fontSubstitutions[ao]===An)?A.fontSubstitutions:Fe.fontSubstitutions;Ge={...Fe,formatting:Ft,page:Ne,pageSetup:We,selection:ct,image:Jt,fontSubstitutions:er},Xh(Ge,A)&&Ve&&ht&&Oe&&ne&&(Ge=A);}return to=df(Ge),ga=mr,to}if(e.document){let A=ey(e.document);A?ro(A):(rt(on("unsupported",se.refuseSource(e.document))),Lt.openRejected("unsupported"));}let Yt=xL({surface:()=>M,activeKey:En,paneOpen:()=>sn,selectionAnchor:()=>Ks()?.anchorY??null,authorFilterKey:()=>I.stateKey});function Jc(A){return tl(A)===null||A.kind==="custom"&&!A.carded?false:!(A.kind==="revision"&&S!==null&&S.includes(A.revisionKind)&&(A.revisionKind!=="format"||v===void 0||v.includes(A.formattingKind??"")))}let Yn=I2(A=>kf(M,A)),Bt=A=>y2(M?.session,A),hi=A=>b2(M?.session,A);function vt(A){let ne=tl(A),ie=M?.publishedLayout();return !ne||!ie?null:E2(ie).get(ne.start.paragraphId)??null}function qs(A){let ne=Bt(A);return ne!==null?{kind:"headerFooter",rId:ne.rId}:hi(A)??{kind:"body"}}function ed(){return u_({surface:M,bodyOrder:()=>{let A=M?.publishedLayout();return A?C2(A):new Map},openStoryOrder:td})}function xa(){let A=M?.activeScope();if(A?.kind==="headerFooter")return {kind:"headerFooter",rId:A.rId};if(A?.kind==="note"){let ne=Ic$1(A.id);if(ne)return {kind:"notesPart",noteKind:ne.noteKind}}return {kind:"body"}}function Qt(A){if(!M)return {kind:"body"};let ne=A.indexOf("#"),ie=ne===-1?de(M.session,A)?.name:A.slice(0,ne);if(ie===void 0)return xa();if(ie.length===0||ie===M.session.part().name)return {kind:"body"};for(let Oe of M.session.headerFooterResolutionBySection())for(let Te of [Oe.headers,Oe.footers])for(let Ve of Te.values())if(Ve.partName===ie)return {kind:"headerFooter",rId:Ve.rId};for(let Oe of ["footnote","endnote"])if(qj$1(M.session.currentPackage(),Oe)?.name===ie)return {kind:"notesPart",noteKind:Oe};return xa()}function td(){if(!M)return new Map;let A=xa();if(A.kind==="body")return new Map;let ne=new Map;for(let[ie,Oe]of M.session.paragraphIdsIn(A).entries())ne.set(Oe,ie);return ne}function yi(A){if(A.kind==="revision"){let ie=A.ranges;if(ie.length===0)return null;let Te=A.revisionKind==="replace"||A.revisionKind==="insert"||A.revisionKind==="delete"?ie[ie.length-1]:ie[0];return {start:ie[0].start,end:Te.end}}let ne=tl(A);return ne?{start:ne.start,end:ne.end}:null}function Ks(){if(M&&M.activatedReviewKey()!==null)return null;let A=ed(),ne=M?.publishedLayout();if(!A||!ne)return null;let ie=Yn(ne).get(A.from.paragraphId);return ie?{pageIndex:ie.pageIndex,anchorY:ie.contentY+ad(ie,A.from.paragraphId,A.from.offset)}:null}function En(){return M?.activeReviewKey()??null}let Fo=cH(),Sa=dH();function Qn(A){if(!p)return [];let ne=I.filterItems(M?.session.reviewItems()??[]),ie=wA(ne,A),Oe=A?.placement!==false,Te=null;if(Oe&&ie.length>0){let We=M?.publishedLayout()??null;We&&(Te=Yn(We));}let Ve=zf(()=>ne,En(),E.lightsPair()),Le=We=>{let ct=Bt(We);return ct===null?1:ct.kind==="header"?0:2},ht=M?.session.packageRevision()??-1,Fe=Fo(ie,Te,ht,Le),{geometries:Ge,order:Ft}=Fe,Ne=aC(M);return Sa(ie,Te!==null,Ft.map(We=>{let ct=ie[We];return f2(ct,{anchorY:Ge[We]?.y??null,pageIndex:Ge[We]?.pageIndex??null,activatable:Gf(ct).every(Jc),isActive:Ve.size>0&&Gf(ct).some(Jt=>Ve.has(nl(Jt))),locked:Ne})}))}function Cn(){return M?.session.trackingSettings()??Yj$1}function cn(A=x,ne=C){let ie=Cn();return iy({...$(),viewOnly:l.mode()==="view",hostChoseMode:l.mode()!==void 0,readerChoseMode:ne,currentMode:A,trackRevisions:ie.trackRevisions,restrictedToTrackedChanges:ie.restrictedToTrackedChanges,restrictedToForms:ie.restrictedToForms,restrictedToReadOnly:ie.restrictedToReadOnly,restrictedToComments:ie.restrictedToComments,engineAdoptedViewing:w})}function be(A){q=null,x=A,M?.setEditingMode(A==="suggesting"?"suggest":A==="viewing"?"view":"edit"),M?.setEditable(A!=="viewing");}function Jn(A){return A!==null?A:x==="suggesting"&&c===void 0?Zr:W?Zr:C?null:l.openingModeDecision($()).rejection}function Us(){let A=cn();T=Jn(A.rejection),A.mode!==null&&(w=A.mode==="viewing",be(A.mode));}function wa(A="editing",ne=true){if(b.isScheduled()){q=A;return}q=null;let ie=JE(l.mode(),$(),Cn(),x,A,w);w=ie.mode==="viewing"&&l.mode()!=="view",ie.mode!==x&&be(ie.mode),T=Jn(ie.rejection),K.report(ie.configurationRejection),ne&&(Ce(),Ee());}function ka(A){let ne=l.mode()==="view";return QE(ne,$,Cn,A)}let hr=TH({surface:()=>M,enabled:()=>p,destroyed:()=>X,viewing:()=>x==="viewing",placements:Qn,authorVisibility:I,scope:qs,reveal:A=>pn.emitReviewItemReveal(Mb(Qn,A)),resolved:A=>{pn.hasReviewChangesResolvedHandlers()&&pn.emitReviewChangesResolved(IA(Qn,A));},activate:(A,ne)=>{k=ne??false;try{return Mn.setActiveReviewItem(A,{announce:!1})}finally{k=false;}},setDisplayMode:A=>{je=A,M?.setRevisionDisplayMode(A),Ce(),Ee();},report:{diagnostics:Lt,tracked:()=>x==="suggesting"}}),{resolveReviewItem:nd}=hr,On=Y2(()=>({mounted:!!M&&!!d$1,generation:Re}),pn.emitHistoryDiagnostic,()=>JSON.stringify(M?.state().selection)),bi=g_({reviewEnabled:p,historyGroups:On,surface:()=>M,author:()=>c,editingMode:()=>x,commentTargetRange:ed,storyScopeOfParagraph:Qt,storyScopeOfReviewItem:qs,noteHomeOf:vt,placements:Qn,resolveReviewItem:nd,bump:Ce}),Mn={beginHistoryGroup(){return b.flush(),On.begin()},get mountGeneration(){return Re},get surface(){return M},...z.popupChrome.setters,stateVersion:()=>mr,fontMeasurement:()=>({measurer:F&&!s()?"shaped":"fixed",resolving:Je||et.pending()||s(),...F&&U&&!s()?{producer:U}:{}}),async setFonts(A){if(X)throw on("destroyed","a destroyed editor cannot replace fonts");let ne=++xe;if(b.flush(),M?.flushPendingInput(),X||ne!==xe)return;let ie=Se.advance(),Oe=()=>!X&&ie.current();try{at=A,we=void 0,Je=!1,et.clear(),A||$s();}finally{ie.cancelPrevious();}let Te=Y;Oe()&&await _e.schedule(true),A&&Oe()&&Y===Te&&$s();},attach(A,ne){let ie=lR(A);if(ie)return rt(on("invalidTarget",ie));if(d$1!==A&&n?.invalidate(),X){rt(on("destroyed","this editor was destroyed; create a new instance to remount"));return}if(M&&d$1===A)return M.moveTo(A,ne);let Oe=b.cancel();if(Oe&&(Xn(),y=Oe),ln.detach(),d$1=A,He=null,M){mn(),M.moveTo(A,ne),Re+=1,mi(A.ownerDocument);return}let Te=y;y=null,Te&&b.shouldYield(Te)?b.schedule(Te):Te?ya(Te):Ce();},detach(){if(n?.invalidate(),X)return;ln.detach();let A=b.cancel();A?(Xn(),y=A):M&&(Tn.destroyDialogs(),mn(),M.park(),Re+=1),d$1=null,He=null,Ce(),Ee();},load(A){let ne=ey(A);if(!ne){let ie=M!==null||y!==null||b.isScheduled();rt(on("unsupported",se.refuseSource(A,ie))),Lt.openRejected("unsupported");return}n?.invalidate(),Lo.reset(),ro(ne);},save(){return b.flush(),VA(M,M?.hostElement()??d$1,()=>M)},getDocumentHandle(){return Object.freeze({revision:M?.session.packageRevision()??0})},exec(A,ne){let ie=wb(d$1,A)??On.gate(A,ne);if(ie)return FN(A,ie);b.flush();let Oe=Tn.exec(A);if(Oe)return Oe;let Te=z.dialog(A,true);if(Te)return Te;On.note(A);let Ve=z.capability(A);if(X&&Ve&&!Ve.ok)return Ve;if(A.type==="setEditingMode"){let ct=ka(A.mode);return ct!==null?(ct.reason===Zr&&(W=true,T=ct.reason,K.report(ct.reason),Ce(),Ee()),ct):(C=true,W=false,T=null,be(A.mode),Ce(),Ee(),{ok:true,changed:false})}let Le=z.toggle(A);if(Le)return Le;if(A.type==="toggleReviewPane")return p?(sn=!sn,Ce(),Ee(),{ok:true,changed:false}):{ok:false,code:"unsupported",reason:qt};let ht=Zn.exec(A);if(ht)return ht;let Fe=M&&(A.type==="resolveAllReviewChanges"||A.type==="setReviewChangesAuthor")?On.run(M,A,ne,()=>hr.exec(A)):hr.exec(A);if(Fe)return Fe;if(Xv(A))return XN(A,M,Yv(x),ne);let Ge=Yi(A);if(x==="viewing"&&Ge.supported&&Ge.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let Ft=lc(A,M,l.modeForGate(),ne);if(!Ft.ok)return Ft.refusal;let Ne=M,We=Ne.session.packageRevision();return On.run(Ne,A,ne,()=>{let ct=X2(Ne,A,{...Ft.tablePlan?{admittedTablePlan:Ft.tablePlan}:{},editor:Mn});return ct||{ok:true,changed:Ne.session.packageRevision()!==We}})},can(A,ne){let ie=wb(d$1,A);if(ie)return ie;let Oe=Tn.can(A);if(Oe)return Oe;let Te=z.dialog(A,false);if(Te)return Te;let Ve=On.gate(A,ne);if(Ve)return Ve;if(A.type==="insertImage"||A.type==="replaceImage"){if(X)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(ne?.scope){let Ne=lc(A,M,l.modeForGate(),ne);if(!Ne.ok)return Ne.refusal}return OC(A,M)}let Le=z.capability(A);if(Le)return Le;let ht=Zn.can(A);if(ht)return ht;let Fe=hr.can(A);if(Fe)return Fe;if(Xv(A))return Qv(A,M,Yv(x),ne);let Ge=Yi(A);if(x==="viewing"&&Ge.supported&&Ge.mutating)return {ok:false,code:"locked",reason:"the document is open for viewing"};let Ft=lc(A,M,l.modeForGate(),ne);if(!Ft.ok)return Ft.refusal;if(A.type==="replaceMatch"){let Ne=Uh(M,A.match);if(Ne)return Ne}if(A.type==="proposeInsertion"||A.type==="proposeDeletion"||A.type==="proposeReplacement"){if(!(A.author??c??"").trim())return {ok:false,code:"invalidArgs",reason:`${A.type} requires a non-empty author`};let We=A.target===void 0?{ok:true,selection:M.state().selection}:Gp(M,A.target);if(!We.ok)return We;let{anchor:ct,head:Jt}=We.selection,er=ct.paragraphId===Jt.paragraphId&&ct.offset===Jt.offset,An=A.type==="proposeReplacement"&&A.target===void 0&&M.state().cellSelection!==null;if(A.type!=="proposeInsertion"&&er&&!An)return {ok:false,code:"invalidArgs",reason:`${A.type} needs a non-collapsed selection`}}if(ic(A)&&Sy(A)){let Ne=ac(Mn);if(Ne){let We=wy(Mn,A,Ne);if(We)return We}}return {ok:true}},isActive(A){let ne=z.isActive(A);return ne!==null?ne:A.type==="toggleDocumentProtection"?Zn.isActive():A.type==="setReviewDisplayMode"?je===A.mode:A.type==="toggleReviewPane"?sn:A.type==="setEditingMode"?x===A.mode:HH(A,M?oo().formatting:null,ie=>M?.isListActive(ie)??false)},getDocumentStyles:()=>M?.session.documentStyles()??[],getDocumentFonts:st,getAvailableFonts:()=>P_(Ue(),st(),an),getDocumentThemeColors:()=>M?.session.documentThemeColors()??[],getOutline:()=>M?.session.documentOutline()??[],getComments:()=>[],getSelectionFormatting:()=>VC(M?oo().formatting:null),findMatches:((A,ne)=>WH(M,x,Lo.noteMatches,A,ne)),selectMatch(A){return b.flush(),M?$H(M,A):{ok:false,code:"notFound",reason:"no document is loaded"}},getSelectedImage:()=>oo().image,getSelectedTable:()=>UC(M),getTableCellSelection:()=>{let A=M?.state().cellSelection;return A?{tableId:A.tableId,rows:A.rows,columns:A.columns,cellIds:A.cellIds}:null},setTableInteractionLabel(A){M?.setTableInteractionLabel(A);},canExecuteImageCommand(A,ne){if(X)return {ok:false,code:"notFound",reason:"the editor was destroyed"};if(ne?.scope){let ie=lc(A,M,l.modeForGate(),ne);if(!ie.ok)return ie.refusal}return Iy(A,M)},executeImageCommand(A){return X?Promise.resolve({ok:false,code:"notFound",reason:"the editor was destroyed"}):Py(Mn,A)},getPageSetup:()=>Hy(M),getWatermark:()=>cf(M),getTrackedChanges:()=>(M?.session.reviewItems()??[]).filter(A=>A.kind==="revision").map(A=>{let ne=Bt(A);return {id:A.id,kind:A.kind==="revision"?A.revisionKind:"revision",...A.kind==="revision"&&A.author?{author:A.author}:{},story:ne!==null?ne.kind:hi(A)?.noteKind??"body"}}),getReviewItems:A=>Qn(A),getCustomNodeDefinitions:()=>u.customNodes,reportCustomNodeDiagnostic:f,...bi,getSelectionPlacement:()=>Ks(),isReviewPaneOpen:()=>sn,getEditingMode:()=>x,getReviewAuthors:()=>R.authorsFor(M?.revisionAuthors()??K_),...wL(I,{enabled:p,surface:()=>M,notify:()=>{Ce(),Ee();}}),setTrackedChangesFilter(A,ne){if(M)return M.setTrackedChangesFilter(A,ne);I.setPredicate(A,ne)&&(Ce(),Ee());},getConfiguredAuthor:()=>c??null,setAuthor(A){let ne=qb(A);if(c!==ne){if(c=ne,M?.setAuthor(c),c!==void 0&&W){W=false;let ie=XE(ka("suggesting"));if(ie.enter)C=true,be("suggesting");else {T=ie.rejection,Ce(),Ee();return}}else if(!C){let ie=q??x;wa(l.mode()===void 0?ie:"editing");return}T=Jn(null),K.report(T),Ce(),Ee();}},setMode(A){l.setMode(A)&&(C=false,W=false,wa());},...G_(l,{surface:()=>M,bump:Ce,emitSelectionChange:Ee}),presenceColorFor:A=>M?.remotePresenceColor(A)??"var(--doc-accent)",collaborationSession:()=>M?.collaborationSession()??null,getReviewAuthorStyle:A=>R.styleFor(A),setOpeningIndicatorHost:fe.set,setRemoteCaretLabelHost(A){J=A,M?.setRemoteCaretLabelHost(A);},setReviewPaneOptions:g.set,setRevisionMarkup:Tn.markup.set,setRevisionMarkupChrome:Tn.markup.register,setCompareDocumentsChrome:Tn.compare.register,setUnsupportedElementRules:ee.set,setRevisionStyles(A){R.set(A),M?.setRevisionStyles(A),Ce(),Ee();},setEditingMode:A=>Mn.exec({type:"setEditingMode",mode:A}),getReviewRevision:()=>Yt(),getActivatedReviewItemKey:A=>Ob(Qn,M?.activatedReviewKey()??null,A),setActiveReviewItem(A,ne){if(A===null)return M?.dismissActiveReview(),Ce(),Ee(),{ok:true,changed:false};if(!M)return {ok:false,code:"notFound",reason:"no document is open"};M.flushPendingInput();let ie=Yr(Qn,A)?.item;if(!ie)return {ok:false,code:"notFound",reason:"no review item with that key"};let Oe=xs(ie),Te=E.set(Oe?nl(Oe.deletion):null)??A,Ve=tl(ie);if(!Ve)return {ok:false,code:"unsupported",reason:"this review item has no resolvable range"};if(!Gf(ie).every(Jc)&&!(k&&ie.kind==="revision"&&ie.revisionKind==="format"))return {ok:false,code:"unsupported",reason:PH(ie)};let Le=ie?Bt(ie):null,ht=Le===null&&ie?vt(ie):null;if(Le!==null||ht!==null){let Fe=Le!==null?{kind:"headerFooter",rId:Le.rId,furnitureKind:Le.kind}:{kind:"note",id:ht},Ge=qp(M,Fe,Ve.start);if(!Ge.ok)return Ge}else {rO(M,(yi(ie)??Ve).start);let Fe=yi(ie)??Ve,Ge={paragraphId:Fe.start.paragraphId,offset:Fe.start.offset};M.activateReview(Te,{anchor:Ge,head:Ge},{allowExcluded:k,preventScroll:true});let Ft=ne?.reveal??"centerIfNeeded";Ft!==false&&M.revealPosition?.(Fe.start,{block:Ft});}return (Le!==null||ht!==null)&&M.activateReview(Te,void 0,{allowExcluded:k}),Ce(),Ee(),ne?.announce===true&&pn.emitReviewItemReveal(Mb(Qn,{key:A,source:"host"})),{ok:true,changed:false}},setReviewActivationExclusions(A,ne){S=A===null?null:[...A],v=ne?.formattingKinds?[...ne.formattingKinds]:void 0,M?.setReviewActivationExclusions(S,{formattingKinds:v});},getHeaderFooterState:()=>M?.headerFooterState()??null,getNotePropertiesState:()=>M?.notePropertiesState?.()??null,getNotePreviewText:A=>M?.notePreviewText?.(A)??null,setActiveScope(A){M?.setActiveScope(A)&&Ce();},getActiveScope:()=>M?.activeScope()??{kind:"body"},query:A=>QN(M,()=>oo().formatting,A),snapshot:()=>oo(),getTotalPages:()=>ps(M),getCurrentPage:A=>_y(M,A),...qH(()=>M,()=>b.flush(),()=>d$1),...VH(()=>Mn,()=>n,()=>b.flush()),...q_(ln,()=>M),...Lo.members,...u2({frame:Lo.frame,placements:Qn}),relayout(A){A?.sync,M?.layout();},retainSelection:()=>d$1?M?.retainSelection()??null:null,releaseSelection:A=>M?.releaseSelection(A),focus(A){return b.flush(),M?A&&A.kind==="all"?{ok:false,code:"invalidTarget",reason:"the all scope cannot take focus"}:A&&!M.setActiveScope(A)?{ok:false,code:"invalidTarget",reason:"that scope cannot be opened"}:(M.focus(),{ok:true,value:void 0}):{ok:false,code:"invalidTarget",reason:"no document is loaded"}},destroy(){n?.invalidate(),X=true,Se.dispose(),et.clear(),K.dispose(),b.cancel(),ln.detach(),oe(),Y(),Y=()=>{},Xn(),d$1=null,y=null,h=new WeakMap,Re+=1,Ce(),Lt.dispose(),pn.clear();},on:pn.on};n=lH(Mn,{surface:()=>M,container:()=>d$1,collaboration:()=>u.collaboration!==null,load:ro,changed:()=>{Ce(),Ee();},cancelLoad:()=>{r=null,o$1=null,b.cancel();}}),Lt.attach(Mn,ha);let io=pi.methods(Mn);return sR(io,()=>d$1),w_(io,On,u.review?.compareDocuments),EN(io,z.popupChrome),mn=()=>iH(io),oH(io,{deferEvents:pn.defer,displayOptions:ba,changed:()=>{Ce(),Ee();}}),io}var z_=Object.freeze({document:true,save:true,events:true,selection:true,scrolling:true,layout:true});function pz(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 mz(e){let t,n=u$1({port:gz(e,()=>t),capabilities:z_}),r=false,o=i=>(r||e.surface?.flushPendingInput(),wN(e,()=>n.execute(i)));return {...n,save:()=>{try{return n.save()}catch(i){return {ok:false,error:{code:"transaction-refused",message:i instanceof Error?i.message:"Cannot save the document."}}}},dispose:()=>{r=true,n.dispose();},execute:o,beginHistoryGroupRun:i=>{let a=r?null:x_(e,i);if(a===null)return null;let s=false;return {execute:l=>{if(s||r||!S_(e,i))return null;let c=t;t=a;try{return o(l)}finally{t=c;}},finish:()=>{s||(s=true,a.finish());}}}}}function gz(e,t){let n=(u,f)=>{let p=t();return p===void 0?f():p.bind(u,f)},r=0,o=0,i=null,a=false,s=false,l=()=>{if(s)return null;let u=e.surface?.session??null;return u!==i&&(a&&(r+=o+1),a=true,i=u,o=0),u&&(o=u.packageRevision()),u},c,d=null;return {localChangeTracking:true,suggesting:()=>e.surface?.editingMode()==="suggest",async prepare(u){if(!u.operations.some(g=>g.op==="updateFieldResult"))return;c=void 0,d=null;let f=e.surface;if(!f)return;ri(f);let p=f.layout();c=r$1(p),d=l()?.currentPackage()??null;},fieldPageContext(u,f,p){let g=l()?.currentPackage()??null;if(!g||g!==d)return null;let y=q(g).story(u);return y?s$2(c,y.part,f,p):null},revision(){return l(),r+o},currentPackage:()=>l()?.currentPackage()??null,revisionDisplayMode:()=>e.surface?mb$1(e.surface.revisionDisplayMode()):Vh$1,collaborative:()=>!!e.surface?.collaborationSession(),...hz(e),setupOutsideUndo:()=>true,allocationActor:()=>e.surface?.collaborationSession()?.identity.actorId,trackedRangeReplacement:()=>!e.surface?.collaborationSession(),replacementLanding:(u,f,p)=>e.surface?.replacementLanding(u,f,p)??null,apply(u,f,p=[],g=false){if(l(),Ns(e))return {ok:false,reason:Cr};let y=e.surface;if(!y)return {ok:false,reason:"no-document"};let h=n(y,()=>y.applyAutomationOps(u,f,p,g));return h.rejected?{ok:false,reason:Ls(h.reason)}:{ok:true,changed:h.committed}},applyLifecycle(u){if(l(),Ns(e))return {ok:false,reason:Cr};let f=e.surface;if(!f)return {ok:false,reason:"no-document"};let p=n(f,()=>f.applyAutomationOps(()=>[u]));return p.rejected?{ok:false,reason:Ls(p.reason)}:{ok:true,changed:p.committed}},applyCommentWrites(u,f){let p=e.surface,g=l();if(!p||!g)return {ok:false,reason:"no-document"};if(Ns(e))return {ok:false,reason:Cr};if(u.length===0)return {ok:true,changed:false};if(f.kind!=="body")return {ok:false,reason:"unsupported-story"};let y=e.can({type:"toggleReviewPane"});if(!y.ok)return {ok:false,reason:Ls(y.reason??"review-module-required")};if(u.length!==1&&!u.every(x=>x.kind==="delete"))return {ok:false,reason:"mixed-comment-writes"};let h=null,b=n(p,()=>p.commitReviewOps(x=>{if(u.every(k=>k.kind==="delete")){let k=u.find(I=>I.kind==="delete"),E=g.deleteComments(u.map(I=>{if(I.kind!=="delete")throw new Error("unreachable mixed comment write");return {commentId:I.commentId,...I.parentCommentId===void 0?{}:{parentCommentId:I.parentCommentId}}}),f,k?.kind==="delete"?k.noteId:void 0,{historyToken:x});return h=E?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:E}}if(u.length!==1)return h={ok:false,reason:"mixed-comment-writes"},{committed:false};let S=u[0];if(S.kind==="resolve"){let k=g.setCommentResolved(S.commentId,S.resolved,{historyToken:x});return h=k?{ok:true,changed:true}:{ok:false,reason:"unknown-comment"},{committed:k}}if(S.kind!=="create"&&S.kind!=="reply")return h={ok:false,reason:"unsupported-comment-write"},{committed:false};let v=g.replyToComment(S.kind==="reply"?S.parentCommentId:null,S.anchor,S.text,S.author,S.date,void 0,void 0,{historyToken:x});return h=v===null?{ok:false,reason:"refused"}:{ok:true,changed:true,commentId:v},{committed:v!==null}},pz(u)));return h??{ok:false,reason:Ls(b??"refused")}},applyCustomNodeWrite(u,f){let p=e.surface,g=l();if(!p||!g)return {ok:false,reason:"no-document"};if(Ns(e))return {ok:false,reason:Cr};if(f.kind!=="body")return {ok:false,reason:"unsupported-story"};let y=null,h=n(p,()=>p.commitReviewOps(b=>{let x=g.insertCustomNode(u,void 0,{historyToken:b});return y=x.ok?{ok:true,changed:x.change!==null}:{ok:false,reason:x.detail?`${x.reason}: ${x.detail}`:x.reason},{committed:x.ok}},"package-scoped"));return y??{ok:false,reason:Ls(h??"refused")}},save:()=>l()?e.surface?.save()??null:null,selectRefusal(u,f){if(u.kind==="body")return null;let p=e.surface;return p?.editingMode()==="view"?"a read-only editor does not open a header, footer or note to select in it":p&&!Se(p.layout(),{paragraphId:f,offset:0})?"that header, footer or note is not shown on any page":null},select(u,f){if(!e.surface)return false;let g=f==="end"?u.end:u.start,y=f==="start"?u.start:u.end;return e.exec({type:"setSelection",range:{anchor:{paragraphId:g.paragraphId,offset:g.offset},head:{paragraphId:y.paragraphId,offset:y.offset}}}).ok},subscribe:u=>e.on("change",()=>u()),dispose(){s=true,i=null;}}}function hz(e){let t=b_(e);return t?{compareDocuments:t}:{}}function Ex(e){let t=e?.closest(".docx-editor")??null;for(;t&&!t.querySelector(".docx-pages");)t=t.parentElement?.closest(".docx-editor")??null;return t}function yz(e){let t=e.popup.ownerDocument,n=r=>{if(r.key!=="Escape"||r.isComposing||r.keyCode===229||e.skip?.(r))return;let o=r.composedPath(),i=o[0]??r.target,a=wo(i)?i:null,s=a!==null&&e.contains(a);if(!s&&Z_(a,e.popup))return;let l=[Ex(e.popup),e.chromeRoot?.(),...e.editorElements?.()??[]],c=s||l.some(d=>d!=null&&o.includes(d));e.close(s),c&&(r.preventDefault(),r.stopPropagation());};return t.addEventListener("keydown",n,true),()=>t.removeEventListener("keydown",n,true)}function Z_(e,t){let r=(Wt(e)?e:e?.parentElement??null)?.closest('[aria-modal="true"], [data-docx-modal]');return r?r.hasAttribute("data-docx-dialog")||r.hasAttribute("data-docx-modal")?true:Ex(t)?.contains(r)===true:false}var bz='[aria-expanded="true"], [role="menu"], [role="listbox"], [role="dialog"]';function vz(e){return e?.querySelector(bz)!=null}function xz(e){let t=e.popup.ownerDocument,n=r=>{let o=r.composedPath()[0]??r.target;if(!wo(o)||e.contains(o))return;let i=Wt(o)?o:o.parentElement;i===null||i===t.body||i===t.documentElement||i.closest(".docx-pages")||Z_(i,e.popup)||e.close();};return t.addEventListener("focusin",n,true),()=>t.removeEventListener("focusin",n,true)}function Sz(e){let t=e.popup,n=Wi(t),r=e.contains??(i=>t?.contains(i)===true),o=i=>{let a=i.composedPath();(a.length>0?a:[i.target]).some(l=>wo(l)&&r(l))||e.close(i);};return n.addEventListener("pointerdown",o,true),()=>n.removeEventListener("pointerdown",o,true)}function wz(e){return e*(96/72)}function kz(e,t){return e*t}function Iz(e,t){return e/t}function Rz(e,t,n){let r=e.pages.find(a=>a.index===t.pageIndex)??e.pages[t.pageIndex];if(!r)return {left:0,top:0,width:0,height:0};let o=n.pageOffsetX.get(r.index)??0,i=n.paintScale;return Object.freeze({left:(r.contentBox.x+t.x+o)*i,top:(r.contentBox.y+t.y)*i,width:t.width*i,height:t.height*i})}function Pz(e){return Object.freeze(e?{left:e.offsetLeft,top:e.offsetTop}:{left:0,top:0})}function Y_(e,t,n,r=false){return t?true:e.length===1?false:r?n:!n}var X_=["e","se","s","sw","w","nw","n","ne"];function Tz(e,t){let n=X_.indexOf(e);t.flipHorizontal&&(n=(4-n+8)%8),t.flipVertical&&(n=(8-n)%8);let r=Math.round(t.rotationDegrees/45)%8;return X_[(n-r+8)%8]}function Ez(e,t,n){let r=e,o=t,i=-n.rotationDegrees*Math.PI/180,a=Math.cos(i),s=Math.sin(i),l=r*a-o*s,c=r*s+o*a;return r=l,o=c,n.flipHorizontal&&(r=-r),n.flipVertical&&(o=-o),Object.freeze({x:r,y:o})}function ma(e){return e/12700}function Q_(e){let t=Ez(e.deltaXPt,e.deltaYPt,e.transform),n=ma(e.startWidthEmu),r=ma(e.startHeightEmu),o=n/r,i=Tz(e.handle,e.transform),a=i.includes("e")?t.x:i.includes("w")?-t.x:0,s=i.includes("s")?t.y:i.includes("n")?-t.y:0;if(n=Math.max(1,n+a),r=Math.max(1,r+s),e.preserveAspect)if(i.length===2){let v=Math.max(n/ma(e.startWidthEmu),r/ma(e.startHeightEmu));n=Math.max(1,ma(e.startWidthEmu)*v),r=Math.max(1,n/o);}else i==="e"||i==="w"?r=Math.max(1,n/o):n=Math.max(1,r*o);let l=ma(e.startWidthEmu),c=ma(e.startHeightEmu),d=n/l,u=r/c,f=e.kind==="inline"&&Math.abs(e.transform.rotationDegrees%180)===90,p=Math.max(1,f?e.startBounds.width+r-c:e.startBounds.width*d),g=Math.max(1,f?e.startBounds.height+n-l:e.startBounds.height*u),y=e.startBounds.x,h=e.startBounds.y,b=e.handle;b.includes("w")&&(y=e.startBounds.x+e.startBounds.width-p),b.includes("n")&&(h=e.startBounds.y+e.startBounds.height-g);let x=null;if(e.kind==="anchored"&&e.startPosition&&(b.includes("w")||b.includes("n")||e.anchorFrameOrigin&&(e.startPosition.horizontalEmu===void 0&&n!==l||e.startPosition.verticalEmu===void 0&&r!==c)))if(e.startPosition.mode==="simple"){let S=b.includes("w")?At(y-e.startBounds.x):0,v=b.includes("n")?At(h-e.startBounds.y):0;x=Object.freeze({mode:"simple",horizontalEmu:(e.startPosition.horizontalEmu??0)+S,verticalEmu:(e.startPosition.verticalEmu??0)+v});}else if(e.anchorFrameOrigin)x=Object.freeze({mode:"frame",...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{},...b.includes("w")||e.startPosition.horizontalEmu===void 0&&n!==l?{horizontalEmu:At(y-e.anchorFrameOrigin.x)}:e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu}:{},...b.includes("n")||e.startPosition.verticalEmu===void 0&&r!==c?{verticalEmu:At(h-e.anchorFrameOrigin.y)}:e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu}:{}});else {let S=b.includes("w")?At(y-e.startBounds.x):0,v=b.includes("n")?At(h-e.startBounds.y):0;x=Object.freeze({mode:"frame",...e.startPosition.horizontalEmu!==void 0?{horizontalEmu:e.startPosition.horizontalEmu+S}:{},...e.startPosition.verticalEmu!==void 0?{verticalEmu:e.startPosition.verticalEmu+v}:{},...e.startPosition.relativeToH!==void 0?{relativeToH:e.startPosition.relativeToH}:{},...e.startPosition.relativeToV!==void 0?{relativeToV:e.startPosition.relativeToV}:{}});}return Object.freeze({widthEmu:At(n),heightEmu:At(r),previewBounds:Object.freeze({x:y,y:h,width:p,height:g}),position:x})}function Cz(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 Oz(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&&hf(e.session.startPosition.mode==="frame"&&e.anchorFrameOrigin?{...e.session.startPosition,horizontalEmu:e.session.startPosition.horizontalEmu??At(e.session.startBounds.x-e.anchorFrameOrigin.x),verticalEmu:e.session.startPosition.verticalEmu??At(e.session.startBounds.y-e.anchorFrameOrigin.y)}:e.session.startPosition,e.deltaXPt,e.deltaYPt+e.accumulatedScrollPt);return Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:Object.freeze({x:t,y:n,width:e.session.startBounds.width,height:e.session.startBounds.height}),position:r??null})}return e.session.handle?Q_({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:Y_(e.session.handle,e.aspectLocked,e.shiftKey,e.textbox),kind:e.session.kind}):Object.freeze({widthEmu:e.session.startWidthEmu,heightEmu:e.session.startHeightEmu,previewBounds:e.session.startBounds,position:null})}var J_=e=>Math.round(e/1440*100)/100,Mz=e=>J_(e).toLocaleString(void 0,{maximumFractionDigits:2}),Az=e=>Math.round(e*1440),Lz={left:"dialogs.paragraph.tabAlignLeft",center:"dialogs.paragraph.tabAlignCenter",right:"dialogs.paragraph.tabAlignRight",decimal:"dialogs.paragraph.tabAlignDecimal",bar:"dialogs.paragraph.tabAlignBar"},e8=e=>e===null||e===0?"none":e<0?"hanging":"firstLine",t8=(e,t)=>e==="none"?0:e==="hanging"?-Math.abs(t):Math.abs(t);function Fz(e){let t=e.indentFirstLineTwips;return {alignment:e.alignment??"left",direction:e.direction??"ltr",indentLeft:e.indentLeftTwips??0,indentRight:e.indentRightTwips??0,special:e8(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 n8={contextualSpacing:false,keepNext:false,keepLines:false,widowControl:false,pageBreakBefore:false,tabStops:false,alignment:false,direction:false,indentLeft:false,indentRight:false,special:false,spaceBefore:false,spaceAfter:false,lineSpacing:false};function Dz(e){return {contextualSpacing:e.contextualSpacing===null,keepNext:e.keepNext===null,keepLines:e.keepLines===null,widowControl:e.widowControl===null,pageBreakBefore:e.pageBreakBefore===null,tabStops:e.disagrees.tabStops,alignment:e.disagrees.alignment,direction:e.disagrees.direction,indentLeft:e.disagrees.indentLeft||e.indentUnknown,indentRight:e.disagrees.indentRight||e.indentUnknown,special:e.disagrees.indentFirstLine||e.indentUnknown,spaceBefore:e.disagrees.spaceBeforePt,spaceAfter:e.disagrees.spaceAfterPt,lineSpacing:e.disagrees.lineSpacing}}function r8(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 Nz(e,t,n=n8,r=n){let o={},i=false,a=(c,d)=>{o[c]=d,i=true;},s=c=>n[c]&&!r[c];(e.direction!==t.direction||s("direction"))&&a("direction",t.direction);let l=!n.direction&&!n.alignment&&e.direction!==t.direction&&t.alignment===o8(e.alignment);return (e.alignment!==t.alignment&&!l||s("alignment"))&&a("alignment",t.alignment),(e.indentLeft!==t.indentLeft||s("indentLeft"))&&a("indentLeftTwips",t.indentLeft),(e.indentRight!==t.indentRight||s("indentRight"))&&a("indentRightTwips",t.indentRight),(e.special!==t.special||e.specialBy!==t.specialBy||s("special"))&&a("indentFirstLineTwips",t8(t.special,t.specialBy)),(e.spaceBefore!==t.spaceBefore||s("spaceBefore"))&&a("spaceBeforePt",t.spaceBefore),(e.spaceAfter!==t.spaceAfter||s("spaceAfter"))&&a("spaceAfterPt",t.spaceAfter),!r.lineSpacing&&(e.lineRule!==t.lineRule||e.lineValue!==t.lineValue||s("lineSpacing"))&&a("lineSpacing",{rule:t.lineRule,value:t.lineValue}),(e.contextualSpacing!==t.contextualSpacing||s("contextualSpacing"))&&a("contextualSpacing",t.contextualSpacing),(e.keepNext!==t.keepNext||s("keepNext"))&&a("keepNext",t.keepNext),(e.keepLines!==t.keepLines||s("keepLines"))&&a("keepLines",t.keepLines),(e.widowControl!==t.widowControl||s("widowControl"))&&a("widowControl",t.widowControl),(e.pageBreakBefore!==t.pageBreakBefore||s("pageBreakBefore"))&&a("pageBreakBefore",t.pageBreakBefore),(!r8(e.tabStops,t.tabStops)||s("tabStops")&&t.clearedAllTabStops)&&a("tabStops",t.tabStops),i?o:null}function o8(e){return e==="left"?"right":e==="right"?"left":e}function Hz(e,t){return [...e.filter(r=>r.positionTwips!==t.positionTwips),t].sort((r,o)=>r.positionTwips-o.positionTwips)}function _z(e,t){if(t.key!=="Tab")return false;let n=[...e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')].filter(a=>!a.hasAttribute("disabled")&&a.tabIndex!==-1);if(n.length===0)return false;let r=n[0],o=n[n.length-1],i=e.ownerDocument.activeElement;return t.shiftKey&&(i===r||i===e)?(o.focus(),true):!t.shiftKey&&i===o?(r.focus(),true):false}var Bz=63;function i8(e){return /^\d{1,3}$/.test(e.trim())?Number(e.trim()):null}function $z(e,t,n){let r=n?.maxCols??63,o=n?.maxRows??63,i=i8(e),a=i8(t);return i===null||i<1||i>r?{counts:null,problem:{kind:"range",field:"columns",max:r}}:a===null||a<1||a>o?{counts:null,problem:{kind:"range",field:"rows",max:o}}:i*a<2?{counts:null,problem:{kind:"oneCell"}}:{counts:{rows:a,cols:i},problem:null}}function Wz(e,t){let n=[[1,2],[2,1],[e?.maxRows??2,1]];for(let[r,o]of n)if(r*o>=2&&t({type:"splitCell",rows:r,cols:o}).ok)return {columns:String(o),rows:String(r)};return {columns:"2",rows:"1"}}function qz(e,t,n){let r,o=false,i,a=nt(()=>t),s,l=new Set,c=[],d=()=>{a.clearTimeout(s),s=void 0,r?.end(),r=void 0,i=void 0,l.clear();},u=()=>{if(o)throw new Error("history group binding was disposed");return (!r||r.state==="closed")&&(r=e.beginHistoryGroup()),r},f=()=>{d(),u();},p=()=>{let h=r;i=void 0,l.clear(),a.clearTimeout(s),s=a.setTimeout(()=>{r===h&&d();},0);},g=(h,b,x,S=false)=>{h.addEventListener(b,x,S),c.push(()=>h.removeEventListener(b,x,S));},y=h=>n.kind==="native-color"?h==="Enter"||h===" ":["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","PageUp","PageDown"," ","Enter"].includes(h);if(g(t,"pointerdown",h=>{let b=h;if(!(b.button!==0||n.kind==="keyboard")&&(f(),i=b.pointerId,n.kind!=="native-color"))try{t.setPointerCapture?.(b.pointerId);}catch{}},true),g(t,"keydown",h=>{let b=h;if(b.key==="Escape"){p();return}!y(b.key)||b.altKey||b.ctrlKey||b.metaKey||(!b.repeat&&l.size===0&&f(),l.add(b.key),u());},true),g(t.ownerDocument,"keyup",h=>{let b=h.key;l.delete(b)&&n.kind!=="native-color"&&l.size===0&&p();},true),n.kind!=="native-color")for(let h of ["pointerup","pointercancel","lostpointercapture"])g(h==="lostpointercapture"?t:t.ownerDocument,h,b=>{i!==void 0&&b.pointerId===i&&p();},true);return g(t,"input",()=>{s!==void 0?f():u();},true),g(t,"change",()=>{(n.kind==="native-color"||i===void 0&&l.size===0)&&p();}),g(t,"blur",p,true),t.ownerDocument.defaultView&&g(t.ownerDocument.defaultView,"blur",p),{options:()=>({historyGroup:u()}),dispose(){if(!o){o=true,d();for(let h of c)h();}}}}var s8=Object.freeze([1,1.15,1.5,2,2.5,3]);function Kz(e){return Number.isInteger(e*10)?e.toFixed(1):String(e)}function a8(e,t,n){let r=e.rule==="multiple";return {spacing:e,command:t?null:{type:"setLineSpacing",rule:e.rule,value:e.value},text:r?Kz(e.value):String(e.value),labelKey:r?null:e.rule==="exact"?"lineSpacing.exactlyPoints":"lineSpacing.atLeastPoints",selected:t,preset:n}}function Uz(e){let t=s8.map(o=>a8({rule:"multiple",value:o},e?.rule==="multiple"&&e.value===o,true));if(!e||t.some(o=>o.selected))return t;let n=a8(e,true,false);if(e.rule!=="multiple")return [n,...t];let r=t.findIndex(o=>o.spacing.value>e.value);return t.splice(r===-1?t.length:r,0,n),t}function jz(e,t,n){let r={minimumFractionDigits:t,maximumFractionDigits:2};try{return new Intl.NumberFormat(n,r).format(e)}catch{return new Intl.NumberFormat("en",r).format(e)}}function Vz(e,t,n){let r=n===void 0?e.text:jz(e.spacing.value,e.spacing.rule==="multiple"?1:0,n);return e.labelKey?t(e.labelKey).replace("{value}",r):r}var ui=class extends Error{code;constructor(t,n){super(`Document capture failed: ${t}.`,{cause:n}),this.name="DocumentRefreshError",this.code=t;}};function l8(e){return JSON.stringify([e.revisionKind,e.author,e.date,e.text,e.replacedText])}function c8(e){return new Map(e.surface()?.session.reviewItems().filter(t=>t.kind==="revision").map(t=>[t.id,l8(t)]))}function d8(e,t,n,r){let o=e.surface();if(!o)return {located:[],available:false};let i=o.session.part(),a=d$2(i),s=o.session.paragraphAnchors().paraIdByNode,l=new Map,c=new Map;a.forEach((g,y)=>{c.set(g.id,y);let h=s.get(g.id);if(h){let b=h.toUpperCase();l.set(b,l.has(b)?null:g);}});let d=new Set(o.layout().pages.flatMap(g=>Ka$1(g).map(y=>y.paragraphId))),u=(g,y=JSON.stringify([typeof g.location?.text=="string"?g.location.text:null,g.unavailableReason,g.description]))=>{let h={id:g.id,resultId:t,isNew:r.get(g.id)!==y,...g.description!==void 0?{description:g.description}:{}};if(!g.location)return {fingerprint:y,change:{...h,status:g.unavailableReason??"unavailable",diagnostic:Object.freeze({code:g.unavailableReason==="deleted"?"deleted":"missing-location"})}};let b=g.location,x=E=>({fingerprint:y,change:{...h,status:"invalid",diagnostic:Object.freeze({code:E,location:Object.freeze({...b})})}});if(b.paragraphId===void 0==(b.paragraphIndex===void 0)||b.paragraphIndex!==void 0&&(!Number.isSafeInteger(b.paragraphIndex)||b.paragraphIndex<0))return x("invalid-selector");if(b.paragraphId!==void 0&&(typeof b.paragraphId!="string"||!vb(b.paragraphId)))return x("invalid-paragraph-id");let S=b.paragraphId!==void 0?l.get(b.paragraphId.toUpperCase()):a[b.paragraphIndex];if(S===null)return x("ambiguous-paragraph-id");if(!S)return x("paragraph-not-found");let v=S?Km(i,S.id)??"":"";if(!Number.isSafeInteger(b.start)||!Number.isSafeInteger(b.end)||b.start<0||b.end<=b.start||b.end>v.length)return x("invalid-offsets");if(v.slice(b.start,b.end)!==b.text)return x("text-mismatch");let k=d.has(S.id);return {fingerprint:y,change:{...h,status:k?"available":"unavailable",location:Object.freeze({...b}),...k?{}:{diagnostic:Object.freeze({code:"not-rendered",location:Object.freeze({...b})})}},...k?{paragraphId:S.id,offset:b.start}:{}}};if(n)return {located:n.map(g=>u(g)),available:true};let f=o.session.reviewItems().filter(g=>g.kind==="revision");return {located:f.map(g=>{let y=l8(g),h=g.ranges[0];if(!h||h.partName!==i.name)return {fingerprint:y,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==y,status:h?"unsupported-story":"unavailable",diagnostic:Object.freeze({code:h?"unsupported-story":"missing-location"})}};let b=c.get(h.start.paragraphId)??-1;if(g.revisionKind==="delete"||g.revisionKind==="moveFrom")return {fingerprint:y,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==y,status:"deleted",diagnostic:Object.freeze({code:"deleted"})}};if(h.start.paragraphId!==h.end.paragraphId)return {fingerprint:y,change:{id:g.id,resultId:t,isNew:r.get(g.id)!==y,status:"unavailable",diagnostic:Object.freeze({code:"multiple-paragraphs"})}};let x=Km(i,h.start.paragraphId)??"",S={paragraphIndex:b,start:h.start.offset,end:h.end.offset,text:x.slice(h.start.offset,h.end.offset)};return u({id:g.id,location:S},y)}),available:f.length>0}}var u8=new WeakMap,Gz=0;function zz(e){let t=u8.get(e);if(t)return t;let n=sH(e),r=`refresh-${++Gz}`,o=0,i=null,a=new AbortController,s=false,l=Promise.resolve(),c=null,d=[],u=null,f=new Set,p=new Set,g=Object.freeze({phase:"idle",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false}),y=I=>{g=Object.freeze({...g,...I});for(let R of f)try{R();}catch{}},h=Up(e,n,{marker:"data-docx-refresh-highlight",defaultColor:"var(--doc-refresh-highlight-color)"},()=>{g.highlightsVisible&&y({highlightsVisible:false});}),b=(I,R)=>{R&&y({phase:R,result:I,recoveryAvailable:c!==null});for(let O of p)try{O(I);}catch{}return I},x=(I,R,O)=>({ok:false,resultId:I,code:R,...O===void 0?{}:{recovered:O}}),S=()=>n.collaboration()?"collaboration":!n.surface()||!n.container()||e.snapshot().isOpening?"unavailable":null,v=()=>{o++,i=null,a.abort(),a=new AbortController,d=[],u=null,h.clear();};n.invalidated.add(()=>{v(),c=null,y({phase:"idle",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false});}),e.on("change",I=>{I.source||u===null||n.revision===u||(d=[],h.clear(),u=null,y({changes:[],highlightsVisible:false}));});let k=async I=>{let R=n.surface(),O=n.container();if(!R||!O)throw new Error("unavailable");qf(R)&&await new Promise((T,$)=>{let W=()=>{O.removeEventListener("compositionend",q),I.removeEventListener("abort",K);},q=()=>{W(),T();},K=()=>{W(),$(new Error("cancelled"));};O.addEventListener("compositionend",q),I.addEventListener("abort",K,{once:true}),I.aborted&&K();});let C=Oc(O);if(C&&await C,I.aborted||n.surface()!==R)throw new Error("document-changed");let w=R.save();if(n.surface()!==R)throw new Error("document-changed");return {bytes:w,revision:n.revision}},E={async capture(){let I=S();if(c)throw new ui("recovery-failed");if(I||s)throw new ui(I??"busy");v(),c=null;let R=o,O=n.epoch,C=a.signal;y({phase:"capturing",result:null,changes:[],highlightsVisible:false,recoveryAvailable:false});try{let w=await k(C);if(R!==o||O!==n.epoch)throw new Error("superseded");let T=Object.freeze({id:`${r}-${R}`,bytes:w.bytes.slice().buffer});return i={token:T,epoch:O,revision:w.revision,sequence:-1,seen:c8(n)},y({phase:"processing"}),T}catch(w){throw R===o&&y({phase:"failed"}),new ui(R===o?"input-failed":"superseded",w)}},applyUpdate(I){let R=`${I.submission?.id??"unknown"}:${I.sequence}`,O;try{if(!Number.isSafeInteger(I.sequence)||I.sequence<0||!(I.bytes instanceof Uint8Array||I.bytes instanceof ArrayBuffer)||I.failures!==void 0&&(!Array.isArray(I.failures)||I.failures.length>1e4||Array.from(I.failures).some(T=>typeof T!="string"))||I.changes!==void 0&&(!Array.isArray(I.changes)||I.changes.length>1e4||new Set(I.changes.map(T=>T.id)).size!==I.changes.length||Array.from(I.changes).some(T=>!T||typeof T.id!="string"||!T.id||T.description!==void 0&&(typeof T.description!="string"||T.description.length>1e3)||T.location!==void 0&&(!T.location||typeof T.location!="object"||T.location.paragraphId!==void 0&&typeof T.location.paragraphId!="string"||T.location.paragraphIndex!==void 0&&typeof T.location.paragraphIndex!="number"||typeof T.location.start!="number"||typeof T.location.end!="number"||typeof T.location.text!="string")||T.unavailableReason!==void 0&&!["deleted","unavailable"].includes(T.unavailableReason))))throw new Error("invalid-result");O={...I,bytes:new Uint8Array((I.bytes instanceof Uint8Array,I.bytes)).slice(),changes:I.changes?.map(T=>({id:T.id,description:T.description,unavailableReason:T.unavailableReason,location:T.location?{paragraphId:T.location.paragraphId,paragraphIndex:T.location.paragraphIndex,start:T.location.start,end:T.location.end,text:T.location.text}:void 0})),failures:I.failures?.slice()};}catch{return Promise.resolve(b(x(R,"invalid-result")))}let C=async()=>{let T=i,$=S();if($)return b(x(R,$));if(!T||T.token!==O.submission)return b(x(R,"superseded"));if(O.sequence<=T.sequence)return b(x(R,"out-of-order"));if(T.epoch!==n.epoch)return b(x(R,"document-changed"));s=true;let W=a.signal,q=()=>i===T&&T.epoch===n.epoch&&!W.aborted;try{let K=await k(W);if(!q())return b(x(R,"cancelled"));if(K.revision!==T.revision)return b(x(R,"local-edits"),"failed");let Z=O.bytes;if(!mg(Z).ok)return b(x(R,"invalid-document"),"failed");if(h.clear(),d=[],u=null,y({phase:"refreshing",changes:[],highlightsVisible:!1}),!q())return b(x(R,"cancelled"));let M=n.surface().save();if(!q())return b(x(R,"cancelled"));if(n.revision!==T.revision)return b(x(R,"local-edits"),"failed");c={bytes:M.slice(),epoch:n.epoch};let ee=await n.replace(Z,"refresh");if(T.epoch!==n.epoch)return b(x(R,"document-changed"));if(!ee&&!q())return c=null,b(x(R,"cancelled"));if(!ee){if(y({phase:"recovering"}),T.epoch!==n.epoch)return b(x(R,"document-changed"));let B=c&&await n.replace(c.bytes,"recovery");return T.epoch!==n.epoch?b(x(R,"document-changed")):(B&&(c=null),i=null,b(x(R,B?"load-failed":"recovery-failed",!!B),"failed"))}c=null,h.clear(),T.revision=n.mountedRevision,T.sequence=O.sequence;let J=d8(n,R,O.changes,T.seen);d=n.revision===T.revision?J.located:[];for(let B of d)T.seen.set(B.change.id,B.fingerprint);u=T.revision;let fe=Object.freeze(d.map(B=>Object.freeze(B.change))),se=Object.freeze({ok:!0,resultId:R,changes:fe,changeInformation:n.revision===T.revision&&J.available?"available":"unavailable",failures:Object.freeze(O.failures??[])});return y({changes:fe,result:se,phase:"complete",recoveryAvailable:!1}),b(se)}catch{return b(x(R,q()?"input-failed":"cancelled"),q()?"failed":void 0)}finally{s=false;}},w=l.then(C);return l=w.then(()=>{},()=>{}),w},cancel(){let I=g.phase==="recovering"||!n.surface()&&c!==null;n.cancel(),o++,i=null,a.abort(),a=new AbortController,I||(c=null),y({phase:I?"failed":g.result?.ok?"complete":"idle",result:I||g.result?.ok?g.result:null,recoveryAvailable:c!==null});},finish(I){i?.token===I&&!s&&(i=null,y({phase:g.phase==="processing"?"idle":g.phase}));},snapshot:()=>g,subscribe(I){return f.add(I),()=>{f.delete(I);}},onResult(I){return p.add(I),()=>{p.delete(I);}},highlightChanges(I){if(h.validate(I),u!==n.revision)return 0;let R=I?.changeIds===void 0?null:new Set(I.changeIds),O=d.filter(C=>C.change.status==="available"&&(R?R.has(C.change.id):I?.includePrevious||C.change.isNew));return h.show(O,I),y({highlightsVisible:O.length>0}),O.length},clearHighlights(I){h.hide(I),y({highlightsVisible:false});},navigateToChange(I,R={}){if(R.focus!==void 0&&typeof R.focus!="boolean")throw new TypeError("focus must be a boolean.");let O=Hs(R,"center",n.container());if(u!==n.revision)return false;let C=d.find(T=>T.change.id===I);if(!C?.paragraphId||C.offset===void 0)return false;let w=n.surface();if(!w?.revealPosition({paragraphId:C.paragraphId,offset:C.offset},O))return false;if(R?.focus){w.setActiveScope({kind:"body"});let T={paragraphId:C.paragraphId,offset:C.offset};w.setSelection({anchor:T,head:T}),w.focus();}return true},recoveryBytes:()=>c?c.bytes.slice().buffer:null,async recover(){if(!c||c.epoch!==n.epoch||s)return false;s=true;let I=c;y({phase:"recovering"});try{if(I.epoch!==n.epoch)return !1;let R=await n.replace(I.bytes,"recovery");return I.epoch!==n.epoch?!1:(R&&(c=null),y({phase:R?"idle":"failed",recoveryAvailable:!R}),R)}finally{s=false;}}};return u8.set(e,E),E}var f8=150,Zz=1e3,Xz=Object.freeze({applied:0,unavailable:0});function Yz(e,t,n,r={}){let{onResult:o,...i}=r,a=n,s=i,l=Xz,c=false,d=nt(()=>So(e)),u,f=0,p=b=>{b.applied===l.applied&&b.unavailable===l.unavailable||(l=b,o?.(b));},g=()=>{if(d.clearTimeout(u),u=void 0,f=0,c)return;let b=typeof a=="function"?a(e):a;p(e.setHighlights(t,b,s));},y=()=>{let b=Date.now();f===0&&(f=b),d.clearTimeout(u);let x=Math.min(f8,Zz-(b-f));u=d.setTimeout(g,Math.max(0,x));},h=e.on("change",b=>{typeof a=="function"?b.source?g():y():b.source==="refresh"||b.source==="recovery"?g():b.source==="load"&&p({applied:0,unavailable:a.length});});return g(),{get result(){return l},refresh:g,update(b,x){a=b,x!==void 0&&(s=x),g();},stop(){c||(c=true,d.clearTimeout(u),h(),e.clearHighlights(t));}}}var Ox=150,m8=2e3,g8="search",h8=10,Cx=Object.freeze([]),Qz=1e3;function Jz(e,t){let n=e.activeIndex>=0?e.matches[e.activeIndex]:void 0;if(!n)return -1;let r=-1;for(let[o,i]of t.entries())i.blockId===n.blockId&&(r<0||Math.abs(i.start-n.start)<Math.abs(t[r].start-n.start))&&(r=o);return r}var p8=new WeakMap;function eZ(e){let t=p8.get(e);if(t)return t;let n={query:"",matchCase:false,wholeWord:false,matches:Cx,truncated:false,activeIndex:-1,activeMatch:null,isPending:false},r="",o={},i=nt(()=>So(e)),a,s=new Set,l=new Map,c=false;function d(){let I="none";for(let R of l.values()){if(R==="all")return "all";R==="active"&&(I="active");}return I}function u(){let I=d(),{matches:R,activeIndex:O}=n,C=O>=0?R[O]:void 0,w=I==="all"?R:I==="active"&&C?[C]:[];w.length===0&&!c||(e.setHighlights(g8,w,{activeIndex:I==="all"?O:w.length>0?0:-1,priority:h8}),c=w.length>0);}function f(I){let R={...n,...I};if(R.matches!==n.matches&&I.activeIndex===void 0&&(R.activeIndex=Jz(n,R.matches)),R.truncated=BH(R.matches)??R.matches.length>=m8,R.activeMatch=R.matches[R.activeIndex]??null,!!Object.keys(R).some(C=>R[C]!==n[C])){n=R,u();for(let C of [...s])C();}}function p(I=r,R=n){return I.length===0?Cx:e.findMatches(I,{matchCase:R.matchCase??false,wholeWord:R.wholeWord??false})}function g(){i.clearTimeout(a),a=void 0;}function y(){g(),r=n.query,f({matches:p(),isPending:false});}let h,b=0,x=()=>{i.clearTimeout(h),h=void 0,b=0,r.length>0&&f({matches:p()});},S=()=>{h!==void 0&&x();};e.on("change",I=>{if(r.length===0)return;if(I.source)return x();let R=Date.now();b===0&&(b=R),i.clearTimeout(h);let O=Math.min(Ox,Qz-(R-b));h=i.setTimeout(x,Math.max(0,O));});let v=e.snapshot().editingMode;e.on("selectionChange",I=>{I.editingMode!==v&&(v=I.editingMode,x());});let k=(I,R)=>{S();let O=n.matches.length;if(O===0)return false;let C=n.activeIndex<0?I>0?-1:0:n.activeIndex;return E.goTo((C+I+O)%O,R)},E={getState:()=>n,subscribe(I){return s.add(I),()=>s.delete(I)},find(I,R={}){g(),r=I;let O=R.matchCase??n.matchCase,C=R.wholeWord??n.wholeWord,w=p(I,{matchCase:O,wholeWord:C});return R.highlight===void 0||R.highlight==="none"?l.delete(o):l.set(o,R.highlight),f({query:I,matchCase:O,wholeWord:C,matches:w,activeIndex:-1,isPending:false}),u(),R.selectFirst&&E.goTo(0),n.matches},setQuery(I){I!==n.query&&(g(),I!==r&&(a=i.setTimeout(y,Ox)),f({query:I,isPending:I!==r}));},setMatchCase(I){f({matchCase:I,matches:p(r,{...n,matchCase:I})});},setWholeWord(I){f({wholeWord:I,matches:p(r,{...n,wholeWord:I})});},goTo(I,R){S();let O=n.matches[I];return !O||(R?.focus&&e.focus(),!e.selectMatch(O).ok)?false:(f({activeIndex:I}),true)},next:I=>k(1,I),previous:I=>k(-1,I),clear(){g(),r="",l.delete(o),f({query:"",matches:Cx,activeIndex:-1,isPending:false});},showHighlights(I){let R={};return l.set(R,I),u(),()=>{l.delete(R)&&u();}}};return p8.set(e,E),E}var tZ=[37,80,68,70,45],Yc=class extends Error{constructor(n){super(`Install @docx-editor.dev/docx-to-${n} and configure menu.exporters.${n}.`+(n==="pdf"?" PDF conversion requires a Node.js server.":""));this.format=n;this.name="ChromeExportError";}format;code="missing-exporter"};async function Mx(e,t,n={},r={}){if(t==="markdown"){if(!n.markdown)throw new Yc(t);let l=await n.markdown(new Uint8Array(await e.save()));if(typeof l?.markdown!="string")throw new TypeError("The Markdown converter returned no Markdown.");return {bytes:new TextEncoder().encode(l.markdown),extension:"md",mimeType:"text/markdown;charset=utf-8"}}if(t!=="pdf")throw new TypeError("Unsupported export format.");if(!n.pdf)throw new Yc(t);let o=e.snapshot?.(),i=r.displayMode!==void 0||r.comments!==void 0,a=o||i?{displayMode:r.displayMode??o?.reviewDisplayMode??"proposed",...r.comments===void 0?{}:{comments:r.comments},revisionMarkup:o?.revisionMarkup??ib$1,...e.getReviewAuthors?{revisionAuthorSlots:Object.freeze(Object.fromEntries(e.getReviewAuthors().map(({author:l,slot:c})=>[l,c])))}:{}}:void 0,s=await n.pdf(new Uint8Array(await e.save()),a);if(!(s?.bytes instanceof Uint8Array)||s.bytes.length===0)throw new TypeError("The PDF converter returned no PDF bytes.");if(!tZ.every((l,c)=>s.bytes[c]===l))throw new TypeError("The PDF converter returned a file without a PDF header.");return {bytes:s.bytes,extension:"pdf",mimeType:"application/pdf"}}var rZ=15e3,Lr=class extends Error{code;constructor(t){super(t==="pdf-viewer-unavailable"?"This browser cannot display PDF files in the page.":t==="pdf-load-failed"?"The PDF did not load for printing.":t==="print-refused"?"The browser refused to print the PDF from the page.":"The print job has ended."),this.code=t,this.name="ChromePrintError";}};function oZ(e){if(e.altKey||e.shiftKey||typeof e.key!="string")return false;let t=e.key.toLowerCase();return t!=="p"&&(e.code!=="KeyP"||/^[a-z]$/.test(t))?false:isApplePlatform()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}var iZ=Object.freeze([{mode:"simple-markup",labelKey:"review.simpleMarkup"},{mode:"all-markup",labelKey:"review.allMarkup"},{mode:"proposed",labelKey:"review.noMarkup"},{mode:"original",labelKey:"review.original"}]);function aZ(e){return {displayMode:e?.reviewDisplayMode??"proposed",comments:true}}async function sZ(e,t={},n=globalThis.document,r={}){let{bytes:o,mimeType:i}=await Mx(e,"pdf",t,r);return lZ(o,i,n)}function lZ(e,t,n){let r=n.nodeType===9?n.body:n;if(!r)throw new TypeError("Printing requires a document body.");let o=r.ownerDocument,i=o.defaultView;if(!i)throw new TypeError("Printing requires a document with a window.");let a=e.buffer instanceof ArrayBuffer?e:e.slice(),s=i.URL.createObjectURL(new i.Blob([a],{type:t})),l=null,c=null,d,u=null,f=false,p=h=>{i.clearTimeout(d),u?.(h),u=null,l?.remove(),l=null,c=null;},g=()=>{if(c)return c;let h=o.createElement("iframe");return l=h,h.setAttribute("aria-hidden","true"),h.setAttribute("tabindex","-1"),h.setAttribute("data-docx-print-frame",""),h.style.cssText="position:fixed;right:0;bottom:0;width:0;height:0;border:0;visibility:hidden;",c=new Promise((b,x)=>{u=x,d=i.setTimeout(()=>p(new Lr("pdf-load-failed")),rZ),h.addEventListener("load",()=>{if(i.clearTimeout(d),!h.contentWindow){p(new Lr("pdf-load-failed"));return}u=null,b(h.contentWindow);},{once:true});}),c.catch(()=>{}),h.src=s,r.append(h),c};return {url:s,async print(h={}){if(f)throw new Lr("print-ended");if(i.navigator.pdfViewerEnabled===false)throw new Lr("pdf-viewer-unavailable");let b=await g();if(f)throw new Lr("print-ended");if(await h.beforePrint?.(),f)throw new Lr("print-ended");let x=o.activeElement;try{b.focus(),b.print();}catch{throw new Lr("print-refused")}finally{x?.isConnected&&x.focus({preventScroll:true});}},dispose(){f||(f=true,p(new Lr("print-ended")),i.URL.revokeObjectURL(s));}}}var cZ=".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document";function dZ(e){return e.reason===void 0?`compareDocuments.errors.${e.code}`:`compareDocuments.reasons.${e.reason}`}var y8="data-docx-compare-phase",uZ=e=>e!==null&&!e.disabled&&!e.closest("[hidden]");function fZ(e,t){if(!e?.isConnected)return;let n=a=>e.querySelector(a),r=n('[data-docx-field="revised"] input, input[type="file"]'),i=(t==="busy"?[n('[data-docx-part="cancel"]'),n(`[${y8}]`)]:t==="unchanged"?[n('[data-docx-part="apply"]'),r]:[r,n('[data-docx-part="apply"]')]).find(uZ)??e;i===e&&!e.hasAttribute("tabindex")&&(e.tabIndex=-1),i.focus({preventScroll:true});}var pZ=new Intl.Collator(void 0,{numeric:true,sensitivity:"base"});function b8(e,t){let n=e.filter(r=>t.showHidden||!r.hidden);return t.sortBy==="location"?[...n].sort((r,o)=>r.order-o.order):[...n].sort((r,o)=>pZ.compare(r.name,o.name)||r.order-o.order)}var Ax=["body","header","footer","footnote","endnote"];function mZ(e,t){let n=b8(e,t),r=Zi$1(t.query.trim()),o=n;if(r.length>0){let i=[],a=[];for(let s of n){let l=Zi$1(s.name);l.startsWith(r)?i.push(s):l.includes(r)&&a.push(s);}o=[...i,...a];}return t.sortBy!=="location"?o:[...o].sort((i,a)=>Ax.indexOf(i.place)-Ax.indexOf(a.place))}function gZ(e,t,n){let r=Zi$1(t.trim());return r.length===0?null:e.find(o=>Zi$1(o.name)===r)??n[0]??null}function hZ(e,t){let n=Zi$1(t.trim()),r=Zi$1(e);if(n.length===0||r.length!==e.length)return null;let o=r.indexOf(n);return o<0?null:{start:o,end:o+n.length}}function yZ(e){return Ax.map(t=>({place:t,rows:e.flatMap((n,r)=>n.place===t?[{row:n,index:r}]:[])})).filter(t=>t.rows.length>0)}function bZ(e){return e.find(t=>t.atSelection&&!t.hidden)?.name??""}function vZ(e,t,n){let r=Xi$1(t)??(Yi$1(t)?"invalidStart":null),o=Zi$1(t),i=t.length===0?null:e.find(a=>Zi$1(a.name)===o)??null;return {problem:r,existing:i,canAdd:n&&r===null,canDelete:n&&i!==null,canGoTo:i!==null}}function xZ(e,t){return (t.support!=="partial"||e.includePartial===true)&&(e.match?.(t)??true)}function SZ(e,t,n){let r=e.surface?.session;return r?Ia(r.currentPackage(),t,n):{ok:false,reason:"drawing-not-found"}}
|
|
31
|
-
export{vE as $,Jy as $a,Qb as $b,Uz as $c,I6 as A,vf as Aa,ab as Ab,kz as Ac,bZ as Ad,K5 as B,ms as Ba,lb as Bb,Iz as Bc,vZ as Bd,U5 as C,ZC as Ca,Z$ as Cb,Rz as Cc,xZ as Cd,V5 as D,By as Da,HO as Db,Pz as Dc,SZ as Dd,CT as E,cc as Ea,X$ as Eb,Y_ as Ec,Z5 as F,Y3 as Fa,_O as Fb,Q_ as Fc,Y5 as G,XC as Ga,Y$ as Gb,Cz as Gc,de as H,YC as Ha,Q$ as Hb,Oz as Hc,Oh as I,Q3 as Ia,J$ as Ib,J_ as Ic,a4 as J,na as Ja,MA as Jb,Mz as Jc,l4 as K,$y as Ka,Tc as Kb,Az as Kc,c4 as L,n$ as La,Ec as Lb,Lz as Lc,VT as M,Wy as Ma,dq as Mb,e8 as Mc,d4 as N,f$ as Na,Ab as Nb,t8 as Nc,u4 as O,Tf as Oa,aa as Ob,Fz as Oc,f4 as P,mO as Pa,Co as Pb,n8 as Pc,p4 as Q,Pf as Qa,Jf as Qb,Dz as Qc,m4 as R,gO as Ra,JA as Rb,r8 as Rc,g4 as S,yO as Sa,eL as Sb,Nz as Sc,zT as T,g$ as Ta,Db as Tb,o8 as Tc,ZT as U,h$ as Ua,ep as Ub,Hz as Uc,XT as V,y$ as Va,Nb as Vb,_z as Vc,h4 as W,v$ as Wa,tp as Wb,Bz as Wc,y4 as X,x$ as Xa,Hb as Xb,$z as Xc,b4 as Y,S$ as Ya,_b as Yb,Wz as Yc,Dh as Z,w$ as Za,Bb as Zb,qz as Zc,bE as _,k$ as _a,cp as _b,s8 as _c,$i as a,sf as aa,I$ as ab,_F as ac,Vz as ad,Kl as b,Hh as ba,eb as bb,Vc as bc,ui as bd,Ou as c,_h as ca,bO as cb,Fs as cc,zz as cd,Mu as d,I4 as da,R$ as db,xge as dc,f8 as dd,Mg as e,lf as ea,P$ as eb,Fj as ec,Yz as ed,t6 as f,nc as fa,tb as fb,Dj as fc,Ox as fd,n6 as g,my as ga,T$ as gb,Nj as gc,m8 as gd,Ag as h,w3 as ha,E$ as hb,Ns as hc,g8 as hd,Wi as i,rc as ia,Cf as ib,WV as ic,h8 as id,Ae as j,oc as ja,nb as jb,Rx as jc,eZ as jd,m6 as k,gy as ka,SO as kb,Zc as kc,Yc as kd,g6 as l,k3 as la,C$ as lb,Xc as lc,Mx as ld,h6 as m,hy as ma,O$ as mb,_s as mc,Lr as md,Wt as n,gf as na,M$ as nb,oz as nc,oZ as nd,Gr as o,At as oa,wO as ob,Qp as oc,iZ as od,y6 as p,ta as pa,IO as pb,Jp as pc,aZ as pd,wo as q,xC as qa,D$ as qb,Px as qc,sZ as qd,nt as r,hf as ra,RO as rb,fz as rc,cZ as rd,ns as s,Xr as sa,rb as sb,z_ as sc,dZ as sd,Lu as t,ac as ta,PO as tb,mz as tc,y8 as td,b6 as u,Iy as ua,TO as ub,Ex as uc,fZ as ud,Fg as v,Py as va,EO as vb,yz as vc,b8 as vd,x6 as w,D3 as wa,ib as wb,vz as wc,mZ as wd,S6 as x,N3 as xa,LO as xb,xz as xc,gZ as xd,w6 as y,_3 as ya,V$ as yb,Sz as yc,hZ as yd,k6 as z,B3 as za,Af as zb,wz as zc,yZ as zd};
|