@docx-editor.dev/core 0.0.1-placeholder → 2.0.1

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 (116) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +92 -2
  3. package/THIRD_PARTY_NOTICES.md +18 -0
  4. package/dist/automation.cjs +1 -0
  5. package/dist/automation.d.cts +74 -0
  6. package/dist/automation.d.ts +74 -0
  7. package/dist/automation.js +1 -0
  8. package/dist/binding.cjs +1 -0
  9. package/dist/binding.d.cts +82 -0
  10. package/dist/binding.d.ts +82 -0
  11. package/dist/binding.js +1 -0
  12. package/dist/chunk-5KSCB2OZ.js +2 -0
  13. package/dist/chunk-BSC44TIT.js +5 -0
  14. package/dist/chunk-DLPL5DAG.js +12 -0
  15. package/dist/chunk-DOEIARE2.js +2 -0
  16. package/dist/chunk-G7YCQBZE.cjs +5 -0
  17. package/dist/chunk-HBL3NNH5.cjs +1 -0
  18. package/dist/chunk-HR7K3W6A.js +1 -0
  19. package/dist/chunk-HVAV2JSN.js +11 -0
  20. package/dist/chunk-MYH2HCUJ.cjs +2 -0
  21. package/dist/chunk-NSM75TN6.cjs +1 -0
  22. package/dist/chunk-PHDVKUWZ.js +1 -0
  23. package/dist/chunk-QADYGK5L.cjs +12 -0
  24. package/dist/chunk-REZUWYB7.js +1 -0
  25. package/dist/chunk-RNBHTPW7.js +10 -0
  26. package/dist/chunk-UD2ZXLFI.cjs +2 -0
  27. package/dist/chunk-VYAVK2AH.cjs +1 -0
  28. package/dist/chunk-YUK46A2N.cjs +11 -0
  29. package/dist/chunk-ZMIX42J7.cjs +10 -0
  30. package/dist/chunk-ZT55Q52J.cjs +2 -0
  31. package/dist/chunk-ZUALAR4M.js +2 -0
  32. package/dist/content-control-walk-CbTqHq6O.d.cts +56 -0
  33. package/dist/content-control-walk-D06GijR0.d.ts +56 -0
  34. package/dist/contracts/document.cjs +1 -0
  35. package/dist/contracts/document.d.cts +246 -0
  36. package/dist/contracts/document.d.ts +246 -0
  37. package/dist/contracts/document.js +0 -0
  38. package/dist/contracts/editor.cjs +1 -0
  39. package/dist/contracts/editor.d.cts +11 -0
  40. package/dist/contracts/editor.d.ts +11 -0
  41. package/dist/contracts/editor.js +1 -0
  42. package/dist/contracts/interaction.cjs +1 -0
  43. package/dist/contracts/interaction.d.cts +11 -0
  44. package/dist/contracts/interaction.d.ts +11 -0
  45. package/dist/contracts/interaction.js +0 -0
  46. package/dist/contracts/modules.cjs +1 -0
  47. package/dist/contracts/modules.d.cts +90 -0
  48. package/dist/contracts/modules.d.ts +90 -0
  49. package/dist/contracts/modules.js +1 -0
  50. package/dist/contracts/types.cjs +1 -0
  51. package/dist/contracts/types.d.cts +452 -0
  52. package/dist/contracts/types.d.ts +452 -0
  53. package/dist/contracts/types.js +0 -0
  54. package/dist/editor-C1QRi1v4.d.ts +1671 -0
  55. package/dist/editor-D0UDock4.d.cts +1671 -0
  56. package/dist/editor.cjs +1 -0
  57. package/dist/editor.css +6017 -0
  58. package/dist/editor.d.cts +271 -0
  59. package/dist/editor.d.ts +271 -0
  60. package/dist/editor.js +1 -0
  61. package/dist/hf-references-BdjsQNE_.d.ts +71 -0
  62. package/dist/hf-references-CgEOSw3i.d.cts +71 -0
  63. package/dist/image-resources-BJnTpG66.d.ts +195 -0
  64. package/dist/image-resources-BpIydXtU.d.cts +195 -0
  65. package/dist/index-CrW-IxXt.d.cts +2515 -0
  66. package/dist/index-ZqBEOrTV.d.ts +2515 -0
  67. package/dist/index.cjs +1 -0
  68. package/dist/index.d.cts +22 -0
  69. package/dist/index.d.ts +22 -0
  70. package/dist/index.js +1 -0
  71. package/dist/layout.cjs +1 -0
  72. package/dist/layout.d.cts +2316 -0
  73. package/dist/layout.d.ts +2316 -0
  74. package/dist/layout.js +1 -0
  75. package/dist/note-nodes-BPSTVDMr.d.ts +108 -0
  76. package/dist/note-nodes-C6DLxlvj.d.cts +108 -0
  77. package/dist/note-properties-CnmCoory.d.cts +68 -0
  78. package/dist/note-properties-m75hmP70.d.ts +68 -0
  79. package/dist/ooxml-package-CR5us6ad.d.cts +354 -0
  80. package/dist/ooxml-package-D_CtywTW.d.ts +354 -0
  81. package/dist/ooxml-tree-BU0e3DVi.d.cts +871 -0
  82. package/dist/ooxml-tree-BU0e3DVi.d.ts +871 -0
  83. package/dist/output.cjs +1 -0
  84. package/dist/output.d.cts +158 -0
  85. package/dist/output.d.ts +158 -0
  86. package/dist/output.js +1 -0
  87. package/dist/protocol-CAkOBBGE.d.cts +1201 -0
  88. package/dist/protocol-oxHaWmt4.d.ts +1201 -0
  89. package/dist/review-support-DS8DYX2a.d.cts +326 -0
  90. package/dist/review-support-Fy3vdIea.d.ts +326 -0
  91. package/dist/revision-projection-72ZApe-g.d.cts +84 -0
  92. package/dist/revision-projection-DHAkcD_L.d.ts +84 -0
  93. package/dist/semantic-cell-selection-CZjBSmMv.d.cts +427 -0
  94. package/dist/semantic-cell-selection-DsmHmLJ5.d.ts +427 -0
  95. package/dist/semantic-interaction-D-Dszxrn.d.cts +187 -0
  96. package/dist/semantic-interaction-Dy-dCUFF.d.ts +187 -0
  97. package/dist/semantic-paint-drawings-BA3z9jl8.d.ts +21 -0
  98. package/dist/semantic-paint-drawings-D7qbB0E2.d.cts +21 -0
  99. package/dist/semantic-records-CJR3BvHs.d.cts +1432 -0
  100. package/dist/semantic-records-CWodBJsz.d.ts +1432 -0
  101. package/dist/shaped-measurer-B-TAtcQU.d.ts +613 -0
  102. package/dist/shaped-measurer-CNIT_svZ.d.cts +613 -0
  103. package/dist/store.cjs +1 -0
  104. package/dist/store.d.cts +2247 -0
  105. package/dist/store.d.ts +2247 -0
  106. package/dist/store.js +1 -0
  107. package/dist/tree-op-types-CwOeiaQ8.d.ts +1431 -0
  108. package/dist/tree-op-types-DMiW6nIH.d.cts +1431 -0
  109. package/dist/tree-package-store-D5S7VKs5.d.ts +708 -0
  110. package/dist/tree-package-store-DOKMtCnh.d.cts +708 -0
  111. package/dist/tree-session-CiUel5Kz.d.ts +542 -0
  112. package/dist/tree-session-D47_imvR.d.cts +542 -0
  113. package/dist/tree-store-CxifqwIv.d.cts +273 -0
  114. package/dist/tree-store-hLtjeyWE.d.ts +273 -0
  115. package/package.json +105 -15
  116. package/index.js +0 -1
@@ -0,0 +1,2 @@
1
+ import {t,u,G,w as w$1,B as B$1,A,z,uc,zc,Ea,Ca,Ha,Aa,o,ca,Ra,ba,Gc,la,q as q$1,ua,wa,Xb,ic,Ib,Kb,va,ka,pa,oa}from'./chunk-RNBHTPW7.js';import {strFromU8,strToU8}from'fflate';var xt=["extension","capability","command","query","schema","dependencyKey","runtimePort","result","origin"],Ot=/^[a-z0-9]+(?:-[a-z0-9]+)*(?:\.[a-z0-9]+(?:-[a-z0-9]+)*)+$/,Nt=/^@[a-z0-9.-]+\/[a-z0-9.-]+(?:#[a-z0-9]+(?:[/._-][a-z0-9]+)*)?$/;function Ve(e){return Ot.test(e)||Nt.test(e)}function W(e,t){if(!Ve(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 Rt=/^(\d+)\.(\d+)\.(\d+)$/;function P(e){let t=Rt.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 J(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 Y(e,t){let n=P(e),r=t.trim();if(r==="*")return true;if(r.startsWith("^")){let o=P(r.slice(1));return J(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 s=true;for(let i of o){let a=i.startsWith(">=")?">=":i.startsWith("<")?"<":null;if(!a)throw new Error(`unsupported version range: ${JSON.stringify(t)}`);let d=P(i.slice(a.length)),l=J(n,d);a===">="?s=s&&l>=0:s=s&&l<0;}return s}return J(n,P(r))===0}var g=class extends Error{constructor(n,r,o=[]){super(r);this.code=n;this.responsible=o;this.name="RegistryError";}code;responsible},he=(e,t)=>`${e}:${t}`;function bt(e,t={}){let n=new Map;for(let l of e){if(W(l.id,"extension"),Ke(l.version,l.id),n.has(l.id))throw new g("duplicate-extension",`duplicate extension id ${l.id}`,[l.id]);n.set(l.id,l);for(let c of l.contributions)W(c.id,c.kind),Ke(c.version,`${l.id} \u2192 ${c.id}`),c.replaces&&It(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 g("missing-dependency",`${l.id} requires missing extension ${c}`,[l.id,c]);for(let c of l.conflicts??[])if(n.has(c)){let p=[l.id,c].sort();throw new g("conflict",`extensions ${p[0]} and ${p[1]} conflict`,p)}}Et(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 g("missing-port",`${l.id} requires unavailable port ${c}`,[l.id,c]);let o=new Map,s=new Map,i=new Map;for(let l of e)for(let c of l.contributions){let p=he(c.kind,c.id);if(c.replaces){let u=he(c.kind,c.replaces.targetId),m=i.get(u)??[];m.push({ext:l.id,c}),i.set(u,m);continue}if(s.has(p)){let u=[o.get(p),l.id].sort();throw new g("id-collision",`${c.kind} id ${c.id} registered by both ${u[0]} and ${u[1]}`,u)}s.set(p,c),o.set(p,l.id);}let a=new Map(s);for(let[l,c]of i){let p=s.get(l);if(!p){let f=c[0];throw new g("replacement-target-missing",`${f.ext} replaces missing target ${f.c.replaces.targetId}`,[f.ext,f.c.replaces.targetId])}let u=p.replaceable??{kind:"none"};for(let{ext:f,c:y}of c){if(!Y(p.version,y.replaces.targetRange))throw new g("replacement-version-mismatch",`${f} replaces ${y.replaces.targetId}@${p.version} outside range ${y.replaces.targetRange}`,[f,y.replaces.targetId]);if(u.kind==="none")throw new g("unauthorized-replacement",`${y.replaces.targetId} does not authorize replacement (attempted by ${f})`,[f,y.replaces.targetId])}let m=Ct(p,c);a.set(l,m);}return {extensions:n,contributions:a,get:(l,c)=>a.get(he(l,c))}}function Ct(e,t){let n=e.replaceable??{kind:"none"};if(t.length===1)return t[0].c;if(n.kind==="priority"){let o=[...t].sort((a,d)=>(d.c.replaces.priority??0)-(a.c.replaces.priority??0)),s=o[0].c.replaces.priority??0,i=o.filter(a=>(a.c.replaces.priority??0)===s);if(i.length>1){let a=i.map(d=>d.ext).sort();throw new g("ambiguous-replacement",`multiple replacers of ${e.id} share top priority ${s}: ${a.join(", ")}`,a)}return o[0].c}let r=t.map(o=>o.ext).sort();throw new g("ambiguous-replacement",`multiple replacers of ${e.id}: ${r.join(", ")}`,r)}function Et(e){let o=new Map,s=[],i=a=>{o.set(a,1),s.push(a);let d=[...e.get(a)?.dependencies??[]].sort();for(let l of d){let c=o.get(l)??0;if(c===1){let p=s.indexOf(l),u=[...s.slice(p),l];throw new g("dependency-cycle",`dependency cycle: ${u.join(" -> ")}`,u)}c===0&&i(l);}s.pop(),o.set(a,2);};for(let a of [...e.keys()].sort())(o.get(a)??0)===0&&i(a);}function Ke(e,t){try{P(e);}catch{throw new g("invalid-version",`invalid version ${JSON.stringify(e)} in ${t}`,[t])}}function It(e,t){try{Y("0.0.0",e);}catch{throw new g("invalid-version",`invalid version range ${JSON.stringify(e)} in ${t}`,[t])}}var k=class extends Error{constructor(t){super(t),this.name="BudgetError";}},D=class e{constructor(t,n){this.label=t;this.capacity=n;this.used=new G(`${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 k(`${this.label}: cannot release with ${this.children.size} child budget(s) outstanding`);if(this.activeReservations>0)throw new k(`${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 k(`${this.label}: ${t.length} cleanup error(s); first: ${String(t[0])}`)}assertLive(){if(this.disposed)throw new k(`${this.label}: budget already released`)}};var q=class extends Error{constructor(n,r){super(r?`cancelled: ${r}`:"cancelled");this.derivedOnly=n;this.name="CancellationError";}derivedOnly},M=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 q(t.derivedOnly,t._reason)}}}};var Q=class extends Error{constructor(n){super(`runtime port not available: ${n}`);this.portId=n;this.name="PortResolutionError";}portId},xe=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 Q(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(w$1.clock)}identity(){return this.resolve(w$1.identity)}},Oe=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}},Ne=class{constructor(t="id"){this.prefix=t;}prefix;n=0;newId(){return this.n+=1,`${this.prefix}-${this.n}`}};function vt(e){let t=B$1(e.limits),n=Object.freeze({...e.config??{}}),r=e.capacity??t.maxDecompressedBytes,o=e.id??"op",s={id:o,limits:t,config:n,ports:e.ports,budget:new D(`op:${o}`,r),cancellation:new M};return Object.freeze(s)}function Pt(e){e.budget.dispose();}var be=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"}}),je=Object.keys(be);function kt(e,t){return new G(`${be[t].phase}:${t}`,e[t])}var Re=class{counter;current=0;peak=0;constructor(t){this.counter=new G("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 St(){for(let e of je){let t=A[e],n=z[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 B(e,t=new Set){let n=new WeakSet,r=o=>{if(o===null)return "null";let s=typeof o;if(s==="boolean")return o?"true":"false";if(s==="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(s==="string")return JSON.stringify(o);if(s==="bigint")return `${o.toString()}n`;if(Array.isArray(o))return `[${o.map(r).join(",")}]`;if(s==="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: ${s}`)};return r(e)}function Ce(e,t){let n=B(e,t),r=0xcbf29ce484222325n,o=0x100000001b3n,s=0xffffffffffffffffn;for(let i=0;i<n.length;i++)r^=BigInt(n.charCodeAt(i)),r=r*o&s;return r.toString(16).padStart(16,"0")}var N="dev.docx-editor.core.comparator",Ee={authoredState:{id:`${N}.authored-state`,mode:"canonical-exact",ephemera:["revision","provenance","producedAt","commitId"],note:"canonical normalized authored records; ephemera excluded"},anchor:{id:`${N}.anchor`,mode:"exact",ephemera:[],note:"internal anchor identity/affinity compares exactly"},yjsStateVector:{id:`${N}.yjs-state-vector`,mode:"sync-optimization-only",ephemera:[],note:"exchange optimization only; never proves update or delete-set coverage"},shapedRun:{id:`${N}.shaped-run`,mode:"exact",ephemera:[],note:"glyph ids, clusters, and fixed-point advances compare exactly"},paginationFingerprint:{id:`${N}.pagination-fingerprint`,mode:"exact",ephemera:[],note:"page/column boundaries, break causes, fixed-point geometry compare exactly"},semanticTree:{id:`${N}.semantic-tree`,mode:"exact",ephemera:[],note:"reading order, roles, headings, alt text compare exactly"},hitTest:{id:`${N}.hit-test`,mode:"exact",ephemera:[],note:"resolved hit target and cluster affinity compare exactly"},pdfSemantics:{id:`${N}.pdf-semantics`,mode:"canonical-exact",ephemera:["objectNumber","producer","creationDate","modDate","subsetTag"],note:"canonical semantic PDF objects; container ephemera excluded"},rasterCheckpoint:{id:`${N}.raster-checkpoint`,mode:"tolerance",ephemera:[],note:"documented unavoidable raster comparison; explicit tolerance only"},benchmarkEvidence:{id:`${N}.benchmark-evidence`,mode:"sync-optimization-only",ephemera:[],note:"diagnostic evidence, not an equivalence basis"}};function Ie(e,t,n,r={}){let o=Ee[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:Ge(t,n,r.epsilon)}}case "exact":case "canonical-exact":{let s=o.mode==="canonical-exact"?new Set(o.ephemera):new Set,i=B(t,s),a=B(n,s);return i===a?{equal:true}:{equal:false,left:i,right:a}}}}function ve(e,t){let n=Ee[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 Ce(t,r)}function Ge(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)=>Ge(r,t[o],n)):false}var Xe=new Set([...t,...u]),ze=/^[0-9a-f]{16}$/,Tt=/^[0-9a-f]*$/;function Pe(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,s)=>{let i=`step[${s}]`;Xe.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 a=o.expect;a.outcome==="applied"?(a.committedRevision===void 0?n(`${i}: applied step needs committedRevision`):a.committedRevision<=o.baseRevision?n(`${i}: committedRevision ${a.committedRevision} must exceed baseRevision ${o.baseRevision}`):r=a.committedRevision,a.modelChange&&wt(a.modelChange,i,n)):(a.committedRevision!==void 0&&n(`${i}: ${a.outcome} step must not commit a revision`),a.authoredStateHash!==void 0&&n(`${i}: ${a.outcome} step must not change authored state`)),a.authoredStateHash!==void 0&&!ze.test(a.authoredStateHash)&&n(`${i}: authoredStateHash must be 16-hex`),a.outputHash!==void 0&&!ze.test(a.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}`),Tt.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 wt(e,t,n){Xe.has(e.origin)||n(`${t}: modelChange origin ${e.origin} unknown`),e.toRevision<=e.fromRevision&&n(`${t}: modelChange revision must advance`);}function $t(e,t){let n=Pe(e);if(!n.valid)return {ok:false,mismatches:n.errors};let r=[];return t.init(e),e.steps.forEach((o,s)=>{let i=`step[${s}]`,a=t.applyStep(o),d=o.expect;if(a.outcome!==d.outcome){r.push(`${i}: outcome ${a.outcome} != expected ${d.outcome}`);return}if(d.outcome==="applied"&&(a.committedRevision!==d.committedRevision&&r.push(`${i}: revision ${a.committedRevision} != expected ${d.committedRevision}`),d.authoredStateHash!==void 0))if(a.authoredState===void 0)r.push(`${i}: store returned no authored state to hash`);else {Ie("authoredState",a.authoredState,a.authoredState).equal||r.push(`${i}: authored state is not self-consistent`);let c=We(a.authoredState);c!==d.authoredStateHash&&r.push(`${i}: authoredStateHash ${c} != expected ${d.authoredStateHash}`);}}),{ok:r.length===0,mismatches:r}}function We(e){return ve("authoredState",e)}var At=new Map([["embedRegular","regular"],["embedBold","bold"],["embedItalic","italic"],["embedBoldItalic","boldItalic"]]),_t=32;function qe(e,t){let n=t.replace(/[^0-9a-fA-F]/g,"");if(n.length!==32)return null;let r=new Uint8Array(16);for(let i=0;i<16;i+=1){let a=Number.parseInt(n.slice(i*2,i*2+2),16);if(Number.isNaN(a))return null;r[15-i]=a;}let o=new Uint8Array(e),s=Math.min(_t,o.length);for(let i=0;i<s;i+=1)o[i]=o[i]^r[i%16];return o}var ke=(e,t)=>{if(!(e.kind==="textValue"||!("attributes"in e))){for(let n of e.attributes??[])if(n.localName===t)return n.value}},Je=e=>e.kind==="textValue"?[]:e.children??[],Ye=e=>e.kind==="textValue"||!("localName"in e)?"":e.localName;function Ft(e,t,n){for(let r of e.relationships.get(t)??[]){if(r.id!==n)continue;if(r.targetMode==="External")return null;let o=q$1(t,r.rawTarget);return o.ok?o.partName:null}return null}function Lt(e,t,n={}){if(!t)return [];let r=n.maxFontBytes??16*1024*1024,o=n.maxFonts??64,s=[],i=new Map,a=d=>{if(!(s.length>=o)){if(Ye(d)==="font"){let l=ke(d,"name");if(l&&l.length<=128)for(let c of Je(d)){if(s.length>=o)return;let p=At.get(Ye(c));if(!p)continue;let u=ke(c,"id"),m=ke(c,"fontKey");if(!u||!m)continue;let f=Ft(e,t.name,u);if(!f)continue;let y=e.partBytes.get(f);if(!y||y.length===0||y.length>r)continue;let I=i.get(f);if(I){s.push({family:l,style:p,bytes:I,partName:f});continue}let O=qe(y,m);O&&(i.set(f,O),s.push({family:l,style:p,bytes:O,partName:f}));}}for(let l of Je(d))a(l);}};return a(t.root),s}function Qe(e){if(e.kind!=="textValue")for(let t of e.children){if(t.kind==="textValue")continue;if(t.kind==="hyperlink"){let r=Ra(t);if(r!==void 0&&r.length>0)return r}let n=Qe(t);if(n!==void 0)return n}}function Dt(e){let t="",n=false,r=o=>{if(!(n||o.kind==="textValue")){if(o.kind==="tab"||o.localName==="ptab"||o.localName==="tab"){n=true;return}if(o.kind==="text"||o.localName==="t"){for(let s of o.children)s.kind==="textValue"&&(t+=s.value);return}for(let s of o.children)r(s);}};return r(e),zc(t)}function Mt(e,t,n,r){let o=n.filter(d=>{if(r.has(d.blockId))return false;let l=d.level+1;return l>=t.instruction.outlineStart&&l<=t.instruction.outlineEnd}),s=new Set(o.map(d=>d.blockId)),i=uc(e),a=new Map;for(let d of o){let l=zc(d.text),c=a.get(l);c?c.push(d.blockId):a.set(l,[d.blockId]);}return t.resultParagraphIds.map(d=>{let l=Ea(e,d);if(!l||l.kind==="textValue")return null;let c=Qe(l),p=c===void 0?void 0:i.get(c);if(p&&s.has(p.paragraphId)){let f=a.get(zc(o.find(I=>I.blockId===p.paragraphId)?.text??"")),y=f?.indexOf(p.paragraphId)??-1;return f&&y>=0&&f.splice(y,1),p.paragraphId}let u=Dt(l);if(u.length===0)return null;let m=a.get(u);return !m||m.length===0?null:m.shift()??null})}function R(e){return e.namespaceUri===la?e.localName:`{${e.namespaceUri}}${e.localName}`}function v(e){let t=[];for(let n of e.attributes)t.push(n.namespaceUri===""||n.namespaceUri===la?`${n.localName}=${n.value}`:`{${n.namespaceUri}}${n.localName}=${n.value}`);return t.sort(),t}function et(e,t){let n=v(e),r=n.length>0?`${R(e)}(${n.join(",")})`:R(e);if(t>=ba)return r;let o=[];for(let s of e.children){if(s.kind==="textValue"){s.value!==""&&o.push(`#${s.value}`);continue}o.push(et(s,t+1));}return o.sort(),o.length>0?`${r}[${o.join(",")}]`:r}function Ze(e){if(!e)return [];let t=[];for(let n of e.children)n.namespaceUri===la&&t.push(et(n,1));return t.sort(),t}function Se(e){if(e.kind==="textValue")return e.value;if(e.kind==="tab")return " ";if(e.kind==="hardBreak")return Xb(e);if(e.kind==="drawing")return ic();if(e.kind==="runProperties"||e.kind==="paragraphProperties"||e.kind==="generic")return "";if(e.kind==="hyperlink"||Ib(e)){let n="",r=e.kind==="hyperlink"?e.children:Kb(e)??[];for(let o of r)n+=Se(o);return n}let t="";for(let n of e.children)t+=Se(n);return t}function h(e,t){let n=new Map(e);for(let r of t.namespaceBindings)n.set(r.prefix,r.namespaceUri);return n}function H(e,t){try{return va(e,t)}catch(n){if(n instanceof pa&&n.reason==="undeclared-prefix")return `generic-refusal:undeclared-prefix:{${e.namespaceUri}}${e.localName}`;throw n}}function Te(e,t,n=ua){if(e.kind==="textValue")return;if(e.kind==="runProperties"||e.kind==="paragraphProperties"){let o=h(n,e),s=[];for(let i of e.children)i.namespaceUri!==la&&s.push(H(i,o));s.sort(),t.push(...s);return}if(e.kind==="generic"){t.push(H(e,n));return}if(Ib(e)){t.push(wa(e));return}if(e.kind==="bookmarkStart"||e.kind==="bookmarkEnd"){t.push(va(e,n));return}if(e.kind==="drawing"){t.push(tt(e));return}if(ka(e.kind))return;let r=h(n,e);for(let o of e.children)Te(o,t,r);}function Bt(e){return `hyperlink(${e.attributes.map(n=>`${n.namespaceUri}|${n.localName}=${n.value}`).sort().join(",")})`}function Ht(e){for(let t of e.children)if(t.kind==="pictureBlipFill")for(let n of t.children){if(n.kind!=="pictureBlip")continue;let r=n.attributes.find(s=>s.localName==="embed"&&s.namespaceUri===oa)?.value,o=n.attributes.find(s=>s.localName==="link"&&s.namespaceUri===oa)?.value;if(r!==void 0)return `embed=${r}`;if(o!==void 0)return `link=${o}`}}function Z(e,t,n){if(e.kind==="textValue")return `#${e.value}`;if(t>=ba)return R(e);let r=h(n,e);if(e.kind==="generic")return H(e,r);let o=v(e),s=o.length>0?`${R(e)}(${o.join(",")})`:R(e),i=[];for(let a of e.children)a.kind!=="textValue"&&i.push(Z(a,t+1,r));return i.sort(),i.length>0?`${s}[${i.join(",")}]`:s}function Ut(e,t,n){let r=h(n,e),o=[];for(let s of e.children)if(s.kind!=="textValue"){if(s.kind==="pictureBlipFill"){let i=s.children,a=i.find(l=>l.kind==="pictureBlip"),d=i.filter(l=>l.kind!=="pictureBlip").map(l=>Z(l,t+1,r));if(d.sort(),a&&a.kind==="pictureBlip"){let l=v(a),c=l.length>0?`pictureBlip(${l.join(",")})`:"pictureBlip";o.push(d.length>0?`${c}[${d.join(",")}]`:c);}else for(let l of i)o.push(Z(l,t+1,r));continue}o.push(Z(s,t+1,r));}return o.sort(),o}function we(e,t,n){if(e.kind==="textValue")return `#${e.value}`;if(t>=ba)return R(e);let r=h(n,e);if(e.kind==="drawingDocPr"){let a=v(e);return a.length>0?`docPr(${a.join(",")})`:"docPr"}if(e.kind==="picture"){let a=Ht(e),d=Ut(e,t+1,r),l=a===void 0?"picture":`picture(${a})`;return d.length>0?`${l}[${d.join(",")}]`:l}let o=v(e),s=o.length>0?`${R(e)}(${o.join(",")})`:R(e),i=[];for(let a of e.children){if(a.kind==="picture"){i.push(we(a,t+1,r));continue}if(a.kind==="generic"){i.push(H(a,r));continue}a.kind!=="textValue"&&i.push(we(a,t+1,r));}return i.length>0?`${s}[${i.join(",")}]`:s}function tt(e){let t=h(ua,e),n=e.children.find(a=>a.kind==="inlineDrawing"||a.kind==="anchoredDrawing");if(!n||n.kind==="textValue")return `drawing(${v(e).join(",")})`;let r=h(t,n),o=v(n),s=o.length>0?`${n.kind}(${o.join(",")})`:n.kind,i=[];for(let a of n.children){if(a.kind==="generic"){i.push(H(a,r));continue}a.kind!=="textValue"&&i.push(we(a,1,r));}return i.length>0?`drawing[${s};${i.join(";")}]`:`drawing[${s}]`}function Vt(e,t,n){let r=e.children.find(c=>c.kind==="paragraphProperties"),o=[],s="",i=[],a=h(ua,e),d=(c,p)=>{if(c.kind==="run"){let u=h(p,c),m=c.children.find(f=>f.kind==="runProperties");o.push(Ze(m)),s+=Se(c);for(let f of c.children)Te(f,i,u);return}if(c.kind==="drawing"){i.push(tt(c));return}if(c.kind==="hyperlink"){i.push(Bt(c));let u=h(p,c);for(let m of c.children)d(m,u);return}if(c.kind==="contentControl"){i.push(wa({...c,children:c.children.filter(m=>m.kind!=="contentControlContent")}));let u=h(p,c);for(let m of c.children){if(m.kind!=="contentControlContent")continue;let f=h(u,m);for(let y of m.children)d(y,f);}return}Te(c,i,p);};for(let c of e.children)d(c,a);let l=Gc(e);return {ordinal:t,path:n,paraId:l===null?null:l.toUpperCase(),text:s,paragraphProperties:Ze(r),runProperties:o,genericStructure:i}}function Kt(e){if(e.localName==="hdr"||e.localName==="ftr"||e.kind==="body")return e;for(let t of e.children)if(t.kind!=="textValue"&&(t.kind==="body"||t.localName==="hdr"||t.localName==="ftr"))return t;return e}function nt(e,t,n,r,o,s){if(s>ba)return;let i=0;for(let a of e.children){if(a.kind==="textValue"){a.value.trim()!==""&&o.push(`${t}/#text ${a.value}`);continue}let d=t===""?String(i):`${t}/${i}`;if(i+=1,a.kind==="paragraph"){n.push(a),r.push(d),o.push(`${d} p`);continue}let l=v(a);o.push(l.length>0?`${d} ${R(a)}(${l.join(",")})`:`${d} ${R(a)}`),nt(a,d,n,r,o,s+1);}}function rt(e){let t=Kt(e.root),n=[],r=[],o=[];nt(t,"",n,r,o,0);let s=n.map((i,a)=>Vt(i,a,r[a]));return {partName:e.name,paragraphs:s,structure:o}}function jt(e){let t=[];for(let n of e){let r=rt(n);r&&t.push(r);}return {stories:t}}function Gt(e,t){let n=[],r=(s,i,a)=>{n.push({path:s,before:JSON.stringify(i)??"undefined",after:JSON.stringify(a)??"undefined"});};e.stories.length!==t.stories.length&&r("stories.length",e.stories.length,t.stories.length);let o=Math.min(e.stories.length,t.stories.length);for(let s=0;s<o;s+=1){let i=e.stories[s],a=t.stories[s],d=p=>`${i.partName}${p}`;i.paragraphs.length!==a.paragraphs.length&&r(d(".paragraphs.length"),i.paragraphs.length,a.paragraphs.length);let l=Math.min(i.paragraphs.length,a.paragraphs.length);for(let p=0;p<l;p+=1){let u=i.paragraphs[p],m=a.paragraphs[p];u.text!==m.text&&r(d(`.p[${p}].text`),u.text,m.text),u.path!==m.path&&r(d(`.p[${p}].path`),u.path,m.path),u.paraId!==m.paraId&&r(d(`.p[${p}].paraId`),u.paraId,m.paraId),JSON.stringify(u.paragraphProperties)!==JSON.stringify(m.paragraphProperties)&&r(d(`.p[${p}].paragraphProperties`),u.paragraphProperties,m.paragraphProperties),JSON.stringify(u.runProperties)!==JSON.stringify(m.runProperties)&&r(d(`.p[${p}].runProperties`),u.runProperties,m.runProperties),JSON.stringify(u.genericStructure)!==JSON.stringify(m.genericStructure)&&r(d(`.p[${p}].genericStructure`),u.genericStructure,m.genericStructure);}i.structure.length!==a.structure.length&&r(d(".structure.length"),i.structure.length,a.structure.length);let c=Math.min(i.structure.length,a.structure.length);for(let p=0;p<c;p+=1)i.structure[p]!==a.structure[p]&&r(d(`.structure[${p}]`),i.structure[p],a.structure[p]);}return n}var U="http://schemas.openxmlformats.org/wordprocessingml/2006/main",Wt="http://schemas.openxmlformats.org/package/2006/relationships",ot="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",w="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml",Jt="application/vnd.openxmlformats-package.relationships+xml",Yt="http://schemas.openxmlformats.org/package/2006/content-types",it="/[Content_Types].xml",C="/word/numbering.xml",at=[{text:"\uF0B7",font:"Symbol"},{text:"o",font:"Courier New"},{text:"\uF0A7",font:"Wingdings"}],st=["decimal","lowerLetter","lowerRoman"],$e=9;function ut(e,t){let n=720*(t+1),r='<w:start w:val="1"/>';if(e==="bullet"){let i=at[t%at.length];return `<w:lvl w:ilvl="${t}">${r}<w:numFmt w:val="bullet"/><w:lvlText w:val="${i.text}"/><w:lvlJc w:val="left"/><w:pPr><w:ind w:left="${n}" w:hanging="360"/></w:pPr><w:rPr><w:rFonts w:ascii="${i.font}" w:hAnsi="${i.font}" w:hint="default"/></w:rPr></w:lvl>`}let o=st[t%st.length],s=o==="lowerRoman";return `<w:lvl w:ilvl="${t}">${r}<w:numFmt w:val="${o}"/><w:lvlText w:val="%${t+1}."/><w:lvlJc w:val="${s?"right":"left"}"/><w:pPr><w:ind w:left="${n}" w:hanging="${s?180:360}"/></w:pPr></w:lvl>`}function qt(e,t){let n=Array.from({length:$e},(r,o)=>ut(e,o)).join("");return `<w:abstractNum w:abstractNumId="${t}"><w:multiLevelType w:val="${e==="bullet"?"hybridMultilevel":"multilevel"}"/>${n}</w:abstractNum>`}function Qt(){let e=Aa(`<w:numbering xmlns:w="${U}"></w:numbering>`,{name:C,contentType:w});return e.ok?e.part:null}var b=(e,t)=>{let n=[];for(let r of e.children)r.kind==="textValue"||r.localName!==t||r.namespaceUri===U&&n.push(r);return n},x=(e,t)=>e.attributes.find(n=>n.localName===t)?.value;function mt(e,t){let n=Aa(`<w:numbering xmlns:w="${U}">${e}</w:numbering>`,{name:C,contentType:w});if(!n.ok)return null;let r=[];for(let o of n.part.root.children)o.kind!=="textValue"&&r.push(o);if(r.length!==t.length)return null;for(let o=0;o<t.length;o+=1){let s=r[o],i=t[o];if(s.namespaceUri!==U||s.localName!==i.localName||i.attribute&&x(s,i.attribute.localName)!==i.attribute.value)return null}return r}var lt=["numPicBullet","abstractNum","num","numIdMacAtCleanup"];function ct(e,t,n){let r=t.indexOf(n);if(r===-1)return e.length;let o=0;return e.forEach((s,i)=>{if(s.kind==="textValue")return;let a=t.indexOf(s.localName);a!==-1&&a<=r&&(o=i+1);}),o}function dt(e,t){let n=0;for(let r of e){let o=x(r,t);!o||!/^\d{1,9}$/.test(o)||(n=Math.max(n,Number(o)));}return n+1}function Zt(e,t){let n=e.parts.get(C),r=n??Qt();if(!r)return null;let o=r.root,s=b(o,"abstractNum"),i=b(o,"num"),a=t==="bullet"?"bullet":"decimal";for(let O of i){let $=x(O,"numId"),Fe=b(O,"abstractNumId")[0],Le=Fe?x(Fe,"val"):void 0;if(!$||!Le)continue;let De=s.find(V=>x(V,"abstractNumId")===Le);if(!De)continue;let Me=b(De,"lvl").find(V=>x(V,"ilvl")==="0"||x(V,"ilvl")===void 0),Be=Me?b(Me,"numFmt")[0]:void 0;if(Be&&x(Be,"val")===a)return {pkg:e,numId:$}}let d=dt(s,"abstractNumId"),l=dt(i,"numId"),c=mt(qt(t,d)+`<w:num w:numId="${l}"><w:abstractNumId w:val="${d}"/></w:num>`,[{localName:"abstractNum",attribute:{localName:"abstractNumId",value:String(d)}},{localName:"num",attribute:{localName:"numId",value:String(l)}}]);if(!c)return null;let p=Ca(r),[u,m]=c.map(O=>ee(O,p));if(!u||!m)return null;let f=Ha(r,o.id,ct(o.children,lt,"abstractNum"),[u]);if(!f.ok)return null;let y=Ha(f.part,o.id,ct(f.part.root.children,lt,"num"),[m]);if(!y.ok)return null;let I=Object.freeze({...e,parts:new Map([...e.parts,[C,y.part]])});if(!n){let O=rn(I);if(!O)return null;let $=ln(O);if(!$)return null;I=$;}return {pkg:I,numId:String(l)}}var en=["nsid","multiLevelType","tmpl","name","styleLink","numStyleLink","lvl"];function ft(e){let t=x(e,"ilvl");return t===void 0||!/^\d{1,9}$/.test(t)?null:Number(t)}function tn(e,t){let n=0;return e.forEach((r,o)=>{if(r.kind!=="textValue"){if(r.localName==="lvl"&&r.namespaceUri===U){(ft(r)??0)<t&&(n=o+1);return}en.includes(r.localName)&&(n=o+1);}}),n}function nn(e,t,n,r){if(!Number.isInteger(n)||n<0||n>=$e||t.length===0||t.length>64)return null;let o=e.parts.get(C);if(!o)return null;let s=o.root,i=b(s,"num").find(f=>x(f,"numId")===t),a=i?b(i,"abstractNumId")[0]:void 0,d=a?x(a,"val"):void 0;if(!d)return null;let l=b(s,"abstractNum").find(f=>x(f,"abstractNumId")===d);if(!l||b(l,"numStyleLink").length>0)return null;let c=b(l,"lvl");if(c.some(f=>ft(f)===n))return e;if(c.length>=$e)return null;let p=mt(ut(r,n),[{localName:"lvl",attribute:{localName:"ilvl",value:String(n)}}]);if(!p)return null;let u=Ca(o),m=Ha(o,l.id,tn(l.children,n),[ee(p[0],u)]);return m.ok?Object.freeze({...e,parts:new Map([...e.parts,[C,m.part]])}):null}function ee(e,t){return e.kind==="textValue"?{...e,id:t()}:{...e,id:t(),children:e.children.map(n=>ee(n,t))}}function rn(e){let t=e.mainDocumentPart,n=on(t),r=e.parts.get(n),o=an(e),s=Aa(`<Relationships xmlns="${Wt}"><Relationship Id="${o}" Type="${ot}" Target="numbering.xml"/></Relationships>`,{name:n,contentType:Jt});if(!s.ok)return null;let i=e.relationships.get(t)??[],a={ownerPart:t,id:o,type:ot,rawTarget:"numbering.xml",targetMode:"Internal",order:i.reduce((u,m)=>Math.max(u,m.order),-1)+1},d=new Map([...e.relationships,[t,[...i,a]]]);if(!r)return Object.freeze({...e,parts:new Map([...e.parts,[n,s.part]]),relationships:d});let l=Ca(r),c=s.part.root.children[0];if(!c)return null;let p=Ha(r,r.root.id,r.root.children.length,[ee(c,l)]);return p.ok?Object.freeze({...e,parts:new Map([...e.parts,[n,p.part]]),relationships:d}):null}function on(e){let t=e.lastIndexOf("/");return `${e.slice(0,t)}/_rels/${e.slice(t+1)}.rels`}function an(e){let t=0;for(let n of e.relationships.values())for(let r of n){let o=/^rId(\d{1,9})$/.exec(r.id);o&&(t=Math.max(t,Number(o[1])));}for(let n of e.externalTargets){let r=/^rId(\d{1,9})$/.exec(n.id);r&&(t=Math.max(t,Number(r[1])));}return `rId${t+1}`}var sn=`<Override PartName="${C}" ContentType="${w}"/>`;function ln(e){let t=e.contentTypes.overrides.get(o(C));if(t===w)return e;if(t!==void 0)return null;let n=e.partBytes.get(it);if(!n)return null;let r=strFromU8(n),o$1=pt(r);if(!o$1)return null;let s=r.lastIndexOf(`</${o$1.rootName}>`);if(s===-1)return null;let i=r.slice(0,s)+sn+r.slice(s),a=pt(i);if(!a||a.rootName!==o$1.rootName)return null;let d=[...o$1.children,yt("Override",{PartName:C,ContentType:w})];return a.children.length!==d.length||a.children.some((l,c)=>l!==d[c])?null:Object.freeze({...e,partBytes:new Map([...e.partBytes,[it,strToU8(i)]]),contentTypes:Object.freeze({defaults:e.contentTypes.defaults,overrides:new Map([...e.contentTypes.overrides,[o(C),w]])})})}function pt(e){let t=ca(e);if(!t.ok)return null;let n=t.nodes.filter(a=>a.type==="element");if(n.length!==1)return null;let r=n[0],o=r.name.indexOf(":"),s=o===-1?"":r.name.slice(0,o);if(r.name.slice(o+1)!=="Types"||r.attributes[s?`xmlns:${s}`:"xmlns"]!==Yt)return null;let i=[];for(let a of r.children)a.type==="element"&&i.push(yt(a.name,a.attributes));return {rootName:r.name,children:i}}function yt(e,t){let n=Object.entries(t).map(([r,o])=>`${r}=${o}`).sort();return [e,...n].join("")}var gt=Object.freeze({trackRevisions:false,restrictedToTrackedChanges:false,doNotTrackMoves:false,doNotTrackFormatting:false});function cn(e){return e!=null&&e.kind!=="textValue"}function ht(e,t){for(let n of e.children)if(n.kind!=="textValue"&&n.namespaceUri===la&&n.localName===t)return n;return null}function _e(e,t){for(let n of e.attributes)if(n.namespaceUri===la&&n.localName===t)return n.value}function Ae(e,t){let n=ht(e,t);if(!n)return false;let r=_e(n,"val");return r===void 0?true:r!=="0"&&r!=="false"&&r!=="off"}function dn(e){if(!cn(e))return gt;let t=ht(e,"documentProtection"),n=t===null?void 0:_e(t,"enforcement"),r=n!==void 0&&n!=="0"&&n!=="false"&&n!=="off";return {trackRevisions:Ae(e,"trackRevisions"),restrictedToTrackedChanges:r&&t!==null&&_e(t,"edit")==="trackedChanges",doNotTrackMoves:Ae(e,"doNotTrackMoves"),doNotTrackFormatting:Ae(e,"doNotTrackFormatting")}}
2
+ export{Ie as A,ve as B,Pe as C,$t as D,We as E,qe as F,Lt as G,Mt as H,rt as I,jt as J,Gt as K,Zt as L,nn as M,gt as N,dn as O,xt as a,Ve as b,W as c,P as d,J as e,Y as f,g,bt as h,k as i,D as j,q as k,M as l,Q as m,xe as n,Oe as o,Ne as p,vt as q,Pt as r,be as s,je as t,kt as u,Re as v,St as w,B as x,Ce as y,Ee as z};
@@ -0,0 +1,5 @@
1
+ 'use strict';var chunkZT55Q52J_cjs=require('./chunk-ZT55Q52J.cjs'),chunkMYH2HCUJ_cjs=require('./chunk-MYH2HCUJ.cjs'),chunkZMIX42J7_cjs=require('./chunk-ZMIX42J7.cjs'),prosemirrorModel=require('prosemirror-model'),prosemirrorState=require('prosemirror-state'),prosemirrorView=require('prosemirror-view'),prosemirrorKeymap=require('prosemirror-keymap'),prosemirrorCommands=require('prosemirror-commands');function L(t){return t.attributes?.val}function A(t){let e=L(t);return e===void 0||!(e==="0"||e==="false"||e==="off")}var on=/^[0-9A-Fa-f]{6}$/,pe=/^\d{1,6}$/,an=/^-?\d{1,6}$/;function De(t){return t===void 0||t==="auto"?null:on.test(t)?`#${t}`:null}var ln={single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"},sn={black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"};function un(t){return !t||!/^[\w \-.+]{1,64}$/.test(t)?null:`"${t}"`}function _(t,e=false){return t===void 0||!(e?an:pe).test(t)?null:`${Number(t)/20}pt`}function Tt(t){let e=[],n=[],o=null,l=null;for(let a of t)switch(a.localName){case "b":e.push(`font-weight:${A(a)?"bold":"normal"}`);break;case "i":e.push(`font-style:${A(a)?"italic":"normal"}`);break;case "u":{let r=L(a)??"single";if(r==="none"||!A(a))break;n.push("underline"),o=ln[r]??"solid",l=De(a.attributes?.color);break}case "strike":A(a)&&n.push("line-through");break;case "dstrike":A(a)&&n.push("line-through");break;case "caps":A(a)&&e.push("text-transform:uppercase");break;case "smallCaps":A(a)&&e.push("font-variant:small-caps");break;case "vertAlign":{let r=L(a);r==="superscript"?e.push("vertical-align:super","font-size:0.75em"):r==="subscript"&&e.push("vertical-align:sub","font-size:0.75em");break}case "color":{let r=De(L(a));r&&e.push(`color:${r}`);break}case "highlight":{let r=sn[L(a)??""];r&&e.push(`background-color:${r}`);break}case "sz":{let r=L(a);r!==void 0&&pe.test(r)&&e.push(`font-size:${Number(r)/2}pt`);break}case "rFonts":{let r=un(a.attributes?.ascii??a.attributes?.hAnsi);r&&e.push(`font-family:${r}`);break}case "spacing":{let r=_(L(a),true);r&&e.push(`letter-spacing:${r}`);break}}return n.length>0&&(e.push(`text-decoration-line:${[...new Set(n)].join(" ")}`),o&&e.push(`text-decoration-style:${o}`),l&&e.push(`text-decoration-color:${l}`)),e.join(";")}var dn={left:"left",start:"left",right:"right",end:"right",center:"center",both:"justify",distribute:"justify"};function It(t){let e=[];for(let n of t)switch(n.localName){case "jc":{let o=dn[L(n)??""];o&&e.push(`text-align:${o}`);break}case "ind":{let o=_(n.attributes?.left??n.attributes?.start,true),l=_(n.attributes?.right??n.attributes?.end,true),a=_(n.attributes?.firstLine),r=_(n.attributes?.hanging);o&&e.push(`margin-left:${o}`),l&&e.push(`margin-right:${l}`),a?e.push(`text-indent:${a}`):r&&e.push(`text-indent:-${r}`);break}case "spacing":{let o=_(n.attributes?.before),l=_(n.attributes?.after);o&&e.push(`margin-top:${o}`),l&&e.push(`margin-bottom:${l}`);let a=n.attributes?.line,r=n.attributes?.lineRule;a!==void 0&&pe.test(a)&&r!=="exact"&&r!=="atLeast"?e.push(`line-height:${(Number(a)/240).toFixed(3)}`):a!==void 0&&pe.test(a)&&e.push(`line-height:${Number(a)/20}pt`);break}case "shd":{let o=De(n.attributes?.fill);o&&e.push(`background-color:${o}`);break}case "pageBreakBefore":A(n)&&e.push("break-before:page");break;}return e.join(";")}var N=new prosemirrorModel.Schema({nodes:{doc:{content:"paragraph+"},paragraph:{content:"inline*",group:"block",attrs:{nodeId:{default:null},props:{default:[]}},toDOM:t=>{let e=It(t.attrs.props??[]);return ["p",{"data-node-id":String(t.attrs.nodeId??""),...e?{style:e}:{}},0]},parseDOM:[{tag:"p",getAttrs:t=>typeof t=="string"?null:{nodeId:t.getAttribute("data-node-id")||null,props:[]}}]},text:{group:"inline"},tab:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"tab",class:"docx-tab"},"\u2192"],parseDOM:[{tag:'span[data-token="tab"]'}]},hardBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["br"],parseDOM:[{tag:"br"}]},pageBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"page-break",class:"docx-page-break"}],parseDOM:[{tag:'span[data-token="page-break"]'}]},unknownInline:{inline:true,group:"inline",atom:true,selectable:false,draggable:false,attrs:{nodeId:{default:null},label:{default:""}},toDOM:t=>["span",{"data-token":"unknown","data-node-id":String(t.attrs.nodeId??""),contenteditable:"false",class:"docx-unknown-inline",title:String(t.attrs.label||"Content this editor cannot edit yet. It is preserved.")}],parseDOM:[{tag:'span[data-token="unknown"]',getAttrs:t=>typeof t=="string"?false:{nodeId:t.getAttribute("data-node-id")||null,label:""}}]}},marks:{runProps:{attrs:{props:{default:[]}},excludes:"runProps",toDOM:t=>{let e=t.attrs.props??[],n=Tt(e);return ["span",{"data-run-props":pn(e),...n?{style:n}:{}},0]},parseDOM:[{tag:"span[data-run-props]",getAttrs:t=>{if(typeof t=="string")return false;let e=fn(t.getAttribute("data-run-props"));return e?{props:e}:false}}]}}});function pn(t){return JSON.stringify(Array.isArray(t)?t:[])}function fn(t){if(!t)return null;try{let e=JSON.parse(t);if(!Array.isArray(e))return null;let n=[];for(let o of e){if(typeof o!="object"||o===null)return null;let l=o;if(typeof l.localName!="string"||l.attributes!==void 0&&(typeof l.attributes!="object"||l.attributes===null))return null;n.push(l.attributes===void 0?{localName:l.localName}:{localName:l.localName,attributes:l.attributes});}return n}catch{return null}}function Ce(t){for(let e of t.marks)if(e.type.name==="runProps")return e.attrs.props??[];return []}function fe(t,e){return JSON.stringify(me(t))===JSON.stringify(me(e))}function me(t){return [...t].map(e=>({localName:e.localName,attributes:Object.fromEntries(Object.entries(e.attributes??{}).sort(([n],[o])=>n<o?-1:1))})).sort((e,n)=>e.localName<n.localName?-1:1)}function Me(t){if(!t||t.kind==="textValue")return [];let e=[];for(let n of t.children){if(n.kind==="textValue")continue;let o={};for(let l of n.attributes)o[l.localName]=l.value;e.push(Object.keys(o).length>0?{localName:n.localName,attributes:o}:{localName:n.localName});}return e}function Nt(t){return t.kind==="textValue"?"":`${{drawing:"Picture",pict:"Picture",object:"Embedded object",fldSimple:"Field",hyperlink:"Hyperlink",sdt:"Content control",tbl:"Table"}[t.localName]??t.localName} \u2014 preserved, not editable yet`}function $(t){if(t.kind==="textValue")return [];let e=[],n=o=>{if(o.kind!=="run")return;let l=o.children.find(r=>r.kind==="runProperties"),a=Me(l);for(let r of o.children)if(r.kind!=="runProperties"){if(r.kind==="tab"){e.push({kind:"tab"});continue}if(r.kind==="hardBreak"){e.push(chunkZMIX42J7_cjs.Wb(r)?{kind:"pageBreak"}:{kind:"hardBreak"});continue}if(r.kind==="text"){let c="";for(let d of r.children)d.kind==="textValue"&&(c+=d.value);c.length>0&&e.push({kind:"text",text:c,props:a});continue}e.push({kind:"unknown",nodeId:r.id,label:Nt(r)});}};return chunkZMIX42J7_cjs.Pb(t.children,0,o=>{if(o.kind==="run"){n(o);return}e.push({kind:"unknown",nodeId:o.id,label:Nt(o)});}),e}function C(t){let e=[],n=o=>{if(o.kind!=="textValue"){if(o.kind==="body"){for(let l of o.children)l.kind==="paragraph"&&e.push(l);return}for(let l of o.children)n(l);}};return n(t.root),e}function j(t){let e=[];for(let n of chunkZMIX42J7_cjs.ve(t))n.root.kind!=="textValue"&&chunkZMIX42J7_cjs.ye(n.root.children,e,0);return e}function B(t){let e=C(t).map(n=>{let o=n.kind==="textValue"?void 0:n.children.find(a=>a.kind==="paragraphProperties"),l=$(n).map(a=>{switch(a.kind){case "text":return N.text(a.text,a.props.length>0?[N.marks.runProps.create({props:a.props})]:[]);case "tab":return N.node("tab");case "hardBreak":return N.node("hardBreak");case "pageBreak":return N.node("pageBreak");default:return N.node("unknownInline",{nodeId:a.nodeId,label:a.label})}});return N.node("paragraph",{nodeId:n.id,props:Me(o)},l)});return N.node("doc",null,e.length>0?e:[N.node("paragraph")])}function X(t){let e=[];return t.forEach(n=>{if(n.isText&&n.text){e.push({kind:"text",text:n.text,props:Ce(n)});return}n.type.name==="tab"?e.push({kind:"tab"}):n.type.name==="hardBreak"?e.push({kind:"hardBreak"}):n.type.name==="pageBreak"?e.push({kind:"pageBreak"}):n.type.name==="unknownInline"&&e.push({kind:"unknown",nodeId:String(n.attrs.nodeId??""),label:String(n.attrs.label??"")});}),e}function D(t){let e="";for(let n of t)n.kind==="text"?e+=n.text:n.kind==="tab"?e+=" ":n.kind==="hardBreak"?e+=`
2
+ `:n.kind==="pageBreak"&&(e+=chunkZMIX42J7_cjs.Ub);return e}function Et(t){let e=[],n=0;for(let o of t)o.kind==="text"?n+=o.text.length:o.kind==="tab"||o.kind==="hardBreak"||o.kind==="pageBreak"?n+=1:e.push(`${o.nodeId}@${n}`);return e}function mn(t,e){if(t===e)return null;let n=0,o=Math.min(t.length,e.length);for(;n<o&&t[n]===e[n];)n+=1;let l=t.length,a=e.length;for(;l>n&&a>n&&t[l-1]===e[a-1];)l-=1,a-=1;return {start:n,endBefore:l,endAfter:a}}function Dt(t){let e=[];for(let n of t)if(n.kind==="text")for(let o=0;o<n.text.length;o+=1)e.push(n.props);else (n.kind==="tab"||n.kind==="hardBreak"||n.kind==="pageBreak")&&e.push(e[e.length-1]??[]);return e}function gn(t,e,n,o,l){let a=[],r=Et(e),c=Et(n);if(JSON.stringify(r)!==JSON.stringify(c))return {ok:false,reason:"unknown-content-moved",detail:t};fe(o,l)||a.push({op:"setParagraphProperties",paragraphId:t,properties:me(l)});let d=D(e),m=D(n),h=mn(d,m);if(h&&(h.endBefore>h.start&&a.push({op:"deleteText",paragraphId:t,start:h.start,end:h.endBefore}),h.endAfter>h.start)){let b=m.slice(h.start,h.endAfter),y=h.start,s="",g=()=>{s.length!==0&&(a.push({op:"insertText",paragraphId:t,offset:y,text:s}),y+=s.length,s="");};for(let k of b)k===" "?(g(),a.push({op:"insertTab",paragraphId:t,offset:y}),y+=1):k===`
3
+ `?(g(),a.push({op:"insertHardBreak",paragraphId:t,offset:y}),y+=1):k===chunkZMIX42J7_cjs.Ub?(g(),a.push({op:"insertPageBreak",paragraphId:t,offset:y}),y+=1):s+=k;g();}if(!h){let b=Dt(e),y=Dt(n),s=0;for(;s<y.length;){if(fe(b[s]??[],y[s])){s+=1;continue}let g=s,k=y[s];for(;s<y.length&&fe(y[s],k)&&!fe(b[s]??[],y[s]);)s+=1;a.push({op:"setRunProperties",paragraphId:t,start:g,end:s,properties:me(k)});}}return {ok:true,ops:a}}function Fe(t,e){let n=C(t),o=[];if(e.forEach(a=>{a.type.name==="paragraph"&&o.push(a);}),o.length!==e.childCount)return {ok:false,reason:"unsupported-node"};let l=o.length-n.length;if(l===0){let a=[];for(let[r,c]of o.entries()){let d=n[r];if(c.attrs.nodeId!==d.id)return {ok:false,reason:"paragraph-reordered",detail:String(c.attrs.nodeId)};let m=gn(d.id,$(d),X(c),Me(d.kind==="textValue"?void 0:d.children.find(h=>h.kind==="paragraphProperties")),c.attrs.props??[]);if(!m.ok)return m;a.push(...m.ops);}return {ok:true,ops:a}}return l===1?yn(n,o):l===-1?hn(n,o):{ok:false,reason:"paragraph-count-unexplained",detail:String(l)}}function yn(t,e){for(let n=0;n<t.length;n+=1){let o=t[n],l=e[n],a=e[n+1];if(!l||!a||l.attrs.nodeId!==o.id)continue;let r=a.attrs.nodeId;if(r!==null&&r!==o.id)continue;let c=D(X(l));if(c+D(X(a))===D($(o))&&Ct(t,e,n)&&Mt(t,e,n+1,n+2))return {ok:true,ops:[{op:"splitParagraph",paragraphId:o.id,offset:c.length}]}}return {ok:false,reason:"split-not-clean"}}function hn(t,e){for(let n=0;n+1<t.length;n+=1){let o=t[n],l=t[n+1],a=e[n];if(!a||a.attrs.nodeId!==o.id)continue;let r=D($(o))+D($(l));if(D(X(a))===r&&Ct(t,e,n)&&Mt(t,e,n+2,n+1))return {ok:true,ops:[{op:"joinParagraphs",firstId:o.id,secondId:l.id}]}}return {ok:false,reason:"join-not-clean"}}function Ct(t,e,n){for(let o=0;o<n;o+=1){let l=e[o],a=t[o];if(!l||l.attrs.nodeId!==a.id||D(X(l))!==D($(a)))return false}return true}function Mt(t,e,n,o){for(let l=0;n+l<t.length;l+=1){let a=t[n+l],r=e[o+l];if(!r||r.attrs.nodeId!==a.id||D(X(r))!==D($(a)))return false}return true}function kn(t,e){return chunkZMIX42J7_cjs.Ea(t,e)!==null}function we(t,e,n){if(!n||n.created.length>0||n.deleted.length>0||n.splitJoin.length>0)return B(e);let o=new Map;t.forEach(d=>{let m=d.attrs.nodeId;typeof m=="string"&&o.set(m,d);});let l=new Set(n.dirty),a=C(e);if(a.length!==t.childCount)return B(e);let r=B(e),c=[];for(let[d,m]of a.entries()){let h=o.get(m.id);c.push(h&&!l.has(m.id)?h:r.child(d));}return N.node("doc",null,c)}var wt=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,xn=["ascii","hAnsi","cs","eastAsia"],bn=["asciiTheme","hAnsiTheme","cstheme","eastAsiaTheme"];var On=/[\u0000-\u001F\u007F-\u009F]/;function ge(t){return t.kind!=="textValue"}function z(t,e){return t.attributes.find(n=>n.localName===e)?.value}function At(t,e){let n=new Map,o=r=>{if(!r||!wt.test(r))return;let c=r.toLowerCase();n.has(c)||n.set(c,r);},l=[...t].reverse();for(;l.length>0;){let r=l.pop();if(ge(r)){if(r.localName==="rFonts"){for(let c of xn)o(z(r,c));if(e)for(let c of bn){let d=z(r,c);d!==void 0&&(d.startsWith("major")?o(e.major):d.startsWith("minor")&&o(e.minor));}}for(let c=r.children.length-1;c>=0;c-=1)l.push(r.children[c]);}}let a=[...n.values()];return a.sort((r,c)=>r<c?-1:r>c?1:0),a}var Sn=new Set(["paragraph","character","table","numbering"]),Pn=/^[0-9A-Fa-f]{6}$/,vn=16,Ft=new Map([["normal",0],["title",1],["subtitle",2],["heading 1",11],["heading 2",12],["heading 3",13],["heading 4",14],["heading 5",15],["heading 6",16],["heading 7",17],["heading 8",18],["heading 9",19]]);function Lt(t){return t.children}function Ae(t,e){for(let n of Lt(t))if(ge(n)&&n.localName===e)return n}function Rn(t){return Ft.get(t.name.toLowerCase())??Ft.get(t.styleId.toLowerCase())??Number.MAX_SAFE_INTEGER}function Le(t){return t===void 0||t.length===0||t.length>128||On.test(t)?null:t}function jt(t,e){if(!t)return [];let n=new Map;for(let a of t.children){if(!ge(a)||a.localName!=="style")continue;let r=Le(z(a,"styleId"));r!==null&&!n.has(r)&&n.set(r,a);}let o=a=>{let r=false,c=false,d=null,m=false,h=false,b=new Set,y=a;for(let k=0;k<vn&&y!==null&&!b.has(y);k+=1){b.add(y);let R=n.get(y);if(!R)break;let S=Ae(R,"rPr");for(let v of S?Lt(S):[]){if(!ge(v))continue;let T=z(v,"val"),M=T!=="0"&&T!=="false"&&T!=="off";v.localName==="b"&&!m?(r=M,m=true):v.localName==="i"&&!h?(c=M,h=true):v.localName==="color"&&d===null&&T&&Pn.test(T)&&(d=T);}let P=Ae(R,"basedOn");y=P?Le(z(P,"val")):null;}let s=e?.(a),g=s?.fontFamily??null;return {fontFamily:g!==null&&wt.test(g)?g:null,fontSizePt:s?.fontSizeHalfPoints!=null&&s.fontSizeHalfPoints>0?s.fontSizeHalfPoints/2:null,bold:r,italic:c,color:d}},l=[];for(let[a,r]of n){let c=z(r,"type");if(c===void 0||!Sn.has(c))continue;let d=Ae(r,"name"),m=Le(d?z(d,"val"):void 0);l.push({styleId:a,name:m??a,type:c,preview:o(a)});}return l.map((a,r)=>({entry:a,index:r,rank:Rn(a)})).sort((a,r)=>a.rank-r.rank||a.index-r.index).map(a=>a.entry)}var Tn=128,In=/[\u0000-\u001F\u007F-\u009F]/,Nn=/[\u0000-\u001F\u007F-\u009F]/g,En=200,Dn=/^heading ([1-9])$/i;function je(t){return t.kind!=="textValue"}function te(t,e){for(let n of t.children)if(je(n)&&n.localName===e)return n}function ee(t,e){return t.attributes.find(n=>n.localName===e)?.value}function Cn(t){let e=new Map;if(!t)return e;for(let n of t.children){if(!je(n)||n.localName!=="style"||ee(n,"type")!=="paragraph")continue;let o=ee(n,"styleId");if(o===void 0||o.length===0||o.length>Tn||In.test(o))continue;let l=te(n,"name"),a=l?ee(l,"val"):void 0,r=a!==void 0?Dn.exec(a):null;if(r){e.set(o,Number(r[1])-1);continue}let c=te(n,"pPr"),d=c?te(c,"outlineLvl"):void 0,m=d?ee(d,"val"):void 0;m!==void 0&&/^[0-8]$/.test(m)&&e.set(o,Number(m));}return e}function He(t){let e=te(t,"pPr"),n=e?te(e,"pStyle"):void 0;return n?ee(n,"val"):void 0}function Ht(t,e){let n=Cn(e);if(n.size===0)return [];let o=[];for(let l of C(t)){if(!je(l))continue;let a=He(l);if(a===void 0)continue;let r=n.get(a);if(r===void 0)continue;let d=(chunkZMIX42J7_cjs.$e(t,l.id)??"").replace(Nn," ").trim().slice(0,En);d.length!==0&&o.push({text:d,level:r,blockId:l.id});}return o}var ye=48,Mn=/[\u0000-\u001F\u007F-\u009F]/g;function _t(t){return t.kind!=="textValue"}function he(t){if(t.kind==="textValue")return t.value.length;if(t.kind==="tab"||t.kind==="hardBreak")return 1;if(t.kind==="runProperties"||t.kind==="generic")return 0;if(t.kind==="hyperlink"||chunkZMIX42J7_cjs.Ib(t)){let n=0,o=t.kind==="hyperlink"?t.children:chunkZMIX42J7_cjs.Kb(t)??[];for(let l of o)n+=he(l);return n}let e=0;for(let n of t.children)e+=he(n);return e}function Fn(t){let e=[],n=0;return _t(t)&&chunkZMIX42J7_cjs.Pb(t.children,0,o=>{if(o.kind==="run"){e.push(n),n+=he(o);return}n+=he(o);}),e}function wn(t,e){if(t.length===0)return {index:0,offset:e};for(let n=t.length-1;n>=0;n-=1){let o=t[n];if(e>=o)return {index:n,offset:e-o}}return {index:0,offset:e}}function _e(t,e){return t.replace(Mn," ").slice(0,e)}function Bt(t,e,n={}){let o={matches:[],truncated:false};if(!chunkZMIX42J7_cjs.Lf(e))return o;let l=n.limit!==void 0&&Number.isInteger(n.limit)&&n.limit>0?Math.min(n.limit,2e3):2e3,a={...n.matchCase===void 0?{}:{matchCase:n.matchCase},...n.wholeWord===void 0?{}:{wholeWord:n.wholeWord}},r=[],c=0;for(let d of C(t)){if(!_t(d))continue;let m=c;c+=1;let h=chunkZMIX42J7_cjs.$e(t,d.id)??"";if(h.length===0)continue;let b=chunkZMIX42J7_cjs.Mf(h,e,l-r.length,a),y=null;for(let s of b.matches){let g=s.start+s.length;y??=Fn(d);let k=wn(y,s.start);r.push({blockId:d.id,start:s.start,length:s.length,paragraphIndex:m,runIndex:k.index,runOffset:k.offset,text:_e(h.slice(s.start,g),256),contextBefore:_e(h.slice(Math.max(0,s.start-ye),s.start),ye),contextAfter:_e(h.slice(g,g+ye),ye)});}if(b.truncated)return {matches:r,truncated:true}}return {matches:r,truncated:false}}var An=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6"],Ln=/^[0-9A-Fa-f]{6}$/,$t={windowText:"000000",window:"FFFFFF"};function Ut(t){return t.kind!=="textValue"}function ke(t,e){return t.attributes.find(n=>n.localName===e)?.value}function Yt(t,e){let n=[t];for(;n.length>0;){let o=n.pop();if(Ut(o)){if(o.localName===e)return o;for(let l=o.children.length-1;l>=0;l-=1)n.push(o.children[l]);}}return null}function xe(t,e){for(let n of t.children)if(Ut(n)&&(e===void 0||n.localName===e))return n;return null}function jn(t){let e=xe(t);if(!e)return null;let n;if(e.localName==="srgbClr")n=ke(e,"val");else if(e.localName==="sysClr"){let o=ke(e,"val")??"";n=ke(e,"lastClr")??(Object.prototype.hasOwnProperty.call($t,o)?$t[o]:void 0);}return n===void 0||!Ln.test(n)?null:n.toUpperCase()}var Hn=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function zt(t,e){let n=xe(t,e),o=n?xe(n,"latin"):null,l=o?ke(o,"typeface"):void 0;return l!==void 0&&Hn.test(l)?l:null}function ne(t){if(!t)return {major:null,minor:null};let e=Yt(t,"fontScheme");return e?{major:zt(e,"majorFont"),minor:zt(e,"minorFont")}:{major:null,minor:null}}function Gt(t){if(!t)return [];let e=Yt(t,"clrScheme");if(!e)return [];let n=[];for(let o of An){let l=xe(e,o),a=l?jn(l):null;if(a===null)return [];n.push({slot:o,hex:a});}return n}var _n=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;var Bn=/[\u0000-\u001F\u007F-\u009F]/;function Jt(t){return t.kind!=="textValue"}function U(t,e){for(let n of t.children)if(Jt(n)&&n.localName===e)return n}function Y(t,e){return t.attributes.find(n=>n.localName===e)?.value}function Wt(t){return t===void 0||t.length===0||t.length>128||Bn.test(t)?null:t}function be(t,e){return t==="minorAscii"||t==="minorHAnsi"?e.minor:t==="majorAscii"||t==="majorHAnsi"?e.major:null}function $n(t,e){let n=be(Y(t,"asciiTheme"),e)??be(Y(t,"hAnsiTheme"),e);if(n!==null)return n;let o=Y(t,"ascii")??Y(t,"hAnsi");return o===void 0?null:_n.test(o)?o:null}function Xt(t,e){if(!t)return {fontFamily:null,fontSizeHalfPoints:null};let n=U(t,"rFonts"),o=U(t,"sz"),l=o?Y(o,"val"):void 0,a=l!==void 0&&/^\d{1,4}$/.test(l)?Number(l):null;return {fontFamily:n?$n(n,e):null,fontSizeHalfPoints:a!==null&&a>=2&&a<=3276?a:null}}function Be(t,e){let n=new Map,o={fontFamily:null,fontSizeHalfPoints:null};if(t){let r=U(t,"docDefaults"),c=r?U(r,"rPrDefault"):void 0;o=Xt(c?U(c,"rPr"):void 0,e);for(let d of t.children){if(!Jt(d)||d.localName!=="style")continue;let m=Wt(Y(d,"styleId"));if(m===null||n.has(m))continue;let h=U(d,"basedOn");n.set(m,{basedOn:Wt(h?Y(h,"val"):void 0),own:Xt(U(d,"rPr"),e)});}}let l=new Map,a=r=>{let c=r??"",d=l.get(c);if(d)return d;let m=null,h=null,b=new Set,y=r;for(let g=0;y!==null&&g<16&&!b.has(y);g+=1){b.add(y);let k=n.get(y);if(!k)break;m??=k.own.fontFamily,h??=k.own.fontSizeHalfPoints,y=k.basedOn;}let s={fontFamily:m??o.fontFamily,fontSizeHalfPoints:h??o.fontSizeHalfPoints};return l.set(c,s),s};return (r,c)=>{let d=a(r),m=c?.find(b=>b.localName==="rFonts"),h=m?be(m.attributes?.asciiTheme,e)??be(m.attributes?.hAnsiTheme,e):null;return h===null?d:{...d,fontFamily:h}}}function Kt(t){let e=new Map,n=new Map,o=new Map;return j(t).forEach((l,a)=>{o.set(l.id,a);let r=chunkZMIX42J7_cjs.Gc(l);if(r===null||!chunkZMIX42J7_cjs.Fc(r))return;e.set(l.id,r);let c=r.toUpperCase();n.has(c)||n.set(c,l.id);}),Object.freeze({paraIdByNode:e,nodeByParaId:n,ordinalByNode:o})}var zn=Object.freeze([]);function Un(t,e={}){let n=chunkZMIX42J7_cjs.wb(t);if(!n.ok)return {ok:false,reason:n.reason,...n.detail?{detail:n.detail}:{}};let o=n.package,l=o.parts.get(o.mainDocumentPart);if(!l)return {ok:false,reason:"no-main-document-tree",detail:o.mainDocumentPart};let a=chunkZMIX42J7_cjs.Mc(l),r=new chunkZMIX42J7_cjs.ef(o,a),c=null,d=null,m=null,h=null;r.subscribe(i=>{h=i;});let b=()=>r.bodyStore(),y=()=>r.currentPackage(),s=Object.freeze({kind:"body"}),g=()=>{if(!c||c.packageRevision!==r.packageRevision){let i=chunkZMIX42J7_cjs.Rb(y());c={packageRevision:r.packageRevision,resolution:i,parts:chunkZMIX42J7_cjs.Sb(y())};}return c},k="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",R="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",S=false,P=null,v=()=>{if(S)return P;S=true;let i=y(),u=(i.relationships.get(i.mainDocumentPart)??[]).find(p=>p.type===k),f;if(u){let p=chunkZMIX42J7_cjs.N(u);p.mode==="Internal"&&p.target.ok&&(f=i.parts.get(p.target.partName));}return f??=i.parts.get("/word/styles.xml"),P=f?.root??null,P},T=false,M=null,Oe=()=>{if(T)return M;T=true;let i=y(),u=(i.relationships.get(i.mainDocumentPart)??[]).find(p=>p.type===R),f;if(u){let p=chunkZMIX42J7_cjs.N(u);p.mode==="Internal"&&p.target.ok&&(f=i.parts.get(p.target.partName));}return f??=i.parts.get("/word/numbering.xml"),M=f?.root??null,M},re="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",G=-1,J=null,$e=()=>{if(G===r.packageRevision)return J;G=r.packageRevision;let i=y(),u=(i.relationships.get(i.mainDocumentPart)??[]).find(p=>p.type===re),f;if(u){let p=chunkZMIX42J7_cjs.N(u);p.mode==="Internal"&&p.target.ok&&(f=i.parts.get(p.target.partName));}return f??=i.parts.get("/word/settings.xml"),J=f?.root??null,J},en="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",ze=false,Se=null,K=()=>{if(ze)return Se;ze=true;let i=y(),u=(i.relationships.get(i.mainDocumentPart)??[]).find(p=>p.type===en),f;if(u){let p=chunkZMIX42J7_cjs.N(u);p.mode==="Internal"&&p.target.ok&&(f=i.parts.get(p.target.partName));}return f??=i.parts.get("/word/theme/theme1.xml"),Se=f?.root??null,Se},tn="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",oe=null,nn=()=>{if(oe)return oe;let i=y(),u=(i.relationships.get(i.mainDocumentPart)??[]).find(p=>p.type===tn),f;if(u){let p=chunkZMIX42J7_cjs.N(u);p.mode==="Internal"&&p.target.ok&&(f=i.parts.get(p.target.partName));}return f??=i.parts.get("/word/fontTable.xml"),oe=Object.freeze(chunkMYH2HCUJ_cjs.G(i,f)),oe},Z=null,Ue=null,Ye=null,Ge=null,ae=null,le=null,Q=null,q=null,ie=null,se=null,Pe=()=>{let i=b();return (!ie||ie.revision!==i.revision)&&(ie={revision:i.revision,index:Kt(i.part)}),ie.index};return {ok:true,session:{editable:j(b().part).length>0,paragraphIds:()=>j(b().part).map(i=>i.id),paragraphIdsIn(i=s){let u=r.partFor(i);return u?j(u).map(f=>f.id):[]},part:()=>b().part,partFor:i=>r.partFor(i),currentPackage:y,applyTreeOps(i,u,f,p=s){if(i.length===0)return {committed:false,rejected:false,opCount:0};let x=i.filter(I=>chunkZMIX42J7_cjs.Qc(I)||chunkZMIX42J7_cjs.Wd(I)).length;if(x>0){if(x!==i.length||i.length!==1)return {committed:false,rejected:true,opCount:i.length,reason:"invalidArgs"};let I=r.applyLifecycleOp(i[0]);return I.ok?{committed:true,rejected:false,opCount:1}:{committed:false,rejected:true,opCount:1,reason:I.detail??I.reason}}let O=r.transact(p,I=>{u!==void 0&&I.selectionBefore(u),f!==void 0&&I.selectionAfter(f);for(let F of i)I.apply(F);});return O.ok?{committed:true,rejected:false,opCount:i.length}:{committed:false,rejected:true,opCount:i.length,reason:O.reason}},projectDoc:()=>B(b().part),reconcile:i=>we(i,b().part,h),lastCommitWasStructural:()=>h!==null&&(h.created.length>0||h.deleted.length>0||h.splitJoin.length>0||h.impact==="global"),applyPmDoc(i){let u=b(),f=Fe(u.part,i);if(!f.ok)return {committed:false,rejected:true,opCount:0,reason:f.reason};if(f.ops.length===0)return {committed:false,rejected:false,opCount:0};let p=r.transact(s,x=>{for(let O of f.ops)x.apply(O);});return p.ok?{committed:true,rejected:false,opCount:f.ops.length}:{committed:false,rejected:true,opCount:f.ops.length,reason:p.reason}},bodyText:()=>Yn(b().part),storyText(i){let u=r.partFor(i);return u?j(u).map(f=>chunkZMIX42J7_cjs.$e(u,f.id)??"").join(`
4
+ `):null},revision:()=>b().revision,revisionFor:i=>r.revisionFor(i),packageRevision:()=>r.packageRevision,canUndo:()=>r.canUndo,canRedo:()=>r.canRedo,undo:()=>{let i=r.selectionForUndo();return r.undo()===null?null:i},redo:()=>{let i=r.selectionForRedo();return r.redo()===null?null:i},beginComposition:(i=s)=>{r.beginComposition(i);},endComposition:()=>r.endComposition(),subscribe(i){return r.subscribe(i)},save(){return chunkZMIX42J7_cjs.xb(y())},headerFooterParts:()=>{let i=g().parts;return i[i.length-1]??chunkZMIX42J7_cjs.Tb(y())},headerFooterPartsBySection:()=>g().parts,headerFooterResolutionBySection:()=>g().resolution,documentFonts(){if(Z&&Z.revision===r.packageRevision)return Z.fonts;let i=g().parts,u=[b().part.root],f=v();f&&u.push(f);let p=new Set;for(let x of i){for(let O of x.headers.values())p.has(O)||(p.add(O),u.push(O.root));for(let O of x.footers.values())p.has(O)||(p.add(O),u.push(O.root));}return Z={revision:r.packageRevision,fonts:At(u,ne(K()))},Z.fonts},documentStyles(){ae??=Be(v(),ne(K()));let i=ae;return Ue??=jt(v(),u=>i(u)),Ue},stylesRoot:()=>v(),documentThemeFonts(){return Ge??=ne(K()),Ge},numberingRoot:()=>Oe(),settingsRoot:()=>$e(),trackingSettings:()=>chunkMYH2HCUJ_cjs.O($e()),documentThemeColors(){return Ye??=Gt(K()),Ye},effectiveRunDefaults(i,u){ae??=Be(v(),ne(K()));let f=b();if(!le||le.revision!==f.revision){let p=new Map;for(let x of j(f.part))x.kind!=="textValue"&&p.set(x.id,He(x)??null);le={revision:f.revision,byId:p};}return ae(le.byId.get(i)??null,u)},documentOutline(){let i=b();return Q&&Q.revision===i.revision||(Q={revision:i.revision,outline:Ht(i.part,v())}),Q.outline},findText(i,u){let f=b(),p=`${u?.matchCase===true?"c":""}${u?.wholeWord===true?"w":""}${u?.limit??""}\0${i}`;if(q&&q.revision===f.revision&&q.key===p)return q.result;let x=Bt(f.part,i,u??{});return q={revision:f.revision,key:p,result:x},x},embeddedFonts:nn,paragraphAnchors:Pe,paraIdOf:i=>Pe().paraIdByNode.get(i)??null,nodeIdOf:i=>Pe().nodeByParaId.get(i.toUpperCase())??null,relationshipTarget:(i,u=s)=>{let f=y(),p=r.partFor(u);return p?chunkZMIX42J7_cjs.Pc(f,p.name,i):null},bookmarks:()=>{let i=b();return (!se||se.revision!==i.revision)&&(se={revision:i.revision,index:chunkZMIX42J7_cjs.uc(i.part)}),se.index},ensureHyperlinkRelationship(i,u=s){let f=r.partFor(u);if(!f)return null;let p=y(),x=chunkZMIX42J7_cjs.Oc(p,i,f.name);return x?(x.pkg!==p&&r.replacePackageShell(x.pkg),x.relationshipId):null},reviewItems(){let i=e.reviewModel;if(!i)return zn;let u=b(),f=`${r.packageRevision}:${u.revision}`;if(d&&d.revisionKey===f)return d.items;let p=y(),x=p.parts.get(chunkZMIX42J7_cjs.if(p,u.part.name)),O=p.parts.get(chunkZMIX42J7_cjs.jf(p,u.part.name)),I=[],F=new Set;for(let V of g().parts)for(let rn of [V.headers,V.footers])for(let ve of rn.values())F.has(ve)||(F.add(ve),I.push(ve));let E=d&&h?Zn(h,d,d.items,u.part,x,O,r.packageRevision):null,w,ue;if(E&&d){let V=i.revisionItemsOfParagraph(u.part,E);Wn(d.items,V,E)?(w=Xn(d.items,d.paragraphOrder,E,V),ue=d.paragraphOrder):(ue=chunkZT55Q52J_cjs.e(u.part),w=i.collectReviewItems({storyPart:u.part,furnitureParts:I,commentsPart:x,commentsExtendedPart:O}));}else ue=chunkZT55Q52J_cjs.e(u.part),w=i.collectReviewItems({storyPart:u.part,furnitureParts:I,commentsPart:x,commentsExtendedPart:O});return d={revisionKey:f,bodyRevision:u.revision,packageRevision:r.packageRevision,items:w,paragraphOrder:ue,commentsPart:x,commentsExtendedPart:O},d.items},hasReviewContent(){let i=b();return (!m||m.revision!==i.revision)&&(m={revision:i.revision,present:chunkZMIX42J7_cjs.Ge(i.part).length>0||qt(i.part.root)}),m.present},replyToComment(i,u,f,p,x){let O=b(),I=r.currentPackage(),F=O.checkpoint();O.graftPackage(()=>r.currentPackage());let E=chunkZMIX42J7_cjs.ff(O,{anchor:{paragraphId:u.paragraphId,start:u.start,end:u.end,...u.endParagraphId===void 0?{}:{endParagraphId:u.endParagraphId}},author:p,text:f,...x===void 0?{}:{date:x},...i===null?{}:{replyToCommentId:i}});return E.ok?(O.restoreHistoryStacks(F),r.replacePackageShell(O.package),r.adoptPackageUnit(I),r.publishStoryWrite(E.change),E.commentId):null},setCommentResolved(i,u){let f=b(),p=r.currentPackage(),x=f.checkpoint();f.graftPackage(()=>r.currentPackage());let O=chunkZMIX42J7_cjs.gf(f,i,u);return O.ok?(f.restoreHistoryStacks(x),r.replacePackageShell(f.package),r.adoptPackageUnit(p),r.publishStoryWrite(O.change),true):false},deleteComment(i){let u=b(),f=r.currentPackage(),p=u.checkpoint();u.graftPackage(()=>r.currentPackage());let x=false,O=false,I=u.transact(F=>{F.applyPackage(E=>{let w=chunkZMIX42J7_cjs.De(E,i);return w===null?(x=true,E):(O=w!==E,w)});});return x||!I.ok||!O?false:(u.restoreHistoryStacks(p),r.installPackageSnapshot(u.package),r.adoptPackageUnit(f),r.publishStoryWrite(I.change),true)},ensureListDefinition(i){let u=chunkMYH2HCUJ_cjs.L(y(),i);return u?(r.replacePackageShell(u.pkg),T=false,M=null,u.numId):null},ensureNumberingLevel(i,u,f){let p=y(),x=chunkMYH2HCUJ_cjs.M(p,i,u,f);return x?(x!==p&&(r.replacePackageShell(x),T=false,M=null),true):false},insertImage(i,u){return r.insertImage(i,u)},replaceImage(i,u,f,p,x,O){return r.replaceImage(i,u,f,p,x,O)},deleteImage(i,u){return r.deleteImage(i,u)},applyImageProperties(i,u){return r.applyImageProperties(i,u)}}}}function Yn(t){return C(t).map(e=>chunkZMIX42J7_cjs.$e(t,e.id)??"").join(`
5
+ `)}function Gn(t,e){let n=t.kind==="revision"?t.ranges[0]??null:t.range;if(!n)return null;let o=e.get(n.start.paragraphId);return o===void 0?null:o}function Wn(t,e,n){for(let l of e)if(l.ranges.length===0)return false;let o=new Set;for(let l of t)l.kind!=="revision"||l.ranges.length>0||Qt(l,n)||o.add(chunkZT55Q52J_cjs.b(l));for(let l of e)if(o.has(chunkZT55Q52J_cjs.b(l)))return false;return true}function Xn(t,e,n,o){let l=e.get(n);if(l===void 0)return [...t];let a=[],r=null;for(let c of t){if(c.kind==="revision"&&Qt(c,n)){r===null&&(r=a.length);continue}if(r===null){let d=Gn(c,e);d!==null&&d>l&&(r=a.length);}a.push(c);}if(r===null&&(r=a.length),o.length>0){let c=o.length<2?[...o]:[...o].sort((d,m)=>chunkZT55Q52J_cjs.h(d,e)-chunkZT55Q52J_cjs.h(m,e));a.splice(r,0,...c);}return chunkZMIX42J7_cjs.Df(a)}function Qt(t,e){return t.ranges.length>0&&t.ranges.every(n=>n.start.paragraphId===e&&n.end.paragraphId===e)}function Jn(t,e){return t.range?t.range.start.paragraphId===e||t.range.end.paragraphId===e:false}function Kn(t,e){return t.ranges.length===0||!t.ranges.some(o=>o.start.paragraphId===e||o.end.paragraphId===e)?false:!t.ranges.every(o=>o.start.paragraphId===e&&o.end.paragraphId===e)}function Zn(t,e,n,o,l,a,r){if(t.fromRevision!==e.bodyRevision||r!==e.packageRevision+1||t.story!==void 0&&t.story.kind!=="body"||t.impact!=="text-local"||t.dirty.length!==1||t.created.length>0||t.deleted.length>0||t.splitJoin.length>0||e.commentsPart!==l||e.commentsExtendedPart!==a)return null;let c=t.dirty[0],d=chunkZMIX42J7_cjs.Ea(o,c);if(!d||d.kind!=="paragraph")return null;for(let m of n){if(m.kind==="comment"){if(Jn(m,c))return null;continue}if(m.kind==="custom"){if(m.range?.start.paragraphId===c)return null;continue}if(Kn(m,c))return null}return c}var Zt=new WeakMap;function qt(t,e=0){if(e>64)return false;let n=Zt.get(t);if(n!==void 0)return n;let o=false;for(let l of t.children)if(l.kind!=="textValue"&&(l.kind==="commentRangeStart"||l.kind==="commentReference"||qt(l,e+1))){o=true;break}return Zt.set(t,o),o}var Qn=chunkZMIX42J7_cjs.s.projection;function sr(t,e,n){let o=t.filter(l=>l.localName!==e);return o.length!==t.length?o:[...o,n?{localName:e,attributes:n}:{localName:e}]}function ur(t,e,n={}){let o=null,l=false,a=()=>n.onChange?.(r()),r=()=>({revision:e.revision(),canUndo:e.canUndo(),canRedo:e.canRedo(),lastRejection:o}),c=s=>{l=true;let g=m.state.tr.replaceWith(0,m.state.doc.content.size,s.content);g.setMeta("addToHistory",false),m.dispatch(g),l=false;},d=s=>()=>(s()&&(c(e.projectDoc()),a()),true),m=new prosemirrorView.EditorView(t,{state:prosemirrorState.EditorState.create({doc:e.projectDoc(),plugins:[prosemirrorKeymap.keymap({...prosemirrorCommands.baseKeymap,Home:prosemirrorCommands.selectTextblockStart,End:prosemirrorCommands.selectTextblockEnd,"Mod-z":d(()=>e.undo()!==null),"Mod-y":d(()=>e.redo()!==null),"Shift-Mod-z":d(()=>e.redo()!==null),"Mod-b":(s,g)=>y(s,g,"b"),"Mod-i":(s,g)=>y(s,g,"i"),"Mod-u":(s,g)=>y(s,g,"u",{val:"single"})})]}),editable:()=>e.editable,handleDOMEvents:{keydown:s=>(h(s),false),beforeinput:(s,g)=>{let k=g;if(s.composing)return false;h(s);let R=k.inputType;if(R==="insertText"&&k.data!=null){k.preventDefault();let{from:S,to:P}=s.state.selection;return s.dispatch(s.state.tr.insertText(k.data,S,P)),true}if(R==="deleteContentBackward"){k.preventDefault();let{from:S,empty:P}=s.state.selection;return P?S>0?s.dispatch(s.state.tr.delete(S-1,S)):prosemirrorCommands.joinBackward(s.state,s.dispatch):prosemirrorCommands.deleteSelection(s.state,s.dispatch),true}if(R==="deleteContentForward"){k.preventDefault();let{from:S,to:P,empty:v}=s.state.selection;return v?P<s.state.doc.content.size?s.dispatch(s.state.tr.delete(S,S+1)):prosemirrorCommands.joinForward(s.state,s.dispatch):prosemirrorCommands.deleteSelection(s.state,s.dispatch),true}return R==="insertParagraph"?(k.preventDefault(),prosemirrorCommands.splitBlock(s.state,s.dispatch),true):false},compositionstart:()=>(e.beginComposition(),false),compositionend:()=>(e.endComposition(),a(),false)},dispatchTransaction(s){let g=m.state.apply(s);if(l||!s.docChanged){m.updateState(g);return}let k=e.applyPmDoc(g.doc);if(k.rejected){o=String(k.reason??"rejected"),m.updateState(g),c(e.projectDoc()),a();return}o=null,m.updateState(k.committed&&e.lastCommitWasStructural()?b(g):g),a();}});function h(s){if(s.composing||l)return;let g=s.dom.ownerDocument.getSelection(),k=g?.anchorNode,R=g?.focusNode;if(!(!g||!k||!R)&&!(!s.dom.contains(k)||!s.dom.contains(R)))try{let S=s.posAtDOM(k,g.anchorOffset),P=s.posAtDOM(R,g.focusOffset),v=s.state.selection;if(v.anchor===S&&v.head===P)return;let T=prosemirrorState.TextSelection.create(s.state.doc,S,P);s.dispatch(s.state.tr.setSelection(T).setMeta("addToHistory",!1));}catch{}}function b(s){let g=e.paragraphIds(),k=s.tr,R=false,S=0;return s.doc.forEach((P,v)=>{let T=g[S];S+=1,!(P.type.name!=="paragraph"||T===void 0)&&P.attrs.nodeId!==T&&(k=k.setNodeMarkup(v,void 0,{...P.attrs,nodeId:T}),R=true);}),R?s.apply(k.setMeta("addToHistory",false)):s}function y(s,g,k,R){let S=N.marks.runProps;if(!g)return true;let{from:P,to:v,empty:T}=s.selection;if(T)return true;let Oe=s.doc.resolve(P).marks().find(J=>J.type===S)?.attrs.props??[],re=sr(Oe,k,R),G=s.tr;return G.removeMark(P,v,S),re.length>0&&G.addMark(P,v,S.create({props:re})),g(G),true}return {view:m,state:r,undo:()=>d(()=>e.undo()!==null)(),redo:()=>d(()=>e.redo()!==null)(),toggleRunProperty(s,g){y(m.state,m.dispatch.bind(m),s,g);},destroy:()=>m.destroy()}}exports.a=N;exports.b=Ce;exports.c=C;exports.d=j;exports.e=B;exports.f=Fe;exports.g=kn;exports.h=we;exports.i=He;exports.j=Un;exports.k=Qn;exports.l=ur;
@@ -0,0 +1 @@
1
+ 'use strict';var r=class extends Error{name="EditorFontError";code;request;diagnostic;constructor(t,n,e={}){super(n,{cause:e.cause}),this.code=t,this.request=e.request,this.diagnostic=e.diagnostic;}};exports.a=r;
@@ -0,0 +1 @@
1
+ var r=Object.freeze({review:null,customNodes:Object.freeze([])});function n(o){if(!o||o.length===0)return r;let t=null,i=[];for(let e of o)e.review&&t===null&&(t=e.review),e.customNodes&&i.push(...e.customNodes);return {review:t,customNodes:i}}export{n as a};