@docx-editor.dev/core 2.35.0 → 2.35.1-canary.20261106032727.sha-b131138

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.ts +8 -8
  3. package/dist/automation.js +1 -1
  4. package/dist/binding.cjs +1 -1
  5. package/dist/binding.d.ts +12 -12
  6. package/dist/binding.js +1 -1
  7. package/dist/{chrome-print-H0uSxdg3.d.ts → chrome-print-D77Z2MRQ.d.ts} +11 -11
  8. package/dist/{chunk-LMASPHYS.js → chunk-27XCGHXI.js} +1 -1
  9. package/dist/chunk-2JVOX642.cjs +236 -0
  10. package/dist/{chunk-2C75IWUN.cjs → chunk-462QYTNK.cjs} +1 -1
  11. package/dist/{chunk-JGE2O6IF.cjs → chunk-5QL7GBV2.cjs} +2 -2
  12. package/dist/{chunk-4NISR27M.cjs → chunk-7AFHVNPA.cjs} +13 -13
  13. package/dist/{chunk-6767S7UF.js → chunk-ASWUP7GU.js} +1 -1
  14. package/dist/{chunk-K2BBJDM7.js → chunk-CCM264XP.js} +1 -1
  15. package/dist/{chunk-NYZP5NM3.js → chunk-CORSCVCC.js} +1 -1
  16. package/dist/{chunk-Q5YVLUGG.js → chunk-FIT3HAWE.js} +1 -1
  17. package/dist/{chunk-SJV6WCTP.cjs → chunk-FTEXTGTC.cjs} +1 -1
  18. package/dist/{chunk-66ZAVRGB.js → chunk-GOXXQ2G3.js} +1 -1
  19. package/dist/{chunk-WWZWT26M.cjs → chunk-GP46C4QJ.cjs} +1 -1
  20. package/dist/{chunk-QDUMZYTX.js → chunk-I7C2C6IZ.js} +1 -1
  21. package/dist/chunk-KIDYIVZ5.js +236 -0
  22. package/dist/{chunk-6BZINLEN.cjs → chunk-Q3OARWRD.cjs} +1 -1
  23. package/dist/{chunk-QLANEOTJ.cjs → chunk-QHE5FKW3.cjs} +4 -4
  24. package/dist/{chunk-TMCMXIBT.js → chunk-R6SVC45W.js} +4 -4
  25. package/dist/{chunk-Y3JSN52G.cjs → chunk-RB55BB5N.cjs} +1 -1
  26. package/dist/{chunk-FLEFHRJG.cjs → chunk-RFM64DRG.cjs} +5 -5
  27. package/dist/{chunk-UAUB5YV6.js → chunk-RTOCN5IQ.js} +1 -1
  28. package/dist/{chunk-2V3V57SC.js → chunk-SCK44KXL.js} +1 -1
  29. package/dist/{chunk-5ZE7ROGP.js → chunk-STK3RNDU.js} +1 -1
  30. package/dist/{chunk-QALWAAPL.cjs → chunk-TRNTPFVY.cjs} +2 -2
  31. package/dist/{chunk-CBJMRC4L.cjs → chunk-TUSRTFEW.cjs} +1 -1
  32. package/dist/{chunk-FMSXJ22B.js → chunk-UMSQMNZU.js} +1 -1
  33. package/dist/{chunk-I4OZW2NO.js → chunk-V5NOTQ6L.js} +1 -1
  34. package/dist/{chunk-AVGSD7FB.js → chunk-XEGE36HF.js} +1 -1
  35. package/dist/{chunk-32YOHLEK.cjs → chunk-Y6FY46N6.cjs} +23 -23
  36. package/dist/{chunk-DSIDCA3V.cjs → chunk-YRJYEXVN.cjs} +4 -4
  37. package/dist/{chunk-TY5CE2JR.cjs → chunk-ZG6KPMLF.cjs} +1 -1
  38. package/dist/collaboration/replication.cjs +1 -1
  39. package/dist/collaboration/replication.d.ts +3 -3
  40. package/dist/collaboration/replication.js +1 -1
  41. package/dist/collaboration.d.ts +2 -2
  42. package/dist/contracts/document.d.ts +2 -2
  43. package/dist/contracts/editor.d.ts +8 -8
  44. package/dist/contracts/modules.d.ts +10 -10
  45. package/dist/contracts/types.d.ts +3 -3
  46. package/dist/{custom-node-writes-Cj0itq58.d.ts → custom-node-writes-BXn8hCVV.d.ts} +2 -2
  47. package/dist/{document-protection-CDLoYQI3.d.ts → document-protection-CfNgyZ4W.d.ts} +1 -1
  48. package/dist/{drawing-graphic-kind-8zt6pugF.d.ts → drawing-graphic-kind-C_kXByHh.d.ts} +2 -2
  49. package/dist/{drawing-preview-package-8o9LSfzP.d.ts → drawing-preview-package-W4jCeIW0.d.ts} +1 -1
  50. package/dist/{editor-CujQcn1z.d.ts → editor-CG4FJl_e.d.ts} +4 -4
  51. package/dist/editor.cjs +1 -1
  52. package/dist/editor.d.ts +25 -25
  53. package/dist/editor.js +1 -1
  54. package/dist/export.cjs +2 -2
  55. package/dist/export.d.ts +6 -6
  56. package/dist/export.js +1 -1
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.d.ts +17 -17
  59. package/dist/index.js +1 -1
  60. package/dist/{layout-shaping-ZjLRz_qa.d.ts → layout-shaping-Cxkd9f_f.d.ts} +1 -1
  61. package/dist/layout.cjs +1 -1
  62. package/dist/layout.d.ts +17 -17
  63. package/dist/layout.js +1 -1
  64. package/dist/{note-properties-BRpskBeh.d.ts → note-properties-DvCg9hqk.d.ts} +1 -1
  65. package/dist/output.cjs +1 -1
  66. package/dist/output.d.ts +10 -10
  67. package/dist/output.js +1 -1
  68. package/dist/{protocol-GVVQQwCX.d.ts → protocol-BVr4_nzI.d.ts} +2 -2
  69. package/dist/{review-paragraph-order-aEHnQTt7.d.ts → review-paragraph-order-cFZfc4oS.d.ts} +1 -1
  70. package/dist/{revision-projection-vU_UiTLx.d.ts → revision-projection-BcWPdgFd.d.ts} +1 -1
  71. package/dist/{semantic-cell-selection-CaRIISu-.d.ts → semantic-cell-selection-CYS_l73g.d.ts} +2 -2
  72. package/dist/{semantic-interaction-LJtUJJS5.d.ts → semantic-interaction-DyXHZhFO.d.ts} +1 -1
  73. package/dist/{semantic-paint-2LBYlQcn.d.ts → semantic-paint-ChK1a0Qd.d.ts} +4 -4
  74. package/dist/{semantic-record-queries-C_YK2gCz.d.ts → semantic-record-queries-CYAipThi.d.ts} +1 -1
  75. package/dist/{semantic-records-AU2pIYRp.d.ts → semantic-records-D0NEAzyD.d.ts} +3 -3
  76. package/dist/store.cjs +1 -1
  77. package/dist/store.d.ts +12 -12
  78. package/dist/store.js +1 -1
  79. package/dist/{tree-op-types-DmrePCMo.d.ts → tree-op-types-Ds9-dl3T.d.ts} +7 -1
  80. package/dist/{tree-package-fragment-DXZ2B7x0.d.ts → tree-package-fragment-Cya6ExyS.d.ts} +1 -1
  81. package/dist/{tree-session-contract-D3e-5YNq.d.ts → tree-session-contract-DiNorPOQ.d.ts} +4 -4
  82. package/dist/{unsupported-elements-9Pz4I_F6.d.ts → unsupported-elements-CJ33VvL9.d.ts} +1 -1
  83. package/package.json +2 -2
  84. package/dist/chunk-DCILO4XD.cjs +0 -236
  85. package/dist/chunk-P3XUE72N.js +0 -236
@@ -1,4 +1,4 @@
1
- import {i,g as g$1,e,f}from'./chunk-LMASPHYS.js';import {hd as hd$1,lf as lf$1,mf as mf$1,pf as pf$1,zb,sd as sd$1,kf as kf$1,zd as zd$1,se as se$1,Md as Md$2,od as od$1,Kd as Kd$1,pd as pd$1,nf as nf$1,_c as _c$2,wf,td as td$1,ud as ud$2}from'./chunk-K2BBJDM7.js';import {b as b$2,c,a as a$1}from'./chunk-Q5YVLUGG.js';import {sa,S,za,Ca,la,da,ba,ca,fa,ea as ea$1,Aa,T,U,W as W$1,V,xa,$,aa as aa$1,na as na$1,pa as pa$1,qa,oa as oa$2,ra as ra$1}from'./chunk-NYZP5NM3.js';import {b as b$1,a}from'./chunk-I4OZW2NO.js';import {eb,Bi,ki,qi,ud as ud$1,Pa,pa,cb,Bk,jb,rg,Bg,zg,Ag,lg,Eb,ng,Hb,sf as sf$1,pj,Qc as Qc$1,Tc as Tc$1,Rc as Rc$1,_c as _c$1,g,qf,re as re$1,se,Xa,ej,vd as vd$1,Bf,pb,wj,ob,Ve as Ve$1,hd as hd$2,cd as cd$1,X,hn,ai,Cd as Cd$1,Ad as Ad$1,yd as yd$1,xd as xd$1,Dd as Dd$1,Ed as Ed$1,Bd as Bd$1,wa,oa as oa$1,ma,id as id$1,wb,Od as Od$1,Md as Md$1,va,Jm as Jm$1,jd as jd$1,Sh,Qh,qc as qc$1,Uh,fb,Mm as Mm$1,xj,Kk,Um as Um$1,Zm as Zm$1,Vm as Vm$1,Ym as Ym$1,Wm as Wm$1,an as an$1,zm as zm$1,yj,Ei,Cj,uc as uc$1,oc,sc,Al as Al$1,Ol as Ol$1,jm as jm$1,mm as mm$1,ml as ml$1,ql as ql$1,Ok,dj,He,fj,Fe,ei,ci,si,Rh,Aj,Nk,fd as fd$1,Kh,Oh,Hn,en as en$1,gn,fn,Wi,Yi,Mk,Ye,Th,Ai,Am as Am$1,tc as tc$1,zl as zl$1,Em as Em$1,Dm as Dm$1,Dn as Dn$1,cm as cm$1,ll as ll$1,Km as Km$1,pm as pm$1,hm as hm$1,im as im$1,Tj,Qj,dm as dm$1,Sj,pl as pl$1,_l as _l$1,Qd as Qd$1,Mh,$k,ym as ym$1,zj,Ej,Ca as Ca$1,Bj,kb,Ti,Of as Of$1,Tf,fg,cg,gg,eg,Fn as Fn$1,lj,Bm as Bm$1,Cm as Cm$1,Ee as Ee$1,Pd as Pd$1,Nd as Nd$1,na as na$2,Yg,ug,E,C,vg,df as df$1,cf as cf$1,yg,An as An$1,gh,Pk,W as W$2,sa as sa$1}from'./chunk-P3XUE72N.js';var Nt=Object.freeze(["default","first","even"]);function hr(e){return e.kind==="body"||e.kind==="header"||e.kind==="footer"}var ve=Object.freeze({kind:"body"});function Y(e){switch(e.kind){case "body":return "body";case "note":return `note:${e.noteKind}:${String(e.noteId)}`;case "textbox":return `textbox:${Y(e.owner)}:${String(e.shapeId)}`;default:return `${e.kind}:${String(e.sectionIndex)}:${e.variant}`}}function yr(e){if(typeof e!="object"||e===null)return false;let t=e;return t.kind==="body"?true:t.kind==="textbox"?yr(t.owner)&&hr(t.owner)&&Number.isInteger(t.shapeId)&&t.shapeId>=0:t.kind==="note"?(t.noteKind==="footnote"||t.noteKind==="endnote")&&Number.isInteger(t.noteId):t.kind!=="header"&&t.kind!=="footer"?false:Number.isInteger(t.sectionIndex)&&t.sectionIndex>=0&&Nt.includes(t.variant)}function _e(e){return e.kind==="note"||e.kind==="textbox"}var Rs=["getTables","getTable","getTableRows","getTableCells","getTableCell","getMergedTableCell","getTableCellProperties","getTableCellBody","getFields","getField","getFieldResult","getInlinePictures","getInlinePicture","getShapes","getShape","getShapeBody","getChangeTrackingMode","getDocument","getDocumentProperty","getStyles","getBody","getParagraphs","getRange","getSpanParagraphs","getText","getSpanText","getTextRanges","expandSpan","getReviewedText","getParagraphId","search","getFont","getParagraphFormat","getStyle","getSections","getPageSetup","getFurniture","getNotes","getNoteBody","getNoteText","getNoteKind","getLists","getListId","getListById","getListParagraphs","getParagraphList","getListLevel","getHyperlink","getBookmarks","getBookmarkName","getBookmarkRange","getBookmarkNames","getBookmarkRangeByName","getComments","getCommentReplies","getCommentId","getCommentAuthor","getCommentDate","getCommentText","getCommentRange","getCommentResolved","getRevisions","getRevisionType","getRevisionAuthor","getRevisionDate","getRevisionRange","getReviewItemRange","getContentControls","getContentControlById","getContentControlsByTag","getContentControlsByTitle","getContentControlTag","getContentControlTitle","getContentControlFileId","getContentControlSubtype","getContentControlLock","getContentControlIsBound","getContentControlPlaceholderShown","getContentControlTemporary","getContentControlText","getContentControlParagraphs","getContentControlRange"],kr=["removeDocumentInformation","compareFromBase64","setDocumentProperties","insertTableRows","insertTable","updateTable","updateTableCell","splitTableCell","setInlinePicture","deleteInlinePicture","insertField","insertOoxml","setFieldCode","setFieldResult","deleteField","updateFieldResult","insertInlinePicture","insertBreak","setChangeTrackingMode","proposeInsertion","proposeDeletion","proposeReplacement","insertText","replaceSpan","replaceStoryBlocks","insertParagraph","splitParagraph","deleteParagraph","selectSpan","selectBookmark","insertBookmark","deleteBookmark","setFont","setParagraphFormat","setStyle","setPageSetup","deleteNote","setListLevel","startNewList","attachToList","detachFromList","setListLevelFormat","insertListParagraph","setHyperlink","insertComment","setCommentResolved","replyToComment","deleteComment","acceptRevision","rejectRevision","resolveRevisionBatch","setRevisionAuthorBatch","acceptAllRevisions","rejectAllRevisions","setContentControlValue","setContentControlProperties","deleteContentControl","insertContentControlText","insertContentControl","insertCustomNode"],xr=["removeDocumentInformation","compareFromBase64","insertTableRows","resolveRevisionBatch","setRevisionAuthorBatch","insertTable","insertInlinePicture","insertBreak","startNewList","deleteNote","insertComment","setCommentResolved","replyToComment","insertCustomNode"],lc=new Set(xr);function bn(e){return lc.has(e.op)&&!(e.op==="insertBreak"&&e.breakType==="Line")||e.op==="updateTable"&&["addRows","addColumns","deleteRows","deleteColumns","delete"].includes(e.mutation.kind)}var dc=new Set(kr);function je(e){return dc.has(e.op)}var uc="http://schemas.openxmlformats.org/officeDocument/2006/relationships",cc="#_x0000_t202",pc=new Set(["#_x0000_t20","#_x0000_t32","#_x0000_t33","#_x0000_t34"]),mc=new Set(["shape","rect","roundrect","oval"]),fc=e=>/^(t|true|1)$/i.test(e?.trim()??"");function gc(e){let t=Cd$1(e).filter(o=>Ad$1(o,xd$1,"textbox"));if(t.length!==1)return null;let n=Cd$1(t[0]);return n.length===1&&Ad$1(n[0],pa,"txbxContent")?n[0]:null}function hc(e){return Bd$1(e,"type")?.trim()===cc||Bd$1(e,"spt",yd$1)?.trim()==="202"}function yc(e){let t=Bd$1(e,"connectortype",yd$1)?.trim();if(t&&t!=="none")return true;let n=Bd$1(e,"type")?.trim(),o=Bd$1(e,"spt",yd$1)?.trim();return pc.has(n??"")||["20","32","33","34"].includes(o??"")}function kc(e){return e.localName==="image"?true:Cd$1(e).some(t=>Ad$1(t,xd$1,"imagedata")&&t.attributes.some(n=>n.namespaceUri===uc&&n.localName==="id"||n.namespaceUri===yd$1&&n.localName==="relid"||!n.namespaceUri&&n.localName==="src"))}function xc(e,t){return e.localName==="group"?"Group":t||fc(Bd$1(e,"hr",yd$1))||Cd$1(e).some(n=>Ad$1(n,xd$1,"textpath"))?"Unsupported":hc(e)?"TextBox":Cd$1(e).some(n=>Ad$1(n,xd$1,"textbox"))?"GeometricShape":kc(e)?"Picture":"GeometricShape"}function Ps(e){let t=Cd$1(e),n=t.some(r=>Ad$1(r,yd$1,"OLEObject")),o=[];for(let r of t){if(r.namespaceUri!==xd$1||!Dd$1.has(r.localName))continue;let a=Ed$1(r);if(a===null)continue;let i=Bd$1(r,"spid",yd$1),s=Bd$1(r,"id")??"",l=xc(r,n),d=l==="TextBox"||l==="GeometricShape"?gc(r):null,m=(l==="TextBox"||l==="GeometricShape")&&mc.has(r.localName)&&!yc(r)&&!Cd$1(r).some(c=>Ad$1(c,xd$1,"textbox")||Ad$1(c,xd$1,"imagedata"));o.push({read:{id:a,name:i===void 0?s.trim():s,type:l},root:d,emptyFrame:m});}return o}var bc="http://schemas.openxmlformats.org/drawingml/2006/picture",vc="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",Ac="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",Is=4096,Oc=65536;function Rc(e){return e&&e.kind!=="textValue"?e:null}function vn(e,t,n){return e.kind!=="textValue"&&e.namespaceUri===t&&e.localName===n}function et(e,t,n){return Rc(e.children.find(o=>vn(o,t,n)))}function Pc(e){let t=e.children.find(c=>c.kind==="anchoredDrawing"||c.kind==="inlineDrawing"||vn(c,wa,"anchor")||vn(c,wa,"inline"));if(!t||t.kind==="textValue")return null;let n=et(t,wa,"docPr"),o=n?oa$1(n.attributes,"id"):void 0;if(!n||o===void 0||!/^\d{1,10}$/.test(o)||Number(o)>4294967295)return "malformed";let r=oa$1(n.attributes,"name")??"",a=et(t,va,"graphic"),i=a?et(a,va,"graphicData"):null,s=i?oa$1(i.attributes,"uri"):void 0,l="Unsupported",d=null,m=false;if(i&&s===ma){let c=et(i,ma,"wsp"),h=c?et(c,ma,"txbx"):null;d=h?et(h,pa,"txbxContent"):null;let f=c?et(c,ma,"cNvSpPr"):null,y=f?oa$1(f.attributes,"txBox"):void 0;l=c?y==="1"||y==="true"?"TextBox":"GeometricShape":"Unsupported";let x=c?et(c,ma,"spPr"):null,v=x?et(x,va,"prstGeom"):null,P=v?oa$1(v.attributes,"prst"):void 0;m=!!f&&!h&&!et(c,ma,"linkedTxbx")&&P!=="line"&&!P?.includes("Connector");}else s===bc?l="Picture":s===vc?l="Group":s===Ac&&(l="Canvas");return {read:{id:Number(o),name:r,type:l},root:d,emptyFrame:m}}function ko(e,t){let n=[],o=new Set,r=[];for(let s of t){if(s.kind==="textValue")continue;let l=pb(wj(e,s),s),d=[];for(let c=s.children.length-1;c>=0;c-=1)d.push({node:s.children[c],scope:l});let m=0;for(;d.length>0;){if(++m>Oc)return {ok:false,reason:"truncated"};let{node:c,scope:h}=d.pop();if(c.kind==="textValue"||c.kind==="paragraph")continue;let f=pb(h,c),y=ob(c),x=c.kind==="drawing"||vn(c,pa,"drawing")?c:y?Ve$1(c,f).drawing:null;if(!(y&&!x)){if(!y&&vn(c,pa,"pict")){for(let{read:v,root:P,emptyFrame:A}of Ps(c)){if(n.length>=Is)return {ok:false,reason:"truncated"};let N={...v,hostParagraphId:s.id,textboxRoot:P,emptyFrame:A,alternate:null};n.push(N),r.push(N);}continue}if(x){let v=Pc(x);if(v==="malformed")return {ok:false,reason:"malformed"};if(v){if(o.has(v.read.id))return {ok:false,reason:"duplicates"};if(n.length>=Is)return {ok:false,reason:"truncated"};o.add(v.read.id),n.push({...v.read,hostParagraphId:s.id,textboxRoot:v.root,emptyFrame:v.emptyFrame,alternate:y?c:null});}continue}for(let v=c.children.length-1;v>=0;v-=1)d.push({node:c.children[v],scope:f});}}}if(r.length===0)return {ok:true,shapes:Object.freeze(n)};let a=new Map;for(let s of n)a.set(s.id,(a.get(s.id)??0)+1);let i=new Set(r.filter(s=>a.get(s.id)>1));return {ok:true,shapes:Object.freeze(i.size?n.filter(s=>!i.has(s)):n)}}var xo=e=>({ok:false,error:{code:"unsupported-content",message:e}});function br(e){if(!(typeof e!="object"||e===null)){if("body"in e)return e.body;if("start"in e&&"end"in e)return br(e.start)??br(e.end)}}function vr(e){if(e.op==="getText")return e.target;if("body"in e)return e.body;let t=e;for(let n of ["span","scope","at","anchor","paragraph"]){let o=br(t[n]);if(o)return o}}function Ss(e,t){let n=lj(e,{op:"createHeaderFooter",sectionIndex:t.sectionIndex,kind:t.kind,variant:t.variant,...t.variant==="first"?{titlePage:true}:{},...t.variant==="even"?{evenAndOddHeaders:true}:{}});return n.ok&&n.createdPartName?n:null}function Ic(e,t){let n=Ss(e,t),o=n&&n.package.parts.get(n.createdPartName);if(!n||!o)return null;let r={...o.root,children:[]};return Pt(rg(n.package,{...o,root:r}))}function ws(e,t,n){let o=vr(e);if(!o)return null;let r=t.handles.resolve(o,"body");if(!r||r.kind!=="body"||r.story.kind!=="header"&&r.story.kind!=="footer")return null;let a=r.story,i=t.reads.package;if(!i||t.reads.story(a))return null;if(!t.reads.sections()[a.sectionIndex])return xo("that section no longer exists");if(e.op!=="insertText"&&e.op!=="replaceSpan"&&e.op!=="insertParagraph"){let d=Ic(i,a);if(!d)return xo("cannot read this header or footer");let m=n(d).plan(e);return !m.ok||m.kind==="query"?m:m.kind!=="command"||m.ops.length||m.lifecycle||m.packageEdits?.length||m.relate?xo("this header or footer does not exist yet; write text to create it"):{ok:true,kind:"query",value:m.answer(d)}}let s=d=>{let m=Ss(d,a);if(!m)return null;let c=Pt(m.package),h=n(c),f=h.plan(e);if(!f.ok||f.kind!=="command"||f.relate||f.lifecycle||f.packageEdits?.length)return null;let y=m.package.parts.get(m.createdPartName);if(!y)return null;for(let v of f.ops){let P=Hn(y,v);if(!P.ok)return null;y=P.part;}let x=rg(m.package,y);return h.settle(Pt(x)).ok?{pkg:x,planner:h,step:f}:null},l=s(i);return l?{ok:true,kind:"command",story:{kind:"body"},ops:[],solitary:true,packageEdits:[d=>{let m=s(d);if(!m)throw new Kk("header/footer creation changed during transaction");return l=m,m.pkg}],answer:d=>l.step.answer(d)}:xo("cannot create this header or footer with that content")}var Es=new WeakSet;function Ds(e){let t=Object.freeze({kind:"generic",id:`${e.hostParagraphId}#empty-text-frame-${String(e.id)}`,namespaceUri:pa,localName:"txbxContent",namespaceBindings:Object.freeze([]),attributes:Object.freeze([]),children:Object.freeze([])});return Es.add(t),t}var Cs=Object.freeze({ok:false,error:Object.freeze({code:"unsupported-content",message:"that shape has no text story in the file, so it cannot take content",detail:"unsupported-story"})});function Ts(e,t){if(e.kind!=="textbox")return false;let n=t.story(e);return !!n&&Es.has(n.root)}function Ls(e,t,n,o){let r=je(e)?vr(e):void 0,a=r===void 0?null:n.resolve(r,"body");if(a?.kind==="body"&&Ts(a.story,o)){let s=t();return s.ok&&s.kind==="query"||Ns(s)?s:Cs}let i=t();return !i.ok||i.kind==="query"||!("story"in i)?i:Ts(i.story,o)&&!Ns(i)?Cs:i}function Ns(e){return e.ok&&e.kind==="command"&&e.ops.length===0&&!e.lifecycle&&!e.packageEdits?.length&&!e.relate}var Sc=63360;function pt(e){return Math.round(Od$1(Md$1(e))*100)/100}function wc(e,t){if(typeof e!="number"||!Number.isFinite(e))return null;let n=Pd$1(Nd$1(e));return n>Sc||n<0||n===0&&!t?null:n}var Cc=[["pageWidth","pageWidthTwips",false],["pageHeight","pageHeightTwips",false],["topMargin","marginTopTwips",true],["rightMargin","marginRightTwips",true],["bottomMargin","marginBottomTwips",true],["leftMargin","marginLeftTwips",true]];function Ms(e){if(typeof e!="object"||e===null)return {ok:false,reason:"that is not a page setup",detail:"not-an-object"};let t=e,n={},o=0;for(let[a,i,s]of Cc){let l=t[a];if(l===void 0)continue;let d=wc(l,s);if(d===null)return {ok:false,reason:`that is not a value for ${a}`,detail:String(l)};n[i]=d,o+=1;}let r=t.orientation;if(r!==void 0){if(r!=="portrait"&&r!=="landscape")return {ok:false,reason:"that is not an orientation",detail:String(r)};n.orientation=r,o+=1;}return o===0?{ok:false,reason:"that page setup names nothing to write",detail:"empty"}:{ok:true,value:n}}function Tc(e){let t=hn(e),n=t.widthTwips>t.heightTwips?"landscape":"portrait";return Object.freeze({pageWidth:pt(t.widthTwips),pageHeight:pt(t.heightTwips),orientation:n,topMargin:pt(t.topTwips),rightMargin:pt(t.rightTwips),bottomMargin:pt(t.bottomTwips),leftMargin:pt(t.leftTwips),headerDistance:pt(t.headerTwips),footerDistance:pt(t.footerTwips),gutter:pt(t.gutterTwips)})}function Nc(e,t){if(!t)return null;let n=null,o=(r,a,i)=>{if(n!==null||r.kind==="textValue"||i>64)return;let s=r.kind==="paragraph"?r.id:a;if(r.id===t.id){n=s;return}for(let l of r.children)o(l,s,i+1);};return o(e.root,null,0),n}function Fs(e,t,n){let o=qf(t.root);return Object.freeze(o.map((r,a)=>{let i=n[a];return Object.freeze({index:a,markParagraphId:Nc(t,r),pageSetup:Tc(r),titlePage:i?.titlePage??false,evenAndOddHeaders:i?.evenAndOddHeaders??false})}))}var Bs=new WeakMap,Ec=0;function Dc(e){if(!e)return;let t=Bs.get(e);return t||(t={...e,cacheKey:`formatting-${++Ec}`},Bs.set(e,t)),t}function bo(e){let t=new WeakMap;return (n,o,r,a)=>{let i=Dc(a),s=fb(n,o.id),l;for(;s&&s.kind!=="table";){if(s.localName==="txbxContent")return;s.kind==="tableCell"&&(l=s.id),s=fb(n,s.id);}if(!s||!l)return;let d=s,m=d.kind==="table"?d.children.find(h=>h.localName==="tblPr")??d:d,c=t.get(m);if(!c||c.table!==d||c.mode!==r||c.filter!==i){let h=new Map,f=se$1(s,1,0,e,r,i);for(let y of f?.rows??[])for(let x of y.cells)h.set(x.id,x.styleFormatting);c={table:d,mode:r,filter:i,cells:h},t.set(m,c);}return c.cells.get(l)}}var qt={},Hs=new WeakMap;function Lc(e,t){let n=e&&e.kind!=="textValue"?e.children.filter(r=>r.kind==="textValue"||r.localName!=="pStyle"):[];return {...e??{kind:"generic",id:"",localName:"pPr",attributes:[]},children:[{kind:"generic",id:"",namespaceUri:pa,localName:"pStyle",prefix:"w",attributes:[{namespaceUri:pa,localName:"val",prefix:"w",value:t}],children:[]},...n]}}function Mc(e){let t=lf$1(e.styles,void 0,e.settings),n=bo(t),o=Md$2(od$1(e.numbering),t);return (r,a,i,s)=>{let l=ai(a,"paragraphProperties","pPr"),d=s===void 0?l:Lc(l,s),m=Kd$1(mf$1(t,d).paragraphPropertyNodes),c=m?pd$1(o,m.numId,m.ilvl):null,h=nf$1(t,d,n(r,a,i),c?_c$2(c.level):void 0);return wf(h.inheritedParagraphProperties)}}function _s(e,t,n,o,r){let a=Hs.get(e.styles??qt);a||Hs.set(e.styles??qt,a=new WeakMap);let i=a.get(e.settings??qt);i||a.set(e.settings??qt,i=new WeakMap);let s=i.get(e.numbering??qt);return s||i.set(e.numbering??qt,s=Mc(e)),s(t,n,o,r)}var Jt=255;function vo(e){return e.trim().toLowerCase()}function Or(e){return e.trim().length>0&&e.length<=Jt&&X(e)}function Ar(e,t){return `${e}\0${vo(t)}`}var js=new WeakMap;function Et(e){let t=js.get(e.root);if(t)return t;let n=Fc(e.root);return js.set(e.root,n),n}function Fc(e){let t=[],n=new Map,o=null,r=0;for(let s of e.children){if(!sd$1(s)||s.localName!=="style")continue;if(r>=kf$1)break;r+=1;let l=zd$1(s,Jt);if(!l)continue;let{styleId:d}=l,m=Object.freeze({styleId:d,type:l.type,name:l.name??null,basedOn:l.basedOn,next:l.next,element:s});t.push(m),n.set(d,m),m.type==="paragraph"&&(l.isDefault?o=d:o===d&&(o=null));}let a=t.filter(s=>n.get(s.styleId)===s),i=new Map;for(let s of a){if(s.name===null||!Or(s.name))continue;let l=Ar(s.type,s.name);i.has(l)||i.set(l,s.styleId);}return Object.freeze({entries:Object.freeze(a),idOf:(s,l)=>i.get(Ar(s,l))??null,nameOf:(s,l)=>{let d=n.get(l);return !d||d.type!==s||d.name===null?null:i.get(Ar(s,d.name))===l?d.name:null},defaultParagraphId:o})}function Vs(e){let t=ud$1(e),n={styles:t?.root??null,settings:Bf(e)?.root??null,numbering:vd$1(e)},o=(i,s,l)=>_s(n,i,s,"proposed",l);if(!t)return Object.freeze({nameOf:()=>null,idOf:()=>null,characterIdOf:()=>null,defaultId:null,present:false,inheritsRtl:o});let r=Et(t),a=r.defaultParagraphId;return Object.freeze({nameOf:i=>r.nameOf("paragraph",i),idOf:i=>r.idOf("paragraph",i),characterIdOf:i=>r.idOf("character",i),defaultId:a,present:true,inheritsRtl:o})}function Ao(e,t,n){let o=eb(e,t);if(!o||o.kind!=="paragraph")return null;let r=Bc(Sh(Qh(o),"pStyle"));return r!==null?n.nameOf(r):n.defaultId===null?null:n.nameOf(n.defaultId)}function Bc(e){if(!e)return null;for(let t of e.attributes)if(t.localName==="val")return t.value;return null}function Oo(e,t){if(typeof e!="string"||e.trim().length===0)return {ok:false,detail:"style: not a name"};if(e.length>Jt)return {ok:false,detail:"style: name too long"};if(!X(e))return {ok:false,detail:"style: not valid XML text"};if(!t.present)return {ok:false,detail:"no-styles-defined: this document defines no styles"};let n=t.idOf(e);return n===null?{ok:false,detail:"style-not-defined: this document defines no paragraph style with that name"}:{ok:true,styleId:n}}function Us(e,t,n){return t>=n?null:{text:e.text.slice(t-e.rawStart,n-e.rawStart),rawStart:t,rawEnd:n,...e.symbol?{symbol:true}:{},...e.symbol&&e.symbolDisplays?{symbolDisplays:e.symbolDisplays}:{}}}function Ks(e,t){let n=[],o=0;for(let r of e){for(;o<t.length&&t[o].end<=r.rawStart;)o+=1;let a=r.rawEnd-r.rawStart;if(r.text.length!==a||r.resultRuns||r.symbolOffsets){let l=t[o];(!l||l.start>=r.rawEnd)&&n.push(r);continue}let i=r.rawStart;for(;o<t.length;){let l=t[o];if(l.end<=i){o+=1;continue}if(l.start>=r.rawEnd)break;let d=Us(r,i,Math.min(l.start,r.rawEnd));if(d&&n.push(d),i=Math.max(i,l.end),l.end<=r.rawEnd&&(o+=1),i>=r.rawEnd)break}let s=Us(r,i,r.rawEnd);s&&n.push(s);}return n}function Ro(e,t){return t.map(n=>{if(!n.text.includes(`
1
+ import {i,g as g$1,e,f}from'./chunk-27XCGHXI.js';import {hd as hd$1,lf as lf$1,mf as mf$1,pf as pf$1,zb,sd as sd$1,kf as kf$1,zd as zd$1,se as se$1,Md as Md$2,od as od$1,Kd as Kd$1,pd as pd$1,nf as nf$1,_c as _c$2,wf,td as td$1,ud as ud$2}from'./chunk-CCM264XP.js';import {b as b$2,c,a as a$1}from'./chunk-FIT3HAWE.js';import {sa,S,za,Ca,la,da,ba,ca,fa,ea as ea$1,Aa,T,U,W as W$1,V,xa,$,aa as aa$1,na as na$1,pa as pa$1,qa,oa as oa$2,ra as ra$1}from'./chunk-CORSCVCC.js';import {b as b$1,a}from'./chunk-V5NOTQ6L.js';import {eb,Bi,ki,qi,ud as ud$1,Pa,pa,cb,Bk,jb,rg,Bg,zg,Ag,lg,Eb,ng,Hb,sf as sf$1,pj,Qc as Qc$1,Tc as Tc$1,Rc as Rc$1,_c as _c$1,g,qf,re as re$1,se,Xa,ej,vd as vd$1,Bf,pb,wj,ob,Ve as Ve$1,hd as hd$2,cd as cd$1,X,hn,ai,Cd as Cd$1,Ad as Ad$1,yd as yd$1,xd as xd$1,Dd as Dd$1,Ed as Ed$1,Bd as Bd$1,wa,oa as oa$1,ma,id as id$1,wb,Od as Od$1,Md as Md$1,va,Jm as Jm$1,jd as jd$1,Sh,Qh,qc as qc$1,Uh,fb,Mm as Mm$1,xj,Kk,Um as Um$1,Zm as Zm$1,Vm as Vm$1,Ym as Ym$1,Wm as Wm$1,an as an$1,zm as zm$1,yj,Ei,Cj,uc as uc$1,oc,sc,Al as Al$1,Ol as Ol$1,jm as jm$1,mm as mm$1,ml as ml$1,ql as ql$1,Ok,dj,He,fj,Fe,ei,ci,si,Rh,Aj,Nk,fd as fd$1,Kh,Oh,Hn,en as en$1,gn,fn,Wi,Yi,Mk,Ye,Th,Ai,Am as Am$1,tc as tc$1,zl as zl$1,Em as Em$1,Dm as Dm$1,Dn as Dn$1,cm as cm$1,ll as ll$1,Km as Km$1,pm as pm$1,hm as hm$1,im as im$1,Tj,Qj,dm as dm$1,Sj,pl as pl$1,_l as _l$1,Qd as Qd$1,Mh,$k,ym as ym$1,zj,Ej,Ca as Ca$1,Bj,kb,Ti,Of as Of$1,Tf,fg,cg,gg,eg,Fn as Fn$1,lj,Bm as Bm$1,Cm as Cm$1,Ee as Ee$1,Pd as Pd$1,Nd as Nd$1,na as na$2,Yg,ug,E,C,vg,df as df$1,cf as cf$1,yg,An as An$1,gh,Pk,W as W$2,sa as sa$1}from'./chunk-KIDYIVZ5.js';var Nt=Object.freeze(["default","first","even"]);function hr(e){return e.kind==="body"||e.kind==="header"||e.kind==="footer"}var ve=Object.freeze({kind:"body"});function Y(e){switch(e.kind){case "body":return "body";case "note":return `note:${e.noteKind}:${String(e.noteId)}`;case "textbox":return `textbox:${Y(e.owner)}:${String(e.shapeId)}`;default:return `${e.kind}:${String(e.sectionIndex)}:${e.variant}`}}function yr(e){if(typeof e!="object"||e===null)return false;let t=e;return t.kind==="body"?true:t.kind==="textbox"?yr(t.owner)&&hr(t.owner)&&Number.isInteger(t.shapeId)&&t.shapeId>=0:t.kind==="note"?(t.noteKind==="footnote"||t.noteKind==="endnote")&&Number.isInteger(t.noteId):t.kind!=="header"&&t.kind!=="footer"?false:Number.isInteger(t.sectionIndex)&&t.sectionIndex>=0&&Nt.includes(t.variant)}function _e(e){return e.kind==="note"||e.kind==="textbox"}var Rs=["getTables","getTable","getTableRows","getTableCells","getTableCell","getMergedTableCell","getTableCellProperties","getTableCellBody","getFields","getField","getFieldResult","getInlinePictures","getInlinePicture","getShapes","getShape","getShapeBody","getChangeTrackingMode","getDocument","getDocumentProperty","getStyles","getBody","getParagraphs","getRange","getSpanParagraphs","getText","getSpanText","getTextRanges","expandSpan","getReviewedText","getParagraphId","search","getFont","getParagraphFormat","getStyle","getSections","getPageSetup","getFurniture","getNotes","getNoteBody","getNoteText","getNoteKind","getLists","getListId","getListById","getListParagraphs","getParagraphList","getListLevel","getHyperlink","getBookmarks","getBookmarkName","getBookmarkRange","getBookmarkNames","getBookmarkRangeByName","getComments","getCommentReplies","getCommentId","getCommentAuthor","getCommentDate","getCommentText","getCommentRange","getCommentResolved","getRevisions","getRevisionType","getRevisionAuthor","getRevisionDate","getRevisionRange","getReviewItemRange","getContentControls","getContentControlById","getContentControlsByTag","getContentControlsByTitle","getContentControlTag","getContentControlTitle","getContentControlFileId","getContentControlSubtype","getContentControlLock","getContentControlIsBound","getContentControlPlaceholderShown","getContentControlTemporary","getContentControlText","getContentControlParagraphs","getContentControlRange"],kr=["removeDocumentInformation","compareFromBase64","setDocumentProperties","insertTableRows","insertTable","updateTable","updateTableCell","splitTableCell","setInlinePicture","deleteInlinePicture","insertField","insertOoxml","setFieldCode","setFieldResult","deleteField","updateFieldResult","insertInlinePicture","insertBreak","setChangeTrackingMode","proposeInsertion","proposeDeletion","proposeReplacement","insertText","replaceSpan","replaceStoryBlocks","insertParagraph","splitParagraph","deleteParagraph","selectSpan","selectBookmark","insertBookmark","deleteBookmark","setFont","setParagraphFormat","setStyle","setPageSetup","deleteNote","setListLevel","startNewList","attachToList","detachFromList","setListLevelFormat","insertListParagraph","setHyperlink","insertComment","setCommentResolved","replyToComment","deleteComment","acceptRevision","rejectRevision","resolveRevisionBatch","setRevisionAuthorBatch","acceptAllRevisions","rejectAllRevisions","setContentControlValue","setContentControlProperties","deleteContentControl","insertContentControlText","insertContentControl","insertCustomNode"],xr=["removeDocumentInformation","compareFromBase64","insertTableRows","resolveRevisionBatch","setRevisionAuthorBatch","insertTable","insertInlinePicture","insertBreak","startNewList","deleteNote","insertComment","setCommentResolved","replyToComment","insertCustomNode"],lc=new Set(xr);function bn(e){return lc.has(e.op)&&!(e.op==="insertBreak"&&e.breakType==="Line")||e.op==="updateTable"&&["addRows","addColumns","deleteRows","deleteColumns","delete"].includes(e.mutation.kind)}var dc=new Set(kr);function je(e){return dc.has(e.op)}var uc="http://schemas.openxmlformats.org/officeDocument/2006/relationships",cc="#_x0000_t202",pc=new Set(["#_x0000_t20","#_x0000_t32","#_x0000_t33","#_x0000_t34"]),mc=new Set(["shape","rect","roundrect","oval"]),fc=e=>/^(t|true|1)$/i.test(e?.trim()??"");function gc(e){let t=Cd$1(e).filter(o=>Ad$1(o,xd$1,"textbox"));if(t.length!==1)return null;let n=Cd$1(t[0]);return n.length===1&&Ad$1(n[0],pa,"txbxContent")?n[0]:null}function hc(e){return Bd$1(e,"type")?.trim()===cc||Bd$1(e,"spt",yd$1)?.trim()==="202"}function yc(e){let t=Bd$1(e,"connectortype",yd$1)?.trim();if(t&&t!=="none")return true;let n=Bd$1(e,"type")?.trim(),o=Bd$1(e,"spt",yd$1)?.trim();return pc.has(n??"")||["20","32","33","34"].includes(o??"")}function kc(e){return e.localName==="image"?true:Cd$1(e).some(t=>Ad$1(t,xd$1,"imagedata")&&t.attributes.some(n=>n.namespaceUri===uc&&n.localName==="id"||n.namespaceUri===yd$1&&n.localName==="relid"||!n.namespaceUri&&n.localName==="src"))}function xc(e,t){return e.localName==="group"?"Group":t||fc(Bd$1(e,"hr",yd$1))||Cd$1(e).some(n=>Ad$1(n,xd$1,"textpath"))?"Unsupported":hc(e)?"TextBox":Cd$1(e).some(n=>Ad$1(n,xd$1,"textbox"))?"GeometricShape":kc(e)?"Picture":"GeometricShape"}function Ps(e){let t=Cd$1(e),n=t.some(r=>Ad$1(r,yd$1,"OLEObject")),o=[];for(let r of t){if(r.namespaceUri!==xd$1||!Dd$1.has(r.localName))continue;let a=Ed$1(r);if(a===null)continue;let i=Bd$1(r,"spid",yd$1),s=Bd$1(r,"id")??"",l=xc(r,n),d=l==="TextBox"||l==="GeometricShape"?gc(r):null,m=(l==="TextBox"||l==="GeometricShape")&&mc.has(r.localName)&&!yc(r)&&!Cd$1(r).some(c=>Ad$1(c,xd$1,"textbox")||Ad$1(c,xd$1,"imagedata"));o.push({read:{id:a,name:i===void 0?s.trim():s,type:l},root:d,emptyFrame:m});}return o}var bc="http://schemas.openxmlformats.org/drawingml/2006/picture",vc="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",Ac="http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",Is=4096,Oc=65536;function Rc(e){return e&&e.kind!=="textValue"?e:null}function vn(e,t,n){return e.kind!=="textValue"&&e.namespaceUri===t&&e.localName===n}function et(e,t,n){return Rc(e.children.find(o=>vn(o,t,n)))}function Pc(e){let t=e.children.find(c=>c.kind==="anchoredDrawing"||c.kind==="inlineDrawing"||vn(c,wa,"anchor")||vn(c,wa,"inline"));if(!t||t.kind==="textValue")return null;let n=et(t,wa,"docPr"),o=n?oa$1(n.attributes,"id"):void 0;if(!n||o===void 0||!/^\d{1,10}$/.test(o)||Number(o)>4294967295)return "malformed";let r=oa$1(n.attributes,"name")??"",a=et(t,va,"graphic"),i=a?et(a,va,"graphicData"):null,s=i?oa$1(i.attributes,"uri"):void 0,l="Unsupported",d=null,m=false;if(i&&s===ma){let c=et(i,ma,"wsp"),h=c?et(c,ma,"txbx"):null;d=h?et(h,pa,"txbxContent"):null;let f=c?et(c,ma,"cNvSpPr"):null,y=f?oa$1(f.attributes,"txBox"):void 0;l=c?y==="1"||y==="true"?"TextBox":"GeometricShape":"Unsupported";let x=c?et(c,ma,"spPr"):null,v=x?et(x,va,"prstGeom"):null,P=v?oa$1(v.attributes,"prst"):void 0;m=!!f&&!h&&!et(c,ma,"linkedTxbx")&&P!=="line"&&!P?.includes("Connector");}else s===bc?l="Picture":s===vc?l="Group":s===Ac&&(l="Canvas");return {read:{id:Number(o),name:r,type:l},root:d,emptyFrame:m}}function ko(e,t){let n=[],o=new Set,r=[];for(let s of t){if(s.kind==="textValue")continue;let l=pb(wj(e,s),s),d=[];for(let c=s.children.length-1;c>=0;c-=1)d.push({node:s.children[c],scope:l});let m=0;for(;d.length>0;){if(++m>Oc)return {ok:false,reason:"truncated"};let{node:c,scope:h}=d.pop();if(c.kind==="textValue"||c.kind==="paragraph")continue;let f=pb(h,c),y=ob(c),x=c.kind==="drawing"||vn(c,pa,"drawing")?c:y?Ve$1(c,f).drawing:null;if(!(y&&!x)){if(!y&&vn(c,pa,"pict")){for(let{read:v,root:P,emptyFrame:A}of Ps(c)){if(n.length>=Is)return {ok:false,reason:"truncated"};let N={...v,hostParagraphId:s.id,textboxRoot:P,emptyFrame:A,alternate:null};n.push(N),r.push(N);}continue}if(x){let v=Pc(x);if(v==="malformed")return {ok:false,reason:"malformed"};if(v){if(o.has(v.read.id))return {ok:false,reason:"duplicates"};if(n.length>=Is)return {ok:false,reason:"truncated"};o.add(v.read.id),n.push({...v.read,hostParagraphId:s.id,textboxRoot:v.root,emptyFrame:v.emptyFrame,alternate:y?c:null});}continue}for(let v=c.children.length-1;v>=0;v-=1)d.push({node:c.children[v],scope:f});}}}if(r.length===0)return {ok:true,shapes:Object.freeze(n)};let a=new Map;for(let s of n)a.set(s.id,(a.get(s.id)??0)+1);let i=new Set(r.filter(s=>a.get(s.id)>1));return {ok:true,shapes:Object.freeze(i.size?n.filter(s=>!i.has(s)):n)}}var xo=e=>({ok:false,error:{code:"unsupported-content",message:e}});function br(e){if(!(typeof e!="object"||e===null)){if("body"in e)return e.body;if("start"in e&&"end"in e)return br(e.start)??br(e.end)}}function vr(e){if(e.op==="getText")return e.target;if("body"in e)return e.body;let t=e;for(let n of ["span","scope","at","anchor","paragraph"]){let o=br(t[n]);if(o)return o}}function Ss(e,t){let n=lj(e,{op:"createHeaderFooter",sectionIndex:t.sectionIndex,kind:t.kind,variant:t.variant,...t.variant==="first"?{titlePage:true}:{},...t.variant==="even"?{evenAndOddHeaders:true}:{}});return n.ok&&n.createdPartName?n:null}function Ic(e,t){let n=Ss(e,t),o=n&&n.package.parts.get(n.createdPartName);if(!n||!o)return null;let r={...o.root,children:[]};return Pt(rg(n.package,{...o,root:r}))}function ws(e,t,n){let o=vr(e);if(!o)return null;let r=t.handles.resolve(o,"body");if(!r||r.kind!=="body"||r.story.kind!=="header"&&r.story.kind!=="footer")return null;let a=r.story,i=t.reads.package;if(!i||t.reads.story(a))return null;if(!t.reads.sections()[a.sectionIndex])return xo("that section no longer exists");if(e.op!=="insertText"&&e.op!=="replaceSpan"&&e.op!=="insertParagraph"){let d=Ic(i,a);if(!d)return xo("cannot read this header or footer");let m=n(d).plan(e);return !m.ok||m.kind==="query"?m:m.kind!=="command"||m.ops.length||m.lifecycle||m.packageEdits?.length||m.relate?xo("this header or footer does not exist yet; write text to create it"):{ok:true,kind:"query",value:m.answer(d)}}let s=d=>{let m=Ss(d,a);if(!m)return null;let c=Pt(m.package),h=n(c),f=h.plan(e);if(!f.ok||f.kind!=="command"||f.relate||f.lifecycle||f.packageEdits?.length)return null;let y=m.package.parts.get(m.createdPartName);if(!y)return null;for(let v of f.ops){let P=Hn(y,v);if(!P.ok)return null;y=P.part;}let x=rg(m.package,y);return h.settle(Pt(x)).ok?{pkg:x,planner:h,step:f}:null},l=s(i);return l?{ok:true,kind:"command",story:{kind:"body"},ops:[],solitary:true,packageEdits:[d=>{let m=s(d);if(!m)throw new Kk("header/footer creation changed during transaction");return l=m,m.pkg}],answer:d=>l.step.answer(d)}:xo("cannot create this header or footer with that content")}var Es=new WeakSet;function Ds(e){let t=Object.freeze({kind:"generic",id:`${e.hostParagraphId}#empty-text-frame-${String(e.id)}`,namespaceUri:pa,localName:"txbxContent",namespaceBindings:Object.freeze([]),attributes:Object.freeze([]),children:Object.freeze([])});return Es.add(t),t}var Cs=Object.freeze({ok:false,error:Object.freeze({code:"unsupported-content",message:"that shape has no text story in the file, so it cannot take content",detail:"unsupported-story"})});function Ts(e,t){if(e.kind!=="textbox")return false;let n=t.story(e);return !!n&&Es.has(n.root)}function Ls(e,t,n,o){let r=je(e)?vr(e):void 0,a=r===void 0?null:n.resolve(r,"body");if(a?.kind==="body"&&Ts(a.story,o)){let s=t();return s.ok&&s.kind==="query"||Ns(s)?s:Cs}let i=t();return !i.ok||i.kind==="query"||!("story"in i)?i:Ts(i.story,o)&&!Ns(i)?Cs:i}function Ns(e){return e.ok&&e.kind==="command"&&e.ops.length===0&&!e.lifecycle&&!e.packageEdits?.length&&!e.relate}var Sc=63360;function pt(e){return Math.round(Od$1(Md$1(e))*100)/100}function wc(e,t){if(typeof e!="number"||!Number.isFinite(e))return null;let n=Pd$1(Nd$1(e));return n>Sc||n<0||n===0&&!t?null:n}var Cc=[["pageWidth","pageWidthTwips",false],["pageHeight","pageHeightTwips",false],["topMargin","marginTopTwips",true],["rightMargin","marginRightTwips",true],["bottomMargin","marginBottomTwips",true],["leftMargin","marginLeftTwips",true]];function Ms(e){if(typeof e!="object"||e===null)return {ok:false,reason:"that is not a page setup",detail:"not-an-object"};let t=e,n={},o=0;for(let[a,i,s]of Cc){let l=t[a];if(l===void 0)continue;let d=wc(l,s);if(d===null)return {ok:false,reason:`that is not a value for ${a}`,detail:String(l)};n[i]=d,o+=1;}let r=t.orientation;if(r!==void 0){if(r!=="portrait"&&r!=="landscape")return {ok:false,reason:"that is not an orientation",detail:String(r)};n.orientation=r,o+=1;}return o===0?{ok:false,reason:"that page setup names nothing to write",detail:"empty"}:{ok:true,value:n}}function Tc(e){let t=hn(e),n=t.widthTwips>t.heightTwips?"landscape":"portrait";return Object.freeze({pageWidth:pt(t.widthTwips),pageHeight:pt(t.heightTwips),orientation:n,topMargin:pt(t.topTwips),rightMargin:pt(t.rightTwips),bottomMargin:pt(t.bottomTwips),leftMargin:pt(t.leftTwips),headerDistance:pt(t.headerTwips),footerDistance:pt(t.footerTwips),gutter:pt(t.gutterTwips)})}function Nc(e,t){if(!t)return null;let n=null,o=(r,a,i)=>{if(n!==null||r.kind==="textValue"||i>64)return;let s=r.kind==="paragraph"?r.id:a;if(r.id===t.id){n=s;return}for(let l of r.children)o(l,s,i+1);};return o(e.root,null,0),n}function Fs(e,t,n){let o=qf(t.root);return Object.freeze(o.map((r,a)=>{let i=n[a];return Object.freeze({index:a,markParagraphId:Nc(t,r),pageSetup:Tc(r),titlePage:i?.titlePage??false,evenAndOddHeaders:i?.evenAndOddHeaders??false})}))}var Bs=new WeakMap,Ec=0;function Dc(e){if(!e)return;let t=Bs.get(e);return t||(t={...e,cacheKey:`formatting-${++Ec}`},Bs.set(e,t)),t}function bo(e){let t=new WeakMap;return (n,o,r,a)=>{let i=Dc(a),s=fb(n,o.id),l;for(;s&&s.kind!=="table";){if(s.localName==="txbxContent")return;s.kind==="tableCell"&&(l=s.id),s=fb(n,s.id);}if(!s||!l)return;let d=s,m=d.kind==="table"?d.children.find(h=>h.localName==="tblPr")??d:d,c=t.get(m);if(!c||c.table!==d||c.mode!==r||c.filter!==i){let h=new Map,f=se$1(s,1,0,e,r,i);for(let y of f?.rows??[])for(let x of y.cells)h.set(x.id,x.styleFormatting);c={table:d,mode:r,filter:i,cells:h},t.set(m,c);}return c.cells.get(l)}}var qt={},Hs=new WeakMap;function Lc(e,t){let n=e&&e.kind!=="textValue"?e.children.filter(r=>r.kind==="textValue"||r.localName!=="pStyle"):[];return {...e??{kind:"generic",id:"",localName:"pPr",attributes:[]},children:[{kind:"generic",id:"",namespaceUri:pa,localName:"pStyle",prefix:"w",attributes:[{namespaceUri:pa,localName:"val",prefix:"w",value:t}],children:[]},...n]}}function Mc(e){let t=lf$1(e.styles,void 0,e.settings),n=bo(t),o=Md$2(od$1(e.numbering),t);return (r,a,i,s)=>{let l=ai(a,"paragraphProperties","pPr"),d=s===void 0?l:Lc(l,s),m=Kd$1(mf$1(t,d).paragraphPropertyNodes),c=m?pd$1(o,m.numId,m.ilvl):null,h=nf$1(t,d,n(r,a,i),c?_c$2(c.level):void 0);return wf(h.inheritedParagraphProperties)}}function _s(e,t,n,o,r){let a=Hs.get(e.styles??qt);a||Hs.set(e.styles??qt,a=new WeakMap);let i=a.get(e.settings??qt);i||a.set(e.settings??qt,i=new WeakMap);let s=i.get(e.numbering??qt);return s||i.set(e.numbering??qt,s=Mc(e)),s(t,n,o,r)}var Jt=255;function vo(e){return e.trim().toLowerCase()}function Or(e){return e.trim().length>0&&e.length<=Jt&&X(e)}function Ar(e,t){return `${e}\0${vo(t)}`}var js=new WeakMap;function Et(e){let t=js.get(e.root);if(t)return t;let n=Fc(e.root);return js.set(e.root,n),n}function Fc(e){let t=[],n=new Map,o=null,r=0;for(let s of e.children){if(!sd$1(s)||s.localName!=="style")continue;if(r>=kf$1)break;r+=1;let l=zd$1(s,Jt);if(!l)continue;let{styleId:d}=l,m=Object.freeze({styleId:d,type:l.type,name:l.name??null,basedOn:l.basedOn,next:l.next,element:s});t.push(m),n.set(d,m),m.type==="paragraph"&&(l.isDefault?o=d:o===d&&(o=null));}let a=t.filter(s=>n.get(s.styleId)===s),i=new Map;for(let s of a){if(s.name===null||!Or(s.name))continue;let l=Ar(s.type,s.name);i.has(l)||i.set(l,s.styleId);}return Object.freeze({entries:Object.freeze(a),idOf:(s,l)=>i.get(Ar(s,l))??null,nameOf:(s,l)=>{let d=n.get(l);return !d||d.type!==s||d.name===null?null:i.get(Ar(s,d.name))===l?d.name:null},defaultParagraphId:o})}function Vs(e){let t=ud$1(e),n={styles:t?.root??null,settings:Bf(e)?.root??null,numbering:vd$1(e)},o=(i,s,l)=>_s(n,i,s,"proposed",l);if(!t)return Object.freeze({nameOf:()=>null,idOf:()=>null,characterIdOf:()=>null,defaultId:null,present:false,inheritsRtl:o});let r=Et(t),a=r.defaultParagraphId;return Object.freeze({nameOf:i=>r.nameOf("paragraph",i),idOf:i=>r.idOf("paragraph",i),characterIdOf:i=>r.idOf("character",i),defaultId:a,present:true,inheritsRtl:o})}function Ao(e,t,n){let o=eb(e,t);if(!o||o.kind!=="paragraph")return null;let r=Bc(Sh(Qh(o),"pStyle"));return r!==null?n.nameOf(r):n.defaultId===null?null:n.nameOf(n.defaultId)}function Bc(e){if(!e)return null;for(let t of e.attributes)if(t.localName==="val")return t.value;return null}function Oo(e,t){if(typeof e!="string"||e.trim().length===0)return {ok:false,detail:"style: not a name"};if(e.length>Jt)return {ok:false,detail:"style: name too long"};if(!X(e))return {ok:false,detail:"style: not valid XML text"};if(!t.present)return {ok:false,detail:"no-styles-defined: this document defines no styles"};let n=t.idOf(e);return n===null?{ok:false,detail:"style-not-defined: this document defines no paragraph style with that name"}:{ok:true,styleId:n}}function Us(e,t,n){return t>=n?null:{text:e.text.slice(t-e.rawStart,n-e.rawStart),rawStart:t,rawEnd:n,...e.symbol?{symbol:true}:{},...e.symbol&&e.symbolDisplays?{symbolDisplays:e.symbolDisplays}:{}}}function Ks(e,t){let n=[],o=0;for(let r of e){for(;o<t.length&&t[o].end<=r.rawStart;)o+=1;let a=r.rawEnd-r.rawStart;if(r.text.length!==a||r.resultRuns||r.symbolOffsets){let l=t[o];(!l||l.start>=r.rawEnd)&&n.push(r);continue}let i=r.rawStart;for(;o<t.length;){let l=t[o];if(l.end<=i){o+=1;continue}if(l.start>=r.rawEnd)break;let d=Us(r,i,Math.min(l.start,r.rawEnd));if(d&&n.push(d),i=Math.max(i,l.end),l.end<=r.rawEnd&&(o+=1),i>=r.rawEnd)break}let s=Us(r,i,r.rawEnd);s&&n.push(s);}return n}function Ro(e,t){return t.map(n=>{if(!n.text.includes(`
2
2
  `))return n;let r=n.text.length===n.rawEnd-n.rawStart&&!n.resultRuns?n.text.replaceAll(`
3
3
  `,(a,i)=>e[n.rawStart+i]):n.text.replaceAll(`
4
4
  `,xj);return {...n,text:r}})}function An(e,t,n){let o=Mm$1(e,t);if(n==="model")return b$2(o);let r=c(e,t,n);if(n==="allMarkup")return a$1(Ro(o,r));let a=$s(e,Hc);if(a.length===0)return a$1(Ro(o,r));let i=Ks(r,a);return a$1(Ro(o,i))}function Ws(e,t,n){if(n==="original")return An(e,t,"original");let o=Mm$1(e,t),r=c(e,t,"current"),a=$s(e,_c),i=a.length===0?r:Ks(r,a);return a$1(Ro(o,i))}var Hc=new Set(["revisionInsert","revisionMoveTo"]),_c=new Set(["revisionDelete","revisionMoveFrom"]);function $s(e,t){let n=Ei(e),o=[],r=(i,s)=>{if(!(s>64||i.kind==="textValue")){if(t.has(i.kind)){let l=n.spanOf(i);l&&l.end>l.start&&o.push({start:l.start,end:l.end});return}for(let l of i.children)r(l,s+1);}};r(e,0),o.sort((i,s)=>i.start-s.start||s.end-i.end);let a=[];for(let i of o){let s=a[a.length-1];s&&i.start<=s.end?s.end=Math.max(s.end,i.end):a.push({...i});}return a}var Rn="\r",jc=Object.freeze({nameOf:()=>null,idOf:()=>null,characterIdOf:()=>null,defaultId:null,present:false,inheritsRtl:()=>false}),Vc=Object.freeze([]),Uc=Object.freeze([]),zs=Object.freeze([]),Gs=Object.freeze({ok:true,shapes:[]}),Kc=Object.freeze({package:null,body:null,story:()=>null,storyOf:()=>null,sections:()=>Uc,furniture:()=>zs,noteIds:()=>({ok:true,ids:Xs}),shapes:()=>Gs,styles:()=>jc});function Wc(e){return e.kind==="textValue"?Vc:Object.freeze(e.children.filter(t=>t.kind!=="textValue").map(t=>{let n=[];jd$1([t],n,0);let o=t.kind==="paragraph"?"paragraph":t.kind==="table"?"table":"other",r=t.kind==="paragraph"&&Sh(Qh(t),"sectPr")!==void 0;return Object.freeze({id:t.id,kind:o,paragraphIds:Object.freeze(n.map(a=>a.id)),removable:o!=="other"&&!r})}))}function On(e,t,n,o,r){let a=id$1(o),i=Object.freeze(a.map(f=>f.id)),s=new Map,l=new Map;a.forEach((f,y)=>{s.set(f.id,y),l.set(f.id,f);});let d=new Map,m=f=>{if(!s.has(f))return null;let y=d.get(f);if(y!==void 0)return y;let x=Jm$1(t,f)??"";return d.set(f,x),x},c=new Map,h=(f,y="allMarkup")=>{let x=l.get(f);if(!x||x.kind!=="paragraph")return null;let v=`${f}:${y}`,P=c.get(v);if(P)return P;let A=An(x,m(f)??"",y);return c.set(v,A),A};return {story:e,part:t,root:o,scope:n,paragraphIds:i,blocks:Wc(o),has:f=>s.has(f),indexOf:f=>s.get(f)??-1,paragraph(f){let y=l.get(f);return y?{nodeId:f,paraId:wb(y),text:h(f)?.text??""}:null},node:f=>l.get(f)??null,rawText:m,paragraphText:(f,y)=>h(f,y)?.text??null,projectedText:h,text:f=>i.map(y=>h(y,f)?.text??"").join(Rn),styles:r}}function Po(e,t){let n=On(e.story,e.part,e.scope,t,e.styles);return {...n,indexOf:o=>n.has(o)?e.indexOf(o):-1}}function Pt(e){let t=e.parts.get(e.mainDocumentPart);if(!t)return Kc;let n,o=()=>n??=Vs(e),r,a=()=>r??=sf$1(e),i,s=new Map,l=new Map,d=new Map,m=A=>{let N=Y(A),S=d.get(N);if(S)return S;let M=x(A),j=M?M.paragraphIds.flatMap(C=>{let z=M.node(C);return z?[z]:[]}):[],J=M?ko(M.part,j):Gs;return d.set(N,J),J},c=A=>{let N=l.get(A);if(N)return N;let S=pj(e,A);if(!S){let G={ok:true,ids:Xs};return l.set(A,G),G}let M=[],j=new Set,J=new Set,C=0,z=false;for(let G of S.root.children){if(Qc$1(G)!==A)continue;if(C+=1,G.kind!=="note"){z=true;continue}if(!Tc$1(G))continue;let Q=Rc$1(G);if(Q===null){z=true;continue}j.has(Q)?J.add(Q):(j.add(Q),M.push(Q));}let K=C>_c$1?{ok:false,reason:"truncated"}:z?{ok:false,reason:"malformed"}:J.size>0?{ok:false,reason:"duplicates",duplicateIds:Object.freeze([...J])}:{ok:true,ids:Object.freeze(M)};return l.set(A,K),K},h=A=>{let N=a()[A.sectionIndex];return N?(A.kind==="header"?N.headers:N.footers).get(A.variant)??null:null},f=A=>{if(A.kind==="body"){let S=hd$2(t);return S?On(A,t,{kind:"body"},S,o):null}if(A.kind==="note"){let S=c(A.noteKind);if(!S.ok||!S.ids.includes(A.noteId))return null;let M=pj(e,A.noteKind);if(!M)return null;let j=cd$1(M.root,A.noteId);return !j||!Tc$1(j)?null:On(A,M,{kind:"notesPart",noteKind:A.noteKind},j,o)}if(A.kind==="textbox"){let S=y(A.owner),M=m(A.owner);if(!S||!M.ok)return null;let j=M.shapes.find(C=>C.id===A.shapeId),J=j?.textboxRoot??(j?.emptyFrame?Ds(j):null);return J?On(A,S.part,S.scope,J,o):null}let N=h(A);return N?On(A,N.part,{kind:"headerFooter",rId:N.rId},N.part.root,o):null},y=A=>x(A),x=A=>{let N=Y(A);if(s.has(N))return s.get(N)??null;let S=f(A);return s.set(N,S),S},v=(A,N)=>{let S=m(A);if(!S.ok)return null;for(let M of S.shapes){if(!M.textboxRoot)continue;let j={kind:"textbox",owner:A,shapeId:M.id};if(x(j)?.has(N))return j}return null};return {package:e,get body(){return x(ve)},story:x,storyOf:A=>{if(x(ve)?.has(A))return ve;let S=[{kind:"body"}];for(let[M]of a().entries())for(let j of ["header","footer"])for(let J of Nt){let C={kind:j,sectionIndex:M,variant:J};if(x(C)){if(x(C).has(A))return C;S.push(C);}}for(let M of ["footnote","endnote"]){let j=c(M);if(j.ok)for(let J of j.ids){let C={kind:"note",noteKind:M,noteId:J};if(x(C)?.has(A))return C}}for(let M of S){let j=v(M,A);if(j)return j}return null},sections:()=>i??=Fs(e,t,a()),furniture(A){let N=a()[A];if(!N)return zs;let S=[];for(let M of ["header","footer"]){let j=M==="header"?N.headers:N.footers;for(let J of Nt){let C=j.get(J);C&&S.push(Object.freeze({kind:M,variant:J,declared:!C.inherited}));}}return Object.freeze(S)},noteIds:c,shapes:m,styles:o}}var Xs=Object.freeze([]);function Ys(e){let t=[];for(let n of e.pages){let o=n.pageFieldSource?.pageNumber??n.index+1,r=hd$1(o,n.pageFieldSource?.format),a=i=>{for(let s of i)if(s.kind==="paragraph")for(let l of s.lines)t.push({...l.range,pageNumber:o,pageNumberText:r});else for(let l of s.rows)for(let d of l.cells)a(d.blocks);};a(n.fragments),n.header&&a(n.header.fragments),n.footer&&a(n.footer.fragments);for(let i of n.footnotes?.notes??[])a(i.fragments);for(let i of n.endnotes?.notes??[])a(i.fragments);}return {pageCount:e.pages.length,ranges:t}}function qs(e,t,n,o){if(!e||!Number.isInteger(e.pageCount)||e.pageCount<1)return null;let r=eb(t,n);if(!r||r.kind!=="paragraph")return null;let a=Bi(r).find(s=>s.node.id===o);if(!a)return null;let i=e.ranges.find(s=>s.paragraphId===n&&s.start<=a.start&&s.end>a.start);return !i||!Number.isInteger(i.pageNumber)||i.pageNumber<1?null:{pageNumber:i.pageNumber,pageNumberText:i.pageNumberText,pageCount:e.pageCount}}function $c(e){return async t=>{let n=i(t,{measurer:e.measurer,producer:e.producer,displayMode:"proposed"});if(!n.ok)throw new Error("field pagination could not open the document");try{return Ys(await n.session.layout())}finally{n.session.dispose();}}}var re=()=>`${new Date().toISOString().slice(0,19)}Z`;function Js(e,t,n){let o=(r,a)=>({state:n,step:{ok:false,error:{code:"unsupported-capability",message:r,detail:a}}});return e.op==="getChangeTrackingMode"||e.op==="setChangeTrackingMode"?t?e.op==="getChangeTrackingMode"?{state:n,step:{ok:true,kind:"query",value:{kind:"text",text:n.mode}}}:e.mode!=="Off"&&e.mode!=="TrackMineOnly"?o("TrackAll requires shared tracking enforcement for every peer and is not supported","change-tracking-mode-unsupported"):e.mode==="TrackMineOnly"&&(typeof e.author!="string"||!e.author.trim()||!X(e.author))?o("TrackMineOnly requires a non-empty XML-safe runtime author","change-tracking-author-required"):{state:{mode:e.mode,...e.mode==="TrackMineOnly"?{author:e.author.trim()}:{}},step:{ok:true,kind:"query",value:{kind:"applied"}}}:o("this host does not support runtime-local change tracking","change-tracking-unsupported-host"):n.mode==="Off"||Rr(e)?null:o(`${e.op} does not support TrackMineOnly; no permanent edit was applied`,"change-tracking-operation-unsupported")}function Rr(e){return !je(e)||e.op==="setChangeTrackingMode"||e.op==="insertText"?true:e.op==="insertBreak"?e.breakType!=="Line"||!(e.location==="Replace"&&"body"in e.span):e.op==="splitParagraph"||e.op==="insertTable"||e.op==="insertTableRows"||["insertField","insertOoxml","setFieldResult","deleteField"].includes(e.op)||["updateTable","updateTableCell","splitTableCell"].includes(e.op)||e.op==="replaceSpan"&&!("body"in e.span)||e.op==="deleteParagraph"?true:["insertContentControl","setContentControlProperties","setContentControlValue","insertContentControlText","startNewList","setListLevelFormat","attachToList","detachFromList","setListLevel","insertParagraph","setFont","setStyle","setParagraphFormat","proposeInsertion","proposeDeletion","proposeReplacement","insertComment","replyToComment","deleteComment","setCommentResolved","acceptRevision","rejectRevision","resolveRevisionBatch","setRevisionAuthorBatch","acceptAllRevisions","rejectAllRevisions","selectSpan","selectBookmark","insertBookmark","deleteBookmark"].includes(e.op)}function Qs(e,t,n){if(!n||!["setFont","setStyle","setParagraphFormat","insertParagraph","attachToList","detachFromList","setListLevel","splitParagraph"].includes(e.op)||!t.ok||t.kind!=="command")return t;if(e.op==="splitParagraph"&&t.ops.some(r=>r.op==="deleteText"))return {ok:false,error:{code:"unsupported-capability",message:"a tracked split cannot remove its delimiters; pass trimDelimiters as false",detail:"change-tracking-operation-unsupported"}};let o={author:n,date:re()};return {...t,ops:t.ops.map(r=>{if(r.op==="insertText"||r.op==="insertParagraphBesideTable")return {...r,revision:o};if(r.op==="splitParagraph")return {op:"splitParagraphMany",paragraphId:r.paragraphId,offsets:[r.offset],revision:o};if(r.op==="splitParagraphMany")return {...r,revision:o};if(r.op==="setRunProperties"||r.op==="setParagraphProperties"||r.op==="setParagraphMarkProperties"||r.op==="setListNumbering"||r.op==="setListLevel")return {...r,revision:o};throw new Error("Formatting plan contains an operation without property revision support")})}}function zc(){let e=globalThis.crypto,t=e?.getRandomValues;if(typeof t!="function")throw new Error("automation: no secure random source. globalThis.crypto.getRandomValues is required to scope document handles to one host.");let n=t.call(e,new Uint8Array(16)),o="";for(let r of n)o+=r.toString(16).padStart(2,"0");return o}function Gc(e){return typeof e=="object"&&e!==null&&"kind"in e&&"ref"in e}function Zs(){let e=new Map,t=new Map,n=new Map,o=new Map,r=zc(),a=null,i=(l,d)=>{let m=(o.get(l)??0)+1;o.set(l,m);let c=`${l}:${r}:${String(m)}`;return e.set(c,d),Object.freeze({kind:l,ref:c})},s=(l,d,m)=>{let c=`${l}\0${d}`,h=n.get(c);if(h)return Object.freeze({kind:l,ref:h});let f=i(l,m);return n.set(c,f.ref),f};return {document(){return a??=i("document",{kind:"document"}),a},body(l,d){return s("body",`${Y(l)}:${d??""}`,{kind:"body",story:l,...d?{rootNodeId:d}:{}})},table(l,d){return s("table",`${Y(d)}:${l}`,{kind:"table",nodeId:l,story:d})},tableRow(l,d){return s("tableRow",`${Y(d)}:${l}`,{kind:"tableRow",nodeId:l,story:d})},tableCell(l,d){return s("tableCell",`${Y(d)}:${l}`,{kind:"tableCell",nodeId:l,story:d})},field(l,d,m){return s("field",`${Y(m)}:${d}`,{kind:"field",paragraphId:l,fieldNodeId:d,story:m})},inlinePicture(l,d){return s("inlinePicture",`${Y(d)}:${l}`,{kind:"inlinePicture",drawingNodeId:l,story:d})},shape(l,d){return s("shape",`${Y(d)}:${String(l)}`,{kind:"shape",shapeId:l,owner:d})},paragraph(l,d){let m=t.get(l);if(m)return Object.freeze({kind:"paragraph",ref:m});let c=i("paragraph",{kind:"paragraph",paragraphId:l,story:d});return t.set(l,c.ref),c},section(l){return s("section",String(l),{kind:"section",index:l})},note(l,d){return s("note",`${l}:${String(d)}`,{kind:"note",noteKind:l,noteId:d})},comment(l,d){return s("comment",`${Y(d)}\0${l}`,{kind:"comment",commentId:l,story:d})},revision(l,d){return s("revision",`${Y(d)}\0${l}`,{kind:"revision",revisionId:l,story:d})},bookmark(l,d){return s("bookmark",`${Y(d)}\0${l}`,{kind:"bookmark",name:l,story:d})},list(l,d){return s("list",`${Y(d)}\0${l}`,{kind:"list",numId:l,story:d})},contentControl(l,d){return s("contentControl",`${Y(d)}\0${l}`,{kind:"contentControl",nodeId:l,story:d})},retargetRevisions(l,d){let m=h=>`revision\0${Y(l)}\0${h}`,c=d.flatMap(({from:h,to:f})=>{let y=h===f?void 0:n.get(m(h));return y?[{ref:y,from:h,to:f}]:[]});for(let{from:h}of c)n.delete(m(h));for(let{ref:h,to:f}of c)n.has(m(f))||(n.set(m(f),h),e.set(h,{kind:"revision",revisionId:f,story:l}));},retarget(l,d){let m=t.get(l);if(!m||l===d)return;let c=e.get(m);!c||c.kind!=="paragraph"||(t.delete(l),e.set(m,{kind:"paragraph",paragraphId:d,story:c.story}),t.has(d)||t.set(d,m));},resolve(l,d){if(!Gc(l)||l.kind!==d||typeof l.ref!="string")return null;let m=e.get(l.ref);return !m||m.kind!==d?null:m}}}var tt="target-removed";function Ve(e,t){return {ok:false,code:e,detail:t}}function Ue(e){return {ok:true,value:e}}function le(e,t,n,o){let r=n.resolve(e,t);if(!r||r.kind!=="body"&&r.kind!=="paragraph")return Ve("invalid-handle",`not-a-${t}-handle`);let a=o.story(r.story);if(!a)return Ve("invalid-handle",`no-such-story:${Y(r.story)}`);if(r.kind==="body"&&r.rootNodeId){let i=eb(a.part,r.rootNodeId);return !i||i.kind!=="tableCell"?Ve("invalid-handle","cell-not-in-story"):Ue(Po(a,i))}return Ue(a)}function he(e,t,n){let o=t.resolve(e,"paragraph");if(!o||o.kind!=="paragraph")return Ve("invalid-handle","not-a-paragraph-handle");let r=n.story(o.story);if(!r)return Ve("invalid-handle",`no-such-story:${Y(o.story)}`);let a=r.indexOf(o.paragraphId);return a<0?Ve("invalid-handle","paragraph-not-in-body"):Ue({story:o.story,paragraphId:o.paragraphId,index:a,offset:0})}function Xc(e,t,n){let o=he(e.paragraph,t,n);if(!o.ok)return o;let a=(n.story(o.value.story)?.rawText(o.value.paragraphId)??"").length,{offset:i}=e;return !Number.isInteger(i)||i<0||i>a?Ve("invalid-offset",`offset ${String(i)} outside 0..${String(a)}`):Ue({...o.value,offset:i})}function Qt(e,t,n){if("paragraph"in e){if(!("at"in e))return Xc(e,t,n);let s=he(e.paragraph,t,n);if(!s.ok||e.at==="start")return s;let d=(n.story(s.value.story)?.rawText(s.value.paragraphId)??"").length;return Ue({...s.value,offset:d})}let o=le(e.body,"body",t,n);if(!o.ok)return o;let r=o.value.paragraphIds;if(r.length===0)return Ve("invalid-offset","empty-story");if(e.at==="start")return Ue({story:o.value.story,paragraphId:r[0],index:o.value.indexOf(r[0]),offset:0});let a=r.length-1,i=r[a];return Ue({story:o.value.story,paragraphId:i,index:o.value.indexOf(i),offset:(o.value.rawText(i)??"").length})}function Yc(e,t){return e.index<t.index||e.index===t.index&&e.offset<=t.offset}function qc(e){let t=e.paragraphIds;if(t.length===0)return null;let n=t.length-1,o=t[n];return {start:{story:e.story,paragraphId:t[0],index:e.indexOf(t[0]),offset:0},end:{story:e.story,paragraphId:o,index:e.indexOf(o),offset:(e.rawText(o)??"").length}}}function W(e,t,n){if("body"in e){let a=le(e.body,"body",t,n);return a.ok?Ue(qc(a.value)):a}if("paragraph"in e){let a=he(e.paragraph,t,n);if(!a.ok)return a;let s=(n.story(a.value.story)?.rawText(a.value.paragraphId)??"").length;return Ue({start:a.value,end:{...a.value,offset:s}})}let o=Qt(e.start,t,n);if(!o.ok)return o;let r=Qt(e.end,t,n);return r.ok?Y(o.value.story)!==Y(r.value.story)?Ve("invalid-handle","span-crosses-stories"):Yc(o.value,r.value)?Ue({start:o.value,end:r.value}):Ve("invalid-offset","span-start-after-end"):r}function ee(e,t,n){if("body"in e)return le(e.body,"body",t,n);if("paragraph"in e)return le(e.paragraph,"paragraph",t,n);let o=e.start;return "paragraph"in o?le(o.paragraph,"paragraph",t,n):le(o.body,"body",t,n)}function Io(e,t,n){if("paragraph"in e)return he(e.paragraph,t,n);let o=le(e.body,"body",t,n);if(!o.ok)return o;let r=o.value.paragraphIds;if(r.length===0)return Ve("invalid-offset","empty-story");let a=e.at==="first"?0:r.length-1;return Ue({story:o.value.story,paragraphId:r[a],index:a,offset:0})}function be(e,t){if(!e)return [];let n=t.paragraphIds,o=n[e.start.index]===e.start.paragraphId?e.start.index:n.indexOf(e.start.paragraphId),r=n[e.end.index]===e.end.paragraphId?e.end.index:n.indexOf(e.end.paragraphId);return o<0||r<o?[]:n.slice(o,r+1)}function mt(e,t){if(!e)return [];let n=be(e,t),o=n.length-1;return n.map((r,a)=>{let i=(t.rawText(r)??"").length,s=a===0?e.start.offset:0,l=a===o?e.end.offset:i;return {paragraphId:r,start:s,end:l,whole:s===0&&l===i}})}function el(e,t,n,o="allMarkup"){if(!e)return "";let r=be(e,t);return r.length===1?t.projectedText(e.start.paragraphId,o)?.sliceRaw(e.start.offset,e.end.offset)??"":r.map((a,i)=>{let s=t.projectedText(a,o);if(!s)return "";let l=(t.rawText(a)??"").length;return i===0?s.sliceRaw(e.start.offset,l):i===r.length-1?s.sliceRaw(0,e.end.offset):s.text}).join(n)}function Ae(e,t){return {start:{paragraph:t.paragraph(e.start.paragraphId,e.start.story),offset:e.start.offset},end:{paragraph:t.paragraph(e.end.paragraphId,e.end.story),offset:e.end.offset}}}var Jc=new Set(["TextBox","GeometricShape","Picture","Group","Canvas","Unsupported"]),nt=(e,t,n)=>({ok:false,error:{code:e,message:t,...n===void 0?{}:{detail:n}}}),Pr=e=>({ok:true,kind:"query",value:e});function Qc(e,t,n){let o=t.resolve(e,"shape");if(!o||o.kind!=="shape")return nt("invalid-handle","that handle does not name a shape","shape");let r=n.shapes(o.owner);if(!r.ok)return nt("ambiguous-document","shape identities in that story are not completely and unambiguously enumerable",r.reason);let a=r.shapes.find(i=>i.id===o.shapeId);return a?{owner:o.owner,shape:a}:nt("invalid-handle","that shape is not in this document",Y(o.owner))}function tl(e,t,n){if(e.op==="getShapes"){let a=e.types;if(a!==void 0&&(!Array.isArray(a)||a.some(m=>!Jc.has(m))))return nt("unsupported-content","unknown shape type","types");if(!("body"in e.span)&&!("paragraph"in e.span))return nt("unsupported-content","shapes are listed for a body or a paragraph only");let i=W(e.span,t,n),s=ee(e.span,t,n);if(!i.ok||!s.ok)return nt("invalid-handle","that range no longer exists",i.ok?s.ok?void 0:s.detail:i.detail);let l=n.shapes(s.value.story);if(!l.ok)return nt("ambiguous-document","shape identities in that story are not completely and unambiguously enumerable",l.reason);let d=new Set(i.value?be(i.value,s.value):[]);return Pr({kind:"handles",handles:l.shapes.filter(m=>d.has(m.hostParagraphId)&&(!a||a.includes(m.type))).map(m=>t.shape(m.id,s.value.story))})}let o=Qc(e.shape,t,n);if("ok"in o)return o;if(e.op==="getShape"){let{id:a,name:i,type:s}=o.shape;return Pr({kind:"shape",shape:{id:a,name:i,type:s}})}if(!o.shape.textboxRoot&&!o.shape.emptyFrame)return nt("unsupported-content","that shape holds no text story of its own",o.shape.type);if(!hr(o.owner))return nt("unsupported-content","text boxes are reachable in the body, headers and footers only",Y(o.owner));let r={kind:"textbox",owner:o.owner,shapeId:o.shape.id};return n.story(r)?Pr({kind:"handle",handle:t.body(r)}):nt("invalid-handle","that text box is not in this document",Y(r))}var Zc=32,ep=32,tp=new Set([" "," ",""]);function ft(e,t,n){return {ok:false,error:n===void 0?{code:e,message:t}:{code:e,message:t,detail:n}}}function rl(e,t,n){if(e.op==="expandSpan")return sp(e,t,n);let o=e.op==="getTextRanges"?e.scope:e.span,r=W(o,t,n);if(!r.ok)return ft(r.code,"that span is not a place",r.detail);let a=ee(o,t,n);if(!a.ok)return ft(a.code,"that span is not a place",a.detail);if(e.op==="getReviewedText")return e.version!=="original"&&e.version!=="current"?ft("unsupported-content","unknown change tracking version","version"):{ok:true,kind:"query",value:{kind:"text",text:ip(r.value,a.value,e.version)}};let i=np(e.endingMarks);if(!i)return ft("unsupported-content","ending marks are not usable","endingMarks");let s=e.projection??"allMarkup";return s!=="allMarkup"&&s!=="original"&&s!=="model"?ft("unsupported-content","unknown text projection","projection"):{ok:true,kind:"query",value:{kind:"spans",spans:ap(r.value,a.value,t,i,e.trimSpacing===true,s)}}}function np(e){if(!Array.isArray(e)||e.length===0||e.length>Zc)return null;let t=[];for(let n of e){if(typeof n!="string"||n.length===0||n.length>ep||op(n))return null;t.push(n);}return t.sort((n,o)=>o.length-n.length)}function op(e){for(let t=0;t<e.length;t+=1){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let o=e.charCodeAt(t+1);if(!(o>=56320&&o<=57343))return true;t+=1;}else if(n>=56320&&n<=57343)return true}return false}function rp(e,t,n,o,r,a=()=>true){let i=[],s=h=>!a(h)||r&&tp.has(e[h]),l=(h,f)=>{let y=h,x=f;for(;y<x&&s(y);)y+=1;for(;x>y&&s(x-1);)x-=1;y<x&&i.push([y,x]);},d=(h,f)=>{for(let y=h;y<h+f;y+=1)if(!a(y))return false;return true},m=t,c=t;for(;c<n;){let h=o.find(x=>c+x.length<=n&&e.startsWith(x,c)&&d(c,x.length));if(h){c+=h.length,l(m,c),m=c;continue}let f=e.charCodeAt(c),y=f>=55296&&f<=56319&&c+1<n;c+=y?2:1;}return m<n&&l(m,n),i}function ap(e,t,n,o,r,a){if(!e)return [];let i=be(e,t),s=i.length-1,l=[];for(let[d,m]of i.entries()){let c=t.projectedText(m,"model"),h=t.projectedText(m,a);if(!c||!h)continue;let f=d===0?e.start.offset:0,y=d===s?e.end.offset:c.text.length,x=n.paragraph(m,t.story),v=h.projectedOffsets(f,y),P=A=>v[A+1-f]>v[A-f];for(let[A,N]of rp(c.text,f,y,o,r,P))l.push({start:{paragraph:x,offset:A},end:{paragraph:x,offset:N}});}return l}function ip(e,t,n){if(!e)return "";let o=be(e,t),r=o.length-1,a="";for(let[i,s]of o.entries()){let l=t.node(s),d=t.rawText(s);if(!l||l.kind!=="paragraph"||d===null)continue;let m=Ws(l,d,n),c=i===0?e.start.offset:0,h=i===r?e.end.offset:d.length;if(a+=m.sliceRaw(c,h),i===r)break;Fn$1(l,n==="current"?"del":"ins")||(a+=Rn);}return a}function nl(e,t){return t.story(e.story)?.indexOf(e.paragraphId)??e.index}function ol(e,t,n){let o=nl(e,n),r=nl(t,n);return o<r||o===r&&e.offset<t.offset}function sp(e,t,n){let o=W(e.span,t,n);if(!o.ok)return ft(o.code,"that span is not a place",o.detail);let r=W(e.to,t,n);if(!r.ok)return ft(r.code,"that span is not a place",r.detail);if(!o.value||!r.value)return ft("invalid-offset","empty story");if(Y(o.value.start.story)!==Y(r.value.start.story))return ft("unsupported-content","the ranges are in different stories","span-crosses-stories");let a=ol(r.value.start,o.value.start,n)?r.value.start:o.value.start,i=ol(o.value.end,r.value.end,n)?r.value.end:o.value.end;return {ok:true,kind:"query",value:{kind:"span",span:Ae({start:a,end:i},t)}}}var lp=1e4;function al(e,t){let n=[],o=t.kind==="contentControl"?oc(t):t;if(!o)return n;for(let r of sc(o))if(!(r.ancestors.length>0)){if(n.length>=lp)break;n.push(ul(e,r.node));}return n}function il(e,t){for(let n of sc(e.root))if(n.node.id===t)return ul(e,n.node);return null}function sl(e,t){for(let n of sc(e.root))if(n.node.id===t)return n.node;return null}function ll(e,t){for(let n of e.paragraphIds){let o=e.node(n);if(!(!o||o.kind!=="paragraph")&&sc(o).some(r=>r.node.id===t))return o}return null}function So(e,t){let n=Zt(t);if(n.length>0){let a=n[0],i=n[n.length-1],s=e.rawText(i);return s===null||!e.has(a)?null:{start:{paragraphId:a,offset:0},end:{paragraphId:i,offset:s.length}}}let o=ll(e,t.id);if(!o)return null;let r=Ei(o).spanOf(t);return r?{start:{paragraphId:o.id,offset:r.start},end:{paragraphId:o.id,offset:r.end}}:null}function dp(e,t,n){let o=ll(e,t.id),r=oc(t);if(!o||!r)return null;let a={...o,children:r.children},i=Km$1(a);return An(a,i,n).text}function dl(e,t,n="allMarkup"){if(n==="allMarkup")return uc$1(t,xj);let o=dp(e,t,n);if(o!==null)return o;let r=So(e,t);if(!r)return "";let a=e.indexOf(r.start.paragraphId),i=e.indexOf(r.end.paragraphId);if(a<0||i<a)return "";let s=[];for(let l=a;l<=i;l+=1){let d=e.paragraphIds[l],m=e.projectedText(d,n),c=e.rawText(d);if(!m||c===null)return "";s.push(m.sliceRaw(l===a?r.start.offset:0,l===i?r.end.offset:c.length));}return s.join("\r")}function ul(e,t){return {nodeId:t.id,properties:qc$1(t),lock:pm$1(e.part,t.id),paragraphIds:Zt(t)}}function Zt(e){let t=oc(e);if(!t)return [];let n=[];return jd$1(t.children,n,0),n.map(o=>o.id)}var up=1e4;function pl(e){return (e.op==="getContentControls"||e.op==="getContentControlById"||e.op==="getContentControlsByTag"||e.op==="getContentControlsByTitle")&&typeof e.scope=="object"&&e.scope!==null&&"span"in e.scope}function Pn(e,t,n){return {ok:false,error:n===void 0?{code:e,message:t}:{code:e,message:t,detail:n}}}var cl=new WeakMap;function cp(e){let t=cl.get(e.root);if(t)return t;let n=new Map;for(let o of sc(e.root))for(let r of Zt(o.node)){let a=n.get(r);a?a.push(o.node):n.set(r,[o.node]);}return cl.set(e.root,n),n}function pp(e,t,n,o){return e===t||n===o?n<=t&&e<=o:Math.max(e,n)<Math.min(t,o)}function mp(e,t){let n=[],o=new Set,r=i=>{o.has(i.id)||n.length>=up||(o.add(i.id),n.push(i));},a=cp(t);for(let i of mt(e,t)){for(let d of a.get(i.paragraphId)??[])r(d);let s=t.node(i.paragraphId);if(!s||s.kind!=="paragraph")continue;let l=Ei(s);for(let d of sc(s)){let m=l.spanOf(d.node);m&&pp(i.start,i.end,m.start,m.end)&&r(d.node);}}return n}function ml(e,t,n){let o=W(e.scope.span,t,n);if(!o.ok)return Pn(o.code,"that span is not a place",o.detail);let r=ee(e.scope.span,t,n);if(!r.ok)return Pn(r.code,"that span is not a place",r.detail);let a=mp(o.value,r.value),i=s=>t.contentControl(s.id,r.value.story);switch(e.op){case "getContentControls":return {ok:true,kind:"query",value:{kind:"handles",handles:a.map(i)}};case "getContentControlById":{if(!Number.isInteger(e.id))return Pn("unsupported-content","a control id is a whole number",String(e.id));let s=a.find(l=>qc$1(l).id===e.id);return s?{ok:true,kind:"query",value:{kind:"handle",handle:i(s)}}:Pn("invalid-handle","no control in that scope carries that id",String(e.id))}default:{let s=e.op==="getContentControlsByTag",l=s?e.tag:e.title;return typeof l!="string"||l.length===0?Pn("unsupported-content","a tag or title to match is required",e.op):{ok:true,kind:"query",value:{kind:"handles",handles:a.filter(m=>{let c=qc$1(m);return (s?c.tag:c.alias)===l}).map(i)}}}}}var fp=256,fl=1e4;function Ir(e,t){if(e.kind!=="textValue"){for(let n of e.attributes)if(n.namespaceUri===pa&&n.localName===t)return n.value}}function gp(e){return e.startsWith("_")}function Dt(e,t={}){let n=new Map,o=[],r=new Set;for(let a of e.paragraphIds){let i=e.node(a);if(i?.kind!=="paragraph")continue;let s=Ei(i),l=d=>{if(d.kind!=="textValue"){if(d.kind==="bookmarkStart"){if(o.length>=fl||n.size>=fl)return;let m=Ir(d,"id"),c=Ir(d,"name");if(m===void 0||c===void 0||c.length===0||c.length>fp||gp(c)&&!t.includeHidden||r.has(c)||n.has(m))return;let h=s.spanOf(d)?.start??0;n.set(m,{name:c,start:{paragraphId:a,offset:h}});return}if(d.kind==="bookmarkEnd"){let m=Ir(d,"id");if(m===void 0)return;let c=n.get(m);if(!c)return;n.delete(m),r.add(c.name);let h=s.spanOf(d)?.start??0;o.push(Object.freeze({name:c.name,start:c.start,end:{paragraphId:a,offset:h}}));return}for(let m of d.children)l(m);}};for(let d of i.children)l(d);}return Object.freeze(o)}function wo(e,t){return Dt(e).find(n=>n.name===t)??null}function gl(e,t){let n=e.node(t);if(n?.kind!=="paragraph")return Object.freeze([]);let o=Ei(n),r=[],a=(i,s)=>{if(!(i.kind==="textValue"||s>32)){if(Ee$1(i)){let l=o.spanOf(i);l&&r.push(Object.freeze({id:i.id,paragraphId:t,start:l.start,end:l.end}));return}for(let l of i.children)a(l,s+1);}};for(let i of n.children)a(i,0);return Object.freeze(r)}function hl(e,t,n){let o=He(n,r=>fj(e,t,r));if(o.kind==="external")return o.href;if(o.kind==="internal"){let r=Fe(n);return r===void 0||r.length===0?null:`#${r}`}return null}var Co=Object.freeze({kind:"applied"}),ye=(e,t,n)=>({ok:false,error:n===void 0?{code:e,message:t}:{code:e,message:t,detail:n}}),Lt=e=>({ok:true,kind:"query",value:e});function xl(e){let t=[],n=new Set,o=r=>{let a=e.story(r);!a||n.has(Y(r))||(n.add(Y(r)),t.push(a));};o(ve),e.sections().forEach((r,a)=>{for(let i of ["header","footer"])for(let s of Nt)e.furniture(a).some(d=>d.kind===i&&d.variant===s&&d.declared)&&o({kind:i,sectionIndex:a,variant:s});});for(let r of ["footnote","endnote"]){let a=e.noteIds(r);if(a.ok)for(let i of a.ids)o({kind:"note",noteKind:r,noteId:i});}return t}function yl(e,t){let n=Yi(t);for(let o of xl(e)){let r=Dt(o,{includeHidden:true}).find(a=>Yi(a.name)===n);if(r)return {story:o,bookmark:r}}return null}var In=(e,t)=>e[0]<t[0]||e[0]===t[0]&&e[1]<t[1],en=(e,t)=>e[0]===t[0]&&e[1]===t[1],kl=(e,t)=>In(e,t)||en(e,t);function hp(e,t,n){let o=en(e.start,e.end),r=en(t.start,t.end),a;return o?a=r?en(t.start,e.start):kl(t.start,e.start)&&In(e.start,t.end):r?a=kl(e.start,t.start)&&In(t.start,e.end):a=In(t.start,e.end)&&In(e.start,t.end),a||!n?a:en(t.end,e.start)||en(t.start,e.end)}function bl(e,t,n){return (o,r)=>{let a=e(o);return t(a)??[...new Set(r)].reduce((i,s)=>i??n(a,s),null)}}function vl(e,t,n,o){if(o||!e.ok||e.kind!=="command"||e.relate)return e;let r=Nk(t.part,n.start,n.end,t.paragraphIds);return r.length===0?e:{...e,ops:[...r,...e.ops]}}function Al(e,t,n){let o=t.resolve(e,"bookmark");if(!o||o.kind!=="bookmark")return ye("invalid-handle","that handle does not name a bookmark","bookmark");let r=n.story(o.story);if(!r)return ye("invalid-handle","that story is not in this document");let a=wo(r,o.name);if(!a)return ye("invalid-handle","this document no longer declares that bookmark",tt);let i=s=>({story:r.story,paragraphId:s.paragraphId,index:r.indexOf(s.paragraphId),offset:s.offset});return {reads:r,range:{start:i(a.start),end:i(a.end)}}}function Ol(e,t,n,{admit:o,pinned:r}){if(e.op==="getBookmarkName"){let d=t.resolve(e.bookmark,"bookmark");return !d||d.kind!=="bookmark"?ye("invalid-handle","that handle does not name a bookmark","bookmark"):Lt({kind:"text",text:d.name})}if(e.op==="getBookmarks"){let d=W(e.scope,t,n);if(!d.ok)return ye(d.code,"that span is not a place",d.detail);let m=ee(e.scope,t,n);if(!m.ok)return ye(m.code,"that span is not a place",m.detail);let c=d.value,h=c===null?null:new Set(be(c,m.value)),f=Dt(m.value).filter(y=>{if(!h||c===null||!h.has(y.start.paragraphId)&&!h.has(y.end.paragraphId))return false;let x=y.start.paragraphId===c.end.paragraphId&&y.start.offset>c.end.offset,v=y.end.paragraphId===c.start.paragraphId&&y.end.offset<c.start.offset;return !x&&!v});return Lt({kind:"handles",handles:f.map(y=>t.bookmark(y.name,m.value.story))})}if(e.op==="getBookmarkNames"){let d=W(e.scope,t,n);if(!d.ok)return ye(d.code,"that range is not a place",d.detail);let m=ee(e.scope,t,n);if(!m.ok)return ye(m.code,"that range is not a place",m.detail);let c=d.value;if(!c)return Lt({kind:"texts",texts:[]});let h=(x,v)=>[m.value.indexOf(x),v],f={start:h(c.start.paragraphId,c.start.offset),end:h(c.end.paragraphId,c.end.offset)},y=Dt(m.value,{includeHidden:e.includeHidden}).filter(x=>hp(f,{start:h(x.start.paragraphId,x.start.offset),end:h(x.end.paragraphId,x.end.offset)},e.includeAdjacent)).map(x=>x.name);return Lt({kind:"texts",texts:Object.freeze(y)})}if(e.op==="getBookmarkRangeByName"){if(!t.resolve(e.document,"document"))return ye("invalid-handle","that handle does not name a document","document");if(typeof e.name!="string")return ye("unsupported-content","a bookmark name is a string");let d=yl(n,e.name);if(!d)return Lt({kind:"spans",spans:[]});let m=c=>({story:d.story.story,paragraphId:c.paragraphId,index:d.story.indexOf(c.paragraphId),offset:c.offset});return Lt({kind:"spans",spans:[Ae({start:m(d.bookmark.start),end:m(d.bookmark.end)},t)]})}if(e.op==="insertBookmark"){if(typeof e.name!="string"||Wi(e.name)!==null)return ye("unsupported-content","a bookmark name starts with a letter or an underscore, holds only letters, digits and underscores, and has at most 40 characters","invalid-bookmark-name");let d=W(e.span,t,n);if(!d.ok)return ye(d.code,"that range is not a place",d.detail);let m=ee(e.span,t,n);if(!m.ok)return ye(m.code,"that range is not a place",m.detail);let c=d.value;if(!c)return ye("invalid-offset","this story holds no paragraph to bookmark");let h=Yi(e.name),f=new Set(xl(n).filter(v=>v.part.name!==m.value.part.name&&Dt(v,{includeHidden:true}).some(P=>Yi(P.name)===h)).map(v=>v.part.name)),y=o(m.value,[c.start.paragraphId,c.end.paragraphId]);return y||{ok:true,kind:"command",ops:[{op:"insertBookmark",name:e.name,start:{paragraphId:c.start.paragraphId,offset:c.start.offset},end:{paragraphId:c.end.paragraphId,offset:c.end.offset}}],story:m.value.story,...f.size>0?{packageEdits:[v=>{let P=v;for(let A of f)P=Mk(P,A,e.name);return P}]}:{},answer:()=>Co}}let a=e.target,i;if("bookmark"in a){let d=t.resolve(a.bookmark,"bookmark");if(!d||d.kind!=="bookmark")return ye("invalid-handle","that handle does not name a bookmark","bookmark");let m=n.story(d.story),c=m?Dt(m,{includeHidden:true}).find(h=>h.name===d.name):void 0;if(!m||!c)return ye("invalid-handle","this document no longer declares that bookmark",d.name);i={story:m,bookmark:c};}else {if(!t.resolve(a.document,"document"))return ye("invalid-handle","that handle does not name a document","document");if(typeof a.name!="string")return ye("unsupported-content","a bookmark name is a string");i=yl(n,a.name);}if(!i)return Lt(Co);let s=r();if(s===null||Y(s)!==Y(i.story.story)){let d=i.story.part.name,m=i.bookmark.name;return {ok:true,kind:"command",ops:[],story:s??i.story.story,packageEdits:[c=>Mk(c,d,m)],answer:()=>Co}}let l=o(i.story,[i.bookmark.start.paragraphId,i.bookmark.end.paragraphId]);return l||{ok:true,kind:"command",ops:[{op:"deleteBookmark",name:i.bookmark.name}],story:i.story.story,answer:()=>Co}}var yp=20*1024*1024;function Sr(e,t=yp){if(typeof e!="string"||e.length===0||e.length>Math.ceil(t/3)*4||e.length%4!==0)return null;let n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=e.endsWith("==")?2:e.endsWith("=")?1:0,r=new Uint8Array(e.length/4*3-o),a=0;for(let i=0;i<e.length;i+=4){let s=i+4===e.length,l=s?4-o:4,d=[0,0,0,0];for(let c=0;c<l;c++){let h=n.indexOf(e[i+c]);if(h<0)return null;d[c]=h;}if(s&&(o===2&&(d[1]&15)!==0||o===1&&(d[2]&3)!==0))return null;let m=d[0]<<18|d[1]<<12|d[2]<<6|d[3];a<r.length&&(r[a++]=m>>>16),a<r.length&&(r[a++]=m>>>8),a<r.length&&(r[a++]=m);}return r}function Rl(e,t,n,o,r){let a=Sr(r);if(!a)return {ok:false,detail:"picture: invalid or oversized base64 (20 MiB maximum)"};let i=Of$1(a);if(i!=="image/png"&&i!=="image/jpeg")return {ok:false,detail:"picture: only PNG and JPEG are supported"};if(!kp(a,i))return {ok:false,detail:"picture: truncated raster container"};let s=Tf(a,i);if(!s||s.pixelWidth*s.pixelHeight>4e7)return {ok:false,detail:"picture: invalid or oversized raster dimensions"};let l=s.pixelWidth*72/(s.dpiX??96),d=s.pixelHeight*72/(s.dpiY??96),m=fg(l),c=fg(d);if(m===null||c===null)return {ok:false,detail:"picture: invalid physical dimensions"};let h=cg(e,t,{bytes:a,mime:i});if(!h.ok)return {ok:false,detail:`picture: ${h.reason}`};let f=gg({docPrId:h.docPrId,lockAspectRatio:true,relationshipId:h.relationshipId,extentEmu:{cx:m,cy:c}});return {ok:true,docPrId:h.docPrId,ops:[{op:"insertDrawing",paragraphId:n,offset:o,drawing:f}],packageEdits:[y=>{let x=cg(y,t,{bytes:a,mime:i});if(!x.ok||x.relationshipId!==h.relationshipId||x.docPrId!==h.docPrId||x.partName!==h.partName)throw new Kk("picture allocation changed during the batch");return x.pkg}]}}function Pl(e,t){return Ye(e).find(n=>n.drawingNodeId===t&&n.kind==="inline"&&n.picture!==null)??null}function Il(e){return {width:e.extentEmu.cx/eg,height:e.extentEmu.cy/eg,lockAspectRatio:e.locks.changeAspect,altTextDescription:e.description}}function Sl(e,t){let n=new Set(Ye(e).filter(r=>r.kind==="inline"&&r.picture!==null).map(r=>r.drawingNodeId)),o=[];for(let r of t){let a=eb(e,r.paragraphId);if(!(!a||a.kind!=="paragraph"))for(let i of Bi(a))i.start>=r.start&&i.end<=r.end&&n.has(i.node.id)&&o.push(i.node.id);}return o}function wl(e,t){let n=[],o=e.drawingNodeId;if(t.lockAspectRatio!==void 0&&typeof t.lockAspectRatio!="boolean")return {ok:false,detail:"lockAspectRatio: not a boolean"};let r=t.lockAspectRatio??e.locks.changeAspect;if(t.lockAspectRatio===false&&n.push({op:"setDrawingLocks",drawingNodeId:o,locks:{changeAspect:false}}),t.width!==void 0||t.height!==void 0){let a=t.width??e.extentEmu.cx/eg,i=t.height??e.extentEmu.cy/eg;if(r){let d=e.extentEmu.cx/e.extentEmu.cy;if(t.width!==void 0&&t.height!==void 0&&Math.abs(a/i-d)>1e-6)return {ok:false,detail:"picture: width and height disagree with the locked aspect ratio"};t.width!==void 0&&t.height===void 0&&(i=a/d),t.height!==void 0&&t.width===void 0&&(a=i*d);}let s=fg(a),l=fg(i);if(s===null||l===null)return {ok:false,detail:"picture: dimensions must be finite positive points"};n.push({op:"resizeDrawing",drawingNodeId:o,extentEmu:{cx:s,cy:l}});}if(t.lockAspectRatio===true&&n.push({op:"setDrawingLocks",drawingNodeId:o,locks:{changeAspect:true}}),t.altTextDescription!==void 0){if(typeof t.altTextDescription!="string"||t.altTextDescription.length>32767||!X(t.altTextDescription))return {ok:false,detail:"altTextDescription: invalid XML text or length"};n.push({op:"setDrawingMetadata",drawingNodeId:o,title:e.title,description:t.altTextDescription});}return n.length?{ok:true,ops:n}:{ok:false,detail:"picture: no properties requested"}}function kp(e,t){if(t==="image/jpeg")return e.length>=4&&e[e.length-2]===255&&e[e.length-1]===217;let n=new DataView(e.buffer,e.byteOffset,e.byteLength),o=8,r=false;for(;o+12<=e.length;){let a=n.getUint32(o);if(a>e.length-o-12)return false;let i=String.fromCharCode(e[o+4],e[o+5],e[o+6],e[o+7]);if(i==="IDAT"&&a>0&&(r=true),o+=a+12,i==="IEND")return r&&a===0&&o===e.length}return false}var Cl=128*1024*1024,xp=Math.ceil(Cl/3)*4;function Tl(e,t){let n=(l,d)=>({ok:false,error:{code:"unsupported-capability",message:l,detail:d}});if(!t.engine)return n("Document compare needs the review module.","review-module-required");if(t.collaborative)return n("Document compare is not available in a collaboration session.","edit.operation-unsupported");let o=t.reads.package;if(!o)return {ok:false,error:{code:"document-unavailable",message:"document unavailable"}};if(typeof e.base64=="string"&&e.base64.length>xp)return n("base64File is larger than the compare size limit.","edit.resource-limit");let r=Sr(e.base64,Cl);if(!r)return {ok:false,error:{code:"unsupported-content",message:"base64File is not valid base64.",detail:"edit.invalid-argument"}};let a=t.engine(o,r,{...e.authorName===void 0?{}:{authorName:e.authorName},...e.detectFormatChanges===void 0?{}:{detectFormatChanges:e.detectFormatChanges},...e.removeDateAndTime===void 0?{}:{removeDateAndTime:e.removeDateAndTime}});if(!a.ok)switch(a.code){case "invalidRevised":case "invalidOptions":return {ok:false,error:{code:"unsupported-content",message:a.message,detail:"edit.invalid-argument"}};case "tooLarge":return n(a.message,"edit.resource-limit");case "protected":return {ok:false,error:{code:"unsupported-revision",message:a.message,detail:"edit.protected-content"}};default:return {ok:false,error:{code:"unsupported-revision",message:a.message,detail:"edit.unsupported-content"}}}let i=t.pin();if(i)return i;let s=a.package;return {ok:true,kind:"command",story:ve,ops:[],packageEdits:[()=>s],answer:()=>({kind:"applied"})}}var wr="http://schemas.openxmlformats.org/package/2006/relationships",Nl="http://schemas.openxmlformats.org/officeDocument/2006/relationships",bp=[{type:"application/vnd.openxmlformats-package.core-properties+xml",namespace:"http://schemas.openxmlformats.org/package/2006/metadata/core-properties",root:"coreProperties",relationship:`${wr}/metadata/core-properties`},{type:"application/vnd.openxmlformats-officedocument.extended-properties+xml",namespace:"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties",root:"Properties",relationship:`${Nl}/extended-properties`},{type:"application/vnd.openxmlformats-officedocument.custom-properties+xml",namespace:"http://schemas.openxmlformats.org/officeDocument/2006/custom-properties",root:"Properties",relationship:`${Nl}/custom-properties`}];function Cr(e){let t=new Map;for(let o of bp){let r=[...new Set([...e.parts.keys(),...e.partBytes.keys()])].filter(l=>ug(e,l)===o.type);if(r.length>1)return null;let a=(e.relationships.get("/")??[]).filter(l=>l.type===o.relationship);if(a.length>1)return null;let i=a[0];if(i){if(i.targetMode!=="Internal")return null;let l=E("/",i.rawTarget);if(!l.ok||r.length!==1||C(l.partName)!==C(r[0]))return null}if(r.length===0)continue;let s=e.parts.get(r[0]);if(!s||s.root.namespaceUri!==o.namespace||s.root.localName!==o.root||(e.relationships.get(s.name)?.length??0)>0||e.parts.has(vg(s.name))||e.partBytes.has(vg(s.name)))return null;t.set(C(s.name),{part:s,relationship:o.relationship});}if(t.size===0)return e;if(!df$1(e,new Set(t.keys())))return null;for(let[o,r]of e.relationships)for(let a of r){if(a.targetMode==="External")continue;let i=E(o,a.rawTarget),s=i.ok&&t.get(C(i.partName));if(!s)continue;if(o!=="/"||a.type!==s.relationship)return null;let l=e.parts.get(vg(o));if(!l||l.root.namespaceUri!==wr||l.root.localName!=="Relationships")return null;let d=l.root.children.filter(c=>c.kind!=="textValue"&&c.attributes.some(h=>h.namespaceUri===""&&h.localName==="Id"&&h.value===a.id));if(d.length!==1)return null;let m=d[0];if(m.kind==="textValue"||m.namespaceUri!==wr||m.localName!=="Relationship"||m.attributes.some(c=>c.namespaceUri!==""||!["Id","Type","Target","TargetMode"].includes(c.localName))||m.children.some(c=>c.kind!=="textValue"||!cf$1(c.value)))return null}let n=e;for(let{part:o}of t.values()){let r=yg(n,o.name);if(!r.ok||r.pkg.contentTypes.overrides.has(C(o.name)))return null;n=r.pkg;}return n}function El(e,t,n,o=true){let r=s=>({ok:false,error:{code:"unsupported-content",message:s}});if(!t.package)return r("document unavailable");if(e.op==="getDocumentProperty")return na$1.includes(e.name)?{ok:true,kind:"query",value:{kind:"text",text:pa$1(t.package,e.name)}}:r("unsupported document property");if(e.op==="removeDocumentInformation"){if(e.removeDocInfoType!=="DocumentProperties"||!o)return {ok:false,error:{code:"unsupported-capability",message:"Only direct DocumentProperties removal outside collaboration is supported."}};if(!Cr(t.package))return {ok:false,error:{code:"unsupported-capability",message:"Document property parts have unsupported structure or dependencies."}};let s=n();return s||{ok:true,kind:"command",story:ve,ops:[],packageEdits:[l=>{let d=Cr(l);if(!d)throw new Kk("document property parts changed");return d}],answer:()=>({kind:"applied"})}}if(!qa(e.values))return r("invalid document property values");if(!o&&!oa$2(t.package))return {ok:false,error:{code:"unsupported-capability",message:"Create document properties before joining collaboration; concurrent core-part creation cannot merge safely."}};let a={...e.values};if(!ra$1(t.package,a))return {ok:false,error:{code:"unsupported-capability",message:"the core properties part cannot be updated safely"}};let i=n();return i||{ok:true,kind:"command",story:ve,ops:[],packageEdits:[s=>{let l=ra$1(s,a);if(!l)throw new Kk("document properties package changed");return l}],answer:()=>({kind:"applied"})}}function b(e,t,n){return {ok:false,error:Object.freeze(n===void 0?{code:e,message:t}:{code:e,message:t,detail:n})}}function _(e){return {ok:true,kind:"query",value:e}}function Ml(e,t){if(!t.package)return b("document-unavailable","this host holds no document right now");let{name:n,id:o,count:r}=e,a=[n,o,r].filter(d=>d!==void 0).length,i=d=>b("unsupported-content",d);if(a>1)return i("give at most one of name, id, and count");if(n!==void 0&&typeof n!="string")return i("a style name is a string");if(o!==void 0&&typeof o!="string")return i("a style id is a string");if(r!==void 0&&r!==true)return i("count is true or omitted");let s=Rp(t.package);if(r)return _({kind:"number",value:s.length});if(n===void 0&&o===void 0)return _({kind:"styles",styles:s});let l=o!==void 0?Fl(s).byId.get(o):n.length>Jt?void 0:Op(s,n);return _({kind:"styles",styles:l?[l]:[]})}var vp=new Set(["paragraph","character","table","numbering"]),Ap=Object.freeze([]),Dl=new WeakMap,Ll=new WeakMap;function Fl(e){let t=Ll.get(e);if(t)return t;let n=new Map,o=new Map;for(let a of e){o.set(a.id,a);let i=vo(a.name),s=n.get(i);(!s||s.type!=="paragraph"&&a.type==="paragraph")&&n.set(i,a);}let r={byKey:n,byId:o};return Ll.set(e,r),r}function Op(e,t){return Fl(e).byKey.get(vo(t))}function Rp(e){let t=ud$1(e);if(!t)return Ap;let n=Dl.get(t.root);if(n)return n;let o=Pp(t);return Dl.set(t.root,o),o}function Pp(e){let t=Et(e),n=[],o=new Map;for(let a of t.entries){if(!vp.has(a.type))continue;let i=t.nameOf(a.type,a.styleId);i!==null&&(n.push(a),o.set(a.styleId,{name:i,type:a.type}));}let r=(a,i)=>{let s=a==null?void 0:o.get(a);return s&&s.type===i?s.name:null};return Object.freeze(n.map(a=>{let i=a.element,s=o.get(a.styleId).name,l=h=>ud$2(i,h),d=l("link"),m=d?td$1(d,"val"):void 0,c=Ip.get(a.type);return Object.freeze({id:a.styleId,name:s,type:a.type,builtIn:!Sp(td$1(i,"customStyle")),basedOn:r(a.basedOn,a.type),next:a.type!=="paragraph"?null:l("next")===void 0?s:r(a.next,"paragraph"),linked:c!==void 0&&m!==a.styleId&&r(m,c)!==null,hidden:To(l("semiHidden"))||To(l("hidden")),uiPriority:wp(l("uiPriority")),quickStyle:To(l("qFormat")),unhideWhenUsed:To(l("unhideWhenUsed"))})}))}var Ip=new Map([["paragraph","character"],["character","paragraph"]]),Bl=new Set(["1","true","on"]);function Sp(e){return e!==void 0&&Bl.has(e)}function To(e){if(!e)return false;let t=td$1(e,"val");return t===void 0||Bl.has(t)}function wp(e){let t=e?td$1(e,"val"):void 0;return t!==void 0&&/^-?\d{1,9}$/.test(t)?Number(t):null}function Hl(e,t){let{reads:n,handles:o}=t;switch(e.op){case "getStyles":return Ml(e,n);case "getSections":return o.resolve(e.document,"document")?_({kind:"handles",handles:n.sections().map(r=>o.section(r.index))}):b("invalid-handle","that handle does not name a document","document");case "getPageSetup":{let r=o.resolve(e.section,"section");if(!r||r.kind!=="section")return b("invalid-handle","that handle does not name a section","section");let a=n.sections()[r.index];return a?_({kind:"pageSetup",setup:a.pageSetup}):b("invalid-handle","that section is not in this document")}default:return El(e,n,t.pin,t.supportsPartCreation)}}function _l(e,t){let n=[],o=new Set,r=a=>{if(a.kind!=="textValue"){if(a.namespaceUri===pa&&a.localName===`${t}Reference`){let i=Rc$1(a)??Number.NaN;o.has(i)||(n.push(i),o.add(i));}for(let i of a.children)r(i);}};return r(e),n}var jl={},Vl=new WeakMap;function Kl(e,t){let n=e??jl,o=Vl.get(n);o||Vl.set(n,o=new WeakMap);let r=t??jl,a=o.get(r);return a||o.set(r,a=Cp(e,t)),a}function Ul(e,t=null,n="all-markup",o){let r=Kl(e,t);return (a,i,s,l,d=n,m=o)=>{let c=r(a,i,s,l,d,m);return c.rtl||c.cs}}function Iy(e,t=null,n="all-markup",o){let r=Kl(e,t);return (a,i,s,l,d=n,m=o)=>r(a,i,s,l,d,m).rtl}function Cp(e,t){let n=lf$1(e,void 0,t),o=bo(n),r=new WeakMap;return (a,i,s,l,d="all-markup",m)=>{let c=o(l,a,d,m),h=r.get(a);if(!h||h.cellStyle!==c){let P=mf$1(n,ai(a,"paragraphProperties","pPr"),c);h={cellStyle:c,inherited:P},r.set(a,h);}let{inherited:f}=h,y=s?f.markRunProperties:pf$1(f.runProperties,zb(i),n),x=false,v=false;for(let P of y){if(P.localName!=="rtl"&&P.localName!=="cs")continue;let A=P.attributes?.val,N=A===void 0||["1","true","on"].includes(A);P.localName==="rtl"?x=N:v=N;}return {rtl:x,cs:v}}}function Wl(e,t=()=>null,n=()=>"all-markup",o=()=>{}){return {runPropertyEdits(...r){return qi(r[0],r[1],r[2],r[3],r[4],r[5],r[6],Ul(e(),t(),n(),o()))},mergedParagraphMarkProperties(...r){return ki(r[0],r[1],r[2],Ul(e(),t(),n(),o()))}}}var gt=xj,ht=/[\r\n\f\u2028\u2029]/;function tn(e,t,n){return n.length?[{op:"insertText",paragraphId:e,offset:t,text:n}]:[]}function Tr(e){return e.replaceAll(gt,`
@@ -1,3 +1,3 @@
1
- import {f,c,d,e}from'./chunk-RIYSCEFQ.js';import {Ue as Ue$1,n,l,p,j as j$1,k,r,i,o,A,B,C,x,u,a,g,f as f$2,ya as ya$1,Ca as Ca$1,fb,Oa as Oa$1,yf,xf,w as w$1,O,N,ra as ra$1,y,ta as ta$1,jd,hd,Zc,wc,ge as ge$1,mb,q as q$1,ec,bc,ac,ab,Ja as Ja$1,dd,cc,t,b,e as e$1,c as c$1,m,Ra as Ra$1,Ya as Ya$1,uf,Od,ie as ie$1,fe as fe$1,Wc,id,Ka as Ka$1,fc,h,sa,Ia as Ia$1}from'./chunk-K2BBJDM7.js';import {f as f$1,yn,sc,qc,vc,rc,pj,Bn as Bn$1,An as An$1,zn as zn$1,ec as ec$1,oc,c as c$2,me as me$1,b as b$1}from'./chunk-P3XUE72N.js';var zr=(e,t,n)=>{let r=e<0n,o=r?-e:e,a=o/t,i=o%t;if(n!=="towardZero"){let l=i*2n;(l>t||l===t&&(n==="halfAwayFromZero"||n==="halfToEven"&&a%2n!==0n))&&(a+=1n);}let s=r?-a:a,c=Number(s);if(!Number.isSafeInteger(c))throw new RangeError("Shaped fixed-point value exceeds the safe integer range");return c},ct=(e,t,n$1,r)=>{if(!Number.isSafeInteger(e))throw new RangeError("font units must be a safe integer");if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("fixed-point denominator must be a positive safe integer");if(!Number.isSafeInteger(n$1)||n$1<0)throw new RangeError("fixed-point numerator must be a non-negative safe integer");if(e===0||n$1===0)return n(0);let o=e*n$1;if(Number.isSafeInteger(o)){let a=Math.abs(o),i=a%t,s=(a-i)/t;return r!=="towardZero"&&(i>t-i||i===t-i&&(r==="halfAwayFromZero"||r==="halfToEven"&&s%2!==0))&&(s+=1),n(s===0?0:o<0?-s:s)}return n(zr(BigInt(e)*BigInt(n$1),BigInt(t),r))},Sn=(e,t,n,r)=>{if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("font size must be a positive integer number of half points");if(t>Math.floor(Number.MAX_SAFE_INTEGER/n))throw new RangeError("font size and fixed-point scale product exceeds the safe integer range");let o=t*n,a=e*2;return i=>ct(i,a,o,r)},xn=(e,t,n)=>{let r=t*n,o=e*2;return a=>a*r/o};var Pe=(e,t)=>e[t]<<8|e[t+1],bn=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0;function Dr(e,t){let n=(s,c)=>s>=0&&s+c<=e.length;if(!n(0,12))return false;let a=String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"&&n(12+t*4,4)?bn(e,12+t*4):0;if(!n(a,12))return false;let i=Pe(e,a+4);for(let s=0;s<i;s+=1){let c=a+12+s*16;if(!n(c,16))return false;if(!(e[c]===99&&e[c+1]===109&&e[c+2]===97&&e[c+3]===112))continue;let u=bn(e,c+8);if(!n(u,4))return false;let y=Pe(e,u+2);for(let f=0;f<y;f+=1){let p=u+4+f*8;if(!n(p,4))return false;if(Pe(e,p)===3&&Pe(e,p+2)===0)return true}return false}return false}var Rn=new WeakMap;function Fn(e,t){let n=Rn.get(e);return n===void 0&&(n=Dr(t,e.faceIndex),Rn.set(e,n)),n}function Cn(e){let t="",n=false;for(let r=0;r<e.length;r+=1){let o=e.charCodeAt(r);o>=32&&o<=255?(t+=String.fromCharCode(61440+o),n=true):t+=e[r];}return n?t:e}var Hr=4096,En=e=>typeof e=="number"?String(e):JSON.stringify(e)??typeof e,ke=class{constructor(t){this.onRestart=t;}onRestart;#e=new Map;keyOf(t$1,n){let r=t(n),o=this.#e.get(r);o===void 0&&(this.#e.size>=Hr&&(this.#e.clear(),this.onRestart()),o=this.#e.size,this.#e.set(r,o));let a=`${o}\0${En(t$1.fontSizeHalfPoints)}\0${En(t$1.bidiLevel)}\0`,i=t$1.context;return !i||i.before===""&&i.after===""?`${a}-${t$1.text}`:`${a}c${i.before.length},${i.after.length}\0${i.before}${i.after}${t$1.text}`}clear(){this.#e.clear();}};var ie=Object.freeze({name:"HarfBuzz",version:"14.4.0"}),ye=null,fe=null;function ut(){return ye?Promise.resolve():fe||(fe=import('./dist-PKZR6RSH.js').then(e=>{let t=e.versionString();if(t!==ie.version)throw new w("shapingLibraryMismatch",{diagnostic:f(ie.version,t)});ye=e;}).catch(e$1=>{throw fe=null,e$1 instanceof w?e$1:c(e$1)?new w("unsupportedRuntime",{diagnostic:d(e$1),cause:e$1}):new w("wasmUnavailable",{diagnostic:e(e$1),cause:e$1})}),fe)}function Gr(){return ye!==null}function Ur(){if(!ye)throw new w("notInitialized",{diagnostic:"Call initializeHarfBuzz() before creating a text shaper"});return ye}var w=class extends Error{name="HarfBuzzShapingError";code;limit;actual;diagnostic;constructor(t,n={}){super(`HarfBuzz shaping failed (${t})`,{cause:n.cause}),this.code=t,this.limit=n.limit,this.actual=n.actual,this.diagnostic=n.diagnostic;}},Kr=16*1024*1024,Wr=1e6,Vr=1e6,jr=1e6,Xr=4,Yr=512,$r=1024*1024,qr=16*1024*1024,Zr=32*1024*1024,Jr=64*1024*1024,Qr=64*1024*1024,eo=1e6,to=1e6,no=1e6,ro=64,oo=4096,ao=4*1024*1024,io=64*1024*1024,so=64*1024*1024,co=256*1024*1024,lo=new Set(["COLR","CPAL","CBDT","CBLC","sbix","SVG "]),vn=["cmap","head","hhea","hmtx","maxp"],uo=(e,t)=>e[t]<<8|e[t+1],po=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,fo=(e,t)=>String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?po(e,12+t*4):0,mo=(e,t)=>{let n=fo(e,t),r=uo(e,n+4),o=new Set;for(let a=0;a<r;a+=1){let i=n+12+a*16;o.add(String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]));}return o},yo=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),ho=(e,t)=>{let n=l(e,t);if(!n.valid)return n;let r=mo(e,t);for(let o of vn)if(!r.has(o))return {valid:false,diagnostic:`missing required ${o} table`};return {valid:true}},dt=ho,U=(e,t,n)=>{if(!Number.isSafeInteger(e)||e<=0||e>n)throw new RangeError(`${t} must be a positive safe integer no greater than ${n}`);return e},go=(e,t,n$1)=>{if(t.length===0)return [];let r=[],o=0;for(;o<t.length;){let a=t[o].cluster,i=o+1,s=t[o].advanceX;for(;i<t.length&&t[i].cluster===a;)s+=t[i].advanceX,i+=1;let c=n(s);r.push({textStart:a,textEnd:n$1==="rtl"?t[o-1]?.cluster??e.length:t[i]?.cluster??e.length,glyphStart:o,glyphEnd:i,advance:c,caretEdges:Object.freeze([n(0),c]),fontSpan:0}),o=i;}return r},V=64,$=8,q=8,Ln=32,pt=V+2*$,So=V+$+q,xo=V+$+2*q,bo=V+$+q,Tn=V+8*$,Bn=V+8*q+$,Ro=V+6*q+$,Fo=V+3*q+2*$,Co=V+3*q,he=e=>V+e.length*Uint16Array.BYTES_PER_ELEMENT,ft=e=>bo+he(e),me=e=>Ln+e*$,Eo=(e,t)=>pt+he(e)+So+ft(t),vo=e=>Tn+he(e)+me(e.length)+e.length*Bn,Lo=e=>{let t=new Set(e.glyphs.map(n=>n.outline));return Tn+he(e.text)+me(e.glyphs.length)+e.glyphs.length*Bn+me(e.clusters.length)+e.clusters.length*Ro+e.clusters.reduce((n,r)=>n+me(r.caretEdges.length),0)+me(e.fontSpans.length)+e.fontSpans.length*Fo+(e.exactAdvancesX===void 0?0:Ln+e.exactAdvancesX.length*q)+Co+[...t].reduce((n,r)=>n+ft(r.path),0)},To=(e,t)=>pt+he(e)+xo+t,lt=class{#e;#p;#f;#m;#y;#R;#h;#l=0;#F;#g;#S;#c;#x;#u;#t;#o=new Map;#i=new Map;#s=new Map;#n=new Map;#C=new ke(()=>{this.#n.clear(),this.#r=0,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0}));});#a=0;#r=0;#b=0;#d;constructor(t,n){p(this),this.#e=t,this.#p=U(n.maxFontBytes??Kr,"maximum font bytes",Qr),this.#f=U(n.maxInputUtf16??Wr,"maximum input UTF-16 code units",eo),this.#m=U(n.maxCodepoints??Vr,"maximum input code points",to),this.#y=U(n.maxGlyphs??jr,"maximum shaped glyphs",no),this.#h=U(n.maxCachedFontBytes??64*1024*1024,"maximum cached font bytes",64*1024*1024),this.#R=U(n.maxCachedFaces??Xr,"maximum cached faces",ro),this.#F=U(n.maxCachedShapes??Yr,"maximum cached shape results",oo),this.#g=U(n.maxOutlineBytes??$r,"maximum outline bytes",ao),this.#S=U(n.maxCachedOutlineBytes??qr,"maximum cached outline bytes",io),this.#c=U(n.maxShapedRunBytes??Zr,"maximum shaped run bytes",so),this.#x=U(n.maxCachedShapeBytes??Jr,"maximum cached shape bytes",co),this.#u=n.instrumentation?.onFaceCacheEvent,this.#t=n.instrumentation,this.#d=new this.#e.Buffer;}dispose(){this.#o.clear(),this.#l=0,this.#i.clear(),this.#s.clear(),this.#n.clear(),this.#C.clear(),this.#a=0,this.#r=0,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#d=void 0;}#v(t,n){let r=this.#o.get(t.identity);if(r)return this.#o.delete(t.identity),this.#o.set(t.identity,r),this.#u?.(Object.freeze({kind:"hit",identity:t.identity})),r;let o=j$1(t);for(let u of vn)if(!o.has(u))throw new w("malformedFont",{diagnostic:`missing required ${u} table`});this.#t?.onByteCopy?.();let a=new this.#e.Blob(yo(n)),i=new this.#e.Face(a,t.faceIndex),s=new this.#e.Font(i),c=s.hExtents();if(!Number.isSafeInteger(i.upem)||i.upem<=0||!Number.isSafeInteger(c.ascender)||!Number.isSafeInteger(c.descender)||!Number.isSafeInteger(c.lineGap))throw new w("malformedFont",{diagnostic:"invalid font units or horizontal metrics"});s.setScale(i.upem,i.upem);let l={identity:t.identity,blob:a,face:i,font:s,unitsPerEm:i.upem,byteLength:n.byteLength};if(n.byteLength<=this.#h){for(;this.#o.size>=this.#R||this.#l+n.byteLength>this.#h;){let u=this.#o.keys().next().value;if(u===void 0)break;this.#l-=this.#o.get(u).byteLength,this.#o.delete(u),this.#u?.(Object.freeze({kind:"evicted",identity:u}));}this.#o.set(t.identity,l),this.#l+=n.byteLength;}return this.#u?.(Object.freeze({kind:"created",identity:t.identity})),l}#L(t,n){let r=this.#i.get(t.identity)?.get(n);if(r)return this.#s.delete(r),this.#s.set(r,void 0),this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#a})),r.outline;this.#t?.onOutlinePathCall?.();let o=t.font.glyphToPath(n),a=ft(o);if(a>this.#g)throw new w("outlineOverLimit",{limit:this.#g,actual:a});let i=Object.freeze({path:o,unitsPerEm:t.unitsPerEm}),s=Eo(t.identity,o)+3*pt+2*q;if(s>this.#S)return this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#a})),i;for(;this.#a+s>this.#S;){let u=this.#s.keys().next().value;if(u===void 0)break;this.#s.delete(u);let y=this.#i.get(u.identity);y.delete(u.glyphId),y.size===0&&this.#i.delete(u.identity),this.#a-=u.bytes,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#a}));}let c=this.#i.get(t.identity);c||this.#i.set(t.identity,c=new Map);let l={outline:i,bytes:s,identity:t.identity,glyphId:n};return c.set(n,l),this.#s.set(l,void 0),this.#a+=s,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"created",retainedBytes:this.#a})),i}#E(t){if(t.length>this.#f)throw new w("textOverLimit",{limit:this.#f,actual:t.length});let n=0;for(let r=0;r<t.length;){let o=t.codePointAt(r);if(r+=o>65535?2:1,n+=1,n>this.#m)throw new w("codepointsOverLimit",{limit:this.#m,actual:n})}}shape(t){if(!this.#d)throw new w("disposed");if(k(t.environment.font),t.environment.font.byteLength>this.#p)throw new w("fontOverLimit",{limit:this.#p,actual:t.environment.font.byteLength});this.#E(t.text);let n$1=vo(t.text);if(n$1>this.#c)throw new w("shapedRunOverLimit",{limit:this.#c,actual:n$1});let r$1=r(t.environment),o$1=this.#C.keyOf(t,r$1),a=this.#n.get(o$1);if(a)return this.#b-a.stamp>=Math.max(1,this.#n.size>>1)&&(this.#n.delete(o$1),this.#n.set(o$1,a),a.stamp=++this.#b),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#r})),a.run;if(this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"miss",retainedBytes:this.#r})),r$1.shapingLibrary.name!==ie.name||r$1.shapingLibrary.version!==ie.version)throw new w("shapingLibraryMismatch");if(r$1.normalization!=="none")throw new w("unsupportedNormalization");if(!Number.isSafeInteger(t.bidiLevel)||t.bidiLevel<0||(t.bidiLevel&1)===1!=(r$1.direction==="rtl"))throw new w("invalidBidiLevel");if(Object.keys(r$1.variationAxes).length>0)throw new w("unsupportedVariationAxes");if(r$1.fallbackOrder.length>0)throw new w("unsupportedFallback");let i$1=i(r$1.font),s=j$1(r$1.font);if([...lo].some(p=>s.has(p))&&!s.has("glyf")&&!s.has("CFF "))throw new w("unsupportedColorFont");let c=t.text;this.#E(c);let l=t.context?.before??"",u$1=t.context?.after??"",y=o,f=Math.max(String(l).length,String(u$1).length);if(typeof l!="string"||typeof u$1!="string"||f>y)throw new w("textOverLimit",{limit:y,actual:f});try{let p=this.#v(r$1.font,i$1),{face:g,font:h}=p,d=this.#d;d.reset();let S=Fn(r$1.font,i$1)?Cn:String,x$1=l+c+u$1,R=A(x$1)?B(p):void 0,L=M=>S(R?C(M,R):M);l||u$1?d.addText(L(l+c+u$1),l.length,c.length):d.addText(L(c)),d.setDirection(r$1.direction==="rtl"?this.#e.Direction.RTL:this.#e.Direction.LTR),d.setScript(r$1.script),d.setLanguage(r$1.language),d.setClusterLevel(this.#e.ClusterLevel.MONOTONE_CHARACTERS);let E=Object.entries(r$1.features).map(([M,G])=>new this.#e.Feature(M,G));if((r$1.features.kern??1)!==0)for(let[M,G]of x(l+c+u$1))E.push(new this.#e.Feature("kern",0,M,G));this.#t?.onShapeCall?.(),this.#e.shape(h,d,E);let A$1=d.getLength();if(A$1>this.#y)throw new w("glyphOverLimit",{limit:this.#y,actual:A$1});let T=d.getGlyphInfos(),v=d.getGlyphPositions(),O=Sn(g.upem,t.fontSizeHalfPoints,r$1.fixedPointScale,r$1.roundingMode),_=xn(g.upem,t.fontSizeHalfPoints,r$1.fixedPointScale),b=[],m=n(0),F=n(0),C$1=new Map,B$1=T.map((M,G)=>{let ee=v[G],At=R?.get(x$1.charCodeAt(M.cluster)),wt=At?.advance??ee?.xAdvance??0;b.push(_(wt));let It=O(wt),Mt=O(ee?.yAdvance??0),xe=At?.glyph??M.codepoint,Nr={id:xe,cluster:M.cluster-l.length,originX:m,originY:F,advanceX:It,advanceY:Mt,offsetX:O(ee?.xOffset??0),offsetY:O(ee?.yOffset??0),outline:C$1.get(xe)??(()=>{let _t=this.#L(p,xe);return C$1.set(xe,_t),_t})()};return m=n(m+It),F=n(F+Mt),Nr}),I=h.hExtents(),P=u({text:c,direction:r$1.direction,bidiLevel:t.bidiLevel,glyphs:B$1,exactAdvancesX:b,clusters:go(c,B$1,r$1.direction),fontSpans:B$1.length===0?[]:[{glyphStart:0,glyphEnd:B$1.length,font:r$1.font,fallbackIndex:null}],metrics:{ascent:O(I.ascender),descent:O(-I.descender),lineGap:O(I.lineGap)}},r$1),N=Lo(P);if(N>this.#c)throw new w("shapedRunOverLimit",{limit:this.#c,actual:N});let D=To(o$1,N);if(D>this.#x)return this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#r})),P;for(;this.#n.size>=this.#F||this.#r+D>this.#x;){let M=this.#n.keys().next().value;if(M===void 0)break;let G=this.#n.get(M);this.#n.delete(M),this.#r-=G.bytes,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#r}));}return this.#n.set(o$1,{run:P,bytes:D,stamp:++this.#b}),this.#r+=D,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"stored",retainedBytes:this.#r})),P}catch(p){throw p instanceof w?p:new w("malformedFont",{diagnostic:p instanceof Error?p.message:"HarfBuzz shaping failed"})}}},mt=(e={})=>new lt(Ur(),e);var yt=Object.freeze({maxFontBytes:16*1024*1024,maxInputUtf16:1e6,maxCodepoints:1e6,maxGlyphs:1e6,maxCachedFaces:32,maxCachedFontBytes:64*1024*1024,maxCachedShapes:512,maxOutlineBytes:1024*1024,maxCachedOutlineBytes:16*1024*1024,maxShapedRunBytes:32*1024*1024,maxCachedShapeBytes:64*1024*1024}),Ai=Object.freeze({...yt,maxCachedShapes:4096});function On(e){let t={maxFontBytes:e.maxFontBytes,maxInputUtf16:e.maxInputUtf16,maxCodepoints:e.maxCodepoints,maxGlyphs:e.maxGlyphs,maxOutlineBytes:e.maxOutlineBytes,maxShapedRunBytes:e.maxShapedRunBytes},n=["docx-editor-layout-harfbuzz-execution-policy",1,Object.entries(t).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>Object.freeze([r,o]))];return `layout-shaper-policy:sha256:${f$1(new TextEncoder().encode(JSON.stringify(n)))}`}function An(e,t=yt){let n=e?.maxFontBytes??t.maxFontBytes;if(!Number.isSafeInteger(n)||n<=0||n>a)throw new RangeError(`Font shaping byte ceiling must be between 1 and ${a}`);return n===t.maxFontBytes?t:Object.freeze({...t,maxFontBytes:n})}function wn(e,t,n=false){let r=false,o=Object.freeze({shape(a){if(r)throw new w("disposed");let i=a.environment.font;if(k(i),i.byteLength>t.maxFontBytes)throw new w("fontOverLimit",{limit:t.maxFontBytes,actual:i.byteLength});return e.shape(a)},dispose(){r||(r=true,n&&e.dispose?.());}});return q$1(e)?p(o):o}var Bo=Object.freeze({}),In=b,Oo="16.0.0",Ao="none",wo=1e3,Io="halfToEven",Pn="cluster-edges-only",Mo="Latn",_o=new Uint8Array(0);var Z=class extends Error{code="overLimit";constructor(t){super(t),this.name="LayoutShapingConfigurationError";}};function Po(e,t){let n=e.epoch,r=e.maxFontBytes,o=e.sources,a$1=e.substitutions,i=e.defaultFont,s=e.language;if(!Number.isSafeInteger(r)||r<=0||r>a)throw new Z(`Font byte ceiling must not exceed the engine hard maximum of ${a}`);let c=o.length,l=a$1?.length??0;if(c===0||c>b)throw new Z(`Font source count must be between 1 and ${b}`);if(l>In)throw new Z(`Font substitution count must not exceed ${In}`);let u=0,y=[];for(let g$1=0;g$1<c;g$1+=1){let h=o[g$1],d=h.request,S=h.availability,x=h.id,R=h.hash,L=h.faceIndex,E=S==="forbidden",A=E?_o:h.bytes;if(!E){if(typeof x!="string"||x.length===0)throw new TypeError("Resolved font id must not be empty");let T;try{T=e$1(A);}catch{throw new Z(`Font source ${x} must provide genuine bytes`)}if(T>r)throw new Z(`Font source ${x} exceeds the per-font byte ceiling`);if(u+=T,u>c$1)throw new Z(`Font sources exceed the aggregate byte ceiling of ${c$1}`)}y.push(t&&g(h)!==void 0?h:Object.freeze({request:Object.freeze({family:d.family,weight:d.weight,style:d.style}),id:x,bytes:A,hash:R,faceIndex:L,...S?{availability:S}:{}}));}let f;if(a$1){f=[];for(let g=0;g<l;g+=1){let h=a$1[g],d=h.from,S=h.to,x=h.lineMetrics;f.push(Object.freeze({from:Object.freeze({family:d.family,weight:d.weight,style:d.style}),to:Object.freeze({family:S.family,weight:S.weight,style:S.style}),...x?{lineMetrics:Object.freeze({heightEm:x.heightEm,baselineEm:x.baselineEm})}:{}}));}}let p={epoch:n,maxFontBytes:r,sources:Object.freeze(y),substitutions:f?Object.freeze(f):void 0,defaultFont:Object.freeze({family:i.family,sizeHalfPoints:i.sizeHalfPoints}),language:s};return Object.freeze(p)}function Mn(e,t){let n=e.map((o,a)=>({value:o,index:a,key:h(t(o))})),r=new Set;for(let o of n){if(r.has(o.key))return e;r.add(o.key);}return n.sort((o,a)=>o.key<a.key?-1:o.key>a.key?1:o.index-a.index).map(({value:o})=>o)}function ko(e,t){let n={family:e.family},r={sizeHalfPoints:e.sizeHalfPoints};return {...n,...t?r:{}}}function _n(e,t){let n=c=>({family:c.family,weight:c.weight,style:c.style}),r=t?e.sources:Mn(e.sources,c=>c.request),o=e.substitutions??[],a=t?o:Mn(o,c=>c.from),i={sources:r.map(c=>{let l=c.availability??"available",u={request:n(c.request),availability:l};if(l==="forbidden")return {...u,...t?{id:c.id,faceIndex:c.faceIndex,declaredHash:c.hash}:{}};let y=g(c);if(y==null)throw new TypeError("Font configuration identity requires prepared source bytes");return {...u,...t?{id:c.id}:{},faceIndex:c.faceIndex,declaredHash:c.hash,actualHash:y,byteLength:c.bytes.byteLength}}),substitutions:a.map(c=>({from:n(c.from),to:n(c.to),lineMetrics:c.lineMetrics?{heightEm:c.lineMetrics.heightEm,baselineEm:c.lineMetrics.baselineEm}:null})),defaultFont:ko(e.defaultFont,t),language:e.language||"en"},s={epoch:e.epoch,maxFontBytes:e.maxFontBytes};return {version:1,...t?s:{},...i}}var No=Symbol("prepared-layout-font-configuration"),Ne=new WeakMap;function zo(e){return Ne.has(e)}function Do(e){let t=Ne.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.configuration}function Ui(e){let t=Ne.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.sharedShapingFingerprint}function ht(e,t){return kn(e,t,false)}function Ki(e,t){return kn(e,t,true)}function kn(e,t,n){let r=Po(e,n),o=Object.freeze({epoch:r.epoch,maxFontBytes:r.maxFontBytes,sources:Object.freeze(r.sources.map(y=>n&&g(y)!==void 0?y:f$2(y,{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash}))),substitutions:r.substitutions,defaultFont:r.defaultFont,language:r.language}),a=new TextEncoder,i=_n(o,true),s=a.encode(JSON.stringify(i)),c=_n(o,false),l=a.encode(JSON.stringify(c)),u=Object.freeze({[No]:true,fingerprint:`font-config:${f$1(s)}`});return Ne.set(u,{configuration:o,sharedShapingFingerprint:`shared-font-config:${f$1(l)}`}),u}function Ho(e){return ht(e).fingerprint}function Go(e,t){let n=new TextEncoder().encode(JSON.stringify({version:1,environment:e,executionPolicy:On(t),ligatureCaretPolicy:Pn,fallback:sa}));return `shaping:${f$1(n)}`}async function Nn(e,t,n,r,o=false){let i=zo(e)?e:ht(e,t),s=Do(i),{epoch:c,maxFontBytes:l,sources:u,substitutions:y,defaultFont:f}=s,p=s.language||"en",g=i.fingerprint,h=m({epoch:c,maxFontBytes:l,resources:u,substitutions:y,validateFont:dt,instrumentation:{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash,onAdmission:t?.onFontAdmission}});await ut();let d=Object.freeze({script:Mo,variationAxes:Object.freeze({}),shapingLibrary:ie,unicodeDataVersion:Oo,normalization:Ao,language:p,features:Bo,...o?{documentLigatures:true}:{},fixedPointScale:wo,roundingMode:Io});return Object.freeze({fonts:h,shaper:wn(n??mt(r),r,n===void 0),defaultFont:f,environment:d,ligatureCaretPolicy:Pn,operation:Object.freeze({resourceEpoch:h.epoch,configEpoch:c,extensionFingerprint:g,shapingHash:Go(d,r),producerVersion:1})})}async function Uo(e,t,n){return Nn(e,t,void 0,An(n))}async function Wi(e,t,n,r,o=false){return Nn(e,r,t,n,o)}function Ko(e){e.shaper.dispose?.();}function gt(e){let t=new Set([0,e.text.length]);for(let r of ya$1(e.text))t.add(r.utf16From),t.add(r.utf16To);let n=new Set([0,e.text.length]);for(let r of e.clusters)n.add(r.textStart),n.add(r.textEnd);return [...t].filter(r=>n.has(r)).sort((r,o)=>r-o)}function ze(e,t){return gt(e).includes(t)}function Wo(e,t){return ze(e,t)}function Vo(e,t,n){return n>=t&&ze(e,t)&&ze(e,n)}function jo(e){let t=ya$1(e.text);return gt(e).map(n=>n===e.text.length?t.length:t.findIndex(r=>r.utf16From===n))}var xt="und";function Gn(){return typeof Intl.Segmenter=="function"}function Xo(){let e=Intl.Segmenter;if(typeof e!="function")throw new Error(`Intl.Segmenter is required for word segmentation (locale: ${xt})`);return e}function Un(){let e=new(Xo())(xt,{granularity:"word"});return {segment(t){let n=[];for(let r of e.segment(t)){let o=r.index,a=o+r.segment.length;n.push({utf16From:o,utf16To:a,wordLike:r.isWordLike===true});}return n}}}var Yo=/^[\p{L}\p{N}']$/u,$o=/^\s$/u;function zn(e){return Yo.test(e)}function Dn(e){return $o.test(e)}function St(e,t,n,r){let o=e[t],a=e[n-1];return {utf16From:o.utf16From,utf16To:a.utf16To,wordLike:r}}function Kn(e){let t=ya$1(e);if(t.length===0)return [];let n=[],r=0;for(;r<t.length;){let o=t[r];if(Dn(o.text)){let a=r+1;for(;a<t.length&&Dn(t[a].text);)a+=1;n.push(St(t,r,a,false)),r=a;continue}if(zn(o.text)){let a=r+1;for(;a<t.length&&zn(t[a].text);)a+=1;n.push(St(t,r,a,true)),r=a;continue}n.push(St(t,r,r+1,false)),r+=1;}return n}function Wn(){return {segment:Kn}}function Vn(e={}){let t=e.isIntlAvailable??Gn,n=e.createIntlBoundary??Un,r=e.createFallbackBoundary??Wn;if(!t())return r();try{return n()}catch{return r()}}var Hn;function jn(){return Hn??=Vn(),Hn}function qo(e,t=jn()){return t.segment(e)}function Zo(e,t){return t.map(n=>({graphemeFrom:Ca$1(e,n.utf16From),graphemeTo:Ca$1(e,n.utf16To),wordLike:n.wordLike}))}var Xn={resourceEpoch:"resource-scoped",configEpoch:"coarse-gate",extensionFingerprint:"coarse-gate",shapingHash:"coarse-gate",producerVersion:"coarse-gate"},Ft=Object.keys(Xn),Yn=Ft.filter(e=>Xn[e]==="coarse-gate"),De=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},ce=(e,t)=>{if(e.trim().length===0)throw new TypeError(`${t} must not be blank`)},Jo={resourceEpoch:De,configEpoch:De,extensionFingerprint:ce,shapingHash:ce,producerVersion:De},Qo=(e,t)=>{Jo[t](e[t],t);},le=e=>{for(let t of Ft)Qo(e,t);return Object.freeze({resourceEpoch:e.resourceEpoch,configEpoch:e.configEpoch,extensionFingerprint:e.extensionFingerprint,shapingHash:e.shapingHash,producerVersion:e.producerVersion})},ea=(e,t)=>{let n=le(e),r=le(t),o=Ft.filter(a=>n[a]!==r[a]);return o.length===0?Object.freeze({status:"current"}):Object.freeze({status:"restart",changed:Object.freeze(o)})},bt=e=>{let t=e.map(({key:n,fingerprint:r})=>(ce(n,"resource dependency key"),ce(r,"resource dependency fingerprint"),Object.freeze({key:n,fingerprint:r}))).sort((n,r)=>n.key<r.key?-1:n.key>r.key?1:0);for(let n=1;n<t.length;n+=1)if(t[n-1].key===t[n].key)throw new TypeError(`Duplicate resource dependency: ${t[n].key}`);return Object.freeze(t)},ta=e=>(De(e.revision,"revision"),ce(e.dependencyFingerprint,"dependencyFingerprint"),ce(e.inputFingerprint,"inputFingerprint"),Object.freeze({revision:e.revision,dependencyFingerprint:e.dependencyFingerprint,inputFingerprint:e.inputFingerprint,resourceDependencies:bt(e.resourceDependencies),...le(e)})),na=(e,t)=>{let n=bt(e),r=bt(t),o=Math.max(n.length,r.length);for(let a=0;a<o;a+=1){let i=n[a],s=r[a];if(i?.key!==s?.key||i?.fingerprint!==s?.fingerprint)return {hit:false,reason:"resource-changed",resourceKey:i?.key??s.key}}return null};function ra(e,t){if(e.dependencyFingerprint!==t.dependencyFingerprint)return {hit:false,reason:"dependency-changed"};if(e.inputFingerprint!==t.inputFingerprint)return {hit:false,reason:"input-changed"};let n=na(e.resourceDependencies,t.resourceDependencies);if(n)return n;for(let r of Yn)if(e[r]!==t[r])return {hit:false,reason:"epoch-changed",epoch:r};return null}var Rt=class{entries=new Map;get(t,n){let r=this.entries.get(t);if(!r)return {hit:false,reason:"absent"};let o=ra(r.provenance,n);return o||{hit:true,value:r.value,provenance:r.provenance}}set(t,n,r){this.entries.set(t,{value:n,provenance:ta(r)});}evictEpoch(t){let n=le(t),r=0;for(let[o,a]of this.entries){let i=a.provenance;Yn.some(s=>i[s]!==n[s])&&(this.entries.delete(o),r+=1);}return r}evictResources(t,n){let r=le(t),o=this.evictEpoch(r);for(let[a,i]of this.entries)i.provenance.resourceDependencies.some(c=>n.get(c.key)!==c.fingerprint)&&(this.entries.delete(a),o+=1);return o}get size(){return this.entries.size}};function $n(e){return e.projected===true?null:e.range}function aa(e,t,n,r=false){let{page:o,story:a,host:i,noteScopeId:s,noteAreaKind:c}=e,l=a==="header"||a==="footer"?u=>Ia$1(u,e.origin,{x:o.box.x,y:o.box.y}):void 0;Ra$1(i,(u,y)=>{let{textboxDepth:f,textboxOwner:p,textboxPath:g,storyOrigin:h}=y,d=f===0?a:"textbox";if(r&&u.marker&&!u.lines.some(S=>S.spans.length>0)){let S=u.lines[0];if(!S||!u.marker)return;let x={range:{paragraphId:u.paragraphId,start:S.range.start,end:S.range.start},text:"",props:[],style:u.marker.style,box:{...S.box,width:0}};n({page:o,story:d,rootStory:a,root:e,storyOrigin:h,absoluteBox:Object.freeze({x:h.x+x.box.x,y:h.y+x.box.y,width:0,height:x.box.height}),noteScopeId:s,noteAreaKind:c,textboxDepth:f,textboxOwner:p,textboxPath:g,paragraph:u,paragraphId:u.paragraphId,line:S,span:x,sourceRange:null});return}for(let S of u.lines){let x=[...Ya$1(S)].sort((R,L)=>(t.get(R.paragraphId)??Number.MAX_SAFE_INTEGER)-(t.get(L.paragraphId)??Number.MAX_SAFE_INTEGER));for(let R of x)for(let L of R.spans)n({page:o,story:d,rootStory:a,root:e,storyOrigin:h,absoluteBox:Object.freeze({x:h.x+L.box.x,y:h.y+L.box.y,width:L.box.width,height:L.box.height}),noteScopeId:s,noteAreaKind:c,textboxDepth:f,textboxOwner:p,textboxPath:g,paragraph:u,paragraphId:R.paragraphId,line:S,span:L,sourceRange:$n(L)});}},e.origin,l);}function ia(e,t,n={}){let r=new Map(fb(e).map((o,a)=>[o,a]));Oa$1(e,o=>aa(o,r,t,n.spanlessMarkers===true));}var ca=1,qn=4,te=Object.freeze({top:0,right:0,bottom:0,left:0}),Zn=new WeakMap;function la(e,t){let n=ua(e);return n===te?t:yf(t,n)}function ua(e){let t=e.vectorShape;if(!t)return te;let{cx:n,cy:r}=t.extentEmu;if(!(n>=0)||!(r>=0)||n===0&&r===0)return te;let o=Zn.get(t);if(o||(o=da(t),Zn.set(t,o)),o===te)return te;let a=e.paintBounds,i=e.geometry.contentBounds;if(!(a.width>0||i.width<=0)||!(a.height>0||i.height<=0))return te;let s=n>0?i.width/n:i.height/r,c=r>0?i.height/r:i.width/n,l=(f,p,g)=>{if(g<-1e-3)return 0;let h=f*p-Math.max(0,g);return Number.isFinite(h)&&h>0?h:0},u=e.kind==="inlineDrawing"&&e.placeholderGraphicKind===null,y={left:l(o.left,s,i.x-a.x),top:u?0:l(o.top,c,i.y-a.y),right:l(o.right,s,a.x+a.width-(i.x+i.width)),bottom:l(o.bottom,c,a.y+a.height-(i.y+i.height))};return y.left||y.top||y.right||y.bottom?Object.freeze(y):te}function da(e){let{cx:t,cy:n}=e.extentEmu,r=0,o=0,a=t,i=n,s=(y,f)=>{r=Math.min(r,y),a=Math.max(a,y),o=Math.min(o,f),i=Math.max(i,f);},c=e.overflowVisible===true,l=c?1/0:ca,u=y=>y.x>=-l&&y.x<=t+l&&y.y>=-l&&y.y<=n+l;for(let y of e.components){if(c)for(let d of y.subpathsEmu)for(let S of d)s(S.x,S.y);let f=y.clipEmu?void 0:y.shadow;if(f){let d=1/0,S=1/0,x=-1/0,R=-1/0;for(let T of y.subpathsEmu)for(let v of T){let O=c?v.x:Math.max(0,Math.min(t,v.x)),_=c?v.y:Math.max(0,Math.min(n,v.y));d=Math.min(d,O),S=Math.min(S,_),x=Math.max(x,O),R=Math.max(R,_);}let L=xf(f.blurEmu)*.75+(y.strokeHex!==null?Math.max(1,xf(y.strokeWidthEmu))/2:0),E=xf(f.dxEmu),A=xf(f.dyEmu);d<=x&&(s(d+E-L,S+A-L),s(x+E+L,R+A+L));}if(y.strokeHex===null||y.strokeInset===true)continue;let p=Math.max(1,xf(y.strokeWidthEmu))/2,g=l+Math.max(0,xf(y.strokeOutsetEmu??0)),h=d=>d.x>=-g&&d.x<=t+g&&d.y>=-g&&d.y<=n+g;y.subpathsEmu.forEach((d,S)=>{let x=y.subpathsClosed?.[S]!==false,R=pa(d,x),L=x&&R.length>2?R.length:R.length-1,E=[];for(let T=0;T<L;T+=1){let v=R[T],O=R[(T+1)%R.length],_=Math.hypot(O.x-v.x,O.y-v.y),b={x:-(O.y-v.y)/_,y:(O.x-v.x)/_};if(E.push(b),!!fa(v,O,-g,t+g,-g,n+g))for(let m=0;m<2;m+=1){let F=J[m],C=v.x+(O.x-v.x)*F,B=v.y+(O.y-v.y)*F;s(C+b.x*p,B+b.y*p),s(C-b.x*p,B-b.y*p);}}if(!x&&E.length&&(y.strokeCap==="round"||y.strokeCap==="square")){for(let[T,v,O]of [[R[0],E[0],-1],[R[R.length-1],E[E.length-1],1]])if(h(T))if(y.strokeCap==="round")s(T.x-p,T.y-p),s(T.x+p,T.y+p);else {let _=T.x+O*v.y*p,b=T.y-O*v.x*p;s(_+v.x*p,b+v.y*p),s(_-v.x*p,b-v.y*p);}}let A=x&&R.length>2?E.length:E.length-1;for(let T=0;T<A;T+=1){let v=R[(T+1)%R.length];if(!h(v))continue;if(y.strokeJoin==="round"){s(v.x-p,v.y-p),s(v.x+p,v.y+p);continue}if(y.strokeJoin==="bevel")continue;let O=E[T],_=E[(T+1)%E.length],b=1+O.x*_.x+O.y*_.y;if(b<2/(qn*qn))continue;let m=O.y*-_.x- -O.x*_.y;if(m===0)continue;let F=m>0?-1:1;s(v.x+F*(O.x+_.x)*p/b,v.y+F*(O.y+_.y)*p/b);}});for(let d of y.arrowheadsEmu??[])if(!(!d[0]||!u(d[0])))for(let S of d)s(S.x,S.y);}return r>=0&&o>=0&&a<=t&&i<=n?te:Object.freeze({left:-r,top:-o,right:a-t,bottom:i-n})}function pa(e,t){let n=[];for(let a of e){let i=n[n.length-1];(!i||i.x!==a.x||i.y!==a.y)&&n.push(a);}let r=n[0],o=n[n.length-1];return t&&n.length>1&&r.x===o.x&&r.y===o.y&&n.pop(),n}var J=new Float64Array(2);function fa(e,t,n,r,o,a){let i=t.x-e.x,s=t.y-e.y;return J[0]=0,J[1]=1,He(-i,e.x-n)&&He(i,r-e.x)&&He(-s,e.y-o)&&He(s,a-e.y)}function He(e,t){if(e===0)return t>=0;let n=t/e;return e<0?J[0]=Math.max(J[0],n):J[1]=Math.min(J[1],n),J[0]<=J[1]}var ma="abcdefghijklmnopqrstuvwxyz";function z(e){let t=Math.round(e.fontSizePt*2);return Math.max(1,t)}function j(e,t,n,r,o){let a=r.shaping?.context;return e.shape({text:o,fontSizeHalfPoints:z(r),bidiLevel:r.shaping?.direction==="rtl"?1:0,environment:ya(t,n,r),...a?{context:a}:{}})}var Jn=new WeakMap;function ya(e,t,n){if(!Object.isFrozen(e)||!Object.isFrozen(e.features)||!Object.isFrozen(e.variationAxes)||!Object.isFrozen(e.shapingLibrary))return Qn(e,t,n);let r=n.shaping?.direction??"ltr",o=n.shaping?.script,a=`${r}|${o??""}|${w$1(n)?1:0}|${e.documentLigatures?O(n):""}|${n.smallCaps?1:0}`,i=Jn.get(e);i||Jn.set(e,i=new WeakMap);let s=i.get(t);s||i.set(t,s=new Map);let c=s.get(a);return c||s.set(a,c=Qn(e,t,n)),c}function Qn(e,t,n){return r({...e,font:t,direction:n.shaping?.direction??"ltr",script:n.shaping?.script==="Zyyy"?e.script:n.shaping?.script??e.script,features:{...e.features,kern:w$1(n)?1:0,...e.documentLigatures?N(n):{},...n.smallCaps?{smcp:1}:{}},fallbackOrder:[]})}function Ge(e,t,n,r,o){let a=o.get(n);if(a!==void 0)return a;let i=true;try{for(let s of ma){let c=j(e,t,n,{...r,smallCaps:!0},s),l=j(e,t,n,{...r,smallCaps:!1},s);if(!(c.glyphs.length!==l.glyphs.length||c.glyphs.some((y,f)=>y.id!==l.glyphs[f]?.id))){i=!1;break}}}catch{i=false;}return o.set(n,i),i}var ha=new Map([["garamond",{family:"Garamond",em:er(1765,539,0)}],["segoe ui",{family:"Segoe UI",em:er(2210,514,0)}]]);function er(e,t,n){return {heightEm:(e+t+n)/2048,baselineEm:(e+n)/2048}}function Ct(e){return e?ha.get(e.trim().toLowerCase()):void 0}function Ue(e){let t=Ct(e.fontFamily);if(!t)return;let n=z(e)/2*ra$1(e);return {height:t.em.heightEm*n,baseline:t.em.baselineEm*n}}var ga=new Map([["roman","serif"],["swiss","sans"],["modern","mono"]]);function ps(e,t){return t==="fixed"?"mono":e?ga.get(e):void 0}var Sa=new Map([["calibri","sans"],["arial","sans"],["helvetica","sans"],["verdana","sans"],["tahoma","sans"],["segoe ui","sans"],["aptos","sans"],["century gothic","sans"],["carlito","sans"],["cambria","serif"],["times new roman","serif"],["georgia","serif"],["garamond","serif"],["book antiqua","serif"],["palatino linotype","serif"],["caladea","serif"],["courier new","mono"],["consolas","mono"]]);function tr(e){let t=e.trim().toLowerCase(),n=Sa.get(t);if(n)return n;let r=t.split(/[\s_-]+/);if(r.includes("mono")||r.includes("monospace")||r.includes("courier"))return "mono";if(r.includes("sans"))return "sans";if(r.includes("serif")||r.includes("roman"))return "serif"}var fs={serif:"Times New Roman",sans:"Arial",mono:"Courier New"};var Et="Calibri, Carlito, Helvetica, Arial, sans-serif",xa='"Times New Roman", "Liberation Serif", Tinos, serif',ba='"Courier New", "Liberation Mono", Cousine, monospace',Ra='Batang, AppleMyungjo, "Noto Serif CJK KR", serif';function Fa(e,t=Et,n){if(!e)return t;if(n?.(e))return Ra;let r=tr(e);return r==="serif"?xa:r==="mono"?ba:t}var Rs=new Map([["calibri","Carlito"]]),Ca=65536,Ea=256;function nr(e,t){return e===void 0?Math.max(1,Math.floor(t)):Number.isFinite(e)&&e>0?Math.max(1,Math.floor(e)):1}function rr(e){let t=new Map,n=null,r=null,o=0,a=s=>{s.older?s.older.newer=s.newer:n=s.newer,s.newer?s.newer.older=s.older:r=s.older,s.older=null,s.newer=null;},i=s=>{s.older=r,s.newer=null,r?r.newer=s:n=s,r=s;};return {get(s){let c=t.get(s);if(c!==void 0)return c!==r&&(a(c),i(c)),c.value},set(s,c){let l=t.get(s);if(l){l.value=c,l!==r&&(a(l),i(l));return}let u={key:s,value:c,older:null,newer:null};for(t.set(s,u),i(u);t.size>e&&n;){let y=n;a(y),t.delete(y.key),o+=1;}},get size(){return t.size},get evictions(){return o}}}var or=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function ar(e=null){return e!=null&&typeof e.measureText=="function"}function ir(e={}){let t=e.scale??1;if(!(t>0)||!Number.isFinite(t))return null;let n=e.fallbackFamily??Et,r=e.context??null;if(!ar(r))return null;let o=r,a=rr(nr(e.maxWidthEntries,Ca)),i=rr(nr(e.maxMetricsEntries,Ea)),s=e.fontAlias,c=new Map,l=f=>{let p=c.get(f);if(p!==void 0)return p;let g="The quick brown fox 0123",h=false;for(let d of ["monospace","serif"]){o.font=`32px ${d}`;let S=o.measureText(g).width;if(o.font=`32px "${f}", ${d}`,o.measureText(g).width!==S){h=true;break}}return c.set(f,h),h},u=f=>{let p=f.fontFamily&&or.test(f.fontFamily)?f.fontFamily:null,g=p?s?.(p):void 0,h=g&&or.test(g)?g:null,d=Fa(p,n,e.serifHangulFace),S=p?h?`"${h}", "${p}", ${d}`:`"${p}", ${d}`:n,x=f.bold?"bold":"normal",R=f.italic?"italic":"normal",L=f.smallCaps?"small-caps":"normal",E=f.fontSizePt*ra$1(f)*t;return `${R} ${L} ${x} ${E}px ${S}`},y$1=(f,p,g)=>f/t*(g.horizontalScalePercent/100)+p.length*g.characterSpacingPt;return {measure(f,p){if(f.length===0)return 0;let g=u(p),h=y(p,f),d=`${g}\0${h}\0${f}`,S=a.get(d);if(S!==void 0)return y$1(S,f,p);o.font=g,"fontKerning"in o&&(o.fontKerning=h?"normal":"none");let x=o.measureText(f).width;return a.set(d,x),y$1(x,f,p)},inkBounds(f,p){if(!f||f.length>2||p.shaping?.direction==="rtl"||ya$1(f).length!==1)return;o.font=u(p),"fontKerning"in o&&(o.fontKerning=w$1(p)?"normal":"none");let g=o.textAlign,h=o.direction,d;try{g!==void 0&&(o.textAlign="left"),h!==void 0&&(o.direction="ltr"),d=o.measureText(f);}finally{g!==void 0&&(o.textAlign=g),h!==void 0&&(o.direction=h);}let S=d.actualBoundingBoxLeft,x=d.actualBoundingBoxRight;if(S===void 0||x===void 0||!Number.isFinite(S)||!Number.isFinite(x))return;let R=p.horizontalScalePercent/(100*t);return {left:-S*R,right:x*R}},textOutline(f,p){if(!f||p.shaping?.direction==="rtl")return;o.font=u(p),"fontKerning"in o&&(o.fontKerning=w$1(p)?"normal":"none");let g=o.textAlign,h=o.textBaseline,d;try{g!==void 0&&(o.textAlign="left"),h!==void 0&&(o.textBaseline="alphabetic"),d=o.measureText(f);}finally{g!==void 0&&(o.textAlign=g),h!==void 0&&(o.textBaseline=h);}let S=[-(d.actualBoundingBoxLeft??NaN),-(d.actualBoundingBoxAscent??NaN),d.actualBoundingBoxRight??NaN,d.actualBoundingBoxDescent??NaN].map(A=>A/t);if(S.some(A=>!Number.isFinite(A)))return;let[x,R,L,E]=S;if(!(!(L>x)||!(E>R)))return {path:null,ink:{left:x,top:R,right:L,bottom:E}}},lineMetrics(f){let p=f.fontSizePt*ra$1(f),g=u(f),h=i.get(g);if(h)return h;let d=Ct(f.fontFamily),S=d&&!l(d.family)&&Ue(f);if(S)return i.set(g,S),S;let x=p*1.15,R=p*.8;o.font=g,"fontKerning"in o&&(o.fontKerning=w$1(f)?"normal":"none");let L=o.measureText("Hxg"),E=L.fontBoundingBoxAscent,A=L.fontBoundingBoxDescent;if(typeof E=="number"&&Number.isFinite(E)&&E>0&&(R=E/t,typeof A=="number"&&Number.isFinite(A)&&A>=0)){let v=(E+A)/t;v>0&&(x=Math.max(v,x));}x>0||(x=p*1.15);let T={height:x,baseline:R};return i.set(g,T),T}}}function va(e=1,t={}){let n=ir({...t,scale:t.scale??e});return n?{measurer:n,producer:t.fontAlias?"canvas-measurer+embedded":"canvas-measurer"}:{measurer:ta$1(),producer:"fixed-measurer"}}function La(e){let t;return n=>{t===void 0&&(t=jd(e.pages)?.hosts??null);let r=t?.get(n);return r?hd(r.pageNumber,r.format):null}}function sr(e,t){let n=uf(e,t.displayMode??mb),r=Od({numberingIndex:t.numberingIndex,styleCascade:t.styleCascade},n).listItems,o=t.package?{footnotesPart:pj(t.package,"footnote"),endnotesPart:pj(t.package,"endnote")}:void 0,a=ie$1(n,r,o,t.package?fe$1(t.package,e,n):void 0,t.displayMode??mb);return {blocks:n,notes:o,context:a}}function cr(e,t,n,r,o){for(let a of t){if(r.length>=yn)return;if(n.tokenForParagraph(a.id)!==""&&Bn$1(e,a.id)===null)for(let i of An$1(a)){if(r.length>=yn)return;if(!i.rewritable)continue;let s=Wc(i.instruction);if(s===null)continue;let c=n.liveValueOf(i.fieldNodeId,s);if(c===null&&o&&n.pageRefProjectionOf){let l=n.pageRefProjectionOf(i.fieldNodeId,s);if(l){let u=o(l.targetParagraphId);u!==null&&u.length>0&&id(l.calibration,l.cached,u,Number.NaN)&&(c=u);}}c===null||c===i.cachedText||c.length>zn$1||c.includes("\r")||r.push({paragraphId:a.id,fieldNodeId:i.fieldNodeId,text:c});}}}function Ta(e,t){let{blocks:n,context:r}=sr(e,t);if(r===null)return null;let o=[];return cr(e,Zc(wc(n)),r,o,t.pageRefPageNumberOf),o.length===0?null:{op:"refreshFieldResults",updates:o}}function Is(e,t){let{notes:n,context:r}=sr(e,t);if(r===null||n===void 0)return [];let o=[],a=[{noteKind:"footnote",notesPart:n.footnotesPart},{noteKind:"endnote",notesPart:n.endnotesPart}];for(let{noteKind:i,notesPart:s}of a){if(!s)continue;let c=[];for(let l of ge$1(s,t.displayMode??mb)){if(c.length>=yn)break;cr(s,Zc(wc(l)),r,c);}c.length>0&&o.push({noteKind:i,op:{op:"refreshFieldResults",updates:c}});}return o}function Ba(e){return e.box}function lr(e,t){if(e.kind==="paragraph"){t.add(e.paragraphId);return}for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks)lr(o,t);}function Oa(e){let t=new Map,n=(o,a,i)=>{if(!(o.kind==="textValue"||i>ec$1*4)){for(let s of o.children)if(s.kind!=="textValue"){if(s.kind==="paragraph"){for(let c of r)t.get(c)?.push(s.id);n(s,s.id,i+1);continue}if(s.kind==="contentControl"){t.set(s.id,[]),r.push(s.id);let c=oc(s);c&&n(c,a,i+1),r.pop();let l=t.get(s.id);l&&l.length===0&&a!==null&&l.push(a);continue}n(s,a,i+1);}}},r=[];return n(e,null,0),t}function Aa(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return {x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function wa(e,t){let n=sc(e.root);if(n.length===0)return Ia;let r=new Map;t.pages.forEach((i,s)=>{(l=>{for(let u of l){let y=new Set;lr(u,y);for(let f of y){let p=r.get(f)??[];p.push({pageIndex:s,box:Ba(u)}),r.set(f,p);}}})(i.fragments);});let o=Oa(e.root),a=[];for(let i of n){let s=qc(i.node),c=[...i.ancestors.map(f=>qc(f).lock),s.lock],l=o.get(i.node.id)??[],u=new Map;for(let f of l)for(let p of r.get(f)??[]){let g=u.get(p.pageIndex);u.set(p.pageIndex,g?Aa(g,p.box):p.box);}let y=[...u.entries()].sort((f,p)=>f[0]-p[0]).map(([f,p])=>({pageIndex:f,...p}));a.push({controlId:i.node.id,type:s.type,level:rc(i.node),depth:i.depth,lock:s.lock,effectiveLock:vc(c),showingPlaceholder:s.showingPlaceholder,temporary:s.temporary,...s.tag===void 0?{}:{tag:s.tag},...s.alias===void 0?{}:{alias:s.alias},...s.id===void 0?{}:{id:s.id},...s.dataBinding===void 0?{}:{dataBinding:s.dataBinding},paragraphIds:l,fragments:y});}return a}var Ia=Object.freeze([]);var Ma=4096;function _a(e,t=0){if(!(e instanceof Uint8Array)||!Number.isSafeInteger(t)||t<0||e.byteLength<12)return;let n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=(h,d)=>Number.isSafeInteger(h)&&Number.isSafeInteger(d)&&h>=0&&d>=0&&h<=e.length-d,o=h=>n.getUint16(h,false),a=h=>n.getUint32(h,false),i=0,s=false;if(a(0)===1953784678){s=true;let h=a(4),d=a(8);if(![65536,131072].includes(h)||!d||t>=d||!r(12,d*4))return;i=a(12+t*4);}else if(t!==0)return;if(!r(i,12)||![65536,1330926671,1953658213].includes(a(i)))return;let c=o(i+4);if(!c||c>Ma||!r(i+12,c*16))return;let l=new Map;for(let h=0;h<c;h++){let d=i+12+h*16,S=a(d),x=a(d+8),R=a(d+12);if(l.has(S)||!r(x,R))return;l.set(S,{offset:x,length:R});}let u=l.get(1751474532),y=l.get(1330851634);if(!u||u.length<20||!y||y.length<4)return;let f=o(u.offset+18),p=o(y.offset),g=n.getInt16(y.offset+2,false);if(!(f<16||f>16384||p>5||g<=0))return Object.freeze({faceIndex:t,collection:s,unitsPerEm:f,os2Version:p,xAvgCharWidth:g,averageAdvanceEm:g/f})}function ur(e,t=_a){if(typeof e!="function"||typeof t!="function")return;let n=new WeakMap;return r=>{if(!fc(r))return;let o;try{o=e(r);}catch{return}if(!o||typeof o!="object"||o.substitution!==null||o.family.trim().toLowerCase()!==r.fontFamily?.trim().toLowerCase()||typeof o.hash!="string"||!/^sha256:[0-9a-f]{64}$/u.test(o.hash)||!Number.isSafeInteger(o.faceIndex)||o.faceIndex<0)return;let a=n.get(o);if(a===void 0&&(a=t(o.bytes,o.faceIndex)??null,n.set(o,a)),!a)return;let i=r.fontSizePt*a.averageAdvanceEm/2;return Number.isFinite(i)&&i>=0&&i<=r.fontSizePt?i:void 0}}var K=(e,t)=>e[t]<<8|e[t+1],Q=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0;function Pa(e,t){let n=(i,s)=>i>=0&&i+s<=e.length;if(!n(0,12))return null;let r=Q(e,0)===1953784678;if(r&&!n(12+t*4,4))return null;let o=r?Q(e,12+t*4):0;if(!n(o,12))return null;let a=K(e,o+4);for(let i=0;i<a;i+=1){let s=o+12+i*16;if(!n(s,16))return null;if(Q(e,s)!==1668112752)continue;let c=Q(e,s+8);if(!n(c,4))return null;let l=null,u=null,y=K(e,c+2);for(let f=0;f<y;f+=1){let p=c+4+f*8;if(!n(p,8))return null;let g=K(e,p),h=K(e,p+2),d=c+Q(e,p+4);if(!n(d,2)||!(g===0||g===3&&(h===1||h===10)))continue;let x=K(e,d);x===12&&u===null&&(u=d),x===4&&l===null&&(l=d);}return u!==null?{format:12,offset:u}:l!==null?{format:4,offset:l}:null}return null}function ka(e,t,n){let r=(u,y)=>u>=0&&u+y<=e.length,o=t.offset;if(t.format===12){if(!r(o,16))return false;let u=Q(e,o+12),y=0,f=Math.min(u,Math.floor((e.length-o-16)/12))-1;for(;y<=f;){let p=y+f>>>1,g=o+16+p*12,h=Q(e,g),d=Q(e,g+4);if(n<h)f=p-1;else if(n>d)y=p+1;else return Q(e,g+8)+(n-h)!==0}return false}if(n>65535||!r(o,14))return false;let a=K(e,o+6)>>>1,i=o+14,s=i+a*2+2,c=s+a*2,l=c+a*2;if(!r(l,a*2))return false;for(let u=0;u<a;u+=1){if(n>K(e,i+u*2))continue;let y=K(e,s+u*2);if(n<y)return false;let f=K(e,c+u*2),p=l+u*2,g=K(e,p);if(g===0)return (n+f&65535)!==0;let h=p+g+(n-y)*2;if(!r(h,2))return false;let d=K(e,h);return d!==0&&(d+f&65535)!==0}return false}var dr=new WeakMap;function pr(e,t){let n=i(e),r=dr.get(e);return r===void 0&&(r=Pa(n,e.faceIndex),dr.set(e,r)),r?ka(n,r,t):void 0}var fr=new WeakMap;function Na(e){let t=fr.get(e);if(t!==void 0)return t;let n=i(e),r=new DataView(n.buffer,n.byteOffset,n.byteLength),o=false,a=r.getUint32(0)===1953784678?r.getUint32(12+e.faceIndex*4):0,i$1=r.getUint16(a+4);for(let s=0;s<i$1;s++){let c=a+12+s*16;if(r.getUint32(c)!==1330851634)continue;let l=r.getUint32(c+8),u=r.getUint32(c+12);u>=86&&l<=n.byteLength-u&&r.getUint16(l)>=1&&(o=(r.getUint32(l+78)&1966080)!==0);break}return fr.set(e,o),o}var mr=1.3;function yr(e,t,n,r,o,a=false){let i=n.height-r;if(!(Math.abs(i-t)<=o)&&!a||!Na(e))return n;let c=a?i*mr:Math.max(n.height,t*mr),l=n.baseline-r;return {height:c,baseline:l+(c-i)/2}}var za=.89111328125,Da=443/2048,Ha=87/2048,Ga=1/2048,Ua=new Set(["Arab","Hebr","Syrc","Thaa","Nkoo"]);function hr(e){return e.latinLane===void 0&&!Ua.has(e.shaping?.script??"")}function gr(e,t,n,r,o,a=true){if(!a||r!==0||!(o>0)||e.trim().toLowerCase()!=="times new roman")return r;let i=(s,c)=>Math.abs(s/o-c)<=Ga;return i(t,za)&&i(n,Da)?Ha*o:r}var Ka=.5;function Wa(e,t){if(t.fontFamily===null)return false;let n=e.substitution;return n!==null&&(n.lineMetrics!==void 0||!me$1(n.requested.family,n.resolved.family))?false:e.family===t.fontFamily||me$1(e.family,t.fontFamily)}function Sr(e,t,n,r,o){let a=new WeakMap;return (i,s)=>{let c=ra$1(s),l=a.get(i);l||(l=new Map,a.set(i,l));let u=z(s),y=hr(s),f=Wa(i,s),p=(y?u:-u)+(f?Ka:0),g=l.get(p);if(g)return c===1?g:{height:g.height*c,baseline:g.baseline*c};let h,d=true,S=i.substitution?.lineMetrics;if(S){let x=u/2;h={height:S.heightEm*x,baseline:S.baselineEm*x};}else try{let x=j(e,t,i,s,""),R=x.metrics.ascent/t.fixedPointScale,L=x.metrics.descent/t.fixedPointScale,E=u/2,A=R+L,T=E*r,v=A>T?T/A:1,O=A*v,_=x.metrics.lineGap/t.fixedPointScale,b=Math.min(Math.max(0,gr(i.family,R,L,_,E,y)),O*o),m=O+b;m>0?h=yr(i,E,{height:m,baseline:R*v+b},b,2/t.fixedPointScale,f):(h=n.lineMetrics(s),d=!1);}catch{h=n.lineMetrics(s),d=false;}return d?(l.set(p,h),c===1?h:{height:h.height*c,baseline:h.baseline*c}):h}}var vt=2048,Va=32,ja=new Map([["symbol",{ascent:2059,descent:450,advances:[512,682,1460,1024,1124,1706,1593,899,682,682,1024,1124,512,1124,512,569,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,569,569,1124,1124,1124,909,1124,1479,1366,1479,1253,1251,1563,1235,1479,682,1292,1479,1405,1821,1479,1479,1573,1518,1139,1212,1251,1413,899,1573,1321,1628,1251,682,1767,682,1348,1024,1024,1292,1124,1124,1012,899,1067,842,1235,674,1235,1124,1124,1180,1067,1124,1124,1067,1124,1235,899,1180,1460,1405,1010,1405,1012,983,410,983,1124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1270,506,1124,342,1460,1024,1542,1542,1542,1542,2134,2021,1235,2021,1235,819,1124,842,1124,1124,1460,1012,942,1124,1124,1124,1124,2048,1235,2048,1348,1686,1405,1628,2021,1573,1573,1686,1573,1573,1460,1460,1460,1460,1460,1460,1460,1573,1460,1618,1618,1823,1686,1124,512,1460,1235,1235,2134,2021,1235,2021,1235,1012,674,1618,1618,1610,1460,786,786,786,786,786,786,1012,1012,1012,1012,0,674,561,1405,1405,1405,786,786,786,786,786,786,1012,1012,1012,0]}],["wingdings",{ascent:1841,descent:432,advances:[2048,2110,2344,2665,2752,1830,2492,938,2220,1826,2319,2319,2399,2399,2951,2956,2245,2751,1431,1431,1826,1135,1233,2196,1941,2208,1924,1825,1826,1826,1825,1863,1863,1203,1624,1381,1381,1929,1929,1124,1124,1826,1727,1727,1727,2275,1352,1739,2230,1819,1803,1332,1665,1529,1529,1480,1420,1627,1813,1826,1834,1825,2368,2159,1974,2233,1927,1911,1937,2099,1902,2245,2181,1597,2150,2603,1529,1951,1529,1825,1825,1825,1825,937,1529,2020,1825,1183,2171,2171,1825,1826,1826,1086,1086,0,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,2048,2048,2048,2048,2048,2048,2048,2048,641,937,641,1825,1825,1825,1825,1825,1951,937,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2146,2146,2146,2146,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2566,2566,1627,1627,1825,1825,1825,1825,1825,1825,2006,2006,1825,1825,1589,1589,1589,1589,2186,2186,1825,1825,1787,1787,1787,1787,1825,1825,1660,1660,2171,1660,1601,1601,1601,1601,987,789,1301,1609,1826,1826,2119]}],["wingdings 2",{ascent:1727,descent:432,advances:[2048,2110,2090,2073,2086,2344,2045,2220,989,1431,1431,1826,1431,1431,1826,1431,1431,1826,1431,1431,2320,2246,1826,1826,1826,2320,2170,2170,1381,1381,1938,1938,1938,1938,1928,1928,1928,1928,1047,1047,1047,1047,1178,1178,1178,1178,1826,1321,1568,1826,1826,1826,1826,1825,1825,1826,1826,2226,1727,1548,1579,984,1035,864,1018,2048,2048,2048,2048,2048,2048,2048,2048,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,0,1899,1899,1453,1453,1673,1332,1431,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2048,2048,542,740,1135,1825,1825,1825,1825,1825,1825,1825,542,740,1135,1825,1825,1825,1825,1825,1825,1825,1825,1825,624,764,903,1461,2020,2020,2020,2020,2020,542,641,740,1135,1529,1529,1085,1085,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1496,1825,0,0,0,0,0,0]}],["wingdings 3",{ascent:1900,descent:432,advances:[2048,1825,1825,1135,1135,1444,1444,1444,1444,1825,1825,1135,1135,1677,1677,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1825,1825,1455,1455,1455,1455,2010,2010,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2220,1825,1751,1114,1115,1660,1660,1930,1930,1930,1930,1924,1924,1924,1924,1930,1930,1931,1931,1825,1825,1232,1232,1444,1444,1444,1444,1825,1232,2005,2005,2005,2005,1801,1801,1801,1801,1801,1801,1801,1801,1085,1085,1825,0,1825,1825,1825,1825,1825,1627,1627,1825,1825,1825,1825,789,789,1825,1825,987,987,1825,1825,1184,1184,1825,1825,1579,1579,1825,1825,888,888,1825,1825,1381,1381,1825,1825,1875,1875,1825,1825,1825,1825,1825,1825,1825,789,592,493,394,1825,1825,1825,1825,1825,1085,1085,1381,1381,1628,1628,1184,1184,900,900,1825,1825,1019,1019,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1291,1291,1291,1291,1961,1961,1825,1825,1540,1540,1540,1540,2096,2096,1825,1825,1688,1688,1688,1688,2277,2277,1825,1825,1885,1885,1885,1885,543,543,1234,1234,766,766,1234,1234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],["webdings",{ascent:1638,descent:410,advances:[1024,2048,2048,2048,2048,2028,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1100,1100,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1144,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,0,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2500,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1377,1377,2048,1726,1058,2048,2048,2048,2048,877,1240,2048,2048,2048,2048,1357,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2645,2048,2048,2048,2048]}]]);function Xa(e){if(b$1(e))return ja.get(e.toLowerCase())}function xr(e,t,n,r){let o=z(r)/2*ra$1(r)*(r.horizontalScalePercent/100)/vt,a=[];for(let i=0;i<n.length;i++){let s=c$2(n.charCodeAt(i),t),c=s===null?0:e.advances[s-Va]??0;if(c===0)return;a.push(c*o+r.characterSpacingPt);}return a}function br(e){let t=new WeakMap,n=r=>{let o=t.get(r);return o===void 0&&(o=Xa(r.fontFamily)??null,t.set(r,o)),o};return {...e,measure(r,o){let a=n(o),i=a&&xr(a,o.fontFamily,r,o);if(!i)return e.measure(r,o);let s=0;for(let c of i)s+=c;return s},caretAdvances(r,o){let a=n(o),i=a&&xr(a,o.fontFamily,r,o);if(!i)return e.caretAdvances?.(r,o);let s=[0];for(let c of i)s.push(s[s.length-1]+c);return s},lineMetrics(r,o){let a=n(r);if(!a)return e.lineMetrics(r,o);let i=z(r)/2*ra$1(r);return {height:(a.ascent+a.descent)*i/vt,baseline:a.ascent*i/vt}}}}var Ya={M:2,L:2,Q:4,C:6,Z:0},Rr=e=>{let t=Math.round(e*1e3)/1e3;return String(Object.is(t,-0)?0:t)};function Lt(e,t,n){if(!(t>0)||!(n>0))return;let r=[],o=0,a=1/0,i=-1/0,s=1/0,c=-1/0;for(let l of e.glyphs){if(l.id===0)return;let u=l.outline.path,y=l.outline.unitsPerEm;if(!u)continue;if(!(y>0)||!u.startsWith("M")||/[^MLQCZ0-9eE+.,\s-]/u.test(u))return;let f=t*(l.drawScale??1)/y,p=(l.originX+l.offsetX)/n,g=(l.originY+l.offsetY)/n;for(let h of u.matchAll(/([MLQCZ])([^MLQCZ]*)/gu)){let d=h[1],S=h[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(S.length!==Ya[d]||S.some(R=>!Number.isFinite(R)))return;let x=d;for(let R=0;R<S.length;R+=2){let L=p+S[R]*f,E=-(g+S[R+1]*f);a=Math.min(a,L),i=Math.max(i,L),s=Math.min(s,E),c=Math.max(c,E),x+=`${R?" ":""}${Rr(L)} ${Rr(E)}`;}if(o+=x.length,o>2e6)return;r.push(x);}}if(!(!r.length||!(i>a)||!(c>s)))return Object.freeze({path:r.join(""),ink:Object.freeze({left:a,top:s,right:i,bottom:c})})}var Tt=new WeakMap;function $a(e){let t=Tt.get(e);if(t!==void 0)return t??void 0;let n=e.path;if(!n.startsWith("M")||n.length>1e6||/[^MLQCZ0-9eE+.,\s-]/u.test(n))return;let r=1/0,o=-1/0,a=n.matchAll(/([MLQCZ])([^MLQCZ]*)/gu);for(let s of a){let c=s[1]==="Z"?0:s[1]==="C"?6:s[1]==="Q"?4:2,l=s[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(l.length!==c||l.some(u=>!Number.isFinite(u))){Tt.set(e,null);return}for(let u=0;u<l.length;u+=2)r=Math.min(r,l[u]),o=Math.max(o,l[u]);}let i=Number.isFinite(r)&&Number.isFinite(o)?{left:r,right:o}:void 0;return Tt.set(e,i??null),i}function Fr(e,t,n,r){if(e.clusters.length!==1||e.glyphs.length===0)return;let o=1/0,a=-1/0;for(let s of e.glyphs){if(s.id===0)return;let c=$a(s.outline),l=s.outline.unitsPerEm;if(!c||!(l>0))return;let u=(s.originX+s.offsetX)/n;o=Math.min(o,u+c.left*t*(s.drawScale??1)/l),a=Math.max(a,u+c.right*t*(s.drawScale??1)/l);}let i={left:o*r,right:a*r};return Number.isFinite(i.left)&&Number.isFinite(i.right)?i:void 0}function qa(e,t,n){if(t<12)return null;if(e.getUint32(0)!==1953784678)return 0;let o=12+(Number.isSafeInteger(n)&&n>0?n:0)*4;if(o+4>t)return null;let a=e.getUint32(o);return a+12<=t?a:null}function Cr(e,t,n,r,o){let a=e.getUint16(n+4);if(a>4096||n+12+a*16>t)return null;for(let i=0;i<a;i+=1){let s=n+12+i*16;if(e.getUint32(s)!==r)continue;let c=e.getUint32(s+8),l=e.getUint32(s+12);return l<o||c+l>t?null:c}return null}function Er(e,t){let n=e.byteLength,r=new DataView(e.buffer,e.byteOffset,n),o=qa(r,n,t);if(o===null)return null;let a=Cr(r,n,o,1751474532,54);if(a===null)return null;let i=r.getUint16(a+18);if(i<=0)return null;let s=Cr(r,n,o,1330851634,30);if(s===null)return null;let c=r.getInt16(s+26)/i,l=r.getInt16(s+28)/i;return !(c>0)||c>1||!(Math.abs(l)<=1)?null:{offsetEm:l,thicknessEm:c}}var Ke=.02;function Bt(e,t){return e.bold===true&&t.request.weight<600}function vr(e){return e.advanceX>0&&e.outline.path.length>0}function Lr(e){let t=0;for(let n of e.glyphs)vr(n)&&t++;return t}function Tr(e,t,n){if(n<=0)return e;let r=new Array(e.length).fill(0);for(let a of t.glyphs){if(!vr(a))continue;let i=Math.min(Math.max(a.cluster+1,1),e.length-1);r[i]+=n;}let o=0;return e.map((a,i)=>(o+=r[i],a+o))}var Za=.5,Ja=4096,Qa=4,Br=4096;function Or(e){let t="environment"in e?e.environment:void 0,n="environment"in e?void 0:e,{shaper:r,resolveFont:o}=e,a=br(e.fallback),i=t??{shapingLibrary:n.shapingLibrary,unicodeDataVersion:n.unicodeDataVersion,script:n?.script??"Latn",fixedPointScale:n?.fixedPointScale??1e3,normalization:n?.normalization??"none",features:n?.features??{},roundingMode:n?.roundingMode??"halfToEven",language:n?.language??"en",variationAxes:{}},s=new WeakMap,c=new WeakMap,l=q$1(r),u=Sr(r,i,a,Qa,Za),y=new WeakMap,f=new WeakMap,p=new Array(Br),g=0,h=(b,m,F)=>{let C=p[g];C&&C.cache.delete(C.text),b.set(m,F),p[g]={cache:b,text:m},g=(g+1)%Br;},d=b=>{let m=y.get(b);if(m!==void 0)return m;let F=o(b);return y.set(b,F),F},S=ur(d),x=(b,m,F)=>{let C=F?c:s,B=C.get(b);B||(B=new Map,C.set(b,B));let I=B.get(m);return I||(I=new Map,B.set(m,I)),I},R=new WeakMap,L=b=>{if(!b.shaping?.wordSpacingPt)return b;let m=R.get(b);return m||(m={...b,shaping:{...b.shaping,wordSpacingPt:void 0}},R.set(b,m)),m},E=(b,m)=>m.shaping?.wordSpacingPt?cc(b)*m.shaping.wordSpacingPt:0,A=(b,m)=>a.measure(b,L(m))+E(b,m),T=(b,m)=>{let F=Math.max(0,a.measure(b,L(m))),C=a.caretAdvances?.(b,L(m))??ac(b,F);if(!C||C.length!==b.length+1)return ac(b,A(b,m));let B=Math.max(0,A(b,m)),I=0,P=0;return C.map((N,D)=>{if(D===0)return 0;b[D-1]===" "&&P++;let M=N+P*(m.shaping?.wordSpacingPt??0);return I=Math.max(I,Math.min(B,Number.isFinite(M)?M:I)),D===b.length?B:I})},v=new WeakMap,O$1=new WeakMap;return ec({hasResolvedFont(b){return d(b)!==null},faceCovers(b,m){let F=d(m);if(!F)return;let C=O$1.get(F);C||(C=new Map,O$1.set(F,C));let B=C.get(b);if(B!==void 0)return B;let I=true;for(let P of b){let N=pr(F,P.codePointAt(0));if(N===void 0)return;if(!N){I=false;break}}return C.size<Ja&&C.set(b,I),I},strikeoutMetrics(b){let m=d(b);if(!m)return;let F=v.get(m);if(F===void 0&&(F=Er(m.bytes,m.faceIndex),v.set(m,F)),!F)return;let C=z(b)/2*ra$1(b);return {offsetPt:F.offsetEm*C,thicknessPt:F.thicknessEm*C}},measure(b,m){if(b.length===0)return 0;let F=d(m);if(!F)return A(b,m);let C=x(F,z(m),m.smallCaps),B=m.shaping?.context,I=m.shaping?`1:${JSON.stringify(B?[m.shaping.script,m.shaping.direction,b,B.before,B.after]:[m.shaping.script,m.shaping.direction,b])}`:`0:${b}`,P=Bt(m,F),N=`${w$1(m)?1:0}:${P?1:0}:${O(m)}:${I}`,D=C.get(N);if(D===void 0){let M=0;try{if(m.smallCaps&&!Ge(r,i,F,m,f))return A(b,m);let G=j(r,i,F,m,b);if(G.glyphs.some(ee=>ee.id===0))return A(b,m);for(let ee of G.glyphs)M+=ee.advanceX;P&&(M+=Lr(G)*(z(m)/2)*.02*i.fixedPointScale);}catch{return A(b,m)}D=M/i.fixedPointScale,h(C,N,D);}return D*ra$1(m)*(m.horizontalScalePercent/100)+b.length*m.characterSpacingPt+E(b,m)},inkBounds(b,m){if(!b||b.length>2||m.shaping?.direction==="rtl"||ya$1(b).length!==1)return;let F=d(m);if(!F)return a.inkBounds?.(b,m);try{if(m.smallCaps&&!Ge(r,i,F,m,f))return a.inkBounds?.(b,m);let C=j(r,i,F,m,b);return Fr(C,z(m)/2,i.fixedPointScale,ra$1(m)*m.horizontalScalePercent/100)}catch{return}},textOutline(b,m){let F=d(m);if(!F)return a.textOutline?.(b,m);try{let C=j(r,i,F,m,b);return Lt(C,z(m)/2,i.fixedPointScale)??a.textOutline?.(b,m)}catch{return a.textOutline?.(b,m)}},caretAdvances(b,m){let F=d(m);if(!F)return T(b,m);try{if(m.smallCaps&&!Ge(r,i,F,m,f))return T(b,m);let C=j(r,i,F,m,b);if(C.glyphs.some(P=>P.id===0))return T(b,m);let B=bc(b,C,ra$1(m)*(m.horizontalScalePercent/100)/i.fixedPointScale,m.characterSpacingPt,m.shaping?.wordSpacingPt??0)??ac(b,C.glyphs.reduce((P,N)=>P+N.advanceX,0)*ra$1(m)*(m.horizontalScalePercent/100)/i.fixedPointScale+b.length*m.characterSpacingPt+E(b,m));if(!B||!Bt(m,F))return B;let I=z(m)/2*.02*ra$1(m)*(m.horizontalScalePercent/100);return Tr(B,C,I)}catch{return T(b,m)}},lineMetrics(b,m){let F=d(b);if(!F)return Ue(b)??a.lineMetrics(b,m);if(!m||/^[\t\n\r\f ]*$/.test(m))return u(F,b);if(l){let C=u(F,b),B=Math.max(0,C.baseline),I=Math.max(0,C.height-C.baseline);return B+I>0?{height:B+I,baseline:B}:C}try{let C=j(r,i,F,b,m),B=0,I=0;for(let P of C.fontSpans){let N=u(P.font,b);B=Math.max(B,N.baseline),I=Math.max(I,N.height-N.baseline);}if(B+I>0)return {height:B+I,baseline:B}}catch{}return u(F,b)}},S)}function ei(e,t){return Or({...t,shaper:e.shaper,environment:e.environment})}function ti(e){let{layout:t,viewport:n}=e,r=new Set;if(!n){for(let c of t.pages)r.add(c.index);return r}let o=Math.max(0,Math.trunc(e.overscanPages??1)),a=n.top+n.height,i=-1,s=-1;for(let c of t.pages){let l=c.box.y;l+c.box.height>=n.top&&l<=a&&(i===-1&&(i=c.index),s=c.index);}if(i===-1){let c=ni(t,n.top);c!==null&&(i=c,s=c);}if(i!==-1){let c=Math.max(0,i-o),l=Math.min(t.pages.length-1,s+o);for(let u=c;u<=l;u+=1)r.add(u);}for(let c of e.pinnedPages??[])c>=0&&c<t.pages.length&&r.add(c);return r}function ni(e,t){let n=null,r=Number.POSITIVE_INFINITY;for(let o of e.pages){let a=t<o.box.y?o.box.y-t:t>o.box.y+o.box.height?t-(o.box.y+o.box.height):0;a<r&&(r=a,n=o.index);}return n}var Ar=["text-local","paragraph-local","flow-structural","global"];function wr(e,t){return Ar.indexOf(t)>Ar.indexOf(e)?t:e}function ri(e){return {impact:"text-local",paragraphIds:new Set,created:new Set,deleted:new Set,dependencyKeys:new Set,structural:false,revision:e}}function oi(e){let{run:t,currentRevision:n,publish:r,schedule:o}=e,a=null,i=null,s=null,c=0,l=0;function u(d){let S=e.runCooperatively;if(!S)return t(d);let x=S(d);s=x;try{for(;;){let R=x.step();if(R)return R;if(n()!==d.revision)return x.cancel(),l+=1,null;if(s!==x)return null}}finally{s===x&&(s=null);}}function y(d){let S=p(n());S.impact=wr(S.impact,d.impact),S.structural=S.structural||d.structural;for(let x of d.paragraphIds)S.paragraphIds.add(x);for(let x of d.created)S.created.add(x);for(let x of d.deleted)S.deleted.add(x);for(let x of d.dependencyKeys)S.dependencyKeys.add(x);}let f=d=>({impact:d.impact,paragraphIds:d.paragraphIds,created:d.created,deleted:d.deleted,dependencyKeys:d.dependencyKeys,structural:d.structural,revision:d.revision});function p(d){return a||(a=ri(d)),a.revision=Math.max(a.revision,d),a}function g(){!o||i||(i=o(()=>{i=null,h();}));}function h(){i&&(i(),i=null),s&&(s.cancel(),s=null,l+=1);let d=a;if(!d)return false;a=null;let S=f(d),x=u(S);return !x||x.revision!==n()?(c+=1,y(S),g(),false):(r(x,S),true)}return {notify(d){let S=p(n());S.impact=wr(S.impact,d.impact);for(let x of d.dirty)S.paragraphIds.add(x);for(let x of d.created)S.created.add(x),S.paragraphIds.add(x);for(let x of d.deleted)S.deleted.add(x),S.paragraphIds.add(x);for(let x of d.dependencyKeys)S.dependencyKeys.add(x);for(let x of d.splitJoin)S.structural=true,"split"in x?(S.paragraphIds.add(x.split.from),S.paragraphIds.add(x.split.tail)):(S.paragraphIds.add(x.join.kept),S.paragraphIds.add(x.join.removed));(d.impact==="flow-structural"||d.impact==="global")&&(S.structural=true),g();},invalidateAll(d,S){let x=p(d);x.impact="flow-structural",x.structural=true,S&&x.dependencyKeys.add(S),g();},flush:h,pending:()=>a?f(a):null,cancel(){i?.(),i=null,s?.cancel(),s=null,a=null;},get staleDiscards(){return c},get cancelledRuns(){return l}}}var Ir=new WeakMap;function X(e){let t=Ir.get(e);if(t)return t;let n=new Map,r=new Map,o=new Map,a=new Map,i=(c,l,u,y)=>{for(let f of c){if(f.kind==="paragraph")continue;let p=f.tableId;a.set(p,Math.max(a.get(p)??0,(f.columnEdges?.length??1)-1));let g=o.get(p);g||(g=new Map,o.set(p,g),n.set(p,[]),r.set(p,new Map));for(let h of f.rows){let d=g.get(h.id);d===void 0&&(d=g.size,g.set(h.id,d),r.get(p).set(d,h.cells));for(let S of h.cells)n.get(p).push({pageIndex:l,tableId:p,row:h,cell:S,rowIndex:d,isHeaderRepeat:h.isHeaderRepeat,offsetX:u,offsetY:y}),i(S.blocks,l,u,y);}}};for(let c of e.pages){i(c.fragments,c.index,0,0);for(let l of [c.header,c.footer])l&&i(l.fragments,c.index,l.box.x-c.contentBox.x,l.box.y-c.contentBox.y);for(let l of [c.footnotes,c.endnotes])if(l)for(let u of l.notes)i(u.fragments,c.index,u.box.x-c.contentBox.x,u.box.y-c.contentBox.y);}let s=new Map;for(let[c,l]of n)s.set(c,{placed:l,rows:r.get(c)??new Map,columnCount:a.get(c)??0});return Ir.set(e,s),s}function _r(e){let t=e.columnCount;for(let n of e.rows.values())for(let r of n)t=Math.max(t,ne(r).to+1);return t}var ne=e=>({from:e.gridColumn,to:e.gridColumn+Math.max(1,e.gridSpan)-1});function ai(e,t,n){if(t.tableId!==n.tableId)return null;let r=X(e).get(t.tableId);if(!r)return null;let o=Math.min(t.rowIndex,n.rowIndex),a=Math.max(t.rowIndex,n.rowIndex),i=Math.min(ne(t).from,ne(n).from),s=Math.max(ne(t).to,ne(n).to),c=p=>{let{from:g,to:h}=ne(p);return h>=i&&g<=s},l=p=>(r.rows.get(p)??[]).some(g=>g.vMergeContinue&&c(g)),u=r.rows.size+_r(r)+2;for(let p=0;!(p>u);p+=1){let g=false;for(let[h,d]of r.rows)if(!(h<o||h>a))for(let S of d){if(!c(S))continue;let{from:x,to:R}=ne(S);x<i&&(i=x,g=true),R>s&&(s=R,g=true);}for(;o>0&&l(o);)o-=1,g=true;for(;l(a+1);)a+=1,g=true;if(!g)break}let y=[],f=new Set;for(let p of r.placed){if(p.isHeaderRepeat||p.rowIndex<o||p.rowIndex>a)continue;let{from:g,to:h}=ne(p.cell);h<i||g>s||f.has(p.cell.id)||(f.add(p.cell.id),y.push(p.cell.id));}return y.length===0?null:{kind:"cells",tableId:t.tableId,cellIds:y,rows:{from:o,to:a},columns:{from:i,to:s},text:kr(e,t.tableId,y)}}function ii(e,t){let n=X(e).get(t);if(!n)return null;let r=[],o=new Set,a=0;for(let i of n.placed)i.isHeaderRepeat||o.has(i.cell.id)||(o.add(i.cell.id),r.push(i.cell.id),a=Math.max(a,i.rowIndex));return r.length===0?null:{kind:"cells",tableId:t,cellIds:r,rows:{from:0,to:a},columns:{from:0,to:_r(n)-1},text:kr(e,t,r)}}function Tc(e,t){let n=ii(e,t.tableId);if(!n)return false;let r=new Set(t.cellIds);return n.cellIds.every(o=>r.has(o))}function Bc(e,t){return Pr(e,t,true)}function ge(e,t){return Pr(e,t,false)}function Pr(e,t,n){let r=new Set(t),o=[],a=new Set;for(let i of X(e).values())for(let s of i.placed)if(!(s.isHeaderRepeat||!r.has(s.cell.id)))for(let c of s.cell.blocks)n&&c.kind!=="paragraph"||Se(c,o,a);return o}function Se(e,t,n){if(e.kind==="paragraph"){for(let r of ab(e))n.has(r)||(n.add(r),t.push(r));return}for(let r of e.rows)if(!r.isHeaderRepeat)for(let o of r.cells)for(let a of o.blocks)Se(a,t,n);}function kr(e,t,n){let r=ge(e,n),o=r[0],a=r[r.length-1];return !o||!a?si(e,t):{anchor:{paragraphId:o,offset:0},head:{paragraphId:a,offset:Ue$1(e,a).length}}}function si(e,t){let n=X(e).get(t);for(let o of n?.placed??[]){if(o.isHeaderRepeat)continue;let a=[];for(let s of o.cell.blocks)Se(s,a,new Set);let i=a[0];if(i){let s={paragraphId:i,offset:0};return {anchor:s,head:s}}}for(let o of e.pages)for(let a of Ja$1(o)){let i={paragraphId:a.paragraphId,offset:0};return {anchor:i,head:i}}let r={paragraphId:"",offset:0};return {anchor:r,head:r}}function ci(e){let t=[...Ja$1(e)];for(let n of [e.header,e.footer])n&&t.push(...Ka$1(n.fragments));for(let n of [e.footnotes,e.endnotes])if(n)for(let r of n.notes)t.push(...Ka$1(r.fragments));return t}function li(e,t){let n=new Set(ge(e,t)),r=[],o=new Set;for(let a of e.pages)for(let i of ci(a))if(n.has(i.paragraphId))for(let s of i.lines)for(let c of s.spans){let l=`${c.range.paragraphId}:${c.range.start}:${c.range.end}`;o.has(l)||(o.add(l),r.push(c));}return r}function ui(e,t){let n=new Set(t),r=[];for(let o of X(e).values())for(let a of o.placed)n.has(a.cell.id)&&r.push({pageIndex:a.pageIndex,x:a.cell.box.x+a.offsetX,y:a.cell.box.y+a.offsetY,width:a.cell.box.width,height:a.cell.box.height});return r}function di(e,t,n=Ue$1){let r=X(e).get(t.tableId);if(!r)return "";let o=new Set(t.cellIds),a=r.placed.some(c=>c.cell.logicalGridColumn!==void 0),i=new Map,s=new Set;for(let c of r.placed){if(c.isHeaderRepeat||!o.has(c.cell.id)||s.has(c.cell.id))continue;s.add(c.cell.id);let l=ge(e,[c.cell.id]).map(f=>n(e,f)).join(`
1
+ import {f,c,d,e}from'./chunk-RIYSCEFQ.js';import {Ue as Ue$1,n,l,p,j as j$1,k,r,i,o,A,B,C,x,u,a,g,f as f$2,ya as ya$1,Ca as Ca$1,fb,Oa as Oa$1,yf,xf,w as w$1,O,N,ra as ra$1,y,ta as ta$1,jd,hd,Zc,wc,ge as ge$1,mb,q as q$1,ec,bc,ac,ab,Ja as Ja$1,dd,cc,t,b,e as e$1,c as c$1,m,Ra as Ra$1,Ya as Ya$1,uf,Od,ie as ie$1,fe as fe$1,Wc,id,Ka as Ka$1,fc,h,sa,Ia as Ia$1}from'./chunk-CCM264XP.js';import {f as f$1,yn,sc,qc,vc,rc,pj,Bn as Bn$1,An as An$1,zn as zn$1,ec as ec$1,oc,c as c$2,me as me$1,b as b$1}from'./chunk-KIDYIVZ5.js';var zr=(e,t,n)=>{let r=e<0n,o=r?-e:e,a=o/t,i=o%t;if(n!=="towardZero"){let l=i*2n;(l>t||l===t&&(n==="halfAwayFromZero"||n==="halfToEven"&&a%2n!==0n))&&(a+=1n);}let s=r?-a:a,c=Number(s);if(!Number.isSafeInteger(c))throw new RangeError("Shaped fixed-point value exceeds the safe integer range");return c},ct=(e,t,n$1,r)=>{if(!Number.isSafeInteger(e))throw new RangeError("font units must be a safe integer");if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("fixed-point denominator must be a positive safe integer");if(!Number.isSafeInteger(n$1)||n$1<0)throw new RangeError("fixed-point numerator must be a non-negative safe integer");if(e===0||n$1===0)return n(0);let o=e*n$1;if(Number.isSafeInteger(o)){let a=Math.abs(o),i=a%t,s=(a-i)/t;return r!=="towardZero"&&(i>t-i||i===t-i&&(r==="halfAwayFromZero"||r==="halfToEven"&&s%2!==0))&&(s+=1),n(s===0?0:o<0?-s:s)}return n(zr(BigInt(e)*BigInt(n$1),BigInt(t),r))},Sn=(e,t,n,r)=>{if(!Number.isSafeInteger(t)||t<=0)throw new RangeError("font size must be a positive integer number of half points");if(t>Math.floor(Number.MAX_SAFE_INTEGER/n))throw new RangeError("font size and fixed-point scale product exceeds the safe integer range");let o=t*n,a=e*2;return i=>ct(i,a,o,r)},xn=(e,t,n)=>{let r=t*n,o=e*2;return a=>a*r/o};var Pe=(e,t)=>e[t]<<8|e[t+1],bn=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0;function Dr(e,t){let n=(s,c)=>s>=0&&s+c<=e.length;if(!n(0,12))return false;let a=String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"&&n(12+t*4,4)?bn(e,12+t*4):0;if(!n(a,12))return false;let i=Pe(e,a+4);for(let s=0;s<i;s+=1){let c=a+12+s*16;if(!n(c,16))return false;if(!(e[c]===99&&e[c+1]===109&&e[c+2]===97&&e[c+3]===112))continue;let u=bn(e,c+8);if(!n(u,4))return false;let y=Pe(e,u+2);for(let f=0;f<y;f+=1){let p=u+4+f*8;if(!n(p,4))return false;if(Pe(e,p)===3&&Pe(e,p+2)===0)return true}return false}return false}var Rn=new WeakMap;function Fn(e,t){let n=Rn.get(e);return n===void 0&&(n=Dr(t,e.faceIndex),Rn.set(e,n)),n}function Cn(e){let t="",n=false;for(let r=0;r<e.length;r+=1){let o=e.charCodeAt(r);o>=32&&o<=255?(t+=String.fromCharCode(61440+o),n=true):t+=e[r];}return n?t:e}var Hr=4096,En=e=>typeof e=="number"?String(e):JSON.stringify(e)??typeof e,ke=class{constructor(t){this.onRestart=t;}onRestart;#e=new Map;keyOf(t$1,n){let r=t(n),o=this.#e.get(r);o===void 0&&(this.#e.size>=Hr&&(this.#e.clear(),this.onRestart()),o=this.#e.size,this.#e.set(r,o));let a=`${o}\0${En(t$1.fontSizeHalfPoints)}\0${En(t$1.bidiLevel)}\0`,i=t$1.context;return !i||i.before===""&&i.after===""?`${a}-${t$1.text}`:`${a}c${i.before.length},${i.after.length}\0${i.before}${i.after}${t$1.text}`}clear(){this.#e.clear();}};var ie=Object.freeze({name:"HarfBuzz",version:"14.4.0"}),ye=null,fe=null;function ut(){return ye?Promise.resolve():fe||(fe=import('./dist-PKZR6RSH.js').then(e=>{let t=e.versionString();if(t!==ie.version)throw new w("shapingLibraryMismatch",{diagnostic:f(ie.version,t)});ye=e;}).catch(e$1=>{throw fe=null,e$1 instanceof w?e$1:c(e$1)?new w("unsupportedRuntime",{diagnostic:d(e$1),cause:e$1}):new w("wasmUnavailable",{diagnostic:e(e$1),cause:e$1})}),fe)}function Gr(){return ye!==null}function Ur(){if(!ye)throw new w("notInitialized",{diagnostic:"Call initializeHarfBuzz() before creating a text shaper"});return ye}var w=class extends Error{name="HarfBuzzShapingError";code;limit;actual;diagnostic;constructor(t,n={}){super(`HarfBuzz shaping failed (${t})`,{cause:n.cause}),this.code=t,this.limit=n.limit,this.actual=n.actual,this.diagnostic=n.diagnostic;}},Kr=16*1024*1024,Wr=1e6,Vr=1e6,jr=1e6,Xr=4,Yr=512,$r=1024*1024,qr=16*1024*1024,Zr=32*1024*1024,Jr=64*1024*1024,Qr=64*1024*1024,eo=1e6,to=1e6,no=1e6,ro=64,oo=4096,ao=4*1024*1024,io=64*1024*1024,so=64*1024*1024,co=256*1024*1024,lo=new Set(["COLR","CPAL","CBDT","CBLC","sbix","SVG "]),vn=["cmap","head","hhea","hmtx","maxp"],uo=(e,t)=>e[t]<<8|e[t+1],po=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0,fo=(e,t)=>String.fromCharCode(e[0],e[1],e[2],e[3])==="ttcf"?po(e,12+t*4):0,mo=(e,t)=>{let n=fo(e,t),r=uo(e,n+4),o=new Set;for(let a=0;a<r;a+=1){let i=n+12+a*16;o.add(String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3]));}return o},yo=e=>e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength),ho=(e,t)=>{let n=l(e,t);if(!n.valid)return n;let r=mo(e,t);for(let o of vn)if(!r.has(o))return {valid:false,diagnostic:`missing required ${o} table`};return {valid:true}},dt=ho,U=(e,t,n)=>{if(!Number.isSafeInteger(e)||e<=0||e>n)throw new RangeError(`${t} must be a positive safe integer no greater than ${n}`);return e},go=(e,t,n$1)=>{if(t.length===0)return [];let r=[],o=0;for(;o<t.length;){let a=t[o].cluster,i=o+1,s=t[o].advanceX;for(;i<t.length&&t[i].cluster===a;)s+=t[i].advanceX,i+=1;let c=n(s);r.push({textStart:a,textEnd:n$1==="rtl"?t[o-1]?.cluster??e.length:t[i]?.cluster??e.length,glyphStart:o,glyphEnd:i,advance:c,caretEdges:Object.freeze([n(0),c]),fontSpan:0}),o=i;}return r},V=64,$=8,q=8,Ln=32,pt=V+2*$,So=V+$+q,xo=V+$+2*q,bo=V+$+q,Tn=V+8*$,Bn=V+8*q+$,Ro=V+6*q+$,Fo=V+3*q+2*$,Co=V+3*q,he=e=>V+e.length*Uint16Array.BYTES_PER_ELEMENT,ft=e=>bo+he(e),me=e=>Ln+e*$,Eo=(e,t)=>pt+he(e)+So+ft(t),vo=e=>Tn+he(e)+me(e.length)+e.length*Bn,Lo=e=>{let t=new Set(e.glyphs.map(n=>n.outline));return Tn+he(e.text)+me(e.glyphs.length)+e.glyphs.length*Bn+me(e.clusters.length)+e.clusters.length*Ro+e.clusters.reduce((n,r)=>n+me(r.caretEdges.length),0)+me(e.fontSpans.length)+e.fontSpans.length*Fo+(e.exactAdvancesX===void 0?0:Ln+e.exactAdvancesX.length*q)+Co+[...t].reduce((n,r)=>n+ft(r.path),0)},To=(e,t)=>pt+he(e)+xo+t,lt=class{#e;#p;#f;#m;#y;#R;#h;#l=0;#F;#g;#S;#c;#x;#u;#t;#o=new Map;#i=new Map;#s=new Map;#n=new Map;#C=new ke(()=>{this.#n.clear(),this.#r=0,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0}));});#a=0;#r=0;#b=0;#d;constructor(t,n){p(this),this.#e=t,this.#p=U(n.maxFontBytes??Kr,"maximum font bytes",Qr),this.#f=U(n.maxInputUtf16??Wr,"maximum input UTF-16 code units",eo),this.#m=U(n.maxCodepoints??Vr,"maximum input code points",to),this.#y=U(n.maxGlyphs??jr,"maximum shaped glyphs",no),this.#h=U(n.maxCachedFontBytes??64*1024*1024,"maximum cached font bytes",64*1024*1024),this.#R=U(n.maxCachedFaces??Xr,"maximum cached faces",ro),this.#F=U(n.maxCachedShapes??Yr,"maximum cached shape results",oo),this.#g=U(n.maxOutlineBytes??$r,"maximum outline bytes",ao),this.#S=U(n.maxCachedOutlineBytes??qr,"maximum cached outline bytes",io),this.#c=U(n.maxShapedRunBytes??Zr,"maximum shaped run bytes",so),this.#x=U(n.maxCachedShapeBytes??Jr,"maximum cached shape bytes",co),this.#u=n.instrumentation?.onFaceCacheEvent,this.#t=n.instrumentation,this.#d=new this.#e.Buffer;}dispose(){this.#o.clear(),this.#l=0,this.#i.clear(),this.#s.clear(),this.#n.clear(),this.#C.clear(),this.#a=0,this.#r=0,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"cleared",retainedBytes:0})),this.#d=void 0;}#v(t,n){let r=this.#o.get(t.identity);if(r)return this.#o.delete(t.identity),this.#o.set(t.identity,r),this.#u?.(Object.freeze({kind:"hit",identity:t.identity})),r;let o=j$1(t);for(let u of vn)if(!o.has(u))throw new w("malformedFont",{diagnostic:`missing required ${u} table`});this.#t?.onByteCopy?.();let a=new this.#e.Blob(yo(n)),i=new this.#e.Face(a,t.faceIndex),s=new this.#e.Font(i),c=s.hExtents();if(!Number.isSafeInteger(i.upem)||i.upem<=0||!Number.isSafeInteger(c.ascender)||!Number.isSafeInteger(c.descender)||!Number.isSafeInteger(c.lineGap))throw new w("malformedFont",{diagnostic:"invalid font units or horizontal metrics"});s.setScale(i.upem,i.upem);let l={identity:t.identity,blob:a,face:i,font:s,unitsPerEm:i.upem,byteLength:n.byteLength};if(n.byteLength<=this.#h){for(;this.#o.size>=this.#R||this.#l+n.byteLength>this.#h;){let u=this.#o.keys().next().value;if(u===void 0)break;this.#l-=this.#o.get(u).byteLength,this.#o.delete(u),this.#u?.(Object.freeze({kind:"evicted",identity:u}));}this.#o.set(t.identity,l),this.#l+=n.byteLength;}return this.#u?.(Object.freeze({kind:"created",identity:t.identity})),l}#L(t,n){let r=this.#i.get(t.identity)?.get(n);if(r)return this.#s.delete(r),this.#s.set(r,void 0),this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#a})),r.outline;this.#t?.onOutlinePathCall?.();let o=t.font.glyphToPath(n),a=ft(o);if(a>this.#g)throw new w("outlineOverLimit",{limit:this.#g,actual:a});let i=Object.freeze({path:o,unitsPerEm:t.unitsPerEm}),s=Eo(t.identity,o)+3*pt+2*q;if(s>this.#S)return this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#a})),i;for(;this.#a+s>this.#S;){let u=this.#s.keys().next().value;if(u===void 0)break;this.#s.delete(u);let y=this.#i.get(u.identity);y.delete(u.glyphId),y.size===0&&this.#i.delete(u.identity),this.#a-=u.bytes,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#a}));}let c=this.#i.get(t.identity);c||this.#i.set(t.identity,c=new Map);let l={outline:i,bytes:s,identity:t.identity,glyphId:n};return c.set(n,l),this.#s.set(l,void 0),this.#a+=s,this.#t?.onOutlineCacheEvent?.(Object.freeze({kind:"created",retainedBytes:this.#a})),i}#E(t){if(t.length>this.#f)throw new w("textOverLimit",{limit:this.#f,actual:t.length});let n=0;for(let r=0;r<t.length;){let o=t.codePointAt(r);if(r+=o>65535?2:1,n+=1,n>this.#m)throw new w("codepointsOverLimit",{limit:this.#m,actual:n})}}shape(t){if(!this.#d)throw new w("disposed");if(k(t.environment.font),t.environment.font.byteLength>this.#p)throw new w("fontOverLimit",{limit:this.#p,actual:t.environment.font.byteLength});this.#E(t.text);let n$1=vo(t.text);if(n$1>this.#c)throw new w("shapedRunOverLimit",{limit:this.#c,actual:n$1});let r$1=r(t.environment),o$1=this.#C.keyOf(t,r$1),a=this.#n.get(o$1);if(a)return this.#b-a.stamp>=Math.max(1,this.#n.size>>1)&&(this.#n.delete(o$1),this.#n.set(o$1,a),a.stamp=++this.#b),this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"hit",retainedBytes:this.#r})),a.run;if(this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"miss",retainedBytes:this.#r})),r$1.shapingLibrary.name!==ie.name||r$1.shapingLibrary.version!==ie.version)throw new w("shapingLibraryMismatch");if(r$1.normalization!=="none")throw new w("unsupportedNormalization");if(!Number.isSafeInteger(t.bidiLevel)||t.bidiLevel<0||(t.bidiLevel&1)===1!=(r$1.direction==="rtl"))throw new w("invalidBidiLevel");if(Object.keys(r$1.variationAxes).length>0)throw new w("unsupportedVariationAxes");if(r$1.fallbackOrder.length>0)throw new w("unsupportedFallback");let i$1=i(r$1.font),s=j$1(r$1.font);if([...lo].some(p=>s.has(p))&&!s.has("glyf")&&!s.has("CFF "))throw new w("unsupportedColorFont");let c=t.text;this.#E(c);let l=t.context?.before??"",u$1=t.context?.after??"",y=o,f=Math.max(String(l).length,String(u$1).length);if(typeof l!="string"||typeof u$1!="string"||f>y)throw new w("textOverLimit",{limit:y,actual:f});try{let p=this.#v(r$1.font,i$1),{face:g,font:h}=p,d=this.#d;d.reset();let S=Fn(r$1.font,i$1)?Cn:String,x$1=l+c+u$1,R=A(x$1)?B(p):void 0,L=M=>S(R?C(M,R):M);l||u$1?d.addText(L(l+c+u$1),l.length,c.length):d.addText(L(c)),d.setDirection(r$1.direction==="rtl"?this.#e.Direction.RTL:this.#e.Direction.LTR),d.setScript(r$1.script),d.setLanguage(r$1.language),d.setClusterLevel(this.#e.ClusterLevel.MONOTONE_CHARACTERS);let E=Object.entries(r$1.features).map(([M,G])=>new this.#e.Feature(M,G));if((r$1.features.kern??1)!==0)for(let[M,G]of x(l+c+u$1))E.push(new this.#e.Feature("kern",0,M,G));this.#t?.onShapeCall?.(),this.#e.shape(h,d,E);let A$1=d.getLength();if(A$1>this.#y)throw new w("glyphOverLimit",{limit:this.#y,actual:A$1});let T=d.getGlyphInfos(),v=d.getGlyphPositions(),O=Sn(g.upem,t.fontSizeHalfPoints,r$1.fixedPointScale,r$1.roundingMode),_=xn(g.upem,t.fontSizeHalfPoints,r$1.fixedPointScale),b=[],m=n(0),F=n(0),C$1=new Map,B$1=T.map((M,G)=>{let ee=v[G],At=R?.get(x$1.charCodeAt(M.cluster)),wt=At?.advance??ee?.xAdvance??0;b.push(_(wt));let It=O(wt),Mt=O(ee?.yAdvance??0),xe=At?.glyph??M.codepoint,Nr={id:xe,cluster:M.cluster-l.length,originX:m,originY:F,advanceX:It,advanceY:Mt,offsetX:O(ee?.xOffset??0),offsetY:O(ee?.yOffset??0),outline:C$1.get(xe)??(()=>{let _t=this.#L(p,xe);return C$1.set(xe,_t),_t})()};return m=n(m+It),F=n(F+Mt),Nr}),I=h.hExtents(),P=u({text:c,direction:r$1.direction,bidiLevel:t.bidiLevel,glyphs:B$1,exactAdvancesX:b,clusters:go(c,B$1,r$1.direction),fontSpans:B$1.length===0?[]:[{glyphStart:0,glyphEnd:B$1.length,font:r$1.font,fallbackIndex:null}],metrics:{ascent:O(I.ascender),descent:O(-I.descender),lineGap:O(I.lineGap)}},r$1),N=Lo(P);if(N>this.#c)throw new w("shapedRunOverLimit",{limit:this.#c,actual:N});let D=To(o$1,N);if(D>this.#x)return this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"skipped",retainedBytes:this.#r})),P;for(;this.#n.size>=this.#F||this.#r+D>this.#x;){let M=this.#n.keys().next().value;if(M===void 0)break;let G=this.#n.get(M);this.#n.delete(M),this.#r-=G.bytes,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"evicted",retainedBytes:this.#r}));}return this.#n.set(o$1,{run:P,bytes:D,stamp:++this.#b}),this.#r+=D,this.#t?.onShapeCacheEvent?.(Object.freeze({kind:"stored",retainedBytes:this.#r})),P}catch(p){throw p instanceof w?p:new w("malformedFont",{diagnostic:p instanceof Error?p.message:"HarfBuzz shaping failed"})}}},mt=(e={})=>new lt(Ur(),e);var yt=Object.freeze({maxFontBytes:16*1024*1024,maxInputUtf16:1e6,maxCodepoints:1e6,maxGlyphs:1e6,maxCachedFaces:32,maxCachedFontBytes:64*1024*1024,maxCachedShapes:512,maxOutlineBytes:1024*1024,maxCachedOutlineBytes:16*1024*1024,maxShapedRunBytes:32*1024*1024,maxCachedShapeBytes:64*1024*1024}),Ai=Object.freeze({...yt,maxCachedShapes:4096});function On(e){let t={maxFontBytes:e.maxFontBytes,maxInputUtf16:e.maxInputUtf16,maxCodepoints:e.maxCodepoints,maxGlyphs:e.maxGlyphs,maxOutlineBytes:e.maxOutlineBytes,maxShapedRunBytes:e.maxShapedRunBytes},n=["docx-editor-layout-harfbuzz-execution-policy",1,Object.entries(t).sort(([r],[o])=>r<o?-1:r>o?1:0).map(([r,o])=>Object.freeze([r,o]))];return `layout-shaper-policy:sha256:${f$1(new TextEncoder().encode(JSON.stringify(n)))}`}function An(e,t=yt){let n=e?.maxFontBytes??t.maxFontBytes;if(!Number.isSafeInteger(n)||n<=0||n>a)throw new RangeError(`Font shaping byte ceiling must be between 1 and ${a}`);return n===t.maxFontBytes?t:Object.freeze({...t,maxFontBytes:n})}function wn(e,t,n=false){let r=false,o=Object.freeze({shape(a){if(r)throw new w("disposed");let i=a.environment.font;if(k(i),i.byteLength>t.maxFontBytes)throw new w("fontOverLimit",{limit:t.maxFontBytes,actual:i.byteLength});return e.shape(a)},dispose(){r||(r=true,n&&e.dispose?.());}});return q$1(e)?p(o):o}var Bo=Object.freeze({}),In=b,Oo="16.0.0",Ao="none",wo=1e3,Io="halfToEven",Pn="cluster-edges-only",Mo="Latn",_o=new Uint8Array(0);var Z=class extends Error{code="overLimit";constructor(t){super(t),this.name="LayoutShapingConfigurationError";}};function Po(e,t){let n=e.epoch,r=e.maxFontBytes,o=e.sources,a$1=e.substitutions,i=e.defaultFont,s=e.language;if(!Number.isSafeInteger(r)||r<=0||r>a)throw new Z(`Font byte ceiling must not exceed the engine hard maximum of ${a}`);let c=o.length,l=a$1?.length??0;if(c===0||c>b)throw new Z(`Font source count must be between 1 and ${b}`);if(l>In)throw new Z(`Font substitution count must not exceed ${In}`);let u=0,y=[];for(let g$1=0;g$1<c;g$1+=1){let h=o[g$1],d=h.request,S=h.availability,x=h.id,R=h.hash,L=h.faceIndex,E=S==="forbidden",A=E?_o:h.bytes;if(!E){if(typeof x!="string"||x.length===0)throw new TypeError("Resolved font id must not be empty");let T;try{T=e$1(A);}catch{throw new Z(`Font source ${x} must provide genuine bytes`)}if(T>r)throw new Z(`Font source ${x} exceeds the per-font byte ceiling`);if(u+=T,u>c$1)throw new Z(`Font sources exceed the aggregate byte ceiling of ${c$1}`)}y.push(t&&g(h)!==void 0?h:Object.freeze({request:Object.freeze({family:d.family,weight:d.weight,style:d.style}),id:x,bytes:A,hash:R,faceIndex:L,...S?{availability:S}:{}}));}let f;if(a$1){f=[];for(let g=0;g<l;g+=1){let h=a$1[g],d=h.from,S=h.to,x=h.lineMetrics;f.push(Object.freeze({from:Object.freeze({family:d.family,weight:d.weight,style:d.style}),to:Object.freeze({family:S.family,weight:S.weight,style:S.style}),...x?{lineMetrics:Object.freeze({heightEm:x.heightEm,baselineEm:x.baselineEm})}:{}}));}}let p={epoch:n,maxFontBytes:r,sources:Object.freeze(y),substitutions:f?Object.freeze(f):void 0,defaultFont:Object.freeze({family:i.family,sizeHalfPoints:i.sizeHalfPoints}),language:s};return Object.freeze(p)}function Mn(e,t){let n=e.map((o,a)=>({value:o,index:a,key:h(t(o))})),r=new Set;for(let o of n){if(r.has(o.key))return e;r.add(o.key);}return n.sort((o,a)=>o.key<a.key?-1:o.key>a.key?1:o.index-a.index).map(({value:o})=>o)}function ko(e,t){let n={family:e.family},r={sizeHalfPoints:e.sizeHalfPoints};return {...n,...t?r:{}}}function _n(e,t){let n=c=>({family:c.family,weight:c.weight,style:c.style}),r=t?e.sources:Mn(e.sources,c=>c.request),o=e.substitutions??[],a=t?o:Mn(o,c=>c.from),i={sources:r.map(c=>{let l=c.availability??"available",u={request:n(c.request),availability:l};if(l==="forbidden")return {...u,...t?{id:c.id,faceIndex:c.faceIndex,declaredHash:c.hash}:{}};let y=g(c);if(y==null)throw new TypeError("Font configuration identity requires prepared source bytes");return {...u,...t?{id:c.id}:{},faceIndex:c.faceIndex,declaredHash:c.hash,actualHash:y,byteLength:c.bytes.byteLength}}),substitutions:a.map(c=>({from:n(c.from),to:n(c.to),lineMetrics:c.lineMetrics?{heightEm:c.lineMetrics.heightEm,baselineEm:c.lineMetrics.baselineEm}:null})),defaultFont:ko(e.defaultFont,t),language:e.language||"en"},s={epoch:e.epoch,maxFontBytes:e.maxFontBytes};return {version:1,...t?s:{},...i}}var No=Symbol("prepared-layout-font-configuration"),Ne=new WeakMap;function zo(e){return Ne.has(e)}function Do(e){let t=Ne.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.configuration}function Ui(e){let t=Ne.get(e);if(!t)throw new TypeError("Invalid prepared layout font configuration");return t.sharedShapingFingerprint}function ht(e,t){return kn(e,t,false)}function Ki(e,t){return kn(e,t,true)}function kn(e,t,n){let r=Po(e,n),o=Object.freeze({epoch:r.epoch,maxFontBytes:r.maxFontBytes,sources:Object.freeze(r.sources.map(y=>n&&g(y)!==void 0?y:f$2(y,{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash}))),substitutions:r.substitutions,defaultFont:r.defaultFont,language:r.language}),a=new TextEncoder,i=_n(o,true),s=a.encode(JSON.stringify(i)),c=_n(o,false),l=a.encode(JSON.stringify(c)),u=Object.freeze({[No]:true,fingerprint:`font-config:${f$1(s)}`});return Ne.set(u,{configuration:o,sharedShapingFingerprint:`shared-font-config:${f$1(l)}`}),u}function Ho(e){return ht(e).fingerprint}function Go(e,t){let n=new TextEncoder().encode(JSON.stringify({version:1,environment:e,executionPolicy:On(t),ligatureCaretPolicy:Pn,fallback:sa}));return `shaping:${f$1(n)}`}async function Nn(e,t,n,r,o=false){let i=zo(e)?e:ht(e,t),s=Do(i),{epoch:c,maxFontBytes:l,sources:u,substitutions:y,defaultFont:f}=s,p=s.language||"en",g=i.fingerprint,h=m({epoch:c,maxFontBytes:l,resources:u,substitutions:y,validateFont:dt,instrumentation:{onOwnedByteCopy:t?.onFontByteCopy,onHash:t?.onFontHash,onAdmission:t?.onFontAdmission}});await ut();let d=Object.freeze({script:Mo,variationAxes:Object.freeze({}),shapingLibrary:ie,unicodeDataVersion:Oo,normalization:Ao,language:p,features:Bo,...o?{documentLigatures:true}:{},fixedPointScale:wo,roundingMode:Io});return Object.freeze({fonts:h,shaper:wn(n??mt(r),r,n===void 0),defaultFont:f,environment:d,ligatureCaretPolicy:Pn,operation:Object.freeze({resourceEpoch:h.epoch,configEpoch:c,extensionFingerprint:g,shapingHash:Go(d,r),producerVersion:1})})}async function Uo(e,t,n){return Nn(e,t,void 0,An(n))}async function Wi(e,t,n,r,o=false){return Nn(e,r,t,n,o)}function Ko(e){e.shaper.dispose?.();}function gt(e){let t=new Set([0,e.text.length]);for(let r of ya$1(e.text))t.add(r.utf16From),t.add(r.utf16To);let n=new Set([0,e.text.length]);for(let r of e.clusters)n.add(r.textStart),n.add(r.textEnd);return [...t].filter(r=>n.has(r)).sort((r,o)=>r-o)}function ze(e,t){return gt(e).includes(t)}function Wo(e,t){return ze(e,t)}function Vo(e,t,n){return n>=t&&ze(e,t)&&ze(e,n)}function jo(e){let t=ya$1(e.text);return gt(e).map(n=>n===e.text.length?t.length:t.findIndex(r=>r.utf16From===n))}var xt="und";function Gn(){return typeof Intl.Segmenter=="function"}function Xo(){let e=Intl.Segmenter;if(typeof e!="function")throw new Error(`Intl.Segmenter is required for word segmentation (locale: ${xt})`);return e}function Un(){let e=new(Xo())(xt,{granularity:"word"});return {segment(t){let n=[];for(let r of e.segment(t)){let o=r.index,a=o+r.segment.length;n.push({utf16From:o,utf16To:a,wordLike:r.isWordLike===true});}return n}}}var Yo=/^[\p{L}\p{N}']$/u,$o=/^\s$/u;function zn(e){return Yo.test(e)}function Dn(e){return $o.test(e)}function St(e,t,n,r){let o=e[t],a=e[n-1];return {utf16From:o.utf16From,utf16To:a.utf16To,wordLike:r}}function Kn(e){let t=ya$1(e);if(t.length===0)return [];let n=[],r=0;for(;r<t.length;){let o=t[r];if(Dn(o.text)){let a=r+1;for(;a<t.length&&Dn(t[a].text);)a+=1;n.push(St(t,r,a,false)),r=a;continue}if(zn(o.text)){let a=r+1;for(;a<t.length&&zn(t[a].text);)a+=1;n.push(St(t,r,a,true)),r=a;continue}n.push(St(t,r,r+1,false)),r+=1;}return n}function Wn(){return {segment:Kn}}function Vn(e={}){let t=e.isIntlAvailable??Gn,n=e.createIntlBoundary??Un,r=e.createFallbackBoundary??Wn;if(!t())return r();try{return n()}catch{return r()}}var Hn;function jn(){return Hn??=Vn(),Hn}function qo(e,t=jn()){return t.segment(e)}function Zo(e,t){return t.map(n=>({graphemeFrom:Ca$1(e,n.utf16From),graphemeTo:Ca$1(e,n.utf16To),wordLike:n.wordLike}))}var Xn={resourceEpoch:"resource-scoped",configEpoch:"coarse-gate",extensionFingerprint:"coarse-gate",shapingHash:"coarse-gate",producerVersion:"coarse-gate"},Ft=Object.keys(Xn),Yn=Ft.filter(e=>Xn[e]==="coarse-gate"),De=(e,t)=>{if(!Number.isSafeInteger(e)||e<0)throw new RangeError(`${t} must be a non-negative safe integer`)},ce=(e,t)=>{if(e.trim().length===0)throw new TypeError(`${t} must not be blank`)},Jo={resourceEpoch:De,configEpoch:De,extensionFingerprint:ce,shapingHash:ce,producerVersion:De},Qo=(e,t)=>{Jo[t](e[t],t);},le=e=>{for(let t of Ft)Qo(e,t);return Object.freeze({resourceEpoch:e.resourceEpoch,configEpoch:e.configEpoch,extensionFingerprint:e.extensionFingerprint,shapingHash:e.shapingHash,producerVersion:e.producerVersion})},ea=(e,t)=>{let n=le(e),r=le(t),o=Ft.filter(a=>n[a]!==r[a]);return o.length===0?Object.freeze({status:"current"}):Object.freeze({status:"restart",changed:Object.freeze(o)})},bt=e=>{let t=e.map(({key:n,fingerprint:r})=>(ce(n,"resource dependency key"),ce(r,"resource dependency fingerprint"),Object.freeze({key:n,fingerprint:r}))).sort((n,r)=>n.key<r.key?-1:n.key>r.key?1:0);for(let n=1;n<t.length;n+=1)if(t[n-1].key===t[n].key)throw new TypeError(`Duplicate resource dependency: ${t[n].key}`);return Object.freeze(t)},ta=e=>(De(e.revision,"revision"),ce(e.dependencyFingerprint,"dependencyFingerprint"),ce(e.inputFingerprint,"inputFingerprint"),Object.freeze({revision:e.revision,dependencyFingerprint:e.dependencyFingerprint,inputFingerprint:e.inputFingerprint,resourceDependencies:bt(e.resourceDependencies),...le(e)})),na=(e,t)=>{let n=bt(e),r=bt(t),o=Math.max(n.length,r.length);for(let a=0;a<o;a+=1){let i=n[a],s=r[a];if(i?.key!==s?.key||i?.fingerprint!==s?.fingerprint)return {hit:false,reason:"resource-changed",resourceKey:i?.key??s.key}}return null};function ra(e,t){if(e.dependencyFingerprint!==t.dependencyFingerprint)return {hit:false,reason:"dependency-changed"};if(e.inputFingerprint!==t.inputFingerprint)return {hit:false,reason:"input-changed"};let n=na(e.resourceDependencies,t.resourceDependencies);if(n)return n;for(let r of Yn)if(e[r]!==t[r])return {hit:false,reason:"epoch-changed",epoch:r};return null}var Rt=class{entries=new Map;get(t,n){let r=this.entries.get(t);if(!r)return {hit:false,reason:"absent"};let o=ra(r.provenance,n);return o||{hit:true,value:r.value,provenance:r.provenance}}set(t,n,r){this.entries.set(t,{value:n,provenance:ta(r)});}evictEpoch(t){let n=le(t),r=0;for(let[o,a]of this.entries){let i=a.provenance;Yn.some(s=>i[s]!==n[s])&&(this.entries.delete(o),r+=1);}return r}evictResources(t,n){let r=le(t),o=this.evictEpoch(r);for(let[a,i]of this.entries)i.provenance.resourceDependencies.some(c=>n.get(c.key)!==c.fingerprint)&&(this.entries.delete(a),o+=1);return o}get size(){return this.entries.size}};function $n(e){return e.projected===true?null:e.range}function aa(e,t,n,r=false){let{page:o,story:a,host:i,noteScopeId:s,noteAreaKind:c}=e,l=a==="header"||a==="footer"?u=>Ia$1(u,e.origin,{x:o.box.x,y:o.box.y}):void 0;Ra$1(i,(u,y)=>{let{textboxDepth:f,textboxOwner:p,textboxPath:g,storyOrigin:h}=y,d=f===0?a:"textbox";if(r&&u.marker&&!u.lines.some(S=>S.spans.length>0)){let S=u.lines[0];if(!S||!u.marker)return;let x={range:{paragraphId:u.paragraphId,start:S.range.start,end:S.range.start},text:"",props:[],style:u.marker.style,box:{...S.box,width:0}};n({page:o,story:d,rootStory:a,root:e,storyOrigin:h,absoluteBox:Object.freeze({x:h.x+x.box.x,y:h.y+x.box.y,width:0,height:x.box.height}),noteScopeId:s,noteAreaKind:c,textboxDepth:f,textboxOwner:p,textboxPath:g,paragraph:u,paragraphId:u.paragraphId,line:S,span:x,sourceRange:null});return}for(let S of u.lines){let x=[...Ya$1(S)].sort((R,L)=>(t.get(R.paragraphId)??Number.MAX_SAFE_INTEGER)-(t.get(L.paragraphId)??Number.MAX_SAFE_INTEGER));for(let R of x)for(let L of R.spans)n({page:o,story:d,rootStory:a,root:e,storyOrigin:h,absoluteBox:Object.freeze({x:h.x+L.box.x,y:h.y+L.box.y,width:L.box.width,height:L.box.height}),noteScopeId:s,noteAreaKind:c,textboxDepth:f,textboxOwner:p,textboxPath:g,paragraph:u,paragraphId:R.paragraphId,line:S,span:L,sourceRange:$n(L)});}},e.origin,l);}function ia(e,t,n={}){let r=new Map(fb(e).map((o,a)=>[o,a]));Oa$1(e,o=>aa(o,r,t,n.spanlessMarkers===true));}var ca=1,qn=4,te=Object.freeze({top:0,right:0,bottom:0,left:0}),Zn=new WeakMap;function la(e,t){let n=ua(e);return n===te?t:yf(t,n)}function ua(e){let t=e.vectorShape;if(!t)return te;let{cx:n,cy:r}=t.extentEmu;if(!(n>=0)||!(r>=0)||n===0&&r===0)return te;let o=Zn.get(t);if(o||(o=da(t),Zn.set(t,o)),o===te)return te;let a=e.paintBounds,i=e.geometry.contentBounds;if(!(a.width>0||i.width<=0)||!(a.height>0||i.height<=0))return te;let s=n>0?i.width/n:i.height/r,c=r>0?i.height/r:i.width/n,l=(f,p,g)=>{if(g<-1e-3)return 0;let h=f*p-Math.max(0,g);return Number.isFinite(h)&&h>0?h:0},u=e.kind==="inlineDrawing"&&e.placeholderGraphicKind===null,y={left:l(o.left,s,i.x-a.x),top:u?0:l(o.top,c,i.y-a.y),right:l(o.right,s,a.x+a.width-(i.x+i.width)),bottom:l(o.bottom,c,a.y+a.height-(i.y+i.height))};return y.left||y.top||y.right||y.bottom?Object.freeze(y):te}function da(e){let{cx:t,cy:n}=e.extentEmu,r=0,o=0,a=t,i=n,s=(y,f)=>{r=Math.min(r,y),a=Math.max(a,y),o=Math.min(o,f),i=Math.max(i,f);},c=e.overflowVisible===true,l=c?1/0:ca,u=y=>y.x>=-l&&y.x<=t+l&&y.y>=-l&&y.y<=n+l;for(let y of e.components){if(c)for(let d of y.subpathsEmu)for(let S of d)s(S.x,S.y);let f=y.clipEmu?void 0:y.shadow;if(f){let d=1/0,S=1/0,x=-1/0,R=-1/0;for(let T of y.subpathsEmu)for(let v of T){let O=c?v.x:Math.max(0,Math.min(t,v.x)),_=c?v.y:Math.max(0,Math.min(n,v.y));d=Math.min(d,O),S=Math.min(S,_),x=Math.max(x,O),R=Math.max(R,_);}let L=xf(f.blurEmu)*.75+(y.strokeHex!==null?Math.max(1,xf(y.strokeWidthEmu))/2:0),E=xf(f.dxEmu),A=xf(f.dyEmu);d<=x&&(s(d+E-L,S+A-L),s(x+E+L,R+A+L));}if(y.strokeHex===null||y.strokeInset===true)continue;let p=Math.max(1,xf(y.strokeWidthEmu))/2,g=l+Math.max(0,xf(y.strokeOutsetEmu??0)),h=d=>d.x>=-g&&d.x<=t+g&&d.y>=-g&&d.y<=n+g;y.subpathsEmu.forEach((d,S)=>{let x=y.subpathsClosed?.[S]!==false,R=pa(d,x),L=x&&R.length>2?R.length:R.length-1,E=[];for(let T=0;T<L;T+=1){let v=R[T],O=R[(T+1)%R.length],_=Math.hypot(O.x-v.x,O.y-v.y),b={x:-(O.y-v.y)/_,y:(O.x-v.x)/_};if(E.push(b),!!fa(v,O,-g,t+g,-g,n+g))for(let m=0;m<2;m+=1){let F=J[m],C=v.x+(O.x-v.x)*F,B=v.y+(O.y-v.y)*F;s(C+b.x*p,B+b.y*p),s(C-b.x*p,B-b.y*p);}}if(!x&&E.length&&(y.strokeCap==="round"||y.strokeCap==="square")){for(let[T,v,O]of [[R[0],E[0],-1],[R[R.length-1],E[E.length-1],1]])if(h(T))if(y.strokeCap==="round")s(T.x-p,T.y-p),s(T.x+p,T.y+p);else {let _=T.x+O*v.y*p,b=T.y-O*v.x*p;s(_+v.x*p,b+v.y*p),s(_-v.x*p,b-v.y*p);}}let A=x&&R.length>2?E.length:E.length-1;for(let T=0;T<A;T+=1){let v=R[(T+1)%R.length];if(!h(v))continue;if(y.strokeJoin==="round"){s(v.x-p,v.y-p),s(v.x+p,v.y+p);continue}if(y.strokeJoin==="bevel")continue;let O=E[T],_=E[(T+1)%E.length],b=1+O.x*_.x+O.y*_.y;if(b<2/(qn*qn))continue;let m=O.y*-_.x- -O.x*_.y;if(m===0)continue;let F=m>0?-1:1;s(v.x+F*(O.x+_.x)*p/b,v.y+F*(O.y+_.y)*p/b);}});for(let d of y.arrowheadsEmu??[])if(!(!d[0]||!u(d[0])))for(let S of d)s(S.x,S.y);}return r>=0&&o>=0&&a<=t&&i<=n?te:Object.freeze({left:-r,top:-o,right:a-t,bottom:i-n})}function pa(e,t){let n=[];for(let a of e){let i=n[n.length-1];(!i||i.x!==a.x||i.y!==a.y)&&n.push(a);}let r=n[0],o=n[n.length-1];return t&&n.length>1&&r.x===o.x&&r.y===o.y&&n.pop(),n}var J=new Float64Array(2);function fa(e,t,n,r,o,a){let i=t.x-e.x,s=t.y-e.y;return J[0]=0,J[1]=1,He(-i,e.x-n)&&He(i,r-e.x)&&He(-s,e.y-o)&&He(s,a-e.y)}function He(e,t){if(e===0)return t>=0;let n=t/e;return e<0?J[0]=Math.max(J[0],n):J[1]=Math.min(J[1],n),J[0]<=J[1]}var ma="abcdefghijklmnopqrstuvwxyz";function z(e){let t=Math.round(e.fontSizePt*2);return Math.max(1,t)}function j(e,t,n,r,o){let a=r.shaping?.context;return e.shape({text:o,fontSizeHalfPoints:z(r),bidiLevel:r.shaping?.direction==="rtl"?1:0,environment:ya(t,n,r),...a?{context:a}:{}})}var Jn=new WeakMap;function ya(e,t,n){if(!Object.isFrozen(e)||!Object.isFrozen(e.features)||!Object.isFrozen(e.variationAxes)||!Object.isFrozen(e.shapingLibrary))return Qn(e,t,n);let r=n.shaping?.direction??"ltr",o=n.shaping?.script,a=`${r}|${o??""}|${w$1(n)?1:0}|${e.documentLigatures?O(n):""}|${n.smallCaps?1:0}`,i=Jn.get(e);i||Jn.set(e,i=new WeakMap);let s=i.get(t);s||i.set(t,s=new Map);let c=s.get(a);return c||s.set(a,c=Qn(e,t,n)),c}function Qn(e,t,n){return r({...e,font:t,direction:n.shaping?.direction??"ltr",script:n.shaping?.script==="Zyyy"?e.script:n.shaping?.script??e.script,features:{...e.features,kern:w$1(n)?1:0,...e.documentLigatures?N(n):{},...n.smallCaps?{smcp:1}:{}},fallbackOrder:[]})}function Ge(e,t,n,r,o){let a=o.get(n);if(a!==void 0)return a;let i=true;try{for(let s of ma){let c=j(e,t,n,{...r,smallCaps:!0},s),l=j(e,t,n,{...r,smallCaps:!1},s);if(!(c.glyphs.length!==l.glyphs.length||c.glyphs.some((y,f)=>y.id!==l.glyphs[f]?.id))){i=!1;break}}}catch{i=false;}return o.set(n,i),i}var ha=new Map([["garamond",{family:"Garamond",em:er(1765,539,0)}],["segoe ui",{family:"Segoe UI",em:er(2210,514,0)}]]);function er(e,t,n){return {heightEm:(e+t+n)/2048,baselineEm:(e+n)/2048}}function Ct(e){return e?ha.get(e.trim().toLowerCase()):void 0}function Ue(e){let t=Ct(e.fontFamily);if(!t)return;let n=z(e)/2*ra$1(e);return {height:t.em.heightEm*n,baseline:t.em.baselineEm*n}}var ga=new Map([["roman","serif"],["swiss","sans"],["modern","mono"]]);function ps(e,t){return t==="fixed"?"mono":e?ga.get(e):void 0}var Sa=new Map([["calibri","sans"],["arial","sans"],["helvetica","sans"],["verdana","sans"],["tahoma","sans"],["segoe ui","sans"],["aptos","sans"],["century gothic","sans"],["carlito","sans"],["cambria","serif"],["times new roman","serif"],["georgia","serif"],["garamond","serif"],["book antiqua","serif"],["palatino linotype","serif"],["caladea","serif"],["courier new","mono"],["consolas","mono"]]);function tr(e){let t=e.trim().toLowerCase(),n=Sa.get(t);if(n)return n;let r=t.split(/[\s_-]+/);if(r.includes("mono")||r.includes("monospace")||r.includes("courier"))return "mono";if(r.includes("sans"))return "sans";if(r.includes("serif")||r.includes("roman"))return "serif"}var fs={serif:"Times New Roman",sans:"Arial",mono:"Courier New"};var Et="Calibri, Carlito, Helvetica, Arial, sans-serif",xa='"Times New Roman", "Liberation Serif", Tinos, serif',ba='"Courier New", "Liberation Mono", Cousine, monospace',Ra='Batang, AppleMyungjo, "Noto Serif CJK KR", serif';function Fa(e,t=Et,n){if(!e)return t;if(n?.(e))return Ra;let r=tr(e);return r==="serif"?xa:r==="mono"?ba:t}var Rs=new Map([["calibri","Carlito"]]),Ca=65536,Ea=256;function nr(e,t){return e===void 0?Math.max(1,Math.floor(t)):Number.isFinite(e)&&e>0?Math.max(1,Math.floor(e)):1}function rr(e){let t=new Map,n=null,r=null,o=0,a=s=>{s.older?s.older.newer=s.newer:n=s.newer,s.newer?s.newer.older=s.older:r=s.older,s.older=null,s.newer=null;},i=s=>{s.older=r,s.newer=null,r?r.newer=s:n=s,r=s;};return {get(s){let c=t.get(s);if(c!==void 0)return c!==r&&(a(c),i(c)),c.value},set(s,c){let l=t.get(s);if(l){l.value=c,l!==r&&(a(l),i(l));return}let u={key:s,value:c,older:null,newer:null};for(t.set(s,u),i(u);t.size>e&&n;){let y=n;a(y),t.delete(y.key),o+=1;}},get size(){return t.size},get evictions(){return o}}}var or=/^[\p{L}\p{N}\p{M} \-.+_,;]{1,64}$/u;function ar(e=null){return e!=null&&typeof e.measureText=="function"}function ir(e={}){let t=e.scale??1;if(!(t>0)||!Number.isFinite(t))return null;let n=e.fallbackFamily??Et,r=e.context??null;if(!ar(r))return null;let o=r,a=rr(nr(e.maxWidthEntries,Ca)),i=rr(nr(e.maxMetricsEntries,Ea)),s=e.fontAlias,c=new Map,l=f=>{let p=c.get(f);if(p!==void 0)return p;let g="The quick brown fox 0123",h=false;for(let d of ["monospace","serif"]){o.font=`32px ${d}`;let S=o.measureText(g).width;if(o.font=`32px "${f}", ${d}`,o.measureText(g).width!==S){h=true;break}}return c.set(f,h),h},u=f=>{let p=f.fontFamily&&or.test(f.fontFamily)?f.fontFamily:null,g=p?s?.(p):void 0,h=g&&or.test(g)?g:null,d=Fa(p,n,e.serifHangulFace),S=p?h?`"${h}", "${p}", ${d}`:`"${p}", ${d}`:n,x=f.bold?"bold":"normal",R=f.italic?"italic":"normal",L=f.smallCaps?"small-caps":"normal",E=f.fontSizePt*ra$1(f)*t;return `${R} ${L} ${x} ${E}px ${S}`},y$1=(f,p,g)=>f/t*(g.horizontalScalePercent/100)+p.length*g.characterSpacingPt;return {measure(f,p){if(f.length===0)return 0;let g=u(p),h=y(p,f),d=`${g}\0${h}\0${f}`,S=a.get(d);if(S!==void 0)return y$1(S,f,p);o.font=g,"fontKerning"in o&&(o.fontKerning=h?"normal":"none");let x=o.measureText(f).width;return a.set(d,x),y$1(x,f,p)},inkBounds(f,p){if(!f||f.length>2||p.shaping?.direction==="rtl"||ya$1(f).length!==1)return;o.font=u(p),"fontKerning"in o&&(o.fontKerning=w$1(p)?"normal":"none");let g=o.textAlign,h=o.direction,d;try{g!==void 0&&(o.textAlign="left"),h!==void 0&&(o.direction="ltr"),d=o.measureText(f);}finally{g!==void 0&&(o.textAlign=g),h!==void 0&&(o.direction=h);}let S=d.actualBoundingBoxLeft,x=d.actualBoundingBoxRight;if(S===void 0||x===void 0||!Number.isFinite(S)||!Number.isFinite(x))return;let R=p.horizontalScalePercent/(100*t);return {left:-S*R,right:x*R}},textOutline(f,p){if(!f||p.shaping?.direction==="rtl")return;o.font=u(p),"fontKerning"in o&&(o.fontKerning=w$1(p)?"normal":"none");let g=o.textAlign,h=o.textBaseline,d;try{g!==void 0&&(o.textAlign="left"),h!==void 0&&(o.textBaseline="alphabetic"),d=o.measureText(f);}finally{g!==void 0&&(o.textAlign=g),h!==void 0&&(o.textBaseline=h);}let S=[-(d.actualBoundingBoxLeft??NaN),-(d.actualBoundingBoxAscent??NaN),d.actualBoundingBoxRight??NaN,d.actualBoundingBoxDescent??NaN].map(A=>A/t);if(S.some(A=>!Number.isFinite(A)))return;let[x,R,L,E]=S;if(!(!(L>x)||!(E>R)))return {path:null,ink:{left:x,top:R,right:L,bottom:E}}},lineMetrics(f){let p=f.fontSizePt*ra$1(f),g=u(f),h=i.get(g);if(h)return h;let d=Ct(f.fontFamily),S=d&&!l(d.family)&&Ue(f);if(S)return i.set(g,S),S;let x=p*1.15,R=p*.8;o.font=g,"fontKerning"in o&&(o.fontKerning=w$1(f)?"normal":"none");let L=o.measureText("Hxg"),E=L.fontBoundingBoxAscent,A=L.fontBoundingBoxDescent;if(typeof E=="number"&&Number.isFinite(E)&&E>0&&(R=E/t,typeof A=="number"&&Number.isFinite(A)&&A>=0)){let v=(E+A)/t;v>0&&(x=Math.max(v,x));}x>0||(x=p*1.15);let T={height:x,baseline:R};return i.set(g,T),T}}}function va(e=1,t={}){let n=ir({...t,scale:t.scale??e});return n?{measurer:n,producer:t.fontAlias?"canvas-measurer+embedded":"canvas-measurer"}:{measurer:ta$1(),producer:"fixed-measurer"}}function La(e){let t;return n=>{t===void 0&&(t=jd(e.pages)?.hosts??null);let r=t?.get(n);return r?hd(r.pageNumber,r.format):null}}function sr(e,t){let n=uf(e,t.displayMode??mb),r=Od({numberingIndex:t.numberingIndex,styleCascade:t.styleCascade},n).listItems,o=t.package?{footnotesPart:pj(t.package,"footnote"),endnotesPart:pj(t.package,"endnote")}:void 0,a=ie$1(n,r,o,t.package?fe$1(t.package,e,n):void 0,t.displayMode??mb);return {blocks:n,notes:o,context:a}}function cr(e,t,n,r,o){for(let a of t){if(r.length>=yn)return;if(n.tokenForParagraph(a.id)!==""&&Bn$1(e,a.id)===null)for(let i of An$1(a)){if(r.length>=yn)return;if(!i.rewritable)continue;let s=Wc(i.instruction);if(s===null)continue;let c=n.liveValueOf(i.fieldNodeId,s);if(c===null&&o&&n.pageRefProjectionOf){let l=n.pageRefProjectionOf(i.fieldNodeId,s);if(l){let u=o(l.targetParagraphId);u!==null&&u.length>0&&id(l.calibration,l.cached,u,Number.NaN)&&(c=u);}}c===null||c===i.cachedText||c.length>zn$1||c.includes("\r")||r.push({paragraphId:a.id,fieldNodeId:i.fieldNodeId,text:c});}}}function Ta(e,t){let{blocks:n,context:r}=sr(e,t);if(r===null)return null;let o=[];return cr(e,Zc(wc(n)),r,o,t.pageRefPageNumberOf),o.length===0?null:{op:"refreshFieldResults",updates:o}}function Is(e,t){let{notes:n,context:r}=sr(e,t);if(r===null||n===void 0)return [];let o=[],a=[{noteKind:"footnote",notesPart:n.footnotesPart},{noteKind:"endnote",notesPart:n.endnotesPart}];for(let{noteKind:i,notesPart:s}of a){if(!s)continue;let c=[];for(let l of ge$1(s,t.displayMode??mb)){if(c.length>=yn)break;cr(s,Zc(wc(l)),r,c);}c.length>0&&o.push({noteKind:i,op:{op:"refreshFieldResults",updates:c}});}return o}function Ba(e){return e.box}function lr(e,t){if(e.kind==="paragraph"){t.add(e.paragraphId);return}for(let n of e.rows)for(let r of n.cells)for(let o of r.blocks)lr(o,t);}function Oa(e){let t=new Map,n=(o,a,i)=>{if(!(o.kind==="textValue"||i>ec$1*4)){for(let s of o.children)if(s.kind!=="textValue"){if(s.kind==="paragraph"){for(let c of r)t.get(c)?.push(s.id);n(s,s.id,i+1);continue}if(s.kind==="contentControl"){t.set(s.id,[]),r.push(s.id);let c=oc(s);c&&n(c,a,i+1),r.pop();let l=t.get(s.id);l&&l.length===0&&a!==null&&l.push(a);continue}n(s,a,i+1);}}},r=[];return n(e,null,0),t}function Aa(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y);return {x:n,y:r,width:Math.max(e.x+e.width,t.x+t.width)-n,height:Math.max(e.y+e.height,t.y+t.height)-r}}function wa(e,t){let n=sc(e.root);if(n.length===0)return Ia;let r=new Map;t.pages.forEach((i,s)=>{(l=>{for(let u of l){let y=new Set;lr(u,y);for(let f of y){let p=r.get(f)??[];p.push({pageIndex:s,box:Ba(u)}),r.set(f,p);}}})(i.fragments);});let o=Oa(e.root),a=[];for(let i of n){let s=qc(i.node),c=[...i.ancestors.map(f=>qc(f).lock),s.lock],l=o.get(i.node.id)??[],u=new Map;for(let f of l)for(let p of r.get(f)??[]){let g=u.get(p.pageIndex);u.set(p.pageIndex,g?Aa(g,p.box):p.box);}let y=[...u.entries()].sort((f,p)=>f[0]-p[0]).map(([f,p])=>({pageIndex:f,...p}));a.push({controlId:i.node.id,type:s.type,level:rc(i.node),depth:i.depth,lock:s.lock,effectiveLock:vc(c),showingPlaceholder:s.showingPlaceholder,temporary:s.temporary,...s.tag===void 0?{}:{tag:s.tag},...s.alias===void 0?{}:{alias:s.alias},...s.id===void 0?{}:{id:s.id},...s.dataBinding===void 0?{}:{dataBinding:s.dataBinding},paragraphIds:l,fragments:y});}return a}var Ia=Object.freeze([]);var Ma=4096;function _a(e,t=0){if(!(e instanceof Uint8Array)||!Number.isSafeInteger(t)||t<0||e.byteLength<12)return;let n=new DataView(e.buffer,e.byteOffset,e.byteLength),r=(h,d)=>Number.isSafeInteger(h)&&Number.isSafeInteger(d)&&h>=0&&d>=0&&h<=e.length-d,o=h=>n.getUint16(h,false),a=h=>n.getUint32(h,false),i=0,s=false;if(a(0)===1953784678){s=true;let h=a(4),d=a(8);if(![65536,131072].includes(h)||!d||t>=d||!r(12,d*4))return;i=a(12+t*4);}else if(t!==0)return;if(!r(i,12)||![65536,1330926671,1953658213].includes(a(i)))return;let c=o(i+4);if(!c||c>Ma||!r(i+12,c*16))return;let l=new Map;for(let h=0;h<c;h++){let d=i+12+h*16,S=a(d),x=a(d+8),R=a(d+12);if(l.has(S)||!r(x,R))return;l.set(S,{offset:x,length:R});}let u=l.get(1751474532),y=l.get(1330851634);if(!u||u.length<20||!y||y.length<4)return;let f=o(u.offset+18),p=o(y.offset),g=n.getInt16(y.offset+2,false);if(!(f<16||f>16384||p>5||g<=0))return Object.freeze({faceIndex:t,collection:s,unitsPerEm:f,os2Version:p,xAvgCharWidth:g,averageAdvanceEm:g/f})}function ur(e,t=_a){if(typeof e!="function"||typeof t!="function")return;let n=new WeakMap;return r=>{if(!fc(r))return;let o;try{o=e(r);}catch{return}if(!o||typeof o!="object"||o.substitution!==null||o.family.trim().toLowerCase()!==r.fontFamily?.trim().toLowerCase()||typeof o.hash!="string"||!/^sha256:[0-9a-f]{64}$/u.test(o.hash)||!Number.isSafeInteger(o.faceIndex)||o.faceIndex<0)return;let a=n.get(o);if(a===void 0&&(a=t(o.bytes,o.faceIndex)??null,n.set(o,a)),!a)return;let i=r.fontSizePt*a.averageAdvanceEm/2;return Number.isFinite(i)&&i>=0&&i<=r.fontSizePt?i:void 0}}var K=(e,t)=>e[t]<<8|e[t+1],Q=(e,t)=>e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3]>>>0;function Pa(e,t){let n=(i,s)=>i>=0&&i+s<=e.length;if(!n(0,12))return null;let r=Q(e,0)===1953784678;if(r&&!n(12+t*4,4))return null;let o=r?Q(e,12+t*4):0;if(!n(o,12))return null;let a=K(e,o+4);for(let i=0;i<a;i+=1){let s=o+12+i*16;if(!n(s,16))return null;if(Q(e,s)!==1668112752)continue;let c=Q(e,s+8);if(!n(c,4))return null;let l=null,u=null,y=K(e,c+2);for(let f=0;f<y;f+=1){let p=c+4+f*8;if(!n(p,8))return null;let g=K(e,p),h=K(e,p+2),d=c+Q(e,p+4);if(!n(d,2)||!(g===0||g===3&&(h===1||h===10)))continue;let x=K(e,d);x===12&&u===null&&(u=d),x===4&&l===null&&(l=d);}return u!==null?{format:12,offset:u}:l!==null?{format:4,offset:l}:null}return null}function ka(e,t,n){let r=(u,y)=>u>=0&&u+y<=e.length,o=t.offset;if(t.format===12){if(!r(o,16))return false;let u=Q(e,o+12),y=0,f=Math.min(u,Math.floor((e.length-o-16)/12))-1;for(;y<=f;){let p=y+f>>>1,g=o+16+p*12,h=Q(e,g),d=Q(e,g+4);if(n<h)f=p-1;else if(n>d)y=p+1;else return Q(e,g+8)+(n-h)!==0}return false}if(n>65535||!r(o,14))return false;let a=K(e,o+6)>>>1,i=o+14,s=i+a*2+2,c=s+a*2,l=c+a*2;if(!r(l,a*2))return false;for(let u=0;u<a;u+=1){if(n>K(e,i+u*2))continue;let y=K(e,s+u*2);if(n<y)return false;let f=K(e,c+u*2),p=l+u*2,g=K(e,p);if(g===0)return (n+f&65535)!==0;let h=p+g+(n-y)*2;if(!r(h,2))return false;let d=K(e,h);return d!==0&&(d+f&65535)!==0}return false}var dr=new WeakMap;function pr(e,t){let n=i(e),r=dr.get(e);return r===void 0&&(r=Pa(n,e.faceIndex),dr.set(e,r)),r?ka(n,r,t):void 0}var fr=new WeakMap;function Na(e){let t=fr.get(e);if(t!==void 0)return t;let n=i(e),r=new DataView(n.buffer,n.byteOffset,n.byteLength),o=false,a=r.getUint32(0)===1953784678?r.getUint32(12+e.faceIndex*4):0,i$1=r.getUint16(a+4);for(let s=0;s<i$1;s++){let c=a+12+s*16;if(r.getUint32(c)!==1330851634)continue;let l=r.getUint32(c+8),u=r.getUint32(c+12);u>=86&&l<=n.byteLength-u&&r.getUint16(l)>=1&&(o=(r.getUint32(l+78)&1966080)!==0);break}return fr.set(e,o),o}var mr=1.3;function yr(e,t,n,r,o,a=false){let i=n.height-r;if(!(Math.abs(i-t)<=o)&&!a||!Na(e))return n;let c=a?i*mr:Math.max(n.height,t*mr),l=n.baseline-r;return {height:c,baseline:l+(c-i)/2}}var za=.89111328125,Da=443/2048,Ha=87/2048,Ga=1/2048,Ua=new Set(["Arab","Hebr","Syrc","Thaa","Nkoo"]);function hr(e){return e.latinLane===void 0&&!Ua.has(e.shaping?.script??"")}function gr(e,t,n,r,o,a=true){if(!a||r!==0||!(o>0)||e.trim().toLowerCase()!=="times new roman")return r;let i=(s,c)=>Math.abs(s/o-c)<=Ga;return i(t,za)&&i(n,Da)?Ha*o:r}var Ka=.5;function Wa(e,t){if(t.fontFamily===null)return false;let n=e.substitution;return n!==null&&(n.lineMetrics!==void 0||!me$1(n.requested.family,n.resolved.family))?false:e.family===t.fontFamily||me$1(e.family,t.fontFamily)}function Sr(e,t,n,r,o){let a=new WeakMap;return (i,s)=>{let c=ra$1(s),l=a.get(i);l||(l=new Map,a.set(i,l));let u=z(s),y=hr(s),f=Wa(i,s),p=(y?u:-u)+(f?Ka:0),g=l.get(p);if(g)return c===1?g:{height:g.height*c,baseline:g.baseline*c};let h,d=true,S=i.substitution?.lineMetrics;if(S){let x=u/2;h={height:S.heightEm*x,baseline:S.baselineEm*x};}else try{let x=j(e,t,i,s,""),R=x.metrics.ascent/t.fixedPointScale,L=x.metrics.descent/t.fixedPointScale,E=u/2,A=R+L,T=E*r,v=A>T?T/A:1,O=A*v,_=x.metrics.lineGap/t.fixedPointScale,b=Math.min(Math.max(0,gr(i.family,R,L,_,E,y)),O*o),m=O+b;m>0?h=yr(i,E,{height:m,baseline:R*v+b},b,2/t.fixedPointScale,f):(h=n.lineMetrics(s),d=!1);}catch{h=n.lineMetrics(s),d=false;}return d?(l.set(p,h),c===1?h:{height:h.height*c,baseline:h.baseline*c}):h}}var vt=2048,Va=32,ja=new Map([["symbol",{ascent:2059,descent:450,advances:[512,682,1460,1024,1124,1706,1593,899,682,682,1024,1124,512,1124,512,569,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,569,569,1124,1124,1124,909,1124,1479,1366,1479,1253,1251,1563,1235,1479,682,1292,1479,1405,1821,1479,1479,1573,1518,1139,1212,1251,1413,899,1573,1321,1628,1251,682,1767,682,1348,1024,1024,1292,1124,1124,1012,899,1067,842,1235,674,1235,1124,1124,1180,1067,1124,1124,1067,1124,1235,899,1180,1460,1405,1010,1405,1012,983,410,983,1124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1270,506,1124,342,1460,1024,1542,1542,1542,1542,2134,2021,1235,2021,1235,819,1124,842,1124,1124,1460,1012,942,1124,1124,1124,1124,2048,1235,2048,1348,1686,1405,1628,2021,1573,1573,1686,1573,1573,1460,1460,1460,1460,1460,1460,1460,1573,1460,1618,1618,1823,1686,1124,512,1460,1235,1235,2134,2021,1235,2021,1235,1012,674,1618,1618,1610,1460,786,786,786,786,786,786,1012,1012,1012,1012,0,674,561,1405,1405,1405,786,786,786,786,786,786,1012,1012,1012,0]}],["wingdings",{ascent:1841,descent:432,advances:[2048,2110,2344,2665,2752,1830,2492,938,2220,1826,2319,2319,2399,2399,2951,2956,2245,2751,1431,1431,1826,1135,1233,2196,1941,2208,1924,1825,1826,1826,1825,1863,1863,1203,1624,1381,1381,1929,1929,1124,1124,1826,1727,1727,1727,2275,1352,1739,2230,1819,1803,1332,1665,1529,1529,1480,1420,1627,1813,1826,1834,1825,2368,2159,1974,2233,1927,1911,1937,2099,1902,2245,2181,1597,2150,2603,1529,1951,1529,1825,1825,1825,1825,937,1529,2020,1825,1183,2171,2171,1825,1826,1826,1086,1086,0,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,2048,2048,2048,2048,2048,2048,2048,2048,641,937,641,1825,1825,1825,1825,1825,1951,937,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2146,2146,2146,2146,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2566,2566,1627,1627,1825,1825,1825,1825,1825,1825,2006,2006,1825,1825,1589,1589,1589,1589,2186,2186,1825,1825,1787,1787,1787,1787,1825,1825,1660,1660,2171,1660,1601,1601,1601,1601,987,789,1301,1609,1826,1826,2119]}],["wingdings 2",{ascent:1727,descent:432,advances:[2048,2110,2090,2073,2086,2344,2045,2220,989,1431,1431,1826,1431,1431,1826,1431,1431,1826,1431,1431,2320,2246,1826,1826,1826,2320,2170,2170,1381,1381,1938,1938,1938,1938,1928,1928,1928,1928,1047,1047,1047,1047,1178,1178,1178,1178,1826,1321,1568,1826,1826,1826,1826,1825,1825,1826,1826,2226,1727,1548,1579,984,1035,864,1018,2048,2048,2048,2048,2048,2048,2048,2048,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,1826,0,1899,1899,1453,1453,1673,1332,1431,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2048,2048,542,740,1135,1825,1825,1825,1825,1825,1825,1825,542,740,1135,1825,1825,1825,1825,1825,1825,1825,1825,1825,624,764,903,1461,2020,2020,2020,2020,2020,542,641,740,1135,1529,1529,1085,1085,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1496,1825,0,0,0,0,0,0]}],["wingdings 3",{ascent:1900,descent:432,advances:[2048,1825,1825,1135,1135,1444,1444,1444,1444,1825,1825,1135,1135,1677,1677,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1135,1825,1825,1455,1455,1455,1455,2010,2010,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,2220,1825,1751,1114,1115,1660,1660,1930,1930,1930,1930,1924,1924,1924,1924,1930,1930,1931,1931,1825,1825,1232,1232,1444,1444,1444,1444,1825,1232,2005,2005,2005,2005,1801,1801,1801,1801,1801,1801,1801,1801,1085,1085,1825,0,1825,1825,1825,1825,1825,1627,1627,1825,1825,1825,1825,789,789,1825,1825,987,987,1825,1825,1184,1184,1825,1825,1579,1579,1825,1825,888,888,1825,1825,1381,1381,1825,1825,1875,1875,1825,1825,1825,1825,1825,1825,1825,789,592,493,394,1825,1825,1825,1825,1825,1085,1085,1381,1381,1628,1628,1184,1184,900,900,1825,1825,1019,1019,1825,1825,1825,1825,1825,1825,1825,1825,1825,1825,1291,1291,1291,1291,1961,1961,1825,1825,1540,1540,1540,1540,2096,2096,1825,1825,1688,1688,1688,1688,2277,2277,1825,1825,1885,1885,1885,1885,543,543,1234,1234,766,766,1234,1234,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}],["webdings",{ascent:1638,descent:410,advances:[1024,2048,2048,2048,2048,2028,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1100,1100,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1144,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,0,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2500,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,1377,1377,2048,1726,1058,2048,2048,2048,2048,877,1240,2048,2048,2048,2048,1357,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2048,2645,2048,2048,2048,2048]}]]);function Xa(e){if(b$1(e))return ja.get(e.toLowerCase())}function xr(e,t,n,r){let o=z(r)/2*ra$1(r)*(r.horizontalScalePercent/100)/vt,a=[];for(let i=0;i<n.length;i++){let s=c$2(n.charCodeAt(i),t),c=s===null?0:e.advances[s-Va]??0;if(c===0)return;a.push(c*o+r.characterSpacingPt);}return a}function br(e){let t=new WeakMap,n=r=>{let o=t.get(r);return o===void 0&&(o=Xa(r.fontFamily)??null,t.set(r,o)),o};return {...e,measure(r,o){let a=n(o),i=a&&xr(a,o.fontFamily,r,o);if(!i)return e.measure(r,o);let s=0;for(let c of i)s+=c;return s},caretAdvances(r,o){let a=n(o),i=a&&xr(a,o.fontFamily,r,o);if(!i)return e.caretAdvances?.(r,o);let s=[0];for(let c of i)s.push(s[s.length-1]+c);return s},lineMetrics(r,o){let a=n(r);if(!a)return e.lineMetrics(r,o);let i=z(r)/2*ra$1(r);return {height:(a.ascent+a.descent)*i/vt,baseline:a.ascent*i/vt}}}}var Ya={M:2,L:2,Q:4,C:6,Z:0},Rr=e=>{let t=Math.round(e*1e3)/1e3;return String(Object.is(t,-0)?0:t)};function Lt(e,t,n){if(!(t>0)||!(n>0))return;let r=[],o=0,a=1/0,i=-1/0,s=1/0,c=-1/0;for(let l of e.glyphs){if(l.id===0)return;let u=l.outline.path,y=l.outline.unitsPerEm;if(!u)continue;if(!(y>0)||!u.startsWith("M")||/[^MLQCZ0-9eE+.,\s-]/u.test(u))return;let f=t*(l.drawScale??1)/y,p=(l.originX+l.offsetX)/n,g=(l.originY+l.offsetY)/n;for(let h of u.matchAll(/([MLQCZ])([^MLQCZ]*)/gu)){let d=h[1],S=h[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(S.length!==Ya[d]||S.some(R=>!Number.isFinite(R)))return;let x=d;for(let R=0;R<S.length;R+=2){let L=p+S[R]*f,E=-(g+S[R+1]*f);a=Math.min(a,L),i=Math.max(i,L),s=Math.min(s,E),c=Math.max(c,E),x+=`${R?" ":""}${Rr(L)} ${Rr(E)}`;}if(o+=x.length,o>2e6)return;r.push(x);}}if(!(!r.length||!(i>a)||!(c>s)))return Object.freeze({path:r.join(""),ink:Object.freeze({left:a,top:s,right:i,bottom:c})})}var Tt=new WeakMap;function $a(e){let t=Tt.get(e);if(t!==void 0)return t??void 0;let n=e.path;if(!n.startsWith("M")||n.length>1e6||/[^MLQCZ0-9eE+.,\s-]/u.test(n))return;let r=1/0,o=-1/0,a=n.matchAll(/([MLQCZ])([^MLQCZ]*)/gu);for(let s of a){let c=s[1]==="Z"?0:s[1]==="C"?6:s[1]==="Q"?4:2,l=s[2].trim().split(/[\s,]+/u).filter(Boolean).map(Number);if(l.length!==c||l.some(u=>!Number.isFinite(u))){Tt.set(e,null);return}for(let u=0;u<l.length;u+=2)r=Math.min(r,l[u]),o=Math.max(o,l[u]);}let i=Number.isFinite(r)&&Number.isFinite(o)?{left:r,right:o}:void 0;return Tt.set(e,i??null),i}function Fr(e,t,n,r){if(e.clusters.length!==1||e.glyphs.length===0)return;let o=1/0,a=-1/0;for(let s of e.glyphs){if(s.id===0)return;let c=$a(s.outline),l=s.outline.unitsPerEm;if(!c||!(l>0))return;let u=(s.originX+s.offsetX)/n;o=Math.min(o,u+c.left*t*(s.drawScale??1)/l),a=Math.max(a,u+c.right*t*(s.drawScale??1)/l);}let i={left:o*r,right:a*r};return Number.isFinite(i.left)&&Number.isFinite(i.right)?i:void 0}function qa(e,t,n){if(t<12)return null;if(e.getUint32(0)!==1953784678)return 0;let o=12+(Number.isSafeInteger(n)&&n>0?n:0)*4;if(o+4>t)return null;let a=e.getUint32(o);return a+12<=t?a:null}function Cr(e,t,n,r,o){let a=e.getUint16(n+4);if(a>4096||n+12+a*16>t)return null;for(let i=0;i<a;i+=1){let s=n+12+i*16;if(e.getUint32(s)!==r)continue;let c=e.getUint32(s+8),l=e.getUint32(s+12);return l<o||c+l>t?null:c}return null}function Er(e,t){let n=e.byteLength,r=new DataView(e.buffer,e.byteOffset,n),o=qa(r,n,t);if(o===null)return null;let a=Cr(r,n,o,1751474532,54);if(a===null)return null;let i=r.getUint16(a+18);if(i<=0)return null;let s=Cr(r,n,o,1330851634,30);if(s===null)return null;let c=r.getInt16(s+26)/i,l=r.getInt16(s+28)/i;return !(c>0)||c>1||!(Math.abs(l)<=1)?null:{offsetEm:l,thicknessEm:c}}var Ke=.02;function Bt(e,t){return e.bold===true&&t.request.weight<600}function vr(e){return e.advanceX>0&&e.outline.path.length>0}function Lr(e){let t=0;for(let n of e.glyphs)vr(n)&&t++;return t}function Tr(e,t,n){if(n<=0)return e;let r=new Array(e.length).fill(0);for(let a of t.glyphs){if(!vr(a))continue;let i=Math.min(Math.max(a.cluster+1,1),e.length-1);r[i]+=n;}let o=0;return e.map((a,i)=>(o+=r[i],a+o))}var Za=.5,Ja=4096,Qa=4,Br=4096;function Or(e){let t="environment"in e?e.environment:void 0,n="environment"in e?void 0:e,{shaper:r,resolveFont:o}=e,a=br(e.fallback),i=t??{shapingLibrary:n.shapingLibrary,unicodeDataVersion:n.unicodeDataVersion,script:n?.script??"Latn",fixedPointScale:n?.fixedPointScale??1e3,normalization:n?.normalization??"none",features:n?.features??{},roundingMode:n?.roundingMode??"halfToEven",language:n?.language??"en",variationAxes:{}},s=new WeakMap,c=new WeakMap,l=q$1(r),u=Sr(r,i,a,Qa,Za),y=new WeakMap,f=new WeakMap,p=new Array(Br),g=0,h=(b,m,F)=>{let C=p[g];C&&C.cache.delete(C.text),b.set(m,F),p[g]={cache:b,text:m},g=(g+1)%Br;},d=b=>{let m=y.get(b);if(m!==void 0)return m;let F=o(b);return y.set(b,F),F},S=ur(d),x=(b,m,F)=>{let C=F?c:s,B=C.get(b);B||(B=new Map,C.set(b,B));let I=B.get(m);return I||(I=new Map,B.set(m,I)),I},R=new WeakMap,L=b=>{if(!b.shaping?.wordSpacingPt)return b;let m=R.get(b);return m||(m={...b,shaping:{...b.shaping,wordSpacingPt:void 0}},R.set(b,m)),m},E=(b,m)=>m.shaping?.wordSpacingPt?cc(b)*m.shaping.wordSpacingPt:0,A=(b,m)=>a.measure(b,L(m))+E(b,m),T=(b,m)=>{let F=Math.max(0,a.measure(b,L(m))),C=a.caretAdvances?.(b,L(m))??ac(b,F);if(!C||C.length!==b.length+1)return ac(b,A(b,m));let B=Math.max(0,A(b,m)),I=0,P=0;return C.map((N,D)=>{if(D===0)return 0;b[D-1]===" "&&P++;let M=N+P*(m.shaping?.wordSpacingPt??0);return I=Math.max(I,Math.min(B,Number.isFinite(M)?M:I)),D===b.length?B:I})},v=new WeakMap,O$1=new WeakMap;return ec({hasResolvedFont(b){return d(b)!==null},faceCovers(b,m){let F=d(m);if(!F)return;let C=O$1.get(F);C||(C=new Map,O$1.set(F,C));let B=C.get(b);if(B!==void 0)return B;let I=true;for(let P of b){let N=pr(F,P.codePointAt(0));if(N===void 0)return;if(!N){I=false;break}}return C.size<Ja&&C.set(b,I),I},strikeoutMetrics(b){let m=d(b);if(!m)return;let F=v.get(m);if(F===void 0&&(F=Er(m.bytes,m.faceIndex),v.set(m,F)),!F)return;let C=z(b)/2*ra$1(b);return {offsetPt:F.offsetEm*C,thicknessPt:F.thicknessEm*C}},measure(b,m){if(b.length===0)return 0;let F=d(m);if(!F)return A(b,m);let C=x(F,z(m),m.smallCaps),B=m.shaping?.context,I=m.shaping?`1:${JSON.stringify(B?[m.shaping.script,m.shaping.direction,b,B.before,B.after]:[m.shaping.script,m.shaping.direction,b])}`:`0:${b}`,P=Bt(m,F),N=`${w$1(m)?1:0}:${P?1:0}:${O(m)}:${I}`,D=C.get(N);if(D===void 0){let M=0;try{if(m.smallCaps&&!Ge(r,i,F,m,f))return A(b,m);let G=j(r,i,F,m,b);if(G.glyphs.some(ee=>ee.id===0))return A(b,m);for(let ee of G.glyphs)M+=ee.advanceX;P&&(M+=Lr(G)*(z(m)/2)*.02*i.fixedPointScale);}catch{return A(b,m)}D=M/i.fixedPointScale,h(C,N,D);}return D*ra$1(m)*(m.horizontalScalePercent/100)+b.length*m.characterSpacingPt+E(b,m)},inkBounds(b,m){if(!b||b.length>2||m.shaping?.direction==="rtl"||ya$1(b).length!==1)return;let F=d(m);if(!F)return a.inkBounds?.(b,m);try{if(m.smallCaps&&!Ge(r,i,F,m,f))return a.inkBounds?.(b,m);let C=j(r,i,F,m,b);return Fr(C,z(m)/2,i.fixedPointScale,ra$1(m)*m.horizontalScalePercent/100)}catch{return}},textOutline(b,m){let F=d(m);if(!F)return a.textOutline?.(b,m);try{let C=j(r,i,F,m,b);return Lt(C,z(m)/2,i.fixedPointScale)??a.textOutline?.(b,m)}catch{return a.textOutline?.(b,m)}},caretAdvances(b,m){let F=d(m);if(!F)return T(b,m);try{if(m.smallCaps&&!Ge(r,i,F,m,f))return T(b,m);let C=j(r,i,F,m,b);if(C.glyphs.some(P=>P.id===0))return T(b,m);let B=bc(b,C,ra$1(m)*(m.horizontalScalePercent/100)/i.fixedPointScale,m.characterSpacingPt,m.shaping?.wordSpacingPt??0)??ac(b,C.glyphs.reduce((P,N)=>P+N.advanceX,0)*ra$1(m)*(m.horizontalScalePercent/100)/i.fixedPointScale+b.length*m.characterSpacingPt+E(b,m));if(!B||!Bt(m,F))return B;let I=z(m)/2*.02*ra$1(m)*(m.horizontalScalePercent/100);return Tr(B,C,I)}catch{return T(b,m)}},lineMetrics(b,m){let F=d(b);if(!F)return Ue(b)??a.lineMetrics(b,m);if(!m||/^[\t\n\r\f ]*$/.test(m))return u(F,b);if(l){let C=u(F,b),B=Math.max(0,C.baseline),I=Math.max(0,C.height-C.baseline);return B+I>0?{height:B+I,baseline:B}:C}try{let C=j(r,i,F,b,m),B=0,I=0;for(let P of C.fontSpans){let N=u(P.font,b);B=Math.max(B,N.baseline),I=Math.max(I,N.height-N.baseline);}if(B+I>0)return {height:B+I,baseline:B}}catch{}return u(F,b)}},S)}function ei(e,t){return Or({...t,shaper:e.shaper,environment:e.environment})}function ti(e){let{layout:t,viewport:n}=e,r=new Set;if(!n){for(let c of t.pages)r.add(c.index);return r}let o=Math.max(0,Math.trunc(e.overscanPages??1)),a=n.top+n.height,i=-1,s=-1;for(let c of t.pages){let l=c.box.y;l+c.box.height>=n.top&&l<=a&&(i===-1&&(i=c.index),s=c.index);}if(i===-1){let c=ni(t,n.top);c!==null&&(i=c,s=c);}if(i!==-1){let c=Math.max(0,i-o),l=Math.min(t.pages.length-1,s+o);for(let u=c;u<=l;u+=1)r.add(u);}for(let c of e.pinnedPages??[])c>=0&&c<t.pages.length&&r.add(c);return r}function ni(e,t){let n=null,r=Number.POSITIVE_INFINITY;for(let o of e.pages){let a=t<o.box.y?o.box.y-t:t>o.box.y+o.box.height?t-(o.box.y+o.box.height):0;a<r&&(r=a,n=o.index);}return n}var Ar=["text-local","paragraph-local","flow-structural","global"];function wr(e,t){return Ar.indexOf(t)>Ar.indexOf(e)?t:e}function ri(e){return {impact:"text-local",paragraphIds:new Set,created:new Set,deleted:new Set,dependencyKeys:new Set,structural:false,revision:e}}function oi(e){let{run:t,currentRevision:n,publish:r,schedule:o}=e,a=null,i=null,s=null,c=0,l=0;function u(d){let S=e.runCooperatively;if(!S)return t(d);let x=S(d);s=x;try{for(;;){let R=x.step();if(R)return R;if(n()!==d.revision)return x.cancel(),l+=1,null;if(s!==x)return null}}finally{s===x&&(s=null);}}function y(d){let S=p(n());S.impact=wr(S.impact,d.impact),S.structural=S.structural||d.structural;for(let x of d.paragraphIds)S.paragraphIds.add(x);for(let x of d.created)S.created.add(x);for(let x of d.deleted)S.deleted.add(x);for(let x of d.dependencyKeys)S.dependencyKeys.add(x);}let f=d=>({impact:d.impact,paragraphIds:d.paragraphIds,created:d.created,deleted:d.deleted,dependencyKeys:d.dependencyKeys,structural:d.structural,revision:d.revision});function p(d){return a||(a=ri(d)),a.revision=Math.max(a.revision,d),a}function g(){!o||i||(i=o(()=>{i=null,h();}));}function h(){i&&(i(),i=null),s&&(s.cancel(),s=null,l+=1);let d=a;if(!d)return false;a=null;let S=f(d),x=u(S);return !x||x.revision!==n()?(c+=1,y(S),g(),false):(r(x,S),true)}return {notify(d){let S=p(n());S.impact=wr(S.impact,d.impact);for(let x of d.dirty)S.paragraphIds.add(x);for(let x of d.created)S.created.add(x),S.paragraphIds.add(x);for(let x of d.deleted)S.deleted.add(x),S.paragraphIds.add(x);for(let x of d.dependencyKeys)S.dependencyKeys.add(x);for(let x of d.splitJoin)S.structural=true,"split"in x?(S.paragraphIds.add(x.split.from),S.paragraphIds.add(x.split.tail)):(S.paragraphIds.add(x.join.kept),S.paragraphIds.add(x.join.removed));(d.impact==="flow-structural"||d.impact==="global")&&(S.structural=true),g();},invalidateAll(d,S){let x=p(d);x.impact="flow-structural",x.structural=true,S&&x.dependencyKeys.add(S),g();},flush:h,pending:()=>a?f(a):null,cancel(){i?.(),i=null,s?.cancel(),s=null,a=null;},get staleDiscards(){return c},get cancelledRuns(){return l}}}var Ir=new WeakMap;function X(e){let t=Ir.get(e);if(t)return t;let n=new Map,r=new Map,o=new Map,a=new Map,i=(c,l,u,y)=>{for(let f of c){if(f.kind==="paragraph")continue;let p=f.tableId;a.set(p,Math.max(a.get(p)??0,(f.columnEdges?.length??1)-1));let g=o.get(p);g||(g=new Map,o.set(p,g),n.set(p,[]),r.set(p,new Map));for(let h of f.rows){let d=g.get(h.id);d===void 0&&(d=g.size,g.set(h.id,d),r.get(p).set(d,h.cells));for(let S of h.cells)n.get(p).push({pageIndex:l,tableId:p,row:h,cell:S,rowIndex:d,isHeaderRepeat:h.isHeaderRepeat,offsetX:u,offsetY:y}),i(S.blocks,l,u,y);}}};for(let c of e.pages){i(c.fragments,c.index,0,0);for(let l of [c.header,c.footer])l&&i(l.fragments,c.index,l.box.x-c.contentBox.x,l.box.y-c.contentBox.y);for(let l of [c.footnotes,c.endnotes])if(l)for(let u of l.notes)i(u.fragments,c.index,u.box.x-c.contentBox.x,u.box.y-c.contentBox.y);}let s=new Map;for(let[c,l]of n)s.set(c,{placed:l,rows:r.get(c)??new Map,columnCount:a.get(c)??0});return Ir.set(e,s),s}function _r(e){let t=e.columnCount;for(let n of e.rows.values())for(let r of n)t=Math.max(t,ne(r).to+1);return t}var ne=e=>({from:e.gridColumn,to:e.gridColumn+Math.max(1,e.gridSpan)-1});function ai(e,t,n){if(t.tableId!==n.tableId)return null;let r=X(e).get(t.tableId);if(!r)return null;let o=Math.min(t.rowIndex,n.rowIndex),a=Math.max(t.rowIndex,n.rowIndex),i=Math.min(ne(t).from,ne(n).from),s=Math.max(ne(t).to,ne(n).to),c=p=>{let{from:g,to:h}=ne(p);return h>=i&&g<=s},l=p=>(r.rows.get(p)??[]).some(g=>g.vMergeContinue&&c(g)),u=r.rows.size+_r(r)+2;for(let p=0;!(p>u);p+=1){let g=false;for(let[h,d]of r.rows)if(!(h<o||h>a))for(let S of d){if(!c(S))continue;let{from:x,to:R}=ne(S);x<i&&(i=x,g=true),R>s&&(s=R,g=true);}for(;o>0&&l(o);)o-=1,g=true;for(;l(a+1);)a+=1,g=true;if(!g)break}let y=[],f=new Set;for(let p of r.placed){if(p.isHeaderRepeat||p.rowIndex<o||p.rowIndex>a)continue;let{from:g,to:h}=ne(p.cell);h<i||g>s||f.has(p.cell.id)||(f.add(p.cell.id),y.push(p.cell.id));}return y.length===0?null:{kind:"cells",tableId:t.tableId,cellIds:y,rows:{from:o,to:a},columns:{from:i,to:s},text:kr(e,t.tableId,y)}}function ii(e,t){let n=X(e).get(t);if(!n)return null;let r=[],o=new Set,a=0;for(let i of n.placed)i.isHeaderRepeat||o.has(i.cell.id)||(o.add(i.cell.id),r.push(i.cell.id),a=Math.max(a,i.rowIndex));return r.length===0?null:{kind:"cells",tableId:t,cellIds:r,rows:{from:0,to:a},columns:{from:0,to:_r(n)-1},text:kr(e,t,r)}}function Tc(e,t){let n=ii(e,t.tableId);if(!n)return false;let r=new Set(t.cellIds);return n.cellIds.every(o=>r.has(o))}function Bc(e,t){return Pr(e,t,true)}function ge(e,t){return Pr(e,t,false)}function Pr(e,t,n){let r=new Set(t),o=[],a=new Set;for(let i of X(e).values())for(let s of i.placed)if(!(s.isHeaderRepeat||!r.has(s.cell.id)))for(let c of s.cell.blocks)n&&c.kind!=="paragraph"||Se(c,o,a);return o}function Se(e,t,n){if(e.kind==="paragraph"){for(let r of ab(e))n.has(r)||(n.add(r),t.push(r));return}for(let r of e.rows)if(!r.isHeaderRepeat)for(let o of r.cells)for(let a of o.blocks)Se(a,t,n);}function kr(e,t,n){let r=ge(e,n),o=r[0],a=r[r.length-1];return !o||!a?si(e,t):{anchor:{paragraphId:o,offset:0},head:{paragraphId:a,offset:Ue$1(e,a).length}}}function si(e,t){let n=X(e).get(t);for(let o of n?.placed??[]){if(o.isHeaderRepeat)continue;let a=[];for(let s of o.cell.blocks)Se(s,a,new Set);let i=a[0];if(i){let s={paragraphId:i,offset:0};return {anchor:s,head:s}}}for(let o of e.pages)for(let a of Ja$1(o)){let i={paragraphId:a.paragraphId,offset:0};return {anchor:i,head:i}}let r={paragraphId:"",offset:0};return {anchor:r,head:r}}function ci(e){let t=[...Ja$1(e)];for(let n of [e.header,e.footer])n&&t.push(...Ka$1(n.fragments));for(let n of [e.footnotes,e.endnotes])if(n)for(let r of n.notes)t.push(...Ka$1(r.fragments));return t}function li(e,t){let n=new Set(ge(e,t)),r=[],o=new Set;for(let a of e.pages)for(let i of ci(a))if(n.has(i.paragraphId))for(let s of i.lines)for(let c of s.spans){let l=`${c.range.paragraphId}:${c.range.start}:${c.range.end}`;o.has(l)||(o.add(l),r.push(c));}return r}function ui(e,t){let n=new Set(t),r=[];for(let o of X(e).values())for(let a of o.placed)n.has(a.cell.id)&&r.push({pageIndex:a.pageIndex,x:a.cell.box.x+a.offsetX,y:a.cell.box.y+a.offsetY,width:a.cell.box.width,height:a.cell.box.height});return r}function di(e,t,n=Ue$1){let r=X(e).get(t.tableId);if(!r)return "";let o=new Set(t.cellIds),a=r.placed.some(c=>c.cell.logicalGridColumn!==void 0),i=new Map,s=new Set;for(let c of r.placed){if(c.isHeaderRepeat||!o.has(c.cell.id)||s.has(c.cell.id))continue;s.add(c.cell.id);let l=ge(e,[c.cell.id]).map(f=>n(e,f)).join(`
2
2
  `),u=i.get(c.rowIndex),y=c.cell.gridColumn+(a?Math.max(1,c.cell.gridSpan)-1:0);u?u.set(y,l):i.set(c.rowIndex,new Map([[y,l]]));}return [...i.keys()].sort((c,l)=>c-l).map(c=>{let l=i.get(c),u=[];for(let y=0;y<=t.columns.to-t.columns.from;y+=1){let f=a?t.columns.to-y:t.columns.from+y;u.push(l.get(f)??"");}return u.join(" ")}).join(`
3
3
  `)}function Ot(e,t){return dd(e,t)}function Oc(e,t,n){if(n){let a=Ot(e,t);if(!a||a.tableId!==n.tableId)return null;let i=n.cellIds[0];if(!i)return null;let s=X(e).get(n.tableId);if(!s)return null;for(let c of s.placed)if(c.cell.id===i)return {tableId:n.tableId,rowId:c.row.id,cellId:i,cellIds:n.cellIds,gridColumnIndex:c.cell.logicalGridColumn??c.cell.gridColumn,isHeaderRepeat:c.isHeaderRepeat};return null}let r=Ot(e,t);if(!r)return null;let o=X(e).get(r.tableId);if(!o)return null;for(let a of o.placed){if(a.isHeaderRepeat)continue;let i=[];for(let s of a.cell.blocks)Se(s,i,new Set);if(i.includes(t))return {tableId:r.tableId,rowId:a.row.id,cellId:a.cell.id,cellIds:[a.cell.id],gridColumnIndex:a.cell.logicalGridColumn??a.cell.gridColumn,isHeaderRepeat:a.row.isHeaderRepeat}}return null}var Mr=new WeakMap;function pi(e,t){let n=Mr.get(e);if(n)return n.get(t)??null;let r=new Map;for(let[o,a]of X(e))for(let i of a.placed){if(i.isHeaderRepeat)continue;let s=[];for(let l of i.cell.blocks)Se(l,s,new Set);let c={tableId:o,rowId:i.row.id,cellId:i.cell.id,rowIndex:i.rowIndex,gridColumn:i.cell.gridColumn,gridSpan:i.cell.gridSpan};for(let l of s){let u=r.get(l);u&&u.tableId.length>=o.length||r.set(l,c);}}return Mr.set(e,r),r.get(t)??null}function Ac(e,t,n){let r=pi(e,t);if(!r)return null;let o=X(e).get(r.tableId);if(!o)return null;let a=new Set;for(let l of o.placed)!l.isHeaderRepeat&&!l.cell.vMergeContinue&&l.cell.blocks.length>0&&a.add(l.cell.id);let i=[...a],s=i.indexOf(r.cellId);if(s<0)return null;let c=n==="next"?1:-1;for(let l=s+c;l>=0&&l<i.length;l+=c){let u=ge(e,[i[l]]);if(u.length>0)return {cellId:i[l],paragraphIds:u}}return "end"}function fi(e,t,n){if(![e,t,n].every(Number.isFinite)||t<=0||n<=0)return {offsetPt:0,count:0};let r=Math.ceil(e/n-1e-9)*n;if(!Number.isFinite(r))return {offsetPt:0,count:0};let o=Math.max(0,r-e);return {offsetPt:o,count:Math.min(8192,Math.max(0,Math.floor((t-o)/n+1e-9)))}}export{Ta as $,Gn as A,Un as B,Kn as C,Wn as D,Vn as E,jn as F,qo as G,Zo as H,le as I,ea as J,Rt as K,$n as L,ia as M,la as N,j as O,Ge as P,Ct as Q,ps as R,tr as S,fs as T,Et as U,Fa as V,Rs as W,ar as X,ir as Y,va as Z,La as _,ct as a,Is as aa,ie as b,wa as ba,ut as c,Lt as ca,Gr as d,Ke as da,w as e,Or as ea,dt as f,ei as fa,mt as g,ti as ga,Ai as h,oi as ha,On as i,ai as ia,An as j,ii as ja,Z as k,Tc as ka,zo as l,Bc as la,Do as m,ge as ma,Ui as n,li as na,ht as o,ui as oa,Ki as p,di as pa,Ho as q,Ot as qa,Uo as r,Oc as ra,Wi as s,pi as sa,Ko as t,Ac as ta,gt as u,fi as ua,ze as v,Wo as w,Vo as x,jo as y,xt as z};