@novaprose/tinymce-compat 0.7.0 → 0.9.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.
- package/README.md +1 -1
- package/THIRD_PARTY_NOTICES.md +2 -0
- package/dist/ai-XVSDIIQI.js +127 -0
- package/dist/ai-XVSDIIQI.js.map +1 -0
- package/dist/dialog-3UZZZW6Y.js +300 -0
- package/dist/dialog-3UZZZW6Y.js.map +1 -0
- package/dist/index.cjs +1335 -409
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +92 -45
- package/dist/index.d.ts +92 -45
- package/dist/index.js +831 -366
- package/dist/index.js.map +1 -1
- package/dist/novaprose.css +376 -550
- package/dist/tinymce-chunks/a11ychecker-fe78c552.js +2 -0
- package/dist/tinymce-chunks/a11ychecker-fe78c552.js.map +7 -0
- package/dist/tinymce-chunks/accordion-ui-4272c63b.js +2 -0
- package/dist/tinymce-chunks/accordion-ui-4272c63b.js.map +7 -0
- package/dist/tinymce-chunks/advcode-840793ca.js +2 -0
- package/dist/tinymce-chunks/advcode-840793ca.js.map +7 -0
- package/dist/tinymce-chunks/advcode-editor-37bc0a02.js +26 -0
- package/dist/tinymce-chunks/advcode-editor-37bc0a02.js.map +7 -0
- package/dist/tinymce-chunks/advlist-67b98670.js +2 -0
- package/dist/tinymce-chunks/{advlist-7a360f16.js.map → advlist-67b98670.js.map} +2 -2
- package/dist/tinymce-chunks/advtable-ui-db2e667d.js +2 -0
- package/dist/tinymce-chunks/advtable-ui-db2e667d.js.map +7 -0
- package/dist/tinymce-chunks/ai-e0658729.js +6 -0
- package/dist/tinymce-chunks/ai-e0658729.js.map +7 -0
- package/dist/tinymce-chunks/ai2-ddf912a7.js +34 -0
- package/dist/tinymce-chunks/ai2-ddf912a7.js.map +7 -0
- package/dist/tinymce-chunks/anchor-ui-da0966bb.js +2 -0
- package/dist/tinymce-chunks/anchor-ui-da0966bb.js.map +7 -0
- package/dist/tinymce-chunks/autocorrect-907e1296.js +3 -0
- package/dist/tinymce-chunks/autocorrect-907e1296.js.map +7 -0
- package/dist/tinymce-chunks/autolink-897e8650.js +2 -0
- package/dist/tinymce-chunks/{autolink-7e2e7be2.js.map → autolink-897e8650.js.map} +2 -2
- package/dist/tinymce-chunks/autoresize-f8a4a52a.js +2 -0
- package/dist/tinymce-chunks/autoresize-f8a4a52a.js.map +7 -0
- package/dist/tinymce-chunks/autosave-60381295.js +2 -0
- package/dist/tinymce-chunks/autosave-60381295.js.map +7 -0
- package/dist/tinymce-chunks/bash-f3f8783a.js +2 -0
- package/dist/tinymce-chunks/bash-f3f8783a.js.map +7 -0
- package/dist/tinymce-chunks/c-8e3b278b.js +2 -0
- package/dist/tinymce-chunks/c-8e3b278b.js.map +7 -0
- package/dist/tinymce-chunks/casechange-8ad6a2c3.js +6 -0
- package/dist/tinymce-chunks/casechange-8ad6a2c3.js.map +7 -0
- package/dist/tinymce-chunks/charmap-5deb524c.js +2 -0
- package/dist/tinymce-chunks/charmap-5deb524c.js.map +7 -0
- package/dist/tinymce-chunks/checklist-5a0c95d3.js +2 -0
- package/dist/tinymce-chunks/checklist-5a0c95d3.js.map +7 -0
- package/dist/tinymce-chunks/codesample-b91dcd91.js +4 -0
- package/dist/tinymce-chunks/codesample-b91dcd91.js.map +7 -0
- package/dist/tinymce-chunks/comments-panel-152e9cbe.js +2 -0
- package/dist/tinymce-chunks/comments-panel-152e9cbe.js.map +7 -0
- package/dist/tinymce-chunks/core-f5b3fd3e.js +4 -0
- package/dist/tinymce-chunks/core-f5b3fd3e.js.map +7 -0
- package/dist/tinymce-chunks/cpp-525b2c81.js +2 -0
- package/dist/tinymce-chunks/cpp-525b2c81.js.map +7 -0
- package/dist/tinymce-chunks/csharp-b95db858.js +2 -0
- package/dist/tinymce-chunks/csharp-b95db858.js.map +7 -0
- package/dist/tinymce-chunks/css-bb736f0c.js +2 -0
- package/dist/tinymce-chunks/css-bb736f0c.js.map +7 -0
- package/dist/tinymce-chunks/de-21549c7e.js +2 -0
- package/dist/tinymce-chunks/de-21549c7e.js.map +7 -0
- package/dist/tinymce-chunks/dialog-126a0355.js +2 -0
- package/dist/tinymce-chunks/dialog-126a0355.js.map +7 -0
- package/dist/tinymce-chunks/diff-02578ed2.js +2 -0
- package/dist/tinymce-chunks/diff-02578ed2.js.map +7 -0
- package/dist/tinymce-chunks/directionality-185b3810.js +2 -0
- package/dist/tinymce-chunks/{directionality-60dba768.js.map → directionality-185b3810.js.map} +2 -2
- package/dist/tinymce-chunks/dockerfile-ff44475c.js +2 -0
- package/dist/tinymce-chunks/dockerfile-ff44475c.js.map +7 -0
- package/dist/tinymce-chunks/draghandle-a1d99987.js +4 -0
- package/dist/tinymce-chunks/draghandle-a1d99987.js.map +7 -0
- package/dist/tinymce-chunks/editimage-36199bc6.js +2 -0
- package/dist/tinymce-chunks/editimage-36199bc6.js.map +7 -0
- package/dist/tinymce-chunks/email-1926dd8a.js +62 -0
- package/dist/tinymce-chunks/email-1926dd8a.js.map +7 -0
- package/dist/tinymce-chunks/email2-e9c49586.js +2 -0
- package/dist/tinymce-chunks/email2-e9c49586.js.map +7 -0
- package/dist/tinymce-chunks/emoticons-a5ab437d.js +2 -0
- package/dist/tinymce-chunks/emoticons-a5ab437d.js.map +7 -0
- package/dist/tinymce-chunks/es-1de93a3f.js +2 -0
- package/dist/tinymce-chunks/es-1de93a3f.js.map +7 -0
- package/dist/tinymce-chunks/exportpdf-1dfcbddc.js +2 -0
- package/dist/tinymce-chunks/exportpdf-1dfcbddc.js.map +7 -0
- package/dist/tinymce-chunks/exportword-ad95abb4.js +2 -0
- package/dist/tinymce-chunks/exportword-ad95abb4.js.map +7 -0
- package/dist/tinymce-chunks/footnotes-ui-3f167c2c.js +2 -0
- package/dist/tinymce-chunks/footnotes-ui-3f167c2c.js.map +7 -0
- package/dist/tinymce-chunks/form-dialog-9eb62199.js +2 -0
- package/dist/tinymce-chunks/form-dialog-9eb62199.js.map +7 -0
- package/dist/tinymce-chunks/formatpainter-cbeeffa7.js +2 -0
- package/dist/tinymce-chunks/formatpainter-cbeeffa7.js.map +7 -0
- package/dist/tinymce-chunks/fr-6fbcca9f.js +2 -0
- package/dist/tinymce-chunks/fr-6fbcca9f.js.map +7 -0
- package/dist/tinymce-chunks/fullpagehtml-ui-9dd804af.js +2 -0
- package/dist/tinymce-chunks/fullpagehtml-ui-9dd804af.js.map +7 -0
- package/dist/tinymce-chunks/go-14612282.js +2 -0
- package/dist/tinymce-chunks/go-14612282.js.map +7 -0
- package/dist/tinymce-chunks/graphql-032121b4.js +2 -0
- package/dist/tinymce-chunks/graphql-032121b4.js.map +7 -0
- package/dist/tinymce-chunks/history-diff-a0db052c.js +2 -0
- package/dist/tinymce-chunks/history-diff-a0db052c.js.map +7 -0
- package/dist/tinymce-chunks/importcss-28610ab5.js +3 -0
- package/dist/tinymce-chunks/importcss-28610ab5.js.map +7 -0
- package/dist/tinymce-chunks/importword-d6c2636a.js +2 -0
- package/dist/tinymce-chunks/importword-d6c2636a.js.map +7 -0
- package/dist/tinymce-chunks/index-a1feed69.js +5 -0
- package/dist/tinymce-chunks/index-a1feed69.js.map +7 -0
- package/dist/tinymce-chunks/index2-610900bb.js +2 -0
- package/dist/tinymce-chunks/index2-610900bb.js.map +7 -0
- package/dist/tinymce-chunks/insertdatetime-a48ee6e0.js +2 -0
- package/dist/tinymce-chunks/{insertdatetime-e0dbcf63.js.map → insertdatetime-a48ee6e0.js.map} +2 -2
- package/dist/tinymce-chunks/it-ca70815f.js +2 -0
- package/dist/tinymce-chunks/it-ca70815f.js.map +7 -0
- package/dist/tinymce-chunks/java-e051279c.js +2 -0
- package/dist/tinymce-chunks/java-e051279c.js.map +7 -0
- package/dist/tinymce-chunks/javascript-d7a6fb3d.js +2 -0
- package/dist/tinymce-chunks/javascript-d7a6fb3d.js.map +7 -0
- package/dist/tinymce-chunks/json-08c0b631.js +2 -0
- package/dist/tinymce-chunks/json-08c0b631.js.map +7 -0
- package/dist/tinymce-chunks/kotlin-b34d5ff2.js +3 -0
- package/dist/tinymce-chunks/kotlin-b34d5ff2.js.map +7 -0
- package/dist/tinymce-chunks/linkchecker-820845fd.js +2 -0
- package/dist/tinymce-chunks/linkchecker-820845fd.js.map +7 -0
- package/dist/tinymce-chunks/lua-9b0ae20a.js +2 -0
- package/dist/tinymce-chunks/lua-9b0ae20a.js.map +7 -0
- package/dist/tinymce-chunks/markdown-5698ebec.js +34 -0
- package/dist/tinymce-chunks/markdown-5698ebec.js.map +7 -0
- package/dist/tinymce-chunks/markdown2-943bcf90.js +2 -0
- package/dist/tinymce-chunks/markdown2-943bcf90.js.map +7 -0
- package/dist/tinymce-chunks/math-ui-1b57f7eb.js +2 -0
- package/dist/tinymce-chunks/math-ui-1b57f7eb.js.map +7 -0
- package/dist/tinymce-chunks/media-ui-de819f11.js +2 -0
- package/dist/tinymce-chunks/media-ui-de819f11.js.map +7 -0
- package/dist/tinymce-chunks/mediaembed-ui-7be11324.js +2 -0
- package/dist/tinymce-chunks/mediaembed-ui-7be11324.js.map +7 -0
- package/dist/tinymce-chunks/mentions-ui-b1bb2d15.js +2 -0
- package/dist/tinymce-chunks/mentions-ui-b1bb2d15.js.map +7 -0
- package/dist/tinymce-chunks/mergetags-ui-f5bdd1f9.js +2 -0
- package/dist/tinymce-chunks/mergetags-ui-f5bdd1f9.js.map +7 -0
- package/dist/tinymce-chunks/nonbreaking-f15226ad.js +2 -0
- package/dist/tinymce-chunks/{nonbreaking-49bdb0d2.js.map → nonbreaking-f15226ad.js.map} +2 -2
- package/dist/tinymce-chunks/pagebreak-ui-7476f5c2.js +2 -0
- package/dist/tinymce-chunks/pagebreak-ui-7476f5c2.js.map +7 -0
- package/dist/tinymce-chunks/pageembed-ui-da39f1ee.js +2 -0
- package/dist/tinymce-chunks/pageembed-ui-da39f1ee.js.map +7 -0
- package/dist/tinymce-chunks/pagelayout-ui-01757669.js +2 -0
- package/dist/tinymce-chunks/pagelayout-ui-01757669.js.map +7 -0
- package/dist/tinymce-chunks/paste-office-4e8e9cb7.js +3 -0
- package/dist/tinymce-chunks/paste-office-4e8e9cb7.js.map +7 -0
- package/dist/tinymce-chunks/permanentpen-fc96f445.js +2 -0
- package/dist/tinymce-chunks/permanentpen-fc96f445.js.map +7 -0
- package/dist/tinymce-chunks/php-6b723470.js +3 -0
- package/dist/tinymce-chunks/php-6b723470.js.map +7 -0
- package/dist/tinymce-chunks/powershell-e6c3fdb8.js +2 -0
- package/dist/tinymce-chunks/powershell-e6c3fdb8.js.map +7 -0
- package/dist/tinymce-chunks/print-86762549.js +27 -0
- package/dist/tinymce-chunks/print-86762549.js.map +7 -0
- package/dist/tinymce-chunks/pt-BR-f6958ec0.js +2 -0
- package/dist/tinymce-chunks/pt-BR-f6958ec0.js.map +7 -0
- package/dist/tinymce-chunks/python-a20cacce.js +2 -0
- package/dist/tinymce-chunks/python-a20cacce.js.map +7 -0
- package/dist/tinymce-chunks/quickbars-35c87c0e.js +2 -0
- package/dist/tinymce-chunks/{quickbars-d937e10a.js.map → quickbars-35c87c0e.js.map} +3 -3
- package/dist/tinymce-chunks/revisionhistory-741dfb24.js +2 -0
- package/dist/tinymce-chunks/revisionhistory-741dfb24.js.map +7 -0
- package/dist/tinymce-chunks/ru-982f3476.js +2 -0
- package/dist/tinymce-chunks/ru-982f3476.js.map +7 -0
- package/dist/tinymce-chunks/ruby-93c325c7.js +2 -0
- package/dist/tinymce-chunks/ruby-93c325c7.js.map +7 -0
- package/dist/tinymce-chunks/rust-d80fbab5.js +2 -0
- package/dist/tinymce-chunks/rust-d80fbab5.js.map +7 -0
- package/dist/tinymce-chunks/save-a65e56cd.js +2 -0
- package/dist/tinymce-chunks/save-a65e56cd.js.map +7 -0
- package/dist/tinymce-chunks/scss-7cffeb15.js +2 -0
- package/dist/tinymce-chunks/scss-7cffeb15.js.map +7 -0
- package/dist/tinymce-chunks/search-bar-1c8ef2ee.js +3 -0
- package/dist/tinymce-chunks/search-bar-1c8ef2ee.js.map +7 -0
- package/dist/tinymce-chunks/spellchecker-91509fc1.js +6 -0
- package/dist/tinymce-chunks/spellchecker-91509fc1.js.map +7 -0
- package/dist/tinymce-chunks/sql-eeac1a81.js +2 -0
- package/dist/tinymce-chunks/sql-eeac1a81.js.map +7 -0
- package/dist/tinymce-chunks/suggestions-panel-c29362cf.js +2 -0
- package/dist/tinymce-chunks/suggestions-panel-c29362cf.js.map +7 -0
- package/dist/tinymce-chunks/suggestions-ui-c5f6bad4.js +2 -0
- package/dist/tinymce-chunks/suggestions-ui-c5f6bad4.js.map +7 -0
- package/dist/tinymce-chunks/swift-2b081f3e.js +2 -0
- package/dist/tinymce-chunks/swift-2b081f3e.js.map +7 -0
- package/dist/tinymce-chunks/table-4d43f60d.js +2 -0
- package/dist/tinymce-chunks/table-4d43f60d.js.map +7 -0
- package/dist/tinymce-chunks/table-dialogs-0445847c.js +2 -0
- package/dist/tinymce-chunks/table-dialogs-0445847c.js.map +7 -0
- package/dist/tinymce-chunks/tableofcontents-ui-01a9af06.js +2 -0
- package/dist/tinymce-chunks/tableofcontents-ui-01a9af06.js.map +7 -0
- package/dist/tinymce-chunks/temml-d637f801.js +97 -0
- package/dist/tinymce-chunks/temml-d637f801.js.map +7 -0
- package/dist/tinymce-chunks/template-b522c8ed.js +2 -0
- package/dist/tinymce-chunks/template-b522c8ed.js.map +7 -0
- package/dist/tinymce-chunks/typescript-fa085d66.js +2 -0
- package/dist/tinymce-chunks/typescript-fa085d66.js.map +7 -0
- package/dist/tinymce-chunks/typography-469ce11a.js +3 -0
- package/dist/tinymce-chunks/typography-469ce11a.js.map +7 -0
- package/dist/tinymce-chunks/visualblocks-8b7cba25.js +2 -0
- package/dist/tinymce-chunks/{visualblocks-58c88e5d.js.map → visualblocks-8b7cba25.js.map} +2 -2
- package/dist/tinymce-chunks/visualchars-7cda4c00.js +2 -0
- package/dist/tinymce-chunks/visualchars-7cda4c00.js.map +7 -0
- package/dist/tinymce-chunks/xml-77617a8f.js +2 -0
- package/dist/tinymce-chunks/xml-77617a8f.js.map +7 -0
- package/dist/tinymce-chunks/yaml-5bb3ad37.js +2 -0
- package/dist/tinymce-chunks/yaml-5bb3ad37.js.map +7 -0
- package/dist/tinymce.global.js +34 -27
- package/dist/tinymce.global.js.map +4 -4
- package/dist/tinymce.licenses.txt +1094 -0
- package/package.json +2 -2
- package/dist/tinymce-chunks/advlist-7a360f16.js +0 -2
- package/dist/tinymce-chunks/autolink-7e2e7be2.js +0 -2
- package/dist/tinymce-chunks/autoresize-d6c9537b.js +0 -2
- package/dist/tinymce-chunks/autoresize-d6c9537b.js.map +0 -7
- package/dist/tinymce-chunks/autosave-4fd46720.js +0 -2
- package/dist/tinymce-chunks/autosave-4fd46720.js.map +0 -7
- package/dist/tinymce-chunks/charmap-4b14307a.js +0 -2
- package/dist/tinymce-chunks/charmap-4b14307a.js.map +0 -7
- package/dist/tinymce-chunks/comments-panel-37cba890.js +0 -2
- package/dist/tinymce-chunks/comments-panel-37cba890.js.map +0 -7
- package/dist/tinymce-chunks/directionality-60dba768.js +0 -2
- package/dist/tinymce-chunks/emoticons-7e6da0b6.js +0 -2
- package/dist/tinymce-chunks/emoticons-7e6da0b6.js.map +0 -7
- package/dist/tinymce-chunks/form-dialog-9cde0ef7.js +0 -2
- package/dist/tinymce-chunks/form-dialog-9cde0ef7.js.map +0 -7
- package/dist/tinymce-chunks/insertdatetime-e0dbcf63.js +0 -2
- package/dist/tinymce-chunks/nonbreaking-49bdb0d2.js +0 -2
- package/dist/tinymce-chunks/paste-office-a38659d6.js +0 -3
- package/dist/tinymce-chunks/paste-office-a38659d6.js.map +0 -7
- package/dist/tinymce-chunks/quickbars-d937e10a.js +0 -2
- package/dist/tinymce-chunks/revisionhistory-d6306426.js +0 -2
- package/dist/tinymce-chunks/revisionhistory-d6306426.js.map +0 -7
- package/dist/tinymce-chunks/table-80284f6f.js +0 -2
- package/dist/tinymce-chunks/table-80284f6f.js.map +0 -7
- package/dist/tinymce-chunks/visualblocks-58c88e5d.js +0 -2
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
var se=Object.create;var tt=Object.defineProperty;var ie=Object.getOwnPropertyDescriptor;var ae=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,le=Object.prototype.hasOwnProperty;var ce=(a,t,e)=>t in a?tt(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e;var j=(a,t)=>()=>{try{return t||a((t={exports:{}}).exports,t),t.exports}catch(e){throw t=0,e}};var pe=(a,t,e,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of ae(t))!le.call(a,n)&&n!==e&&tt(a,n,{get:()=>t[n],enumerable:!(r=ie(t,n))||r.enumerable});return a};var _=(a,t,e)=>(e=a!=null?se(oe(a)):{},pe(t||!a||!a.__esModule?tt(e,"default",{value:a,enumerable:!0}):e,a));var y=(a,t,e)=>ce(a,typeof t!="symbol"?t+"":t,e);var vt=j(et=>{var bt=globalThis.__novaprose_tinymce["packages/core/src/plugins/index.ts"];Object.defineProperty(et,"__esModule",{value:!0});for(yt in bt)(function(a){Object.defineProperty(et,a,{enumerable:!0,get:function(){return bt[a]}})})(yt);var yt});var Pt=j(rt=>{var $t=globalThis.__novaprose_tinymce["node_modules/.pnpm/prosemirror-model@1.25.13/node_modules/prosemirror-model/dist/index.js"];Object.defineProperty(rt,"__esModule",{value:!0});for(xt in $t)(function(a){Object.defineProperty(rt,a,{enumerable:!0,get:function(){return $t[a]}})})(xt);var xt});var Ct=j(nt=>{var kt=globalThis.__novaprose_tinymce["packages/core/src/document.ts"];Object.defineProperty(nt,"__esModule",{value:!0});for(Et in kt)(function(a){Object.defineProperty(nt,a,{enumerable:!0,get:function(){return kt[a]}})})(Et);var Et});var G=j(st=>{var Mt=globalThis.__novaprose_tinymce["packages/core/src/plugins/pagelayout.ts"];Object.defineProperty(st,"__esModule",{value:!0});for(Nt in Mt)(function(a){Object.defineProperty(st,a,{enumerable:!0,get:function(){return Mt[a]}})})(Nt);var Nt});var Tt=j(it=>{var At=globalThis.__novaprose_tinymce["packages/core/src/plugins/suggestions.ts"];Object.defineProperty(it,"__esModule",{value:!0});for(Ut in At)(function(a){Object.defineProperty(it,a,{enumerable:!0,get:function(){return At[a]}})})(Ut);var Ut});var _t=j(at=>{var Rt=globalThis.__novaprose_tinymce["packages/core/src/language.ts"];Object.defineProperty(at,"__esModule",{value:!0});for(St in Rt)(function(a){Object.defineProperty(at,a,{enumerable:!0,get:function(){return Rt[a]}})})(St);var St});var Dt=j(ot=>{var Ot=globalThis.__novaprose_tinymce["packages/core/src/url.ts"];Object.defineProperty(ot,"__esModule",{value:!0});for(It in Ot)(function(a){Object.defineProperty(ot,a,{enumerable:!0,get:function(){return Ot[a]}})})(It);var It});var er=_(vt(),1),te=_(Pt(),1),ee=_(Ct(),1),gt=_(G(),1);var Gt=_(G()),Z=_(Tt()),qt=_(_t()),ft=_(Dt());var ue={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};function lt(a){return a.replace(/&(#x[0-9a-f]+|#\d+|[a-z]+);/gi,(t,e)=>{if(e[0]==="#"){let r=e[1]==="x"||e[1]==="X"?parseInt(e.slice(2),16):parseInt(e.slice(1),10);return Number.isFinite(r)&&r>0&&r<=1114111?String.fromCodePoint(r):t}return ue[e.toLowerCase()]??t})}function fe(a){return a<32&&a!==9&&a!==10&&a!==13||a>65533}function N(a){let t="";for(let e=0;e<a.length;e++)fe(a.charCodeAt(e))||(t+=a[e]);return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}var me=/([^\s=/]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;function Xt(a){let t=a.charCodeAt(0)===65279?a.slice(1):a,e={name:"#document",attrs:{},children:[]},r=[e],n=0;for(;n<t.length;){let s=t.indexOf("<",n),i=r[r.length-1];if(s<0){n<t.length&&i.children.push(lt(t.slice(n)));break}if(s>n&&i.children.push(lt(t.slice(n,s))),t.startsWith("<!--",s)){let o=t.indexOf("-->",s+4);n=o<0?t.length:o+3}else if(t.startsWith("<![CDATA[",s)){let o=t.indexOf("]]>",s+9);i.children.push(t.slice(s+9,o<0?t.length:o)),n=o<0?t.length:o+3}else if(t.startsWith("<?",s)||t.startsWith("<!",s)){let o=t.indexOf(">",s);n=o<0?t.length:o+1}else if(t[s+1]==="/"){let o=t.indexOf(">",s),l=t.slice(s+2,o<0?t.length:o).trim(),c=r.map(p=>p.name).lastIndexOf(l);c>0&&(r.length=c),n=o<0?t.length:o+1}else{let o=s+1,l="";for(;o<t.length;o++){let g=t[o];if(l)g===l&&(l="");else if(g==='"'||g==="'")l=g;else if(g===">")break}let c=t.slice(s+1,o),p=c.endsWith("/");p&&(c=c.slice(0,-1));let u=c.search(/[\s]/),m=u<0?c:c.slice(0,u),f={};if(u>=0)for(let g of c.slice(u).matchAll(me))f[g[1]]=lt(g[2]??g[3]??"");let w={name:m,attrs:f,children:[]};i.children.push(w),p||r.push(w),n=o+1}}return e}function E(a,t){return a?a.children.filter(e=>typeof e!="string"&&(!t||e.name===t)):[]}function d(a,t){return a?.children.find(e=>typeof e!="string"&&e.name===t)}function L(a,...t){let e=a;for(let r of t)e=d(e,r);return e}function F(a){return typeof a=="string"?a:a.children.map(F).join("")}var de=new TextEncoder,q=null;function we(a){if(!q){q=new Uint32Array(256);for(let e=0;e<256;e++){let r=e;for(let n=0;n<8;n++)r=r&1?3988292384^r>>>1:r>>>1;q[e]=r>>>0}}let t=4294967295;for(let e of a)t=q[(t^e)&255]^t>>>8;return(t^4294967295)>>>0}async function jt(a,t){let r=new ReadableStream({start(l){l.enqueue(a),l.close()}}).pipeThrough(t).getReader(),n=[],s=0;for(;;){let{done:l,value:c}=await r.read();if(l)break;n.push(c),s+=c.length}let i=new Uint8Array(s),o=0;for(let l of n)i.set(l,o),o+=l.length;return i}var ge=()=>typeof CompressionStream<"u";async function Lt(a){let t=[],e=[],r=0;for(let c of a){let p=de.encode(c.name),u=we(c.data),m=ge()&&c.data.length>64,f=m?await jt(c.data,new CompressionStream("deflate-raw")):c.data,w=m?8:0,g=new DataView(new ArrayBuffer(30));g.setUint32(0,67324752,!0),g.setUint16(4,20,!0),g.setUint16(6,2048,!0),g.setUint16(8,w,!0),g.setUint16(10,0,!0),g.setUint16(12,33,!0),g.setUint32(14,u,!0),g.setUint32(18,f.length,!0),g.setUint32(22,c.data.length,!0),g.setUint16(26,p.length,!0),g.setUint16(28,0,!0),t.push(new Uint8Array(g.buffer),p,f);let h=new DataView(new ArrayBuffer(46));h.setUint32(0,33639248,!0),h.setUint16(4,20,!0),h.setUint16(6,20,!0),h.setUint16(8,2048,!0),h.setUint16(10,w,!0),h.setUint16(12,0,!0),h.setUint16(14,33,!0),h.setUint32(16,u,!0),h.setUint32(20,f.length,!0),h.setUint32(24,c.data.length,!0),h.setUint16(28,p.length,!0),h.setUint32(42,r,!0),e.push(new Uint8Array(h.buffer),p),r+=30+p.length+f.length}let n=e.reduce((c,p)=>c+p.length,0),s=new DataView(new ArrayBuffer(22));s.setUint32(0,101010256,!0),s.setUint16(8,a.length,!0),s.setUint16(10,a.length,!0),s.setUint32(12,n,!0),s.setUint32(16,r,!0);let i=[...t,...e,new Uint8Array(s.buffer)],o=new Uint8Array(i.reduce((c,p)=>c+p.length,0)),l=0;for(let c of i)o.set(c,l),l+=c.length;return o}async function Ft(a){let t=new DataView(a.buffer,a.byteOffset,a.byteLength),e=-1;for(let o=a.length-22;o>=Math.max(0,a.length-22-65535);o--)if(t.getUint32(o,!0)===101010256){e=o;break}if(e<0)throw new Error("Not a ZIP file");let r=t.getUint16(e+10,!0),n=t.getUint32(e+16,!0),s=new TextDecoder,i=new Map;for(let o=0;o<r;o++){if(t.getUint32(n,!0)!==33639248)throw new Error("Damaged ZIP file");let l=t.getUint16(n+8,!0),c=t.getUint16(n+10,!0),p=t.getUint32(n+20,!0),u=t.getUint16(n+28,!0),m=t.getUint16(n+30,!0),f=t.getUint16(n+32,!0),w=t.getUint32(n+42,!0),g=s.decode(a.subarray(n+46,n+46+u));if(n+=46+u+m+f,l&1)throw new Error("Encrypted documents are not supported");let h=w+30+t.getUint16(w+26,!0)+t.getUint16(w+28,!0),v=a.subarray(h,h+p);if(c===0)i.set(g,v);else if(c===8){if(typeof DecompressionStream>"u")throw new Error("This browser cannot unpack compressed files");i.set(g,await jt(v,new DecompressionStream("deflate-raw")))}else throw new Error(`Unsupported compression in ${g}`)}return i}var A={w:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",r:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",wp:"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing",a:"http://schemas.openxmlformats.org/drawingml/2006/main",pic:"http://schemas.openxmlformats.org/drawingml/2006/picture",rel:"http://schemas.openxmlformats.org/officeDocument/2006/relationships"},O=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
+
`,he=1440/25.4,zt=9525,be=600,X=a=>Math.round(a*he);function ye(a){return a[0]===137&&a[1]===80&&a[2]===78&&a[3]===71?"png":a[0]===255&&a[1]===216&&a[2]===255?"jpeg":a[0]===71&&a[1]===73&&a[2]===70?"gif":null}function ve(a,t){let e=new DataView(a.buffer,a.byteOffset,a.byteLength);try{if(t==="png")return{width:e.getUint32(16),height:e.getUint32(20)};if(t==="gif")return{width:e.getUint16(6,!0),height:e.getUint16(8,!0)};for(let r=2;r+9<a.length&&a[r]===255;){let n=a[r+1],s=e.getUint16(r+2);if(n>=192&&n<=207&&![196,200,204].includes(n))return{height:e.getUint16(r+5),width:e.getUint16(r+7)};r+=2+s}}catch{}return{}}function $e(a){let t=atob(a.replace(/\s+/g,"")),e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}async function xe(a){let t,e=/^data:[^,;]*(;base64)?,([\s\S]*)$/i.exec(a);if(e)t=e[1]?$e(e[2]):new TextEncoder().encode(decodeURIComponent(e[2]));else if(typeof fetch=="function"&&!/^(javascript|vbscript):/i.test(a)){let n=await fetch(a);if(!n.ok)return null;t=new Uint8Array(await n.arrayBuffer())}else return null;let r=ye(t);return r?{data:t,type:r,...ve(t,r)}:null}var Pe={black:"000000",white:"FFFFFF",red:"FF0000",green:"008000",blue:"0000FF",yellow:"FFFF00",orange:"FFA500",purple:"800080",gray:"808080",grey:"808080"};function ct(a){if(typeof a!="string")return null;let t=a.trim().toLowerCase(),e=/^#([0-9a-f]{3,8})$/.exec(t)?.[1];if(e)return e.length===3||e.length===4?[...e.slice(0,3)].map(n=>n+n).join("").toUpperCase():e.length===6||e.length===8?e.slice(0,6).toUpperCase():null;let r=/^rgba?\(([^)]+)\)$/.exec(t)?.[1];if(r){let n=r.split(/[\s,/]+/).filter(Boolean);if(n.length>=4&&Number(n[3])===0)return null;let s=n.slice(0,3).map(i=>i.endsWith("%")?parseFloat(i)*255/100:parseFloat(i));return s.length<3||s.some(i=>!Number.isFinite(i))?null:s.map(i=>Math.round(Math.min(255,Math.max(0,i))).toString(16).padStart(2,"0")).join("").toUpperCase()}return Pe[t]??null}var ke={serif:"Times New Roman","sans-serif":"Arial",monospace:"Consolas","system-ui":"Calibri",cursive:"Comic Sans MS"};function Ee(a){if(typeof a!="string")return null;let t=a.split(",")[0].trim().replace(/^['"]|['"]$/g,"");return t?ke[t.toLowerCase()]??t.slice(0,64):null}function Bt(a){let t=typeof a=="string"?/^(\d+(?:\.\d+)?)(px|pt)$/.exec(a.trim()):null;if(!t)return null;let e=t[2]==="px"?Number(t[1])*.75:Number(t[1]);return e>0&&e<1e3?Math.round(e*2):null}function pt(a){let t=a.replace(/[^\p{L}\p{N}_]/gu,"_");return(/^\p{L}/u.test(t)?t:`b_${t}`).slice(0,40)}function Ht(a){let t=Number(a);return new Date(Number.isFinite(t)&&t>0?t:0).toISOString().replace(/\.\d+Z$/,"Z")}var Wt={font:"Cambria Math",italic:!0};function ut(a){let t=(0,Z.blockSuggestion)(a.attrs.suggestion);return t?.change!=="insert"&&t?.change!=="delete"?null:{tag:t.change==="insert"?"w:ins":"w:del",author:(t.name||t.author||"NovaProse").slice(0,80),time:t.time}}var Ce=["\u2022","\u25E6","\u25AA"],Me=["decimal","lowerLetter","lowerRoman"],Ne={decimal:"decimal","lower-alpha":"lowerLetter","lower-latin":"lowerLetter","upper-alpha":"upperLetter","upper-latin":"upperLetter","lower-roman":"lowerRoman","upper-roman":"upperRoman","lower-greek":"lowerLetter"},Ae={disc:"\u2022",circle:"\u25E6",square:"\u25AA"},mt=class{constructor(t,e){y(this,"layout",t);y(this,"images",e);y(this,"rels",[]);y(this,"relCount",2);y(this,"media",[]);y(this,"imageRels",new Map);y(this,"abstracts",new Map);y(this,"abstractXml",[]);y(this,"numXml",[]);y(this,"numCount",0);y(this,"drawingCount",0);y(this,"bookmarkCount",0);y(this,"changeCount",0);y(this,"textWidthPx");y(this,"bands",[]);this.textWidthPx=(t.width-t.margins.left-t.margins.right)*96/25.4}rel(t,e,r=!1){let n=`rId${++this.relCount}`;return this.rels.push(`<Relationship Id="${n}" Type="${A.rel}/${t}" Target="${N(e)}"${r?' TargetMode="External"':""}/>`),n}runProps(t,e,r={}){let n=this.props(t,e,r),s=t.find(c=>c.type.name==="suggestion_format");if(!s)return n?`<w:rPr>${n}</w:rPr>`:"";let i=this.props((0,Z.formatMarks)(s.type.schema,s.attrs.before),e,r),o=String(s.attrs.name||s.attrs.author||"NovaProse").slice(0,80),l=`<w:rPrChange w:id="${++this.changeCount}" w:author="${N(o)}" w:date="${Ht(s.attrs.time)}"><w:rPr>${i}</w:rPr></w:rPrChange>`;return`<w:rPr>${n}${l}</w:rPr>`}props(t,e,r={}){let n=r.style??"",s=r.font??"",i=!!e.bold,o=!!r.italic,l=!1,c="",p="",u=!1,m="",f="",w="";for(let h of t){let v=h.type.name;if(v==="link")n="Hyperlink";else if(v==="bold")i=!0;else if(v==="italic")o=!0;else if(v==="underline")u=!0;else if(v==="strike")l=!0;else if(v==="subscript")f="subscript";else if(v==="superscript")f="superscript";else if(v==="language")w=(0,qt.languageTag)(h.attrs.lang)??w;else if(v==="code")s="Consolas",m||(m="F3F4F6");else if(v==="color")c=ct(h.attrs.value)??c;else if(v==="background")m=ct(h.attrs.value)??m;else if(v==="font_family")s=Ee(h.attrs.value)??s;else if(v==="font_size"){let b=Bt(h.attrs.value);b&&(p=`<w:sz w:val="${b}"/><w:szCs w:val="${b}"/>`)}}return(n?`<w:rStyle w:val="${n}"/>`:"")+(s?`<w:rFonts w:ascii="${N(s)}" w:hAnsi="${N(s)}" w:cs="${N(s)}" w:eastAsia="${N(s)}"/>`:"")+(i?"<w:b/><w:bCs/>":"")+(o?"<w:i/><w:iCs/>":"")+(l?"<w:strike/>":"")+(c?`<w:color w:val="${c}"/>`:"")+p+(u?'<w:u w:val="single"/>':"")+(m?`<w:shd w:val="clear" w:color="auto" w:fill="${m}"/>`:"")+(f?`<w:vertAlign w:val="${f}"/>`:"")+(w?`<w:lang w:val="${w}"/>`:"")}text(t,e="w:t"){let r="";return t.split(`
|
|
3
|
+
`).forEach((n,s)=>{s&&(r+="<w:br/>"),n.split(" ").forEach((i,o)=>{o&&(r+="<w:tab/>"),i&&(r+=`<${e} xml:space="preserve">${N(i)}</${e}>`)})}),r}run(t,e,r,n={}){let s=this.revisionOf(e,r)?.tag==="w:del",i=`<w:r>${this.runProps(e,r,n)}${this.text(t,s?"w:delText":"w:t")}</w:r>`;return this.tracked(i,e,r)}revisionOf(t,e){if(e?.change?.tag==="w:del")return e.change;let r=t.find(n=>n.type.name==="suggestion_insert"||n.type.name==="suggestion_delete");return r?{tag:r.type.name==="suggestion_insert"?"w:ins":"w:del",author:String(r.attrs.name||r.attrs.author||"NovaProse").slice(0,80),time:r.attrs.time}:e?.change??null}revisionAttrs(t){return`w:id="${++this.changeCount}" w:author="${N(t.author)}" w:date="${Ht(t.time)}"`}tracked(t,e,r){let n=this.revisionOf(e,r);return n?`<${n.tag} ${this.revisionAttrs(n)}>${t}</${n.tag}>`:t}bookmark(t,e=""){if(typeof t!="string"||!t)return e;let r=++this.bookmarkCount;return`<w:bookmarkStart w:id="${r}" w:name="${N(pt(t))}"/>${e}<w:bookmarkEnd w:id="${r}"/>`}drawing(t,e,r,n){let s=typeof t=="string"?this.images.get(t):null,i=typeof e=="string"?e:"";if(!s||typeof t!="string")return i?this.text(`[${i}]`):"";let o=this.imageRels.get(t);if(!o){let w=`image${this.media.length+1}.${s.type}`;this.media.push({name:`word/media/${w}`,data:s.data}),o=this.rel("image",`media/${w}`),this.imageRels.set(t,o)}let l=Number(r)||s.width||300,c=s.width&&s.height?s.height/s.width:.75,p=Number(n)||l*c;l>this.textWidthPx&&(p*=this.textWidthPx/l,l=this.textWidthPx);let u=Math.round(l*zt),m=Math.round(p*zt),f=++this.drawingCount;return`<w:drawing><wp:inline distT="0" distB="0" distL="0" distR="0"><wp:extent cx="${u}" cy="${m}"/><wp:docPr id="${f}" name="Picture ${f}" descr="${N(i)}"/><wp:cNvGraphicFramePr><a:graphicFrameLocks noChangeAspect="1"/></wp:cNvGraphicFramePr><a:graphic><a:graphicData uri="${A.pic}"><pic:pic><pic:nvPicPr><pic:cNvPr id="${f}" name="Picture ${f}"/><pic:cNvPicPr/></pic:nvPicPr><pic:blipFill><a:blip r:embed="${o}"/><a:stretch><a:fillRect/></a:stretch></pic:blipFill><pic:spPr><a:xfrm><a:off x="0" y="0"/><a:ext cx="${u}" cy="${m}"/></a:xfrm><a:prstGeom prst="rect"><a:avLst/></a:prstGeom></pic:spPr></pic:pic></a:graphicData></a:graphic></wp:inline></w:drawing>`}inlineNode(t,e){let r=t.type.name;if(t.isText)return this.run(t.text??"",t.marks,e);if(r==="hard_break")return this.tracked("<w:r><w:br/></w:r>",t.marks,e);if(r==="image")return this.tracked(`<w:r>${this.drawing(t.attrs.src,t.attrs.alt,t.attrs.width,t.attrs.height)}</w:r>`,t.marks,e);if(r==="anchor")return this.bookmark(t.attrs.id);if(r==="math_inline")return this.run(String(t.attrs.latex??""),t.marks,e,Wt);if(r==="mergetag")return this.run(String(t.attrs.label||`{{${String(t.attrs.key??"")}}}`),t.marks,e);let n=t.type.spec.leafText?.(t)??t.textContent;return n?this.run(n,t.marks,e):""}inline(t,e){let r="",n=null;return t.forEach(s=>{let i=s.marks.find(l=>l.type.name==="link"),o=i&&(0,ft.isSafeLinkUrl)(i.attrs.href)?String(i.attrs.href):null;o!==n&&(n!==null&&(r+="</w:hyperlink>"),o!==null&&(r+=o.startsWith("#")?`<w:hyperlink w:anchor="${N(pt(o.slice(1)))}">`:`<w:hyperlink r:id="${this.rel("hyperlink",o,!0)}">`),n=o),r+=this.inlineNode(s,e)}),n!==null&&(r+="</w:hyperlink>"),r}paragraph(t,e,r={}){let n=t?.attrs??{},s=n.dir==="rtl",i=r.style??e.style,o=r.jc??(typeof n.align=="string"?n.align:""),l=o==="justify"?"both":o==="center"||o==="right"||o==="left"?o:"",c=Number(n.indent)||0,p=r.indent??(e.continuation??0)+Math.max(0,c)*be,u="",m=typeof n.lineHeight=="string"?n.lineHeight:"";if(/^\d+(\.\d+)?$/.test(m))u=`<w:spacing w:line="${Math.round(Number(m)*240)}" w:lineRule="auto"/>`;else{let g=Bt(m);g&&(u=`<w:spacing w:line="${g*10}" w:lineRule="exact"/>`)}let f=(i?`<w:pStyle w:val="${i}"/>`:"")+(r.numPr??"")+(r.border??"")+(s?"<w:bidi/>":"")+u+(p&&!r.numPr?`<w:ind w:${s?"right":"left"}="${p}"/>`:"")+(l?`<w:jc w:val="${l}"/>`:"")+(e.change?`<w:rPr><${e.change.tag} ${this.revisionAttrs(e.change)}/></w:rPr>`:""),w=r.content??(t?this.inline(t,e):"");return`<w:p>${f?`<w:pPr>${f}</w:pPr>`:""}${r.prefix??""}${w}</w:p>`}numbering(t,e,r){let n=`${t?"o":"b"}:${typeof e=="string"?e:""}`,s=this.abstracts.get(n);if(s===void 0){s=this.abstracts.size,this.abstracts.set(n,s);let l=typeof e=="string"?t?Ne[e]:Ae[e]:void 0,c=Array.from({length:9},(p,u)=>{let m=`<w:pPr><w:ind w:left="${720*(u+1)}" w:hanging="360"/></w:pPr>`;if(t){let w=u===0&&l||Me[u%3];return`<w:lvl w:ilvl="${u}"><w:start w:val="1"/><w:numFmt w:val="${w}"/><w:lvlText w:val="%${u+1}."/><w:lvlJc w:val="left"/>${m}</w:lvl>`}let f=u===0&&l||Ce[u%3];return`<w:lvl w:ilvl="${u}"><w:start w:val="1"/><w:numFmt w:val="bullet"/><w:lvlText w:val="${f}"/><w:lvlJc w:val="left"/>${m}</w:lvl>`});this.abstractXml.push(`<w:abstractNum w:abstractNumId="${s}"><w:multiLevelType w:val="hybridMultilevel"/>${c.join("")}</w:abstractNum>`)}let i=++this.numCount,o=t?`<w:lvlOverride w:ilvl="0"><w:startOverride w:val="${Math.max(0,r)}"/></w:lvlOverride>`:"";return this.numXml.push(`<w:num w:numId="${i}"><w:abstractNumId w:val="${s}"/>${o}</w:num>`),i}list(t,e){let r=t.type.name==="ordered_list",n=t.attrs.checklist===!0,s=Math.min(8,e.listLevel+1),i=n?0:this.numbering(r,t.attrs.listStyle,Number(t.attrs.start)||1),o={...e,listLevel:s,continuation:720*(s+1)},l="";return t.forEach(c=>{let p=!0;c.forEach(u=>{let m=u.type.name;p&&u.isTextblock?(p=!1,l+=this.paragraph(u,o,{numPr:i?`<w:numPr><w:ilvl w:val="${s}"/><w:numId w:val="${i}"/></w:numPr>`:void 0,prefix:n?this.run(c.attrs.checked?"\u2612 ":"\u2610 ",[],o):""})):m==="bullet_list"||m==="ordered_list"?l+=this.list(u,{...e,listLevel:s}):(p=!1,l+=this.block(u,o))})}),l}table(t,e){let r=[];t.forEach(b=>r.push(b));let n=new Map,s=new Map,i=0;if(r.forEach((b,x)=>{let $=0;b.forEach(M=>{for(;n.has(`${x}:${$}`);)$++;let T={row:x,col:$,colspan:Math.max(1,Number(M.attrs.colspan)||1),rowspan:Math.max(1,Math.min(r.length-x,Number(M.attrs.rowspan)||1)),cell:M};s.set(`${x}:${$}`,T);for(let S=0;S<T.rowspan;S++)for(let k=0;k<T.colspan;k++)n.set(`${x+S}:${$+k}`,T);$+=T.colspan,i=Math.max(i,$)})}),!i)return"";let o=Array.from({length:i},()=>null);for(let b of s.values()){let x=b.cell.attrs.colwidth;Array.isArray(x)&&x.forEach(($,M)=>{typeof $=="number"&&$>0&&o[b.col+M]==null&&(o[b.col+M]=$)})}let l=o.reduce((b,x)=>b+(x??0),0),c=o.filter(b=>b==null).length,p=c?Math.max(40,(this.textWidthPx-l)/c):0,u=o.map(b=>Math.round((b??p)*15)),m=t.attrs.align==="center"||t.attrs.align==="right"?t.attrs.align:"",f=b=>`<w:${b} w:val="single" w:sz="4" w:space="0" w:color="auto"/>`,w=`<w:tblPr><w:tblW w:w="${u.reduce((b,x)=>b+x,0)}" w:type="dxa"/>`+(m?`<w:jc w:val="${m}"/>`:"")+`<w:tblBorders>${["top","left","bottom","right","insideH","insideV"].map(f).join("")}</w:tblBorders><w:tblLayout w:type="fixed"/><w:tblCellMar><w:left w:w="108" w:type="dxa"/><w:right w:w="108" w:type="dxa"/></w:tblCellMar></w:tblPr>`,g=`<w:tblGrid>${u.map(b=>`<w:gridCol w:w="${b}"/>`).join("")}</w:tblGrid>`,h=(b,x)=>u.slice(b,b+x).reduce(($,M)=>$+M,0),v="";return r.forEach((b,x)=>{let $=ut(b)??e.change??null,M=$?{...e,change:$}:e,T=b.childCount>0;b.forEach(R=>{R.type.name!=="table_header"&&(T=!1)});let S="";for(let R=0;R<i;){let U=n.get(`${x}:${R}`);if(!U){S+=`<w:tc><w:tcPr><w:tcW w:w="${u[R]}" w:type="dxa"/></w:tcPr><w:p/></w:tc>`,R++;continue}let I=`<w:tcW w:w="${h(U.col,U.colspan)}" w:type="dxa"/>`,B=U.colspan>1?`<w:gridSpan w:val="${U.colspan}"/>`:"";if(U.row!==x)S+=`<w:tc><w:tcPr>${I}${B}<w:vMerge/></w:tcPr><w:p/></w:tc>`;else{let{cell:D}=U,H=ut(D),re=H?{...M,change:H}:M,ht=ct(D.attrs.background),W=D.attrs.valign==="middle"?"center":D.attrs.valign,ne=I+B+(U.rowspan>1?'<w:vMerge w:val="restart"/>':"")+(ht?`<w:shd w:val="clear" w:color="auto" w:fill="${ht}"/>`:"")+(W==="top"||W==="center"||W==="bottom"?`<w:vAlign w:val="${W}"/>`:"")+(H?`<w:${H.tag==="w:ins"?"cellIns":"cellDel"} ${this.revisionAttrs(H)}/>`:""),Q=this.blocks(D,{...re,listLevel:-1,continuation:void 0,style:void 0,bold:e.bold||D.type.name==="table_header"});Q.endsWith("</w:p>")||(Q+="<w:p/>"),S+=`<w:tc><w:tcPr>${ne}</w:tcPr>${Q}</w:tc>`}R+=U.colspan}let k=(T?"<w:tblHeader/>":"")+($?`<${$.tag} ${this.revisionAttrs($)}/>`:"");v+=`<w:tr>${k?`<w:trPr>${k}</w:trPr>`:""}${S}</w:tr>`}),`<w:tbl>${w}${g}${v}</w:tbl>`}blocks(t,e){let r="";return t.forEach(n=>r+=this.block(n,e)),r}block(t,e){let r=t.type.name,n=ut(t),s=n?{...e,change:n}:e;switch(r){case"paragraph":return this.paragraph(t,s);case"heading":{let i=Math.min(6,Math.max(1,Number(t.attrs.level)||1));return this.paragraph(t,s,{style:`Heading${i}`,content:this.bookmark(t.attrs.id,this.inline(t,s))})}case"blockquote":return this.blocks(t,{...s,style:"Quote"});case"code_block":return this.paragraph(null,s,{style:"Code",content:this.run(t.textContent,[],{...s,bold:!1})});case"bullet_list":case"ordered_list":return this.list(t,s);case"table":return this.table(t,s);case"horizontal_rule":return this.paragraph(null,s,{border:'<w:pBdr><w:bottom w:val="single" w:sz="6" w:space="1" w:color="auto"/></w:pBdr>',content:""});case"pagebreak":return'<w:p><w:r><w:br w:type="page"/></w:r></w:p>';case"figure":{let i="",o="";t.forEach(c=>{c.type.name==="figure_image"?i=this.drawing(c.attrs.src,c.attrs.alt,c.attrs.width,c.attrs.height):c.type.name==="figcaption"&&(o=this.paragraph(c,s,{style:"Caption"}))});let l=t.attrs.align==="center"||t.attrs.align==="right"?t.attrs.align:"";return this.paragraph(null,s,{jc:l,content:i?this.tracked(`<w:r>${i}</w:r>`,[],s):""})+o}case"math_block":return this.paragraph(null,s,{jc:"center",content:this.run(String(t.attrs.latex??""),[],s,Wt)});case"details":return this.blocks(t,s);case"details_summary":return this.paragraph(t,{...s,bold:!0});case"toc":{let i=Array.isArray(t.attrs.entries)?t.attrs.entries:[];return(typeof t.attrs.title=="string"&&t.attrs.title?this.paragraph(null,s,{content:this.run(t.attrs.title,[],{...s,bold:!0})}):"")+i.filter(l=>!!l&&typeof l.id=="string").map(l=>this.paragraph(null,s,{indent:Math.max(0,(Number(l.level)||1)-1)*360,content:`<w:hyperlink w:anchor="${N(pt(l.id))}">${this.run(String(l.text??""),[],s,{style:"Hyperlink"})}</w:hyperlink>`})).join("")}case"media":case"pageembed":case"link_card":{let i=String(t.attrs.src??t.attrs.href??"");return(0,ft.isSafeLinkUrl)(i)?this.paragraph(null,s,{content:`<w:hyperlink r:id="${this.rel("hyperlink",i,!0)}">${this.run(String(t.attrs.title||i),[],s)}</w:hyperlink>`}):""}default:return t.isTextblock?this.paragraph(t,s):t.isBlock&&t.childCount?this.blocks(t,s):""}}bandXml(t,e){let{layout:r}=this,n=X(r.width-r.margins.left-r.margins.right),s='<w:rPr><w:color w:val="595959"/><w:sz w:val="18"/><w:szCs w:val="18"/></w:rPr>',i=c=>`<w:fldSimple w:instr=" ${c} "><w:r>${s}<w:t>1</w:t></w:r></w:fldSimple>`,o=c=>c.split(/(\{pages?\})/).filter(p=>p!=="").map(p=>p==="{page}"?i("PAGE"):p==="{pages}"?i("NUMPAGES"):`<w:r>${s}<w:t xml:space="preserve">${N(p)}</w:t></w:r>`).join(""),l=`<w:r>${s}<w:tab/></w:r>`;return`${O}<w:${t} xmlns:w="${A.w}" xmlns:r="${A.r}"><w:p><w:pPr><w:tabs><w:tab w:val="center" w:pos="${Math.round(n/2)}"/><w:tab w:val="right" w:pos="${n}"/></w:tabs><w:spacing w:before="0" w:after="0"/></w:pPr>${o(e.left)}${l}${o(e.center)}${l}${o(e.right)}</w:p></w:${t}>`}bandReference(t,e){if(!e)return"";let r=`${t}1.xml`,n=this.rel(t,r);return this.bands.push({name:`word/${r}`,xml:this.bandXml(t==="header"?"hdr":"ftr",e),contentType:`application/vnd.openxmlformats-officedocument.wordprocessingml.${t}+xml`}),`<w:${t}Reference w:type="default" r:id="${n}"/>`}bandFiles(){let t=e=>new TextEncoder().encode(e);return{entries:this.bands.map(e=>({name:e.name,data:t(e.xml)})),overrides:this.bands.map(e=>`<Override PartName="/${e.name}" ContentType="${e.contentType}"/>`).join("")}}document(t){let e=this.blocks(t,{listLevel:-1});e.endsWith("</w:p>")||(e+="<w:p/>");let{layout:r}=this,n=r.margins,s=r.width>r.height?' w:orient="landscape"':"",i=this.bandReference("header",r.header)+this.bandReference("footer",r.footer),o=p=>X(Math.min(12.5,Math.max(3,p/2))),l=i&&r.differentFirstPage?"<w:titlePg/>":"",c=`<w:sectPr>${i}<w:pgSz w:w="${X(r.width)}" w:h="${X(r.height)}"${s}/><w:pgMar w:top="${X(n.top)}" w:right="${X(n.right)}" w:bottom="${X(n.bottom)}" w:left="${X(n.left)}" w:header="${o(n.top)}" w:footer="${o(n.bottom)}" w:gutter="0"/>${l}</w:sectPr>`;return O+`<w:document xmlns:w="${A.w}" xmlns:r="${A.r}" xmlns:wp="${A.wp}" xmlns:a="${A.a}" xmlns:pic="${A.pic}"><w:body>${e}${c}</w:body></w:document>`}numberingXml(){return`${O}<w:numbering xmlns:w="${A.w}">${this.abstractXml.join("")}${this.numXml.join("")}</w:numbering>`}relsXml(){return`${O}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${A.rel}/styles" Target="styles.xml"/><Relationship Id="rId2" Type="${A.rel}/numbering" Target="numbering.xml"/>${this.rels.join("")}</Relationships>`}mediaFiles(){return this.media}};function Ue(a,t){let e=N(a),r=Math.round(t*2),n=(i,o)=>`<w:style w:type="paragraph" w:styleId="Heading${i}"><w:name w:val="heading ${i}"/><w:basedOn w:val="Normal"/><w:next w:val="Normal"/><w:uiPriority w:val="9"/><w:qFormat/><w:pPr><w:keepNext/><w:spacing w:before="${Math.round(o*20*1.2)}" w:after="${Math.round(o*10)}"/><w:outlineLvl w:val="${i-1}"/></w:pPr><w:rPr><w:b/><w:bCs/><w:sz w:val="${Math.round(o*2)}"/><w:szCs w:val="${Math.round(o*2)}"/></w:rPr></w:style>`,s=[2,1.5,1.25,1,.875,.85];return`${O}<w:styles xmlns:w="${A.w}"><w:docDefaults><w:rPrDefault><w:rPr><w:rFonts w:ascii="${e}" w:hAnsi="${e}" w:cs="${e}" w:eastAsia="${e}"/><w:sz w:val="${r}"/><w:szCs w:val="${r}"/></w:rPr></w:rPrDefault><w:pPrDefault><w:pPr><w:spacing w:after="${Math.round(t*20*.75)}" w:line="384" w:lineRule="auto"/></w:pPr></w:pPrDefault></w:docDefaults><w:style w:type="paragraph" w:default="1" w:styleId="Normal"><w:name w:val="Normal"/><w:qFormat/></w:style>`+s.map((i,o)=>n(o+1,t*i)).join("")+`<w:style w:type="paragraph" w:styleId="Quote"><w:name w:val="Quote"/><w:basedOn w:val="Normal"/><w:qFormat/><w:pPr><w:pBdr><w:left w:val="single" w:sz="18" w:space="8" w:color="D0D7DE"/></w:pBdr><w:ind w:left="360"/></w:pPr><w:rPr><w:color w:val="59636E"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Code"><w:name w:val="Code"/><w:basedOn w:val="Normal"/><w:pPr><w:shd w:val="clear" w:color="auto" w:fill="F6F8FA"/><w:spacing w:line="276" w:lineRule="auto"/></w:pPr><w:rPr><w:rFonts w:ascii="Consolas" w:hAnsi="Consolas" w:cs="Consolas"/><w:sz w:val="${Math.round(r*.85)}"/></w:rPr></w:style><w:style w:type="paragraph" w:styleId="Caption"><w:name w:val="caption"/><w:basedOn w:val="Normal"/><w:qFormat/><w:rPr><w:i/><w:color w:val="59636E"/><w:sz w:val="${Math.round(r*.85)}"/></w:rPr></w:style><w:style w:type="character" w:styleId="Hyperlink"><w:name w:val="Hyperlink"/><w:rPr><w:color w:val="0969DA"/><w:u w:val="single"/></w:rPr></w:style></w:styles>`}function Te(a){let t=new Set;return a.descendants(e=>{(e.type.name==="image"||e.type.name==="figure_image")&&e.attrs.src&&t.add(String(e.attrs.src))}),[...t]}async function K(a,t={}){let e=t.page&&"width"in t.page&&typeof t.page.width=="number"?t.page:(0,Gt.resolvePageLayout)(t.page??{}),r=t.loadImage??xe,n=new Map;await Promise.all(Te(a).map(async u=>{n.set(u,await r(u).catch(()=>null))}));let s=new mt(e,n),i=s.document(a),o=s.bandFiles(),l=u=>new TextEncoder().encode(u),c=t.title?`<dc:title>${N(t.title)}</dc:title>`:"",p=[{name:"[Content_Types].xml",data:l(`${O}<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Default Extension="png" ContentType="image/png"/><Default Extension="jpeg" ContentType="image/jpeg"/><Default Extension="gif" ContentType="image/gif"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/><Override PartName="/word/numbering.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>`+o.overrides+"</Types>")},{name:"_rels/.rels",data:l(`${O}<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="${A.rel}/officeDocument" Target="word/document.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId3" Type="${A.rel}/extended-properties" Target="docProps/app.xml"/></Relationships>`)},{name:"word/document.xml",data:l(i)},{name:"word/styles.xml",data:l(Ue(t.font??"Calibri",t.fontSize??12))},{name:"word/numbering.xml",data:l(s.numberingXml())},{name:"word/_rels/document.xml.rels",data:l(s.relsXml())},{name:"docProps/core.xml",data:l(`${O}<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/">${c}</cp:coreProperties>`)},{name:"docProps/app.xml",data:l(`${O}<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"><Application>NovaProse</Application></Properties>`)},...o.entries,...s.mediaFiles()];return Lt(p)}var Y=_(G());var Re={yellow:"#ffff00",green:"#00ff00",cyan:"#00ffff",magenta:"#ff00ff",blue:"#0000ff",red:"#ff0000",darkBlue:"#000080",darkCyan:"#008080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",darkGray:"#808080",lightGray:"#c0c0c0",black:"#000000",white:"#ffffff"},Se={lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman"},_e={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",webp:"image/webp"},C=a=>a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),z=a=>!!a&&!["0","false","off","none"].includes(a.attrs["w:val"]??""),P=a=>a?.attrs["w:val"];function Oe(a){let t="";for(let e=0;e<a.length;e+=32768)t+=String.fromCharCode(...a.subarray(e,e+32768));return btoa(t)}function Zt(a,t){if(t.startsWith("/"))return t.slice(1);let e=a.split("/").slice(0,-1);for(let r of t.split("/"))r===".."?e.pop():r!=="."&&e.push(r);return e.join("/")}function V(a,t){return`${t}|${(a.attrs["w:author"]??"").slice(0,80)}|${Date.parse(a.attrs["w:date"]??"")}`}function Kt(a,t,e){let r=d(a,e);if(r)return{node:r,kind:"del",change:"delete"};let n=d(a,t);return n?{node:n,kind:"ins",change:"insert"}:null}var dt=class{constructor(t,e="accept"){y(this,"files",t);y(this,"revisions",e);y(this,"warnings",new Set);y(this,"styles",new Map);y(this,"levels",new Map);y(this,"starts",new Map);y(this,"footnotes",new Map);y(this,"notes",[]);y(this,"rels",new Map);y(this,"part","word/document.xml");y(this,"images",0);y(this,"inHeader",!1);y(this,"revisionCount",0);y(this,"wholeRevision",null)}xml(t){let e=this.files.get(t);return e?Xt(new TextDecoder().decode(e)):void 0}relsOf(t){let e=new Map,r=t.split("/").slice(0,-1).join("/"),n=t.split("/").pop(),s=this.xml(`${r?`${r}/`:""}_rels/${n}.rels`);for(let i of E(L(s,"Relationships"),"Relationship")){let o=i.attrs.TargetMode==="External";e.set(i.attrs.Id??"",{type:(i.attrs.Type??"").split("/").pop()??"",target:o?i.attrs.Target??"":Zt(t,i.attrs.Target??""),external:o})}return e}load(){let t=this.relsOf("_rels/.rels"),e=this.xml("_rels/.rels");for(let i of E(L(e,"Relationships"),"Relationship"))(i.attrs.Type??"").endsWith("/officeDocument")&&(this.part=Zt("",i.attrs.Target??"word/document.xml"));this.rels=this.relsOf(this.part);let r=i=>[...this.rels.values()].find(o=>o.type===i)?.target;for(let i of E(L(this.xml(r("styles")??""),"w:styles"),"w:style")){let o=d(i,"w:pPr"),l=P(d(o,"w:outlineLvl"));this.styles.set(i.attrs["w:styleId"]??"",{name:(P(d(i,"w:name"))??"").toLowerCase(),basedOn:P(d(i,"w:basedOn")),outline:l!==void 0?Number(l):void 0,numPr:d(o,"w:numPr"),jc:P(d(o,"w:jc")),rPr:d(i,"w:rPr")})}let n=L(this.xml(r("numbering")??""),"w:numbering"),s=new Map;for(let i of E(n,"w:abstractNum")){let o=[];for(let l of E(i,"w:lvl"))o[Number(l.attrs["w:ilvl"])||0]={format:P(d(l,"w:numFmt"))??"decimal",text:P(d(l,"w:lvlText"))??"",start:Number(P(d(l,"w:start"))??1)};s.set(i.attrs["w:abstractNumId"]??"",o)}for(let i of E(n,"w:num")){let o=i.attrs["w:numId"]??"";this.levels.set(o,s.get(P(d(i,"w:abstractNumId"))??"")??[]);for(let l of E(i,"w:lvlOverride")){let c=P(d(l,"w:startOverride"));c!==void 0&&this.starts.set(`${o}:${l.attrs["w:ilvl"]}`,Number(c))}}for(let i of E(L(this.xml(r("footnotes")??""),"w:footnotes"),"w:footnote"))this.footnotes.set(i.attrs["w:id"]??"",i);return L(this.xml(this.part),"w:document","w:body")}styleChain(t){let e=[],r=new Set;for(;t&&!r.has(t);){r.add(t);let n=this.styles.get(t);if(!n)break;e.push(n),t=n.basedOn}return e}headingLevel(t,e){let r=P(d(e,"w:outlineLvl"));if(r!==void 0&&Number(r)<6)return Number(r)+1;for(let n of this.styleChain(t)){let s=/^heading (\d)$/.exec(n.name);if(s)return Math.min(6,Number(s[1]));if(n.name==="title")return 1;if(n.outline!==void 0&&n.outline<6)return n.outline+1}return 0}styleKind(t){for(let e of this.styleChain(t)){if(/quote/.test(e.name))return"quote";if(/^(html preformatted|code|source code|macro text)/.test(e.name))return"code"}return null}runStyle(t,e=!1){let{bold:r,italic:n,underline:s,strike:i,vertical:o,color:l,background:c,font:p,size:u}=this.runFormat(t,e),m=Yt.test(p),f=[];l&&f.push(`color: ${l}`),c&&!(m&&Jt.has(c))&&f.push(`background-color: ${c}`),p&&!m&&f.push(`font-family: ${p}`),u&&f.push(`font-size: ${u}`);let w=[];r&&w.push("strong"),n&&w.push("em"),s&&w.push("u"),i&&w.push("s"),o==="superscript"&&w.push("sup"),o==="subscript"&&w.push("sub"),m&&w.push("code");let g=w.map(v=>`<${v}>`).join(""),h=w.reverse().map(v=>`</${v}>`).join("");return f.length&&(g=`<span style="${C(f.join("; "))}">${g}`,h=`${h}</span>`),{open:g,close:h}}formatMarks(t,e=!1){let{bold:r,italic:n,underline:s,strike:i,vertical:o,color:l,background:c,font:p,size:u}=this.runFormat(t,e),m=Yt.test(p),f=[];return r&&f.push({type:"bold"}),n&&f.push({type:"italic"}),s&&f.push({type:"underline"}),i&&f.push({type:"strike"}),m&&f.push({type:"code"}),o==="superscript"&&f.push({type:"superscript"}),o==="subscript"&&f.push({type:"subscript"}),l&&f.push({type:"color",attrs:{value:l}}),c&&!(m&&Jt.has(c))&&f.push({type:"background",attrs:{value:c}}),p&&!m&&f.push({type:"font_family",attrs:{value:/\s/.test(p)?`"${p}"`:p}}),u&&f.push({type:"font_size",attrs:{value:u}}),JSON.stringify(f)}runFormat(t,e){let r=[];for(let f of this.styleChain(P(d(t,"w:rStyle"))).reverse())f.rPr&&!(e&&f.name==="hyperlink")&&r.push(f.rPr);t&&r.push(t);let n=!1,s=!1,i=!1,o=!1,l="",c="",p="",u="",m="";for(let f of r){d(f,"w:b")&&!this.inHeader&&(n=z(d(f,"w:b"))),d(f,"w:i")&&(s=z(d(f,"w:i"))),d(f,"w:u")&&!e&&(i=z(d(f,"w:u"))),(d(f,"w:strike")||d(f,"w:dstrike"))&&(o=z(d(f,"w:strike")??d(f,"w:dstrike")));let w=P(d(f,"w:vertAlign"));w&&(l=w);let g=P(d(f,"w:color"));g&&!e&&/^[0-9a-f]{6}$/i.test(g)&&(c=`#${g.toLowerCase()}`);let h=Re[P(d(f,"w:highlight"))??""],v=d(f,"w:shd")?.attrs["w:fill"];h?p=h:v&&/^[0-9a-f]{6}$/i.test(v)&&(p=`#${v.toLowerCase()}`);let b=d(f,"w:rFonts")?.attrs["w:ascii"];b&&(u=b.replace(/[;"<>{}]/g,""));let x=Number(P(d(f,"w:sz")));x>0&&(m=`${x/2}pt`)}return{bold:n,italic:s,underline:i,strike:o,vertical:l,color:c,background:p,font:u,size:m}}image(t,e,r,n=""){let s=t?this.rels.get(t):void 0;if(!s)return"";if(s.external)return/^https?:/i.test(s.target)?`<img src="${C(s.target)}" alt="${C(n)}"${e?` width="${e}"`:""}${r?` height="${r}"`:""}>`:"";let i=this.files.get(s.target),o=s.target.split(".").pop()?.toLowerCase()??"",l=_e[o];return!i||!l?(this.warnings.add(`image format .${o||"?"}`),""):(this.images++,`<img src="data:${l};base64,${Oe(i)}" alt="${C(n)}"${e?` width="${e}"`:""}${r?` height="${r}"`:""}>`)}drawing(t){let e=d(t,"wp:inline")??d(t,"wp:anchor"),r=d(e,"wp:extent"),n=l=>l?Math.round(Number(l)/9525):void 0,s=d(e,"wp:docPr"),i,o=l=>{for(let c of E(l)){if(i)return;c.name==="a:blip"?i=c:o(c)}};return e&&o(e),this.image(i?.attrs["r:embed"]??i?.attrs["r:link"],n(r?.attrs.cx),n(r?.attrs.cy),s?.attrs.descr??s?.attrs.title??"")}vml(t){let e,r,n=o=>{for(let l of E(o))l.name==="v:shape"&&(r=l),l.name==="v:imagedata"?e=l:n(l)};if(n(t),!e)return"";let s=r?.attrs.style??"",i=o=>{let l=new RegExp(`${o}:\\s*([\\d.]+)(pt|px|in)`).exec(s);if(!l)return;let c=Number(l[1]);return Math.round(l[2]==="pt"?c*(4/3):l[2]==="in"?c*96:c)};return this.image(e.attrs["r:id"],i("width"),i("height"),e.attrs["o:title"]??"")}inline(t,e){for(let r of E(t))switch(r.name){case"w:r":this.run(r,e);break;case"w:hyperlink":{let n=r.attrs["r:id"]?this.rels.get(r.attrs["r:id"]):void 0,s=r.attrs["w:anchor"],i=n?.external?n.target:s?`#${s}`:"";i&&e.push(`<a href="${C(i)}">`),e.links++,this.inline(r,e),e.links--,i&&e.push("</a>");break}case"w:ins":case"w:moveTo":this.revisions==="suggestions"?this.revision(r,"ins",e):this.inline(r,e);break;case"w:del":case"w:moveFrom":this.revisions==="suggestions"&&this.revision(r,"del",e);break;case"w:smartTag":case"w:customXml":case"w:fldSimple":case"w:dir":case"w:bdo":this.inline(r,e);break;case"w:sdt":this.inline(d(r,"w:sdtContent")??r,e);break;case"m:oMath":case"m:oMathPara":e.push(`<em>${C(F(r))}</em>`),this.warnings.add("equations");break;default:break}}revision(t,e,r){if(this.wholeRevision===V(t,e)){let l=r.deleted;r.deleted=l||e==="del",this.inline(t,r),r.deleted=l;return}let{key:n,id:s,attrs:i}=this.revisionAttrs(t,e,r);r.push(`<${e}${i}>`);let o=r.deleted;r.deleted=o||e==="del",this.inline(t,r),r.deleted=o,r.push(`</${e}>`),r.revision={key:n,id:s,end:r.pushed}}wholeAttrs({node:t,change:e}){let r=(t.attrs["w:author"]??"").slice(0,80),n=Date.parse(t.attrs["w:date"]??""),s=`w${(t.attrs["w:id"]??"").replace(/[^\w-]/g,"").slice(0,60)||`r${++this.revisionCount}`}`;return` data-suggestion="${C(s)}" data-change="${e}"`+(r?` data-name="${C(r)}"`:"")+(Number.isFinite(n)?` data-time="${n}"`:"")}revisionAttrs(t,e,r){let n=(t.attrs["w:author"]??"").slice(0,80),s=Date.parse(t.attrs["w:date"]??""),i=V(t,e),o=r.revision,l=o&&o.key===i&&o.end===r.pushed?o.id:`w${(t.attrs["w:id"]??"").replace(/[^\w-]/g,"").slice(0,60)||`r${++this.revisionCount}`}`,c=` data-suggestion="${C(l)}"`+(n?` data-name="${C(n)}"`:"")+(Number.isFinite(s)?` data-time="${s}"`:"");return{key:i,id:l,attrs:c}}run(t,e){let r=d(t,"w:rPr");if(d(r,"w:rFonts")?.attrs["w:ascii"]==="Cambria Math"&&e.field!=="code"){let p=E(t,"w:t").map(F).join("");p&&e.push(`<span data-type="inline-math" data-latex="${C(p)}">${C(p)}</span>`);return}let{open:n,close:s}=this.runStyle(r,e.links>0),i=this.revisions==="suggestions"?d(r,"w:rPrChange"):void 0,o=i?this.revisionAttrs(i,"format",e):null;if(i&&o){let p=this.formatMarks(d(i,"w:rPr"),e.links>0);n=`<span${o.attrs} data-format="${C(p)}">${n}`,s=`${s}</span>`}let l="",c=()=>{l&&e.field!=="code"&&e.push(`${n}${l}${s}`),l=""};for(let p of E(t))switch(p.name){case"w:t":l+=C(F(p));break;case"w:delText":e.deleted&&(l+=C(F(p)));break;case"w:tab":case"w:ptab":l+=" ";break;case"w:noBreakHyphen":l+="-";break;case"w:sym":{let u=parseInt(p.attrs["w:char"]??"",16);Number.isFinite(u)&&u<57344&&(l+=C(String.fromCodePoint(u)));break}case"w:br":case"w:cr":c(),p.attrs["w:type"]==="page"?e.pageBreak():p.attrs["w:type"]!=="column"&&e.field!=="code"&&e.push("<br>");break;case"w:drawing":c(),e.field!=="code"&&e.push(this.drawing(p));break;case"w:pict":case"w:object":c(),e.field!=="code"&&e.push(this.vml(p));break;case"w:fldChar":{c();let u=p.attrs["w:fldCharType"];if(u==="begin")e.fields.push({code:"",link:!1}),e.field="code";else if(u==="separate"){let m=e.fields[e.fields.length-1];e.field="result";let f=m&&/^\s*HYPERLINK\s+(?:\\l\s+)?"([^"]+)"/.exec(m.code);if(m&&f){let w=/\\l/.test(m.code.split('"')[0]??"");e.push(`<a href="${C(w?`#${f[1]}`:f[1])}">`),m.link=!0,e.links++}}else u==="end"&&(e.fields.pop()?.link&&(e.push("</a>"),e.links--),e.field=e.fields.length?"result":null);break}case"w:instrText":{let u=e.fields[e.fields.length-1];u&&(u.code+=F(p));break}case"w:footnoteReference":{c();let u=this.footnotes.get(p.attrs["w:id"]??"");if(u){let m=this.notes.length+1;this.notes.push(`<p><sup>${m}</sup> ${this.noteText(u)}</p>`),e.push(`<sup>${m}</sup>`)}break}default:break}c(),o&&(e.revision={key:o.key,id:o.id,end:e.pushed})}noteText(t){return E(t,"w:p").map(e=>{let r=new J;return this.inline(e,r),r.parts().join(" ")}).join(" ").trim()}paragraph(t,e,r){let n=d(t,"w:pPr"),s=P(d(n,"w:pStyle")),i=this.headingLevel(s,n),o=i?null:this.styleKind(s),l=new J;this.inline(t,l);let c=l.parts(),p=this.styleChain(s),u=P(d(n,"w:jc"))??p.find(k=>k.jc)?.jc,m=[];u==="center"?m.push("text-align: center"):u==="right"||u==="end"?m.push("text-align: right"):(u==="both"||u==="distribute")&&m.push("text-align: justify");let f=d(n,"w:ind"),w=Number(f?.attrs["w:left"]??f?.attrs["w:start"]??0),g=d(n,"w:numPr")??p.find(k=>k.numPr)?.numPr,h=P(d(g,"w:numId"));w>0&&!h&&m.push(`margin-left: ${Math.round(w/15)}px`);let v=d(n,"w:spacing"),b=Number(v?.attrs["w:line"]);b&&(v?.attrs["w:lineRule"]??"auto")==="auto"&&b!==240&&m.push(`line-height: ${Math.round(b/240*100)/100}`);let x=z(d(n,"w:bidi")),$=`${m.length?` style="${m.join("; ")}"`:""}${x?' dir="rtl"':""}`,M=E(t,"w:bookmarkStart").find(k=>k.attrs["w:name"]!=="_GoBack"),T=i&&M?` id="${C(M.attrs["w:name"]??"")}"`:"";if(z(d(n,"w:pageBreakBefore"))&&(e.close(r),r.push(Vt)),c.length===1&&!c[0]&&!i&&d(d(n,"w:pBdr"),"w:bottom")){e.close(r),r.push("<hr>");return}let S=!i&&!h?/^([☐☒☑]) /.exec(c[0]??""):null;if(S&&c.length===1){e.item(r,"checklist",0,!1,"",1,S[1]!=="\u2610");let k=m.filter(R=>!R.startsWith("margin-left"));r.push(`<p${k.length?` style="${k.join("; ")}"`:""}${x?' dir="rtl"':""}>${c[0].slice(2)}</p>`);return}c.forEach((k,R)=>{if(R>0&&(e.close(r),r.push(Vt)),!(!k&&c.length>1)){if(h&&h!=="0"&&R===0){let U=Number(P(d(g,"w:ilvl"))??0),I=this.levels.get(h)?.[U];if(I&&I.format!=="none"){let B=I.format!=="bullet",D=this.starts.get(`${h}:${U}`)??I.start;e.item(r,h,U,B,B?Se[I.format]??"":"",D),r.push(`<p${$}>${k}</p>`);return}}e.close(r),i?r.push(`<h${i}${T}${$}>${k}</h${i}>`):o==="quote"?r.push(`<blockquote><p${$}>${k}</p></blockquote>`):o==="code"?r.push(`<pre><code>${k.replace(/<br>/g,`
|
|
4
|
+
`)}</code></pre>`):r.push(`<p${$}>${k}</p>`)}})}table(t,e){let r=E(d(t,"w:tblGrid"),"w:gridCol").map(i=>Math.round(Number(i.attrs["w:w"]??0)/15)),n=E(t,"w:tr").map(i=>{let o=Number(P(d(d(i,"w:trPr"),"w:gridBefore"))??0),l=[];for(let c of E(i,"w:tc")){let p=d(c,"w:tcPr"),u=Math.max(1,Number(P(d(p,"w:gridSpan"))??1)),m=d(p,"w:vMerge"),f=m?P(m)==="restart"?"restart":"continue":null;l.push({tc:c,col:o,span:u,merge:f,rowspan:1}),o+=u}return{tr:i,cells:l}});n.forEach((i,o)=>{for(let l of i.cells)if(l.merge==="restart")for(let c=o+1;c<n.length&&n[c].cells.find(u=>u.col===l.col)?.merge==="continue";c++)l.rowspan++}),e.push("<table><tbody>");let s=this.revisions==="suggestions";for(let{tr:i,cells:o}of n){let l=d(i,"w:trPr"),c=z(d(l,"w:tblHeader")),p=Kt(l,"w:ins","w:del");if(p?.change==="delete"&&!s)continue;let u=s&&p?V(p.node,p.kind):null;e.push(s&&p?`<tr${this.wholeAttrs(p)}>`:"<tr>");for(let m of o){if(m.merge==="continue")continue;let f=d(m.tc,"w:tcPr"),w=Kt(f,"w:cellIns","w:cellDel");if(w?.change==="delete"&&!s)continue;let g=s&&w?this.wholeAttrs(w):"";this.wholeRevision=s&&w?V(w.node,w.kind):u;let h=c?"th":"td",v=[],b=d(f,"w:shd")?.attrs["w:fill"];b&&/^[0-9a-f]{6}$/i.test(b)&&v.push(`background-color: #${b.toLowerCase()}`);let x=P(d(f,"w:vAlign"));x==="center"?v.push("vertical-align: middle"):x==="bottom"&&v.push("vertical-align: bottom");let $=r.slice(m.col,m.col+m.span),M=$.length===m.span&&$.every(T=>T>0)?` data-colwidth="${$.join(",")}"`:"";e.push(`<${h}${m.span>1?` colspan="${m.span}"`:""}${m.rowspan>1?` rowspan="${m.rowspan}"`:""}${M}${v.length?` style="${v.join("; ")}"`:""}${g}>`),this.inHeader=c,this.blocks(m.tc,e),this.inHeader=!1,this.wholeRevision=null,e.push(`</${h}>`)}e.push("</tr>")}e.push("</tbody></table>")}blocks(t,e){let r=new wt,n=e.length;for(let s of E(t))s.name==="w:p"?this.paragraph(s,r,e):s.name==="w:tbl"?(r.close(e),this.table(s,e)):s.name==="w:sdt"?(r.close(e),this.blocks(d(s,"w:sdtContent")??s,e)):s.name==="w:altChunk"&&this.warnings.add("embedded content (altChunk)");r.close(e),t.name==="w:body"&&this.notes.length&&e.push("<hr>",...this.notes.splice(0)),e.length===n&&t.name==="w:tc"&&e.push("<p></p>")}page(t){let e=d(t,"w:sectPr"),r=d(e,"w:pgSz"),n=d(e,"w:pgMar");if(!r)return;let s=m=>Math.round(Number(m)/1440*25.4*10)/10,i=s(r.attrs["w:w"]),o=s(r.attrs["w:h"]);if(!(i>0&&o>0))return;r.attrs["w:orient"]==="landscape"&&i<o&&([i,o]=[o,i]);let l={};for(let m of["top","right","bottom","left"]){let f=n?.attrs[`w:${m}`];f!==void 0&&(l[m]=Math.abs(s(f)))}let[c,p]=i<o?[i,o]:[o,i];return{size:Object.keys(Y.PAGE_SIZES).find(m=>Math.abs(Y.PAGE_SIZES[m][0]-c)<1.5&&Math.abs(Y.PAGE_SIZES[m][1]-p)<1.5)??{width:i,height:o},orientation:i>o?"landscape":"portrait",margins:l}}},Vt='<div class="nova-pagebreak" style="break-after: page;"></div>',Yt=/^(consolas|courier( new)?|menlo|monaco|lucida console|source code pro|fira (code|mono)|jetbrains mono|cascadia (code|mono)|monospace)$/i,Jt=new Set(["#f3f4f6","#f6f8fa"]),J=class{constructor(){y(this,"current",[]);y(this,"done",[]);y(this,"field",null);y(this,"fields",[]);y(this,"links",0);y(this,"deleted",!1);y(this,"pushed",0);y(this,"revision",null)}push(t){this.current.push(t),this.pushed++}pageBreak(){this.done.push(this.current.join("")),this.current=[]}parts(){return[...this.done,this.current.join("")]}},wt=class{constructor(){y(this,"stack",[])}item(t,e,r,n,s,i,o){let l=n?"ol":"ul",c=o===void 0?"<li>":`<li data-checked="${o}">`;for(;this.stack.length&&this.stack[this.stack.length-1].level>r;)t.push(`</li></${this.stack.pop().tag}>`);let p=this.stack[this.stack.length-1];if(p&&p.level===r){if(p.numId===e&&p.tag===l){t.push(`</li>${c}`);return}t.push(`</li></${this.stack.pop().tag}>`)}let u=(n&&i!==1?` start="${i}"`:"")+(s?` style="list-style-type: ${s}"`:"")+(o===void 0?"":' data-type="checklist"');t.push(`<${l}${u}>${c}`),this.stack.push({numId:e,level:r,tag:l})}close(t){for(;this.stack.length;)t.push(`</li></${this.stack.pop().tag}>`)}};async function Qt(a,t={}){let e=a instanceof Uint8Array?a:new Uint8Array(a),r=await Ft(e),n=new dt(r,t.revisions),s=n.load();if(!s)throw new Error("Not a Word document (.docx)");let i=[];return n.blocks(s,i),{html:i.join(""),page:n.page(s),warnings:[...n.warnings]}}function Ie(a){return!!a&&typeof a=="object"&&"view"in a&&"getHTML"in a}function sr(a,t={}){return Ie(a)?K(a.view.state.doc,{page:(0,gt.pageLayout)(a)?.layout,...t}):a instanceof te.Node?K(a,t):K((0,ee.createRenderer)(t).doc(a),t)}async function ir(a,t,e={}){let r=t instanceof Uint8Array?t:new Uint8Array(t instanceof ArrayBuffer?t:await t.arrayBuffer()),n=await Qt(r,{revisions:e.revisions??(a.hasPlugin("suggestions")?"suggestions":"accept")});return e.mode==="insert"?a.insertContent(n.html):a.setContent(n.html),n.page&&(0,gt.pageLayout)(a)?.set(n.page),n}export{sr as exportDocx,Qt as fromDocx,ir as importDocx,K as toDocx};
|
|
5
|
+
//# sourceMappingURL=index-a1feed69.js.map
|