@docx-editor.dev/core 2.20.0 → 2.21.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 (112) hide show
  1. package/README.md +11 -32
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.ts +11 -10
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.ts +9 -9
  7. package/dist/binding.js +1 -1
  8. package/dist/chunk-44LQJIKH.cjs +20 -0
  9. package/dist/chunk-4EHMMSFR.cjs +1 -0
  10. package/dist/{chunk-D2V4YBWJ.cjs → chunk-AFG7Q622.cjs} +1 -1
  11. package/dist/chunk-AJCCS53D.js +1 -0
  12. package/dist/{chunk-3EZO3O6I.js → chunk-AYMSP25Q.js} +3 -3
  13. package/dist/{chunk-44SIVFJT.cjs → chunk-B4KZSKF7.cjs} +5 -5
  14. package/dist/chunk-BDAY2ETZ.js +1 -0
  15. package/dist/chunk-BNZF6DYC.cjs +18 -0
  16. package/dist/chunk-BQXF2PFF.js +2 -0
  17. package/dist/chunk-GIHKVXEO.js +2 -0
  18. package/dist/chunk-ITNK6C5M.cjs +3 -0
  19. package/dist/chunk-MP3K4LC5.js +1 -0
  20. package/dist/chunk-MXOO7KRI.cjs +11 -0
  21. package/dist/chunk-NG6IQ4SI.js +11 -0
  22. package/dist/{chunk-2HQXLL5L.cjs → chunk-PYXMAUNR.cjs} +1 -1
  23. package/dist/chunk-Q2B6HX3R.js +1 -0
  24. package/dist/chunk-Q5JPPUNR.js +5 -0
  25. package/dist/chunk-S35UK656.cjs +2 -0
  26. package/dist/chunk-S6J4O5XP.js +1 -0
  27. package/dist/{chunk-GSEUM6AI.cjs → chunk-TE43S3LX.cjs} +1 -1
  28. package/dist/chunk-TKQH7BNE.cjs +1 -0
  29. package/dist/chunk-UKVVUHZL.cjs +1 -0
  30. package/dist/chunk-VH2DLEZK.js +20 -0
  31. package/dist/{chunk-OHVJYJOA.js → chunk-VUNFWXHF.js} +1 -1
  32. package/dist/{chunk-OA6LFCTG.cjs → chunk-WQFNWLNY.cjs} +3 -3
  33. package/dist/chunk-WZX4UGRQ.js +3 -0
  34. package/dist/{chunk-CAIWEQLC.js → chunk-X5QNSISI.js} +1 -1
  35. package/dist/chunk-XS4FOHH6.js +18 -0
  36. package/dist/{chunk-PIBYJZIH.cjs → chunk-XZY4Q6PJ.cjs} +1 -1
  37. package/dist/{chunk-WTILOUPG.cjs → chunk-Z2ETEZRU.cjs} +1 -1
  38. package/dist/collaboration/replication.cjs +1 -1
  39. package/dist/collaboration/replication.d.ts +13 -4
  40. package/dist/collaboration/replication.js +1 -1
  41. package/dist/collaboration.d.ts +4 -3
  42. package/dist/contracts/document.d.ts +3 -2
  43. package/dist/contracts/editor.cjs +1 -1
  44. package/dist/contracts/editor.d.ts +9 -9
  45. package/dist/contracts/editor.js +1 -1
  46. package/dist/contracts/interaction.d.ts +2 -2
  47. package/dist/contracts/modules.cjs +1 -1
  48. package/dist/contracts/modules.d.ts +9 -7
  49. package/dist/contracts/modules.js +1 -1
  50. package/dist/contracts/types.d.ts +2 -1
  51. package/dist/{custom-node-writes-piokwVR5.d.ts → custom-node-writes-05qS32px.d.ts} +2 -2
  52. package/dist/{document-protection-C6RvCHx-.d.ts → document-protection-Cr59VKLO.d.ts} +1 -1
  53. package/dist/{editor-BgtcHulQ.d.ts → editor-BsLSz_7y.d.ts} +28 -29
  54. package/dist/editor-scope-OHPwVQ5l.d.ts +84 -0
  55. package/dist/editor.cjs +1 -1
  56. package/dist/editor.css +1 -1
  57. package/dist/editor.d.ts +130 -27
  58. package/dist/editor.js +1 -1
  59. package/dist/export.cjs +2 -2
  60. package/dist/export.d.ts +13 -13
  61. package/dist/export.js +1 -1
  62. package/dist/{font-resolver-Bv2Z25-J.d.ts → font-resolver-CzwdBJDE.d.ts} +1 -1
  63. package/dist/{headless-document-view-DHKMN_3Y.d.ts → headless-document-view-B7nAiR7P.d.ts} +2 -2
  64. package/dist/{image-resources-C51LuAAu.d.ts → image-resources-C4ilLzog.d.ts} +1 -1
  65. package/dist/{index-3lr8xXF8.d.ts → index-zkvqBQ9o.d.ts} +117 -26
  66. package/dist/index.cjs +1 -1
  67. package/dist/index.d.ts +18 -18
  68. package/dist/index.js +1 -1
  69. package/dist/{layout-shaping-CKBUSaS7.d.ts → layout-shaping-BJKVTI6i.d.ts} +1 -1
  70. package/dist/layout.cjs +1 -1
  71. package/dist/layout.d.ts +41 -18
  72. package/dist/layout.js +1 -1
  73. package/dist/{note-properties-CcXUgqr8.d.ts → note-properties-MNztEj5s.d.ts} +1 -1
  74. package/dist/{omml-equation-C5P6Ym3v.d.ts → omml-equation-CbnW9yXd.d.ts} +1 -1
  75. package/dist/output.cjs +1 -1
  76. package/dist/output.d.ts +8 -7
  77. package/dist/output.js +1 -1
  78. package/dist/{protocol-CsawNZkt.d.ts → protocol-Co_r0SZQ.d.ts} +2 -2
  79. package/dist/{review-paragraph-order-BCIqjopY.d.ts → review-paragraph-order-EFaU7TqH.d.ts} +1 -1
  80. package/dist/{revision-projection-BcRnC4Yj.d.ts → revision-projection-DEIvpxiq.d.ts} +16 -2
  81. package/dist/{semantic-cell-selection-R9wrenwR.d.ts → semantic-cell-selection-DXmfnDCw.d.ts} +9 -4
  82. package/dist/{semantic-interaction-B7beVwH7.d.ts → semantic-interaction-BLu3M6Nn.d.ts} +1 -1
  83. package/dist/{semantic-paint-CLvHwf8y.d.ts → semantic-paint-CPsihA6k.d.ts} +18 -2
  84. package/dist/{semantic-records-CbXwnS80.d.ts → semantic-records-CqD0b5Ex.d.ts} +146 -6
  85. package/dist/store.cjs +1 -1
  86. package/dist/store.d.ts +462 -427
  87. package/dist/store.js +1 -1
  88. package/dist/{note-lifecycle-D4AOFCAt.d.ts → tree-package-fragment-CwJDixNs.d.ts} +183 -143
  89. package/dist/{tree-session-contract-DTQxw2zL.d.ts → tree-session-contract-D9RRWE0C.d.ts} +8 -8
  90. package/dist/{types-barrel-CEOy-Jv0.d.ts → types-barrel-DLB11iSY.d.ts} +1470 -1426
  91. package/package.json +2 -2
  92. package/dist/chunk-2H4ABRMB.cjs +0 -20
  93. package/dist/chunk-6UCDHGXI.js +0 -1
  94. package/dist/chunk-7VMVDRRU.js +0 -2
  95. package/dist/chunk-CEXC2VHI.cjs +0 -1
  96. package/dist/chunk-CF3JR35B.js +0 -11
  97. package/dist/chunk-D5EHDHYV.js +0 -1
  98. package/dist/chunk-DGSJZMAE.cjs +0 -11
  99. package/dist/chunk-EHBPYFRE.js +0 -20
  100. package/dist/chunk-GOEBQ26R.js +0 -1
  101. package/dist/chunk-H6WDEAOJ.js +0 -18
  102. package/dist/chunk-I6LSEDUL.cjs +0 -18
  103. package/dist/chunk-IW35GWJN.js +0 -1
  104. package/dist/chunk-JRBGCIR2.js +0 -5
  105. package/dist/chunk-K5HIOS6J.cjs +0 -3
  106. package/dist/chunk-KLQXP27K.js +0 -3
  107. package/dist/chunk-MZFFU66H.cjs +0 -2
  108. package/dist/chunk-MZPNLIP3.js +0 -2
  109. package/dist/chunk-OHJQ7GPZ.cjs +0 -1
  110. package/dist/chunk-P4TGGDK3.js +0 -1
  111. package/dist/chunk-ZKWRCLT2.cjs +0 -1
  112. package/dist/editor-scope-DZJT4ukT.d.ts +0 -53
@@ -1 +1 @@
1
- 'use strict';var chunkOA6LFCTG_cjs=require('./chunk-OA6LFCTG.cjs'),chunkI6LSEDUL_cjs=require('./chunk-I6LSEDUL.cjs'),chunkWTILOUPG_cjs=require('./chunk-WTILOUPG.cjs'),chunkDGSJZMAE_cjs=require('./chunk-DGSJZMAE.cjs');var Te=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function D(e){let n=new Map;for(let t of e)if(Array.isArray(t)){for(let r of t.slice(0,2048)){if(typeof r!="string"||!Te.test(r))continue;let o=r.toLowerCase();if(n.has(o)||n.set(o,r),n.size===2048)break}if(n.size===2048)break}return Object.freeze([...n.values()])}function Ge(e){let n=e&&"failures"in e?e.failures:void 0;return e==null||(e.sources?.length??0)===0&&(e.substitutions?.length??0)===0&&(n===void 0||Array.isArray(n)&&n.length===0)?void 0:e}var We=64,we=Object.freeze({family:"Calibri",sizeHalfPoints:22});function Se(e,...n){let t=[e,...n],r=[],o=new Set;for(let a of t)for(let d of a.sources??[]){let c=chunkOA6LFCTG_cjs.g(d.request);o.has(c)||(o.add(c),r.push(d));}let s=[],i=new Set;for(let a of t)for(let d of a.substitutions??[]){let c=chunkOA6LFCTG_cjs.g(d.from);o.has(c)||i.has(c)||(i.add(c),s.push(d));}let u=D(t.map(a=>a.supportedFamilies));return Object.freeze({...u.length?{supportedFamilies:u}:{},epoch:e.epoch??0,maxFontBytes:e.maxFontBytes??chunkOA6LFCTG_cjs.a,sources:Object.freeze(r),...s.length>0?{substitutions:Object.freeze(s)}:{},defaultFont:e.defaultFont??we,...e.language!==void 0?{language:e.language}:{}})}var Ne=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function Ee(e){let n=e?.defaultFont?.family;return n!==void 0&&Ne.test(n)?n:we.family}var Ie="docx-editor.dev/font-resolver",Ce=Symbol.for("docx-editor.dev/font-resolver");function tn(e){let n={value:true,enumerable:false,configurable:true};try{Object.defineProperty(e,Ce,n),Object.defineProperty(e,Ie,n);}catch(t){throw new TypeError("defineFontResolver cannot mark a frozen or sealed function; mark it before freezing, or wrap it in a fresh function and mark that.",{cause:t})}return e}function on(e){return typeof e=="function"&&e[Ce]===true}var X=e=>`${e.family.trim().toLowerCase()} ${e.weight} ${e.style}`;function Me(e,n,t){let r=new Map(e.map(o=>[X(o),o]));for(let[o,s]of n)r.set(o,s);for(let o of t)r.has(X(o.to))&&r.set(X(o.from),o.from);return [...r.values()]}async function rn(e,n,t={}){return ve(e,n,t)}async function sn(e,n,t={}){return ve(e,n,t)}async function ve(e,n,t){let r=e.map(_e),o,s=[],i=[],u=new Map,a=new Set,d=0,c=[],f=new Set,m=[],S=n.resolvedFaces??[],E=n.defaultFamily;for(let b=0;b<e.length;b+=1){ke(n.signal);let k=e[b],I=Me(S,u,c),P;try{let x=r[b],O;if(x){let l=await Re(x,n.signal);if(!l.ok)throw l.cause;O=l.value;}else if(typeof k=="function"){let l=await Re(Promise.resolve(k(Le(n,E,I,d))).then(p=>({ok:!0,value:p}),p=>({ok:!1,cause:p})),n.signal);if(!l.ok)throw l.cause;O=l.value;}else O=k;if(O==null)continue;if(typeof O=="function"){Z(t,k,b,new TypeError("A font origin answered with a function; pass the resolver itself rather than a function returning one"));continue}let R="failures"in O?O.failures:void 0,M=[];if(Array.isArray(R)){let l=Math.min(R.length,chunkOA6LFCTG_cjs.b);for(let p=0;p<l;p++)M.push(R[p]);R.length>l&&M.push(new Error("Additional font-origin failures were omitted"));}else R!==void 0&&M.push(R);let C=Be(O,a,d,f,o?"maxFontBytes"in o&&o.maxFontBytes!==void 0?o.maxFontBytes:chunkOA6LFCTG_cjs.a:void 0,t.reserveOwnedBytes,t.instrumentation);P=C;for(let l of new Set([...C.dropped,...M]))Z(t,k,b,l);let w=C.fragment;w.supportedFamilies&&s.push(w.supportedFamilies),m.push(...M);let $=(w.sources??[]).map(l=>(chunkOA6LFCTG_cjs.g(l.request),[X(l.request),l.request])),y=[...w.substitutions??[]];!o&&"defaultFont"in w&&(E=Ee(w)),o||(o=w);let g=new Set(C.sourceKeys);if(g.size>0){c=c.filter(l=>!g.has(chunkOA6LFCTG_cjs.g(l.from)));for(let l of g)f.delete(l);}i.push(...w.sources??[]);for(let l of C.sourceKeys)a.add(l);d+=C.ownedBytes;for(let[l,p]of $)u.set(l,p);for(let l of y)c.push(l),f.add(chunkOA6LFCTG_cjs.g(l.from));}catch(x){if(P?.releaseOwnedBytes?.(),n.signal?.aborted)throw n.signal.reason??x;if(x instanceof V)throw x.cause;Z(t,k,b,x);continue}}if(!o)return;let{epoch:N,...j}=Se({...o,supportedFamilies:D(s),sources:i,substitutions:c});return m.length===0?j:{...j,failures:Object.freeze(m)}}var V=class extends Error{constructor(t){super("Unable to reserve owned font bytes");this.cause=t;this.name="FontOwnershipReservationError";}cause},Y=class extends RangeError{};async function Re(e,n){if(!n)return e;ke(n);let t,r=new Promise((s,i)=>{t=i;}),o=()=>t?.(n.reason);n.addEventListener("abort",o,{once:true});try{return await Promise.race([e,r])}finally{n.removeEventListener("abort",o);}}function _e(e){if(e===null||typeof e!="object")return;let n;try{n=e.then;}catch(t){return Promise.resolve({ok:false,cause:t})}if(typeof n=="function")return Promise.resolve(e).then(t=>({ok:true,value:t}),t=>({ok:false,cause:t}))}function Be(e,n,t,r,o,s,i){let u=e.sources??[],a=e.substitutions??[],d="maxFontBytes"in e?e.maxFontBytes:void 0,c="defaultFont"in e?e.defaultFont:void 0,f="epoch"in e?e.epoch:void 0,m="language"in e?e.language:void 0;if(!Array.isArray(u)||!Array.isArray(a))throw new TypeError("Font origin sources and substitutions must be arrays");let S=u.length,E=a.length;if(S>chunkOA6LFCTG_cjs.b)throw new RangeError(`Font source count must not exceed ${chunkOA6LFCTG_cjs.b}`);if(E>chunkOA6LFCTG_cjs.b)throw new RangeError(`Font substitution count must not exceed ${chunkOA6LFCTG_cjs.b}`);let N=d??chunkOA6LFCTG_cjs.a;if(!Number.isSafeInteger(N)||N<=0||N>chunkOA6LFCTG_cjs.a)throw new RangeError(`Font byte ceiling must be a positive safe integer no greater than ${chunkOA6LFCTG_cjs.a}`);let j=o??N,b=0,k=[],I=new Set,P=[],x=[];for(let y=0;y<S;y+=1){let g=u[y];try{let l=Q(g.request),p=g.availability,B=g.faceIndex,h=g.hash,A=g.id,L=chunkOA6LFCTG_cjs.g(l);if(p!==void 0&&p!=="available"&&p!=="forbidden")throw new TypeError("Font source availability must be available or forbidden");if(!Number.isSafeInteger(B)||B<0)throw new RangeError("Font face index must be a non-negative safe integer");if(typeof h!="string"||h.length===0)throw new TypeError("Font source hash must be a non-empty string");let K;if(p!=="forbidden"){if(typeof A!="string"||A.length===0)throw new TypeError("Font source id must be a non-empty string");K=g.bytes;let J=chunkOA6LFCTG_cjs.e(K);if(J>j)throw new RangeError("Font source exceeds the effective base byte ceiling");if(n.has(L)||I.has(L))continue;if(t+b+J>chunkOA6LFCTG_cjs.c)throw new RangeError(`Font sources exceed the aggregate byte ceiling of ${chunkOA6LFCTG_cjs.c}`);b+=J;}else K=new Uint8Array(0);if(n.has(L)||I.has(L))continue;if(n.size+I.size>=chunkOA6LFCTG_cjs.b)throw new Y(`Font source count must not exceed ${chunkOA6LFCTG_cjs.b}`);I.add(L),k.push(L),P.push(Object.freeze({request:l,id:A,bytes:K,hash:h,faceIndex:B,...p?{availability:p}:{}}));}catch(l){if(l instanceof Y)throw l;x.push(l);}}let O=new Set,R=[];for(let y=0;y<E;y+=1){let g=a[y];try{let l=Q(g.from),p=Q(g.to);chunkOA6LFCTG_cjs.g(l),chunkOA6LFCTG_cjs.g(p);let B=g.lineMetrics,h=B?Object.freeze({heightEm:B.heightEm,baselineEm:B.baselineEm}):void 0;if(h&&(!Number.isFinite(h.heightEm)||!Number.isFinite(h.baselineEm)||h.heightEm<=0||h.heightEm>4||h.baselineEm<0||h.baselineEm>h.heightEm))throw new RangeError("Font substitution line metrics must fit within a bounded em box");let A=chunkOA6LFCTG_cjs.g(l);if(n.has(A)||I.has(A)||r.has(A)||O.has(A))continue;O.add(A),R.push(Object.freeze({from:l,to:p,...h?{lineMetrics:h}:{}}));}catch(l){x.push(l);}}if((S>0||E>0)&&P.length===0&&R.length===0&&x.length>0)throw x[0];let M=r.size;for(let y of I)r.has(y)&&(M-=1);if(M+O.size>chunkOA6LFCTG_cjs.b)throw new RangeError(`Font substitution count must not exceed ${chunkOA6LFCTG_cjs.b}`);let C;if(c!==void 0){let y=c.family,g=c.sizeHalfPoints;if(chunkOA6LFCTG_cjs.g({family:y,weight:400,style:"normal"}),!Number.isSafeInteger(g)||g<=0)throw new RangeError("Default font size must be a positive safe integer in half-points");C=Object.freeze({family:y,sizeHalfPoints:g});}if(f!==void 0&&(!Number.isSafeInteger(f)||f<0))throw new RangeError("Font configuration epoch must be a non-negative safe integer");if(m!==void 0&&typeof m!="string")throw new TypeError("Font shaping language must be a string");let w;if(b>0&&s)try{w=s(b);}catch(y){throw new V(y)}let $;try{$=P.map(y=>chunkOA6LFCTG_cjs.f(y,i));}catch(y){throw w?.(),y}return {fragment:Object.freeze({supportedFamilies:D([e.supportedFamilies]),sources:Object.freeze($),substitutions:Object.freeze(R),...f!==void 0?{epoch:f}:{},...d!==void 0?{maxFontBytes:d}:{},...C?{defaultFont:C}:{},...m!==void 0?{language:m}:{}}),sourceKeys:Object.freeze(k),ownedBytes:b,dropped:Object.freeze(x),releaseOwnedBytes:w}}function Pe(e){return !Number.isSafeInteger(e)||e<=0?0:e>chunkOA6LFCTG_cjs.c?chunkOA6LFCTG_cjs.c:e}function Le(e,n,t,r){let{committedSourceBytes:o,...s}=e,i=Pe(r);return {...s,defaultFamily:n,...t.length>0?{resolvedFaces:t}:{},...i>0?{committedSourceBytes:i}:{}}}function Q(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function ke(e){if(e?.aborted)throw e.reason??new DOMException("Font resolution was aborted","AbortError")}function Z(e,n,t,r){let o;try{typeof n=="function"&&n.name.length>0&&(o=n.name);}catch{}let s=Object.freeze({originIndex:t,...o!==void 0?{originName:o}:{},cause:r});if(e.onOriginFailure)try{let u=e.onOriginFailure(s);Promise.resolve(u).catch(a=>{console.warn("[fonts] font-origin diagnostic callback failed",a);});return}catch(u){console.warn("[fonts] font-origin diagnostic callback failed",u);}let i="";try{r instanceof Error&&r.message.length>0&&(i=`: ${r.message}`);}catch{}console.warn(`[fonts] a font origin failed and was skipped${i}`,r);}function G(e){let n=new WeakMap;return (t,r)=>{let o=new Set;for(let s of t){let i=[{node:s,context:r,next:0}],u=a=>{i.pop();let d=i.at(-1)?.found??o;for(let c of a)d.add(c);};for(;i.length;){let a=i[i.length-1],d=n.get(a.node);if(d?.key===a.context.key){u(d.families);continue}if(!a.children){let m=e(a.node,a.context);a.children=m.children,a.found=new Set(m.families);}let c=a.children[a.next++];if(c){i.push({...c,next:0});continue}let f=[...a.found];f.length<=256?n.set(a.node,{key:a.context.key,families:f}):n.delete(a.node),u(f);}}return [...o]}}function W(e,n){return e.children.flatMap(t=>t.kind==="textValue"?[]:[{node:t,context:n}])}function qe(e,n){let{styles:t,theme:r,supplementalFamilies:o,depth:s}=n;if(e.kind==="table"){let a=chunkI6LSEDUL_cjs.Mc(e,468,s,t),d=[];for(let c of a?.rows??[])for(let f of c.cells){let m={...n,depth:s+1,cellStyle:f.styleFormatting,key:`${n.baseKey}|${s+1}|${JSON.stringify(f.styleFormatting)}`};for(let S of f.blocks)d.push({node:S,context:m});}return {children:d.reverse()}}let i=new Set;if(e.kind==="paragraph"){let a=e.children.find(c=>c.kind==="paragraphProperties"),d=chunkI6LSEDUL_cjs.Db(t,a,n.cellStyle).runProperties;for(let c of chunkI6LSEDUL_cjs.oc(e,d,void 0,(f,m)=>chunkI6LSEDUL_cjs.Fb(f,m,t),void 0,void 0,"all-markup",void 0,void 0,r)){if(!c.text||c.fontSlot!=="eastAsia"&&!o.has(c.style.fontFamily??""))continue;let f=chunkWTILOUPG_cjs.a((c.fontSlot==="eastAsia"?c.style.fontFamilyEastAsia:c.style.fontFamily)??void 0);f&&i.add(f);}}let u=e.localName==="txbxContent"?{...n,cellStyle:void 0,key:`${n.baseKey}|${s}|undefined`}:n;return {families:[...i],children:W(e,u).reverse()}}function ze(){let e=G(qe),n,t;return (r,o,s)=>{if(!n||t!==o||n.theme!==s){let i=chunkI6LSEDUL_cjs.Cb(o,s);t=o,n={key:`${i.cacheToken}|0|undefined`,baseKey:i.cacheToken,styles:i,theme:s,depth:0,supplementalFamilies:new Set([...Object.values(s.majorSupplemental??{}),...Object.values(s.minorSupplemental??{})])};}return e([...r].reverse(),n)}}function yn(e,n,t){return ze()(e,n,t)}function ee(e,n){return e.attributes.find(t=>t.localName===n)?.value}var De=G((e,n)=>{let t=[];if(e.namespaceUri===chunkDGSJZMAE_cjs.da){if(e.localName==="fldSimple"){let r=chunkI6LSEDUL_cjs.fc(ee(e,"instr")??"")?.font;r&&t.push(r);}if(e.localName==="p")for(let r of je(e))t.push(r);}return {families:t,children:W(e,n)}});function Cn(e){let n=new Map;for(let t of De(e,{key:""})){let r=chunkWTILOUPG_cjs.a(t);r!==null&&!n.has(r.toLowerCase())&&n.set(r.toLowerCase(),r);}return [...n.values()]}function je(e){let n=[],t=chunkI6LSEDUL_cjs.ga(),r=[];for(let o=e.children.length-1;o>=0;o-=1){let s=e.children[o];s.kind!=="textValue"&&r.push({node:s,containerDepth:0});}for(;r.length>0;){let{node:o,containerDepth:s}=r.pop();if(s>=chunkDGSJZMAE_cjs.la||o.namespaceUri===chunkDGSJZMAE_cjs.da&&o.localName==="p")continue;if(o.namespaceUri===chunkDGSJZMAE_cjs.da&&o.localName==="fldChar"){let u=ee(o,"fldCharType");u==="begin"?chunkI6LSEDUL_cjs.ja(t):u==="separate"?(t.nesting===1&&Ae(t,n),chunkI6LSEDUL_cjs.la(t)):u==="end"&&(t.nesting===1&&Ae(t,n),chunkI6LSEDUL_cjs.ma(t));continue}if(o.namespaceUri===chunkDGSJZMAE_cjs.da&&(o.localName==="instrText"||o.localName==="delInstrText")){chunkI6LSEDUL_cjs.ka(t,$e(o),o.localName==="delInstrText");continue}if(o.namespaceUri===chunkDGSJZMAE_cjs.da&&o.localName==="fldSimple"){let u=chunkI6LSEDUL_cjs.fc(ee(o,"instr")??"");u?.font&&n.push(u.font);}let i=chunkDGSJZMAE_cjs.ma(o,s);for(let u=o.children.length-1;u>=0;u-=1){let a=o.children[u];a.kind!=="textValue"&&r.push({node:a,containerDepth:i});}}return chunkI6LSEDUL_cjs.ha(t),n}function Ae(e,n){let t=chunkI6LSEDUL_cjs.ia(e);if(t.overflow)return;let r=chunkI6LSEDUL_cjs.fc(t.instruction);r?.font&&n.push(r.font);}function $e(e){let n="",t=[...e.children].reverse();for(;t.length>0&&n.length<=256;){let r=t.pop();if(r.kind==="textValue")n+=r.value;else for(let o=r.children.length-1;o>=0;o-=1)t.push(r.children[o]);}return n}function vn(e,n,t,r){if(!n)return [];let o=chunkI6LSEDUL_cjs.rc(n),s=chunkI6LSEDUL_cjs.Cb(t,r),i=new Map;for(let u of e)for(let a of Ke(u)){let d=chunkDGSJZMAE_cjs.Hd(a.children),c=f=>{if(f)for(let m of f.values())for(let S of [m.markerStyle.fontFamily,m.markerStyle.fontFamilyEastAsia]){let E=chunkWTILOUPG_cjs.a(S??void 0);if(E===null)continue;let N=E.toLowerCase();i.has(N)||i.set(N,E);}};c(chunkI6LSEDUL_cjs.Mb(d,o,s));for(let f of d){let m=chunkI6LSEDUL_cjs.hd(f);for(let S of m.contents)c(chunkI6LSEDUL_cjs.gd(S,o,s));}}return [...i.values()].sort((u,a)=>u.localeCompare(a))}function Ke(e){if(e.localName==="document"){for(let n of e.children)if(n.kind!=="textValue"&&n.localName==="body")return [n];return []}if(e.localName==="footnotes"||e.localName==="endnotes"){let n=[];for(let t of e.children)t.kind!=="textValue"&&(t.localName==="footnote"||t.localName==="endnote")&&n.push(t);return n}return [e]}var Ue={regular:{weight:400,style:"normal"},bold:{weight:700,style:"normal"},italic:{weight:400,style:"italic"},boldItalic:{weight:700,style:"italic"}};function Tn(e,n){let t=[],r=[],o=0;for(let s of e){let i=s.bytes.byteLength;if(!Number.isSafeInteger(i)||i>n||i>chunkOA6LFCTG_cjs.a||i>chunkOA6LFCTG_cjs.c-o){r.push(s);continue}o+=i,t.push(s);}return {sources:t,dropped:r}}function Nn(e,n,t){let r=n.reduce((s,i)=>s+i.bytes.byteLength,0),o=new Set(n.filter(s=>s.request.family.trim().length>0).map(s=>chunkOA6LFCTG_cjs.g(s.request)));return He(e,{maxFontBytes:t,aggregateBudget:Math.max(0,chunkOA6LFCTG_cjs.c-r),shadowedRequests:o})}function He(e,n){let t=[],r=[],o=n.aggregateBudget,s=new Set;for(let i of e){let u=Ue[i.style],a=Object.freeze({family:i.family,weight:u.weight,style:u.style});if(i.family.trim().length===0){r.push({request:a,partName:i.partName,reason:"malformed"});continue}let d=chunkOA6LFCTG_cjs.g(a);if(!(n.shadowedRequests?.has(d)||s.has(d))){if(s.add(d),i.bytes.byteLength>n.maxFontBytes||i.bytes.byteLength>o){r.push({request:a,partName:i.partName,reason:"overLimit"});continue}o-=i.bytes.byteLength,t.push({request:a,id:`embedded:${i.partName}#${i.style}`,bytes:i.bytes,hash:chunkDGSJZMAE_cjs.a(i.bytes),faceIndex:0});}}return {sources:t,dropped:r}}exports.a=D;exports.b=Ge;exports.c=We;exports.d=we;exports.e=Se;exports.f=Ee;exports.g=Ie;exports.h=Ce;exports.i=tn;exports.j=on;exports.k=rn;exports.l=sn;exports.m=Tn;exports.n=Nn;exports.o=He;exports.p=G;exports.q=W;exports.r=ze;exports.s=yn;exports.t=Cn;exports.u=je;exports.v=vn;
1
+ 'use strict';var chunkWQFNWLNY_cjs=require('./chunk-WQFNWLNY.cjs'),chunkBNZF6DYC_cjs=require('./chunk-BNZF6DYC.cjs'),chunkZ2ETEZRU_cjs=require('./chunk-Z2ETEZRU.cjs'),chunkMXOO7KRI_cjs=require('./chunk-MXOO7KRI.cjs');var Te=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function D(e){let n=new Map;for(let t of e)if(Array.isArray(t)){for(let r of t.slice(0,2048)){if(typeof r!="string"||!Te.test(r))continue;let o=r.toLowerCase();if(n.has(o)||n.set(o,r),n.size===2048)break}if(n.size===2048)break}return Object.freeze([...n.values()])}function Ge(e){let n=e&&"failures"in e?e.failures:void 0;return e==null||(e.sources?.length??0)===0&&(e.substitutions?.length??0)===0&&(n===void 0||Array.isArray(n)&&n.length===0)?void 0:e}var We=64,we=Object.freeze({family:"Calibri",sizeHalfPoints:22});function Se(e,...n){let t=[e,...n],r=[],o=new Set;for(let a of t)for(let d of a.sources??[]){let c=chunkWQFNWLNY_cjs.g(d.request);o.has(c)||(o.add(c),r.push(d));}let s=[],i=new Set;for(let a of t)for(let d of a.substitutions??[]){let c=chunkWQFNWLNY_cjs.g(d.from);o.has(c)||i.has(c)||(i.add(c),s.push(d));}let u=D(t.map(a=>a.supportedFamilies));return Object.freeze({...u.length?{supportedFamilies:u}:{},epoch:e.epoch??0,maxFontBytes:e.maxFontBytes??chunkWQFNWLNY_cjs.a,sources:Object.freeze(r),...s.length>0?{substitutions:Object.freeze(s)}:{},defaultFont:e.defaultFont??we,...e.language!==void 0?{language:e.language}:{}})}var Ne=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u;function Ee(e){let n=e?.defaultFont?.family;return n!==void 0&&Ne.test(n)?n:we.family}var Ie="docx-editor.dev/font-resolver",Ce=Symbol.for("docx-editor.dev/font-resolver");function tn(e){let n={value:true,enumerable:false,configurable:true};try{Object.defineProperty(e,Ce,n),Object.defineProperty(e,Ie,n);}catch(t){throw new TypeError("defineFontResolver cannot mark a frozen or sealed function; mark it before freezing, or wrap it in a fresh function and mark that.",{cause:t})}return e}function on(e){return typeof e=="function"&&e[Ce]===true}var X=e=>`${e.family.trim().toLowerCase()} ${e.weight} ${e.style}`;function Me(e,n,t){let r=new Map(e.map(o=>[X(o),o]));for(let[o,s]of n)r.set(o,s);for(let o of t)r.has(X(o.to))&&r.set(X(o.from),o.from);return [...r.values()]}async function rn(e,n,t={}){return ve(e,n,t)}async function sn(e,n,t={}){return ve(e,n,t)}async function ve(e,n,t){let r=e.map(_e),o,s=[],i=[],u=new Map,a=new Set,d=0,c=[],f=new Set,m=[],S=n.resolvedFaces??[],E=n.defaultFamily;for(let b=0;b<e.length;b+=1){ke(n.signal);let k=e[b],I=Me(S,u,c),P;try{let x=r[b],O;if(x){let l=await Re(x,n.signal);if(!l.ok)throw l.cause;O=l.value;}else if(typeof k=="function"){let l=await Re(Promise.resolve(k(Le(n,E,I,d))).then(p=>({ok:!0,value:p}),p=>({ok:!1,cause:p})),n.signal);if(!l.ok)throw l.cause;O=l.value;}else O=k;if(O==null)continue;if(typeof O=="function"){Z(t,k,b,new TypeError("A font origin answered with a function; pass the resolver itself rather than a function returning one"));continue}let R="failures"in O?O.failures:void 0,M=[];if(Array.isArray(R)){let l=Math.min(R.length,chunkWQFNWLNY_cjs.b);for(let p=0;p<l;p++)M.push(R[p]);R.length>l&&M.push(new Error("Additional font-origin failures were omitted"));}else R!==void 0&&M.push(R);let C=Be(O,a,d,f,o?"maxFontBytes"in o&&o.maxFontBytes!==void 0?o.maxFontBytes:chunkWQFNWLNY_cjs.a:void 0,t.reserveOwnedBytes,t.instrumentation);P=C;for(let l of new Set([...C.dropped,...M]))Z(t,k,b,l);let w=C.fragment;w.supportedFamilies&&s.push(w.supportedFamilies),m.push(...M);let $=(w.sources??[]).map(l=>(chunkWQFNWLNY_cjs.g(l.request),[X(l.request),l.request])),y=[...w.substitutions??[]];!o&&"defaultFont"in w&&(E=Ee(w)),o||(o=w);let g=new Set(C.sourceKeys);if(g.size>0){c=c.filter(l=>!g.has(chunkWQFNWLNY_cjs.g(l.from)));for(let l of g)f.delete(l);}i.push(...w.sources??[]);for(let l of C.sourceKeys)a.add(l);d+=C.ownedBytes;for(let[l,p]of $)u.set(l,p);for(let l of y)c.push(l),f.add(chunkWQFNWLNY_cjs.g(l.from));}catch(x){if(P?.releaseOwnedBytes?.(),n.signal?.aborted)throw n.signal.reason??x;if(x instanceof V)throw x.cause;Z(t,k,b,x);continue}}if(!o)return;let{epoch:N,...j}=Se({...o,supportedFamilies:D(s),sources:i,substitutions:c});return m.length===0?j:{...j,failures:Object.freeze(m)}}var V=class extends Error{constructor(t){super("Unable to reserve owned font bytes");this.cause=t;this.name="FontOwnershipReservationError";}cause},Y=class extends RangeError{};async function Re(e,n){if(!n)return e;ke(n);let t,r=new Promise((s,i)=>{t=i;}),o=()=>t?.(n.reason);n.addEventListener("abort",o,{once:true});try{return await Promise.race([e,r])}finally{n.removeEventListener("abort",o);}}function _e(e){if(e===null||typeof e!="object")return;let n;try{n=e.then;}catch(t){return Promise.resolve({ok:false,cause:t})}if(typeof n=="function")return Promise.resolve(e).then(t=>({ok:true,value:t}),t=>({ok:false,cause:t}))}function Be(e,n,t,r,o,s,i){let u=e.sources??[],a=e.substitutions??[],d="maxFontBytes"in e?e.maxFontBytes:void 0,c="defaultFont"in e?e.defaultFont:void 0,f="epoch"in e?e.epoch:void 0,m="language"in e?e.language:void 0;if(!Array.isArray(u)||!Array.isArray(a))throw new TypeError("Font origin sources and substitutions must be arrays");let S=u.length,E=a.length;if(S>chunkWQFNWLNY_cjs.b)throw new RangeError(`Font source count must not exceed ${chunkWQFNWLNY_cjs.b}`);if(E>chunkWQFNWLNY_cjs.b)throw new RangeError(`Font substitution count must not exceed ${chunkWQFNWLNY_cjs.b}`);let N=d??chunkWQFNWLNY_cjs.a;if(!Number.isSafeInteger(N)||N<=0||N>chunkWQFNWLNY_cjs.a)throw new RangeError(`Font byte ceiling must be a positive safe integer no greater than ${chunkWQFNWLNY_cjs.a}`);let j=o??N,b=0,k=[],I=new Set,P=[],x=[];for(let y=0;y<S;y+=1){let g=u[y];try{let l=Q(g.request),p=g.availability,B=g.faceIndex,h=g.hash,A=g.id,L=chunkWQFNWLNY_cjs.g(l);if(p!==void 0&&p!=="available"&&p!=="forbidden")throw new TypeError("Font source availability must be available or forbidden");if(!Number.isSafeInteger(B)||B<0)throw new RangeError("Font face index must be a non-negative safe integer");if(typeof h!="string"||h.length===0)throw new TypeError("Font source hash must be a non-empty string");let K;if(p!=="forbidden"){if(typeof A!="string"||A.length===0)throw new TypeError("Font source id must be a non-empty string");K=g.bytes;let J=chunkWQFNWLNY_cjs.e(K);if(J>j)throw new RangeError("Font source exceeds the effective base byte ceiling");if(n.has(L)||I.has(L))continue;if(t+b+J>chunkWQFNWLNY_cjs.c)throw new RangeError(`Font sources exceed the aggregate byte ceiling of ${chunkWQFNWLNY_cjs.c}`);b+=J;}else K=new Uint8Array(0);if(n.has(L)||I.has(L))continue;if(n.size+I.size>=chunkWQFNWLNY_cjs.b)throw new Y(`Font source count must not exceed ${chunkWQFNWLNY_cjs.b}`);I.add(L),k.push(L),P.push(Object.freeze({request:l,id:A,bytes:K,hash:h,faceIndex:B,...p?{availability:p}:{}}));}catch(l){if(l instanceof Y)throw l;x.push(l);}}let O=new Set,R=[];for(let y=0;y<E;y+=1){let g=a[y];try{let l=Q(g.from),p=Q(g.to);chunkWQFNWLNY_cjs.g(l),chunkWQFNWLNY_cjs.g(p);let B=g.lineMetrics,h=B?Object.freeze({heightEm:B.heightEm,baselineEm:B.baselineEm}):void 0;if(h&&(!Number.isFinite(h.heightEm)||!Number.isFinite(h.baselineEm)||h.heightEm<=0||h.heightEm>4||h.baselineEm<0||h.baselineEm>h.heightEm))throw new RangeError("Font substitution line metrics must fit within a bounded em box");let A=chunkWQFNWLNY_cjs.g(l);if(n.has(A)||I.has(A)||r.has(A)||O.has(A))continue;O.add(A),R.push(Object.freeze({from:l,to:p,...h?{lineMetrics:h}:{}}));}catch(l){x.push(l);}}if((S>0||E>0)&&P.length===0&&R.length===0&&x.length>0)throw x[0];let M=r.size;for(let y of I)r.has(y)&&(M-=1);if(M+O.size>chunkWQFNWLNY_cjs.b)throw new RangeError(`Font substitution count must not exceed ${chunkWQFNWLNY_cjs.b}`);let C;if(c!==void 0){let y=c.family,g=c.sizeHalfPoints;if(chunkWQFNWLNY_cjs.g({family:y,weight:400,style:"normal"}),!Number.isSafeInteger(g)||g<=0)throw new RangeError("Default font size must be a positive safe integer in half-points");C=Object.freeze({family:y,sizeHalfPoints:g});}if(f!==void 0&&(!Number.isSafeInteger(f)||f<0))throw new RangeError("Font configuration epoch must be a non-negative safe integer");if(m!==void 0&&typeof m!="string")throw new TypeError("Font shaping language must be a string");let w;if(b>0&&s)try{w=s(b);}catch(y){throw new V(y)}let $;try{$=P.map(y=>chunkWQFNWLNY_cjs.f(y,i));}catch(y){throw w?.(),y}return {fragment:Object.freeze({supportedFamilies:D([e.supportedFamilies]),sources:Object.freeze($),substitutions:Object.freeze(R),...f!==void 0?{epoch:f}:{},...d!==void 0?{maxFontBytes:d}:{},...C?{defaultFont:C}:{},...m!==void 0?{language:m}:{}}),sourceKeys:Object.freeze(k),ownedBytes:b,dropped:Object.freeze(x),releaseOwnedBytes:w}}function Pe(e){return !Number.isSafeInteger(e)||e<=0?0:e>chunkWQFNWLNY_cjs.c?chunkWQFNWLNY_cjs.c:e}function Le(e,n,t,r){let{committedSourceBytes:o,...s}=e,i=Pe(r);return {...s,defaultFamily:n,...t.length>0?{resolvedFaces:t}:{},...i>0?{committedSourceBytes:i}:{}}}function Q(e){return Object.freeze({family:e.family,weight:e.weight,style:e.style})}function ke(e){if(e?.aborted)throw e.reason??new DOMException("Font resolution was aborted","AbortError")}function Z(e,n,t,r){let o;try{typeof n=="function"&&n.name.length>0&&(o=n.name);}catch{}let s=Object.freeze({originIndex:t,...o!==void 0?{originName:o}:{},cause:r});if(e.onOriginFailure)try{let u=e.onOriginFailure(s);Promise.resolve(u).catch(a=>{console.warn("[fonts] font-origin diagnostic callback failed",a);});return}catch(u){console.warn("[fonts] font-origin diagnostic callback failed",u);}let i="";try{r instanceof Error&&r.message.length>0&&(i=`: ${r.message}`);}catch{}console.warn(`[fonts] a font origin failed and was skipped${i}`,r);}function G(e){let n=new WeakMap;return (t,r)=>{let o=new Set;for(let s of t){let i=[{node:s,context:r,next:0}],u=a=>{i.pop();let d=i.at(-1)?.found??o;for(let c of a)d.add(c);};for(;i.length;){let a=i[i.length-1],d=n.get(a.node);if(d?.key===a.context.key){u(d.families);continue}if(!a.children){let m=e(a.node,a.context);a.children=m.children,a.found=new Set(m.families);}let c=a.children[a.next++];if(c){i.push({...c,next:0});continue}let f=[...a.found];f.length<=256?n.set(a.node,{key:a.context.key,families:f}):n.delete(a.node),u(f);}}return [...o]}}function W(e,n){return e.children.flatMap(t=>t.kind==="textValue"?[]:[{node:t,context:n}])}function qe(e,n){let{styles:t,theme:r,supplementalFamilies:o,depth:s}=n;if(e.kind==="table"){let a=chunkBNZF6DYC_cjs.Rc(e,468,s,t),d=[];for(let c of a?.rows??[])for(let f of c.cells){let m={...n,depth:s+1,cellStyle:f.styleFormatting,key:`${n.baseKey}|${s+1}|${JSON.stringify(f.styleFormatting)}`};for(let S of f.blocks)d.push({node:S,context:m});}return {children:d.reverse()}}let i=new Set;if(e.kind==="paragraph"){let a=e.children.find(c=>c.kind==="paragraphProperties"),d=chunkBNZF6DYC_cjs.Fb(t,a,n.cellStyle).runProperties;for(let c of chunkBNZF6DYC_cjs.tc(e,d,void 0,(f,m)=>chunkBNZF6DYC_cjs.Hb(f,m,t),void 0,void 0,"all-markup",void 0,void 0,r)){if(!c.text||c.fontSlot!=="eastAsia"&&!o.has(c.style.fontFamily??""))continue;let f=chunkZ2ETEZRU_cjs.a((c.fontSlot==="eastAsia"?c.style.fontFamilyEastAsia:c.style.fontFamily)??void 0);f&&i.add(f);}}let u=e.localName==="txbxContent"?{...n,cellStyle:void 0,key:`${n.baseKey}|${s}|undefined`}:n;return {families:[...i],children:W(e,u).reverse()}}function ze(){let e=G(qe),n,t;return (r,o,s)=>{if(!n||t!==o||n.theme!==s){let i=chunkBNZF6DYC_cjs.Eb(o,s);t=o,n={key:`${i.cacheToken}|0|undefined`,baseKey:i.cacheToken,styles:i,theme:s,depth:0,supplementalFamilies:new Set([...Object.values(s.majorSupplemental??{}),...Object.values(s.minorSupplemental??{})])};}return e([...r].reverse(),n)}}function yn(e,n,t){return ze()(e,n,t)}function ee(e,n){return e.attributes.find(t=>t.localName===n)?.value}var De=G((e,n)=>{let t=[];if(e.namespaceUri===chunkMXOO7KRI_cjs.da){if(e.localName==="fldSimple"){let r=chunkBNZF6DYC_cjs.kc(ee(e,"instr")??"")?.font;r&&t.push(r);}if(e.localName==="p")for(let r of je(e))t.push(r);}return {families:t,children:W(e,n)}});function Cn(e){let n=new Map;for(let t of De(e,{key:""})){let r=chunkZ2ETEZRU_cjs.a(t);r!==null&&!n.has(r.toLowerCase())&&n.set(r.toLowerCase(),r);}return [...n.values()]}function je(e){let n=[],t=chunkBNZF6DYC_cjs.ia(),r=[];for(let o=e.children.length-1;o>=0;o-=1){let s=e.children[o];s.kind!=="textValue"&&r.push({node:s,containerDepth:0});}for(;r.length>0;){let{node:o,containerDepth:s}=r.pop();if(s>=chunkMXOO7KRI_cjs.la||o.namespaceUri===chunkMXOO7KRI_cjs.da&&o.localName==="p")continue;if(o.namespaceUri===chunkMXOO7KRI_cjs.da&&o.localName==="fldChar"){let u=ee(o,"fldCharType");u==="begin"?chunkBNZF6DYC_cjs.la(t):u==="separate"?(t.nesting===1&&Ae(t,n),chunkBNZF6DYC_cjs.na(t)):u==="end"&&(t.nesting===1&&Ae(t,n),chunkBNZF6DYC_cjs.oa(t));continue}if(o.namespaceUri===chunkMXOO7KRI_cjs.da&&(o.localName==="instrText"||o.localName==="delInstrText")){chunkBNZF6DYC_cjs.ma(t,$e(o),o.localName==="delInstrText");continue}if(o.namespaceUri===chunkMXOO7KRI_cjs.da&&o.localName==="fldSimple"){let u=chunkBNZF6DYC_cjs.kc(ee(o,"instr")??"");u?.font&&n.push(u.font);}let i=chunkMXOO7KRI_cjs.ma(o,s);for(let u=o.children.length-1;u>=0;u-=1){let a=o.children[u];a.kind!=="textValue"&&r.push({node:a,containerDepth:i});}}return chunkBNZF6DYC_cjs.ja(t),n}function Ae(e,n){let t=chunkBNZF6DYC_cjs.ka(e);if(t.overflow)return;let r=chunkBNZF6DYC_cjs.kc(t.instruction);r?.font&&n.push(r.font);}function $e(e){let n="",t=[...e.children].reverse();for(;t.length>0&&n.length<=256;){let r=t.pop();if(r.kind==="textValue")n+=r.value;else for(let o=r.children.length-1;o>=0;o-=1)t.push(r.children[o]);}return n}function vn(e,n,t,r){if(!n)return [];let o=chunkBNZF6DYC_cjs.wc(n),s=chunkBNZF6DYC_cjs.Eb(t,r),i=new Map;for(let u of e)for(let a of Ke(u)){let d=chunkMXOO7KRI_cjs.Id(a.children),c=f=>{if(f)for(let m of f.values())for(let S of [m.markerStyle.fontFamily,m.markerStyle.fontFamilyEastAsia]){let E=chunkZ2ETEZRU_cjs.a(S??void 0);if(E===null)continue;let N=E.toLowerCase();i.has(N)||i.set(N,E);}};c(chunkBNZF6DYC_cjs.Ob(d,o,s));for(let f of d){let m=chunkBNZF6DYC_cjs.nd(f);for(let S of m.contents)c(chunkBNZF6DYC_cjs.md(S,o,s));}}return [...i.values()].sort((u,a)=>u.localeCompare(a))}function Ke(e){if(e.localName==="document"){for(let n of e.children)if(n.kind!=="textValue"&&n.localName==="body")return [n];return []}if(e.localName==="footnotes"||e.localName==="endnotes"){let n=[];for(let t of e.children)t.kind!=="textValue"&&(t.localName==="footnote"||t.localName==="endnote")&&n.push(t);return n}return [e]}var Ue={regular:{weight:400,style:"normal"},bold:{weight:700,style:"normal"},italic:{weight:400,style:"italic"},boldItalic:{weight:700,style:"italic"}};function Tn(e,n){let t=[],r=[],o=0;for(let s of e){let i=s.bytes.byteLength;if(!Number.isSafeInteger(i)||i>n||i>chunkWQFNWLNY_cjs.a||i>chunkWQFNWLNY_cjs.c-o){r.push(s);continue}o+=i,t.push(s);}return {sources:t,dropped:r}}function Nn(e,n,t){let r=n.reduce((s,i)=>s+i.bytes.byteLength,0),o=new Set(n.filter(s=>s.request.family.trim().length>0).map(s=>chunkWQFNWLNY_cjs.g(s.request)));return He(e,{maxFontBytes:t,aggregateBudget:Math.max(0,chunkWQFNWLNY_cjs.c-r),shadowedRequests:o})}function He(e,n){let t=[],r=[],o=n.aggregateBudget,s=new Set;for(let i of e){let u=Ue[i.style],a=Object.freeze({family:i.family,weight:u.weight,style:u.style});if(i.family.trim().length===0){r.push({request:a,partName:i.partName,reason:"malformed"});continue}let d=chunkWQFNWLNY_cjs.g(a);if(!(n.shadowedRequests?.has(d)||s.has(d))){if(s.add(d),i.bytes.byteLength>n.maxFontBytes||i.bytes.byteLength>o){r.push({request:a,partName:i.partName,reason:"overLimit"});continue}o-=i.bytes.byteLength,t.push({request:a,id:`embedded:${i.partName}#${i.style}`,bytes:i.bytes,hash:chunkMXOO7KRI_cjs.a(i.bytes),faceIndex:0});}}return {sources:t,dropped:r}}exports.a=D;exports.b=Ge;exports.c=We;exports.d=we;exports.e=Se;exports.f=Ee;exports.g=Ie;exports.h=Ce;exports.i=tn;exports.j=on;exports.k=rn;exports.l=sn;exports.m=Tn;exports.n=Nn;exports.o=He;exports.p=G;exports.q=W;exports.r=ze;exports.s=yn;exports.t=Cn;exports.u=je;exports.v=vn;
@@ -1 +1 @@
1
- 'use strict';var chunkK5HIOS6J_cjs=require('./chunk-K5HIOS6J.cjs'),chunkDGSJZMAE_cjs=require('./chunk-DGSJZMAE.cjs');var z=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,J=128,Q=/[\u0000-\u001F\u007F-\u009F]/,G=16,nn=2,en=3276;function V(e){return e.kind!=="textValue"}function P(e,n){for(let t of e.children)if(V(t)&&t.localName===n)return t}function O(e,n){return e.attributes.find(t=>t.localName===n)?.value}function D(e){return e===void 0||e.length===0||e.length>J||Q.test(e)?null:e}function v(e,n){let t=chunkK5HIOS6J_cjs.b(O(e,"asciiTheme"),n)??chunkK5HIOS6J_cjs.b(O(e,"hAnsiTheme"),n);if(t!==null)return t;let l=O(e,"ascii")??O(e,"hAnsi");return l===void 0?null:z.test(l)?l:null}function C(e,n){let t=chunkK5HIOS6J_cjs.b(O(e,"eastAsiaTheme"),n);if(t!==null)return t;let l=O(e,"eastAsia");return l===void 0?null:z.test(l)?l:null}function tn(e){return e!==void 0&&z.test(e)?e:null}function On(e){return tn(e)}function ln(e){return e!==void 0&&["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(n=>!!O(e,n))}function Y(e,n){if(!e)return {fontFamily:null,fontSizeHalfPoints:null,hasLatinFontReference:false};let t=P(e,"rFonts"),l=P(e,"sz"),i=l?O(l,"val"):void 0,r=i!==void 0&&/^\d{1,4}$/.test(i)?Number(i):null;return {fontFamily:t?v(t,n):null,hasLatinFontReference:ln(t),fontSizeHalfPoints:r!==null&&r>=nn&&r<=en?r:null}}function Sn(e,n){let t=new Map,l={fontFamily:null,fontSizeHalfPoints:null,hasLatinFontReference:false};if(e){let a=P(e,"docDefaults"),s=a?P(a,"rPrDefault"):void 0;l=Y(s?P(s,"rPr"):void 0,n);for(let u of e.children){if(!V(u)||u.localName!=="style")continue;let o=D(O(u,"styleId"));if(o===null||t.has(o))continue;let f=P(u,"basedOn");t.set(o,{basedOn:D(f?O(f,"val"):void 0),own:Y(P(u,"rPr"),n)});}}let i=new Map,r=a=>{let s=a??"",u=i.get(s);if(u)return u;let o=null,f=null,m=l.hasLatinFontReference,b=new Set,y=a;for(let I=0;y!==null&&I<G&&!b.has(y);I+=1){b.add(y);let E=t.get(y);if(!E)break;o??=E.own.fontFamily,m||=E.own.hasLatinFontReference,f??=E.own.fontSizeHalfPoints,y=E.basedOn;}let g={hasLatinFontReference:m,fontFamily:o??l.fontFamily,fontSizeHalfPoints:f??l.fontSizeHalfPoints};return i.set(s,g),g};return (a,s)=>{let u=r(a),o=s?.find(b=>b.localName==="rFonts"),f=o?chunkK5HIOS6J_cjs.b(o.attributes?.asciiTheme,n)??chunkK5HIOS6J_cjs.b(o.attributes?.hAnsiTheme,n):null,m=["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(b=>!!o?.attributes?.[b]);return {fontFamily:f??u.fontFamily??(!u.hasLatinFontReference&&!m?n.minor:null),fontSizeHalfPoints:u.fontSizeHalfPoints}}}var an=16,on=16,rn=32,sn=4096;function x(e){return e.kind!=="textValue"}function c(e,n){for(let t of e.children)if(x(t)&&t.localName===n)return t}function M(e,n){return e.attributes.find(t=>t.localName===n)?.value}function un(e){return e==="1"||e==="true"||e==="on"}function H(){return {families:new Map,styleIds:new Set,anyText:false,bareParagraph:false,bareRun:false,bareTable:false}}function _(e,n){for(let[t,l]of n.families)e.families.has(t)||e.families.set(t,l);for(let t of n.styleIds)e.styleIds.add(t);e.anyText||=n.anyText,e.bareParagraph||=n.bareParagraph,e.bareRun||=n.bareRun,e.bareTable||=n.bareTable;}function T(e,n){if(n===null)return;let t=n.toLowerCase();e.has(t)||e.set(t,n);}var fn=new Set(["tab","noBreakHyphen","softHyphen","footnoteRef","endnoteRef","footnoteReference","endnoteReference"]),dn=128;function cn(e){for(let n of e.attributes)if(n.localName==="font"&&!(n.namespaceUri!==chunkDGSJZMAE_cjs.da&&n.namespaceUri!==""))return n.value.length>0&&n.value.length<=dn;return false}function $(e,n){if(n?.has(e.id))return true;for(let t of e.children)if(!(!x(t)||t.namespaceUri!==chunkDGSJZMAE_cjs.da)){if(fn.has(t.localName))return true;if(t.localName==="sym"){if(!cn(t))return true;continue}if(!(t.localName!=="t"&&t.localName!=="delText")){for(let l of t.children)if(!x(l)&&l.value.length>0)return true}}return false}function mn(e){for(let n of e.children)if(!(!x(n)||n.namespaceUri!==chunkDGSJZMAE_cjs.da)&&!(n.localName!=="t"&&n.localName!=="delText")){for(let t of n.children)if(!x(t))for(let l of t.value){let i=l.codePointAt(0);if(i>=4352&&i<=4607||i>=11904&&i<=40959||i>=43360&&i<=43391||i>=44032&&i<=55295||i>=63744&&i<=64255||i>=65072&&i<=65103||i>=65280&&i<=65519||i>=131072&&i<=262143)return true}}return false}function K(e,n){let t=[e];for(;t.length>0;){let l=t.pop();if(x(l)){if(n?.has(l.id))return true;if(l.localName==="r"&&l.namespaceUri===chunkDGSJZMAE_cjs.da){if($(l,n))return true;continue}for(let i of l.children)t.push(i);}}return false}function yn(e,n,t,l){if(!$(e,l))return;n.anyText=true;let i=c(e,"rPr"),r=i?c(i,"rFonts"):void 0;r&&(T(n.families,v(r,t)),mn(e)&&T(n.families,C(r,t)));let a=i?c(i,"rStyle"):void 0,s=D(a?M(a,"val"):void 0);s!==null?n.styleIds.add(s):n.bareRun=true;}function gn(e,n,t){if(!t)return;n.anyText=true;let l=e.localName==="tbl",i=c(e,l?"tblPr":"pPr"),r=i?c(i,l?"tblStyle":"pStyle"):void 0,a=D(r?M(r,"val"):void 0);a!==null?n.styleIds.add(a):l?n.bareTable=true:n.bareParagraph=true;}function X(e){return (e.localName==="p"||e.localName==="tbl")&&e.namespaceUri===chunkDGSJZMAE_cjs.da}function U(e,n,t,l,i){e.namespaceUri===chunkDGSJZMAE_cjs.da&&(i?.has(e.id)&&e.localName==="fldSimple"&&(n.anyText=true,n.bareRun=true),e.localName==="r"?yn(e,n,t,i):X(e)&&gn(e,n,l));}var W=new WeakMap;function q(e,n,t){let l=W.get(e);if(l&&l.major===n.major&&l.minor===n.minor&&l.majorEastAsia===n.majorEastAsia&&l.minorEastAsia===n.minorEastAsia&&l.majorBidi===n.majorBidi&&l.minorBidi===n.minorBidi)return l.summary;let i=H();if(e.children.length>=on&&t<rn){for(let r of e.children)x(r)&&_(i,q(r,n,t+1));U(e,i,n,i.anyText);}else {let r=[e];for(;r.length>0;){let a=r.pop();if(!x(a))continue;let s=X(a)&&K(a);U(a,i,n,s);for(let u=a.children.length-1;u>=0;u-=1)r.push(a.children[u]);}}return W.set(e,{major:n.major,minor:n.minor,majorEastAsia:n.majorEastAsia,minorEastAsia:n.minorEastAsia,majorBidi:n.majorBidi,minorBidi:n.minorBidi,summary:i}),i}var xn={docDefaultFamilies:[],defaultParagraph:null,defaultCharacter:null,defaultTable:null,chainFamilies:()=>[]},Z=new WeakMap;function w(e,n){let t=c(e,"rPr"),l=t?c(t,"rFonts"):void 0;return l?v(l,n):null}function k(e,n){let t=c(e,"rPr"),l=t?c(t,"rFonts"):void 0;return l?C(l,n):null}function hn(e,n){let t=new Map,l=null,i=null,r=null,a=null,s=null,u=c(e,"docDefaults"),o=u?c(u,"rPrDefault"):void 0;o&&(l=w(o,n),i=k(o,n));let f=o?c(o,"rPr"):void 0,m=f?c(f,"rFonts"):void 0;m&&["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(d=>!!M(m,d))||(l??=n.minor);let y=0;for(let d of e.children){if(!x(d)||d.localName!=="style")continue;if(y>=sn)break;y+=1;let h=D(M(d,"styleId"));if(h===null)continue;let S=c(d,"basedOn"),F=[];for(let p of d.children){if(!x(p)||p.localName!=="tblStylePr")continue;let L=w(p,n);L!==null&&F.push(L);let R=k(p,n);R!==null&&F.push(R);}t.set(h,{basedOn:D(S?M(S,"val"):void 0),family:w(d,n),eastAsiaFamily:k(d,n),conditionalFamilies:F});let A=un(M(d,"default")),j=M(d,"type");j==="paragraph"?A?r=h:r===h&&(r=null):j==="character"?A?a=h:a===h&&(a=null):j==="table"&&(A?s=h:s===h&&(s=null));}let g=new Map,I=d=>{if(d===null)return [];let h=g.get(d);if(h)return h;let S=[],F=null,A=null,j=new Set,p=d;for(let L=0;p!==null&&L<an&&!j.has(p);L+=1){j.add(p);let R=t.get(p);if(!R)break;F??=R.family,A??=R.eastAsiaFamily,S.push(...R.conditionalFamilies),p=R.basedOn;}return F!==null&&S.unshift(F),A!==null&&S.unshift(A),g.set(d,S),S};return {docDefaultFamilies:[l,i].filter(d=>d!==null),defaultParagraph:r,defaultCharacter:a,defaultTable:s,chainFamilies:I}}function bn(e,n){if(!e)return {...xn,docDefaultFamilies:n.minor?[n.minor]:[]};let t=Z.get(e);if(t&&t.major===n.major&&t.minor===n.minor&&t.majorEastAsia===n.majorEastAsia&&t.minorEastAsia===n.minorEastAsia&&t.majorBidi===n.majorBidi&&t.minorBidi===n.minorBidi)return t.index;let l=hn(e,n);return Z.set(e,{major:n.major,minor:n.minor,majorEastAsia:n.majorEastAsia,minorEastAsia:n.minorEastAsia,majorBidi:n.majorBidi,minorBidi:n.minorBidi,index:l}),l}function En(e,n,t,l){let i=H(),r=new Map;for(let o of e){let f=H();for(let m of o.children){if(!x(m))continue;if(!l||l.size===0){_(f,q(m,t,0));continue}let b=H(),y=[m];for(;y.length>0;){let g=y.pop();if(!x(g))continue;let I=X(g)&&K(g,l);U(g,b,t,I,l);for(let E=g.children.length-1;E>=0;E-=1)y.push(g.children[E]);}_(f,b);}_(i,f);for(let m of f.families.values())T(r,m);}let a=bn(n,t),s=new Map;for(let o of i.styleIds)for(let f of a.chainFamilies(o))T(s,f);if(i.bareParagraph)for(let o of a.chainFamilies(a.defaultParagraph))T(s,o);if(i.bareRun)for(let o of a.chainFamilies(a.defaultCharacter))T(s,o);if(i.bareTable)for(let o of a.chainFamilies(a.defaultTable))T(s,o);if(i.anyText)for(let o of a.docDefaultFamilies)T(s,o);for(let o of r.keys())s.delete(o);let u=[...s.values()].sort((o,f)=>o<f?-1:o>f?1:0);return Object.freeze({direct:Object.freeze([...r.values()]),inherited:Object.freeze(u)})}function An(e,n,t){let l=En(e,n,t),i=[...l.direct,...l.inherited];return i.sort((r,a)=>r<a?-1:r>a?1:0),i}exports.a=tn;exports.b=On;exports.c=Sn;exports.d=En;exports.e=An;
1
+ 'use strict';var chunkITNK6C5M_cjs=require('./chunk-ITNK6C5M.cjs'),chunkMXOO7KRI_cjs=require('./chunk-MXOO7KRI.cjs');var z=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,J=128,Q=/[\u0000-\u001F\u007F-\u009F]/,G=16,nn=2,en=3276;function V(e){return e.kind!=="textValue"}function P(e,n){for(let t of e.children)if(V(t)&&t.localName===n)return t}function O(e,n){return e.attributes.find(t=>t.localName===n)?.value}function D(e){return e===void 0||e.length===0||e.length>J||Q.test(e)?null:e}function v(e,n){let t=chunkITNK6C5M_cjs.b(O(e,"asciiTheme"),n)??chunkITNK6C5M_cjs.b(O(e,"hAnsiTheme"),n);if(t!==null)return t;let l=O(e,"ascii")??O(e,"hAnsi");return l===void 0?null:z.test(l)?l:null}function C(e,n){let t=chunkITNK6C5M_cjs.b(O(e,"eastAsiaTheme"),n);if(t!==null)return t;let l=O(e,"eastAsia");return l===void 0?null:z.test(l)?l:null}function tn(e){return e!==void 0&&z.test(e)?e:null}function On(e){return tn(e)}function ln(e){return e!==void 0&&["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(n=>!!O(e,n))}function Y(e,n){if(!e)return {fontFamily:null,fontSizeHalfPoints:null,hasLatinFontReference:false};let t=P(e,"rFonts"),l=P(e,"sz"),i=l?O(l,"val"):void 0,r=i!==void 0&&/^\d{1,4}$/.test(i)?Number(i):null;return {fontFamily:t?v(t,n):null,hasLatinFontReference:ln(t),fontSizeHalfPoints:r!==null&&r>=nn&&r<=en?r:null}}function Sn(e,n){let t=new Map,l={fontFamily:null,fontSizeHalfPoints:null,hasLatinFontReference:false};if(e){let a=P(e,"docDefaults"),s=a?P(a,"rPrDefault"):void 0;l=Y(s?P(s,"rPr"):void 0,n);for(let u of e.children){if(!V(u)||u.localName!=="style")continue;let o=D(O(u,"styleId"));if(o===null||t.has(o))continue;let f=P(u,"basedOn");t.set(o,{basedOn:D(f?O(f,"val"):void 0),own:Y(P(u,"rPr"),n)});}}let i=new Map,r=a=>{let s=a??"",u=i.get(s);if(u)return u;let o=null,f=null,m=l.hasLatinFontReference,b=new Set,y=a;for(let I=0;y!==null&&I<G&&!b.has(y);I+=1){b.add(y);let E=t.get(y);if(!E)break;o??=E.own.fontFamily,m||=E.own.hasLatinFontReference,f??=E.own.fontSizeHalfPoints,y=E.basedOn;}let g={hasLatinFontReference:m,fontFamily:o??l.fontFamily,fontSizeHalfPoints:f??l.fontSizeHalfPoints};return i.set(s,g),g};return (a,s)=>{let u=r(a),o=s?.find(b=>b.localName==="rFonts"),f=o?chunkITNK6C5M_cjs.b(o.attributes?.asciiTheme,n)??chunkITNK6C5M_cjs.b(o.attributes?.hAnsiTheme,n):null,m=["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(b=>!!o?.attributes?.[b]);return {fontFamily:f??u.fontFamily??(!u.hasLatinFontReference&&!m?n.minor:null),fontSizeHalfPoints:u.fontSizeHalfPoints}}}var an=16,on=16,rn=32,sn=4096;function x(e){return e.kind!=="textValue"}function c(e,n){for(let t of e.children)if(x(t)&&t.localName===n)return t}function M(e,n){return e.attributes.find(t=>t.localName===n)?.value}function un(e){return e==="1"||e==="true"||e==="on"}function H(){return {families:new Map,styleIds:new Set,anyText:false,bareParagraph:false,bareRun:false,bareTable:false}}function _(e,n){for(let[t,l]of n.families)e.families.has(t)||e.families.set(t,l);for(let t of n.styleIds)e.styleIds.add(t);e.anyText||=n.anyText,e.bareParagraph||=n.bareParagraph,e.bareRun||=n.bareRun,e.bareTable||=n.bareTable;}function T(e,n){if(n===null)return;let t=n.toLowerCase();e.has(t)||e.set(t,n);}var fn=new Set(["tab","noBreakHyphen","softHyphen","footnoteRef","endnoteRef","footnoteReference","endnoteReference"]),dn=128;function cn(e){for(let n of e.attributes)if(n.localName==="font"&&!(n.namespaceUri!==chunkMXOO7KRI_cjs.da&&n.namespaceUri!==""))return n.value.length>0&&n.value.length<=dn;return false}function $(e,n){if(n?.has(e.id))return true;for(let t of e.children)if(!(!x(t)||t.namespaceUri!==chunkMXOO7KRI_cjs.da)){if(fn.has(t.localName))return true;if(t.localName==="sym"){if(!cn(t))return true;continue}if(!(t.localName!=="t"&&t.localName!=="delText")){for(let l of t.children)if(!x(l)&&l.value.length>0)return true}}return false}function mn(e){for(let n of e.children)if(!(!x(n)||n.namespaceUri!==chunkMXOO7KRI_cjs.da)&&!(n.localName!=="t"&&n.localName!=="delText")){for(let t of n.children)if(!x(t))for(let l of t.value){let i=l.codePointAt(0);if(i>=4352&&i<=4607||i>=11904&&i<=40959||i>=43360&&i<=43391||i>=44032&&i<=55295||i>=63744&&i<=64255||i>=65072&&i<=65103||i>=65280&&i<=65519||i>=131072&&i<=262143)return true}}return false}function K(e,n){let t=[e];for(;t.length>0;){let l=t.pop();if(x(l)){if(n?.has(l.id))return true;if(l.localName==="r"&&l.namespaceUri===chunkMXOO7KRI_cjs.da){if($(l,n))return true;continue}for(let i of l.children)t.push(i);}}return false}function yn(e,n,t,l){if(!$(e,l))return;n.anyText=true;let i=c(e,"rPr"),r=i?c(i,"rFonts"):void 0;r&&(T(n.families,v(r,t)),mn(e)&&T(n.families,C(r,t)));let a=i?c(i,"rStyle"):void 0,s=D(a?M(a,"val"):void 0);s!==null?n.styleIds.add(s):n.bareRun=true;}function gn(e,n,t){if(!t)return;n.anyText=true;let l=e.localName==="tbl",i=c(e,l?"tblPr":"pPr"),r=i?c(i,l?"tblStyle":"pStyle"):void 0,a=D(r?M(r,"val"):void 0);a!==null?n.styleIds.add(a):l?n.bareTable=true:n.bareParagraph=true;}function X(e){return (e.localName==="p"||e.localName==="tbl")&&e.namespaceUri===chunkMXOO7KRI_cjs.da}function U(e,n,t,l,i){e.namespaceUri===chunkMXOO7KRI_cjs.da&&(i?.has(e.id)&&e.localName==="fldSimple"&&(n.anyText=true,n.bareRun=true),e.localName==="r"?yn(e,n,t,i):X(e)&&gn(e,n,l));}var W=new WeakMap;function q(e,n,t){let l=W.get(e);if(l&&l.major===n.major&&l.minor===n.minor&&l.majorEastAsia===n.majorEastAsia&&l.minorEastAsia===n.minorEastAsia&&l.majorBidi===n.majorBidi&&l.minorBidi===n.minorBidi)return l.summary;let i=H();if(e.children.length>=on&&t<rn){for(let r of e.children)x(r)&&_(i,q(r,n,t+1));U(e,i,n,i.anyText);}else {let r=[e];for(;r.length>0;){let a=r.pop();if(!x(a))continue;let s=X(a)&&K(a);U(a,i,n,s);for(let u=a.children.length-1;u>=0;u-=1)r.push(a.children[u]);}}return W.set(e,{major:n.major,minor:n.minor,majorEastAsia:n.majorEastAsia,minorEastAsia:n.minorEastAsia,majorBidi:n.majorBidi,minorBidi:n.minorBidi,summary:i}),i}var xn={docDefaultFamilies:[],defaultParagraph:null,defaultCharacter:null,defaultTable:null,chainFamilies:()=>[]},Z=new WeakMap;function w(e,n){let t=c(e,"rPr"),l=t?c(t,"rFonts"):void 0;return l?v(l,n):null}function k(e,n){let t=c(e,"rPr"),l=t?c(t,"rFonts"):void 0;return l?C(l,n):null}function hn(e,n){let t=new Map,l=null,i=null,r=null,a=null,s=null,u=c(e,"docDefaults"),o=u?c(u,"rPrDefault"):void 0;o&&(l=w(o,n),i=k(o,n));let f=o?c(o,"rPr"):void 0,m=f?c(f,"rFonts"):void 0;m&&["ascii","hAnsi","asciiTheme","hAnsiTheme"].some(d=>!!M(m,d))||(l??=n.minor);let y=0;for(let d of e.children){if(!x(d)||d.localName!=="style")continue;if(y>=sn)break;y+=1;let h=D(M(d,"styleId"));if(h===null)continue;let S=c(d,"basedOn"),F=[];for(let p of d.children){if(!x(p)||p.localName!=="tblStylePr")continue;let L=w(p,n);L!==null&&F.push(L);let R=k(p,n);R!==null&&F.push(R);}t.set(h,{basedOn:D(S?M(S,"val"):void 0),family:w(d,n),eastAsiaFamily:k(d,n),conditionalFamilies:F});let A=un(M(d,"default")),j=M(d,"type");j==="paragraph"?A?r=h:r===h&&(r=null):j==="character"?A?a=h:a===h&&(a=null):j==="table"&&(A?s=h:s===h&&(s=null));}let g=new Map,I=d=>{if(d===null)return [];let h=g.get(d);if(h)return h;let S=[],F=null,A=null,j=new Set,p=d;for(let L=0;p!==null&&L<an&&!j.has(p);L+=1){j.add(p);let R=t.get(p);if(!R)break;F??=R.family,A??=R.eastAsiaFamily,S.push(...R.conditionalFamilies),p=R.basedOn;}return F!==null&&S.unshift(F),A!==null&&S.unshift(A),g.set(d,S),S};return {docDefaultFamilies:[l,i].filter(d=>d!==null),defaultParagraph:r,defaultCharacter:a,defaultTable:s,chainFamilies:I}}function bn(e,n){if(!e)return {...xn,docDefaultFamilies:n.minor?[n.minor]:[]};let t=Z.get(e);if(t&&t.major===n.major&&t.minor===n.minor&&t.majorEastAsia===n.majorEastAsia&&t.minorEastAsia===n.minorEastAsia&&t.majorBidi===n.majorBidi&&t.minorBidi===n.minorBidi)return t.index;let l=hn(e,n);return Z.set(e,{major:n.major,minor:n.minor,majorEastAsia:n.majorEastAsia,minorEastAsia:n.minorEastAsia,majorBidi:n.majorBidi,minorBidi:n.minorBidi,index:l}),l}function En(e,n,t,l){let i=H(),r=new Map;for(let o of e){let f=H();for(let m of o.children){if(!x(m))continue;if(!l||l.size===0){_(f,q(m,t,0));continue}let b=H(),y=[m];for(;y.length>0;){let g=y.pop();if(!x(g))continue;let I=X(g)&&K(g,l);U(g,b,t,I,l);for(let E=g.children.length-1;E>=0;E-=1)y.push(g.children[E]);}_(f,b);}_(i,f);for(let m of f.families.values())T(r,m);}let a=bn(n,t),s=new Map;for(let o of i.styleIds)for(let f of a.chainFamilies(o))T(s,f);if(i.bareParagraph)for(let o of a.chainFamilies(a.defaultParagraph))T(s,o);if(i.bareRun)for(let o of a.chainFamilies(a.defaultCharacter))T(s,o);if(i.bareTable)for(let o of a.chainFamilies(a.defaultTable))T(s,o);if(i.anyText)for(let o of a.docDefaultFamilies)T(s,o);for(let o of r.keys())s.delete(o);let u=[...s.values()].sort((o,f)=>o<f?-1:o>f?1:0);return Object.freeze({direct:Object.freeze([...r.values()]),inherited:Object.freeze(u)})}function An(e,n,t){let l=En(e,n,t),i=[...l.direct,...l.inherited];return i.sort((r,a)=>r<a?-1:r>a?1:0),i}exports.a=tn;exports.b=On;exports.c=Sn;exports.d=En;exports.e=An;
@@ -1 +1 @@
1
- 'use strict';var chunkCEXC2VHI_cjs=require('../chunk-CEXC2VHI.cjs');require('../chunk-DGSJZMAE.cjs');Object.defineProperty(exports,"createCollaborationDocumentPort",{enumerable:true,get:function(){return chunkCEXC2VHI_cjs.b}});
1
+ 'use strict';var chunk4EHMMSFR_cjs=require('../chunk-4EHMMSFR.cjs'),chunkMXOO7KRI_cjs=require('../chunk-MXOO7KRI.cjs');Object.defineProperty(exports,"createCollaborationDocumentPort",{enumerable:true,get:function(){return chunk4EHMMSFR_cjs.b}});Object.defineProperty(exports,"historyGroupOfJournal",{enumerable:true,get:function(){return chunkMXOO7KRI_cjs.ya}});Object.defineProperty(exports,"reportHistoryGroup",{enumerable:true,get:function(){return chunkMXOO7KRI_cjs.Mi}});
@@ -1,6 +1,8 @@
1
- import { T as TreePackageStore, b as TreeModelChange } from '../note-lifecycle-D4AOFCAt.js';
2
- import { a1 as OoxmlElement, j as OoxmlPackage } from '../types-barrel-CEOy-Jv0.js';
3
- import '../image-resources-C51LuAAu.js';
1
+ import { b as HistoryGroup, T as TreePackageStore, c as TreeModelChange } from '../tree-package-fragment-CwJDixNs.js';
2
+ export { r as reportHistoryGroup } from '../tree-package-fragment-CwJDixNs.js';
3
+ import { a1 as OoxmlElement, j as OoxmlPackage } from '../types-barrel-DLB11iSY.js';
4
+ import '../image-resources-C4ilLzog.js';
5
+ import '../editor-scope-OHPwVQ5l.js';
4
6
 
5
7
  /** Attribute name as the journal addresses it. Prefix is authored fidelity, not identity. @public */
6
8
  interface CanonicalAttributeName {
@@ -107,6 +109,8 @@ type CanonicalPrimitiveEffect = {
107
109
  interface CanonicalPrimitiveJournal {
108
110
  readonly effects: readonly CanonicalPrimitiveEffect[];
109
111
  }
112
+ /** The history group the transaction behind `journal` named, if any. @public */
113
+ declare function historyGroupOfJournal(journal: CanonicalPrimitiveJournal): HistoryGroup | undefined;
110
114
 
111
115
  /** Options for a canonical collaboration document port. @public */
112
116
  interface CreateCollaborationDocumentPortOptions {
@@ -196,6 +200,11 @@ interface CollaborationDocumentPort {
196
200
  *
197
201
  * Disabled observation allocates no journal. This is the collaboration write seam;
198
202
  * adapters never write a CRDT through this port.
203
+ * Preserve the journal object's identity and deliver it synchronously to local capture.
204
+ * `historyGroupOfJournal` reads local identity metadata, outside replicated state.
205
+ * Cloning, spreading, serialization or postMessage loses that metadata. Custom worker
206
+ * ports must map local gesture identities explicitly; a serialized journal alone cannot
207
+ * preserve gesture grouping or synchronous `ExecResult.history` reporting.
199
208
  */
200
209
  observePrimitiveJournal(listener: (journal: CanonicalPrimitiveJournal) => void): () => void;
201
210
  /** True when a committed journal has not yet been frozen or delivered to observers. */
@@ -212,4 +221,4 @@ interface CollaborationDocumentPort {
212
221
  binaryPart(storageKey: string): Uint8Array | null;
213
222
  }
214
223
 
215
- export { type CanonicalAttributeName, type CanonicalBinaryDescriptor, type CanonicalElementNodeDescriptor, type CanonicalNodeDescriptor, type CanonicalPrimitiveEffect, type CanonicalPrimitiveJournal, type CanonicalRelationshipRecord, type CanonicalTextNodeDescriptor, type CollaborationApplyResult, type CollaborationDocumentPort, type CollaborationMutation, type CollaborationParagraph, type CollaborationParagraphTextUpdate, type CreateCollaborationDocumentPortOptions, createCollaborationDocumentPort };
224
+ export { type CanonicalAttributeName, type CanonicalBinaryDescriptor, type CanonicalElementNodeDescriptor, type CanonicalNodeDescriptor, type CanonicalPrimitiveEffect, type CanonicalPrimitiveJournal, type CanonicalRelationshipRecord, type CanonicalTextNodeDescriptor, type CollaborationApplyResult, type CollaborationDocumentPort, type CollaborationMutation, type CollaborationParagraph, type CollaborationParagraphTextUpdate, type CreateCollaborationDocumentPortOptions, HistoryGroup, createCollaborationDocumentPort, historyGroupOfJournal };
@@ -1 +1 @@
1
- export{b as createCollaborationDocumentPort}from'../chunk-IW35GWJN.js';import'../chunk-CF3JR35B.js';
1
+ export{b as createCollaborationDocumentPort}from'../chunk-Q2B6HX3R.js';export{ya as historyGroupOfJournal,Mi as reportHistoryGroup}from'../chunk-NG6IQ4SI.js';
@@ -1,9 +1,10 @@
1
- import { S as StoryScope } from './note-lifecycle-D4AOFCAt.js';
2
- import { W as TreeDocOp } from './types-barrel-CEOy-Jv0.js';
1
+ import { S as StoryScope } from './tree-package-fragment-CwJDixNs.js';
2
+ import { W as TreeDocOp } from './types-barrel-DLB11iSY.js';
3
3
  import { CollaborationDocumentPort } from './collaboration/replication.js';
4
4
  import { C as CollaborationStatus, a as CollaborationStatusSnapshot, b as CollaborationFailureCode } from './failure-DNNmwsgD.js';
5
5
  export { c as CollaborationFailure, d as createCollaborationStatusTracker, i as isCollaborationFailureCode } from './failure-DNNmwsgD.js';
6
- import './image-resources-C51LuAAu.js';
6
+ import './image-resources-C4ilLzog.js';
7
+ import './editor-scope-OHPwVQ5l.js';
7
8
 
8
9
  /**
9
10
  * A peer's presence color is attacker-controlled: it arrives over awareness from whoever is in
@@ -1,5 +1,6 @@
1
- import { D as DocxDocument, E as ExecResult, k as ContentControlType, l as DocTarget, m as RunFormatting, n as Extent, I as InsertableContentControlType, o as ContainerRef, p as ContentControlFilter, q as DocRange, r as Revision, s as DocComment, S as StyleDefinitions } from '../types-barrel-CEOy-Jv0.js';
2
- export { B as Block, t as ColorValue, u as ContentControl, v as DocAnchor, w as DocAnchorRange, x as DocLocation, y as DocumentBody, z as ExecErrorCode, H as HeaderFooterSet, A as IndentFormatting, P as Paragraph, F as ParagraphFlags, G as ParagraphTabStop, J as RevisionType, K as Section, L as SectionProperties, M as StyleDefinition, T as Table, N as Theme, Q as ThemeColorScheme } from '../types-barrel-CEOy-Jv0.js';
1
+ import { D as DocxDocument, E as ExecResult, k as ContentControlType, l as DocTarget, m as RunFormatting, n as Extent, I as InsertableContentControlType, o as ContainerRef, p as ContentControlFilter, q as DocRange, r as Revision, s as DocComment, S as StyleDefinitions } from '../types-barrel-DLB11iSY.js';
2
+ export { B as Block, t as ColorValue, u as ContentControl, v as DocAnchor, w as DocAnchorRange, x as DocLocation, y as DocumentBody, z as ExecErrorCode, H as HeaderFooterSet, A as IndentFormatting, P as Paragraph, F as ParagraphFlags, G as ParagraphTabStop, J as RevisionType, K as Section, L as SectionProperties, M as StyleDefinition, T as Table, N as Theme, Q as ThemeColorScheme } from '../types-barrel-DLB11iSY.js';
3
+ import '../editor-scope-OHPwVQ5l.js';
3
4
 
4
5
  /**
5
6
  * `@docx-editor.dev/core/contracts/document` — the document-level edit and query vocabulary.
@@ -1 +1 @@
1
- 'use strict';var chunkOHJQ7GPZ_cjs=require('../chunk-OHJQ7GPZ.cjs');Object.defineProperty(exports,"EditorFontError",{enumerable:true,get:function(){return chunkOHJQ7GPZ_cjs.a}});
1
+ 'use strict';var chunkUKVVUHZL_cjs=require('../chunk-UKVVUHZL.cjs');Object.defineProperty(exports,"EditorFontError",{enumerable:true,get:function(){return chunkUKVVUHZL_cjs.a}});
@@ -1,12 +1,12 @@
1
- export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, e 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 EditorSelection, d as EditorSnapshot, a as FontConfiguration, F as FontFaceRequest, b as FontSource, c as FontSourceSubstitution, R as FormatPainterLevel, U as FormatPainterMode, o as FormatPainterSurfaceState, V as FurnitureVariant, W as HeaderFooterSlotArgs, X as HeaderFooterState, Y as HyperlinkInfo, I as ImageContext, f as ImageCropPercent, _ as NoteKind, $ as NotePropertiesSide, a0 as NotePropertiesState, a1 as PageSetup, a2 as ResolveReviewChangesOptions, a3 as ResolvedNoteNumbering, a4 as ReviewActivationOptions, a5 as ReviewCommentPlacement, a6 as ReviewCustomPlacement, a7 as ReviewItemPlacement, a8 as ReviewItemPlacementBase, a9 as ReviewItemQuery, aa as ReviewRevisionPlacement, S as SelectedImageState, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, ab as TableBorderTarget, ac as TableCellVerticalAlignment, ad as TableColumnDividerResizeTarget, ae as TableColumnOccurrenceTarget, t as TableContext, af as TableRightEdgeResizeTarget, ag as TableRowOccurrenceTarget, ah as TextMatch, T as TrackedChangeFilterMode, h as TrackedChangePredicate, ai as ZoomFitTarget, Z as ZoomMode } from '../editor-BgtcHulQ.js';
2
- export { B as Block, t as ColorValue, C as CommentRecord, o as ContainerRef, u as ContentControl, p as ContentControlFilter, k as ContentControlType, v as DocAnchor, w as DocAnchorRange, s as DocComment, x as DocLocation, q as DocRange, l as DocTarget, y as DocumentBody, D as DocxDocument, ah as DocxDocumentJSON, ai as DrawingHorizontalReferenceFrame, a8 as DrawingKind, ab as DrawingLocks, aa as DrawingPositionInput, aj as DrawingVerticalReferenceFrame, z as ExecErrorCode, E as ExecResult, n as Extent, ak as FontDefinition, H as HeaderFooterSet, a9 as ImageWrapTarget, A as IndentFormatting, I as InsertableContentControlType, al as NumberingRef, am as PageMargins, P as Paragraph, an as ParagraphDisagreements, F as ParagraphFlags, ac as ParagraphFormatCommand, G as ParagraphTabStop, ao as Point, ae as Rect, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind, r as Revision, h as RevisionAddress, _ as RevisionBatchResult, J as RevisionType, ap as Run, m as RunFormatting, K as Section, L as SectionProperties, af as SelectionPin, M as StyleDefinition, S as StyleDefinitions, T as Table, aq as TableCell, ar as TableRow, N as Theme, Q as ThemeColorScheme, ag as Unsubscribe, ad as Watermark } from '../types-barrel-CEOy-Jv0.js';
1
+ export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, e 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 EditorSelection, d as EditorSnapshot, a as FontConfiguration, F as FontFaceRequest, b as FontSource, c as FontSourceSubstitution, R as FormatPainterLevel, U as FormatPainterMode, o as FormatPainterSurfaceState, V as FurnitureVariant, W as HeaderFooterSlotArgs, X as HeaderFooterState, Y as HyperlinkInfo, I as ImageContext, f as ImageCropPercent, _ as NoteKind, $ as NotePropertiesSide, a0 as NotePropertiesState, a1 as PageSetup, a2 as ResolveReviewChangesOptions, a3 as ResolvedNoteNumbering, a4 as ReviewActivationOptions, a5 as ReviewCommentPlacement, a6 as ReviewCustomPlacement, a7 as ReviewItemPlacement, a8 as ReviewItemPlacementBase, a9 as ReviewItemQuery, aa as ReviewRevisionPlacement, S as SelectedImageState, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, ab as TableBorderTarget, ac as TableCellVerticalAlignment, ad as TableColumnDividerResizeTarget, ae as TableColumnOccurrenceTarget, t as TableContext, af as TableRightEdgeResizeTarget, ag as TableRowOccurrenceTarget, ah as TextMatch, T as TrackedChangeFilterMode, h as TrackedChangePredicate, ai as ZoomFitTarget, Z as ZoomMode } from '../editor-BsLSz_7y.js';
2
+ import '../revision-projection-DEIvpxiq.js';
3
+ export { B as Block, t as ColorValue, C as CommentRecord, o as ContainerRef, u as ContentControl, p as ContentControlFilter, k as ContentControlType, v as DocAnchor, w as DocAnchorRange, s as DocComment, x as DocLocation, q as DocRange, l as DocTarget, y as DocumentBody, D as DocxDocument, ah as DocxDocumentJSON, ai as DrawingHorizontalReferenceFrame, a8 as DrawingKind, ab as DrawingLocks, aa as DrawingPositionInput, aj as DrawingVerticalReferenceFrame, z as ExecErrorCode, E as ExecResult, n as Extent, ak as FontDefinition, H as HeaderFooterSet, a9 as ImageWrapTarget, A as IndentFormatting, I as InsertableContentControlType, al as NumberingRef, am as PageMargins, P as Paragraph, an as ParagraphDisagreements, F as ParagraphFlags, ac as ParagraphFormatCommand, G as ParagraphTabStop, ao as Point, ae as Rect, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind, r as Revision, h as RevisionAddress, _ as RevisionBatchResult, J as RevisionType, ap as Run, m as RunFormatting, K as Section, L as SectionProperties, af as SelectionPin, M as StyleDefinition, S as StyleDefinitions, T as Table, aq as TableCell, ar as TableRow, N as Theme, Q as ThemeColorScheme, ag as Unsubscribe, ad as Watermark } from '../types-barrel-DLB11iSY.js';
3
4
  export { ContentControlSummary, DocEdits, DocQueries, DocQueryResults, ParagraphSummary } from './document.js';
4
- export { E as EditorScope, V as ViewScope } from '../editor-scope-DZJT4ukT.js';
5
+ export { b as EditorExecOptions, E as EditorScope, H as HistoryDiagnostic, a as HistoryGroup, c as HistoryGroupOutcome, V as ViewScope } from '../editor-scope-OHPwVQ5l.js';
5
6
  export { InteractionAffinity, InteractionOutcome, InteractionOutcomeCode, SemanticIdentity, SemanticTarget } from './interaction.js';
6
- export { S as SemanticPosition, a as SemanticSelection } from '../semantic-interaction-B7beVwH7.js';
7
- export { I as ImageResourceState, P as PreservedImageMime, R as RenderableImageMime, S as SupportedImageMime, V as ValidatedImageBytesHandle, a as VectorImageMime } from '../image-resources-C51LuAAu.js';
8
- import '../document-protection-C6RvCHx-.js';
7
+ export { S as SemanticPosition, a as SemanticSelection } from '../semantic-interaction-BLu3M6Nn.js';
8
+ export { I as ImageResourceState, P as PreservedImageMime, R as RenderableImageMime, S as SupportedImageMime, V as ValidatedImageBytesHandle, a as VectorImageMime } from '../image-resources-C4ilLzog.js';
9
+ import '../document-protection-Cr59VKLO.js';
9
10
  import '../failure-DNNmwsgD.js';
10
- import '../semantic-records-CbXwnS80.js';
11
- import '../revision-projection-BcRnC4Yj.js';
12
- import '../omml-equation-C5P6Ym3v.js';
11
+ import '../semantic-records-CqD0b5Ex.js';
12
+ import '../omml-equation-CbnW9yXd.js';
@@ -1 +1 @@
1
- export{a as EditorFontError}from'../chunk-GOEBQ26R.js';
1
+ export{a as EditorFontError}from'../chunk-S6J4O5XP.js';
@@ -1,5 +1,5 @@
1
- import { V as ViewScope } from '../editor-scope-DZJT4ukT.js';
2
- export { E as EditorScope } from '../editor-scope-DZJT4ukT.js';
1
+ import { V as ViewScope } from '../editor-scope-OHPwVQ5l.js';
2
+ export { E as EditorScope } from '../editor-scope-OHPwVQ5l.js';
3
3
 
4
4
  /**
5
5
  * `@docx-editor.dev/core/contracts/interaction` — semantic addressing and interaction outcomes.
@@ -1 +1 @@
1
- 'use strict';var chunkZKWRCLT2_cjs=require('../chunk-ZKWRCLT2.cjs');Object.defineProperty(exports,"resolveEditorModules",{enumerable:true,get:function(){return chunkZKWRCLT2_cjs.a}});
1
+ 'use strict';var chunkTKQH7BNE_cjs=require('../chunk-TKQH7BNE.cjs');Object.defineProperty(exports,"resolveEditorModules",{enumerable:true,get:function(){return chunkTKQH7BNE_cjs.a}});
@@ -1,9 +1,11 @@
1
- import { R as ReviewModelInput, a as ReviewItem, O as OoxmlPart, b as ReviewRevisionItem } from '../types-barrel-CEOy-Jv0.js';
2
- export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, e as ReviewPosition, f as ReviewRange, g as ReviewRevisionKind, h as RevisionAddress } from '../types-barrel-CEOy-Jv0.js';
3
- import { R as RevisionDisplayMode } from '../revision-projection-BcRnC4Yj.js';
1
+ import { R as ReviewModelInput, a as ReviewItem, O as OoxmlPart, b as ReviewRevisionItem } from '../types-barrel-DLB11iSY.js';
2
+ export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, e as ReviewPosition, f as ReviewRange, g as ReviewRevisionKind, h as RevisionAddress } from '../types-barrel-DLB11iSY.js';
3
+ import { R as ReviewDisplayMode } from '../revision-projection-DEIvpxiq.js';
4
+ export { a as RevisionDisplayMode } from '../revision-projection-DEIvpxiq.js';
4
5
  import { CollaborationModuleContribution } from '../collaboration.js';
5
- import '../note-lifecycle-D4AOFCAt.js';
6
- import '../image-resources-C51LuAAu.js';
6
+ import '../editor-scope-OHPwVQ5l.js';
7
+ import '../tree-package-fragment-CwJDixNs.js';
8
+ import '../image-resources-C4ilLzog.js';
7
9
  import '../collaboration/replication.js';
8
10
  import '../failure-DNNmwsgD.js';
9
11
 
@@ -52,7 +54,7 @@ interface ReviewModuleContribution {
52
54
  * carried so the future `setRevisionDisplayMode` command can validate against
53
55
  * it without a breaking module-shape change.
54
56
  */
55
- readonly displayModes: readonly RevisionDisplayMode[];
57
+ readonly displayModes: readonly ReviewDisplayMode[];
56
58
  /** The review queue derivation. */
57
59
  readonly collectReviewItems: CollectReviewItems;
58
60
  /**
@@ -124,4 +126,4 @@ interface EditorModuleRegistry {
124
126
  /** Resolve construction-time modules into the registry the instance dispatches over. */
125
127
  declare function resolveEditorModules(modules: readonly EditorModule[] | undefined): EditorModuleRegistry;
126
128
 
127
- export { CollaborationModuleContribution, type CollectReviewItems, type EditorModule, type EditorModuleRegistry, OoxmlPart, ReviewItem, ReviewModelInput, type ReviewModuleContribution, ReviewRevisionItem, RevisionDisplayMode, resolveEditorModules };
129
+ export { CollaborationModuleContribution, type CollectReviewItems, type EditorModule, type EditorModuleRegistry, OoxmlPart, ReviewDisplayMode, ReviewItem, ReviewModelInput, type ReviewModuleContribution, ReviewRevisionItem, resolveEditorModules };
@@ -1 +1 @@
1
- export{a as resolveEditorModules}from'../chunk-D5EHDHYV.js';
1
+ export{a as resolveEditorModules}from'../chunk-AJCCS53D.js';
@@ -1 +1,2 @@
1
- export { B as Block, t as ColorValue, o as ContainerRef, u as ContentControl, p as ContentControlFilter, k as ContentControlType, v as DocAnchor, w as DocAnchorRange, s as DocComment, x as DocLocation, q as DocRange, l as DocTarget, y as DocumentBody, D as DocxDocument, ah as DocxDocumentJSON, z as ExecErrorCode, E as ExecResult, n as Extent, ak as FontDefinition, H as HeaderFooterSet, A as IndentFormatting, I as InsertableContentControlType, al as NumberingRef, am as PageMargins, P as Paragraph, an as ParagraphDisagreements, F as ParagraphFlags, ac as ParagraphFormatCommand, G as ParagraphTabStop, ao as Point, ae as Rect, r as Revision, J as RevisionType, ap as Run, m as RunFormatting, K as Section, L as SectionProperties, af as SelectionPin, M as StyleDefinition, S as StyleDefinitions, T as Table, aq as TableCell, ar as TableRow, N as Theme, Q as ThemeColorScheme, ag as Unsubscribe, ad as Watermark } from '../types-barrel-CEOy-Jv0.js';
1
+ export { B as Block, t as ColorValue, o as ContainerRef, u as ContentControl, p as ContentControlFilter, k as ContentControlType, v as DocAnchor, w as DocAnchorRange, s as DocComment, x as DocLocation, q as DocRange, l as DocTarget, y as DocumentBody, D as DocxDocument, ah as DocxDocumentJSON, z as ExecErrorCode, E as ExecResult, n as Extent, ak as FontDefinition, H as HeaderFooterSet, A as IndentFormatting, I as InsertableContentControlType, al as NumberingRef, am as PageMargins, P as Paragraph, an as ParagraphDisagreements, F as ParagraphFlags, ac as ParagraphFormatCommand, G as ParagraphTabStop, ao as Point, ae as Rect, r as Revision, J as RevisionType, ap as Run, m as RunFormatting, K as Section, L as SectionProperties, af as SelectionPin, M as StyleDefinition, S as StyleDefinitions, T as Table, aq as TableCell, ar as TableRow, N as Theme, Q as ThemeColorScheme, ag as Unsubscribe, ad as Watermark } from '../types-barrel-DLB11iSY.js';
2
+ import '../editor-scope-OHPwVQ5l.js';
@@ -1,5 +1,5 @@
1
- import { j as OoxmlPackage, O as OoxmlPart, i as OoxmlNode, a5 as TreeOpRejection } from './types-barrel-CEOy-Jv0.js';
2
- import { b as TreeModelChange, e as TreeDocumentStore } from './note-lifecycle-D4AOFCAt.js';
1
+ import { j as OoxmlPackage, O as OoxmlPart, i as OoxmlNode, a5 as TreeOpRejection } from './types-barrel-DLB11iSY.js';
2
+ import { c as TreeModelChange, f as TreeDocumentStore } from './tree-package-fragment-CwJDixNs.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,4 +1,4 @@
1
- import { i as OoxmlNode } from './types-barrel-CEOy-Jv0.js';
1
+ import { i as OoxmlNode } from './types-barrel-DLB11iSY.js';
2
2
 
3
3
  /** `ST_DocProtect`: the restriction a document asks for. `none` also stands for "no element". */
4
4
  type DocumentProtectionEdit = 'none' | 'readOnly' | 'comments' | 'trackedChanges' | 'forms';
@@ -1,12 +1,29 @@
1
- import { a7 as SourceCrop, a8 as DrawingKind, a9 as ImageWrapTarget, aa as DrawingPositionInput, ab as DrawingLocks, t as ColorValue, z as ExecErrorCode, ac as ParagraphFormatCommand, ad as Watermark, v as DocAnchor, E as ExecResult, g as ReviewRevisionKind, c as ReviewCommentItem, b as ReviewRevisionItem, d as ReviewCustomItem, p as ContentControlFilter, q as DocRange, m as RunFormatting, r as Revision, ae as Rect, af as SelectionPin, ag as Unsubscribe } from './types-barrel-CEOy-Jv0.js';
1
+ import { R as ReviewDisplayMode } from './revision-projection-DEIvpxiq.js';
2
+ import { a7 as SourceCrop, a8 as DrawingKind, a9 as ImageWrapTarget, aa as DrawingPositionInput, ab as DrawingLocks, t as ColorValue, z as ExecErrorCode, ac as ParagraphFormatCommand, ad as Watermark, v as DocAnchor, E as ExecResult, g as ReviewRevisionKind, c as ReviewCommentItem, b as ReviewRevisionItem, d as ReviewCustomItem, p as ContentControlFilter, q as DocRange, m as RunFormatting, r as Revision, ae as Rect, af as SelectionPin, ag as Unsubscribe } from './types-barrel-DLB11iSY.js';
2
3
  import { DocEdits, DocQueries, DocQueryResults, ContentControlSummary } from './contracts/document.js';
3
- import { V as ViewScope, E as EditorScope } from './editor-scope-DZJT4ukT.js';
4
+ import { H as HistoryDiagnostic, a as HistoryGroup, V as ViewScope, b as EditorExecOptions, E as EditorScope } from './editor-scope-OHPwVQ5l.js';
4
5
  import { InteractionOutcome } from './contracts/interaction.js';
5
- import { a as SemanticSelection, S as SemanticPosition } from './semantic-interaction-B7beVwH7.js';
6
- import { I as ImageResourceState, S as SupportedImageMime } from './image-resources-C51LuAAu.js';
7
- import { D as DocumentProtectionState } from './document-protection-C6RvCHx-.js';
6
+ import { a as SemanticSelection, S as SemanticPosition } from './semantic-interaction-BLu3M6Nn.js';
7
+ import { I as ImageResourceState, S as SupportedImageMime } from './image-resources-C4ilLzog.js';
8
+ import { D as DocumentProtectionState } from './document-protection-Cr59VKLO.js';
8
9
  import { C as CollaborationStatus } from './failure-DNNmwsgD.js';
9
10
 
11
+ /**
12
+ * What `editor.on(...)` can be subscribed to, and what each handler receives.
13
+ *
14
+ * These are PUSH notifications and are not interchangeable with reading `snapshot()`: a snapshot
15
+ * read cannot observe an event that was never emitted, which is why adapter behaviour is asserted
16
+ * against these rather than against the snapshot.
17
+ */
18
+ interface EditorEvents {
19
+ /** A document mutation committed, with the ids it touched. */
20
+ change: (change: DocumentChange) => void;
21
+ /** The selection or its derived formatting moved. */
22
+ selectionChange: (snapshot: EditorSnapshot) => void;
23
+ error: (error: EditorError) => void;
24
+ historyDiagnostic: (diagnostic: HistoryDiagnostic) => void;
25
+ }
26
+
10
27
  /** Selection and unsupported-change policy for a bulk review decision. @public */
11
28
  interface ResolveReviewChangesOptions {
12
29
  action: 'accept' | 'reject';
@@ -638,16 +655,12 @@ interface Editor {
638
655
  * Validation does not open a dialog. Other write refusals also reject the save.
639
656
  */
640
657
  save(): Promise<ArrayBuffer>;
641
- /** An opaque handle to the current document (identity + revision). Replaces the former
642
- * structured `getDocument()`; the canonical state is the engine `PackageModel`, not a tree. */
643
658
  getDocumentHandle(): DocumentHandle;
644
- exec(command: EditorCommand, options?: {
645
- scope?: EditorScope;
646
- }): ExecResult;
659
+ /** Create an explicit gesture handle; creates no undo entry. */
660
+ beginHistoryGroup(): HistoryGroup;
661
+ exec(command: EditorCommand, options?: EditorExecOptions): ExecResult;
647
662
  /** Dry run: reports whether `exec` would apply. Never reports `changed`. */
648
- can(command: EditorCommand, options?: {
649
- scope?: EditorScope;
650
- }): CanResult;
663
+ can(command: EditorCommand, options?: EditorExecOptions): CanResult;
651
664
  /**
652
665
  * Dry run for byte commands that require {@link Editor.executeImageCommand}.
653
666
  * Generic {@link Editor.can} on `insertImage` / `replaceImage` refuses with an async-path
@@ -1245,7 +1258,7 @@ interface EditorCommands extends EditorCommandShape<DocEdits>, EditorHeaderFoote
1245
1258
  resolveAllReviewChanges: ResolveReviewChangesOptions;
1246
1259
  /** Change the review projection without accepting or rejecting document revisions. */
1247
1260
  setReviewDisplayMode: {
1248
- mode: 'all-markup' | 'proposed' | 'original';
1261
+ mode: ReviewDisplayMode;
1249
1262
  };
1250
1263
  toggleMark: {
1251
1264
  mark: string;
@@ -1845,7 +1858,7 @@ interface EditorSnapshot {
1845
1858
  /** The document's `w:documentProtection`, as the file states it; null with no document. */
1846
1859
  readonly documentProtection?: DocumentProtectionState | null;
1847
1860
  /** The displayed revision projection. The document and its revision history stay unchanged. */
1848
- readonly reviewDisplayMode?: 'all-markup' | 'proposed' | 'original';
1861
+ readonly reviewDisplayMode?: ReviewDisplayMode;
1849
1862
  /**
1850
1863
  * Whether the document carries review content — tracked changes or comment
1851
1864
  * anchors — independent of any registered review module.
@@ -1915,19 +1928,5 @@ interface EditorSnapshot {
1915
1928
  interface EditorError extends Error {
1916
1929
  readonly code?: string;
1917
1930
  }
1918
- /**
1919
- * What `editor.on(...)` can be subscribed to, and what each handler receives.
1920
- *
1921
- * These are PUSH notifications and are not interchangeable with reading `snapshot()`: a snapshot
1922
- * read cannot observe an event that was never emitted, which is why adapter behaviour is asserted
1923
- * against these rather than against the snapshot.
1924
- */
1925
- interface EditorEvents {
1926
- /** A document mutation committed, with the ids it touched. */
1927
- change: (change: DocumentChange) => void;
1928
- /** The selection or its derived formatting moved. */
1929
- selectionChange: (snapshot: EditorSnapshot) => void;
1930
- error: (error: EditorError) => void;
1931
- }
1932
1931
 
1933
1932
  export { type NotePropertiesSide as $, type AuthoredNoteNumbering as A, type EditorError as B, type CanResult as C, type DocumentSource as D, EditorFontError as E, type FontFaceRequest as F, type EditorEvents as G, type EditorFontErrorCode as H, type ImageContext as I, type EditorFormatPainterCommands as J, type EditorHeaderFooterCommands as K, type EditorNoteCommands as L, type EditorPosition as M, type EditorQueries as N, type EditorQuery as O, type EditorQueryResults as P, type EditorSelection as Q, type FormatPainterLevel as R, type SelectedImageState as S, type TrackedChangeFilterMode as T, type FormatPainterMode as U, type FurnitureVariant as V, type HeaderFooterSlotArgs as W, type HeaderFooterState as X, type HyperlinkInfo as Y, type ZoomMode as Z, type NoteKind as _, type FontConfiguration as a, type NotePropertiesState as a0, type PageSetup as a1, type ResolveReviewChangesOptions as a2, type ResolvedNoteNumbering as a3, type ReviewActivationOptions as a4, type ReviewCommentPlacement as a5, type ReviewCustomPlacement as a6, type ReviewItemPlacement as a7, type ReviewItemPlacementBase as a8, type ReviewItemQuery as a9, type ReviewRevisionPlacement as aa, type TableBorderTarget as ab, type TableCellVerticalAlignment as ac, type TableColumnDividerResizeTarget as ad, type TableColumnOccurrenceTarget as ae, type TableRightEdgeResizeTarget as af, type TableRowOccurrenceTarget as ag, type TextMatch as ah, type ZoomFitTarget as ai, type FontSource as b, type FontSourceSubstitution as c, type EditorSnapshot as d, type EditorCommand as e, type ImageCropPercent as f, type ImageCropPermille as g, type TrackedChangePredicate as h, cropPercentFromCropPermille as i, cropPercentFromPermille as j, cropPercentFromSourceCrop as k, cropPermilleFromCropPercent as l, cropPermilleFromPercent as m, type Editor as n, type FormatPainterSurfaceState as o, type TableBorderEdgeTarget as p, type TableBorderSpec as q, type TableBorderStyle as r, sourceCropFromCropPercent as s, type TableContext as t, type DocumentChange as u, validateImageCropPercent as v, type DocumentEditingMode as w, type DocumentHandle as x, type EditorCommandShape as y, type EditorCommands as z };
@@ -0,0 +1,84 @@
1
+ /** The engine-owned identity of one gesture. Create it with `Editor.beginHistoryGroup()`. @public */
2
+ declare const historyGroupBrand: unique symbol;
3
+ interface HistoryGroup {
4
+ readonly [historyGroupBrand]: true;
5
+ /** Closed after `end()`, document replacement, detach, or destruction. */
6
+ readonly state: 'open' | 'closed';
7
+ /** End this gesture without reverting any edits. Safe to call more than once. */
8
+ end(): void;
9
+ }
10
+ /** The history authority's result for this frame. @public */
11
+ interface HistoryGroupOutcome {
12
+ readonly kind: 'started' | 'extended' | 'split' | 'none';
13
+ readonly reason?: 'history-boundary' | 'undo-redo' | 'no-history' | 'package-unit' | 'composition';
14
+ }
15
+ /**
16
+ * The editor is N+1 editing views: one body plus one per header/footer relationship, plus
17
+ * footnotes, text boxes, and other addressable regions. Commands must name their target.
18
+ *
19
+ * This set is open-ended. Treat it as non-exhaustive as more regions become addressable.
20
+ */
21
+ type EditorScope = {
22
+ kind: 'body';
23
+ } | {
24
+ kind: 'headerFooter';
25
+ rId: string;
26
+ }
27
+ /**
28
+ * A footnote/endnote region.
29
+ *
30
+ * `id` encodes kind and signed note id as `footnote:<id>` or `endnote:<id>`. Use
31
+ * `formatNoteScopeId` or `parseNoteScopeId` from the store package.
32
+ */
33
+ | {
34
+ kind: 'note';
35
+ id: string;
36
+ } | {
37
+ /**
38
+ * A text box or floating frame with its own content.
39
+ *
40
+ * Addressing one takes the drawing that hosts it as well as the story root: a frame is
41
+ * reached THROUGH its drawing, and nothing can reveal or select it from `id` alone.
42
+ */
43
+ kind: 'frame';
44
+ id: string;
45
+ /** The drawing that hosts this frame. */
46
+ drawingNodeId: string;
47
+ /** The paragraph that anchors that drawing. */
48
+ hostParagraphId: string;
49
+ /** Furniture or note story that owns this frame. Absence means the body story. */
50
+ owner?: {
51
+ kind: 'headerFooter';
52
+ rId: string;
53
+ } | {
54
+ kind: 'note';
55
+ id: string;
56
+ };
57
+ }
58
+ /** Read-only aggregate across every view. Valid for queries, not for writes. */
59
+ | {
60
+ kind: 'all';
61
+ };
62
+ /** A concrete editing view. */
63
+ type ViewScope = Exclude<EditorScope, {
64
+ kind: 'all';
65
+ }>;
66
+ /** Options for a command's editing view and explicit gesture. @public */
67
+ interface EditorExecOptions {
68
+ /** Omitted, the command addresses the current selection. */
69
+ readonly scope?: EditorScope;
70
+ /**
71
+ * An open handle from this editor. Supported for synchronous formatting commands.
72
+ * Intervening writes and undo/redo can split a gesture; inspect `ExecResult.history`.
73
+ * Read-only commands do not close a gesture. Ungrouped collaboration uses timed capture.
74
+ * See the core history grouping guide for gesture bindings and boundary rules.
75
+ */
76
+ readonly historyGroup?: HistoryGroup;
77
+ }
78
+ /** Optional diagnostic notification; subscribing does not change history behavior. @public */
79
+ interface HistoryDiagnostic {
80
+ readonly kind: 'split' | 'possible-ungrouped-gesture' | 'possible-fragmented-gesture';
81
+ readonly reason: string;
82
+ }
83
+
84
+ export type { EditorScope as E, HistoryDiagnostic as H, ViewScope as V, HistoryGroup as a, EditorExecOptions as b, HistoryGroupOutcome as c };