@docx-editor.dev/core 2.12.0 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/README.md +18 -14
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.cts +5 -5
  4. package/dist/automation.d.ts +5 -5
  5. package/dist/automation.js +1 -1
  6. package/dist/binding.cjs +1 -1
  7. package/dist/binding.d.cts +8 -8
  8. package/dist/binding.d.ts +8 -8
  9. package/dist/binding.js +1 -1
  10. package/dist/chunk-2PIHW2QM.cjs +1 -0
  11. package/dist/chunk-2QTY5S6T.js +1 -0
  12. package/dist/chunk-4Z5MODAE.cjs +2 -0
  13. package/dist/chunk-5TKAPFZT.cjs +2 -0
  14. package/dist/chunk-DRQHIQ4R.cjs +1 -0
  15. package/dist/chunk-F2K6SDHA.cjs +20 -0
  16. package/dist/chunk-FBA57EUJ.js +2 -0
  17. package/dist/{chunk-XCFM3G5L.cjs → chunk-KIAP7PFQ.cjs} +1 -1
  18. package/dist/chunk-KTAQ7BRQ.js +20 -0
  19. package/dist/chunk-LBAHXZCU.cjs +5 -0
  20. package/dist/chunk-MCDUQYWP.js +5 -0
  21. package/dist/chunk-MQP26KCF.js +1 -0
  22. package/dist/chunk-NDJGSR6M.cjs +19 -0
  23. package/dist/chunk-NJNFJPGB.cjs +11 -0
  24. package/dist/chunk-O5M4CR4P.cjs +2 -0
  25. package/dist/{chunk-W77HJGYX.js → chunk-OKEDGR65.js} +1 -1
  26. package/dist/{chunk-WU7PUTVA.js → chunk-RIYSCEFQ.js} +1 -1
  27. package/dist/chunk-UKUOZXUD.js +19 -0
  28. package/dist/chunk-VQ4R5LTU.js +2 -0
  29. package/dist/chunk-ZBEJHJN2.js +11 -0
  30. package/dist/chunk-ZVTW7RGD.js +2 -0
  31. package/dist/collaboration/replication.cjs +1 -1
  32. package/dist/collaboration/replication.d.cts +3 -3
  33. package/dist/collaboration/replication.d.ts +3 -3
  34. package/dist/collaboration/replication.js +1 -1
  35. package/dist/collaboration.d.cts +3 -3
  36. package/dist/collaboration.d.ts +3 -3
  37. package/dist/contracts/editor.d.cts +7 -7
  38. package/dist/contracts/editor.d.ts +7 -7
  39. package/dist/contracts/interaction.d.cts +7 -7
  40. package/dist/contracts/interaction.d.ts +7 -7
  41. package/dist/contracts/modules.d.cts +7 -7
  42. package/dist/contracts/modules.d.ts +7 -7
  43. package/dist/{custom-node-writes-D4rMJIES.d.cts → custom-node-writes-C46r3_5O.d.cts} +2 -2
  44. package/dist/{custom-node-writes-CcNeHH5C.d.ts → custom-node-writes-DntmaAVW.d.ts} +2 -2
  45. package/dist/{dist-YFULGVS3.js → dist-OSUJGKTK.js} +1 -1
  46. package/dist/{editor-B76SEMZw.d.cts → editor-AJ06hyyg.d.cts} +45 -9
  47. package/dist/{editor-BcdsPdbY.d.ts → editor-a6VvsfYU.d.ts} +45 -9
  48. package/dist/editor.cjs +1 -1
  49. package/dist/editor.css +1 -1
  50. package/dist/editor.d.cts +22 -22
  51. package/dist/editor.d.ts +22 -22
  52. package/dist/editor.js +1 -1
  53. package/dist/{index-BYTvklN5.d.ts → index-C5ZnSRkF.d.ts} +209 -20
  54. package/dist/{index-CDGhPib1.d.cts → index-Cbw4lkOt.d.cts} +209 -20
  55. package/dist/index.cjs +1 -1
  56. package/dist/index.d.cts +15 -15
  57. package/dist/index.d.ts +15 -15
  58. package/dist/index.js +1 -1
  59. package/dist/layout.cjs +1 -1
  60. package/dist/layout.d.cts +203 -593
  61. package/dist/layout.d.ts +203 -593
  62. package/dist/layout.js +1 -1
  63. package/dist/{note-properties-Bx7rXruA.d.ts → note-properties-CDFiNXcD.d.ts} +1 -1
  64. package/dist/{note-properties-zQ8w04en.d.cts → note-properties-Y6qYh2Hv.d.cts} +1 -1
  65. package/dist/{omml-equation-69O1Pd8G.d.ts → omml-equation-BY49UOIF.d.ts} +1 -1
  66. package/dist/{omml-equation-BmV51rim.d.cts → omml-equation-DB8d-jCq.d.cts} +1 -1
  67. package/dist/output.cjs +1 -1
  68. package/dist/output.d.cts +6 -6
  69. package/dist/output.d.ts +6 -6
  70. package/dist/output.js +1 -1
  71. package/dist/{protocol-DC7ueVuo.d.ts → protocol-BsmQgblT.d.ts} +2 -2
  72. package/dist/{protocol-FTXtrAIT.d.cts → protocol-gOY5GA8K.d.cts} +2 -2
  73. package/dist/{review-items-B78OsJU2.d.ts → review-items-CCS1h93f.d.ts} +1 -1
  74. package/dist/{review-items-C-2WQdEb.d.cts → review-items-CaAkgi5s.d.cts} +1 -1
  75. package/dist/{review-reads-UexYBp-m.d.ts → review-reads-BjZYeMd4.d.ts} +8 -21
  76. package/dist/{review-reads-CbBQlb-n.d.cts → review-reads-DEsV0OOW.d.cts} +8 -21
  77. package/dist/{revision-projection-6u8lae9J.d.cts → revision-projection-BeXVrSSV.d.ts} +24 -3
  78. package/dist/{revision-projection-B2v9U3qx.d.ts → revision-projection-DXbrfNGD.d.cts} +24 -3
  79. package/dist/{semantic-cell-selection-DsYz2Vg3.d.ts → semantic-cell-selection-BK91NCCG.d.ts} +16 -7
  80. package/dist/{semantic-cell-selection-nEE7E3Z8.d.cts → semantic-cell-selection-BMhku3B1.d.cts} +16 -7
  81. package/dist/{semantic-interaction-C00BpIyC.d.ts → semantic-interaction-BmQ7h2cq.d.ts} +4 -2
  82. package/dist/{semantic-interaction-DiOX0FIH.d.cts → semantic-interaction-DUAnxbgf.d.cts} +4 -2
  83. package/dist/{semantic-paint-Cc11nrDL.d.cts → semantic-paint-DufNL1Zr.d.cts} +2 -2
  84. package/dist/{semantic-paint-ofuoBsYo.d.ts → semantic-paint-WJD2KeG1.d.ts} +2 -2
  85. package/dist/{semantic-records-CRG1r6-a.d.cts → semantic-records-92UnKeU_.d.ts} +1146 -10
  86. package/dist/{semantic-records-CzI0ZEuR.d.ts → semantic-records-BpozY7-j.d.cts} +1146 -10
  87. package/dist/shaped-measurer-BWbindlI.d.ts +168 -0
  88. package/dist/shaped-measurer-CFPnXFs9.d.cts +168 -0
  89. package/dist/store.cjs +1 -1
  90. package/dist/store.d.cts +26 -16
  91. package/dist/store.d.ts +26 -16
  92. package/dist/store.js +1 -1
  93. package/dist/{tree-op-types-CA7qgAUF.d.cts → tree-op-types-BUulYD5y.d.cts} +15 -2
  94. package/dist/{tree-op-types-HKfUzt_-.d.ts → tree-op-types-D6HzlPR4.d.ts} +15 -2
  95. package/dist/{tree-package-fragment-oJZX_5iN.d.ts → tree-package-fragment-CWFjgH6a.d.ts} +3 -11
  96. package/dist/{tree-package-fragment-Cz-v-0B3.d.cts → tree-package-fragment-Dhyw7oPm.d.cts} +3 -11
  97. package/dist/{tree-session-contract-BPDLrEPX.d.ts → tree-session-contract-B2HfGt79.d.ts} +33 -6
  98. package/dist/{tree-session-contract-Cbl87xa8.d.cts → tree-session-contract-BY9xd7s_.d.cts} +33 -6
  99. package/dist/{tree-store-B7hd6cEa.d.ts → tree-store-APgWx6qn.d.ts} +1 -1
  100. package/dist/{tree-store-BenW0Mg_.d.cts → tree-store-DEEQ9wz_.d.cts} +1 -1
  101. package/package.json +5 -2
  102. package/dist/chunk-3JON7JMD.cjs +0 -1
  103. package/dist/chunk-5V6FNKBE.cjs +0 -2
  104. package/dist/chunk-BXRVGHTY.cjs +0 -18
  105. package/dist/chunk-BXTTPJSH.js +0 -5
  106. package/dist/chunk-ILTZTY3K.cjs +0 -10
  107. package/dist/chunk-IUM7FZPA.js +0 -2
  108. package/dist/chunk-JWZG4QJ5.cjs +0 -2
  109. package/dist/chunk-JXZYDBKU.cjs +0 -19
  110. package/dist/chunk-KBOOIC2Q.js +0 -19
  111. package/dist/chunk-L6XZTLPS.js +0 -10
  112. package/dist/chunk-L7OR5TJK.cjs +0 -5
  113. package/dist/chunk-MHQNR2OU.js +0 -2
  114. package/dist/chunk-MLGPISGH.js +0 -1
  115. package/dist/chunk-NJXQABQU.js +0 -18
  116. package/dist/chunk-TKEGK4GQ.cjs +0 -2
  117. package/dist/chunk-VGFMPWND.js +0 -2
  118. package/dist/shaped-measurer-CkOGZQn9.d.ts +0 -611
  119. package/dist/shaped-measurer-CneACGcP.d.cts +0 -611
@@ -0,0 +1,2 @@
1
+ import {q as q$1,p as p$1,m,r,n,t,s,l,u,v as v$1,o,x,d as d$1,y,e,A as A$1,k as k$1,f as f$1,w as w$1,z,a,b,g,c as c$1,h,i as i$1,j as j$1}from'./chunk-FBA57EUJ.js';import {c,d,p,f,k,j,i,Je,ch,Pe,ze as ze$1,ca,Zb,Ka,_b,N,x as x$1,Na,w,ma}from'./chunk-ZBEJHJN2.js';var on=["extension","capability","command","query","schema","dependencyKey","runtimePort","result","origin"],an=/^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)+$/,sn=/^@[a-z0-9.-]+\/[a-z0-9.-]+(?:#[a-z0-9]+(?:[/._-][a-z0-9]+)*)?$/;function Ft(e){return an.test(e)||sn.test(e)}function re(e,t){if(!Ft(e))throw new Error(`invalid ${t??"registry"} id ${JSON.stringify(e)}: must be reverse-domain (dev.docx-editor.core.x) or package-owned (@scope/pkg#kind/name)`)}var ln=/^(\d+)\.(\d+)\.(\d+)$/;function $(e){let t=ln.exec(e);if(!t)throw new Error(`invalid semantic version: ${JSON.stringify(e)}`);return {major:Number(t[1]),minor:Number(t[2]),patch:Number(t[3])}}function oe(e,t){return e.major!==t.major?e.major<t.major?-1:1:e.minor!==t.minor?e.minor<t.minor?-1:1:e.patch!==t.patch?e.patch<t.patch?-1:1:0}function ie(e,t){let n=$(e),r=t.trim();if(r==="*")return true;if(r.startsWith("^")){let o=$(r.slice(1));return oe(n,o)<0?false:o.major>0?n.major===o.major:o.minor>0?n.major===0&&n.minor===o.minor:n.major===0&&n.minor===0}if(r.includes(" ")){let o=r.split(/\s+/);if(o.length!==2)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let p=true;for(let i of o){let s=i.startsWith(">=")?">=":i.startsWith("<")?"<":null;if(!s)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let d=$(i.slice(s.length)),l=oe(n,d);s===">="?p=p&&l>=0:p=p&&l<0;}return p}return oe(n,$(r))===0}var v=class extends Error{constructor(n,r,o=[]){super(r);this.code=n;this.responsible=o;this.name="RegistryError";}code;responsible},Ae=(e,t)=>`${e}:${t}`;function dn(e,t={}){let n=new Map;for(let l of e){if(re(l.id,"extension"),Bt(l.version,l.id),n.has(l.id))throw new v("duplicate-extension",`duplicate extension id ${l.id}`,[l.id]);n.set(l.id,l);for(let c of l.contributions)re(c.id,c.kind),Bt(c.version,`${l.id} \u2192 ${c.id}`),c.replaces&&mn(c.replaces.targetRange,`${l.id} \u2192 replaces ${c.replaces.targetId}`);}for(let l of e){for(let c of l.dependencies??[])if(!n.has(c))throw new v("missing-dependency",`${l.id} requires missing extension ${c}`,[l.id,c]);for(let c of l.conflicts??[])if(n.has(c)){let g=[l.id,c].sort();throw new v("conflict",`extensions ${g[0]} and ${g[1]} conflict`,g)}}pn(n);let r=new Set(t.availablePorts??[]);for(let l of e)for(let c of l.contributions)c.kind==="runtimePort"&&r.add(c.id);for(let l of e)for(let c of l.requiredPorts??[])if(!r.has(c))throw new v("missing-port",`${l.id} requires unavailable port ${c}`,[l.id,c]);let o=new Map,p=new Map,i=new Map;for(let l of e)for(let c of l.contributions){let g=Ae(c.kind,c.id);if(c.replaces){let x=Ae(c.kind,c.replaces.targetId),R=i.get(x)??[];R.push({ext:l.id,c}),i.set(x,R);continue}if(p.has(g)){let x=[o.get(g),l.id].sort();throw new v("id-collision",`${c.kind} id ${c.id} registered by both ${x[0]} and ${x[1]}`,x)}p.set(g,c),o.set(g,l.id);}let s=new Map(p);for(let[l,c]of i){let g=p.get(l);if(!g){let O=c[0];throw new v("replacement-target-missing",`${O.ext} replaces missing target ${O.c.replaces.targetId}`,[O.ext,O.c.replaces.targetId])}let x=g.replaceable??{kind:"none"};for(let{ext:O,c:b}of c){if(!ie(g.version,b.replaces.targetRange))throw new v("replacement-version-mismatch",`${O} replaces ${b.replaces.targetId}@${g.version} outside range ${b.replaces.targetRange}`,[O,b.replaces.targetId]);if(x.kind==="none")throw new v("unauthorized-replacement",`${b.replaces.targetId} does not authorize replacement (attempted by ${O})`,[O,b.replaces.targetId])}let R=cn(g,c);s.set(l,R);}return {extensions:n,contributions:s,get:(l,c)=>s.get(Ae(l,c))}}function cn(e,t){let n=e.replaceable??{kind:"none"};if(t.length===1)return t[0].c;if(n.kind==="priority"){let o=[...t].sort((s,d)=>(d.c.replaces.priority??0)-(s.c.replaces.priority??0)),p=o[0].c.replaces.priority??0,i=o.filter(s=>(s.c.replaces.priority??0)===p);if(i.length>1){let s=i.map(d=>d.ext).sort();throw new v("ambiguous-replacement",`multiple replacers of ${e.id} share top priority ${p}: ${s.join(", ")}`,s)}return o[0].c}let r=t.map(o=>o.ext).sort();throw new v("ambiguous-replacement",`multiple replacers of ${e.id}: ${r.join(", ")}`,r)}function pn(e){let o=new Map,p=[],i=s=>{o.set(s,1),p.push(s);let d=[...e.get(s)?.dependencies??[]].sort();for(let l of d){let c=o.get(l)??0;if(c===1){let g=p.indexOf(l),x=[...p.slice(g),l];throw new v("dependency-cycle",`dependency cycle: ${x.join(" -> ")}`,x)}c===0&&i(l);}p.pop(),o.set(s,2);};for(let s of [...e.keys()].sort())(o.get(s)??0)===0&&i(s);}function Bt(e,t){try{$(e);}catch{throw new v("invalid-version",`invalid version ${JSON.stringify(e)} in ${t}`,[t])}}function mn(e,t){try{ie("0.0.0",e);}catch{throw new v("invalid-version",`invalid version range ${JSON.stringify(e)} in ${t}`,[t])}}var A=class extends Error{constructor(t){super(t),this.name="BudgetError";}},W=class e{constructor(t,n){this.label=t;this.capacity=n;this.used=new p(`${t}.budget`,n);}label;capacity;used;children=new Set;activeReservations=0;cleanups=[];disposed=false;carveAmount=0;parent;get inUse(){return this.used.current}get available(){return this.used.remaining}get isDisposed(){return this.disposed}reserve(t){this.assertLive(),this.used.add(t),this.activeReservations+=1;let n=false,r=this;return {amount:t,get released(){return n},release(){n||(n=true,r.used.release(t),r.activeReservations-=1);}}}child(t,n){this.assertLive(),this.used.add(n);let r=new e(t,n);return r.parent=this,r.carveAmount=n,this.children.add(r),r}onRelease(t){this.assertLive(),this.cleanups.push(t);}dispose(){if(this.disposed)return;if(this.children.size>0)throw new A(`${this.label}: cannot release with ${this.children.size} child budget(s) outstanding`);if(this.activeReservations>0)throw new A(`${this.label}: cannot release with ${this.activeReservations} reservation(s) outstanding`);let t=[];for(let n=this.cleanups.length-1;n>=0;n--)try{this.cleanups[n]();}catch(r){t.push(r);}if(this.disposed=true,this.parent&&(this.parent.children.delete(this),this.parent.used.release(this.carveAmount),this.parent=void 0),t.length>0)throw new A(`${this.label}: ${t.length} cleanup error(s); first: ${String(t[0])}`)}assertLive(){if(this.disposed)throw new A(`${this.label}: budget already released`)}};var ae=class extends Error{constructor(n,r){super(r?`cancelled: ${r}`:"cancelled");this.derivedOnly=n;this.name="CancellationError";}derivedOnly},K=class{_cancelled=false;_phase="pre-publication";_reason;cancel(t){this._cancelled=true,t!==void 0&&(this._reason=t);}markPublished(){this._phase="post-publication";}get isCancelled(){return this._cancelled}get phase(){return this._phase}get isPublished(){return this._phase==="post-publication"}get derivedOnly(){return this._cancelled&&this._phase==="post-publication"}get token(){let t=this;return {get isCancelled(){return t._cancelled},get phase(){return t._phase},get derivedOnly(){return t.derivedOnly},checkpoint(){if(t._cancelled)throw new ae(t.derivedOnly,t._reason)}}}};var se=class extends Error{constructor(n){super(`runtime port not available: ${n}`);this.portId=n;this.name="PortResolutionError";}portId},_e=class{ports=new Map;provide(t,n){return this.ports.set(t,n),this}has(t){return this.ports.has(t)}resolve(t){if(!this.ports.has(t))throw new se(t);return this.ports.get(t)}missing(t){return t.filter(n=>!this.ports.has(n))}availablePorts(){return [...this.ports.keys()]}clock(){return this.resolve(f.clock)}identity(){return this.resolve(f.identity)}},Me=class{constructor(t=0,n=1){this.step=n;this.t=t;}step;t;now(){let t=this.t;return this.t+=this.step,t}},Le=class{constructor(t="id"){this.prefix=t;}prefix;n=0;newId(){return this.n+=1,`${this.prefix}-${this.n}`}};function un(e){let t=k(e.limits),n=Object.freeze({...e.config??{}}),r=e.capacity??t.maxDecompressedBytes,o=e.id??"op",p={id:o,limits:t,config:n,ports:e.ports,budget:new W(`op:${o}`,r),cancellation:new K};return Object.freeze(p)}function fn(e){e.budget.dispose();}var Fe=Object.freeze({maxRecursionDepth:{unit:"depth",phase:"xml-parse"},maxElementCount:{unit:"count",phase:"xml-parse"},maxPartCount:{unit:"count",phase:"package-read"},maxDecompressedBytes:{unit:"bytes",phase:"package-read"},maxCompressedBytes:{unit:"bytes",phase:"package-read"},maxCompressionRatio:{unit:"ratio",phase:"package-read"},maxChunkBytes:{unit:"bytes",phase:"package-read"},maxPaginationPasses:{unit:"passes",phase:"layout"},maxQueueDepth:{unit:"count",phase:"output"}}),Vt=Object.keys(Fe);function yn(e,t){return new p(`${Fe[t].phase}:${t}`,e[t])}var De=class{counter;current=0;peak=0;constructor(t){this.counter=new p("memory",t);}allocate(t){this.counter.add(t),this.current+=t,this.current>this.peak&&(this.peak=this.current);}free(t){this.counter.release(t),this.current=Math.max(0,this.current-t);}get currentBytes(){return this.current}get peakBytes(){return this.peak}reset(){this.counter.release(this.current),this.current=0;}};function hn(){for(let e of Vt){let t=j[e],n=i[e];if(!Number.isFinite(t)||t<=0)throw new Error(`default ${e} must be finite > 0`);if(!Number.isFinite(n)||n<=0)throw new Error(`ceiling ${e} must be finite > 0`);if(t>n)throw new Error(`default ${e} exceeds ceiling`)}}function G(e,t=new Set){let n=new WeakSet,r=o=>{if(o===null)return "null";let p=typeof o;if(p==="boolean")return o?"true":"false";if(p==="number"){let i=o;if(!Number.isFinite(i))throw new Error(`non-finite number is not comparable: ${i}`);return Object.is(i,-0)?"0":String(i)}if(p==="string")return JSON.stringify(o);if(p==="bigint")return `${o.toString()}n`;if(Array.isArray(o))return `[${o.map(r).join(",")}]`;if(p==="object"){let i=o;if(n.has(i))throw new Error("cannot canonicalize a cyclic structure");n.add(i);let d=Object.keys(i).filter(l=>!t.has(l)).sort().map(l=>`${JSON.stringify(l)}:${r(i[l])}`).join(",");return n.delete(i),`{${d}}`}throw new Error(`unsupported value type in comparator input: ${p}`)};return r(e)}function Be(e,t){let n=G(e,t),r=0xcbf29ce484222325n,o=0x100000001b3n,p=0xffffffffffffffffn;for(let i=0;i<n.length;i++)r^=BigInt(n.charCodeAt(i)),r=r*o&p;return r.toString(16).padStart(16,"0")}var C="dev.docx-editor.core.comparator",Ve={authoredState:{id:`${C}.authored-state`,mode:"canonical-exact",ephemera:["revision","provenance","producedAt","commitId"],note:"canonical normalized authored records; ephemera excluded"},anchor:{id:`${C}.anchor`,mode:"exact",ephemera:[],note:"internal anchor identity/affinity compares exactly"},yjsStateVector:{id:`${C}.yjs-state-vector`,mode:"sync-optimization-only",ephemera:[],note:"exchange optimization only; never proves update or delete-set coverage"},shapedRun:{id:`${C}.shaped-run`,mode:"exact",ephemera:[],note:"glyph ids, clusters, and fixed-point advances compare exactly"},paginationFingerprint:{id:`${C}.pagination-fingerprint`,mode:"exact",ephemera:[],note:"page/column boundaries, break causes, fixed-point geometry compare exactly"},semanticTree:{id:`${C}.semantic-tree`,mode:"exact",ephemera:[],note:"reading order, roles, headings, alt text compare exactly"},hitTest:{id:`${C}.hit-test`,mode:"exact",ephemera:[],note:"resolved hit target and cluster affinity compare exactly"},pdfSemantics:{id:`${C}.pdf-semantics`,mode:"canonical-exact",ephemera:["objectNumber","producer","creationDate","modDate","subsetTag"],note:"canonical semantic PDF objects; container ephemera excluded"},rasterCheckpoint:{id:`${C}.raster-checkpoint`,mode:"tolerance",ephemera:[],note:"documented unavoidable raster comparison; explicit tolerance only"},benchmarkEvidence:{id:`${C}.benchmark-evidence`,mode:"sync-optimization-only",ephemera:[],note:"diagnostic evidence, not an equivalence basis"}};function ze(e,t,n,r={}){let o=Ve[e];switch(o.mode){case "sync-optimization-only":throw new Error(`${o.id} is not an equivalence basis (${o.note})`);case "tolerance":{if(r.epsilon===void 0)throw new Error(`${o.id} requires an explicit epsilon`);return {equal:zt(t,n,r.epsilon)}}case "exact":case "canonical-exact":{let p=o.mode==="canonical-exact"?new Set(o.ephemera):new Set,i=G(t,p),s=G(n,p);return i===s?{equal:true}:{equal:false,left:i,right:s}}}}function Ue(e,t){let n=Ve[e];if(n.mode==="tolerance"||n.mode==="sync-optimization-only")throw new Error(`${n.id} has no canonical fingerprint (${n.mode})`);let r=n.mode==="canonical-exact"?new Set(n.ephemera):void 0;return Be(t,r)}function zt(e,t,n){return typeof e=="number"&&typeof t=="number"?Number.isFinite(e)&&Number.isFinite(t)&&Math.abs(e-t)<=n:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((r,o)=>zt(r,t[o],n)):false}var Ht=new Set([...c,...d]),Ut=/^[0-9a-f]{16}$/,gn=/^[0-9a-f]*$/;function He(e){let t=[],n=o=>t.push(o);e.formatVersion!==1&&n(`unsupported formatVersion ${e.formatVersion}`),e.documentId||n("documentId is required"),e.source.kind==="docx"&&!/^[0-9a-f]{64}$/.test(e.source.sha256)&&n("docx source requires a 64-hex sha256");let r=-1;e.steps.forEach((o,p)=>{let i=`step[${p}]`;Ht.has(o.origin)||n(`${i}: unknown origin ${o.origin}`),(!Number.isInteger(o.baseRevision)||o.baseRevision<0)&&n(`${i}: baseRevision must be a non-negative integer`),o.baseRevision<r&&n(`${i}: baseRevision regressed below ${r}`);let s=o.expect;s.outcome==="applied"?(s.committedRevision===void 0?n(`${i}: applied step needs committedRevision`):s.committedRevision<=o.baseRevision?n(`${i}: committedRevision ${s.committedRevision} must exceed baseRevision ${o.baseRevision}`):r=s.committedRevision,s.modelChange&&xn(s.modelChange,i,n)):(s.committedRevision!==void 0&&n(`${i}: ${s.outcome} step must not commit a revision`),s.authoredStateHash!==void 0&&n(`${i}: ${s.outcome} step must not change authored state`)),s.authoredStateHash!==void 0&&!Ut.test(s.authoredStateHash)&&n(`${i}: authoredStateHash must be 16-hex`),s.outputHash!==void 0&&!Ut.test(s.outputHash)&&n(`${i}: outputHash must be 16-hex`);});for(let o of [...e.snapshots??[],...e.updates??[]])o.documentId!==e.documentId&&n(`envelope documentId ${o.documentId} != ${e.documentId}`),gn.test(o.bytesHex)||n("envelope bytesHex must be hex"),o.bytesHex.length!==o.byteLength*2&&n(`envelope byteLength ${o.byteLength} disagrees with ${o.bytesHex.length/2} decoded bytes`);return {valid:t.length===0,errors:t}}function xn(e,t,n){Ht.has(e.origin)||n(`${t}: modelChange origin ${e.origin} unknown`),e.toRevision<=e.fromRevision&&n(`${t}: modelChange revision must advance`);}function Rn(e,t){let n=He(e);if(!n.valid)return {ok:false,mismatches:n.errors};let r=[];return t.init(e),e.steps.forEach((o,p)=>{let i=`step[${p}]`,s=t.applyStep(o),d=o.expect;if(s.outcome!==d.outcome){r.push(`${i}: outcome ${s.outcome} != expected ${d.outcome}`);return}if(d.outcome==="applied"&&(s.committedRevision!==d.committedRevision&&r.push(`${i}: revision ${s.committedRevision} != expected ${d.committedRevision}`),d.authoredStateHash!==void 0))if(s.authoredState===void 0)r.push(`${i}: store returned no authored state to hash`);else {ze("authoredState",s.authoredState,s.authoredState).equal||r.push(`${i}: authored state is not self-consistent`);let c=jt(s.authoredState);c!==d.authoredStateHash&&r.push(`${i}: authoredStateHash ${c} != expected ${d.authoredStateHash}`);}}),{ok:r.length===0,mismatches:r}}function jt(e){return Ue("authoredState",e)}function le(e,t){return {...e,children:t}}function de(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===ca}function q(e,t=[]){if(e.kind==="textValue")return t;e.kind==="paragraph"&&t.push(e.id);for(let n of e.children)q(n,t);return t}function Wt(e,t){if(e.kind==="textValue")return null;if(e.kind==="paragraph"&&e.id===t)return e;for(let n of e.children){let r=Wt(n,t);if(r)return r}return null}function On(e){let t=(n,r)=>{if(n.kind==="textValue")return n;if(r&&de(n,"vMerge")){if(ze$1(n,"val")==="restart")return n;let p=[...n.attributes.filter(i=>!(i.localName==="val"&&i.namespaceUri===ca)),{kind:"wmlVal",namespaceUri:ca,localName:"val",prefix:"w",value:"restart"}];return {...n,attributes:p}}if(n.kind==="paragraph"||n.kind==="table")return n;let o=r||de(n,"tc");return le(n,n.children.map(p=>t(p,o)))};return le(e,e.children.map(n=>t(n,false)))}function Kt(e,t){if(!(e.kind==="textValue"||e.kind==="table")){if(de(e,"tr")){t.push(e);return}for(let n of e.children)Kt(n,t);}}function Gt(e,t,n){if(e.kind==="textValue"||e.kind==="table")return {node:e,hadRows:false,keptRows:false};if(de(e,"tr")){if(!t.has(e))return {node:null,hadRows:true,keptRows:false};let i=n.value?On(e):e;return n.value=false,{node:i,hadRows:true,keptRows:true}}let r=false,o=false,p=[];for(let i of e.children){let s=Gt(i,t,n);r||=s.hadRows,o||=s.keptRows,s.node!==null&&p.push(s.node);}return r?{node:o?le(e,p):null,hadRows:true,keptRows:o}:{node:e,hadRows:false,keptRows:false}}function qt(e,t,n){let r=[];for(let d of e.children)Kt(d,r);let o=new Set(q(e).filter(d=>t.inRange.has(d)));if(o.size===0)return;let p=r.filter(d=>{let l=q(d);return l.length>0&&l.every(c=>t.covered.has(c))}),i=new Set(p.flatMap(d=>q(d)));if(p.length>0&&o.size===i.size&&[...o].every(d=>i.has(d))){let d={value:true},l=new Set(p),c=[];for(let g of e.children){let x=Gt(g,l,d);x.node!==null&&c.push(x.node);}n.push(le(e,c));return}for(let d of q(e)){if(!t.inRange.has(d))continue;let l=Wt(e,d);l&&n.push(l);}}var vn="http://schemas.openxmlformats.org/package/2006/content-types",bn=5e4;function P(e){return e.kind!=="textValue"}function Yt(e,t=[]){if(e.kind==="textValue")return t;e.kind==="paragraph"&&t.push(e.id);for(let n of e.children)Yt(n,t);return t}function je(e,t){if(e.kind==="textValue")return null;if(e.kind==="paragraph"&&e.id===t)return e;for(let n of e.children){let r=je(n,t);if(r)return r}return null}function S(e,t){return {...e,children:t}}function wn(e,t){return e.kind!=="textValue"&&e.localName===t&&e.namespaceUri===ca}function Cn(e){if(e.root.kind==="document"){let t=e.root.children.find(n=>n.kind==="body");return t&&P(t)?t:null}return P(e.root)?e.root:null}function kn(e,t){return Yt(e).some(n=>t.has(n))}function We(e,t,n){for(let r of e)if(P(r)){if(r.kind==="paragraph"){t.inRange.has(r.id)&&n.push(r);continue}if(t.fullBlocks.has(r.id)){n.push(r);continue}if(r.kind==="table"){qt(r,t,n);continue}if(r.kind==="contentControl"){let o=r.children.find(p=>p.kind==="contentControlContent");o&&P(o)&&We(o.children,t,n);continue}kn(r,t.inRange)&&We(r.children,t,n);}}var En=new Set(["commentRangeStart","commentRangeEnd"]);function In(e){return e.kind==="run"&&e.children.some(t=>t.kind==="commentReference")}function Ke(e){if(e.kind==="textValue")return e;if(En.has(e.localName)&&e.namespaceUri===ca||In(e)||wn(e,"sectPr"))return null;let t=false,n=[];for(let r of e.children){let o=Ke(r);if(o===null){t=true;continue}o!==r&&(t=true),n.push(o);}return t?S(e,n):e}function Sn(e){let t=[],n=d=>{if(d.kind!=="textValue"){if(d.kind==="run"){for(let l of d.children)if(l.kind==="fldChar"){let c=ze$1(l,"fldCharType");t.push({nodeId:l.id,type:c==="separate"||c==="end"?c:"begin"});}else l.kind==="instrText"&&t.push({nodeId:l.id,type:"instr"});return}for(let l of d.children)n(l);}};for(let d of e)n(d);if(t.length===0)return e;let r=new Set,o=[],p=null,i=[];for(let d of t){if(d.type==="begin"){o.push({beginId:d.nodeId,separateId:null,instrIds:[]});continue}if(d.type==="separate"){let c=o[o.length-1];c?c.separateId=d.nodeId:p=d.nodeId;continue}if(d.type==="instr"){let c=o[o.length-1];c?c.instrIds.push(d.nodeId):p===null&&i.push(d.nodeId);continue}if(!o.pop()){r.add(d.nodeId),p!==null&&r.add(p);for(let c of i)r.add(c);p=null,i=[];}}for(let d of o){r.add(d.beginId),d.separateId!==null&&r.add(d.separateId);for(let l of d.instrIds)r.add(l);}p!==null&&r.add(p);for(let d of i)r.add(d);if(r.size===0)return e;let s=d=>{if(d.kind==="textValue")return d;if(r.has(d.id))return null;let l=[],c=false;for(let g of d.children){let x=s(g);if(x===null){c=true;continue}x!==g&&(c=true),l.push(x);}return c?S(d,l):d};return e.map(d=>s(d)).filter(d=>d!==null)}function Ge(e){if(e.kind==="textValue")return e.value.length;let t=0;for(let n of e.children)t+=Ge(n);return t}function Pn(e,t){let n=[];for(let r of e.children){if(r.kind!=="contentControl"){n.push(r);continue}let o=t.get(r.id),p=Ge(r);if(o===void 0||p>=o){n.push(r);continue}if(p===0)continue;let i=r.children.find(s=>s.kind==="contentControlContent");i&&P(i)?n.push(...i.children):n.push(r);}return S(e,n)}function Nn(e){let t=new Set,n=new Set,r=i=>{if(i.kind!=="textValue"){if(i.kind==="bookmarkStart"){let s=ze$1(i,"id");s!==void 0&&t.add(s);}if(i.kind==="bookmarkEnd"){let s=ze$1(i,"id");s!==void 0&&n.add(s);}for(let s of i.children)r(s);}};for(let i of e)r(i);let o=new Set([...t].filter(i=>n.has(i)));if(o.size===t.size&&o.size===n.size)return e;let p=i=>{if(i.kind==="textValue")return i;if(i.kind==="bookmarkStart"||i.kind==="bookmarkEnd"){let l=ze$1(i,"id");return l!==void 0&&o.has(l)?i:null}let s=[],d=false;for(let l of i.children){let c=p(l);if(c===null){d=true;continue}c!==l&&(d=true),s.push(c);}return d?S(i,s):i};return e.map(i=>p(i)??i)}function Tn(e$1,t$1,n$1){let r$1=e$1.parts.get(t$1.partName);if(!r$1)return {ok:false,reason:"unknown-part"};if(t$1.paragraphIds.length===0)return {ok:false,reason:"empty-range"};let o$1=t$1.paragraphIds[0],p=t$1.paragraphIds[t$1.paragraphIds.length-1],i=new Map;for(let a of [o$1,p]){let m=je(r$1.root,a);if(!m)return {ok:false,reason:"empty-range"};for(let u of m.children)u.kind==="contentControl"&&i.set(u.id,Ge(u));}let s$1=r$1,d=je(s$1.root,p);if(!d)return {ok:false,reason:"empty-range"};let l$1=Je(d);if(t$1.endOffset<l$1){let a=ch(s$1,{op:"deleteText",paragraphId:p,start:t$1.endOffset,end:l$1},{deferValidation:true});if(!a.ok)return {ok:false,reason:"trim-refused"};s$1=a.part;}if(t$1.startOffset>0){let a=ch(s$1,{op:"deleteText",paragraphId:o$1,start:0,end:t$1.startOffset},{deferValidation:true});if(!a.ok)return {ok:false,reason:"trim-refused"};s$1=a.part;}let c=Cn(s$1);if(!c)return {ok:false,reason:"unknown-part"};let g$1={inRange:new Set(t$1.paragraphIds),covered:new Set(t$1.coveredParagraphIds),fullBlocks:new Set(t$1.fullyCoveredBlockIds)},x$2=[];if(We(c.children,g$1,x$2),x$2.length===0)return {ok:false,reason:"empty-range"};if(x$2.length>bn)return {ok:false,reason:"resource-limit"};let R=x$2.map(a=>Ke(a)).filter(a=>a!==null).map(a=>a.kind!=="paragraph"||a.id!==o$1&&a.id!==p?a:Pn(a,i));R=[...Sn(R)],R=[...Nn(R)];let O=Pe(e$1,"footnote"),b$1=Pe(e$1,"endnote"),qe=(a,m)=>P(a)&&a.namespaceUri===ca&&a.localName===m,Ye=q$1(R,(a,m)=>{let u=a==="footnote"?O:b$1;if(!u||!P(u.root))return null;for(let f of u.root.children){if(!qe(f,a))continue;let y=ze$1(f,"id");if(y!==void 0&&p$1(y)===m)return f}return null}),Je$1=Ye.footnote,Xe=Ye.endnote;Je$1.size===0&&(O=null),Xe.size===0&&(b$1=null);let Qe=(a,m,u)=>{if(!a||!P(a.root))return [];let f=[];for(let y of a.root.children){if(!qe(y,m))continue;let h=ze$1(y,"id"),U=ze$1(y,"type");if(U==="separator"||U==="continuationSeparator"){f.push(y);continue}if(h!==void 0&&u.has(p$1(h))){let xe=Ke(y);xe&&P(xe)&&f.push(xe);}}return f},Ze=Qe(O,"footnote",Je$1),et=Qe(b$1,"endnote",Xe),Jt=[...Ze,...et],tt=[...R,...Jt],_=new Set;m(tt,_);let B=r(e$1,e$1.mainDocumentPart),M=new Set;n(tt,M);let ce=[],k=t(e$1,e$1.mainDocumentPart,M);for(;;){let a=_.size,m$1=M.size;ce=s(B,_),n(ce,M),k=t(e$1,e$1.mainDocumentPart,M);let u=[...k.nums,...k.abstracts];m(u,_);for(let f of u)l(f,y=>{if(y.kind!=="textValue"&&(y.localName==="styleLink"||y.localName==="numStyleLink")&&y.namespaceUri===ca){let h=ze$1(y,"val");h&&_.add(h);}});if(_.size===a&&M.size===m$1)break}let L=u(e$1,e$1.mainDocumentPart),nt=ce.map(a=>v$1(a,L)),pe=B.docDefaults?v$1(B.docDefaults,L):null;R=R.map(a=>v$1(a,L));let me=Ze.map(a=>v$1(a,L)),ue=et.map(a=>v$1(a,L)),rt=new Set;o(R,rt);let ot=Zb(e$1,r$1.name).filter(a=>rt.has(a.id)),it=new Map,at=0,st=a=>{let m=new Set;for(let u of a){if(u.targetMode==="External")continue;let f=w(u.ownerPart,u.rawTarget);if(!f.ok){m.add(u.id);continue}if((_b(e$1,f.partName)??"").toLowerCase().startsWith("image/")&&n$1?.omitMedia!==true){let h=e$1.partBytes.get(f.partName)??e$1.partBytes.get(f.partName.replace(/^\//,""));h?(it.set(f.partName,h),at+=h.byteLength):m.add(u.id);continue}m.add(u.id);}return m},fe=st(ot),ye=(a,m)=>{if(a.kind==="textValue")return a;if(a.kind==="drawing"){let y=new Set;o([a],y);for(let h of y)if(m.has(h))return null;return a}let u=[],f=false;for(let y of a.children){let h=ye(y,m);if(h===null){f=true;continue}h!==y&&(f=true),u.push(h);}return f?S(a,u):a};fe.size>0&&(R=R.map(a=>ye(a,fe)).filter(a=>a!==null));let Xt=ot.filter(a=>!fe.has(a.id)),lt=(a,m)=>{if(!a)return [];let u=new Set;o(m,u);let f=Zb(e$1,a.name).filter(h=>u.has(h.id)),y=st(f);if(y.size>0)for(let h=0;h<m.length;h+=1){let U=ye(m[h],y);U!==null&&(m[h]=U);}return f.filter(h=>!y.has(h.id))},Qt=lt(O,me),Zt=lt(b$1,ue),E=new Map,he=[],dt=new Map,V=(a,m,u)=>{let f=w$1(a,m,u);E.set(a.slice(1),Ka(ma(f))),he.push([a,m]),dt.set(a,f);},ge=(a,m)=>a.map(u=>{if(u.targetMode==="External")return {...u,ownerPart:m};let f=w(u.ownerPart,u.rawTarget);return {...u,ownerPart:m,rawTarget:f.ok?f.partName:u.rawTarget}}),z$1=ge(Xt,"/word/document.xml"),Y=ge(Qt,"/word/footnotes.xml"),J=ge(Zt,"/word/endnotes.xml"),ct=new Set(z$1.map(a=>a.id)),pt=9001,X=(a,m)=>{let u=z(ct,pt);pt+=1,ct.add(u),z$1.push({ownerPart:"/word/document.xml",id:u,type:a,rawTarget:m,targetMode:"Internal",order:z$1.length});},en=x(s$1,R);if(V("/word/document.xml",a,en),B.part&&(nt.length>0||pe)){let a=S(B.part.root,[...pe?[pe]:[],...nt]);V("/word/styles.xml",b,a),X(g,"styles.xml");}if(k.part&&(k.nums.length>0||k.abstracts.length>0)){let a=S(k.part.root,[...k.abstracts.map(m=>v$1(m,L)),...k.nums]);V("/word/numbering.xml",c$1,a),X(h,"numbering.xml");}O&&me.length>0&&(V("/word/footnotes.xml",d$1,S(O.root,me)),X(i$1,"footnotes.xml"),Y.length>0&&E.set("word/_rels/footnotes.xml.rels",Ka(y(Y)))),b$1&&ue.length>0&&(V("/word/endnotes.xml",e,S(b$1.root,ue)),X(j$1,"endnotes.xml"),J.length>0&&E.set("word/_rels/endnotes.xml.rels",Ka(y(J))));let Q=new Map;for(let[a,m]of it){E.set(a.slice(1),m);let u=A$1(a);u&&!Q.has(u)&&Q.set(u,_b(e$1,a)??"application/octet-stream");}let mt={ownerPart:"/",id:"rId1",type:k$1,rawTarget:"word/document.xml",targetMode:"Internal",order:0};E.set("word/_rels/document.xml.rels",Ka(y(z$1))),E.set("_rels/.rels",Ka(y([mt])));let tn=[`<Default Extension="rels" ContentType="${f$1}"/>`,'<Default Extension="xml" ContentType="application/xml"/>',...[...Q].map(([a,m])=>`<Default Extension="${N(a)}" ContentType="${N(m)}"/>`)].join(""),nn=he.map(([a,m])=>`<Override PartName="${N(a)}" ContentType="${N(m)}"/>`).join("");E.set("[Content_Types].xml",Ka(`<Types xmlns="${vn}">${tn}${nn}</Types>`));let D=new Map;D.set("/",[mt]),D.set("/word/document.xml",z$1),Y.length>0&&D.set("/word/footnotes.xml",Y),J.length>0&&D.set("/word/endnotes.xml",J);let ut=[];for(let a of D.values())for(let m of a)m.targetMode==="External"&&ut.push({ownerPart:m.ownerPart,id:m.id,type:m.type,rawTarget:m.rawTarget,sinkSafe:x$1(m.rawTarget).ok});let Z=new Map;Z.set("rels",f$1),Z.set("xml","application/xml");for(let[a,m]of Q)Z.set(a,m);let rn={defaults:Z,overrides:new Map(he)},ft=new Map;for(let[a,m]of E)ft.set(a.startsWith("/")?a:`/${a}`,m);return {ok:true,bytes:Na(E),package:Object.freeze({parts:dt,partBytes:ft,relationships:D,externalTargets:ut,contentTypes:rn,mainDocumentPart:"/word/document.xml"}),lastMarkCovered:t$1.lastMarkCovered,blockCount:R.length,mediaBytes:at}}
2
+ export{ze as A,Ue as B,He as C,Rn as D,jt as E,Tn as F,on as a,Ft as b,re as c,$ as d,oe as e,ie as f,v as g,dn as h,A as i,W as j,ae as k,K as l,se as m,_e as n,Me as o,Le as p,un as q,fn as r,Fe as s,Vt as t,yn as u,De as v,hn as w,G as x,Be as y,Ve as z};
@@ -1 +1 @@
1
- 'use strict';var chunkXCFM3G5L_cjs=require('../chunk-XCFM3G5L.cjs');require('../chunk-ILTZTY3K.cjs');Object.defineProperty(exports,"createCollaborationDocumentPort",{enumerable:true,get:function(){return chunkXCFM3G5L_cjs.b}});
1
+ 'use strict';var chunkKIAP7PFQ_cjs=require('../chunk-KIAP7PFQ.cjs');require('../chunk-NJNFJPGB.cjs');Object.defineProperty(exports,"createCollaborationDocumentPort",{enumerable:true,get:function(){return chunkKIAP7PFQ_cjs.b}});
@@ -1,6 +1,6 @@
1
- import { T as TreeModelChange } from '../tree-store-BenW0Mg_.cjs';
2
- import { g as OoxmlElement, b as OoxmlPackage } from '../tree-op-types-CA7qgAUF.cjs';
3
- import { T as TreePackageStore } from '../tree-package-fragment-Cz-v-0B3.cjs';
1
+ import { T as TreeModelChange } from '../tree-store-DEEQ9wz_.cjs';
2
+ import { g as OoxmlElement, b as OoxmlPackage } from '../tree-op-types-BUulYD5y.cjs';
3
+ import { T as TreePackageStore } from '../tree-package-fragment-Dhyw7oPm.cjs';
4
4
  import '../contracts/types.cjs';
5
5
 
6
6
  /** Attribute name as the journal addresses it. Prefix is authored fidelity, not identity. @public */
@@ -1,6 +1,6 @@
1
- import { T as TreeModelChange } from '../tree-store-B7hd6cEa.js';
2
- import { g as OoxmlElement, b as OoxmlPackage } from '../tree-op-types-HKfUzt_-.js';
3
- import { T as TreePackageStore } from '../tree-package-fragment-oJZX_5iN.js';
1
+ import { T as TreeModelChange } from '../tree-store-APgWx6qn.js';
2
+ import { g as OoxmlElement, b as OoxmlPackage } from '../tree-op-types-D6HzlPR4.js';
3
+ import { T as TreePackageStore } from '../tree-package-fragment-CWFjgH6a.js';
4
4
  import '../contracts/types.js';
5
5
 
6
6
  /** Attribute name as the journal addresses it. Prefix is authored fidelity, not identity. @public */
@@ -1 +1 @@
1
- export{b as createCollaborationDocumentPort}from'../chunk-W77HJGYX.js';import'../chunk-L6XZTLPS.js';
1
+ export{b as createCollaborationDocumentPort}from'../chunk-OKEDGR65.js';import'../chunk-ZBEJHJN2.js';
@@ -1,9 +1,9 @@
1
- import { S as StoryScope } from './tree-package-fragment-Cz-v-0B3.cjs';
2
- import { T as TreeDocOp } from './tree-op-types-CA7qgAUF.cjs';
1
+ import { S as StoryScope } from './tree-package-fragment-Dhyw7oPm.cjs';
2
+ import { T as TreeDocOp } from './tree-op-types-BUulYD5y.cjs';
3
3
  import { CollaborationDocumentPort } from './collaboration/replication.cjs';
4
4
  import { C as CollaborationStatus, a as CollaborationStatusSnapshot, b as CollaborationFailureCode } from './failure-BnGjoXf0.cjs';
5
5
  export { c as CollaborationFailure, d as createCollaborationStatusTracker, i as isCollaborationFailureCode } from './failure-BnGjoXf0.cjs';
6
- import './tree-store-BenW0Mg_.cjs';
6
+ import './tree-store-DEEQ9wz_.cjs';
7
7
  import './contracts/types.cjs';
8
8
 
9
9
  /**
@@ -1,9 +1,9 @@
1
- import { S as StoryScope } from './tree-package-fragment-oJZX_5iN.js';
2
- import { T as TreeDocOp } from './tree-op-types-HKfUzt_-.js';
1
+ import { S as StoryScope } from './tree-package-fragment-CWFjgH6a.js';
2
+ import { T as TreeDocOp } from './tree-op-types-D6HzlPR4.js';
3
3
  import { CollaborationDocumentPort } from './collaboration/replication.js';
4
4
  import { C as CollaborationStatus, a as CollaborationStatusSnapshot, b as CollaborationFailureCode } from './failure-BnGjoXf0.js';
5
5
  export { c as CollaborationFailure, d as createCollaborationStatusTracker, i as isCollaborationFailureCode } from './failure-BnGjoXf0.js';
6
- import './tree-store-B7hd6cEa.js';
6
+ import './tree-store-APgWx6qn.js';
7
7
  import './contracts/types.js';
8
8
 
9
9
  /**
@@ -1,10 +1,10 @@
1
1
  export { ContentControlSummary, DocEdits, DocQueries, DocQueryResults, ParagraphSummary } from './document.cjs';
2
- export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind } from '../review-items-C-2WQdEb.cjs';
3
- export { A as AuthoredNoteNumbering, C as CanResult, r as DocumentChange, t as DocumentEditingMode, u as DocumentHandle, D as DocumentSource, l as Editor, b as EditorCommand, w as EditorCommandShape, x as EditorCommands, y as EditorError, z as EditorEvents, E as EditorFontError, B as EditorFontErrorCode, G as EditorFormatPainterCommands, H as EditorHeaderFooterCommands, J as EditorNoteCommands, K as EditorPosition, L as EditorQueries, M as EditorQuery, N as EditorQueryResults, O as EditorScope, P as EditorSelection, a as EditorSnapshot, F as FontConfiguration, n as FontFaceRequest, j as FontSource, k as FontSourceSubstitution, Q as FormatPainterLevel, R as FormatPainterMode, m as FormatPainterSurfaceState, U as FurnitureVariant, W as HeaderFooterSlotArgs, X as HeaderFooterState, Y as HyperlinkInfo, I as ImageContext, c as ImageCropPercent, _ as InteractionAffinity, $ as InteractionOutcome, a0 as InteractionOutcomeCode, a1 as NoteKind, a2 as NotePropertiesSide, a3 as NotePropertiesState, a4 as PageSetup, a5 as ResolvedNoteNumbering, a6 as ReviewActivationOptions, a7 as ReviewCommentPlacement, a8 as ReviewCustomPlacement, a9 as ReviewItemPlacement, aa as ReviewItemPlacementBase, ab as ReviewItemQuery, ac as ReviewRevisionPlacement, S as SelectedImageState, ad as SemanticIdentity, ae as SemanticTarget, T as TableBorderEdgeTarget, o as TableBorderSpec, p as TableBorderStyle, af as TableBorderTarget, ag as TableCellVerticalAlignment, ah as TableColumnDividerResizeTarget, ai as TableColumnOccurrenceTarget, q as TableContext, aj as TableRightEdgeResizeTarget, ak as TableRowOccurrenceTarget, al as TextMatch, V as ViewScope, am as ZoomFitTarget, Z as ZoomMode } from '../editor-B76SEMZw.cjs';
4
- export { S as SemanticPosition, a as SemanticSelection } from '../semantic-interaction-DiOX0FIH.cjs';
5
- export { z as DrawingHorizontalReferenceFrame, D as DrawingKind, w as DrawingLocks, v as DrawingPositionInput, A as DrawingVerticalReferenceFrame, x as ImageResourceState, u as ImageWrapTarget, P as PreservedImageMime, t as RenderableImageMime, R as RevisionAddress, y as SupportedImageMime, V as ValidatedImageBytesHandle, B as VectorImageMime } from '../tree-op-types-CA7qgAUF.cjs';
2
+ export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind } from '../review-items-CaAkgi5s.cjs';
3
+ export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, b as EditorCommand, y as EditorCommandShape, z as EditorCommands, B as EditorError, G as EditorEvents, E as EditorFontError, H as EditorFontErrorCode, J as EditorFormatPainterCommands, K as EditorHeaderFooterCommands, L as EditorNoteCommands, M as EditorPosition, N as EditorQueries, O as EditorQuery, P as EditorQueryResults, Q as EditorScope, R as EditorSelection, a as EditorSnapshot, F as FontConfiguration, m as FontFaceRequest, k as FontSource, l as FontSourceSubstitution, U as FormatPainterLevel, W as FormatPainterMode, o as FormatPainterSurfaceState, X as FurnitureVariant, Y as HeaderFooterSlotArgs, _ as HeaderFooterState, $ as HyperlinkInfo, I as ImageContext, c as ImageCropPercent, a0 as InteractionAffinity, a1 as InteractionOutcome, a2 as InteractionOutcomeCode, a3 as NoteKind, a4 as NotePropertiesSide, a5 as NotePropertiesState, a6 as PageSetup, a7 as ResolvedNoteNumbering, a8 as ReviewActivationOptions, a9 as ReviewCommentPlacement, aa as ReviewCustomPlacement, ab as ReviewItemPlacement, ac as ReviewItemPlacementBase, ad as ReviewItemQuery, ae as ReviewRevisionPlacement, S as SelectedImageState, af as SemanticIdentity, ag as SemanticTarget, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, ah as TableBorderTarget, ai as TableCellVerticalAlignment, aj as TableColumnDividerResizeTarget, ak as TableColumnOccurrenceTarget, t as TableContext, al as TableRightEdgeResizeTarget, am as TableRowOccurrenceTarget, an as TextMatch, T as TrackedChangeFilterMode, e as TrackedChangePredicate, V as ViewScope, ao as ZoomFitTarget, Z as ZoomMode } from '../editor-AJ06hyyg.cjs';
4
+ export { S as SemanticPosition, a as SemanticSelection } from '../semantic-interaction-DUAnxbgf.cjs';
5
+ export { z as DrawingHorizontalReferenceFrame, D as DrawingKind, w as DrawingLocks, v as DrawingPositionInput, A as DrawingVerticalReferenceFrame, x as ImageResourceState, u as ImageWrapTarget, P as PreservedImageMime, t as RenderableImageMime, R as RevisionAddress, y as SupportedImageMime, V as ValidatedImageBytesHandle, B as VectorImageMime } from '../tree-op-types-BUulYD5y.cjs';
6
6
  export { Block, ColorValue, ContainerRef, ContentControl, ContentControlFilter, ContentControlType, DocAnchor, DocAnchorRange, DocComment, DocLocation, DocRange, DocTarget, DocumentBody, DocxDocument, DocxDocumentJSON, ExecErrorCode, ExecResult, Extent, FontDefinition, HeaderFooterSet, IndentFormatting, InsertableContentControlType, NumberingRef, PageMargins, Paragraph, ParagraphDisagreements, ParagraphFlags, ParagraphFormatCommand, ParagraphTabStop, Point, Rect, Revision, RevisionType, Run, RunFormatting, Section, SectionProperties, SelectionPin, StyleDefinition, StyleDefinitions, Table, TableCell, TableRow, Theme, ThemeColorScheme, Unsubscribe, Watermark } from './types.cjs';
7
7
  import '../failure-BnGjoXf0.cjs';
8
- import '../semantic-records-CRG1r6-a.cjs';
9
- import '../revision-projection-6u8lae9J.cjs';
10
- import '../omml-equation-BmV51rim.cjs';
8
+ import '../semantic-records-BpozY7-j.cjs';
9
+ import '../revision-projection-DXbrfNGD.cjs';
10
+ import '../omml-equation-DB8d-jCq.cjs';
@@ -1,10 +1,10 @@
1
1
  export { ContentControlSummary, DocEdits, DocQueries, DocQueryResults, ParagraphSummary } from './document.js';
2
- export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind } from '../review-items-B78OsJU2.js';
3
- export { A as AuthoredNoteNumbering, C as CanResult, r as DocumentChange, t as DocumentEditingMode, u as DocumentHandle, D as DocumentSource, l as Editor, b as EditorCommand, w as EditorCommandShape, x as EditorCommands, y as EditorError, z as EditorEvents, E as EditorFontError, B as EditorFontErrorCode, G as EditorFormatPainterCommands, H as EditorHeaderFooterCommands, J as EditorNoteCommands, K as EditorPosition, L as EditorQueries, M as EditorQuery, N as EditorQueryResults, O as EditorScope, P as EditorSelection, a as EditorSnapshot, F as FontConfiguration, n as FontFaceRequest, j as FontSource, k as FontSourceSubstitution, Q as FormatPainterLevel, R as FormatPainterMode, m as FormatPainterSurfaceState, U as FurnitureVariant, W as HeaderFooterSlotArgs, X as HeaderFooterState, Y as HyperlinkInfo, I as ImageContext, c as ImageCropPercent, _ as InteractionAffinity, $ as InteractionOutcome, a0 as InteractionOutcomeCode, a1 as NoteKind, a2 as NotePropertiesSide, a3 as NotePropertiesState, a4 as PageSetup, a5 as ResolvedNoteNumbering, a6 as ReviewActivationOptions, a7 as ReviewCommentPlacement, a8 as ReviewCustomPlacement, a9 as ReviewItemPlacement, aa as ReviewItemPlacementBase, ab as ReviewItemQuery, ac as ReviewRevisionPlacement, S as SelectedImageState, ad as SemanticIdentity, ae as SemanticTarget, T as TableBorderEdgeTarget, o as TableBorderSpec, p as TableBorderStyle, af as TableBorderTarget, ag as TableCellVerticalAlignment, ah as TableColumnDividerResizeTarget, ai as TableColumnOccurrenceTarget, q as TableContext, aj as TableRightEdgeResizeTarget, ak as TableRowOccurrenceTarget, al as TextMatch, V as ViewScope, am as ZoomFitTarget, Z as ZoomMode } from '../editor-BcdsPdbY.js';
4
- export { S as SemanticPosition, a as SemanticSelection } from '../semantic-interaction-C00BpIyC.js';
5
- export { z as DrawingHorizontalReferenceFrame, D as DrawingKind, w as DrawingLocks, v as DrawingPositionInput, A as DrawingVerticalReferenceFrame, x as ImageResourceState, u as ImageWrapTarget, P as PreservedImageMime, t as RenderableImageMime, R as RevisionAddress, y as SupportedImageMime, V as ValidatedImageBytesHandle, B as VectorImageMime } from '../tree-op-types-HKfUzt_-.js';
2
+ export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind } from '../review-items-CCS1h93f.js';
3
+ export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, b as EditorCommand, y as EditorCommandShape, z as EditorCommands, B as EditorError, G as EditorEvents, E as EditorFontError, H as EditorFontErrorCode, J as EditorFormatPainterCommands, K as EditorHeaderFooterCommands, L as EditorNoteCommands, M as EditorPosition, N as EditorQueries, O as EditorQuery, P as EditorQueryResults, Q as EditorScope, R as EditorSelection, a as EditorSnapshot, F as FontConfiguration, m as FontFaceRequest, k as FontSource, l as FontSourceSubstitution, U as FormatPainterLevel, W as FormatPainterMode, o as FormatPainterSurfaceState, X as FurnitureVariant, Y as HeaderFooterSlotArgs, _ as HeaderFooterState, $ as HyperlinkInfo, I as ImageContext, c as ImageCropPercent, a0 as InteractionAffinity, a1 as InteractionOutcome, a2 as InteractionOutcomeCode, a3 as NoteKind, a4 as NotePropertiesSide, a5 as NotePropertiesState, a6 as PageSetup, a7 as ResolvedNoteNumbering, a8 as ReviewActivationOptions, a9 as ReviewCommentPlacement, aa as ReviewCustomPlacement, ab as ReviewItemPlacement, ac as ReviewItemPlacementBase, ad as ReviewItemQuery, ae as ReviewRevisionPlacement, S as SelectedImageState, af as SemanticIdentity, ag as SemanticTarget, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, ah as TableBorderTarget, ai as TableCellVerticalAlignment, aj as TableColumnDividerResizeTarget, ak as TableColumnOccurrenceTarget, t as TableContext, al as TableRightEdgeResizeTarget, am as TableRowOccurrenceTarget, an as TextMatch, T as TrackedChangeFilterMode, e as TrackedChangePredicate, V as ViewScope, ao as ZoomFitTarget, Z as ZoomMode } from '../editor-a6VvsfYU.js';
4
+ export { S as SemanticPosition, a as SemanticSelection } from '../semantic-interaction-BmQ7h2cq.js';
5
+ export { z as DrawingHorizontalReferenceFrame, D as DrawingKind, w as DrawingLocks, v as DrawingPositionInput, A as DrawingVerticalReferenceFrame, x as ImageResourceState, u as ImageWrapTarget, P as PreservedImageMime, t as RenderableImageMime, R as RevisionAddress, y as SupportedImageMime, V as ValidatedImageBytesHandle, B as VectorImageMime } from '../tree-op-types-D6HzlPR4.js';
6
6
  export { Block, ColorValue, ContainerRef, ContentControl, ContentControlFilter, ContentControlType, DocAnchor, DocAnchorRange, DocComment, DocLocation, DocRange, DocTarget, DocumentBody, DocxDocument, DocxDocumentJSON, ExecErrorCode, ExecResult, Extent, FontDefinition, HeaderFooterSet, IndentFormatting, InsertableContentControlType, NumberingRef, PageMargins, Paragraph, ParagraphDisagreements, ParagraphFlags, ParagraphFormatCommand, ParagraphTabStop, Point, Rect, Revision, RevisionType, Run, RunFormatting, Section, SectionProperties, SelectionPin, StyleDefinition, StyleDefinitions, Table, TableCell, TableRow, Theme, ThemeColorScheme, Unsubscribe, Watermark } from './types.js';
7
7
  import '../failure-BnGjoXf0.js';
8
- import '../semantic-records-CzI0ZEuR.js';
9
- import '../revision-projection-B2v9U3qx.js';
10
- import '../omml-equation-69O1Pd8G.js';
8
+ import '../semantic-records-92UnKeU_.js';
9
+ import '../revision-projection-BeXVrSSV.js';
10
+ import '../omml-equation-BY49UOIF.js';
@@ -1,10 +1,10 @@
1
- export { O as EditorScope, _ as InteractionAffinity, $ as InteractionOutcome, a0 as InteractionOutcomeCode, ad as SemanticIdentity, ae as SemanticTarget, V as ViewScope } from '../editor-B76SEMZw.cjs';
1
+ export { Q as EditorScope, a0 as InteractionAffinity, a1 as InteractionOutcome, a2 as InteractionOutcomeCode, af as SemanticIdentity, ag as SemanticTarget, V as ViewScope } from '../editor-AJ06hyyg.cjs';
2
2
  import './document.cjs';
3
3
  import './types.cjs';
4
- import '../review-items-C-2WQdEb.cjs';
5
- import '../tree-op-types-CA7qgAUF.cjs';
6
- import '../semantic-interaction-DiOX0FIH.cjs';
7
- import '../semantic-records-CRG1r6-a.cjs';
8
- import '../revision-projection-6u8lae9J.cjs';
9
- import '../omml-equation-BmV51rim.cjs';
4
+ import '../review-items-CaAkgi5s.cjs';
5
+ import '../tree-op-types-BUulYD5y.cjs';
6
+ import '../semantic-interaction-DUAnxbgf.cjs';
7
+ import '../semantic-records-BpozY7-j.cjs';
8
+ import '../revision-projection-DXbrfNGD.cjs';
9
+ import '../omml-equation-DB8d-jCq.cjs';
10
10
  import '../failure-BnGjoXf0.cjs';
@@ -1,10 +1,10 @@
1
- export { O as EditorScope, _ as InteractionAffinity, $ as InteractionOutcome, a0 as InteractionOutcomeCode, ad as SemanticIdentity, ae as SemanticTarget, V as ViewScope } from '../editor-BcdsPdbY.js';
1
+ export { Q as EditorScope, a0 as InteractionAffinity, a1 as InteractionOutcome, a2 as InteractionOutcomeCode, af as SemanticIdentity, ag as SemanticTarget, V as ViewScope } from '../editor-a6VvsfYU.js';
2
2
  import './document.js';
3
3
  import './types.js';
4
- import '../review-items-B78OsJU2.js';
5
- import '../tree-op-types-HKfUzt_-.js';
6
- import '../semantic-interaction-C00BpIyC.js';
7
- import '../semantic-records-CzI0ZEuR.js';
8
- import '../revision-projection-B2v9U3qx.js';
9
- import '../omml-equation-69O1Pd8G.js';
4
+ import '../review-items-CCS1h93f.js';
5
+ import '../tree-op-types-D6HzlPR4.js';
6
+ import '../semantic-interaction-BmQ7h2cq.js';
7
+ import '../semantic-records-92UnKeU_.js';
8
+ import '../revision-projection-BeXVrSSV.js';
9
+ import '../omml-equation-BY49UOIF.js';
10
10
  import '../failure-BnGjoXf0.js';
@@ -1,12 +1,12 @@
1
- import { O as OoxmlPart } from '../tree-op-types-CA7qgAUF.cjs';
2
- export { R as RevisionAddress } from '../tree-op-types-CA7qgAUF.cjs';
3
- import { R as ReviewModelInput, a as ReviewItem, b as ReviewRevisionItem } from '../review-items-C-2WQdEb.cjs';
4
- export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, e as ReviewPosition, f as ReviewRange, g as ReviewRevisionKind } from '../review-items-C-2WQdEb.cjs';
1
+ import { O as OoxmlPart } from '../tree-op-types-BUulYD5y.cjs';
2
+ export { R as RevisionAddress } from '../tree-op-types-BUulYD5y.cjs';
3
+ import { R as ReviewModelInput, a as ReviewItem, b as ReviewRevisionItem } from '../review-items-CaAkgi5s.cjs';
4
+ export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, e as ReviewPosition, f as ReviewRange, g as ReviewRevisionKind } from '../review-items-CaAkgi5s.cjs';
5
5
  import { CollaborationModuleContribution } from '../collaboration.cjs';
6
- import { R as RevisionDisplayMode } from '../revision-projection-6u8lae9J.cjs';
6
+ import { R as RevisionDisplayMode } from '../revision-projection-DXbrfNGD.cjs';
7
7
  import './types.cjs';
8
- import '../tree-package-fragment-Cz-v-0B3.cjs';
9
- import '../tree-store-BenW0Mg_.cjs';
8
+ import '../tree-package-fragment-Dhyw7oPm.cjs';
9
+ import '../tree-store-DEEQ9wz_.cjs';
10
10
  import '../collaboration/replication.cjs';
11
11
  import '../failure-BnGjoXf0.cjs';
12
12
 
@@ -1,12 +1,12 @@
1
- import { O as OoxmlPart } from '../tree-op-types-HKfUzt_-.js';
2
- export { R as RevisionAddress } from '../tree-op-types-HKfUzt_-.js';
3
- import { R as ReviewModelInput, a as ReviewItem, b as ReviewRevisionItem } from '../review-items-B78OsJU2.js';
4
- export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, e as ReviewPosition, f as ReviewRange, g as ReviewRevisionKind } from '../review-items-B78OsJU2.js';
1
+ import { O as OoxmlPart } from '../tree-op-types-D6HzlPR4.js';
2
+ export { R as RevisionAddress } from '../tree-op-types-D6HzlPR4.js';
3
+ import { R as ReviewModelInput, a as ReviewItem, b as ReviewRevisionItem } from '../review-items-CCS1h93f.js';
4
+ export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, e as ReviewPosition, f as ReviewRange, g as ReviewRevisionKind } from '../review-items-CCS1h93f.js';
5
5
  import { CollaborationModuleContribution } from '../collaboration.js';
6
- import { R as RevisionDisplayMode } from '../revision-projection-B2v9U3qx.js';
6
+ import { R as RevisionDisplayMode } from '../revision-projection-BeXVrSSV.js';
7
7
  import './types.js';
8
- import '../tree-package-fragment-oJZX_5iN.js';
9
- import '../tree-store-B7hd6cEa.js';
8
+ import '../tree-package-fragment-CWFjgH6a.js';
9
+ import '../tree-store-APgWx6qn.js';
10
10
  import '../collaboration/replication.js';
11
11
  import '../failure-BnGjoXf0.js';
12
12
 
@@ -1,5 +1,5 @@
1
- import { b as OoxmlPackage, O as OoxmlPart, a as OoxmlNode, r as TreeOpRejection } from './tree-op-types-CA7qgAUF.cjs';
2
- import { T as TreeModelChange, a as TreeDocumentStore } from './tree-store-BenW0Mg_.cjs';
1
+ import { b as OoxmlPackage, O as OoxmlPart, a as OoxmlNode, r as TreeOpRejection } from './tree-op-types-BUulYD5y.cjs';
2
+ import { T as TreeModelChange, a as TreeDocumentStore } from './tree-store-DEEQ9wz_.cjs';
3
3
 
4
4
  /** Which of a family's four faces an embedded font relationship supplies. */
5
5
  type FontStyleKey = 'regular' | 'bold' | 'italic' | 'boldItalic';
@@ -1,5 +1,5 @@
1
- import { b as OoxmlPackage, O as OoxmlPart, a as OoxmlNode, r as TreeOpRejection } from './tree-op-types-HKfUzt_-.js';
2
- import { T as TreeModelChange, a as TreeDocumentStore } from './tree-store-B7hd6cEa.js';
1
+ import { b as OoxmlPackage, O as OoxmlPart, a as OoxmlNode, r as TreeOpRejection } from './tree-op-types-D6HzlPR4.js';
2
+ import { T as TreeModelChange, a as TreeDocumentStore } from './tree-store-APgWx6qn.js';
3
3
 
4
4
  /** Which of a family's four faces an embedded font relationship supplies. */
5
5
  type FontStyleKey = 'regular' | 'bold' | 'italic' | 'boldItalic';
@@ -1,2 +1,2 @@
1
- import {b}from'./chunk-WU7PUTVA.js';async function Pr(s={}){var _,t=s,r=typeof window=="object",a=typeof WorkerGlobalScope<"u",o=typeof process=="object"&&process.versions?.node&&process.type!="renderer";if(o){let{createRequire:e}=await import('./node-module-shim-TTKTT66I.js');var i=e(import.meta.url);}var l=(e,h)=>{throw h},b$1=import.meta.url,d="";function T(e){return t.locateFile?t.locateFile(e,d):d+e}var m,R;if(o){var L=i("fs");b$1.startsWith("file:")&&(d=i("path").dirname(i("url").fileURLToPath(b$1))+"/"),R=e=>{e=X(e)?new URL(e):e;var h=L.readFileSync(e);return h},m=async(e,h=true)=>{e=X(e)?new URL(e):e;var y=L.readFileSync(e,h?void 0:"utf8");return y},process.argv.length>1&&(process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),l=(e,h)=>{throw process.exitCode=e,h};}else if(r||a){try{d=new URL(".",b$1).href;}catch{}a&&(R=e=>{var h=new XMLHttpRequest;return h.open("GET",e,false),h.responseType="arraybuffer",h.send(null),new Uint8Array(h.response)}),m=async e=>{if(X(e))return new Promise((y,A)=>{var P=new XMLHttpRequest;P.open("GET",e,true),P.responseType="arraybuffer",P.onload=()=>{if(P.status==200||P.status==0&&P.response){y(P.response);return}A(P.status);},P.onerror=A,P.send(null);});var h=await fetch(e,{credentials:"same-origin"});if(h.ok)return h.arrayBuffer();throw new Error(h.status+" : "+h.url)};}console.log.bind(console);var C=console.error.bind(console),B,Y=false,Z,X=e=>e.startsWith("file://"),ct,it,j,ut,ft=false;function ht(){var e=j.buffer;t.HEAP8=new Int8Array(e),t.HEAPU8=ut=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAP32=new Int32Array(e),t.HEAPU32=new Uint32Array(e),t.HEAPF32=new Float32Array(e),new BigInt64Array(e),new BigUint64Array(e);}function Kt(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)c_(t.preRun.shift());pt(dt);}function Jt(){ft=true,F.__wasm_call_ctors();}function Qt(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)o_(t.postRun.shift());pt(gt);}var O=0,M=null;function qt(e){O++,t.monitorRunDependencies?.(O);}function xt(e){if(O--,t.monitorRunDependencies?.(O),O==0&&M){var h=M;M=null,h();}}function lt(e){t.onAbort?.(e),e="Aborted("+e+")",C(e),Y=true,e+=". Build with -sASSERTIONS for more info.";var h=new WebAssembly.RuntimeError(e);throw it?.(h),h}var q;function t_(){return t.locateFile?T("harfbuzz.wasm"):b(new URL("harfbuzz.wasm",import.meta.url).href)}function __(e){if(e==q&&B)return new Uint8Array(B);if(R)return R(e);throw "both async and sync fetching of the wasm failed"}async function e_(e){if(!B)try{var h=await m(e);return new Uint8Array(h)}catch{}return __(e)}async function n_(e,h){try{var y=await e_(e),A=await WebAssembly.instantiate(y,h);return A}catch(P){C(`failed to asynchronously prepare wasm: ${P}`),lt(P);}}async function r_(e,h,y){if(!e&&!X(h)&&!o)try{var A=fetch(h,{credentials:"same-origin"}),P=await WebAssembly.instantiateStreaming(A,y);return P}catch(H){C(`wasm streaming compile failed: ${H}`),C("falling back to ArrayBuffer instantiation");}return n_(h,y)}function s_(){return {env:kt,wasi_snapshot_preview1:kt}}async function a_(){function e(H,nt){return F=H.exports,t.wasmExports=F,j=F.memory,ht(),W=F.__indirect_function_table,pr(F),xt(),F}qt();function h(H){return e(H.instance)}var y=s_();if(t.instantiateWasm)return new Promise((H,nt)=>{t.instantiateWasm(y,(dr,yr)=>{H(e(dr));});});q??=t_();var A=await r_(B,q,y),P=h(A);return P}class bt{name="ExitStatus";constructor(h){this.message=`Program terminated with exit(${h})`,this.status=h;}}var pt=e=>{for(;e.length>0;)e.shift()(t);},gt=[],o_=e=>gt.push(e),dt=[],c_=e=>dt.push(e),x=true,i_=e=>Rt(e),u_=()=>Ft(),f_=()=>lt(""),yt=0,h_=()=>{x=false,yt=0;},V={},Pt=e=>{if(e instanceof bt||e=="unwind")return Z;l(1,e);},At=()=>x||yt>0,vt=e=>{Z=e,At()||(t.onExit?.(e),Y=true),l(e,new bt(e));},l_=(e,h)=>{Z=e,vt(e);},b_=l_,p_=()=>{if(!At())try{b_(Z);}catch(e){Pt(e);}},g_=e=>{if(!Y)try{e(),p_();}catch(h){Pt(h);}},d_=()=>performance.now(),y_=(e,h)=>{if(V[e]&&(clearTimeout(V[e].id),delete V[e]),!h)return 0;var y=setTimeout(()=>{delete V[e],g_(()=>Ht(e,d_()));},h);return V[e]={id:y,timeout_ms:h},0},P_=()=>2147483648,A_=(e,h)=>Math.ceil(e/h)*h,v_=e=>{var h=j.buffer.byteLength,y=(e-h+65535)/65536|0;try{return j.grow(y),ht(),1}catch{}},T_=e=>{var h=ut.length;e>>>=0;var y=P_();if(e>y)return false;for(var A=1;A<=4;A*=2){var P=h*(1+.2/A);P=Math.min(P,e+100663296);var H=Math.min(y,A_(Math.max(e,P),65536)),nt=v_(H);if(nt)return true}return false},Tt=e=>{let h=e.length;return [h%128|128,h>>7,...e]},m_={i:127,p:127,j:126,f:125,d:124,e:111},mt=e=>Tt(Array.from(e,h=>{var y=m_[h];return y})),E_=(e,h)=>{var y=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Tt([1,96,...mt(h.slice(1)),...mt(h[0]==="v"?"":h[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),A=new WebAssembly.Module(y),P=new WebAssembly.Instance(A,{e:{f:e}}),H=P.exports.f;return H},W,Et=e=>W.get(e),H_=(e,h)=>{if(D)for(var y=e;y<e+h;y++){var A=Et(y);A&&D.set(A,y);}},D,R_=e=>(D||(D=new WeakMap,H_(0,W.length)),D.get(e)||0),tt=[],S_=()=>tt.length?tt.pop():W.grow(1),_t=(e,h)=>W.set(e,h),F_=(e,h)=>{var y=R_(e);if(y)return y;var A=S_();try{_t(A,e);}catch(H){if(!(H instanceof TypeError))throw H;var P=E_(e,h);_t(A,P);}return D.set(e,A),A},k_=e=>{D.delete(Et(e)),_t(e,null),tt.push(e);},U_=e=>St(e);t.noExitRuntime&&(x=t.noExitRuntime),t.print&&(t.print),t.printErr&&(C=t.printErr),t.wasmBinary&&(B=t.wasmBinary),t.arguments&&(t.arguments),t.thisProgram&&(t.thisProgram),t.wasmExports=F,t.stackSave=u_,t.stackRestore=i_,t.stackAlloc=U_,t.addFunction=F_,t.removeFunction=k_;var Ht,Rt,St,Ft;function pr(e){t._hb_blob_create=e.hb_blob_create,t._hb_blob_destroy=e.hb_blob_destroy,t._hb_blob_get_length=e.hb_blob_get_length,t._hb_blob_get_data=e.hb_blob_get_data,t._hb_buffer_serialize=e.hb_buffer_serialize,t._hb_buffer_create=e.hb_buffer_create,t._hb_buffer_reset=e.hb_buffer_reset,t._hb_buffer_reference=e.hb_buffer_reference,t._hb_buffer_destroy=e.hb_buffer_destroy,t._hb_buffer_get_content_type=e.hb_buffer_get_content_type,t._hb_buffer_set_direction=e.hb_buffer_set_direction,t._hb_buffer_set_script=e.hb_buffer_set_script,t._hb_buffer_set_language=e.hb_buffer_set_language,t._hb_buffer_set_flags=e.hb_buffer_set_flags,t._hb_buffer_set_cluster_level=e.hb_buffer_set_cluster_level,t._hb_buffer_clear_contents=e.hb_buffer_clear_contents,t._hb_buffer_add=e.hb_buffer_add,t._hb_buffer_get_length=e.hb_buffer_get_length,t._hb_buffer_get_glyph_infos=e.hb_buffer_get_glyph_infos,t._hb_buffer_get_glyph_positions=e.hb_buffer_get_glyph_positions,t._hb_glyph_info_get_glyph_flags=e.hb_glyph_info_get_glyph_flags,t._hb_buffer_guess_segment_properties=e.hb_buffer_guess_segment_properties,t._hb_buffer_add_utf8=e.hb_buffer_add_utf8,t._hb_buffer_add_utf16=e.hb_buffer_add_utf16,t._hb_buffer_add_codepoints=e.hb_buffer_add_codepoints,t._hb_buffer_set_message_func=e.hb_buffer_set_message_func,t._hb_language_from_string=e.hb_language_from_string,t._hb_language_to_string=e.hb_language_to_string,t._hb_script_from_string=e.hb_script_from_string,t._hb_version=e.hb_version,t._hb_version_string=e.hb_version_string,t._hb_feature_from_string=e.hb_feature_from_string,t._hb_feature_to_string=e.hb_feature_to_string,t._hb_variation_from_string=e.hb_variation_from_string,t._hb_variation_to_string=e.hb_variation_to_string,t._malloc=e.malloc,t._free=e.free,t._hb_draw_funcs_set_move_to_func=e.hb_draw_funcs_set_move_to_func,t._hb_draw_funcs_set_line_to_func=e.hb_draw_funcs_set_line_to_func,t._hb_draw_funcs_set_quadratic_to_func=e.hb_draw_funcs_set_quadratic_to_func,t._hb_draw_funcs_set_cubic_to_func=e.hb_draw_funcs_set_cubic_to_func,t._hb_draw_funcs_set_close_path_func=e.hb_draw_funcs_set_close_path_func,t._hb_draw_funcs_create=e.hb_draw_funcs_create,t._hb_draw_funcs_destroy=e.hb_draw_funcs_destroy,t._hb_face_create=e.hb_face_create,t._hb_face_reference=e.hb_face_reference,t._hb_face_destroy=e.hb_face_destroy,t._hb_face_reference_table=e.hb_face_reference_table,t._hb_face_get_upem=e.hb_face_get_upem,t._hb_face_collect_unicodes=e.hb_face_collect_unicodes,t._hb_font_funcs_create=e.hb_font_funcs_create,t._hb_font_funcs_destroy=e.hb_font_funcs_destroy,t._hb_font_funcs_set_font_h_extents_func=e.hb_font_funcs_set_font_h_extents_func,t._hb_font_funcs_set_font_v_extents_func=e.hb_font_funcs_set_font_v_extents_func,t._hb_font_funcs_set_nominal_glyph_func=e.hb_font_funcs_set_nominal_glyph_func,t._hb_font_funcs_set_nominal_glyphs_func=e.hb_font_funcs_set_nominal_glyphs_func,t._hb_font_funcs_set_variation_glyph_func=e.hb_font_funcs_set_variation_glyph_func,t._hb_font_funcs_set_glyph_h_advance_func=e.hb_font_funcs_set_glyph_h_advance_func,t._hb_font_funcs_set_glyph_v_advance_func=e.hb_font_funcs_set_glyph_v_advance_func,t._hb_font_funcs_set_glyph_h_advances_func=e.hb_font_funcs_set_glyph_h_advances_func,t._hb_font_funcs_set_glyph_v_advances_func=e.hb_font_funcs_set_glyph_v_advances_func,t._hb_font_funcs_set_glyph_h_origin_func=e.hb_font_funcs_set_glyph_h_origin_func,t._hb_font_funcs_set_glyph_v_origin_func=e.hb_font_funcs_set_glyph_v_origin_func,t._hb_font_funcs_set_glyph_h_kerning_func=e.hb_font_funcs_set_glyph_h_kerning_func,t._hb_font_funcs_set_glyph_extents_func=e.hb_font_funcs_set_glyph_extents_func,t._hb_font_funcs_set_glyph_name_func=e.hb_font_funcs_set_glyph_name_func,t._hb_font_funcs_set_glyph_from_name_func=e.hb_font_funcs_set_glyph_from_name_func,t._hb_font_get_h_extents=e.hb_font_get_h_extents,t._hb_font_get_v_extents=e.hb_font_get_v_extents,t._hb_font_get_glyph=e.hb_font_get_glyph,t._hb_font_get_nominal_glyph=e.hb_font_get_nominal_glyph,t._hb_font_get_variation_glyph=e.hb_font_get_variation_glyph,t._hb_font_get_glyph_h_advance=e.hb_font_get_glyph_h_advance,t._hb_font_get_glyph_v_advance=e.hb_font_get_glyph_v_advance,t._hb_font_get_glyph_h_origin=e.hb_font_get_glyph_h_origin,t._hb_font_get_glyph_v_origin=e.hb_font_get_glyph_v_origin,t._hb_font_get_glyph_extents=e.hb_font_get_glyph_extents,t._hb_font_get_glyph_from_name=e.hb_font_get_glyph_from_name,t._hb_font_draw_glyph_or_fail=e.hb_font_draw_glyph_or_fail,t._hb_font_paint_glyph_or_fail=e.hb_font_paint_glyph_or_fail,t._hb_font_draw_glyph=e.hb_font_draw_glyph,t._hb_font_paint_glyph=e.hb_font_paint_glyph,t._hb_font_glyph_to_string=e.hb_font_glyph_to_string,t._hb_font_create=e.hb_font_create,t._hb_font_set_variations=e.hb_font_set_variations,t._hb_font_create_sub_font=e.hb_font_create_sub_font,t._hb_font_reference=e.hb_font_reference,t._hb_font_destroy=e.hb_font_destroy,t._hb_font_get_face=e.hb_font_get_face,t._hb_font_set_funcs=e.hb_font_set_funcs,t._hb_font_set_scale=e.hb_font_set_scale,t._hb_ot_color_has_palettes=e.hb_ot_color_has_palettes,t._hb_ot_color_palette_get_count=e.hb_ot_color_palette_get_count,t._hb_ot_color_palette_get_name_id=e.hb_ot_color_palette_get_name_id,t._hb_ot_color_palette_color_get_name_id=e.hb_ot_color_palette_color_get_name_id,t._hb_ot_color_palette_get_flags=e.hb_ot_color_palette_get_flags,t._hb_ot_color_palette_get_colors=e.hb_ot_color_palette_get_colors,t._hb_ot_color_has_layers=e.hb_ot_color_has_layers,t._hb_ot_color_has_paint=e.hb_ot_color_has_paint,t._hb_ot_color_glyph_has_paint=e.hb_ot_color_glyph_has_paint,t._hb_ot_color_glyph_get_layers=e.hb_ot_color_glyph_get_layers,t._hb_ot_color_has_png=e.hb_ot_color_has_png,t._hb_ot_color_glyph_reference_png=e.hb_ot_color_glyph_reference_png,t._hb_ot_layout_get_glyph_class=e.hb_ot_layout_get_glyph_class,t._hb_ot_layout_get_ligature_carets=e.hb_ot_layout_get_ligature_carets,t._hb_ot_layout_table_get_script_tags=e.hb_ot_layout_table_get_script_tags,t._hb_ot_layout_table_get_feature_tags=e.hb_ot_layout_table_get_feature_tags,t._hb_ot_layout_script_get_language_tags=e.hb_ot_layout_script_get_language_tags,t._hb_ot_layout_language_get_feature_tags=e.hb_ot_layout_language_get_feature_tags,t._hb_ot_layout_feature_get_lookups=e.hb_ot_layout_feature_get_lookups,t._hb_ot_layout_feature_get_name_ids=e.hb_ot_layout_feature_get_name_ids,t._hb_ot_metrics_get_position_with_fallback=e.hb_ot_metrics_get_position_with_fallback,t._hb_ot_layout_lookup_get_optical_bound=e.hb_ot_layout_lookup_get_optical_bound,t._hb_ot_metrics_get_position=e.hb_ot_metrics_get_position,t._hb_ot_metrics_get_variation=e.hb_ot_metrics_get_variation,t._hb_ot_metrics_get_x_variation=e.hb_ot_metrics_get_x_variation,t._hb_ot_metrics_get_y_variation=e.hb_ot_metrics_get_y_variation,t._hb_ot_name_list_names=e.hb_ot_name_list_names,t._hb_ot_name_get_utf16=e.hb_ot_name_get_utf16,t._hb_set_create=e.hb_set_create,t._hb_set_destroy=e.hb_set_destroy,t._hb_ot_tag_to_script=e.hb_ot_tag_to_script,t._hb_ot_tag_to_language=e.hb_ot_tag_to_language,t._hb_ot_var_get_axis_infos=e.hb_ot_var_get_axis_infos,t._hb_paint_funcs_set_push_transform_func=e.hb_paint_funcs_set_push_transform_func,t._hb_paint_funcs_set_pop_transform_func=e.hb_paint_funcs_set_pop_transform_func,t._hb_paint_funcs_set_color_glyph_func=e.hb_paint_funcs_set_color_glyph_func,t._hb_paint_funcs_set_push_clip_glyph_func=e.hb_paint_funcs_set_push_clip_glyph_func,t._hb_paint_funcs_set_push_clip_rectangle_func=e.hb_paint_funcs_set_push_clip_rectangle_func,t._hb_paint_funcs_set_pop_clip_func=e.hb_paint_funcs_set_pop_clip_func,t._hb_paint_funcs_set_color_func=e.hb_paint_funcs_set_color_func,t._hb_paint_funcs_set_image_func=e.hb_paint_funcs_set_image_func,t._hb_paint_funcs_set_linear_gradient_func=e.hb_paint_funcs_set_linear_gradient_func,t._hb_paint_funcs_set_radial_gradient_func=e.hb_paint_funcs_set_radial_gradient_func,t._hb_paint_funcs_set_sweep_gradient_func=e.hb_paint_funcs_set_sweep_gradient_func,t._hb_paint_funcs_set_push_group_func=e.hb_paint_funcs_set_push_group_func,t._hb_paint_funcs_set_pop_group_func=e.hb_paint_funcs_set_pop_group_func,t._hb_paint_funcs_set_custom_palette_color_func=e.hb_paint_funcs_set_custom_palette_color_func,t._hb_paint_funcs_create=e.hb_paint_funcs_create,t._hb_paint_funcs_destroy=e.hb_paint_funcs_destroy,t._hb_color_line_get_color_stops=e.hb_color_line_get_color_stops,t._hb_color_line_get_extend=e.hb_color_line_get_extend,t._hb_set_get_population=e.hb_set_get_population,t._hb_set_next_many=e.hb_set_next_many,t._hb_shape=e.hb_shape,Ht=e._emscripten_timeout,Rt=e._emscripten_stack_restore,St=e._emscripten_stack_alloc,Ft=e.emscripten_stack_get_current;}var kt={_abort_js:f_,_emscripten_runtime_keepalive_clear:h_,_setitimer_js:y_,emscripten_resize_heap:T_,proc_exit:vt},F=await a_();function et(){if(O>0){M=et;return}if(Kt(),O>0){M=et;return}function e(){t.calledRun=true,!Y&&(Jt(),ct?.(t),t.onRuntimeInitialized?.(),Qt());}t.setStatus?(t.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>t.setStatus(""),1),e();},1)):e();}function gr(){if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.shift()();}return gr(),et(),ft?_=t:_=new Promise((e,h)=>{ct=e,it=h;}),_}var It=Pr;var n,c,Ct,Ar=new TextDecoder("utf8"),vr=new TextEncoder,at=new FinalizationRegistry(s=>{s();});function $(s,_){let t=s.ptr;at.register(s,()=>_(t));}function Tr(s){n=s,c=n.wasmExports,Ct=n.addFunction(_=>{c.free(_);},"vi");}function p(s){return (s.charCodeAt(0)&255)<<24|(s.charCodeAt(1)&255)<<16|(s.charCodeAt(2)&255)<<8|(s.charCodeAt(3)&255)<<0}function S(s){return [String.fromCharCode(s>>24&255),String.fromCharCode(s>>16&255),String.fromCharCode(s>>8&255),String.fromCharCode(s>>0&255)].join("")}function I(s,_){let t;return _==null?t=n.HEAPU8.indexOf(0,s):t=s+_,Ar.decode(n.HEAPU8.subarray(s,t))}function mr(s,_){let t=s/2+_;return String.fromCharCode(...n.HEAPU16.subarray(s/2,t))}function z(s){let _=c.malloc(s.length+1);for(let t=0;t<s.length;++t){let r=s.charCodeAt(t);if(r>127)throw new Error("Expected ASCII text");n.HEAPU8[_+t]=r;}return n.HEAPU8[_+s.length]=0,{ptr:_,length:s.length,free:function(){c.free(_);}}}function Er(s){let _=c.malloc(s.length);return vr.encodeInto(s,n.HEAPU8.subarray(_,_+s.length)),{ptr:_,length:s.length,free:function(){c.free(_);}}}function Hr(s){let _=c.malloc(s.length*2),t=n.HEAPU16.subarray(_/2,_/2+s.length);for(let r=0;r<t.length;++r)t[r]=s.charCodeAt(r);return {ptr:_,length:t.length,free:function(){c.free(_);}}}function Ot(s){return I(c.hb_language_to_string(s))}function Rr(s){let _=z(s),t=c.hb_language_from_string(_.ptr,-1);return _.free(),t}function Sr(s){let _=c.hb_set_get_population(s),t=c.malloc(_<<2),r=t>>2;return c.hb_set_next_many(s,-1,t,_),n.HEAPU32.subarray(r,r+_)}var Q=[void 0],Dt=[];function v(s){if(s===void 0)return 0;let _=Dt.pop()??Q.length;return Q[_]=s,_}function g(s){return Q[s]}function N(s){s!==0&&(Q[s]=void 0,Dt.push(s));}function ot(s){return {red:s>>8&255,green:s>>16&255,blue:s>>24&255,alpha:s&255}}function st(s){return (s.red<<8|s.green<<16|s.blue<<24|s.alpha)>>>0}var Gr={DEFAULT:0,USABLE_WITH_LIGHT_BACKGROUND:1,USABLE_WITH_DARK_BACKGROUND:2},Br={PAD:0,REPEAT:1,REFLECT:2},Mr={CLEAR:0,SRC:1,DEST:2,SRC_OVER:3,DEST_OVER:4,SRC_IN:5,DEST_IN:6,SRC_OUT:7,DEST_OUT:8,SRC_ATOP:9,DEST_ATOP:10,XOR:11,PLUS:12,SCREEN:13,OVERLAY:14,DARKEN:15,LIGHTEN:16,COLOR_DODGE:17,COLOR_BURN:18,HARD_LIGHT:19,SOFT_LIGHT:20,DIFFERENCE:21,EXCLUSION:22,MULTIPLY:23,HSL_HUE:24,HSL_SATURATION:25,HSL_COLOR:26,HSL_LUMINOSITY:27},Vr={HIDDEN:1},Wr={UNSAFE_TO_BREAK:1,UNSAFE_TO_CONCAT:2,SAFE_TO_INSERT_TATWEEL:4,DEFINED:7},wr=class{constructor(s){let _=s instanceof Uint8Array?s:new Uint8Array(s),t=c.malloc(_.byteLength);n.HEAPU8.set(_,t),this.ptr=c.hb_blob_create(t,_.byteLength,2,t,Ct),$(this,c.hb_blob_destroy);}},w=65535,zr={UNCLASSIFIED:0,BASE_GLYPH:1,LIGATURE:2,MARK:3,COMPONENT:4},Fr=class{constructor(s,_=0){typeof s=="number"?this.ptr=c.hb_face_reference(s):this.ptr=c.hb_face_create(s.ptr,_),this.upem=c.hb_face_get_upem(this.ptr),$(this,c.hb_face_destroy);}referenceTable(s){let _=c.hb_face_reference_table(this.ptr,p(s)),t=c.hb_blob_get_length(_);if(!t)return;let r=c.hb_blob_get_data(_,0);return n.HEAPU8.subarray(r,r+t)}getAxisInfos(){let s=n.stackSave(),_=n.stackAlloc(2048),t=n.stackAlloc(4);n.HEAPU32[t/4]=64,c.hb_ot_var_get_axis_infos(this.ptr,0,t,_);let r={};return Array.from({length:n.HEAPU32[t/4]}).forEach((a,o)=>{let i={axisIndex:n.HEAPU32[_/4+o*8],tag:S(n.HEAPU32[_/4+o*8+1]),nameId:n.HEAPU32[_/4+o*8+2],flags:n.HEAPU32[_/4+o*8+3],min:n.HEAPF32[_/4+o*8+4],default:n.HEAPF32[_/4+o*8+5],max:n.HEAPF32[_/4+o*8+6]};r[i.tag]=i;}),n.stackRestore(s),r}collectUnicodes(){let s=c.hb_set_create();c.hb_face_collect_unicodes(this.ptr,s);let _=Sr(s);return c.hb_set_destroy(s),_}getTableScriptTags(s){let _=n.stackSave(),t=p(s),r=0,a=128,o=n.stackAlloc(4),i=n.stackAlloc(512),u=[];for(;a==128;){n.HEAPU32[o/4]=a,c.hb_ot_layout_table_get_script_tags(this.ptr,t,r,o,i),a=n.HEAPU32[o/4];let f=n.HEAPU32.subarray(i/4,i/4+a);u.push(...Array.from(f).map(S)),r+=a;}return n.stackRestore(_),u}getTableFeatureTags(s){let _=n.stackSave(),t=p(s),r=0,a=128,o=n.stackAlloc(4),i=n.stackAlloc(512),u=[];for(;a==128;){n.HEAPU32[o/4]=a,c.hb_ot_layout_table_get_feature_tags(this.ptr,t,r,o,i),a=n.HEAPU32[o/4];let f=n.HEAPU32.subarray(i/4,i/4+a);u.push(...Array.from(f).map(S)),r+=a;}return n.stackRestore(_),u}getScriptLanguageTags(s,_){let t=n.stackSave(),r=p(s),a=0,o=128,i=n.stackAlloc(4),u=n.stackAlloc(512),f=[];for(;o==128;){n.HEAPU32[i/4]=o,c.hb_ot_layout_script_get_language_tags(this.ptr,r,_,a,i,u),o=n.HEAPU32[i/4];let l=n.HEAPU32.subarray(u/4,u/4+o);f.push(...Array.from(l).map(S)),a+=o;}return n.stackRestore(t),f}getLanguageFeatureTags(s,_,t){let r=n.stackSave(),a=p(s),o=0,i=128,u=n.stackAlloc(4),f=n.stackAlloc(512),l=[];for(;i==128;){n.HEAPU32[u/4]=i,c.hb_ot_layout_language_get_feature_tags(this.ptr,a,_,t,o,u,f),i=n.HEAPU32[u/4];let b=n.HEAPU32.subarray(f/4,f/4+i);l.push(...Array.from(b).map(S)),o+=i;}return n.stackRestore(r),l}getFeatureLookups(s,_){let t=n.stackSave(),r=p(s),a=0,o=128,i=n.stackAlloc(4),u=n.stackAlloc(512),f=[];for(;o==128;){n.HEAPU32[i/4]=o,c.hb_ot_layout_feature_get_lookups(this.ptr,r,_,a,i,u),o=n.HEAPU32[i/4];let l=n.HEAPU32.subarray(u/4,u/4+o);f.push(...Array.from(l)),a+=o;}return n.stackRestore(t),f}getGlyphClass(s){return c.hb_ot_layout_get_glyph_class(this.ptr,s)}listNames(){let s=n.stackSave(),_=n.stackAlloc(4),t=c.hb_ot_name_list_names(this.ptr,_),r=n.HEAPU32[_/4],a=[];for(let o=0;o<r;o++)a.push({nameId:n.HEAPU32[t/4+o*3],language:Ot(n.HEAPU32[t/4+o*3+2])});return n.stackRestore(s),a}getName(s,_){let t=n.stackSave(),r=Rr(_),a=c.hb_ot_name_get_utf16(this.ptr,s,r,0,0)+1,o=n.stackAlloc(4),i=c.malloc(a*2);n.HEAPU32[o/4]=a,c.hb_ot_name_get_utf16(this.ptr,s,r,o,i);let u=mr(i,a-1);return c.free(i),n.stackRestore(t),u}getFeatureNameIds(s,_){let t=n.stackSave(),r=p(s),a=n.stackAlloc(4),o=n.stackAlloc(4),i=n.stackAlloc(4),u=n.stackAlloc(4),f=n.stackAlloc(4),l=c.hb_ot_layout_feature_get_name_ids(this.ptr,r,_,a,o,i,u,f),b;if(l){let d=n.HEAPU32[a/4],T=n.HEAPU32[o/4],m=n.HEAPU32[i/4],R=n.HEAPU32[u/4],L=n.HEAPU32[f/4];b={paramUiLabelNameIds:Array.from({length:R},(G,C)=>L+C)},d!=w&&(b.uiLabelNameId=d),T!=w&&(b.uiTooltipTextNameId=T),m!=w&&(b.sampleTextNameId=m);}return n.stackRestore(t),b}hasColorPalettes(){return !!c.hb_ot_color_has_palettes(this.ptr)}getColorPalettes(){let s=c.hb_ot_color_palette_get_count(this.ptr),_=[],t=n.stackSave(),r=n.stackAlloc(4),a=n.stackAlloc(512);for(let o=0;o<s;o++){let i=[],u=0,f=128;for(;f===128;){n.HEAPU32[r/4]=f,c.hb_ot_color_palette_get_colors(this.ptr,o,u,r,a),f=n.HEAPU32[r/4];for(let d=0;d<f;d++){let T=ot(n.HEAPU32[a/4+d]),m=c.hb_ot_color_palette_color_get_name_id(this.ptr,u+d);m!=w&&(T.nameId=m),i.push(T);}u+=f;}let l={colors:i,flags:c.hb_ot_color_palette_get_flags(this.ptr,o)},b=c.hb_ot_color_palette_get_name_id(this.ptr,o);b!=w&&(l.nameId=b),_.push(l);}return n.stackRestore(t),_}hasColorLayers(){return !!c.hb_ot_color_has_layers(this.ptr)}getGlyphColorLayers(s){let _=[],t=n.stackSave(),r=n.stackAlloc(4),a=n.stackAlloc(1024),o=0,i=128;for(;i===128;){n.HEAPU32[r/4]=i,c.hb_ot_color_glyph_get_layers(this.ptr,s,o,r,a),i=n.HEAPU32[r/4];for(let u=0;u<i;u++){let f=a/4+u*2,l={glyph:n.HEAPU32[f]},b=n.HEAPU32[f+1];b!=65535&&(l.colorIndex=b),_.push(l);}o+=i;}return n.stackRestore(t),_}hasColorPaint(){return !!c.hb_ot_color_has_paint(this.ptr)}glyphHasColorPaint(s){return !!c.hb_ot_color_glyph_has_paint(this.ptr,s)}hasColorPng(){return !!c.hb_ot_color_has_png(this.ptr)}},Lt=class{constructor(){this.funcPtrs=[],this.userDataPtrs=[],this.ptr=c.hb_draw_funcs_create();let s=this.ptr,_=this.funcPtrs,t=this.userDataPtrs;at.register(this,()=>{c.hb_draw_funcs_destroy(s);for(let r of _)n.removeFunction(r);for(let r of t)N(r);});}setMoveToFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l)=>{s(u,f,g(o),g(l));},"viiiffi");this.funcPtrs.push(r),c.hb_draw_funcs_set_move_to_func(this.ptr,r,t,0);}setLineToFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l)=>{s(u,f,g(o),g(l));},"viiiffi");this.funcPtrs.push(r),c.hb_draw_funcs_set_line_to_func(this.ptr,r,t,0);}setQuadraticToFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d)=>{s(u,f,l,b,g(o),g(d));},"viiiffffi");this.funcPtrs.push(r),c.hb_draw_funcs_set_quadratic_to_func(this.ptr,r,t,0);}setCubicToFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d,T,m)=>{s(u,f,l,b,d,T,g(o),g(m));},"viiiffffffi");this.funcPtrs.push(r),c.hb_draw_funcs_set_cubic_to_func(this.ptr,r,t,0);}setClosePathFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u)=>{s(g(o),g(u));},"viiii");this.funcPtrs.push(r),c.hb_draw_funcs_set_close_path_func(this.ptr,r,t,0);}},$r={HORIZONTAL_ASCENDER:p("hasc"),HORIZONTAL_DESCENDER:p("hdsc"),HORIZONTAL_LINE_GAP:p("hlgp"),HORIZONTAL_CLIPPING_ASCENT:p("hcla"),HORIZONTAL_CLIPPING_DESCENT:p("hcld"),VERTICAL_ASCENDER:p("vasc"),VERTICAL_DESCENDER:p("vdsc"),VERTICAL_LINE_GAP:p("vlgp"),HORIZONTAL_CARET_RISE:p("hcrs"),HORIZONTAL_CARET_RUN:p("hcrn"),HORIZONTAL_CARET_OFFSET:p("hcof"),VERTICAL_CARET_RISE:p("vcrs"),VERTICAL_CARET_RUN:p("vcrn"),VERTICAL_CARET_OFFSET:p("vcof"),X_HEIGHT:p("xhgt"),CAP_HEIGHT:p("cpht"),SUBSCRIPT_EM_X_SIZE:p("sbxs"),SUBSCRIPT_EM_Y_SIZE:p("sbys"),SUBSCRIPT_EM_X_OFFSET:p("sbxo"),SUBSCRIPT_EM_Y_OFFSET:p("sbyo"),SUPERSCRIPT_EM_X_SIZE:p("spxs"),SUPERSCRIPT_EM_Y_SIZE:p("spys"),SUPERSCRIPT_EM_X_OFFSET:p("spxo"),SUPERSCRIPT_EM_Y_OFFSET:p("spyo"),STRIKEOUT_SIZE:p("strs"),STRIKEOUT_OFFSET:p("stro"),UNDERLINE_SIZE:p("unds"),UNDERLINE_OFFSET:p("undo")},k;function kr(){return k||(k=new Lt,k.setMoveToFunc((s,_,t)=>{t.push(`M${s},${_}`);}),k.setLineToFunc((s,_,t)=>{t.push(`L${s},${_}`);}),k.setCubicToFunc((s,_,t,r,a,o,i)=>{i.push(`C${s},${_} ${t},${r} ${a},${o}`);}),k.setQuadraticToFunc((s,_,t,r,a)=>{a.push(`Q${s},${_} ${t},${r}`);}),k.setClosePathFunc(s=>{s.push("Z");})),k}var U;function Ur(){return U||(U=new Lt,U.setMoveToFunc((s,_,t)=>{t.push({type:"M",values:[s,_]});}),U.setLineToFunc((s,_,t)=>{t.push({type:"L",values:[s,_]});}),U.setCubicToFunc((s,_,t,r,a,o,i)=>{i.push({type:"C",values:[s,_,t,r,a,o]});}),U.setQuadraticToFunc((s,_,t,r,a)=>{a.push({type:"Q",values:[s,_,t,r]});}),U.setClosePathFunc(s=>{s.push({type:"Z",values:[]});})),U}var E=class Nt{constructor(_){typeof _=="number"?this.ptr=c.hb_font_reference(_):(this.ptr=c.hb_font_create(_.ptr),this._face=_),$(this,c.hb_font_destroy);}get face(){return this._face||(this._face=new Fr(c.hb_font_get_face(this.ptr))),this._face}subFont(){return new Nt(c.hb_font_create_sub_font(this.ptr))}hExtents(){let _=n.stackSave(),t=n.stackAlloc(48);c.hb_font_get_h_extents(this.ptr,t);let r={ascender:n.HEAP32[t/4],descender:n.HEAP32[t/4+1],lineGap:n.HEAP32[t/4+2]};return n.stackRestore(_),r}vExtents(){let _=n.stackSave(),t=n.stackAlloc(48);c.hb_font_get_v_extents(this.ptr,t);let r={ascender:n.HEAP32[t/4],descender:n.HEAP32[t/4+1],lineGap:n.HEAP32[t/4+2]};return n.stackRestore(_),r}glyphName(_){let t=n.stackSave(),r=256,a=n.stackAlloc(r);c.hb_font_glyph_to_string(this.ptr,_,a,r);let o=I(a);return n.stackRestore(t),o}drawGlyph(_,t,r){let a=v(r);try{c.hb_font_draw_glyph(this.ptr,_,t.ptr,a);}finally{N(a);}}drawGlyphOrFail(_,t,r){let a=v(r);try{return !!c.hb_font_draw_glyph_or_fail(this.ptr,_,t.ptr,a)}finally{N(a);}}paintGlyph(_,t,r,a=0,o={red:0,green:0,blue:0,alpha:255}){let i=v(r);try{c.hb_font_paint_glyph(this.ptr,_,t.ptr,i,a,st(o));}finally{N(i);}}paintGlyphOrFail(_,t,r,a=0,o={red:0,green:0,blue:0,alpha:255}){let i=v(r);try{return !!c.hb_font_paint_glyph_or_fail(this.ptr,_,t.ptr,i,a,st(o))}finally{N(i);}}getGlyphColorPng(_){let t=c.hb_ot_color_glyph_reference_png(this.ptr,_),r=c.hb_blob_get_length(t),a;if(r){let o=c.hb_blob_get_data(t,0);a=n.HEAPU8.slice(o,o+r);}return c.hb_blob_destroy(t),a}glyphToPath(_){let t=[];return this.drawGlyph(_,kr(),t),t.join("")}glyphHAdvance(_){return c.hb_font_get_glyph_h_advance(this.ptr,_)}glyphVAdvance(_){return c.hb_font_get_glyph_v_advance(this.ptr,_)}glyphHOrigin(_){let t=n.stackSave(),r=n.stackAlloc(4),a=n.stackAlloc(4),o;return c.hb_font_get_glyph_h_origin(this.ptr,_,r,a)&&(o=[n.HEAP32[r/4],n.HEAP32[a/4]]),n.stackRestore(t),o}glyphVOrigin(_){let t=n.stackSave(),r=n.stackAlloc(4),a=n.stackAlloc(4),o;return c.hb_font_get_glyph_v_origin(this.ptr,_,r,a)&&(o=[n.HEAP32[r/4],n.HEAP32[a/4]]),n.stackRestore(t),o}glyphExtents(_){let t=n.stackSave(),r=n.stackAlloc(16),a;return c.hb_font_get_glyph_extents(this.ptr,_,r)&&(a={xBearing:n.HEAP32[r/4],yBearing:n.HEAP32[r/4+1],width:n.HEAP32[r/4+2],height:n.HEAP32[r/4+3]}),n.stackRestore(t),a}glyph(_,t=0){let r=n.stackSave(),a=n.stackAlloc(4),o;return c.hb_font_get_glyph(this.ptr,_,t,a)&&(o=n.HEAPU32[a/4]),n.stackRestore(r),o}nominalGlyph(_){let t=n.stackSave(),r=n.stackAlloc(4),a;return c.hb_font_get_nominal_glyph(this.ptr,_,r)&&(a=n.HEAPU32[r/4]),n.stackRestore(t),a}variationGlyph(_,t){let r=n.stackSave(),a=n.stackAlloc(4),o;return c.hb_font_get_variation_glyph(this.ptr,_,t,a)&&(o=n.HEAPU32[a/4]),n.stackRestore(r),o}glyphFromName(_){let t=n.stackSave(),r=n.stackAlloc(4),a=Er(_),o;return c.hb_font_get_glyph_from_name(this.ptr,a.ptr,a.length,r)&&(o=n.HEAPU32[r/4]),a.free(),n.stackRestore(t),o}glyphToJson(_){let t=[];return this.drawGlyph(_,Ur(),t),t}setScale(_,t){c.hb_font_set_scale(this.ptr,_,t);}setVariations(_){let t=n.stackSave(),r=n.stackAlloc(8*_.length);_.forEach((a,o)=>{a.writeTo(r+o*8);}),c.hb_font_set_variations(this.ptr,r,_.length),n.stackRestore(t);}setFuncs(_){c.hb_font_set_funcs(this.ptr,_.ptr);}getLookupOpticalBound(_,t,r){return c.hb_ot_layout_lookup_get_optical_bound(this.ptr,_,t,r)}getLigatureCarets(_,t){let r=n.stackSave(),a=0,o=128,i=n.stackAlloc(4),u=n.stackAlloc(512),f=[];for(;o==128;){n.HEAPU32[i/4]=o,c.hb_ot_layout_get_ligature_carets(this.ptr,_,t,a,i,u),o=n.HEAPU32[i/4];let l=n.HEAP32.subarray(u/4,u/4+o);f.push(...Array.from(l)),a+=o;}return n.stackRestore(r),f}getMetricPosition(_){let t=n.stackSave(),r=n.stackAlloc(4),a;return c.hb_ot_metrics_get_position(this.ptr,_,r)&&(a=n.HEAP32[r/4]),n.stackRestore(t),a}getMetricPositionWithFallback(_){let t=n.stackSave(),r=n.stackAlloc(4);c.hb_ot_metrics_get_position_with_fallback(this.ptr,_,r);let a=n.HEAP32[r/4];return n.stackRestore(t),a}getMetricVariation(_){return c.hb_ot_metrics_get_variation(this.ptr,_)}getMetricXVariation(_){return c.hb_ot_metrics_get_x_variation(this.ptr,_)}getMetricYVariation(_){return c.hb_ot_metrics_get_y_variation(this.ptr,_)}},Yr=class{constructor(){this.ptr=c.hb_font_funcs_create(),$(this,c.hb_font_funcs_destroy);}setGlyphExtentsFunc(s){let _=n.addFunction((t,r,a,o,i)=>{let u=s(new E(t),a);return u?(n.HEAP32[o/4]=u.xBearing,n.HEAP32[o/4+1]=u.yBearing,n.HEAP32[o/4+2]=u.width,n.HEAP32[o/4+3]=u.height,1):0},"ippipp");c.hb_font_funcs_set_glyph_extents_func(this.ptr,_,0,0);}setGlyphFromNameFunc(s){let _=n.addFunction((t,r,a,o,i,u)=>{let f=s(new E(t),I(a,o));return f?(n.HEAPU32[i/4]=f,1):0},"ipppipp");c.hb_font_funcs_set_glyph_from_name_func(this.ptr,_,0,0);}setGlyphHAdvanceFunc(s){let _=n.addFunction((t,r,a,o)=>s(new E(t),a),"ippip");c.hb_font_funcs_set_glyph_h_advance_func(this.ptr,_,0,0);}setGlyphVAdvanceFunc(s){let _=n.addFunction((t,r,a,o)=>s(new E(t),a),"ippip");c.hb_font_funcs_set_glyph_v_advance_func(this.ptr,_,0,0);}setGlyphHOriginFunc(s){let _=n.addFunction((t,r,a,o,i,u)=>{let f=s(new E(t),a);return f?(n.HEAP32[o/4]=f[0],n.HEAP32[i/4]=f[1],1):0},"ippippp");c.hb_font_funcs_set_glyph_h_origin_func(this.ptr,_,0,0);}setGlyphVOriginFunc(s){let _=n.addFunction((t,r,a,o,i,u)=>{let f=s(new E(t),a);return f?(n.HEAP32[o/4]=f[0],n.HEAP32[i/4]=f[1],1):0},"ippippp");c.hb_font_funcs_set_glyph_v_origin_func(this.ptr,_,0,0);}setGlyphHKerningFunc(s){let _=n.addFunction((t,r,a,o,i)=>s(new E(t),a,o),"ippiip");c.hb_font_funcs_set_glyph_h_kerning_func(this.ptr,_,0,0);}setGlyphNameFunc(s){let _=new TextEncoder,t=n.addFunction((r,a,o,i,u,f)=>{let l=s(new E(r),o);return l?(_.encodeInto(l,n.HEAPU8.subarray(i,i+u)),1):0},"ippipip");c.hb_font_funcs_set_glyph_name_func(this.ptr,t,0,0);}setNominalGlyphFunc(s){let _=n.addFunction((t,r,a,o,i)=>{let u=s(new E(t),a);return u?(n.HEAPU32[o/4]=u,1):0},"ippipp");c.hb_font_funcs_set_nominal_glyph_func(this.ptr,_,0,0);}setVariationGlyphFunc(s){let _=n.addFunction((t,r,a,o,i,u)=>{let f=s(new E(t),a,o);return f?(n.HEAPU32[i/4]=f,1):0},"ippiipp");c.hb_font_funcs_set_variation_glyph_func(this.ptr,_,0,0);}setFontHExtentsFunc(s){let _=n.addFunction((t,r,a,o)=>{let i=s(new E(t));return i?(n.HEAP32[a/4]=i.ascender,n.HEAP32[a/4+1]=i.descender,n.HEAP32[a/4+2]=i.lineGap,1):0},"ipppp");c.hb_font_funcs_set_font_h_extents_func(this.ptr,_,0,0);}setFontVExtentsFunc(s){let _=n.addFunction((t,r,a,o)=>{let i=s(new E(t));return i?(n.HEAP32[a/4]=i.ascender,n.HEAP32[a/4+1]=i.descender,n.HEAP32[a/4+2]=i.lineGap,1):0},"ipppp");c.hb_font_funcs_set_font_v_extents_func(this.ptr,_,0,0);}};function rt(s){let _=c.hb_color_line_get_extend(s),t=[],r=n.stackSave(),a=n.stackAlloc(4),o=n.stackAlloc(1536),i=0,u=128;for(;u===128;){n.HEAPU32[a/4]=u,c.hb_color_line_get_color_stops(s,i,a,o),u=n.HEAPU32[a/4];for(let f=0;f<u;f++){let l=(o+f*12)/4;t.push({offset:n.HEAPF32[l],isForeground:n.HEAPU32[l+1]!==0,color:ot(n.HEAPU32[l+2])});}i+=u;}return n.stackRestore(r),{extend:_,colorStops:t}}var Zr=class{constructor(){this.funcPtrs=[],this.userDataPtrs=[],this.ptr=c.hb_paint_funcs_create();let s=this.ptr,_=this.funcPtrs,t=this.userDataPtrs;at.register(this,()=>{c.hb_paint_funcs_destroy(s);for(let r of _)n.removeFunction(r);for(let r of t)N(r);});}setPushTransformFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d,T)=>s(i,u,f,l,b,d,g(o),g(T)),"viiffffffi");this.funcPtrs.push(r),c.hb_paint_funcs_set_push_transform_func(this.ptr,r,t,0);}setPopTransformFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i)=>s(g(o),g(i)),"viii");this.funcPtrs.push(r),c.hb_paint_funcs_set_pop_transform_func(this.ptr,r,t,0);}setColorGlyphFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f)=>s(i,new E(u),g(o),g(f))?1:0,"iiiiii");this.funcPtrs.push(r),c.hb_paint_funcs_set_color_glyph_func(this.ptr,r,t,0);}setPushClipGlyphFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f)=>s(i,new E(u),g(o),g(f)),"viiiii");this.funcPtrs.push(r),c.hb_paint_funcs_set_push_clip_glyph_func(this.ptr,r,t,0);}setPushClipRectangleFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b)=>s(i,u,f,l,g(o),g(b)),"viiffffi");this.funcPtrs.push(r),c.hb_paint_funcs_set_push_clip_rectangle_func(this.ptr,r,t,0);}setPopClipFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i)=>s(g(o),g(i)),"viii");this.funcPtrs.push(r),c.hb_paint_funcs_set_pop_clip_func(this.ptr,r,t,0);}setColorFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f)=>s(i!==0,ot(u),g(o),g(f)),"viiiii");this.funcPtrs.push(r),c.hb_paint_funcs_set_color_func(this.ptr,r,t,0);}setImageFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d,T)=>{let m=c.hb_blob_get_length(i),R=c.hb_blob_get_data(i,0),L=n.HEAPU8.subarray(R,R+m),G;return d&&(G={xBearing:n.HEAP32[d/4],yBearing:n.HEAP32[d/4+1],width:n.HEAP32[d/4+2],height:n.HEAP32[d/4+3]}),s(L,u,f,S(l),G,g(o),g(T))?1:0},"iiiiiiifii");this.funcPtrs.push(r),c.hb_paint_funcs_set_image_func(this.ptr,r,t,0);}setLinearGradientFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d,T,m)=>s(rt(i),u,f,l,b,d,T,g(o),g(m)),"viiiffffffi");this.funcPtrs.push(r),c.hb_paint_funcs_set_linear_gradient_func(this.ptr,r,t,0);}setRadialGradientFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d,T,m)=>s(rt(i),u,f,l,b,d,T,g(o),g(m)),"viiiffffffi");this.funcPtrs.push(r),c.hb_paint_funcs_set_radial_gradient_func(this.ptr,r,t,0);}setSweepGradientFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d)=>s(rt(i),u,f,l,b,g(o),g(d)),"viiiffffi");this.funcPtrs.push(r),c.hb_paint_funcs_set_sweep_gradient_func(this.ptr,r,t,0);}setPushGroupFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i)=>s(g(o),g(i)),"viii");this.funcPtrs.push(r),c.hb_paint_funcs_set_push_group_func(this.ptr,r,t,0);}setPopGroupFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u)=>s(i,g(o),g(u)),"viiii");this.funcPtrs.push(r),c.hb_paint_funcs_set_pop_group_func(this.ptr,r,t,0);}setCustomPaletteColorFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f)=>{let l=s(i,g(o),g(f));return l!==void 0?(n.HEAPU32[u/4]=st(l),1):0},"iiiiii");this.funcPtrs.push(r),c.hb_paint_funcs_set_custom_palette_color_func(this.ptr,r,t,0);}},Ir={INVALID:0,UNICODE:1,GLYPHS:2},Cr={DEFAULT:0,NO_CLUSTERS:1,NO_POSITIONS:2,NO_GLYPH_NAMES:4,GLYPH_EXTENTS:8,GLYPH_FLAGS:16,NO_ADVANCES:32,DEFINED:63},Xr={DEFAULT:0,BOT:1,EOT:2,PRESERVE_DEFAULT_IGNORABLES:4,REMOVE_DEFAULT_IGNORABLES:8,DO_NOT_INSERT_DOTTED_CIRCLE:16,VERIFY:32,PRODUCE_UNSAFE_TO_CONCAT:64,PRODUCE_SAFE_TO_INSERT_TATWEEL:128,DEFINED:255},jr={INVALID:0,LTR:4,RTL:5,TTB:6,BTT:7},Kr={MONOTONE_GRAPHEMES:0,MONOTONE_CHARACTERS:1,CHARACTERS:2,GRAPHEMES:3,DEFAULT:0},Gt={INVALID:0,TEXT:p("TEXT"),JSON:p("JSON")},Jr=class Bt{constructor(_){_!=null?this.ptr=c.hb_buffer_reference(_):this.ptr=c.hb_buffer_create(),$(this,c.hb_buffer_destroy);}add(_,t){c.hb_buffer_add(this.ptr,_,t);}addText(_,t=0,r){let a=Hr(_);c.hb_buffer_add_utf16(this.ptr,a.ptr,a.length,t,r??a.length),a.free();}addCodePoints(_,t=0,r){let a=c.malloc(_.length*4);n.HEAPU32.subarray(a/4,a/4+_.length).set(_),c.hb_buffer_add_codepoints(this.ptr,a,_.length,t,r??_.length),c.free(a);}guessSegmentProperties(){c.hb_buffer_guess_segment_properties(this.ptr);}setDirection(_){c.hb_buffer_set_direction(this.ptr,_);}setFlags(_){c.hb_buffer_set_flags(this.ptr,_);}setLanguage(_){let t=z(_);c.hb_buffer_set_language(this.ptr,c.hb_language_from_string(t.ptr,-1)),t.free();}setScript(_){let t=z(_);c.hb_buffer_set_script(this.ptr,c.hb_script_from_string(t.ptr,-1)),t.free();}setClusterLevel(_){c.hb_buffer_set_cluster_level(this.ptr,_);}reset(){c.hb_buffer_reset(this.ptr);}clearContents(){c.hb_buffer_clear_contents(this.ptr);}setMessageFunc(_){let t=(a,o,i,u)=>{let f=I(i);return _(new Bt(a),new E(o),f)?1:0},r=n.addFunction(t,"iiiii");c.hb_buffer_set_message_func(this.ptr,r,0,0);}getLength(){return c.hb_buffer_get_length(this.ptr)}getGlyphInfos(){let _=c.hb_buffer_get_glyph_infos(this.ptr,0),t=n.HEAPU32.subarray(_/4,_/4+this.getLength()*5),r=[];for(let a=0;a<t.length;a+=5)r.push({codepoint:t[a],cluster:t[a+2],flags:c.hb_glyph_info_get_glyph_flags(_+a*4)});return r}getGlyphPositions(){let _=c.hb_buffer_get_glyph_positions(this.ptr,0)/4;if(_==0)return [];let t=n.HEAP32.subarray(_,_+this.getLength()*5),r=[];for(let a=0;a<t.length;a+=5)r.push({xAdvance:t[a],yAdvance:t[a+1],xOffset:t[a+2],yOffset:t[a+3]});return r}getGlyphInfosAndPositions(){let _=c.hb_buffer_get_glyph_infos(this.ptr,0),t=n.HEAPU32.subarray(_/4,_/4+this.getLength()*5),r=c.hb_buffer_get_glyph_positions(this.ptr,0)/4,a=r?n.HEAP32.subarray(r,r+this.getLength()*5):void 0,o=[];for(let i=0;i<t.length;i+=5){let u={codepoint:t[i],cluster:t[i+2],flags:c.hb_glyph_info_get_glyph_flags(_+i*4)};for(let[f,l]of [["mask",1],["var1",3],["var2",4]])Object.defineProperty(u,f,{value:t[i+l],enumerable:false});a&&(u.xAdvance=a[i],u.yAdvance=a[i+1],u.xOffset=a[i+2],u.yOffset=a[i+3],Object.defineProperty(u,"var",{value:a[i+4],enumerable:false})),o.push(u);}return o}updateGlyphPositions(_){let t=c.hb_buffer_get_glyph_positions(this.ptr,0)/4;if(t==0)return;let r=Math.min(_.length,this.getLength()),a=n.HEAP32.subarray(t,t+r*5);for(let o=0;o<r;o++)a[o*5]=_[o].xAdvance,a[o*5+1]=_[o].yAdvance,a[o*5+2]=_[o].xOffset,a[o*5+3]=_[o].yOffset;}serialize(_={}){let{font:t,start:r=0,end:a,format:o=Gt.TEXT,flags:i=0}=_,u=n.stackSave(),f=a??this.getLength(),l=32*1024,b=c.malloc(l),d=n.stackAlloc(4),T="";for(;r<f;){r+=c.hb_buffer_serialize(this.ptr,r,f,b,l,d,t?t.ptr:0,o,i);let m=n.HEAPU32[d/4];if(m==0)break;T+=I(b,m);}return c.free(b),n.stackRestore(u),T}getContentType(){return c.hb_buffer_get_content_type(this.ptr)}},Qr=class J{static{this.GLOBAL_START=0;}static{this.GLOBAL_END=4294967295;}constructor(_,t=1,r=J.GLOBAL_START,a=J.GLOBAL_END){this.tag=_,this.value=t,this.start=r,this.end=a;}static fromString(_){let t=n.stackSave(),r=n.stackAlloc(16),a=z(_),o;return c.hb_feature_from_string(a.ptr,-1,r)&&(o=new J(S(n.HEAPU32[r/4]),n.HEAPU32[r/4+1],n.HEAPU32[r/4+2],n.HEAPU32[r/4+3])),a.free(),n.stackRestore(t),o}toString(){let _=n.stackSave(),t=n.stackAlloc(16);this.writeTo(t);let r=128,a=n.stackAlloc(r);c.hb_feature_to_string(t,a,r);let o=I(a);return n.stackRestore(_),o}writeTo(_){n.HEAPU32[_/4]=p(this.tag),n.HEAPU32[_/4+1]=this.value,n.HEAPU32[_/4+2]=this.start,n.HEAPU32[_/4+3]=this.end;}},qr=class Mt{constructor(_,t=0){this.tag=_,this.value=t;}static fromString(_){let t=n.stackSave(),r=n.stackAlloc(8),a=z(_),o;return c.hb_variation_from_string(a.ptr,-1,r)&&(o=new Mt(S(n.HEAPU32[r/4]),n.HEAPF32[r/4+1])),a.free(),n.stackRestore(t),o}toString(){let _=n.stackSave(),t=n.stackAlloc(8);this.writeTo(t);let r=128,a=n.stackAlloc(r);c.hb_variation_to_string(t,a,r);let o=I(a);return n.stackRestore(_),o}writeTo(_){n.HEAPU32[_/4]=p(this.tag),n.HEAPF32[_/4+1]=this.value;}},K={DONT_STOP:0,GSUB:1,GPOS:2};function Or(s,_,t){let r=t?.length??0,a=n.stackSave(),o=0;r&&(o=n.stackAlloc(16*r),t.forEach((i,u)=>{i.writeTo(o+u*16);})),c.hb_shape(s.ptr,_.ptr,o,r),n.stackRestore(a);}function xr(s,_,t,r,a){let o=[],i=K.DONT_STOP,u=false;return _.setMessageFunc((f,l,b)=>{if(b.startsWith("start table GSUB")?i=K.GSUB:b.startsWith("start table GPOS")&&(i=K.GPOS),i!=a&&(u=false),a!=K.DONT_STOP&&i==a&&b.startsWith("end lookup "+r)&&(u=true),u)return false;let d=f.serialize({font:l,format:Gt.JSON,flags:Cr.NO_GLYPH_NAMES});return o.push({m:b,t:JSON.parse(d),glyphs:f.getContentType()==Ir.GLYPHS}),true}),Or(s,_,t),o}function ts(){let s=n.stackSave(),_=n.stackAlloc(12);c.hb_version(_,_+4,_+8);let t={major:n.HEAPU32[_/4],minor:n.HEAPU32[(_+4)/4],micro:n.HEAPU32[(_+8)/4]};return n.stackRestore(s),t}function _s(){return I(c.hb_version_string())}function es(s){let _=p(s);return S(c.hb_ot_tag_to_script(_))}function ns(s){let _=p(s);return Ot(c.hb_ot_tag_to_language(_))}Tr(await It());
1
+ import {b}from'./chunk-RIYSCEFQ.js';async function Pr(s={}){var _,t=s,r=typeof window=="object",a=typeof WorkerGlobalScope<"u",o=typeof process=="object"&&process.versions?.node&&process.type!="renderer";if(o){let{createRequire:e}=await import('./node-module-shim-TTKTT66I.js');var i=e(import.meta.url);}var l=(e,h)=>{throw h},b$1=import.meta.url,d="";function T(e){return t.locateFile?t.locateFile(e,d):d+e}var m,R;if(o){var L=i("fs");b$1.startsWith("file:")&&(d=i("path").dirname(i("url").fileURLToPath(b$1))+"/"),R=e=>{e=X(e)?new URL(e):e;var h=L.readFileSync(e);return h},m=async(e,h=true)=>{e=X(e)?new URL(e):e;var y=L.readFileSync(e,h?void 0:"utf8");return y},process.argv.length>1&&(process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),l=(e,h)=>{throw process.exitCode=e,h};}else if(r||a){try{d=new URL(".",b$1).href;}catch{}a&&(R=e=>{var h=new XMLHttpRequest;return h.open("GET",e,false),h.responseType="arraybuffer",h.send(null),new Uint8Array(h.response)}),m=async e=>{if(X(e))return new Promise((y,A)=>{var P=new XMLHttpRequest;P.open("GET",e,true),P.responseType="arraybuffer",P.onload=()=>{if(P.status==200||P.status==0&&P.response){y(P.response);return}A(P.status);},P.onerror=A,P.send(null);});var h=await fetch(e,{credentials:"same-origin"});if(h.ok)return h.arrayBuffer();throw new Error(h.status+" : "+h.url)};}console.log.bind(console);var C=console.error.bind(console),B,Y=false,Z,X=e=>e.startsWith("file://"),ct,it,j,ut,ft=false;function ht(){var e=j.buffer;t.HEAP8=new Int8Array(e),t.HEAPU8=ut=new Uint8Array(e),t.HEAPU16=new Uint16Array(e),t.HEAP32=new Int32Array(e),t.HEAPU32=new Uint32Array(e),t.HEAPF32=new Float32Array(e),new BigInt64Array(e),new BigUint64Array(e);}function Kt(){if(t.preRun)for(typeof t.preRun=="function"&&(t.preRun=[t.preRun]);t.preRun.length;)c_(t.preRun.shift());pt(dt);}function Jt(){ft=true,F.__wasm_call_ctors();}function Qt(){if(t.postRun)for(typeof t.postRun=="function"&&(t.postRun=[t.postRun]);t.postRun.length;)o_(t.postRun.shift());pt(gt);}var O=0,M=null;function qt(e){O++,t.monitorRunDependencies?.(O);}function xt(e){if(O--,t.monitorRunDependencies?.(O),O==0&&M){var h=M;M=null,h();}}function lt(e){t.onAbort?.(e),e="Aborted("+e+")",C(e),Y=true,e+=". Build with -sASSERTIONS for more info.";var h=new WebAssembly.RuntimeError(e);throw it?.(h),h}var q;function t_(){return t.locateFile?T("harfbuzz.wasm"):b(new URL("harfbuzz.wasm",import.meta.url).href)}function __(e){if(e==q&&B)return new Uint8Array(B);if(R)return R(e);throw "both async and sync fetching of the wasm failed"}async function e_(e){if(!B)try{var h=await m(e);return new Uint8Array(h)}catch{}return __(e)}async function n_(e,h){try{var y=await e_(e),A=await WebAssembly.instantiate(y,h);return A}catch(P){C(`failed to asynchronously prepare wasm: ${P}`),lt(P);}}async function r_(e,h,y){if(!e&&!X(h)&&!o)try{var A=fetch(h,{credentials:"same-origin"}),P=await WebAssembly.instantiateStreaming(A,y);return P}catch(H){C(`wasm streaming compile failed: ${H}`),C("falling back to ArrayBuffer instantiation");}return n_(h,y)}function s_(){return {env:kt,wasi_snapshot_preview1:kt}}async function a_(){function e(H,nt){return F=H.exports,t.wasmExports=F,j=F.memory,ht(),W=F.__indirect_function_table,pr(F),xt(),F}qt();function h(H){return e(H.instance)}var y=s_();if(t.instantiateWasm)return new Promise((H,nt)=>{t.instantiateWasm(y,(dr,yr)=>{H(e(dr));});});q??=t_();var A=await r_(B,q,y),P=h(A);return P}class bt{name="ExitStatus";constructor(h){this.message=`Program terminated with exit(${h})`,this.status=h;}}var pt=e=>{for(;e.length>0;)e.shift()(t);},gt=[],o_=e=>gt.push(e),dt=[],c_=e=>dt.push(e),x=true,i_=e=>Rt(e),u_=()=>Ft(),f_=()=>lt(""),yt=0,h_=()=>{x=false,yt=0;},V={},Pt=e=>{if(e instanceof bt||e=="unwind")return Z;l(1,e);},At=()=>x||yt>0,vt=e=>{Z=e,At()||(t.onExit?.(e),Y=true),l(e,new bt(e));},l_=(e,h)=>{Z=e,vt(e);},b_=l_,p_=()=>{if(!At())try{b_(Z);}catch(e){Pt(e);}},g_=e=>{if(!Y)try{e(),p_();}catch(h){Pt(h);}},d_=()=>performance.now(),y_=(e,h)=>{if(V[e]&&(clearTimeout(V[e].id),delete V[e]),!h)return 0;var y=setTimeout(()=>{delete V[e],g_(()=>Ht(e,d_()));},h);return V[e]={id:y,timeout_ms:h},0},P_=()=>2147483648,A_=(e,h)=>Math.ceil(e/h)*h,v_=e=>{var h=j.buffer.byteLength,y=(e-h+65535)/65536|0;try{return j.grow(y),ht(),1}catch{}},T_=e=>{var h=ut.length;e>>>=0;var y=P_();if(e>y)return false;for(var A=1;A<=4;A*=2){var P=h*(1+.2/A);P=Math.min(P,e+100663296);var H=Math.min(y,A_(Math.max(e,P),65536)),nt=v_(H);if(nt)return true}return false},Tt=e=>{let h=e.length;return [h%128|128,h>>7,...e]},m_={i:127,p:127,j:126,f:125,d:124,e:111},mt=e=>Tt(Array.from(e,h=>{var y=m_[h];return y})),E_=(e,h)=>{var y=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Tt([1,96,...mt(h.slice(1)),...mt(h[0]==="v"?"":h[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),A=new WebAssembly.Module(y),P=new WebAssembly.Instance(A,{e:{f:e}}),H=P.exports.f;return H},W,Et=e=>W.get(e),H_=(e,h)=>{if(D)for(var y=e;y<e+h;y++){var A=Et(y);A&&D.set(A,y);}},D,R_=e=>(D||(D=new WeakMap,H_(0,W.length)),D.get(e)||0),tt=[],S_=()=>tt.length?tt.pop():W.grow(1),_t=(e,h)=>W.set(e,h),F_=(e,h)=>{var y=R_(e);if(y)return y;var A=S_();try{_t(A,e);}catch(H){if(!(H instanceof TypeError))throw H;var P=E_(e,h);_t(A,P);}return D.set(e,A),A},k_=e=>{D.delete(Et(e)),_t(e,null),tt.push(e);},U_=e=>St(e);t.noExitRuntime&&(x=t.noExitRuntime),t.print&&(t.print),t.printErr&&(C=t.printErr),t.wasmBinary&&(B=t.wasmBinary),t.arguments&&(t.arguments),t.thisProgram&&(t.thisProgram),t.wasmExports=F,t.stackSave=u_,t.stackRestore=i_,t.stackAlloc=U_,t.addFunction=F_,t.removeFunction=k_;var Ht,Rt,St,Ft;function pr(e){t._hb_blob_create=e.hb_blob_create,t._hb_blob_destroy=e.hb_blob_destroy,t._hb_blob_get_length=e.hb_blob_get_length,t._hb_blob_get_data=e.hb_blob_get_data,t._hb_buffer_serialize=e.hb_buffer_serialize,t._hb_buffer_create=e.hb_buffer_create,t._hb_buffer_reset=e.hb_buffer_reset,t._hb_buffer_reference=e.hb_buffer_reference,t._hb_buffer_destroy=e.hb_buffer_destroy,t._hb_buffer_get_content_type=e.hb_buffer_get_content_type,t._hb_buffer_set_direction=e.hb_buffer_set_direction,t._hb_buffer_set_script=e.hb_buffer_set_script,t._hb_buffer_set_language=e.hb_buffer_set_language,t._hb_buffer_set_flags=e.hb_buffer_set_flags,t._hb_buffer_set_cluster_level=e.hb_buffer_set_cluster_level,t._hb_buffer_clear_contents=e.hb_buffer_clear_contents,t._hb_buffer_add=e.hb_buffer_add,t._hb_buffer_get_length=e.hb_buffer_get_length,t._hb_buffer_get_glyph_infos=e.hb_buffer_get_glyph_infos,t._hb_buffer_get_glyph_positions=e.hb_buffer_get_glyph_positions,t._hb_glyph_info_get_glyph_flags=e.hb_glyph_info_get_glyph_flags,t._hb_buffer_guess_segment_properties=e.hb_buffer_guess_segment_properties,t._hb_buffer_add_utf8=e.hb_buffer_add_utf8,t._hb_buffer_add_utf16=e.hb_buffer_add_utf16,t._hb_buffer_add_codepoints=e.hb_buffer_add_codepoints,t._hb_buffer_set_message_func=e.hb_buffer_set_message_func,t._hb_language_from_string=e.hb_language_from_string,t._hb_language_to_string=e.hb_language_to_string,t._hb_script_from_string=e.hb_script_from_string,t._hb_version=e.hb_version,t._hb_version_string=e.hb_version_string,t._hb_feature_from_string=e.hb_feature_from_string,t._hb_feature_to_string=e.hb_feature_to_string,t._hb_variation_from_string=e.hb_variation_from_string,t._hb_variation_to_string=e.hb_variation_to_string,t._malloc=e.malloc,t._free=e.free,t._hb_draw_funcs_set_move_to_func=e.hb_draw_funcs_set_move_to_func,t._hb_draw_funcs_set_line_to_func=e.hb_draw_funcs_set_line_to_func,t._hb_draw_funcs_set_quadratic_to_func=e.hb_draw_funcs_set_quadratic_to_func,t._hb_draw_funcs_set_cubic_to_func=e.hb_draw_funcs_set_cubic_to_func,t._hb_draw_funcs_set_close_path_func=e.hb_draw_funcs_set_close_path_func,t._hb_draw_funcs_create=e.hb_draw_funcs_create,t._hb_draw_funcs_destroy=e.hb_draw_funcs_destroy,t._hb_face_create=e.hb_face_create,t._hb_face_reference=e.hb_face_reference,t._hb_face_destroy=e.hb_face_destroy,t._hb_face_reference_table=e.hb_face_reference_table,t._hb_face_get_upem=e.hb_face_get_upem,t._hb_face_collect_unicodes=e.hb_face_collect_unicodes,t._hb_font_funcs_create=e.hb_font_funcs_create,t._hb_font_funcs_destroy=e.hb_font_funcs_destroy,t._hb_font_funcs_set_font_h_extents_func=e.hb_font_funcs_set_font_h_extents_func,t._hb_font_funcs_set_font_v_extents_func=e.hb_font_funcs_set_font_v_extents_func,t._hb_font_funcs_set_nominal_glyph_func=e.hb_font_funcs_set_nominal_glyph_func,t._hb_font_funcs_set_nominal_glyphs_func=e.hb_font_funcs_set_nominal_glyphs_func,t._hb_font_funcs_set_variation_glyph_func=e.hb_font_funcs_set_variation_glyph_func,t._hb_font_funcs_set_glyph_h_advance_func=e.hb_font_funcs_set_glyph_h_advance_func,t._hb_font_funcs_set_glyph_v_advance_func=e.hb_font_funcs_set_glyph_v_advance_func,t._hb_font_funcs_set_glyph_h_advances_func=e.hb_font_funcs_set_glyph_h_advances_func,t._hb_font_funcs_set_glyph_v_advances_func=e.hb_font_funcs_set_glyph_v_advances_func,t._hb_font_funcs_set_glyph_h_origin_func=e.hb_font_funcs_set_glyph_h_origin_func,t._hb_font_funcs_set_glyph_v_origin_func=e.hb_font_funcs_set_glyph_v_origin_func,t._hb_font_funcs_set_glyph_h_kerning_func=e.hb_font_funcs_set_glyph_h_kerning_func,t._hb_font_funcs_set_glyph_extents_func=e.hb_font_funcs_set_glyph_extents_func,t._hb_font_funcs_set_glyph_name_func=e.hb_font_funcs_set_glyph_name_func,t._hb_font_funcs_set_glyph_from_name_func=e.hb_font_funcs_set_glyph_from_name_func,t._hb_font_get_h_extents=e.hb_font_get_h_extents,t._hb_font_get_v_extents=e.hb_font_get_v_extents,t._hb_font_get_glyph=e.hb_font_get_glyph,t._hb_font_get_nominal_glyph=e.hb_font_get_nominal_glyph,t._hb_font_get_variation_glyph=e.hb_font_get_variation_glyph,t._hb_font_get_glyph_h_advance=e.hb_font_get_glyph_h_advance,t._hb_font_get_glyph_v_advance=e.hb_font_get_glyph_v_advance,t._hb_font_get_glyph_h_origin=e.hb_font_get_glyph_h_origin,t._hb_font_get_glyph_v_origin=e.hb_font_get_glyph_v_origin,t._hb_font_get_glyph_extents=e.hb_font_get_glyph_extents,t._hb_font_get_glyph_from_name=e.hb_font_get_glyph_from_name,t._hb_font_draw_glyph_or_fail=e.hb_font_draw_glyph_or_fail,t._hb_font_paint_glyph_or_fail=e.hb_font_paint_glyph_or_fail,t._hb_font_draw_glyph=e.hb_font_draw_glyph,t._hb_font_paint_glyph=e.hb_font_paint_glyph,t._hb_font_glyph_to_string=e.hb_font_glyph_to_string,t._hb_font_create=e.hb_font_create,t._hb_font_set_variations=e.hb_font_set_variations,t._hb_font_create_sub_font=e.hb_font_create_sub_font,t._hb_font_reference=e.hb_font_reference,t._hb_font_destroy=e.hb_font_destroy,t._hb_font_get_face=e.hb_font_get_face,t._hb_font_set_funcs=e.hb_font_set_funcs,t._hb_font_set_scale=e.hb_font_set_scale,t._hb_ot_color_has_palettes=e.hb_ot_color_has_palettes,t._hb_ot_color_palette_get_count=e.hb_ot_color_palette_get_count,t._hb_ot_color_palette_get_name_id=e.hb_ot_color_palette_get_name_id,t._hb_ot_color_palette_color_get_name_id=e.hb_ot_color_palette_color_get_name_id,t._hb_ot_color_palette_get_flags=e.hb_ot_color_palette_get_flags,t._hb_ot_color_palette_get_colors=e.hb_ot_color_palette_get_colors,t._hb_ot_color_has_layers=e.hb_ot_color_has_layers,t._hb_ot_color_has_paint=e.hb_ot_color_has_paint,t._hb_ot_color_glyph_has_paint=e.hb_ot_color_glyph_has_paint,t._hb_ot_color_glyph_get_layers=e.hb_ot_color_glyph_get_layers,t._hb_ot_color_has_png=e.hb_ot_color_has_png,t._hb_ot_color_glyph_reference_png=e.hb_ot_color_glyph_reference_png,t._hb_ot_layout_get_glyph_class=e.hb_ot_layout_get_glyph_class,t._hb_ot_layout_get_ligature_carets=e.hb_ot_layout_get_ligature_carets,t._hb_ot_layout_table_get_script_tags=e.hb_ot_layout_table_get_script_tags,t._hb_ot_layout_table_get_feature_tags=e.hb_ot_layout_table_get_feature_tags,t._hb_ot_layout_script_get_language_tags=e.hb_ot_layout_script_get_language_tags,t._hb_ot_layout_language_get_feature_tags=e.hb_ot_layout_language_get_feature_tags,t._hb_ot_layout_feature_get_lookups=e.hb_ot_layout_feature_get_lookups,t._hb_ot_layout_feature_get_name_ids=e.hb_ot_layout_feature_get_name_ids,t._hb_ot_metrics_get_position_with_fallback=e.hb_ot_metrics_get_position_with_fallback,t._hb_ot_layout_lookup_get_optical_bound=e.hb_ot_layout_lookup_get_optical_bound,t._hb_ot_metrics_get_position=e.hb_ot_metrics_get_position,t._hb_ot_metrics_get_variation=e.hb_ot_metrics_get_variation,t._hb_ot_metrics_get_x_variation=e.hb_ot_metrics_get_x_variation,t._hb_ot_metrics_get_y_variation=e.hb_ot_metrics_get_y_variation,t._hb_ot_name_list_names=e.hb_ot_name_list_names,t._hb_ot_name_get_utf16=e.hb_ot_name_get_utf16,t._hb_set_create=e.hb_set_create,t._hb_set_destroy=e.hb_set_destroy,t._hb_ot_tag_to_script=e.hb_ot_tag_to_script,t._hb_ot_tag_to_language=e.hb_ot_tag_to_language,t._hb_ot_var_get_axis_infos=e.hb_ot_var_get_axis_infos,t._hb_paint_funcs_set_push_transform_func=e.hb_paint_funcs_set_push_transform_func,t._hb_paint_funcs_set_pop_transform_func=e.hb_paint_funcs_set_pop_transform_func,t._hb_paint_funcs_set_color_glyph_func=e.hb_paint_funcs_set_color_glyph_func,t._hb_paint_funcs_set_push_clip_glyph_func=e.hb_paint_funcs_set_push_clip_glyph_func,t._hb_paint_funcs_set_push_clip_rectangle_func=e.hb_paint_funcs_set_push_clip_rectangle_func,t._hb_paint_funcs_set_pop_clip_func=e.hb_paint_funcs_set_pop_clip_func,t._hb_paint_funcs_set_color_func=e.hb_paint_funcs_set_color_func,t._hb_paint_funcs_set_image_func=e.hb_paint_funcs_set_image_func,t._hb_paint_funcs_set_linear_gradient_func=e.hb_paint_funcs_set_linear_gradient_func,t._hb_paint_funcs_set_radial_gradient_func=e.hb_paint_funcs_set_radial_gradient_func,t._hb_paint_funcs_set_sweep_gradient_func=e.hb_paint_funcs_set_sweep_gradient_func,t._hb_paint_funcs_set_push_group_func=e.hb_paint_funcs_set_push_group_func,t._hb_paint_funcs_set_pop_group_func=e.hb_paint_funcs_set_pop_group_func,t._hb_paint_funcs_set_custom_palette_color_func=e.hb_paint_funcs_set_custom_palette_color_func,t._hb_paint_funcs_create=e.hb_paint_funcs_create,t._hb_paint_funcs_destroy=e.hb_paint_funcs_destroy,t._hb_color_line_get_color_stops=e.hb_color_line_get_color_stops,t._hb_color_line_get_extend=e.hb_color_line_get_extend,t._hb_set_get_population=e.hb_set_get_population,t._hb_set_next_many=e.hb_set_next_many,t._hb_shape=e.hb_shape,Ht=e._emscripten_timeout,Rt=e._emscripten_stack_restore,St=e._emscripten_stack_alloc,Ft=e.emscripten_stack_get_current;}var kt={_abort_js:f_,_emscripten_runtime_keepalive_clear:h_,_setitimer_js:y_,emscripten_resize_heap:T_,proc_exit:vt},F=await a_();function et(){if(O>0){M=et;return}if(Kt(),O>0){M=et;return}function e(){t.calledRun=true,!Y&&(Jt(),ct?.(t),t.onRuntimeInitialized?.(),Qt());}t.setStatus?(t.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>t.setStatus(""),1),e();},1)):e();}function gr(){if(t.preInit)for(typeof t.preInit=="function"&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.shift()();}return gr(),et(),ft?_=t:_=new Promise((e,h)=>{ct=e,it=h;}),_}var It=Pr;var n,c,Ct,Ar=new TextDecoder("utf8"),vr=new TextEncoder,at=new FinalizationRegistry(s=>{s();});function $(s,_){let t=s.ptr;at.register(s,()=>_(t));}function Tr(s){n=s,c=n.wasmExports,Ct=n.addFunction(_=>{c.free(_);},"vi");}function p(s){return (s.charCodeAt(0)&255)<<24|(s.charCodeAt(1)&255)<<16|(s.charCodeAt(2)&255)<<8|(s.charCodeAt(3)&255)<<0}function S(s){return [String.fromCharCode(s>>24&255),String.fromCharCode(s>>16&255),String.fromCharCode(s>>8&255),String.fromCharCode(s>>0&255)].join("")}function I(s,_){let t;return _==null?t=n.HEAPU8.indexOf(0,s):t=s+_,Ar.decode(n.HEAPU8.subarray(s,t))}function mr(s,_){let t=s/2+_;return String.fromCharCode(...n.HEAPU16.subarray(s/2,t))}function z(s){let _=c.malloc(s.length+1);for(let t=0;t<s.length;++t){let r=s.charCodeAt(t);if(r>127)throw new Error("Expected ASCII text");n.HEAPU8[_+t]=r;}return n.HEAPU8[_+s.length]=0,{ptr:_,length:s.length,free:function(){c.free(_);}}}function Er(s){let _=c.malloc(s.length);return vr.encodeInto(s,n.HEAPU8.subarray(_,_+s.length)),{ptr:_,length:s.length,free:function(){c.free(_);}}}function Hr(s){let _=c.malloc(s.length*2),t=n.HEAPU16.subarray(_/2,_/2+s.length);for(let r=0;r<t.length;++r)t[r]=s.charCodeAt(r);return {ptr:_,length:t.length,free:function(){c.free(_);}}}function Ot(s){return I(c.hb_language_to_string(s))}function Rr(s){let _=z(s),t=c.hb_language_from_string(_.ptr,-1);return _.free(),t}function Sr(s){let _=c.hb_set_get_population(s),t=c.malloc(_<<2),r=t>>2;return c.hb_set_next_many(s,-1,t,_),n.HEAPU32.subarray(r,r+_)}var Q=[void 0],Dt=[];function v(s){if(s===void 0)return 0;let _=Dt.pop()??Q.length;return Q[_]=s,_}function g(s){return Q[s]}function N(s){s!==0&&(Q[s]=void 0,Dt.push(s));}function ot(s){return {red:s>>8&255,green:s>>16&255,blue:s>>24&255,alpha:s&255}}function st(s){return (s.red<<8|s.green<<16|s.blue<<24|s.alpha)>>>0}var Gr={DEFAULT:0,USABLE_WITH_LIGHT_BACKGROUND:1,USABLE_WITH_DARK_BACKGROUND:2},Br={PAD:0,REPEAT:1,REFLECT:2},Mr={CLEAR:0,SRC:1,DEST:2,SRC_OVER:3,DEST_OVER:4,SRC_IN:5,DEST_IN:6,SRC_OUT:7,DEST_OUT:8,SRC_ATOP:9,DEST_ATOP:10,XOR:11,PLUS:12,SCREEN:13,OVERLAY:14,DARKEN:15,LIGHTEN:16,COLOR_DODGE:17,COLOR_BURN:18,HARD_LIGHT:19,SOFT_LIGHT:20,DIFFERENCE:21,EXCLUSION:22,MULTIPLY:23,HSL_HUE:24,HSL_SATURATION:25,HSL_COLOR:26,HSL_LUMINOSITY:27},Vr={HIDDEN:1},Wr={UNSAFE_TO_BREAK:1,UNSAFE_TO_CONCAT:2,SAFE_TO_INSERT_TATWEEL:4,DEFINED:7},wr=class{constructor(s){let _=s instanceof Uint8Array?s:new Uint8Array(s),t=c.malloc(_.byteLength);n.HEAPU8.set(_,t),this.ptr=c.hb_blob_create(t,_.byteLength,2,t,Ct),$(this,c.hb_blob_destroy);}},w=65535,zr={UNCLASSIFIED:0,BASE_GLYPH:1,LIGATURE:2,MARK:3,COMPONENT:4},Fr=class{constructor(s,_=0){typeof s=="number"?this.ptr=c.hb_face_reference(s):this.ptr=c.hb_face_create(s.ptr,_),this.upem=c.hb_face_get_upem(this.ptr),$(this,c.hb_face_destroy);}referenceTable(s){let _=c.hb_face_reference_table(this.ptr,p(s)),t=c.hb_blob_get_length(_);if(!t)return;let r=c.hb_blob_get_data(_,0);return n.HEAPU8.subarray(r,r+t)}getAxisInfos(){let s=n.stackSave(),_=n.stackAlloc(2048),t=n.stackAlloc(4);n.HEAPU32[t/4]=64,c.hb_ot_var_get_axis_infos(this.ptr,0,t,_);let r={};return Array.from({length:n.HEAPU32[t/4]}).forEach((a,o)=>{let i={axisIndex:n.HEAPU32[_/4+o*8],tag:S(n.HEAPU32[_/4+o*8+1]),nameId:n.HEAPU32[_/4+o*8+2],flags:n.HEAPU32[_/4+o*8+3],min:n.HEAPF32[_/4+o*8+4],default:n.HEAPF32[_/4+o*8+5],max:n.HEAPF32[_/4+o*8+6]};r[i.tag]=i;}),n.stackRestore(s),r}collectUnicodes(){let s=c.hb_set_create();c.hb_face_collect_unicodes(this.ptr,s);let _=Sr(s);return c.hb_set_destroy(s),_}getTableScriptTags(s){let _=n.stackSave(),t=p(s),r=0,a=128,o=n.stackAlloc(4),i=n.stackAlloc(512),u=[];for(;a==128;){n.HEAPU32[o/4]=a,c.hb_ot_layout_table_get_script_tags(this.ptr,t,r,o,i),a=n.HEAPU32[o/4];let f=n.HEAPU32.subarray(i/4,i/4+a);u.push(...Array.from(f).map(S)),r+=a;}return n.stackRestore(_),u}getTableFeatureTags(s){let _=n.stackSave(),t=p(s),r=0,a=128,o=n.stackAlloc(4),i=n.stackAlloc(512),u=[];for(;a==128;){n.HEAPU32[o/4]=a,c.hb_ot_layout_table_get_feature_tags(this.ptr,t,r,o,i),a=n.HEAPU32[o/4];let f=n.HEAPU32.subarray(i/4,i/4+a);u.push(...Array.from(f).map(S)),r+=a;}return n.stackRestore(_),u}getScriptLanguageTags(s,_){let t=n.stackSave(),r=p(s),a=0,o=128,i=n.stackAlloc(4),u=n.stackAlloc(512),f=[];for(;o==128;){n.HEAPU32[i/4]=o,c.hb_ot_layout_script_get_language_tags(this.ptr,r,_,a,i,u),o=n.HEAPU32[i/4];let l=n.HEAPU32.subarray(u/4,u/4+o);f.push(...Array.from(l).map(S)),a+=o;}return n.stackRestore(t),f}getLanguageFeatureTags(s,_,t){let r=n.stackSave(),a=p(s),o=0,i=128,u=n.stackAlloc(4),f=n.stackAlloc(512),l=[];for(;i==128;){n.HEAPU32[u/4]=i,c.hb_ot_layout_language_get_feature_tags(this.ptr,a,_,t,o,u,f),i=n.HEAPU32[u/4];let b=n.HEAPU32.subarray(f/4,f/4+i);l.push(...Array.from(b).map(S)),o+=i;}return n.stackRestore(r),l}getFeatureLookups(s,_){let t=n.stackSave(),r=p(s),a=0,o=128,i=n.stackAlloc(4),u=n.stackAlloc(512),f=[];for(;o==128;){n.HEAPU32[i/4]=o,c.hb_ot_layout_feature_get_lookups(this.ptr,r,_,a,i,u),o=n.HEAPU32[i/4];let l=n.HEAPU32.subarray(u/4,u/4+o);f.push(...Array.from(l)),a+=o;}return n.stackRestore(t),f}getGlyphClass(s){return c.hb_ot_layout_get_glyph_class(this.ptr,s)}listNames(){let s=n.stackSave(),_=n.stackAlloc(4),t=c.hb_ot_name_list_names(this.ptr,_),r=n.HEAPU32[_/4],a=[];for(let o=0;o<r;o++)a.push({nameId:n.HEAPU32[t/4+o*3],language:Ot(n.HEAPU32[t/4+o*3+2])});return n.stackRestore(s),a}getName(s,_){let t=n.stackSave(),r=Rr(_),a=c.hb_ot_name_get_utf16(this.ptr,s,r,0,0)+1,o=n.stackAlloc(4),i=c.malloc(a*2);n.HEAPU32[o/4]=a,c.hb_ot_name_get_utf16(this.ptr,s,r,o,i);let u=mr(i,a-1);return c.free(i),n.stackRestore(t),u}getFeatureNameIds(s,_){let t=n.stackSave(),r=p(s),a=n.stackAlloc(4),o=n.stackAlloc(4),i=n.stackAlloc(4),u=n.stackAlloc(4),f=n.stackAlloc(4),l=c.hb_ot_layout_feature_get_name_ids(this.ptr,r,_,a,o,i,u,f),b;if(l){let d=n.HEAPU32[a/4],T=n.HEAPU32[o/4],m=n.HEAPU32[i/4],R=n.HEAPU32[u/4],L=n.HEAPU32[f/4];b={paramUiLabelNameIds:Array.from({length:R},(G,C)=>L+C)},d!=w&&(b.uiLabelNameId=d),T!=w&&(b.uiTooltipTextNameId=T),m!=w&&(b.sampleTextNameId=m);}return n.stackRestore(t),b}hasColorPalettes(){return !!c.hb_ot_color_has_palettes(this.ptr)}getColorPalettes(){let s=c.hb_ot_color_palette_get_count(this.ptr),_=[],t=n.stackSave(),r=n.stackAlloc(4),a=n.stackAlloc(512);for(let o=0;o<s;o++){let i=[],u=0,f=128;for(;f===128;){n.HEAPU32[r/4]=f,c.hb_ot_color_palette_get_colors(this.ptr,o,u,r,a),f=n.HEAPU32[r/4];for(let d=0;d<f;d++){let T=ot(n.HEAPU32[a/4+d]),m=c.hb_ot_color_palette_color_get_name_id(this.ptr,u+d);m!=w&&(T.nameId=m),i.push(T);}u+=f;}let l={colors:i,flags:c.hb_ot_color_palette_get_flags(this.ptr,o)},b=c.hb_ot_color_palette_get_name_id(this.ptr,o);b!=w&&(l.nameId=b),_.push(l);}return n.stackRestore(t),_}hasColorLayers(){return !!c.hb_ot_color_has_layers(this.ptr)}getGlyphColorLayers(s){let _=[],t=n.stackSave(),r=n.stackAlloc(4),a=n.stackAlloc(1024),o=0,i=128;for(;i===128;){n.HEAPU32[r/4]=i,c.hb_ot_color_glyph_get_layers(this.ptr,s,o,r,a),i=n.HEAPU32[r/4];for(let u=0;u<i;u++){let f=a/4+u*2,l={glyph:n.HEAPU32[f]},b=n.HEAPU32[f+1];b!=65535&&(l.colorIndex=b),_.push(l);}o+=i;}return n.stackRestore(t),_}hasColorPaint(){return !!c.hb_ot_color_has_paint(this.ptr)}glyphHasColorPaint(s){return !!c.hb_ot_color_glyph_has_paint(this.ptr,s)}hasColorPng(){return !!c.hb_ot_color_has_png(this.ptr)}},Lt=class{constructor(){this.funcPtrs=[],this.userDataPtrs=[],this.ptr=c.hb_draw_funcs_create();let s=this.ptr,_=this.funcPtrs,t=this.userDataPtrs;at.register(this,()=>{c.hb_draw_funcs_destroy(s);for(let r of _)n.removeFunction(r);for(let r of t)N(r);});}setMoveToFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l)=>{s(u,f,g(o),g(l));},"viiiffi");this.funcPtrs.push(r),c.hb_draw_funcs_set_move_to_func(this.ptr,r,t,0);}setLineToFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l)=>{s(u,f,g(o),g(l));},"viiiffi");this.funcPtrs.push(r),c.hb_draw_funcs_set_line_to_func(this.ptr,r,t,0);}setQuadraticToFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d)=>{s(u,f,l,b,g(o),g(d));},"viiiffffi");this.funcPtrs.push(r),c.hb_draw_funcs_set_quadratic_to_func(this.ptr,r,t,0);}setCubicToFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d,T,m)=>{s(u,f,l,b,d,T,g(o),g(m));},"viiiffffffi");this.funcPtrs.push(r),c.hb_draw_funcs_set_cubic_to_func(this.ptr,r,t,0);}setClosePathFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u)=>{s(g(o),g(u));},"viiii");this.funcPtrs.push(r),c.hb_draw_funcs_set_close_path_func(this.ptr,r,t,0);}},$r={HORIZONTAL_ASCENDER:p("hasc"),HORIZONTAL_DESCENDER:p("hdsc"),HORIZONTAL_LINE_GAP:p("hlgp"),HORIZONTAL_CLIPPING_ASCENT:p("hcla"),HORIZONTAL_CLIPPING_DESCENT:p("hcld"),VERTICAL_ASCENDER:p("vasc"),VERTICAL_DESCENDER:p("vdsc"),VERTICAL_LINE_GAP:p("vlgp"),HORIZONTAL_CARET_RISE:p("hcrs"),HORIZONTAL_CARET_RUN:p("hcrn"),HORIZONTAL_CARET_OFFSET:p("hcof"),VERTICAL_CARET_RISE:p("vcrs"),VERTICAL_CARET_RUN:p("vcrn"),VERTICAL_CARET_OFFSET:p("vcof"),X_HEIGHT:p("xhgt"),CAP_HEIGHT:p("cpht"),SUBSCRIPT_EM_X_SIZE:p("sbxs"),SUBSCRIPT_EM_Y_SIZE:p("sbys"),SUBSCRIPT_EM_X_OFFSET:p("sbxo"),SUBSCRIPT_EM_Y_OFFSET:p("sbyo"),SUPERSCRIPT_EM_X_SIZE:p("spxs"),SUPERSCRIPT_EM_Y_SIZE:p("spys"),SUPERSCRIPT_EM_X_OFFSET:p("spxo"),SUPERSCRIPT_EM_Y_OFFSET:p("spyo"),STRIKEOUT_SIZE:p("strs"),STRIKEOUT_OFFSET:p("stro"),UNDERLINE_SIZE:p("unds"),UNDERLINE_OFFSET:p("undo")},k;function kr(){return k||(k=new Lt,k.setMoveToFunc((s,_,t)=>{t.push(`M${s},${_}`);}),k.setLineToFunc((s,_,t)=>{t.push(`L${s},${_}`);}),k.setCubicToFunc((s,_,t,r,a,o,i)=>{i.push(`C${s},${_} ${t},${r} ${a},${o}`);}),k.setQuadraticToFunc((s,_,t,r,a)=>{a.push(`Q${s},${_} ${t},${r}`);}),k.setClosePathFunc(s=>{s.push("Z");})),k}var U;function Ur(){return U||(U=new Lt,U.setMoveToFunc((s,_,t)=>{t.push({type:"M",values:[s,_]});}),U.setLineToFunc((s,_,t)=>{t.push({type:"L",values:[s,_]});}),U.setCubicToFunc((s,_,t,r,a,o,i)=>{i.push({type:"C",values:[s,_,t,r,a,o]});}),U.setQuadraticToFunc((s,_,t,r,a)=>{a.push({type:"Q",values:[s,_,t,r]});}),U.setClosePathFunc(s=>{s.push({type:"Z",values:[]});})),U}var E=class Nt{constructor(_){typeof _=="number"?this.ptr=c.hb_font_reference(_):(this.ptr=c.hb_font_create(_.ptr),this._face=_),$(this,c.hb_font_destroy);}get face(){return this._face||(this._face=new Fr(c.hb_font_get_face(this.ptr))),this._face}subFont(){return new Nt(c.hb_font_create_sub_font(this.ptr))}hExtents(){let _=n.stackSave(),t=n.stackAlloc(48);c.hb_font_get_h_extents(this.ptr,t);let r={ascender:n.HEAP32[t/4],descender:n.HEAP32[t/4+1],lineGap:n.HEAP32[t/4+2]};return n.stackRestore(_),r}vExtents(){let _=n.stackSave(),t=n.stackAlloc(48);c.hb_font_get_v_extents(this.ptr,t);let r={ascender:n.HEAP32[t/4],descender:n.HEAP32[t/4+1],lineGap:n.HEAP32[t/4+2]};return n.stackRestore(_),r}glyphName(_){let t=n.stackSave(),r=256,a=n.stackAlloc(r);c.hb_font_glyph_to_string(this.ptr,_,a,r);let o=I(a);return n.stackRestore(t),o}drawGlyph(_,t,r){let a=v(r);try{c.hb_font_draw_glyph(this.ptr,_,t.ptr,a);}finally{N(a);}}drawGlyphOrFail(_,t,r){let a=v(r);try{return !!c.hb_font_draw_glyph_or_fail(this.ptr,_,t.ptr,a)}finally{N(a);}}paintGlyph(_,t,r,a=0,o={red:0,green:0,blue:0,alpha:255}){let i=v(r);try{c.hb_font_paint_glyph(this.ptr,_,t.ptr,i,a,st(o));}finally{N(i);}}paintGlyphOrFail(_,t,r,a=0,o={red:0,green:0,blue:0,alpha:255}){let i=v(r);try{return !!c.hb_font_paint_glyph_or_fail(this.ptr,_,t.ptr,i,a,st(o))}finally{N(i);}}getGlyphColorPng(_){let t=c.hb_ot_color_glyph_reference_png(this.ptr,_),r=c.hb_blob_get_length(t),a;if(r){let o=c.hb_blob_get_data(t,0);a=n.HEAPU8.slice(o,o+r);}return c.hb_blob_destroy(t),a}glyphToPath(_){let t=[];return this.drawGlyph(_,kr(),t),t.join("")}glyphHAdvance(_){return c.hb_font_get_glyph_h_advance(this.ptr,_)}glyphVAdvance(_){return c.hb_font_get_glyph_v_advance(this.ptr,_)}glyphHOrigin(_){let t=n.stackSave(),r=n.stackAlloc(4),a=n.stackAlloc(4),o;return c.hb_font_get_glyph_h_origin(this.ptr,_,r,a)&&(o=[n.HEAP32[r/4],n.HEAP32[a/4]]),n.stackRestore(t),o}glyphVOrigin(_){let t=n.stackSave(),r=n.stackAlloc(4),a=n.stackAlloc(4),o;return c.hb_font_get_glyph_v_origin(this.ptr,_,r,a)&&(o=[n.HEAP32[r/4],n.HEAP32[a/4]]),n.stackRestore(t),o}glyphExtents(_){let t=n.stackSave(),r=n.stackAlloc(16),a;return c.hb_font_get_glyph_extents(this.ptr,_,r)&&(a={xBearing:n.HEAP32[r/4],yBearing:n.HEAP32[r/4+1],width:n.HEAP32[r/4+2],height:n.HEAP32[r/4+3]}),n.stackRestore(t),a}glyph(_,t=0){let r=n.stackSave(),a=n.stackAlloc(4),o;return c.hb_font_get_glyph(this.ptr,_,t,a)&&(o=n.HEAPU32[a/4]),n.stackRestore(r),o}nominalGlyph(_){let t=n.stackSave(),r=n.stackAlloc(4),a;return c.hb_font_get_nominal_glyph(this.ptr,_,r)&&(a=n.HEAPU32[r/4]),n.stackRestore(t),a}variationGlyph(_,t){let r=n.stackSave(),a=n.stackAlloc(4),o;return c.hb_font_get_variation_glyph(this.ptr,_,t,a)&&(o=n.HEAPU32[a/4]),n.stackRestore(r),o}glyphFromName(_){let t=n.stackSave(),r=n.stackAlloc(4),a=Er(_),o;return c.hb_font_get_glyph_from_name(this.ptr,a.ptr,a.length,r)&&(o=n.HEAPU32[r/4]),a.free(),n.stackRestore(t),o}glyphToJson(_){let t=[];return this.drawGlyph(_,Ur(),t),t}setScale(_,t){c.hb_font_set_scale(this.ptr,_,t);}setVariations(_){let t=n.stackSave(),r=n.stackAlloc(8*_.length);_.forEach((a,o)=>{a.writeTo(r+o*8);}),c.hb_font_set_variations(this.ptr,r,_.length),n.stackRestore(t);}setFuncs(_){c.hb_font_set_funcs(this.ptr,_.ptr);}getLookupOpticalBound(_,t,r){return c.hb_ot_layout_lookup_get_optical_bound(this.ptr,_,t,r)}getLigatureCarets(_,t){let r=n.stackSave(),a=0,o=128,i=n.stackAlloc(4),u=n.stackAlloc(512),f=[];for(;o==128;){n.HEAPU32[i/4]=o,c.hb_ot_layout_get_ligature_carets(this.ptr,_,t,a,i,u),o=n.HEAPU32[i/4];let l=n.HEAP32.subarray(u/4,u/4+o);f.push(...Array.from(l)),a+=o;}return n.stackRestore(r),f}getMetricPosition(_){let t=n.stackSave(),r=n.stackAlloc(4),a;return c.hb_ot_metrics_get_position(this.ptr,_,r)&&(a=n.HEAP32[r/4]),n.stackRestore(t),a}getMetricPositionWithFallback(_){let t=n.stackSave(),r=n.stackAlloc(4);c.hb_ot_metrics_get_position_with_fallback(this.ptr,_,r);let a=n.HEAP32[r/4];return n.stackRestore(t),a}getMetricVariation(_){return c.hb_ot_metrics_get_variation(this.ptr,_)}getMetricXVariation(_){return c.hb_ot_metrics_get_x_variation(this.ptr,_)}getMetricYVariation(_){return c.hb_ot_metrics_get_y_variation(this.ptr,_)}},Yr=class{constructor(){this.ptr=c.hb_font_funcs_create(),$(this,c.hb_font_funcs_destroy);}setGlyphExtentsFunc(s){let _=n.addFunction((t,r,a,o,i)=>{let u=s(new E(t),a);return u?(n.HEAP32[o/4]=u.xBearing,n.HEAP32[o/4+1]=u.yBearing,n.HEAP32[o/4+2]=u.width,n.HEAP32[o/4+3]=u.height,1):0},"ippipp");c.hb_font_funcs_set_glyph_extents_func(this.ptr,_,0,0);}setGlyphFromNameFunc(s){let _=n.addFunction((t,r,a,o,i,u)=>{let f=s(new E(t),I(a,o));return f?(n.HEAPU32[i/4]=f,1):0},"ipppipp");c.hb_font_funcs_set_glyph_from_name_func(this.ptr,_,0,0);}setGlyphHAdvanceFunc(s){let _=n.addFunction((t,r,a,o)=>s(new E(t),a),"ippip");c.hb_font_funcs_set_glyph_h_advance_func(this.ptr,_,0,0);}setGlyphVAdvanceFunc(s){let _=n.addFunction((t,r,a,o)=>s(new E(t),a),"ippip");c.hb_font_funcs_set_glyph_v_advance_func(this.ptr,_,0,0);}setGlyphHOriginFunc(s){let _=n.addFunction((t,r,a,o,i,u)=>{let f=s(new E(t),a);return f?(n.HEAP32[o/4]=f[0],n.HEAP32[i/4]=f[1],1):0},"ippippp");c.hb_font_funcs_set_glyph_h_origin_func(this.ptr,_,0,0);}setGlyphVOriginFunc(s){let _=n.addFunction((t,r,a,o,i,u)=>{let f=s(new E(t),a);return f?(n.HEAP32[o/4]=f[0],n.HEAP32[i/4]=f[1],1):0},"ippippp");c.hb_font_funcs_set_glyph_v_origin_func(this.ptr,_,0,0);}setGlyphHKerningFunc(s){let _=n.addFunction((t,r,a,o,i)=>s(new E(t),a,o),"ippiip");c.hb_font_funcs_set_glyph_h_kerning_func(this.ptr,_,0,0);}setGlyphNameFunc(s){let _=new TextEncoder,t=n.addFunction((r,a,o,i,u,f)=>{let l=s(new E(r),o);return l?(_.encodeInto(l,n.HEAPU8.subarray(i,i+u)),1):0},"ippipip");c.hb_font_funcs_set_glyph_name_func(this.ptr,t,0,0);}setNominalGlyphFunc(s){let _=n.addFunction((t,r,a,o,i)=>{let u=s(new E(t),a);return u?(n.HEAPU32[o/4]=u,1):0},"ippipp");c.hb_font_funcs_set_nominal_glyph_func(this.ptr,_,0,0);}setVariationGlyphFunc(s){let _=n.addFunction((t,r,a,o,i,u)=>{let f=s(new E(t),a,o);return f?(n.HEAPU32[i/4]=f,1):0},"ippiipp");c.hb_font_funcs_set_variation_glyph_func(this.ptr,_,0,0);}setFontHExtentsFunc(s){let _=n.addFunction((t,r,a,o)=>{let i=s(new E(t));return i?(n.HEAP32[a/4]=i.ascender,n.HEAP32[a/4+1]=i.descender,n.HEAP32[a/4+2]=i.lineGap,1):0},"ipppp");c.hb_font_funcs_set_font_h_extents_func(this.ptr,_,0,0);}setFontVExtentsFunc(s){let _=n.addFunction((t,r,a,o)=>{let i=s(new E(t));return i?(n.HEAP32[a/4]=i.ascender,n.HEAP32[a/4+1]=i.descender,n.HEAP32[a/4+2]=i.lineGap,1):0},"ipppp");c.hb_font_funcs_set_font_v_extents_func(this.ptr,_,0,0);}};function rt(s){let _=c.hb_color_line_get_extend(s),t=[],r=n.stackSave(),a=n.stackAlloc(4),o=n.stackAlloc(1536),i=0,u=128;for(;u===128;){n.HEAPU32[a/4]=u,c.hb_color_line_get_color_stops(s,i,a,o),u=n.HEAPU32[a/4];for(let f=0;f<u;f++){let l=(o+f*12)/4;t.push({offset:n.HEAPF32[l],isForeground:n.HEAPU32[l+1]!==0,color:ot(n.HEAPU32[l+2])});}i+=u;}return n.stackRestore(r),{extend:_,colorStops:t}}var Zr=class{constructor(){this.funcPtrs=[],this.userDataPtrs=[],this.ptr=c.hb_paint_funcs_create();let s=this.ptr,_=this.funcPtrs,t=this.userDataPtrs;at.register(this,()=>{c.hb_paint_funcs_destroy(s);for(let r of _)n.removeFunction(r);for(let r of t)N(r);});}setPushTransformFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d,T)=>s(i,u,f,l,b,d,g(o),g(T)),"viiffffffi");this.funcPtrs.push(r),c.hb_paint_funcs_set_push_transform_func(this.ptr,r,t,0);}setPopTransformFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i)=>s(g(o),g(i)),"viii");this.funcPtrs.push(r),c.hb_paint_funcs_set_pop_transform_func(this.ptr,r,t,0);}setColorGlyphFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f)=>s(i,new E(u),g(o),g(f))?1:0,"iiiiii");this.funcPtrs.push(r),c.hb_paint_funcs_set_color_glyph_func(this.ptr,r,t,0);}setPushClipGlyphFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f)=>s(i,new E(u),g(o),g(f)),"viiiii");this.funcPtrs.push(r),c.hb_paint_funcs_set_push_clip_glyph_func(this.ptr,r,t,0);}setPushClipRectangleFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b)=>s(i,u,f,l,g(o),g(b)),"viiffffi");this.funcPtrs.push(r),c.hb_paint_funcs_set_push_clip_rectangle_func(this.ptr,r,t,0);}setPopClipFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i)=>s(g(o),g(i)),"viii");this.funcPtrs.push(r),c.hb_paint_funcs_set_pop_clip_func(this.ptr,r,t,0);}setColorFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f)=>s(i!==0,ot(u),g(o),g(f)),"viiiii");this.funcPtrs.push(r),c.hb_paint_funcs_set_color_func(this.ptr,r,t,0);}setImageFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d,T)=>{let m=c.hb_blob_get_length(i),R=c.hb_blob_get_data(i,0),L=n.HEAPU8.subarray(R,R+m),G;return d&&(G={xBearing:n.HEAP32[d/4],yBearing:n.HEAP32[d/4+1],width:n.HEAP32[d/4+2],height:n.HEAP32[d/4+3]}),s(L,u,f,S(l),G,g(o),g(T))?1:0},"iiiiiiifii");this.funcPtrs.push(r),c.hb_paint_funcs_set_image_func(this.ptr,r,t,0);}setLinearGradientFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d,T,m)=>s(rt(i),u,f,l,b,d,T,g(o),g(m)),"viiiffffffi");this.funcPtrs.push(r),c.hb_paint_funcs_set_linear_gradient_func(this.ptr,r,t,0);}setRadialGradientFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d,T,m)=>s(rt(i),u,f,l,b,d,T,g(o),g(m)),"viiiffffffi");this.funcPtrs.push(r),c.hb_paint_funcs_set_radial_gradient_func(this.ptr,r,t,0);}setSweepGradientFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f,l,b,d)=>s(rt(i),u,f,l,b,g(o),g(d)),"viiiffffi");this.funcPtrs.push(r),c.hb_paint_funcs_set_sweep_gradient_func(this.ptr,r,t,0);}setPushGroupFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i)=>s(g(o),g(i)),"viii");this.funcPtrs.push(r),c.hb_paint_funcs_set_push_group_func(this.ptr,r,t,0);}setPopGroupFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u)=>s(i,g(o),g(u)),"viiii");this.funcPtrs.push(r),c.hb_paint_funcs_set_pop_group_func(this.ptr,r,t,0);}setCustomPaletteColorFunc(s,_){let t=v(_);this.userDataPtrs.push(t);let r=n.addFunction((a,o,i,u,f)=>{let l=s(i,g(o),g(f));return l!==void 0?(n.HEAPU32[u/4]=st(l),1):0},"iiiiii");this.funcPtrs.push(r),c.hb_paint_funcs_set_custom_palette_color_func(this.ptr,r,t,0);}},Ir={INVALID:0,UNICODE:1,GLYPHS:2},Cr={DEFAULT:0,NO_CLUSTERS:1,NO_POSITIONS:2,NO_GLYPH_NAMES:4,GLYPH_EXTENTS:8,GLYPH_FLAGS:16,NO_ADVANCES:32,DEFINED:63},Xr={DEFAULT:0,BOT:1,EOT:2,PRESERVE_DEFAULT_IGNORABLES:4,REMOVE_DEFAULT_IGNORABLES:8,DO_NOT_INSERT_DOTTED_CIRCLE:16,VERIFY:32,PRODUCE_UNSAFE_TO_CONCAT:64,PRODUCE_SAFE_TO_INSERT_TATWEEL:128,DEFINED:255},jr={INVALID:0,LTR:4,RTL:5,TTB:6,BTT:7},Kr={MONOTONE_GRAPHEMES:0,MONOTONE_CHARACTERS:1,CHARACTERS:2,GRAPHEMES:3,DEFAULT:0},Gt={INVALID:0,TEXT:p("TEXT"),JSON:p("JSON")},Jr=class Bt{constructor(_){_!=null?this.ptr=c.hb_buffer_reference(_):this.ptr=c.hb_buffer_create(),$(this,c.hb_buffer_destroy);}add(_,t){c.hb_buffer_add(this.ptr,_,t);}addText(_,t=0,r){let a=Hr(_);c.hb_buffer_add_utf16(this.ptr,a.ptr,a.length,t,r??a.length),a.free();}addCodePoints(_,t=0,r){let a=c.malloc(_.length*4);n.HEAPU32.subarray(a/4,a/4+_.length).set(_),c.hb_buffer_add_codepoints(this.ptr,a,_.length,t,r??_.length),c.free(a);}guessSegmentProperties(){c.hb_buffer_guess_segment_properties(this.ptr);}setDirection(_){c.hb_buffer_set_direction(this.ptr,_);}setFlags(_){c.hb_buffer_set_flags(this.ptr,_);}setLanguage(_){let t=z(_);c.hb_buffer_set_language(this.ptr,c.hb_language_from_string(t.ptr,-1)),t.free();}setScript(_){let t=z(_);c.hb_buffer_set_script(this.ptr,c.hb_script_from_string(t.ptr,-1)),t.free();}setClusterLevel(_){c.hb_buffer_set_cluster_level(this.ptr,_);}reset(){c.hb_buffer_reset(this.ptr);}clearContents(){c.hb_buffer_clear_contents(this.ptr);}setMessageFunc(_){let t=(a,o,i,u)=>{let f=I(i);return _(new Bt(a),new E(o),f)?1:0},r=n.addFunction(t,"iiiii");c.hb_buffer_set_message_func(this.ptr,r,0,0);}getLength(){return c.hb_buffer_get_length(this.ptr)}getGlyphInfos(){let _=c.hb_buffer_get_glyph_infos(this.ptr,0),t=n.HEAPU32.subarray(_/4,_/4+this.getLength()*5),r=[];for(let a=0;a<t.length;a+=5)r.push({codepoint:t[a],cluster:t[a+2],flags:c.hb_glyph_info_get_glyph_flags(_+a*4)});return r}getGlyphPositions(){let _=c.hb_buffer_get_glyph_positions(this.ptr,0)/4;if(_==0)return [];let t=n.HEAP32.subarray(_,_+this.getLength()*5),r=[];for(let a=0;a<t.length;a+=5)r.push({xAdvance:t[a],yAdvance:t[a+1],xOffset:t[a+2],yOffset:t[a+3]});return r}getGlyphInfosAndPositions(){let _=c.hb_buffer_get_glyph_infos(this.ptr,0),t=n.HEAPU32.subarray(_/4,_/4+this.getLength()*5),r=c.hb_buffer_get_glyph_positions(this.ptr,0)/4,a=r?n.HEAP32.subarray(r,r+this.getLength()*5):void 0,o=[];for(let i=0;i<t.length;i+=5){let u={codepoint:t[i],cluster:t[i+2],flags:c.hb_glyph_info_get_glyph_flags(_+i*4)};for(let[f,l]of [["mask",1],["var1",3],["var2",4]])Object.defineProperty(u,f,{value:t[i+l],enumerable:false});a&&(u.xAdvance=a[i],u.yAdvance=a[i+1],u.xOffset=a[i+2],u.yOffset=a[i+3],Object.defineProperty(u,"var",{value:a[i+4],enumerable:false})),o.push(u);}return o}updateGlyphPositions(_){let t=c.hb_buffer_get_glyph_positions(this.ptr,0)/4;if(t==0)return;let r=Math.min(_.length,this.getLength()),a=n.HEAP32.subarray(t,t+r*5);for(let o=0;o<r;o++)a[o*5]=_[o].xAdvance,a[o*5+1]=_[o].yAdvance,a[o*5+2]=_[o].xOffset,a[o*5+3]=_[o].yOffset;}serialize(_={}){let{font:t,start:r=0,end:a,format:o=Gt.TEXT,flags:i=0}=_,u=n.stackSave(),f=a??this.getLength(),l=32*1024,b=c.malloc(l),d=n.stackAlloc(4),T="";for(;r<f;){r+=c.hb_buffer_serialize(this.ptr,r,f,b,l,d,t?t.ptr:0,o,i);let m=n.HEAPU32[d/4];if(m==0)break;T+=I(b,m);}return c.free(b),n.stackRestore(u),T}getContentType(){return c.hb_buffer_get_content_type(this.ptr)}},Qr=class J{static{this.GLOBAL_START=0;}static{this.GLOBAL_END=4294967295;}constructor(_,t=1,r=J.GLOBAL_START,a=J.GLOBAL_END){this.tag=_,this.value=t,this.start=r,this.end=a;}static fromString(_){let t=n.stackSave(),r=n.stackAlloc(16),a=z(_),o;return c.hb_feature_from_string(a.ptr,-1,r)&&(o=new J(S(n.HEAPU32[r/4]),n.HEAPU32[r/4+1],n.HEAPU32[r/4+2],n.HEAPU32[r/4+3])),a.free(),n.stackRestore(t),o}toString(){let _=n.stackSave(),t=n.stackAlloc(16);this.writeTo(t);let r=128,a=n.stackAlloc(r);c.hb_feature_to_string(t,a,r);let o=I(a);return n.stackRestore(_),o}writeTo(_){n.HEAPU32[_/4]=p(this.tag),n.HEAPU32[_/4+1]=this.value,n.HEAPU32[_/4+2]=this.start,n.HEAPU32[_/4+3]=this.end;}},qr=class Mt{constructor(_,t=0){this.tag=_,this.value=t;}static fromString(_){let t=n.stackSave(),r=n.stackAlloc(8),a=z(_),o;return c.hb_variation_from_string(a.ptr,-1,r)&&(o=new Mt(S(n.HEAPU32[r/4]),n.HEAPF32[r/4+1])),a.free(),n.stackRestore(t),o}toString(){let _=n.stackSave(),t=n.stackAlloc(8);this.writeTo(t);let r=128,a=n.stackAlloc(r);c.hb_variation_to_string(t,a,r);let o=I(a);return n.stackRestore(_),o}writeTo(_){n.HEAPU32[_/4]=p(this.tag),n.HEAPF32[_/4+1]=this.value;}},K={DONT_STOP:0,GSUB:1,GPOS:2};function Or(s,_,t){let r=t?.length??0,a=n.stackSave(),o=0;r&&(o=n.stackAlloc(16*r),t.forEach((i,u)=>{i.writeTo(o+u*16);})),c.hb_shape(s.ptr,_.ptr,o,r),n.stackRestore(a);}function xr(s,_,t,r,a){let o=[],i=K.DONT_STOP,u=false;return _.setMessageFunc((f,l,b)=>{if(b.startsWith("start table GSUB")?i=K.GSUB:b.startsWith("start table GPOS")&&(i=K.GPOS),i!=a&&(u=false),a!=K.DONT_STOP&&i==a&&b.startsWith("end lookup "+r)&&(u=true),u)return false;let d=f.serialize({font:l,format:Gt.JSON,flags:Cr.NO_GLYPH_NAMES});return o.push({m:b,t:JSON.parse(d),glyphs:f.getContentType()==Ir.GLYPHS}),true}),Or(s,_,t),o}function ts(){let s=n.stackSave(),_=n.stackAlloc(12);c.hb_version(_,_+4,_+8);let t={major:n.HEAPU32[_/4],minor:n.HEAPU32[(_+4)/4],micro:n.HEAPU32[(_+8)/4]};return n.stackRestore(s),t}function _s(){return I(c.hb_version_string())}function es(s){let _=p(s);return S(c.hb_ot_tag_to_script(_))}function ns(s){let _=p(s);return Ot(c.hb_ot_tag_to_language(_))}Tr(await It());
2
2
  export{Vr as AxisFlags,wr as Blob,Jr as Buffer,Ir as BufferContentType,Xr as BufferFlag,Cr as BufferSerializeFlag,Gt as BufferSerializeFormat,Kr as ClusterLevel,Gr as ColorPaletteFlags,jr as Direction,Lt as DrawFuncs,Fr as Face,Qr as Feature,E as Font,Yr as FontFuncs,zr as GlyphClass,Wr as GlyphFlag,$r as MetricsTag,Mr as PaintCompositeMode,Br as PaintExtend,Zr as PaintFuncs,K as TracePhase,qr as Variation,ns as otTagToLanguage,es as otTagToScript,Or as shape,xr as shapeWithTrace,ts as version,_s as versionString};