@docx-editor.dev/core 2.24.0 → 2.25.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 (95) hide show
  1. package/dist/automation.cjs +1 -1
  2. package/dist/automation.d.ts +30 -11
  3. package/dist/automation.js +1 -1
  4. package/dist/binding.cjs +1 -1
  5. package/dist/binding.d.ts +8 -8
  6. package/dist/binding.js +1 -1
  7. package/dist/{chunk-BOGQGMMU.cjs → chunk-3RMHRNDA.cjs} +1 -1
  8. package/dist/{chunk-6CPYOVRT.cjs → chunk-42N7OV3G.cjs} +1 -1
  9. package/dist/chunk-47ZJEEBT.js +2 -0
  10. package/dist/chunk-4B3SXBV6.js +4 -0
  11. package/dist/chunk-5MWFZ7F4.cjs +11 -0
  12. package/dist/chunk-AS2OC6J4.cjs +26 -0
  13. package/dist/{chunk-DF7F7TNU.cjs → chunk-B7SYEMZ7.cjs} +1 -1
  14. package/dist/{chunk-TBFZZX7Z.cjs → chunk-BME2KUNL.cjs} +1 -1
  15. package/dist/chunk-CDGVVEUK.js +26 -0
  16. package/dist/chunk-E4RAPI5J.cjs +2 -0
  17. package/dist/{chunk-YIBEBHT3.js → chunk-FZJTQPH4.js} +1 -1
  18. package/dist/chunk-H7XMRUAO.cjs +5 -0
  19. package/dist/{chunk-KPSGB64S.js → chunk-ILUE2SI5.js} +1 -1
  20. package/dist/{chunk-G765WG4R.js → chunk-IZT3C23R.js} +1 -1
  21. package/dist/{chunk-AKF5KM2W.cjs → chunk-KJLPVGSX.cjs} +2 -2
  22. package/dist/{chunk-W3ZUPQIZ.cjs → chunk-LF5LPZOP.cjs} +13 -13
  23. package/dist/{chunk-JDAAGZNE.cjs → chunk-MEF2AK5L.cjs} +1 -1
  24. package/dist/{chunk-SOUJNWXV.js → chunk-N5WE5O5Q.js} +1 -1
  25. package/dist/{chunk-VPKKYCZI.cjs → chunk-OVDW4XQD.cjs} +1 -1
  26. package/dist/{chunk-XWXJB4J7.js → chunk-SNN53UPD.js} +1 -1
  27. package/dist/chunk-V7LBEUVW.js +5 -0
  28. package/dist/chunk-VE7YBFQD.js +5 -0
  29. package/dist/chunk-VOVDX7GW.js +18 -0
  30. package/dist/chunk-VQ33XGNP.cjs +5 -0
  31. package/dist/{chunk-2LXGB2X7.js → chunk-WVJRO4WY.js} +1 -1
  32. package/dist/chunk-XUJINXW6.js +1 -0
  33. package/dist/{chunk-ZSM6X52G.cjs → chunk-Y3TPAITU.cjs} +1 -1
  34. package/dist/chunk-Z65JJLLF.js +11 -0
  35. package/dist/collaboration/replication.cjs +1 -1
  36. package/dist/collaboration/replication.d.ts +4 -4
  37. package/dist/collaboration/replication.js +1 -1
  38. package/dist/collaboration.d.ts +3 -3
  39. package/dist/contracts/document.d.ts +2 -2
  40. package/dist/contracts/editor.d.ts +8 -8
  41. package/dist/contracts/modules.d.ts +6 -6
  42. package/dist/contracts/types.d.ts +1 -1
  43. package/dist/{custom-node-writes-77rvPW2-.d.ts → custom-node-writes-Cy9imOjA.d.ts} +2 -2
  44. package/dist/{document-protection-CYIjO-li.d.ts → document-protection-Bp19Ad4I.d.ts} +1 -1
  45. package/dist/{editor-BU6rjQZz.d.ts → editor-DkfCCTxA.d.ts} +145 -9
  46. package/dist/editor.cjs +1 -1
  47. package/dist/editor.css +3 -1
  48. package/dist/editor.d.ts +179 -34
  49. package/dist/editor.js +1 -1
  50. package/dist/export.cjs +2 -2
  51. package/dist/export.d.ts +12 -12
  52. package/dist/export.js +1 -1
  53. package/dist/{font-resolver-CPO7wtg6.d.ts → font-resolver-C295obND.d.ts} +1 -1
  54. package/dist/{headless-document-view-Cc3fFWhv.d.ts → headless-document-view-R9bzzepb.d.ts} +2 -2
  55. package/dist/{image-resources-DkuzBnTM.d.ts → image-resources-DfagDguq.d.ts} +1 -1
  56. package/dist/{index-BOkQYOsZ.d.ts → index-3KAxeSic.d.ts} +333 -308
  57. package/dist/index.cjs +1 -1
  58. package/dist/index.d.ts +17 -17
  59. package/dist/index.js +1 -1
  60. package/dist/{layout-shaping-BOOxnLxF.d.ts → layout-shaping-C889tgmj.d.ts} +2 -2
  61. package/dist/layout.cjs +1 -1
  62. package/dist/layout.d.ts +19 -19
  63. package/dist/layout.js +1 -1
  64. package/dist/{note-properties-DMfKK3QU.d.ts → note-properties-CmfvOJsi.d.ts} +1 -1
  65. package/dist/{omml-equation-BY7OdfGY.d.ts → omml-equation-CZ6IG2ja.d.ts} +1 -1
  66. package/dist/output.cjs +1 -1
  67. package/dist/output.d.ts +7 -7
  68. package/dist/output.js +1 -1
  69. package/dist/{protocol-CPAakntQ.d.ts → protocol-BhmenALD.d.ts} +43 -22
  70. package/dist/{review-paragraph-order-B0BP_wJP.d.ts → review-paragraph-order-BwhRT264.d.ts} +1 -1
  71. package/dist/{revision-projection-CVJeA2jp.d.ts → revision-projection-DfWxdBqA.d.ts} +1 -1
  72. package/dist/{semantic-cell-selection-BtO2s2Za.d.ts → semantic-cell-selection-CC3NwCtx.d.ts} +4 -4
  73. package/dist/{semantic-interaction-COMnWyBQ.d.ts → semantic-interaction-BHlV61hK.d.ts} +1 -1
  74. package/dist/{semantic-paint-C032N0ps.d.ts → semantic-paint-DfWIWUs6.d.ts} +2 -2
  75. package/dist/{semantic-records-BSjo-xck.d.ts → semantic-records-DrExlBy-.d.ts} +6 -6
  76. package/dist/store.cjs +1 -1
  77. package/dist/store.d.ts +37 -40
  78. package/dist/store.js +1 -1
  79. package/dist/{tree-package-fragment-BIyGh6L8.d.ts → tree-package-fragment-YPyYC1aD.d.ts} +9 -4
  80. package/dist/{tree-session-contract-CHcCnz3W.d.ts → tree-session-contract-AeY2v0x9.d.ts} +8 -6
  81. package/dist/{types-barrel-DN_-gaRX.d.ts → types-barrel-BO73JqHG.d.ts} +44 -30
  82. package/package.json +3 -3
  83. package/dist/chunk-3OMDEMLL.js +0 -1
  84. package/dist/chunk-CVNDMQIX.cjs +0 -26
  85. package/dist/chunk-IEXYOLNR.cjs +0 -5
  86. package/dist/chunk-J3EM5ZEA.js +0 -18
  87. package/dist/chunk-JNE6QF47.js +0 -26
  88. package/dist/chunk-JQTVFP72.cjs +0 -2
  89. package/dist/chunk-JXL25DRU.js +0 -11
  90. package/dist/chunk-P4SBMHHO.cjs +0 -5
  91. package/dist/chunk-QQAF64KN.js +0 -5
  92. package/dist/chunk-SI5FLZGU.js +0 -4
  93. package/dist/chunk-T4TKRNZT.cjs +0 -11
  94. package/dist/chunk-XMWH2R23.js +0 -5
  95. package/dist/chunk-ZXAGLAY2.js +0 -2
@@ -1 +1 @@
1
- 'use strict';var chunkJQTVFP72_cjs=require('./chunk-JQTVFP72.cjs');require('./chunk-ZSM6X52G.cjs'),require('./chunk-W3ZUPQIZ.cjs'),require('./chunk-BOGQGMMU.cjs'),require('./chunk-TBFZZX7Z.cjs');var chunkP4SBMHHO_cjs=require('./chunk-P4SBMHHO.cjs'),chunkJDAAGZNE_cjs=require('./chunk-JDAAGZNE.cjs'),chunkT4TKRNZT_cjs=require('./chunk-T4TKRNZT.cjs');var j=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),D=Object.freeze({kind:"body"});function Y(o,t={}){let m=chunkT4TKRNZT_cjs.Ld(o,t.limits??{});if(!m.ok)return {ok:false,reason:m.reason,...m.limit===void 0?{}:{limit:m.limit},...m.detail?{detail:m.detail}:{}};let p=m.package.parts.get(m.package.mainDocumentPart);if(!p)return {ok:false,reason:"no-main-document-part",detail:m.package.mainDocumentPart};let u=new chunkP4SBMHHO_cjs.Q(m.package,chunkP4SBMHHO_cjs.Ia(m.package,chunkT4TKRNZT_cjs.gb(p))),y=t.collaborationModel?.session,c=()=>{},n=K(u,y,()=>c());if(t.pagination){let i,l=-1,e=t.pagination;n.prepare=async f=>{if(!f.operations.some(s=>s.op==="updateFieldResult"))return;i=void 0;let a=u.packageRevision,d=await e(chunkP4SBMHHO_cjs.La(u));u.packageRevision===a&&(i=d,l=a);},n.fieldPageContext=(f,a,d)=>{if(u.packageRevision!==l)return null;let s=chunkJQTVFP72_cjs.g(u.currentPackage()).story(f);return s?chunkJQTVFP72_cjs.d(i,s.part,a,d):null};}let r=chunkJQTVFP72_cjs.m({port:n,capabilities:j});return y&&(c=y.attach(chunkJDAAGZNE_cjs.b(u,{documentId:y.documentId}))),{ok:true,host:r}}function G(o,t,m){let p=o.partFor(m);return p?chunkT4TKRNZT_cjs.Ea(o,()=>{let u=chunkT4TKRNZT_cjs.Jf(o.currentPackage(),t,p.name);return u?(o.replacePackageShell(u.pkg),u.relationshipId):null},u=>u!==null):null}function K(o,t,m=()=>{}){let p=true,u=0,y=()=>t?(u+=1,{origin:t.identity.role==="agent"?chunkT4TKRNZT_cjs.b.mutationAgent:chunkT4TKRNZT_cjs.b.mutationHuman,actorId:t.identity.actorId,operationId:`${t.identity.actorId}:${t.sessionId}:automation:${u}`,recordsHistory:false}):{},c=n=>(t?.flushPendingJournals(),n);return {localChangeTracking:true,revision:()=>o.packageRevision,currentPackage:()=>p?o.currentPackage():null,apply(n,r=D,i=[]){if(!p)return {ok:false,reason:"disposed"};let l=n(d=>chunkT4TKRNZT_cjs.ib(t?.identity.actorId,()=>G(o,d,r)));if(l===null)return {ok:false,reason:"unsupported-target"};let e=t?.gateOperations(l,r);if(e)return {ok:false,reason:e};let f=t?o.partFor(r)?.name:void 0,a=o.transact(r,d=>{for(let s of i)d.applyPackage(s);for(let s of l)d.apply(s);f&&d.applyPackage(s=>chunkJDAAGZNE_cjs.a(s,f,l));},y());return a.ok?c({ok:true,changed:a.change!==null}):{ok:false,reason:a.detail?`${a.reason}: ${a.detail}`:a.reason}},applyLifecycle(n){if(!p)return {ok:false,reason:"disposed"};let r=t?.gateOperations([n],D);if(r)return {ok:false,reason:r};let i=chunkT4TKRNZT_cjs.ib(t?.identity.actorId,()=>o.applyLifecycleOp(n));return i.ok?c({ok:true,changed:i.change!==null}):{ok:false,reason:i.detail?`${i.reason}: ${i.detail}`:i.reason}},applyCommentWrites(n,r){if(!p)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};if(l.store.graftPackage(()=>o.currentPackage()),n.every(a=>a.kind==="delete")){let a=n.find(s=>s.kind==="delete"),d=chunkT4TKRNZT_cjs.ib(t?.identity.actorId,()=>chunkP4SBMHHO_cjs.ba(o,n.flatMap(s=>s.kind==="delete"?[{commentId:s.commentId,...s.parentCommentId===void 0?{}:{parentCommentId:s.parentCommentId}}]:[]),r,a?.kind==="delete"?a.noteId:void 0));return d?c({ok:true,changed:d}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let e=n[0];if(e.kind==="create"||e.kind==="reply"){let a=chunkT4TKRNZT_cjs.ib(t?.identity.actorId,()=>chunkP4SBMHHO_cjs.$(o,{anchor:e.anchor,author:e.author,text:e.text,...e.date===void 0?{}:{date:e.date},...e.kind==="reply"?{replyToCommentId:e.parentCommentId}:{}},r));return a.ok?c({ok:true,changed:true,..."commentId"in a?{commentId:a.commentId}:{}}):{ok:false,reason:a.reason}}if(e.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let f=chunkT4TKRNZT_cjs.ib(t?.identity.actorId,()=>chunkP4SBMHHO_cjs.aa(o,e.commentId,e.resolved));return f.ok?c({ok:true,changed:true}):{ok:false,reason:f.reason}},applyCustomNodeWrite(n,r){if(!p)return {ok:false,reason:"disposed"};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};let e=chunkT4TKRNZT_cjs.ib(t?.identity.actorId,()=>chunkP4SBMHHO_cjs.ja(o,n,r));return e.ok?c({ok:true,changed:e.change!==null}):{ok:false,reason:e.detail?`${e.reason}: ${e.detail}`:e.reason}},save:()=>p?chunkT4TKRNZT_cjs.Md(o.currentPackage()):null,subscribe:n=>o.subscribe(()=>n()),dispose(){m(),p=false;}}}Object.defineProperty(exports,"AUTOMATION_COMMAND_OPERATIONS",{enumerable:true,get:function(){return chunkJQTVFP72_cjs.i}});Object.defineProperty(exports,"AUTOMATION_QUERY_OPERATIONS",{enumerable:true,get:function(){return chunkJQTVFP72_cjs.h}});Object.defineProperty(exports,"AUTOMATION_SOLITARY_OPERATIONS",{enumerable:true,get:function(){return chunkJQTVFP72_cjs.j}});Object.defineProperty(exports,"HEADER_FOOTER_VARIANTS",{enumerable:true,get:function(){return chunkJQTVFP72_cjs.f}});Object.defineProperty(exports,"createAutomationPaginationProvider",{enumerable:true,get:function(){return chunkJQTVFP72_cjs.e}});Object.defineProperty(exports,"isAutomationCommand",{enumerable:true,get:function(){return chunkJQTVFP72_cjs.l}});Object.defineProperty(exports,"isSolitaryAutomationCommand",{enumerable:true,get:function(){return chunkJQTVFP72_cjs.k}});Object.defineProperty(exports,"paginationSnapshotOf",{enumerable:true,get:function(){return chunkJQTVFP72_cjs.c}});exports.SERVER_AUTOMATION_CAPABILITIES=j;exports.createServerAutomationHost=Y;
1
+ 'use strict';var chunkE4RAPI5J_cjs=require('./chunk-E4RAPI5J.cjs');require('./chunk-Y3TPAITU.cjs'),require('./chunk-LF5LPZOP.cjs'),require('./chunk-3RMHRNDA.cjs'),require('./chunk-BME2KUNL.cjs');var chunkH7XMRUAO_cjs=require('./chunk-H7XMRUAO.cjs'),chunkMEF2AK5L_cjs=require('./chunk-MEF2AK5L.cjs'),chunk5MWFZ7F4_cjs=require('./chunk-5MWFZ7F4.cjs');var j=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),D=Object.freeze({kind:"body"});function Y(o,t={}){let m=chunk5MWFZ7F4_cjs.Vd(o,t.limits??{});if(!m.ok)return {ok:false,reason:m.reason,...m.limit===void 0?{}:{limit:m.limit},...m.detail?{detail:m.detail}:{}};let p=m.package.parts.get(m.package.mainDocumentPart);if(!p)return {ok:false,reason:"no-main-document-part",detail:m.package.mainDocumentPart};let u=new chunkH7XMRUAO_cjs.Q(m.package,chunkH7XMRUAO_cjs.Ia(m.package,chunk5MWFZ7F4_cjs.eb(p))),y=t.collaborationModel?.session,c=()=>{},n=K(u,y,()=>c());if(t.pagination){let i,l=-1,e=t.pagination;n.prepare=async f=>{if(!f.operations.some(s=>s.op==="updateFieldResult"))return;i=void 0;let a=u.packageRevision,d=await e(chunkH7XMRUAO_cjs.La(u));u.packageRevision===a&&(i=d,l=a);},n.fieldPageContext=(f,a,d)=>{if(u.packageRevision!==l)return null;let s=chunkE4RAPI5J_cjs.g(u.currentPackage()).story(f);return s?chunkE4RAPI5J_cjs.d(i,s.part,a,d):null};}let r=chunkE4RAPI5J_cjs.m({port:n,capabilities:j});return y&&(c=y.attach(chunkMEF2AK5L_cjs.b(u,{documentId:y.documentId}))),{ok:true,host:r}}function G(o,t,m){let p=o.partFor(m);return p?chunk5MWFZ7F4_cjs.Ea(o,()=>{let u=chunk5MWFZ7F4_cjs.Uf(o.currentPackage(),t,p.name);return u?(o.replacePackageShell(u.pkg),u.relationshipId):null},u=>u!==null):null}function K(o,t,m=()=>{}){let p=true,u=0,y=()=>t?(u+=1,{origin:t.identity.role==="agent"?chunk5MWFZ7F4_cjs.b.mutationAgent:chunk5MWFZ7F4_cjs.b.mutationHuman,actorId:t.identity.actorId,operationId:`${t.identity.actorId}:${t.sessionId}:automation:${u}`,recordsHistory:false}):{},c=n=>(t?.flushPendingJournals(),n);return {localChangeTracking:true,collaborative:()=>!!t,revision:()=>o.packageRevision,currentPackage:()=>p?o.currentPackage():null,apply(n,r=D,i=[]){if(!p)return {ok:false,reason:"disposed"};let l=n(d=>chunk5MWFZ7F4_cjs.xb(t?.identity.actorId,()=>G(o,d,r)));if(l===null)return {ok:false,reason:"unsupported-target"};let e=t?.gateOperations(l,r);if(e)return {ok:false,reason:e};let f=t?o.partFor(r)?.name:void 0,a=o.transact(r,d=>{for(let s of i)d.applyPackage(s);for(let s of l)d.apply(s);f&&d.applyPackage(s=>chunkMEF2AK5L_cjs.a(s,f,l));},y());return a.ok?c({ok:true,changed:a.change!==null}):{ok:false,reason:a.detail?`${a.reason}: ${a.detail}`:a.reason}},applyLifecycle(n){if(!p)return {ok:false,reason:"disposed"};let r=t?.gateOperations([n],D);if(r)return {ok:false,reason:r};let i=chunk5MWFZ7F4_cjs.xb(t?.identity.actorId,()=>o.applyLifecycleOp(n));return i.ok?c({ok:true,changed:i.change!==null}):{ok:false,reason:i.detail?`${i.reason}: ${i.detail}`:i.reason}},applyCommentWrites(n,r){if(!p)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};if(l.store.graftPackage(()=>o.currentPackage()),n.every(a=>a.kind==="delete")){let a=n.find(s=>s.kind==="delete"),d=chunk5MWFZ7F4_cjs.xb(t?.identity.actorId,()=>chunkH7XMRUAO_cjs.ba(o,n.flatMap(s=>s.kind==="delete"?[{commentId:s.commentId,...s.parentCommentId===void 0?{}:{parentCommentId:s.parentCommentId}}]:[]),r,a?.kind==="delete"?a.noteId:void 0));return d?c({ok:true,changed:d}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let e=n[0];if(e.kind==="create"||e.kind==="reply"){let a=chunk5MWFZ7F4_cjs.xb(t?.identity.actorId,()=>chunkH7XMRUAO_cjs.$(o,{anchor:e.anchor,author:e.author,text:e.text,...e.date===void 0?{}:{date:e.date},...e.kind==="reply"?{replyToCommentId:e.parentCommentId}:{}},r));return a.ok?c({ok:true,changed:true,..."commentId"in a?{commentId:a.commentId}:{}}):{ok:false,reason:a.reason}}if(e.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let f=chunk5MWFZ7F4_cjs.xb(t?.identity.actorId,()=>chunkH7XMRUAO_cjs.aa(o,e.commentId,e.resolved));return f.ok?c({ok:true,changed:true}):{ok:false,reason:f.reason}},applyCustomNodeWrite(n,r){if(!p)return {ok:false,reason:"disposed"};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};let e=chunk5MWFZ7F4_cjs.xb(t?.identity.actorId,()=>chunkH7XMRUAO_cjs.ja(o,n,r));return e.ok?c({ok:true,changed:e.change!==null}):{ok:false,reason:e.detail?`${e.reason}: ${e.detail}`:e.reason}},save:()=>p?chunk5MWFZ7F4_cjs.Wd(o.currentPackage()):null,subscribe:n=>o.subscribe(()=>n()),dispose(){m(),p=false;}}}Object.defineProperty(exports,"AUTOMATION_COMMAND_OPERATIONS",{enumerable:true,get:function(){return chunkE4RAPI5J_cjs.i}});Object.defineProperty(exports,"AUTOMATION_QUERY_OPERATIONS",{enumerable:true,get:function(){return chunkE4RAPI5J_cjs.h}});Object.defineProperty(exports,"AUTOMATION_SOLITARY_OPERATIONS",{enumerable:true,get:function(){return chunkE4RAPI5J_cjs.j}});Object.defineProperty(exports,"HEADER_FOOTER_VARIANTS",{enumerable:true,get:function(){return chunkE4RAPI5J_cjs.f}});Object.defineProperty(exports,"createAutomationPaginationProvider",{enumerable:true,get:function(){return chunkE4RAPI5J_cjs.e}});Object.defineProperty(exports,"isAutomationCommand",{enumerable:true,get:function(){return chunkE4RAPI5J_cjs.l}});Object.defineProperty(exports,"isSolitaryAutomationCommand",{enumerable:true,get:function(){return chunkE4RAPI5J_cjs.k}});Object.defineProperty(exports,"paginationSnapshotOf",{enumerable:true,get:function(){return chunkE4RAPI5J_cjs.c}});exports.SERVER_AUTOMATION_CAPABILITIES=j;exports.createServerAutomationHost=Y;
@@ -1,14 +1,14 @@
1
- import { A as AutomationCapabilities, a as AutomationHost } from './protocol-CPAakntQ.js';
2
- export { b as AUTOMATION_COMMAND_OPERATIONS, c as AUTOMATION_QUERY_OPERATIONS, d as AUTOMATION_SOLITARY_OPERATIONS, e as AutomationAlignment, f as AutomationBatchRequest, g as AutomationBatchResponse, h as AutomationChangeEvent, i as AutomationContentControlLock, j as AutomationContentControlRangeLocation, k as AutomationContentControlScope, l as AutomationContentControlSubtype, m as AutomationContentControlValue, n as AutomationError, o as AutomationErrorCode, p as AutomationFontRead, q as AutomationFontWrite, r as AutomationHandle, s as AutomationHandleRef, t as AutomationObjectKind, u as AutomationOperation, v as AutomationOperationKind, w as AutomationOperationResult, x as AutomationPageOrientation, y as AutomationPageSetupRead, z as AutomationPageSetupWrite, B as AutomationParagraphFormatRead, C as AutomationParagraphFormatWrite, D as AutomationParagraphRef, E as AutomationPoint, F as AutomationSaveResult, G as AutomationSearchOptions, H as AutomationSelectionMode, I as AutomationSpan, J as AutomationSpanRef, K as AutomationTextProjection, L as AutomationUnsubscribe, M as AutomationValue, N as isAutomationCommand, O as isSolitaryAutomationCommand } from './protocol-CPAakntQ.js';
3
- import { H as HeaderFooterVariant, N as NoteKind } from './tree-package-fragment-BIyGh6L8.js';
4
- import { T as TextMeasurer, S as SemanticLayout } from './semantic-records-BSjo-xck.js';
5
- import { H as HeadlessDocumentView } from './headless-document-view-Cc3fFWhv.js';
6
- import { X as OoxmlPackageLimits, Y as OoxmlPackageRejection } from './types-barrel-DN_-gaRX.js';
7
- export { Z as RevisionBatchEntry, _ as RevisionBatchResult, $ as RevisionBatchSkipReason } from './types-barrel-DN_-gaRX.js';
1
+ import { A as AutomationOperation, a as AutomationCapabilities, b as AutomationHost } from './protocol-BhmenALD.js';
2
+ export { c as AutomationAlignment, d as AutomationBatchRequest, e as AutomationBatchResponse, f as AutomationChangeEvent, g as AutomationContentControlLock, h as AutomationContentControlRangeLocation, i as AutomationContentControlScope, j as AutomationContentControlSubtype, k as AutomationContentControlValue, l as AutomationError, m as AutomationErrorCode, n as AutomationFontRead, o as AutomationFontWrite, p as AutomationHandle, q as AutomationHandleRef, r as AutomationObjectKind, s as AutomationOperationKind, t as AutomationOperationResult, u as AutomationPageOrientation, v as AutomationPageSetupRead, w as AutomationPageSetupWrite, x as AutomationParagraphFormatRead, y as AutomationParagraphFormatWrite, z as AutomationParagraphRef, B as AutomationPoint, C as AutomationSaveResult, D as AutomationSearchOptions, E as AutomationSelectionMode, F as AutomationSpan, G as AutomationSpanRef, H as AutomationTextProjection, I as AutomationUnsubscribe, J as AutomationValue } from './protocol-BhmenALD.js';
3
+ import { e as HeaderFooterVariant, N as NoteKind } from './tree-package-fragment-YPyYC1aD.js';
4
+ import { T as TextMeasurer, S as SemanticLayout } from './semantic-records-DrExlBy-.js';
5
+ import { H as HeadlessDocumentView } from './headless-document-view-R9bzzepb.js';
6
+ import { a1 as OoxmlPackageLimits, Y as OoxmlPackageRejection } from './types-barrel-BO73JqHG.js';
7
+ export { a2 as RevisionBatchEntry, a3 as RevisionBatchResult, a4 as RevisionBatchSkipReason } from './types-barrel-BO73JqHG.js';
8
8
  import { CollaborationModuleContribution } from './collaboration.js';
9
- import './image-resources-DkuzBnTM.js';
10
- import './revision-projection-CVJeA2jp.js';
11
- import './omml-equation-BY7OdfGY.js';
9
+ import './image-resources-DfagDguq.js';
10
+ import './revision-projection-DfWxdBqA.js';
11
+ import './omml-equation-CZ6IG2ja.js';
12
12
  import './editor-scope-OHPwVQ5l.js';
13
13
  import './collaboration/replication.js';
14
14
  import './failure-BIPVQbRm.js';
@@ -36,6 +36,25 @@ type AutomationStoryId = {
36
36
  readonly noteId: number;
37
37
  };
38
38
 
39
+ /** Operations that read. They never open a transaction. */
40
+ declare const AUTOMATION_QUERY_OPERATIONS: readonly ["getTables", "getTable", "getTableRows", "getTableCells", "getTableCell", "getTableCellProperties", "getTableCellBody", "getFields", "getField", "getInlinePictures", "getInlinePicture", "getChangeTrackingMode", "getDocument", "getDocumentProperty", "getBody", "getParagraphs", "getRange", "getSpanParagraphs", "getText", "getSpanText", "getParagraphId", "search", "getFont", "getParagraphFormat", "getStyle", "getSections", "getPageSetup", "getFurniture", "getNotes", "getNoteBody", "getNoteText", "getNoteKind", "getLists", "getListId", "getListById", "getListParagraphs", "getParagraphList", "getListLevel", "getHyperlink", "getBookmarks", "getBookmarkName", "getBookmarkRange", "getComments", "getCommentReplies", "getCommentId", "getCommentAuthor", "getCommentDate", "getCommentText", "getCommentRange", "getCommentResolved", "getRevisions", "getRevisionType", "getRevisionAuthor", "getRevisionDate", "getRevisionRange", "getContentControls", "getContentControlById", "getContentControlsByTag", "getContentControlsByTitle", "getContentControlTag", "getContentControlTitle", "getContentControlFileId", "getContentControlSubtype", "getContentControlLock", "getContentControlIsBound", "getContentControlPlaceholderShown", "getContentControlTemporary", "getContentControlText", "getContentControlParagraphs", "getContentControlRange"];
41
+ /** Operations that write. Every one of these goes through the single transaction path. */
42
+ declare const AUTOMATION_COMMAND_OPERATIONS: readonly ["removeDocumentInformation", "setDocumentProperties", "insertTableRows", "insertTable", "updateTable", "updateTableCell", "setInlinePicture", "deleteInlinePicture", "insertField", "setFieldCode", "deleteField", "updateFieldResult", "insertInlinePicture", "insertBreak", "setChangeTrackingMode", "proposeInsertion", "proposeDeletion", "proposeReplacement", "insertText", "replaceSpan", "replaceStoryBlocks", "insertParagraph", "splitParagraph", "deleteParagraph", "selectSpan", "selectBookmark", "setFont", "setParagraphFormat", "setStyle", "setPageSetup", "deleteNote", "setListLevel", "startNewList", "attachToList", "detachFromList", "setListLevelFormat", "insertListParagraph", "setHyperlink", "insertComment", "setCommentResolved", "replyToComment", "deleteComment", "acceptRevision", "rejectRevision", "resolveRevisionBatch", "acceptAllRevisions", "rejectAllRevisions", "setContentControlValue", "setContentControlProperties", "deleteContentControl", "insertContentControlText", "insertContentControl", "insertCustomNode"];
43
+ /**
44
+ * Commands that commit as a PACKAGE transaction and therefore share a batch with nothing.
45
+ *
46
+ * A note's lifecycle rewrites several parts at once — the notes part, the references in every
47
+ * story that cited it, the relationship and the content-type override — and the store publishes
48
+ * that as its own undo unit rather than as ops inside a story transaction. Two of them, or one
49
+ * beside a story command, would be two commits: two revisions, and a moment where half the
50
+ * caller's batch is published. Refused while planning instead.
51
+ */
52
+ declare const AUTOMATION_SOLITARY_OPERATIONS: readonly ["removeDocumentInformation", "insertTableRows", "resolveRevisionBatch", "insertTable", "insertInlinePicture", "insertBreak", "startNewList", "deleteNote", "insertComment", "setCommentResolved", "replyToComment", "insertCustomNode"];
53
+ /** Whether an operation must be the only one in its batch. */
54
+ declare function isSolitaryAutomationCommand(operation: AutomationOperation): boolean;
55
+ /** Whether an operation writes. Drives the query/command split inside one batch. */
56
+ declare function isAutomationCommand(operation: AutomationOperation): boolean;
57
+
39
58
  /** Measured page positions used by field updates; no guessed page counts. @public */
40
59
  interface AutomationPaginationSnapshot {
41
60
  readonly pageCount: number;
@@ -111,5 +130,5 @@ interface ServerAutomationHostOptions {
111
130
  */
112
131
  declare function createServerAutomationHost(bytes: Uint8Array, options?: ServerAutomationHostOptions): ServerAutomationHostResult;
113
132
 
114
- export { AutomationCapabilities, AutomationHost, HEADER_FOOTER_VARIANTS, SERVER_AUTOMATION_CAPABILITIES, createAutomationPaginationProvider, createServerAutomationHost, paginationSnapshotOf };
133
+ export { AUTOMATION_COMMAND_OPERATIONS, AUTOMATION_QUERY_OPERATIONS, AUTOMATION_SOLITARY_OPERATIONS, AutomationCapabilities, AutomationHost, AutomationOperation, HEADER_FOOTER_VARIANTS, SERVER_AUTOMATION_CAPABILITIES, createAutomationPaginationProvider, createServerAutomationHost, isAutomationCommand, isSolitaryAutomationCommand, paginationSnapshotOf };
115
134
  export type { AutomationPaginationOptions, AutomationPaginationProvider, AutomationPaginationSnapshot, AutomationStoryId, ServerAutomationHostOptions, ServerAutomationHostRejection, ServerAutomationHostResult };
@@ -1 +1 @@
1
- import {m,g,d}from'./chunk-ZXAGLAY2.js';export{i as AUTOMATION_COMMAND_OPERATIONS,h as AUTOMATION_QUERY_OPERATIONS,j as AUTOMATION_SOLITARY_OPERATIONS,f as HEADER_FOOTER_VARIANTS,e as createAutomationPaginationProvider,l as isAutomationCommand,k as isSolitaryAutomationCommand,c as paginationSnapshotOf}from'./chunk-ZXAGLAY2.js';import'./chunk-3OMDEMLL.js';import'./chunk-J3EM5ZEA.js';import'./chunk-SOUJNWXV.js';import'./chunk-XWXJB4J7.js';import {Q,Ia,La,ja,ba,$,aa}from'./chunk-XMWH2R23.js';import {b,a}from'./chunk-2LXGB2X7.js';import {Ld,gb,Md,ib,Ea,Jf,b as b$1}from'./chunk-JXL25DRU.js';var j=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),D=Object.freeze({kind:"body"});function Y(o,t={}){let m$1=Ld(o,t.limits??{});if(!m$1.ok)return {ok:false,reason:m$1.reason,...m$1.limit===void 0?{}:{limit:m$1.limit},...m$1.detail?{detail:m$1.detail}:{}};let p=m$1.package.parts.get(m$1.package.mainDocumentPart);if(!p)return {ok:false,reason:"no-main-document-part",detail:m$1.package.mainDocumentPart};let u=new Q(m$1.package,Ia(m$1.package,gb(p))),y=t.collaborationModel?.session,c=()=>{},n=K(u,y,()=>c());if(t.pagination){let i,l=-1,e=t.pagination;n.prepare=async f=>{if(!f.operations.some(s=>s.op==="updateFieldResult"))return;i=void 0;let a=u.packageRevision,d=await e(La(u));u.packageRevision===a&&(i=d,l=a);},n.fieldPageContext=(f,a,d$1)=>{if(u.packageRevision!==l)return null;let s=g(u.currentPackage()).story(f);return s?d(i,s.part,a,d$1):null};}let r=m({port:n,capabilities:j});return y&&(c=y.attach(b(u,{documentId:y.documentId}))),{ok:true,host:r}}function G(o,t,m){let p=o.partFor(m);return p?Ea(o,()=>{let u=Jf(o.currentPackage(),t,p.name);return u?(o.replacePackageShell(u.pkg),u.relationshipId):null},u=>u!==null):null}function K(o,t,m=()=>{}){let p=true,u=0,y=()=>t?(u+=1,{origin:t.identity.role==="agent"?b$1.mutationAgent:b$1.mutationHuman,actorId:t.identity.actorId,operationId:`${t.identity.actorId}:${t.sessionId}:automation:${u}`,recordsHistory:false}):{},c=n=>(t?.flushPendingJournals(),n);return {localChangeTracking:true,revision:()=>o.packageRevision,currentPackage:()=>p?o.currentPackage():null,apply(n,r=D,i=[]){if(!p)return {ok:false,reason:"disposed"};let l=n(d=>ib(t?.identity.actorId,()=>G(o,d,r)));if(l===null)return {ok:false,reason:"unsupported-target"};let e=t?.gateOperations(l,r);if(e)return {ok:false,reason:e};let f=t?o.partFor(r)?.name:void 0,a$1=o.transact(r,d=>{for(let s of i)d.applyPackage(s);for(let s of l)d.apply(s);f&&d.applyPackage(s=>a(s,f,l));},y());return a$1.ok?c({ok:true,changed:a$1.change!==null}):{ok:false,reason:a$1.detail?`${a$1.reason}: ${a$1.detail}`:a$1.reason}},applyLifecycle(n){if(!p)return {ok:false,reason:"disposed"};let r=t?.gateOperations([n],D);if(r)return {ok:false,reason:r};let i=ib(t?.identity.actorId,()=>o.applyLifecycleOp(n));return i.ok?c({ok:true,changed:i.change!==null}):{ok:false,reason:i.detail?`${i.reason}: ${i.detail}`:i.reason}},applyCommentWrites(n,r){if(!p)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};if(l.store.graftPackage(()=>o.currentPackage()),n.every(a=>a.kind==="delete")){let a=n.find(s=>s.kind==="delete"),d=ib(t?.identity.actorId,()=>ba(o,n.flatMap(s=>s.kind==="delete"?[{commentId:s.commentId,...s.parentCommentId===void 0?{}:{parentCommentId:s.parentCommentId}}]:[]),r,a?.kind==="delete"?a.noteId:void 0));return d?c({ok:true,changed:d}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let e=n[0];if(e.kind==="create"||e.kind==="reply"){let a=ib(t?.identity.actorId,()=>$(o,{anchor:e.anchor,author:e.author,text:e.text,...e.date===void 0?{}:{date:e.date},...e.kind==="reply"?{replyToCommentId:e.parentCommentId}:{}},r));return a.ok?c({ok:true,changed:true,..."commentId"in a?{commentId:a.commentId}:{}}):{ok:false,reason:a.reason}}if(e.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let f=ib(t?.identity.actorId,()=>aa(o,e.commentId,e.resolved));return f.ok?c({ok:true,changed:true}):{ok:false,reason:f.reason}},applyCustomNodeWrite(n,r){if(!p)return {ok:false,reason:"disposed"};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};let e=ib(t?.identity.actorId,()=>ja(o,n,r));return e.ok?c({ok:true,changed:e.change!==null}):{ok:false,reason:e.detail?`${e.reason}: ${e.detail}`:e.reason}},save:()=>p?Md(o.currentPackage()):null,subscribe:n=>o.subscribe(()=>n()),dispose(){m(),p=false;}}}export{j as SERVER_AUTOMATION_CAPABILITIES,Y as createServerAutomationHost};
1
+ import {m,g,d}from'./chunk-47ZJEEBT.js';export{i as AUTOMATION_COMMAND_OPERATIONS,h as AUTOMATION_QUERY_OPERATIONS,j as AUTOMATION_SOLITARY_OPERATIONS,f as HEADER_FOOTER_VARIANTS,e as createAutomationPaginationProvider,l as isAutomationCommand,k as isSolitaryAutomationCommand,c as paginationSnapshotOf}from'./chunk-47ZJEEBT.js';import'./chunk-XUJINXW6.js';import'./chunk-VOVDX7GW.js';import'./chunk-N5WE5O5Q.js';import'./chunk-SNN53UPD.js';import {Q,Ia,La,ja,ba,$,aa}from'./chunk-VE7YBFQD.js';import {b,a}from'./chunk-WVJRO4WY.js';import {Vd,eb,Wd,xb,Ea,Uf,b as b$1}from'./chunk-Z65JJLLF.js';var j=Object.freeze({document:true,save:true,events:true,selection:false,scrolling:false,layout:false}),D=Object.freeze({kind:"body"});function Y(o,t={}){let m$1=Vd(o,t.limits??{});if(!m$1.ok)return {ok:false,reason:m$1.reason,...m$1.limit===void 0?{}:{limit:m$1.limit},...m$1.detail?{detail:m$1.detail}:{}};let p=m$1.package.parts.get(m$1.package.mainDocumentPart);if(!p)return {ok:false,reason:"no-main-document-part",detail:m$1.package.mainDocumentPart};let u=new Q(m$1.package,Ia(m$1.package,eb(p))),y=t.collaborationModel?.session,c=()=>{},n=K(u,y,()=>c());if(t.pagination){let i,l=-1,e=t.pagination;n.prepare=async f=>{if(!f.operations.some(s=>s.op==="updateFieldResult"))return;i=void 0;let a=u.packageRevision,d=await e(La(u));u.packageRevision===a&&(i=d,l=a);},n.fieldPageContext=(f,a,d$1)=>{if(u.packageRevision!==l)return null;let s=g(u.currentPackage()).story(f);return s?d(i,s.part,a,d$1):null};}let r=m({port:n,capabilities:j});return y&&(c=y.attach(b(u,{documentId:y.documentId}))),{ok:true,host:r}}function G(o,t,m){let p=o.partFor(m);return p?Ea(o,()=>{let u=Uf(o.currentPackage(),t,p.name);return u?(o.replacePackageShell(u.pkg),u.relationshipId):null},u=>u!==null):null}function K(o,t,m=()=>{}){let p=true,u=0,y=()=>t?(u+=1,{origin:t.identity.role==="agent"?b$1.mutationAgent:b$1.mutationHuman,actorId:t.identity.actorId,operationId:`${t.identity.actorId}:${t.sessionId}:automation:${u}`,recordsHistory:false}):{},c=n=>(t?.flushPendingJournals(),n);return {localChangeTracking:true,collaborative:()=>!!t,revision:()=>o.packageRevision,currentPackage:()=>p?o.currentPackage():null,apply(n,r=D,i=[]){if(!p)return {ok:false,reason:"disposed"};let l=n(d=>xb(t?.identity.actorId,()=>G(o,d,r)));if(l===null)return {ok:false,reason:"unsupported-target"};let e=t?.gateOperations(l,r);if(e)return {ok:false,reason:e};let f=t?o.partFor(r)?.name:void 0,a$1=o.transact(r,d=>{for(let s of i)d.applyPackage(s);for(let s of l)d.apply(s);f&&d.applyPackage(s=>a(s,f,l));},y());return a$1.ok?c({ok:true,changed:a$1.change!==null}):{ok:false,reason:a$1.detail?`${a$1.reason}: ${a$1.detail}`:a$1.reason}},applyLifecycle(n){if(!p)return {ok:false,reason:"disposed"};let r=t?.gateOperations([n],D);if(r)return {ok:false,reason:r};let i=xb(t?.identity.actorId,()=>o.applyLifecycleOp(n));return i.ok?c({ok:true,changed:i.change!==null}):{ok:false,reason:i.detail?`${i.reason}: ${i.detail}`:i.reason}},applyCommentWrites(n,r){if(!p)return {ok:false,reason:"disposed"};if(n.length===0)return {ok:true,changed:false};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};if(l.store.graftPackage(()=>o.currentPackage()),n.every(a=>a.kind==="delete")){let a=n.find(s=>s.kind==="delete"),d=xb(t?.identity.actorId,()=>ba(o,n.flatMap(s=>s.kind==="delete"?[{commentId:s.commentId,...s.parentCommentId===void 0?{}:{parentCommentId:s.parentCommentId}}]:[]),r,a?.kind==="delete"?a.noteId:void 0));return d?c({ok:true,changed:d}):{ok:false,reason:"comment-delete-refused"}}if(n.length!==1)return {ok:false,reason:"mixed-comment-writes"};let e=n[0];if(e.kind==="create"||e.kind==="reply"){let a=xb(t?.identity.actorId,()=>$(o,{anchor:e.anchor,author:e.author,text:e.text,...e.date===void 0?{}:{date:e.date},...e.kind==="reply"?{replyToCommentId:e.parentCommentId}:{}},r));return a.ok?c({ok:true,changed:true,..."commentId"in a?{commentId:a.commentId}:{}}):{ok:false,reason:a.reason}}if(e.kind!=="resolve")return {ok:false,reason:"unsupported-comment-write"};let f=xb(t?.identity.actorId,()=>aa(o,e.commentId,e.resolved));return f.ok?c({ok:true,changed:true}):{ok:false,reason:f.reason}},applyCustomNodeWrite(n,r){if(!p)return {ok:false,reason:"disposed"};let i=t?.gateOperations([],r);if(i)return {ok:false,reason:i};let l=o.resolveStory(r);if(!l.ok)return {ok:false,reason:l.reason};let e=xb(t?.identity.actorId,()=>ja(o,n,r));return e.ok?c({ok:true,changed:e.change!==null}):{ok:false,reason:e.detail?`${e.reason}: ${e.detail}`:e.reason}},save:()=>p?Wd(o.currentPackage()):null,subscribe:n=>o.subscribe(()=>n()),dispose(){m(),p=false;}}}export{j as SERVER_AUTOMATION_CAPABILITIES,Y as createServerAutomationHost};
package/dist/binding.cjs CHANGED
@@ -1 +1 @@
1
- 'use strict';var chunkIEXYOLNR_cjs=require('./chunk-IEXYOLNR.cjs');require('./chunk-6CPYOVRT.cjs'),require('./chunk-BOGQGMMU.cjs'),require('./chunk-TBFZZX7Z.cjs'),require('./chunk-P4SBMHHO.cjs'),require('./chunk-JDAAGZNE.cjs'),require('./chunk-T4TKRNZT.cjs');Object.defineProperty(exports,"PROJECTION_ORIGIN",{enumerable:true,get:function(){return chunkIEXYOLNR_cjs.k}});Object.defineProperty(exports,"bodyParagraphs",{enumerable:true,get:function(){return chunkIEXYOLNR_cjs.c}});Object.defineProperty(exports,"docToTreeOps",{enumerable:true,get:function(){return chunkIEXYOLNR_cjs.f}});Object.defineProperty(exports,"mountTreeSurface",{enumerable:true,get:function(){return chunkIEXYOLNR_cjs.l}});Object.defineProperty(exports,"openTreeSession",{enumerable:true,get:function(){return chunkIEXYOLNR_cjs.j}});Object.defineProperty(exports,"partHasNode",{enumerable:true,get:function(){return chunkIEXYOLNR_cjs.g}});Object.defineProperty(exports,"reconcileDoc",{enumerable:true,get:function(){return chunkIEXYOLNR_cjs.h}});Object.defineProperty(exports,"runPropsOf",{enumerable:true,get:function(){return chunkIEXYOLNR_cjs.b}});Object.defineProperty(exports,"treeSchema",{enumerable:true,get:function(){return chunkIEXYOLNR_cjs.a}});Object.defineProperty(exports,"treeToDoc",{enumerable:true,get:function(){return chunkIEXYOLNR_cjs.e}});
1
+ 'use strict';var chunkVQ33XGNP_cjs=require('./chunk-VQ33XGNP.cjs');require('./chunk-42N7OV3G.cjs'),require('./chunk-3RMHRNDA.cjs'),require('./chunk-BME2KUNL.cjs'),require('./chunk-H7XMRUAO.cjs'),require('./chunk-MEF2AK5L.cjs'),require('./chunk-5MWFZ7F4.cjs');Object.defineProperty(exports,"PROJECTION_ORIGIN",{enumerable:true,get:function(){return chunkVQ33XGNP_cjs.k}});Object.defineProperty(exports,"bodyParagraphs",{enumerable:true,get:function(){return chunkVQ33XGNP_cjs.c}});Object.defineProperty(exports,"docToTreeOps",{enumerable:true,get:function(){return chunkVQ33XGNP_cjs.f}});Object.defineProperty(exports,"mountTreeSurface",{enumerable:true,get:function(){return chunkVQ33XGNP_cjs.l}});Object.defineProperty(exports,"openTreeSession",{enumerable:true,get:function(){return chunkVQ33XGNP_cjs.j}});Object.defineProperty(exports,"partHasNode",{enumerable:true,get:function(){return chunkVQ33XGNP_cjs.g}});Object.defineProperty(exports,"reconcileDoc",{enumerable:true,get:function(){return chunkVQ33XGNP_cjs.h}});Object.defineProperty(exports,"runPropsOf",{enumerable:true,get:function(){return chunkVQ33XGNP_cjs.b}});Object.defineProperty(exports,"treeSchema",{enumerable:true,get:function(){return chunkVQ33XGNP_cjs.a}});Object.defineProperty(exports,"treeToDoc",{enumerable:true,get:function(){return chunkVQ33XGNP_cjs.e}});
package/dist/binding.d.ts CHANGED
@@ -1,16 +1,16 @@
1
1
  import { Node, Schema } from 'prosemirror-model';
2
- import { a0 as OoxmlProperty, Y as OoxmlPackageRejection } from './types-barrel-DN_-gaRX.js';
3
- import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-CHcCnz3W.js';
4
- export { D as DocumentStyleEntry, M as MapResult, b as TreeApplyOptions, c as TreeBindingRejection, d as bodyParagraphs, e as docToTreeOps, p as partHasNode, r as reconcileDoc, t as treeToDoc } from './tree-session-contract-CHcCnz3W.js';
2
+ import { X as OoxmlProperty, Y as OoxmlPackageRejection } from './types-barrel-BO73JqHG.js';
3
+ import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-AeY2v0x9.js';
4
+ export { D as DocumentStyleEntry, M as MapResult, b as TreeApplyOptions, c as TreeBindingRejection, d as bodyParagraphs, e as docToTreeOps, p as partHasNode, r as reconcileDoc, t as treeToDoc } from './tree-session-contract-AeY2v0x9.js';
5
5
  import { ReviewModuleContribution } from './contracts/modules.js';
6
- export { S as StoryScope, a as StoryTargetRejection } from './tree-package-fragment-BIyGh6L8.js';
6
+ export { S as StoryScope, a as StoryTargetRejection } from './tree-package-fragment-YPyYC1aD.js';
7
7
  import { EditorView } from 'prosemirror-view';
8
8
  import './editor-scope-OHPwVQ5l.js';
9
- import './image-resources-DkuzBnTM.js';
10
- import './custom-node-writes-77rvPW2-.js';
11
- import './headless-document-view-Cc3fFWhv.js';
9
+ import './image-resources-DfagDguq.js';
10
+ import './custom-node-writes-Cy9imOjA.js';
11
+ import './headless-document-view-R9bzzepb.js';
12
12
  import './collaboration/replication.js';
13
- import './revision-projection-CVJeA2jp.js';
13
+ import './revision-projection-DfWxdBqA.js';
14
14
  import './collaboration.js';
15
15
  import './failure-BIPVQbRm.js';
16
16
 
package/dist/binding.js CHANGED
@@ -1 +1 @@
1
- export{k as PROJECTION_ORIGIN,c as bodyParagraphs,f as docToTreeOps,l as mountTreeSurface,j as openTreeSession,g as partHasNode,h as reconcileDoc,b as runPropsOf,a as treeSchema,e as treeToDoc}from'./chunk-QQAF64KN.js';import'./chunk-G765WG4R.js';import'./chunk-SOUJNWXV.js';import'./chunk-XWXJB4J7.js';import'./chunk-XMWH2R23.js';import'./chunk-2LXGB2X7.js';import'./chunk-JXL25DRU.js';
1
+ export{k as PROJECTION_ORIGIN,c as bodyParagraphs,f as docToTreeOps,l as mountTreeSurface,j as openTreeSession,g as partHasNode,h as reconcileDoc,b as runPropsOf,a as treeSchema,e as treeToDoc}from'./chunk-V7LBEUVW.js';import'./chunk-IZT3C23R.js';import'./chunk-N5WE5O5Q.js';import'./chunk-SNN53UPD.js';import'./chunk-VE7YBFQD.js';import'./chunk-WVJRO4WY.js';import'./chunk-Z65JJLLF.js';
@@ -1 +1 @@
1
- 'use strict';var chunkTBFZZX7Z_cjs=require('./chunk-TBFZZX7Z.cjs'),chunkP4SBMHHO_cjs=require('./chunk-P4SBMHHO.cjs'),chunkT4TKRNZT_cjs=require('./chunk-T4TKRNZT.cjs');function F(t){let r=[],s=0;for(let e of t){let o=s+e.text.length;e.resultRuns?r.push({text:e.text,rawStart:e.rawStart,rawEnd:e.rawEnd,resultRuns:e.resultRuns,projectedStart:s,projectedEnd:o,expansion:e.text.length!==e.rawEnd-e.rawStart}):r.push({text:e.text,rawStart:e.rawStart,rawEnd:e.rawEnd,projectedStart:s,projectedEnd:o,expansion:e.text.length!==e.rawEnd-e.rawStart}),s=o;}return r}function T(t,r){return r<=t.rawStart?t.projectedStart:r>=t.rawEnd?t.projectedEnd:t.expansion?t.projectedStart:t.projectedStart+r-t.rawStart}function M(t,r){return t.expansion?t.rawStart:t.rawStart+r-t.projectedStart}function V(t,r){return t.expansion?t.rawEnd:t.rawStart+r-t.projectedStart}function g(t){let r=F(t),s="";for(let e of t)s+=e.text;return {text:s,projectedOffset(e){let o=0;for(let a of r){if(e<=a.rawEnd)return T(a,e);o=a.projectedEnd;}return o},rawRange(e,o){if(e<0||e>=o||o>s.length)return null;let a=r.find(d=>e>=d.projectedStart&&e<d.projectedEnd),n=r.find(d=>o>d.projectedStart&&o<=d.projectedEnd);return !a||!n?null:{start:M(a,e),end:V(n,o)}},sliceRaw(e,o){if(e>=o)return "";let a="";for(let n of r){if(n.expansion){e<=n.rawStart&&o>=n.rawEnd&&(a+=n.text);continue}let d=Math.max(e,n.rawStart),u=Math.min(o,n.rawEnd);d<u&&(a+=n.text.slice(d-n.rawStart,u-n.rawStart));}return a},resultRunAddressAt(e){let o=r.find(n=>n.resultRuns!==void 0&&e>=n.projectedStart&&e<n.projectedEnd);if(!o?.resultRuns)return null;let a=e-o.projectedStart;for(let n of o.resultRuns)if(a>=n.start&&a<n.end)return {runId:n.runId,offset:a-n.start};return null},findOccurrences(e,o,a={}){let n=[];if(o<=0||!chunkP4SBMHHO_cjs.Ga(e)||s.length===0)return {matches:n,truncated:false};let d=a.matchCase===true,u=a.wholeWord===true,i=d?e:chunkP4SBMHHO_cjs.Ea(e),l=d?s:chunkP4SBMHHO_cjs.Ea(s),f=Math.min(s.length,a.to??s.length),j=new Set,c=l.indexOf(i,Math.max(0,a.from??0));for(;c>=0;){let p=c+i.length;if(p>f)return {matches:n,truncated:false};if(!u||chunkP4SBMHHO_cjs.Fa(s,c,p)){let m=r.find(x=>c>=x.projectedStart&&c<x.projectedEnd),P=r.find(x=>p>x.projectedStart&&p<=x.projectedEnd);if(!m||!P)return {matches:n,truncated:false};let h=m===P&&m.expansion?m:null;if(!h||!j.has(h)){if(n.length>=o)return {matches:n,truncated:true};n.push({start:c,length:i.length,rawStart:M(m,c),rawEnd:V(P,p)}),h&&j.add(h);}}c=l.indexOf(i,p);}return {matches:n,truncated:false}}}}function A(t){return t.length===0?g([]):g([{text:t,rawStart:0,rawEnd:t.length}])}function B(t,r,s="allMarkup"){if(!r.includes(chunkT4TKRNZT_cjs.ke))return r.length===0?[]:[{text:r,rawStart:0,rawEnd:r.length}];let e=chunkT4TKRNZT_cjs.Fe(t),o=chunkT4TKRNZT_cjs.ef(t,e),a=chunkTBFZZX7Z_cjs.c(t,e,s),n=new Map;for(let i of e)n.set(i.node.id,i);let d=[],u=0;for(let i of o){let l=n.get(i.node.id);if(!l)continue;u<i.start&&d.push({text:r.slice(u,i.start),rawStart:u,rawEnd:i.start});let f=a.get(l.node.id);l.kind==="simple"&&f?d.push({text:f.text,rawStart:i.start,rawEnd:i.end,resultRuns:f.runs}):d.push({text:f?.text??chunkT4TKRNZT_cjs.ke,rawStart:i.start,rawEnd:i.end}),u=i.end;}return u<r.length&&d.push({text:r.slice(u),rawStart:u,rawEnd:r.length}),d}function N(t,r,s="allMarkup"){return r.includes(chunkT4TKRNZT_cjs.ke)?g(B(t,r,s)):A(r)}exports.a=g;exports.b=A;exports.c=B;exports.d=N;
1
+ 'use strict';var chunkBME2KUNL_cjs=require('./chunk-BME2KUNL.cjs'),chunkH7XMRUAO_cjs=require('./chunk-H7XMRUAO.cjs'),chunk5MWFZ7F4_cjs=require('./chunk-5MWFZ7F4.cjs');function F(t){let r=[],s=0;for(let e of t){let o=s+e.text.length;e.resultRuns?r.push({text:e.text,rawStart:e.rawStart,rawEnd:e.rawEnd,resultRuns:e.resultRuns,projectedStart:s,projectedEnd:o,expansion:e.text.length!==e.rawEnd-e.rawStart}):r.push({text:e.text,rawStart:e.rawStart,rawEnd:e.rawEnd,projectedStart:s,projectedEnd:o,expansion:e.text.length!==e.rawEnd-e.rawStart}),s=o;}return r}function T(t,r){return r<=t.rawStart?t.projectedStart:r>=t.rawEnd?t.projectedEnd:t.expansion?t.projectedStart:t.projectedStart+r-t.rawStart}function M(t,r){return t.expansion?t.rawStart:t.rawStart+r-t.projectedStart}function V(t,r){return t.expansion?t.rawEnd:t.rawStart+r-t.projectedStart}function g(t){let r=F(t),s="";for(let e of t)s+=e.text;return {text:s,projectedOffset(e){let o=0;for(let a of r){if(e<=a.rawEnd)return T(a,e);o=a.projectedEnd;}return o},rawRange(e,o){if(e<0||e>=o||o>s.length)return null;let a=r.find(d=>e>=d.projectedStart&&e<d.projectedEnd),n=r.find(d=>o>d.projectedStart&&o<=d.projectedEnd);return !a||!n?null:{start:M(a,e),end:V(n,o)}},sliceRaw(e,o){if(e>=o)return "";let a="";for(let n of r){if(n.expansion){e<=n.rawStart&&o>=n.rawEnd&&(a+=n.text);continue}let d=Math.max(e,n.rawStart),u=Math.min(o,n.rawEnd);d<u&&(a+=n.text.slice(d-n.rawStart,u-n.rawStart));}return a},resultRunAddressAt(e){let o=r.find(n=>n.resultRuns!==void 0&&e>=n.projectedStart&&e<n.projectedEnd);if(!o?.resultRuns)return null;let a=e-o.projectedStart;for(let n of o.resultRuns)if(a>=n.start&&a<n.end)return {runId:n.runId,offset:a-n.start};return null},findOccurrences(e,o,a={}){let n=[];if(o<=0||!chunkH7XMRUAO_cjs.Ga(e)||s.length===0)return {matches:n,truncated:false};let d=a.matchCase===true,u=a.wholeWord===true,i=d?e:chunkH7XMRUAO_cjs.Ea(e),l=d?s:chunkH7XMRUAO_cjs.Ea(s),f=Math.min(s.length,a.to??s.length),j=new Set,c=l.indexOf(i,Math.max(0,a.from??0));for(;c>=0;){let p=c+i.length;if(p>f)return {matches:n,truncated:false};if(!u||chunkH7XMRUAO_cjs.Fa(s,c,p)){let m=r.find(x=>c>=x.projectedStart&&c<x.projectedEnd),P=r.find(x=>p>x.projectedStart&&p<=x.projectedEnd);if(!m||!P)return {matches:n,truncated:false};let h=m===P&&m.expansion?m:null;if(!h||!j.has(h)){if(n.length>=o)return {matches:n,truncated:true};n.push({start:c,length:i.length,rawStart:M(m,c),rawEnd:V(P,p)}),h&&j.add(h);}}c=l.indexOf(i,p);}return {matches:n,truncated:false}}}}function A(t){return t.length===0?g([]):g([{text:t,rawStart:0,rawEnd:t.length}])}function B(t,r,s="allMarkup"){if(!r.includes(chunk5MWFZ7F4_cjs.ve))return r.length===0?[]:[{text:r,rawStart:0,rawEnd:r.length}];let e=chunk5MWFZ7F4_cjs.Qe(t),o=chunk5MWFZ7F4_cjs.pf(t,e),a=chunkBME2KUNL_cjs.c(t,e,s),n=new Map;for(let i of e)n.set(i.node.id,i);let d=[],u=0;for(let i of o){let l=n.get(i.node.id);if(!l)continue;u<i.start&&d.push({text:r.slice(u,i.start),rawStart:u,rawEnd:i.start});let f=a.get(l.node.id);l.kind==="simple"&&f?d.push({text:f.text,rawStart:i.start,rawEnd:i.end,resultRuns:f.runs}):d.push({text:f?.text??chunk5MWFZ7F4_cjs.ve,rawStart:i.start,rawEnd:i.end}),u=i.end;}return u<r.length&&d.push({text:r.slice(u),rawStart:u,rawEnd:r.length}),d}function N(t,r,s="allMarkup"){return r.includes(chunk5MWFZ7F4_cjs.ve)?g(B(t,r,s)):A(r)}exports.a=g;exports.b=A;exports.c=B;exports.d=N;
@@ -1 +1 @@
1
- 'use strict';var chunkP4SBMHHO_cjs=require('./chunk-P4SBMHHO.cjs'),chunkT4TKRNZT_cjs=require('./chunk-T4TKRNZT.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=chunkP4SBMHHO_cjs.b(O(e,"asciiTheme"),n)??chunkP4SBMHHO_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=chunkP4SBMHHO_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?chunkP4SBMHHO_cjs.b(o.attributes?.asciiTheme,n)??chunkP4SBMHHO_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!==chunkT4TKRNZT_cjs.fa&&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!==chunkT4TKRNZT_cjs.fa)){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!==chunkT4TKRNZT_cjs.fa)&&!(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===chunkT4TKRNZT_cjs.fa){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===chunkT4TKRNZT_cjs.fa}function U(e,n,t,l,i){e.namespaceUri===chunkT4TKRNZT_cjs.fa&&(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 chunkH7XMRUAO_cjs=require('./chunk-H7XMRUAO.cjs'),chunk5MWFZ7F4_cjs=require('./chunk-5MWFZ7F4.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=chunkH7XMRUAO_cjs.b(O(e,"asciiTheme"),n)??chunkH7XMRUAO_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=chunkH7XMRUAO_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?chunkH7XMRUAO_cjs.b(o.attributes?.asciiTheme,n)??chunkH7XMRUAO_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!==chunk5MWFZ7F4_cjs.fa&&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!==chunk5MWFZ7F4_cjs.fa)){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!==chunk5MWFZ7F4_cjs.fa)&&!(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===chunk5MWFZ7F4_cjs.fa){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===chunk5MWFZ7F4_cjs.fa}function U(e,n,t,l,i){e.namespaceUri===chunk5MWFZ7F4_cjs.fa&&(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;