@docx-editor.dev/core 2.30.0 → 2.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +18 -27
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +17 -16
- package/dist/binding.js +1 -1
- package/dist/bookmark-names-DDuAra_V.d.ts +37 -0
- package/dist/{chrome-print-BM3Js-6X.d.ts → chrome-print-CznJ0ucN.d.ts} +361 -41
- package/dist/chunk-25EXMBV2.cjs +5 -0
- package/dist/chunk-2CWQY27B.cjs +1 -0
- package/dist/chunk-3IEXDEFH.cjs +7 -0
- package/dist/chunk-65XBN67F.cjs +2 -0
- package/dist/chunk-6NVZNB7O.cjs +3 -0
- package/dist/chunk-6UDJUI3W.cjs +2 -0
- package/dist/chunk-ACLR4DMK.js +1 -0
- package/dist/{chunk-RJCQGJR7.js → chunk-B2BEELUE.js} +1 -1
- package/dist/chunk-DDFHKQFU.js +30 -0
- package/dist/chunk-E4IAO4CY.cjs +2 -0
- package/dist/chunk-ETDZFNMI.js +2 -0
- package/dist/chunk-FDSL5OJU.cjs +30 -0
- package/dist/chunk-FS7CMYLT.js +4 -0
- package/dist/chunk-GDS24SZN.js +30 -0
- package/dist/chunk-GIY6NT2X.js +5 -0
- package/dist/chunk-GWM3AKUD.js +18 -0
- package/dist/chunk-HDOXACHP.js +2 -0
- package/dist/chunk-IILEENID.js +1 -0
- package/dist/chunk-L5TYBFDB.js +1 -0
- package/dist/chunk-MNF2K7NN.cjs +30 -0
- package/dist/chunk-O324RB6R.cjs +1 -0
- package/dist/chunk-OKMEMSKB.cjs +1 -0
- package/dist/chunk-QXJKYNYZ.js +1 -0
- package/dist/chunk-RALTVLB6.js +2 -0
- package/dist/chunk-SRVKFUFI.js +3 -0
- package/dist/chunk-TELQ52LG.cjs +1 -0
- package/dist/chunk-TJHE5EET.cjs +1 -0
- package/dist/chunk-UMMRURPE.js +7 -0
- package/dist/chunk-WN7ICTA5.js +1 -0
- package/dist/{chunk-FLBEJC6X.cjs → chunk-XJYZVGQR.cjs} +1 -1
- package/dist/chunk-ZGTIE3QJ.cjs +4 -0
- package/dist/chunk-ZOZI27AW.cjs +18 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +20 -5
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.cjs +1 -1
- package/dist/collaboration.d.ts +5 -6
- package/dist/collaboration.js +1 -1
- package/dist/contracts/document.d.ts +3 -3
- package/dist/contracts/editor.d.ts +13 -10
- package/dist/contracts/interaction.d.ts +2 -2
- package/dist/contracts/modules.d.ts +15 -13
- package/dist/contracts/types.d.ts +135 -2
- package/dist/{custom-node-writes-0v0Kgw1T.d.ts → custom-node-writes-CLJKGD9t.d.ts} +7 -2
- package/dist/{diagnostic-context-CcAO4q1s.d.ts → diagnostic-context-BtDUY3v2.d.ts} +3 -2
- package/dist/{diagnostic-hints-2Bke6H_w.d.ts → diagnostic-hints-DK8-V0fk.d.ts} +2 -2
- package/dist/{document-protection-8eyMWIJ0.d.ts → document-protection-NaniLHWF.d.ts} +1 -1
- package/dist/{editor-DaEJd2so.d.ts → editor-DZwOTmlR.d.ts} +386 -279
- package/dist/editor-fonts-D_-vjuJi.d.ts +53 -0
- package/dist/{editor-scope-7o9xweiJ.d.ts → editor-scope-B3L-1ALc.d.ts} +57 -4
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +6 -4
- package/dist/editor.d.ts +646 -31
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +9 -16
- package/dist/export.js +2 -2
- package/dist/{failure-NS2lsya4.d.ts → failure-6KGFrDO9.d.ts} +1 -1
- package/dist/{font-resolver-CL9BVKZo.d.ts → font-resolver-BlQNGdvR.d.ts} +1 -1
- package/dist/{headless-document-view-DZQN8Bnx.d.ts → headless-document-view-Bcz9_Qva.d.ts} +115 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +27 -26
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-cEnVrhWg.d.ts → layout-shaping-E5J4Z1Gf.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +95 -23
- package/dist/layout.js +1 -1
- package/dist/{note-properties-9FH8zAeG.d.ts → note-properties-Ds5R2_3F.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +24 -10
- package/dist/output.js +1 -1
- package/dist/{protocol-CZ1uUlPO.d.ts → protocol-DKa4qt7F.d.ts} +167 -5
- package/dist/{review-paragraph-order-CqVelc5A.d.ts → review-paragraph-order-Dc17w_6v.d.ts} +1 -1
- package/dist/revision-projection-Cn6rZJ7H.d.ts +258 -0
- package/dist/{semantic-cell-selection-Dr9yxFZt.d.ts → semantic-cell-selection-BaUR0iJ4.d.ts} +2 -2
- package/dist/{semantic-interaction-Dc3pf3hr.d.ts → semantic-interaction-CJoHLoOl.d.ts} +1 -1
- package/dist/{semantic-paint-Bz3FBAoH.d.ts → semantic-paint-BPw_n0li.d.ts} +7 -4
- package/dist/{semantic-record-queries-Bx0pl6kL.d.ts → semantic-record-queries-C0rJ3sB4.d.ts} +1 -1
- package/dist/{semantic-records-CjcF26ZL.d.ts → semantic-records-BvN-WWst.d.ts} +365 -512
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +47 -22
- package/dist/store.js +1 -1
- package/dist/{types-barrel-CA0xB8kH.d.ts → tree-op-types-C_S2niXW.d.ts} +1239 -747
- package/dist/{tree-package-store-DKhdEVym.d.ts → tree-package-store-CRHvMyNj.d.ts} +676 -646
- package/dist/{tree-session-contract-CwnTEVLF.d.ts → tree-session-contract-D1awo_dA.d.ts} +26 -13
- package/dist/unsupported-elements-CVos5cqe.d.ts +23 -0
- package/docs/accept-reject-without-scrolling.md +95 -0
- package/docs/comment-on-found-text.md +72 -0
- package/docs/custom-review-cards.md +178 -0
- package/docs/highlight-ranges.md +48 -0
- package/docs/index.md +36 -0
- package/docs/propose-rewrite.md +247 -0
- package/docs/tracked-replacement.md +68 -0
- package/package.json +3 -2
- package/dist/chunk-2PV5L5NJ.js +0 -5
- package/dist/chunk-5OTS2EJ7.js +0 -7
- package/dist/chunk-5P4223J4.cjs +0 -27
- package/dist/chunk-5RRAZMBU.cjs +0 -1
- package/dist/chunk-5SPITS5F.js +0 -18
- package/dist/chunk-6JIJOZDW.js +0 -1
- package/dist/chunk-7ATNKARV.js +0 -2
- package/dist/chunk-BGCUTKWE.cjs +0 -5
- package/dist/chunk-BTQKU64Q.cjs +0 -1
- package/dist/chunk-EBCXSH2W.js +0 -3
- package/dist/chunk-ERECKTIR.cjs +0 -2
- package/dist/chunk-HYASLE2G.cjs +0 -1
- package/dist/chunk-JC47NRJC.cjs +0 -3
- package/dist/chunk-KJRTNY2Q.cjs +0 -2
- package/dist/chunk-NKPUH3QJ.js +0 -1
- package/dist/chunk-PF5NJWS3.js +0 -2
- package/dist/chunk-PWTRJSES.cjs +0 -18
- package/dist/chunk-QFKGI242.cjs +0 -30
- package/dist/chunk-RPPV4S6T.cjs +0 -4
- package/dist/chunk-T32MGBJS.js +0 -1
- package/dist/chunk-UM26GH5B.js +0 -30
- package/dist/chunk-VRCZBFLH.js +0 -27
- package/dist/chunk-WF7JZ755.cjs +0 -1
- package/dist/chunk-WK5X2MMA.cjs +0 -7
- package/dist/chunk-WPDD2Y32.js +0 -2
- package/dist/chunk-YBMWBXST.cjs +0 -2
- package/dist/chunk-YZGUBCHP.js +0 -1
- package/dist/chunk-ZOS2PM4A.js +0 -4
- package/dist/image-resources-Bipz8toD.d.ts +0 -211
- package/dist/omml-equation-DP2WpUbK.d.ts +0 -97
package/dist/chunk-ZOS2PM4A.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import {O,na,N}from'./chunk-EBCXSH2W.js';import {Ba,wa,Fa,Wa,hb,Oe as Oe$1,$ as $$1,td,Aa,ff,ub,La,Dd,Da,fa,dd,ea,kf,ua,fd,Fb,eb,fb,Xa,Db,Eb,Ie as Ie$1,Ke as Ke$1}from'./chunk-UM26GH5B.js';import {mb}from'./chunk-5SPITS5F.js';function te(t,e,n,o,i,r){let a=Xa(e,n);if(a.background==="byAuthor"&&!r?(t.style.setProperty("--doc-revision-background",`color-mix(in srgb, ${o} 15%, var(--doc-revision-color-white))`),t.style.backgroundColor="var(--doc-revision-background)"):a.background!=="none"&&(t.style.backgroundColor=a.background==="byAuthor"?r:Wa(a.background,o)),a.mark==="none")return;let s=Wa(a.color,i??o);a.color!=="auto"&&(t.style.color=s),a.mark==="bold"&&(t.style.fontWeight="bold"),a.mark==="italic"&&(t.style.fontStyle="italic");let l=a.mark==="underline"||a.mark==="doubleUnderline"?"underline":a.mark==="strikethrough"||a.mark==="doubleStrikethrough"?"line-through":void 0;l&&(t.style.textDecorationLine=l,t.style.textDecorationStyle=a.mark.startsWith("double")?"double":"solid",t.style.textDecorationColor=s,l==="underline"&&(t.style.textDecorationThickness="var(--doc-revision-insertion-decoration-thickness)",t.style.textUnderlineOffset="var(--doc-revision-insertion-underline-offset)"));}var kt=new WeakMap;function no(t){let e=null;for(let n of t)if(!(n.localName!=="rPrChange"&&n.localName!=="pPrChange")){e=n.attributes?.author??"";break}return e}function ne(t){let e=ff(t),n=kt.get(e);if(n)return n;let o=[],i=new Set,r=true,a=p=>{p===""||i.has(p)||(i.add(p),o.push(p));},s=p=>{for(let y of p.props)y.localName==="pPrChange"&&a(y.attributes?.author??"");for(let y of p.lines){if(y.changeSites)for(let f of y.changeSites)a(f.author);for(let f of y.spans){let g=f.revisions;if(g!==void 0)for(let k=0;k<g.length;k+=1)a(g[k].author);let v=no(f.props);v!==null&&a(v);}}for(let y of p.lines){let f=y.drawings;if(f!==void 0)for(let g=0;g<f.length;g+=1){let v=f[g].revisions;if(v!==void 0)for(let x=0;x<v.length;x+=1)a(v[x].author);let k=f[g].accessibility.hidden?void 0:f[g].textboxStory;if(k)for(let x of ne(k.fragments).authors)a(x);}}let h=p.markRevisions;if(h)for(let y=0;y<h.length;y+=1)a(h[y].author);},l=p=>{p.marker?.picture&&(r=false);for(let h of p.lines)(h.drawings?.length??0)>0&&(r=false);},d=[],c=(p,h)=>{for(let y of p){if(y.kind==="paragraph"){h&&s(y),r&&l(y);continue}for(let f of y.rows){let g=h&&!f.isHeaderRepeat;for(let v of f.cells)v.revisionShadingAuthor&&d.push(v.revisionShadingAuthor),c(v.blocks,g);}}};c(t,true);for(let p of d)a(p);let u={authors:o,drawingFree:r};return kt.set(e,u),u}var A=8,St={color:"painted",background:"painted",activeBackground:"painted",spanClassName:"painted",avatarUrl:"card-only"},wt=Object.keys(St),oo=wt.filter(t=>St[t]==="painted"),ro=new Set(["http","https","data","blob"]),io=/^([a-zA-Z][a-zA-Z0-9+.-]*):/;function ao(t){let e=t.replace(/[\u0000-\u0020\u007f]/g,"");if(e.length===0)return;let n=io.exec(e);if(n)return !ro.has(n[1].toLowerCase())||/^data:/i.test(e)&&!/^data:image\/(?!svg)/i.test(e)?void 0:e;let o=i=>e[i]==="/"||e[i]==="\\";return o(0)&&o(1)?void 0:e}function so(t){if(typeof t=="string")return t.length>0?{color:t}:null;if(t===null||typeof t!="object")return null;let e={},n=Object.prototype.hasOwnProperty;for(let o of wt){if(!n.call(t,o))continue;let i=t[o];if(!(typeof i!="string"||i.length===0)){if(o==="avatarUrl"){let r=ao(i);r!==void 0&&(e.avatarUrl=r);continue}e[o]=i;}}return Object.keys(e).length>0?e:null}function B(t){return `var(--doc-review-author-${t%A})`}function Mt(t){let e=new Map;if(t===void 0||t==="kind"||t==="author")return e;for(let[n,o]of Object.entries(t.authors)){let i=so(o);i&&e.set(n,i);}return e}function oi(t,e){let n=Mt(e);return [...t].map(([o,i])=>{let r=n.get(o);return {author:o,slot:i,color:r?.color??B(i),...r?{style:r}:{}}})}var lo=128;function ye(t,e,n=lo){let o=e.length<n?e.length:n,i=t;for(let r=0;r<o;r+=1)i=Math.imul(i^e.charCodeAt(r),16777619);return Math.imul(i^e.length,16777619)}function co(t,e,n){let o=ye(2166136261,n);for(let i of t.keys())o=ye(o,i);for(let[i,r]of e){o=ye(o,i);for(let a of oo)o=ye(o,r[a]??"",1/0);}return `${t.size}.${e.size}.${(o>>>0).toString(36)}`}function Le(t){return t===null?"kind":t.key}var Ee=new WeakMap;function Pe(t,e,n){if(t==="kind")return null;let o=Ee.get(e);if(o&&o.option===t&&o.authorSlots===n)return o.context;let i=Mt(t),r=t===void 0||t==="author"?"author":t.others??"author";if(i.size===0&&r==="kind")return Ee.set(e,{option:t,authorSlots:n,context:null}),null;let a=n??yo(e),s=new Map;for(let[d,c]of i){if(!c.spanClassName)continue;let u=c.spanClassName.split(/\s+/).filter(p=>p.length>0);u.length>0&&s.set(d,u);}let l={authorSlots:a,styles:i,classTokens:s,others:r,key:co(a,i,r)};return Ee.set(e,{option:t,authorSlots:n,context:l}),l}function uo(t){return ne(t).authors}var Rt=new WeakMap;function yo(t){let e=Rt.get(t);if(e)return e;let n=new Map,o=i=>{for(let r of uo(i))n.has(r)||n.set(r,n.size);};for(let i of t.pages){o(i.fragments),i.header&&o(i.header.fragments),i.footer&&o(i.footer.fragments);for(let r of [i.footnotes,i.endnotes])if(r){r.separator&&o(r.separator.fragments),r.continuationNotice&&o(r.continuationNotice.fragments);for(let a of r.notes)o(a.fragments);}for(let r of [i.anchoredDrawings,i.header?.anchoredDrawings,i.footer?.anchoredDrawings])if(r)for(let a of r){if(a.accessibility.hidden)continue;let s=a.revisions;if(s!==void 0)for(let l=0;l<s.length;l+=1){let d=s[l].author;d!==""&&!n.has(d)&&n.set(d,n.size);}a.textboxStory&&o(a.textboxStory.fragments);}}return Rt.set(t,n),n}function po(t,e){let n=null;for(let o of e)o===""||t.has(o)||(n===null&&(n=new Map(t)),n.has(o)||n.set(o,n.size));return n??t}function ri(){let t=new Map,e=0;return {resolve(n,o){let i=po(n,o);for(let r of i.keys())t.has(r)||(t.set(r,e),e+=1);return new Map([...i.keys()].map(r=>[r,t.get(r)]).sort((r,a)=>r[1]-a[1]))}}}function j(t,e,n){if(t===void 0||t.length===0)return null;let o=t[t.length-1],i=t.some(s=>s.kind==="delete"||s.kind==="moveFrom"),r=o.kind,a=r==="delete"||r==="moveFrom"?"line-through":r==="insert"||r==="moveTo"?"underline":null;return {attribution:o,line:i&&a==="underline"?"line-through":a,decorationStyle:r==="moveFrom"||r==="moveTo"?"double":"solid",color:i?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",authorColor:n?.get(o.author)?.color??B(e?.get(o.author)??0),deleted:i}}function oe(t,e=false){let n=t.spans.find(r=>r.style.shaping)?.style.shaping?.baseLevel,o=n===void 0?e:n===1,i=Eb(t.spans,t.drawings??[]);return i?{x:o?i.left:i.right,rtl:o}:{x:t.contentX,rtl:o}}function Te(t,e,n,o,i,r,a){let s=a??oe(n,o),l=e.ownerDocument.createElement("span");l.className="docx-terminator-seat",l.dataset.docxMarker="",l.setAttribute("aria-hidden","true"),l.setAttribute("contenteditable","false"),l.style.position="absolute",l.style.left=`${(s.x-n.contentX)*r}px`,l.style.bottom=`${Math.max(0,n.box.height-n.baseline)*r}px`,l.style.width="0",l.style.fontSize="0",l.style.lineHeight="0",l.style.whiteSpace="pre",l.style.pointerEvents="none",l.style.userSelect="none",s.rtl&&(l.style.direction="rtl"),t.style.display="inline-block",t.style.verticalAlign="baseline",t.style.fontSize=`${i*r}px`,l.append(t),e.append(l);}function Ae(t,e,n){let o=j(e,n?.authorSlots,n?.styles);if(!o)return;let{attribution:i}=o,r=n?.styles.get(i.author),a=n&&(r?.color!==void 0||n.others==="author");if(t.style.color=a?o.authorColor:o.color,t.dataset.revisionKind=i.kind,t.dataset.revisionId=i.id,t.dataset.reviewAuthor=i.author,n){t.dataset.reviewAuthorSlot=String((n.authorSlots.get(i.author)??0)%A);for(let s of n.classTokens.get(i.author)??[])t.classList.add(s);}o.line&&(t.style.textDecorationLine=o.line,t.style.textDecorationStyle=o.decorationStyle,t.style.textDecorationColor=t.style.color);}function Et(t,e,n,o,i,r=false){let a=t.createElement("span"),s=e.spans[e.spans.length-1];a.className="docx-line-break-mark",a.dataset.docxMarker="",a.setAttribute("aria-hidden","true"),a.contentEditable="false",a.textContent="\u21B5",a.style.pointerEvents="none",a.style.userSelect="none",a.style.color="var(--doc-revision-format)",Ae(a,s?.revisions,i);let l=s?.style.fontSizePt??$$1.fontSizePt;Te(a,n,e,r,l,o);}function Lt(t,e,n,o,i=false){let r=eb(e);if(!r){let c=t.createElement("span");return c.className="docx-paragraph-mark",c.setAttribute("aria-hidden","true"),c.contentEditable="false",c.textContent="\xB6",c.style.pointerEvents="none",c.style.color="var(--doc-revision-format)",c}let a=t.createElement("span");a.className=`docx-paragraph-mark docx-revision-pmark docx-revision-pmark-${r.kind}`,a.setAttribute("aria-hidden","true"),a.contentEditable="false",a.dataset.revisionKind=r.kind,a.dataset.revisionId=r.id,r.author!==""&&(a.dataset.reviewAuthor=r.author),a.dataset.revisionIds=e.map(c=>c.id).join(" "),a.dataset.revisionKinds=e.map(c=>c.kind).join(" "),a.textContent="\xB6",a.style.pointerEvents="none";let s=fb(r),l=n?.styles.get(r.author),d=n?(n.authorSlots.get(r.author)??0)%A:0;if(n){a.dataset.reviewAuthorSlot=String(d);let c=n.classTokens.get(r.author);if(c)for(let u=0;u<c.length;u+=1)a.classList.add(c[u]);}if(a.style.color=l?.color??(n?.others==="author"?B(d):s?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)"),o){let c=a.style.color;a.style.color="";let u=Xa(o,r.kind).mark;u==="hidden"&&(a.style.visibility="hidden"),u==="caret"&&(a.textContent="^"),u==="pound"&&(a.textContent="#"),te(a,o,r.kind,l?.color??B(d),i||n?.others==="kind"||l?.color?c:void 0,l?.background);}else s&&(a.style.textDecorationLine="line-through");return a}function pe(t){let e=Object.getPrototypeOf(t);return e===Object.prototype||e===Array.prototype||e===null}function Be(t,e,n,o){if(t===e)return true;if(typeof t!="object"||typeof e!="object"||t===null||e===null||n>32||!pe(t)||!pe(e)||o&&--o.remaining<0)return false;let i=Array.isArray(t);if(i!==Array.isArray(e))return false;if(i){let r=t,a=e;if(r.length!==a.length)return false;for(let s=0;s<r.length;s+=1)if(!Be(r[s],a[s],n+1,o))return false;return true}return Pt(t,e,void 0,n,o)}function Pt(t,e,n,o,i){let r=t,a=e,s=0;for(let l in r)if(!(!Object.hasOwn(r,l)||n?.has(l))){if(!Object.hasOwn(a,l)||!Be(r[l],a[l],o+1,i))return false;s+=1;}for(let l in a)Object.hasOwn(a,l)&&!n?.has(l)&&(s-=1);return s===0}function C(t,e,n){return t===e?true:!pe(t)||!pe(e)?false:Pt(t,e,n,0)}function Tt(t,e,n){return Be(t,e,0,{remaining:n})}var ho=/^[0-9A-Fa-f]{6}$/,fo=new Set(["box","lines","shadingBox","marker"]),go=new Set(["box","contentX","spans"]),Bt=new Set(["box"]);function G(t,e,n,o,i,r){let a=(o.x-i.x)*r;a!==(e.x-n.x)*r&&(t.left=`${a}px`);let s=(o.y-i.y)*r;s!==(e.y-n.y)*r&&(t.top=`${s}px`),o.width!==e.width&&(t.width=`${o.width*r}px`),o.height!==e.height&&(t.height=`${o.height*r}px`);}function At(t,e){return oe(t,e).x-t.contentX}function mo(t,e,n,o,i){if((e.drawings?.length??0)>0||t.box.height!==e.box.height||t.spans.length!==e.spans.length||!C(t,e,go))return false;for(let r=0;r<e.spans.length;r+=1){let a=t.spans[r],s=e.spans[r];if(s.tabLeader||s.noteSeparator||s.style.shaping||s.style.border||a.box.width!==s.box.width||a.box.height!==s.box.height||!C(a,s,Bt)||r>0&&n(t,r)!==n(e,r))return false}return !o||At(t,i)===At(e,i)}function bo(t,e,n){if(e.borders||e.bottomBorder||e.marker?.picture||t.box.height!==e.box.height||t.lines.length!==e.lines.length||!C(t,e,fo)||t.shadingBox===void 0!=(e.shadingBox===void 0)||t.shadingBox&&t.shadingBox.height!==e.shadingBox.height||t.marker===void 0!=(e.marker===void 0))return false;if(t.marker){let a=e.marker;if(t.marker.box.height!==a.box.height||!C(t.marker,a,Bt))return false}let o=td(e.props),i=e.lines.length-1,r=n.showParagraphMarks&&!!e.paragraphEnd||(e.markRevisions?.length??0)>0;for(let a=0;a<=i;a+=1){let s=e.lines[a],l=n.showParagraphMarks&&!!s.manualBreakAfter||a===i&&r;if(!mo(t.lines[a],s,n.gapOf,l,o))return false}return true}function Ct(t,e,n,o){if(!bo(e,n,o))return false;let i=o.scale,r=!!(n.shading&&ho.test(n.shading)&&n.shadingBox),a=n.marker!==void 0,s=(r?1:0)+(a?1:0),l=t.children;if(l.length!==s+n.lines.length)return false;for(let d=0;d<n.lines.length;d+=1)if(l[s+d].dataset.lineId!==n.lines[d].id)return false;if(r&&!l[0].classList.contains("docx-paragraph-shading")||a&&!l[s-1].classList.contains("docx-list-marker"))return false;if(r){let d=l[0];G(d.style,e.shadingBox,e.box,n.shadingBox,n.box,i);}if(a){let d=l[s-1];G(d.style,e.marker.box,e.box,n.marker.box,n.box,i);}for(let d=0;d<n.lines.length;d+=1){let c=e.lines[d],u=n.lines[d],p=l[s+d],h=(u.box.y-n.box.y)*i;h!==(c.box.y-e.box.y)*i&&(p.style.top=`${h}px`);let y=(u.contentX-n.box.x)*i;y!==(c.contentX-e.box.x)*i&&(p.style.left=`${y}px`);}return true}var Ce=new WeakMap,he=new WeakMap;function Ht(t,e,n){Ce.set(t,{fragment:e,rows:n});}function $e(t,e,n,o,i){he.set(t,{cell:e,host:n,strokes:o,blocks:i});}function Ft(t,e){for(let[n,o]of t)if(n.kind==="table"&&n.tableId===e.tableId&&n.fragmentIndex===e.fragmentIndex)return o}var xo=new Set(["rows","box","columnEdges"]),vo=new Set(["box","cells"]),ko=new Set(["box","blocks","borders"]),Ro=new Set(["strokes","edgeSegments"]),fe=[];function He(t,e,n){let o=t.children[n]??null,i=0;for(;i<e.length&&o===e[i];)o=o.nextElementSibling,i+=1;if(i===e.length&&o===null)return;let r=new Set(e);for(;o;){let a=o.nextElementSibling;r.has(o)||o.remove(),o=a;}o=t.children[n+i]??null;for(let a=i;a<e.length;a+=1){let s=e[a];s===o?o=o.nextElementSibling:t.insertBefore(s,o);}}function So(t,e,n){if(t===e)return true;if(!t||!e||!C(t,e,Ro))return false;let o=t.strokes??fe,i=e.strokes??fe;if(o.length!==i.length||i.length>0&&n?.length!==i.length)return false;for(let r=0;r<i.length;r+=1){let a=o[r],s=i[r];if(a.side!==s.side||a.role!==s.role||a.color!==s.color||a.cssStyle!==s.cssStyle)return false;let l=s.side==="top"||s.side==="bottom";if(s.cssStyle!=="solid"&&(l?a.height!==s.height:a.width!==s.width))return false}return true}function wo(t,e,n,o){let i=e?.strokes??fe,r=n?.strokes??fe;if(!(i===r||!t))for(let a=0;a<r.length;a+=1){let s=i[a],l=r[a],d=t[a].style;s.x!==l.x&&(d.left=`${l.x*o}px`),s.y!==l.y&&(d.top=`${l.y*o}px`),s.width!==l.width&&(d.width=`${l.width*o}px`),s.height!==l.height&&(d.height=`${l.height*o}px`);}}function Mo(t,e,n){return t[n]?.id===e?n:t.findIndex(o=>o.id===e)}function Eo(t,e,n){let o=t.cell,i=n.scale,r=new Set,a=[];for(let s=0;s<e.blocks.length;s+=1){let l=e.blocks[s],d=Mo(o.blocks,l.id,s),c=d<0||r.has(d)?void 0:o.blocks[d],u=c?t.blocks[d]:void 0;if(c&&r.add(d),c&&u&&(c===l||c.kind==="paragraph"&&l.kind==="paragraph"&&Ct(u,c,l,n))){G(u.style,c.box,o.box,l.box,e.box,i),a.push(u);continue}let p=l.kind==="table"&&c?.kind==="table"?n.block(l,u):n.block(l);p.style.left=`${(l.box.x-e.box.x)*i}px`,p.style.top=`${(l.box.y-e.box.y)*i}px`,a.push(p);}return a}function Lo(t,e,n,o,i,r){let a=he.get(t);if(!a||a.cell!==e)return null;if(e!==o){if(!C(e,o,ko))return null;if(o.paintInert||o.vMergeContinue)he.set(t,{...a,cell:o});else {if(o.textDirection==="btLr"&&(e.box.width!==o.box.width||e.box.height!==o.box.height)||!So(e.borders,o.borders,a.strokes))return null;let l=a.host,d=l.children.length-a.blocks.length;if(d<0)return null;for(let u of a.blocks)if(u.parentElement!==l)return null;wo(a.strokes,e.borders,o.borders,r.scale);let c=Eo(a,o,r);He(l,c,d),he.set(t,{cell:o,host:l,strokes:a.strokes,blocks:c});}}return G(t.style,e.box,n,o.box,i,r.scale),t}function Po(t,e,n,o,i,r){if(e!==o){if(!C(e,o,vo))return null;let a=t.children;if(a.length!==e.cells.length)return null;let s=new Set,l=[];for(let d=0;d<o.cells.length;d+=1){let c=o.cells[d],u=e.cells[d]?.id===c.id?d:e.cells.findIndex(h=>h.id===c.id),p=u>=0&&!s.has(u)?Lo(a[u],e.cells[u],e.box,c,o.box,r):null;p&&s.add(u),l.push(p??r.cell(c,o.box));}He(t,l,0);}return G(t.style,e.box,n,o.box,i,r.scale),t}function $t(t){return `${t.id}\0${t.isHeaderRepeat?1:0}${t.isContinuation?1:0}`}function Dt(t,e,n){let o=Ce.get(t);if(!o)return null;let i=o.fragment;if(!C(i,e,xo))return null;let r=new Map;for(let[d,c]of o.rows){let u=$t(d);r.set(u,r.has(u)?null:[d,c]);}let a=new Map;for(let d of e.rows){let c=$t(d),u=r.get(c);r.delete(c);let p=u?Po(u[1],u[0],i.box,d,e.box,n):null;a.set(d,p??n.row(d));}let s=n.scale,l=t.style;return i.box.x!==e.box.x&&(l.left=`${e.box.x*s}px`),i.box.y!==e.box.y&&(l.top=`${e.box.y*s}px`),i.box.width!==e.box.width&&(l.width=`${e.box.width*s}px`),i.box.height!==e.box.height&&(l.height=`${e.box.height*s}px`),He(t,[...a.values()],0),Ce.set(t,{fragment:e,rows:a}),t}function Fe(t,e,n){let o=hb(e.props)??n.paragraphFormatRevision,i=n.revisionStyles,r=j(e.revisions,i?.authorSlots,i?.styles);if(!(!r&&!o)){if(r){let{attribution:a}=r;t.classList.add("docx-revision",`docx-revision-${a.kind}`),t.dataset.revisionKind=a.kind,t.dataset.revisionId=a.id,a.author!==""&&(t.dataset.reviewAuthor=a.author),a.date!==void 0&&(t.dataset.revisionDate=a.date);let s=i?.styles.get(a.author);if(i){t.dataset.reviewAuthorSlot=String((i.authorSlots.get(a.author)??0)%A);let c=i.classTokens.get(a.author);if(c)for(let u=0;u<c.length;u+=1)t.classList.add(c[u]);}let d=i!==void 0&&(s?.color!==void 0||i.others==="author")?r.authorColor:r.color;if(n.revisionMarkup){s?.background&&(t.style.backgroundColor=s.background),te(t,n.revisionMarkup,r.deleted?e.revisions?.find(c=>c.kind==="delete"||c.kind==="moveFrom")?.kind??a.kind:a.kind,r.authorColor,n.revisionKindColors||i?.others==="kind"||s?.color?d:void 0,s?.background);return}t.style.color=d,t.style.backgroundColor=s?.background??(r.deleted?"var(--doc-revision-deletion-wash)":"var(--doc-revision-insertion-wash)"),r.line&&(t.style.textDecorationLine=r.line,a.kind==="insert"&&r.line==="underline"?(t.style.textDecorationStyle="var(--doc-revision-insertion-decoration-style)",t.style.textDecorationThickness="var(--doc-revision-insertion-decoration-thickness)",t.style.textUnderlineOffset="var(--doc-revision-insertion-underline-offset)"):t.style.textDecorationStyle=r.decorationStyle,t.style.textDecorationColor=d);return}if(t.classList.add("docx-revision",...n.revisionMarkup?[]:["docx-revision-format"]),t.dataset.revisionKind="format",t.dataset.formattingKind=hb(e.props)?"rPrChange":"pPrChange",t.dataset.revisionId=o.id,o.author!==""&&(t.dataset.reviewAuthor=o.author),o.date!==void 0&&(t.dataset.revisionDate=o.date),i){let a=i.styles.get(o.author);t.dataset.reviewAuthorSlot=String((i.authorSlots.get(o.author)??0)%A);let s=i.classTokens.get(o.author);if(s)for(let l=0;l<s.length;l+=1)t.classList.add(s[l]);!n.revisionMarkup&&a?.color!==void 0&&(t.style.color=a.color),a?.background!==void 0&&(t.style.backgroundColor=a.background);}n.revisionMarkup&&te(t,n.revisionMarkup,"format",i?.styles.get(o.author)?.color??B(i?.authorSlots.get(o.author)??0),void 0,i?.styles.get(o.author)?.background);}}function It(t,e,n,o,i){if(e.spans.length!==0)return;i({...$$1,fontFamily:o.fontFamily,fontSizePt:o.fontSizePt,bold:o.bold,italic:o.italic});let r=t.ownerDocument.createElement("br");r.style.lineHeight=`${e.box.height*n}px`,t.append(r);}function Ot(t,e,n){let o=e.marker?.picture,i=n.urlRegistry;if(!o||o.resource.kind!=="ready"||!i)return null;let r=n.scale,a=i.urlForReady(o.resource.validatedHandle,o.resource.mime);if(a===null)return null;let s=o.box,l=t.createElement("span");l.className="docx-list-marker",l.dataset.docxMarker="",l.setAttribute("contenteditable","false"),l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.left=`${(s.x-e.box.x)*r}px`,l.style.top=`${(s.y-e.box.y)*r}px`,l.style.width=`${s.width*r}px`,l.style.height=`${s.height*r}px`,l.style.display="block",l.style.overflow="hidden";let d=t.createElement("img");return d.className="docx-list-marker-image",d.setAttribute("src",a),d.setAttribute("alt",""),d.setAttribute("draggable","false"),d.style.display="block",d.style.width=`${s.width*r}px`,d.style.height=`${s.height*r}px`,d.style.maxWidth="none",d.style.maxHeight="none",l.append(d),l}function Nt(t,e,n,o){let i=t.createElement("span");i.dataset.docxNoteRule="single",i.setAttribute("contenteditable","false"),i.setAttribute("aria-hidden","true"),i.style.display="inline-block",i.style.position="relative",i.style.verticalAlign="top",i.style.width=`${e.box.width*o}px`,i.style.height=`${Math.min(e.box.height+(n.leading??0),n.box.height)*o}px`;let r=kf(e,n),a=t.createElement("span");return a.style.position="absolute",a.style.left="0",a.style.top=`${(r.y-n.box.y)*o}px`,a.style.width=`${r.width*o}px`,a.style.height=`${r.height*o}px`,a.style.backgroundColor=e.style.color?`#${e.style.color}`:"#000000",i.append(a),i}function ge(t){return t==="double"||t==="triple"||t==="doubleWave"||t.startsWith("thinThick")||t.startsWith("thickThin")}function W(t,e,n,o,i,r){switch(e){case "dashed":case "dashSmallGap":case "dotDash":case "dotDotDash":case "dashDotStroked":{let a=Math.max(4,4*r);t.style.backgroundColor="transparent",t.style.backgroundImage=`linear-gradient(to ${o?"bottom":"right"}, #${n} 60%, transparent 60%)`,t.style.backgroundSize=o?`100% ${a}px`:`${a}px 100%`;return}case "dotted":{let a=Math.max(3,3*r);t.style.backgroundColor="transparent",t.style.backgroundImage=`linear-gradient(to ${o?"bottom":"right"}, #${n} 35%, transparent 35%)`,t.style.backgroundSize=o?`100% ${a}px`:`${a}px 100%`;return}case "double":case "doubleWave":case "triple":case "thinThickSmallGap":case "thickThinSmallGap":case "thinThickThinSmallGap":case "thinThickMediumGap":case "thickThinMediumGap":case "thinThickThinMediumGap":case "thinThickLargeGap":case "thickThinLargeGap":case "thinThickThinLargeGap":{let a=i/3;t.style.backgroundColor="transparent",t.style.backgroundImage=`linear-gradient(to ${o?"right":"bottom"}, #${n} 0px, #${n} ${a}px, transparent ${a}px, transparent ${a*2}px, #${n} ${a*2}px)`;return}case "threeDEmboss":case "ridge":{t.style.backgroundColor="transparent";let a=o?"borderLeft":"borderTop";t.style[a]=`${Math.max(1,i)}px ridge #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "threeDEngrave":case "groove":{t.style.backgroundColor="transparent";let a=o?"borderLeft":"borderTop";t.style[a]=`${Math.max(1,i)}px groove #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "inset":{t.style.backgroundColor="transparent";let a=o?"borderLeft":"borderTop";t.style[a]=`${Math.max(1,i)}px inset #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "outset":{t.style.backgroundColor="transparent";let a=o?"borderLeft":"borderTop";t.style[a]=`${Math.max(1,i)}px outset #${n}`,o?t.style.width="0px":t.style.height="0px";return}default:return}}var To=/^[0-9A-Fa-f]{6}$/;function _t(t,e,n,o){for(let{box:i,edge:r,side:a}of Fb(n)){let s=r.color&&To.test(r.color)?r.color:"000000",l=t.createElement("span");l.className=`docx-run-border docx-run-border-${a}`,l.dataset.docxMarker="",l.setAttribute("aria-hidden","true"),l.setAttribute("contenteditable","false"),Object.assign(l.style,{position:"absolute",pointerEvents:"none",left:`${(i.x-n.contentX)*o}px`,top:`${(i.y-n.box.y)*o}px`,width:`${i.width*o}px`,height:`${i.height*o}px`,backgroundColor:`#${s}`});let d=a==="left"||a==="right";W(l,r.val,s,d,(d?i.width:i.height)*o,o),e.append(l);}}function Kt(t,e){let n=e.fieldAtom?.formControl;if(n?.kind!=="dropdown"||n.entries.length===0)return;let o=t.ownerDocument.createElement("select");o.dataset.docxFormDropdown="",o.dataset.docxMarker="",o.setAttribute("aria-label",n.accessibleName??e.text);for(let[i,r]of n.entries.entries()){let a=t.ownerDocument.createElement("option");a.value=String(i),a.textContent=r,o.append(a);}o.selectedIndex=n.selectedIndex,Object.assign(o.style,{position:"absolute",inset:"0",width:"100%",height:"100%",opacity:"0",cursor:"pointer",font:"inherit",padding:"0",border:"0"}),t.style.position="relative",t.append(o);}function zt(t,e,n){let o=e.fieldAtom?.formControl;if(o?.kind!=="checkbox")return;t.dataset.docxFormCheckbox="",t.dataset.checked=String(o.checked),t.setAttribute("role","checkbox"),t.tabIndex=0,t.setAttribute("aria-checked",String(o.checked)),o.accessibleName&&t.setAttribute("aria-label",o.accessibleName),t.style.width=`${e.box.width*n}px`;let i=t.ownerDocument.createElement("span");i.className="docx-form-checkbox-hit",i.dataset.docxMarker="",i.setAttribute("aria-hidden","true"),t.append(i);}var re=Object.freeze({pageBreak:"Page break",columnBreak:"Column break",sectionBreakContinuous:"Section break (continuous)",sectionBreakNextPage:"Section break (next page)",sectionBreakEvenPage:"Section break (even page)",sectionBreakOddPage:"Section break (odd page)",sectionBreakNextColumn:"Section break (new column)"}),jt=Object.keys(re);function _i(t){if(!t)return re;let e={};for(let n of jt){let o=`formattingMarks.${n}`,i=t(o);e[n]=i&&i!==o?i:re[n];}return Object.freeze(e)}function Gt(t){return jt.map(e=>t[e]).join("\0")}function Ao(t,e){return t==="page"?e.pageBreak:e.columnBreak}function Bo(t,e){switch(t){case "continuous":return e.sectionBreakContinuous;case "evenPage":return e.sectionBreakEvenPage;case "oddPage":return e.sectionBreakOddPage;case "nextColumn":return e.sectionBreakNextColumn;default:return e.sectionBreakNextPage}}var Co=8;function $o(t,e){let n=oe(t,e),o=t.box.x,i=t.box.x+t.box.width;return Ho(t)?n.rtl?{left:Math.min(o,n.x),right:n.x,rtl:true}:{left:n.x,right:Math.max(i,n.x),rtl:false}:{left:o,right:i,rtl:n.rtl}}function Ho(t){return Eb(t.spans,t.drawings??[])?(t.drawings?.length??0)>0?true:t.spans.some(e=>e.box.width>0||e.text!==mb&&e.text!==`
|
|
2
|
-
`&&e.text!==""):false}function Ut(t){let e=t.createElement("span");return e.className="docx-break-mark-rule",e.style.flex="1 1 0",e.style.minWidth="0",e.style.height="0",e.style.borderTop="1px dotted currentColor",e}function Fo(t,e,n,o,i){if(o.length===0)return null;let{scale:r}=i,a=$o(e,i.paragraphRtl),s=Co*r,l=t.createElement("span");l.className="docx-break-mark",l.dataset.docxMarker="",l.setAttribute("aria-hidden","true"),l.setAttribute("contenteditable","false"),l.style.position="absolute",l.style.left=`${(a.left-e.contentX)*r}px`,l.style.width=`${Math.max(0,a.right-a.left)*r}px`,l.style.height=`${s}px`,i.boundary?l.style.top=`${-s/2}px`:l.style.bottom=`${Math.max(0,e.box.height-e.baseline)*r}px`,l.style.display="flex",l.style.overflow="hidden",l.style.pointerEvents="none",l.style.userSelect="none",l.style.whiteSpace="pre",l.style.fontFamily="Arial, Helvetica, sans-serif",l.style.fontSize=`${s}px`,l.style.fontWeight="normal",l.style.fontStyle="normal",l.style.lineHeight=`${s}px`,l.style.color="var(--doc-revision-format)",a.rtl&&(l.style.direction="rtl");for(let{text:d,revisions:c}of o){let u=t.createElement("span");u.className="docx-break-mark-segment",u.style.flex="1 1 0",u.style.minWidth="0",u.style.display="flex",u.style.alignItems="center",Ae(u,c,i.colors);let p=t.createElement("span");p.className="docx-break-mark-label",p.textContent=d,p.dir="auto",p.style.unicodeBidi="isolate",p.style.flex="0 1 auto",p.style.minWidth="0",p.style.overflow="hidden",p.style.padding=`0 ${s/2}px`,u.append(Ut(t),p,Ut(t)),l.append(u);}return n.append(l),a}function Do(t){let e=t.breakAfter==="page"?mb:`
|
|
3
|
-
`;for(let n=t.spans.length-1;n>=0;n-=1)if(t.spans[n].text===e)return t.spans[n].revisions}function Wt(t,e){let n=t.sectionBreaks??[];return {strings:e,sectionBreaks:new Map(n.map(o=>[o.paragraphId,o.kind])),token:n.map(o=>`${o.paragraphId}:${o.kind}`).join(",")}}function Io(t,e,n,o,i){let r=e.lines.length-1,a=e.paragraphEnd?o.sectionBreaks.get(e.paragraphId):void 0,s=e.outOfFlow===true&&!e.positionedFrame,l;for(let d=0;d<=r;d+=1){let c=e.lines[d],u=n[d];if(!u)continue;let p=[];if(c.breakAfter&&!s){let y=Do(c);p.push({text:Ao(c.breakAfter,o.strings),...y?{revisions:y}:{}});}d===r&&a&&p.push({text:Bo(a,o.strings)});let h=Fo(t,c,u,p,{...i,boundary:s});h&&d===r&&!s&&(l={x:h.rtl?h.left:h.right,rtl:h.rtl});}return {replacesPilcrow:a!==void 0,...l?{pilcrowAt:l}:{}}}function Xt(t,e,n,o,i){let r=td(e.props),a=o.breakMarks&&!o.inertLinks?Io(t,e,n,o.breakMarks,{paragraphRtl:r,scale:i,...o.revisionStyles?{colors:o.revisionStyles}:{}}):null,s=(e.markRevisions?.length??0)>0;if(!(o.showParagraphMarks&&e.paragraphEnd&&!a?.replacesPilcrow)&&!s)return;let d=Lt(t,e.markRevisions??[],o.revisionStyles,o.revisionMarkup,o.revisionKindColors),c=e.lines[e.lines.length-1],u=n[n.length-1];if(!c||!u)return;let p=e.paragraphMarkSizePt??e.emptyParagraphStyle?.fontSizePt??c.spans.at(-1)?.style.fontSizePt??$$1.fontSizePt;Te(d,u,c,r,p,i,a?.pilcrowAt);}function Vt(t){t.style.fontFamily=O,t.style.direction="ltr";}function De(t,e,n=false){let o=n?null:hb(e.props.filter(r=>r.localName==="pPrChange")),i=o??e.markFormatRevision;i&&(Oo(t,i,o?"pPrChange":"rPrChange"),t.dataset.paragraphId=e.paragraphId,t.dataset.reviewStart=String(e.range.start),t.dataset.reviewEnd=String(e.range.end));}function Oo(t,e,n){t.dataset.revisionKind="format",t.dataset.revisionId=e.id,t.dataset.formattingKind=n,e.author&&(t.dataset.reviewAuthor=e.author),e.date!==void 0&&(t.dataset.revisionDate=e.date);}function Yt(t,e,n,o,i,r){for(let a of [n.footnotes,n.endnotes])a&&e.append(No(t,n,a,o,i,r));}function No(t,e,n,o,i,r){let a=t.createElement("div");a.className="docx-notes",a.dataset.docxNotes=n.kind,a.dataset.docxNotesPlacement=n.placement,a.style.position="absolute",a.style.left=`${(n.box.x-e.box.x)*o.scale}px`,a.style.top=`${(n.box.y-e.box.y)*o.scale}px`,a.style.width=`${n.box.width*o.scale}px`,a.style.height=`${n.box.height*o.scale}px`;for(let s of [n.separator,n.continuationNotice]){if(!s)continue;let l=t.createElement("div");l.className="docx-note-separator",l.dataset.docxNoteSeparator=s.kind,l.setAttribute("contenteditable","false"),l.setAttribute("aria-hidden","true"),l.style.position="absolute",l.style.left=`${(s.box.x-n.box.x)*o.scale}px`,l.style.top=`${(s.box.y-n.box.y)*o.scale}px`,l.style.width=`${s.box.width*o.scale}px`,l.style.height=`${s.box.height*o.scale}px`;let d=s.ruleStyle;if(d||s.synthetic)_o(l,t,d??"single",o.scale,s.box.height,s.ruleColor);else {let c={...o,tabLeaderOriginXPt:s.box.x-e.box.x};for(let u of s.fragments)l.append(u.kind==="table"?r(t,u,c):i(t,u,c));}a.append(l);}for(let s of n.notes){let l={...o,tabLeaderOriginXPt:s.box.x-e.box.x},d=t.createElement("div");d.className="docx-note",d.dataset.docxNote=s.noteKind,d.dataset.docxNoteId=String(s.noteId),d.dataset.docxNoteScope=s.scopeId,s.mark!==null&&(d.dataset.docxNoteMark=s.mark),s.continuation&&(d.dataset.docxNoteContinuation=""),d.setAttribute("role","doc-footnote"),d.style.position="absolute",d.style.left=`${(s.box.x-n.box.x)*o.scale}px`,d.style.top=`${(s.box.y-n.box.y)*o.scale}px`,d.style.width=`${s.box.width*o.scale}px`,d.style.height=`${s.box.height*o.scale}px`;for(let c of s.fragments)d.append(c.kind==="table"?r(t,c,l):i(t,c,l));a.append(d);}return a}function _o(t,e,n,o,i,r){t.dataset.docxNoteRule=n;let a=r&&/^[a-f\d]{6}$/i.test(r)?`#${r}`:"#000000";t.style.color=a;let s=Math.max(1,o*.75);if(n==="single"){t.style.backgroundColor=a,t.style.height=`${i*o}px`;return}t.style.opacity="0.85";let l=Math.max(1,o*1.25);for(let d of [0,s+l]){let c=e.createElement("div");c.setAttribute("aria-hidden","true"),c.style.position="absolute",c.style.left="0",c.style.right="0",c.style.top=`${d}px`,c.style.height="0",c.style.borderTop=`${s}px solid currentColor`,t.append(c);}}var Ko=new Set(["dropdown","comboBox","date","checkbox","picture","buildingBlockGallery"]);function qt(t,e,n,o){let i=o.contentControlChrome,r=i?.suppressedIds,a=(n.contentControls??[]).filter(p=>r?.has(p.id)!==true),s=[...a,...(i?.additionalBoundaries??[]).filter(p=>r?.has(p.id)!==true&&!a.some(h=>h.id===p.id))];if(s.length===0)return;let l=i?.showAll===true,d=i?.activeIds,c=i?.hoverIds,u=i?.tocControlIds;for(let p of s){let h=u?.has(p.id)===true,y=!h&&d?.has(p.id)===true,f=c?.has(p.id)===true;e.append(Uo(t,n,p,o.scale,y,f,l||y||h&&f,i?.checkedIds?.has(p.id),h,i?.readOnly===true));}}function zo(t,e,n,o){let i=t.contentBox.x-t.box.x,r=t.contentBox.y-t.box.y;if(n==="checkbox"){let p=Math.max(1,Math.min(e.height,16))*o,h=e.width>0?(i+e.x+e.width/2)*o-p/2:(i+e.x)*o,y=(r+e.y)*o+Math.max(0,(e.height*o-p)/2);return {left:h,top:y,size:p}}let a=16*o,s=(i+e.x+e.width)*o,l=t.box.width*o,d=s+2*o,c=d+a<=l?d:Math.max(0,s-a),u=(r+e.y)*o+Math.max(0,(e.height*o-a)/2);return {left:c,top:u,size:a}}function Uo(t,e,n,o,i,r,a,s,l,d){let c=t.createElement("div");c.className="docx-content-control-chrome",c.dataset.docxContentControl=n.id,c.dataset.docxMarker="",c.dataset.controlType=n.controlType,c.dataset.lock=n.effectiveLock,n.bound&&(c.dataset.bound=""),n.placeholder&&(c.dataset.placeholder=""),l&&(c.dataset.docxToc=""),d&&(c.dataset.readOnly=""),i&&(c.dataset.active=""),r&&(c.dataset.hover=""),a&&(c.dataset.boundaryVisible=""),c.setAttribute("contenteditable","false"),c.setAttribute("role","group"),n.alias&&(c.dataset.alias=n.alias),n.tag&&(c.dataset.tag=n.tag),n.alias&&c.setAttribute("aria-label",n.alias),c.style.position="absolute",c.style.inset="0",c.style.pointerEvents="none",c.style.zIndex="2";let u=e.contentBox.x-e.box.x,p=e.contentBox.y-e.box.y;for(let y of n.fragments){if(y.pageIndex!==e.index)continue;let f=t.createElement("div");f.className="docx-content-control-boundary",f.dataset.docxMarker="",f.setAttribute("contenteditable","false"),f.setAttribute("aria-hidden","true"),f.style.position="absolute",f.style.left=`${(u+y.box.x)*o}px`,f.style.top=`${(p+y.box.y)*o}px`,f.style.width=`${Math.max(y.box.width,1)*o}px`,f.style.height=`${Math.max(y.box.height,1)*o}px`,f.style.pointerEvents="none",c.append(f);}let h=n.fragments.find(y=>y.pageIndex===e.index);if(h&&n.alias){let y=t.createElement("div");y.className="docx-content-control-label",y.dataset.docxMarker="",y.setAttribute("contenteditable","false"),y.setAttribute("aria-hidden","true"),y.textContent=n.alias,y.style.position="absolute",y.style.left=`${(u+h.box.x)*o}px`,y.style.top=`${Math.max(0,(p+h.box.y)*o-16)}px`,y.style.pointerEvents="none",c.append(y);}if(h&&Ko.has(n.controlType)){let y=t.createElement("button");y.type="button",y.className="docx-content-control-widget",y.dataset.docxMarker="",y.dataset.docxCcWidget=n.controlType,y.dataset.docxCcId=n.id,y.setAttribute("contenteditable","false"),y.setAttribute("tabindex","-1"),n.controlType==="checkbox"?y.setAttribute("role","checkbox"):n.controlType==="dropdown"||n.controlType==="comboBox"||n.controlType==="buildingBlockGallery"?y.setAttribute("role","listbox"):(n.controlType==="date"||n.controlType==="picture")&&y.setAttribute("role","button"),n.alias&&(y.dataset.name=n.alias),n.alias&&y.setAttribute("aria-label",n.alias),n.controlType==="checkbox"&&(y.setAttribute("data-checked",s?"true":"false"),y.setAttribute("aria-checked",s?"true":"false"));let f=n.effectiveLock==="contentLocked"||n.effectiveLock==="sdtContentLocked";(d||f||n.bound)&&(y.disabled=true,y.dataset.disabledReason=d?"readOnly":n.bound?"bound":"locked",y.setAttribute("aria-disabled","true"));let g=zo(e,h.box,n.controlType,o);y.style.position="absolute",y.style.left=`${g.left}px`,y.style.top=`${g.top}px`,y.style.width=`${g.size}px`,y.style.height=`${g.size}px`,y.style.fontSize=`${g.size}px`,y.style.pointerEvents="auto",y.style.padding="0",y.style.margin="0",y.style.cursor=y.disabled?"not-allowed":"pointer",c.append(y);}return c}var Jt="docx-change-bars",me="docx-change-bar",jo=.5;function Qt(t,e){for(let n of e)switch(t.author??=n.author,n.kind){case "insert":case "moveTo":t.insertion=true;break;case "delete":case "moveFrom":t.deletion=true;break;case "format":t.format=true;break}}function en(t,e,n){let o=t.lines,i=o.length-1,r=[];for(let a=0;a<=i;a+=1){let s=o[a];if(r.length=0,e.mode==="simple-markup"){s.changeSites&&r.push(...s.changeSites),a===i&&t.markChangeSites&&r.push(...t.markChangeSites),r.length>0&&Zt(t,o,a,e,r,n);continue}s.changeSites&&r.push(...s.changeSites);for(let l of s.spans){l.revisions&&r.push(...l.revisions);let d=hb(l.props);d&&r.push(d);}for(let l of s.drawings??[])l.revisions&&r.push(...l.revisions);if(s.anchorRevisions&&r.push(...s.anchorRevisions),a===i){t.markRevisions&&r.push(...t.markRevisions),t.markFormatRevision&&r.push(t.markFormatRevision);let l=hb(t.props);l&&r.push(l);}r.length!==0&&Zt(t,o,a,e,r,n);}}function Zt(t,e,n,o,i,r){let a=e[n],s=e.length-1,l=(n===0?t.box.y:a.box.y)+o.dy,d=Math.min((n===s?t.box.y+t.box.height:e[n+1].box.y)+o.dy,o.limit);if(d<=l)return;let c={top:l,bottom:d,story:o.story,insertion:false,deletion:false,format:false};Qt(c,i),r.push(c);}function Go(t,e,n){for(let o of t.rows){let i=e.mode==="simple-markup"?o.changeSites:void 0;if(e.mode==="all-markup"&&o.revisionKind||i&&i.length>0){let r=Oe$1(o)?Math.max(o.box.y,...o.cells.map(s=>s.box.y+s.box.height)):o.box.y+o.box.height,a={top:o.box.y+e.dy,bottom:Math.min(r+e.dy,e.limit),story:e.story,author:o.revisionAuthor,insertion:o.revisionKind==="insert",deletion:o.revisionKind==="delete",format:false};i&&Qt(a,i),n.push(a);}for(let r of o.cells){if(r.textDirection==="btLr"){let a=[];if(Ie(r.blocks,e,a),a.length===0)continue;let s={top:r.box.y+e.dy,bottom:Math.min(r.box.y+r.box.height+e.dy,e.limit),story:e.story,insertion:false,deletion:false,format:false};for(let l of a)s.insertion||=l.insertion,s.deletion||=l.deletion,s.format||=l.format;s.bottom>s.top&&n.push(s);continue}Ie(r.blocks,e,n);}}}function Ie(t,e,n){for(let o of t)o.kind==="table"?Go(o,e,n):en(o,e,n);}function Wo(t){t.sort((n,o)=>n.top-o.top||n.bottom-o.bottom);let e=[];for(let n of t){let o=e[e.length-1];if(o&&o.story===n.story&&o.author===n.author&&n.top<=o.bottom+jo){o.bottom=Math.max(o.bottom,n.bottom),o.insertion||=n.insertion,o.deletion||=n.deletion,o.format||=n.format;continue}e.push({...n});}return e}function Oe(t,e,n,o=false,i,r=false,a){let s=[];if(n==="none"||i?.changedLines.mark==="none")return {mode:n,toggle:o,left:0,runs:s,signature:"none"};let l=t.box.height,d=t.contentBox.y-t.box.y+t.contentBox.height,c={x:t.box.x,y:t.box.y};Ba(t,g=>{if(g.story==="note-separator")return;let v={mode:n,story:g.story,dy:g.origin.y-t.box.y,limit:g.story==="body"?d:l};Ie(g.host.fragments,v,s);let k=g.story==="header"||g.story==="footer"?x=>wa(x,g.origin,c):void 0;Fa(g.host,(x,E)=>{E.textboxDepth!==0&&en(x,{mode:n,story:g.story,dy:E.storyOrigin.y-t.box.y,limit:l},s);},g.origin,k);});let u=i?.changedLines.mark==="rightBorder"||i?.changedLines.mark==="outsideBorder"&&r&&t.index%2===0,p=Math.round((u?t.box.width-Math.max(0,(t.box.width-t.contentBox.width-(t.contentBox.x-t.box.x))/2):Math.max(0,(t.contentBox.x-t.box.x)/2))*e),h=i?Wa(i.changedLines.color,"var(--doc-review-author-0)",n==="simple-markup"?"var(--doc-review-change-bar-simple)":"var(--doc-review-change-bar)"):void 0,y=Wo(s);if(i?.changedLines.color==="byAuthor")for(let g of y)g.color=a?.styles.get(g.author??"")?.color??B(a?.authorSlots.get(g.author??"")??0);let f=`${n}|${o?"t":""}|${p}|${h??""}`;for(let g of y)f+=`|${g.story}:${g.top.toFixed(3)}-${g.bottom.toFixed(3)}${g.insertion?"i":""}${g.deletion?"d":""}${g.format?"f":""}:${g.color??""}`;return {mode:n,toggle:o,left:p,runs:y,signature:f,...h?{color:h}:{}}}function tn(t,e,n){if(e.runs.length===0)return null;let o=e.mode==="simple-markup",i=t.createElement("div");i.className=Jt,i.dataset.docxChangeBars=e.signature,i.dataset.docxChangeBarsMode=e.mode,i.setAttribute("aria-hidden","true"),i.setAttribute("contenteditable","false"),i.style.position="absolute",i.style.inset="0",i.style.pointerEvents="none";for(let r of e.runs){let a=t.createElement("div");a.className=me,r.insertion&&a.classList.add(`${me}-insertion`),r.deletion&&a.classList.add(`${me}-deletion`),r.format&&a.classList.add(`${me}-format`),a.dataset.docxStory=r.story,a.style.position="absolute",a.style.left=`${e.left}px`,a.style.top=`${r.top*n}px`,a.style.height=`${(r.bottom-r.top)*n}px`,a.style.width=o?"var(--doc-review-change-bar-simple-width)":"var(--doc-review-change-bar-width)",a.style.backgroundColor=r.color??e.color??(o?"var(--doc-review-change-bar-simple)":"var(--doc-review-change-bar)"),e.toggle?(a.dataset.docxChangeBarToggle="",a.style.pointerEvents="auto",a.style.cursor="pointer"):a.style.pointerEvents="none",i.append(a);}return i}function nn(t,e,n,o,i=false,r,a=false,s){return tn(t,Oe(e,n,o,i,r,a,s),n)}function on(t,e,n,o,i,r=false,a,s=false,l){let d=e.querySelector(`:scope > .${Jt}`),c=Oe(n,o,i,r,a,s,l);if(d&&d.dataset.docxChangeBars===c.signature)return;d?.remove();let u=tn(t,c,o);u&&e.append(u);}function be(t,e,n){return !!n.activeHeaderFooterRId&&!!t.rId&&n.activeHeaderFooterRId===t.rId&&(n.activeHeaderFooterPageIndex===void 0||n.activeHeaderFooterPageIndex===e)}function Ne(t,e,n){return n?t.kind==="footer"?Math.max(t.box.height,e.box.y+e.box.height-t.box.y):Math.max(t.box.height,e.contentBox.y-t.box.y):t.box.height}function Xo(t,e){let{box:n}=e,o=t.contentBox,i=e.kind==="header"?n.y:Math.max(n.y,o.y+o.height),r=e.kind==="header"?Math.min(n.y+n.height,o.y):n.y+n.height;return r>i?{x:n.x,y:i,width:n.width,height:r-i}:null}function Vo(t,e){let n=e.box,o=t.contentBox;return n.x<o.x+o.width&&o.x<n.x+n.width&&n.y<o.y+o.height&&o.y<n.y+n.height}function rn(t,e,n,o,i){let r=o.box;if(Vo(n,o)){e.dataset.docxHfOverBody="";let s=Xo(n,o);if(!s)return null;let l=t.createElement("div");l.className="docx-hf-hover",l.dataset.docxHfHover=o.kind,l.setAttribute("contenteditable","false"),l.style.position="absolute",l.style.left=`${(s.x-n.box.x)*i}px`,l.style.top=`${(s.y-n.box.y)*i}px`,l.style.width=`${s.width*i}px`,l.style.height=`${s.height*i}px`,e.before(l),r=s;}let a=t.createElement("div");return a.className="docx-hf-edit-hint",a.dataset.docxHfHint=o.kind,a.setAttribute("contenteditable","false"),a.style.position="absolute",a.style.left=`${(r.x-n.box.x)*i}px`,a.style.width=`${r.width*i}px`,a.style.top=o.kind==="header"?`${(r.y+r.height-n.box.y)*i}px`:`${(r.y-n.box.y)*i}px`,o.kind==="footer"&&(a.style.transform="translateY(-100%)"),a}function an(t,e){for(let{record:n,element:o,materialized:i}of t){if(!i)continue;let r=o.querySelector(":scope > .docx-page-content");r&&xe(r,"contenteditable",e.activeHeaderFooterRId?"false":null);let a=null;for(let s of o.querySelectorAll(":scope > .docx-hf:not(.docx-hf--placeholder)")){let l=Yo(n,s);if(!l)continue;let d=be(l,n.index,e);d&&(a=l.kind),qo(s,n,l,d,e.scale);}xe(o,"data-docx-hf-active-kind",a);for(let s of o.querySelectorAll(":scope > [data-docx-hf-front]")){let l=sn(n,s.dataset.docxHfFront);ln(s,!!l&&be(l,n.index,e));}}}function Yo(t,e){return sn(t,e.dataset.docxHf)}function sn(t,e){if(e==="header")return t.header;if(e==="footer")return t.footer}function qo(t,e,n,o,i){xe(t,"data-docx-hf-active",o?"":null),xe(t,"contenteditable",o?"true":"false");let r=`${Ne(n,e,o)*i}px`;t.style.height!==r&&(t.style.height=r),ln(t,o);}function xe(t,e,n){t.getAttribute(e)!==n&&(n===null?t.removeAttribute(e):t.setAttribute(e,n));}function ln(t,e){let n=t.querySelectorAll(t instanceof Element&&t.classList.contains("docx-drawing-layer")?":scope > *":":scope > .docx-drawing-layer > *"),o=e?"auto":"none";for(let i of n){i.style.pointerEvents!==o&&(i.style.pointerEvents=o);for(let r of i.querySelectorAll(".docx-drawing"))r.style.pointerEvents!==o&&(r.style.pointerEvents=o);}}function dn(t){return t.horizontalFrame==="page"||t.verticalFrame==="page"}function cn(t,e,n){let o=e.paintBounds,i=wa(e,t.box,n),r=i.x-e.x,a=i.y-e.y,s=l=>Object.freeze({x:l.x+r,y:l.y+a,width:l.width,height:l.height});return Object.freeze({...e,x:e.x+r,y:e.y+a,paintBounds:s(o),hitBounds:s(e.hitBounds),geometry:Object.freeze({...e.geometry,contentBounds:s(e.geometry.contentBounds),paintBounds:s(e.geometry.paintBounds),...e.geometry.clipPolygon?{clipPolygon:Object.freeze(e.geometry.clipPolygon.map(l=>Object.freeze({x:l.x+r,y:l.y+a})))}:{}})})}function Zo(t,e,n,o,i){let r=n.anchoredDrawings??[];if(r.length===0)return;let a=r.map(l=>cn(n,l,i)),s=t.createElement("div");s.className="docx-hf-behind-layer",s.dataset.docxHfBehind=n.kind,s.setAttribute("contenteditable","false"),s.style.position="absolute",s.style.inset="0",s.style.overflow="hidden",s.style.pointerEvents="none",o.appendDrawings(s,a,i,"behind",false),s.childElementCount>0&&e.append(s);}function Jo(t,e,n,o,i,r){let{scale:a}=i.chrome,s=t.createElement("div");s.className="docx-hf",s.dataset.docxHf=o.kind,o.rId&&(s.dataset.docxRId=o.rId),r?(s.dataset.docxHfActive="",s.setAttribute("contenteditable","true")):s.setAttribute("contenteditable","false"),s.style.position="absolute",s.style.left=`${(o.box.x-n.box.x)*a}px`,s.style.top=`${(o.box.y-n.box.y)*a}px`,s.style.width=`${o.box.width*a}px`,s.style.height=`${Ne(o,n,r)*a}px`,s.style.overflow="visible";let l=(n.box.x-o.box.x)*a,d=(n.box.y-o.box.y)*a,c=l+n.box.width*a,u=d+n.box.height*a;s.style.clipPath=`polygon(${l}px ${d}px, ${c}px ${d}px, ${c}px ${u}px, ${l}px ${u}px)`;for(let y of o.fragments)s.append(i.paintFragment(y,o.box.x-n.box.x));let p=(o.anchoredDrawings??[]).filter(y=>!dn(y)),h=Object.freeze({x:0,y:0,width:o.box.width,height:o.box.height});return i.appendDrawings(s,p,h,"inFront",r),e.append(s),s}function un(t,e,n,o){let i=Object.freeze({x:n.box.x,y:n.box.y,width:n.box.width,height:n.box.height}),r=[n.header,n.footer].filter(s=>!!s);for(let s of r)Zo(t,e,s,o,i);let a=[];for(let s of r){let l=be(s,n.index,o.chrome),d=Jo(t,e,n,s,o,l),c=rn(t,d,n,s,o.chrome.scale);c&&a.push(c);let u=(s.anchoredDrawings??[]).filter(dn).map(p=>cn(s,p,i));o.appendDrawings(e,u,i,"inFront",l,s.kind);}return a}var Qo=0;function yn(t,e,n,o){if(o===void 0||!Number.isFinite(o)||o<0||o>1)return;let i="http://www.w3.org/2000/svg",r=(u,p)=>{let h=t.createElementNS(i,u);for(let[y,f]of Object.entries(p))h.setAttribute(y,f);return h},a=`docx-bilevel-${++Qo}`,s=r("svg",{width:"0",height:"0","aria-hidden":"true"});s.style.position="absolute",s.style.pointerEvents="none";let l=r("filter",{id:a,"color-interpolation-filters":"sRGB"});l.append(r("feColorMatrix",{type:"saturate",values:"0"}));let d=r("feComponentTransfer",{}),c=Array.from({length:256},(u,p)=>p/255>=o?1:0).join(" ");for(let u of ["R","G","B"])d.append(r(`feFunc${u}`,{type:"discrete",tableValues:c}));l.append(d),s.append(l),e.append(s),n.style.filter=`${n.style.filter} url(#${a})`.trim();}function pn(t){return Math.max(-1,Math.min(1,t))}function er(t,e){if(!Number.isFinite(t)||!Number.isFinite(e))return null;let n=pn(t/100),o=pn(e/100);if(n===0&&o===0)return null;let i=o>=0?Math.min(1e3,1/(1-o)):Math.max(0,1+o),r=.5-n/2,a=r+n-i*r;return Object.freeze({slope:i,intercept:a})}function ve(t){if(!Number.isFinite(t))return "0";let e=Math.round(t*1e6)/1e6;return String(Object.is(e,-0)?0:e)}function tr(t){let{slope:e,intercept:n}=t;if(n>=0){let i=e+2*n;return i<=0?"brightness(0)":`contrast(${ve(e/i)}) brightness(${ve(i)})`}let o=1-2*n;return `brightness(${ve(e/o)}) contrast(${ve(o)})`}function _e(t){let e=[];t.grayscale&&e.push("grayscale(1)");let n=er(t.brightness,t.contrast);n&&e.push(tr(n));let{opacity:o}=t;return o!==void 0&&Number.isFinite(o)&&o>=0&&o<1&&e.push(`opacity(${Math.round(o*1e3)/1e3})`),e.length>0?e.join(" "):void 0}var hn="http://www.w3.org/2000/svg",nr=0;function fn(t,e){let{cx:n,cy:o}=t.extentEmu;if(n>0&&o>0)return {viewBox:[0,0,n,o],frame:e};let i=1;for(let a of t.components)i=Math.max(i,a.strokeWidthEmu);if(n<=0){let a=o>0?e.height/o:0;return {viewBox:[-i,0,2*i,Math.max(1,o)],frame:{...e,x:e.x-i*a,width:2*i*a}}}let r=e.width/n;return {viewBox:[0,-i,n,2*i],frame:{...e,y:e.y-i*r,height:2*i*r}}}function gn(t,e,n,o,i){let r=`docx-inset-${++nr}`,a=t.createElementNS(hn,"clipPath");a.setAttribute("id",r);let s=t.createElementNS(hn,"path");s.setAttribute("d",o),s.setAttribute("clip-rule","evenodd"),a.append(s),e.append(a),n.setAttribute("stroke-width",String(2*Math.max(1,i))),n.setAttribute("clip-path",`url(#${r})`);}var Ke="http://www.w3.org/2000/svg";function $(t){return Number.isFinite(t)?String(t):"0"}function ze(t,e,n,o,i){if(o===n)return;let r=a=>`${$(-a*i)}px`;t.style.overflow="visible",t.style.clipPath=`inset(${r(n.y-o.y)} ${r(o.x+o.width-(n.x+n.width))} ${r(o.y+o.height-(n.y+n.height))} ${r(n.x-o.x)})`,e.style.pointerEvents="none";}function Ue(t,e,n){let o=e.vectorShape,i=e.geometry.contentBounds,r=e.paintBounds,a=t.createElement("div");a.className="docx-drawing-image-frame",a.style.position="absolute";let s=fn(o,i);a.style.left=`${(s.frame.x-r.x)*n}px`,a.style.top=`${(s.frame.y-r.y)*n}px`,a.style.width=`${s.frame.width*n}px`,a.style.height=`${s.frame.height*n}px`;let l=t.createElementNS(Ke,"svg");l.setAttribute("viewBox",s.viewBox.map($).join(" ")),l.setAttribute("preserveAspectRatio","none"),l.setAttribute("width","100%"),l.setAttribute("height","100%"),l.style.display="block",l.style.overflow="visible";for(let d of o.components){let c=t.createElementNS(Ke,"path"),u=d.subpathsEmu.map((p,h)=>`M${p.map(y=>`${$(y.x)} ${$(y.y)}`).join("L")}${d.subpathsClosed?.[h]===false?"":"Z"}`).join("");if(c.setAttribute("d",u),c.setAttribute("fill",d.fillHex!==null?`#${d.fillHex}`:"none"),c.setAttribute("fill-rule","evenodd"),d.fillAlpha<1&&c.setAttribute("fill-opacity",$(Math.max(0,d.fillAlpha))),d.strokeHex!==null&&(c.setAttribute("stroke",`#${d.strokeHex}`),c.setAttribute("stroke-width",$(Math.max(1,d.strokeWidthEmu))),d.strokeInset&&gn(t,l,c,u,Ie$1(d.strokeWidthEmu)),d.strokeAlpha<1&&c.setAttribute("stroke-opacity",$(Math.max(0,d.strokeAlpha)))),l.append(c),d.strokeHex!==null)for(let p of d.arrowheadsEmu??[]){let h=t.createElementNS(Ke,"path");h.setAttribute("d",`M${p.map(y=>`${$(y.x)} ${$(y.y)}`).join("L")}Z`),h.setAttribute("fill",`#${d.strokeHex}`),h.setAttribute("fill-opacity",$(Math.max(0,Math.min(1,d.strokeAlpha)))),h.setAttribute("data-docx-line-end","triangle"),l.append(h);}}return a.append(l),a}function je(t,e,n,o){let i=e.groupTextboxStories;if(!i||e.accessibility.hidden||!n.paintStoryFragment)return null;let r=e.paintBounds;if(r.width<=0||r.height<=0)return null;let a=n.scale,s=t.createElement("div");s.className="docx-drawing-group-text",s.dataset.groupTextFor=e.drawingNodeId,s.setAttribute("contenteditable","false");let l=o?.x??0,d=o?.y??0;s.style.position="absolute",s.style.left=`${(r.x-l)*a}px`,s.style.top=`${(r.y-d)*a}px`,s.style.width=`${r.width*a}px`,s.style.height=`${r.height*a}px`,s.style.overflow="hidden",s.style.pointerEvents="none";let c=e.x-r.x,u=e.y-r.y;for(let p of i){let h=p.story,y=t.createElement("div");y.className="docx-drawing-textbox-content",y.style.position="absolute",y.style.left=`${(c+p.box.x+h.contentOffset.x)*a}px`,y.style.top=`${(u+p.box.y+h.contentOffset.y)*a}px`,y.style.width=`${h.contentWidth*a}px`,y.style.height=`${Math.max(0,h.contentHeight)*a}px`,y.style.overflow="hidden";let f=p.rotationDegrees;if(f!==0&&Number.isFinite(f)){let g=p.box.width/2-h.contentOffset.x,v=p.box.height/2-h.contentOffset.y;y.style.transformOrigin=`${g*a}px ${v*a}px`,y.style.transform=`rotate(${f}deg)`;}for(let g of h.fragments)y.append(n.paintStoryFragment(t,g,{readOnly:true}));for(let g of y.querySelectorAll('[style*="pointer-events"]'))g.style.pointerEvents="none";s.append(y);}return s}var or=new Map([["image/svg+xml","SVG"],["image/tiff","TIFF"],["image/x-emf","EMF"],["image/x-wmf","WMF"]]),rr="Unknown",Re=new WeakMap,ke=new WeakMap,ir=256;function xn(t,e){let n=Re.get(t);if(n)return n;let o=new Map,i=new Map;return n=Object.freeze({urlForReady(r,a){let s=o.get(r.resourceKey);if(s)return s;let l;try{l=e.create(r,a);}catch(d){if(d instanceof Error&&d.message.startsWith("PaintImageUrlSource:"))return null;throw d}return o.set(r.resourceKey,l),l},imageFor(r,a,s){let l=i.get(r);if(l&&l.resourceKey===a)return l.element;let d=s.createElement("img");return i.size<ir&&i.set(r,{element:d,resourceKey:a,...l?.readyElement?{readyElement:l.readyElement}:{}}),d},imageForPending(r){return i.get(r)?.element??null},readyElementFor(r){return i.get(r)?.readyElement??null},rememberReadyElement(r,a){let s=i.get(r);s&&i.set(r,{...s,readyElement:a});},reconcile(r,a){for(let[s,l]of o)r.has(s)||(e.revoke(l),o.delete(s));for(let[s,l]of i)a.has(s)||(l.element.removeAttribute("src"),i.delete(s));},revokeAll(){for(let r of o.values())e.revoke(r);o.clear();for(let r of i.values())r.element.removeAttribute("src");i.clear();}}),Re.set(t,n),n}function Ge(t,e){return `${e.paintInstance??""}|${t.drawingNodeId}`}function Ra(t){Re.get(t)?.revokeAll(),Re.delete(t);}function X(t){return Number.isFinite(t)?String(t):"0"}function vn(t,e){if(t.length<3||e.width<=0||e.height<=0)return null;let n=[];for(let o of t){if(!Number.isFinite(o.x)||!Number.isFinite(o.y))return null;let i=(o.x-e.x)/e.width*100,r=(o.y-e.y)/e.height*100;n.push(`${X(i)}% ${X(r)}%`);}return `polygon(${n.join(", ")})`}function kn(t){let e=t.geometry.contentBounds;return Ke$1({transform:t.transform,contentWidth:e.width,contentHeight:e.height})}function Rn(t,e){let{crop:n}=t,o=Math.max(0,Math.min(1,n.left)),i=Math.max(0,Math.min(1,n.top)),r=Math.max(0,Math.min(1,n.right)),a=Math.max(0,Math.min(1,n.bottom)),s=Math.max(1e-4,1-o-r),l=Math.max(1e-4,1-i-a);return Object.freeze({width:`${X(1/s*100)}%`,height:`${X(1/l*100)}%`,left:`${X(-o/s*100)}%`,top:`${X(-i/l*100)}%`})}function ar(t,e){let{resource:n}=t;switch(n.kind){case "external":return e.externalResource;case "missing":return e.missingResource;case "pending":return e.pendingResource;case "unrenderable":switch(n.reason){case "unsupported-format":return e.unsupportedFormat(or.get(n.mime)??rr);case "non-picture-graphic":return e.nonPictureGraphic(t.placeholderGraphicKind??"graphic");case "signature-mismatch":return e.contentMismatch;case "decode-failed":return e.decodeFailed;case "resource-limit":return e.resourceLimit;default:return e.invalidResource}default:return e.invalidResource}}function F(t,e,n){let{accessibility:o}=e;o.hidden||(t.setAttribute("role",n?"link":"img"),o.label?t.setAttribute("aria-label",o.label):n||t.setAttribute("aria-hidden","true"));}function V(t,e,n,o){let i=o?.x??0,r=o?.y??0;t.style.position="absolute",t.style.left=`${(e.x-i)*n}px`,t.style.top=`${(e.y-r)*n}px`,t.style.width=`${e.width*n}px`,t.style.height=`${e.height*n}px`,t.style.boxSizing="border-box",t.style.overflow="hidden",t.style.pointerEvents="auto";}function Sn(t){let e=t.groupPicture?t.geometry.imageTransformCorners:void 0;if(!e||e.length===0)return t.geometry.contentBounds;let n=1/0,o=1/0,i=-1/0,r=-1/0;for(let a of e)n=Math.min(n,a.x),o=Math.min(o,a.y),i=Math.max(i,a.x),r=Math.max(r,a.y);return {x:n,y:o,width:i-n,height:r-o}}function sr(t,e,n,o,i){let r=t.paintBounds,a=Sn(t),s=Rn(t);return [o,n.scale,i?.x??0,i?.y??0,r.x,r.y,r.width,r.height,a.x,a.y,a.width,a.height,vn(t.geometry.clipPolygon??[],r)??"",_e(t.effects)??"",t.effects.bilevel??"",kn(t)??"",s.width,s.height,s.left,s.top,n.inertLinks?"":t.hyperlinkHref??"",t.accessibility.label??""].join("|")}function ie(t,e,n,o){let i=t.createElement("div");i.className="docx-drawing docx-drawing-placeholder",n.unbound||(i.dataset.drawingNodeId=e.drawingNodeId),V(i,e.paintBounds,n.scale,o);let r=t.createElement("div");r.className="docx-drawing-placeholder-card";let a=t.createElement("span");return a.className="docx-drawing-placeholder-label",a.textContent=ar(e,n.strings),r.append(a),i.append(r),e.hyperlinkHref&&!n.inertLinks?(i.dataset.docxDrawingLink=e.drawingNodeId,i.dataset.docxDrawingLinkKind="external",i.dataset.docxDrawingLinkHref=e.hyperlinkHref,i.setAttribute("tabindex","-1"),F(i,e,true)):F(i,e,false),i}function lr(t,e,n,o,i,r){let a=e.resource;if(a.kind!=="ready")return ie(t,e,n,r);let s=Ge(e,n),l=i?.readyElementFor?.(s)??t.createElement("div"),d=sr(e,a,n,o,r),c=!e.vectorShape;if(c&&ke.get(l)===d)return l;l.className="docx-drawing docx-drawing-ready",l.style.cssText="",n.unbound||(l.dataset.drawingNodeId=e.drawingNodeId),delete l.dataset.docxDrawingLink,delete l.dataset.docxDrawingLinkKind,delete l.dataset.docxDrawingLinkHref,l.removeAttribute("aria-hidden"),l.removeAttribute("aria-label"),l.removeAttribute("role"),l.removeAttribute("tabindex"),V(l,e.paintBounds,n.scale,r);let u=t.createElement("div");u.className="docx-drawing-image-frame",u.style.position="absolute";let p=Sn(e),h=e.paintBounds,y=vn(e.geometry.clipPolygon??[],e.groupPicture?p:h);y&&((e.groupPicture?u:l).style.clipPath=y),u.style.left=`${(p.x-h.x)*n.scale}px`,u.style.top=`${(p.y-h.y)*n.scale}px`,u.style.width=`${p.width*n.scale}px`,u.style.height=`${p.height*n.scale}px`;let f=_e(e.effects);f&&(u.style.filter=f);let g=t.createElement("div");g.className="docx-drawing-transform-stage",g.style.position="relative",g.style.width="100%",g.style.height="100%";let v=kn(e);v&&(g.style.transform=v,g.style.transformOrigin="0 0");let k=t.createElement("div");k.className="docx-drawing-crop-viewport",k.style.position="relative",k.style.width="100%",k.style.height="100%",k.style.overflow="hidden";let x=i?.imageFor?.(s,a.resourceKey,t)??t.createElement("img");x.className="docx-drawing-image",x.setAttribute("draggable","false"),x.getAttribute("src")!==o&&x.setAttribute("src",o),x.setAttribute("alt","");let E=Rn(e);if(x.style.position="absolute",x.style.width=E.width,x.style.height=E.height,x.style.left=E.left,x.style.top=E.top,x.style.maxWidth="none",x.style.maxHeight="none",k.append(x),g.append(k),u.append(g),l.replaceChildren(u),e.vectorShape){let z=Ue(t,e,n.scale),L=e.paintBounds;ze(l,z,L,N(e,L),n.scale),l.append(z);}return yn(t,l,u,e.effects.bilevel),e.hyperlinkHref&&!n.inertLinks?(l.dataset.docxDrawingLink=e.drawingNodeId,l.dataset.docxDrawingLinkKind="external",l.dataset.docxDrawingLinkHref=e.hyperlinkHref,l.setAttribute("tabindex","-1"),F(l,e,true)):F(l,e,false),i?.rememberReadyElement?.(s,l),c?ke.set(l,d):ke.delete(l),l}function dr(t,e,n,o,i){let r=t.createElement("div");r.className="docx-drawing docx-drawing-shape",n.unbound||(r.dataset.drawingNodeId=e.drawingNodeId);let a=e.paintBounds;V(r,a,n.scale,i);let s=Ue(t,e,n.scale);return ze(r,s,a,o,n.scale),r.append(s),e.hyperlinkHref&&!n.inertLinks?(r.dataset.docxDrawingLink=e.drawingNodeId,r.dataset.docxDrawingLinkKind="external",r.dataset.docxDrawingLinkHref=e.hyperlinkHref,r.setAttribute("tabindex","-1"),F(r,e,true)):F(r,e,false),r}function cr(t,e,n,o,i){let r=o.scale,a=t.createElement("div");a.className="docx-drawing docx-drawing-textbox",o.unbound||(a.dataset.drawingNodeId=e.drawingNodeId),a.setAttribute("contenteditable","false"),V(a,e.paintBounds,o.scale,i),a.style.overflow="hidden";let s=(e.x-e.paintBounds.x)*r,l=(e.y-e.paintBounds.y)*r;if(n.fillHex!==null||n.strokeHex!==null){let c=t.createElement("div");c.className="docx-drawing-textbox-box",c.style.position="absolute",c.style.left=`${s}px`,c.style.top=`${l}px`,c.style.width=`${e.width*r}px`,c.style.height=`${e.height*r}px`,c.style.boxSizing="border-box",n.fillHex!==null&&(c.style.backgroundColor=`#${n.fillHex}`),n.strokeHex!==null&&(c.style.border=`${Math.max(n.strokeWidthPt*r,.5)}px solid #${n.strokeHex}`),a.append(c);}let d=t.createElement("div");d.className="docx-drawing-textbox-content",d.style.position="absolute",d.style.left=`${s+n.contentOffset.x*r}px`,d.style.top=`${l+n.contentOffset.y*r}px`,d.style.width=`${n.contentWidth*r}px`,d.style.height=`${Math.max(0,n.contentHeight)*r}px`,d.style.overflow="hidden";for(let c of n.fragments)d.append(o.paintStoryFragment(t,c));for(let c of d.querySelectorAll("[data-paragraph-id]"))c.dataset.textboxParagraphId=c.dataset.paragraphId,delete c.dataset.paragraphId;return a.append(d),F(a,e,false),a}function ur(t,e,n){let o=n.revisionStyles,i=j(e.revisions,o?.authorSlots,o?.styles);if(!i){if(t.dataset.revisionKind===void 0)return;t.classList.remove("docx-drawing--revision","docx-drawing--revision-insertion","docx-drawing--revision-deletion"),delete t.dataset.revisionKind,delete t.dataset.revisionId,delete t.dataset.reviewAuthor,delete t.dataset.revisionDate,delete t.dataset.reviewAuthorSlot;return}let{attribution:r}=i;t.classList.add("docx-drawing--revision",i.deleted?"docx-drawing--revision-deletion":"docx-drawing--revision-insertion"),t.classList.remove(i.deleted?"docx-drawing--revision-insertion":"docx-drawing--revision-deletion"),t.dataset.revisionKind=r.kind,t.dataset.revisionId=r.id,r.author!==""?t.dataset.reviewAuthor=r.author:delete t.dataset.reviewAuthor,r.date!==void 0?t.dataset.revisionDate=r.date:delete t.dataset.revisionDate,o?t.dataset.reviewAuthorSlot=String((o.authorSlots.get(r.author)??0)%A):delete t.dataset.reviewAuthorSlot;}function wn(t,e,n,o,i){let r=yr(t,e,n,o,i);return r&&ur(r,e,n),r}function yr(t,e,n,o,i){if(e.accessibility.hidden)return null;let r=e.vectorShape?N(e,e.paintBounds):e.paintBounds;if(r.width<=0||r.height<=0)return null;if(e.textboxStory!==void 0&&n.paintStoryFragment!==void 0)return cr(t,e,e.textboxStory,n,i);if(e.groupTextboxStories&&!e.groupPicture&&!e.vectorShape){let d=t.createElement("div");return d.className="docx-drawing docx-drawing-group-frame",n.unbound||(d.dataset.drawingNodeId=e.drawingNodeId),V(d,e.paintBounds,n.scale,i),F(d,e,false),d}let{resource:a}=e,s=a.kind==="ready"&&n.imageUrlPort&&o?o.urlForReady(a.validatedHandle,a.mime):null;if(e.groupPicture&&a.kind!=="pending"&&!s)return ie(t,e,n,i);let l=e.groupPicture!==void 0&&s!==null;if(e.vectorShape&&e.vectorShape.subpathsEmu.length>0&&!l)return dr(t,e,n,r,i);if(a.kind==="ready")return !s||!o?ie(t,e,n,i):lr(t,e,n,s,o,i);if(a.kind==="pending"){let d=o?.readyElementFor?.(Ge(e,n))??o?.imageForPending?.(Ge(e,n))?.closest(".docx-drawing-ready");return d?(ke.delete(d),n.unbound||(d.dataset.drawingNodeId=e.drawingNodeId),V(d,e.paintBounds,n.scale,i),d):ie(t,e,n,i)}return ie(t,e,n,i)}function Mn(t,e,n,o,i){let r=[];for(let a of e.drawings??[]){let s=wn(t,a,n,o,i);s&&r.push(s);let l=je(t,a,n,i);l&&r.push(l);}return Object.freeze(r)}function En(t,e,n,o,i,r){let a=[];for(let s of e){if(Db(s)!==n)continue;let l=wn(t,s,o,i,r);l&&(l.dataset.drawingLayer=n,a.push(l));let d=je(t,s,o,r);d&&(d.dataset.drawingLayer=n,a.push(d));}return Object.freeze(a)}var mn=new WeakMap;function pr(t){let e=mn.get(t);if(e)return e;let n=[],o=[];Ba(t,({host:r})=>{(!("anchoredDrawings"in r)||(r.anchoredDrawings?.length??0)===0)&&ne(r.fragments).drawingFree||(Da(r,a=>{a.resource.kind==="ready"&&n.push(a.resource.resourceKey),o.push(`p${t.index}|${a.drawingNodeId}`);}),Fa(r,a=>{let s=a.marker?.picture;s?.resource.kind==="ready"&&n.push(s.resource.resourceKey);}));});let i=Object.freeze({resourceKeys:Object.freeze(n),elementKeys:Object.freeze(o)});return mn.set(t,i),i}var bn=new WeakMap;function Ln(t){let e=bn.get(t);if(e)return e;let n=new Set,o=new Set;for(let r of t.pages){let a=pr(r);for(let s of a.resourceKeys)n.add(s);for(let s of a.elementKeys)o.add(s);}let i=Object.freeze({resourceKeys:n,elementKeys:o});return bn.set(t,i),i}function Pn(t){return Ln(t).resourceKeys}function Tn(t){return Ln(t).elementKeys}function An(t){return [t.missingResource,t.externalResource,t.invalidResource,t.contentMismatch,t.decodeFailed,t.resourceLimit,t.pendingResource,t.unsupportedFormat("probe"),t.nonPictureGraphic("probe")].join("\0")}var We=Object.freeze({unsupportedFormat:t=>`Unsupported image format (${t})`,nonPictureGraphic:t=>`Unsupported graphic (${t})`,missingResource:"Image missing",externalResource:"External image not loaded",invalidResource:"Invalid image",contentMismatch:"Image content does not match its type",decodeFailed:"Image could not be decoded",resourceLimit:"Image exceeds size limits",pendingResource:"Loading image"});function Sa(t){return Object.freeze({unsupportedFormat:e=>t("image.unsupportedFormat",{format:e}),nonPictureGraphic:e=>t("image.nonPictureGraphic",{kind:e}),missingResource:t("image.missingResource"),externalResource:t("image.externalResource"),invalidResource:t("image.invalidResource"),contentMismatch:t("image.contentMismatch"),decodeFailed:t("image.decodeFailed"),resourceLimit:t("image.resourceLimit"),pendingResource:t("image.pendingResource")})}function hr(t,e,n){t.style.position="absolute",t.style.left=`${e.x*n}px`,t.style.top=`${e.y*n}px`,t.style.width=`${e.width*n}px`,t.style.height=`${e.height*n}px`;}function Xe(t,e,n,o){let i=t.createElement("span");return i.className=e,i.setAttribute("aria-hidden","true"),i.style.position="absolute",i.style.display="block",i.style.left=`${n.x*o}px`,i.style.top=`${n.y*o}px`,i.style.width=`${n.width*o}px`,i.style.height=`${n.height*o}px`,i.style.backgroundColor="currentColor",i.style.pointerEvents="none",i}function w(t,e,n,o,i=0,r=0,a=[],s){let l=i+n.box.x,d=r+n.box.y,c=[...a,n.kind];switch(n.kind){case "text":case "fallback":{let u=t.createElement("span");u.className=["docx-equation-node",...c.map(p=>`docx-equation-${p}`)].join(" "),hr(u,{x:l,y:d,width:n.box.width,height:n.box.height},o),u.textContent=n.text,u.style.display="block",n.runStyle&&s&&(u.style.fontWeight=n.runStyle.bold?"bold":"normal",u.style.fontStyle=n.runStyle.italic?"italic":"normal",s(u,n.runStyle)),u.style.fontSize=`${n.fontSizePt*o}px`,u.style.lineHeight=`${n.box.height*o}px`,u.style.whiteSpace="pre",e.append(u);break}case "row":for(let u of n.items)w(t,e,u,o,l,d,c,s);break;case "fraction":w(t,e,n.numerator,o,l,d,c,s),e.append(Xe(t,"docx-equation-fraction-bar",{...n.bar,x:l+n.bar.x,y:d+n.bar.y},o)),w(t,e,n.denominator,o,l,d,c,s);break;case "radical":w(t,e,n.sign,o,l,d,c,s),n.degree&&w(t,e,n.degree,o,l,d,c,s),e.append(Xe(t,"docx-equation-radical-bar",{...n.bar,x:l+n.bar.x,y:d+n.bar.y},o)),w(t,e,n.radicand,o,l,d,c,s);break;case "bar":w(t,e,n.body,o,l,d,c,s),e.append(Xe(t,"docx-equation-bar",{...n.bar,x:l+n.bar.x,y:d+n.bar.y},o));break;case "script":w(t,e,n.base,o,l,d,c,s),n.subscript&&w(t,e,n.subscript,o,l,d,c,s),n.superscript&&w(t,e,n.superscript,o,l,d,c,s);break;case "nary":w(t,e,n.operator,o,l,d,c,s),n.lowerLimit&&w(t,e,n.lowerLimit,o,l,d,c,s),n.upperLimit&&w(t,e,n.upperLimit,o,l,d,c,s),w(t,e,n.body,o,l,d,c,s);break}}function Bn(t,e,n,o,i){let r=n.geometry;e.className="layout-run docx-equation",e.dataset.docxEquation=n.sourceNodeId,e.setAttribute("contenteditable","false"),e.setAttribute("role","math"),n.fallbackText&&e.setAttribute("aria-label",n.fallbackText),e.style.position="relative",e.style.display="inline-block",e.style.width=`${r.box.width*o}px`,e.style.height=`${r.box.height*o}px`,e.style.lineHeight="0",e.style.pointerEvents="auto",e.style.userSelect="none",e.style.verticalAlign=`${-(r.box.height-r.baseline)*o}px`;let a=t.createDocumentFragment();w(t,a,r,o,0,0,[],i),e.append(a);}function Cn(t,e,n,o){if(n.glyphOffsetPt!==void 0){let s=n.style.horizontalScalePercent/100,l=n.box.width*o;e.style.width=`${l/s}px`,s!==1&&(e.style.marginRight=`${l-l/s}px`);let d=t.createElement("span");if(d.dataset.docxGlyphOffset="",s!==1&&(d.style.letterSpacing=`${n.style.characterSpacingPt*o/s}px`),n.glyphOffsetPt){d.dataset.docxShiftedInk="",d.style.setProperty("forced-color-adjust","preserve-parent-color"),d.style.setProperty("-webkit-text-fill-color","transparent");let c=`${n.glyphOffsetPt*o/s}px`;d.style.setProperty("--docx-glyph-ink-offset",c),e.style.color&&e.style.color!=="inherit"&&d.style.setProperty("--docx-glyph-ink-color",e.style.color),d.style.textShadow=`${c} 0 currentColor`;}return e.append(d),d}let i=n.lineEndWhitespace===true;(n.style.horizontalScalePercent!==100||n.text===" "||i)&&(e.style.width=`${n.box.width*o}px`);let r=n.style.shaping!==void 0&&n.style.horizontalScalePercent!==100;if(!i&&!r||(i&&(e.style.clipPath="inset(-1em 0)"),n.style.horizontalScalePercent===100))return e;let a=t.createElement("span");if(a.dataset.docxClippedFill="",a.style.display="inline-block",a.style.transform=e.style.transform,a.style.transformOrigin=e.style.transformOrigin,r){let s=n.style.horizontalScalePercent/100;a.style.width=`${n.box.width*o/s}px`,a.style.letterSpacing=`${n.style.characterSpacingPt*o/s}px`,n.style.shaping?.wordSpacingPt&&(a.style.wordSpacing=`${n.style.shaping.wordSpacingPt*o/s}px`),a.style.direction=n.style.shaping?.direction??"ltr",a.style.transformOrigin=a.style.direction==="rtl"?"right":"left";}return a.style.textDecorationLine=e.style.textDecorationLine,a.style.textDecorationStyle=e.style.textDecorationStyle,a.style.textDecorationColor=e.style.textDecorationColor,a.style.textDecorationThickness=e.style.textDecorationThickness,a.style.textUnderlineOffset=e.style.textUnderlineOffset,e.style.removeProperty("transform"),e.style.removeProperty("transform-origin"),e.style.removeProperty("text-decoration-line"),e.style.removeProperty("text-decoration-style"),e.style.removeProperty("text-decoration-color"),e.style.removeProperty("text-decoration-thickness"),e.style.removeProperty("text-underline-offset"),e.append(a),a}function $n(t,e,n){let o=e.textOutline;if(!o||!Number.isFinite(n)||n<=0||!Number.isFinite(o.widthPt)||o.widthPt<=0||o.widthPt>1584||!/^[0-9a-f]{6}$/i.test(o.color))return;let i=o.widthPt*n;Number.isFinite(i)&&(t.setProperty("-webkit-text-stroke-width",`${i}px`),t.setProperty("-webkit-text-stroke-color",`#${o.color}`));}var fr=/^[0-9A-Fa-f]{6}$/;function gr(t,e,n){let o=t.createElement("div");o.className=`docx-page-border docx-page-border-${e.side}`,o.setAttribute("aria-hidden","true"),o.style.position="absolute";let i=e.side==="left"||e.side==="right",r=(i?e.box.width:e.box.height)*n,a=ge(e.edge.val)?r:Math.max(1,r),s=a-r;o.style.left=`${e.box.x*n-(e.side==="right"?s:0)}px`,o.style.top=`${e.box.y*n-(e.side==="bottom"?s:0)}px`,o.style.width=i?`${a}px`:`${e.box.width*n}px`,o.style.height=i?`${e.box.height*n}px`:`${a}px`;let l=e.edge.color&&fr.test(e.edge.color)?e.edge.color:"000000";return o.style.backgroundColor=`#${l}`,W(o,e.edge.val,l,i,a,n),o}function Hn(t,e,n){let o=t.createElement("div");o.className="docx-page-borders",o.setAttribute("aria-hidden","true"),o.setAttribute("contenteditable","false"),o.style.position="absolute",o.style.inset="0",o.style.pointerEvents="none";for(let i of e.strokes)o.append(gr(t,i,n));return o}var mr=/^[0-9A-Fa-f]{6}$/;function br(t){switch(t){case "dashed":return "dashed";case "dotted":return "dotted";case "double":case "triple":return "solid";default:return "solid"}}function qe(t){return t&&mr.test(t)?t:"000000"}function Ve(t,e){let n=t.createElement("div");return n.className=e,n.setAttribute("aria-hidden","true"),n.setAttribute("contenteditable","false"),n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.right="0",n.style.bottom="0",n.style.overflow="visible",n.style.pointerEvents="none",n.style.boxSizing="border-box",n}function xr(t,e,n,o){if(!n)return;let i=`#${qe(n.color)}`,r=`${Math.max(0,n.widthPt*o)}px`;if(t.style[`border${e}Width`]=r,t.style[`border${e}Color`]=i,n.style==="double"||n.style==="triple"){t.style[`border${e}Style`]="none";return}t.style[`border${e}Style`]=br(n.style);}function Ye(t,e,n,o,i){let r=t.createElement("div");if(r.className=i,r.dataset.edge=n.side,r.dataset.stroke=n.role,r.style.position="absolute",r.style.left=`${n.x*o}px`,r.style.top=`${n.y*o}px`,r.style.width=`${n.width*o}px`,r.style.height=`${n.height*o}px`,r.style.pointerEvents="none",n.cssStyle==="solid")r.style.backgroundColor=`#${qe(n.color)}`;else {let a=n.side==="top"||n.side==="bottom";r.style.boxSizing="border-box",r.style[a?"borderTop":"borderLeft"]=`${(a?n.height:n.width)*o}px ${n.cssStyle} #${qe(n.color)}`;}return e.append(r),r}function vr(t){let e=new Set;for(let n of t)e.add(`${n.side}\0${n.role}`);return e}function kr(t,e,n,o){let i=vr(n),r=h=>i.has(`${h}\0middle`),a=Ve(t,"docx-table-border-double"),s=Ve(t,"docx-table-border-triple"),l=Ve(t,"docx-table-border-edge");for(let h of [a,s,l])h.style.zIndex="1";let d=false,c=false,u=false,p=[];for(let h of n){if(h.role==="edge"){u=true,p.push(Ye(t,l,h,o,"docx-table-border-edge-stroke"));continue}if(r(h.side)){c=true,p.push(Ye(t,s,h,o,"docx-table-border-triple-stroke"));continue}(h.role==="outer"||h.role==="inner")&&(d=true,p.push(Ye(t,a,h,o,"docx-table-border-double-stroke")));}return d&&e.append(a),c&&e.append(s),u&&e.append(l),p}function Fn(t,e,n,o){let i=new Set((n?.strokes??[]).map(r=>r.side));for(let r of ["top","right","bottom","left"]){let a=`${r[0].toUpperCase()}${r.slice(1)}`;xr(e,a,n?.[r],o),i.has(r)&&(e.style[`border${a}Style`]="none");}if(n?.strokes&&n.strokes.length>0)return kr(t,e,n.strokes,o)}function Dn(t,e,n){e.revisionKind&&(n&&(t.style.backgroundColor="transparent"),t.classList.add("docx-table-row--revision",e.revisionKind==="insert"?"layout-revision-ins":"layout-revision-del"),t.dataset.revisionKind=e.revisionKind,e.revisionId!==void 0&&(t.dataset.revisionId=e.revisionId),e.revisionAuthor!==void 0&&(t.dataset.reviewAuthor=e.revisionAuthor),e.revisionDate!==void 0&&(t.dataset.revisionDate=e.revisionDate));}function In(t,e,n,o){if(e.textDirection!=="btLr")return o;let i=t.createElement("div");return i.className="docx-table-cell-content-btlr",i.style.position="absolute",i.style.left="0",i.style.top="0",i.style.width=`${e.box.height*n}px`,i.style.height=`${e.box.width*n}px`,i.style.transformOrigin="0 0",i.style.transform=`translateY(${e.box.height*n}px) rotate(-90deg)`,o.append(i),i}var Ze="when-selected",On=new WeakMap,Nn=0;function Rr(t){let e=On.get(t);return e||(Nn+=1,e=`alias${Nn}`,On.set(t,e)),e}function Vn(t){return {...t,drawingStrings:t.drawingStrings??We,urlRegistry:t.urlRegistry??null,changeBars:t.changeBars??"none",changeBarsToggle:t.changeBarsToggle??false}}function Sr(t){let e={...t,inertLinks:true,tabLeaderOriginXPt:0};return Object.freeze({scale:t.scale,strings:t.drawingStrings,...t.imageUrlPort?{imageUrlPort:t.imageUrlPort}:{},...t.inertLinks?{inertLinks:true}:{},...t.paintInstance?{paintInstance:t.paintInstance}:{},...t.revisionStyles?{revisionStyles:t.revisionStyles}:{},...t.unbound?{unbound:true}:{},paintStoryFragment:(n,o,i)=>{let r=i?.readOnly?{...e,unbound:true}:e;return o.kind==="table"?K(n,o,r):_(n,o,r)}})}function Yn(t){return Object.freeze({ctx:Sr(t),urlRegistry:t.urlRegistry})}function _n(t,e,n,o,i,r){qn(t,e,Aa(n),o,i,r);}function qn(t,e,n,o,i,r,a=true,s){if(n.length===0)return;let l=Yn(o),d=t.createElement("div");d.className=r==="behind"?"docx-drawing-layer docx-drawing-layer-behind":"docx-drawing-layer docx-drawing-layer-front",d.style.position="absolute",d.style.inset="0",d.style.pointerEvents="none",s&&(d.dataset.docxHfFront=s);for(let c of En(t,n,r,l.ctx,l.urlRegistry,i)){if(c.style.pointerEvents=a?"auto":"none",!a)for(let u of c.querySelectorAll(".docx-drawing"))u.style.pointerEvents="none";d.append(c);}d.childElementCount>0&&e.append(d);}var q=/^[0-9A-Fa-f]{6}$/,Kn=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u,wr=new Map(Object.entries({single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"})),Mr=new Map(Object.entries({black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"}));function Er(t){return t.doubleStrike?"double":t.strike?"single":"none"}function Lr(t){return t==="thick"||t.endsWith("Heavy")}function Zn(t){if(!t.underline)return null;let e=t.underline.color&&q.test(t.underline.color)?t.underline.color:null;return {cssStyle:wr.get(t.underline.variant)??"solid",color:e,heavy:Lr(t.underline.variant)}}function Jn(t,e,n,o){t.textDecorationLine=e,t.textDecorationStyle=n,o.color&&(t.textDecorationColor=`#${o.color}`),o.heavy&&(t.textDecorationThickness=`max(${2*o.scale}px, 0.12em)`);}function zn(t,e,n){e!=="none"&&Jn(t,"line-through",e==="double"?"double":"solid",{scale:n});}function Un(t,e,n){Jn(t,"underline",e.cssStyle,{color:e.color,heavy:e.heavy,scale:n});}function Pr(t,e,n){let o=e.color?`#${e.color}`:"currentColor";t.borderBottomWidth=`${(e.heavy?2:1)*n}px`,t.borderBottomStyle=e.cssStyle==="wavy"?"solid":e.cssStyle,t.borderBottomColor=o;}function Y(t,e,n){let o=t.style,i=n.scale;$n(o,e,i);let r=fa(e);o.fontSize=`${e.fontSizePt*r*i}px`,e.bold&&(o.fontWeight="bold"),e.italic&&(o.fontStyle="italic");let a=e.fontFamily&&Kn.test(e.fontFamily)?e.fontFamily:n.defaultFontFamily&&Kn.test(n.defaultFontFamily)?n.defaultFontFamily:null;if(a){let d=n.fontAlias?.(a);o.fontFamily=d?`"${d}", "${a}", ${O}`:`"${a}", ${O}`;}e.color&&q.test(e.color)&&(o.color=`#${e.color}`);let s=e.highlight?Mr.get(e.highlight):void 0;s?(o.backgroundColor=s,t.dataset.highlight=e.highlight??""):e.shading&&q.test(e.shading)&&(o.backgroundColor=`#${e.shading}`),e.caps&&(o.textTransform="uppercase"),o.fontKerning=dd(e)?"normal":"none",e.smallCaps&&(o.fontVariant="small-caps");let l=ea(e);l!==0&&(o.position="relative",o.top=`${-l*i}px`),e.characterSpacingPt!==0&&(o.letterSpacing=`${e.characterSpacingPt*i}px`),e.horizontalScalePercent!==100&&(o.transformOrigin="left",o.transform=`scaleX(${e.horizontalScalePercent/100})`);}function Qn(t,e,n,o,i){let r=n===" "?null:Zn(o),a=Er(o),s=e;if(r&&a!=="none"){let l=t.createElement("span");l.dataset.docxDeco="underline",Un(l.style,r,i);let d=t.createElement("span");d.dataset.docxDeco="strike",zn(d.style,a,i),l.append(d),e.append(l),s=d;}else r?Un(e.style,r,i):a!=="none"&&zn(e.style,a,i);s.textContent=n;}function D(t,e,n,o){let i=t.createElement(e);return i.style.position="absolute",i.style.left=`${n.x*o}px`,i.style.top=`${n.y*o}px`,i.style.width=`${n.width*o}px`,i.style.height=`${n.height*o}px`,i}function Tr(t,e,n){let o=e.fieldAtom;!o||(t.dataset.fieldAtom=o.formField?"form":"field",o.resultStart!==void 0&&o.resultEnd!==void 0&&(t.dataset.fieldResultStart=String(o.resultStart),t.dataset.fieldResultEnd=String(o.resultEnd)),!(o.formField?n.shadeFormFields!==false:(n.fieldShading??Ze)!=="never"))||(t.classList.add("docx-field-atom"),(o.formField||(n.fieldShading??Ze)==="always")&&t.classList.add("docx-field-atom--shaded"));}function Ar(t,e,n,o,i){let r=t.createElement("span"),a=ua(e.style,e.fontSlot);if(e.equation)return n.unbound||(r.dataset.paragraphId=e.range.paragraphId,r.dataset.start=String(e.range.start),r.dataset.end=String(e.range.end)),Y(r,a,n),Bn(t,r,e.equation,n.scale,(l,d)=>Y(l,d,n)),Fe(r,e,n),r;r.className="layout-run layout-run-text",r.style.display="inline-block",r.style.verticalAlign="baseline",r.style.boxSizing="border-box",r.style.height=`${o*n.scale}px`,r.style.paddingTop=`${i*n.scale}px`,r.style.lineHeight=`${(o-i)*n.scale}px`,e.range.end>e.range.start?n.unbound||(r.dataset.paragraphId=e.range.paragraphId,r.dataset.start=String(e.range.start),r.dataset.end=String(e.range.end)):(r.setAttribute("aria-hidden","true"),r.contentEditable="false"),Y(r,a,n),Tr(r,e,n),Fe(r,e,n);let s=Cn(t,r,e,n.scale);if(e.text===" "){r.style.overflow="hidden",r.style.verticalAlign="top";let l=Zn(e.style);l&&e.tabLeader!=="underscore"&&(r.dataset.docxTabUnderline="",Pr(r.style,l,n.scale));}return Qn(t,s,fd(e),e.style,n.scale),zt(r,e,n.scale),Kt(r,e),e.projected&&(r.dataset.docxField="",r.setAttribute("contenteditable","false"),e.noteNav?(r.style.userSelect="none",e.noteNav.direction==="to-note"?(r.dataset.docxNoteRef="",r.dataset.docxNoteScope=e.noteNav.scopeId,e.text.length>0&&r.setAttribute("aria-description",e.text)):(r.dataset.docxNoteMarkBack="",r.dataset.docxNoteScope=e.noteNav.scopeId)):e.fieldAtom?.formControl?(r.style.userSelect="none",r.style.cursor="pointer"):(r.style.pointerEvents="none",r.style.userSelect="none")),r}function jn(t,e,n){let o=t.createElement("a");return o.className="docx-hyperlink",o.style.cursor=!n.inertLinks&&e.href?"pointer":"default",o.dataset.docxLink=e.id,o.dataset.docxLinkKind=e.kind,o.setAttribute("tabindex","-1"),!n.inertLinks&&e.href&&(o.setAttribute("href",e.href),e.kind==="external"&&o.setAttribute("rel","noopener noreferrer")),e.tooltip&&o.setAttribute("title",e.tooltip),o.style.display="inline-block",o.style.verticalAlign="baseline",o.style.textDecoration="none",o.style.color="inherit",o}function Br(t,e,n,o=false,i=$$1){let r=n.scale,a=t.createElement("div");a.className="docx-line layout-line",a.dataset.lineId=e.id,n.unbound||(a.dataset.paragraphId=e.range.paragraphId),a.style.position="absolute",a.style.top=`${e.box.y*r}px`,a.style.left=`${e.contentX*r}px`,a.style.height=`${e.box.height*r}px`,a.style.fontSize="0",a.style.whiteSpace="pre",a.style.setProperty("text-decoration-skip-ink","none"),a.style.setProperty("text-decoration-skip-spaces","none"),a.style.overflow="visible";let s=e.leading??0,l=Math.min(Math.max(s,...e.spans.map(m=>m.box.height+s),e.spans.length===0?e.box.height-(e.trailingSpacing??0):0),e.box.height),d=Math.max(0,e.box.height-l);a.style.boxSizing="border-box",a.style.paddingBottom=`${d*r}px`,a.style.lineHeight=`${(e.box.height-d)*r}px`;let c=null,u=null,p=null,h=new Map;for(let[m,b]of La(e).entries())h.set(b.paragraphId,m);let y=m=>h.get(m)??0,f=[...e.drawings??[]].sort((m,b)=>y(m.paragraphId)-y(b.paragraphId)||m.start-b.start),g=0,v=e.spans.some(m=>m.style.shaping!==void 0)||(e.drawings??[]).some(Dd),k=0,x=e.contentX,E=(m,b)=>{for(;g<f.length&&(y(f[g].paragraphId)<y(m)||y(f[g].paragraphId)===y(m)&&f[g].start<b);){let R=f[g],P=v?Math.max(0,R.advanceEnd-R.advanceStart):Math.max(0,R.advanceEnd-x);x=Math.max(x,R.advanceEnd);let S=t.createElement("span");S.className="docx-inline-drawing-advance",S.dataset.docxMarker="",n.unbound||(S.dataset.drawingParagraphId=R.paragraphId,S.dataset.drawingStart=String(R.start)),S.setAttribute("contenteditable","false"),S.setAttribute("aria-hidden","true"),S.style.display="inline-block",S.style.width=`${P*r}px`,S.style.height=`${R.baselineOffset*r}px`,S.style.lineHeight="0",S.style.pointerEvents="none",S.style.verticalAlign="baseline",a.append(S),k+=P,g+=1,c=null,u=null;}},z=m=>{let b=m.wrapAdvanceBefore??0;if(b<=.001)return;let R=t.createElement("span");R.className="docx-wrap-advance",R.dataset.docxMarker="",R.setAttribute("contenteditable","false"),R.setAttribute("aria-hidden","true"),R.style.display="inline-block",R.style.width=`${b*r}px`,R.style.height="0",R.style.lineHeight="0",R.style.pointerEvents="none",R.style.verticalAlign="baseline",a.append(R),c=null,u=null;},L=0,Z=false;for(let[m,b]of e.spans.entries()){let R=g;E(b.range.paragraphId,b.range.start),v||z(b);let P=!v&&g>R?b.box.x-x-(b.wrapAdvanceBefore??0):0;x=Math.max(x,b.box.x+b.box.width);let S=Math.min(b.box.height+s,e.box.height),M=b.noteSeparator?Nt(t,b,e,r):Ar(t,b,n,S,s);v&&(M.style.position="relative",M.style.left=`${(b.box.x-e.contentX-k)*r}px`,M.style.width||(M.style.width=`${b.box.width*r}px`),M.style.direction=b.style.shaping?.direction??"ltr",M.style.unicodeBidi="isolate",b.style.shaping?.wordSpacingPt&&(M.style.wordSpacing=`${b.style.shaping.wordSpacingPt*r}px`),k+=b.box.width);let J=L>0&&!Z?L:P;J>.001&&(M.style.marginLeft=`${J*r}px`);let et=e.spans[m+1],Se=v?0:eo(e,m+1,y);Z=Se>0&&et!==void 0&&$r(b,et),Z&&(M.style.wordSpacing=`${Se*r}px`),L=Se;let N=b.link;if(!N){c=null,u=null,p=null,a.append(M);continue}if(b.fieldAtom){let tt=Je(b);c!==null&&u===N.id&&p===tt||(c=jn(t,N,n),u=N.id,p=tt,a.append(c)),c.append(M);continue}(!c||u!==N.id||p!==null)&&(c=jn(t,N,n),u=N.id,p=null,a.append(c)),c.append(M);}E(La(e)[La(e).length-1]?.paragraphId??e.range.paragraphId,Number.POSITIVE_INFINITY),It(a,e,r,i,m=>Y(a,m,n));let I=Object.freeze({x:e.contentX,y:e.box.y,width:e.box.width,height:e.box.height});_t(t,a,e,r),n.showParagraphMarks&&e.manualBreakAfter&&Et(t,e,a,r,n.revisionStyles,o);let O=Yn(Vn(n));if(e.drawings&&e.drawings.length>0)for(let m of Mn(t,e,O.ctx,O.urlRegistry,I))a.append(m);return a}function eo(t,e,n){if(e<=0||e>=t.spans.length)return 0;let o=t.spans[e-1],i=t.spans[e],r=n(o.range.paragraphId),a=n(i.range.paragraphId);if(t.drawings?.some(d=>{let c=n(d.paragraphId),u=c>r||c===r&&d.start>=o.range.start,p=c<a||c===a&&d.start<i.range.start;return u&&p}))return 0;let l=i.box.x-(o.box.x+o.box.width)-(i.wrapAdvanceBefore??0);return l>.001?l:0}var Cr=/[\t\n\r \u00A0\u1361\u{10100}-\u{10102}\u{1039F}\u{1091F}]/u;function $r(t,e){return !t.text.endsWith(" ")||t.style.horizontalScalePercent!==100||!Hr(t,e)||(e.wrapAdvanceBefore??0)>.001?false:!Cr.test(t.text.slice(0,-1))}function Hr(t,e){return !t.link&&!e.link?true:!t.link||!e.link||t.link.id!==e.link.id||!!t.fieldAtom!=!!e.fieldAtom?false:!t.fieldAtom||Je(t)===Je(e)}function Je(t){return t.fieldAtom?.resultStart??t.range.start}function _(t,e,n){let o=n.scale,i=D(t,"div",e.box,o);i.className="docx-paragraph-fragment layout-paragraph",e.clipToBox&&(i.style.overflow="hidden"),n.unbound||(i.dataset.paragraphId=e.paragraphId),i.dataset.fragmentIndex=String(e.fragmentIndex),n.unbound||De(i,e),n.readOnlyParagraphIds?.has(e.paragraphId)&&(i.classList.add("docx-generated-region"),i.dataset.docxReadOnly="",i.setAttribute("contenteditable","false")),n.emptyTocPlaceholderIds?.has(e.paragraphId)&&(i.classList.add("docx-toc-empty-placeholder"),i.dataset.docxTocEmpty=""),e.shading&&q.test(e.shading)&&e.shadingBox&&i.append(Ir(t,e,o)),e.marker&&i.append(Fr(t,e,n));for(let a of e.lines)for(let s of a.spans){if(!s.tabLeader)continue;let l=Dr(t,e,a,s,n);l&&i.append(l);}let r=[];for(let a of e.lines){let s=Br(t,a,n.revisionMarkup&&hb(e.props)?{...n,paragraphFormatRevision:hb(e.props)}:n,td(e.props),e.emptyParagraphStyle);e.markFormatRevision&&a===e.lines[e.lines.length-1]&&De(s,e,true),s.style.top=`${(a.box.y-e.box.y)*o}px`,s.style.left=`${(a.contentX-e.box.x)*o}px`,i.append(s),r.push(s);}if(Xt(t,e,r,n,o),e.borders)for(let a of e.borders)i.append(Gn(t,e,a,o));else e.bottomBorder&&i.append(Gn(t,e,{side:"bottom",edge:e.bottomBorder.edge,box:e.bottomBorder.box},o));return i}function Fr(t,e,n){let o=e.marker,i=n.scale,r=Ot(t,e,Vn(n));if(r)return r;let a=e.lines[0]?.leading??0,s=D(t,"span",o.box,i);s.className="docx-list-marker",s.dataset.docxMarker="",s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.left=`${(o.box.x-e.box.x)*i}px`,s.style.top=`${(o.box.y-e.box.y)*i}px`,s.style.display="block",s.style.overflow="visible",s.style.whiteSpace="pre";let l=e.lines[0],d=l?Math.max(a,...l.spans.map(h=>h.box.height+a),l.spans.length===0?l.box.height-(l.trailingSpacing??0):0):o.box.height,c=Math.min(d,o.box.height),u=Math.max(0,o.box.height-c);s.style.fontSize="0",s.style.boxSizing="border-box",s.style.paddingBottom=`${u*i}px`,s.style.lineHeight=`${c*i}px`;let p=t.createElement("span");return p.style.display="inline-block",p.style.verticalAlign="baseline",p.style.boxSizing="border-box",p.style.height=`${c*i}px`,p.style.paddingTop=`${a*i}px`,p.style.lineHeight=`${(c-a)*i}px`,Y(p,o.style,n),o.pieces&&(p.dir="rtl"),Qn(t,p,o.text,o.style,i),s.append(p),s}function Dr(t,e,n,o,i){let r=o.tabLeader?ub.get(o.tabLeader):void 0;if(!r||o.box.width<=0)return null;let a=i.scale,s=t.createElement("div");s.className="docx-tab-leader",s.dataset.docxTabLeader="",s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",o.tabLeader==="underscore"&&(s.style.zIndex="1"),s.style.left=`${(o.box.x-e.box.x)*a}px`,s.style.top=`${(n.box.y-e.box.y)*a}px`,s.style.width=`${o.box.width*a}px`,s.style.height=`${n.box.height*a}px`,s.style.overflow="hidden",s.style.whiteSpace="pre",s.style.pointerEvents="none",s.style.userSelect="none";let l=n.leading??0,d=Math.min(o.box.height+l,n.box.height),c=Math.max(0,n.box.height-d);s.style.fontSize="0",s.style.boxSizing="border-box",s.style.paddingBottom=`${c*a}px`,s.style.lineHeight=`${(n.box.height-c)*a}px`;let u=t.createElement("span");u.style.display="inline-block",u.style.verticalAlign="baseline",Y(u,o.style,i),u.style.boxSizing="border-box",u.style.height=`${d*a}px`,u.style.paddingTop=`${l*a}px`,u.style.lineHeight=`${(d-l)*a}px`,o.tabLeader==="heavy"&&(u.style.fontWeight="bold");let p=o.tabLeaderAdvancePt&&o.tabLeaderAdvancePt>0?o.tabLeaderAdvancePt:Math.max(.5,o.style.fontSizePt*.2),h=na((i.tabLeaderOriginXPt??0)+o.box.x,o.box.width,p);return u.style.marginLeft=`${h.offsetPt*a}px`,u.textContent=r.repeat(h.count),u.style.letterSpacing="0",s.append(u),s}function Ir(t,e,n){let o=e.shadingBox,i=D(t,"div",o,n);return i.className="docx-paragraph-shading",i.setAttribute("aria-hidden","true"),i.style.left=`${(o.x-e.box.x)*n}px`,i.style.top=`${(o.y-e.box.y)*n}px`,i.style.backgroundColor=`#${e.shading}`,i}function Gn(t,e,n,o){let i=D(t,"div",n.box,o);i.className=`docx-paragraph-border docx-paragraph-border-${n.side}`,i.setAttribute("aria-hidden","true");let r=(n.box.x-e.box.x)*o,a=(n.box.y-e.box.y)*o,s=n.side==="left"||n.side==="right"||n.side==="bar",l=(s?n.box.width:n.box.height)*o,c=ge(n.edge.val)?l:Math.max(1,l);i.style.left=`${n.side==="right"?r-(c-l):r}px`,i.style.top=`${n.side==="bottom"?a-(c-l):a}px`,s?i.style.width=`${c}px`:i.style.height=`${c}px`;let u=n.edge.color&&q.test(n.edge.color)?n.edge.color:"000000";return i.style.backgroundColor=`#${u}`,W(i,n.edge.val,u,s,c,o),i}function to(t,e,n,o){let i=o.scale,r=D(t,"div",e.box,i);if(r.className="docx-table-cell",r.style.left=`${(e.box.x-n.x)*i}px`,r.style.top=`${(e.box.y-n.y)*i}px`,r.style.boxSizing="border-box",r.style.overflow="visible",r.dataset.cellId=e.id,r.dataset.gridColumn=String(e.gridColumn),r.dataset.gridSpan=String(e.gridSpan),e.rowSpan&&e.rowSpan>1&&(r.dataset.rowSpan=String(e.rowSpan)),e.paintInert||e.vMergeContinue)return r.dataset.vMergeContinue="true",r.style.border="none",r.style.backgroundColor="transparent",$e(r,e,r,void 0,[]),r;r.style.border="none";let a=Fn(t,r,e.borders,i);if(e.shading&&q.test(e.shading)&&(r.style.backgroundColor=`#${e.shading}`),e.revisionShading&&o.revisionMarkup){let d=o.revisionMarkup.cells[e.revisionShading];if(r.dataset.revisionCell=e.revisionShading,d!=="none"){let c=e.revisionShadingAuthor??"";r.style.backgroundColor=d==="byAuthor"?o.revisionStyles?.styles.get(c)?.color??B(o.revisionCellStyles?.authorSlots.get(c)??0):`var(--doc-revision-color-${d})`;}}let s=In(t,e,i,r),l=[];for(let d of e.blocks){let c=d.kind==="table"?K(t,d,o):_(t,d,o);c.style.left=`${(d.box.x-e.box.x)*i}px`,c.style.top=`${(d.box.y-e.box.y)*i}px`,s.append(c),l.push(c);}return $e(r,e,s,a,l),r}function Wn(t,e,n,o){let i=o.scale,r=D(t,"div",e.box,i);r.className="docx-table-row",Dn(r,e,!!o.revisionMarkup),r.dataset.rowId=e.id,e.isHeaderRepeat&&(r.dataset.headerRepeat="true"),r.style.left=`${(e.box.x-n.box.x)*i}px`,r.style.top=`${(e.box.y-n.box.y)*i}px`,r.style.overflow="visible";for(let a of e.cells)r.append(to(t,a,e.box,o));return r}function K(t,e,n,o){let i=o&&Dt(o,e,{scale:n.scale,showParagraphMarks:n.showParagraphMarks===true,row:l=>Wn(t,l,e,n),cell:(l,d)=>to(t,l,d,n),block:(l,d)=>l.kind==="table"?K(t,l,n,d):_(t,l,n),gapOf:(l,d)=>eo(l,d,()=>0)});if(i)return i;let r=n.scale,a=D(t,"div",e.box,r);a.className="docx-table-fragment layout-table",a.dataset.tableId=e.tableId,a.dataset.fragmentIndex=String(e.fragmentIndex),a.style.overflow="visible";let s=new Map;for(let l of e.rows){let d=Wn(t,l,e,n);s.set(l,d),a.append(d);}return Ht(a,e,s),a}function Or(t,e,n,o,i){let r={...n,paintInstance:`p${e.index}`,tabLeaderOriginXPt:e.contentBox.x-e.box.x},a=D(t,"div",e.box,r.scale);if(a.className="docx-page",Vt(a),a.dataset.pageIndex=String(e.index),r.ariaHidden&&(a.setAttribute("aria-hidden","true"),a.setAttribute("role","presentation")),a.dataset.materialized=String(o),!o)return a;let s=Object.freeze({x:-(e.contentBox.x-e.box.x),y:-(e.contentBox.y-e.box.y),width:e.box.width,height:e.box.height}),l=e.pageBorders?Hn(t,e.pageBorders,r.scale):null;l&&e.pageBorders&&(l.dataset.docxZOrder=e.pageBorders.zOrder),l&&e.pageBorders?.zOrder==="back"&&a.append(l);let d=new Map,c=un(t,a,e,{chrome:r,paintFragment:(y,f)=>{let g=d.get(f);return g||(g={...r,inertLinks:true,tabLeaderOriginXPt:f},d.set(f,g)),y.kind==="table"?K(t,y,g):_(t,y,g)},appendDrawings:(y,f,g,v,k,x)=>qn(t,y,f,r,g,v,k,x)});_n(t,a,e,r,s,"behind");let u=t.createElement("div");u.className="docx-page-content",u.style.position="absolute",u.style.left=`${(e.contentBox.x-e.box.x)*r.scale}px`,u.style.top=`${(e.contentBox.y-e.box.y)*r.scale}px`,u.style.width=`${e.contentBox.width*r.scale}px`,u.style.height=`${e.contentBox.height*r.scale}px`,r.activeHeaderFooterRId&&u.setAttribute("contenteditable","false");for(let y of e.columnSeparators??[]){let f=t.createElement("div");f.className="docx-column-separator",f.setAttribute("contenteditable","false"),f.style.position="absolute",f.style.left=`${y.x*r.scale}px`,f.style.top=`${y.y*r.scale}px`,f.style.width=`${y.width*r.scale}px`,f.style.height=`${y.height*r.scale}px`,f.style.backgroundColor="currentColor",f.style.pointerEvents="none",u.append(f);}let p=i?new Map:null;for(let y of e.fragments){let f=y.kind==="table"?K(t,y,r):_(t,y,r);p?.set(y,f),u.append(f);}i&&p&&(i.content=u,i.blocks=p),a.append(u),_n(t,a,e,r,s,"inFront"),l&&e.pageBorders?.zOrder==="front"&&a.append(l),Yt(t,a,e,r,_,K);for(let y of ["header","footer"]){if(e[y]||e.parityBlank)continue;let f=t.createElement("div");f.className="docx-hf docx-hf--placeholder",f.dataset.docxHf=y,f.setAttribute("contenteditable","false");let g=y==="header"?e.contentBox.y-e.box.y:e.box.y+e.box.height-(e.contentBox.y+e.contentBox.height),v=Math.min(g,Nr);if(v<=0)continue;let k=Math.max(0,Math.min(_r,g-v)),x=y==="header"?k:e.box.height-k-v;f.style.position="absolute",f.style.left=`${(e.contentBox.x-e.box.x)*r.scale}px`,f.style.top=`${x*r.scale}px`,f.style.width=`${e.contentBox.width*r.scale}px`,f.style.height=`${v*r.scale}px`,a.append(f);}for(let y of c)a.append(y);qt(t,a,e,r);let h=nn(t,e,r.scale,r.changeBars,r.changeBarsToggle,r.revisionMarkup,r.facingPages,r.revisionStyles);return h&&a.append(h),a}var Nr=30,_r=36,Qe=new WeakMap;function bs(t){Qe.delete(t);}function Kr(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function zr(t,e){let n=Object.keys(t);if(n.length!==Object.keys(e).length)return false;for(let o of n){let i=t[o],r=e[o];if(i!==r)return false}return true}function Ur(t,e){if(t.length!==e.length)return false;for(let n=0;n<t.length;n+=1)if(t[n]!==e[n])return false;return true}function jr(t,e){if(t===e)return false;let n=new Set([...Object.keys(t),...Object.keys(e)]);for(let o of n){if(o==="fragments"||o==="pageFieldSource")continue;let i=t[o],r=e[o];if(i!==r&&!(Array.isArray(i)&&Array.isArray(r)&&Ur(i,r))&&!(typeof i=="object"&&typeof r=="object"&&i!==null&&r!==null&&!Array.isArray(i)&&!Array.isArray(r)&&zr(i,r))&&!Tt(i,r,Gr))return false}return true}var Xn="docx-column-separator",Gr=2e4;function Wr(t,e,n,o){let i=e.content,r=e.blocks;if(!i||!r||i.parentElement!==e.element)return null;let a={...o,paintInstance:`p${n.index}`,tabLeaderOriginXPt:n.contentBox.x-n.box.x},s=new Map,l=[];for(let p of n.fragments){let h=r.get(p)??(p.kind==="table"?K(t,p,a,Ft(r,p)):_(t,p,a));s.set(p,h),l.push(h);}let d=new Set(l),c=i.firstChild;for(;c;){let p=c.nextSibling,h=c;!d.has(h)&&h.classList?.contains(Xn)!==true&&c.remove(),c=p;}let u=i.firstChild;for(;u&&u.classList?.contains(Xn);)u=u.nextSibling;for(let p of l){if(p===u){u=u.nextSibling;continue}i.insertBefore(p,u);}return on(t,e.element,n,o.scale,o.changeBars,o.changeBarsToggle,o.revisionMarkup,o.facingPages,o.revisionStyles),{record:n,materialized:true,element:e.element,content:i,blocks:s}}function Xr(t,e,n,o){let i=t.element;return !t.materialized&&Kr(t.record.box,e.box)&&i.style.left===`${e.box.x*n}px`&&i.style.top===`${e.box.y*n}px`&&i.style.width===`${e.box.width*n}px`&&i.style.height===`${e.box.height*n}px`&&i.getAttribute("aria-hidden")===(o?"true":null)}function Vr(t,e,n={}){Yr(t,e,n);}function Yr(t,e,n,o){t.classList.toggle("docx-show-paragraph-marks",n.showParagraphMarks??false);let i=n.contentControlChrome,r=i?`${i.showAll===true?"1":"0"}:${i.activeIds?[...i.activeIds].sort().join(","):""}:${i.checkedIds?[...i.checkedIds].sort().join(","):""}:${i.tocControlIds?[...i.tocControlIds].sort().join(","):""}:${i.suppressedIds?[...i.suppressedIds].sort().join(","):""}:${i.readOnly===true?"ro":""}`:"",a=n.drawingStrings??We,s=n.breakMarkStrings??re,l=n.imageUrlPort!==void 0?xn(t,n.imageUrlPort):null,d=i?.additionalBoundaries?i.additionalBoundaries.flatMap(m=>m.fragments.map(b=>`${m.id}:${b.pageIndex}:${b.box.x}:${b.box.y}:${b.box.width}:${b.box.height}`)).sort().join(","):"",c=n.readOnlyParagraphIds?[...n.readOnlyParagraphIds].sort().join(","):"",u=n.emptyTocPlaceholderIds?[...n.emptyTocPlaceholderIds].sort().join(","):"",p=i?.tocControlIds?[...i.tocControlIds].sort().join(","):"",h=Pe(n.revisionStyles??(n.revisionMarkup?"author":void 0),e,o),y=n.revisionMarkup&&Object.values(n.revisionMarkup.cells).includes("byAuthor")?h??Pe("author",e,o):null,f={scale:n.scale??96/72,ariaHidden:n.ariaHidden??true,drawingStrings:a,urlRegistry:l,...n.fontAlias?{fontAlias:n.fontAlias}:{},...n.readOnlyParagraphIds?{readOnlyParagraphIds:n.readOnlyParagraphIds}:{},...n.emptyTocPlaceholderIds?{emptyTocPlaceholderIds:n.emptyTocPlaceholderIds}:{},...n.defaultFontFamily?{defaultFontFamily:n.defaultFontFamily}:{},...n.fieldShading?{fieldShading:n.fieldShading}:{},showParagraphMarks:n.showParagraphMarks??false,...n.showParagraphMarks?{breakMarks:Wt(e,s)}:{},changeBars:n.changeBars??"all-markup",changeBarsToggle:n.changeBarsToggle??false,...n.shadeFormFields!==void 0?{shadeFormFields:n.shadeFormFields}:{},...h?{revisionStyles:h}:{},...y?{revisionCellStyles:y}:{},...n.revisionMarkup?{revisionMarkup:n.revisionMarkup}:{},facingPages:n.facingPages,revisionKindColors:n.revisionStyles==="kind",...n.imageUrlPort?{imageUrlPort:n.imageUrlPort}:{},...n.activeHeaderFooterRId?{activeHeaderFooterRId:n.activeHeaderFooterRId}:{},...n.activeHeaderFooterPageIndex!==void 0?{activeHeaderFooterPageIndex:n.activeHeaderFooterPageIndex}:{},...i?{contentControlChrome:i}:{}},g=t.ownerDocument,v=`${f.scale}|${f.ariaHidden}|${f.fontAlias?Rr(f.fontAlias):""}|${f.defaultFontFamily??""}|cc:${r}:${d}|toc:${p}|ro:${c}|tocEmpty:${u}|${n.imageUrlPort?"url":""}|${An(a)}|markup:${JSON.stringify(n.revisionMarkup)}|facing:${n.facingPages}|rev:${Le(h)}|cells:${Le(y)}|marks:${n.showParagraphMarks??false}|${f.breakMarks?`breaks:${Gt(s)}:${f.breakMarks.token}|`:""}bars:${f.changeBars}:${f.changeBarsToggle}`,k=Qe.get(t),x=k?.parameters===v,E=x?new Map(k.pages.map(m=>[m.record,m])):null,z=k?new Map(k.pages.map(m=>[m.record.index,m])):null,L=e.pages.map(m=>{let b=n.materialize?.has(m.index)??true,R=E?.get(m);if(R&&R.materialized===b)return R;let P=z?.get(m.index);if(!b&&P&&Xr(P,m,f.scale,f.ariaHidden))return {record:m,materialized:false,element:P.element};if(x&&b&&P?.materialized&&jr(P.record,m)){let J=Wr(g,P,m,f);if(J)return J}let S={},M=Or(g,m,f,b,S);return {record:m,materialized:b,element:M,...S.content?{content:S.content}:{},...S.blocks?{blocks:S.blocks}:{}}});if(Qe.set(t,{parameters:v,pages:L}),t.dataset.revision=String(e.revision),l){let m={...e,pages:L.filter(b=>b.materialized).map(b=>b.record)};l.reconcile(Pn(m),Tn(m));}let Z=new Set(L.map(m=>m.element)),I=t.firstChild;for(;I;){let m=I.nextSibling;Z.has(I)||I.remove(),I=m;}let O=t.firstChild;for(let m of L){if(m.element===O){O=O.nextSibling;continue}t.insertBefore(m.element,O);}an(L,f);}function qr(t,e,n,o){let i=t.ownerDocument,r=o.scale,a=[];for(let s of n){let l=e.pages[s.pageIndex];if(!l)continue;let d=i.createElement("div");d.className=s.className??o.className??"docx-cell-selection-rect",d.style.position="absolute";let c=o.pageOffsetX?.get(s.pageIndex)??0;d.style.left=`${(l.contentBox.x+s.x+c)*r}px`,d.style.top=`${(l.contentBox.y+s.y)*r}px`,d.style.width=`${s.width*r}px`,d.style.height=`${s.height*r}px`,s.reviewAuthor&&(d.dataset.reviewAuthor=s.reviewAuthor.author,d.dataset.reviewAuthorSlot=String(s.reviewAuthor.slot%A),d.style.setProperty("--doc-review-author-current",s.reviewAuthor.color)),s.activeBackground!==void 0&&(d.style.backgroundColor=s.activeBackground,d.style.boxShadow="none"),a.push(d);}t.replaceChildren(...a);}
|
|
4
|
-
export{B as a,Mt as b,oi as c,yo as d,ri as e,_i as f,Gt as g,Oe as h,Ra as i,An as j,We as k,Sa as l,Ze as m,Mr as n,bs as o,Vr as p,Yr as q,qr as r};
|
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
import { al as DrawingProjection, Q as OoxmlPackage } from './types-barrel-CA0xB8kH.js';
|
|
2
|
-
|
|
3
|
-
/** Opaque handle — bytes are reachable only through {@link mintValidatedImageBytes}. */
|
|
4
|
-
interface ValidatedImageBytesHandle {
|
|
5
|
-
readonly registryId: number;
|
|
6
|
-
readonly resourceKey: string;
|
|
7
|
-
readonly contentId: string;
|
|
8
|
-
readonly generation: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* The engine's trust-boundary caps: recursion depth, element counts, and the rest.
|
|
13
|
-
*
|
|
14
|
-
* A caller may LOWER any of these but never raise or disable one — an override of `Infinity`,
|
|
15
|
-
* zero, a negative or `NaN` clamps into `(0, ceiling]` rather than turning the limit off. These
|
|
16
|
-
* are security ceilings, not performance budgets.
|
|
17
|
-
*/
|
|
18
|
-
interface ResourceLimits {
|
|
19
|
-
/** Max nested-structure recursion (tables/shapes/SDT/groups). */
|
|
20
|
-
readonly maxRecursionDepth: number;
|
|
21
|
-
/** Max total parsed element count. */
|
|
22
|
-
readonly maxElementCount: number;
|
|
23
|
-
/** Max package part count. */
|
|
24
|
-
readonly maxPartCount: number;
|
|
25
|
-
/** Max total decompressed bytes (zip-bomb guard). */
|
|
26
|
-
readonly maxDecompressedBytes: number;
|
|
27
|
-
/** Max total compressed input bytes. */
|
|
28
|
-
readonly maxCompressedBytes: number;
|
|
29
|
-
/** Max decompressed:compressed ratio per entry. */
|
|
30
|
-
readonly maxCompressionRatio: number;
|
|
31
|
-
/** In-memory chunk budget for streaming/spooling. */
|
|
32
|
-
readonly maxChunkBytes: number;
|
|
33
|
-
/** Max pagination passes before non-convergence is declared. */
|
|
34
|
-
readonly maxPaginationPasses: number;
|
|
35
|
-
/** Max queued items in any bounded work queue. */
|
|
36
|
-
readonly maxQueueDepth: number;
|
|
37
|
-
}
|
|
38
|
-
/** Non-disableable hard ceilings: no resolved limit may exceed these. */
|
|
39
|
-
declare const HARD_CEILINGS: ResourceLimits;
|
|
40
|
-
/** Finite defaults, all <= their hard ceiling. */
|
|
41
|
-
declare const DEFAULT_LIMITS: ResourceLimits;
|
|
42
|
-
/**
|
|
43
|
-
* Resolve caller overrides into a frozen, always-finite limit set. Each value is
|
|
44
|
-
* `min(override>0 ? override : default, ceiling)`. Infinity/0/negative/NaN can
|
|
45
|
-
* never disable a limit — the hard ceiling always wins.
|
|
46
|
-
*/
|
|
47
|
-
declare function resolveLimits(overrides?: Partial<ResourceLimits>): ResourceLimits;
|
|
48
|
-
/** Bounded image decode limits (typed-drawings-and-images task 4). */
|
|
49
|
-
/** Trust-boundary caps specific to image decoding and embedding. */
|
|
50
|
-
interface ImageResourceLimits {
|
|
51
|
-
readonly maxEncodedBytes: number;
|
|
52
|
-
readonly maxDecodedBytes: number;
|
|
53
|
-
readonly maxPixels: number;
|
|
54
|
-
readonly maxDimension: number;
|
|
55
|
-
readonly maxPolygonPoints: number;
|
|
56
|
-
readonly maxExternalRedirects: number;
|
|
57
|
-
}
|
|
58
|
-
/** Image caps nothing can raise past. A caller's override clamps into these. */
|
|
59
|
-
declare const IMAGE_RESOURCE_HARD_CEILINGS: ImageResourceLimits;
|
|
60
|
-
/** The image caps in force when a host configures none. Conservative and finite. */
|
|
61
|
-
declare const DEFAULT_IMAGE_RESOURCE_LIMITS: ImageResourceLimits;
|
|
62
|
-
/** Resolve caller overrides into frozen image limits; hard ceilings cannot be raised. */
|
|
63
|
-
declare function resolveImageResourceLimits(overrides?: Partial<ImageResourceLimits>): ImageResourceLimits;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* Raster media the decode port measures and any authoring path may write.
|
|
67
|
-
*
|
|
68
|
-
* BMP and WebP are here for the same reason the other three are: an `<img>` decodes them
|
|
69
|
-
* natively, so they need a signature and a structural header and nothing else. BMP is what
|
|
70
|
-
* older documents carry; WebP is what current Word writes.
|
|
71
|
-
*/
|
|
72
|
-
type SupportedImageMime = 'image/png' | 'image/jpeg' | 'image/gif' | 'image/bmp' | 'image/webp';
|
|
73
|
-
/**
|
|
74
|
-
* Vector media painted straight from validated bytes. An `<img>` renders SVG in the
|
|
75
|
-
* browser's secure static mode — no script, no external subresource loads — so there is
|
|
76
|
-
* no decode step and no raster buffer sized by a file-supplied number.
|
|
77
|
-
*/
|
|
78
|
-
type VectorImageMime = 'image/svg+xml';
|
|
79
|
-
/** Every mime the painter can hand to an `<img>`. */
|
|
80
|
-
type RenderableImageMime = SupportedImageMime | VectorImageMime;
|
|
81
|
-
/**
|
|
82
|
-
* Media kept in the package byte-for-byte that the painter cannot hand to an `<img>`.
|
|
83
|
-
* A decode port may rasterize it; without one it paints as a labelled placeholder.
|
|
84
|
-
*/
|
|
85
|
-
type PreservedImageMime = 'image/tiff' | 'image/x-emf' | 'image/x-wmf';
|
|
86
|
-
/**
|
|
87
|
-
* What is known about one embedded image: validated, refused, or still decoding.
|
|
88
|
-
*
|
|
89
|
-
* Content type is a CLAIM. Signature sniffing, structural header validation and the decode port
|
|
90
|
-
* are authoritative, and bytes that fail them never enter public state.
|
|
91
|
-
*/
|
|
92
|
-
type ImageResourceState = {
|
|
93
|
-
readonly kind: 'ready';
|
|
94
|
-
readonly partName: string;
|
|
95
|
-
readonly contentId: string;
|
|
96
|
-
readonly resourceKey: string;
|
|
97
|
-
readonly validatedHandle: ValidatedImageBytesHandle;
|
|
98
|
-
readonly mime: RenderableImageMime;
|
|
99
|
-
readonly pixelWidth: number;
|
|
100
|
-
readonly pixelHeight: number;
|
|
101
|
-
readonly dpiX: number;
|
|
102
|
-
readonly dpiY: number;
|
|
103
|
-
} | {
|
|
104
|
-
readonly kind: 'unrenderable';
|
|
105
|
-
readonly partName: string | null;
|
|
106
|
-
readonly mime: RenderableImageMime | PreservedImageMime | 'unknown';
|
|
107
|
-
readonly reason: 'unsupported-format' | 'non-picture-graphic' | 'signature-mismatch' | 'decode-failed' | 'resource-limit';
|
|
108
|
-
} | {
|
|
109
|
-
readonly kind: 'external';
|
|
110
|
-
readonly relationshipId: string;
|
|
111
|
-
readonly sinkSafe: boolean;
|
|
112
|
-
} | {
|
|
113
|
-
readonly kind: 'missing';
|
|
114
|
-
readonly relationshipId: string;
|
|
115
|
-
} | {
|
|
116
|
-
readonly kind: 'pending';
|
|
117
|
-
readonly resourceKey: string;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* The injected image decoder.
|
|
121
|
-
*
|
|
122
|
-
* A port rather than a direct `Image`/`createImageBitmap` call, so a worker or server runtime
|
|
123
|
-
* supplies its own and the engine never reaches for a browser global.
|
|
124
|
-
*/
|
|
125
|
-
interface ImageDecodePort {
|
|
126
|
-
decode(bytes: Uint8Array, mime: SupportedImageMime, limits: ImageResourceLimits,
|
|
127
|
-
/** Aborted when the owning lookup/session is disposed. */
|
|
128
|
-
signal?: AbortSignal): Promise<Readonly<{
|
|
129
|
-
pixelWidth: number;
|
|
130
|
-
pixelHeight: number;
|
|
131
|
-
dpiX: number;
|
|
132
|
-
dpiY: number;
|
|
133
|
-
}>>;
|
|
134
|
-
/**
|
|
135
|
-
* Optional conversion of media an `<img>` cannot render (EMF/WMF metafiles, TIFF) into a
|
|
136
|
-
* renderable raster. The returned bytes are untrusted and re-enter the full raster
|
|
137
|
-
* validation path (sniff, header, pixel caps, decode) before they can become a ready
|
|
138
|
-
* resource. A null return declines the format and keeps the labelled placeholder; so does
|
|
139
|
-
* a throw, as `decode-failed`.
|
|
140
|
-
*/
|
|
141
|
-
convertPreserved?(bytes: Uint8Array, mime: PreservedImageMime, limits: ImageResourceLimits,
|
|
142
|
-
/** Aborted when the owning lookup/session is disposed. */
|
|
143
|
-
signal?: AbortSignal): Promise<Readonly<{
|
|
144
|
-
bytes: Uint8Array;
|
|
145
|
-
mime: SupportedImageMime;
|
|
146
|
-
}> | null>;
|
|
147
|
-
}
|
|
148
|
-
/** Resolves a relationship id to a validated image resource, or reports why it could not. */
|
|
149
|
-
interface ImageResourceLookup {
|
|
150
|
-
readonly resolveEmbedded: (ownerPartName: string, relationshipId: string) => Promise<ImageResourceState>;
|
|
151
|
-
readonly resolveLinked: (ownerPartName: string, relationshipId: string) => ImageResourceState;
|
|
152
|
-
readonly resolveForProjection: (projection: DrawingProjection) => Promise<ImageResourceState>;
|
|
153
|
-
readonly liveReferenceCount: (partName: string) => number;
|
|
154
|
-
readonly dispose: () => void;
|
|
155
|
-
}
|
|
156
|
-
/** Maximum prefix inspected for SVG root detection (exported for bounded-scan tests). */
|
|
157
|
-
declare const MAX_SVG_SNIFF_BYTES = 512;
|
|
158
|
-
/** A raster header that passed structural validation: its real MIME type and pixel extent. */
|
|
159
|
-
interface ValidatedRasterHeader {
|
|
160
|
-
readonly pixelWidth: number;
|
|
161
|
-
readonly pixelHeight: number;
|
|
162
|
-
/** Horizontal physical density when bounded header metadata supplies it. */
|
|
163
|
-
readonly dpiX?: number;
|
|
164
|
-
/** Vertical physical density when bounded header metadata supplies it. */
|
|
165
|
-
readonly dpiY?: number;
|
|
166
|
-
}
|
|
167
|
-
/** Bounded scan for an `<svg` document root (optional `<?xml` prolog only). */
|
|
168
|
-
declare function hasBoundedSvgRoot(bytes: Uint8Array): boolean;
|
|
169
|
-
/** Signature sniffing — authoritative over declared content type. */
|
|
170
|
-
declare function sniffImageMime(bytes: Uint8Array): RenderableImageMime | PreservedImageMime | 'unknown';
|
|
171
|
-
/** Structural PNG IHDR validation before decode. */
|
|
172
|
-
declare function validatePngHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
|
|
173
|
-
/** Structural GIF logical screen descriptor validation before decode. */
|
|
174
|
-
declare function validateGifHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
|
|
175
|
-
/** Bounded JPEG marker scan through the first supported SOF marker. */
|
|
176
|
-
declare function validateJpegHeader(bytes: Uint8Array): ValidatedRasterHeader | null;
|
|
177
|
-
/**
|
|
178
|
-
* Intrinsic size of an SVG, resolved the way a browser sizes one: absolute `width`/`height`
|
|
179
|
-
* first, then `viewBox` for the missing axis or ratio, then the CSS 300x150 default.
|
|
180
|
-
*
|
|
181
|
-
* This is metadata for insert and reset-to-natural-size only. Layout uses the authored
|
|
182
|
-
* `wp:extent` and the browser rasterizes into that box, so nothing here sizes an allocation
|
|
183
|
-
* and an out-of-range value is clamped rather than refused.
|
|
184
|
-
*/
|
|
185
|
-
declare function resolveSvgIntrinsicSize(bytes: Uint8Array, limits: ImageResourceLimits): ValidatedRasterHeader | null;
|
|
186
|
-
/**
|
|
187
|
-
* Validate a raster image's header structurally and report its real MIME type and extent.
|
|
188
|
-
*
|
|
189
|
-
* Content type is a CLAIM; this is what makes it a fact. A file declaring `image/png` over JPEG
|
|
190
|
-
* bytes is caught here rather than at decode.
|
|
191
|
-
*/
|
|
192
|
-
declare function validateRasterHeader(bytes: Uint8Array, mime: SupportedImageMime): ValidatedRasterHeader | null;
|
|
193
|
-
/** Package-wide live drawing references to a media part name. */
|
|
194
|
-
declare function liveDrawingReferenceCount(pkg: OoxmlPackage, partName: string): number;
|
|
195
|
-
/** How the image cache decodes, and what it will spend doing so. */
|
|
196
|
-
interface CreateImageResourceCacheOptions {
|
|
197
|
-
readonly limits?: Partial<ImageResourceLimits>;
|
|
198
|
-
readonly decodePort: ImageDecodePort;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Derived cache for one immutable package snapshot. Registry identity is
|
|
202
|
-
* `(package snapshot, decodePort object, normalized limits)` — the first caller
|
|
203
|
-
* never imposes its decoder or limits on later callers with different options.
|
|
204
|
-
*/
|
|
205
|
-
declare function imageResourceLookupFor(pkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
|
|
206
|
-
/** @deprecated Prefer {@link imageResourceLookupFor} — registry binds cache to package identity. */
|
|
207
|
-
/** Build the per-document image cache. Validated bytes only; refusals are remembered too. */
|
|
208
|
-
declare function createImageResourceCache(initialPkg: OoxmlPackage, options: CreateImageResourceCacheOptions): ImageResourceLookup;
|
|
209
|
-
|
|
210
|
-
export { DEFAULT_IMAGE_RESOURCE_LIMITS as D, HARD_CEILINGS as H, MAX_SVG_SNIFF_BYTES as M, resolveSvgIntrinsicSize as d, DEFAULT_LIMITS as f, IMAGE_RESOURCE_HARD_CEILINGS as g, createImageResourceCache as j, hasBoundedSvgRoot as k, imageResourceLookupFor as l, liveDrawingReferenceCount as m, resolveLimits as n, validateGifHeader as o, validateJpegHeader as p, validatePngHeader as q, resolveImageResourceLimits as r, sniffImageMime as s, validateRasterHeader as v };
|
|
211
|
-
export type { CreateImageResourceCacheOptions as C, ImageResourceState as I, PreservedImageMime as P, RenderableImageMime as R, SupportedImageMime as S, ValidatedImageBytesHandle as V, VectorImageMime as a, ImageResourceLimits as b, ImageDecodePort as c, ResourceLimits as e, ImageResourceLookup as h, ValidatedRasterHeader as i };
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { U as OoxmlNodeId, V as OoxmlGenericElementNode, N as OoxmlNode } from './types-barrel-CA0xB8kH.js';
|
|
2
|
-
|
|
3
|
-
/** Office Math Markup Language namespace. */
|
|
4
|
-
declare const OFFICE_MATH_NAMESPACE_URI = "http://schemas.openxmlformats.org/officeDocument/2006/math";
|
|
5
|
-
declare const DEFAULT_OMML_LIMITS: Readonly<{
|
|
6
|
-
maxDepth: 24;
|
|
7
|
-
maxNodes: 256;
|
|
8
|
-
maxTextLength: 512;
|
|
9
|
-
}>;
|
|
10
|
-
/** Shared work limits for untrusted OMML and linear-math input. */
|
|
11
|
-
interface OmmlLimits {
|
|
12
|
-
readonly maxDepth?: number;
|
|
13
|
-
readonly maxNodes?: number;
|
|
14
|
-
readonly maxTextLength?: number;
|
|
15
|
-
}
|
|
16
|
-
type EquationExpression = {
|
|
17
|
-
readonly kind: 'row';
|
|
18
|
-
readonly items: readonly EquationExpression[];
|
|
19
|
-
} | {
|
|
20
|
-
readonly kind: 'text';
|
|
21
|
-
readonly value: string;
|
|
22
|
-
readonly format?: {
|
|
23
|
-
readonly fontFamily?: string;
|
|
24
|
-
readonly bold?: boolean;
|
|
25
|
-
readonly italic?: boolean;
|
|
26
|
-
readonly literal?: boolean;
|
|
27
|
-
readonly normalText?: boolean;
|
|
28
|
-
readonly mathStyle?: 'p' | 'b' | 'i' | 'bi';
|
|
29
|
-
};
|
|
30
|
-
} | {
|
|
31
|
-
readonly kind: 'bar';
|
|
32
|
-
readonly body: EquationExpression;
|
|
33
|
-
readonly position: 'top' | 'bottom';
|
|
34
|
-
} | {
|
|
35
|
-
readonly kind: 'fraction';
|
|
36
|
-
readonly numerator: EquationExpression;
|
|
37
|
-
readonly denominator: EquationExpression;
|
|
38
|
-
} | {
|
|
39
|
-
readonly kind: 'radical';
|
|
40
|
-
readonly radicand: EquationExpression;
|
|
41
|
-
readonly degree?: EquationExpression;
|
|
42
|
-
} | {
|
|
43
|
-
readonly kind: 'script';
|
|
44
|
-
readonly base: EquationExpression;
|
|
45
|
-
readonly subscript?: EquationExpression;
|
|
46
|
-
readonly superscript?: EquationExpression;
|
|
47
|
-
} | {
|
|
48
|
-
readonly kind: 'nary';
|
|
49
|
-
readonly operator: string;
|
|
50
|
-
readonly body: EquationExpression;
|
|
51
|
-
readonly lowerLimit?: EquationExpression;
|
|
52
|
-
readonly upperLimit?: EquationExpression;
|
|
53
|
-
} | {
|
|
54
|
-
readonly kind: 'fallback';
|
|
55
|
-
readonly text: string;
|
|
56
|
-
};
|
|
57
|
-
interface OmmlEquationProjection {
|
|
58
|
-
readonly sourceNodeId: OoxmlNodeId;
|
|
59
|
-
readonly expression: EquationExpression;
|
|
60
|
-
readonly fallbackText: string;
|
|
61
|
-
readonly truncated: boolean;
|
|
62
|
-
readonly visitedNodes: number;
|
|
63
|
-
}
|
|
64
|
-
type LinearMathRejection = 'empty' | 'invalid-syntax' | 'invalid-xml-text' | 'depth-limit' | 'node-limit' | 'text-limit';
|
|
65
|
-
type LinearMathParseResult = {
|
|
66
|
-
readonly ok: true;
|
|
67
|
-
readonly expression: EquationExpression;
|
|
68
|
-
} | {
|
|
69
|
-
readonly ok: false;
|
|
70
|
-
readonly reason: LinearMathRejection;
|
|
71
|
-
};
|
|
72
|
-
type LinearMathOmmlResult = {
|
|
73
|
-
readonly ok: true;
|
|
74
|
-
readonly expression: EquationExpression;
|
|
75
|
-
readonly equation: OoxmlGenericElementNode;
|
|
76
|
-
} | {
|
|
77
|
-
readonly ok: false;
|
|
78
|
-
readonly reason: LinearMathRejection;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Project one preserved `m:oMath` generic node without changing its canonical source.
|
|
82
|
-
*/
|
|
83
|
-
declare function projectOmmlEquation(node: OoxmlNode, limits?: OmmlLimits): OmmlEquationProjection | null;
|
|
84
|
-
/** Parse the supported compact linear-math subset with fixed work limits. */
|
|
85
|
-
declare function parseLinearMath(input: string, limits?: OmmlLimits): LinearMathParseResult;
|
|
86
|
-
/**
|
|
87
|
-
* Convert a projected expression into reversible compact syntax.
|
|
88
|
-
*
|
|
89
|
-
* Returns an empty string when parsing the result would change the projected meaning.
|
|
90
|
-
*/
|
|
91
|
-
declare function equationExpressionToLinearMath(expression: EquationExpression): string;
|
|
92
|
-
type NextNodeId = () => string;
|
|
93
|
-
/** Parse compact linear math and generate fresh canonical OMML in one bounded operation. */
|
|
94
|
-
declare function linearMathToOmml(input: string, nextId: NextNodeId, limits?: OmmlLimits): LinearMathOmmlResult;
|
|
95
|
-
|
|
96
|
-
export { DEFAULT_OMML_LIMITS as D, OFFICE_MATH_NAMESPACE_URI as c, equationExpressionToLinearMath as e, projectOmmlEquation as f, linearMathToOmml as l, parseLinearMath as p };
|
|
97
|
-
export type { EquationExpression as E, LinearMathOmmlResult as L, OmmlEquationProjection as O, LinearMathParseResult as a, LinearMathRejection as b, OmmlLimits as d };
|