@docx-editor.dev/core 2.34.0 → 2.35.0-canary.20261102190412.sha-b9a04a3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.js +1 -1
  3. package/dist/binding.cjs +1 -1
  4. package/dist/binding.js +1 -1
  5. package/dist/{chunk-V7CO55DO.cjs → chunk-36OE5A2F.cjs} +2 -2
  6. package/dist/chunk-4BMTYXQL.cjs +7 -0
  7. package/dist/{chunk-5HUVQXET.cjs → chunk-4UOOFSL5.cjs} +2 -2
  8. package/dist/{chunk-VLQDQNSS.js → chunk-5KPONTUV.js} +1 -1
  9. package/dist/{chunk-KCUXXO3Q.js → chunk-5X23LOBT.js} +1 -1
  10. package/dist/{chunk-VQOAC3VI.cjs → chunk-6JKXXUXG.cjs} +20 -20
  11. package/dist/chunk-7N553ZFH.js +1 -0
  12. package/dist/{chunk-5KOLFKOB.cjs → chunk-AXUSFHCQ.cjs} +5 -5
  13. package/dist/{chunk-ZJ74LCFI.cjs → chunk-BI2HHPJ7.cjs} +1 -1
  14. package/dist/{chunk-E5BKDHIP.cjs → chunk-CCGWLTCP.cjs} +1 -1
  15. package/dist/{chunk-L74TCGVH.cjs → chunk-CNGBQ36V.cjs} +1 -1
  16. package/dist/{chunk-7FUORGCW.js → chunk-CZIRRKXA.js} +1 -1
  17. package/dist/{chunk-DYLB5U42.js → chunk-EVTBNATS.js} +1 -1
  18. package/dist/{chunk-DR6W23TB.cjs → chunk-GVZRSFUY.cjs} +1 -1
  19. package/dist/{chunk-NEM774E3.cjs → chunk-HBEVI765.cjs} +1 -1
  20. package/dist/chunk-HQGFS7O5.js +30 -0
  21. package/dist/chunk-I3XDNCUJ.js +3 -0
  22. package/dist/{chunk-A5BTVPET.cjs → chunk-IK6L3RKU.cjs} +18 -18
  23. package/dist/chunk-IVQT6HDE.js +7 -0
  24. package/dist/chunk-JWNOCKTF.js +4 -0
  25. package/dist/{chunk-6MF5PN2E.js → chunk-KDA6HKHR.js} +18 -18
  26. package/dist/chunk-MCNHQCMR.js +2 -0
  27. package/dist/{chunk-37IYWENL.cjs → chunk-MKEJJKTH.cjs} +1 -1
  28. package/dist/{chunk-NKZVMMHU.cjs → chunk-NMV7DRHU.cjs} +1 -1
  29. package/dist/{chunk-AVCYP7OY.js → chunk-NTJWPRUU.js} +5 -5
  30. package/dist/chunk-PA4BATSI.js +32 -0
  31. package/dist/chunk-SRKJYXCG.js +1 -0
  32. package/dist/{chunk-IWXBRUPG.cjs → chunk-TKCFTVY4.cjs} +3 -3
  33. package/dist/{chunk-37RNWL45.js → chunk-UILTSNM6.js} +2 -2
  34. package/dist/{chunk-TXIO5WYQ.cjs → chunk-YBHYIWJH.cjs} +23 -23
  35. package/dist/collaboration/replication.cjs +1 -1
  36. package/dist/collaboration/replication.d.ts +8 -1
  37. package/dist/collaboration/replication.js +1 -1
  38. package/dist/editor.cjs +1 -1
  39. package/dist/editor.js +1 -1
  40. package/dist/export.cjs +2 -2
  41. package/dist/export.js +1 -1
  42. package/dist/index.cjs +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/layout.cjs +1 -1
  45. package/dist/layout.js +1 -1
  46. package/dist/output.cjs +1 -1
  47. package/dist/output.js +1 -1
  48. package/dist/store.cjs +1 -1
  49. package/dist/store.js +1 -1
  50. package/package.json +2 -2
  51. package/dist/chunk-5JP3QQF7.js +0 -7
  52. package/dist/chunk-77JT2AU7.js +0 -2
  53. package/dist/chunk-AFXFH2T2.js +0 -3
  54. package/dist/chunk-BL2E4QRA.js +0 -1
  55. package/dist/chunk-DB7X4Y6O.js +0 -4
  56. package/dist/chunk-KYA4Y2YB.js +0 -1
  57. package/dist/chunk-NBSSQSKY.js +0 -30
  58. package/dist/chunk-UKG2TXWH.cjs +0 -7
  59. package/dist/chunk-YWJSQA2O.js +0 -32
@@ -1,2 +0,0 @@
1
- import {Q,R,T,S}from'./chunk-AFXFH2T2.js';import {h,a,b,e,c,f,re as re$1,Nc,Qc,Sc,Tc,Rc,ie as ie$1,Oc,Pc,nd,kf,Md,Lf,Kf,d,F,xd,ma,Bc,lf,kd,of}from'./chunk-YWJSQA2O.js';import {b as b$1}from'./chunk-BL2E4QRA.js';import {a as a$1,c as c$1,b as b$2}from'./chunk-VLQDQNSS.js';import {qe,Ee,Bb,Aa,pa,Ba,gd,ge as ge$1,f as f$1,va,oa,a as a$2,N}from'./chunk-6MF5PN2E.js';var St=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function Y(e){let t=new Map;for(let n of e)if(Array.isArray(n)){for(let o of n.slice(0,2048)){if(typeof o!="string"||!St.test(o))continue;let r=o.toLowerCase();if(t.has(r)||t.set(r,o),t.size===2048)break}if(t.size===2048)break}return Object.freeze([...t.values()])}function mn(e){let t=e&&"failures"in e?e.failures:void 0;return e==null||(e.sources?.length??0)===0&&(e.substitutions?.length??0)===0&&(t===void 0||Array.isArray(t)&&t.length===0)?void 0:e}var nt=64,ce=Object.freeze({family:"Calibri",sizeHalfPoints:22}),gn=ce;function ee(e,...t){let n=[e,...t],o=[],r=new Set;for(let l of n)for(let u of l.sources??[]){let c=h(u.request);r.has(c)||(r.add(c),o.push(u));}let i=[],s=new Set;for(let l of n)for(let u of l.substitutions??[]){let c=h(u.from);r.has(c)||s.has(c)||(s.add(c),i.push(u));}let a$1=Y(n.map(l=>l.supportedFamilies));return Object.freeze({...a$1.length?{supportedFamilies:a$1}:{},epoch:e.epoch??0,maxFontBytes:e.maxFontBytes??a,sources:Object.freeze(o),...i.length>0?{substitutions:Object.freeze(i)}:{},defaultFont:e.defaultFont??ce,...e.language!==void 0?{language:e.language}:{}})}var Ot=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function te(e){let t=e?.defaultFont?.family;return t!==void 0&&Ot.test(t)?t:ce.family}function G(e){let t="deferred"in e?e.deferred:void 0;if(t===void 0)return {now:e};let{deferred:n,...o}=e;if(typeof t?.then!="function")return {now:o};let r=Promise.resolve(t);return r.catch(()=>{}),{now:o,later:r}}var rt=new WeakSet;function At(e){return e&&rt.add(e),e}function it(e,t){if(!t)return e;let n=e?fe(e):void 0,o=t.deferred?{deferred:t.deferred}:{},r=rt.has(t),i=r?t.supportedFamilies??[]:[...t.supportedFamilies??[],...n?.supportedFamilies??[]];return {...n,sources:r?t.sources??[]:[...t.sources??[],...n?.sources??[]],substitutions:r?t.substitutions??[]:[...t.substitutions??[],...n?.substitutions??[]],supportedFamilies:i.length>0?[...new Set(i)]:void 0,...o}}function Rt(e){return !!e&&((e.sources?.length??0)>0||(e.substitutions?.length??0)>0||e.deferred!==void 0)}function st(e){let t=e&&"failures"in e?e.failures:void 0;return Array.isArray(t)?t.slice(0,256):[]}function at(e,t){return t?t.aborted?Promise.reject(t.reason):new Promise((n,o)=>{let r=()=>o(t.reason);t.addEventListener("abort",r,{once:true}),Promise.resolve(e).then(i=>{t.removeEventListener("abort",r),n(i);},i=>{t.removeEventListener("abort",r),o(i);});}):Promise.resolve(e)}async function lt(e,t,n){let o="failures"in e?e.failures:void 0,r=s=>o===void 0?s:{...s,failures:o},i=e;for(let s=0;s<ot;s+=1){let{now:a,later:l}=G(i);if(!l)return r(a);let u;try{u=await at(l,n);}catch(c){if(n?.aborted)throw n.reason;return t(c),r(a)}for(let c of st(u))t(c);i=it(a,u)??a;}return t(new RangeError(`Font loading stopped after ${ot} deferred steps`)),r(G(i).now)}var ot=256;function fe(e){if(!("failures"in e))return e;let{failures:t,...n}=e;return n}async function de(e,t,n,o){let r=t.flatMap((a,l)=>a?[a.then(u=>({originIndex:l,ok:true,value:u??void 0}),u=>({originIndex:l,ok:false,cause:u}))]:[]);if(r.length===0)return;let i=await at(Promise.race(r),n).catch(()=>{});if(!i||n?.aborted)return;if(i.ok)for(let a of st(i.value))o.report(i.originIndex,a);else o.report(i.originIndex,i.cause);if(!i.ok||!Rt(i.value)){let a=t.map((l,u)=>u===i.originIndex?void 0:l);return de(e,a,n,o)}let s=[];for(let a=0;a<Math.max(e.length,t.length);a+=1){let l=e[a],u=t[a];s.push(a===i.originIndex?it(l,i.value):u?{...l??{sources:[]},deferred:u}:l);}try{return At(await o.compose(s))}catch(a){n?.aborted||o.report(i.originIndex,a);return}}var kt="docx-editor.dev/font-resolver",ft=Symbol.for("docx-editor.dev/font-resolver");function En(e){let t={value:true,enumerable:false,configurable:true};try{Object.defineProperty(e,ft,t),Object.defineProperty(e,kt,t);}catch(n){throw new TypeError("defineFontResolver cannot mark a frozen or sealed function; mark it before freezing, or wrap it in a fresh function and mark that.",{cause:n})}return e}function Cn(e){return typeof e=="function"&&e[ft]===true}var ge=class extends RangeError{constructor(n,o,r){super(`Font source ${n.family} (${o} bytes) exceeds the shaping byte ceiling (${r} bytes)`);this.request=n;}request},pe=class extends AggregateError{causes;constructor(t){let n=Object.freeze(t.slice(0,b*2));super(n,`Font origin rejected all ${n.length} face and substitution candidates`),this.causes=n;}},ne=e=>`${e.family.trim().toLowerCase()} ${e.weight} ${e.style}`;function Tt(e,t,n){let o=new Map(e.map(r=>[ne(r),r]));for(let[r,i]of t)o.set(r,i);for(let r of n)o.has(ne(r.to))&&o.set(ne(r.from),r.from);return [...o.values()]}async function Sn(e,t,n={}){return ye(e,t,n)}async function On(e,t,n={}){return ye(e,t,n)}async function ye(e,t,n){let o=n.maxExecutionFontBytes??a;if(!Number.isSafeInteger(o)||o<=0||o>a)throw new RangeError("Font execution byte ceiling is outside the supported range");let r=e.map(Mt),i,s=[],a$1=[],l=new Map,u=new Set,c=0,f=[],d=new Set,b$1=[],v=t.resolvedFaces??[],T=t.defaultFamily,S=[],P=[],g=new Set(n.placeholderOrigins??[]),E;for(let F=0;F<e.length;F+=1){dt(t.signal);let k=e[F],X=Tt(v,l,f),q,B;try{let w=r[F],p;if(w){let m=await ct(w,t.signal);if(!m.ok)throw m.cause;p=m.value;}else if(typeof k=="function"){let m=await ct(Promise.resolve(k(Lt(t,T,X,c))).then(_=>({ok:!0,value:_}),_=>({ok:!1,cause:_})),t.signal);if(!m.ok)throw m.cause;p=m.value;}else p=k;if(p==null)continue;if(typeof p=="function"){K(n,k,F,new TypeError("A font origin answered with a function; pass the resolver itself rather than a function returning one"));continue}if(n.awaitDeferred){let m=G(p);m.later&&ut(m.now,m.now)&&g.add(F),p=await lt(p,_=>K(n,k,F,_),t.signal);}else {let m=G(p);p=m.now,B=m.later;}let C="failures"in p?p.failures:void 0,O=[];if(Array.isArray(C)){let m=Math.min(C.length,b);for(let _=0;_<m;_++)O.push(C[_]);C.length>m&&O.push(new Error("Additional font-origin failures were omitted"));}else C!==void 0&&O.push(C);let A;try{A=vt(p,u,c,d,i?"maxFontBytes"in i&&i.maxFontBytes!==void 0?i.maxFontBytes:a:void 0,n.reserveOwnedBytes,n.instrumentation,o);}catch(m){for(let _ of new Set(O))K(n,k,F,_);throw m}q=A;for(let m of new Set([...A.dropped,...O]))K(n,k,F,m);let x=A.fragment;x.supportedFamilies&&s.push(x.supportedFamilies),b$1.push(...O);let U=(x.sources??[]).map(m=>(h(m.request),[ne(m.request),m.request])),W=[...x.substitutions??[]];B!==void 0&&ut(x,p)&&g.add(F);let $=g.has(F);!i&&!$&&"defaultFont"in x&&(T=te(x)),!i&&!$&&(i=x),$&&(E??=x);let z=new Set(A.sourceKeys);if(z.size>0){f=f.filter(m=>!z.has(h(m.from)));for(let m of z)d.delete(m);}a$1.push(...x.sources??[]);for(let m of A.sourceKeys)u.add(m);c+=A.ownedBytes;for(let[m,_]of U)l.set(m,_);for(let m of W)f.push(m),d.add(h(m.from));S[F]=fe(x),B&&(P[F]=B);}catch(w){if(q?.releaseOwnedBytes?.(),t.signal?.aborted)throw t.signal.reason??w;if(w instanceof oe)throw w.cause;if(K(n,k,F,w),B){let p=new Error("Font origin skipped, so its background faces were not loaded");K(n,k,F,p);}continue}}let y=P.some(Boolean)?de(S,P,t.signal,{compose:F=>ye(F,t,{...n,placeholderOrigins:g}),report:(F,k)=>K(n,e[F],F,k)}):void 0;if(i??=E,!i)return y?{sources:[],deferred:y}:void 0;let{epoch:M,...R}=ee({...i,supportedFamilies:Y(s),sources:a$1,substitutions:f}),D=y?{...R,deferred:y}:R;return b$1.length===0?D:{...D,failures:Object.freeze(b$1)}}function ut(e,t){return (e.sources?.length??0)===0&&(e.substitutions?.length??0)===0&&!("defaultFont"in t)&&!("maxFontBytes"in t)}var oe=class extends Error{constructor(n){super("Unable to reserve owned font bytes");this.cause=n;this.name="FontOwnershipReservationError";}cause},re=class extends RangeError{};async function ct(e,t){if(!t)return e;dt(t);let n,o=new Promise((i,s)=>{n=s;}),r=()=>n?.(t.reason);t.addEventListener("abort",r,{once:true});try{return await Promise.race([e,o])}finally{t.removeEventListener("abort",r);}}function Mt(e){if(e===null||typeof e!="object")return;let t;try{t=e.then;}catch(n){return Promise.resolve({ok:false,cause:n})}if(typeof t=="function")return Promise.resolve(e).then(n=>({ok:true,value:n}),n=>({ok:false,cause:n}))}function vt(e$1,t,n,o,r,i,s,a$1=a){let l=e$1.sources??[],u=e$1.substitutions??[],c$1="maxFontBytes"in e$1?e$1.maxFontBytes:void 0,f$1="defaultFont"in e$1?e$1.defaultFont:void 0,d="epoch"in e$1?e$1.epoch:void 0,b$1="language"in e$1?e$1.language:void 0;if(!Array.isArray(l)||!Array.isArray(u))throw new TypeError("Font origin sources and substitutions must be arrays");let v=l.length,T=u.length;if(v>b)throw new RangeError(`Font source count must not exceed ${b}`);if(T>b)throw new RangeError(`Font substitution count must not exceed ${b}`);let S=c$1??a;if(!Number.isSafeInteger(S)||S<=0||S>a)throw new RangeError(`Font byte ceiling must be a positive safe integer no greater than ${a}`);let P=Math.min(r??S,a$1),g=0,E=[],y=new Set,M=[],R=[];for(let w=0;w<v;w+=1){let p=l[w];try{let C=me(p.request),O=h(C);if(t.has(O)||y.has(O))continue;let A=p.availability,x=p.faceIndex,U=p.hash,W=p.id;if(A!==void 0&&A!=="available"&&A!=="forbidden")throw new TypeError("Font source availability must be available or forbidden");if(!Number.isSafeInteger(x)||x<0)throw new RangeError("Font face index must be a non-negative safe integer");if(typeof U!="string"||U.length===0)throw new TypeError("Font source hash must be a non-empty string");let $;if(A!=="forbidden"){if(typeof W!="string"||W.length===0)throw new TypeError("Font source id must be a non-empty string");$=p.bytes;let z=e($);if(z>P)throw z<=(r??S)?new ge(C,z,a$1):new RangeError(`Font source ${C.family} (${z} bytes) exceeds the effective base byte ceiling (${P} bytes)`);if(t.has(O)||y.has(O))continue;if(n+g+z>c)throw new RangeError(`Font sources exceed the aggregate byte ceiling of ${c}`);g+=z;}else $=new Uint8Array(0);if(t.has(O)||y.has(O))continue;if(t.size+y.size>=b)throw new re(`Font source count must not exceed ${b}`);y.add(O),E.push(O),M.push(Object.freeze({request:C,id:W,bytes:$,hash:U,faceIndex:x,...A?{availability:A}:{}}));}catch(C){if(C instanceof re)throw C;R.push(C);}}let D=new Set,F=[];for(let w=0;w<T;w+=1){let p=u[w];try{let C=me(p.from),O=me(p.to);h(C),h(O);let A=p.lineMetrics,x=A?Object.freeze({heightEm:A.heightEm,baselineEm:A.baselineEm}):void 0;if(x&&(!Number.isFinite(x.heightEm)||!Number.isFinite(x.baselineEm)||x.heightEm<=0||x.heightEm>4||x.baselineEm<0||x.baselineEm>x.heightEm))throw new RangeError("Font substitution line metrics must fit within a bounded em box");let U=h(C);if(t.has(U)||y.has(U)||o.has(U)||D.has(U))continue;D.add(U),F.push(Object.freeze({from:C,to:O,...x?{lineMetrics:x}:{}}));}catch(C){R.push(C);}}if((v>0||T>0)&&M.length===0&&F.length===0&&R.length>0)throw R.length===1?R[0]:new pe(R);let k=o.size;for(let w of y)o.has(w)&&(k-=1);if(k+D.size>b)throw new RangeError(`Font substitution count must not exceed ${b}`);let X;if(f$1!==void 0){let w=f$1.family,p=f$1.sizeHalfPoints;if(h({family:w,weight:400,style:"normal"}),!Number.isSafeInteger(p)||p<=0)throw new RangeError("Default font size must be a positive safe integer in half-points");X=Object.freeze({family:w,sizeHalfPoints:p});}if(d!==void 0&&(!Number.isSafeInteger(d)||d<0))throw new RangeError("Font configuration epoch must be a non-negative safe integer");if(b$1!==void 0&&typeof b$1!="string")throw new TypeError("Font shaping language must be a string");let q;if(g>0&&i)try{q=i(g);}catch(w){throw new oe(w)}let B;try{B=M.map(w=>f(w,s));}catch(w){throw q?.(),w}return {fragment:Object.freeze({supportedFamilies:Y([e$1.supportedFamilies]),sources:Object.freeze(B),substitutions:Object.freeze(F),...d!==void 0?{epoch:d}:{},...c$1!==void 0?{maxFontBytes:c$1}:{},...X?{defaultFont:X}:{},...b$1!==void 0?{language:b$1}:{}}),sourceKeys:Object.freeze(E),ownedBytes:g,dropped:Object.freeze(R),releaseOwnedBytes:q}}function _t(e){return !Number.isSafeInteger(e)||e<=0?0:e>c?c:e}function Lt(e,t,n,o){let{committedSourceBytes:r,...i}=e,s=_t(o);return {...i,defaultFamily:t,...n.length>0?{resolvedFaces:n}:{},...s>0?{committedSourceBytes:s}:{}}}function me(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function dt(e){if(e?.aborted)throw e.reason??new DOMException("Font resolution was aborted","AbortError")}function K(e,t,n,o){let r;try{typeof t=="function"&&t.name.length>0&&(r=t.name);}catch{}try{o instanceof Error&&o.stack;}catch{}let i=Object.freeze({originIndex:n,...r!==void 0?{originName:r}:{},cause:o});if(e.onOriginFailure)try{let a=e.onOriginFailure(i);Promise.resolve(a).catch(l=>{console.warn("[fonts] font-origin diagnostic callback failed",l);});return}catch(a){console.warn("[fonts] font-origin diagnostic callback failed",a);}let s="";try{o instanceof Error&&o.message.length>0&&(s=`: ${o.message}`);}catch{}console.warn(`[fonts] a font origin failed and was skipped${s}`,o);}function Nt(e,t,n){let o="";for(let r=t;r+1<t+n&&r+1<e.length;r+=2){let i=e[r]|e[r+1]<<8;if(i===0)break;o+=String.fromCharCode(i);}return o}function Pt(e,t,n){let o="";for(let r=t;r<t+n&&r<e.length&&e[r]!==0;r++)o+=String.fromCharCode(e[r]);return o}function It(e,t){let n=new DataView(e.buffer,e.byteOffset,e.byteLength);if(e.length<8||n.getUint32(0,true)!==1)return;let o=0;for(let r=0;r<1e5&&o+8<=e.length;r++){let i=n.getUint32(o,true),s=n.getUint32(o+4,true);if(s<8||s%4!==0||o+s>e.length||(i===82&&s>=104&&t(Nt(e,o+40,64)),i===14))return;o+=s;}}function Dt(e,t){let n=new DataView(e.buffer,e.byteOffset,e.byteLength),o=e.length>=22&&n.getUint32(0,true)===2596720087?22:0;if(!(o+18>e.length||n.getUint16(o+2,true)!==9)){o+=18;for(let i=0;i<1e5&&o+6<=e.length;i++){let s=n.getUint32(o,true),a=n.getUint16(o+4,true);if(s<3||o+s*2>e.length||(a===763&&s*2>=25&&t(Pt(e,o+6+18,Math.min(32,s*2-6-18))),a===0))return;o+=s*2;}}}function mt(e,t){let n=new Map,o=i=>{if(i.trim().toLowerCase()==="system")return;let s=t(i.trim());if(s===null||n.size>=16)return;let a=s.toLowerCase();n.has(a)||n.set(a,s);},r=0;for(let[i,s]of e.partBytes){let a=i.toLowerCase();if(!a.startsWith("/word/")||a.startsWith("/word/glossary/"))continue;let l=a.endsWith(".emf"),u=a.endsWith(".wmf");if(!(!l&&!u)){if(++r>64||n.size>=16)break;l?It(s,o):Dt(s,o);}}return [...n.values()]}var Bt=2e5,pt=32,Ut=new Set(["latin","ea","cs"]);function zt(e,t){let n=/^\+(mn|mj)-(lt|ea|cs)$/.exec(e);if(!n)return;let o=n[1]==="mj";return n[2]==="ea"?o?t.majorEastAsia:t.minorEastAsia:n[2]==="cs"?o?t.majorBidi:t.minorBidi:o?t.major:t.minor}var gt=new WeakMap;function qt(e){let t=gt.get(e);if(t)return t;let n=[],o=new Set,r=[e],i=0;for(;r.length>0&&++i<=Bt&&n.length<pt;){let s=r.pop();if(s.namespaceUri===va&&Ut.has(s.localName)){let a=oa(s.attributes,"typeface");a&&!o.has(a)&&(o.add(a),n.push(a));continue}for(let a=s.children.length-1;a>=0;a-=1){let l=s.children[a];l.kind!=="textValue"&&r.push(l);}}return gt.set(e,n),n}function Nn(e,t={}){let n=new Map,o=r=>{let i=r?b$1(r):null;if(i===null||n.size>=pt)return;let s=i.toLowerCase();n.has(s)||n.set(s,i);};for(let r of e.parts.values()){let i=r.root;if(!(i.namespaceUri!==qe&&i.namespaceUri!==Ee)){o(t.minor);for(let s of qt(i))s.startsWith("+")?o(zt(s,t)):o(s);}}for(let r of mt(e,b$1))o(r);return [...n.values()]}var jt=256,Xt=Object.freeze([]);function ie(e){let t=new WeakMap;return (n,o)=>{let r=new Set;for(let i of n){let s=[{node:i,context:o,next:0}],a=l=>{s.pop();let u=s.at(-1)?.found??r;for(let c of l)u.add(c);};for(;s.length;){let l=s[s.length-1],u=t.get(l.node);if(u?.key===l.context.key){a(u.families);continue}if(!l.children){let d=e(l.node,l.context);l.children=d.children,l.found=new Set(d.families);}let c=l.children[l.next++];if(c){s.push({...c,next:0});continue}let f=l.found.size===0?Xt:[...l.found];f.length<=jt&&Bb(l.node)?t.set(l.node,{key:l.context.key,families:f}):t.delete(l.node),a(f);}}return [...r]}}function se(e,t){return e.children.flatMap(n=>n.kind==="textValue"?[]:[{node:n,context:t}])}var yt=new WeakMap,$t=4096;function Ft(e,t){let n=`${e.baseKey}|${e.depth+1}|${JSON.stringify(t)}`,o=yt.get(e);o||yt.set(e,o=new Map);let r=o.get(n);if(r)return r;let i={...e,depth:e.depth+1,cellStyle:t,key:n};return o.size<$t&&o.set(n,i),i}function Vt(e,t){let{styles:n,theme:o,supplementalFamilies:r,depth:i}=t;if(e.kind==="table"){let l=re$1(e,468,i,n),u=[];for(let c of l?.rows??[])for(let f of c.cells){let d=Ft(t,f.styleFormatting);for(let b of f.blocks)u.push({node:b,context:d});}return {children:u.reverse()}}let s=new Set;if(e.kind==="paragraph"){let l=e.children.find(c=>c.kind==="paragraphProperties"),u=lf(n,l,t.cellStyle).runProperties;for(let c of kd(e,u,void 0,(f,d)=>of(f,d,n),void 0,void 0,"all-markup",void 0,void 0,o)){if(!c.text||c.fontSlot!=="eastAsia"&&!r.has(c.style.fontFamily??""))continue;let f=b$1((c.fontSlot==="eastAsia"?c.style.fontFamilyEastAsia:c.style.fontFamily)??void 0);f&&s.add(f);}}let a=e.localName==="txbxContent"?{...t,cellStyle:void 0,key:`${t.baseKey}|${i}|undefined`}:t;return {families:[...s],children:se(e,a).reverse()}}function Ht(){let e=ie(Vt),t,n,o=(i,s)=>{if(!t||n!==i||t.theme!==s){let a=kf(i,s);n=i,t={key:`${a.cacheToken}|0|undefined`,baseKey:a.cacheToken,styles:a,theme:s,depth:0,supplementalFamilies:new Set([...Object.values(s.majorSupplemental??{}),...Object.values(s.minorSupplemental??{})])};}return t};return Object.assign((i,s,a)=>e([...i].reverse(),o(s,a)),{warmTableRows(i,s,a,l,u){let c=o(l,u),f=re$1(i,468,c.depth,c.styles)?.rows??[];for(let d of f.slice(s,a))for(let b of d.cells)e(b.blocks,Ft(c,b.styleFormatting));return f.length}})}function Xn(e,t,n){return Ht()(e,t,n)}function Fe(e,t){return e.attributes.find(n=>n.localName===t)?.value}var Kt=ie((e,t)=>{let n=[];if(e.namespaceUri===pa){if(e.localName==="fldSimple"){let o=ie$1(Fe(e,"instr")??"")?.font;o&&n.push(o);}if(e.localName==="p")for(let o of Wt(e))n.push(o);}return {families:n,children:se(e,t)}});function to(e){let t=new Map;for(let n of Kt(e,{key:""})){let o=b$1(n);o!==null&&!t.has(o.toLowerCase())&&t.set(o.toLowerCase(),o);}return [...t.values()]}function Wt(e){let t=[],n=Nc(),o=[];for(let r=e.children.length-1;r>=0;r-=1){let i=e.children[r];i.kind!=="textValue"&&o.push({node:i,containerDepth:0});}for(;o.length>0;){let{node:r,containerDepth:i}=o.pop();if(i>=Aa||r.namespaceUri===pa&&r.localName==="p")continue;if(r.namespaceUri===pa&&r.localName==="fldChar"){let a=Fe(r,"fldCharType");a==="begin"?Qc(n):a==="separate"?(n.nesting===1&&ht(n,t),Sc(n)):a==="end"&&(n.nesting===1&&ht(n,t),Tc(n));continue}if(r.namespaceUri===pa&&(r.localName==="instrText"||r.localName==="delInstrText")){Rc(n,Yt(r),r.localName==="delInstrText");continue}if(r.namespaceUri===pa&&r.localName==="fldSimple"){let a=ie$1(Fe(r,"instr")??"");a?.font&&t.push(a.font);}let s=Ba(r,i);for(let a=r.children.length-1;a>=0;a-=1){let l=r.children[a];l.kind!=="textValue"&&o.push({node:l,containerDepth:s});}}return Oc(n),t}function ht(e,t){let n=Pc(e);if(n.overflow)return;let o=ie$1(n.instruction);o?.font&&t.push(o.font);}function Yt(e){let t="",n=[...e.children].reverse();for(;n.length>0&&t.length<=256;){let o=n.pop();if(o.kind==="textValue")t+=o.value;else for(let r=o.children.length-1;r>=0;r-=1)n.push(o.children[r]);}return t}var Gt=()=>true,Jt=/[ᄀ-ᇿ⺀-鿿ꥠ-꥿가-퟿豈-﫿︰-﹏＀-￯]/u;function no(e,t,n,o){if(!t)return [];let r=nd(t),i=kf(n,o),s=new Map;for(let a of e)for(let l of Qt(a)){let u=gd(l.children),c=f=>{if(f)for(let d of f.values()){let b=d.markerText===void 0||Jt.test(d.markerText);for(let v of [d.markerStyle.fontFamily,b?d.markerStyle.fontFamilyEastAsia:null]){let T=b$1(v??void 0);if(T===null)continue;let S=T.toLowerCase();s.has(S)||s.set(S,T);}}};c(Md(u,r,i,Gt));for(let f of u){let d=Lf(f);for(let b of d.contents)c(Kf(b,r,i));}}return [...s.values()].sort((a,l)=>a.localeCompare(l))}function Qt(e){if(e.localName==="document"){for(let t of e.children)if(t.kind!=="textValue"&&t.localName==="body")return [t];return []}if(e.localName==="footnotes"||e.localName==="endnotes"){let t=[];for(let n of e.children)n.kind!=="textValue"&&(n.localName==="footnote"||n.localName==="endnote")&&t.push(n);return t}return [e]}var Zt="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",wt=256,en=31;function J(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===pa}function ae(e,t){return e.attributes.find(n=>n.localName===t&&n.namespaceUri===pa)?.value}function xt(e){let t=(e.relationships.get(e.mainDocumentPart)??[]).find(i=>i.type===Zt),n=t?N(t):void 0,r=((n?.mode==="Internal"&&n.target.ok?e.parts.get(n.target.partName):void 0)??e.parts.get("/word/fontTable.xml"))?.root;return r&&J(r,"fonts")?r:void 0}function bt(e,t){let n=e.children.find(o=>J(o,t));return n&&n.kind!=="textValue"?ae(n,"val"):void 0}function Et(e){let t=xt(e),n=new Map;if(!t)return n;let o=0;for(let r of t.children){if(!J(r,"font"))continue;if(++o>wt)break;let i=c$1(ae(r,"name"));if(!i)continue;let s=R(bt(r,"family"),bt(r,"pitch")),a=i.trim().toLowerCase();s&&!n.has(a)&&n.set(a,s);}return n}function Ct(e){let t=xt(e),n=new Map;if(!t)return n;let o=0;for(let r of t.children){if(!J(r,"font"))continue;if(++o>wt)break;let i=c$1(ae(r,"name"));if(!i)continue;let s=r.children.find(c=>J(c,"altName")),a=s&&s.kind!=="textValue"?ae(s,"val"):void 0,l=a!==void 0&&a.length<=en?a$1(a):null,u=i.trim().toLowerCase();l&&!n.has(u)&&n.set(u,l);}return n}function Co(e,t,n,o=[]){let r=new Set,i=new Set((o??[]).map(a=>a.from.family.trim().toLowerCase())),s=new Map;for(let a of e.substitutions??[]){let l=a.from.family.trim().toLowerCase();s.has(l)||s.set(l,a.to.family.trim().toLowerCase());}for(let a of e.substitutions??[]){let l=a.from.family.trim().toLowerCase(),u=a.to.family.trim().toLowerCase(),c=[t.alternates.get(l),t.fallbacks.get(l)].some(f=>{let d=f?.trim().toLowerCase();return d!==void 0&&d!==l&&(d===u||s.get(d)===u)});u!==l&&!i.has(l)&&c&&!(n.resolve(a.from)instanceof d)&&r.add(a.from.family.toLowerCase());}return r}function tn(e,t){return e.attributes.find(n=>n.localName===t&&n.namespaceUri===pa)?.value}var nn=new Set(["document","hdr","ftr","footnotes","endnotes","comments","styles","numbering","glossaryDocument"]),on=new Set(["t","delText","instrText","delInstrText"]),rn=2e6;function sn(e,t){let n=e.stylesRoot(),o=e.documentThemeFonts(),r=[...F(n),...n?xd(n).run:[]],i=ma(r,o),s=a$1(i.fontFamily??void 0)??t,a=a$1(Bc([{text:"\xE9",props:r,style:i,start:0,end:1}],o)[0]?.style.fontFamily??void 0)??s,l=a$1(i.fontFamilyEastAsia??void 0),u=a$1(i.complexLane?.fontFamily??void 0)??o.minorBidi??t,c=Et(e.currentPackage()),f=g=>c.get(g.trim().toLowerCase())??S(g),d=(g,E)=>{let y=f(g);if(!y)return E;let M=f(E);return M===void 0||M===y?E:T[y]},b=new Map,v=new Map,T$1=0;for(let g of e.currentPackage().parts.values()){if(g.root.namespaceUri!==pa||!nn.has(g.root.localName))continue;let E=[g.root];for(;E.length>0&&T$1<rn;){T$1++;let y=E.pop();if(y.kind!=="textValue"){if(y.namespaceUri===pa){if(on.has(y.localName))continue;if(y.localName==="rFonts"){for(let[M,R]of [["ascii",s],["hAnsi",a],["eastAsia",l],["cs",u]]){let D=a$1(b$2(tn(y,M))??void 0);if(!D||!R)continue;let F=D.trim().toLowerCase(),k=b.get(F)??new Set,X=M==="ascii"||M==="hAnsi",q=X?d(D,R):R;if(k.add(q),b.set(F,k),X&&f(D)){let B=v.get(F)??new Set;B.add(q),v.set(F,B);}}continue}}for(let M of y.children)E.push(M);}}}for(let g of a$2)b.delete(g);let S$1=new Map,P=[];for(let[g,E]of b){let y=v.get(g);E.size===1?S$1.set(g,[...E][0]):y?.size===1?S$1.set(g,[...y][0]):P.push(g);}return {fallbacks:S$1,ambiguousFamilies:P,defaults:new Map([...b].map(([g,E])=>[g,[...E]]))}}function an(e,t,n=[],o="Calibri"){let r=Ct(e.currentPackage()),i=sn(e,o),s=t.flatMap(u=>{let c=r.get(u.trim().toLowerCase());return c?[c]:[]}),a=new Map,l=t.flatMap(u=>i.defaults.get(u.trim().toLowerCase())??[]).filter(u=>u.trim().toLowerCase()!==o.trim().toLowerCase());for(let u of [...t,...s,...n,...l]){let c=a$1(u);if(c&&!a.has(c.trim().toLowerCase())&&a.set(c.trim().toLowerCase(),c),a.size===nt)break}return {families:[...a.values()],alternates:r,fallbacks:i.fallbacks,ambiguousFamilies:i.ambiguousFamilies}}function So(e,t,n){let o=te(n),r=an(e,t,[],o);return {plan:r,request:{families:r.families,defaultFamily:o}}}function Oo(e,t,n=t.fallbacks){let o=new Map(e.sources.map(u=>[h(u.request),u.request])),r=[],i=new Set((e.substitutions??[]).map(u=>h(u.from))),s=new Map((e.substitutions??[]).map(u=>[h(u.from),u])),a=u=>{let c=o.get(h(u));if(c)return {to:c};let f=s.get(h(u)),d=f&&o.get(h(f.to));if(!(!f||!d))return f.lineMetrics?{to:d,lineMetrics:f.lineMetrics}:{to:d}},l=Math.max(0,b-i.size);for(let u of t.families){let c=u.trim().toLowerCase(),f=t.alternates.get(c),d=n.get(c),b=ge$1(u);for(let v of [400,700])for(let T of ["normal","italic"]){let S={family:u,weight:v,style:T};if(o.has(h(S)))continue;let P=s.has(h(S));for(let g of P?[b,f]:[b,f,d]){if(!g||g.trim().toLowerCase()===c)continue;let E={family:g,weight:v,style:T},y=o.get(h(E)),M=P?y?{to:y}:void 0:a(E);if(!M)continue;if(!i.has(h(S))){if(l===0)break;l--;}let R=Q(u)?.em;r.push({from:S,...M,...R?{lineMetrics:R}:{}});break}}}return ee({...e,substitutions:[...r,...e.substitutions??[]]})}function Ao(e,t,n){let o=new Set((e.substitutions??[]).map(i=>h(i.from))),r=new Set;for(let i of t.substitutions??[]){if(o.has(h(i.from)))continue;let s=i.from.family.trim().toLowerCase(),a=i.to.family.trim().toLowerCase();[n.alternates.get(s),n.fallbacks.get(s)].some(u=>u?.trim().toLowerCase()===a)||r.add(s);}return r}function Ro(e,t){let n=new Map;for(let[o,r]of e)t(o)||n.set(o,r);return n}var ln={regular:{weight:400,style:"normal"},bold:{weight:700,style:"normal"},italic:{weight:400,style:"italic"},boldItalic:{weight:700,style:"italic"}};function Mo(e,t){let n=[],o=[],r=0;for(let i of e){let s=i.bytes.byteLength;if(!Number.isSafeInteger(s)||s>t||s>a||s>c-r){o.push(i);continue}r+=s,n.push(i);}return {sources:n,dropped:o}}function vo(e,t,n){let o=t.reduce((i,s)=>i+s.bytes.byteLength,0),r=new Set(t.filter(i=>i.request.family.trim().length>0).map(i=>h(i.request)));return un(e,{maxFontBytes:n,aggregateBudget:Math.max(0,c-o),shadowedRequests:r})}function un(e,t){let n=[],o=[],r=t.aggregateBudget,i=new Set;for(let s of e){let a=ln[s.style],l=Object.freeze({family:s.family,weight:a.weight,style:a.style});if(s.family.trim().length===0){o.push({request:l,partName:s.partName,reason:"malformed"});continue}let u=h(l);if(!(t.shadowedRequests?.has(u)||i.has(u))){if(i.add(u),s.bytes.byteLength>t.maxFontBytes||s.bytes.byteLength>r){o.push({request:l,partName:s.partName,reason:"overLimit"});continue}r-=s.bytes.byteLength,n.push({request:l,id:`embedded:${s.partName}#${s.style}`,bytes:s.bytes,hash:f$1(s.bytes),faceIndex:0});}}return {sources:n,dropped:o}}
2
- export{Wt as A,no as B,Co as C,an as D,So as E,Oo as F,Ao as G,Ro as H,Mo as I,vo as J,un as K,Y as a,mn as b,nt as c,ce as d,gn as e,ee as f,te as g,G as h,it as i,Rt as j,st as k,fe as l,kt as m,ft as n,En as o,Cn as p,ge as q,pe as r,Sn as s,On as t,Nn as u,ie as v,se as w,Ht as x,Xn as y,to as z};
@@ -1,3 +0,0 @@
1
- import {f,c,d,e}from'./chunk-RIYSCEFQ.js';import {Te,n,l,p,j as j$1,k,r,i,o,A as A$1,B,C,x,u,a,g,f as f$2,ya as ya$1,Ca as Ca$1,eb,Oa as Oa$1,xf,wf,w,O,N,ra as ra$1,y,ta as ta$1,id,gd,Yc,vc,fe as fe$1,lb,q as q$1,dc,ac,$b,ab,Ja as Ja$1,cd,bc,t,b,e as e$1,c as c$1,m,Ra as Ra$1,Ya as Ya$1,tf,Nd,he as he$1,ee,Vc,hd,Ka as Ka$1,ec,h,sa,Ia as Ia$1}from'./chunk-YWJSQA2O.js';import {f as f$1,sn,jc,hc,mc,ic,gj,vn as vn$1,un,tn,Xb,fc,c as c$2,he as he$2,b as b$1}from'./chunk-6MF5PN2E.js';var zr=(e,t,n)=>{let r=e<0n,o=r?-e:e,a=o/t,i=o%t;if(n!=="towardZero"){let l=i*2n;(l>t||l===t&&(n==="halfAwayFromZero"||n==="halfToEven"&&a%2n!==0n))&&(a+=1n);}let s=r?-a:a,c=Number(s);if(!Number.isSafeInteger(c))throw new RangeError("Shaped fixed-point value exceeds the safe integer range");return c},ct=(e,t,n$1,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$1)||n$1<0)throw new RangeError("fixed-point numerator must be a non-negative safe integer");if(e===0||n$1===0)return n(0);let o=e*n$1;if(Number.isSafeInteger(o)){let a=Math.abs(o),i=a%t,s=(a-i)/t;return r!=="towardZero"&&(i>t-i||i===t-i&&(r==="halfAwayFromZero"||r==="halfToEven"&&s%2!==0))&&(s+=1),n(s===0?0:o<0?-s:s)}return n(zr(BigInt(e)*BigInt(n$1),BigInt(t),r))},Sn=(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=>ct(i,a,o,r)},xn=(e,t,n)=>{let r=t*n,o=e*2;return a=>a*r/o};var Pe=(e,t)=>e[t]<<8|e[t+1],bn=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0;function Dr(e,t){let n=(s,c)=>s>=0&&s+c<=e.length;if(!n(0,12))return false;let a=String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"&&n(12+t*4,4)?bn(e,12+t*4):0;if(!n(a,12))return false;let i=Pe(e,a+4);for(let s=0;s<i;s+=1){let c=a+12+s*16;if(!n(c,16))return false;if(!(e[c]===99&&e[c+1]===109&&e[c+2]===97&&e[c+3]===112))continue;let u=bn(e,c+8);if(!n(u,4))return false;let y=Pe(e,u+2);for(let f=0;f<y;f+=1){let p=u+4+f*8;if(!n(p,4))return false;if(Pe(e,p)===3&&Pe(e,p+2)===0)return true}return false}return false}var Rn=new WeakMap;function Fn(e,t){let n=Rn.get(e);return n===void 0&&(n=Dr(t,e.faceIndex),Rn.set(e,n)),n}function Cn(e){let t="",n=false;for(let r=0;r<e.length;r+=1){let o=e.charCodeAt(r);o>=32&&o<=255?(t+=String.fromCharCode(61440+o),n=true):t+=e[r];}return n?t:e}var Hr=4096,En=e=>typeof e=="number"?String(e):JSON.stringify(e)??typeof e,ke=class{constructor(t){this.onRestart=t;}onRestart;#e=new Map;keyOf(t$1,n){let r=t(n),o=this.#e.get(r);o===void 0&&(this.#e.size>=Hr&&(this.#e.clear(),this.onRestart()),o=this.#e.size,this.#e.set(r,o));let a=`${o}\0${En(t$1.fontSizeHalfPoints)}\0${En(t$1.bidiLevel)}\0`,i=t$1.context;return !i||i.before===""&&i.after===""?`${a}-${t$1.text}`:`${a}c${i.before.length},${i.after.length}\0${i.before}${i.after}${t$1.text}`}clear(){this.#e.clear();}};var ie=Object.freeze({name:"HarfBuzz",version:"14.4.0"}),ye=null,fe=null;function ut(){return ye?Promise.resolve():fe||(fe=import('./dist-PKZR6RSH.js').then(e=>{let t=e.versionString();if(t!==ie.version)throw new A("shapingLibraryMismatch",{diagnostic:f(ie.version,t)});ye=e;}).catch(e$1=>{throw fe=null,e$1 instanceof A?e$1:c(e$1)?new A("unsupportedRuntime",{diagnostic:d(e$1),cause:e$1}):new A("wasmUnavailable",{diagnostic:e(e$1),cause:e$1})}),fe)}function Gr(){return ye!==null}function Ur(){if(!ye)throw new A("notInitialized",{diagnostic:"Call initializeHarfBuzz() before creating a text shaper"});return ye}var A=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;}},Kr=16*1024*1024,Wr=1e6,Vr=1e6,jr=1e6,Xr=4,Yr=512,$r=1024*1024,qr=16*1024*1024,Zr=32*1024*1024,Jr=64*1024*1024,Qr=64*1024*1024,eo=1e6,to=1e6,no=1e6,ro=64,oo=4096,ao=4*1024*1024,io=64*1024*1024,so=64*1024*1024,co=256*1024*1024,lo=new Set(["COLR","CPAL","CBDT","CBLC","sbix","SVG "]),vn=["cmap","head","hhea","hmtx","maxp"],uo=(e,t)=>e[t]<<8|e[t+1],po=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,fo=(e,t)=>String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?po(e,12+t*4):0,mo=(e,t)=>{let n=fo(e,t),r=uo(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},yo=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),ho=(e,t)=>{let n=l(e,t);if(!n.valid)return n;let r=mo(e,t);for(let o of vn)if(!r.has(o))return {valid:false,diagnostic:`missing required ${o} table`};return {valid:true}},dt=ho,U=(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},go=(e,t,n$1)=>{if(t.length===0)return [];let r=[],o=0;for(;o<t.length;){let a=t[o].cluster,i=o+1,s=t[o].advanceX;for(;i<t.length&&t[i].cluster===a;)s+=t[i].advanceX,i+=1;let c=n(s);r.push({textStart:a,textEnd:n$1==="rtl"?t[o-1]?.cluster??e.length:t[i]?.cluster??e.length,glyphStart:o,glyphEnd:i,advance:c,caretEdges:Object.freeze([n(0),c]),fontSpan:0}),o=i;}return r},V=64,$=8,q=8,Ln=32,pt=V+2*$,So=V+$+q,xo=V+$+2*q,bo=V+$+q,Tn=V+8*$,Bn=V+8*q+$,Ro=V+6*q+$,Fo=V+3*q+2*$,Co=V+3*q,he=e=>V+e.length*Uint16Array.BYTES_PER_ELEMENT,ft=e=>bo+he(e),me=e=>Ln+e*$,Eo=(e,t)=>pt+he(e)+So+ft(t),vo=e=>Tn+he(e)+me(e.length)+e.length*Bn,Lo=e=>{let t=new Set(e.glyphs.map(n=>n.outline));return Tn+he(e.text)+me(e.glyphs.length)+e.glyphs.length*Bn+me(e.clusters.length)+e.clusters.length*Ro+e.clusters.reduce((n,r)=>n+me(r.caretEdges.length),0)+me(e.fontSpans.length)+e.fontSpans.length*Fo+(e.exactAdvancesX===void 0?0:Ln+e.exactAdvancesX.length*q)+Co+[...t].reduce((n,r)=>n+ft(r.path),0)},To=(e,t)=>pt+he(e)+xo+t,lt=class{#e;#p;#f;#m;#y;#R;#h;#l=0;#F;#g;#S;#c;#x;#u;#t;#o=new Map;#i=new Map;#s=new Map;#n=new Map;#C=new ke(()=>{this.#n.clear(),this.#r=0,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0}));});#a=0;#r=0;#b=0;#d;constructor(t,n){p(this),this.#e=t,this.#p=U(n.maxFontBytes??Kr,"maximum font bytes",Qr),this.#f=U(n.maxInputUtf16??Wr,"maximum input UTF-16 code units",eo),this.#m=U(n.maxCodepoints??Vr,"maximum input code points",to),this.#y=U(n.maxGlyphs??jr,"maximum shaped glyphs",no),this.#h=U(n.maxCachedFontBytes??64*1024*1024,"maximum cached font bytes",64*1024*1024),this.#R=U(n.maxCachedFaces??Xr,"maximum cached faces",ro),this.#F=U(n.maxCachedShapes??Yr,"maximum cached shape results",oo),this.#g=U(n.maxOutlineBytes??$r,"maximum outline bytes",ao),this.#S=U(n.maxCachedOutlineBytes??qr,"maximum cached outline bytes",io),this.#c=U(n.maxShapedRunBytes??Zr,"maximum shaped run bytes",so),this.#x=U(n.maxCachedShapeBytes??Jr,"maximum cached shape bytes",co),this.#u=n.instrumentation?.onFaceCacheEvent,this.#t=n.instrumentation,this.#d=new this.#e.Buffer;}dispose(){this.#o.clear(),this.#l=0,this.#i.clear(),this.#s.clear(),this.#n.clear(),this.#C.clear(),this.#a=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.#u?.(Object.freeze({kind:"hit",identity:t.identity})),r;let o=j$1(t);for(let u of vn)if(!o.has(u))throw new A("malformedFont",{diagnostic:`missing required ${u} table`});this.#t?.onByteCopy?.();let a=new this.#e.Blob(yo(n)),i=new this.#e.Face(a,t.faceIndex),s=new this.#e.Font(i),c=s.hExtents();if(!Number.isSafeInteger(i.upem)||i.upem<=0||!Number.isSafeInteger(c.ascender)||!Number.isSafeInteger(c.descender)||!Number.isSafeInteger(c.lineGap))throw new A("malformedFont",{diagnostic:"invalid font units or horizontal metrics"});s.setScale(i.upem,i.upem);let l={identity:t.identity,blob:a,face:i,font:s,unitsPerEm:i.upem,byteLength:n.byteLength};if(n.byteLength<=this.#h){for(;this.#o.size>=this.#R||this.#l+n.byteLength>this.#h;){let u=this.#o.keys().next().value;if(u===void 0)break;this.#l-=this.#o.get(u).byteLength,this.#o.delete(u),this.#u?.(Object.freeze({kind:"evicted",identity:u}));}this.#o.set(t.identity,l),this.#l+=n.byteLength;}return this.#u?.(Object.freeze({kind:"created",identity:t.identity})),l}#L(t,n){let r=this.#i.get(t.identity)?.get(n);if(r)return this.#s.delete(r),this.#s.set(r,void 0),this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#a})),r.outline;this.#t?.onOutlinePathCall?.();let o=t.font.glyphToPath(n),a=ft(o);if(a>this.#g)throw new A("outlineOverLimit",{limit:this.#g,actual:a});let i=Object.freeze({path:o,unitsPerEm:t.unitsPerEm}),s=Eo(t.identity,o)+3*pt+2*q;if(s>this.#S)return this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#a})),i;for(;this.#a+s>this.#S;){let u=this.#s.keys().next().value;if(u===void 0)break;this.#s.delete(u);let y=this.#i.get(u.identity);y.delete(u.glyphId),y.size===0&&this.#i.delete(u.identity),this.#a-=u.bytes,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#a}));}let c=this.#i.get(t.identity);c||this.#i.set(t.identity,c=new Map);let l={outline:i,bytes:s,identity:t.identity,glyphId:n};return c.set(n,l),this.#s.set(l,void 0),this.#a+=s,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"created",retainedBytes:this.#a})),i}#E(t){if(t.length>this.#f)throw new A("textOverLimit",{limit:this.#f,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.#m)throw new A("codepointsOverLimit",{limit:this.#m,actual:n})}}shape(t){if(!this.#d)throw new A("disposed");if(k(t.environment.font),t.environment.font.byteLength>this.#p)throw new A("fontOverLimit",{limit:this.#p,actual:t.environment.font.byteLength});this.#E(t.text);let n$1=vo(t.text);if(n$1>this.#c)throw new A("shapedRunOverLimit",{limit:this.#c,actual:n$1});let r$1=r(t.environment),o$1=this.#C.keyOf(t,r$1),a=this.#n.get(o$1);if(a)return this.#b-a.stamp>=Math.max(1,this.#n.size>>1)&&(this.#n.delete(o$1),this.#n.set(o$1,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$1.shapingLibrary.name!==ie.name||r$1.shapingLibrary.version!==ie.version)throw new A("shapingLibraryMismatch");if(r$1.normalization!=="none")throw new A("unsupportedNormalization");if(!Number.isSafeInteger(t.bidiLevel)||t.bidiLevel<0||(t.bidiLevel&1)===1!=(r$1.direction==="rtl"))throw new A("invalidBidiLevel");if(Object.keys(r$1.variationAxes).length>0)throw new A("unsupportedVariationAxes");if(r$1.fallbackOrder.length>0)throw new A("unsupportedFallback");let i$1=i(r$1.font),s=j$1(r$1.font);if([...lo].some(p=>s.has(p))&&!s.has("glyf")&&!s.has("CFF "))throw new A("unsupportedColorFont");let c=t.text;this.#E(c);let l=t.context?.before??"",u$1=t.context?.after??"",y=o,f=Math.max(String(l).length,String(u$1).length);if(typeof l!="string"||typeof u$1!="string"||f>y)throw new A("textOverLimit",{limit:y,actual:f});try{let p=this.#v(r$1.font,i$1),{face:g,font:h}=p,d=this.#d;d.reset();let S=Fn(r$1.font,i$1)?Cn:String,x$1=l+c+u$1,R=A$1(x$1)?B(p):void 0,L=M=>S(R?C(M,R):M);l||u$1?d.addText(L(l+c+u$1),l.length,c.length):d.addText(L(c)),d.setDirection(r$1.direction==="rtl"?this.#e.Direction.RTL:this.#e.Direction.LTR),d.setScript(r$1.script),d.setLanguage(r$1.language),d.setClusterLevel(this.#e.ClusterLevel.MONOTONE_CHARACTERS);let E=Object.entries(r$1.features).map(([M,G])=>new this.#e.Feature(M,G));if((r$1.features.kern??1)!==0)for(let[M,G]of x(l+c+u$1))E.push(new this.#e.Feature("kern",0,M,G));this.#t?.onShapeCall?.(),this.#e.shape(h,d,E);let w=d.getLength();if(w>this.#y)throw new A("glyphOverLimit",{limit:this.#y,actual:w});let T=d.getGlyphInfos(),v=d.getGlyphPositions(),O=Sn(g.upem,t.fontSizeHalfPoints,r$1.fixedPointScale,r$1.roundingMode),_=xn(g.upem,t.fontSizeHalfPoints,r$1.fixedPointScale),b=[],m=n(0),F=n(0),C$1=new Map,B$1=T.map((M,G)=>{let ee=v[G],wt=R?.get(x$1.charCodeAt(M.cluster)),At=wt?.advance??ee?.xAdvance??0;b.push(_(At));let It=O(At),Mt=O(ee?.yAdvance??0),xe=wt?.glyph??M.codepoint,Nr={id:xe,cluster:M.cluster-l.length,originX:m,originY:F,advanceX:It,advanceY:Mt,offsetX:O(ee?.xOffset??0),offsetY:O(ee?.yOffset??0),outline:C$1.get(xe)??(()=>{let _t=this.#L(p,xe);return C$1.set(xe,_t),_t})()};return m=n(m+It),F=n(F+Mt),Nr}),I=h.hExtents(),P=u({text:c,direction:r$1.direction,bidiLevel:t.bidiLevel,glyphs:B$1,exactAdvancesX:b,clusters:go(c,B$1,r$1.direction),fontSpans:B$1.length===0?[]:[{glyphStart:0,glyphEnd:B$1.length,font:r$1.font,fallbackIndex:null}],metrics:{ascent:O(I.ascender),descent:O(-I.descender),lineGap:O(I.lineGap)}},r$1),N=Lo(P);if(N>this.#c)throw new A("shapedRunOverLimit",{limit:this.#c,actual:N});let D=To(o$1,N);if(D>this.#x)return this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#r})),P;for(;this.#n.size>=this.#F||this.#r+D>this.#x;){let M=this.#n.keys().next().value;if(M===void 0)break;let G=this.#n.get(M);this.#n.delete(M),this.#r-=G.bytes,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#r}));}return this.#n.set(o$1,{run:P,bytes:D,stamp:++this.#b}),this.#r+=D,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"stored",retainedBytes:this.#r})),P}catch(p){throw p instanceof A?p:new A("malformedFont",{diagnostic:p instanceof Error?p.message:"HarfBuzz shaping failed"})}}},mt=(e={})=>new lt(Ur(),e);var yt=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}),Oi=Object.freeze({...yt,maxCachedShapes:4096});function On(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:${f$1(new TextEncoder().encode(JSON.stringify(n)))}`}function wn(e,t=yt){let n=e?.maxFontBytes??t.maxFontBytes;if(!Number.isSafeInteger(n)||n<=0||n>a)throw new RangeError(`Font shaping byte ceiling must be between 1 and ${a}`);return n===t.maxFontBytes?t:Object.freeze({...t,maxFontBytes:n})}function An(e,t,n=false){let r=false,o=Object.freeze({shape(a){if(r)throw new A("disposed");let i=a.environment.font;if(k(i),i.byteLength>t.maxFontBytes)throw new A("fontOverLimit",{limit:t.maxFontBytes,actual:i.byteLength});return e.shape(a)},dispose(){r||(r=true,n&&e.dispose?.());}});return q$1(e)?p(o):o}var Bo=Object.freeze({}),In=b,Oo="16.0.0",wo="none",Ao=1e3,Io="halfToEven",Pn="cluster-edges-only",Mo="Latn",_o=new Uint8Array(0);var Z=class extends Error{code="overLimit";constructor(t){super(t),this.name="LayoutShapingConfigurationError";}};function Po(e,t){let n=e.epoch,r=e.maxFontBytes,o=e.sources,a$1=e.substitutions,i=e.defaultFont,s=e.language;if(!Number.isSafeInteger(r)||r<=0||r>a)throw new Z(`Font byte ceiling must not exceed the engine hard maximum of ${a}`);let c=o.length,l=a$1?.length??0;if(c===0||c>b)throw new Z(`Font source count must be between 1 and ${b}`);if(l>In)throw new Z(`Font substitution count must not exceed ${In}`);let u=0,y=[];for(let g$1=0;g$1<c;g$1+=1){let h=o[g$1],d=h.request,S=h.availability,x=h.id,R=h.hash,L=h.faceIndex,E=S==="forbidden",w=E?_o:h.bytes;if(!E){if(typeof x!="string"||x.length===0)throw new TypeError("Resolved font id must not be empty");let T;try{T=e$1(w);}catch{throw new Z(`Font source ${x} must provide genuine bytes`)}if(T>r)throw new Z(`Font source ${x} exceeds the per-font byte ceiling`);if(u+=T,u>c$1)throw new Z(`Font sources exceed the aggregate byte ceiling of ${c$1}`)}y.push(t&&g(h)!==void 0?h:Object.freeze({request:Object.freeze({family:d.family,weight:d.weight,style:d.style}),id:x,bytes:w,hash:R,faceIndex:L,...S?{availability:S}:{}}));}let f;if(a$1){f=[];for(let g=0;g<l;g+=1){let h=a$1[g],d=h.from,S=h.to,x=h.lineMetrics;f.push(Object.freeze({from:Object.freeze({family:d.family,weight:d.weight,style:d.style}),to:Object.freeze({family:S.family,weight:S.weight,style:S.style}),...x?{lineMetrics:Object.freeze({heightEm:x.heightEm,baselineEm:x.baselineEm})}:{}}));}}let p={epoch:n,maxFontBytes:r,sources:Object.freeze(y),substitutions:f?Object.freeze(f):void 0,defaultFont:Object.freeze({family:i.family,sizeHalfPoints:i.sizeHalfPoints}),language:s};return Object.freeze(p)}function Mn(e,t){let n=e.map((o,a)=>({value:o,index:a,key:h(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 ko(e,t){let n={family:e.family},r={sizeHalfPoints:e.sizeHalfPoints};return {...n,...t?r:{}}}function _n(e,t){let n=c=>({family:c.family,weight:c.weight,style:c.style}),r=t?e.sources:Mn(e.sources,c=>c.request),o=e.substitutions??[],a=t?o:Mn(o,c=>c.from),i={sources:r.map(c=>{let l=c.availability??"available",u={request:n(c.request),availability:l};if(l==="forbidden")return {...u,...t?{id:c.id,faceIndex:c.faceIndex,declaredHash:c.hash}:{}};let y=g(c);if(y==null)throw new TypeError("Font configuration identity requires prepared source bytes");return {...u,...t?{id:c.id}:{},faceIndex:c.faceIndex,declaredHash:c.hash,actualHash:y,byteLength:c.bytes.byteLength}}),substitutions:a.map(c=>({from:n(c.from),to:n(c.to),lineMetrics:c.lineMetrics?{heightEm:c.lineMetrics.heightEm,baselineEm:c.lineMetrics.baselineEm}:null})),defaultFont:ko(e.defaultFont,t),language:e.language||"en"},s={epoch:e.epoch,maxFontBytes:e.maxFontBytes};return {version:1,...t?s:{},...i}}var No=Symbol("prepared-layout-font-configuration"),Ne=new WeakMap;function zo(e){return Ne.has(e)}function Do(e){let t=Ne.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.configuration}function Gi(e){let t=Ne.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.sharedShapingFingerprint}function ht(e,t){return kn(e,t,false)}function Ui(e,t){return kn(e,t,true)}function kn(e,t,n){let r=Po(e,n),o=Object.freeze({epoch:r.epoch,maxFontBytes:r.maxFontBytes,sources:Object.freeze(r.sources.map(y=>n&&g(y)!==void 0?y:f$2(y,{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash}))),substitutions:r.substitutions,defaultFont:r.defaultFont,language:r.language}),a=new TextEncoder,i=_n(o,true),s=a.encode(JSON.stringify(i)),c=_n(o,false),l=a.encode(JSON.stringify(c)),u=Object.freeze({[No]:true,fingerprint:`font-config:${f$1(s)}`});return Ne.set(u,{configuration:o,sharedShapingFingerprint:`shared-font-config:${f$1(l)}`}),u}function Ho(e){return ht(e).fingerprint}function Go(e,t){let n=new TextEncoder().encode(JSON.stringify({version:1,environment:e,executionPolicy:On(t),ligatureCaretPolicy:Pn,fallback:sa}));return `shaping:${f$1(n)}`}async function Nn(e,t,n,r,o=false){let i=zo(e)?e:ht(e,t),s=Do(i),{epoch:c,maxFontBytes:l,sources:u,substitutions:y,defaultFont:f}=s,p=s.language||"en",g=i.fingerprint,h=m({epoch:c,maxFontBytes:l,resources:u,substitutions:y,validateFont:dt,instrumentation:{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash,onAdmission:t?.onFontAdmission}});await ut();let d=Object.freeze({script:Mo,variationAxes:Object.freeze({}),shapingLibrary:ie,unicodeDataVersion:Oo,normalization:wo,language:p,features:Bo,...o?{documentLigatures:true}:{},fixedPointScale:Ao,roundingMode:Io});return Object.freeze({fonts:h,shaper:An(n??mt(r),r,n===void 0),defaultFont:f,environment:d,ligatureCaretPolicy:Pn,operation:Object.freeze({resourceEpoch:h.epoch,configEpoch:c,extensionFingerprint:g,shapingHash:Go(d,r),producerVersion:1})})}async function Uo(e,t,n){return Nn(e,t,void 0,wn(n))}async function Ki(e,t,n,r,o=false){return Nn(e,r,t,n,o)}function Ko(e){e.shaper.dispose?.();}function gt(e){let t=new Set([0,e.text.length]);for(let r of ya$1(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 ze(e,t){return gt(e).includes(t)}function Wo(e,t){return ze(e,t)}function Vo(e,t,n){return n>=t&&ze(e,t)&&ze(e,n)}function jo(e){let t=ya$1(e.text);return gt(e).map(n=>n===e.text.length?t.length:t.findIndex(r=>r.utf16From===n))}var xt="und";function Gn(){return typeof Intl.Segmenter=="function"}function Xo(){let e=Intl.Segmenter;if(typeof e!="function")throw new Error(`Intl.Segmenter is required for word segmentation (locale: ${xt})`);return e}function Un(){let e=new(Xo())(xt,{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 Yo=/^[\p{L}\p{N}']$/u,$o=/^\s$/u;function zn(e){return Yo.test(e)}function Dn(e){return $o.test(e)}function St(e,t,n,r){let o=e[t],a=e[n-1];return {utf16From:o.utf16From,utf16To:a.utf16To,wordLike:r}}function Kn(e){let t=ya$1(e);if(t.length===0)return [];let n=[],r=0;for(;r<t.length;){let o=t[r];if(Dn(o.text)){let a=r+1;for(;a<t.length&&Dn(t[a].text);)a+=1;n.push(St(t,r,a,false)),r=a;continue}if(zn(o.text)){let a=r+1;for(;a<t.length&&zn(t[a].text);)a+=1;n.push(St(t,r,a,true)),r=a;continue}n.push(St(t,r,r+1,false)),r+=1;}return n}function Wn(){return {segment:Kn}}function Vn(e={}){let t=e.isIntlAvailable??Gn,n=e.createIntlBoundary??Un,r=e.createFallbackBoundary??Wn;if(!t())return r();try{return n()}catch{return r()}}var Hn;function jn(){return Hn??=Vn(),Hn}function qo(e,t=jn()){return t.segment(e)}function Zo(e,t){return t.map(n=>({graphemeFrom:Ca$1(e,n.utf16From),graphemeTo:Ca$1(e,n.utf16To),wordLike:n.wordLike}))}var Xn={resourceEpoch:"resource-scoped",configEpoch:"coarse-gate",extensionFingerprint:"coarse-gate",shapingHash:"coarse-gate",producerVersion:"coarse-gate"},Ft=Object.keys(Xn),Yn=Ft.filter(e=>Xn[e]==="coarse-gate"),De=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},ce=(e,t)=>{if(e.trim().length===0)throw new TypeError(`${t} must not be blank`)},Jo={resourceEpoch:De,configEpoch:De,extensionFingerprint:ce,shapingHash:ce,producerVersion:De},Qo=(e,t)=>{Jo[t](e[t],t);},le=e=>{for(let t of Ft)Qo(e,t);return Object.freeze({resourceEpoch:e.resourceEpoch,configEpoch:e.configEpoch,extensionFingerprint:e.extensionFingerprint,shapingHash:e.shapingHash,producerVersion:e.producerVersion})},ea=(e,t)=>{let n=le(e),r=le(t),o=Ft.filter(a=>n[a]!==r[a]);return o.length===0?Object.freeze({status:"current"}):Object.freeze({status:"restart",changed:Object.freeze(o)})},bt=e=>{let t=e.map(({key:n,fingerprint:r})=>(ce(n,"resource dependency key"),ce(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)},ta=e=>(De(e.revision,"revision"),ce(e.dependencyFingerprint,"dependencyFingerprint"),ce(e.inputFingerprint,"inputFingerprint"),Object.freeze({revision:e.revision,dependencyFingerprint:e.dependencyFingerprint,inputFingerprint:e.inputFingerprint,resourceDependencies:bt(e.resourceDependencies),...le(e)})),na=(e,t)=>{let n=bt(e),r=bt(t),o=Math.max(n.length,r.length);for(let a=0;a<o;a+=1){let i=n[a],s=r[a];if(i?.key!==s?.key||i?.fingerprint!==s?.fingerprint)return {hit:false,reason:"resource-changed",resourceKey:i?.key??s.key}}return null};function ra(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=na(e.resourceDependencies,t.resourceDependencies);if(n)return n;for(let r of Yn)if(e[r]!==t[r])return {hit:false,reason:"epoch-changed",epoch:r};return null}var Rt=class{entries=new Map;get(t,n){let r=this.entries.get(t);if(!r)return {hit:false,reason:"absent"};let o=ra(r.provenance,n);return o||{hit:true,value:r.value,provenance:r.provenance}}set(t,n,r){this.entries.set(t,{value:n,provenance:ta(r)});}evictEpoch(t){let n=le(t),r=0;for(let[o,a]of this.entries){let i=a.provenance;Yn.some(s=>i[s]!==n[s])&&(this.entries.delete(o),r+=1);}return r}evictResources(t,n){let r=le(t),o=this.evictEpoch(r);for(let[a,i]of this.entries)i.provenance.resourceDependencies.some(c=>n.get(c.key)!==c.fingerprint)&&(this.entries.delete(a),o+=1);return o}get size(){return this.entries.size}};function $n(e){return e.projected===true?null:e.range}function aa(e,t,n,r=false){let{page:o,story:a,host:i,noteScopeId:s,noteAreaKind:c}=e,l=a==="header"||a==="footer"?u=>Ia$1(u,e.origin,{x:o.box.x,y:o.box.y}):void 0;Ra$1(i,(u,y)=>{let{textboxDepth:f,textboxOwner:p,textboxPath:g,storyOrigin:h}=y,d=f===0?a:"textbox";if(r&&u.marker&&!u.lines.some(S=>S.spans.length>0)){let S=u.lines[0];if(!S||!u.marker)return;let x={range:{paragraphId:u.paragraphId,start:S.range.start,end:S.range.start},text:"",props:[],style:u.marker.style,box:{...S.box,width:0}};n({page:o,story:d,rootStory:a,root:e,storyOrigin:h,absoluteBox:Object.freeze({x:h.x+x.box.x,y:h.y+x.box.y,width:0,height:x.box.height}),noteScopeId:s,noteAreaKind:c,textboxDepth:f,textboxOwner:p,textboxPath:g,paragraph:u,paragraphId:u.paragraphId,line:S,span:x,sourceRange:null});return}for(let S of u.lines){let x=[...Ya$1(S)].sort((R,L)=>(t.get(R.paragraphId)??Number.MAX_SAFE_INTEGER)-(t.get(L.paragraphId)??Number.MAX_SAFE_INTEGER));for(let R of x)for(let L of R.spans)n({page:o,story:d,rootStory:a,root:e,storyOrigin:h,absoluteBox:Object.freeze({x:h.x+L.box.x,y:h.y+L.box.y,width:L.box.width,height:L.box.height}),noteScopeId:s,noteAreaKind:c,textboxDepth:f,textboxOwner:p,textboxPath:g,paragraph:u,paragraphId:R.paragraphId,line:S,span:L,sourceRange:$n(L)});}},e.origin,l);}function ia(e,t,n={}){let r=new Map(eb(e).map((o,a)=>[o,a]));Oa$1(e,o=>aa(o,r,t,n.spanlessMarkers===true));}var ca=1,qn=4,te=Object.freeze({top:0,right:0,bottom:0,left:0}),Zn=new WeakMap;function la(e,t){let n=ua(e);return n===te?t:xf(t,n)}function ua(e){let t=e.vectorShape;if(!t)return te;let{cx:n,cy:r}=t.extentEmu;if(!(n>=0)||!(r>=0)||n===0&&r===0)return te;let o=Zn.get(t);if(o||(o=da(t),Zn.set(t,o)),o===te)return te;let a=e.paintBounds,i=e.geometry.contentBounds;if(!(a.width>0||i.width<=0)||!(a.height>0||i.height<=0))return te;let s=n>0?i.width/n:i.height/r,c=r>0?i.height/r:i.width/n,l=(f,p,g)=>{if(g<-1e-3)return 0;let h=f*p-Math.max(0,g);return Number.isFinite(h)&&h>0?h:0},u=e.kind==="inlineDrawing"&&e.placeholderGraphicKind===null,y={left:l(o.left,s,i.x-a.x),top:u?0:l(o.top,c,i.y-a.y),right:l(o.right,s,a.x+a.width-(i.x+i.width)),bottom:l(o.bottom,c,a.y+a.height-(i.y+i.height))};return y.left||y.top||y.right||y.bottom?Object.freeze(y):te}function da(e){let{cx:t,cy:n}=e.extentEmu,r=0,o=0,a=t,i=n,s=(y,f)=>{r=Math.min(r,y),a=Math.max(a,y),o=Math.min(o,f),i=Math.max(i,f);},c=e.overflowVisible===true,l=c?1/0:ca,u=y=>y.x>=-l&&y.x<=t+l&&y.y>=-l&&y.y<=n+l;for(let y of e.components){if(c)for(let d of y.subpathsEmu)for(let S of d)s(S.x,S.y);let f=y.clipEmu?void 0:y.shadow;if(f){let d=1/0,S=1/0,x=-1/0,R=-1/0;for(let T of y.subpathsEmu)for(let v of T){let O=c?v.x:Math.max(0,Math.min(t,v.x)),_=c?v.y:Math.max(0,Math.min(n,v.y));d=Math.min(d,O),S=Math.min(S,_),x=Math.max(x,O),R=Math.max(R,_);}let L=wf(f.blurEmu)*.75+(y.strokeHex!==null?Math.max(1,wf(y.strokeWidthEmu))/2:0),E=wf(f.dxEmu),w=wf(f.dyEmu);d<=x&&(s(d+E-L,S+w-L),s(x+E+L,R+w+L));}if(y.strokeHex===null||y.strokeInset===true)continue;let p=Math.max(1,wf(y.strokeWidthEmu))/2,g=l+Math.max(0,wf(y.strokeOutsetEmu??0)),h=d=>d.x>=-g&&d.x<=t+g&&d.y>=-g&&d.y<=n+g;y.subpathsEmu.forEach((d,S)=>{let x=y.subpathsClosed?.[S]!==false,R=pa(d,x),L=x&&R.length>2?R.length:R.length-1,E=[];for(let T=0;T<L;T+=1){let v=R[T],O=R[(T+1)%R.length],_=Math.hypot(O.x-v.x,O.y-v.y),b={x:-(O.y-v.y)/_,y:(O.x-v.x)/_};if(E.push(b),!!fa(v,O,-g,t+g,-g,n+g))for(let m=0;m<2;m+=1){let F=J[m],C=v.x+(O.x-v.x)*F,B=v.y+(O.y-v.y)*F;s(C+b.x*p,B+b.y*p),s(C-b.x*p,B-b.y*p);}}if(!x&&E.length&&(y.strokeCap==="round"||y.strokeCap==="square")){for(let[T,v,O]of [[R[0],E[0],-1],[R[R.length-1],E[E.length-1],1]])if(h(T))if(y.strokeCap==="round")s(T.x-p,T.y-p),s(T.x+p,T.y+p);else {let _=T.x+O*v.y*p,b=T.y-O*v.x*p;s(_+v.x*p,b+v.y*p),s(_-v.x*p,b-v.y*p);}}let w=x&&R.length>2?E.length:E.length-1;for(let T=0;T<w;T+=1){let v=R[(T+1)%R.length];if(!h(v))continue;if(y.strokeJoin==="round"){s(v.x-p,v.y-p),s(v.x+p,v.y+p);continue}if(y.strokeJoin==="bevel")continue;let O=E[T],_=E[(T+1)%E.length],b=1+O.x*_.x+O.y*_.y;if(b<2/(qn*qn))continue;let m=O.y*-_.x- -O.x*_.y;if(m===0)continue;let F=m>0?-1:1;s(v.x+F*(O.x+_.x)*p/b,v.y+F*(O.y+_.y)*p/b);}});for(let d of y.arrowheadsEmu??[])if(!(!d[0]||!u(d[0])))for(let S of d)s(S.x,S.y);}return r>=0&&o>=0&&a<=t&&i<=n?te:Object.freeze({left:-r,top:-o,right:a-t,bottom:i-n})}function pa(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 J=new Float64Array(2);function fa(e,t,n,r,o,a){let i=t.x-e.x,s=t.y-e.y;return J[0]=0,J[1]=1,He(-i,e.x-n)&&He(i,r-e.x)&&He(-s,e.y-o)&&He(s,a-e.y)}function He(e,t){if(e===0)return t>=0;let n=t/e;return e<0?J[0]=Math.max(J[0],n):J[1]=Math.min(J[1],n),J[0]<=J[1]}var ma="abcdefghijklmnopqrstuvwxyz";function z(e){let t=Math.round(e.fontSizePt*2);return Math.max(1,t)}function j(e,t,n,r,o){let a=r.shaping?.context;return e.shape({text:o,fontSizeHalfPoints:z(r),bidiLevel:r.shaping?.direction==="rtl"?1:0,environment:ya(t,n,r),...a?{context:a}:{}})}var Jn=new WeakMap;function ya(e,t,n){if(!Object.isFrozen(e)||!Object.isFrozen(e.features)||!Object.isFrozen(e.variationAxes)||!Object.isFrozen(e.shapingLibrary))return Qn(e,t,n);let r=n.shaping?.direction??"ltr",o=n.shaping?.script,a=`${r}|${o??""}|${w(n)?1:0}|${e.documentLigatures?O(n):""}|${n.smallCaps?1:0}`,i=Jn.get(e);i||Jn.set(e,i=new WeakMap);let s=i.get(t);s||i.set(t,s=new Map);let c=s.get(a);return c||s.set(a,c=Qn(e,t,n)),c}function Qn(e,t,n){return r({...e,font:t,direction:n.shaping?.direction??"ltr",script:n.shaping?.script==="Zyyy"?e.script:n.shaping?.script??e.script,features:{...e.features,kern:w(n)?1:0,...e.documentLigatures?N(n):{},...n.smallCaps?{smcp:1}:{}},fallbackOrder:[]})}function Ge(e,t,n,r,o){let a=o.get(n);if(a!==void 0)return a;let i=true;try{for(let s of ma){let c=j(e,t,n,{...r,smallCaps:!0},s),l=j(e,t,n,{...r,smallCaps:!1},s);if(!(c.glyphs.length!==l.glyphs.length||c.glyphs.some((y,f)=>y.id!==l.glyphs[f]?.id))){i=!1;break}}}catch{i=false;}return o.set(n,i),i}var ha=new Map([["garamond",{family:"Garamond",em:er(1765,539,0)}],["segoe ui",{family:"Segoe UI",em:er(2210,514,0)}]]);function er(e,t,n){return {heightEm:(e+t+n)/2048,baselineEm:(e+n)/2048}}function Ct(e){return e?ha.get(e.trim().toLowerCase()):void 0}function Ue(e){let t=Ct(e.fontFamily);if(!t)return;let n=z(e)/2*ra$1(e);return {height:t.em.heightEm*n,baseline:t.em.baselineEm*n}}var ga=new Map([["roman","serif"],["swiss","sans"],["modern","mono"]]);function ds(e,t){return t==="fixed"?"mono":e?ga.get(e):void 0}var Sa=new Map([["calibri","sans"],["arial","sans"],["helvetica","sans"],["verdana","sans"],["tahoma","sans"],["segoe ui","sans"],["aptos","sans"],["century gothic","sans"],["carlito","sans"],["cambria","serif"],["times new roman","serif"],["georgia","serif"],["garamond","serif"],["book antiqua","serif"],["palatino linotype","serif"],["caladea","serif"],["courier new","mono"],["consolas","mono"]]);function tr(e){let t=e.trim().toLowerCase(),n=Sa.get(t);if(n)return n;let r=t.split(/[\s_-]+/);if(r.includes("mono")||r.includes("monospace")||r.includes("courier"))return "mono";if(r.includes("sans"))return "sans";if(r.includes("serif")||r.includes("roman"))return "serif"}var ps={serif:"Times New Roman",sans:"Arial",mono:"Courier New"};var Et="Calibri, Carlito, Helvetica, Arial, sans-serif",xa='"Times New Roman", "Liberation Serif", Tinos, serif',ba='"Courier New", "Liberation Mono", Cousine, monospace';function Ra(e,t=Et){if(!e)return t;let n=tr(e);return n==="serif"?xa:n==="mono"?ba:t}var bs=new Map([["calibri","Carlito"]]),Fa=65536,Ca=256;function nr(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 rr(e){let t=new Map,n=null,r=null,o=0,a=s=>{s.older?s.older.newer=s.newer:n=s.newer,s.newer?s.newer.older=s.older:r=s.older,s.older=null,s.newer=null;},i=s=>{s.older=r,s.newer=null,r?r.newer=s:n=s,r=s;};return {get(s){let c=t.get(s);if(c!==void 0)return c!==r&&(a(c),i(c)),c.value},set(s,c){let l=t.get(s);if(l){l.value=c,l!==r&&(a(l),i(l));return}let u={key:s,value:c,older:null,newer:null};for(t.set(s,u),i(u);t.size>e&&n;){let y=n;a(y),t.delete(y.key),o+=1;}},get size(){return t.size},get evictions(){return o}}}var or=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function ar(e=null){return e!=null&&typeof e.measureText=="function"}function ir(e={}){let t=e.scale??1;if(!(t>0)||!Number.isFinite(t))return null;let n=e.fallbackFamily??Et,r=e.context??null;if(!ar(r))return null;let o=r,a=rr(nr(e.maxWidthEntries,Fa)),i=rr(nr(e.maxMetricsEntries,Ca)),s=e.fontAlias,c=new Map,l=f=>{let p=c.get(f);if(p!==void 0)return p;let g="The quick brown fox 0123",h=false;for(let d of ["monospace","serif"]){o.font=`32px ${d}`;let S=o.measureText(g).width;if(o.font=`32px "${f}", ${d}`,o.measureText(g).width!==S){h=true;break}}return c.set(f,h),h},u=f=>{let p=f.fontFamily&&or.test(f.fontFamily)?f.fontFamily:null,g=p?s?.(p):void 0,h=g&&or.test(g)?g:null,d=Ra(p,n),S=p?h?`"${h}", "${p}", ${d}`:`"${p}", ${d}`:n,x=f.bold?"bold":"normal",R=f.italic?"italic":"normal",L=f.smallCaps?"small-caps":"normal",E=f.fontSizePt*ra$1(f)*t;return `${R} ${L} ${x} ${E}px ${S}`},y$1=(f,p,g)=>f/t*(g.horizontalScalePercent/100)+p.length*g.characterSpacingPt;return {measure(f,p){if(f.length===0)return 0;let g=u(p),h=y(p,f),d=`${g}\0${h}\0${f}`,S=a.get(d);if(S!==void 0)return y$1(S,f,p);o.font=g,"fontKerning"in o&&(o.fontKerning=h?"normal":"none");let x=o.measureText(f).width;return a.set(d,x),y$1(x,f,p)},inkBounds(f,p){if(!f||f.length>2||p.shaping?.direction==="rtl"||ya$1(f).length!==1)return;o.font=u(p),"fontKerning"in o&&(o.fontKerning=w(p)?"normal":"none");let g=o.textAlign,h=o.direction,d;try{g!==void 0&&(o.textAlign="left"),h!==void 0&&(o.direction="ltr"),d=o.measureText(f);}finally{g!==void 0&&(o.textAlign=g),h!==void 0&&(o.direction=h);}let S=d.actualBoundingBoxLeft,x=d.actualBoundingBoxRight;if(S===void 0||x===void 0||!Number.isFinite(S)||!Number.isFinite(x))return;let R=p.horizontalScalePercent/(100*t);return {left:-S*R,right:x*R}},textOutline(f,p){if(!f||p.shaping?.direction==="rtl")return;o.font=u(p),"fontKerning"in o&&(o.fontKerning=w(p)?"normal":"none");let g=o.textAlign,h=o.textBaseline,d;try{g!==void 0&&(o.textAlign="left"),h!==void 0&&(o.textBaseline="alphabetic"),d=o.measureText(f);}finally{g!==void 0&&(o.textAlign=g),h!==void 0&&(o.textBaseline=h);}let S=[-(d.actualBoundingBoxLeft??NaN),-(d.actualBoundingBoxAscent??NaN),d.actualBoundingBoxRight??NaN,d.actualBoundingBoxDescent??NaN].map(w=>w/t);if(S.some(w=>!Number.isFinite(w)))return;let[x,R,L,E]=S;if(!(!(L>x)||!(E>R)))return {path:null,ink:{left:x,top:R,right:L,bottom:E}}},lineMetrics(f){let p=f.fontSizePt*ra$1(f),g=u(f),h=i.get(g);if(h)return h;let d=Ct(f.fontFamily),S=d&&!l(d.family)&&Ue(f);if(S)return i.set(g,S),S;let x=p*1.15,R=p*.8;o.font=g,"fontKerning"in o&&(o.fontKerning=w(f)?"normal":"none");let L=o.measureText("Hxg"),E=L.fontBoundingBoxAscent,w$1=L.fontBoundingBoxDescent;if(typeof E=="number"&&Number.isFinite(E)&&E>0&&(R=E/t,typeof w$1=="number"&&Number.isFinite(w$1)&&w$1>=0)){let v=(E+w$1)/t;v>0&&(x=Math.max(v,x));}x>0||(x=p*1.15);let T={height:x,baseline:R};return i.set(g,T),T}}}function Ea(e=1,t={}){let n=ir({...t,scale:t.scale??e});return n?{measurer:n,producer:t.fontAlias?"canvas-measurer+embedded":"canvas-measurer"}:{measurer:ta$1(),producer:"fixed-measurer"}}function va(e){let t;return n=>{t===void 0&&(t=id(e.pages)?.hosts??null);let r=t?.get(n);return r?gd(r.pageNumber,r.format):null}}function sr(e,t){let n=tf(e,t.displayMode??lb),r=Nd({numberingIndex:t.numberingIndex,styleCascade:t.styleCascade},n).listItems,o=t.package?{footnotesPart:gj(t.package,"footnote"),endnotesPart:gj(t.package,"endnote")}:void 0,a=he$1(n,r,o,t.package?ee(t.package,e,n):void 0,t.displayMode??lb);return {blocks:n,notes:o,context:a}}function cr(e,t,n,r,o){for(let a of t){if(r.length>=sn)return;if(n.tokenForParagraph(a.id)!==""&&vn$1(e,a.id)===null)for(let i of un(a)){if(r.length>=sn)return;if(!i.rewritable)continue;let s=Vc(i.instruction);if(s===null)continue;let c=n.liveValueOf(i.fieldNodeId,s);if(c===null&&o&&n.pageRefProjectionOf){let l=n.pageRefProjectionOf(i.fieldNodeId,s);if(l){let u=o(l.targetParagraphId);u!==null&&u.length>0&&hd(l.calibration,l.cached,u,Number.NaN)&&(c=u);}}c===null||c===i.cachedText||c.length>tn||c.includes("\r")||r.push({paragraphId:a.id,fieldNodeId:i.fieldNodeId,text:c});}}}function La(e,t){let{blocks:n,context:r}=sr(e,t);if(r===null)return null;let o=[];return cr(e,Yc(vc(n)),r,o,t.pageRefPageNumberOf),o.length===0?null:{op:"refreshFieldResults",updates:o}}function As(e,t){let{notes:n,context:r}=sr(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:s}of a){if(!s)continue;let c=[];for(let l of fe$1(s,t.displayMode??lb)){if(c.length>=sn)break;cr(s,Yc(vc(l)),r,c);}c.length>0&&o.push({noteKind:i,op:{op:"refreshFieldResults",updates:c}});}return o}function Ta(e){return e.box}function lr(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)lr(o,t);}function Ba(e){let t=new Map,n=(o,a,i)=>{if(!(o.kind==="textValue"||i>Xb*4)){for(let s of o.children)if(s.kind!=="textValue"){if(s.kind==="paragraph"){for(let c of r)t.get(c)?.push(s.id);n(s,s.id,i+1);continue}if(s.kind==="contentControl"){t.set(s.id,[]),r.push(s.id);let c=fc(s);c&&n(c,a,i+1),r.pop();let l=t.get(s.id);l&&l.length===0&&a!==null&&l.push(a);continue}n(s,a,i+1);}}},r=[];return n(e,null,0),t}function Oa(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 wa(e,t){let n=jc(e.root);if(n.length===0)return Aa;let r=new Map;t.pages.forEach((i,s)=>{(l=>{for(let u of l){let y=new Set;lr(u,y);for(let f of y){let p=r.get(f)??[];p.push({pageIndex:s,box:Ta(u)}),r.set(f,p);}}})(i.fragments);});let o=Ba(e.root),a=[];for(let i of n){let s=hc(i.node),c=[...i.ancestors.map(f=>hc(f).lock),s.lock],l=o.get(i.node.id)??[],u=new Map;for(let f of l)for(let p of r.get(f)??[]){let g=u.get(p.pageIndex);u.set(p.pageIndex,g?Oa(g,p.box):p.box);}let y=[...u.entries()].sort((f,p)=>f[0]-p[0]).map(([f,p])=>({pageIndex:f,...p}));a.push({controlId:i.node.id,type:s.type,level:ic(i.node),depth:i.depth,lock:s.lock,effectiveLock:mc(c),showingPlaceholder:s.showingPlaceholder,temporary:s.temporary,...s.tag===void 0?{}:{tag:s.tag},...s.alias===void 0?{}:{alias:s.alias},...s.id===void 0?{}:{id:s.id},...s.dataBinding===void 0?{}:{dataBinding:s.dataBinding},paragraphIds:l,fragments:y});}return a}var Aa=Object.freeze([]);var Ia=4096;function Ma(e,t=0){if(!(e instanceof Uint8Array)||!Number.isSafeInteger(t)||t<0||e.byteLength<12)return;let n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=(h,d)=>Number.isSafeInteger(h)&&Number.isSafeInteger(d)&&h>=0&&d>=0&&h<=e.length-d,o=h=>n.getUint16(h,false),a=h=>n.getUint32(h,false),i=0,s=false;if(a(0)===1953784678){s=true;let h=a(4),d=a(8);if(![65536,131072].includes(h)||!d||t>=d||!r(12,d*4))return;i=a(12+t*4);}else if(t!==0)return;if(!r(i,12)||![65536,1330926671,1953658213].includes(a(i)))return;let c=o(i+4);if(!c||c>Ia||!r(i+12,c*16))return;let l=new Map;for(let h=0;h<c;h++){let d=i+12+h*16,S=a(d),x=a(d+8),R=a(d+12);if(l.has(S)||!r(x,R))return;l.set(S,{offset:x,length:R});}let u=l.get(1751474532),y=l.get(1330851634);if(!u||u.length<20||!y||y.length<4)return;let f=o(u.offset+18),p=o(y.offset),g=n.getInt16(y.offset+2,false);if(!(f<16||f>16384||p>5||g<=0))return Object.freeze({faceIndex:t,collection:s,unitsPerEm:f,os2Version:p,xAvgCharWidth:g,averageAdvanceEm:g/f})}function ur(e,t=Ma){if(typeof e!="function"||typeof t!="function")return;let n=new WeakMap;return r=>{if(!ec(r))return;let o;try{o=e(r);}catch{return}if(!o||typeof o!="object"||o.substitution!==null||o.family.trim().toLowerCase()!==r.fontFamily?.trim().toLowerCase()||typeof o.hash!="string"||!/^sha256:[0-9a-f]{64}$/u.test(o.hash)||!Number.isSafeInteger(o.faceIndex)||o.faceIndex<0)return;let a=n.get(o);if(a===void 0&&(a=t(o.bytes,o.faceIndex)??null,n.set(o,a)),!a)return;let i=r.fontSizePt*a.averageAdvanceEm/2;return Number.isFinite(i)&&i>=0&&i<=r.fontSizePt?i:void 0}}var K=(e,t)=>e[t]<<8|e[t+1],Q=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0;function _a(e,t){let n=(i,s)=>i>=0&&i+s<=e.length;if(!n(0,12))return null;let r=Q(e,0)===1953784678;if(r&&!n(12+t*4,4))return null;let o=r?Q(e,12+t*4):0;if(!n(o,12))return null;let a=K(e,o+4);for(let i=0;i<a;i+=1){let s=o+12+i*16;if(!n(s,16))return null;if(Q(e,s)!==1668112752)continue;let c=Q(e,s+8);if(!n(c,4))return null;let l=null,u=null,y=K(e,c+2);for(let f=0;f<y;f+=1){let p=c+4+f*8;if(!n(p,8))return null;let g=K(e,p),h=K(e,p+2),d=c+Q(e,p+4);if(!n(d,2)||!(g===0||g===3&&(h===1||h===10)))continue;let x=K(e,d);x===12&&u===null&&(u=d),x===4&&l===null&&(l=d);}return u!==null?{format:12,offset:u}:l!==null?{format:4,offset:l}:null}return null}function Pa(e,t,n){let r=(u,y)=>u>=0&&u+y<=e.length,o=t.offset;if(t.format===12){if(!r(o,16))return false;let u=Q(e,o+12),y=0,f=Math.min(u,Math.floor((e.length-o-16)/12))-1;for(;y<=f;){let p=y+f>>>1,g=o+16+p*12,h=Q(e,g),d=Q(e,g+4);if(n<h)f=p-1;else if(n>d)y=p+1;else return Q(e,g+8)+(n-h)!==0}return false}if(n>65535||!r(o,14))return false;let a=K(e,o+6)>>>1,i=o+14,s=i+a*2+2,c=s+a*2,l=c+a*2;if(!r(l,a*2))return false;for(let u=0;u<a;u+=1){if(n>K(e,i+u*2))continue;let y=K(e,s+u*2);if(n<y)return false;let f=K(e,c+u*2),p=l+u*2,g=K(e,p);if(g===0)return (n+f&65535)!==0;let h=p+g+(n-y)*2;if(!r(h,2))return false;let d=K(e,h);return d!==0&&(d+f&65535)!==0}return false}var dr=new WeakMap;function pr(e,t){let n=i(e),r=dr.get(e);return r===void 0&&(r=_a(n,e.faceIndex),dr.set(e,r)),r?Pa(n,r,t):void 0}var fr=new WeakMap;function ka(e){let t=fr.get(e);if(t!==void 0)return t;let n=i(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$1=r.getUint16(a+4);for(let s=0;s<i$1;s++){let c=a+12+s*16;if(r.getUint32(c)!==1330851634)continue;let l=r.getUint32(c+8),u=r.getUint32(c+12);u>=86&&l<=n.byteLength-u&&r.getUint16(l)>=1&&(o=(r.getUint32(l+78)&1966080)!==0);break}return fr.set(e,o),o}var mr=1.3;function yr(e,t,n,r,o,a=false){let i=n.height-r;if(!(Math.abs(i-t)<=o)&&!a||!ka(e))return n;let c=a?i*mr:Math.max(n.height,t*mr),l=n.baseline-r;return {height:c,baseline:l+(c-i)/2}}var Na=.89111328125,za=443/2048,Da=87/2048,Ha=1/2048,Ga=new Set(["Arab","Hebr","Syrc","Thaa","Nkoo"]);function hr(e){return e.latinLane===void 0&&!Ga.has(e.shaping?.script??"")}function gr(e,t,n,r,o,a=true){if(!a||r!==0||!(o>0)||e.trim().toLowerCase()!=="times new roman")return r;let i=(s,c)=>Math.abs(s/o-c)<=Ha;return i(t,Na)&&i(n,za)?Da*o:r}var Ua=.5;function Ka(e,t){if(t.fontFamily===null)return false;let n=e.substitution;return n!==null&&(n.lineMetrics!==void 0||!he$2(n.requested.family,n.resolved.family))?false:e.family===t.fontFamily||he$2(e.family,t.fontFamily)}function Sr(e,t,n,r,o){let a=new WeakMap;return (i,s)=>{let c=ra$1(s),l=a.get(i);l||(l=new Map,a.set(i,l));let u=z(s),y=hr(s),f=Ka(i,s),p=(y?u:-u)+(f?Ua:0),g=l.get(p);if(g)return c===1?g:{height:g.height*c,baseline:g.baseline*c};let h,d=true,S=i.substitution?.lineMetrics;if(S){let x=u/2;h={height:S.heightEm*x,baseline:S.baselineEm*x};}else try{let x=j(e,t,i,s,""),R=x.metrics.ascent/t.fixedPointScale,L=x.metrics.descent/t.fixedPointScale,E=u/2,w=R+L,T=E*r,v=w>T?T/w:1,O=w*v,_=x.metrics.lineGap/t.fixedPointScale,b=Math.min(Math.max(0,gr(i.family,R,L,_,E,y)),O*o),m=O+b;m>0?h=yr(i,E,{height:m,baseline:R*v+b},b,2/t.fixedPointScale,f):(h=n.lineMetrics(s),d=!1);}catch{h=n.lineMetrics(s),d=false;}return d?(l.set(p,h),c===1?h:{height:h.height*c,baseline:h.baseline*c}):h}}var vt=2048,Wa=32,Va=new Map([["symbol",{ascent:2059,descent:450,advances:[512,682,1460,1024,1124,1706,1593,899,682,682,1024,1124,512,1124,512,569,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,569,569,1124,1124,1124,909,1124,1479,1366,1479,1253,1251,1563,1235,1479,682,1292,1479,1405,1821,1479,1479,1573,1518,1139,1212,1251,1413,899,1573,1321,1628,1251,682,1767,682,1348,1024,1024,1292,1124,1124,1012,899,1067,842,1235,674,1235,1124,1124,1180,1067,1124,1124,1067,1124,1235,899,1180,1460,1405,1010,1405,1012,983,410,983,1124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1270,506,1124,342,1460,1024,1542,1542,1542,1542,2134,2021,1235,2021,1235,819,1124,842,1124,1124,1460,1012,942,1124,1124,1124,1124,2048,1235,2048,1348,1686,1405,1628,2021,1573,1573,1686,1573,1573,1460,1460,1460,1460,1460,1460,1460,1573,1460,1618,1618,1823,1686,1124,512,1460,1235,1235,2134,2021,1235,2021,1235,1012,674,1618,1618,1610,1460,786,786,786,786,786,786,1012,1012,1012,1012,0,674,561,1405,1405,1405,786,786,786,786,786,786,1012,1012,1012,0]}],["wingdings",{ascent:1841,descent:432,advances:[2048,2110,2344,2665,2752,1830,2492,938,2220,1826,2319,2319,2399,2399,2951,2956,2245,2751,1431,1431,1826,1135,1233,2196,1941,2208,1924,1825,1826,1826,1825,1863,1863,1203,1624,1381,1381,1929,1929,1124,1124,1826,1727,1727,1727,2275,1352,1739,2230,1819,1803,1332,1665,1529,1529,1480,1420,1627,1813,1826,1834,1825,2368,2159,1974,2233,1927,1911,1937,2099,1902,2245,2181,1597,2150,2603,1529,1951,1529,1825,1825,1825,1825,937,1529,2020,1825,1183,2171,2171,1825,1826,1826,1086,1086,0,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,2048,2048,2048,2048,2048,2048,2048,2048,641,937,641,1825,1825,1825,1825,1825,1951,937,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2146,2146,2146,2146,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2566,2566,1627,1627,1825,1825,1825,1825,1825,1825,2006,2006,1825,1825,1589,1589,1589,1589,2186,2186,1825,1825,1787,1787,1787,1787,1825,1825,1660,1660,2171,1660,1601,1601,1601,1601,987,789,1301,1609,1826,1826,2119]}],["wingdings 2",{ascent:1727,descent:432,advances:[2048,2110,2090,2073,2086,2344,2045,2220,989,1431,1431,1826,1431,1431,1826,1431,1431,1826,1431,1431,2320,2246,1826,1826,1826,2320,2170,2170,1381,1381,1938,1938,1938,1938,1928,1928,1928,1928,1047,1047,1047,1047,1178,1178,1178,1178,1826,1321,1568,1826,1826,1826,1826,1825,1825,1826,1826,2226,1727,1548,1579,984,1035,864,1018,2048,2048,2048,2048,2048,2048,2048,2048,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,0,1899,1899,1453,1453,1673,1332,1431,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2048,2048,542,740,1135,1825,1825,1825,1825,1825,1825,1825,542,740,1135,1825,1825,1825,1825,1825,1825,1825,1825,1825,624,764,903,1461,2020,2020,2020,2020,2020,542,641,740,1135,1529,1529,1085,1085,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1496,1825,0,0,0,0,0,0]}],["wingdings 3",{ascent:1900,descent:432,advances:[2048,1825,1825,1135,1135,1444,1444,1444,1444,1825,1825,1135,1135,1677,1677,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1825,1825,1455,1455,1455,1455,2010,2010,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2220,1825,1751,1114,1115,1660,1660,1930,1930,1930,1930,1924,1924,1924,1924,1930,1930,1931,1931,1825,1825,1232,1232,1444,1444,1444,1444,1825,1232,2005,2005,2005,2005,1801,1801,1801,1801,1801,1801,1801,1801,1085,1085,1825,0,1825,1825,1825,1825,1825,1627,1627,1825,1825,1825,1825,789,789,1825,1825,987,987,1825,1825,1184,1184,1825,1825,1579,1579,1825,1825,888,888,1825,1825,1381,1381,1825,1825,1875,1875,1825,1825,1825,1825,1825,1825,1825,789,592,493,394,1825,1825,1825,1825,1825,1085,1085,1381,1381,1628,1628,1184,1184,900,900,1825,1825,1019,1019,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1291,1291,1291,1291,1961,1961,1825,1825,1540,1540,1540,1540,2096,2096,1825,1825,1688,1688,1688,1688,2277,2277,1825,1825,1885,1885,1885,1885,543,543,1234,1234,766,766,1234,1234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],["webdings",{ascent:1638,descent:410,advances:[1024,2048,2048,2048,2048,2028,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1100,1100,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1144,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,0,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2500,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1377,1377,2048,1726,1058,2048,2048,2048,2048,877,1240,2048,2048,2048,2048,1357,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2645,2048,2048,2048,2048]}]]);function ja(e){if(b$1(e))return Va.get(e.toLowerCase())}function xr(e,t,n,r){let o=z(r)/2*ra$1(r)*(r.horizontalScalePercent/100)/vt,a=[];for(let i=0;i<n.length;i++){let s=c$2(n.charCodeAt(i),t),c=s===null?0:e.advances[s-Wa]??0;if(c===0)return;a.push(c*o+r.characterSpacingPt);}return a}function br(e){let t=new WeakMap,n=r=>{let o=t.get(r);return o===void 0&&(o=ja(r.fontFamily)??null,t.set(r,o)),o};return {...e,measure(r,o){let a=n(o),i=a&&xr(a,o.fontFamily,r,o);if(!i)return e.measure(r,o);let s=0;for(let c of i)s+=c;return s},caretAdvances(r,o){let a=n(o),i=a&&xr(a,o.fontFamily,r,o);if(!i)return e.caretAdvances?.(r,o);let s=[0];for(let c of i)s.push(s[s.length-1]+c);return s},lineMetrics(r,o){let a=n(r);if(!a)return e.lineMetrics(r,o);let i=z(r)/2*ra$1(r);return {height:(a.ascent+a.descent)*i/vt,baseline:a.ascent*i/vt}}}}var Xa={M:2,L:2,Q:4,C:6,Z:0},Rr=e=>{let t=Math.round(e*1e3)/1e3;return String(Object.is(t,-0)?0:t)};function Lt(e,t,n){if(!(t>0)||!(n>0))return;let r=[],o=0,a=1/0,i=-1/0,s=1/0,c=-1/0;for(let l of e.glyphs){if(l.id===0)return;let u=l.outline.path,y=l.outline.unitsPerEm;if(!u)continue;if(!(y>0)||!u.startsWith("M")||/[^MLQCZ0-9eE+.,\s-]/u.test(u))return;let f=t*(l.drawScale??1)/y,p=(l.originX+l.offsetX)/n,g=(l.originY+l.offsetY)/n;for(let h of u.matchAll(/([MLQCZ])([^MLQCZ]*)/gu)){let d=h[1],S=h[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(S.length!==Xa[d]||S.some(R=>!Number.isFinite(R)))return;let x=d;for(let R=0;R<S.length;R+=2){let L=p+S[R]*f,E=-(g+S[R+1]*f);a=Math.min(a,L),i=Math.max(i,L),s=Math.min(s,E),c=Math.max(c,E),x+=`${R?" ":""}${Rr(L)} ${Rr(E)}`;}if(o+=x.length,o>2e6)return;r.push(x);}}if(!(!r.length||!(i>a)||!(c>s)))return Object.freeze({path:r.join(""),ink:Object.freeze({left:a,top:s,right:i,bottom:c})})}var Tt=new WeakMap;function Ya(e){let t=Tt.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 s of a){let c=s[1]==="Z"?0:s[1]==="C"?6:s[1]==="Q"?4:2,l=s[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(l.length!==c||l.some(u=>!Number.isFinite(u))){Tt.set(e,null);return}for(let u=0;u<l.length;u+=2)r=Math.min(r,l[u]),o=Math.max(o,l[u]);}let i=Number.isFinite(r)&&Number.isFinite(o)?{left:r,right:o}:void 0;return Tt.set(e,i??null),i}function Fr(e,t,n,r){if(e.clusters.length!==1||e.glyphs.length===0)return;let o=1/0,a=-1/0;for(let s of e.glyphs){if(s.id===0)return;let c=Ya(s.outline),l=s.outline.unitsPerEm;if(!c||!(l>0))return;let u=(s.originX+s.offsetX)/n;o=Math.min(o,u+c.left*t*(s.drawScale??1)/l),a=Math.max(a,u+c.right*t*(s.drawScale??1)/l);}let i={left:o*r,right:a*r};return Number.isFinite(i.left)&&Number.isFinite(i.right)?i:void 0}function $a(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 Cr(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 s=n+12+i*16;if(e.getUint32(s)!==r)continue;let c=e.getUint32(s+8),l=e.getUint32(s+12);return l<o||c+l>t?null:c}return null}function Er(e,t){let n=e.byteLength,r=new DataView(e.buffer,e.byteOffset,n),o=$a(r,n,t);if(o===null)return null;let a=Cr(r,n,o,1751474532,54);if(a===null)return null;let i=r.getUint16(a+18);if(i<=0)return null;let s=Cr(r,n,o,1330851634,30);if(s===null)return null;let c=r.getInt16(s+26)/i,l=r.getInt16(s+28)/i;return !(c>0)||c>1||!(Math.abs(l)<=1)?null:{offsetEm:l,thicknessEm:c}}var Ke=.02;function Bt(e,t){return e.bold===true&&t.request.weight<600}function vr(e){return e.advanceX>0&&e.outline.path.length>0}function Lr(e){let t=0;for(let n of e.glyphs)vr(n)&&t++;return t}function Tr(e,t,n){if(n<=0)return e;let r=new Array(e.length).fill(0);for(let a of t.glyphs){if(!vr(a))continue;let i=Math.min(Math.max(a.cluster+1,1),e.length-1);r[i]+=n;}let o=0;return e.map((a,i)=>(o+=r[i],a+o))}var qa=.5,Za=4096,Ja=4,Br=4096;function Or(e){let t="environment"in e?e.environment:void 0,n="environment"in e?void 0:e,{shaper:r,resolveFont:o}=e,a=br(e.fallback),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:{}},s=new WeakMap,c=new WeakMap,l=q$1(r),u=Sr(r,i,a,Ja,qa),y=new WeakMap,f=new WeakMap,p=new Array(Br),g=0,h=(b,m,F)=>{let C=p[g];C&&C.cache.delete(C.text),b.set(m,F),p[g]={cache:b,text:m},g=(g+1)%Br;},d=b=>{let m=y.get(b);if(m!==void 0)return m;let F=o(b);return y.set(b,F),F},S=ur(d),x=(b,m,F)=>{let C=F?c:s,B=C.get(b);B||(B=new Map,C.set(b,B));let I=B.get(m);return I||(I=new Map,B.set(m,I)),I},R=new WeakMap,L=b=>{if(!b.shaping?.wordSpacingPt)return b;let m=R.get(b);return m||(m={...b,shaping:{...b.shaping,wordSpacingPt:void 0}},R.set(b,m)),m},E=(b,m)=>m.shaping?.wordSpacingPt?bc(b)*m.shaping.wordSpacingPt:0,w$1=(b,m)=>a.measure(b,L(m))+E(b,m),T=(b,m)=>{let F=Math.max(0,a.measure(b,L(m))),C=a.caretAdvances?.(b,L(m))??$b(b,F);if(!C||C.length!==b.length+1)return $b(b,w$1(b,m));let B=Math.max(0,w$1(b,m)),I=0,P=0;return C.map((N,D)=>{if(D===0)return 0;b[D-1]===" "&&P++;let M=N+P*(m.shaping?.wordSpacingPt??0);return I=Math.max(I,Math.min(B,Number.isFinite(M)?M:I)),D===b.length?B:I})},v=new WeakMap,O$1=new WeakMap;return dc({hasResolvedFont(b){return d(b)!==null},faceCovers(b,m){let F=d(m);if(!F)return;let C=O$1.get(F);C||(C=new Map,O$1.set(F,C));let B=C.get(b);if(B!==void 0)return B;let I=true;for(let P of b){let N=pr(F,P.codePointAt(0));if(N===void 0)return;if(!N){I=false;break}}return C.size<Za&&C.set(b,I),I},strikeoutMetrics(b){let m=d(b);if(!m)return;let F=v.get(m);if(F===void 0&&(F=Er(m.bytes,m.faceIndex),v.set(m,F)),!F)return;let C=z(b)/2*ra$1(b);return {offsetPt:F.offsetEm*C,thicknessPt:F.thicknessEm*C}},measure(b,m){if(b.length===0)return 0;let F=d(m);if(!F)return w$1(b,m);let C=x(F,z(m),m.smallCaps),B=m.shaping?.context,I=m.shaping?`1:${JSON.stringify(B?[m.shaping.script,m.shaping.direction,b,B.before,B.after]:[m.shaping.script,m.shaping.direction,b])}`:`0:${b}`,P=Bt(m,F),N=`${w(m)?1:0}:${P?1:0}:${O(m)}:${I}`,D=C.get(N);if(D===void 0){let M=0;try{if(m.smallCaps&&!Ge(r,i,F,m,f))return w$1(b,m);let G=j(r,i,F,m,b);if(G.glyphs.some(ee=>ee.id===0))return w$1(b,m);for(let ee of G.glyphs)M+=ee.advanceX;P&&(M+=Lr(G)*(z(m)/2)*.02*i.fixedPointScale);}catch{return w$1(b,m)}D=M/i.fixedPointScale,h(C,N,D);}return D*ra$1(m)*(m.horizontalScalePercent/100)+b.length*m.characterSpacingPt+E(b,m)},inkBounds(b,m){if(!b||b.length>2||m.shaping?.direction==="rtl"||ya$1(b).length!==1)return;let F=d(m);if(!F)return a.inkBounds?.(b,m);try{if(m.smallCaps&&!Ge(r,i,F,m,f))return a.inkBounds?.(b,m);let C=j(r,i,F,m,b);return Fr(C,z(m)/2,i.fixedPointScale,ra$1(m)*m.horizontalScalePercent/100)}catch{return}},textOutline(b,m){let F=d(m);if(!F)return a.textOutline?.(b,m);try{let C=j(r,i,F,m,b);return Lt(C,z(m)/2,i.fixedPointScale)??a.textOutline?.(b,m)}catch{return a.textOutline?.(b,m)}},caretAdvances(b,m){let F=d(m);if(!F)return T(b,m);try{if(m.smallCaps&&!Ge(r,i,F,m,f))return T(b,m);let C=j(r,i,F,m,b);if(C.glyphs.some(P=>P.id===0))return T(b,m);let B=ac(b,C,ra$1(m)*(m.horizontalScalePercent/100)/i.fixedPointScale,m.characterSpacingPt,m.shaping?.wordSpacingPt??0)??$b(b,C.glyphs.reduce((P,N)=>P+N.advanceX,0)*ra$1(m)*(m.horizontalScalePercent/100)/i.fixedPointScale+b.length*m.characterSpacingPt+E(b,m));if(!B||!Bt(m,F))return B;let I=z(m)/2*.02*ra$1(m)*(m.horizontalScalePercent/100);return Tr(B,C,I)}catch{return T(b,m)}},lineMetrics(b,m){let F=d(b);if(!F)return Ue(b)??a.lineMetrics(b,m);if(!m||/^[\t\n\r\f ]*$/.test(m))return u(F,b);if(l){let C=u(F,b),B=Math.max(0,C.baseline),I=Math.max(0,C.height-C.baseline);return B+I>0?{height:B+I,baseline:B}:C}try{let C=j(r,i,F,b,m),B=0,I=0;for(let P of C.fontSpans){let N=u(P.font,b);B=Math.max(B,N.baseline),I=Math.max(I,N.height-N.baseline);}if(B+I>0)return {height:B+I,baseline:B}}catch{}return u(F,b)}},S)}function Qa(e,t){return Or({...t,shaper:e.shaper,environment:e.environment})}function ei(e){let{layout:t,viewport:n}=e,r=new Set;if(!n){for(let c of t.pages)r.add(c.index);return r}let o=Math.max(0,Math.trunc(e.overscanPages??1)),a=n.top+n.height,i=-1,s=-1;for(let c of t.pages){let l=c.box.y;l+c.box.height>=n.top&&l<=a&&(i===-1&&(i=c.index),s=c.index);}if(i===-1){let c=ti(t,n.top);c!==null&&(i=c,s=c);}if(i!==-1){let c=Math.max(0,i-o),l=Math.min(t.pages.length-1,s+o);for(let u=c;u<=l;u+=1)r.add(u);}for(let c of e.pinnedPages??[])c>=0&&c<t.pages.length&&r.add(c);return r}function ti(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 wr=["text-local","paragraph-local","flow-structural","global"];function Ar(e,t){return wr.indexOf(t)>wr.indexOf(e)?t:e}function ni(e){return {impact:"text-local",paragraphIds:new Set,created:new Set,deleted:new Set,dependencyKeys:new Set,structural:false,revision:e}}function ri(e){let{run:t,currentRevision:n,publish:r,schedule:o}=e,a=null,i=null,s=null,c=0,l=0;function u(d){let S=e.runCooperatively;if(!S)return t(d);let x=S(d);s=x;try{for(;;){let R=x.step();if(R)return R;if(n()!==d.revision)return x.cancel(),l+=1,null;if(s!==x)return null}}finally{s===x&&(s=null);}}function y(d){let S=p(n());S.impact=Ar(S.impact,d.impact),S.structural=S.structural||d.structural;for(let x of d.paragraphIds)S.paragraphIds.add(x);for(let x of d.created)S.created.add(x);for(let x of d.deleted)S.deleted.add(x);for(let x of d.dependencyKeys)S.dependencyKeys.add(x);}let f=d=>({impact:d.impact,paragraphIds:d.paragraphIds,created:d.created,deleted:d.deleted,dependencyKeys:d.dependencyKeys,structural:d.structural,revision:d.revision});function p(d){return a||(a=ni(d)),a.revision=Math.max(a.revision,d),a}function g(){!o||i||(i=o(()=>{i=null,h();}));}function h(){i&&(i(),i=null),s&&(s.cancel(),s=null,l+=1);let d=a;if(!d)return false;a=null;let S=f(d),x=u(S);return !x||x.revision!==n()?(c+=1,y(S),g(),false):(r(x,S),true)}return {notify(d){let S=p(n());S.impact=Ar(S.impact,d.impact);for(let x of d.dirty)S.paragraphIds.add(x);for(let x of d.created)S.created.add(x),S.paragraphIds.add(x);for(let x of d.deleted)S.deleted.add(x),S.paragraphIds.add(x);for(let x of d.dependencyKeys)S.dependencyKeys.add(x);for(let x of d.splitJoin)S.structural=true,"split"in x?(S.paragraphIds.add(x.split.from),S.paragraphIds.add(x.split.tail)):(S.paragraphIds.add(x.join.kept),S.paragraphIds.add(x.join.removed));(d.impact==="flow-structural"||d.impact==="global")&&(S.structural=true),g();},invalidateAll(d,S){let x=p(d);x.impact="flow-structural",x.structural=true,S&&x.dependencyKeys.add(S),g();},flush:h,pending:()=>a?f(a):null,cancel(){i?.(),i=null,s?.cancel(),s=null,a=null;},get staleDiscards(){return c},get cancelledRuns(){return l}}}var Ir=new WeakMap;function X(e){let t=Ir.get(e);if(t)return t;let n=new Map,r=new Map,o=new Map,a=new Map,i=(c,l,u,y)=>{for(let f of c){if(f.kind==="paragraph")continue;let p=f.tableId;a.set(p,Math.max(a.get(p)??0,(f.columnEdges?.length??1)-1));let g=o.get(p);g||(g=new Map,o.set(p,g),n.set(p,[]),r.set(p,new Map));for(let h of f.rows){let d=g.get(h.id);d===void 0&&(d=g.size,g.set(h.id,d),r.get(p).set(d,h.cells));for(let S of h.cells)n.get(p).push({pageIndex:l,tableId:p,row:h,cell:S,rowIndex:d,isHeaderRepeat:h.isHeaderRepeat,offsetX:u,offsetY:y}),i(S.blocks,l,u,y);}}};for(let c of e.pages){i(c.fragments,c.index,0,0);for(let l of [c.header,c.footer])l&&i(l.fragments,c.index,l.box.x-c.contentBox.x,l.box.y-c.contentBox.y);for(let l of [c.footnotes,c.endnotes])if(l)for(let u of l.notes)i(u.fragments,c.index,u.box.x-c.contentBox.x,u.box.y-c.contentBox.y);}let s=new Map;for(let[c,l]of n)s.set(c,{placed:l,rows:r.get(c)??new Map,columnCount:a.get(c)??0});return Ir.set(e,s),s}function _r(e){let t=e.columnCount;for(let n of e.rows.values())for(let r of n)t=Math.max(t,ne(r).to+1);return t}var ne=e=>({from:e.gridColumn,to:e.gridColumn+Math.max(1,e.gridSpan)-1});function oi(e,t,n){if(t.tableId!==n.tableId)return null;let r=X(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(ne(t).from,ne(n).from),s=Math.max(ne(t).to,ne(n).to),c=p=>{let{from:g,to:h}=ne(p);return h>=i&&g<=s},l=p=>(r.rows.get(p)??[]).some(g=>g.vMergeContinue&&c(g)),u=r.rows.size+_r(r)+2;for(let p=0;!(p>u);p+=1){let g=false;for(let[h,d]of r.rows)if(!(h<o||h>a))for(let S of d){if(!c(S))continue;let{from:x,to:R}=ne(S);x<i&&(i=x,g=true),R>s&&(s=R,g=true);}for(;o>0&&l(o);)o-=1,g=true;for(;l(a+1);)a+=1,g=true;if(!g)break}let y=[],f=new Set;for(let p of r.placed){if(p.isHeaderRepeat||p.rowIndex<o||p.rowIndex>a)continue;let{from:g,to:h}=ne(p.cell);h<i||g>s||f.has(p.cell.id)||(f.add(p.cell.id),y.push(p.cell.id));}return y.length===0?null:{kind:"cells",tableId:t.tableId,cellIds:y,rows:{from:o,to:a},columns:{from:i,to:s},text:kr(e,t.tableId,y)}}function ai(e,t){let n=X(e).get(t);if(!n)return null;let r=[],o=new Set,a=0;for(let i of n.placed)i.isHeaderRepeat||o.has(i.cell.id)||(o.add(i.cell.id),r.push(i.cell.id),a=Math.max(a,i.rowIndex));return r.length===0?null:{kind:"cells",tableId:t,cellIds:r,rows:{from:0,to:a},columns:{from:0,to:_r(n)-1},text:kr(e,t,r)}}function Lc(e,t){let n=ai(e,t.tableId);if(!n)return false;let r=new Set(t.cellIds);return n.cellIds.every(o=>r.has(o))}function Tc(e,t){return Pr(e,t,true)}function ge(e,t){return Pr(e,t,false)}function Pr(e,t,n){let r=new Set(t),o=[],a=new Set;for(let i of X(e).values())for(let s of i.placed)if(!(s.isHeaderRepeat||!r.has(s.cell.id)))for(let c of s.cell.blocks)n&&c.kind!=="paragraph"||Se(c,o,a);return o}function Se(e,t,n){if(e.kind==="paragraph"){for(let r of ab(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)Se(a,t,n);}function kr(e,t,n){let r=ge(e,n),o=r[0],a=r[r.length-1];return !o||!a?ii(e,t):{anchor:{paragraphId:o,offset:0},head:{paragraphId:a,offset:Te(e,a).length}}}function ii(e,t){let n=X(e).get(t);for(let o of n?.placed??[]){if(o.isHeaderRepeat)continue;let a=[];for(let s of o.cell.blocks)Se(s,a,new Set);let i=a[0];if(i){let s={paragraphId:i,offset:0};return {anchor:s,head:s}}}for(let o of e.pages)for(let a of Ja$1(o)){let i={paragraphId:a.paragraphId,offset:0};return {anchor:i,head:i}}let r={paragraphId:"",offset:0};return {anchor:r,head:r}}function si(e){let t=[...Ja$1(e)];for(let n of [e.header,e.footer])n&&t.push(...Ka$1(n.fragments));for(let n of [e.footnotes,e.endnotes])if(n)for(let r of n.notes)t.push(...Ka$1(r.fragments));return t}function ci(e,t){let n=new Set(ge(e,t)),r=[],o=new Set;for(let a of e.pages)for(let i of si(a))if(n.has(i.paragraphId))for(let s of i.lines)for(let c of s.spans){let l=`${c.range.paragraphId}:${c.range.start}:${c.range.end}`;o.has(l)||(o.add(l),r.push(c));}return r}function li(e,t){let n=new Set(t),r=[];for(let o of X(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 ui(e,t,n=Te){let r=X(e).get(t.tableId);if(!r)return "";let o=new Set(t.cellIds),a=r.placed.some(c=>c.cell.logicalGridColumn!==void 0),i=new Map,s=new Set;for(let c of r.placed){if(c.isHeaderRepeat||!o.has(c.cell.id)||s.has(c.cell.id))continue;s.add(c.cell.id);let l=ge(e,[c.cell.id]).map(f=>n(e,f)).join(`
2
- `),u=i.get(c.rowIndex),y=c.cell.gridColumn+(a?Math.max(1,c.cell.gridSpan)-1:0);u?u.set(y,l):i.set(c.rowIndex,new Map([[y,l]]));}return [...i.keys()].sort((c,l)=>c-l).map(c=>{let l=i.get(c),u=[];for(let y=0;y<=t.columns.to-t.columns.from;y+=1){let f=a?t.columns.to-y:t.columns.from+y;u.push(l.get(f)??"");}return u.join(" ")}).join(`
3
- `)}function Ot(e,t){return cd(e,t)}function Bc(e,t,n){if(n){let a=Ot(e,t);if(!a||a.tableId!==n.tableId)return null;let i=n.cellIds[0];if(!i)return null;let s=X(e).get(n.tableId);if(!s)return null;for(let c of s.placed)if(c.cell.id===i)return {tableId:n.tableId,rowId:c.row.id,cellId:i,cellIds:n.cellIds,gridColumnIndex:c.cell.logicalGridColumn??c.cell.gridColumn,isHeaderRepeat:c.isHeaderRepeat};return null}let r=Ot(e,t);if(!r)return null;let o=X(e).get(r.tableId);if(!o)return null;for(let a of o.placed){if(a.isHeaderRepeat)continue;let i=[];for(let s of a.cell.blocks)Se(s,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 Mr=new WeakMap;function di(e,t){let n=Mr.get(e);if(n)return n.get(t)??null;let r=new Map;for(let[o,a]of X(e))for(let i of a.placed){if(i.isHeaderRepeat)continue;let s=[];for(let l of i.cell.blocks)Se(l,s,new Set);let c={tableId:o,rowId:i.row.id,cellId:i.cell.id,rowIndex:i.rowIndex,gridColumn:i.cell.gridColumn,gridSpan:i.cell.gridSpan};for(let l of s){let u=r.get(l);u&&u.tableId.length>=o.length||r.set(l,c);}}return Mr.set(e,r),r.get(t)??null}function Oc(e,t,n){let r=di(e,t);if(!r)return null;let o=X(e).get(r.tableId);if(!o)return null;let a=new Set;for(let l of o.placed)!l.isHeaderRepeat&&!l.cell.vMergeContinue&&l.cell.blocks.length>0&&a.add(l.cell.id);let i=[...a],s=i.indexOf(r.cellId);if(s<0)return null;let c=n==="next"?1:-1;for(let l=s+c;l>=0&&l<i.length;l+=c){let u=ge(e,[i[l]]);if(u.length>0)return {cellId:i[l],paragraphIds:u}}return "end"}function pi(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)))}}export{La as $,Gn as A,Un as B,Kn as C,Wn as D,Vn as E,jn as F,qo as G,Zo as H,le as I,ea as J,Rt as K,$n as L,ia as M,la as N,j as O,Ge as P,Ct as Q,ds as R,tr as S,ps as T,Et as U,Ra as V,bs as W,ar as X,ir as Y,Ea as Z,va as _,ct as a,As as aa,ie as b,wa as ba,ut as c,Lt as ca,Gr as d,Ke as da,A as e,Or as ea,dt as f,Qa as fa,mt as g,ei as ga,Oi as h,ri as ha,On as i,oi as ia,wn as j,ai as ja,Z as k,Lc as ka,zo as l,Tc as la,Do as m,ge as ma,Gi as n,ci as na,ht as o,li as oa,Ui as p,ui as pa,Ho as q,Ot as qa,Uo as r,Bc as ra,Ki as s,di as sa,Ko as t,Oc as ta,gt as u,pi as ua,ze as v,Wo as w,Vo as x,jo as y,xt as z};
@@ -1 +0,0 @@
1
- import {b,a}from'./chunk-VLQDQNSS.js';import {ke,pa,Ea,ce,de,rh,be}from'./chunk-6MF5PN2E.js';var Fn=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,bn=128,Rn=/[\u0000-\u001F\u007F-\u009F]/,Nn=16,Tn=2,Pn=3276;function rn(n){return n.kind!=="textValue"}function N(n,e){for(let t of n.children)if(rn(t)&&t.localName===e)return t}function g(n,e){return n.attributes.find(t=>t.localName===e)?.value}function T(n){return n===void 0||n.length===0||n.length>bn||Rn.test(n)?null:n}function U(n,e){let t=ke(g(n,"asciiTheme"),e)??b(g(n,"ascii"))??ke(g(n,"hAnsiTheme"),e)??b(g(n,"hAnsi"));return a(t??void 0)}function V(n,e){let t=ke(g(n,"eastAsiaTheme"),e);if(t!==null)return t;let l=g(n,"eastAsia");return l===void 0?null:a(b(l)??void 0)}function J(n,e){let t=ke(g(n,"hAnsiTheme"),e);if(t!==null)return t;let l=g(n,"hAnsi");return l===void 0?null:a(b(l)??void 0)}function Mn(n){return n!==void 0&&Fn.test(n)?n:null}function ae(n){return Mn(n)}function Cn(n){return n!==void 0&&["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(e=>!!g(n,e))}function on(n,e){if(!n)return {fontFamily:null,fontSizeHalfPoints:null,hasLatinFontReference:false};let t=N(n,"rFonts"),l=N(n,"sz"),a=l?g(l,"val"):void 0,i=a!==void 0&&/^\d{1,4}$/.test(a)?Number(a):null;return {fontFamily:t?U(t,e):null,hasLatinFontReference:Cn(t),fontSizeHalfPoints:i!==null&&i>=Tn&&i<=Pn?i:null}}function ie(n,e){let t=new Map,l={fontFamily:null,fontSizeHalfPoints:null,hasLatinFontReference:false};if(n){let o=N(n,"docDefaults"),r=o?N(o,"rPrDefault"):void 0;l=on(r?N(r,"rPr"):void 0,e);for(let s of n.children){if(!rn(s)||s.localName!=="style")continue;let f=T(g(s,"styleId"));if(f===null||t.has(f))continue;let u=N(s,"basedOn");t.set(f,{basedOn:T(u?g(u,"val"):void 0),own:on(N(s,"rPr"),e)});}}let a=new Map,i=o=>{let r=o??"",s=a.get(r);if(s)return s;let f=null,u=null,d=l.hasLatinFontReference,y=new Set,A=o;for(let k=0;A!==null&&k<Nn&&!y.has(A);k+=1){y.add(A);let D=t.get(A);if(!D)break;f??=D.own.fontFamily,d||=D.own.hasLatinFontReference,u??=D.own.fontSizeHalfPoints,A=D.basedOn;}let H={hasLatinFontReference:d,fontFamily:f??l.fontFamily,fontSizeHalfPoints:u??l.fontSizeHalfPoints};return a.set(r,H),H};return (o,r)=>{let s=i(o),f=r?.find(y=>y.localName==="rFonts"),u=f?ke(f.attributes?.asciiTheme,e)??(f.attributes?.ascii===void 0?ke(f.attributes?.hAnsiTheme,e):null):null,d=["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(y=>!!f?.attributes?.[y]);return {fontFamily:u??s.fontFamily??(!s.hasLatinFontReference&&!d?e.minor:null),fontSizeHalfPoints:s.fontSizeHalfPoints}}}function sn(n){for(let e of n.children)if(e.kind!=="textValue"&&e.localName==="rPr"&&e.namespaceUri===pa)return Ea(e,"vanish");return false}var Hn=16,Ln=16,In=32,jn=4096;function E(n){return n.kind!=="textValue"}function c(n,e){for(let t of n.children)if(E(t)&&t.localName===e)return t}function x(n,e){return n.attributes.find(t=>t.localName===e)?.value}function _n(n){return n==="1"||n==="true"||n==="on"}function Y(){return {profiles:new Map}}function cn(n){return JSON.stringify([n.latin,n.eastAsia,n.hasEastAsian,n.hAnsi,n.hasHAnsi,n.hint,n.runStyle,n.paragraphStyle===void 0?0:n.paragraphStyle,n.tableStyle===void 0?0:n.tableStyle])}function yn(n,e){let t=cn(e);n.profiles.has(t)||n.profiles.set(t,e);}function $(n,e){for(let[t,l]of e.profiles)n.profiles.has(t)||n.profiles.set(t,l);}function Bn(n,e){let t=e.localName==="tbl",l=c(e,t?"tblPr":"pPr"),a=l?c(l,t?"tblStyle":"pStyle"):void 0,i=T(a?x(a,"val"):void 0),o=new Map;for(let r of n.profiles.values()){let s=t&&r.tableStyle===void 0?{...r,tableStyle:i}:!t&&r.paragraphStyle===void 0?{...r,paragraphStyle:i}:r;o.set(cn(s),s);}n.profiles=o;}function h(n,e){if(e===null)return;let t=e.toLowerCase();n.has(t)||n.set(t,e);}var vn=new Set(["tab","noBreakHyphen","softHyphen","footnoteRef","endnoteRef","footnoteReference","endnoteReference"]),kn=128;function zn(n){for(let e of n.attributes)if(e.localName==="font"&&!(e.namespaceUri!==pa&&e.namespaceUri!==""))return e.value.length>0&&e.value.length<=kn;return false}function wn(n,e){if(sn(n))return false;if(e?.has(n.id))return true;for(let t of n.children)if(!(!E(t)||t.namespaceUri!==pa)){if(vn.has(t.localName))return true;if(t.localName==="sym"){if(!zn(t))return true;continue}if(!(t.localName!=="t"&&t.localName!=="delText")){for(let l of t.children)if(!E(l)&&l.value.length>0)return true}}return false}function Un(n){return n>=160&&n<=65535&&!(n>=1424&&n<=1983)&&!(n>=64285&&n<=65023)&&!(n>=65136&&n<=65278)&&!be(n)}function Yn(n){let e=false,t=false;for(let l of n.children)if(!(!E(l)||l.namespaceUri!==pa)&&!(l.localName!=="t"&&l.localName!=="delText")){for(let a of l.children)if(!E(a))for(let i of a.value){let o=i.codePointAt(0);if(!(o<128)&&(e||=be(o),t||=Un(o),e&&t))return {eastAsian:e,hAnsi:t}}}return {eastAsian:e,hAnsi:t}}function Xn(n,e,t,l){if(!wn(n,l))return;let a=c(n,"rPr"),i=a?c(a,"rFonts"):void 0,o=Yn(n),r=o.eastAsian,s=a?c(a,"rStyle"):void 0;yn(e,{latin:i?U(i,t):null,eastAsia:i&&(r||o.hAnsi)?V(i,t):null,hasEastAsian:r,hint:(i&&x(i,"hint"))??null,hAnsi:i&&o.hAnsi?J(i,t):null,hasHAnsi:o.hAnsi,runStyle:T(s?x(s,"val"):void 0)});}function hn(n){return (n.localName==="p"||n.localName==="tbl")&&n.namespaceUri===pa}var Wn={latin:null,eastAsia:null,hasEastAsian:false,hAnsi:null,hasHAnsi:false,hint:null,runStyle:null};function gn(n,e,t,l){n.namespaceUri===pa&&(l?.has(n.id)&&n.localName==="fldSimple"&&yn(e,Wn),n.localName==="r"?Xn(n,e,t,l):hn(n)&&Bn(e,n));}function An(n,e,t){let l=[{node:n,summary:Y(),next:0}];for(;;){let a=l[l.length-1],i=a.node.children;if(a.next<i.length){let r=i[a.next];a.next+=1,E(r)&&l.push({node:r,summary:Y(),next:0});continue}gn(a.node,a.summary,e,t),l.pop();let o=l[l.length-1];if(!o)return a.summary;$(o.summary,a.summary);}}var un=new WeakMap;function Sn(n,e,t){let l=un.get(n);if(l&&l.major===e.major&&l.minor===e.minor&&l.majorEastAsia===e.majorEastAsia&&l.minorEastAsia===e.minorEastAsia&&l.majorBidi===e.majorBidi&&l.minorBidi===e.minorBidi)return l.summary;let a;return n.children.length>=Ln&&t<In?a=Zn(n,e,t):a=An(n,e),un.set(n,{major:e.major,minor:e.minor,majorEastAsia:e.majorEastAsia,minorEastAsia:e.minorEastAsia,majorBidi:e.majorBidi,minorBidi:e.minorBidi,summary:a}),a}var C=new Map,Vn=64;function Jn(n,e){return n.major===e.major&&n.minor===e.minor&&n.majorEastAsia===e.majorEastAsia&&n.minorEastAsia===e.minorEastAsia&&n.majorBidi===e.majorBidi&&n.minorBidi===e.minorBidi}function Kn(n,e){if(n===e)return true;if(!n||!e||n.profiles.size!==e.profiles.size)return false;for(let t of n.profiles.keys())if(!e.profiles.has(t))return false;return true}function Zn(n,e,t){let l=n.children,a=n.namespaceUri!==pa||n.localName!=="r"&&!hn(n),i=a?C.get(n.id):void 0,o=i?.children.deref(),r=i!==void 0&&o!==void 0&&o.length===l.length&&Jn(i.themeFonts,e),s=r,f=l.map((d,y)=>{if(r&&d===o[y])return i.parts[y];let A=E(d)?Sn(d,e,t+1):null;return s&&!Kn(A,i.parts[y])&&(s=false),A}),u;if(s)u=i.summary;else {u=Y();for(let d of f)d&&$(u,d);gn(n,u,e);}return a&&(C.delete(n.id),C.set(n.id,{children:rh(l),parts:f,summary:u,themeFonts:e}),C.size>Vn&&C.delete(C.keys().next().value)),u}var v={latin:null,eastAsia:null,hAnsi:null,hint:null,conditional:[],conditionalEastAsia:[]},$n={docDefaultLatin:null,docDefaultEastAsia:null,docDefaultHAnsi:null,docDefaultHint:null,docDefaultsNameLatin:false,hAnsiSlotDefault:null,fallbackEastAsia:null,defaultParagraph:null,defaultCharacter:null,defaultTable:null,chain:()=>v,characterChain:()=>v},fn=new WeakMap;function K(n,e){let t=c(n,"rPr"),l=t?c(t,"rFonts"):void 0;return l?U(l,e):null}function Z(n,e){let t=c(n,"rPr"),l=t?c(t,"rFonts"):void 0;return l?V(l,e):null}function dn(n){let e=c(n,"rPr"),t=e?c(e,"rFonts"):void 0;return (t&&x(t,"hint"))??null}function mn(n,e){let t=c(n,"rPr"),l=t?c(t,"rFonts"):void 0;return l?J(l,e):null}function qn(n,e){let t=new Map,l=null,a=null,i=null,o=null,r=null,s=null,f=c(n,"docDefaults"),u=f?c(f,"rPrDefault"):void 0;u&&(l=K(u,e),a=Z(u,e),i=mn(u,e));let d=u?c(u,"rPr"):void 0,y=d?c(d,"rFonts"):void 0,A=y&&["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(m=>!!x(y,m)),H=u?ce:e.minor;A||(l??=H);let k=u?de:e.minorEastAsia,D=0;for(let m of n.children){if(!E(m)||m.localName!=="style")continue;if(D>=jn)break;D+=1;let S=T(x(m,"styleId"));if(S===null)continue;let z=c(m,"basedOn"),L=[],I=[];for(let F of m.children){if(!E(F)||F.localName!=="tblStylePr")continue;let j=K(F,e);j!==null&&L.push(j);let _=Z(F,e);_!==null&&I.push(_);}t.set(S,{basedOn:T(z?x(z,"val"):void 0),family:K(m,e),eastAsiaFamily:Z(m,e),hAnsiFamily:mn(m,e),hint:dn(m),conditionalFamilies:L,conditionalEastAsiaFamilies:I});let P=_n(x(m,"default")),M=x(m,"type");M==="paragraph"?P?o=S:o===S&&(o=null):M==="character"?P?r=S:r===S&&(r=null):M==="table"&&(P?s=S:s===S&&(s=null));}let pn=new Map,On=new Map,q=(m,S,z)=>{if(m===null)return v;let L=S.get(m);if(L)return L;let I=null,P=null,M=null,F=null,j=[],_=[],G=new Set,b=m;for(let nn=0;b!==null&&nn<Hn&&!G.has(b);nn+=1){G.add(b);let p=t.get(b);if(!p)break;if(b===z){b=p.basedOn;continue}I??=p.family,P??=p.eastAsiaFamily,M??=p.hAnsiFamily,F??=p.hint;for(let X of p.conditionalFamilies)j.push(X);for(let X of p.conditionalEastAsiaFamilies)_.push(X);b=p.basedOn;}let Q={latin:I,eastAsia:P,hAnsi:M,hint:F,conditional:j,conditionalEastAsia:_};return S.set(m,Q),Q},xn=m=>q(m,pn,null),Dn=m=>q(m,On,r);return {docDefaultLatin:l,docDefaultEastAsia:a,docDefaultHAnsi:i,docDefaultHint:u?dn(u):null,docDefaultsNameLatin:!!A,hAnsiSlotDefault:H,fallbackEastAsia:k,defaultParagraph:o,defaultCharacter:r,defaultTable:s,chain:xn,characterChain:Dn}}function Gn(n,e){if(!n)return {...$n,docDefaultLatin:e.minor,hAnsiSlotDefault:e.minor,fallbackEastAsia:e.minorEastAsia};let t=fn.get(n);if(t&&t.major===e.major&&t.minor===e.minor&&t.majorEastAsia===e.majorEastAsia&&t.minorEastAsia===e.minorEastAsia&&t.majorBidi===e.majorBidi&&t.minorBidi===e.minorBidi)return t.index;let l=qn(n,e);return fn.set(n,{major:e.major,minor:e.minor,majorEastAsia:e.majorEastAsia,minorEastAsia:e.minorEastAsia,majorBidi:e.majorBidi,minorBidi:e.minorBidi,index:l}),l}function Qn(n,e,t){let l=[e.characterChain(n.runStyle??null),e.chain(n.paragraphStyle??e.defaultParagraph),n.tableStyle===false||n.tableStyle===void 0?v:e.chain(n.tableStyle??e.defaultTable)];for(let a of l){h(t,a.eastAsia),h(t,a.latin),n.hasHAnsi&&h(t,a.hAnsi);for(let i of a.conditional)h(t,i);for(let i of a.conditionalEastAsia)h(t,i);}h(t,e.docDefaultLatin),h(t,e.docDefaultEastAsia),n.hasHAnsi&&h(t,e.docDefaultHAnsi);}function ne(n,e,t){return n.latin!==null||e.some(l=>l.latin!==null)||t.docDefaultsNameLatin}function ee(n,e,t,l){let a=e.characterChain(n.runStyle??null),i=e.chain(n.paragraphStyle??e.defaultParagraph),o=n.tableStyle===false||n.tableStyle===void 0?v:e.chain(n.tableStyle??e.defaultTable);n.latin!==null?h(t,n.latin):h(l,a.latin??i.latin??o.latin??e.docDefaultLatin);for(let s of o.conditional)h(l,s);n.hasHAnsi&&(n.hAnsi!==null?h(t,n.hAnsi):h(l,a.hAnsi??i.hAnsi??o.hAnsi??e.docDefaultHAnsi??(ne(n,[a,i,o],e)?e.hAnsiSlotDefault:null)));let r=n.hint??a.hint??i.hint??o.hint??e.docDefaultHint;if(!(!n.hasEastAsian&&!(n.hasHAnsi&&r==="eastAsia"))){n.eastAsia!==null?h(t,n.eastAsia):h(l,a.eastAsia??i.eastAsia??o.eastAsia??e.docDefaultEastAsia??e.fallbackEastAsia);for(let s of o.conditionalEastAsia)h(l,s);}}function he(n,e,t,l){return En(n,e,t,true,l)}function En(n,e,t,l,a){let i=Gn(e,t),o=new Map,r=new Map;for(let f of n){let u=Y();for(let d of f.children)E(d)&&$(u,a&&a.size>0?An(d,t,a):Sn(d,t,0));for(let d of u.profiles.values()){let y=d.tableStyle===void 0?{...d,tableStyle:false}:d;ee(y,i,o,r),l&&Qn(y,i,r);}}for(let f of o.keys())r.delete(f);let s=[...r.values()].sort((f,u)=>f<u?-1:f>u?1:0);return Object.freeze({direct:Object.freeze([...o.values()]),inherited:Object.freeze(s)})}function ge(n,e,t){let l=En(n,e,t,false),a=[...l.direct,...l.inherited];return a.sort((i,o)=>i<o?-1:i>o?1:0),a}export{sn as a,Mn as b,ae as c,ie as d,he as e,ge as f};