@docx-editor.dev/core 2.23.0 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +1 -1
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.js +1 -1
- package/dist/{chunk-KRBBWATQ.js → chunk-2LXGB2X7.js} +1 -1
- package/dist/chunk-3OMDEMLL.js +1 -0
- package/dist/{chunk-PCPBDYEL.cjs → chunk-6CPYOVRT.cjs} +1 -1
- package/dist/chunk-AKF5KM2W.cjs +4 -0
- package/dist/{chunk-QTFAXWVI.cjs → chunk-BOGQGMMU.cjs} +1 -1
- package/dist/chunk-CVNDMQIX.cjs +26 -0
- package/dist/{chunk-FWX535CS.cjs → chunk-DF7F7TNU.cjs} +1 -1
- package/dist/{chunk-UMBHUW6R.js → chunk-G765WG4R.js} +1 -1
- package/dist/{chunk-BUDXZ7T2.cjs → chunk-IEXYOLNR.cjs} +5 -5
- package/dist/chunk-J3EM5ZEA.js +18 -0
- package/dist/{chunk-QK23BSRK.cjs → chunk-JDAAGZNE.cjs} +1 -1
- package/dist/chunk-JNE6QF47.js +26 -0
- package/dist/{chunk-KV5HFE23.cjs → chunk-JQTVFP72.cjs} +1 -1
- package/dist/chunk-JXL25DRU.js +11 -0
- package/dist/{chunk-GRVRQBKU.js → chunk-KPSGB64S.js} +1 -1
- package/dist/chunk-P4SBMHHO.cjs +5 -0
- package/dist/chunk-QQAF64KN.js +5 -0
- package/dist/chunk-SI5FLZGU.js +4 -0
- package/dist/{chunk-DZOGUV7O.js → chunk-SOUJNWXV.js} +1 -1
- package/dist/chunk-T4TKRNZT.cjs +11 -0
- package/dist/{chunk-EHT4LKKZ.cjs → chunk-TBFZZX7Z.cjs} +1 -1
- package/dist/chunk-VPKKYCZI.cjs +2 -0
- package/dist/chunk-W3ZUPQIZ.cjs +18 -0
- package/dist/chunk-XMWH2R23.js +5 -0
- package/dist/{chunk-6QS5WL63.js → chunk-XWXJB4J7.js} +1 -1
- package/dist/chunk-YIBEBHT3.js +2 -0
- package/dist/{chunk-RLO64PHP.cjs → chunk-ZSM6X52G.cjs} +1 -1
- package/dist/chunk-ZXAGLAY2.js +2 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.js +1 -1
- package/dist/contracts/editor.d.ts +3 -3
- package/dist/{editor-DhUQsWWH.d.ts → editor-BU6rjQZz.d.ts} +3 -1
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +12 -12
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +5 -5
- package/dist/export.js +1 -1
- package/dist/{font-resolver-BwoHFBlr.d.ts → font-resolver-CPO7wtg6.d.ts} +1 -1
- package/dist/{index-BYaCkGKO.d.ts → index-BOkQYOsZ.d.ts} +21 -17
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +7 -7
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-DpWQG26a.d.ts → layout-shaping-BOOxnLxF.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +55 -40
- package/dist/layout.js +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +3 -3
- package/dist/output.js +1 -1
- package/dist/{semantic-cell-selection-B8GF_H2e.d.ts → semantic-cell-selection-BtO2s2Za.d.ts} +2 -2
- package/dist/{semantic-interaction-DQjtIruQ.d.ts → semantic-interaction-COMnWyBQ.d.ts} +1 -1
- package/dist/{semantic-paint-DoPl85nR.d.ts → semantic-paint-C032N0ps.d.ts} +1 -1
- package/dist/{semantic-records-DB0VgWsr.d.ts → semantic-records-BSjo-xck.d.ts} +3 -3
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +0 -1
- package/dist/store.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-4OAXZNBU.js +0 -5
- package/dist/chunk-6745I4XF.cjs +0 -20
- package/dist/chunk-6KA3L3FR.cjs +0 -11
- package/dist/chunk-DYRXA5UJ.cjs +0 -2
- package/dist/chunk-F5LAOPAD.js +0 -20
- package/dist/chunk-JN62FLHE.cjs +0 -4
- package/dist/chunk-Q4RDWB3U.cjs +0 -18
- package/dist/chunk-T7RGKBCE.cjs +0 -5
- package/dist/chunk-VE6H5EJA.js +0 -5
- package/dist/chunk-WHG23WNI.js +0 -1
- package/dist/chunk-XBYZTDF7.js +0 -4
- package/dist/chunk-XRBPZCNK.js +0 -11
- package/dist/chunk-Y5JCIWTF.js +0 -2
- package/dist/chunk-ZA6HEWUM.js +0 -2
- package/dist/chunk-ZCRSPN4Q.js +0 -18
package/dist/chunk-JN62FLHE.cjs
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
'use strict';var chunkQ4RDWB3U_cjs=require('./chunk-Q4RDWB3U.cjs'),chunkT7RGKBCE_cjs=require('./chunk-T7RGKBCE.cjs'),chunk6KA3L3FR_cjs=require('./chunk-6KA3L3FR.cjs');var Vn=4096,zt=e=>typeof e=="number"?String(e):JSON.stringify(e)??typeof e,Le=class{constructor(t){this.onRestart=t;}onRestart;#e=new Map;keyOf(t,n){let r=chunkQ4RDWB3U_cjs.s(n),o=this.#e.get(r);o===void 0&&(this.#e.size>=Vn&&(this.#e.clear(),this.onRestart()),o=this.#e.size,this.#e.set(r,o));let a=`${o}\0${zt(t.fontSizeHalfPoints)}\0${zt(t.bidiLevel)}\0`,i=t.context;return !i||i.before===""&&i.after===""?`${a}-${t.text}`:`${a}c${i.before.length},${i.after.length}\0${i.before}${i.after}${t.text}`}clear(){this.#e.clear();}};function Q(e){try{let t=new URL(e);return t.username!==""||t.password!==""||t.search!==""||t.hash!==""?`${t.protocol}//${t.host}${t.pathname}\u2026`:e}catch{let t=e.search(/[?#]/);return t===-1?e:`${e.slice(0,t)}\u2026`}}function kt(e){return e.replace(/[a-z][a-z0-9+.-]*:\/\/[^\s"')]+/gi,t=>Q(t))}function $n(e){if(typeof e!="string"&&!(e instanceof URL))throw new TypeError(`setHarfBuzzWasmUrl: expected a string or URL, received ${typeof e}`);if(typeof e=="string"&&e.trim()==="")throw new TypeError("setHarfBuzzWasmUrl: expected a non-empty URL");throw new Error("setHarfBuzzWasmUrl is not supported by the CommonJS build, which loads the shaper from node_modules and finds its binary on disk. Import the ESM build instead.");}function Nt(e){return e instanceof Error&&/process\.getBuiltinModule/.test(e.message)}function Dt(e){return `the text shaper cannot start on this Node version: the ESM build reaches Node builtins through \`process.getBuiltinModule\`, added in Node 20.16.0 and 22.3.0. Upgrade Node; \`setHarfBuzzWasmUrl\` does not apply here. (${kt(e instanceof Error?e.message:String(e))})`}function Ht(e){let t=kt(e instanceof Error?e.message:String(e));return `the HarfBuzz WASM binary could not be loaded from ${"its bundled location"}. If this bundler does not emit \`new URL(..., import.meta.url)\` assets (esbuild, Bun, and library builds that inline dynamic imports), serve \`@docx-editor.dev/core/harfbuzz.wasm\` yourself, point \`setHarfBuzzWasmUrl\` from '@docx-editor.dev/core/layout' at it before creating an editor, and reload the page. (${t})`}function Ut(e,t){let n=`expected HarfBuzz ${e}, loaded ${t}`;return `${n}. The bundled binary does not match this build of the engine.`}var $=Object.freeze({name:"HarfBuzz",version:"14.4.0"}),le=null,se=null;function Ze(){return le?Promise.resolve():se||(se=import('harfbuzzjs').then(e=>{let t=e.versionString();if(t!==$.version)throw new B("shapingLibraryMismatch",{diagnostic:Ut($.version,t)});le=e;}).catch(e=>{throw se=null,e instanceof B?e:Nt(e)?new B("unsupportedRuntime",{diagnostic:Dt(e),cause:e}):new B("wasmUnavailable",{diagnostic:Ht(e),cause:e})}),se)}function qn(){return le!==null}function Zn(){if(!le)throw new B("notInitialized",{diagnostic:"Call initializeHarfBuzz() before creating a text shaper"});return le}var B=class extends Error{name="HarfBuzzShapingError";code;limit;actual;diagnostic;constructor(t,n={}){super(`HarfBuzz shaping failed (${t})`,{cause:n.cause}),this.code=t,this.limit=n.limit,this.actual=n.actual,this.diagnostic=n.diagnostic;}},Jn=16*1024*1024,Qn=1e6,er=1e6,tr=1e6,nr=4,rr=512,or=1024*1024,ar=16*1024*1024,ir=32*1024*1024,sr=64*1024*1024,cr=64*1024*1024,lr=1e6,dr=1e6,ur=1e6,pr=64,fr=4096,yr=4*1024*1024,mr=64*1024*1024,hr=64*1024*1024,gr=256*1024*1024,Sr=new Set(["COLR","CPAL","CBDT","CBLC","sbix","SVG "]),Gt=["cmap","head","hhea","hmtx","maxp"],br=(e,t)=>e[t]<<8|e[t+1],xr=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,Rr=(e,t)=>String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?xr(e,12+t*4):0,Cr=(e,t)=>{let n=Rr(e,t),r=br(e,n+4),o=new Set;for(let a=0;a<r;a+=1){let i=n+12+a*16;o.add(String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]));}return o},Fr=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),vr=(e,t)=>{let n=chunkQ4RDWB3U_cjs.m(e,t);if(!n.valid)return n;let r=Cr(e,t);for(let o of Gt)if(!r.has(o))return {valid:false,diagnostic:`missing required ${o} table`};return {valid:true}},Je=vr,M=(e,t,n)=>{if(!Number.isSafeInteger(e)||e<=0||e>n)throw new RangeError(`${t} must be a positive safe integer no greater than ${n}`);return e},Er=(e,t,n)=>{let r=e<0n,o=r?-e:e,a=o/t,i=o%t;if(n!=="towardZero"){let d=i*2n;(d>t||d===t&&(n==="halfAwayFromZero"||n==="halfToEven"&&a%2n!==0n))&&(a+=1n);}let c=r?-a:a,s=Number(c);if(!Number.isSafeInteger(s))throw new RangeError("Shaped fixed-point value exceeds the safe integer range");return s},Wt=(e,t,n,r)=>{if(!Number.isSafeInteger(e))throw new RangeError("font units must be a safe integer");if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("fixed-point denominator must be a positive safe integer");if(!Number.isSafeInteger(n)||n<0)throw new RangeError("fixed-point numerator must be a non-negative safe integer");return chunkQ4RDWB3U_cjs.o(Er(BigInt(e)*BigInt(n),BigInt(t),r))},Lr=(e,t,n,r)=>{if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("font size must be a positive integer number of half points");if(t>Math.floor(Number.MAX_SAFE_INTEGER/n))throw new RangeError("font size and fixed-point scale product exceeds the safe integer range");let o=t*n,a=e*2;return i=>Wt(i,a,o,r)},Br=(e,t,n)=>{let r=t*n,o=e*2;return a=>a*r/o},Ir=(e,t)=>{if(t.length===0)return [];let n=[...new Set(t.map(i=>i.cluster))].sort((i,c)=>i-c),r=new Map;for(let i=0;i<n.length;i+=1)r.set(n[i],n[i+1]??e.length);let o=[],a=0;for(;a<t.length;){let i=t[a].cluster,c=a+1;for(;c<t.length&&t[c].cluster===i;)c+=1;let s=t.slice(a,c).reduce((l,f)=>l+f.advanceX,0),d=chunkQ4RDWB3U_cjs.o(s);o.push({textStart:i,textEnd:r.get(i),glyphStart:a,glyphEnd:c,advance:d,caretEdges:Object.freeze([chunkQ4RDWB3U_cjs.o(0),d]),fontSpan:0}),a=c;}return o},k=64,H=8,X=8,Kt=32,Xt=k+2*H,Or=k+H+X,Tr=k+H+2*X,wr=k+H+X,Vt=k+8*H,jt=k+8*X+H,Ar=k+6*X+H,Pr=k+3*X+2*H,_r=k+3*X,de=e=>k+e.length*Uint16Array.BYTES_PER_ELEMENT,Qe=e=>wr+de(e),ce=e=>Kt+e*H,Mr=(e,t)=>Xt+de(e)+Or+Qe(t),zr=e=>Vt+de(e)+ce(e.length)+e.length*jt,kr=e=>{let t=new Set(e.glyphs.map(n=>n.outline));return Vt+de(e.text)+ce(e.glyphs.length)+e.glyphs.length*jt+ce(e.clusters.length)+e.clusters.length*Ar+e.clusters.reduce((n,r)=>n+ce(r.caretEdges.length),0)+ce(e.fontSpans.length)+e.fontSpans.length*Pr+(e.exactAdvancesX===void 0?0:Kt+e.exactAdvancesX.length*X)+_r+[...t].reduce((n,r)=>n+Qe(r.path),0)},Nr=(e,t)=>Xt+de(e)+Tr+t,qe=class{#e;#u;#p;#f;#y;#x;#m;#c=0;#R;#h;#g;#s;#S;#l;#t;#o=new Map;#a=new Map;#n=new Map;#C=new Le(()=>{this.#n.clear(),this.#r=0,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0}));});#i=0;#r=0;#b=0;#d;constructor(t,n){this.#e=t,this.#u=M(n.maxFontBytes??Jn,"maximum font bytes",cr),this.#p=M(n.maxInputUtf16??Qn,"maximum input UTF-16 code units",lr),this.#f=M(n.maxCodepoints??er,"maximum input code points",dr),this.#y=M(n.maxGlyphs??tr,"maximum shaped glyphs",ur),this.#m=M(n.maxCachedFontBytes??64*1024*1024,"maximum cached font bytes",64*1024*1024),this.#x=M(n.maxCachedFaces??nr,"maximum cached faces",pr),this.#R=M(n.maxCachedShapes??rr,"maximum cached shape results",fr),this.#h=M(n.maxOutlineBytes??or,"maximum outline bytes",yr),this.#g=M(n.maxCachedOutlineBytes??ar,"maximum cached outline bytes",mr),this.#s=M(n.maxShapedRunBytes??ir,"maximum shaped run bytes",hr),this.#S=M(n.maxCachedShapeBytes??sr,"maximum cached shape bytes",gr),this.#l=n.instrumentation?.onFaceCacheEvent,this.#t=n.instrumentation,this.#d=new this.#e.Buffer;}dispose(){this.#o.clear(),this.#c=0,this.#a.clear(),this.#n.clear(),this.#C.clear(),this.#i=0,this.#r=0,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#d=void 0;}#v(t,n){let r=this.#o.get(t.identity);if(r)return this.#o.delete(t.identity),this.#o.set(t.identity,r),this.#l?.(Object.freeze({kind:"hit",identity:t.identity})),r;let o=chunkQ4RDWB3U_cjs.k(t);for(let l of Gt)if(!o.has(l))throw new B("malformedFont",{diagnostic:`missing required ${l} table`});this.#t?.onByteCopy?.();let a=new this.#e.Blob(Fr(n)),i=new this.#e.Face(a,t.faceIndex),c=new this.#e.Font(i),s=c.hExtents();if(!Number.isSafeInteger(i.upem)||i.upem<=0||!Number.isSafeInteger(s.ascender)||!Number.isSafeInteger(s.descender)||!Number.isSafeInteger(s.lineGap))throw new B("malformedFont",{diagnostic:"invalid font units or horizontal metrics"});c.setScale(i.upem,i.upem);let d={identity:t.identity,blob:a,face:i,font:c,unitsPerEm:i.upem,byteLength:n.byteLength};if(n.byteLength<=this.#m){for(;this.#o.size>=this.#x||this.#c+n.byteLength>this.#m;){let l=this.#o.keys().next().value;if(l===void 0)break;this.#c-=this.#o.get(l).byteLength,this.#o.delete(l),this.#l?.(Object.freeze({kind:"evicted",identity:l}));}this.#o.set(t.identity,d),this.#c+=n.byteLength;}return this.#l?.(Object.freeze({kind:"created",identity:t.identity})),d}#E(t,n,r){let o=JSON.stringify([t.identity,t.unitsPerEm,r,n]),a=this.#a.get(o);if(a)return this.#a.delete(o),this.#a.set(o,a),this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#i})),a.outline;this.#t?.onOutlinePathCall?.();let i=t.font.glyphToPath(n),c=Qe(i);if(c>this.#h)throw new B("outlineOverLimit",{limit:this.#h,actual:c});let s=Object.freeze({path:i,unitsPerEm:t.unitsPerEm}),d=Mr(o,i);if(d>this.#g)return this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#i})),s;for(;this.#i+d>this.#g;){let l=this.#a.keys().next().value;if(l===void 0)break;let f=this.#a.get(l);this.#a.delete(l),this.#i-=f.bytes,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#i}));}return this.#a.set(o,{outline:s,bytes:d}),this.#i+=d,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"created",retainedBytes:this.#i})),s}#F(t){if(t.length>this.#p)throw new B("textOverLimit",{limit:this.#p,actual:t.length});let n=0;for(let r=0;r<t.length;){let o=t.codePointAt(r);if(r+=o>65535?2:1,n+=1,n>this.#f)throw new B("codepointsOverLimit",{limit:this.#f,actual:n})}}shape(t){if(!this.#d)throw new B("disposed");if(chunkQ4RDWB3U_cjs.l(t.environment.font),t.environment.font.byteLength>this.#u)throw new B("fontOverLimit",{limit:this.#u,actual:t.environment.font.byteLength});this.#F(t.text);let n=zr(t.text);if(n>this.#s)throw new B("shapedRunOverLimit",{limit:this.#s,actual:n});let r=chunkQ4RDWB3U_cjs.q(t.environment),o=this.#C.keyOf(t,r),a=this.#n.get(o);if(a)return this.#b-a.stamp>=Math.max(1,this.#n.size>>1)&&(this.#n.delete(o),this.#n.set(o,a),a.stamp=++this.#b),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#r})),a.run;if(this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"miss",retainedBytes:this.#r})),r.shapingLibrary.name!==$.name||r.shapingLibrary.version!==$.version)throw new B("shapingLibraryMismatch");if(r.normalization!=="none")throw new B("unsupportedNormalization");if(!Number.isSafeInteger(t.bidiLevel)||t.bidiLevel<0||(t.bidiLevel&1)===1!=(r.direction==="rtl"))throw new B("invalidBidiLevel");if(Object.keys(r.variationAxes).length>0)throw new B("unsupportedVariationAxes");if(r.fallbackOrder.length>0)throw new B("unsupportedFallback");let i=chunkQ4RDWB3U_cjs.j(r.font),c=chunkQ4RDWB3U_cjs.k(r.font);if([...Sr].some(y=>c.has(y))&&!c.has("glyf")&&!c.has("CFF "))throw new B("unsupportedColorFont");let s=t.text;this.#F(s);let d=t.context?.before??"",l=t.context?.after??"",f=chunkQ4RDWB3U_cjs.p,S=Math.max(String(d).length,String(l).length);if(typeof d!="string"||typeof l!="string"||S>f)throw new B("textOverLimit",{limit:f,actual:S});try{let y=this.#v(r.font,i),{face:b,font:x}=y,m=this.#d;m.reset(),d||l?m.addText(d+s+l,d.length,s.length):m.addText(s),m.setDirection(r.direction==="rtl"?this.#e.Direction.RTL:this.#e.Direction.LTR),m.setScript(r.script),m.setLanguage(r.language),m.setClusterLevel(this.#e.ClusterLevel.MONOTONE_CHARACTERS);let h=Object.entries(r.features).map(([I,A])=>new this.#e.Feature(I,A));this.#t?.onShapeCall?.(),this.#e.shape(x,m,h);let g=m.getGlyphInfosAndPositions();if(g.length>this.#y)throw new B("glyphOverLimit",{limit:this.#y,actual:g.length});let R=Lr(b.upem,t.fontSizeHalfPoints,r.fixedPointScale,r.roundingMode),v=Br(b.upem,t.fontSizeHalfPoints,r.fixedPointScale),L=[],T=chunkQ4RDWB3U_cjs.o(0),p=chunkQ4RDWB3U_cjs.o(0),u=new Map,C=JSON.stringify(Object.entries(r.variationAxes).sort(([I],[A])=>I.localeCompare(A))),F=g.map(I=>{L.push(v(I.xAdvance??0));let A=R(I.xAdvance??0),Z=R(I.yAdvance??0),Xn={id:I.codepoint,cluster:I.cluster-d.length,originX:T,originY:p,advanceX:A,advanceY:Z,offsetX:R(I.xOffset??0),offsetY:R(I.yOffset??0),outline:u.get(I.codepoint)??(()=>{let ut=this.#E(y,I.codepoint,C);return u.set(I.codepoint,ut),ut})()};return T=chunkQ4RDWB3U_cjs.o(T+A),p=chunkQ4RDWB3U_cjs.o(p+Z),Xn}),E=x.hExtents(),O=chunkQ4RDWB3U_cjs.t({text:s,direction:r.direction,bidiLevel:t.bidiLevel,glyphs:F,exactAdvancesX:L,clusters:Ir(s,F),fontSpans:F.length===0?[]:[{glyphStart:0,glyphEnd:F.length,font:r.font,fallbackIndex:null}],metrics:{ascent:R(E.ascender),descent:R(-E.descender),lineGap:R(E.lineGap)}},r),_=kr(O);if(_>this.#s)throw new B("shapedRunOverLimit",{limit:this.#s,actual:_});let w=Nr(o,_);if(w>this.#S)return this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#r})),O;for(;this.#n.size>=this.#R||this.#r+w>this.#S;){let I=this.#n.keys().next().value;if(I===void 0)break;let A=this.#n.get(I);this.#n.delete(I),this.#r-=A.bytes,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#r}));}return this.#n.set(o,{run:O,bytes:w,stamp:++this.#b}),this.#r+=w,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"stored",retainedBytes:this.#r})),O}catch(y){throw y instanceof B?y:new B("malformedFont",{diagnostic:y instanceof Error?y.message:"HarfBuzz shaping failed"})}}},et=(e={})=>new qe(Zn(),e);var tt=Object.freeze({maxFontBytes:16*1024*1024,maxInputUtf16:1e6,maxCodepoints:1e6,maxGlyphs:1e6,maxCachedFaces:32,maxCachedFontBytes:64*1024*1024,maxCachedShapes:512,maxOutlineBytes:1024*1024,maxCachedOutlineBytes:16*1024*1024,maxShapedRunBytes:32*1024*1024,maxCachedShapeBytes:64*1024*1024}),La=Object.freeze({...tt,maxCachedShapes:4096});function Yt(e){let t={maxFontBytes:e.maxFontBytes,maxInputUtf16:e.maxInputUtf16,maxCodepoints:e.maxCodepoints,maxGlyphs:e.maxGlyphs,maxOutlineBytes:e.maxOutlineBytes,maxShapedRunBytes:e.maxShapedRunBytes},n=["docx-editor-layout-harfbuzz-execution-policy",1,Object.entries(t).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>Object.freeze([r,o]))];return `layout-shaper-policy:sha256:${chunk6KA3L3FR_cjs.a(new TextEncoder().encode(JSON.stringify(n)))}`}var Dr=Object.freeze({}),$t=chunkQ4RDWB3U_cjs.c,Hr="16.0.0",Ur="none",Gr=1e3,Wr="halfToEven",Jt="cluster-edges-only",Kr="Latn",Xr=new Uint8Array(0);var U=class extends Error{code="overLimit";constructor(t){super(t),this.name="LayoutShapingConfigurationError";}};function Vr(e,t){let n=e.epoch,r=e.maxFontBytes,o=e.sources,a=e.substitutions,i=e.defaultFont,c=e.language;if(!Number.isSafeInteger(r)||r<=0||r>chunkQ4RDWB3U_cjs.b)throw new U(`Font byte ceiling must not exceed the engine hard maximum of ${chunkQ4RDWB3U_cjs.b}`);let s=o.length,d=a?.length??0;if(s===0||s>chunkQ4RDWB3U_cjs.c)throw new U(`Font source count must be between 1 and ${chunkQ4RDWB3U_cjs.c}`);if(d>$t)throw new U(`Font substitution count must not exceed ${$t}`);let l=0,f=[];for(let b=0;b<s;b+=1){let x=o[b],m=x.request,h=x.availability,g=x.id,R=x.hash,v=x.faceIndex,L=h==="forbidden",T=L?Xr:x.bytes;if(!L){if(typeof g!="string"||g.length===0)throw new TypeError("Resolved font id must not be empty");let p;try{p=chunkQ4RDWB3U_cjs.f(T);}catch{throw new U(`Font source ${g} must provide genuine bytes`)}if(p>r)throw new U(`Font source ${g} exceeds the per-font byte ceiling`);if(l+=p,l>chunkQ4RDWB3U_cjs.d)throw new U(`Font sources exceed the aggregate byte ceiling of ${chunkQ4RDWB3U_cjs.d}`)}f.push(t&&chunkQ4RDWB3U_cjs.h(x)!==void 0?x:Object.freeze({request:Object.freeze({family:m.family,weight:m.weight,style:m.style}),id:g,bytes:T,hash:R,faceIndex:v,...h?{availability:h}:{}}));}let S;if(a){S=[];for(let b=0;b<d;b+=1){let x=a[b],m=x.from,h=x.to,g=x.lineMetrics;S.push(Object.freeze({from:Object.freeze({family:m.family,weight:m.weight,style:m.style}),to:Object.freeze({family:h.family,weight:h.weight,style:h.style}),...g?{lineMetrics:Object.freeze({heightEm:g.heightEm,baselineEm:g.baselineEm})}:{}}));}}let y={epoch:n,maxFontBytes:r,sources:Object.freeze(f),substitutions:S?Object.freeze(S):void 0,defaultFont:Object.freeze({family:i.family,sizeHalfPoints:i.sizeHalfPoints}),language:c};return Object.freeze(y)}function qt(e,t){let n=e.map((o,a)=>({value:o,index:a,key:chunkQ4RDWB3U_cjs.i(t(o))})),r=new Set;for(let o of n){if(r.has(o.key))return e;r.add(o.key);}return n.sort((o,a)=>o.key<a.key?-1:o.key>a.key?1:o.index-a.index).map(({value:o})=>o)}function jr(e,t){let n={family:e.family},r={sizeHalfPoints:e.sizeHalfPoints};return {...n,...t?r:{}}}function Zt(e,t){let n=s=>({family:s.family,weight:s.weight,style:s.style}),r=t?e.sources:qt(e.sources,s=>s.request),o=e.substitutions??[],a=t?o:qt(o,s=>s.from),i={sources:r.map(s=>{let d=s.availability??"available",l={request:n(s.request),availability:d};if(d==="forbidden")return {...l,...t?{id:s.id,faceIndex:s.faceIndex,declaredHash:s.hash}:{}};let f=chunkQ4RDWB3U_cjs.h(s);if(f==null)throw new TypeError("Font configuration identity requires prepared source bytes");return {...l,...t?{id:s.id}:{},faceIndex:s.faceIndex,declaredHash:s.hash,actualHash:f,byteLength:s.bytes.byteLength}}),substitutions:a.map(s=>({from:n(s.from),to:n(s.to),lineMetrics:s.lineMetrics?{heightEm:s.lineMetrics.heightEm,baselineEm:s.lineMetrics.baselineEm}:null})),defaultFont:jr(e.defaultFont,t),language:e.language||"en"},c={epoch:e.epoch,maxFontBytes:e.maxFontBytes};return {version:1,...t?c:{},...i}}var Yr=Symbol("prepared-layout-font-configuration"),Be=new WeakMap;function $r(e){return Be.has(e)}function qr(e){let t=Be.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.configuration}function Aa(e){let t=Be.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.sharedShapingFingerprint}function nt(e,t){return Qt(e,t,false)}function Pa(e,t){return Qt(e,t,true)}function Qt(e,t,n){let r=Vr(e,n),o=Object.freeze({epoch:r.epoch,maxFontBytes:r.maxFontBytes,sources:Object.freeze(r.sources.map(f=>n&&chunkQ4RDWB3U_cjs.h(f)!==void 0?f:chunkQ4RDWB3U_cjs.g(f,{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash}))),substitutions:r.substitutions,defaultFont:r.defaultFont,language:r.language}),a=new TextEncoder,i=Zt(o,true),c=a.encode(JSON.stringify(i)),s=Zt(o,false),d=a.encode(JSON.stringify(s)),l=Object.freeze({[Yr]:true,fingerprint:`font-config:${chunk6KA3L3FR_cjs.a(c)}`});return Be.set(l,{configuration:o,sharedShapingFingerprint:`shared-font-config:${chunk6KA3L3FR_cjs.a(d)}`}),l}function Zr(e){return nt(e).fingerprint}function Jr(e,t){let n=new TextEncoder().encode(JSON.stringify({version:1,environment:e,executionPolicy:Yt(t),ligatureCaretPolicy:Jt,fallback:chunkQ4RDWB3U_cjs.ea}));return `shaping:${chunk6KA3L3FR_cjs.a(n)}`}async function en(e,t,n,r,o=false){let i=$r(e)?e:nt(e,t),c=qr(i),{epoch:s,maxFontBytes:d,sources:l,substitutions:f,defaultFont:S}=c,y=c.language||"en",b=i.fingerprint,x=chunkQ4RDWB3U_cjs.n({epoch:s,maxFontBytes:d,resources:l,substitutions:f,validateFont:Je,instrumentation:{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash,onAdmission:t?.onFontAdmission}});await Ze();let m=Object.freeze({script:Kr,variationAxes:Object.freeze({}),shapingLibrary:$,unicodeDataVersion:Hr,normalization:Ur,language:y,features:Dr,...o?{documentLigatures:true}:{},fixedPointScale:Gr,roundingMode:Wr});return Object.freeze({fonts:x,shaper:n??et(r),defaultFont:S,environment:m,ligatureCaretPolicy:Jt,operation:Object.freeze({resourceEpoch:x.epoch,configEpoch:s,extensionFingerprint:b,shapingHash:Jr(m,r),producerVersion:1})})}async function Qr(e,t){return en(e,t,void 0,tt)}async function _a(e,t,n,r,o=false){return en(e,r,t,n,o)}function eo(e){e.shaper.dispose?.();}function rt(e){let t=new Set([0,e.text.length]);for(let r of chunkQ4RDWB3U_cjs.ka(e.text))t.add(r.utf16From),t.add(r.utf16To);let n=new Set([0,e.text.length]);for(let r of e.clusters)n.add(r.textStart),n.add(r.textEnd);return [...t].filter(r=>n.has(r)).sort((r,o)=>r-o)}function Ie(e,t){return rt(e).includes(t)}function to(e,t){return Ie(e,t)}function no(e,t,n){return n>=t&&Ie(e,t)&&Ie(e,n)}function ro(e){let t=chunkQ4RDWB3U_cjs.ka(e.text);return rt(e).map(n=>n===e.text.length?t.length:t.findIndex(r=>r.utf16From===n))}var at="und";function on(){return typeof Intl.Segmenter=="function"}function oo(){let e=Intl.Segmenter;if(typeof e!="function")throw new Error(`Intl.Segmenter is required for word segmentation (locale: ${at})`);return e}function an(){let e=new(oo())(at,{granularity:"word"});return {segment(t){let n=[];for(let r of e.segment(t)){let o=r.index,a=o+r.segment.length;n.push({utf16From:o,utf16To:a,wordLike:r.isWordLike===true});}return n}}}var ao=/^[\p{L}\p{N}']$/u,io=/^\s$/u;function tn(e){return ao.test(e)}function nn(e){return io.test(e)}function ot(e,t,n,r){let o=e[t],a=e[n-1];return {utf16From:o.utf16From,utf16To:a.utf16To,wordLike:r}}function sn(e){let t=chunkQ4RDWB3U_cjs.ka(e);if(t.length===0)return [];let n=[],r=0;for(;r<t.length;){let o=t[r];if(nn(o.text)){let a=r+1;for(;a<t.length&&nn(t[a].text);)a+=1;n.push(ot(t,r,a,false)),r=a;continue}if(tn(o.text)){let a=r+1;for(;a<t.length&&tn(t[a].text);)a+=1;n.push(ot(t,r,a,true)),r=a;continue}n.push(ot(t,r,r+1,false)),r+=1;}return n}function cn(){return {segment:sn}}function ln(e={}){let t=e.isIntlAvailable??on,n=e.createIntlBoundary??an,r=e.createFallbackBoundary??cn;if(!t())return r();try{return n()}catch{return r()}}var rn;function dn(){return rn??=ln(),rn}function so(e,t=dn()){return t.segment(e)}function co(e,t){return t.map(n=>({graphemeFrom:chunkQ4RDWB3U_cjs.oa(e,n.utf16From),graphemeTo:chunkQ4RDWB3U_cjs.oa(e,n.utf16To),wordLike:n.wordLike}))}var un={resourceEpoch:"resource-scoped",configEpoch:"coarse-gate",extensionFingerprint:"coarse-gate",shapingHash:"coarse-gate",producerVersion:"coarse-gate"},ct=Object.keys(un),pn=ct.filter(e=>un[e]==="coarse-gate"),Oe=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},ee=(e,t)=>{if(e.trim().length===0)throw new TypeError(`${t} must not be blank`)},lo={resourceEpoch:Oe,configEpoch:Oe,extensionFingerprint:ee,shapingHash:ee,producerVersion:Oe},uo=(e,t)=>{lo[t](e[t],t);},te=e=>{for(let t of ct)uo(e,t);return Object.freeze({resourceEpoch:e.resourceEpoch,configEpoch:e.configEpoch,extensionFingerprint:e.extensionFingerprint,shapingHash:e.shapingHash,producerVersion:e.producerVersion})},po=(e,t)=>{let n=te(e),r=te(t),o=ct.filter(a=>n[a]!==r[a]);return o.length===0?Object.freeze({status:"current"}):Object.freeze({status:"restart",changed:Object.freeze(o)})},it=e=>{let t=e.map(({key:n,fingerprint:r})=>(ee(n,"resource dependency key"),ee(r,"resource dependency fingerprint"),Object.freeze({key:n,fingerprint:r}))).sort((n,r)=>n.key<r.key?-1:n.key>r.key?1:0);for(let n=1;n<t.length;n+=1)if(t[n-1].key===t[n].key)throw new TypeError(`Duplicate resource dependency: ${t[n].key}`);return Object.freeze(t)},fo=e=>(Oe(e.revision,"revision"),ee(e.dependencyFingerprint,"dependencyFingerprint"),ee(e.inputFingerprint,"inputFingerprint"),Object.freeze({revision:e.revision,dependencyFingerprint:e.dependencyFingerprint,inputFingerprint:e.inputFingerprint,resourceDependencies:it(e.resourceDependencies),...te(e)})),yo=(e,t)=>{let n=it(e),r=it(t),o=Math.max(n.length,r.length);for(let a=0;a<o;a+=1){let i=n[a],c=r[a];if(i?.key!==c?.key||i?.fingerprint!==c?.fingerprint)return {hit:false,reason:"resource-changed",resourceKey:i?.key??c.key}}return null};function mo(e,t){if(e.dependencyFingerprint!==t.dependencyFingerprint)return {hit:false,reason:"dependency-changed"};if(e.inputFingerprint!==t.inputFingerprint)return {hit:false,reason:"input-changed"};let n=yo(e.resourceDependencies,t.resourceDependencies);if(n)return n;for(let r of pn)if(e[r]!==t[r])return {hit:false,reason:"epoch-changed",epoch:r};return null}var st=class{entries=new Map;get(t,n){let r=this.entries.get(t);if(!r)return {hit:false,reason:"absent"};let o=mo(r.provenance,n);return o||{hit:true,value:r.value,provenance:r.provenance}}set(t,n,r){this.entries.set(t,{value:n,provenance:fo(r)});}evictEpoch(t){let n=te(t),r=0;for(let[o,a]of this.entries){let i=a.provenance;pn.some(c=>i[c]!==n[c])&&(this.entries.delete(o),r+=1);}return r}evictResources(t,n){let r=te(t),o=this.evictEpoch(r);for(let[a,i]of this.entries)i.provenance.resourceDependencies.some(s=>n.get(s.key)!==s.fingerprint)&&(this.entries.delete(a),o+=1);return o}get size(){return this.entries.size}};function fn(e){return e.projected===true?null:e.range}function go(e,t,n){let{page:r,story:o,host:a,noteScopeId:i,noteAreaKind:c}=e,s=o==="header"||o==="footer"?d=>chunkQ4RDWB3U_cjs.ta(d,e.origin,{x:r.box.x,y:r.box.y}):void 0;chunkQ4RDWB3U_cjs.Ca(a,(d,l)=>{let{textboxDepth:f,textboxOwner:S,textboxPath:y,storyOrigin:b}=l,x=f===0?o:"textbox";for(let m of d.lines){let h=[...chunkQ4RDWB3U_cjs.Ja(m)].sort((g,R)=>(t.get(g.paragraphId)??Number.MAX_SAFE_INTEGER)-(t.get(R.paragraphId)??Number.MAX_SAFE_INTEGER));for(let g of h)for(let R of g.spans)n({page:r,story:x,rootStory:o,root:e,storyOrigin:b,absoluteBox:Object.freeze({x:b.x+R.box.x,y:b.y+R.box.y,width:R.box.width,height:R.box.height}),noteScopeId:i,noteAreaKind:c,textboxDepth:f,textboxOwner:S,textboxPath:y,paragraph:d,paragraphId:g.paragraphId,line:m,span:R,sourceRange:fn(R)});}},e.origin,s);}function So(e,t){let n=new Map(chunkQ4RDWB3U_cjs.Pa(e).map((r,o)=>[r,o]));chunkQ4RDWB3U_cjs.za(e,r=>go(r,n,t));}var xo=1,yn=4,V=Object.freeze({top:0,right:0,bottom:0,left:0}),mn=new WeakMap;function Ro(e,t){let n=Co(e);return n===V?t:chunkQ4RDWB3U_cjs.cb(t,n)}function Co(e){let t=e.vectorShape;if(!t)return V;let{cx:n,cy:r}=t.extentEmu;if(!(n>=0)||!(r>=0)||n===0&&r===0)return V;let o=mn.get(t);if(o||(o=Fo(t),mn.set(t,o)),o===V)return V;let a=e.paintBounds,i=e.geometry.contentBounds;if(!(a.width>0||i.width<=0)||!(a.height>0||i.height<=0))return V;let c=n>0?i.width/n:i.height/r,s=r>0?i.height/r:i.width/n,d=(f,S,y)=>{if(y<-1e-3)return 0;let b=f*S-Math.max(0,y);return Number.isFinite(b)&&b>0?b:0},l={left:d(o.left,c,i.x-a.x),top:d(o.top,s,i.y-a.y),right:d(o.right,c,a.x+a.width-(i.x+i.width)),bottom:d(o.bottom,s,a.y+a.height-(i.y+i.height))};return l.left||l.top||l.right||l.bottom?Object.freeze(l):V}function Fo(e){let{cx:t,cy:n}=e.extentEmu,r=0,o=0,a=t,i=n,c=(l,f)=>{r=Math.min(r,l),a=Math.max(a,l),o=Math.min(o,f),i=Math.max(i,f);},s=xo,d=l=>l.x>=-s&&l.x<=t+s&&l.y>=-s&&l.y<=n+s;for(let l of e.components){if(l.strokeHex===null||l.strokeInset===true)continue;let f=Math.max(1,chunkQ4RDWB3U_cjs.bb(l.strokeWidthEmu))/2;l.subpathsEmu.forEach((S,y)=>{let b=l.subpathsClosed?.[y]!==false,x=vo(S,b),m=b&&x.length>2?x.length:x.length-1,h=[];for(let R=0;R<m;R+=1){let v=x[R],L=x[(R+1)%x.length],T=Math.hypot(L.x-v.x,L.y-v.y),p={x:-(L.y-v.y)/T,y:(L.x-v.x)/T};if(h.push(p),!!Eo(v,L,-s,t+s,-s,n+s))for(let u=0;u<2;u+=1){let C=G[u],F=v.x+(L.x-v.x)*C,E=v.y+(L.y-v.y)*C;c(F+p.x*f,E+p.y*f),c(F-p.x*f,E-p.y*f);}}let g=b&&x.length>2?h.length:h.length-1;for(let R=0;R<g;R+=1){let v=x[(R+1)%x.length];if(!d(v))continue;let L=h[R],T=h[(R+1)%h.length],p=1+L.x*T.x+L.y*T.y;if(p<2/(yn*yn))continue;let u=L.y*-T.x- -L.x*T.y;if(u===0)continue;let C=u>0?-1:1;c(v.x+C*(L.x+T.x)*f/p,v.y+C*(L.y+T.y)*f/p);}});for(let S of l.arrowheadsEmu??[])if(!(!S[0]||!d(S[0])))for(let y of S)c(y.x,y.y);}return r>=0&&o>=0&&a<=t&&i<=n?V:Object.freeze({left:-r,top:-o,right:a-t,bottom:i-n})}function vo(e,t){let n=[];for(let a of e){let i=n[n.length-1];(!i||i.x!==a.x||i.y!==a.y)&&n.push(a);}let r=n[0],o=n[n.length-1];return t&&n.length>1&&r.x===o.x&&r.y===o.y&&n.pop(),n}var G=new Float64Array(2);function Eo(e,t,n,r,o,a){let i=t.x-e.x,c=t.y-e.y;return G[0]=0,G[1]=1,Te(-i,e.x-n)&&Te(i,r-e.x)&&Te(-c,e.y-o)&&Te(c,a-e.y)}function Te(e,t){if(e===0)return t>=0;let n=t/e;return e<0?G[0]=Math.max(G[0],n):G[1]=Math.min(G[1],n),G[0]<=G[1]}function N(e){return (e.kerningEnabled??e.kerningMinPt>0)&&e.kerningMinPt>0&&e.fontSizePt>=e.kerningMinPt}var bn="Calibri, Carlito, Helvetica, Arial, sans-serif",ei=new Map([["calibri","Carlito"]]),Lo=65536,Bo=256;function hn(e,t){return e===void 0?Math.max(1,Math.floor(t)):Number.isFinite(e)&&e>0?Math.max(1,Math.floor(e)):1}function gn(e){let t=new Map,n=0;return {get(r){let o=t.get(r);if(o!==void 0)return t.delete(r),t.set(r,o),o},set(r,o){for(t.has(r)&&t.delete(r),t.set(r,o);t.size>e;){let a=t.keys().next();if(a.done)break;t.delete(a.value),n+=1;}},get size(){return t.size},get evictions(){return n}}}var Sn=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function xn(e=null){return e!=null&&typeof e.measureText=="function"}function Rn(e={}){let t=e.scale??1;if(!(t>0)||!Number.isFinite(t))return null;let n=e.fallbackFamily??bn,r=e.context??null;if(!xn(r))return null;let o=r,a=gn(hn(e.maxWidthEntries,Lo)),i=gn(hn(e.maxMetricsEntries,Bo)),c=e.fontAlias,s=l=>{let f=l.fontFamily&&Sn.test(l.fontFamily)?l.fontFamily:null,S=f?c?.(f):void 0,y=S&&Sn.test(S)?S:null,b=f?y?`"${y}", "${f}", ${n}`:`"${f}", ${n}`:n,x=l.bold?"bold":"normal",m=l.italic?"italic":"normal",h=l.smallCaps?"small-caps":"normal",g=l.fontSizePt*chunkQ4RDWB3U_cjs.da(l)*t;return `${m} ${h} ${x} ${g}px ${b}`},d=(l,f,S)=>l/t*(S.horizontalScalePercent/100)+f.length*S.characterSpacingPt;return {measure(l,f){if(l.length===0)return 0;let S=s(f),y=`${S}\0${N(f)}\0${l}`,b=a.get(y);if(b!==void 0)return d(b,l,f);o.font=S,"fontKerning"in o&&(o.fontKerning=N(f)?"normal":"none");let x=o.measureText(l).width;return a.set(y,x),d(x,l,f)},inkBounds(l,f){if(!l||l.length>2||f.shaping?.direction==="rtl"||chunkQ4RDWB3U_cjs.ka(l).length!==1)return;o.font=s(f),"fontKerning"in o&&(o.fontKerning=N(f)?"normal":"none");let S=o.textAlign,y=o.direction,b;try{S!==void 0&&(o.textAlign="left"),y!==void 0&&(o.direction="ltr"),b=o.measureText(l);}finally{S!==void 0&&(o.textAlign=S),y!==void 0&&(o.direction=y);}let x=b.actualBoundingBoxLeft,m=b.actualBoundingBoxRight;if(x===void 0||m===void 0||!Number.isFinite(x)||!Number.isFinite(m))return;let h=f.horizontalScalePercent/(100*t);return {left:-x*h,right:m*h}},lineMetrics(l){let f=l.fontSizePt*chunkQ4RDWB3U_cjs.da(l),S=s(l),y=i.get(S);if(y)return y;let b=f*1.15,x=f*.8;o.font=S,"fontKerning"in o&&(o.fontKerning=N(l)?"normal":"none");let m=o.measureText("Hxg"),h=m.fontBoundingBoxAscent,g=m.fontBoundingBoxDescent;if(typeof h=="number"&&Number.isFinite(h)&&h>0&&(x=h/t,typeof g=="number"&&Number.isFinite(g)&&g>=0)){let v=(h+g)/t;v>0&&(b=Math.max(v,b));}b>0||(b=f*1.15);let R={height:b,baseline:x};return i.set(S,R),R}}}function Io(e=1,t={}){let n=Rn({...t,scale:t.scale??e});return n?{measurer:n,producer:t.fontAlias?"canvas-measurer+embedded":"canvas-measurer"}:{measurer:chunkQ4RDWB3U_cjs.fa(),producer:"fixed-measurer"}}function Oo(e){let t;return n=>{t===void 0&&(t=chunkQ4RDWB3U_cjs.Yc(e.pages)?.hosts??null);let r=t?.get(n);return r?chunkQ4RDWB3U_cjs.Wc(r.pageNumber,r.format):null}}function Cn(e,t){let n=chunkQ4RDWB3U_cjs.xc(e,t.displayMode??chunkQ4RDWB3U_cjs.Ra),r=chunkQ4RDWB3U_cjs.uc({numberingIndex:t.numberingIndex,styleCascade:t.styleCascade},n).listItems,o=t.package?{footnotesPart:chunk6KA3L3FR_cjs.bg(t.package,"footnote"),endnotesPart:chunk6KA3L3FR_cjs.bg(t.package,"endnote")}:void 0,a=chunkQ4RDWB3U_cjs.Uc(n,r,o,t.package?chunkQ4RDWB3U_cjs.Rc(t.package,e,n):void 0,t.displayMode??chunkQ4RDWB3U_cjs.Ra);return {blocks:n,notes:o,context:a}}function Fn(e,t,n,r,o){for(let a of t){if(r.length>=chunk6KA3L3FR_cjs.Vh)return;if(n.tokenForParagraph(a.id)!==""&&chunk6KA3L3FR_cjs.Yh(e,a.id)===null)for(let i of chunk6KA3L3FR_cjs.Xh(a)){if(r.length>=chunk6KA3L3FR_cjs.Vh)return;if(!i.rewritable)continue;let c=chunkQ4RDWB3U_cjs.ob(i.instruction);if(c===null)continue;let s=n.liveValueOf(i.fieldNodeId,c);if(s===null&&o&&n.pageRefProjectionOf){let d=n.pageRefProjectionOf(i.fieldNodeId,c);if(d){let l=o(d.targetParagraphId);l!==null&&l.length>0&&chunkQ4RDWB3U_cjs.Xc(d.calibration,d.cached,l,Number.NaN)&&(s=l);}}s===null||s===i.cachedText||s.length>chunk6KA3L3FR_cjs.Wh||s.includes(`
|
|
2
|
-
`)||s.includes("\r")||r.push({paragraphId:a.id,fieldNodeId:i.fieldNodeId,text:s});}}}function To(e,t){let{blocks:n,context:r}=Cn(e,t);if(r===null)return null;let o=[];return Fn(e,chunkQ4RDWB3U_cjs.sc(chunkQ4RDWB3U_cjs.mc(n)),r,o,t.pageRefPageNumberOf),o.length===0?null:{op:"refreshFieldResults",updates:o}}function ui(e,t){let{notes:n,context:r}=Cn(e,t);if(r===null||n===void 0)return [];let o=[],a=[{noteKind:"footnote",notesPart:n.footnotesPart},{noteKind:"endnote",notesPart:n.endnotesPart}];for(let{noteKind:i,notesPart:c}of a){if(!c)continue;let s=[];for(let d of chunkQ4RDWB3U_cjs.Sc(c,t.displayMode??chunkQ4RDWB3U_cjs.Ra)){if(s.length>=chunk6KA3L3FR_cjs.Vh)break;Fn(c,chunkQ4RDWB3U_cjs.sc(chunkQ4RDWB3U_cjs.mc(d)),r,s);}s.length>0&&o.push({noteKind:i,op:{op:"refreshFieldResults",updates:s}});}return o}function wo(e){return e.box}function vn(e,t){if(e.kind==="paragraph"){t.add(e.paragraphId);return}for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks)vn(o,t);}function Ao(e){let t=new Map,n=(o,a,i)=>{if(!(o.kind==="textValue"||i>chunk6KA3L3FR_cjs.kb*4)){for(let c of o.children)if(c.kind!=="textValue"){if(c.kind==="paragraph"){for(let s of r)t.get(s)?.push(c.id);n(c,c.id,i+1);continue}if(c.kind==="contentControl"){t.set(c.id,[]),r.push(c.id);let s=chunk6KA3L3FR_cjs.ub(c);s&&n(s,a,i+1),r.pop();let d=t.get(c.id);d&&d.length===0&&a!==null&&d.push(a);continue}n(c,a,i+1);}}},r=[];return n(e,null,0),t}function Po(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return {x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function _o(e,t){let n=chunk6KA3L3FR_cjs.yb(e.root);if(n.length===0)return Mo;let r=new Map;t.pages.forEach((i,c)=>{(d=>{for(let l of d){let f=new Set;vn(l,f);for(let S of f){let y=r.get(S)??[];y.push({pageIndex:c,box:wo(l)}),r.set(S,y);}}})(i.fragments);});let o=Ao(e.root),a=[];for(let i of n){let c=chunk6KA3L3FR_cjs.wb(i.node),s=[...i.ancestors.map(S=>chunk6KA3L3FR_cjs.wb(S).lock),c.lock],d=o.get(i.node.id)??[],l=new Map;for(let S of d)for(let y of r.get(S)??[]){let b=l.get(y.pageIndex);l.set(y.pageIndex,b?Po(b,y.box):y.box);}let f=[...l.entries()].sort((S,y)=>S[0]-y[0]).map(([S,y])=>({pageIndex:S,...y}));a.push({controlId:i.node.id,type:c.type,level:chunk6KA3L3FR_cjs.xb(i.node),depth:i.depth,lock:c.lock,effectiveLock:chunk6KA3L3FR_cjs.Bb(s),showingPlaceholder:c.showingPlaceholder,temporary:c.temporary,...c.tag===void 0?{}:{tag:c.tag},...c.alias===void 0?{}:{alias:c.alias},...c.id===void 0?{}:{id:c.id},...c.dataBinding===void 0?{}:{dataBinding:c.dataBinding},paragraphIds:d,fragments:f});}return a}var Mo=Object.freeze([]);function Ln(e,t,n){let r=e.lines?.find(o=>{let a=o.spans;if(!a)return n<o.range.end;let i=a.filter(c=>c.range.paragraphId===t);return i.length===a.length?n<o.range.end:i.length>0&&n<i[i.length-1].range.end});return r?r.box.y:e.fragmentY}function Vo(e,t){let n=new Map;for(let r of e.pages)for(let[o,a]of jo(r,t))n.has(o)||n.set(o,a);return n}var En=new WeakMap;function jo(e,t){let n=En.get(t);n||(n=new WeakMap,En.set(t,n));let r=n.get(e);if(r)return r;let o=new Map;for(let a of t(e)){let i=new Set([a.paragraphId]);for(let c of a.lines??[])for(let s of c.spans??[])i.add(s.range.paragraphId);for(let c of i)o.has(c)||o.set(c,{pageIndex:e.index,contentY:e.contentBox.y,fragmentY:a.box.y,...a.lines?{lines:a.lines}:{}});}return n.set(e,o),o}function Yo(e,t){let n=chunkT7RGKBCE_cjs.oa(e);if(!n)return null;let r=t.get(n.start.paragraphId);return r?{pageIndex:r.pageIndex,y:r.contentY+Ln(r,n.start.paragraphId,n.start.offset)}:null}var Bn=new WeakMap;function $o(e){let t=Bn.get(e);if(t!==void 0)return t;let n=chunkQ4RDWB3U_cjs.j(e),r=new DataView(n.buffer,n.byteOffset,n.byteLength),o=false,a=r.getUint32(0)===1953784678?r.getUint32(12+e.faceIndex*4):0,i=r.getUint16(a+4);for(let c=0;c<i;c++){let s=a+12+c*16;if(r.getUint32(s)!==1330851634)continue;let d=r.getUint32(s+8),l=r.getUint32(s+12);l>=86&&d<=n.byteLength-l&&r.getUint16(d)>=1&&(o=(r.getUint32(d+78)&1966080)!==0);break}return Bn.set(e,o),o}function In(e,t,n,r,o){if(r>o||Math.abs(n.height-t)>o||!$o(e))return n;let a=t*.3;return {height:n.height+a,baseline:n.baseline+a/2}}var qo="abcdefghijklmnopqrstuvwxyz";function q(e){let t=Math.round(e.fontSizePt*2);return Math.max(1,t)}function W(e,t,n,r,o){let a=r.shaping?.context;return e.shape({text:o,fontSizeHalfPoints:q(r),bidiLevel:r.shaping?.direction==="rtl"?1:0,environment:Zo(t,n,r),...a?{context:a}:{}})}var On=new WeakMap;function Zo(e,t,n){if(!Object.isFrozen(e)||!Object.isFrozen(e.features)||!Object.isFrozen(e.variationAxes)||!Object.isFrozen(e.shapingLibrary))return Tn(e,t,n);let r=n.shaping?.direction??"ltr",o=n.shaping?.script,a=`${r}|${o??""}|${N(n)?1:0}|${e.documentLigatures?chunkQ4RDWB3U_cjs.B(n):""}|${n.smallCaps?1:0}`,i=On.get(e);i||On.set(e,i=new WeakMap);let c=i.get(t);c||i.set(t,c=new Map);let s=c.get(a);return s||c.set(a,s=Tn(e,t,n)),s}function Tn(e,t,n){return chunkQ4RDWB3U_cjs.q({...e,font:t,direction:n.shaping?.direction??"ltr",script:n.shaping?.script==="Zyyy"?e.script:n.shaping?.script??e.script,features:{...e.features,kern:N(n)?1:0,...e.documentLigatures?chunkQ4RDWB3U_cjs.A(n):{},...n.smallCaps?{smcp:1}:{}},fallbackOrder:[]})}function we(e,t,n,r,o){let a=o.get(n);if(a!==void 0)return a;let i=true;try{for(let c of qo){let s=W(e,t,n,{...r,smallCaps:!0},c),d=W(e,t,n,{...r,smallCaps:!1},c);if(!(s.glyphs.length!==d.glyphs.length||s.glyphs.some((f,S)=>f.id!==d.glyphs[S]?.id))){i=!1;break}}}catch{i=false;}return o.set(n,i),i}function wn(e,t,n,r,o){let a=new WeakMap;return (i,c)=>{let s=chunkQ4RDWB3U_cjs.da(c),d=a.get(i);d||(d=new Map,a.set(i,d));let l=q(c),f=d.get(l);if(f)return s===1?f:{height:f.height*s,baseline:f.baseline*s};let S,y=true,b=i.substitution?.lineMetrics;if(b){let x=l/2;S={height:b.heightEm*x,baseline:b.baselineEm*x};}else try{let x=W(e,t,i,c,""),m=x.metrics.ascent/t.fixedPointScale,h=x.metrics.descent/t.fixedPointScale,g=l/2,R=m+h,v=g*r,L=R>v?v/R:1,T=R*L,p=Math.min(Math.max(0,x.metrics.lineGap/t.fixedPointScale),T*o),u=T+p;u>0?S=In(i,g,{height:u,baseline:m*L+p},p,2/t.fixedPointScale):(S=n.lineMetrics(c),y=!1);}catch{S=n.lineMetrics(c),y=false;}return y?(d.set(l,S),s===1?S:{height:S.height*s,baseline:S.baseline*s}):S}}var lt=new WeakMap;function Jo(e){let t=lt.get(e);if(t!==void 0)return t??void 0;let n=e.path;if(!n.startsWith("M")||n.length>1e6||/[^MLQCZ0-9eE+.,\s-]/u.test(n))return;let r=1/0,o=-1/0,a=n.matchAll(/([MLQCZ])([^MLQCZ]*)/gu);for(let c of a){let s=c[1]==="Z"?0:c[1]==="C"?6:c[1]==="Q"?4:2,d=c[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(d.length!==s||d.some(l=>!Number.isFinite(l))){lt.set(e,null);return}for(let l=0;l<d.length;l+=2)r=Math.min(r,d[l]),o=Math.max(o,d[l]);}let i=Number.isFinite(r)&&Number.isFinite(o)?{left:r,right:o}:void 0;return lt.set(e,i??null),i}function An(e,t,n,r){if(e.clusters.length!==1||e.glyphs.length===0)return;let o=1/0,a=-1/0;for(let c of e.glyphs){if(c.id===0)return;let s=Jo(c.outline),d=c.outline.unitsPerEm;if(!s||!(d>0))return;let l=(c.originX+c.offsetX)/n;o=Math.min(o,l+s.left*t*(c.drawScale??1)/d),a=Math.max(a,l+s.right*t*(c.drawScale??1)/d);}let i={left:o*r,right:a*r};return Number.isFinite(i.left)&&Number.isFinite(i.right)?i:void 0}function Qo(e,t,n){if(t<12)return null;if(e.getUint32(0)!==1953784678)return 0;let o=12+(Number.isSafeInteger(n)&&n>0?n:0)*4;if(o+4>t)return null;let a=e.getUint32(o);return a+12<=t?a:null}function Pn(e,t,n,r,o){let a=e.getUint16(n+4);if(a>4096||n+12+a*16>t)return null;for(let i=0;i<a;i+=1){let c=n+12+i*16;if(e.getUint32(c)!==r)continue;let s=e.getUint32(c+8),d=e.getUint32(c+12);return d<o||s+d>t?null:s}return null}function _n(e,t){let n=e.byteLength,r=new DataView(e.buffer,e.byteOffset,n),o=Qo(r,n,t);if(o===null)return null;let a=Pn(r,n,o,1751474532,54);if(a===null)return null;let i=r.getUint16(a+18);if(i<=0)return null;let c=Pn(r,n,o,1330851634,30);if(c===null)return null;let s=r.getInt16(c+26)/i,d=r.getInt16(c+28)/i;return !(s>0)||s>1||!(Math.abs(d)<=1)?null:{offsetEm:d,thicknessEm:s}}var ea=.5,ta=4,Mn=4096;function zn(e){let t="environment"in e?e.environment:void 0,n="environment"in e?void 0:e,{shaper:r,resolveFont:o,fallback:a}=e,i=t??{shapingLibrary:n.shapingLibrary,unicodeDataVersion:n.unicodeDataVersion,script:n?.script??"Latn",fixedPointScale:n?.fixedPointScale??1e3,normalization:n?.normalization??"none",features:n?.features??{},roundingMode:n?.roundingMode??"halfToEven",language:n?.language??"en",variationAxes:{}},c=new WeakMap,s=new WeakMap,d=wn(r,i,a,ta,ea),l=new WeakMap,f=new WeakMap,S=new Array(Mn),y=0,b=(p,u,C)=>{let F=S[y];F&&F.cache.delete(F.text),p.set(u,C),S[y]={cache:p,text:u},y=(y+1)%Mn;},x=p=>{let u=l.get(p);if(u!==void 0)return u;let C=o(p);return l.set(p,C),C},m=(p,u,C)=>{let F=C?s:c,E=F.get(p);E||(E=new Map,F.set(p,E));let O=E.get(u);return O||(O=new Map,E.set(u,O)),O},h=new WeakMap,g=p=>{if(!p.shaping?.wordSpacingPt)return p;let u=h.get(p);return u||(u={...p,shaping:{...p.shaping,wordSpacingPt:void 0}},h.set(p,u)),u},R=(p,u)=>u.shaping?.wordSpacingPt?chunkQ4RDWB3U_cjs.Dd(p)*u.shaping.wordSpacingPt:0,v=(p,u)=>a.measure(p,g(u))+R(p,u),L=(p,u)=>{let C=Math.max(0,a.measure(p,g(u))),F=a.caretAdvances?.(p,g(u))??chunkQ4RDWB3U_cjs.Bd(p,C);if(!F||F.length!==p.length+1)return chunkQ4RDWB3U_cjs.Bd(p,v(p,u));let E=Math.max(0,v(p,u)),O=0,_=0;return F.map((w,I)=>{if(I===0)return 0;p[I-1]===" "&&_++;let A=w+_*(u.shaping?.wordSpacingPt??0);return O=Math.max(O,Math.min(E,Number.isFinite(A)?A:O)),I===p.length?E:O})},T=new WeakMap;return {hasResolvedFont(p){return x(p)!==null},strikeoutMetrics(p){let u=x(p);if(!u)return;let C=T.get(u);if(C===void 0&&(C=_n(u.bytes,u.faceIndex),T.set(u,C)),!C)return;let F=q(p)/2*chunkQ4RDWB3U_cjs.da(p);return {offsetPt:C.offsetEm*F,thicknessPt:C.thicknessEm*F}},measure(p,u){if(p.length===0)return 0;let C=x(u);if(!C)return v(p,u);let F=m(C,q(u),u.smallCaps),E=u.shaping?.context,O=u.shaping?`1:${JSON.stringify(E?[u.shaping.script,u.shaping.direction,p,E.before,E.after]:[u.shaping.script,u.shaping.direction,p])}`:`0:${p}`,_=`${N(u)?1:0}:${chunkQ4RDWB3U_cjs.B(u)}:${O}`,w=F.get(_);if(w===void 0){let I=0;try{if(u.smallCaps&&!we(r,i,C,u,f))return v(p,u);let A=W(r,i,C,u,p);if(A.glyphs.some(Z=>Z.id===0))return v(p,u);for(let Z of A.glyphs)I+=Z.advanceX;}catch{return v(p,u)}w=I/i.fixedPointScale,b(F,_,w);}return w*chunkQ4RDWB3U_cjs.da(u)*(u.horizontalScalePercent/100)+p.length*u.characterSpacingPt+R(p,u)},inkBounds(p,u){if(!p||p.length>2||u.shaping?.direction==="rtl"||chunkQ4RDWB3U_cjs.ka(p).length!==1)return;let C=x(u);if(!C)return a.inkBounds?.(p,u);try{if(u.smallCaps&&!we(r,i,C,u,f))return a.inkBounds?.(p,u);let F=W(r,i,C,u,p);return An(F,q(u)/2,i.fixedPointScale,chunkQ4RDWB3U_cjs.da(u)*u.horizontalScalePercent/100)}catch{return}},caretAdvances(p,u){let C=x(u);if(!C)return L(p,u);try{if(u.smallCaps&&!we(r,i,C,u,f))return L(p,u);let F=W(r,i,C,u,p);return F.glyphs.some(E=>E.id===0)?L(p,u):chunkQ4RDWB3U_cjs.Cd(p,F,chunkQ4RDWB3U_cjs.da(u)*(u.horizontalScalePercent/100)/i.fixedPointScale,u.characterSpacingPt,u.shaping?.wordSpacingPt??0)??chunkQ4RDWB3U_cjs.Bd(p,F.glyphs.reduce((E,O)=>E+O.advanceX,0)*chunkQ4RDWB3U_cjs.da(u)*(u.horizontalScalePercent/100)/i.fixedPointScale+p.length*u.characterSpacingPt+R(p,u))}catch{return L(p,u)}},lineMetrics(p,u){let C=x(p);if(!C)return a.lineMetrics(p,u);if(!u||/^[\t\n\r\f ]*$/.test(u))return d(C,p);try{let F=W(r,i,C,p,u),E=0,O=0;for(let _ of F.fontSpans){let w=d(_.font,p);E=Math.max(E,w.baseline),O=Math.max(O,w.height-w.baseline);}if(E+O>0)return {height:E+O,baseline:E}}catch{}return d(C,p)}}}function na(e,t){return zn({...t,shaper:e.shaper,environment:e.environment})}function ra(e){let{layout:t,viewport:n}=e,r=new Set;if(!n){for(let s of t.pages)r.add(s.index);return r}let o=Math.max(0,Math.trunc(e.overscanPages??1)),a=n.top+n.height,i=-1,c=-1;for(let s of t.pages){let d=s.box.y;d+s.box.height>=n.top&&d<=a&&(i===-1&&(i=s.index),c=s.index);}if(i===-1){let s=oa(t,n.top);s!==null&&(i=s,c=s);}if(i!==-1){let s=Math.max(0,i-o),d=Math.min(t.pages.length-1,c+o);for(let l=s;l<=d;l+=1)r.add(l);}for(let s of e.pinnedPages??[])s>=0&&s<t.pages.length&&r.add(s);return r}function oa(e,t){let n=null,r=Number.POSITIVE_INFINITY;for(let o of e.pages){let a=t<o.box.y?o.box.y-t:t>o.box.y+o.box.height?t-(o.box.y+o.box.height):0;a<r&&(r=a,n=o.index);}return n}var kn=["text-local","paragraph-local","flow-structural","global"];function Nn(e,t){return kn.indexOf(t)>kn.indexOf(e)?t:e}function aa(e){return {impact:"text-local",paragraphIds:new Set,created:new Set,deleted:new Set,dependencyKeys:new Set,structural:false,revision:e}}function ia(e){let{run:t,currentRevision:n,publish:r,schedule:o}=e,a=null,i=null,c=null,s=0,d=0;function l(m){let h=e.runCooperatively;if(!h)return t(m);let g=h(m);c=g;try{for(;;){let R=g.step();if(R)return R;if(n()!==m.revision)return g.cancel(),d+=1,null;if(c!==g)return null}}finally{c===g&&(c=null);}}function f(m){let h=y(n());h.impact=Nn(h.impact,m.impact),h.structural=h.structural||m.structural;for(let g of m.paragraphIds)h.paragraphIds.add(g);for(let g of m.created)h.created.add(g);for(let g of m.deleted)h.deleted.add(g);for(let g of m.dependencyKeys)h.dependencyKeys.add(g);}let S=m=>({impact:m.impact,paragraphIds:m.paragraphIds,created:m.created,deleted:m.deleted,dependencyKeys:m.dependencyKeys,structural:m.structural,revision:m.revision});function y(m){return a||(a=aa(m)),a.revision=Math.max(a.revision,m),a}function b(){!o||i||(i=o(()=>{i=null,x();}));}function x(){i&&(i(),i=null),c&&(c.cancel(),c=null,d+=1);let m=a;if(!m)return false;a=null;let h=S(m),g=l(h);return !g||g.revision!==n()?(s+=1,f(h),b(),false):(r(g,h),true)}return {notify(m){let h=y(n());h.impact=Nn(h.impact,m.impact);for(let g of m.dirty)h.paragraphIds.add(g);for(let g of m.created)h.created.add(g),h.paragraphIds.add(g);for(let g of m.deleted)h.deleted.add(g),h.paragraphIds.add(g);for(let g of m.dependencyKeys)h.dependencyKeys.add(g);for(let g of m.splitJoin)h.structural=true,"split"in g?(h.paragraphIds.add(g.split.from),h.paragraphIds.add(g.split.tail)):(h.paragraphIds.add(g.join.kept),h.paragraphIds.add(g.join.removed));(m.impact==="flow-structural"||m.impact==="global")&&(h.structural=true),b();},invalidateAll(m,h){let g=y(m);g.impact="flow-structural",g.structural=true,h&&g.dependencyKeys.add(h),b();},flush:x,pending:()=>a?S(a):null,cancel(){i?.(),i=null,c?.cancel(),c=null,a=null;},get staleDiscards(){return s},get cancelledRuns(){return d}}}var Dn=new WeakMap;function K(e){let t=Dn.get(e);if(t)return t;let n=new Map,r=new Map,o=new Map,a=new Map,i=(s,d,l,f)=>{for(let S of s){if(S.kind==="paragraph")continue;let y=S.tableId;a.set(y,Math.max(a.get(y)??0,(S.columnEdges?.length??1)-1));let b=o.get(y);b||(b=new Map,o.set(y,b),n.set(y,[]),r.set(y,new Map));for(let x of S.rows){let m=b.get(x.id);m===void 0&&(m=b.size,b.set(x.id,m),r.get(y).set(m,x.cells));for(let h of x.cells)n.get(y).push({pageIndex:d,tableId:y,row:x,cell:h,rowIndex:m,isHeaderRepeat:x.isHeaderRepeat,offsetX:l,offsetY:f}),i(h.blocks,d,l,f);}}};for(let s of e.pages){i(s.fragments,s.index,0,0);for(let d of [s.header,s.footer])d&&i(d.fragments,s.index,d.box.x-s.contentBox.x,d.box.y-s.contentBox.y);for(let d of [s.footnotes,s.endnotes])if(d)for(let l of d.notes)i(l.fragments,s.index,l.box.x-s.contentBox.x,l.box.y-s.contentBox.y);}let c=new Map;for(let[s,d]of n)c.set(s,{placed:d,rows:r.get(s)??new Map,columnCount:a.get(s)??0});return Dn.set(e,c),c}function Wn(e){let t=e.columnCount;for(let n of e.rows.values())for(let r of n)t=Math.max(t,j(r).to+1);return t}var j=e=>({from:e.gridColumn,to:e.gridColumn+Math.max(1,e.gridSpan)-1});function sa(e,t,n){if(t.tableId!==n.tableId)return null;let r=K(e).get(t.tableId);if(!r)return null;let o=Math.min(t.rowIndex,n.rowIndex),a=Math.max(t.rowIndex,n.rowIndex),i=Math.min(j(t).from,j(n).from),c=Math.max(j(t).to,j(n).to),s=y=>{let{from:b,to:x}=j(y);return x>=i&&b<=c},d=y=>(r.rows.get(y)??[]).some(b=>b.vMergeContinue&&s(b)),l=r.rows.size+Wn(r)+2;for(let y=0;!(y>l);y+=1){let b=false;for(let[x,m]of r.rows)if(!(x<o||x>a))for(let h of m){if(!s(h))continue;let{from:g,to:R}=j(h);g<i&&(i=g,b=true),R>c&&(c=R,b=true);}for(;o>0&&d(o);)o-=1,b=true;for(;d(a+1);)a+=1,b=true;if(!b)break}let f=[],S=new Set;for(let y of r.placed){if(y.isHeaderRepeat||y.rowIndex<o||y.rowIndex>a)continue;let{from:b,to:x}=j(y.cell);x<i||b>c||S.has(y.cell.id)||(S.add(y.cell.id),f.push(y.cell.id));}return f.length===0?null:{kind:"cells",tableId:t.tableId,cellIds:f,rows:{from:o,to:a},columns:{from:i,to:c},text:ca(e,t.tableId,f)}}function Yi(e,t){return Kn(e,t,true)}function Ae(e,t){return Kn(e,t,false)}function Kn(e,t,n){let r=new Set(t),o=[],a=new Set;for(let i of K(e).values())for(let c of i.placed)if(!(c.isHeaderRepeat||!r.has(c.cell.id)))for(let s of c.cell.blocks)n&&s.kind!=="paragraph"||ne(s,o,a);return o}function ne(e,t,n){if(e.kind==="paragraph"){for(let r of chunkQ4RDWB3U_cjs.Ma(e))n.has(r)||(n.add(r),t.push(r));return}for(let r of e.rows)if(!r.isHeaderRepeat)for(let o of r.cells)for(let a of o.blocks)ne(a,t,n);}function ca(e,t,n){let r=Ae(e,n),o=r[0],a=r[r.length-1];return !o||!a?la(e,t):{anchor:{paragraphId:o,offset:0},head:{paragraphId:a,offset:chunkQ4RDWB3U_cjs.$e(e,a).length}}}function la(e,t){let n=K(e).get(t);for(let o of n?.placed??[]){if(o.isHeaderRepeat)continue;let a=[];for(let c of o.cell.blocks)ne(c,a,new Set);let i=a[0];if(i){let c={paragraphId:i,offset:0};return {anchor:c,head:c}}}for(let o of e.pages)for(let a of chunkQ4RDWB3U_cjs.ua(o)){let i={paragraphId:a.paragraphId,offset:0};return {anchor:i,head:i}}let r={paragraphId:"",offset:0};return {anchor:r,head:r}}function da(e){let t=[...chunkQ4RDWB3U_cjs.ua(e)];for(let n of [e.header,e.footer])n&&t.push(...chunkQ4RDWB3U_cjs.va(n.fragments));for(let n of [e.footnotes,e.endnotes])if(n)for(let r of n.notes)t.push(...chunkQ4RDWB3U_cjs.va(r.fragments));return t}function ua(e,t){let n=new Set(Ae(e,t)),r=[],o=new Set;for(let a of e.pages)for(let i of da(a))if(n.has(i.paragraphId))for(let c of i.lines)for(let s of c.spans){let d=`${s.range.paragraphId}:${s.range.start}:${s.range.end}`;o.has(d)||(o.add(d),r.push(s));}return r}function pa(e,t){let n=new Set(t),r=[];for(let o of K(e).values())for(let a of o.placed)n.has(a.cell.id)&&r.push({pageIndex:a.pageIndex,x:a.cell.box.x+a.offsetX,y:a.cell.box.y+a.offsetY,width:a.cell.box.width,height:a.cell.box.height});return r}function fa(e,t){let n=K(e).get(t.tableId);if(!n)return "";let r=new Set(t.cellIds),o=n.placed.some(c=>c.cell.logicalGridColumn!==void 0),a=new Map,i=new Set;for(let c of n.placed){if(c.isHeaderRepeat||!r.has(c.cell.id)||i.has(c.cell.id))continue;i.add(c.cell.id);let s=Ae(e,[c.cell.id]).map(f=>chunkQ4RDWB3U_cjs.$e(e,f)).join(`
|
|
3
|
-
`),d=a.get(c.rowIndex),l=c.cell.gridColumn+(o?Math.max(1,c.cell.gridSpan)-1:0);d?d.set(l,s):a.set(c.rowIndex,new Map([[l,s]]));}return [...a.keys()].sort((c,s)=>c-s).map(c=>{let s=a.get(c),d=[];for(let l=0;l<=t.columns.to-t.columns.from;l+=1){let f=o?t.columns.to-l:t.columns.from+l;d.push(s.get(f)??"");}return d.join(" ")}).join(`
|
|
4
|
-
`)}function dt(e,t){return ma(e).get(t)??null}var Hn=new WeakMap;function ya(e){let t=Hn.get(e);if(t)return t;let n=[];for(let r of e.blocks)ne(r,n,new Set);return Hn.set(e,n),n}var Un=new WeakMap;function ma(e){let t=Un.get(e);if(t)return t;let n=new Map;for(let[r,o]of K(e)){let a;for(let i of o.placed)if(!i.isHeaderRepeat)for(let c of ya(i.cell)){let s=n.get(c);s&&s.tableId.length>=r.length||(a??=Wn(o),n.set(c,{tableId:r,rows:o.rows.size,columns:a,rowIndex:i.rowIndex,columnIndex:i.cell.logicalGridColumn??i.cell.gridColumn}));}}return Un.set(e,n),n}function $i(e,t,n){if(n){let a=dt(e,t);if(!a||a.tableId!==n.tableId)return null;let i=n.cellIds[0];if(!i)return null;let c=K(e).get(n.tableId);if(!c)return null;for(let s of c.placed)if(s.cell.id===i)return {tableId:n.tableId,rowId:s.row.id,cellId:i,cellIds:n.cellIds,gridColumnIndex:s.cell.logicalGridColumn??s.cell.gridColumn,isHeaderRepeat:s.isHeaderRepeat};return null}let r=dt(e,t);if(!r)return null;let o=K(e).get(r.tableId);if(!o)return null;for(let a of o.placed){if(a.isHeaderRepeat)continue;let i=[];for(let c of a.cell.blocks)ne(c,i,new Set);if(i.includes(t))return {tableId:r.tableId,rowId:a.row.id,cellId:a.cell.id,cellIds:[a.cell.id],gridColumnIndex:a.cell.logicalGridColumn??a.cell.gridColumn,isHeaderRepeat:a.row.isHeaderRepeat}}return null}var Gn=new WeakMap;function qi(e,t){let n=Gn.get(e);if(n)return n.get(t)??null;let r=new Map;for(let[o,a]of K(e))for(let i of a.placed){if(i.isHeaderRepeat)continue;let c=[];for(let d of i.cell.blocks)ne(d,c,new Set);let s={tableId:o,rowId:i.row.id,cellId:i.cell.id,rowIndex:i.rowIndex,gridColumn:i.cell.gridColumn,gridSpan:i.cell.gridSpan};for(let d of c){let l=r.get(d);l&&l.tableId.length>=o.length||r.set(d,s);}}return Gn.set(e,r),r.get(t)??null}function ha(e,t,n){if(![e,t,n].every(Number.isFinite)||t<=0||n<=0)return {offsetPt:0,count:0};let r=Math.ceil(e/n-1e-9)*n;if(!Number.isFinite(r))return {offsetPt:0,count:0};let o=Math.max(0,r-e);return {offsetPt:o,count:Math.min(8192,Math.max(0,Math.floor((t-o)/n+1e-9)))}}exports.$=we;exports.A=an;exports.B=sn;exports.C=cn;exports.D=ln;exports.E=dn;exports.F=so;exports.G=co;exports.H=te;exports.I=po;exports.J=st;exports.K=fn;exports.L=So;exports.M=Ro;exports.N=N;exports.O=bn;exports.P=ei;exports.Q=xn;exports.R=Rn;exports.S=Io;exports.T=Oo;exports.U=To;exports.V=ui;exports.W=_o;exports.X=Ln;exports.Y=Vo;exports.Z=Yo;exports._=W;exports.a=$n;exports.aa=zn;exports.b=$;exports.ba=na;exports.c=Ze;exports.ca=ra;exports.d=qn;exports.da=ia;exports.e=B;exports.ea=sa;exports.f=Je;exports.fa=Yi;exports.g=Wt;exports.ga=Ae;exports.h=et;exports.ha=ua;exports.i=La;exports.ia=pa;exports.j=U;exports.ja=fa;exports.k=$r;exports.ka=dt;exports.l=qr;exports.la=$i;exports.m=Aa;exports.ma=qi;exports.n=nt;exports.na=ha;exports.o=Pa;exports.p=Zr;exports.q=Qr;exports.r=_a;exports.s=eo;exports.t=rt;exports.u=Ie;exports.v=to;exports.w=no;exports.x=ro;exports.y=at;exports.z=on;
|