@docx-editor.dev/core 2.21.1 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +10 -10
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +8 -8
- package/dist/binding.js +1 -1
- package/dist/{chunk-BF2TOG2V.js → chunk-5RKCJ5DF.js} +1 -1
- package/dist/chunk-65GJRSZ5.cjs +18 -0
- package/dist/chunk-6TBRG6SA.cjs +20 -0
- package/dist/chunk-A72MJGY7.cjs +4 -0
- package/dist/chunk-AZ7QSAXH.js +4 -0
- package/dist/chunk-BL57VQ7E.js +1 -0
- package/dist/chunk-CB6RQ3GD.cjs +11 -0
- package/dist/chunk-GG4IAKFI.js +5 -0
- package/dist/chunk-HJYLFMLX.js +2 -0
- package/dist/chunk-HL6NO7IH.cjs +2 -0
- package/dist/chunk-HZQFGB2X.cjs +5 -0
- package/dist/{chunk-FPDIJ4RF.js → chunk-IWAUA732.js} +1 -1
- package/dist/chunk-OZXBAEWW.js +2 -0
- package/dist/{chunk-4TYA4RLP.cjs → chunk-P5PWSRNW.cjs} +1 -1
- package/dist/{chunk-DZYKU2HG.js → chunk-PD5XKBJA.js} +1 -1
- package/dist/{chunk-7N77EN2Z.cjs → chunk-REMFTPDL.cjs} +1 -1
- package/dist/{chunk-T5B4NMKF.cjs → chunk-RLKX7BIP.cjs} +1 -1
- package/dist/chunk-UGLO2GA5.cjs +1 -0
- package/dist/chunk-UOQONZVQ.js +11 -0
- package/dist/chunk-VD2MWTR6.js +20 -0
- package/dist/chunk-VIXH2OVP.js +1 -0
- package/dist/chunk-W2JIZ5JH.js +18 -0
- package/dist/chunk-W5H62AWM.cjs +1 -0
- package/dist/{chunk-E5OUYRNM.cjs → chunk-X2LJDR53.cjs} +5 -5
- package/dist/chunk-YQXY6TQ3.js +5 -0
- package/dist/{chunk-RA2TDTEQ.cjs → chunk-YYFBYVW4.cjs} +1 -1
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +4 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +3 -3
- package/dist/contracts/document.d.ts +2 -2
- package/dist/contracts/editor.d.ts +8 -8
- package/dist/contracts/modules.d.ts +6 -6
- package/dist/contracts/types.d.ts +1 -1
- package/dist/{custom-node-writes-CncR6KfC.d.ts → custom-node-writes-Ck6eOiJ3.d.ts} +2 -2
- package/dist/{document-protection-DM6mA8Rf.d.ts → document-protection-CMPEonQc.d.ts} +1 -1
- package/dist/{editor-BRh7GuZF.d.ts → editor-BKDVqXyk.d.ts} +70 -49
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +188 -26
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +31 -14
- package/dist/export.js +2 -2
- package/dist/{font-resolver-DwuQYj3P.d.ts → font-resolver-PBc8Vuxs.d.ts} +1 -1
- package/dist/{headless-document-view-C3fc_jV0.d.ts → headless-document-view-9wjJT20Y.d.ts} +2 -2
- package/dist/{image-resources-DxF-SN_8.d.ts → image-resources-B0v-XaTM.d.ts} +2 -2
- package/dist/{index-3pNnG4z4.d.ts → index-DQA53aR1.d.ts} +134 -16
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-_GGjhhVc.d.ts → layout-shaping-Dyr0ZSOI.d.ts} +5 -2
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +376 -33
- package/dist/layout.js +1 -1
- package/dist/{note-properties-CjT31AuP.d.ts → note-properties-D_lmG9xx.d.ts} +1 -1
- package/dist/{omml-equation-Bk3OP1fv.d.ts → omml-equation-CfTm3jOK.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +7 -7
- package/dist/output.js +1 -1
- package/dist/{protocol-CrbTIW2Z.d.ts → protocol-CkVDxyQ3.d.ts} +2 -2
- package/dist/{review-paragraph-order-D3KZohIL.d.ts → review-paragraph-order-BjUs-tDd.d.ts} +1 -1
- package/dist/{revision-projection-kVd7p6Wd.d.ts → revision-projection-DDVBYTIG.d.ts} +1 -1
- package/dist/{semantic-cell-selection-CkSsZHDL.d.ts → semantic-cell-selection-DW6qsmoC.d.ts} +4 -4
- package/dist/{semantic-interaction-Z2Xa68U5.d.ts → semantic-interaction-BNiYSBcB.d.ts} +1 -1
- package/dist/{semantic-paint-BHKprI9P.d.ts → semantic-paint-DE236npp.d.ts} +2 -2
- package/dist/{semantic-records-StH-AnHK.d.ts → semantic-records-C5OeXnaL.d.ts} +545 -569
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +13 -13
- package/dist/store.js +1 -1
- package/dist/{tree-package-fragment-CpEV1gl3.d.ts → tree-package-fragment-DBb97w3F.d.ts} +2 -2
- package/dist/{tree-session-contract-CTT9nM7Z.d.ts → tree-session-contract-BYat3RKx.d.ts} +5 -5
- package/dist/{types-barrel-PwcfEkaX.d.ts → types-barrel-ChGvWjkO.d.ts} +3 -1
- package/package.json +2 -2
- package/dist/chunk-25OQBAKA.js +0 -2
- package/dist/chunk-3B3DQMSL.js +0 -11
- package/dist/chunk-3P3DNJYM.js +0 -5
- package/dist/chunk-3PA64KPK.js +0 -5
- package/dist/chunk-AGWWNVIJ.cjs +0 -1
- package/dist/chunk-DFTVN25X.cjs +0 -5
- package/dist/chunk-DGONGMAV.js +0 -2
- package/dist/chunk-F4H3LC6M.cjs +0 -2
- package/dist/chunk-IUTTOBQW.cjs +0 -20
- package/dist/chunk-IYCXQAFT.cjs +0 -4
- package/dist/chunk-JL3SI5SZ.js +0 -18
- package/dist/chunk-OFWUHH52.js +0 -20
- package/dist/chunk-OKY6JRJL.js +0 -4
- package/dist/chunk-P24FHMQW.cjs +0 -1
- package/dist/chunk-QBKAOSVF.cjs +0 -18
- package/dist/chunk-U5GUJKTS.js +0 -1
- package/dist/chunk-XRYSPKKC.js +0 -1
- package/dist/chunk-ZZRCVDQU.cjs +0 -11
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {aa,Ba,$ as $$1}from'./chunk-AZ7QSAXH.js';import {ba,lb,da,Ha,vb,Ea,Fa,pa,ea,$,ia,ob,L as L$1,K as K$1,Jd,_,pb,ga,nb}from'./chunk-W2JIZ5JH.js';function Be(t,e,n){let o=e.marker?.picture,a=n.urlRegistry;if(!o||o.resource.kind!=="ready"||!a)return null;let r=n.scale,i=a.urlForReady(o.resource.validatedHandle,o.resource.mime);if(i===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",i),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 Ne(t,e,n,o){let a=t.createElement("span");a.dataset.docxNoteRule="single",a.setAttribute("contenteditable","false"),a.setAttribute("aria-hidden","true"),a.style.display="inline-block",a.style.position="relative",a.style.verticalAlign="top",a.style.width=`${e.box.width*o}px`,a.style.height=`${Math.min(e.box.height+(n.leading??0),n.box.height)*o}px`;let r=Jd(e,n),i=t.createElement("span");return i.style.position="absolute",i.style.left="0",i.style.top=`${(r.y-n.box.y)*o}px`,i.style.width=`${r.width*o}px`,i.style.height=`${r.height*o}px`,i.style.backgroundColor=e.style.color?`#${e.style.color}`:"#000000",a.append(i),a}function q(t){return t==="double"||t==="triple"||t==="doubleWave"||t.startsWith("thinThick")||t.startsWith("thickThin")}function F(t,e,n,o,a,r){switch(e){case "dashed":case "dashSmallGap":case "dotDash":case "dotDotDash":case "dashDotStroked":{let i=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% ${i}px`:`${i}px 100%`;return}case "dotted":{let i=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% ${i}px`:`${i}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 i=a/3;t.style.backgroundColor="transparent",t.style.backgroundImage=`linear-gradient(to ${o?"right":"bottom"}, #${n} 0px, #${n} ${i}px, transparent ${i}px, transparent ${i*2}px, #${n} ${i*2}px)`;return}case "threeDEmboss":case "ridge":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px ridge #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "threeDEngrave":case "groove":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px groove #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "inset":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px inset #${n}`,o?t.style.width="0px":t.style.height="0px";return}case "outset":{t.style.backgroundColor="transparent";let i=o?"borderLeft":"borderTop";t.style[i]=`${Math.max(1,a)}px outset #${n}`,o?t.style.width="0px":t.style.height="0px";return}default:return}}var Vt=/^[0-9A-Fa-f]{6}$/;function Oe(t,e,n,o){for(let{box:a,edge:r,side:i}of pb(n)){let s=r.color&&Vt.test(r.color)?r.color:"000000",l=t.createElement("span");l.className=`docx-run-border docx-run-border-${i}`,l.dataset.docxMarker="",l.setAttribute("aria-hidden","true"),l.setAttribute("contenteditable","false"),Object.assign(l.style,{position:"absolute",pointerEvents:"none",left:`${(a.x-n.contentX)*o}px`,top:`${(a.y-n.box.y)*o}px`,width:`${a.width*o}px`,height:`${a.height*o}px`,backgroundColor:`#${s}`});let d=i==="left"||i==="right";F(l,r.val,s,d,(d?a.width:a.height)*o,o),e.append(l);}}function Ke(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[a,r]of n.entries.entries()){let i=t.ownerDocument.createElement("option");i.value=String(a),i.textContent=r,o.append(i);}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 ze(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 a=t.ownerDocument.createElement("span");a.className="docx-form-checkbox-hit",a.dataset.docxMarker="",a.setAttribute("aria-hidden","true"),t.append(a);}var L=8,je={color:"painted",background:"painted",activeBackground:"painted",spanClassName:"painted",avatarUrl:"card-only"},Ge=Object.keys(je),qt=Ge.filter(t=>je[t]==="painted"),Yt=new Set(["http","https","data","blob"]),Zt=/^([a-zA-Z][a-zA-Z0-9+.-]*):/;function Jt(t){let e=t.replace(/[\u0000-\u0020\u007f]/g,"");if(e.length===0)return;let n=Zt.exec(e);if(n)return !Yt.has(n[1].toLowerCase())||/^data:/i.test(e)&&!/^data:image\/(?!svg)/i.test(e)?void 0:e;let o=a=>e[a]==="/"||e[a]==="\\";return o(0)&&o(1)?void 0:e}function Qt(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 Ge){if(!n.call(t,o))continue;let a=t[o];if(!(typeof a!="string"||a.length===0)){if(o==="avatarUrl"){let r=Jt(a);r!==void 0&&(e.avatarUrl=r);continue}e[o]=a;}}return Object.keys(e).length>0?e:null}function Z(t){return `var(--doc-review-author-${t%L})`}function We(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 a=Qt(o);a&&e.set(n,a);}return e}function To(t,e){let n=We(e);return [...t].map(([o,a])=>{let r=n.get(o);return {author:o,slot:a,color:r?.color??Z(a),...r?{style:r}:{}}})}var en=128;function Y(t,e,n=en){let o=e.length<n?e.length:n,a=t;for(let r=0;r<o;r+=1)a=Math.imul(a^e.charCodeAt(r),16777619);return Math.imul(a^e.length,16777619)}function tn(t,e,n){let o=Y(2166136261,n);for(let a of t.keys())o=Y(o,a);for(let[a,r]of e){o=Y(o,a);for(let i of qt)o=Y(o,r[i]??"",1/0);}return `${t.size}.${e.size}.${(o>>>0).toString(36)}`}function Xe(t){return t===null?"kind":t.key}var ae=new WeakMap;function Ve(t,e,n){if(t==="kind")return null;let o=ae.get(e);if(o&&o.option===t&&o.authorSlots===n)return o.context;let a=We(t),r=t===void 0||t==="author"?"author":t.others??"author";if(a.size===0&&r==="kind")return ae.set(e,{option:t,authorSlots:n,context:null}),null;let i=n??on(e),s=new Map;for(let[d,c]of a){if(!c.spanClassName)continue;let y=c.spanClassName.split(/\s+/).filter(h=>h.length>0);y.length>0&&s.set(d,y);}let l={authorSlots:i,styles:a,classTokens:s,others:r,key:tn(i,a,r)};return ae.set(e,{option:t,authorSlots:n,context:l}),l}var _e=new WeakMap;function nn(t){let e=_e.get(t);if(e)return e;let n=[],o=new Set,a=r=>{r===""||o.has(r)||(o.add(r),n.push(r));};for(let r of ba(t)){for(let s of r.lines)for(let l of s.spans){let d=l.revisions;if(d!==void 0)for(let c=0;c<d.length;c+=1)a(d[c].author);for(let c of l.props){if(c.localName!=="rPrChange"&&c.localName!=="pPrChange")continue;let y=c.attributes?.author;a(y??"");break}}for(let s of r.lines){let l=s.drawings;if(l!==void 0)for(let d=0;d<l.length;d+=1){let c=l[d].revisions;if(c!==void 0)for(let y=0;y<c.length;y+=1)a(c[y].author);}}let i=r.markRevisions;if(i)for(let s=0;s<i.length;s+=1)a(i[s].author);}return _e.set(t,n),n}var Ue=new WeakMap;function on(t){let e=Ue.get(t);if(e)return e;let n=new Map,o=a=>{for(let r of nn(a))n.has(r)||n.set(r,n.size);};for(let a of t.pages){o(a.fragments),a.header&&o(a.header.fragments),a.footer&&o(a.footer.fragments);for(let r of [a.footnotes,a.endnotes])if(r){r.separator&&o(r.separator.fragments);for(let i of r.notes)o(i.fragments);}for(let r of [a.anchoredDrawings,a.header?.anchoredDrawings,a.footer?.anchoredDrawings])if(r)for(let i of r){let s=i.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);}i.textboxStory&&o(i.textboxStory.fragments);}}return Ue.set(t,n),n}function rn(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 Mo(){let t=new Map,e=0;return {resolve(n,o){let a=rn(n,o);for(let r of a.keys())t.has(r)||(t.set(r,e),e+=1);return new Map([...a.keys()].map(r=>[r,t.get(r)]).sort((r,i)=>r[1]-i[1]))}}}function B(t,e,n){if(t===void 0||t.length===0)return null;let o=t[t.length-1],a=t.some(s=>s.kind==="delete"||s.kind==="moveFrom"),r=o.kind,i=r==="delete"||r==="moveFrom"?"line-through":r==="insert"||r==="moveTo"?"underline":null;return {attribution:o,line:a&&i==="underline"?"line-through":i,decorationStyle:r==="moveFrom"||r==="moveTo"?"double":"solid",color:a?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)",authorColor:n?.get(o.author)?.color??Z(e?.get(o.author)??0),deleted:a}}function ie(t,e=false){let n=t.spans.find(a=>a.style.shaping)?.style.shaping?.baseLevel,o=n===void 0?e:n===1;return t.spans.length?{x:o?t.spans.reduce((a,r)=>Math.min(a,r.box.x),1/0):t.spans.reduce((a,r)=>Math.max(a,r.box.x+r.box.width),-1/0),rtl:o}:{x:t.contentX,rtl:o}}function se(t,e,n,o){t.style.left=`${(e.x-n)*o}px`,t.style.marginLeft=`${(e.rtl?-2:2)*o}px`,e.rtl&&(t.style.transform="translateX(-100%)");}function qe(t,e,n,o,a=false){let r=t.createElement("span"),i=e.spans[e.spans.length-1];r.className="docx-line-break-mark",r.dataset.docxMarker="",r.setAttribute("aria-hidden","true"),r.contentEditable="false",r.textContent="\u21B5",r.style.position="absolute",r.style.pointerEvents="none",r.style.userSelect="none",se(r,ie(e,a),e.contentX,n),r.style.top=`${e.leading*n}px`,r.style.fontSize=`${(i?.style.fontSizePt??e.box.height)*n}px`,r.style.lineHeight=`${Math.max(0,e.box.height-e.leading-(e.trailingSpacing??0))*n}px`,r.style.color="var(--doc-revision-format)";let s=B(i?.revisions,o?.authorSlots,o?.styles);if(s){let{attribution:l}=s,d=o?.styles.get(l.author),c=o&&(d?.color!==void 0||o.others==="author");if(r.style.color=c?s.authorColor:s.color,r.dataset.revisionKind=l.kind,r.dataset.revisionId=l.id,r.dataset.reviewAuthor=l.author,o){r.dataset.reviewAuthorSlot=String((o.authorSlots.get(l.author)??0)%L);for(let y of o.classTokens.get(l.author)??[])r.classList.add(y);}s.line&&(r.style.textDecorationLine=s.line,r.style.textDecorationStyle=s.decorationStyle,r.style.textDecorationColor=r.style.color);}return r}function Ye(t,e,n,o){let a=Ea(e);if(!a){let d=t.createElement("span");return d.className="docx-paragraph-mark",d.setAttribute("aria-hidden","true"),d.contentEditable="false",d.textContent="\xB6",d.style.position="absolute",d.style.pointerEvents="none",d.style.marginLeft=`${2*n}px`,d.style.color="var(--doc-revision-format)",d}let r=t.createElement("span");r.className=`docx-paragraph-mark docx-revision-pmark docx-revision-pmark-${a.kind}`,r.setAttribute("aria-hidden","true"),r.contentEditable="false",r.dataset.revisionKind=a.kind,r.dataset.revisionId=a.id,a.author!==""&&(r.dataset.reviewAuthor=a.author),r.dataset.revisionIds=e.map(d=>d.id).join(" "),r.dataset.revisionKinds=e.map(d=>d.kind).join(" "),r.textContent="\xB6",r.style.position="absolute",r.style.pointerEvents="none",r.style.marginLeft=`${2*n}px`;let i=Fa(a),s=o?.styles.get(a.author),l=o?(o.authorSlots.get(a.author)??0)%L:0;if(o){r.dataset.reviewAuthorSlot=String(l);let d=o.classTokens.get(a.author);if(d)for(let c=0;c<d.length;c+=1)r.classList.add(d[c]);}return r.style.color=s?.color??(o?.others==="author"?Z(l):i?"var(--doc-revision-deletion)":"var(--doc-revision-insertion)"),i&&(r.style.textDecorationLine="line-through"),r}function le(t,e,n=false){let o=n?null:Ha(e.props.filter(r=>r.localName==="pPrChange")),a=o??e.markFormatRevision;a&&(an(t,a,o?"pPrChange":"rPrChange"),t.dataset.paragraphId=e.paragraphId,t.dataset.reviewStart=String(e.range.start),t.dataset.reviewEnd=String(e.range.end));}function an(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 Ze(t,e,n,o,a,r){for(let i of [n.footnotes,n.endnotes])i&&e.append(sn(t,n,i,o,a,r));}function sn(t,e,n,o,a,r){let i=t.createElement("div");if(i.className="docx-notes",i.dataset.docxNotes=n.kind,i.dataset.docxNotesPlacement=n.placement,i.style.position="absolute",i.style.left=`${(n.box.x-e.box.x)*o.scale}px`,i.style.top=`${(n.box.y-e.box.y)*o.scale}px`,i.style.width=`${n.box.width*o.scale}px`,i.style.height=`${n.box.height*o.scale}px`,n.separator){let s=t.createElement("div");s.className="docx-note-separator",s.dataset.docxNoteSeparator=n.separator.kind,s.setAttribute("contenteditable","false"),s.setAttribute("aria-hidden","true"),s.style.position="absolute",s.style.left=`${(n.separator.box.x-n.box.x)*o.scale}px`,s.style.top=`${(n.separator.box.y-n.box.y)*o.scale}px`,s.style.width=`${n.separator.box.width*o.scale}px`,s.style.height=`${n.separator.box.height*o.scale}px`;let l=n.separator.ruleStyle;if(l||n.separator.synthetic)ln(s,t,l??"single",o.scale,n.separator.box.height,n.separator.ruleColor);else {let d={...o,tabLeaderOriginXPt:n.separator.box.x-e.box.x};for(let c of n.separator.fragments)s.append(c.kind==="table"?r(t,c,d):a(t,c,d));}i.append(s);}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):a(t,c,l));i.append(d);}return i}function ln(t,e,n,o,a,r){t.dataset.docxNoteRule=n;let i=r&&/^[a-f\d]{6}$/i.test(r)?`#${r}`:"#000000";t.style.color=i;let s=Math.max(1,o*.75);if(n==="single"){t.style.backgroundColor=i,t.style.height=`${a*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 dn=new Set(["dropdown","comboBox","date","checkbox","picture","buildingBlockGallery"]);function Je(t,e,n,o){let a=o.contentControlChrome,r=a?.suppressedIds,i=(n.contentControls??[]).filter(h=>r?.has(h.id)!==true),s=[...i,...(a?.additionalBoundaries??[]).filter(h=>r?.has(h.id)!==true&&!i.some(p=>p.id===h.id))];if(s.length===0)return;let l=a?.showAll===true,d=a?.activeIds,c=a?.hoverIds,y=a?.tocControlIds;for(let h of s){let p=y?.has(h.id)===true,u=!p&&d?.has(h.id)===true,f=c?.has(h.id)===true;e.append(yn(t,n,h,o.scale,u,f,l||u||p&&f,a?.checkedIds?.has(h.id),p,a?.readOnly===true));}}function cn(t,e,n,o){let a=t.contentBox.x-t.box.x,r=t.contentBox.y-t.box.y;if(n==="checkbox"){let h=Math.max(1,Math.min(e.height,16))*o,p=e.width>0?(a+e.x+e.width/2)*o-h/2:(a+e.x)*o,u=(r+e.y)*o+Math.max(0,(e.height*o-h)/2);return {left:p,top:u,size:h}}let i=16*o,s=(a+e.x+e.width)*o,l=t.box.width*o,d=s+2*o,c=d+i<=l?d:Math.max(0,s-i),y=(r+e.y)*o+Math.max(0,(e.height*o-i)/2);return {left:c,top:y,size:i}}function yn(t,e,n,o,a,r,i,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=""),a&&(c.dataset.active=""),r&&(c.dataset.hover=""),i&&(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 y=e.contentBox.x-e.box.x,h=e.contentBox.y-e.box.y;for(let u of n.fragments){if(u.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=`${(y+u.box.x)*o}px`,f.style.top=`${(h+u.box.y)*o}px`,f.style.width=`${Math.max(u.box.width,1)*o}px`,f.style.height=`${Math.max(u.box.height,1)*o}px`,f.style.pointerEvents="none",c.append(f);}let p=n.fragments.find(u=>u.pageIndex===e.index);if(p&&n.alias){let u=t.createElement("div");u.className="docx-content-control-label",u.dataset.docxMarker="",u.setAttribute("contenteditable","false"),u.setAttribute("aria-hidden","true"),u.textContent=n.alias,u.style.position="absolute",u.style.left=`${(y+p.box.x)*o}px`,u.style.top=`${Math.max(0,(h+p.box.y)*o-16)}px`,u.style.pointerEvents="none",c.append(u);}if(p&&dn.has(n.controlType)){let u=t.createElement("button");u.type="button",u.className="docx-content-control-widget",u.dataset.docxMarker="",u.dataset.docxCcWidget=n.controlType,u.dataset.docxCcId=n.id,u.setAttribute("contenteditable","false"),u.setAttribute("tabindex","-1"),n.controlType==="checkbox"?u.setAttribute("role","checkbox"):n.controlType==="dropdown"||n.controlType==="comboBox"||n.controlType==="buildingBlockGallery"?u.setAttribute("role","listbox"):(n.controlType==="date"||n.controlType==="picture")&&u.setAttribute("role","button"),n.alias&&(u.dataset.name=n.alias),n.alias&&u.setAttribute("aria-label",n.alias),n.controlType==="checkbox"&&(u.setAttribute("data-checked",s?"true":"false"),u.setAttribute("aria-checked",s?"true":"false"));let f=n.effectiveLock==="contentLocked"||n.effectiveLock==="sdtContentLocked";(d||f||n.bound)&&(u.disabled=true,u.dataset.disabledReason=d?"readOnly":n.bound?"bound":"locked",u.setAttribute("aria-disabled","true"));let x=cn(e,p.box,n.controlType,o);u.style.position="absolute",u.style.left=`${x.left}px`,u.style.top=`${x.top}px`,u.style.width=`${x.size}px`,u.style.height=`${x.size}px`,u.style.fontSize=`${x.size}px`,u.style.pointerEvents="auto",u.style.padding="0",u.style.margin="0",u.style.cursor=u.disabled?"not-allowed":"pointer",c.append(u);}return c}var et="docx-change-bars",J="docx-change-bar",un=.5;function tt(t,e){for(let n of e)switch(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 nt(t,e,n){let o=t.lines,a=o.length-1,r=[];for(let i=0;i<=a;i+=1){let s=o[i];if(r.length=0,e.mode==="simple-markup"){s.changeSites&&r.push(...s.changeSites),i===a&&t.markChangeSites&&r.push(...t.markChangeSites),r.length>0&&Qe(t,o,i,e,r,n);continue}for(let l of s.spans){l.revisions&&r.push(...l.revisions);let d=Ha(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),i===a){t.markRevisions&&r.push(...t.markRevisions),t.markFormatRevision&&r.push(t.markFormatRevision);let l=Ha(t.props);l&&r.push(l);}r.length!==0&&Qe(t,o,i,e,r,n);}}function Qe(t,e,n,o,a,r){let i=e[n],s=e.length-1,l=(n===0?t.box.y:i.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};tt(c,a),r.push(c);}function pn(t,e,n){for(let o of t.rows){let a=e.mode==="simple-markup"?o.changeSites:void 0;if(e.mode==="all-markup"&&o.revisionKind||a&&a.length>0){let r={top:o.box.y+e.dy,bottom:Math.min(o.box.y+o.box.height+e.dy,e.limit),story:e.story,insertion:o.revisionKind==="insert",deletion:o.revisionKind==="delete",format:false};a&&tt(r,a),n.push(r);}for(let r of o.cells){if(r.textDirection==="btLr"){let i=[];if(de(r.blocks,e,i),i.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 i)s.insertion||=l.insertion,s.deletion||=l.deletion,s.format||=l.format;s.bottom>s.top&&n.push(s);continue}de(r.blocks,e,n);}}}function de(t,e,n){for(let o of t)o.kind==="table"?pn(o,e,n):nt(o,e,n);}function hn(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&&n.top<=o.bottom+un){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 ot(t,e,n,o=false){let a=[];if(n==="none")return {mode:n,toggle:o,left:0,runs:a,signature:"none"};let r=t.box.height,i=t.contentBox.y-t.box.y+t.contentBox.height,s={x:t.box.x,y:t.box.y};ea(t,y=>{if(y.story==="note-separator")return;let h={mode:n,story:y.story,dy:y.origin.y-t.box.y,limit:y.story==="body"?i:r};de(y.host.fragments,h,a);let p=y.story==="header"||y.story==="footer"?u=>$(u,y.origin,s):void 0;ia(y.host,(u,f)=>{f.textboxDepth!==0&&nt(u,{mode:n,story:y.story,dy:f.storyOrigin.y-t.box.y,limit:r},a);},y.origin,p);});let l=Math.round(Math.max(0,(t.contentBox.x-t.box.x)/2)*e),d=hn(a),c=`${n}|${o?"t":""}|${l}`;for(let y of d)c+=`|${y.story}:${y.top.toFixed(3)}-${y.bottom.toFixed(3)}${y.insertion?"i":""}${y.deletion?"d":""}${y.format?"f":""}`;return {mode:n,toggle:o,left:l,runs:d,signature:c}}function rt(t,e,n){if(e.runs.length===0)return null;let o=e.mode==="simple-markup",a=t.createElement("div");a.className=et,a.dataset.docxChangeBars=e.signature,a.dataset.docxChangeBarsMode=e.mode,a.setAttribute("aria-hidden","true"),a.setAttribute("contenteditable","false"),a.style.position="absolute",a.style.inset="0",a.style.pointerEvents="none";for(let r of e.runs){let i=t.createElement("div");i.className=J,r.insertion&&i.classList.add(`${J}-insertion`),r.deletion&&i.classList.add(`${J}-deletion`),r.format&&i.classList.add(`${J}-format`),i.dataset.docxStory=r.story,i.style.position="absolute",i.style.left=`${e.left}px`,i.style.top=`${r.top*n}px`,i.style.height=`${(r.bottom-r.top)*n}px`,i.style.width=o?"var(--doc-review-change-bar-simple-width)":"var(--doc-review-change-bar-width)",i.style.backgroundColor=o?"var(--doc-review-change-bar-simple)":"var(--doc-review-change-bar)",e.toggle?(i.dataset.docxChangeBarToggle="",i.style.pointerEvents="auto",i.style.cursor="pointer"):i.style.pointerEvents="none",a.append(i);}return a}function at(t,e,n,o,a=false){return rt(t,ot(e,n,o,a),n)}function it(t,e,n,o,a,r=false){let i=e.querySelector(`:scope > .${et}`),s=ot(n,o,a,r);if(i&&i.dataset.docxChangeBars===s.signature)return;i?.remove();let l=rt(t,s,o);l&&e.append(l);}function Q(t,e,n){return !!n.activeHeaderFooterRId&&!!t.rId&&n.activeHeaderFooterRId===t.rId&&(n.activeHeaderFooterPageIndex===void 0||n.activeHeaderFooterPageIndex===e)}function ce(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 st(t,e){for(let{record:n,element:o,materialized:a}of t){if(!a)continue;let r=o.querySelector(":scope > .docx-page-content");r&&(e.activeHeaderFooterRId?r.setAttribute("contenteditable","false"):r.removeAttribute("contenteditable")),delete o.dataset.docxHfActiveKind;for(let i of o.querySelectorAll(":scope > .docx-hf:not(.docx-hf--placeholder)")){let s=fn(n,i);if(!s)continue;let l=Q(s,n.index,e);l&&(o.dataset.docxHfActiveKind=s.kind),gn(i,n,s,l,e.scale);}for(let i of o.querySelectorAll(":scope > [data-docx-hf-front]")){let s=lt(n,i.dataset.docxHfFront);dt(i,!!s&&Q(s,n.index,e));}}}function fn(t,e){return lt(t,e.dataset.docxHf)}function lt(t,e){if(e==="header")return t.header;if(e==="footer")return t.footer}function gn(t,e,n,o,a){o?(t.dataset.docxHfActive="",t.setAttribute("contenteditable","true")):(delete t.dataset.docxHfActive,t.setAttribute("contenteditable","false")),t.style.height=`${ce(n,e,o)*a}px`,dt(t,o);}function dt(t,e){let n=t.querySelectorAll(t instanceof Element&&t.classList.contains("docx-drawing-layer")?":scope > *":":scope > .docx-drawing-layer > *");for(let o of n){o.style.pointerEvents=e?"auto":"none";for(let a of o.querySelectorAll(".docx-drawing"))a.style.pointerEvents=e?"auto":"none";}}var mn=0;function ct(t,e,n,o){if(o===void 0||!Number.isFinite(o)||o<0||o>1)return;let a="http://www.w3.org/2000/svg",r=(y,h)=>{let p=t.createElementNS(a,y);for(let[u,f]of Object.entries(h))p.setAttribute(u,f);return p},i=`docx-bilevel-${++mn}`,s=r("svg",{width:"0",height:"0","aria-hidden":"true"});s.style.position="absolute",s.style.pointerEvents="none";let l=r("filter",{id:i,"color-interpolation-filters":"sRGB"});l.append(r("feColorMatrix",{type:"saturate",values:"0"}));let d=r("feComponentTransfer",{}),c=Array.from({length:256},(y,h)=>h/255>=o?1:0).join(" ");for(let y of ["R","G","B"])d.append(r(`feFunc${y}`,{type:"discrete",tableValues:c}));l.append(d),s.append(l),e.append(s),n.style.filter=`${n.style.filter} url(#${i})`.trim();}function yt(t){return Math.max(-1,Math.min(1,t))}function xn(t,e){if(!Number.isFinite(t)||!Number.isFinite(e))return null;let n=yt(t/100),o=yt(e/100);if(n===0&&o===0)return null;let a=o>=0?Math.min(1e3,1/(1-o)):Math.max(0,1+o),r=.5-n/2,i=r+n-a*r;return Object.freeze({slope:a,intercept:i})}function ee(t){if(!Number.isFinite(t))return "0";let e=Math.round(t*1e6)/1e6;return String(Object.is(e,-0)?0:e)}function bn(t){let{slope:e,intercept:n}=t;if(n>=0){let a=e+2*n;return a<=0?"brightness(0)":`contrast(${ee(e/a)}) brightness(${ee(a)})`}let o=1-2*n;return `brightness(${ee(e/o)}) contrast(${ee(o)})`}function ye(t){let e=[];t.grayscale&&e.push("grayscale(1)");let n=xn(t.brightness,t.contrast);n&&e.push(bn(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 vn=new Map([["image/svg+xml","SVG"],["image/tiff","TIFF"],["image/x-emf","EMF"],["image/x-wmf","WMF"]]),Sn="Unknown",te=new WeakMap,pe=new WeakMap,Rn=256;function ht(t,e){let n=te.get(t);if(n)return n;let o=new Map,a=new Map;return n=Object.freeze({urlForReady(r,i){let s=o.get(r.resourceKey);if(s)return s;let l;try{l=e.create(r,i);}catch(d){if(d instanceof Error&&d.message.startsWith("PaintImageUrlSource:"))return null;throw d}return o.set(r.resourceKey,l),l},imageFor(r,i,s){let l=a.get(r);if(l&&l.resourceKey===i)return l.element;let d=s.createElement("img");return a.size<Rn&&a.set(r,{element:d,resourceKey:i,...l?.readyElement?{readyElement:l.readyElement}:{}}),d},imageForPending(r){return a.get(r)?.element??null},readyElementFor(r){return a.get(r)?.readyElement??null},rememberReadyElement(r,i){let s=a.get(r);s&&a.set(r,{...s,readyElement:i});},reconcile(r,i){for(let[s,l]of o)r.has(s)||(e.revoke(l),o.delete(s));for(let[s,l]of a)i.has(s)||(l.element.removeAttribute("src"),a.delete(s));},revokeAll(){for(let r of o.values())e.revoke(r);o.clear();for(let r of a.values())r.element.removeAttribute("src");a.clear();}}),te.set(t,n),n}function he(t,e){return `${e.paintInstance??""}|${t.drawingNodeId}`}function Qo(t){te.get(t)?.revokeAll(),te.delete(t);}function k(t){return Number.isFinite(t)?String(t):"0"}function ft(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 a=(o.x-e.x)/e.width*100,r=(o.y-e.y)/e.height*100;n.push(`${k(a)}% ${k(r)}%`);}return `polygon(${n.join(", ")})`}function gt(t){let e=t.geometry.contentBounds;return nb({transform:t.transform,contentWidth:e.width,contentHeight:e.height})}function mt(t,e){let{crop:n}=t,o=Math.max(0,Math.min(1,n.left)),a=Math.max(0,Math.min(1,n.top)),r=Math.max(0,Math.min(1,n.right)),i=Math.max(0,Math.min(1,n.bottom)),s=Math.max(1e-4,1-o-r),l=Math.max(1e-4,1-a-i);return Object.freeze({width:`${k(1/s*100)}%`,height:`${k(1/l*100)}%`,left:`${k(-o/s*100)}%`,top:`${k(-a/l*100)}%`})}function wn(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(vn.get(n.mime)??Sn);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 I(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 j(t,e,n,o){let a=o?.x??0,r=o?.y??0;t.style.position="absolute",t.style.left=`${(e.x-a)*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 kn(t,e,n,o,a){let r=t.paintBounds,i=t.geometry.contentBounds,s=mt(t);return [o,n.scale,a?.x??0,a?.y??0,r.x,r.y,r.width,r.height,i.x,i.y,i.width,i.height,ft(t.geometry.clipPolygon??[],r)??"",ye(t.effects)??"",t.effects.bilevel??"",gt(t)??"",s.width,s.height,s.left,s.top,n.inertLinks?"":t.hyperlinkHref??"",t.accessibility.label??""].join("|")}function U(t,e,n,o){let a=t.createElement("div");a.className="docx-drawing docx-drawing-placeholder",a.dataset.drawingNodeId=e.drawingNodeId,j(a,e.paintBounds,n.scale,o);let r=t.createElement("div");r.className="docx-drawing-placeholder-card";let i=t.createElement("span");return i.className="docx-drawing-placeholder-label",i.textContent=wn(e,n.strings),r.append(i),a.append(r),e.hyperlinkHref&&!n.inertLinks?(a.dataset.docxDrawingLink=e.drawingNodeId,a.dataset.docxDrawingLinkKind="external",a.dataset.docxDrawingLinkHref=e.hyperlinkHref,a.setAttribute("tabindex","-1"),I(a,e,true)):I(a,e,false),a}function Pn(t,e,n,o,a,r){let i=e.resource;if(i.kind!=="ready")return U(t,e,n,r);let s=he(e,n),l=a?.readyElementFor?.(s)??t.createElement("div"),d=kn(e,i,n,o,r);if(pe.get(l)===d)return l;l.className="docx-drawing docx-drawing-ready",l.style.cssText="",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"),j(l,e.paintBounds,n.scale,r);let c=ft(e.geometry.clipPolygon??[],e.paintBounds);c&&(l.style.clipPath=c);let y=t.createElement("div");y.className="docx-drawing-image-frame",y.style.position="absolute";let h=e.geometry.contentBounds,p=e.paintBounds;y.style.left=`${(h.x-p.x)*n.scale}px`,y.style.top=`${(h.y-p.y)*n.scale}px`,y.style.width=`${h.width*n.scale}px`,y.style.height=`${h.height*n.scale}px`;let u=ye(e.effects);u&&(y.style.filter=u);let f=t.createElement("div");f.className="docx-drawing-transform-stage",f.style.position="relative",f.style.width="100%",f.style.height="100%";let x=gt(e);x&&(f.style.transform=x,f.style.transformOrigin="0 0");let w=t.createElement("div");w.className="docx-drawing-crop-viewport",w.style.position="relative",w.style.width="100%",w.style.height="100%",w.style.overflow="hidden";let v=a?.imageFor?.(s,i.resourceKey,t)??t.createElement("img");v.className="docx-drawing-image",v.setAttribute("draggable","false"),v.getAttribute("src")!==o&&v.setAttribute("src",o),v.setAttribute("alt","");let A=mt(e);return v.style.position="absolute",v.style.width=A.width,v.style.height=A.height,v.style.left=A.left,v.style.top=A.top,v.style.maxWidth="none",v.style.maxHeight="none",w.append(v),f.append(w),y.append(f),l.replaceChildren(y),ct(t,l,y,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"),I(l,e,true)):I(l,e,false),a?.rememberReadyElement?.(s,l),pe.set(l,d),l}var ue="http://www.w3.org/2000/svg";function An(t,e,n,o){let a=e.vectorShape,r=t.createElement("div");r.className="docx-drawing docx-drawing-shape",r.dataset.drawingNodeId=e.drawingNodeId,j(r,e.paintBounds,n.scale,o);let i=e.geometry.contentBounds,s=e.paintBounds,l=t.createElement("div");l.className="docx-drawing-image-frame",l.style.position="absolute",l.style.left=`${(i.x-s.x)*n.scale}px`,l.style.top=`${(i.y-s.y)*n.scale}px`,l.style.width=`${i.width*n.scale}px`,l.style.height=`${i.height*n.scale}px`;let d=t.createElementNS(ue,"svg");d.setAttribute("viewBox",`0 0 ${k(Math.max(1,a.extentEmu.cx))} ${k(Math.max(1,a.extentEmu.cy))}`),d.setAttribute("preserveAspectRatio","none"),d.setAttribute("width","100%"),d.setAttribute("height","100%"),d.style.display="block",d.style.overflow="visible";for(let c of a.components){let y=t.createElementNS(ue,"path"),h=c.subpathsEmu.map((p,u)=>`M${p.map(f=>`${k(f.x)} ${k(f.y)}`).join("L")}${c.subpathsClosed?.[u]===false?"":"Z"}`).join("");if(y.setAttribute("d",h),y.setAttribute("fill",c.fillHex!==null?`#${c.fillHex}`:"none"),y.setAttribute("fill-rule","evenodd"),c.fillAlpha<1&&y.setAttribute("fill-opacity",k(Math.max(0,c.fillAlpha))),c.strokeHex!==null&&(y.setAttribute("stroke",`#${c.strokeHex}`),y.setAttribute("stroke-width",k(Math.max(1,c.strokeWidthEmu))),c.strokeAlpha<1&&y.setAttribute("stroke-opacity",k(Math.max(0,c.strokeAlpha)))),d.append(y),c.strokeHex!==null)for(let p of c.arrowheadsEmu??[]){let u=t.createElementNS(ue,"path");u.setAttribute("d",`M${p.map(f=>`${k(f.x)} ${k(f.y)}`).join("L")}Z`),u.setAttribute("fill",`#${c.strokeHex}`),u.setAttribute("fill-opacity",k(Math.max(0,Math.min(1,c.strokeAlpha)))),u.setAttribute("data-docx-line-end","triangle"),d.append(u);}}return l.append(d),r.append(l),e.hyperlinkHref&&!n.inertLinks?(r.dataset.docxDrawingLink=e.drawingNodeId,r.dataset.docxDrawingLinkKind="external",r.dataset.docxDrawingLinkHref=e.hyperlinkHref,r.setAttribute("tabindex","-1"),I(r,e,true)):I(r,e,false),r}function En(t,e,n,o,a){let r=o.scale,i=t.createElement("div");i.className="docx-drawing docx-drawing-textbox",i.dataset.drawingNodeId=e.drawingNodeId,i.setAttribute("contenteditable","false"),j(i,e.paintBounds,o.scale,a),i.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}`),i.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]"))delete c.dataset.paragraphId;return i.append(d),I(i,e,false),i}function Ln(t,e,n){let o=n.revisionStyles,a=B(e.revisions,o?.authorSlots,o?.styles);if(!a){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}=a;t.classList.add("docx-drawing--revision",a.deleted?"docx-drawing--revision-deletion":"docx-drawing--revision-insertion"),t.classList.remove(a.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)%L):delete t.dataset.reviewAuthorSlot;}function xt(t,e,n,o,a){let r=$n(t,e,n,o,a);return r&&Ln(r,e,n),r}function $n(t,e,n,o,a){if(e.accessibility.hidden||e.paintBounds.width<=0||e.paintBounds.height<=0)return null;if(e.kind==="anchoredDrawing"&&e.textboxStory!==void 0&&n.paintStoryFragment!==void 0)return En(t,e,e.textboxStory,n,a);if(e.vectorShape&&e.vectorShape.subpathsEmu.length>0)return An(t,e,n,a);let{resource:r}=e;if(r.kind==="ready"){if(!n.imageUrlPort||!o)return U(t,e,n,a);let i=o.urlForReady(r.validatedHandle,r.mime);return i?Pn(t,e,n,i,o,a):U(t,e,n,a)}if(r.kind==="pending"){let i=o?.readyElementFor?.(he(e,n))??o?.imageForPending?.(he(e,n))?.closest(".docx-drawing-ready");return i?(pe.delete(i),i.dataset.drawingNodeId=e.drawingNodeId,j(i,e.paintBounds,n.scale,a),i):U(t,e,n,a)}return U(t,e,n,a)}function bt(t,e,n,o,a){let r=[];for(let i of e.drawings??[]){let s=xt(t,i,n,o,a);s&&r.push(s);}return Object.freeze(r)}function vt(t,e,n,o,a,r){let i=[];for(let s of e){if(ob(s)!==n)continue;let l=xt(t,s,o,a,r);l&&(l.dataset.drawingLayer=n,i.push(l));}return Object.freeze(i)}function Tn(t,e){ea(t,({host:n})=>ga(n,e));}var ut=new WeakMap;function Mn(t){let e=ut.get(t);if(e)return e;let n=[],o=[];Tn(t,r=>{r.resource.kind==="ready"&&n.push(r.resource.resourceKey),o.push(`p${t.index}|${r.drawingNodeId}`);}),ea(t,({host:r})=>ia(r,i=>{let s=i.marker?.picture;s?.resource.kind==="ready"&&n.push(s.resource.resourceKey);}));let a=Object.freeze({resourceKeys:Object.freeze(n),elementKeys:Object.freeze(o)});return ut.set(t,a),a}var pt=new WeakMap;function St(t){let e=pt.get(t);if(e)return e;let n=new Set,o=new Set;for(let r of t.pages){let i=Mn(r);for(let s of i.resourceKeys)n.add(s);for(let s of i.elementKeys)o.add(s);}let a=Object.freeze({resourceKeys:n,elementKeys:o});return pt.set(t,a),a}function Rt(t){return St(t).resourceKeys}function wt(t){return St(t).elementKeys}function kt(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 fe=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 er(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 Cn(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 Pt(t,e,n,o){let a=t.createElement("span");return a.className=e,a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.display="block",a.style.left=`${n.x*o}px`,a.style.top=`${n.y*o}px`,a.style.width=`${n.width*o}px`,a.style.height=`${n.height*o}px`,a.style.backgroundColor="currentColor",a.style.pointerEvents="none",a}function P(t,e,n,o,a=0,r=0,i=[]){let s=a+n.box.x,l=r+n.box.y,d=[...i,n.kind];switch(n.kind){case "text":case "fallback":{let c=t.createElement("span");c.className=["docx-equation-node",...d.map(y=>`docx-equation-${y}`)].join(" "),Cn(c,{x:s,y:l,width:n.box.width,height:n.box.height},o),c.textContent=n.text,c.style.display="block",c.style.fontSize=`${n.fontSizePt*o}px`,c.style.lineHeight=`${n.box.height*o}px`,c.style.whiteSpace="pre",e.append(c);break}case "row":for(let c of n.items)P(t,e,c,o,s,l,d);break;case "fraction":P(t,e,n.numerator,o,s,l,d),e.append(Pt(t,"docx-equation-fraction-bar",{...n.bar,x:s+n.bar.x,y:l+n.bar.y},o)),P(t,e,n.denominator,o,s,l,d);break;case "radical":P(t,e,n.sign,o,s,l,d),n.degree&&P(t,e,n.degree,o,s,l,d),e.append(Pt(t,"docx-equation-radical-bar",{...n.bar,x:s+n.bar.x,y:l+n.bar.y},o)),P(t,e,n.radicand,o,s,l,d);break;case "script":P(t,e,n.base,o,s,l,d),n.subscript&&P(t,e,n.subscript,o,s,l,d),n.superscript&&P(t,e,n.superscript,o,s,l,d);break;case "nary":P(t,e,n.operator,o,s,l,d),n.lowerLimit&&P(t,e,n.lowerLimit,o,s,l,d),n.upperLimit&&P(t,e,n.upperLimit,o,s,l,d),P(t,e,n.body,o,s,l,d);break}}function At(t,e,n,o){let a=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=`${a.box.width*o}px`,e.style.height=`${a.box.height*o}px`,e.style.lineHeight="0",e.style.pointerEvents="auto",e.style.userSelect="none",e.style.verticalAlign=`${-(a.box.height-a.baseline)*o}px`;let r=t.createDocumentFragment();P(t,r,a,o),e.append(r);}function Et(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 a=n.lineEndWhitespace===true;(n.style.horizontalScalePercent!==100||n.text===" "||a)&&(e.style.width=`${n.box.width*o}px`);let r=n.style.shaping!==void 0&&n.style.horizontalScalePercent!==100;if(!a&&!r||(a&&(e.style.clipPath="inset(-1em 0)"),n.style.horizontalScalePercent===100))return e;let i=t.createElement("span");if(i.dataset.docxClippedFill="",i.style.display="inline-block",i.style.transform=e.style.transform,i.style.transformOrigin=e.style.transformOrigin,r){let s=n.style.horizontalScalePercent/100;i.style.width=`${n.box.width*o/s}px`,i.style.letterSpacing=`${n.style.characterSpacingPt*o/s}px`,n.style.shaping?.wordSpacingPt&&(i.style.wordSpacing=`${n.style.shaping.wordSpacingPt*o/s}px`),i.style.direction=n.style.shaping?.direction??"ltr",i.style.transformOrigin=i.style.direction==="rtl"?"right":"left";}return i.style.textDecorationLine=e.style.textDecorationLine,i.style.textDecorationStyle=e.style.textDecorationStyle,i.style.textDecorationColor=e.style.textDecorationColor,i.style.textDecorationThickness=e.style.textDecorationThickness,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.append(i),i}function Lt(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 a=o.widthPt*n;Number.isFinite(a)&&(t.setProperty("-webkit-text-stroke-width",`${a}px`),t.setProperty("-webkit-text-stroke-color",`#${o.color}`));}var Dn=/^[0-9A-Fa-f]{6}$/;function Hn(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 a=e.side==="left"||e.side==="right",r=(a?e.box.width:e.box.height)*n,i=q(e.edge.val)?r:Math.max(1,r),s=i-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=a?`${i}px`:`${e.box.width*n}px`,o.style.height=a?`${e.box.height*n}px`:`${i}px`;let l=e.edge.color&&Dn.test(e.edge.color)?e.edge.color:"000000";return o.style.backgroundColor=`#${l}`,F(o,e.edge.val,l,a,i,n),o}function $t(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 a of e.strokes)o.append(Hn(t,a,n));return o}var In=/^[0-9A-Fa-f]{6}$/;function Fn(t){switch(t){case "dashed":return "dashed";case "dotted":return "dotted";case "double":case "triple":return "solid";default:return "solid"}}function xe(t){return t&&In.test(t)?t:"000000"}function ge(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 Bn(t,e,n,o){if(!n)return;let a=`#${xe(n.color)}`,r=`${Math.max(0,n.widthPt*o)}px`;if(t.style[`border${e}Width`]=r,t.style[`border${e}Color`]=a,n.style==="double"||n.style==="triple"){t.style[`border${e}Style`]="none";return}t.style[`border${e}Style`]=Fn(n.style);}function me(t,e,n,o,a){let r=t.createElement("div");if(r.className=a,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=`#${xe(n.color)}`;else {let i=n.side==="top"||n.side==="bottom";r.style.boxSizing="border-box",r.style[i?"borderTop":"borderLeft"]=`${(i?n.height:n.width)*o}px ${n.cssStyle} #${xe(n.color)}`;}e.append(r);}function Nn(t){let e=new Set;for(let n of t)e.add(`${n.side}\0${n.role}`);return e}function On(t,e,n,o){let a=Nn(n),r=h=>a.has(`${h}\0middle`),i=ge(t,"docx-table-border-double"),s=ge(t,"docx-table-border-triple"),l=ge(t,"docx-table-border-edge");for(let h of [i,s,l])h.style.zIndex="1";let d=false,c=false,y=false;for(let h of n){if(h.role==="edge"){y=true,me(t,l,h,o,"docx-table-border-edge-stroke");continue}if(r(h.side)){c=true,me(t,s,h,o,"docx-table-border-triple-stroke");continue}(h.role==="outer"||h.role==="inner")&&(d=true,me(t,i,h,o,"docx-table-border-double-stroke"));}d&&e.append(i),c&&e.append(s),y&&e.append(l);}function Tt(t,e,n,o){let a=new Set((n?.strokes??[]).map(r=>r.side));for(let r of ["top","right","bottom","left"]){let i=`${r[0].toUpperCase()}${r.slice(1)}`;Bn(e,i,n?.[r],o),a.has(r)&&(e.style[`border${i}Style`]="none");}n?.strokes&&n.strokes.length>0&&On(t,e,n.strokes,o);}function Mt(t,e,n,o){if(e.textDirection!=="btLr")return o;let a=t.createElement("div");return a.className="docx-table-cell-content-btlr",a.style.position="absolute",a.style.left="0",a.style.top="0",a.style.width=`${e.box.height*n}px`,a.style.height=`${e.box.width*n}px`,a.style.transformOrigin="0 0",a.style.transform=`translateY(${e.box.height*n}px) rotate(-90deg)`,o.append(a),a}var be="when-selected",Ct=new WeakMap,Dt=0;function Kn(t){let e=Ct.get(t);return e||(Dt+=1,e=`alias${Dt}`,Ct.set(t,e)),e}function Se(t){return {...t,drawingStrings:t.drawingStrings??fe,urlRegistry:t.urlRegistry??null,changeBars:t.changeBars??"none",changeBarsToggle:t.changeBarsToggle??false}}function zn(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}:{},paintStoryFragment:(n,o)=>o.kind==="table"?O(n,o,e):N(n,o,e)})}function _t(t){return Object.freeze({ctx:zn(t),urlRegistry:t.urlRegistry})}function Ht(t,e,n,o,a,r){oe(t,e,da(n),o,a,r);}function oe(t,e,n,o,a,r,i=true,s){if(n.length===0)return;let l=_t(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 vt(t,n,r,l.ctx,l.urlRegistry,a)){if(c.style.pointerEvents=i?"auto":"none",!i)for(let y of c.querySelectorAll(".docx-drawing"))y.style.pointerEvents="none";d.append(c);}d.childElementCount>0&&e.append(d);}function Ut(t){return t.horizontalFrame==="page"||t.verticalFrame==="page"}function jt(t,e,n){let o=e.paintBounds,a=$(e,t.box,n),r=a.x-e.x,i=a.y-e.y,s=l=>Object.freeze({x:l.x+r,y:l.y+i,width:l.width,height:l.height});return Object.freeze({...e,x:e.x+r,y:e.y+i,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+i})))}:{}})})}function _n(t,e,n,o,a,r){let i=o.map(l=>jt(n,l,r)),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",oe(t,s,i,a,r,"behind",false),s.childElementCount>0&&e.append(s);}function Un(t,e,n,o,a,r,i,s=false){let l=o.filter(Ut).map(d=>jt(n,d,r));oe(t,e,l,a,r,i,s,n.kind);}var K=/^[0-9A-Fa-f]{6}$/,It=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,jn=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"})),Gn=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 Wn(t){return t.doubleStrike?"double":t.strike?"single":"none"}function Xn(t){return t==="thick"||t.endsWith("Heavy")}function Gt(t){if(!t.underline)return null;let e=t.underline.color&&K.test(t.underline.color)?t.underline.color:null;return {cssStyle:jn.get(t.underline.variant)??"solid",color:e,heavy:Xn(t.underline.variant)}}function Wt(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 Ft(t,e,n){e!=="none"&&Wt(t,"line-through",e==="double"?"double":"solid",{scale:n});}function Bt(t,e,n){Wt(t,"underline",e.cssStyle,{color:e.color,heavy:e.heavy,scale:n});}function Vn(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 ne(t,e,n){let o=t.style,a=n.scale;Lt(o,e,a);let r=L$1(e);o.fontSize=`${e.fontSizePt*r*a}px`,e.bold&&(o.fontWeight="bold"),e.italic&&(o.fontStyle="italic");let i=e.fontFamily&&It.test(e.fontFamily)?e.fontFamily:n.defaultFontFamily&&It.test(n.defaultFontFamily)?n.defaultFontFamily:null;if(i){let d=n.fontAlias?.(i);o.fontFamily=d?`"${d}", "${i}", ${aa}`:`"${i}", ${aa}`;}e.color&&K.test(e.color)&&(o.color=`#${e.color}`);let s=e.highlight?Gn.get(e.highlight):void 0;s?(o.backgroundColor=s,t.dataset.highlight=e.highlight??""):e.shading&&K.test(e.shading)&&(o.backgroundColor=`#${e.shading}`),e.caps&&(o.textTransform="uppercase"),o.fontKerning=$$1(e)?"normal":"none",e.smallCaps&&(o.fontVariant="small-caps");let l=K$1(e);l!==0&&(o.position="relative",o.top=`${-l*a}px`),e.characterSpacingPt!==0&&(o.letterSpacing=`${e.characterSpacingPt*a}px`),e.horizontalScalePercent!==100&&(o.transformOrigin="left",o.transform=`scaleX(${e.horizontalScalePercent/100})`);}function Xt(t,e,n,o,a){let r=n===" "?null:Gt(o),i=Wn(o),s=e;if(r&&i!=="none"){let l=t.createElement("span");l.dataset.docxDeco="underline",Bt(l.style,r,a);let d=t.createElement("span");d.dataset.docxDeco="strike",Ft(d.style,i,a),l.append(d),e.append(l),s=d;}else r?Bt(e.style,r,a):i!=="none"&&Ft(e.style,i,a);s.textContent=n;}function D(t,e,n,o){let a=t.createElement(e);return a.style.position="absolute",a.style.left=`${n.x*o}px`,a.style.top=`${n.y*o}px`,a.style.width=`${n.width*o}px`,a.style.height=`${n.height*o}px`,a}function qn(t,e,n){let o=e.fieldAtom;!o||(t.dataset.fieldAtom=o.formField?"form":"field",!(o.formField?n.shadeFormFields!==false:(n.fieldShading??be)!=="never"))||(t.classList.add("docx-field-atom"),(o.formField||(n.fieldShading??be)==="always")&&t.classList.add("docx-field-atom--shaded"));}function Nt(t,e,n){let o=Ha(e.props),a=n.revisionStyles,r=B(e.revisions,a?.authorSlots,a?.styles);if(!(!r&&!o)){if(r){let{attribution:i}=r;t.classList.add("docx-revision",`docx-revision-${i.kind}`),t.dataset.revisionKind=i.kind,t.dataset.revisionId=i.id,i.author!==""&&(t.dataset.reviewAuthor=i.author),i.date!==void 0&&(t.dataset.revisionDate=i.date);let s=a?.styles.get(i.author);if(a){t.dataset.reviewAuthorSlot=String((a.authorSlots.get(i.author)??0)%L);let c=a.classTokens.get(i.author);if(c)for(let y=0;y<c.length;y+=1)t.classList.add(c[y]);}let d=a!==void 0&&(s?.color!==void 0||a.others==="author")?r.authorColor:r.color;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,i.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","docx-revision-format"),t.dataset.revisionKind="format",t.dataset.formattingKind="rPrChange",t.dataset.revisionId=o.id,o.author!==""&&(t.dataset.reviewAuthor=o.author),o.date!==void 0&&(t.dataset.revisionDate=o.date),a){let i=a.styles.get(o.author);t.dataset.reviewAuthorSlot=String((a.authorSlots.get(o.author)??0)%L);let s=a.classTokens.get(o.author);if(s)for(let l=0;l<s.length;l+=1)t.classList.add(s[l]);i?.color!==void 0&&(t.style.color=i.color),i?.background!==void 0&&(t.style.backgroundColor=i.background);}}}function Yn(t,e,n,o,a){let r=t.createElement("span"),i=_(e.style,e.fontSlot);if(e.equation)return r.dataset.paragraphId=e.range.paragraphId,r.dataset.start=String(e.range.start),r.dataset.end=String(e.range.end),ne(r,i,n),At(t,r,e.equation,n.scale),Nt(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=`${a*n.scale}px`,r.style.lineHeight=`${(o-a)*n.scale}px`,e.range.end>e.range.start?(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"),ne(r,i,n),qn(r,e,n),Nt(r,e,n);let s=Et(t,r,e,n.scale);if(e.text===" "){r.style.overflow="hidden",r.style.verticalAlign="top";let l=Gt(e.style);l&&e.tabLeader!=="underscore"&&(r.dataset.docxTabUnderline="",Vn(r.style,l,n.scale));}return Xt(t,s,e.text,e.style,n.scale),ze(r,e,n.scale),Ke(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 Ot(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 Zn(t,e,n,o=false){let a=n.scale,r=t.createElement("div");r.className="docx-line layout-line",r.dataset.lineId=e.id,r.dataset.paragraphId=e.range.paragraphId,r.style.position="absolute",r.style.top=`${e.box.y*a}px`,r.style.left=`${e.contentX*a}px`,r.style.height=`${e.box.height*a}px`,r.style.fontSize="0",r.style.whiteSpace="pre",r.style.overflow="visible";let i=e.leading??0,s=Math.min(Math.max(i,...e.spans.map(g=>g.box.height+i),e.spans.length===0?e.box.height-(e.trailingSpacing??0):0),e.box.height),l=Math.max(0,e.box.height-s);r.style.boxSizing="border-box",r.style.paddingBottom=`${l*a}px`,r.style.lineHeight=`${(e.box.height-l)*a}px`;let d=null,c=null,y=null,h=new Map;for(let[g,m]of pa(e).entries())h.set(m.paragraphId,g);let p=g=>h.get(g)??0,u=[...e.drawings??[]].sort((g,m)=>p(g.paragraphId)-p(m.paragraphId)||g.start-m.start),f=0,x=(g,m)=>{for(;f<u.length&&(p(u[f].paragraphId)<p(g)||p(u[f].paragraphId)===p(g)&&u[f].start<m);){let b=u[f],S=Math.max(0,b.advanceEnd-b.advanceStart),R=t.createElement("span");R.className="docx-inline-drawing-advance",R.dataset.docxMarker="",R.setAttribute("contenteditable","false"),R.setAttribute("aria-hidden","true"),R.style.display="inline-block",R.style.width=`${S*a}px`,R.style.height=`${b.baselineOffset*a}px`,R.style.lineHeight="0",R.style.pointerEvents="none",R.style.verticalAlign="baseline",r.append(R),f+=1,d=null,c=null;}},w=g=>{let m=g.wrapAdvanceBefore??0;if(m<=.001)return;let b=t.createElement("span");b.className="docx-wrap-advance",b.dataset.docxMarker="",b.setAttribute("contenteditable","false"),b.setAttribute("aria-hidden","true"),b.style.display="inline-block",b.style.width=`${m*a}px`,b.style.height="0",b.style.lineHeight="0",b.style.pointerEvents="none",b.style.verticalAlign="baseline",r.append(b),d=null,c=null;},v=e.spans.some(g=>g.style.shaping!==void 0),A=0,E=0,C=false;for(let[g,m]of e.spans.entries()){x(m.range.paragraphId,m.range.start),v||w(m);let b=Math.min(m.box.height+i,e.box.height),S=m.noteSeparator?Ne(t,m,e,a):Yn(t,m,n,b,i);v&&(S.style.position="relative",S.style.left=`${(m.box.x-e.contentX-A)*a}px`,S.style.width||(S.style.width=`${m.box.width*a}px`),S.style.direction=m.style.shaping?.direction??"ltr",S.style.unicodeBidi="isolate",m.style.shaping?.wordSpacingPt&&(S.style.wordSpacing=`${m.style.shaping.wordSpacingPt*a}px`),A+=m.box.width),E>0&&!C&&(S.style.marginLeft=`${E*a}px`);let R=e.spans[g+1],z=v?0:Jn(e,g+1,p);C=z>0&&R!==void 0&&eo(m,R),C&&(S.style.wordSpacing=`${z*a}px`),E=z;let $=m.link;if(!$){d=null,c=null,y=null,r.append(S);continue}if(m.fieldAtom){d!==null&&c===$.id&&y===m.range.start||(d=Ot(t,$,n),c=$.id,y=m.range.start,r.append(d)),d.append(S);continue}(!d||c!==$.id||y!==null)&&(d=Ot(t,$,n),c=$.id,y=null,r.append(d)),d.append(S);}if(x(pa(e)[pa(e).length-1]?.paragraphId??e.range.paragraphId,Number.POSITIVE_INFINITY),e.spans.length===0){let g=t.createElement("br");g.style.lineHeight=`${e.box.height*a}px`,r.append(g);}let T=Object.freeze({x:e.contentX,y:e.box.y,width:e.box.width,height:e.box.height});Oe(t,r,e,a),n.showParagraphMarks&&e.manualBreakAfter&&r.append(qe(t,e,a,n.revisionStyles,o));let M=_t(Se(n));if(e.drawings&&e.drawings.length>0)for(let g of bt(t,e,M.ctx,M.urlRegistry,T))r.append(g);return r}function Jn(t,e,n){if(e<=0||e>=t.spans.length)return 0;let o=t.spans[e-1],a=t.spans[e],r=n(o.range.paragraphId),i=n(a.range.paragraphId);if(t.drawings?.some(d=>{let c=n(d.paragraphId),y=c>r||c===r&&d.start>=o.range.start,h=c<i||c===i&&d.start<a.range.start;return y&&h}))return 0;let l=a.box.x-(o.box.x+o.box.width)-(a.wrapAdvanceBefore??0);return l>.001?l:0}var Qn=/[\t\n\r \u00A0\u1361\u{10100}-\u{10102}\u{1039F}\u{1091F}]/u;function eo(t,e){return !t.text.endsWith(" ")||t.style.horizontalScalePercent!==100||!to(t,e)||(e.wrapAdvanceBefore??0)>.001?false:!Qn.test(t.text.slice(0,-1))}function to(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||t.range.start===e.range.start}function N(t,e,n){let o=n.scale,a=D(t,"div",e.box,o);a.className="docx-paragraph-fragment layout-paragraph",e.clipToBox&&(a.style.overflow="hidden"),a.dataset.paragraphId=e.paragraphId,a.dataset.fragmentIndex=String(e.fragmentIndex),le(a,e),n.readOnlyParagraphIds?.has(e.paragraphId)&&(a.classList.add("docx-generated-region"),a.dataset.docxReadOnly="",a.setAttribute("contenteditable","false")),n.emptyTocPlaceholderIds?.has(e.paragraphId)&&(a.classList.add("docx-toc-empty-placeholder"),a.dataset.docxTocEmpty=""),e.shading&&K.test(e.shading)&&e.shadingBox&&a.append(ro(t,e,o)),e.marker&&a.append(no(t,e,n));for(let r of e.lines)for(let i of r.spans){if(!i.tabLeader)continue;let s=oo(t,e,r,i,n);s&&a.append(s);}if(n.showParagraphMarks&&e.paragraphEnd||e.markRevisions&&e.markRevisions.length>0){let r=Ye(t,e.markRevisions??[],o,n.revisionStyles),i=e.lines[e.lines.length-1];i&&(r.style.top=`${(i.box.y-e.box.y)*o}px`,se(r,ie(i,lb(e.props)),e.box.x,o),a.append(r));}for(let r of e.lines){let i=Zn(t,r,n,lb(e.props));e.markFormatRevision&&r===e.lines[e.lines.length-1]&&le(i,e,true),i.style.top=`${(r.box.y-e.box.y)*o}px`,i.style.left=`${(r.contentX-e.box.x)*o}px`,a.append(i);}if(e.borders)for(let r of e.borders)a.append(Kt(t,e,r,o));else e.bottomBorder&&a.append(Kt(t,e,{side:"bottom",edge:e.bottomBorder.edge,box:e.bottomBorder.box},o));return a}function no(t,e,n){let o=e.marker,a=n.scale,r=Be(t,e,Se(n));if(r)return r;let i=e.lines[0]?.leading??0,s=D(t,"span",o.box,a);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)*a}px`,s.style.top=`${(o.box.y-e.box.y)*a}px`,s.style.display="block",s.style.overflow="visible",s.style.whiteSpace="pre";let l=e.lines[0],d=l?Math.max(i,...l.spans.map(p=>p.box.height+i),l.spans.length===0?l.box.height-(l.trailingSpacing??0):0):o.box.height,c=Math.min(d,o.box.height),y=Math.max(0,o.box.height-c);s.style.fontSize="0",s.style.boxSizing="border-box",s.style.paddingBottom=`${y*a}px`,s.style.lineHeight=`${c*a}px`;let h=t.createElement("span");return h.style.display="inline-block",h.style.verticalAlign="baseline",h.style.boxSizing="border-box",h.style.height=`${c*a}px`,h.style.paddingTop=`${i*a}px`,h.style.lineHeight=`${(c-i)*a}px`,ne(h,o.style,n),Xt(t,h,o.text,o.style,a),s.append(h),s}function oo(t,e,n,o,a){let r=o.tabLeader?vb.get(o.tabLeader):void 0;if(!r||o.box.width<=0)return null;let i=a.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)*i}px`,s.style.top=`${(n.box.y-e.box.y)*i}px`,s.style.width=`${o.box.width*i}px`,s.style.height=`${n.box.height*i}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*i}px`,s.style.lineHeight=`${(n.box.height-c)*i}px`;let y=t.createElement("span");y.style.display="inline-block",y.style.verticalAlign="baseline",ne(y,o.style,a),y.style.boxSizing="border-box",y.style.height=`${d*i}px`,y.style.paddingTop=`${l*i}px`,y.style.lineHeight=`${(d-l)*i}px`,o.tabLeader==="heavy"&&(y.style.fontWeight="bold");let h=o.tabLeaderAdvancePt&&o.tabLeaderAdvancePt>0?o.tabLeaderAdvancePt:Math.max(.5,o.style.fontSizePt*.2),p=Ba((a.tabLeaderOriginXPt??0)+o.box.x,o.box.width,h);return y.style.marginLeft=`${p.offsetPt*i}px`,y.textContent=r.repeat(p.count),y.style.letterSpacing="0",s.append(y),s}function ro(t,e,n){let o=e.shadingBox,a=D(t,"div",o,n);return a.className="docx-paragraph-shading",a.setAttribute("aria-hidden","true"),a.style.left=`${(o.x-e.box.x)*n}px`,a.style.top=`${(o.y-e.box.y)*n}px`,a.style.backgroundColor=`#${e.shading}`,a}function Kt(t,e,n,o){let a=D(t,"div",n.box,o);a.className=`docx-paragraph-border docx-paragraph-border-${n.side}`,a.setAttribute("aria-hidden","true");let r=(n.box.x-e.box.x)*o,i=(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=q(n.edge.val)?l:Math.max(1,l);a.style.left=`${n.side==="right"?r-(c-l):r}px`,a.style.top=`${n.side==="bottom"?i-(c-l):i}px`,s?a.style.width=`${c}px`:a.style.height=`${c}px`;let y=n.edge.color&&K.test(n.edge.color)?n.edge.color:"000000";return a.style.backgroundColor=`#${y}`,F(a,n.edge.val,y,s,c,o),a}function ao(t,e,n,o){let a=o.scale,r=D(t,"div",e.box,a);if(r.className="docx-table-cell",r.style.left=`${(e.box.x-n.x)*a}px`,r.style.top=`${(e.box.y-n.y)*a}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",r;r.style.border="none",Tt(t,r,e.borders,a),e.shading&&K.test(e.shading)&&(r.style.backgroundColor=`#${e.shading}`);let i=Mt(t,e,a,r);for(let s of e.blocks){let l=s.kind==="table"?O(t,s,o):N(t,s,o);l.style.left=`${(s.box.x-e.box.x)*a}px`,l.style.top=`${(s.box.y-e.box.y)*a}px`,i.append(l);}return r}function O(t,e,n){let o=n.scale,a=D(t,"div",e.box,o);a.className="docx-table-fragment layout-table",a.dataset.tableId=e.tableId,a.dataset.fragmentIndex=String(e.fragmentIndex),a.style.overflow="visible";for(let r of e.rows){let i=D(t,"div",r.box,o);i.className="docx-table-row",r.revisionKind&&(i.classList.add("docx-table-row--revision",r.revisionKind==="insert"?"layout-revision-ins":"layout-revision-del"),i.dataset.revisionKind=r.revisionKind,r.revisionId!==void 0&&(i.dataset.revisionId=r.revisionId),r.revisionAuthor!==void 0&&(i.dataset.reviewAuthor=r.revisionAuthor),r.revisionDate!==void 0&&(i.dataset.revisionDate=r.revisionDate)),i.dataset.rowId=r.id,r.isHeaderRepeat&&(i.dataset.headerRepeat="true"),i.style.left=`${(r.box.x-e.box.x)*o}px`,i.style.top=`${(r.box.y-e.box.y)*o}px`,i.style.overflow="visible";for(let s of r.cells)i.append(ao(t,s,r.box,n));a.append(i);}return a}function io(t,e,n,o,a){let r={...n,paintInstance:`p${e.index}`,tabLeaderOriginXPt:e.contentBox.x-e.box.x},i=D(t,"div",e.box,r.scale);if(i.className="docx-page",i.style.fontFamily=aa,i.dataset.pageIndex=String(e.index),r.ariaHidden&&(i.setAttribute("aria-hidden","true"),i.setAttribute("role","presentation")),i.dataset.materialized=String(o),!o)return i;let s=Object.freeze({x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height}),l=Object.freeze({x:-(e.contentBox.x-e.box.x),y:-(e.contentBox.y-e.box.y),width:e.box.width,height:e.box.height});Ht(t,i,e,r,l,"behind");for(let p of [e.header,e.footer])p?.anchoredDrawings?.length&&_n(t,i,p,p.anchoredDrawings,r,{x:e.box.x,y:e.box.y,width:e.box.width,height:e.box.height});let d=e.pageBorders?$t(t,e.pageBorders,r.scale):null;d&&e.pageBorders?.zOrder==="back"&&i.append(d);let c=t.createElement("div");c.className="docx-page-content",c.style.position="absolute",c.style.left=`${(e.contentBox.x-e.box.x)*r.scale}px`,c.style.top=`${(e.contentBox.y-e.box.y)*r.scale}px`,c.style.width=`${e.contentBox.width*r.scale}px`,c.style.height=`${e.contentBox.height*r.scale}px`,r.activeHeaderFooterRId&&c.setAttribute("contenteditable","false");for(let p of e.columnSeparators??[]){let u=t.createElement("div");u.className="docx-column-separator",u.setAttribute("contenteditable","false"),u.style.position="absolute",u.style.left=`${p.x*r.scale}px`,u.style.top=`${p.y*r.scale}px`,u.style.width=`${p.width*r.scale}px`,u.style.height=`${p.height*r.scale}px`,u.style.backgroundColor="currentColor",u.style.pointerEvents="none",c.append(u);}let y=a?new Map:null;for(let p of e.fragments){let u=p.kind==="table"?O(t,p,r):N(t,p,r);y?.set(p,u),c.append(u);}a&&y&&(a.content=c,a.blocks=y),i.append(c),d&&e.pageBorders?.zOrder==="front"&&i.append(d),Ht(t,i,e,r,l,"inFront"),Ze(t,i,e,r,N,O);for(let p of ["header","footer"]){if(e[p])continue;let u=t.createElement("div");u.className="docx-hf docx-hf--placeholder",u.dataset.docxHf=p,u.setAttribute("contenteditable","false");let f=p==="header"?e.contentBox.y-e.box.y:e.box.y+e.box.height-(e.contentBox.y+e.contentBox.height),x=Math.min(f,so);if(x<=0)continue;let w=Math.max(0,Math.min(lo,f-x)),v=p==="header"?w:e.box.height-w-x;u.style.position="absolute",u.style.left=`${(e.contentBox.x-e.box.x)*r.scale}px`,u.style.top=`${v*r.scale}px`,u.style.width=`${e.contentBox.width*r.scale}px`,u.style.height=`${x*r.scale}px`,i.append(u);}for(let p of [e.header,e.footer]){if(!p)continue;let u=p.anchoredDrawings??[],f=Q(p,e.index,r),x=t.createElement("div");x.className="docx-hf",x.dataset.docxHf=p.kind,p.rId&&(x.dataset.docxRId=p.rId),f?(x.dataset.docxHfActive="",x.setAttribute("contenteditable","true")):x.setAttribute("contenteditable","false"),x.style.position="absolute",x.style.left=`${(p.box.x-e.box.x)*r.scale}px`,x.style.top=`${(p.box.y-e.box.y)*r.scale}px`,x.style.width=`${p.box.width*r.scale}px`;let w=ce(p,e,f);x.style.height=`${w*r.scale}px`,x.style.overflow="visible";let v=(e.box.x-p.box.x)*r.scale,A=(e.box.y-p.box.y)*r.scale,E=v+e.box.width*r.scale,C=A+e.box.height*r.scale;x.style.clipPath=`polygon(${v}px ${A}px, ${E}px ${A}px, ${E}px ${C}px, ${v}px ${C}px)`;let T=Object.freeze({x:0,y:0,width:p.box.width,height:p.box.height}),M=u.filter(b=>!Ut(b)),g={...r,inertLinks:true,tabLeaderOriginXPt:p.box.x-e.box.x};for(let b of p.fragments)x.append(b.kind==="table"?O(t,b,g):N(t,b,g));oe(t,x,M,Se(r),T,"inFront",f),i.append(x);let m=t.createElement("div");m.className="docx-hf-edit-hint",m.dataset.docxHfHint=p.kind,m.setAttribute("contenteditable","false"),m.style.position="absolute",m.style.left=x.style.left,m.style.width=x.style.width,m.style.top=p.kind==="header"?`${(p.box.y+p.box.height-e.box.y)*r.scale}px`:`${(p.box.y-e.box.y)*r.scale}px`,p.kind==="footer"&&(m.style.transform="translateY(-100%)"),i.append(m),Un(t,i,p,u,r,s,"inFront",f);}Je(t,i,e,r);let h=at(t,e,r.scale,r.changeBars,r.changeBarsToggle);return h&&i.append(h),i}var so=30,lo=36,ve=new WeakMap;function Nr(t){ve.delete(t);}function co(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function yo(t,e){let n=Object.keys(t);if(n.length!==Object.keys(e).length)return false;for(let o of n){let a=t[o],r=e[o];if(a!==r)return false}return true}function uo(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 po(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")continue;let a=t[o],r=e[o];if(a!==r&&!(Array.isArray(a)&&Array.isArray(r)&&uo(a,r))&&!(typeof a=="object"&&typeof r=="object"&&a!==null&&r!==null&&!Array.isArray(a)&&!Array.isArray(r)&&yo(a,r)))return false}return true}var zt="docx-column-separator";function ho(t,e,n,o){let a=e.content,r=e.blocks;if(!a||!r||a.parentElement!==e.element)return null;let i={...o,paintInstance:`p${n.index}`,tabLeaderOriginXPt:n.contentBox.x-n.box.x},s=new Map,l=[];for(let h of n.fragments){let p=r.get(h)??(h.kind==="table"?O(t,h,i):N(t,h,i));s.set(h,p),l.push(p);}let d=new Set(l),c=a.firstChild;for(;c;){let h=c.nextSibling,p=c;!d.has(p)&&p.classList?.contains(zt)!==true&&c.remove(),c=h;}let y=a.firstChild;for(;y&&y.classList?.contains(zt);)y=y.nextSibling;for(let h of l){if(h===y){y=y.nextSibling;continue}a.insertBefore(h,y);}return it(t,e.element,n,o.scale,o.changeBars,o.changeBarsToggle),{record:n,materialized:true,element:e.element,content:a,blocks:s}}function fo(t,e,n,o){let a=t.element;return !t.materialized&&co(t.record.box,e.box)&&a.style.left===`${e.box.x*n}px`&&a.style.top===`${e.box.y*n}px`&&a.style.width===`${e.box.width*n}px`&&a.style.height===`${e.box.height*n}px`&&a.getAttribute("aria-hidden")===(o?"true":null)}function go(t,e,n={}){mo(t,e,n);}function mo(t,e,n,o){t.classList.toggle("docx-show-paragraph-marks",n.showParagraphMarks??false);let a=n.contentControlChrome,r=a?`${a.showAll===true?"1":"0"}:${a.activeIds?[...a.activeIds].sort().join(","):""}:${a.checkedIds?[...a.checkedIds].sort().join(","):""}:${a.tocControlIds?[...a.tocControlIds].sort().join(","):""}:${a.suppressedIds?[...a.suppressedIds].sort().join(","):""}:${a.readOnly===true?"ro":""}`:"",i=n.drawingStrings??fe,s=n.imageUrlPort!==void 0?ht(t,n.imageUrlPort):null,l=a?.additionalBoundaries?a.additionalBoundaries.flatMap(g=>g.fragments.map(m=>`${g.id}:${m.pageIndex}:${m.box.x}:${m.box.y}:${m.box.width}:${m.box.height}`)).sort().join(","):"",d=n.readOnlyParagraphIds?[...n.readOnlyParagraphIds].sort().join(","):"",c=n.emptyTocPlaceholderIds?[...n.emptyTocPlaceholderIds].sort().join(","):"",y=a?.tocControlIds?[...a.tocControlIds].sort().join(","):"",h=Ve(n.revisionStyles,e,o),p={scale:n.scale??96/72,ariaHidden:n.ariaHidden??true,drawingStrings:i,urlRegistry:s,...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,changeBars:n.changeBars??"all-markup",changeBarsToggle:n.changeBarsToggle??false,...n.shadeFormFields!==void 0?{shadeFormFields:n.shadeFormFields}:{},...h?{revisionStyles:h}:{},...n.imageUrlPort?{imageUrlPort:n.imageUrlPort}:{},...n.activeHeaderFooterRId?{activeHeaderFooterRId:n.activeHeaderFooterRId}:{},...n.activeHeaderFooterPageIndex!==void 0?{activeHeaderFooterPageIndex:n.activeHeaderFooterPageIndex}:{},...a?{contentControlChrome:a}:{}},u=t.ownerDocument,f=`${p.scale}|${p.ariaHidden}|${p.fontAlias?Kn(p.fontAlias):""}|${p.defaultFontFamily??""}|cc:${r}:${l}|toc:${y}|ro:${d}|tocEmpty:${c}|${n.imageUrlPort?"url":""}|${kt(i)}|rev:${Xe(h)}|marks:${n.showParagraphMarks??false}|bars:${p.changeBars}:${p.changeBarsToggle}`,x=ve.get(t),w=x?.parameters===f,v=w?new Map(x.pages.map(g=>[g.record,g])):null,A=x?new Map(x.pages.map(g=>[g.record.index,g])):null,E=e.pages.map(g=>{let m=n.materialize?.has(g.index)??true,b=v?.get(g);if(b&&b.materialized===m)return b;let S=A?.get(g.index);if(!m&&S&&fo(S,g,p.scale,p.ariaHidden))return {record:g,materialized:false,element:S.element};if(w&&m&&S?.materialized&&po(S.record,g)){let $=ho(u,S,g,p);if($)return $}let R={},z=io(u,g,p,m,R);return {record:g,materialized:m,element:z,...R.content?{content:R.content}:{},...R.blocks?{blocks:R.blocks}:{}}});ve.set(t,{parameters:f,pages:E}),t.dataset.revision=String(e.revision),s&&s.reconcile(Rt(e),wt(e));let C=new Set(E.map(g=>g.element)),T=t.firstChild;for(;T;){let g=T.nextSibling;C.has(T)||T.remove(),T=g;}let M=t.firstChild;for(let g of E){if(g.element===M){M=M.nextSibling;continue}t.insertBefore(g.element,M);}st(E,p);}function xo(t,e,n,o){let a=t.ownerDocument,r=o.scale,i=[];for(let s of n){let l=e.pages[s.pageIndex];if(!l)continue;let d=a.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%L),d.style.setProperty("--doc-review-author-current",s.reviewAuthor.color)),s.activeBackground!==void 0&&(d.style.backgroundColor=s.activeBackground,d.style.boxShadow="none"),i.push(d);}t.replaceChildren(...i);}
|
|
2
|
+
export{Z as a,We as b,To as c,on as d,Mo as e,Qo as f,kt as g,fe as h,er as i,be as j,Gn as k,Nr as l,go as m,mo as n,xo as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkCB6RQ3GD_cjs=require('./chunk-CB6RQ3GD.cjs');var X=new Set(["document","hdr","ftr","footnotes","endnotes"]),W=24,U=512,E=chunkCB6RQ3GD_cjs.zg(W);function z(o){let t=o.root;return t.namespaceUri===chunkCB6RQ3GD_cjs.da&&X.has(t.localName)}function $(o){let t=[],e=r=>{if(r.kind!=="textValue"){r.namespaceUri===chunkCB6RQ3GD_cjs.da&&r.localName==="p"&&t.push(r);for(let i of r.children)e(i);}};return e(o.root),t}function V(o){let t=chunkCB6RQ3GD_cjs.Qb(o);let e=[],r=new Set;for(let i of $(t)){let n=chunkCB6RQ3GD_cjs.Kb(i);if(!n||!chunkCB6RQ3GD_cjs.Jb(n))continue;let a=n.toUpperCase();if(r.has(a))continue;r.add(a);let s=chunkCB6RQ3GD_cjs.Ui(t,i.id);s!==null&&e.push(Object.freeze({paragraphId:a,nodeId:i.id,text:s}));}return Object.freeze(e)}function Y(o){let t=E.get(o.root);if(t)return t;let e=chunkCB6RQ3GD_cjs.Qb(o);let r=new Map,i=new Set,n=a=>{if(a.kind!=="textValue"){if(a.namespaceUri===chunkCB6RQ3GD_cjs.da&&a.localName==="p"){let s=chunkCB6RQ3GD_cjs.Kb(a);if(s&&chunkCB6RQ3GD_cjs.Jb(s)){let p=s.toUpperCase();i.has(p)||(i.add(p),a.kind==="paragraph"&&r.set(p,a.id));}}for(let s of a.children)n(s);}};return n(e.root),E.set(o.root,r),r}function w(o,t){if(o.length!==t.length)return false;for(let e=0;e<o.length;e+=1)if(o[e].root!==t[e])return false;return true}function B(o){let t=new Map,e=null,r=(n,a,s)=>{for(t.delete(n),t.set(n,{partName:a.name,root:a.root,nodeId:s});t.size>U;){let p=t.keys().next();if(p.done)break;t.delete(p.value);}},i=(n,a)=>{let s=t.get(n);if(!s)return null;let p=a.find(c=>c.name===s.partName);if(!p)return null;if(p.root===s.root)return {part:p,nodeId:s.nodeId};let l=chunkCB6RQ3GD_cjs.Ha(p,s.nodeId);if(!l||l.kind!=="paragraph")return null;let d=chunkCB6RQ3GD_cjs.Kb(l);return !d||d.toUpperCase()!==n?null:(r(n,p,s.nodeId),{part:p,nodeId:s.nodeId})};return n=>{let a=o(),s=i(n,a);if(s)return s;if(e&&e.ids.has(n)&&w(a,e.roots))return null;for(let p of a){let l=Y(p).get(n);if(l!==void 0)return r(n,p,l),{part:p,nodeId:l}}return (!e||!w(a,e.roots))&&(e={roots:a.map(p=>p.root),ids:new Set}),e.ids.size<U&&e.ids.add(n),null}}function H(o,t){return chunkCB6RQ3GD_cjs.Ba(o,t)}var q=Object.freeze({kind:"body"}),F=1e6;function b(o,t){if(t<=0||t>=o.length)return false;let e=o.charCodeAt(t-1),r=o.charCodeAt(t);return e>=55296&&e<=56319&&r>=56320&&r<=57343}function Q(o,t,e){if(t===e)return [];let r=0,i=Math.min(t.length,e.length);for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r+=1;for(;r>0&&(b(t,r)||b(e,r));)r-=1;let n=0;for(;n<t.length-r&&n<e.length-r&&t.charCodeAt(t.length-n-1)===e.charCodeAt(e.length-n-1);)n+=1;for(;n>0&&(b(t,t.length-n)||b(e,e.length-n));)n-=1;let a=t.length-r-n,s=e.slice(r,e.length-n),p=[];return a>0&&p.push({op:"deleteText",paragraphId:o,start:r,end:r+a}),s.length>0&&p.push({op:"insertText",paragraphId:o,offset:r,text:s}),Object.freeze(p)}function K(o){let t=r=>!!r&&r.kind!=="textValue"&&r.namespaceUri===chunkCB6RQ3GD_cjs.da&&r.localName==="t"&&r.attributes.every(i=>i.namespaceUri===chunkCB6RQ3GD_cjs.ea&&i.localName==="space")&&r.children.every(i=>i.kind==="textValue"),e=[];for(let r of o){let i=e.at(-1);if(!t(i)||!t(r)){e.push(r);continue}let n=i.children.map(a=>a.kind==="textValue"?a.value:"").join("")+r.children.map(a=>a.kind==="textValue"?a.value:"").join("");e[e.length-1]={...i,attributes:/^\s|\s$/.test(n)?[{kind:"xmlSpace",namespaceUri:chunkCB6RQ3GD_cjs.ea,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:i.children[0]?.id??`${i.id}/text`,kind:"textValue",value:n}]};}return e}function G(o){if(o.kind==="textValue")return o;let t=false,e=o.children.map(r=>{let i=G(r);return i!==r&&(t=true),i});if(o.namespaceUri===chunkCB6RQ3GD_cjs.da&&o.localName==="r"){let r=K(e);(r.length!==e.length||r.some((i,n)=>i!==e[n]))&&(e=[...r],t=true);}return t?{...o,children:e}:o}function rr(o,t,e){let r=o.parts.get(t);if(!r)return o;let i=false,n=new Set;for(let a of e)(a.op==="insertText"||a.op==="deleteText")&&!a.revision&&n.add(a.paragraphId);for(let a of n){let s=chunkCB6RQ3GD_cjs.Ha(r,a);if(!s||s.kind==="textValue")continue;let p=G(s);if(p===s)continue;let l=chunkCB6RQ3GD_cjs.Ma(r,a,p,{deferValidation:true});l.ok&&(r=l.part,i=true);}return i?chunkCB6RQ3GD_cjs.lc(o,r):o}function er(o,t){let e=t.documentId.trim();if(e.length===0||e.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let r=()=>V(o.bodyStore().part),i,a=B(()=>{let l=o.bodyStore().part,d=o.currentPackage();if(i?.pkg===d&&i.body===l)return i.parts;let c=[l];for(let g of d.parts.values())g===l||!z(g)||c.push(g);return i={pkg:d,body:l,parts:Object.freeze(c)},i.parts}),s=(l,d)=>{if(l.length===0)return {ok:true,changed:false};let c=r(),g=new Set,h=[];for(let u of l){if(typeof u.text!="string"||u.text.length>F)return {ok:false,reason:"collaboration-text-limit"};if(typeof u.paragraphId!="string"||u.paragraphId.length===0||u.paragraphId.length>256)return {ok:false,reason:"unknown-paragraph-id"};let m=u.paragraphId.toUpperCase();if(g.has(m))return {ok:false,reason:"duplicate-paragraph-id"};g.add(m);let N=c.filter(L=>L.paragraphId===m);if(N.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let T=N[0];h.push(...Q(T.nodeId,T.text,u.text));}if(h.length===0)return {ok:true,changed:false};let y=o.transact(q,u=>{for(let m of h)u.apply(m);u.applyPackage(m=>rr(m,m.mainDocumentPart,h));},{origin:d.origin,actorId:d.actorId,operationId:d.operationId,recordsHistory:false});return y.ok?{ok:true,changed:y.change!==null}:{ok:false,reason:y.detail??y.reason}};return Object.freeze({documentId:e,paragraphs:r,paragraphByNodeId(l){return r().find(d=>d.nodeId===l)??null},paragraphByStableId(l){let d=l.toUpperCase(),c=a(d);if(!c)return null;let g=chunkCB6RQ3GD_cjs.Ui(c.part,c.nodeId);return g===null?null:Object.freeze({paragraphId:d,nodeId:c.nodeId,text:g})},applyParagraphText(l,d,c){return s([{paragraphId:l,text:d}],c)},applyParagraphTexts:s,applyRemotePackage(l,d){let c=o.publishRemotePackage(l,d);return c.ok?{ok:true,changed:c.change!==null}:{ok:false,reason:c.detail??c.reason}},revision:()=>o.packageRevision,subscribe:l=>o.subscribe(l),observePrimitiveJournal:l=>H(o,l),hasPendingJournals:()=>chunkCB6RQ3GD_cjs.za(o),flushPendingJournals:()=>{chunkCB6RQ3GD_cjs.Aa(o);},save:()=>chunkCB6RQ3GD_cjs.kc(o.currentPackage()),binaryPart(l){let d=o.currentPackage();return d.partBytes.get(l)??d.partBytes.get(l.startsWith("/")?l.slice(1):`/${l}`)??null}})}exports.a=rr;exports.b=er;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {Ya,Wa,Xa}from'./chunk-GG4IAKFI.js';import {ce,xe,Ye,te,he,ue,ie,ke,se,ve}from'./chunk-UOQONZVQ.js';var _=4096,L=ue*16;function I(){return {out:[],runs:[],length:0}}function D(e,n,s,t){if(n.length===0||s===t)return;let o=e.runs[e.runs.length-1];if(o?.runId===n&&o.end===s){e.runs[e.runs.length-1]={runId:n,start:o.start,end:t};return}e.runs.push({runId:n,start:s,end:t});}function M(e,n,s,t){if(n.length>t.left)return false;if(t.left-=n.length,n.length>0){let o=e.length;e.out.push(n),e.length+=n.length,D(e,s,o,e.length);}return true}function v(e,n){let s=e.length;n.text.length>0&&e.out.push(n.text),e.length+=n.text.length;for(let t of n.runs)D(e,t.runId,s+t.start,s+t.end);}function O(e){return {text:e.out.join(""),runs:e.runs}}function j(){return {text:ce,runs:[]}}function W(e){for(let n of e)if(!n.separated)return false;return true}function H(e,n=0,s=e.length,t){let o=new Set,l=new Map,r=new Map,d=t?[t]:[];t&&o.add(t);for(let a=n;a<s;a+=1){let i=e[a].node;if(he(i,"begin")){d.push(i.id);continue}if(he(i,"separate")){let u=d[d.length-1];u&&(o.add(u),l.set(i.id,u));continue}if(he(i,"end")){let u=d.pop();u&&(o.add(u),r.set(i.id,u));}}return {activeBegins:o,separateBegin:l,endBegin:r}}function z(e,n,s){if(he(s,"begin"))return n.activeBegins.has(s.id)&&e.push({beginId:s.id,separated:false}),true;if(he(s,"separate")){let t=n.separateBegin.get(s.id),o=e[e.length-1];return t&&o?.beginId===t&&(o.separated=true),true}if(he(s,"end")){let t=n.endBegin.get(s.id),o=e[e.length-1];return t&&o?.beginId===t&&e.pop(),true}return false}function J(e,n,s,t){let o=[];if(!te(e,o,s))return null;let l=o.reverse(),r=I();for(;l.length>0;){let d=l.pop();if(n==="original"&&d.hiddenInOriginal)continue;if(ke(d.node)){let i=[];if(!te(d.node,i,s))return null;for(let u=i.length-1;u>=0;u-=1)l.push(i[u]);continue}if(ie(d.node))continue;let a=se(d.node);if(!M(r,a,d.runId,t))return null}return O(r)}function K(e,n,s,t,o){let l=I(),r=[],d=H(e);for(let a of e){let i=a.node;if(z(r,d,i)||ie(i)||!W(r)||n==="original"&&a.hiddenInOriginal)continue;if(ke(i)){let c=o>=ve?J(i,n,s,t):X(i,n,s,t,o+1);if(c===null)return null;v(l,c);continue}let u=se(i);if(!M(l,u,a.runId,t))return null}return O(l)}function X(e,n,s,t,o){let l=[];return te(e,l,s)?K(l,n,s,t,o):null}function Y(e,n,s){let t=n.node;if(e.owned.has(t.id)&&(e.nodesLeft-=1,e.nodesLeft<0&&(e.overflow=true)),he(t,"begin"))return t.id!==e.span.node.id&&e.markers.activeBegins.has(t.id)&&e.states.push({beginId:t.id,separated:false}),false;if(he(t,"separate")){let l=e.markers.separateBegin.get(t.id),r=e.states[e.states.length-1];return l&&r?.beginId===l&&(r.separated=true),false}if(he(t,"end")){if(t.id===e.endId)return true;let l=e.markers.endBegin.get(t.id),r=e.states[e.states.length-1];return l&&r?.beginId===l&&e.states.pop(),false}if(e.overflow||ie(t)||ke(t)||!e.owned.has(t.id)||!W(e.states)||s==="original"&&n.hiddenInOriginal)return false;let o=se(t);return M(e.result,o,n.runId,e.chars)||(e.overflow=true),false}function U(e,n,s="allMarkup"){let t=new Map,o=new Map,l=new Map;for(let i of n)i.kind==="complex"?o.set(i.node.id,i):l.set(i.node.id,i);let r=[];te(e,r);let d=new Map;for(let i=0;i<r.length;i+=1)d.set(r[i].node.id,i);let a=null;for(let i=0;i<r.length;i+=1){let u=r[i],c=l.get(u.node.id);if(c){let f={left:_},p={left:L},g=X(c.node,s,f,p,0);t.set(c.node.id,g??j());}if(a===null){let f=o.get(u.node.id);if(!f)continue;let p=new Set(f.removeNodeIds),g=-1;for(let R=f.removeNodeIds.length-1;R>=0;R-=1){let m=d.get(f.removeNodeIds[R]);if(!(m===void 0||m<=i)&&he(r[m].node,"end")){g=m;break}}let x=r[g];if(!x){t.set(f.node.id,j());continue}a={span:f,owned:p,states:[{beginId:f.node.id,separated:false}],markers:H(r,i+1,g,f.node.id),endId:x.node.id,result:I(),chars:{left:L},nodesLeft:_,overflow:false};}Y(a,u,s)&&(t.set(a.span.node.id,a.overflow?j():O(a.result)),a=null);}return a!==null&&t.set(a.span.node.id,j()),t}function Z(e){let n=[],s=0;for(let t of e){let o=s+t.text.length;t.resultRuns?n.push({text:t.text,rawStart:t.rawStart,rawEnd:t.rawEnd,resultRuns:t.resultRuns,projectedStart:s,projectedEnd:o,expansion:t.text.length!==t.rawEnd-t.rawStart}):n.push({text:t.text,rawStart:t.rawStart,rawEnd:t.rawEnd,projectedStart:s,projectedEnd:o,expansion:t.text.length!==t.rawEnd-t.rawStart}),s=o;}return n}function $(e,n){return n<=e.rawStart?e.projectedStart:n>=e.rawEnd?e.projectedEnd:e.expansion?e.projectedStart:e.projectedStart+n-e.rawStart}function G(e,n){return e.expansion?e.rawStart:e.rawStart+n-e.projectedStart}function Q(e,n){return e.expansion?e.rawEnd:e.rawStart+n-e.projectedStart}function B(e){let n=Z(e),s="";for(let t of e)s+=t.text;return {text:s,projectedOffset(t){let o=0;for(let l of n){if(t<=l.rawEnd)return $(l,t);o=l.projectedEnd;}return o},rawRange(t,o){if(t<0||t>=o||o>s.length)return null;let l=n.find(d=>t>=d.projectedStart&&t<d.projectedEnd),r=n.find(d=>o>d.projectedStart&&o<=d.projectedEnd);return !l||!r?null:{start:G(l,t),end:Q(r,o)}},sliceRaw(t,o){if(t>=o)return "";let l="";for(let r of n){if(r.expansion){t<=r.rawStart&&o>=r.rawEnd&&(l+=r.text);continue}let d=Math.max(t,r.rawStart),a=Math.min(o,r.rawEnd);d<a&&(l+=r.text.slice(d-r.rawStart,a-r.rawStart));}return l},resultRunAddressAt(t){let o=n.find(r=>r.resultRuns!==void 0&&t>=r.projectedStart&&t<r.projectedEnd);if(!o?.resultRuns)return null;let l=t-o.projectedStart;for(let r of o.resultRuns)if(l>=r.start&&l<r.end)return {runId:r.runId,offset:l-r.start};return null},findOccurrences(t,o,l={}){let r=[];if(o<=0||!Ya(t)||s.length===0)return {matches:r,truncated:false};let d=l.matchCase===true,a=l.wholeWord===true,i=d?t:Wa(t),u=d?s:Wa(s),c=Math.min(s.length,l.to??s.length),f=new Set,p=u.indexOf(i,Math.max(0,l.from??0));for(;p>=0;){let g=p+i.length;if(g>c)return {matches:r,truncated:false};if(!a||Xa(s,p,g)){let x=n.find(b=>p>=b.projectedStart&&p<b.projectedEnd),R=n.find(b=>g>b.projectedStart&&g<=b.projectedEnd);if(!x||!R)return {matches:r,truncated:false};let m=x===R&&x.expansion?x:null;if(!m||!f.has(m)){if(r.length>=o)return {matches:r,truncated:true};r.push({start:p,length:i.length,rawStart:G(x,p),rawEnd:Q(R,g)}),m&&f.add(m);}}p=u.indexOf(i,g);}return {matches:r,truncated:false}}}}function q(e){return e.length===0?B([]):B([{text:e,rawStart:0,rawEnd:e.length}])}function ee(e,n,s="allMarkup"){if(!n.includes(ce))return n.length===0?[]:[{text:n,rawStart:0,rawEnd:n.length}];let t=xe(e),o=Ye(e,t),l=U(e,t,s),r=new Map;for(let i of t)r.set(i.node.id,i);let d=[],a=0;for(let i of o){let u=r.get(i.node.id);if(!u)continue;a<i.start&&d.push({text:n.slice(a,i.start),rawStart:a,rawEnd:i.start});let c=l.get(u.node.id);u.kind==="simple"&&c?d.push({text:c.text,rawStart:i.start,rawEnd:i.end,resultRuns:c.runs}):d.push({text:c?.text??ce,rawStart:i.start,rawEnd:i.end}),a=i.end;}return a<n.length&&d.push({text:n.slice(a),rawStart:a,rawEnd:n.length}),d}function le(e,n,s="allMarkup"){return n.includes(ce)?B(ee(e,n,s)):q(n)}export{B as a,q as b,ee as c,le as d};
|