@betteroffice/docx 0.0.1 → 0.0.2
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 +19 -0
- package/dist/chunk-AEQOEQJ7.mjs +57 -0
- package/dist/chunk-AZ52IWB6.mjs +16 -0
- package/dist/{chunk-SINEY6ZF.mjs → chunk-B4IR6YP4.mjs} +1 -1
- package/dist/chunk-IFT6DUJX.mjs +1 -0
- package/dist/{chunk-H3JCIGWK.mjs → chunk-NJHOPXZW.mjs} +1 -1
- package/dist/chunk-NTQM4EYN.mjs +1 -0
- package/dist/{chunk-KXNZFTTK.mjs → chunk-WBH3SXI6.mjs} +1 -1
- package/dist/collaboration/index.d.mts +64 -0
- package/dist/collaboration/index.mjs +1 -0
- package/dist/{content-sSHuWw49.d.mts → content-DLFHRQav.d.mts} +8 -8
- package/dist/core.d.mts +148 -341
- package/dist/core.mjs +1 -1
- package/dist/{displayListQueries-p-ijSzdh.d.mts → displayListQueries-UGc_XBUv.d.mts} +1 -1
- package/dist/docx/index.d.mts +40 -520
- package/dist/docx/index.mjs +2 -2
- package/dist/editor/index.d.mts +35 -151
- package/dist/editor/index.mjs +1 -1
- package/dist/{fontLoader-Bx6DK6-2.d.mts → fontLoader-aSewHMKF.d.mts} +65 -63
- package/dist/{formatting-DoL7KBSL.d.mts → formatting-D1EPSaJP.d.mts} +1 -1
- package/dist/generated/edit/docx_edit_bg.wasm +0 -0
- package/dist/generated/layout/docx_layout_bg.wasm +0 -0
- package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
- package/dist/generated/parse/docx_parse_bg.wasm +0 -0
- package/dist/index-Bwxm3oiC.d.mts +934 -0
- package/dist/layout/index.d.mts +18 -240
- package/dist/layout/index.mjs +1 -1
- package/dist/layout/pagination/index.d.mts +10 -58
- package/dist/layout/pagination/index.mjs +1 -1
- package/dist/layout/render/index.d.mts +10 -11
- package/dist/layout/render/index.mjs +1 -1
- package/dist/plugin-api/RenderedDomContext.d.mts +8 -9
- package/dist/plugin-api/index.d.mts +191 -6
- package/dist/plugin-api/resolveItemPositions.d.mts +4 -5
- package/dist/{rustDisplayList-dqunvwxH.d.mts → rustDisplayList-CX78djsZ.d.mts} +5 -5
- package/dist/rustMeasureSource-D1KsQvVC.d.mts +106 -0
- package/dist/selectiveSave-CVoajSKE.d.mts +56 -0
- package/dist/styles/index.d.mts +4 -39
- package/dist/styles/index.mjs +1 -1
- package/dist/{styles-VxNcXLdi.d.mts → styles-Dn_o3Vo5.d.mts} +2 -2
- package/dist/types/content.d.mts +2 -2
- package/dist/types/document.d.mts +40 -14
- package/dist/{types-DNrYr6yQ.d.mts → types-DMkDbvEu.d.mts} +3 -71
- package/dist/utils/comments.d.mts +2 -2
- package/dist/utils/index.d.mts +110 -576
- package/dist/utils/index.mjs +1 -84
- package/dist/utils/stylePreview.d.mts +2 -2
- package/dist/utils/units.d.mts +33 -2
- package/dist/wasm-BGQBTR2J.mjs +1 -0
- package/dist/wasm-edit.d.mts +13 -5
- package/dist/wasm-edit.mjs +1 -1
- package/dist/wasm-opc.mjs +1 -1
- package/dist/wasm-parse.mjs +1 -1
- package/dist/yrs/index.d.mts +5 -881
- package/dist/yrs/index.mjs +1 -1
- package/dist/yrs/residentEngineWorker.mjs +1 -1
- package/package.json +16 -139
- package/dist/Subscribable-DOz6Ohoo.d.mts +0 -33
- package/dist/agent/index.d.mts +0 -531
- package/dist/agent/index.mjs +0 -1
- package/dist/chunk-34K66SY4.mjs +0 -1
- package/dist/chunk-4RCISPPE.mjs +0 -1
- package/dist/chunk-52GB3Y42.mjs +0 -1
- package/dist/chunk-6PW4CWUG.mjs +0 -1
- package/dist/chunk-7DEIW7FL.mjs +0 -1
- package/dist/chunk-7PCO5I2O.mjs +0 -1
- package/dist/chunk-BI3B33LI.mjs +0 -1
- package/dist/chunk-BIQWVK5P.mjs +0 -2
- package/dist/chunk-DXKG3HQ5.mjs +0 -16
- package/dist/chunk-FPZBTOD6.mjs +0 -1
- package/dist/chunk-FZIA7OFY.mjs +0 -1
- package/dist/chunk-GWKJ2Y4Y.mjs +0 -1
- package/dist/chunk-HJGAQIU7.mjs +0 -2
- package/dist/chunk-I6KKMUUC.mjs +0 -1
- package/dist/chunk-IL5JZJT7.mjs +0 -1
- package/dist/chunk-JY6ILTNS.mjs +0 -1
- package/dist/chunk-KEE52TT5.mjs +0 -1
- package/dist/chunk-KVKLLTDP.mjs +0 -58
- package/dist/chunk-L5ISVQ3W.mjs +0 -1
- package/dist/chunk-LDUWIM7M.mjs +0 -1
- package/dist/chunk-N5Q3YN64.mjs +0 -1
- package/dist/chunk-NEWOMDTX.mjs +0 -1
- package/dist/chunk-O2QSE2I7.mjs +0 -1
- package/dist/chunk-OJOHXQNQ.mjs +0 -1
- package/dist/chunk-OMR3TWCD.mjs +0 -2
- package/dist/chunk-P3KDV4M2.mjs +0 -1
- package/dist/chunk-Q7PO7V73.mjs +0 -1
- package/dist/chunk-QOUFE3VX.mjs +0 -1
- package/dist/chunk-TYHI7RAD.mjs +0 -1
- package/dist/chunk-UIEJWORW.mjs +0 -1
- package/dist/chunk-VAOUFAUH.mjs +0 -1
- package/dist/chunk-VBOTMRXV.mjs +0 -1
- package/dist/chunk-VCER63GQ.mjs +0 -1
- package/dist/chunk-WAUF2UC7.mjs +0 -2
- package/dist/chunk-X4XDO3LZ.mjs +0 -1
- package/dist/chunk-XQBCCJBO.mjs +0 -9
- package/dist/chunk-XWUOLYRQ.mjs +0 -2
- package/dist/chunk-XYH6XWP3.mjs +0 -10
- package/dist/chunk-YBIM6UJV.mjs +0 -8
- package/dist/chunk-YCIH2Q3E.mjs +0 -1
- package/dist/chunk-ZOV5KL7C.mjs +0 -1
- package/dist/colorResolver-n0o7H7ep.d.mts +0 -290
- package/dist/core-plugins.d.mts +0 -37
- package/dist/core-plugins.mjs +0 -1
- package/dist/docx/parser.d.mts +0 -41
- package/dist/docx/parser.mjs +0 -1
- package/dist/docx/rezip.d.mts +0 -148
- package/dist/docx/rezip.mjs +0 -1
- package/dist/docx/serializer/index.d.mts +0 -42
- package/dist/docx/serializer/index.mjs +0 -1
- package/dist/editorTree-DO5PyDK8.d.mts +0 -37
- package/dist/executor-7O2RBJ2B.mjs +0 -1
- package/dist/headerFooterLayout-0zPT64Qc.d.mts +0 -316
- package/dist/headless.d.mts +0 -69
- package/dist/headless.mjs +0 -1
- package/dist/layout/flow/index.d.mts +0 -149
- package/dist/layout/flow/index.mjs +0 -1
- package/dist/layout/measure/index.d.mts +0 -324
- package/dist/layout/measure/index.mjs +0 -1
- package/dist/layout/pagination/types.d.mts +0 -4
- package/dist/layout/pagination/types.mjs +0 -1
- package/dist/managers/AutoSaveManager.d.mts +0 -81
- package/dist/managers/AutoSaveManager.mjs +0 -1
- package/dist/managers/TableSelectionManager.d.mts +0 -74
- package/dist/managers/TableSelectionManager.mjs +0 -1
- package/dist/managers/types.d.mts +0 -113
- package/dist/managers/types.mjs +0 -0
- package/dist/mcp-cli.mjs +0 -142
- package/dist/mcp.d.mts +0 -162
- package/dist/mcp.mjs +0 -16
- package/dist/measureBlocksPipeline-Df0Bbrwy.d.mts +0 -109
- package/dist/measuredBlock-DZwz8zhD.d.mts +0 -26
- package/dist/plugin-api/types.d.mts +0 -193
- package/dist/plugin-api/types.mjs +0 -0
- package/dist/processTemplate-HDUIZFJ5.mjs +0 -1
- package/dist/registry-DMM5VTdT.d.mts +0 -165
- package/dist/rustPagination-Bj2hq013.d.mts +0 -106
- package/dist/sectionConfigs-DW3J8q0X.d.mts +0 -55
- package/dist/selectionContext-Buc9BCU1.d.mts +0 -570
- package/dist/selectiveSave-oFBJ1n71.d.mts +0 -16
- package/dist/selectiveXmlPatch-ypkxlTD_.d.mts +0 -23
- package/dist/settingsParser-CcGvtmCK.d.mts +0 -33
- package/dist/types/agentApi.d.mts +0 -456
- package/dist/types/agentApi.mjs +0 -1
- package/dist/types-dYdjUZMo.d.mts +0 -311
- package/dist/units-O5Y02RKQ.d.mts +0 -34
- package/dist/utils/headingCollector.d.mts +0 -28
- package/dist/utils/headingCollector.mjs +0 -1
- package/dist/utils/highlightColors.d.mts +0 -14
- package/dist/utils/highlightColors.mjs +0 -1
- package/dist/utils/textSelection.d.mts +0 -92
- package/dist/utils/textSelection.mjs +0 -1
- package/dist/variableDetector-Borj29SF.d.mts +0 -115
- package/dist/wasm-FZQ5XB2Y.mjs +0 -1
- package/dist/watermarkApi-DCxjutkg.d.mts +0 -38
package/dist/chunk-7PCO5I2O.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a,b as b$1}from'./chunk-OBQGPMPQ.mjs';function E(e,t){if(e.length!==t.length)throw new Error(`toMeasuredBlocks: expected one measure per block (blocks=${e.length}, measures=${t.length})`);return e.map((n,i)=>({block:n,measure:t[i]}))}function P(e,t,n,i){let g=[],p=[],r=t,s=t.sectionIndex??0;for(let c=0;c<e.length;c++){if(e[c].kind!=="sectionBreak")continue;let o=e[c],u=i?.[s],f={pageSize:o.pageSize??r.pageSize,margins:o.margins??r.margins,columns:o.columns,sectionIndex:o.sectionIndex??s,sectionId:o.sectionId??r.sectionId??(r.emitPageMetadata?`section-${s}`:void 0),orientation:o.orientation??r.orientation,headerFooterRefs:o.headerFooterRefs??r.headerFooterRefs,pageNumbering:o.pageNumbering??r.pageNumbering,pageBorders:o.pageBorders??r.pageBorders,watermark:o.watermark??r.watermark,verticalAlign:o.verticalAlign??r.verticalAlign,noteSettings:o.noteSettings??r.noteSettings,emitPageMetadata:r.emitPageMetadata||o.sectionId!=null||o.sectionIndex!=null||o.pageNumbering!=null||o.headerFooterRefs!=null,...u?{pageSize:{w:u.pageSize?.w??o.pageSize?.w??r.pageSize.w,h:u.pageSize?.h??o.pageSize?.h??r.pageSize.h},margins:{...r.margins,...o.margins,...u.margins},columns:u.columns??o.columns,sectionId:u.sectionId??o.sectionId??(r.emitPageMetadata?`section-${s}`:void 0),headerFooterRefs:u.headerFooterRefs??o.headerFooterRefs,pageNumbering:u.pageNumbering??o.pageNumbering,pageBorders:u.pageBorders??o.pageBorders,watermark:u.watermark??o.watermark,noteSettings:u.noteSettings??o.noteSettings}:{}};g.push(f),p.push(c),r=f,s+=1;}let a=i?.[s];return g.push({...n,...a?{pageSize:{w:a.pageSize?.w??n.pageSize.w,h:a.pageSize?.h??n.pageSize.h},margins:{...n.margins,...a.margins},columns:a.columns??n.columns,headerFooterRefs:a.headerFooterRefs??n.headerFooterRefs,pageNumbering:a.pageNumbering??n.pageNumbering,pageBorders:a.pageBorders??n.pageBorders,watermark:a.watermark??n.watermark,noteSettings:a.noteSettings??n.noteSettings}:{},sectionIndex:n.sectionIndex??s,sectionId:a?.sectionId??n.sectionId??(n.emitPageMetadata?`section-${s}`:void 0)}),{configs:g,breakIndices:p}}var S=null;function B(){return S??(S=import('./wasm-SA237OSP.mjs').then(async e=>(await e.preloadLayoutWasm(),{layoutDocumentJson:e.layoutDocumentJson}))),S}function w(e,t){return t instanceof Map?Object.fromEntries(t):t}function R(e){let t=JSON.parse(e);if(t===null||typeof t!="object"||!Array.isArray(t.pages)||typeof t.pageSize?.w!="number"||typeof t.pageSize?.h!="number")throw new Error("rust pagination returned a malformed Layout");return t}function h(e={}){let t=e.engine??null,n=false,i={rustPaginated:0,engineErrors:0},g=t?Promise.resolve():(e.loadEngine??B)().then(p=>{t=p;});return g.catch(()=>{}),{isReady(){return t!==null},whenReady(){return g},getStats(){return {...i}},paginate(p,r){if(!t)throw new Error("[rustPagination] paginate called before the wasm engine loaded \u2014 layout passes must be gated on isReady()/whenReady()");let s;try{let a=JSON.stringify({measured:p,options:r},w);s=R(t.layoutDocumentJson(a));}catch(a){throw i.engineErrors++,a instanceof Error?a:new Error(String(a))}return i.rustPaginated++,n||(n=true,console.debug("[rustPagination] rust engine active (first rust-paginated layout pass)")),s}}}function k(e,t){for(let n=0;n<e.pages.length;n++)for(let i of e.pages[n].fragments){if(i.pmStart==null)continue;let g=i.pmStart,p=i.pmEnd??g+1;if(t>=g&&t<p)return n}return null}function x(e){return e.displayMode==="float"||a(e.wrapType)||e.wrapType==="topAndBottom"}function L(e){return x(e)&&e.wrapType==="topAndBottom"}function b(e){return x(e)&&!b$1(e.wrapType)&&e.wrapType!=="topAndBottom"}export{E as a,P as b,B as c,h as d,k as e,x as f,L as g,b as h};
|
package/dist/chunk-BI3B33LI.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b}from'./chunk-TTRUPDAB.mjs';var o=class{constructor(t){b(this,"listeners",new Set);b(this,"snapshot");b(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t);}));b(this,"getSnapshot",()=>this.snapshot);this.snapshot=t;}setSnapshot(t){this.snapshot=t,this.notify();}notify(){for(let t of this.listeners)t();}};export{o as a};
|
package/dist/chunk-BIQWVK5P.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var m={image:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",hyperlink:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",header:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",footer:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",footnotes:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",endnotes:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",styles:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",numbering:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",fontTable:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",theme:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",settings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",webSettings:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",oleObject:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject",chart:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",diagramData:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData",officeDocument:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",coreProperties:"http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",extendedProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",customProperties:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties",customXml:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml",comments:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",commentsExtended:"http://schemas.microsoft.com/office/2011/relationships/commentsExtended",commentsIds:"http://schemas.microsoft.com/office/2016/09/relationships/commentsIds",commentsExtensible:"http://schemas.microsoft.com/office/2018/08/relationships/commentsExtensible"};function n(e,o){return e.get(o)?.target}
|
|
2
|
-
export{m as a,n as b};
|
package/dist/chunk-DXKG3HQ5.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-FPZBTOD6.mjs';import {b as b$2}from'./chunk-H3JCIGWK.mjs';async function Fe(n){if(n instanceof ArrayBuffer)return n;if(n instanceof Uint8Array){let e=new ArrayBuffer(n.byteLength);return new Uint8Array(e).set(n),e}if(n instanceof Blob)return n.arrayBuffer();throw new TypeError(`Unsupported DocxInput type: ${typeof n}`)}function G(n){let e=n.replace(/[^0-9a-fA-F]/g,"");if(e.length!==32)return null;let t=new Uint8Array(16);for(let r=0;r<16;r++){let i=Number.parseInt(e.slice(r*2,r*2+2),16);if(Number.isNaN(i))return null;t[r]=i;}let o=new Uint8Array(16);for(let r=0;r<16;r++)o[r]=t[15-r];return o}function x(n){return n?G(n)!==null:false}function P(n,e){let t=G(e);if(!t)throw new Error(`Invalid embedded-font key: "${e}"`);let o=new Uint8Array(n.slice(0)),r=Math.min(32,o.length);for(let i=0;i<r;i++)o[i]^=t[i%16];return o.buffer}var z={calibri:{googleFont:"Carlito",category:"sans-serif",fallbackStack:["Calibri","Carlito","Arial","Helvetica","sans-serif"],singleLineRatio:1.2207},cambria:{googleFont:"Caladea",category:"serif",fallbackStack:["Cambria","Caladea","Georgia","serif"],singleLineRatio:1.2676},arial:{googleFont:"Arimo",category:"sans-serif",fallbackStack:["Arial","Arimo","Helvetica","sans-serif"],singleLineRatio:1.1172},"times new roman":{googleFont:"Tinos",category:"serif",fallbackStack:["Times New Roman","Tinos","Times","serif"],singleLineRatio:1.1074},"courier new":{googleFont:"Cousine",category:"monospace",fallbackStack:["Courier New","Cousine","Courier","monospace"],singleLineRatio:1.1328},georgia:{googleFont:"Tinos",category:"serif",fallbackStack:["Georgia","Tinos","Times New Roman","serif"],singleLineRatio:1.1362},verdana:{googleFont:"Open Sans",category:"sans-serif",fallbackStack:["Verdana","Open Sans","Arial","sans-serif"],singleLineRatio:1.2153},tahoma:{googleFont:"Open Sans",category:"sans-serif",fallbackStack:["Tahoma","Open Sans","Arial","sans-serif"],singleLineRatio:1.2075},"trebuchet ms":{googleFont:"Fira Sans",category:"sans-serif",fallbackStack:["Trebuchet MS","Fira Sans","Arial","sans-serif"],singleLineRatio:1.1431},"comic sans ms":{googleFont:"Comic Neue",category:"cursive",fallbackStack:["Comic Sans MS","Comic Neue","cursive"],singleLineRatio:1.3936},impact:{googleFont:"Anton",category:"sans-serif",fallbackStack:["Impact","Anton","Arial Black","sans-serif"],singleLineRatio:1.2197},"palatino linotype":{googleFont:"EB Garamond",category:"serif",fallbackStack:["Palatino Linotype","EB Garamond","Palatino","Georgia","serif"],singleLineRatio:1.0259},"book antiqua":{googleFont:"EB Garamond",category:"serif",fallbackStack:["Book Antiqua","EB Garamond","Palatino","Georgia","serif"],singleLineRatio:1.0259},garamond:{googleFont:"EB Garamond",category:"serif",fallbackStack:["Garamond","EB Garamond","Georgia","serif"],singleLineRatio:1.068},"century gothic":{googleFont:"Questrial",category:"sans-serif",fallbackStack:["Century Gothic","Questrial","Arial","sans-serif"],singleLineRatio:1.1611},"lucida sans":{googleFont:"Open Sans",category:"sans-serif",fallbackStack:["Lucida Sans","Open Sans","Arial","sans-serif"],singleLineRatio:1.1655},"lucida console":{googleFont:"Cousine",category:"monospace",fallbackStack:["Lucida Console","Cousine","Courier New","monospace"],singleLineRatio:1.1387},consolas:{googleFont:"Inconsolata",category:"monospace",fallbackStack:["Consolas","Inconsolata","Cousine","Courier New","monospace"],singleLineRatio:1.1626},"ms mincho":{googleFont:"Noto Serif JP",category:"serif",fallbackStack:["MS Mincho","Noto Serif JP","serif"],singleLineRatio:1.15},"\uFF4D\uFF53 \u660E\u671D":{googleFont:"Noto Serif JP",category:"serif",fallbackStack:["MS Mincho","\uFF2D\uFF33 \u660E\u671D","Noto Serif JP","serif"],singleLineRatio:1.15},"\uFF4D\uFF53 \uFF50\u660E\u671D":{googleFont:"Noto Serif JP",category:"serif",fallbackStack:["MS PMincho","\uFF2D\uFF33 \uFF30\u660E\u671D","Noto Serif JP","serif"],singleLineRatio:1.15},"ms gothic":{googleFont:"Noto Sans JP",category:"sans-serif",fallbackStack:["MS Gothic","Noto Sans JP","sans-serif"],singleLineRatio:1.15},"\uFF4D\uFF53 \u30B4\u30B7\u30C3\u30AF":{googleFont:"Noto Sans JP",category:"sans-serif",fallbackStack:["MS Gothic","\uFF2D\uFF33 \u30B4\u30B7\u30C3\u30AF","Noto Sans JP","sans-serif"],singleLineRatio:1.15},"\uFF4D\uFF53 \uFF50\u30B4\u30B7\u30C3\u30AF":{googleFont:"Noto Sans JP",category:"sans-serif",fallbackStack:["MS PGothic","\uFF2D\uFF33 \uFF30\u30B4\u30B7\u30C3\u30AF","Noto Sans JP","sans-serif"],singleLineRatio:1.15},simhei:{googleFont:"Noto Sans SC",category:"sans-serif",fallbackStack:["SimHei","Noto Sans SC","sans-serif"],singleLineRatio:1.15},simsun:{googleFont:"Noto Serif SC",category:"serif",fallbackStack:["SimSun","Noto Serif SC","serif"],singleLineRatio:1.15},"malgun gothic":{googleFont:"Noto Sans KR",category:"sans-serif",fallbackStack:["Malgun Gothic","Noto Sans KR","sans-serif"],singleLineRatio:1.15},\u5B8B\u4F53:{googleFont:"Noto Serif SC",category:"serif",fallbackStack:["SimSun","\u5B8B\u4F53","Noto Serif SC","serif"],singleLineRatio:1.15},\u9ED1\u4F53:{googleFont:"Noto Sans SC",category:"sans-serif",fallbackStack:["SimHei","\u9ED1\u4F53","Noto Sans SC","sans-serif"],singleLineRatio:1.15},\u5FAE\u8F6F\u96C5\u9ED1:{googleFont:"Noto Sans SC",category:"sans-serif",fallbackStack:["Microsoft YaHei","\u5FAE\u8F6F\u96C5\u9ED1","Noto Sans SC","sans-serif"],singleLineRatio:1.15},\u7B49\u7EBF:{googleFont:"Noto Sans SC",category:"sans-serif",fallbackStack:["DengXian","\u7B49\u7EBF","Noto Sans SC","sans-serif"],singleLineRatio:1.15},\u4EFF\u5B8B:{googleFont:"Noto Serif SC",category:"serif",fallbackStack:["FangSong","\u4EFF\u5B8B","Noto Serif SC","serif"],singleLineRatio:1.15},\u6977\u4F53:{googleFont:"Noto Serif SC",category:"serif",fallbackStack:["KaiTi","\u6977\u4F53","Noto Serif SC","serif"],singleLineRatio:1.15},\u65B0\u7D30\u660E\u9AD4:{googleFont:"Noto Serif TC",category:"serif",fallbackStack:["PMingLiU","\u65B0\u7D30\u660E\u9AD4","Noto Serif TC","serif"],singleLineRatio:1.15},\u7D30\u660E\u9AD4:{googleFont:"Noto Serif TC",category:"serif",fallbackStack:["MingLiU","\u7D30\u660E\u9AD4","Noto Serif TC","serif"],singleLineRatio:1.15},\u5FAE\u8EDF\u6B63\u9ED1\u9AD4:{googleFont:"Noto Sans TC",category:"sans-serif",fallbackStack:["Microsoft JhengHei","\u5FAE\u8EDF\u6B63\u9ED1\u9AD4","Noto Sans TC","sans-serif"],singleLineRatio:1.15},\u6A19\u6977\u9AD4:{googleFont:"Noto Serif TC",category:"serif",fallbackStack:["DFKai-SB","\u6A19\u6977\u9AD4","Noto Serif TC","serif"],singleLineRatio:1.15},"\uB9D1\uC740 \uACE0\uB515":{googleFont:"Noto Sans KR",category:"sans-serif",fallbackStack:["Malgun Gothic","\uB9D1\uC740 \uACE0\uB515","Noto Sans KR","sans-serif"],singleLineRatio:1.15},\uAD74\uB9BC:{googleFont:"Noto Sans KR",category:"sans-serif",fallbackStack:["Gulim","\uAD74\uB9BC","Noto Sans KR","sans-serif"],singleLineRatio:1.15},\uB3CB\uC6C0:{googleFont:"Noto Sans KR",category:"sans-serif",fallbackStack:["Dotum","\uB3CB\uC6C0","Noto Sans KR","sans-serif"],singleLineRatio:1.15},\uBC14\uD0D5:{googleFont:"Noto Serif KR",category:"serif",fallbackStack:["Batang","\uBC14\uD0D5","Noto Serif KR","serif"],singleLineRatio:1.15},\uAD81\uC11C:{googleFont:"Noto Serif KR",category:"serif",fallbackStack:["Gungsuh","\uAD81\uC11C","Noto Serif KR","serif"],singleLineRatio:1.15}},j={"sans-serif":"Arial, Helvetica, sans-serif",serif:"Times New Roman, Times, serif",monospace:"Courier New, Courier, monospace",cursive:"cursive",fantasy:"fantasy","system-ui":"system-ui, sans-serif"};function q(n){let e=n.toLowerCase();return e.includes("mono")||e.includes("courier")||e.includes("consolas")||e.includes("console")||e.includes("code")||e.includes("terminal")?"monospace":e.includes("times")||e.includes("georgia")||e.includes("garamond")||e.includes("palatino")||e.includes("baskerville")||e.includes("bodoni")||e.includes("cambria")||e.includes("mincho")||e.includes("\u660E\u671D")||e.includes("\u660E\u9AD4")||e.includes("\u5B8B")||e.includes("ming")||e.includes("song")||e.includes("serif")?"serif":e.includes("script")||e.includes("cursive")||e.includes("comic")||e.includes("brush")||e.includes("hand")?"cursive":"sans-serif"}var J={"microsoft yahei":"\u5FAE\u8F6F\u96C5\u9ED1",dengxian:"\u7B49\u7EBF",fangsong:"\u4EFF\u5B8B",kaiti:"\u6977\u4F53",pmingliu:"\u65B0\u7D30\u660E\u9AD4",mingliu:"\u7D30\u660E\u9AD4","microsoft jhenghei":"\u5FAE\u8EDF\u6B63\u9ED1\u9AD4","dfkai-sb":"\u6A19\u6977\u9AD4",gulim:"\uAD74\uB9BC",dotum:"\uB3CB\uC6C0",batang:"\uBC14\uD0D5",gungsuh:"\uAD81\uC11C",meiryo:"ms gothic",\u30E1\u30A4\u30EA\u30AA:"ms gothic","yu gothic":"ms gothic",\u6E38\u30B4\u30B7\u30C3\u30AF:"ms gothic","yu mincho":"ms mincho",\u6E38\u660E\u671D:"ms mincho"};function v(n){let e=n.trim().toLowerCase(),t=z[J[e]??e];if(t)return {googleFont:t.googleFont,cssFallback:t.fallbackStack.map(B).join(", "),originalFont:n,hasGoogleEquivalent:true,singleLineRatio:t.singleLineRatio};let o=q(n),r=j[o];return {googleFont:null,cssFallback:`${B(n)}, ${r}`,originalFont:n,hasGoogleEquivalent:false,singleLineRatio:1.15}}var W={"\n":"\\a ","\r":"\\d ","\f":"\\c "};function Y(n){return n.replace(/["\\]/g,"\\$&").replace(/[\n\r\f]/g,e=>W[e])}function B(n){return ["serif","sans-serif","monospace","cursive","fantasy","system-ui"].includes(n.toLowerCase())?n:/[\s,'"()]/.test(n)?`"${Y(n)}"`:n}function Ee(n,e){if(!e)return null;let o=n.toLowerCase().startsWith("major")?e.majorFont:e.minorFont;if(!o)return null;let r=n.toLowerCase();return r.includes("eastasia")||r.includes("ea")?o.ea??o.latin??null:r.includes("cs")||r.includes("bidi")?o.cs??o.latin??null:o.latin??null}var g=new Set,m=new Map,A=new Set,f=new Map,k=new Set,b=new Set,d=false,L=true,h=new Set,E=new Set;function p(n,e){let t=n instanceof Error?n.message:String(n),o=new Error(`[font] ${e}: ${t}`,{cause:n});if(b.size>0)for(let r of b)try{r(o);}catch(i){console.error("Font error subscriber threw:",i);}else console.warn(o.message);}function O(n,e="normal",t="normal"){return `${n.trim()}|${e}|${t}`}function w(n){return h.has(n)?false:E.has(n)?true:te(n)?(E.add(n),queueMicrotask(()=>T([n])),true):false}function V(n){let e=`${n}|`,t=[];for(let[o,r]of f)o.startsWith(e)&&t.push(r);return t}function U(n,e){A.add(n),g.add(e),T([e]);}function X(n,e=[400,700],t=["normal","italic"]){let o=encodeURIComponent(n),r=[];for(let a of t){let s=a==="italic"?1:0;for(let c of e)r.push(`${s},${c}`);}r.sort();let i=r.join(";");return `https://fonts.googleapis.com/css2?family=${o}:ital,wght@${i}&display=swap`}async function R(n,e){if(typeof document>"u")return false;let t=n.trim();if(g.has(t))return true;let o=m.get(t);if(o)return o;if(!e&&w(t))return true;let r=V(t);if(!L&&r.length===0)return false;let i=(async()=>{d=true;try{if(r.length>0&&(await Promise.all(r),g.has(t)||!e&&w(t)))return !0;if(!L)return !1;let a=X(t,e?.weights,e?.styles),s=document.createElement("link");return s.rel="stylesheet",s.href=a,await new Promise(l=>{let u=setTimeout(()=>l(!1),5e3);s.onload=()=>{clearTimeout(u),l(!0);},s.onerror=()=>{clearTimeout(u),l(!1);},document.head.appendChild(s);})?(await C(t,3e3),g.add(t),T([t]),!0):!1}catch(a){return p(a,`failed to load "${t}"`),false}finally{m.delete(t),m.size===0&&f.size===0&&(d=false);}})();return m.set(t,i),i}async function Q(n,e){let t=n.filter(o=>!g.has(o.trim()));t.length!==0&&await Promise.all(t.map(o=>R(o,e)));}function Z(n){let e=n.trim();return g.has(e)||E.has(e)}function we(n){L=n;}function Re(){return L}function Ae(){return d}function Te(){return Array.from(new Set([...g,...E]))}function Ce(n){return k.add(n),()=>{k.delete(n);}}function T(n){for(let e of k)try{e(n);}catch(t){p(t,"load callback threw");}}function _e(n){return b.add(n),()=>{b.delete(n);}}async function C(n,e){if("fonts"in document)try{let t=`400 16px "${n}"`;return await Promise.race([document.fonts.load(t),new Promise(o=>setTimeout(o,e))]),document.fonts.check(t)}catch{}return await new Promise(t=>setTimeout(t,100)),true}var S,D=new Map,ee="abcdefghijklmnopqrstuvwxyz0123456789";function ne(){return S===void 0&&(S=document.createElement("canvas").getContext("2d"),S&&(S.textBaseline="top")),S}function te(n,e="sans-serif"){if(typeof document>"u")return false;let t=ne();if(!t)return false;let o=i=>(t.font=i,t.measureText(ee).width),r=i=>{let a=D.get(i);return a===void 0&&(a=o(`72px ${i}`),D.set(i,a)),o(`72px "${n}", ${i}`)!==a};return r(e)||r(e==="sans-serif"?"serif":"sans-serif")}var oe={"<":"\\3c ",">":"\\3e ","\n":"\\a ","\r":"\\d ","\f":"\\c "},M=n=>n.replace(/["\\]/g,"\\$&").replace(/[<>\n\r\f]/g,e=>oe[e]);async function $(n,e,t){if(typeof document>"u")return false;let o=n.trim(),r=t?.style??"normal",i=O(o,t?.weight,r);if(h.add(o),A.has(i))return true;let a=f.get(i);if(a)return a;let s=(async()=>{d=true;try{let c=new Blob([e],{type:"font/ttf"}),l=URL.createObjectURL(c),u=document.createElement("style");return u.textContent=`
|
|
2
|
-
@font-face {
|
|
3
|
-
font-family: "${M(o)}";
|
|
4
|
-
src: url(${l}) format('truetype');
|
|
5
|
-
font-weight: ${t?.weight??"normal"};
|
|
6
|
-
font-style: ${r};
|
|
7
|
-
font-display: swap;
|
|
8
|
-
}
|
|
9
|
-
`,document.head.appendChild(u),await C(o,3e3),U(i,o),!0}catch(c){return p(c,`failed to load "${o}" from buffer`),false}finally{f.delete(i),m.size===0&&f.size===0&&(d=false);}})();return f.set(i,s),s}function re(n){let e=n.split("?")[0].split("#")[0].toLowerCase();return e.endsWith(".woff2")?"woff2":e.endsWith(".woff")?"woff":e.endsWith(".otf")?"opentype":"truetype"}async function ie(n,e,t){if(typeof document>"u")return false;if(/[<>]/.test(e))return p(new Error(`invalid src URL for "${n}": contains '<' or '>'`),"rejected src"),false;let o=n.trim(),r=O(o,t?.weight);if(h.add(o),A.has(r))return true;let i=f.get(r);if(i)return i;let a=(async()=>{d=true;try{let s=document.createElement("style");return s.textContent=`
|
|
10
|
-
@font-face {
|
|
11
|
-
font-family: "${M(o)}";
|
|
12
|
-
src: url(${JSON.stringify(e)}) format('${re(e)}');
|
|
13
|
-
font-weight: ${t?.weight??"normal"};
|
|
14
|
-
font-display: swap;
|
|
15
|
-
}
|
|
16
|
-
`,document.head.appendChild(s),await C(o,3e3),U(r,o),!0}catch(s){return p(s,`failed to load "${o}" from ${e}`),false}finally{f.delete(r),m.size===0&&f.size===0&&(d=false);}})();return f.set(r,a),a}async function Ie(n){!n||n.length===0||await Promise.all(n.map(e=>ie(e.family,e.src,{weight:e.weight})));}var ae={Calibri:"Carlito",Cambria:"Caladea",Arial:"Arimo","Times New Roman":"Tinos","Courier New":"Cousine",Garamond:"EB Garamond","Book Antiqua":"EB Garamond",Georgia:"Tinos",Verdana:"Open Sans",Tahoma:"Open Sans","Trebuchet MS":"Source Sans Pro","Century Gothic":"Poppins","Franklin Gothic":"Libre Franklin",Palatino:"EB Garamond","Palatino Linotype":"EB Garamond","Lucida Sans":"Open Sans","Segoe UI":"Open Sans",Impact:"Anton","Comic Sans MS":"Comic Neue",Consolas:"Inconsolata","Lucida Console":"Inconsolata",Monaco:"Fira Code"};function se(n){let e=n.trim();return ae[e]||v(e).googleFont||e}async function le(n){let e=n.trim(),t=se(e);if(t!==e){if(!h.has(e)&&Z(e)||w(e))return true;let o=await R(t);return o&&g.add(e),o}return R(t)}async function ce(n){let e=[...new Set(n.map(t=>t.trim()))];await Promise.all(e.map(t=>le(t)));}async function Ge(){await Q(["Carlito","Caladea","Arimo","Tinos","Cousine","EB Garamond"]);}function fe(n){let e=new Set;if(typeof n!="object"||n===null)return e;let t=[n],o=new WeakSet,r=0,i=1e5;for(;t.length>0&&r++<i;){let a=t.pop();if(typeof a!="object"||a===null||o.has(a))continue;if(o.add(a),Array.isArray(a)){for(let l of a)t.push(l);continue}let s=a,c=s.fontFamily;if(typeof c=="object"&&c!==null){let l=c;for(let u of ["ascii","hAnsi","eastAsia","cs"]){let N=l[u];typeof N=="string"&&N.trim()&&e.add(N.trim());}}typeof s.name=="string"&&("altName"in s||"panose1"in s||"embedRegular"in s)&&(s.name.trim()&&e.add(s.name.trim()),typeof s.altName=="string"&&s.altName.trim()&&e.add(s.altName.trim()));for(let l of Object.values(s))t.push(l);}return e}async function xe(n){let e=fe(n);e.size!==0&&await ce(Array.from(e));}function ge(n){let e=new TextDecoder("utf-8",{ignoreBOM:true});return {paths:()=>[...n.keys()],file:t=>n.get(t)??null,text:t=>{let o=n.get(t);return o?e.decode(o):null}}}function K(n){let e=b$2(new Uint8Array(n));return ge(new Map(Object.entries(e)))}function ue(n){let e=new Set;if(!n)return e;for(let t of n.fonts)(t.embedRegular||t.embedBold||t.embedItalic||t.embedBoldItalic)&&e.add(t.name);return e}var de=[{key:"embedRegular",weight:"normal",style:"normal"},{key:"embedBold",weight:"bold",style:"normal"},{key:"embedItalic",weight:"normal",style:"italic"},{key:"embedBoldItalic",weight:"bold",style:"italic"}];function me(n,e){let t=n.replace(/^\/+/,""),r=(t.toLowerCase().startsWith("word/")?t:`word/${t}`).toLowerCase();for(let[i,a]of e)if(i.toLowerCase()===r)return a}function ye(n,e,t,o,r){let i=r.get(e.relId);if(!i)return null;let a=me(i,o);if(!a)return null;let s;if(e.fontKey&&x(e.fontKey))try{s=P(a,e.fontKey);}catch{return null}else s=a.slice(0);return {family:n,weight:t.weight,style:t.style,data:s,subsetted:e.subsetted??false}}function H(n,e,t){if(!n||n.fonts.length===0)return [];if(!t||e.size===0)return [];let o=b$1(t,"word/_rels/fontTable.xml.rels"),r=new Map;for(let[a,s]of o)r.set(a,s.target);let i=[];for(let a of n.fonts)for(let s of de){let c=a[s.key];if(!c)continue;let l=ye(a.name,c,s,e,r);l&&i.push(l);}return i}async function He(n){let e=n.package.fontTable;if(!e||ue(e).size===0)return [];let t=n.originalBuffer;if(!t)return [];let o=K(t),r=new Map,i=null;for(let a of o.paths()){if(a.toLowerCase().startsWith("word/fonts/")){let s=o.file(a);s&&r.set(a,s.slice().buffer);}a.toLowerCase()==="word/_rels/fonttable.xml.rels"&&(i=o.text(a));}return H(e,r,i)}async function ze(n,e,t){let o=H(n,e,t),r=new Set;return o.length===0||await Promise.all(o.map(async i=>{await $(i.family,i.data,{weight:i.weight,style:i.style})?r.add(i.family):typeof document<"u"&&console.warn(`[embeddedFonts] embedded face "${i.family}" (${i.weight} ${i.style}) failed to load; text using it falls back to the CSS stack`);})),r}export{H as A,He as B,ze as C,Fe as a,x as b,P as c,v as d,Ee as e,R as f,Q as g,Z as h,we as i,Re as j,Ae as k,Te as l,Ce as m,_e as n,te as o,$ as p,ie as q,Ie as r,ae as s,se as t,le as u,ce as v,Ge as w,fe as x,xe as y,ue as z};
|
package/dist/chunk-FPZBTOD6.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b,c as c$1}from'./chunk-SINEY6ZF.mjs';var B=new Set(["__proto__","constructor","prototype"]);function j(t,e){return R(b(new Uint8Array(t),JSON.stringify(e)),t)}function R(t,e){let r=JSON.parse(t);h(r,"wire");let n=c(r,"wire");if(f(n,["wireVersion","document","embeddedFontParts","fontTableRelationshipsXml","canonicalBase64","canonicalSha256"],"wire",["fontTableRelationshipsXml","canonicalBase64","canonicalSha256"]),n.wireVersion!==1)throw new TypeError("wire.wireVersion must be 1");let o=D(n.document,e),i=N(n.embeddedFontParts);if((n.canonicalBase64!==void 0||n.canonicalSha256!==void 0)&&(n.canonicalBase64===void 0||n.canonicalSha256===void 0))throw new TypeError("wire canonical fields must be present together");let s=n.canonicalSha256===void 0?void 0:d(n.canonicalSha256,"wire.canonicalSha256");if(s!==void 0&&!/^[0-9a-f]{64}$/.test(s))throw new TypeError("wire.canonicalSha256 is invalid");return {wireVersion:1,document:o,embeddedFonts:i,...n.fontTableRelationshipsXml===void 0?{}:{fontTableRelationshipsXml:d(n.fontTableRelationshipsXml,"wire.fontTableRelationshipsXml")},...n.canonicalBase64===void 0?{}:{rustCanonicalBytes:g(d(n.canonicalBase64,"wire.canonicalBase64")),rustCanonicalSha256:s}}}function D(t,e){let r=c(t,"wire.document");f(r,["package","templateVariables","warnings"],"wire.document",["templateVariables","warnings"]);let o={package:M(r.package),originalBuffer:e};return r.templateVariables!==void 0&&(o.templateVariables=E(r.templateVariables,"wire.document.templateVariables")),r.warnings!==void 0&&(o.warnings=E(r.warnings,"wire.document.warnings")),o}function M(t){let e=c(t,"wire.document.package");f(e,["document","styles","theme","numbering","settings","fontTable","headerEntries","footerEntries","footnotes","endnotes","footnoteSeparators","endnoteSeparators","relationshipEntries","mediaEntries","chartEntries"],"wire.document.package",["styles","headerEntries","footerEntries","footnotes","endnotes","footnoteSeparators","endnoteSeparators"]);let o={document:x(e.document),theme:c(e.theme,"wire.document.package.theme"),numbering:c(e.numbering,"wire.document.package.numbering"),settings:c(e.settings,"wire.document.package.settings"),fontTable:c(e.fontTable,"wire.document.package.fontTable"),relationships:T(e.relationshipEntries,"wire.document.package.relationshipEntries"),media:F(e.mediaEntries),charts:y(e.chartEntries,"wire.document.package.chartEntries",(i,a)=>c(i,a))};e.styles!==void 0&&(o.styles=c(e.styles,"wire.document.package.styles"));for(let[i,a]of [["headerEntries","headers"],["footerEntries","footers"]]){let s=e[i];s!==void 0&&(o[a]=y(s,`wire.document.package.${i}`,(p,u)=>c(p,u)));}return e.footnotes!==void 0&&(o.footnotes=l(e.footnotes,"wire.document.package.footnotes")),e.endnotes!==void 0&&(o.endnotes=l(e.endnotes,"wire.document.package.endnotes")),e.footnoteSeparators!==void 0&&(o.footnoteSeparators=l(e.footnoteSeparators,"wire.document.package.footnoteSeparators")),e.endnoteSeparators!==void 0&&(o.endnoteSeparators=l(e.endnoteSeparators,"wire.document.package.endnoteSeparators")),o}function x(t){let e="wire.document.package.document",r=c(t,e);if(f(r,["content","sections","finalSectionProperties","comments"],e,["sections","finalSectionProperties","comments"]),!Array.isArray(r.content))throw new TypeError(`${e}.content must be an array`);r.content.forEach((o,i)=>c(o,`${e}.content[${i}]`));let n={content:r.content};if(r.sections!==void 0){if(!Array.isArray(r.sections))throw new TypeError(`${e}.sections must be an array`);n.sections=r.sections.map((o,i)=>{let a=`${e}.sections[${i}]`,s=c(o,a);f(s,["id","properties","contentStart","contentEnd"],a,["id"]);let p=S(s.contentStart,`${a}.contentStart`),u=S(s.contentEnd,`${a}.contentEnd`);if(p>u||u>n.content.length)throw new TypeError(`${a} has an invalid content range`);return {...s.id===void 0?{}:{id:d(s.id,`${a}.id`)},properties:c(s.properties,`${a}.properties`),content:n.content.slice(p,u)}});}return r.finalSectionProperties!==void 0&&(n.finalSectionProperties=c(r.finalSectionProperties,`${e}.finalSectionProperties`)),r.comments!==void 0&&(n.comments=l(r.comments,`${e}.comments`)),n}function T(t,e){return y(t,e,(r,n,o)=>O(r,n,o))}function F(t){let e="wire.document.package.mediaEntries";if(!Array.isArray(t))throw new TypeError(`${e} must be an array`);let r=new Map,n=new Map;for(let o=0;o<t.length;o+=1){let i=`${e}[${o}]`,a=t[o];if(!Array.isArray(a)||a.length!==2)throw new TypeError(`${i} must be a key/value pair`);let s=d(a[0],`${i}[0]`);if(r.has(s))throw new TypeError(`${e} contains duplicate key ${JSON.stringify(s)}`);let p=`${i}[1]`,u=c(a[1],p);f(u,["path","filename","mimeType","base64","dataUrl"],p,["filename"]);let m=d(u.path,`${p}.path`),w=n.get(m);if(!w){let P=g(d(u.base64,`${p}.base64`)),b={path:m,...u.filename===void 0?{}:{filename:d(u.filename,`${p}.filename`)},mimeType:d(u.mimeType,`${p}.mimeType`),data:A(P),dataUrl:d(u.dataUrl,`${p}.dataUrl`)};w=b,n.set(m,b);}r.set(s,w);}return r}function N(t){let e="wire.embeddedFontParts";if(!Array.isArray(t))throw new TypeError(`${e} must be an array`);let r=new Map;return t.forEach((n,o)=>{let i=`${e}[${o}]`,a=c(n,i);f(a,["path","base64"],i);let s=d(a.path,`${i}.path`);if(r.has(s))throw new TypeError(`${e} contains duplicate key ${JSON.stringify(s)}`);r.set(s,A(g(d(a.base64,`${i}.base64`))));}),r}function y(t,e,r){if(!Array.isArray(t))throw new TypeError(`${e} must be an array`);let n=new Map;return t.forEach((o,i)=>{let a=`${e}[${i}]`;if(!Array.isArray(o)||o.length!==2)throw new TypeError(`${a} must be a key/value pair`);let s=d(o[0],`${a}[0]`);if(n.has(s))throw new TypeError(`${e} contains duplicate key ${JSON.stringify(s)}`);n.set(s,r(o[1],`${a}[1]`,s));}),n}function E(t,e){if(!Array.isArray(t))throw new TypeError(`${e} must be an array`);return t.map((r,n)=>d(r,`${e}[${n}]`))}function l(t,e){if(!Array.isArray(t))throw new TypeError(`${e} must be an array`);return t.forEach((r,n)=>c(r,`${e}[${n}]`)),t}function A(t){return Uint8Array.from(t).buffer}function S(t,e){let r=V(t,e);if(!Number.isSafeInteger(r)||r<0)throw new TypeError(`${e} must be a non-negative safe integer`);return r}function J(t,e="word/_rels/document.xml.rels"){let r=JSON.parse(c$1(new TextEncoder().encode(t),e));h(r,"relationshipPart");let n=c(r,"relationshipPart");return f(n,["path","relationships","canonicalBase64","canonicalSha256"],"relationshipPart"),d(n.path,"relationshipPart.path"),T(n.relationships,"relationshipPart.relationships")}function O(t,e,r){let n=c(t,e);f(n,["id","type","target","targetMode"],e,["targetMode"]);let o=d(n.id,`${e}.id`);if(o!==r)throw new TypeError(`${e}.id does not match its map key`);let i={id:o,type:d(n.type,`${e}.type`),target:d(n.target,`${e}.target`)};if(n.targetMode!==void 0){if(n.targetMode!=="External"&&n.targetMode!=="Internal")throw new TypeError(`${e}.targetMode is invalid`);i.targetMode=n.targetMode;}return i}function h(t,e,r=new WeakSet){if(!(t===null||typeof t!="object")){if(r.has(t))throw new TypeError(`${e} contains a cycle`);r.add(t);try{for(let n of Object.keys(t)){if(B.has(n))throw new TypeError(`${e} contains forbidden key ${n}`);h(t[n],`${e}.${n}`,r);}}finally{r.delete(t);}}}function c(t,e){if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError(`${e} must be an object`);return t}function f(t,e,r,n=[]){let o=new Set(e);for(let a of Object.keys(t))if(!o.has(a))throw new TypeError(`${r} contains unknown key ${a}`);let i=new Set(n);for(let a of e)if(!i.has(a)&&!Object.prototype.hasOwnProperty.call(t,a))throw new TypeError(`${r} is missing ${a}`)}function d(t,e){if(typeof t!="string")throw new TypeError(`${e} must be a string`);return t}function V(t,e){if(typeof t!="number"||!Number.isFinite(t))throw new TypeError(`${e} must be a finite number`);return t}function g(t){let e;try{e=atob(t);}catch{throw new TypeError("wire canonicalBase64 is invalid")}let r=new Uint8Array(e.length);for(let n=0;n<e.length;n+=1)r[n]=e.charCodeAt(n);return r}export{j as a,J as b};
|
package/dist/chunk-FZIA7OFY.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var c={dk1:"000000",lt1:"FFFFFF",dk2:"44546A",lt2:"E7E6E6",accent1:"4472C4",accent2:"ED7D31",accent3:"A5A5A5",accent4:"FFC000",accent5:"5B9BD5",accent6:"70AD47",hlink:"0563C1",folHlink:"954F72"},f={dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",hlink:"hlink",folHlink:"folHlink",dark1:"dk1",light1:"lt1",dark2:"dk2",light2:"lt2",hyperlink:"hlink",followedHyperlink:"folHlink",background1:"lt1",text1:"dk1",background2:"lt2",text2:"dk2",tx1:"dk1",tx2:"dk2",bg1:"lt1",bg2:"lt2"};function b(e){if(!e)return 1;let n=parseInt(e,16);return isNaN(n)?1:n/255}function i(e){let n=e.padStart(6,"0").slice(0,6),t=parseInt(n.slice(0,2),16),r=parseInt(n.slice(2,4),16),l=parseInt(n.slice(4,6),16);return {r:isNaN(t)?0:t,g:isNaN(r)?0:r,b:isNaN(l)?0:l}}function g(e,n,t){let r=l=>Math.max(0,Math.min(255,Math.round(l))).toString(16).padStart(2,"0");return `${r(e)}${r(n)}${r(t)}`.toUpperCase()}function s(e,n){if(n>=1)return e;if(n<=0)return "FFFFFF";let t=i(e);return g(Math.min(255,Math.max(0,Math.round(t.r*n+255*(1-n)))),Math.min(255,Math.max(0,Math.round(t.g*n+255*(1-n)))),Math.min(255,Math.max(0,Math.round(t.b*n+255*(1-n)))))}function h(e,n){if(n>=1)return e;if(n<=0)return "000000";let t=i(e);return g(Math.min(255,Math.max(0,Math.round(t.r*n))),Math.min(255,Math.max(0,Math.round(t.g*n))),Math.min(255,Math.max(0,Math.round(t.b*n))))}function p(e,n){let t=f[n]??n,r=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],l=a=>r.includes(a);return e?.colorScheme?l(t)?e.colorScheme[t]??c[t]??"000000":"000000":l(t)?c[t]??"000000":"000000"}function x(e){if(!e)return null;let n=e.toLowerCase();return f[e]??f[n]??null}function u(e,n,t="000000"){if(!e)return `#${t}`;if(e.auto)return `#${t}`;let r;if(e.themeColor){let l=x(e.themeColor);if(l?r=p(n,l):r=e.rgb??t,e.themeTint){let a=b(e.themeTint);r=s(r,a);}else if(e.themeShade){let a=b(e.themeShade);r=h(r,a);}}else e.rgb?r=e.rgb==="auto"?t:e.rgb:r=t;return `#${r.toUpperCase().replace(/^#/,"")}`}function M(e,n){if(!(!e||e.auto)){if(e.themeColor&&n)return u(e,n).slice(1);if(e.rgb&&e.rgb!=="auto")return e.rgb.toUpperCase().replace(/^#/,"")}}function y(e,n){if(!e)return "#000000";let r=u(e,n).replace(/^#/,""),l=i(r);return (.299*l.r+.587*l.g+.114*l.b)/255>.5?"#000000":"#FFFFFF"}function F(e,n,t){let l=u(e,n).replace(/^#/,""),a=1-t/100;return `#${h(l,a)}`}function V(e,n,t){let l=u(e,n).replace(/^#/,""),a=1-t/100;return `#${s(l,a)}`}function v(e,n,t,r){let l=u(e,r).replace(/^#/,""),a=u(n,r).replace(/^#/,""),o=i(l),m=i(a),d={r:Math.round(o.r*(1-t)+m.r*t),g:Math.round(o.g*(1-t)+m.g*t),b:Math.round(o.b*(1-t)+m.b*t)};return `#${g(d.r,d.g,d.b)}`}var k=[{slot:"lt1",name:"Background 1"},{slot:"dk1",name:"Text 1"},{slot:"lt2",name:"Background 2"},{slot:"dk2",name:"Text 2"},{slot:"accent1",name:"Accent 1"},{slot:"accent2",name:"Accent 2"},{slot:"accent3",name:"Accent 3"},{slot:"accent4",name:"Accent 4"},{slot:"accent5",name:"Accent 5"},{slot:"accent6",name:"Accent 6"}],C=[{type:"base",value:0,hexValue:"",labelSuffix:""},{type:"tint",value:.8,hexValue:"CC",labelSuffix:", Lighter 80%"},{type:"tint",value:.6,hexValue:"99",labelSuffix:", Lighter 60%"},{type:"tint",value:.4,hexValue:"66",labelSuffix:", Lighter 40%"},{type:"shade",value:.75,hexValue:"BF",labelSuffix:", Darker 25%"},{type:"shade",value:.5,hexValue:"80",labelSuffix:", Darker 50%"}];function A(e,n,t){return n==="tint"?s(e,1-t):h(e,t)}function H(e){let n=e??c;return C.map(t=>k.map(r=>{let l=n[r.slot]??c[r.slot]??"000000",a;t.type==="base"?a=l.toUpperCase():t.type==="tint"?a=s(l,1-t.value):a=h(l,t.value);let o={hex:a,themeSlot:r.slot,label:`${r.name}${t.labelSuffix}`};return t.type==="tint"&&t.hexValue?o.tint=t.hexValue:t.type==="shade"&&t.hexValue&&(o.shade=t.hexValue),o}))}export{i as a,p as b,x as c,u as d,M as e,y as f,F as g,V as h,v as i,A as j,H as k};
|
package/dist/chunk-GWKJ2Y4Y.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function i(e){return e/1440*96}function s(e,t,n){if(!n||t<=n)return {width:e,height:t};let u=n/t;return {width:Math.round(e*u),height:n}}var r=0;function b(){return `block-${++r}`}function l(){r=0;}export{i as a,s as b,b as c,l as d};
|
package/dist/chunk-HJGAQIU7.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {b as b$1}from'./chunk-FZIA7OFY.mjs';import {xml2js}from'xml-js';function C(e){return !e||!e.elements?[]:e.elements.filter(n=>n.type==="element")}function u(e,n,t){if(!e||!e.attributes)return null;let o=e.attributes;if(t in o){let i=o[t];return i==null?null:String(i)}return null}function b(e,n){if(!e||!e.elements)return null;for(let t of e.elements)if(t.type==="element"&&t.name===n)return t;return null}function R(e,n,t,o=1){let i=u(e,n,t);if(i===null)return;let r=parseInt(i,10);if(!isNaN(r))return r*o}var q={accent1:"accent1",accent2:"accent2",accent3:"accent3",accent4:"accent4",accent5:"accent5",accent6:"accent6",dk1:"dk1",lt1:"lt1",dk2:"dk2",lt2:"lt2",tx1:"text1",tx2:"text2",bg1:"background1",bg2:"background2",hlink:"hlink",folHlink:"folHlink"},O={black:"000000",white:"FFFFFF",red:"FF0000",green:"00FF00",blue:"0000FF",yellow:"FFFF00",cyan:"00FFFF",magenta:"FF00FF"};function V(e,n){let t=C(n),o=t.find(r=>r.name==="a:shade");if(o){let r=u(o,null,"val");r&&(e.themeShade=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}let i=t.find(r=>r.name==="a:tint");if(i){let r=u(i,null,"val");r&&(e.themeTint=Math.round(parseInt(r,10)/1e5*255).toString(16).padStart(2,"0").toUpperCase());}return e}function G(e){if(!e)return;let n=C(e),t=n.find(a=>a.name==="a:srgbClr");if(t){let a=u(t,null,"val");if(a)return V({rgb:a},t)}let o=n.find(a=>a.name==="a:schemeClr");if(o){let a=u(o,null,"val");if(a){let l={themeColor:q[a]??"dk1"};return V(l,o)}}let i=n.find(a=>a.name==="a:sysClr");if(i)return {rgb:u(i,null,"lastClr")??"000000"};let r=n.find(a=>a.name==="a:prstClr");if(r){let a=u(r,null,"val");if(a&&O[a])return {rgb:O[a]}}}function z(e){if(!e)return;let n=C(e);if(n.find(o=>o.name==="a:noFill"))return {type:"none"};let t=n.find(o=>o.name==="a:solidFill");if(t)return {type:"solid",color:G(t)};if(n.find(o=>o.name==="a:gradFill"))return {type:"gradient"}}function $(e){let n=e?b(e,"a:ln"):null;if(!n)return;let t=C(n);if(t.find(l=>l.name==="a:noFill"))return;let o={},i=u(n,null,"w");i&&(o.width=parseInt(i,10));let r=t.find(l=>l.name==="a:solidFill");r&&(o.color=G(r));let a=t.find(l=>l.name==="a:prstDash");if(a){let l=u(a,null,"val");l&&(o.style=l);}return o}function H(e){if(e){if(e.rgb)return `#${e.rgb}`;if(e.themeColor)return `#${b$1(null,e.themeColor)}`}}var g=.5522847498307936,U=.16666666666666666;function A(){return {type:"close"}}function c(e){return e.length===0?[]:[{type:"move",x:e[0].x,y:e[0].y},...e.slice(1).map(n=>({type:"line",x:n.x,y:n.y})),A()]}function P(e,n=-Math.PI/2){let t=Array.from({length:e},(o,i)=>{let r=n+i*Math.PI*2/e;return {x:.5+Math.cos(r)*.5,y:.5+Math.sin(r)*.5}});return c(t)}function p(e,n=.45){let t=Array.from({length:e*2},(o,i)=>{let r=-Math.PI/2+i*Math.PI/e,a=i%2===0?.5:.5*n;return {x:.5+Math.cos(r)*a,y:.5+Math.sin(r)*a}});return c(t)}function B(e,n){return e===void 0||!Number.isFinite(e)?n:Math.max(0,Math.min(1,e>1?e/1e5:e))}function X(e,n){let t=B(n,.5),o=c([{x:0,y:.25},{x:1-t,y:.25},{x:1-t,y:0},{x:1,y:.5},{x:1-t,y:1},{x:1-t,y:.75},{x:0,y:.75}]),i=r=>{switch(e){case "left":return {x:1-r.x,y:r.y};case "up":return {x:r.y,y:1-r.x};case "down":return {x:r.y,y:r.x};case "right":return r}};return o.map(r=>{if(r.type!=="move"&&r.type!=="line")return r;let a=i(r);return {type:r.type,x:a.x,y:a.y}})}function F(e,n){let t=B(n,.5);if(e<=2)return [{type:"move",x:0,y:0},{type:"line",x:t,y:0},{type:"line",x:t,y:1},{type:"line",x:1,y:1}];let o=[{type:"move",x:0,y:0}];for(let i=1;i<e;i++){let r=i/e;o.push(i%2===1?{type:"line",x:i===1?t:r,y:(i-1)/e}:{type:"line",x:(i-1)/e,y:r});}return o.push({type:"line",x:1,y:1}),o}function S(e){if(e<=2)return [{type:"move",x:0,y:0},{type:"cubic",cp1x:.5,cp1y:0,cp2x:.5,cp2y:1,x:1,y:1}];let n=[{type:"move",x:0,y:0}];for(let t=0;t<e-1;t++){let o=t/(e-1),i=(t+1)/(e-1);n.push({type:"cubic",cp1x:o+(i-o)*.5,cp1y:o,cp2x:o+(i-o)*.5,cp2y:i,x:i,y:i});}return n}function N(e,n={}){switch(e){case "rect":return [{type:"move",x:0,y:0},{type:"line",x:1,y:0},{type:"line",x:1,y:1},{type:"line",x:0,y:1},A()];case "roundRect":{let t=U;return [{type:"move",x:t,y:0},{type:"line",x:1-t,y:0},{type:"quad",cpx:1,cpy:0,x:1,y:t},{type:"line",x:1,y:1-t},{type:"quad",cpx:1,cpy:1,x:1-t,y:1},{type:"line",x:t,y:1},{type:"quad",cpx:0,cpy:1,x:0,y:1-t},{type:"line",x:0,y:t},{type:"quad",cpx:0,cpy:0,x:t,y:0},A()]}case "ellipse":return [{type:"move",x:1,y:.5},{type:"cubic",cp1x:1,cp1y:.5+g/2,cp2x:.5+g/2,cp2y:1,x:.5,y:1},{type:"cubic",cp1x:.5-g/2,cp1y:1,cp2x:0,cp2y:.5+g/2,x:0,y:.5},{type:"cubic",cp1x:0,cp1y:.5-g/2,cp2x:.5-g/2,cp2y:0,x:.5,y:0},{type:"cubic",cp1x:.5+g/2,cp1y:0,cp2x:1,cp2y:.5-g/2,x:1,y:.5},A()];case "line":case "straightConnector1":return [{type:"move",x:0,y:0},{type:"line",x:1,y:1}];case "triangle":case "isosTriangle":return [{type:"move",x:.5,y:0},{type:"line",x:1,y:1},{type:"line",x:0,y:1},A()];case "rtTriangle":return c([{x:0,y:0},{x:1,y:1},{x:0,y:1}]);case "diamond":case "flowChartDecision":return c([{x:.5,y:0},{x:1,y:.5},{x:.5,y:1},{x:0,y:.5}]);case "parallelogram":{let t=B(n.adj,.25);return c([{x:t,y:0},{x:1,y:0},{x:1-t,y:1},{x:0,y:1}])}case "trapezoid":{let t=B(n.adj,.2);return c([{x:t,y:0},{x:1-t,y:0},{x:1,y:1},{x:0,y:1}])}case "pentagon":case "flowChartOffpageConnector":return P(5);case "hexagon":return P(6);case "heptagon":return P(7);case "octagon":return P(8);case "decagon":return P(10);case "dodecagon":return P(12);case "star4":return p(4);case "star5":return p(5);case "star6":return p(6);case "star7":return p(7);case "star8":return p(8);case "star10":return p(10);case "star12":return p(12);case "star16":return p(16);case "star24":return p(24);case "star32":return p(32);case "bentConnector2":return F(2,n.adj1);case "bentConnector3":return F(3,n.adj1);case "bentConnector4":return F(4,n.adj1);case "bentConnector5":return F(5,n.adj1);case "curvedConnector2":return S(2);case "curvedConnector3":return S(3);case "curvedConnector4":return S(4);case "curvedConnector5":return S(5);case "rightArrow":return X("right",n.adj2);case "leftArrow":return X("left",n.adj2);case "upArrow":return X("up",n.adj2);case "downArrow":return X("down",n.adj2);case "leftRightArrow":return c([{x:0,y:.5},{x:.25,y:0},{x:.25,y:.25},{x:.75,y:.25},{x:.75,y:0},{x:1,y:.5},{x:.75,y:1},{x:.75,y:.75},{x:.25,y:.75},{x:.25,y:1}]);case "upDownArrow":return c([{x:.5,y:0},{x:1,y:.25},{x:.75,y:.25},{x:.75,y:.75},{x:1,y:.75},{x:.5,y:1},{x:0,y:.75},{x:.25,y:.75},{x:.25,y:.25},{x:0,y:.25}]);case "chevron":return c([{x:0,y:0},{x:.65,y:0},{x:1,y:.5},{x:.65,y:1},{x:0,y:1},{x:.35,y:.5}]);case "homePlate":return c([{x:0,y:0},{x:.75,y:0},{x:1,y:.5},{x:.75,y:1},{x:0,y:1}]);case "flowChartProcess":case "flowChartAlternateProcess":case "flowChartPredefinedProcess":case "flowChartInternalStorage":case "flowChartPreparation":case "flowChartManualOperation":case "flowChartMagneticTape":case "flowChartMagneticDisk":case "flowChartMagneticDrum":case "flowChartDisplay":case "textBox":return N("rect");case "flowChartConnector":return N("ellipse");case "flowChartInputOutput":case "flowChartManualInput":return N("parallelogram",n);case "flowChartTerminator":return N("roundRect");default:return null}}function W(e){if(!e)return;let n=parseInt(e,10);if(!isNaN(n))return n/6e4}function ce(e){if(!e)return {size:{width:0,height:0}};let n=b(e,"a:ext"),t=R(n,null,"cx")??0,o=R(n,null,"cy")??0,i={width:t,height:o},r=b(e,"a:off"),a;if(r){let T=R(r,null,"x")??0,f=R(r,null,"y")??0;a={x:T,y:f};}let l=u(e,null,"rot"),m=u(e,null,"flipH")==="1",M=u(e,null,"flipV")==="1",w=W(l),x;return (w!==void 0||m||M)&&(x={},w!==void 0&&(x.rotation=w),m&&(x.flipH=true),M&&(x.flipV=true)),{size:i,transform:x,offset:a}}function de(e){if(!e)return "rect";let n=b(e,"a:prstGeom");if(n){let o=u(n,null,"prst");if(o)return o}return b(e,"a:custGeom"),"rect"}var K=/&(?!(?:[A-Za-z][A-Za-z0-9]*|#[0-9]+|#x[0-9a-fA-F]+);)/g;function Z(e){let n=e.replace(K,"&");try{return xml2js(n,{compact:!1,ignoreComment:!0,ignoreInstruction:!0,ignoreDoctype:!0,alwaysArray:!1,trim:!1,captureSpacesBetweenElements:!0,attributesKey:"attributes",textKey:"text"})}catch(t){if(!(t instanceof Error))throw t;let o=t.message.match(/Column:\s*(\d+)/)?.[1];if(!o)throw t;let i=Number(o),r=JSON.stringify(n.slice(Math.max(0,i-30),i+30)),a=new Error(`${t.message}
|
|
2
|
-
Near: ${r}`);throw a.stack=t.stack,a}}function ye(e){try{let n=Z(e);return n.elements?.find(t=>t.type==="element")??n}catch(n){return console.warn("Failed to parse XML:",n),null}}function I(e){let n=e.indexOf(":");return n>=0?e.slice(n+1):e}function he(e,n,t){let o=`${n}:${t}`;return k(e).find(i=>i.name===o||I(i.name??"")===t)??null}function xe(e,n,t){let o=`${n}:${t}`;return k(e).filter(i=>i.name===o||I(i.name??"")===t)}function D(e,n){return k(e).filter(t=>I(t.name??"")===n)}function h(e,n){return k(e).find(t=>t.name===n)??null}function k(e){return e?.elements?.filter(n=>n.type==="element")??[]}function d(e,n,t){if(!e?.attributes)return null;let o=e.attributes;return n&&`${n}:${t}`in o?o[`${n}:${t}`]:t in o?o[t]:null}function v(e){return e?typeof e.text=="string"?e.text:(e.elements??[]).map(n=>n.type==="text"?typeof n.text=="string"?n.text:"":n.type==="element"?v(n):"").join(""):""}function s(e,n,t,o=1){let i=d(e,n,t);if(i===null)return;let r=parseInt(i,10);return Number.isNaN(r)?void 0:r*o}function ge(e,n="w"){if(!e)return false;let t=d(e,n,"val");return t!=="0"&&t!=="false"&&t!=="off"}function J(e){if(!e)return;let n=d(e,null,"relativeFrom")??"column",t=h(e,"wp:align");if(t){let i=v(t);return {relativeTo:n,alignment:i}}let o=h(e,"wp:posOffset");if(o){let i=v(o),r=parseInt(i,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function Y(e){if(!e)return;let n=d(e,null,"relativeFrom")??"paragraph",t=h(e,"wp:align");if(t){let i=v(t);return {relativeTo:n,alignment:i}}let o=h(e,"wp:posOffset");if(o){let i=v(o),r=parseInt(i,10);return {relativeTo:n,posOffset:isNaN(r)?0:r}}return {relativeTo:n}}function Pe(e){let n=h(e,"wp:positionH"),t=h(e,"wp:positionV"),o=h(e,"wp:simplePos"),i=d(e,null,"simplePos")==="1",r=s(e,null,"relativeHeight"),a=d(e,null,"behindDoc")==="1",l=d(e,null,"hidden"),m=d(e,null,"locked");if(!(!n&&!t&&!o&&!i&&r===void 0&&!a&&l===null&&m===null))return {useSimplePos:i||void 0,simplePos:o&&i?{x:s(o,null,"x")??void 0,y:s(o,null,"y")??void 0}:void 0,relativeHeight:r!==void 0&&Number.isFinite(r)?r:void 0,behindDoc:a||void 0,hidden:l==="1"||l==="true"||void 0,locked:m==="1"||m==="true"||void 0,horizontal:J(n)??{relativeTo:"column"},vertical:Y(t)??{relativeTo:"paragraph"}}}var Q=["wp:wrapNone","wp:wrapSquare","wp:wrapTight","wp:wrapThrough","wp:wrapTopAndBottom"];function ee(e,n,t){if(!e){let f={type:n?"behind":"inFront"};return t?.distT!==void 0&&(f.distT=t.distT),t?.distB!==void 0&&(f.distB=t.distB),t?.distL!==void 0&&(f.distL=t.distL),t?.distR!==void 0&&(f.distR=t.distR),f}let i=(e.name||"").replace("wp:",""),r;switch(i){case "wrapNone":r=n?"behind":"inFront";break;case "wrapSquare":r="square";break;case "wrapTight":r="tight";break;case "wrapThrough":r="through";break;case "wrapTopAndBottom":r="topAndBottom";break;default:r="square";}let a={type:r},l=d(e,null,"wrapText");l&&(a.wrapText=l);let m=s(e,null,"distT")??t?.distT,M=s(e,null,"distB")??t?.distB,w=s(e,null,"distL")??t?.distL,x=s(e,null,"distR")??t?.distR;m!==void 0&&(a.distT=m),M!==void 0&&(a.distB=M),w!==void 0&&(a.distL=w),x!==void 0&&(a.distR=x);let T=h(e,"wp:wrapPolygon");if(T){let f=[...D(T,"start"),...D(T,"lineTo")].slice(0,2048).map(y=>({x:s(y,null,"x")??void 0,y:s(y,null,"y")??void 0})).filter(y=>y.x!==void 0&&y.y!==void 0&&Number.isFinite(y.x)&&Number.isFinite(y.y)&&Math.abs(y.x)<=1e9&&Math.abs(y.y)<=1e9);f.length>1&&(a.polygon=f);}return a}function ke(e){let n=k(e),t=d(e,null,"behindDoc")==="1",o=n.find(r=>Q.includes(r.name??"")),i={distT:s(e,null,"distT")??void 0,distB:s(e,null,"distB")??void 0,distL:s(e,null,"distL")??void 0,distR:s(e,null,"distR")??void 0};return ee(o??null,t,i)}export{z as a,$ as b,H as c,N as d,W as e,ce as f,de as g,ye as h,I as i,he as j,xe as k,D as l,h as m,k as n,d as o,v as p,s as q,ge as r,Pe as s,ke as t};
|
package/dist/chunk-I6KKMUUC.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-ZOV5KL7C.mjs';import {n,i,o,t,s,m,b as b$1,q}from'./chunk-HJGAQIU7.mjs';import {b as b$2}from'./chunk-BIQWVK5P.mjs';import {b}from'./chunk-3UBMCDME.mjs';function p(e,n){let t=q(e,null,n);return t!==void 0&&Number.isFinite(t)?t:void 0}function f(e,n){let t=o(e,null,n);if(t==="1"||t==="true"||t==="on")return true;if(t==="0"||t==="false"||t==="off")return false}function R(e){return n(e).find(n=>{let t=i(n.name??"");return t==="inline"||t==="anchor"})??null}function X(e){let n=m(e,"a:graphic"),t=n?m(n,"a:graphicData"):null,i=t?m(t,"pic:pic"):null,r=i?m(i,"pic:blipFill"):null;return {picture:i,blipFill:r,blip:r?m(r,"a:blip"):null}}function C(e){let n=m(e,"wp:extent");return {width:p(n,"cx")??0,height:p(n,"cy")??0}}function W(e){let n=m(e,"wp:effectExtent");if(!n)return;let t={left:p(n,"l")??0,top:p(n,"t")??0,right:p(n,"r")??0,bottom:p(n,"b")??0};return Object.values(t).some(Boolean)?t:void 0}function k(e){let{picture:n}=X(e),t=n?m(n,"pic:spPr"):null,i=t?m(t,"a:xfrm"):null;if(!i)return;let r=o(i,null,"rot"),o$1=r===null?void 0:Number(r)/6e4,d=f(i,"flipH"),m$1=f(i,"flipV");if(!(!Number.isFinite(o$1)&&d!==true&&m$1!==true))return {...Number.isFinite(o$1)?{rotation:o$1}:{},...d===true?{flipH:true}:{},...m$1===true?{flipV:true}:{}}}function A(e){let n=m(e,"a:srcRect");if(!n)return;let t=r=>{let o=p(n,r);return o===void 0||o===0?void 0:o/1e5},i={left:t("l"),top:t("t"),right:t("r"),bottom:t("b")};return Object.values(i).some(r=>r!==void 0)?i:void 0}function B(e){let n=m(e,"a:alphaModFix"),t=p(n,"amt");if(!(t===void 0||t>=1e5))return Math.max(0,Math.min(1,t/1e5))}function D(e){let n={type:"inline"};for(let[t,i]of [["distT","distT"],["distB","distB"],["distL","distL"],["distR","distR"]]){let r=p(e,t);r!==void 0&&(n[i]=r);}return n}function z(e){let n=e.replace(/^\/+/,"");return n.startsWith("word/")?n:n.startsWith("media/")?`word/${n}`:`word/${n}`}function L(e,n){if(!n)return;let t=new Set([e.replace(/^\/+/,""),z(e),`word/${e.replace(/^\/+/,"")}`]);for(let[i,r]of n)if([...t].some(o=>o.toLowerCase()===i.toLowerCase()))return r}function N(e){let n=e.split(".").pop()?.toLowerCase();return {png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp",svg:"image/svg+xml",emf:"image/x-emf",wmf:"image/x-wmf"}[n??""]??"application/octet-stream"}function O(e,n,t){let i=n?.get(e.rId);if(!i?.target)return;let r=L(i.target,t);e.filename=i.target.split("/").pop(),e.mimeType=r?.mimeType??N(i.target),e.src=r?.dataUrl??r?.base64;}function j(e,n,t){let i=m(n,"wp:docPr");if(!i)return;e.id=o(i,null,"id")??void 0,e.alt=o(i,null,"descr")??void 0,e.title=o(i,null,"title")??void 0,(f(i,"decorative")||m(i,"adec:decorative"))&&(e.decorative=true);let r=m(i,"a:hlinkClick"),o$1=o(r,"r","id");if(o$1&&t){let d=a(b$2(t,o$1));d&&(e.hlinkHref=d,e.hyperlink={href:d,tooltip:o(r,null,"tooltip")??void 0,target:o(r,null,"tgtFrame")??void 0,history:o(r,null,"history")!=="0"});}}function H(e,n,t$1){let{picture:i$1,blipFill:r,blip:o$1}=X(e);if(!i$1||!r||!o$1)return null;let d=o(o$1,"r","embed")??o(o$1,null,"embed")??o(o$1,"r","link")??"",m$1=i(e.name??"")==="anchor",u={type:"image",rId:d,size:C(e),wrap:m$1?t(e)??{type:"inFront"}:D(e)};m$1&&(u.position=s(e),u.layoutInCell=f(e,"layoutInCell"),u.allowOverlap=f(e,"allowOverlap"));let c=W(e);c&&(u.padding=c,u.effectExtent={...c});let h=k(e);h&&(u.transform=h);let b=A(r);b&&(u.crop=b);let I=B(o$1);I!==void 0&&(u.opacity=I);let T=m(i$1,"pic:spPr"),x=b$1(T);return x&&(u.outline=x),O(u,n,t$1),j(u,e,n),u}function S(e,n,t){let i=R(e);return i?H(i,n,t):null}function Z(e,n,t){return S(e,n,t)}function V(e){return e.wrap.type==="inline"}function _(e){return !V(e)}function ee(e){return e.wrap.type==="behind"}function ne(e){return e.wrap.type==="inFront"}function te(e){return b(e.size.width)}function ie(e){return b(e.size.height)}function re(e){return e.decorative===true}function oe(e){return {top:b(e.wrap.distT),bottom:b(e.wrap.distB),left:b(e.wrap.distL),right:b(e.wrap.distR)}}export{S as a,Z as b,V as c,_ as d,ee as e,ne as f,te as g,ie as h,re as i,oe as j};
|
package/dist/chunk-IL5JZJT7.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {c,a,b as b$1}from'./chunk-GWKJ2Y4Y.mjs';import {f}from'./chunk-52GB3Y42.mjs';import {a as a$1,b}from'./chunk-X4XDO3LZ.mjs';import {i}from'./chunk-L5ISVQ3W.mjs';import {f as f$1}from'./chunk-XWUOLYRQ.mjs';import {d as d$2,c as c$1}from'./chunk-HJGAQIU7.mjs';import {d,e}from'./chunk-FZIA7OFY.mjs';import {d as d$1,f as f$2,k,l,b as b$2}from'./chunk-3UBMCDME.mjs';function re(e){return Math.max(1,Math.round(e/8*1.333))}var ie={single:"solid",double:"double",dotted:"dotted",dashed:"dashed",thick:"solid",dashSmallGap:"dashed",dotDash:"dashed",dotDotDash:"dotted",triple:"double",wave:"solid",doubleWave:"double",threeDEmboss:"ridge",threeDEngrave:"groove",outset:"outset",inset:"inset"};function M(e,n){if(!e||!e.style||e.style==="none"||e.style==="nil")return;let t={style:ie[e.style]||"solid",width:re(e.size??0),color:e.color?d(e.color,n):"#000000"};return e.space!==void 0&&(t.space=d$1(e.space)),t}function W(e,n){let t=e.borders;if(!t)return;let r={},i=["top","bottom","left","right"];for(let o of i){let s=t[o],d=s?M(s,n):void 0;r[o]=d??{width:0,style:"none"};}return Object.keys(r).length>0?r:void 0}var _={183:"\u2022",111:"\u25CB",167:"\u25A0",252:"\u2713",110:"\u25A0",113:"\u25CB",117:"\u25C6",118:"\u2756",168:"\u2713",251:"\u2713",254:"\u2713",61623:"\u2022",61550:"\u25A0",61551:"\u25CB",61607:"\u25A0",61692:"\u2713",8226:"\u2022",9679:"\u25CF",9675:"\u25CB",9632:"\u25A0",9633:"\u25A1",9670:"\u25C6",9671:"\u25C7",8211:"\u2013",8212:"\u2014",62:">",45:"-"};function G(e){if(!e||e.trim()==="")return "\u2022";let n=e.charCodeAt(0);return _[n]?_[n]:n>=57344&&n<=63743||n<32||n>=127&&n<160?"\u2022":e}function oe(e,n){let t=[];for(let r=0;r<=n;r+=1){let i=e[r]??0;if(i<=0)break;t.push(i);}return t.length===0?"1.":`${t.join(".")}.`}var ae=["","I","II","III","IV","V","VI","VII","VIII","IX"],se=["","X","XX","XXX","XL","L","LX","LXX","LXXX","XC"],le=["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"];function U(e,n){if(e<=0)return "";let t="M".repeat(Math.floor(e/1e3))+le[Math.floor(e/100)%10]+se[Math.floor(e/10)%10]+ae[e%10];return n?t:t.toLowerCase()}function V(e,n){if(e<=0)return "";let t=[],r=e;for(;r>0;){let o=(r-1)%26;t.push(String.fromCharCode(65+o)),r=Math.floor((r-1)/26);}let i=t.reverse().join("");return n?i:i.toLowerCase()}function ue(e,n){if(e<=0)return "";switch(n){case "upperRoman":return U(e,true);case "lowerRoman":return U(e,false);case "upperLetter":return V(e,true);case "lowerLetter":return V(e,false);case "decimalZero":return f$1(e,2);case "decimalZero3":return f$1(e,3);case "decimalZero4":return f$1(e,4);case "decimalZero5":return f$1(e,5);case "none":return "";default:return String(e)}}function j(e,n,t){return e.replace(/%(\d)([.):\]])?/g,(r,i,o="")=>{let s=parseInt(i,10)-1;if(s<0)return "";let d=n[s]??0,u=t?.[s]??"decimal",f=ue(d,u);return f?f+o:""})}function Y(e,n,t){let r=e.numPr;if(!r)return null;let i=r.numId;if(i==null||i===0)return null;if(e.listIsBullet)return G(e.listMarker||"");let o=r.ilvl??0;if((e.listLevelNumFmts?.[o]??e.listNumFmt)==="none")return e.listMarker?e.listMarker:null;let d=e.listAbstractNumId??i,u=n.get(d)??new Array(9).fill(0),f=`${i}:${o}`;t.has(f)||(t.add(f),e.listStartOverride!=null&&(u[o]=e.listStartOverride-1)),u[o]=(u[o]??0)+1;for(let c=o+1;c<u.length;c+=1)u[c]=0;return n.set(d,u),e.listMarker&&e.listMarker.includes("%")?j(e.listMarker,u,e.listLevelNumFmts??void 0):e.listMarker?e.listMarker:oe(u,o)}function R(e,n){let t={};for(let r of e)switch(r.type.name){case "bold":t.bold=true,(r.attrs.cs===true||r.attrs.complexScript===true)&&(t.boldCs=true);break;case "italic":t.italic=true,(r.attrs.cs===true||r.attrs.complexScript===true)&&(t.italicCs=true);break;case "underline":{let i=r.attrs;if(i.style||i.color){let o=i.color?d(i.color,n):void 0;t.underline={style:i.style,color:o};}else t.underline=true;break}case "strike":t.strike=true;break;case "textColor":{let i=r.attrs;(i.themeColor||i.rgb)&&(t.color=d({rgb:i.rgb,themeColor:i.themeColor,themeTint:i.themeTint,themeShade:i.themeShade},n));break}case "highlight":t.highlight=i(r.attrs.color);break;case "fontSize":{let i=r.attrs,s=e.some(d=>d.type.name==="rtl")&&i.sizeCs!=null?i.sizeCs:i.size;s!=null&&(t.fontSize=s/2),i.sizeCs!=null&&(t.fontSizeCs=i.sizeCs/2);break}case "fontFamily":{let i=r.attrs;t.fontSlots={ascii:i.ascii,hAnsi:i.hAnsi,eastAsia:i.eastAsia,cs:i.cs,asciiTheme:i.asciiTheme,hAnsiTheme:i.hAnsiTheme,eastAsiaTheme:i.eastAsiaTheme,csTheme:i.csTheme,hint:i.hint??void 0};let o=e.some(s=>s.type.name==="rtl");t.fontFamily=(o?i.cs:void 0)||i.ascii||i.hAnsi||i.eastAsia||i.cs;break}case "language":t.language={latin:r.attrs.latin??r.attrs.val,eastAsia:r.attrs.eastAsia,bidi:r.attrs.bidi};break;case "complexScript":t.complexScript=r.attrs.enabled!==false,typeof r.attrs.bold=="boolean"&&(t.boldCs=r.attrs.bold),typeof r.attrs.italic=="boolean"&&(t.italicCs=r.attrs.italic);break;case "characterSpacing":{let i=r.attrs;i.spacing!=null&&i.spacing!==0&&(t.letterSpacing=a(i.spacing)),i.position!=null&&i.position!==0&&(t.positionPx=k(i.position)),i.scale!=null&&i.scale!==100&&(t.horizontalScale=i.scale),i.kerning!=null&&i.kerning>0&&(t.kerningMinPt=l(i.kerning));break}case "allCaps":t.allCaps=true;break;case "smallCaps":t.smallCaps=true;break;case "emboss":t.emboss=true;break;case "imprint":t.imprint=true;break;case "textShadow":t.textShadow=true;break;case "textOutline":t.textOutline=true;break;case "hidden":t.hidden=true;break;case "rtl":t.rtl=true;break;case "textEffect":{let i=r.attrs.effect;(i==="blinkBackground"||i==="lights"||i==="antsBlack"||i==="antsRed"||i==="shimmer"||i==="sparkle")&&(t.textEffect=i);break}case "modernTextEffects":{let i=r.attrs.effects;i&&(t.modernEffects=i);break}case "emphasisMark":{let i=r.attrs.type;i==="dot"||i==="comma"||i==="circle"||i==="underDot"?t.emphasisMark=i:t.emphasisMark="dot";break}case "superscript":t.superscript=true;break;case "subscript":t.subscript=true;break;case "hyperlink":{let i=r.attrs;t.hyperlink={href:i.href,tooltip:i.tooltip};break}case "footnoteRef":{let i=r.attrs,o=typeof i.id=="string"?parseInt(i.id,10):i.id;i.noteType==="endnote"?t.endnoteRefId=o:t.footnoteRefId=o,t.superscript=true;break}case "comment":{let i=r.attrs.commentId;i&&(t.commentIds||(t.commentIds=[]),t.commentIds.push(i));break}case "insertion":t.isInsertion=true,t.changeAuthor=r.attrs.author,t.changeDate=r.attrs.date,t.changeRevisionId=r.attrs.revisionId;break;case "deletion":t.isDeletion=true,t.changeAuthor=r.attrs.author,t.changeDate=r.attrs.date,t.changeRevisionId=r.attrs.revisionId;break}return t}function ce(e){let n=e.defaultTextFormatting;if(!n)return {};let t={};if(n.fontFamily){t.fontSlots={...n.fontFamily};let r=n.fontFamily.ascii||n.fontFamily.hAnsi||n.fontFamily.eastAsia||n.fontFamily.cs;r&&(t.fontFamily=r);}return n.fontSize!=null&&(t.fontSize=n.fontSize/2),n.fontSizeCs!=null&&(t.fontSizeCs=n.fontSizeCs/2),n.boldCs!=null&&(t.boldCs=n.boldCs),n.italicCs!=null&&(t.italicCs=n.italicCs),n.cs!=null&&(t.complexScript=n.cs),n.language&&(t.language={...n.language}),t}function $(e){e.hyperlink&&(e.hyperlink={...e.hyperlink,noDefaultStyle:true},delete e.color,delete e.underline);}function de(e){return e==="contentLocked"||e==="sdtContentLocked"}function fe(e,n){let t=e.attrs;if(t.sdtType==="checkbox"&&!(de(t.lock)||t.dataBinding!=null))return {kind:"checkbox",groupId:`sdt@${n}`,pos:n,tag:t.tag!=null?String(t.tag):void 0,alias:t.alias!=null?String(t.alias):void 0,checked:typeof t.checked=="boolean"?t.checked:void 0}}var P=new Set;function pe(e){if(!(typeof e!="string"||e.length===0))try{let n=JSON.parse(e);return Array.isArray(n)?n.map(t=>{if(typeof t!="object"||t==null)return null;let r=t;return typeof r.position!="number"||typeof r.color!="string"?null:{position:r.position,color:r.color}}).filter(t=>t!=null):void 0}catch{return}}function Z(e){if(e?.kind){if(e.kind==="pattern")return {type:"pattern",color:c$1(e.foregroundColor??e.color),patternPreset:e.patternPreset,foregroundColor:c$1(e.foregroundColor),backgroundColor:c$1(e.backgroundColor)};if(e.kind==="picture"){let n=e.picture?.src;return {type:"picture",color:c$1(e.color),pictureRelId:e.picture?.rId,pictureSrc:n&&(n.startsWith("data:")||n.startsWith("blob:"))?n:void 0,pictureSrcRect:e.srcRect,pictureFillMode:e.fillMode,pictureTile:e.tile,pictureStretchRect:e.stretchRect,pictureOpacity:e.pictureOpacity}}if(e.kind==="theme")return {type:"solid",color:c$1(e.color),themeRefIndex:e.themeRefIndex}}}function me(e){let n=Z(e.fillPaint);if(n)return n;let t=e.fillType??"solid";return t==="none"?{type:"none"}:t==="gradient"?{type:"gradient",color:e.fillColor,gradientType:e.gradientType,gradientAngle:e.gradientAngle,gradientStops:pe(e.gradientStops)}:t==="pattern"||t==="picture"?{type:t,color:e.fillColor}:{type:"solid",color:e.fillColor}}function ge(e){if(!(e.outlineWidth==null&&!e.outlineColor&&!e.outlineStyle))return {color:e.outlineColor,width:e.outlineWidth,dash:e.outlineStyle}}function he(e){let n={};if(typeof e.rotation=="number")n.rotation=e.rotation;else if(e.transform){let t=e.transform.match(/rotate\(([-\d.]+)deg\)/);t&&(n.rotation=parseFloat(t[1]));}return (e.flipH||e.transform?.includes("scaleX(-1)"))&&(n.flipH=true),(e.flipV||e.transform?.includes("scaleY(-1)"))&&(n.flipV=true),Object.keys(n).length>0?n:void 0}function be(e){return e.geometryPath?.length?e.geometryPath:null}function ye(e){if(typeof e!="string"||e.length===0)return [];try{let n=JSON.parse(e);return Array.isArray(n)?n.filter(t=>typeof t=="object"&&t!=null&&t.type==="shape"):[]}catch{return []}}function ke(e){return c$1(e?.color)}function Te(e){let n={};if(!e)return n;e.bold&&(n.bold=true),e.boldCs!=null&&(n.boldCs=e.boldCs),e.italic&&(n.italic=true),e.italicCs!=null&&(n.italicCs=e.italicCs),e.underline&&(n.underline=true),e.strike&&(n.strike=true);let t=ke(e);t&&(n.color=t),e.fontSize!=null&&(n.fontSize=e.fontSize/2),e.fontSizeCs!=null&&(n.fontSizeCs=e.fontSizeCs/2),e.fontFamily&&(n.fontSlots={...e.fontFamily});let r=e.fontFamily?.ascii||e.fontFamily?.hAnsi||e.fontFamily?.eastAsia||e.fontFamily?.cs;return r&&(n.fontFamily=r),e.cs!=null&&(n.complexScript=e.cs),e.language&&(n.language={...e.language}),n}function Se(e,n,t){let r=t?.match(/rotate\(\s*(-?\d+(?:\.\d+)?)deg\s*\)/i),i=r?Number(r[1]):0,o=Number.isFinite(i)?(i%360+360)%360:0,s=o*Math.PI/180,d=Math.abs(Math.cos(s)),u=Math.abs(Math.sin(s)),f=e*d+n*u,c=e*u+n*d;return {rotationDeg:o||void 0,flipH:t?.includes("scaleX(-1)")||void 0,flipV:t?.includes("scaleY(-1)")||void 0,rotationBounds:o!==0?{width:f,height:c,offsetX:(f-e)/2,offsetY:(c-n)/2}:void 0}}function J(e){let n=Te(e.formatting),t=[];for(let r of e.content)switch(r.type){case "text":r.text&&t.push({kind:"text",text:r.text,...n});break;case "tab":t.push({kind:"tab",...n});break;case "break":t.push({kind:"lineBreak"});break}return t}function xe(e){return e.type==="run"?J(e):e.type==="hyperlink"?e.children.flatMap(n=>n.type==="run"?J(n):[]):[]}function Be(e){let n=e.formatting?.alignment,t=n==="both"?"justify":n==="left"||n==="center"||n==="right"?n:void 0;return {kind:"paragraph",id:c(),paraId:e.paraId,runs:e.content.flatMap(xe),attrs:{...t?{alignment:t}:{}}}}function Fe(e){let n=Z(e.fillPaint);if(n)return n;let t=e.fill;if(t)return t.type==="none"?{type:"none"}:t.type==="gradient"?{type:"gradient",color:c$1(t.color),gradientType:t.gradient?.type,gradientAngle:t.gradient?.angle,gradientStops:t.gradient?.stops.map(r=>({position:r.position,color:c$1(r.color)??"#000000"}))}:{type:t.type,color:c$1(t.color)}}function Ce(e){let n=e.outline;if(n)return {color:c$1(n.color),width:n.width!=null?b$2(n.width):void 0,dash:n.style}}function we(e){let n={};return e.transform?.rotation!=null&&(n.rotation=e.transform.rotation),e.transform?.flipH&&(n.flipH=true),e.transform?.flipV&&(n.flipV=true),Object.keys(n).length>0?n:void 0}function q(e,n){let t=e.shapeType||"rect",r=d$2(t);if(!r)return P.has(t)||(P.add(t),console.warn(`[openooxml] DrawingML preset geometry "${t}" is deferred and was not emitted as a ShapeBlock.`)),null;let i=b$1(b$2(e.size?.width)||100,b$2(e.size?.height)||80,n.pageContentHeight);return {kind:"shape",id:c(),shapeType:t,geometryPath:r,fill:Fe(e),stroke:Ce(e),transform:we(e),width:i.width,height:i.height,x:e.offset?b$2(e.offset.x):void 0,y:e.offset?b$2(e.offset.y):void 0,innerText:e.textBody?.content.map(Be),children:e.children?.map(o=>q(o,n)).filter(o=>o!=null)}}function K(e,n,t){let r=e.attrs,i=r.shapeType||"rect",o=be(r)??d$2(i);if(!o)return P.has(i)||(P.add(i),console.warn(`[openooxml] DrawingML preset geometry "${i}" is deferred and was not emitted as a ShapeBlock.`)),null;let s=b$1(r.width||100,r.height||80,t.pageContentHeight),d=n+e.nodeSize;return {kind:"shape",id:c(),shapeType:i,geometryPath:o,fill:me(r),stroke:ge(r),transform:he(r),width:s.width,height:s.height,children:ye(r.children).map(u=>q(u,t)).filter(u=>u!=null),docStart:n,docEnd:d,pmStart:n,pmEnd:d}}function Q(e,n,t){let r=e.attrs;if(!r.chartJson)return null;try{let i=JSON.parse(r.chartJson),o=b$1(r.width||320,r.height||220,t.pageContentHeight),s=n+e.nodeSize;return {kind:"chart",id:c(),chart:i,width:o.width,height:o.height,docStart:n,docEnd:s,pmStart:n,pmEnd:s}}catch{return null}}function ee(e,n,t){let r=[],i=n+1,o=t.theme,s=ce(e.attrs),d=e.attrs.styleId,u=typeof d=="string"&&/^TOC\d*$/i.test(d);function f(c,m,g){if(c.isText&&c.text){let l=R(c.marks,o);u&&$(l);let a={kind:"text",text:c.text,...s,...l,logicalOrder:r.length,pmStart:m,pmEnd:m+c.nodeSize,inlineSdtWidget:g};r.push(a);}else if(c.type.name==="hardBreak")r.push({kind:"lineBreak",pmStart:m,pmEnd:m+c.nodeSize});else if(c.type.name==="tab"){let l=R(c.marks,o),a={kind:"tab",...s,...l,logicalOrder:r.length,pmStart:m,pmEnd:m+c.nodeSize};r.push(a);}else if(c.type.name==="image"){let l=c.attrs,a=b$1(l.width||100,l.height||100,t.pageContentHeight),p=R(c.marks,o),b=l.transform,y={kind:"image",src:l.src,width:a.width,height:a.height,alt:l.alt,transform:b,...Se(a.width,a.height,b),wrapType:l.wrapType,displayMode:l.displayMode,cssFloat:l.cssFloat,distTop:l.distTop,distBottom:l.distBottom,distLeft:l.distLeft,distRight:l.distRight,position:l.position,cropTop:l.cropTop,cropRight:l.cropRight,cropBottom:l.cropBottom,cropLeft:l.cropLeft,opacity:l.opacity,isInsertion:p.isInsertion,isDeletion:p.isDeletion,changeAuthor:p.changeAuthor,changeDate:p.changeDate,changeRevisionId:p.changeRevisionId,pmStart:m,pmEnd:m+c.nodeSize};r.push(y);}else {if(c.type.name==="shape")return;if(c.type.name==="chart")return;if(c.type.name==="field"){let l=c.attrs.fieldType,a=l==="PAGE"?"PAGE":l==="NUMPAGES"?"NUMPAGES":l==="DATE"?"DATE":l==="TIME"?"TIME":"OTHER",p=R(c.marks,o);u&&$(p);let b=c.attrs.instruction||void 0;r.push({kind:"field",fieldType:a,...l&&l!==a?{rawType:l}:{},...b?{instruction:b}:{},fallback:c.attrs.displayText||"",...s,...p,logicalOrder:r.length,pmStart:m,pmEnd:m+c.nodeSize});}else if(c.type.name==="math"){let l=c.attrs.plainText||"[equation]";r.push({kind:"text",text:l,italic:true,fontFamily:"Cambria Math",pmStart:m,pmEnd:m+c.nodeSize});}else if(c.type.name==="sdt"){let l=fe(c,m)??g,a=m+1;c.forEach((p,b)=>{f(p,a+b,l);});}}}return e.forEach((c,m)=>{f(c,i+m);}),r}var Le="Calibri",Me=11;function Re(e$1,n,t,r,i){let o={};if(e$1.alignment){let a=e$1.alignment;a==="both"||a==="distribute"?o.alignment="justify":a==="left"?o.alignment="left":a==="center"?o.alignment="center":a==="right"&&(o.alignment="right");}let s=e$1._originalFormatting?.beforeAutospacing,d=e$1._originalFormatting?.afterAutospacing;(s||d||e$1.spaceBefore!=null||e$1.spaceAfter!=null||e$1.lineSpacing!=null)&&(o.spacing={},s?o.spacing.before=f$2:e$1.spaceBefore!=null&&(o.spacing.before=a(e$1.spaceBefore)),d?o.spacing.after=f$2:e$1.spaceAfter!=null&&(o.spacing.after=a(e$1.spaceAfter)),e$1.lineSpacing!=null&&(e$1.lineSpacingRule==="exact"||e$1.lineSpacingRule==="atLeast"?(o.spacing.line=a(e$1.lineSpacing),o.spacing.lineUnit="px",o.spacing.lineRule=e$1.lineSpacingRule):(o.spacing.line=e$1.lineSpacing/240,o.spacing.lineUnit="multiplier",o.spacing.lineRule="auto"))),e$1.spacingExplicit&&(o.spacingExplicit=e$1.spacingExplicit);let u=e$1.indentLeft,f=e$1.indentFirstLine,c=e$1.hangingIndent;if(e$1.numPr?.numId&&u==null&&(u=((e$1.numPr.ilvl??0)+1)*720,f==null&&(f=-360,c=true)),(u!=null||e$1.indentRight!=null||f!=null)&&(o.indent={},u!=null&&(o.indent.left=a(u)),e$1.indentRight!=null&&(o.indent.right=a(e$1.indentRight)),f!=null&&(c?o.indent.hanging=Math.abs(a(f)):o.indent.firstLine=a(f))),e$1.styleId&&(o.styleId=e$1.styleId),e$1.borders){let a=e$1.borders;o.borders={};let p=b=>b?M(b,n):void 0;a.top&&(o.borders.top=p(a.top)),a.bottom&&(o.borders.bottom=p(a.bottom)),a.left&&(o.borders.left=p(a.left)),a.right&&(o.borders.right=p(a.right)),a.between&&(o.borders.between=p(a.between)),a.bar&&(o.borders.bar=p(a.bar)),!o.borders.top&&!o.borders.bottom&&!o.borders.left&&!o.borders.right&&!o.borders.between&&!o.borders.bar&&delete o.borders;}let m=e(e$1.shading?.fill,n);m&&(o.shading=`#${m}`),e$1.tabs&&e$1.tabs.length>0&&(o.tabs=e$1.tabs.map(a=>({val:Pe(a.alignment),pos:a.position,leader:a.leader}))),e$1.pageBreakBefore&&(o.pageBreakBefore=true),e$1.keepNext&&(o.keepNext=true),e$1.keepLines&&(o.keepLines=true),e$1.contextualSpacing&&(o.contextualSpacing=true),e$1.bidi&&(o.bidi=true),e$1.styleId&&(o.styleId=e$1.styleId),e$1.numPr&&(o.numPr={numId:e$1.numPr.numId,ilvl:e$1.numPr.ilvl});let g=t&&r?Y(e$1,t,r):null;g!=null?o.listMarker=g:e$1.listMarker&&(o.listMarker=e$1.listMarker),e$1.listIsBullet!=null&&(o.listIsBullet=e$1.listIsBullet),e$1.listMarkerHidden&&(o.listMarkerHidden=true),e$1.listMarkerFontFamily&&(o.listMarkerFontFamily=e$1.listMarkerFontFamily),e$1.listMarkerFontSize&&(o.listMarkerFontSize=e$1.listMarkerFontSize),e$1.listMarkerSuffix&&(o.listMarkerSuffix=e$1.listMarkerSuffix),i!==void 0&&(o.defaultTabStopTwips=i);let l=e$1.defaultTextFormatting;if(l&&(l.fontSize!=null&&(o.defaultFontSize=l.fontSize/2),l.fontFamily&&(o.defaultFontFamily=l.fontFamily.ascii||l.fontFamily.hAnsi)),e$1.pPrIns&&(o.pPrIns=e$1.pPrIns),e$1.pPrDel&&(o.pPrDel=e$1.pPrDel),e$1.numPr){let a=e$1.pPrChange,p=Array.isArray(a)&&a.some(b=>!b?.previousFormatting?.numPr);e$1.pPrDel?o.listMarkerRevision="del":(e$1.pPrIns||p)&&(o.listMarkerRevision="ins");}return o}function Pe(e){switch(e){case "left":return "start";case "right":return "end";case "center":return "center";case "decimal":return "decimal";case "bar":return "bar";case "clear":return "clear";case "num":return "start";default:return "start"}}function E(e,n,t){let r=e.attrs,i=ee(e,n,t),o=Re(r,t.theme,t.listCounters,t.listSeenNumIds,t.defaultTabStopTwips);return {kind:"paragraph",id:c(),paraId:r.paraId||void 0,runs:i,attrs:o,pmStart:n,pmEnd:n+e.nodeSize}}function te(e,n,t){let r=false;if(e.forEach(u=>{(u.type.name==="shape"||u.type.name==="chart")&&(r=true);}),!r)return [E(e,n,t)];let i=[],o=[],s=0,d=()=>{if(o.length===0)return;let u=e.type.create(e.attrs,o,e.marks),f=E(u,n+s,t);f.runs.length>0&&i.push(f),o=[];};return e.forEach((u,f)=>{if(u.type.name==="shape"||u.type.name==="chart"){if(d(),u.type.name==="shape"){let c=K(u,n+1+f,t);c&&i.push(c);}else {let c=Q(u,n+1+f,t);c&&i.push(c);}return}o.length===0&&(s=f),o.push(u);}),d(),i}function Ie(e,n,t,r){let i=[],o=n+1;e.forEach(a=>{a.type.name==="paragraph"?i.push(...te(a,o,t)):a.type.name==="table"&&i.push(ne(a,o,t)),o+=a.nodeSize;});let s=e.attrs,d=s.width,u=s.widthType,f=d&&(!u||u==="dxa"||u==="auto")?a(d):void 0,c$1=s.margins,m=(a$1,p)=>{if(a$1!=null){let b=a(a$1);if(b>0)return b}if(p!=null){let b=a(p);if(b>=0)return b}return 0},g={top:m(c$1?.top,r?.top),right:m(c$1?.right,r?.right),bottom:m(c$1?.bottom,r?.bottom),left:m(c$1?.left,r?.left)},l=s.cellMarker;return {id:c(),blocks:i,colSpan:s.colspan,rowSpan:s.rowspan,width:f,widthValue:d,widthType:u,verticalAlign:s.verticalAlign,background:s.backgroundColor?`#${s.backgroundColor}`:void 0,borders:W(s,t.theme),padding:g,noWrap:s.noWrap||void 0,trackedMarker:l??void 0}}function ve(e,n,t,r){let i=[],o=n+1;e.forEach(u=>{(u.type.name==="tableCell"||u.type.name==="tableHeader")&&i.push(Ie(u,o,t,r)),o+=u.nodeSize;});let s=e.attrs,d=s._originalFormatting;return {id:c(),cells:i,height:s.height?a(s.height):void 0,heightRule:s.heightRule??void 0,isHeader:s.isHeader,cantSplit:d?.cantSplit||void 0,trackedIns:s.trIns??void 0,trackedDel:s.trDel??void 0}}function ne(e,n,t){let r=[],i=n+1,o=e.attrs.cellMargins;e.forEach(p=>{p.type.name==="tableRow"&&r.push(ve(p,i,t,o)),i+=p.nodeSize;});let d=e.attrs.columnWidths?.map(a),u=e.attrs.width,f=e.attrs.widthType;if(!d&&r.length>0){let b=r[0].cells.map(y=>y.width);b.every(y=>y!==void 0&&y>0)&&(d=b);}let c$1=e.attrs.justification,m=e.attrs._originalFormatting,g=m?.indent?.value&&m.indent.type==="dxa"?a(m.indent.value):void 0,l=e.attrs.floating,a$1=l?{horzAnchor:l.horzAnchor,vertAnchor:l.vertAnchor,tblpX:l.tblpX!==void 0?a(l.tblpX):void 0,tblpXSpec:l.tblpXSpec,tblpY:l.tblpY!==void 0?a(l.tblpY):void 0,tblpYSpec:l.tblpYSpec,topFromText:l.topFromText!==void 0?a(l.topFromText):void 0,bottomFromText:l.bottomFromText!==void 0?a(l.bottomFromText):void 0,leftFromText:l.leftFromText!==void 0?a(l.leftFromText):void 0,rightFromText:l.rightFromText!==void 0?a(l.rightFromText):void 0}:void 0;return {kind:"table",id:c(),rows:r,columnWidths:d,width:u,widthType:f,justification:c$1,bidi:e.attrs.bidi||void 0,indent:g,floating:a$1,pmStart:n,pmEnd:n+e.nodeSize}}function Ee(e,n,t){let r=e.attrs,i=r.wrapType,o=i==="behind"||i==="inFront",s=b$1(r.width||100,r.height||100,t),d=r.transform,u=d?.match(/rotate\(\s*(-?\d+(?:\.\d+)?)deg\s*\)/i),f=u?Number(u[1]):0,c$1=Number.isFinite(f)?(f%360+360)%360:0,m=c$1*Math.PI/180,g=Math.abs(Math.cos(m)),l=Math.abs(Math.sin(m)),a=s.width*g+s.height*l,p=s.width*l+s.height*g;return {kind:"image",id:c(),src:r.src,width:s.width,height:s.height,alt:r.alt,transform:d,rotationDeg:c$1||void 0,flipH:d?.includes("scaleX(-1)")||void 0,flipV:d?.includes("scaleY(-1)")||void 0,rotationBounds:c$1!==0?{width:a,height:p,offsetX:(a-s.width)/2,offsetY:(p-s.height)/2}:void 0,anchor:o?{isAnchored:true,offsetH:r.distLeft,offsetV:r.distTop,behindDoc:i==="behind"}:void 0,hlinkHref:r.hlinkHref,pmStart:n,pmEnd:n+e.nodeSize}}function ze(e,n,t){let r=e.attrs,i=[];return e.forEach((o,s)=>{if(o.type.name==="paragraph"){let d=E(o,n+1+s,t);i.push(d);}}),{kind:"textBox",id:c(),width:r.width??b,height:r.height??void 0,fillColor:r.fillColor,outlineWidth:r.outlineWidth,outlineColor:r.outlineColor,outlineStyle:r.outlineStyle,margins:{top:r.marginTop??a$1.top,bottom:r.marginBottom??a$1.bottom,left:r.marginLeft??a$1.left,right:r.marginRight??a$1.right},content:i,displayMode:r.displayMode,cssFloat:r.cssFloat,wrapType:r.wrapType,wrapText:r.wrapText,anchorTarget:r.anchorTarget,position:r.position,distTop:r.distTop,distBottom:r.distBottom,distLeft:r.distLeft,distRight:r.distRight,pmStart:n,pmEnd:n+e.nodeSize}}function st(e,n={}){let t=e.attrs?.defaultTabStopTwips,r={...n,defaultFont:n.defaultFont??Le,defaultSize:n.defaultSize??Me,defaultTabStopTwips:n.defaultTabStopTwips??t},i=[],o=0,s={top:1440,bottom:1440,left:1440,right:1440};r.listCounters||(r.listCounters=new Map),r.listSeenNumIds||(r.listSeenNumIds=new Set);let d=(u,f,c$1)=>{if(u.type.name==="blockSdt"){let g=u.attrs,l={id:`sdt@${f}`,sdtType:typeof g.sdtType=="string"?g.sdtType:"richText",tag:g.tag!=null?String(g.tag):void 0,alias:g.alias!=null?String(g.alias):void 0,lock:g.lock!=null?String(g.lock):void 0,checked:typeof g.checked=="boolean"?g.checked:void 0,bound:g.dataBinding!=null?true:void 0,repeatingItem:/<w15:repeatingSectionItem[\s/>]/.test(String(g.rawPropertiesXml??""))?true:void 0},a=[...c$1,l];u.forEach((p,b)=>{d(p,f+1+b,a);});return}let m=i.length;switch(u.type.name){case "paragraph":{let g=te(u,f,r),l=u.attrs;i.push(...g);let a$1=l._sectionProperties;if(a$1||l.sectionBreakType){let p={kind:"sectionBreak",id:c(),type:a$1?.sectionStart??l.sectionBreakType};if(a$1){if((a$1.pageWidth!==void 0||a$1.pageHeight!==void 0)&&(p.pageSize={w:a(a$1.pageWidth??12240),h:a(a$1.pageHeight??15840)}),a$1.marginTop!==void 0||a$1.marginBottom!==void 0||a$1.marginLeft!==void 0||a$1.marginRight!==void 0){let y={top:a$1.marginTop??s.top,bottom:a$1.marginBottom??s.bottom,left:a$1.marginLeft??s.left,right:a$1.marginRight??s.right};p.margins={top:a(y.top),bottom:a(y.bottom),left:a(y.left),right:a(y.right)},s=y;}let b=a$1.columnCount??1;if(b>1){let y={count:b,gap:a(a$1.columnSpace??720),equalWidth:a$1.equalWidth??true,separator:a$1.separator};p.columns=y;}}i.push(p);}}break;case "table":i.push(ne(u,f,r));break;case "image":i.push(Ee(u,f,r.pageContentHeight));break;case "textBox":i.push(ze(u,f,r));break;case "horizontalRule":case "pageBreak":{let g={kind:"pageBreak",id:c(),pmStart:f,pmEnd:f+u.nodeSize};i.push(g);break}}if(c$1.length>0)for(let g=m;g<i.length;g++)i[g].sdtGroups=c$1;};return e.forEach((u,f)=>{d(u,o+f,[]);}),i}function mt(e,n){let t=e.floating;if(!t)return false;let r=f(e,n),i=0;t.tblpX!==void 0?i=t.tblpX:t.tblpXSpec?t.tblpXSpec==="left"||t.tblpXSpec==="inside"?i=0:t.tblpXSpec==="right"||t.tblpXSpec==="outside"?i=n-r:t.tblpXSpec==="center"&&(i=(n-r)/2):e.justification==="center"?i=(n-r)/2:e.justification==="right"&&(i=n-r);let o=t.leftFromText??0,s=t.rightFromText??0,d=i-o,u=n-(i+r)-s;return d<24&&u<24}function gt(e,n,t){}export{M as a,j as b,st as c,mt as d,gt as e};
|
package/dist/chunk-JY6ILTNS.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-BI3B33LI.mjs';var o={TABLE_INDEX:"data-table-index",ROW_INDEX:"data-row",COLUMN_INDEX:"data-col",TABLE_CELL:"data-table-cell"};function b(e,l){if(!(e instanceof Element))return null;let t=e;for(;t&&t!==l;){if(t.tagName==="TD"||t.tagName==="TH"){let n=t.getAttribute(o.ROW_INDEX),r=t.getAttribute(o.COLUMN_INDEX);if(n!==null&&r!==null){let a=t;for(;a&&a!==l;){if(a.tagName==="TABLE"){let u=a.getAttribute(o.TABLE_INDEX);if(u!==null)return {tableIndex:parseInt(u,10),rowIndex:parseInt(n,10),columnIndex:parseInt(r,10)};break}a=a.parentElement;}}break}t=t.parentElement;}return null}function d(e,l){if(!e.package?.document?.content)return null;let t=0;for(let n of e.package.document.content)if(n.type==="table"){if(t===l)return n;t++;}return null}function f(e,l,t){if(!e.package?.document?.content)return e;let n=0,r=e.package.document.content.map(a=>{if(a.type==="table"){if(n===l)return n++,t;n++;}return a});return {...e,package:{...e.package,document:{...e.package.document,content:r}}}}function T(e,l){if(!e.package?.document?.content)return e;let t=0,n=e.package.document.content.filter(r=>{if(r.type==="table"){let a=t===l;return t++,!a}return true});return {...e,package:{...e.package,document:{...e.package.document,content:n}}}}var m=class extends a{constructor(){super({selectedCell:null});}selectCell(l){this.setSnapshot({selectedCell:l});}clearSelection(){this.setSnapshot({selectedCell:null});}isCellSelected(l,t,n){let{selectedCell:r}=this.getSnapshot();return r?r.tableIndex===l&&r.rowIndex===t&&r.columnIndex===n:false}getSelectedCell(){return this.getSnapshot().selectedCell}};export{o as a,b,d as c,f as d,T as e,m as f};
|
package/dist/chunk-KEE52TT5.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function d(t,r){let e=w(r),u=new RegExp(`<w:p[\\s][^>]*w14:paraId="${e}"`,"g"),s=[],i;for(;(i=u.exec(t))!==null;)s.push(i.index);if(s.length===0||s.length>1)return null;let o=s[0],n=o,a=0;for(;n<t.length;){let f=t.indexOf("<",n);if(f===-1)break;if(t.startsWith("<w:p",f)){let c=t[f+4];if(c===">"||c===" "||c==="/"){let l=t.indexOf(">",f);if(l===-1)break;if(t[l-1]==="/"){if(a===0)return {start:o,end:l+1};n=l+1;}else a++,n=l+1;}else n=f+1;}else if(t.startsWith("</w:p>",f)){if(a--,a===0)return {start:o,end:f+6};n=f+6;}else n=f+1;}return null}function h(t,r){let e=d(t,r);return e?t.substring(e.start,e.end):null}function g(t){let r=0,e=/<w:p[\s>]/g,u;for(;(u=e.exec(t))!==null;){let s=u.index,i=t[s+4];(i===">"||i===" ")&&r++;}return r}function p(t){let r=new Map,e=/w14:paraId="([^"]+)"/g,u;for(;(u=e.exec(t))!==null;){let s=u[1];r.set(s,(r.get(s)||0)+1);}return r}function b(t,r,e){if(e.size===0)return {safe:true};let u=p(t),s=p(r);for(let n of e){let a=u.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-original: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-original: ${n}`}}for(let n of e){let a=s.get(n)||0;if(a===0)return {safe:false,reason:`paraId-not-found-in-serialized: ${n}`};if(a>1)return {safe:false,reason:`duplicate-paraId-in-serialized: ${n}`}}let i=g(t),o=g(r);return i!==o?{safe:false,reason:`paragraph-count-mismatch: original=${i}, serialized=${o}`}:{safe:true}}function P(t,r,e){if(e.size===0)return t;if(!b(t,r,e).safe)return null;let s=[];for(let o of e){let n=d(t,o);if(!n)return null;let a=h(r,o);if(!a)return null;s.push({start:n.start,end:n.end,newXml:a});}s.sort((o,n)=>n.start-o.start);let i=t;for(let{start:o,end:n,newXml:a}of s)i=i.substring(0,o)+a+i.substring(n);return i}function w(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{b as a,P as b};
|
package/dist/chunk-KVKLLTDP.mjs
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-BIQWVK5P.mjs';import {a,b,c}from'./chunk-H3JCIGWK.mjs';import {h}from'./chunk-N5Q3YN64.mjs';import {a as a$1,g}from'./chunk-SINEY6ZF.mjs';new TextEncoder;new TextDecoder;async function L(e){let t=await crypto.subtle.digest("SHA-256",Uint8Array.from(e).buffer);return Array.from(new Uint8Array(t),r=>r.toString(16).padStart(2,"0")).join("")}var V=new TextEncoder,Y=new TextDecoder("utf-8",{ignoreBOM:true});function m(e){return typeof e=="string"?V.encode(e):e instanceof Uint8Array?e:new Uint8Array(e)}function u(e){return e?Y.decode(e):void 0}function w(e){let t=c(Object.fromEntries(e)),r=new ArrayBuffer(t.byteLength);return new Uint8Array(r).set(t),r}function k(e){return e.startsWith("/")?e.slice(1):`word/${e}`}function H(e){let t=[{relsPath:"word/_rels/document.xml.rels",blocks:e.package.document.content}],r=a=>(a??[]).flatMap(p=>p.content),n=[...r(e.package.footnoteSeparators),...r(e.package.footnotes)];n.length>0&&t.push({relsPath:"word/_rels/footnotes.xml.rels",blocks:n});let o=[...r(e.package.endnoteSeparators),...r(e.package.endnotes)];o.length>0&&t.push({relsPath:"word/_rels/endnotes.xml.rels",blocks:o});let i=e.package.relationships;if(!i)return t;let s=(a,p)=>{if(a)for(let[f,y]of a.entries()){let d=i.get(f);if(!d||d.type!==p||!d.target)continue;let x=k(d.target).replace(/^word\//,"");t.push({relsPath:`word/_rels/${x}.rels`,blocks:y.content});}};return s(e.package.headers,a$2.header),s(e.package.footers,a$2.footer),t}function E(e){let t=0;for(let r of e.matchAll(/Id="rId(\d+)"/g)){let n=parseInt(r[1],10);n>t&&(t=n);}return t}async function z(e,t,r={},n,o){await a(),await a$1();let i=o??{seed:await L(new Uint8Array(t)),now:new Date().toISOString()};G(i);let s=e.package,a$2={determinism:i,document:s.document,headerEntries:[...s.headers?.entries()??[]],footerEntries:[...s.footers?.entries()??[]],footnotes:s.footnotes??[],endnotes:s.endnotes??[],footnoteSeparators:s.footnoteSeparators??[],endnoteSeparators:s.endnoteSeparators??[],relationshipEntries:[...s.relationships?.entries()??[]],...s.numbering===void 0?{}:{numbering:s.numbering},options:{updateModifiedDate:r.updateModifiedDate??true,...r.modifiedBy===void 0?{}:{modifiedBy:r.modifiedBy}},...n===void 0?{}:{selective:{changedParaIds:[...n.changedParaIds]}}};I(a$2,"save");let p=g(JSON.stringify(a$2),new Uint8Array(t)),f=ee(p);return n||Z(e,t,f),{buffer:f,determinism:i}}function Z(e,t,r){let n=b(new Uint8Array(t)),o=b(new Uint8Array(r));for(let a of H(e)){let p=u(n[a.relsPath])??"",f=u(o[a.relsPath])??"",y=new Set(A(p).map(c=>l(c,"Id"))),d=A(f).filter(c=>l(c,"Type")?.endsWith("/image")).map(c=>l(c,"Id")).filter(c=>!!c&&!y.has(c)),h=J(a.blocks);if(h.length>d.length)throw new Error(`Rust save image mutation mismatch in ${a.relsPath}: ${h.length} model images, ${d.length} relationships`);h.forEach((c,g)=>{c.rId=d[g];});let x=A(f).filter(c=>l(c,"Type")?.endsWith("/hyperlink")&&l(c,"TargetMode")==="External");for(let c of B(a.blocks)){if(!c.href){W(f,c.rId)||(c.rId=void 0);continue}let g=x.find(S=>K(l(S,"Target")??"")===c.href),b=g&&l(g,"Id");b&&(c.rId=b);}}let i=e.package.headers,s=e.package.relationships;if(!(!i||!s))for(let[a,p]of i){let f=p.watermark;if(!f||f.kind!=="picture")continue;let y=s.get(a);if(!y?.target)continue;let h=`word/_rels/${k(y.target).replace(/^word\//,"")}.rels`,x=u(o[h])??"";if(W(x,f.relId))continue;let c=f.mediaPath?.split("/").pop(),g=A(x).find(S=>{if(!l(S,"Type")?.endsWith("/image"))return false;let q=l(S,"Target")?.split("/").pop();return c?q===c:true}),b=g&&l(g,"Id");b&&(f.relId=b);}}function J(e){let t=[],r=n=>{for(let o of n.content)o.type==="drawing"&&o.image.src?.startsWith("data:")&&!o.image.rId&&t.push(o.image);};for(let n of e)if(n.type==="paragraph"){for(let o of n.content)if(o.type==="run")r(o);else if(o.type==="insertion"||o.type==="deletion"||o.type==="moveFrom"||o.type==="moveTo")for(let i of o.content)i.type==="run"&&r(i);}else if(n.type==="table")for(let o of n.rows)for(let i of o.cells)t.push(...J(i.content));return t}function B(e){let t=[];for(let r of e)if(r.type==="paragraph")for(let n of r.content)n.type==="hyperlink"&&(n.href||n.rId)&&!n.anchor&&t.push(n);else if(r.type==="table")for(let n of r.rows)for(let o of n.cells)t.push(...B(o.content));else r.type==="blockSdt"&&t.push(...B(r.content));return t}function A(e){return [...e.matchAll(/<Relationship\b[^>]*\/?>/g)].map(t=>t[0])}function l(e,t){return e.match(new RegExp(`\\b${t}="([^"]*)"`))?.[1]}function W(e,t){if(t)return A(e).find(r=>l(r,"Id")===t)}function K(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").replace(/&#(\d+);/g,(t,r)=>String.fromCodePoint(Number(r))).replace(/&#x([0-9A-Fa-f]+);/g,(t,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&/g,"&")}function G(e){if(!/^[0-9a-f]{64}$/i.test(e.seed))throw new TypeError("Rust save determinism seed must be a SHA-256 hex digest");if(!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/.test(e.now))throw new TypeError("Rust save clock must be a UTC ISO-8601 millisecond timestamp")}var Q=new Set(["__proto__","constructor","prototype"]);function I(e,t,r=new WeakSet){if(!(e===null||typeof e!="object")){if(r.has(e))throw new TypeError(`${t} contains a cycle`);if(r.add(e),Array.isArray(e))e.forEach((n,o)=>I(n,`${t}[${o}]`,r));else for(let n of Object.keys(e)){if(Q.has(n))throw new TypeError(`${t} contains forbidden key ${n}`);I(e[n],`${t}.${n}`,r);}r.delete(e);}}function ee(e){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}async function M(){let e=new Map;e.set("[Content_Types].xml",m(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
2
|
-
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
|
|
3
|
-
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>
|
|
4
|
-
<Default Extension="xml" ContentType="application/xml"/>
|
|
5
|
-
<Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/>
|
|
6
|
-
<Override PartName="/word/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml"/>
|
|
7
|
-
<Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/>
|
|
8
|
-
<Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/>
|
|
9
|
-
</Types>`)),e.set("_rels/.rels",m(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
10
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
11
|
-
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/>
|
|
12
|
-
<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>
|
|
13
|
-
<Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/>
|
|
14
|
-
</Relationships>`)),e.set("word/_rels/document.xml.rels",m(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
15
|
-
<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
|
|
16
|
-
<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>
|
|
17
|
-
</Relationships>`)),e.set("word/document.xml",m(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
18
|
-
<w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
|
|
19
|
-
<w:body>
|
|
20
|
-
<w:p>
|
|
21
|
-
<w:r>
|
|
22
|
-
<w:t></w:t>
|
|
23
|
-
</w:r>
|
|
24
|
-
</w:p>
|
|
25
|
-
<w:sectPr>
|
|
26
|
-
<w:pgSz w:w="12240" w:h="15840"/>
|
|
27
|
-
<w:pgMar w:top="1440" w:right="1440" w:bottom="1440" w:left="1440" w:header="720" w:footer="720" w:gutter="0"/>
|
|
28
|
-
</w:sectPr>
|
|
29
|
-
</w:body>
|
|
30
|
-
</w:document>`)),e.set("word/styles.xml",m(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
31
|
-
<w:styles xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
|
|
32
|
-
<w:docDefaults>
|
|
33
|
-
<w:rPrDefault>
|
|
34
|
-
<w:rPr>
|
|
35
|
-
<w:rFonts w:ascii="Calibri" w:hAnsi="Calibri"/>
|
|
36
|
-
<w:sz w:val="22"/>
|
|
37
|
-
</w:rPr>
|
|
38
|
-
</w:rPrDefault>
|
|
39
|
-
<w:pPrDefault>
|
|
40
|
-
<w:pPr>
|
|
41
|
-
<w:spacing w:after="200" w:line="276" w:lineRule="auto"/>
|
|
42
|
-
</w:pPr>
|
|
43
|
-
</w:pPrDefault>
|
|
44
|
-
</w:docDefaults>
|
|
45
|
-
<w:style w:type="paragraph" w:default="1" w:styleId="Normal">
|
|
46
|
-
<w:name w:val="Normal"/>
|
|
47
|
-
</w:style>
|
|
48
|
-
</w:styles>`));let t=new Date().toISOString();return e.set("docProps/core.xml",m(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
49
|
-
<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
50
|
-
<dc:creator>OpenOOXML DOCX Editor</dc:creator>
|
|
51
|
-
<dcterms:created xsi:type="dcterms:W3CDTF">${t}</dcterms:created>
|
|
52
|
-
<dcterms:modified xsi:type="dcterms:W3CDTF">${t}</dcterms:modified>
|
|
53
|
-
</cp:coreProperties>`)),e.set("docProps/app.xml",m(`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
|
54
|
-
<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties">
|
|
55
|
-
<Application>OpenOOXML DOCX Editor</Application>
|
|
56
|
-
<AppVersion>1.0.0</AppVersion>
|
|
57
|
-
</Properties>`)),w(e)}var De="application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml",Oe="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtended+xml",Re="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsIds+xml",Ee="application/vnd.openxmlformats-officedocument.wordprocessingml.commentsExtensible+xml",te="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",re="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";async function C(e,t={}){if(!e.originalBuffer)throw new Error("Cannot repack document: no original buffer for round-trip. Use createDocx() for new documents.");return (await z(e,e.originalBuffer,t)).buffer}async function Be(e,t,r={}){return C({...e,originalBuffer:t.originalBuffer},r)}function O(e){return new Map(Object.entries(b(new Uint8Array(e))))}async function Ie(e,t,r={}){return X(e,new Map([["word/document.xml",t]]),r)}async function Me(e,t,r,n={}){return X(e,new Map([[t,r]]),n)}async function X(e,t,r={}){return ne(O(e),t,r)}async function ne(e,t,r={}){for(let[n,o]of t)e.set(n,m(o));return w(e)}function v(e,t){let r="word/_rels/document.xml.rels",n=u(e.get(r));if(n===void 0)throw new Error("document.xml.rels not found in DOCX");let o=`rId${E(n)+1}`,i=t.targetMode==="External"?' TargetMode="External"':"",s=`<Relationship Id="${o}" Type="${P(t.type)}" Target="${P(t.target)}"${i}/>`,a=n.replace(/<Relationships([^>]*)\/>/,"<Relationships$1></Relationships>");return e.set(r,m(a.replace("</Relationships>",`${s}</Relationships>`))),o}async function Ce(e,t){let r=O(e),n=v(r,t);return {buffer:w(r),rId:n}}async function Ue(e,t,r,n){let o=O(e),i=`word/media/${t}`;o.set(i,m(r));let s=v(o,{type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",target:`media/${t}`}),a=u(o.get("[Content_Types].xml")),p=t.split(".").pop()?.toLowerCase()??"";if(a!==void 0&&p&&!a.includes(`Extension="${p}"`)){let f=`<Default Extension="${P(p)}" ContentType="${P(n||oe(p))}"/>`;o.set("[Content_Types].xml",m(a.replace("</Types>",`${f}</Types>`)));}return {buffer:w(o),rId:s,path:i}}function oe(e){return {png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",bmp:"image/bmp",tif:"image/tiff",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp",wmf:"image/x-wmf",emf:"image/x-emf"}[e]??"application/octet-stream"}function Fe(e,t){let r=e;if(t.updateModifiedDate){let n=`<dcterms:modified xsi:type="dcterms:W3CDTF">${new Date().toISOString()}</dcterms:modified>`;r=r.includes("<dcterms:modified")?r.replace(/<dcterms:modified[^<>]*>[^<]*<\/dcterms:modified>/,n):r.replace("</cp:coreProperties>",`${n}</cp:coreProperties>`);}if(t.modifiedBy){let n=`<cp:lastModifiedBy>${P(t.modifiedBy)}</cp:lastModifiedBy>`;r=r.includes("<cp:lastModifiedBy")?r.replace(/<cp:lastModifiedBy>[^<]*<\/cp:lastModifiedBy>/,n):r.replace("</cp:coreProperties>",`${n}</cp:coreProperties>`);}return r}async function Ne(e){let t=[],r=[];try{let n=O(e);for(let s of ["[Content_Types].xml","word/document.xml"])n.has(s)||t.push(`Missing required file: ${s}`);for(let s of ["_rels/.rels","word/_rels/document.xml.rels","word/styles.xml"])n.has(s)||r.push(`Missing recommended file: ${s}`);let o=u(n.get("word/document.xml"));o!==void 0&&(o.includes("<?xml")||r.push("document.xml missing XML declaration"),o.includes("<w:document")||t.push("document.xml missing w:document element"),o.includes("<w:body>")||t.push("document.xml missing w:body element"));let i=u(n.get("[Content_Types].xml"));i!==void 0&&!i.includes("word/document.xml")&&!i.includes("application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml")&&r.push("Content_Types.xml may be missing document.xml type declaration");}catch(n){let o=n instanceof Error?n.message:typeof n=="string"?n:"Unknown error";t.push(`Failed to read as ZIP: ${o}`);}return {valid:t.length===0,errors:t,warnings:r}}function je(e){if(e.byteLength<4)return false;let t=new Uint8Array(e);return t[0]===80&&t[1]===75}async function _e(e){let t=await M();return C({...e,originalBuffer:t})}function Le(e){let t=new Map,r=e.package.relationships;if(!r)return t;let n=[{map:e.package.headers,relationshipType:te},{map:e.package.footers,relationshipType:re}];for(let{map:o,relationshipType:i}of n)for(let[s,a]of o??[]){let p=r.get(s);p?.type===i&&p.target&&t.set(k(p.target),h(a));}return t}function P(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}var He=C;
|
|
58
|
-
export{E as a,z as b,M as c,De as d,Oe as e,Re as f,Ee as g,C as h,Be as i,Ie as j,Me as k,X as l,ne as m,Ce as n,Ue as o,Fe as p,Ne as q,je as r,_e as s,Le as t,He as u};
|
package/dist/chunk-L5ISVQ3W.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {d as d$1,a,c}from'./chunk-FZIA7OFY.mjs';var s={black:"000000",blue:"0000FF",cyan:"00FFFF",darkBlue:"00008B",darkCyan:"008B8B",darkGray:"A9A9A9",darkGreen:"006400",darkMagenta:"8B008B",darkRed:"8B0000",darkYellow:"808000",green:"00FF00",lightGray:"D3D3D3",magenta:"FF00FF",red:"FF0000",white:"FFFFFF",yellow:"FFFF00",none:""};function d(e){if(!e||e==="none")return "";let r=s[e];return r?`#${r}`:""}function S(e,r){return e?e.auto?"transparent":d$1(e,r):""}function v(e,r){if(!e)return false;if(e.auto)return true;let n=d$1(e,r).replace(/^#/,"").toLowerCase(),o=a(n);return (o.r+o.g+o.b)/3<20}function k(e,r){if(!e)return false;let n=d$1(e,r).replace(/^#/,"").toLowerCase(),o=a(n);return (o.r+o.g+o.b)/3>235}function V(e){if(!e)return;let r=e.trim();if(r.toLowerCase()==="auto")return {auto:true};let t=c(r);if(t)return {themeColor:t};let n=r.replace(/^#/,"").toUpperCase();return /^[0-9A-F]{6}$/i.test(n)?{rgb:n}:/^[0-9A-F]{3}$/i.test(n)?{rgb:n.split("").map(u=>u+u).join("")}:{rgb:n.padStart(6,"0").slice(0,6)}}function y(e,r,t){let n={themeColor:e};return r!==void 0&&r>0&&r<1&&(n.themeTint=Math.round(r*255).toString(16).toUpperCase().padStart(2,"0")),t!==void 0&&t>0&&t<1&&(n.themeShade=Math.round(t*255).toString(16).toUpperCase().padStart(2,"0")),n}function B(e){return {rgb:e.replace(/^#/,"").toUpperCase()}}function f(e){return e.startsWith("#")?e:`#${e}`}function H(e){return d(e)||f(e)}function w(e,r,t){if(!e&&!r)return true;if(!e||!r)return false;let n=d$1(e,t).toUpperCase(),o=d$1(r,t).toUpperCase();return n===o}export{d as a,S as b,v as c,k as d,V as e,y as f,B as g,f as h,H as i,w as j};
|
package/dist/chunk-LDUWIM7M.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a as a$2,C as C$1,v}from'./chunk-DXKG3HQ5.mjs';import {a as a$3}from'./chunk-FPZBTOD6.mjs';import {a}from'./chunk-H3JCIGWK.mjs';import {a as a$1}from'./chunk-SINEY6ZF.mjs';var x=new WeakMap;function D(t){return x.get(t)}var C=new WeakMap;function h(t){let e=C.get(t);if(e)return e;let a=typeof process>"u"?void 0:process.env.OPENOOXML_DOCX_PARSE_BACKEND??process.env.DOCX_PARSE_BACKEND;return a==="rust"?a:F}var F="rust";async function s(t,e={}){await a(),await a$1();let a$4=t instanceof ArrayBuffer?t:await a$2(t);h(e);let n=e.onProgress??(()=>{});try{n("Extracting DOCX...",0);let r=a$3(a$4,g(e));return k(e,n),await w(r,e.preloadFonts??!0,n),n("Assembling document...",95),n("Complete",100),r.document}catch(r){let o=r instanceof Error?r.message:String(r);if(o.startsWith("Failed to parse DOCX: "))throw r;let i=S(o),P=i.code==="Container"?o.replace(/^container error: /,""):o,c=new Error(`Failed to parse DOCX: ${P}`,{cause:r});throw Object.assign(c,i),c}}function g(t){let e=D(t)?.seed;return {parseHeadersFooters:t.parseHeadersFooters??true,parseNotes:t.parseNotes??true,detectVariables:t.detectVariables??true,...e?{determinismSeed:e}:{},includeCanonical:false}}function k(t,e){e("Extracted DOCX",10),e("Parsing relationships...",10),e("Parsed relationships",15),e("Parsing theme...",15),e("Parsed theme",20),e("Parsing styles...",20),e("Parsed styles",30),e("Parsing numbering...",30),e("Parsed numbering",35),e("Processing media files...",35),e("Processed media",40),e("Parsing document body...",40),e("Parsed document body",55),t.parseHeadersFooters??true?(e("Parsing headers/footers...",55),e("Parsed headers/footers",65)):e("Skipping headers/footers",65),t.parseNotes??true?(e("Parsing footnotes/endnotes...",65),e("Parsed footnotes/endnotes",75)):e("Skipping footnotes/endnotes",75),e("Parsing comments...",75),t.detectVariables??true?(e("Detecting template variables...",75),e("Detected variables",80)):e("Skipping variable detection",80);}async function w(t,e,a){if(!e){a("Skipping font loading",95);return}a("Loading fonts...",80),await O(t.document.package.theme??null,t.document.package.styles,t.document.package.document),await C$1(t.document.package.fontTable,t.embeddedFonts,t.fontTableRelationshipsXml),a("Loaded fonts",95);}async function O(t,e,a){let n=new Set;t?.fontScheme?.majorFont?.latin&&n.add(t.fontScheme.majorFont.latin),t?.fontScheme?.minorFont?.latin&&n.add(t.fontScheme.minorFont.latin),e?.docDefaults?.rPr?.fontFamily?.ascii&&n.add(e.docDefaults.rPr.fontFamily.ascii);for(let r of e?.styles??[])r.rPr?.fontFamily?.ascii&&n.add(r.rPr.fontFamily.ascii),r.rPr?.fontFamily?.hAnsi&&n.add(r.rPr.fontFamily.hAnsi);for(let r of a.content)if(r.type==="paragraph")for(let o of r.content)o.type==="run"&&(o.formatting?.fontFamily?.ascii&&n.add(o.formatting.fontFamily.ascii),o.formatting?.fontFamily?.hAnsi&&n.add(o.formatting.fontFamily.hAnsi));if(n.size!==0)try{await v([...n]);}catch(r){console.warn("Failed to load some fonts:",r);}}function S(t){let e=/(?:unsafe XML|resource limit .* exceeded|malformed XML|invalid relationship) in ([^:]+)(?::| at)/.exec(t)?.[1],a=/ at byte (\d+):/.exec(t)?.[1];return {code:t.startsWith("unsafe XML")?"UnsafeXml":t.startsWith("resource limit")?"ResourceLimit":t.startsWith("malformed XML")?"MalformedXml":t.startsWith("invalid relationship")?"Relationship":t.startsWith("container error")?"Container":t.startsWith("wire.")?"Wire":"Parse",...e?{part:e}:{},...a?{offset:Number(a)}:{}}}async function A(t){return s(t,{preloadFonts:false,parseHeadersFooters:false,parseNotes:false,detectVariables:true})}async function _(t,e){return s(t,{onProgress:e,preloadFonts:true,parseHeadersFooters:true,parseNotes:true,detectVariables:true})}async function V(t){return (await A(t)).templateVariables??[]}async function j(t){let e=await s(t,{preloadFonts:false}),a=e.package,n=new Set([...a.media?.values()??[]].map(r=>r.path));return {hasDocument:true,hasStyles:a.styles!==void 0,hasTheme:a.theme!==void 0,hasNumbering:a.numbering!==void 0,headerCount:a.headers?.size??0,footerCount:a.footers?.size??0,mediaCount:n.size,variableCount:e.templateVariables?.length??0}}export{s as a,A as b,_ as c,V as d,j as e};
|
package/dist/chunk-N5Q3YN64.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {d,e,f as f$1}from'./chunk-SINEY6ZF.mjs';var l={seed:"0".repeat(64),now:"2000-01-01T00:00:00.000Z"};function n(e$1,t){let i=JSON.stringify({...t,determinism:l}),s=e$1==="S10"?d(i):e$1==="S11"?e(i):f$1(i),r=JSON.parse(s);if(!r||typeof r!="object")throw new TypeError(`${e$1} Rust serializer returned a non-object response`);let o=r;if(o.wireVersion!==1||o.family!==t.family||typeof o.xml!="string")throw new TypeError(`invalid ${e$1} Rust serializer response for ${String(t.family)}`);return o.xml}function m(e){switch(e.type){case "paragraph":return f(e);case "table":return p(e);case "blockSdt":return n("S11",{family:"blockSdt",sdt:e})}}function g(e){return m(e)}function z(e){return n("S12",{family:"document",body:e.package.document})}function x(e){let t=n("S12",{family:"document",body:e}),i="<w:body>",s="</w:body>",r=t.indexOf(i),o=t.lastIndexOf(s);if(r<0||o<r)throw new Error("Rust document serializer omitted w:body");return t.slice(r+i.length,o)}function w(e){return n("S10",{family:"section",properties:e})}function f(e){return n("S11",{family:"paragraph",paragraph:e})}function h(e){return n("S11",{family:"run",run:e})}function p(e){return n("S11",{family:"table",table:e})}function D(e){return n("S12",{family:"headerFooter",story:e})}function b(e){return n("S12",{family:"comments",comments:e})}function T(e){return n("S12",{family:"footnotes",notes:e})}function k(e){return n("S12",{family:"endnotes",notes:e})}export{g as a,z as b,x as c,w as d,f as e,h as f,p as g,D as h,b as i,T as j,k};
|
package/dist/chunk-NEWOMDTX.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-T4EZMUXM.mjs';var I=class{__destroy_into_raw(){let _=this.__wbg_ptr;return this.__wbg_ptr=0,z.unregister(this),_}free(){let _=this.__destroy_into_raw();e.__wbg_editsession_free(_,0);}accept_change(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_accept_change(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}add_comment(_,r,o,n){let t,l;try{let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),p=i,m=a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),y=i,h=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),x=i,v=e.editsession_add_comment(this.__wbg_ptr,w,f,g,p,m,y,h,x);var c=v[0],s=v[1];if(v[3])throw c=0,s=0,b(v[2]);return t=c,l=s,u(c,s)}finally{e.__wbindgen_free(t,l,1);}}apply_delete(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=i,t=e.editsession_apply_delete(this.__wbg_ptr,o,n,r);if(t[3])throw b(t[2]);var l=S(t[0],t[1]).slice();return e.__wbindgen_free(t[0],t[1]*1,1),l}apply_delete_profiled(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=i,t=e.editsession_apply_delete_profiled(this.__wbg_ptr,o,n,r);if(t[3])throw b(t[2]);var l=S(t[0],t[1]).slice();return e.__wbindgen_free(t[0],t[1]*1,1),l}apply_input(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=i,t=e.editsession_apply_input(this.__wbg_ptr,o,n,r);if(t[3])throw b(t[2]);var l=S(t[0],t[1]).slice();return e.__wbindgen_free(t[0],t[1]*1,1),l}apply_input_profile_json(){let _,r;try{let o=e.editsession_apply_input_profile_json(this.__wbg_ptr);return _=o[0],r=o[1],u(o[0],o[1])}finally{e.__wbindgen_free(_,r,1);}}apply_input_profiled(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=i,t=e.editsession_apply_input_profiled(this.__wbg_ptr,o,n,r);if(t[3])throw b(t[2]);var l=S(t[0],t[1]).slice();return e.__wbindgen_free(t[0],t[1]*1,1),l}apply_local_update(_){let r=D(_,e.__wbindgen_malloc),o=i,n=e.editsession_apply_local_update(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}apply_paragraph_style(_,r,o,n,t,l,c,s){let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),p=i,m=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),y=i,h=a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),x=i;var v=j(c)?0:a(c,e.__wbindgen_malloc,e.__wbindgen_realloc),E=i,W=j(s)?0:a(s,e.__wbindgen_malloc,e.__wbindgen_realloc),k=i;let A=e.editsession_apply_paragraph_style(this.__wbg_ptr,w,f,g,p,o,m,y,t,h,x,v,E,W,k);if(A[1])throw b(A[0])}apply_raw_ops(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=i,t=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),l=i,c=e.editsession_apply_raw_ops(this.__wbg_ptr,o,n,t,l);if(c[1])throw b(c[0])}apply_update(_){let r=D(_,e.__wbindgen_malloc),o=i,n=e.editsession_apply_update(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}build_display_list_frame(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=i,t=e.editsession_build_display_list_frame(this.__wbg_ptr,o,n,r);if(t[3])throw b(t[2]);var l=S(t[0],t[1]).slice();return e.__wbindgen_free(t[0],t[1]*1,1),l}build_display_list_json(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_build_display_list_json(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}can_redo(){return e.editsession_can_redo(this.__wbg_ptr)!==0}can_undo(){return e.editsession_can_undo(this.__wbg_ptr)!==0}cell_selection(){let _,r;try{let t=e.editsession_cell_selection(this.__wbg_ptr);var o=t[0],n=t[1];if(t[3])throw o=0,n=0,b(t[2]);return _=o,r=n,u(o,n)}finally{e.__wbindgen_free(_,r,1);}}clear_content_control_value(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=i,n=e.editsession_clear_content_control_value(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}clear_formatting(_,r,o,n,t){let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),w=i,f=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),g=i,p=e.editsession_clear_formatting(this.__wbg_ptr,l,c,s,w,o,f,g,t);if(p[1])throw b(p[0])}clear_measure_fonts(){e.editsession_clear_measure_fonts(this.__wbg_ptr);}clear_update_observer(){e.editsession_clear_update_observer(this.__wbg_ptr);}client_id(){return e.editsession_client_id(this.__wbg_ptr)}create_story(_,r,o,n){let t,l;try{let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),p=i,m=a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),y=i,h=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),x=i,v=e.editsession_create_story(this.__wbg_ptr,w,f,g,p,m,y,h,x);var c=v[0],s=v[1];if(v[3])throw c=0,s=0,b(v[2]);return t=c,l=s,u(c,s)}finally{e.__wbindgen_free(t,l,1);}}delete_column(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_delete_column(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}delete_range(_,r,o,n,t,l,c){let s,w;try{let x=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),v=i,E=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),W=i,k=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),A=i;var f=j(l)?0:a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),g=i,p=j(c)?0:a(c,e.__wbindgen_malloc,e.__wbindgen_realloc),m=i;let T=e.editsession_delete_range(this.__wbg_ptr,x,v,E,W,o,k,A,t,f,g,p,m);var y=T[0],h=T[1];if(T[3])throw y=0,h=0,b(T[2]);return s=y,w=h,u(y,h)}finally{e.__wbindgen_free(s,w,1);}}delete_row(_,r,o){let n,t;try{let p=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),m=i;var l=j(r)?0:a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=j(o)?0:a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),w=i;let y=e.editsession_delete_row(this.__wbg_ptr,p,m,l,c,s,w);var f=y[0],g=y[1];if(y[3])throw f=0,g=0,b(y[2]);return n=f,t=g,u(f,g)}finally{e.__wbindgen_free(n,t,1);}}delete_story(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=i,n=e.editsession_delete_story(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}delete_table(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_delete_table(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}display_hit_test_regions_json(_,r,o){let n,t;try{let s=e.editsession_display_hit_test_regions_json(this.__wbg_ptr,_,r,o);var l=s[0],c=s[1];if(s[3])throw l=0,c=0,b(s[2]);return n=l,t=c,u(l,c)}finally{e.__wbindgen_free(n,t,1);}}display_range_rects_json(_,r){let o,n;try{let c=e.editsession_display_range_rects_json(this.__wbg_ptr,_,r);var t=c[0],l=c[1];if(c[3])throw t=0,l=0,b(c[2]);return o=t,n=l,u(t,l)}finally{e.__wbindgen_free(o,n,1);}}display_range_rects_region_json(_,r,o,n){let t,l;try{let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),p=i,m=e.editsession_display_range_rects_region_json(this.__wbg_ptr,w,f,g,p,o,n);var c=m[0],s=m[1];if(m[3])throw c=0,s=0,b(m[2]);return t=c,l=s,u(c,s)}finally{e.__wbindgen_free(t,l,1);}}encode_state(){let _=e.editsession_encode_state(this.__wbg_ptr);var r=S(_[0],_[1]).slice();return e.__wbindgen_free(_[0],_[1]*1,1),r}format_range(_,r,o,n,t,l){let c=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),p=i,m=a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),y=i,h=e.editsession_format_range(this.__wbg_ptr,c,s,w,f,o,g,p,t,m,y);if(h[1])throw b(h[0])}insert_column(_,r){let o,n;try{let c=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=e.editsession_insert_column(this.__wbg_ptr,c,s,r);var t=w[0],l=w[1];if(w[3])throw t=0,l=0,b(w[2]);return o=t,n=l,u(t,l)}finally{e.__wbindgen_free(o,n,1);}}insert_image(_,r,o,n,t,l){let c,s;try{let h=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),x=i,v=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),E=i,W=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),k=i;var w=j(t)?0:a(t,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=j(l)?0:a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),p=i;let A=e.editsession_insert_image(this.__wbg_ptr,h,x,v,E,o,W,k,w,f,g,p);var m=A[0],y=A[1];if(A[3])throw m=0,y=0,b(A[2]);return c=m,s=y,u(m,y)}finally{e.__wbindgen_free(c,s,1);}}insert_page_break(_,r,o){let n=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=i,l=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_insert_page_break(this.__wbg_ptr,n,t,l,c,o);if(s[1])throw b(s[0])}insert_row(_,r,o,n){let t,l;try{let m=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),y=i;var c=j(o)?0:a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=j(n)?0:a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i;let h=e.editsession_insert_row(this.__wbg_ptr,m,y,r,c,s,w,f);var g=h[0],p=h[1];if(h[3])throw g=0,p=0,b(h[2]);return t=g,l=p,u(g,p)}finally{e.__wbindgen_free(t,l,1);}}insert_section_break(_,r,o,n){let t=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=i,c=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=e.editsession_insert_section_break(this.__wbg_ptr,t,l,c,s,o,w,f);if(g[1])throw b(g[0])}insert_table(_,r,o,n,t,l,c){let s,w;try{let x=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),v=i,E=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),W=i;var f=j(l)?0:a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),g=i,p=j(c)?0:a(c,e.__wbindgen_malloc,e.__wbindgen_realloc),m=i;let k=e.editsession_insert_table(this.__wbg_ptr,x,v,E,W,o,n,t,f,g,p,m);var y=k[0],h=k[1];if(k[3])throw y=0,h=0,b(k[2]);return s=y,w=h,u(y,h)}finally{e.__wbindgen_free(s,w,1);}}insert_text(_,r,o,n,t,l){let c,s;try{let h=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),x=i,v=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),E=i,W=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),k=i;var w=j(t)?0:a(t,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=j(l)?0:a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),p=i;let A=e.editsession_insert_text(this.__wbg_ptr,h,x,v,E,o,W,k,w,f,g,p);var m=A[0],y=A[1];if(A[3])throw m=0,y=0,b(A[2]);return c=m,s=y,u(m,y)}finally{e.__wbindgen_free(c,s,1);}}insert_watermark(_,r,o,n){let t=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=i,c=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=e.editsession_insert_watermark(this.__wbg_ptr,t,l,c,s,o,w,f);if(g[1])throw b(g[0])}layout_document_json(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_layout_document_json(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}list_revisions(){let _,r;try{let t=e.editsession_list_revisions(this.__wbg_ptr);var o=t[0],n=t[1];if(t[3])throw o=0,n=0,b(t[2]);return _=o,r=n,u(o,n)}finally{e.__wbindgen_free(_,r,1);}}load(_){let r=D(_,e.__wbindgen_malloc),o=i,n=e.editsession_load(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}load_json(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_load_json(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}locate_paragraph(_,r){let o,n;try{let c=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=e.editsession_locate_paragraph(this.__wbg_ptr,c,s,w,f);var t=g[0],l=g[1];if(g[3])throw t=0,l=0,b(g[2]);return o=t,n=l,u(t,l)}finally{e.__wbindgen_free(o,n,1);}}measure_paragraph_json(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_measure_paragraph_json(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}merge_cells(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_merge_cells(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}merge_paragraphs(_,r,o,n){let t,l;try{let m=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),y=i,h=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),x=i;var c=j(o)?0:a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=j(n)?0:a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i;let v=e.editsession_merge_paragraphs(this.__wbg_ptr,m,y,h,x,c,s,w,f);var g=v[0],p=v[1];if(v[3])throw g=0,p=0,b(v[2]);return t=g,l=p,u(g,p)}finally{e.__wbindgen_free(t,l,1);}}constructor(_){let r=e.editsession_new(_);if(r[2])throw b(r[1]);return this.__wbg_ptr=r[0],z.register(this,this.__wbg_ptr,this),this}outline_glyph_json(_,r){let o,n;try{let c=e.editsession_outline_glyph_json(this.__wbg_ptr,_,r);var t=c[0],l=c[1];if(c[3])throw t=0,l=0,b(c[2]);return o=t,n=l,u(t,l)}finally{e.__wbindgen_free(o,n,1);}}paragraph_spans(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_paragraph_spans(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}paragraphs(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_paragraphs(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}redo(){return e.editsession_redo(this.__wbg_ptr)!==0}redo_depth(){return e.editsession_redo_depth(this.__wbg_ptr)>>>0}register_measure_font(_){let r=D(_,e.__wbindgen_malloc),o=i,n=e.editsession_register_measure_font(this.__wbg_ptr,r,o);if(n[2])throw b(n[1]);return n[0]>>>0}reject_change(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_reject_change(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}replace_range(_,r,o,n,t,l,c,s){let w,f;try{let v=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),E=i,W=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),k=i,A=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),T=i,J=a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),Y=i;var g=j(c)?0:a(c,e.__wbindgen_malloc,e.__wbindgen_realloc),p=i,m=j(s)?0:a(s,e.__wbindgen_malloc,e.__wbindgen_realloc),y=i;let U=e.editsession_replace_range(this.__wbg_ptr,v,E,W,k,o,A,T,t,J,Y,g,p,m,y);var h=U[0],x=U[1];if(U[3])throw h=0,x=0,b(U[2]);return w=h,f=x,u(h,x)}finally{e.__wbindgen_free(w,f,1);}}resolve_comment(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_resolve_comment(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}selection(){let _,r;try{let t=e.editsession_selection(this.__wbg_ptr);var o=t[0],n=t[1];if(t[3])throw o=0,n=0,b(t[2]);return _=o,r=n,u(o,n)}finally{e.__wbindgen_free(_,r,1);}}selection_context(_,r,o,n,t){let l,c;try{let f=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),g=i,p=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),m=i,y=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),h=i,x=e.editsession_selection_context(this.__wbg_ptr,f,g,p,m,o,y,h,t);var s=x[0],w=x[1];if(x[3])throw s=0,w=0,b(x[2]);return l=s,c=w,u(s,w)}finally{e.__wbindgen_free(l,c,1);}}set_cell_borders(_,r){let o,n;try{let c=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=e.editsession_set_cell_borders(this.__wbg_ptr,c,s,w,f);var t=g[0],l=g[1];if(g[3])throw t=0,l=0,b(g[2]);return o=t,n=l,u(t,l)}finally{e.__wbindgen_free(o,n,1);}}set_cell_selection(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=i,n=e.editsession_set_cell_selection(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}set_cell_shading(_,r){let o,n;try{let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i;var t=j(r)?0:a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),l=i;let g=e.editsession_set_cell_shading(this.__wbg_ptr,w,f,t,l);var c=g[0],s=g[1];if(g[3])throw c=0,s=0,b(g[2]);return o=c,n=s,u(c,s)}finally{e.__wbindgen_free(o,n,1);}}set_cell_text_format(_,r){let o,n;try{let c=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=e.editsession_set_cell_text_format(this.__wbg_ptr,c,s,w,f);var t=g[0],l=g[1];if(g[3])throw t=0,l=0,b(g[2]);return o=t,n=l,u(t,l)}finally{e.__wbindgen_free(o,n,1);}}set_column_width(_,r){let o,n;try{let c=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=e.editsession_set_column_width(this.__wbg_ptr,c,s,r);var t=w[0],l=w[1];if(w[3])throw t=0,l=0,b(w[2]);return o=t,n=l,u(t,l)}finally{e.__wbindgen_free(o,n,1);}}set_content_control_value(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=i,t=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),l=i,c=e.editsession_set_content_control_value(this.__wbg_ptr,o,n,t,l);if(c[1])throw b(c[0])}set_content_control_value_at(_,r,o,n){let t=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),l=i,c=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=e.editsession_set_content_control_value_at(this.__wbg_ptr,t,l,c,s,o,w,f);if(g[1])throw b(g[0])}set_hyperlink(_,r,o,n,t,l){let c=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),p=i,m=a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),y=i,h=e.editsession_set_hyperlink(this.__wbg_ptr,c,s,w,f,o,g,p,t,m,y);if(h[1])throw b(h[0])}set_image_geometry(_,r){let o=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),n=i,t=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),l=i,c=e.editsession_set_image_geometry(this.__wbg_ptr,o,n,t,l);if(c[1])throw b(c[0])}set_paragraph_attr(_,r,o){let n=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),t=i,l=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=a(o,e.__wbindgen_malloc,e.__wbindgen_realloc),w=i,f=e.editsession_set_paragraph_attr(this.__wbg_ptr,n,t,l,c,s,w);if(f[1])throw b(f[0])}set_paragraph_attrs(_,r,o,n,t,l,c,s){let w=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),p=i,m=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),y=i,h=a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),x=i;var v=j(c)?0:a(c,e.__wbindgen_malloc,e.__wbindgen_realloc),E=i,W=j(s)?0:a(s,e.__wbindgen_malloc,e.__wbindgen_realloc),k=i;let A=e.editsession_set_paragraph_attrs(this.__wbg_ptr,w,f,g,p,o,m,y,t,h,x,v,E,W,k);if(A[1])throw b(A[0])}set_selection(_,r,o,n,t){let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),w=i,f=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),g=i,p=e.editsession_set_selection(this.__wbg_ptr,l,c,s,w,o,f,g,t);if(p[1])throw b(p[0])}set_table_width(_,r){let o,n;try{let c=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=e.editsession_set_table_width(this.__wbg_ptr,c,s,r);var t=w[0],l=w[1];if(w[3])throw t=0,l=0,b(w[2]);return o=t,n=l,u(t,l)}finally{e.__wbindgen_free(o,n,1);}}set_update_observer(_){let r=e.editsession_set_update_observer(this.__wbg_ptr,_);if(r[1])throw b(r[0])}split_cell(_,r,o){let n,t;try{let s=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),w=i,f=e.editsession_split_cell(this.__wbg_ptr,s,w,j(r)?Number.MAX_SAFE_INTEGER:r>>>0,j(o)?Number.MAX_SAFE_INTEGER:o>>>0);var l=f[0],c=f[1];if(f[3])throw l=0,c=0,b(f[2]);return n=l,t=c,u(l,c)}finally{e.__wbindgen_free(n,t,1);}}split_paragraph(_,r,o,n,t){let l,c;try{let y=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),h=i,x=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),v=i;var s=j(n)?0:a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),w=i,f=j(t)?0:a(t,e.__wbindgen_malloc,e.__wbindgen_realloc),g=i;let E=e.editsession_split_paragraph(this.__wbg_ptr,y,h,x,v,o,s,w,f,g);var p=E[0],m=E[1];if(E[3])throw p=0,m=0,b(E[2]);return l=p,c=m,u(p,m)}finally{e.__wbindgen_free(l,c,1);}}story_checksum(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_story_checksum(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}story_ids(){let _=e.editsession_story_ids(this.__wbg_ptr);var r=Z(_[0],_[1]).slice();return e.__wbindgen_free(_[0],_[1]*4,4),r}story_len(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=i,n=e.editsession_story_len(this.__wbg_ptr,r,o);if(n[2])throw b(n[1]);return n[0]>>>0}story_segments(_){let r,o;try{let l=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),c=i,s=e.editsession_story_segments(this.__wbg_ptr,l,c);var n=s[0],t=s[1];if(s[3])throw n=0,t=0,b(s[2]);return r=n,o=t,u(n,t)}finally{e.__wbindgen_free(r,o,1);}}toggle_mark(_,r,o,n,t,l){let c=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=a(n,e.__wbindgen_malloc,e.__wbindgen_realloc),p=i,m=a(l,e.__wbindgen_malloc,e.__wbindgen_realloc),y=i,h=e.editsession_toggle_mark(this.__wbg_ptr,c,s,w,f,o,g,p,t,m,y);if(h[1])throw b(h[0])}track_table_undo(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=i,n=e.editsession_track_table_undo(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}track_undo(_){let r=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),o=i,n=e.editsession_track_undo(this.__wbg_ptr,r,o);if(n[1])throw b(n[0])}undo(){return e.editsession_undo(this.__wbg_ptr)!==0}undo_depth(){return e.editsession_undo_depth(this.__wbg_ptr)>>>0}yrs_blocks_for_story(_,r){let o,n;try{let c=a(_,e.__wbindgen_malloc,e.__wbindgen_realloc),s=i,w=a(r,e.__wbindgen_malloc,e.__wbindgen_realloc),f=i,g=e.editsession_yrs_blocks_for_story(this.__wbg_ptr,c,s,w,f);var t=g[0],l=g[1];if(g[3])throw t=0,l=0,b(g[2]);return o=t,n=l,u(t,l)}finally{e.__wbindgen_free(o,n,1);}}};Symbol.dispose&&(I.prototype[Symbol.dispose]=I.prototype.free);function C(){return {__proto__:null,"./docx_edit_bg.js":{__proto__:null,__wbg___wbindgen_throw_344f42d3211c4765:function(_,r){throw new Error(u(_,r))},__wbg_call_a6e5c5dce5018821:function(){return B(function(_,r,o){return _.call(r,o)},arguments)},__wbg_getRandomValues_3f44b700395062e5:function(){return B(function(_,r){globalThis.crypto.getRandomValues(S(_,r));},arguments)},__wbg_new_from_slice_77cdfb7977362f3c:function(_,r){return new Uint8Array(S(_,r))},__wbg_now_374e0d8e8b91c892:function(){return performance.now()},__wbindgen_cast_0000000000000001:function(_,r){return u(_,r)},__wbindgen_init_externref_table:function(){let _=e.__wbindgen_externrefs,r=_.grow(4);_.set(0,void 0),_.set(r+0,void 0),_.set(r+1,null),_.set(r+2,true),_.set(r+3,false);}}}}var z=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(d=>e.__wbg_editsession_free(d,1));function Q(d){let _=e.__externref_table_alloc();return e.__wbindgen_externrefs.set(_,d),_}function Z(d,_){d=d>>>0;let r=$(),o=[];for(let n=d;n<d+4*_;n+=4)o.push(e.__wbindgen_externrefs.get(r.getUint32(n,true)));return e.__externref_drop_slice(d,_),o}function S(d,_){return d=d>>>0,M().subarray(d/1,d/1+_)}var R=null;function $(){return (R===null||R.buffer.detached===true||R.buffer.detached===void 0&&R.buffer!==e.memory.buffer)&&(R=new DataView(e.memory.buffer)),R}function u(d,_){return _e(d>>>0,_)}var F=null;function M(){return (F===null||F.byteLength===0)&&(F=new Uint8Array(e.memory.buffer)),F}function B(d,_){try{return d.apply(this,_)}catch(r){let o=Q(r);e.__wbindgen_exn_store(o);}}function j(d){return d==null}function D(d,_){let r=_(d.length*1,1)>>>0;return M().set(d,r/1),i=d.length,r}function a(d,_,r){if(r===void 0){let c=O.encode(d),s=_(c.length,1)>>>0;return M().subarray(s,s+c.length).set(c),i=c.length,s}let o=d.length,n=_(o,1)>>>0,t=M(),l=0;for(;l<o;l++){let c=d.charCodeAt(l);if(c>127)break;t[n+l]=c;}if(l!==o){l!==0&&(d=d.slice(l)),n=r(n,o,o=l+d.length*3,1)>>>0;let c=M().subarray(n+l,n+o),s=O.encodeInto(d,c);l+=s.written,n=r(n,o,l,1)>>>0;}return i=l,n}function b(d){let _=e.__wbindgen_externrefs.get(d);return e.__externref_table_dealloc(d),_}var L=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true});L.decode();var ee=2146435072,N=0;function _e(d,_){return N+=_,N>=ee&&(L=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}),L.decode(),N=_),L.decode(M().subarray(d,d+_))}var O=new TextEncoder;"encodeInto"in O||(O.encodeInto=function(d,_){let r=O.encode(d);return _.set(r),{read:d.length,written:r.length}});var i=0,e;function q(d,_){return e=d.exports,R=null,F=null,e.__wbindgen_start(),e}async function re(d,_){if(typeof Response=="function"&&d instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(d,_)}catch(n){if(d.ok&&r(d.type)&&d.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n);else throw n}let o=await d.arrayBuffer();return await WebAssembly.instantiate(o,_)}else {let o=await WebAssembly.instantiate(d,_);return o instanceof WebAssembly.Instance?{instance:o,module:d}:o}function r(o){switch(o){case "basic":case "cors":case "default":return true}return false}}function P(d){if(e!==void 0)return e;d!==void 0&&(Object.getPrototypeOf(d)===Object.prototype?{module:d}=d:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let _=C();d instanceof WebAssembly.Module||(d=new WebAssembly.Module(d));let r=new WebAssembly.Instance(d,_);return q(r)}async function X(d){if(e!==void 0)return e;if(d!==void 0&&(Object.getPrototypeOf(d)===Object.prototype?{module_or_path:d}=d:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),d===void 0)throw new Error("docx-edit wasm requires an explicit module or URL");let _=C();(typeof d=="string"||typeof Request=="function"&&d instanceof Request||typeof URL=="function"&&d instanceof URL)&&(d=fetch(d));let{instance:r,module:o}=await re(await d,_);return q(r)}var G=a$1({label:"docx-edit",preloadName:"preloadEditWasm",assetUrl:()=>new URL("./generated/edit/docx_edit_bg.wasm",import.meta.url),initAsync:X,initSync:P});function ce(d){return G.preload(d)}function ae(d){return G.ensure(),new I(d)}export{ce as a,ae as b};
|
package/dist/chunk-O2QSE2I7.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import p from'pizzip';import l from'docxtemplater';function T(e,r,t={}){return b(e,r,t).buffer}function b(e,r,t={}){let{nullGetter:n="keep",linebreaks:s=true,delimiters:o}=t,a=[],i=[],g=[];try{let d=new p(e),m=new l(d,{paragraphLoop:!0,linebreaks:s,nullGetter:c=>{let f=c.value||"";if(n==="error")throw new Error(`Undefined variable: ${f}`);return n==="empty"?(g.push(f),""):(g.push(f),`{${f}}`)},delimiters:o?{start:o.start||"{",end:o.end||"}"}:void 0});return Object.keys(r).forEach(c=>{r[c]!==void 0&&r[c]!==null&&i.push(c);}),m.setData(r),m.render(),{buffer:m.getZip().generate({type:"arraybuffer",compression:"DEFLATE",compressionOptions:{level:6}}),replacedVariables:i,unreplacedVariables:g,warnings:a}}catch(d){throw u(d)}}function x(e,r,t={}){let n=T(e,r,t);return new Blob([n],{type:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"})}function D(e,r,t="document",n={}){let s=x(e,r,n);E(s,`${t}.docx`);}function L(e){try{let r=new p(e),n=new l(r,{paragraphLoop:!0,linebreaks:!0}).getFullText();return y(n)}catch(r){throw u(r)}}function O(e){let r=[],t=[];try{let n=new p(e),o=new l(n,{paragraphLoop:!0,linebreaks:!0}).getFullText();t=y(o);let a=h(o);for(let i of a)r.push({message:`Unclosed tag: ${i}`,variable:i,type:"parse"});return {valid:r.length===0,errors:r,tags:t}}catch(n){return r.push(u(n)),{valid:false,errors:r,tags:t}}}function P(e,r){return e.filter(t=>!(t in r)||r[t]===void 0||r[t]===null)}function U(e,r){try{let t=new p(e),n=new l(t,{paragraphLoop:!0,linebreaks:!0,nullGetter:s=>`[${s.value||""}]`});return n.setData(r),n.render(),n.getFullText()}catch(t){throw u(t)}}function y(e){let r=[],t=/\{([^{}]+)\}/g,n;for(;(n=t.exec(e))!==null;){let s=n[1].trim();s&&!r.includes(s)&&r.push(s);}return r.sort()}function h(e){let r=[],t=0,n="";for(let s of e)s==="{"?(t++,n=""):s==="}"?(t--,t<0&&(t=0)):t>0&&(n+=s);return t>0&&n.trim()&&r.push(n.trim()),r}function w(e){return "properties"in e&&typeof e.properties=="object"}function u(e){if(e instanceof Error){if(w(e)&&e.properties?.errors){let r=e.properties.errors[0];return {message:r?.message||"Template processing error",variable:r?.properties?.tag,type:"render",originalError:e}}if(e.message.includes("undefined")){let r=e.message.match(/undefined (?:variable|tag):\s*(\S+)/i);return {message:e.message,variable:r?r[1]:void 0,type:"undefined",originalError:e}}return e.message.includes("parse")||e.message.includes("unclosed")||e.message.includes("syntax")?{message:e.message,type:"parse",originalError:e}:{message:e.message,type:"unknown",originalError:e}}return {message:String(e),type:"unknown"}}function E(e,r){let t=URL.createObjectURL(e),n=document.createElement("a");n.href=t,n.download=r,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(t);}function z(e,r,t={}){let{linebreaks:n=true,delimiters:s}=t;try{let o=new p(e),a=new l(o,{paragraphLoop:!0,linebreaks:n,delimiters:s?{start:s.start||"{",end:s.end||"}"}:void 0});return a.setData(r),a.render(),a.getZip().generate({type:"arraybuffer",compression:"DEFLATE"})}catch(o){throw u(o)}}function F(e={}){return (r,t)=>T(r,t,e)}var V=T;export{T as a,b,x as c,D as d,L as e,O as f,P as g,U as h,z as i,F as j,V as k};
|
package/dist/chunk-OJOHXQNQ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {b}from'./chunk-KVKLLTDP.mjs';async function l(n,r,t){if(!i(n,r,t))return null;try{return (await b(n,r,{updateModifiedDate:!0},{changedParaIds:t.changedParaIds})).buffer}catch{return null}}function i(n,r,t){return t.structuralChange||t.hasUntrackedChanges||!r?false:!a(n.package.document.content)}function a(n){let r=t=>t.content.some(e=>e.type==="drawing"&&e.image?.src?.startsWith("data:")&&!e.image.rId);for(let t of n)if(t.type==="paragraph")for(let e of t.content){if(e.type==="run"&&r(e)||e.type==="hyperlink"&&e.href&&!e.rId&&!e.anchor)return true;if(e.type==="insertion"||e.type==="deletion"||e.type==="moveFrom"||e.type==="moveTo"){for(let o of e.content)if(o.type==="run"&&r(o))return true}}else if(t.type==="table"){for(let e of t.rows)for(let o of e.cells)if(a(o.content))return true}else if(t.type==="blockSdt"&&a(t.content))return true;return false}export{l as a};
|
package/dist/chunk-OMR3TWCD.mjs
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {o,j as j$1,q,k}from'./chunk-HJGAQIU7.mjs';import {a}from'./chunk-FPZBTOD6.mjs';import {c}from'./chunk-H3JCIGWK.mjs';function U(t,n=null,e=null,o=null,r=null,l=null,u,T=null){if(!t)return x([],new Map);let s=F("footnote",t),p=[...s.footnoteSeparators??[],...s.footnotes??[]];return x(p,new Map(p.map(m=>[m.id,m])))}function D(t,n=null,e=null,o=null,r=null,l=null,u,T=null){if(!t)return h([],new Map);let s=F("endnote",t),p=[...s.endnoteSeparators??[],...s.endnotes??[]];return h(p,new Map(p.map(m=>[m.id,m])))}function F(t,n){let e=`${t}s`,o=new TextEncoder,r={"[Content_Types].xml":o.encode(`<?xml version="1.0" encoding="UTF-8"?><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"/><Override PartName="/word/document.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml"/><Override PartName="/word/${e}.xml" ContentType="application/vnd.openxmlformats-officedocument.wordprocessingml.${e}+xml"/></Types>`),"_rels/.rels":o.encode('<?xml version="1.0" encoding="UTF-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="word/document.xml"/></Relationships>'),"word/document.xml":o.encode('<?xml version="1.0" encoding="UTF-8"?><w:document xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main"><w:body><w:p/></w:body></w:document>'),"word/_rels/document.xml.rels":o.encode(`<?xml version="1.0" encoding="UTF-8"?><Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/${e}" Target="${e}.xml"/></Relationships>`),[`word/${e}.xml`]:o.encode(n)},l=c(r),u=new ArrayBuffer(l.byteLength);return new Uint8Array(u).set(l),a(u,{parseHeadersFooters:false,parseNotes:true,detectVariables:false}).document.package}function E(t){return t?{decimal:"decimal",upperRoman:"upperRoman",lowerRoman:"lowerRoman",upperLetter:"upperLetter",lowerLetter:"lowerLetter",ordinal:"ordinal",cardinalText:"cardinalText",ordinalText:"ordinalText",bullet:"bullet",chicago:"chicago",none:"none"}[t]:void 0}function S(t){return t==="pageBottom"||t==="beneathText"||t==="sectEnd"||t==="docEnd"?t:void 0}function P(t){return t==="sectEnd"||t==="docEnd"?t:void 0}function w(t){return t==="continuous"||t==="eachSect"||t==="eachPage"?t:void 0}function $(t){let n={};if(!t)return n;n.position=S(o(j$1(t,"w","pos"),"w","val"));let e=j$1(t,"w","numFmt");n.numFmt=E(o(e,"w","val"));let o$1=o(e,"w","format");o$1&&(n.customNumberFormat=o$1.slice(0,255)),n.numStart=q(j$1(t,"w","numStart"),"w","val"),n.numRestart=w(o(j$1(t,"w","numRestart"),"w","val"));let r=M(t,"footnote");return r.length&&(n.separators=r),y(n)}function L(t){let n={};if(!t)return n;n.position=P(o(j$1(t,"w","pos"),"w","val"));let e=j$1(t,"w","numFmt");n.numFmt=E(o(e,"w","val"));let o$1=o(e,"w","format");o$1&&(n.customNumberFormat=o$1.slice(0,255)),n.numStart=q(j$1(t,"w","numStart"),"w","val"),n.numRestart=w(o(j$1(t,"w","numRestart"),"w","val"));let r=M(t,"endnote");return r.length&&(n.separators=r),y(n)}function M(t,n){return k(t,"w",n).slice(0,32).map(e=>q(e,"w","id")).filter(e=>e!==void 0).map(e=>({noteId:e,kind:e===-1?"separator":e===0?"continuationSeparator":"continuationNotice"}))}function y(t){for(let n of Object.keys(t))t[n]===void 0&&delete t[n];return t}function j(t){return b(t)}function O(t){return b(t)}function b(t){return t.content.filter(n=>n.type==="paragraph").map(n=>n.content.filter(e=>e.type==="run").flatMap(e=>e.content).filter(e=>e.type==="text").map(e=>e.text).join("")).join(`
|
|
2
|
-
`)}function N(t){return t.noteType!=="normal"}function R(t){return t.noteType!=="normal"}function x(t,n){return {byId:n,footnotes:t,getFootnote:e=>n.get(e),hasFootnote:e=>n.has(e),getNormalFootnotes:()=>t.filter(e=>!N(e)),getSeparator:()=>t.find(e=>e.noteType==="separator"),getContinuationSeparator:()=>t.find(e=>e.noteType==="continuationSeparator")}}function h(t,n){return {byId:n,endnotes:t,getEndnote:e=>n.get(e),hasEndnote:e=>n.has(e),getNormalEndnotes:()=>t.filter(e=>!R(e)),getSeparator:()=>t.find(e=>e.noteType==="separator"),getContinuationSeparator:()=>t.find(e=>e.noteType==="continuationSeparator")}}export{U as a,D as b,$ as c,L as d,j as e,O as f,N as g,R as h};
|
package/dist/chunk-P3KDV4M2.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {a,b as b$1}from'./chunk-7PCO5I2O.mjs';import {e}from'./chunk-OMR3TWCD.mjs';import {b}from'./chunk-3UBMCDME.mjs';import {d,e as e$1,g,c,f}from'./chunk-TTRUPDAB.mjs';var $=12,ce=24,O=6;function V(e,a){if(e.size!==a.size)return false;for(let[n,i]of e)if(a.get(n)!==i)return false;return true}function de(e,a){for(let[n,i]of a)if((e.get(n)??0)<i)return false;return true}function pe(e,a){let n=new Map(e);for(let[i,o]of a)n.set(i,Math.max(n.get(i)??0,o));return n}var N=8;function Q(e){return e.noteKind==="endnote"?-Math.abs(e.footnoteId)-1:e.footnoteId}function me(e){let a=[],n=(i,o)=>{for(let r of i)if(r.kind==="paragraph")for(let t of r.runs)t.kind==="text"&&t.footnoteRefId!=null?a.push({footnoteId:t.footnoteRefId,pmPos:t.pmStart??0,...o??{}}):t.kind==="text"&&t.endnoteRefId!=null&&a.push({footnoteId:t.endnoteRefId,pmPos:t.pmStart??0,noteKind:"endnote",...o??{}});else r.kind==="table"?r.rows.forEach((t,s)=>{for(let l of t.cells)n(l.blocks,o??{tableBlockId:r.id,rowIndex:s});}):r.kind==="textBox"&&n(r.content,o);};return n(e),a}function Z(e,a){let n=new Map;if(a.length===0)return n;let i=(o,r)=>{let t=n.get(o)??[];t.includes(r)||t.push(r),n.set(o,t);};for(let o of a){let r=false;for(let t of e){for(let s of t.fragments){let l=false;if(o.tableBlockId!=null&&o.rowIndex!=null)l=s.kind==="table"&&s.blockId===o.tableBlockId&&o.rowIndex>=s.rowStart&&o.rowIndex<s.rowEnd;else {let u=s.pmStart??-1,f=s.pmEnd??-1;l=u>=0&&f>=0&&o.pmPos>=u&&o.pmPos<f;}if(l){i(t.number,Q(o)),r=true;break}}if(r)break}}return n}function j(e,a,n=String(a)){if(e.length===0)return [{kind:"paragraph",id:`fn-empty-${a}`,runs:[{kind:"text",text:`${n} `,fontSize:N,superscript:true}]}];let i=e.map(r=>{if(r.kind!=="paragraph")return r;let t=r;return {...t,runs:t.runs.map(s=>(s.kind==="text"||s.kind==="tab")&&s.fontSize==null?{...s,fontSize:N}:s)}}),o=i[0];if(o.kind==="paragraph"){let r=o,t=r.runs.find(l=>l.kind==="text"),s={kind:"text",text:`${n} `,fontSize:N,superscript:true,...t?.fontFamily?{fontFamily:t.fontFamily}:{}};i[0]={...r,runs:[s,...r.runs]};}return i}function J(e,a,n,i,o){let r=e.type==="footnote"?`fn:${e.id}`:null,t=(r?i.yrsStoryBlocks?.(r):null)??[],s=o?.displayLabel??String(a),l=j(t,a,s),u=i.measureBlocks(l,n),f=u.reduce((c,d)=>d.kind==="paragraph"||d.kind==="table"?c+d.totalHeight:d.kind==="image"||d.kind==="shape"||d.kind==="chart"||d.kind==="textBox"?c+d.height:c,0);return {id:e.id,displayNumber:a,blocks:l,measures:u,height:f,noteKind:o?.noteKind??(e.type==="endnote"?"endnote":"footnote"),displayLabel:s,anchor:o?.anchor}}function ge(e,a,n,i,o,r){let t=new Map,s=new Map(e.map(c=>[c.id,c])),l=new Map(a.map(c=>[c.id,c])),u=new Set,f=1;for(let c of n){let d=Q(c);if(u.has(d))continue;u.add(d);let m=c.noteKind??"footnote",g=m==="endnote"?l.get(c.footnoteId):s.get(c.footnoteId);if(!g||g.noteType&&g.noteType!=="normal")continue;let x=typeof i=="function"?i(c):i,p=r?.get(d)??{displayNumber:f,displayLabel:String(f)};t.set(d,J(g,p.displayNumber,x,o,{noteKind:m,displayLabel:p.displayLabel,anchor:p.anchor})),f++;}return t}function he(e,a,n,i){return ge(e,[],a.map(o=>({...o,pmPos:0})),o=>typeof n=="function"?n(o):n,i)}function ee(e,a){let n=Math.max(1,Math.floor(a));if(n<=1||e.length<=1)return [e];let o=e.reduce((s,l)=>s+l.height,0)/n,r=[[]],t=0;for(let s of e)r.length<n&&t>0&&t+s.height/2>o&&(r.push([]),t=0),r[r.length-1].push(s),t+=s.height;return r}function A(e,a,n=1){let i=new Map;for(let[o,r]of e){let t=r.map(u=>a.get(u)).filter(u=>u!==void 0&&u.height>0);if(t.length===0)continue;let s=typeof n=="number"?n:n.get(o)??1,l=0;for(let u of ["footnote","endnote"]){let f=t.filter(m=>(m.noteKind??"footnote")===u);if(!f.length)continue;let d=ee(f,u==="footnote"?s:1).reduce((m,g)=>Math.max(m,g.reduce((x,p)=>x+p.height,0)),0);d>0&&(l+=d+$);}l>0&&i.set(o,l);}return i}function be(e){let{blocks:a$1,measures:n,layoutOpts:i,paginate:o,footnoteRefs:r,footnoteContentMap:t,initialLayout:s}=e,l=a(a$1,n),u=e.footnoteColumns??1,f=p=>typeof u=="number"?Math.max(1,u):Math.max(1,u.get(p)??1),c=e.mapReferencesToPages??Z,d=c(s.pages,r),m=A(d,t,u);if(m.size===0)return {layout:s,pageFootnoteMap:d,converged:true};let g=s,x=false;for(let p=0;p<O;p++){g=o(l,{...i,footnoteReservedHeights:m});let M=c(g.pages,r),b=A(M,t,u);if(d=M,V(m,b)){m=b,x=true;break}m=b;}if(!x){let p=m,M=false;for(let b=0;b<O;b++){g=o(l,{...i,footnoteReservedHeights:p}),d=c(g.pages,r);let F=A(d,t,u);if(de(p,F)){M=true;break}p=pe(p,F);}M||(g=o(l,{...i,footnoteReservedHeights:p}),d=c(g.pages,r)),console.warn(`[docx-editor] footnote layout did not stabilize within ${O} passes; settling with conservative page reservations. If footnotes appear misplaced, please file a bug with the document.`);}for(let[p,M]of d){let b=g.pages.find(F=>F.number===p);if(b){b.footnoteIds=M;let F=f(p);F>1&&(b.footnoteColumns=F);}}return {layout:g,pageFootnoteMap:d,converged:x}}function ye(e$1,a,n){let i=new Map;if(!n?.package||!n.package.footnotes?.length&&!n.package.endnotes?.length)return i;let o=new Map;for(let t of n.package.footnotes??[])t.noteType&&t.noteType!=="normal"||o.set(t.id,t);let r=new Map;for(let t of n.package.endnotes??[])t.noteType&&t.noteType!=="normal"||r.set(t.id,t);for(let[t,s]of e$1){let l=[];for(let u of s){let f=a.get(u);if(!f)continue;let c=f.noteKind==="endnote"?r.get(f.id):o.get(f.id);if(!c)continue;let d=f?.displayNumber??0;l.push({displayNumber:f.displayLabel??String(d),text:e(c),content:f});}l.length>0&&i.set(t,l);}return i}function Fe(e){if(e.kind!=="paragraph")return false;let a=e.attrs;return a?!!(a.borders?.top||a.borders?.bottom||a.spacingExplicit?.before||a.spacingExplicit?.after):false}function te(e){return oe(e)}function oe(e){let a=new Set;for(let n=1;n<e.length;n++){let i=e[n-1],o=e[n];i.kind==="table"&&o.kind==="paragraph"&&(o.runs.length>0||Fe(o)||a.add(n));}return e.map((n,i)=>{if(n.kind==="table")return ke(n);if(n.kind!=="paragraph")return n;let o=a.has(i),r=n.attrs?.spacingExplicit,t=n.attrs?.spacing?.before!=null,s=n.attrs?.spacing?.after!=null,l=t&&!r?.before,u=s&&!r?.after,f=l||u;if(!f&&!o)return n;let c=n.attrs;return f&&c?.spacing&&(c={...c,spacing:{...c.spacing,before:r?.before?c.spacing.before:void 0,after:r?.after?c.spacing.after:void 0}}),o&&(c={...c??{},suppressEmptyParagraphHeight:true}),{...n,attrs:c}})}function ke(e){let a=false,n=e.rows.map(i=>{let o=false,r=i.cells.map(t=>{let s=oe(t.blocks);return s.some((u,f)=>u!==t.blocks[f])?(o=true,{...t,blocks:s}):t});return o?(a=true,{...i,cells:r}):i});return a?{...e,rows:n}:e}function xe(e){return e?.align??e?.alignment}function ne(e,a,n,i){let o=i.section==="header"?i.margins.header??48:i.pageSize.h-(i.margins.footer??48)-n,r=e.position?.vertical;if(!r)return a;let t=xe(r),s=r.posOffset!==void 0?b(r.posOffset):void 0;if(r.relativeTo==="page"){if(s!==void 0)return s-o;if(t==="top")return -o;if(t==="bottom")return i.pageSize.h-e.height-o;if(t==="center")return (i.pageSize.h-e.height)/2-o}if(r.relativeTo==="margin"){let l=i.margins.top,u=i.pageSize.h-i.margins.top-i.margins.bottom;if(s!==void 0)return l+s-o;if(t==="top")return l-o;if(t==="bottom")return l+u-e.height-o;if(t==="center")return l+(u-e.height)/2-o}return s!==void 0?a+s:a}function re(e){switch(e.kind){case "paragraph":case "table":return true;case "image":return !e.anchor?.isAnchored;case "shape":case "chart":return true;case "textBox":return e.displayMode===void 0||e.displayMode==="inline";default:return false}}function Me(e){return e?e.kind==="paragraph"||e.kind==="table"?e.totalHeight:e.kind==="image"||e.kind==="shape"||e.kind==="chart"||e.kind==="textBox"?e.height:0:0}function ae(e,a,n,i){let o=0,r=0,t=0;for(let s=0;s<e.length;s++){let l=e[s],u=a[s];if(!(!l||!u)){if(l.kind==="paragraph"&&u.kind==="paragraph"){let f=t,c=f+u.totalHeight;o=Math.min(o,f),r=Math.max(r,c);for(let d of l.runs){if(d.kind!=="image"||!d.position)continue;let m=ne(d,f,n,i);o=Math.min(o,m),r=Math.max(r,m+d.height);}t=c;}else if(l.kind==="table"&&u.kind==="table"){let f=t+u.totalHeight;o=Math.min(o,t),r=Math.max(r,f),t=f;}else if(l.kind==="image"&&u.kind==="image"){let f=t+u.height;o=Math.min(o,t),r=Math.max(r,f),t=f;}else if(l.kind==="shape"&&u.kind==="shape"){let f=t+u.height;o=Math.min(o,t),r=Math.max(r,f),t=f;}else if(l.kind==="chart"&&u.kind==="chart"){let f=t+u.height;o=Math.min(o,t),r=Math.max(r,f),t=f;}else if(l.kind==="textBox"&&u.kind==="textBox"){let f=t+u.height;o=Math.min(o,t),r=Math.max(r,f),l.displayMode!=="float"&&(t=f);}}}return {visualTop:o,visualBottom:r}}function Te(e,a,n,i,o){if(!e||!e.content||e.content.length===0)return;let r=o?i.yrsStoryBlocks?.(o):null;if(!r||r.length===0)return;let t=te(r),s=i.measureBlocks(t,a),l=0,u=0;for(let d=0;d<t.length;d++){let m=Me(s[d]);l+=m,re(t[d])&&(u+=m);}let{visualTop:f,visualBottom:c}=ae(t,s,l,n);return {blocks:t,measures:s,height:l,flowHeight:u,visualTop:f,visualBottom:c}}function Be(e,a,n,i,o){let r=e.hfCaretRects(a,n,i);return o===void 0?r:r.filter(t=>t.pageIndex===o)}function He(e,a,n,i,o,r){let t=e.hfRangeRects(a,n,Math.min(i,o),Math.max(i,o));return r===void 0?t:t.filter(s=>s.pageIndex===r)}function ie(e){return e?e.flowHeight??e.height:0}function Le(e){let{pageSize:a,margins:n,finalMargins:i,bodyBlocks:o,headers:r,footers:t,warn:s}=e,l=n.header??48,u=n.footer??48,f=n.top-l,c=n.bottom-u,d=Math.max(0,...(r??[]).map(ie)),m=Math.max(0,...(t??[]).map(ie)),g=d>f,x=m>c;if(!g&&!x)return {margins:n,finalMargins:i};let p=Math.max(0,a.h-24),M=false,b=I=>{let h={...I};return g&&(h.top=Math.max(I.top,l+d)),x&&(h.bottom=Math.max(I.bottom,u+m)),h.top+h.bottom>p&&(M=true,h.bottom=Math.max(0,Math.min(h.bottom,p-h.top)),h.top+h.bottom>p&&(h.top=Math.max(0,p-h.bottom))),h},F=b(n),fe=b(i);if(o)for(let I of o){if(I.kind!=="sectionBreak")continue;let h=I;h.margins&&(h.margins=b(h.margins));}return M&&s&&s(`[layout] header/footer content exceeds page height; clamping margins to preserve a content area. pageHeight=${Math.round(a.h)} headerBand=${Math.round(d)} footerBand=${Math.round(m)} top=${Math.round(F.top)} bottom=${Math.round(F.bottom)}`),{margins:F,finalMargins:fe}}var T,B,H,L,P,_,U,z=class{constructor(){d(this,_);d(this,T,0);d(this,B,0);d(this,H,false);d(this,L,false);d(this,P,new Set);}setStateSeq(a){e$1(this,T,a);}incrementStateSeq(){return ++g(this,T)._}getStateSeq(){return c(this,T)}getRenderSeq(){return c(this,B)}onLayoutStart(){e$1(this,H,true);}onLayoutComplete(a){e$1(this,B,a),e$1(this,H,false),c(this,L)&&this.isSafeToRender()&&(e$1(this,L,false),f(this,_,U).call(this));}isSafeToRender(){return !c(this,H)&&c(this,B)>=c(this,T)}requestRender(){this.isSafeToRender()?f(this,_,U).call(this):e$1(this,L,true);}onRender(a){return c(this,P).add(a),()=>c(this,P).delete(a)}reset(){e$1(this,T,0),e$1(this,B,0),e$1(this,H,false),e$1(this,L,false);}getDebugInfo(){return {stateSeq:c(this,T),renderSeq:c(this,B),layoutUpdating:c(this,H),hasPendingRender:c(this,L),isSafe:this.isSafeToRender()}}};T=new WeakMap,B=new WeakMap,H=new WeakMap,L=new WeakMap,P=new WeakMap,_=new WeakSet,U=function(){for(let a of c(this,P))try{a();}catch(n){console.error("LayoutSelectionGate: render callback error",n);}};var se=816,ue=1056,w=96,K=48;function S(e){return Math.round(e/1440*96)}function C(e,a){return e!=null?S(e):a}function Se(e){return {w:e?.pageWidth?S(e.pageWidth):se,h:e?.pageHeight?S(e.pageHeight):ue}}function Re(e){let a=e?.gutter!=null?S(e.gutter):void 0;return {top:C(e?.marginTop,w),right:C(e?.marginRight,w),bottom:C(e?.marginBottom,w),left:C(e?.marginLeft,w)+(a??0),header:C(e?.headerDistance,K),footer:C(e?.footerDistance,K),gutter:a}}function Ie(e,a){let n={header:null,footer:null,firstHeader:null,firstFooter:null};if(!e?.package)return n;let i=e.package.headers,o=e.package.footers,r=null,t=null,s=null,l=null;if(i&&a?.headerReferences){let u=a.headerReferences.find(c=>c.type==="default");u?.rId&&(r=i.get(u.rId)??null);let f=a.headerReferences.find(c=>c.type==="first");f?.rId&&(s=i.get(f.rId)??null);}if(o&&a?.footerReferences){let u=a.footerReferences.find(c=>c.type==="default");u?.rId&&(t=o.get(u.rId)??null);let f=a.footerReferences.find(c=>c.type==="first");f?.rId&&(l=o.get(f.rId)??null);}return a?.titlePg||(!r&&s&&(r=s),!t&&l&&(t=l)),{header:r,footer:t,firstHeader:s,firstFooter:l}}function Pe(e){let a=e?.columnCount??e?.columns?.length??1;if(a<=1)return;let n=S(e?.columnSpace??720);return {count:a,gap:n,equalWidth:e?.equalWidth??true,separator:e?.separator,columns:e?.columns?.slice(0,a).map(i=>({width:i.width!=null?S(i.width):void 0,space:i.space!=null?S(i.space):void 0}))}}function le(e){let a=e.pageSize.w-e.margins.left-e.margins.right,n=e.columns;if(!n||n.count<=1)return a;if(n.equalWidth===false&&n.columns?.length){let i=n.columns[0]?.width;if(i!=null&&Number.isFinite(i)&&i>0)return i}return Math.floor((a-(n.count-1)*n.gap)/n.count)}function Ce(e,a,n){let{configs:i,breakIndices:o}=b$1(e,a,n),r=0,t=[];for(let s=0;s<e.length;s++)t.push(le(i[r]??a)),r<o.length&&s===o[r]&&r++;return t}export{w as A,K as B,S as C,Se as D,Re as E,Ie as F,Pe as G,le as H,Ce as I,$ as a,ce as b,O as c,V as d,Q as e,me as f,Z as g,j as h,J as i,ge as j,he as k,ee as l,A as m,be as n,ye as o,te as p,ne as q,re as r,ae as s,Te as t,Be as u,He as v,Le as w,z as x,se as y,ue as z};
|
package/dist/chunk-Q7PO7V73.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function a(e){return {start:e,end:e,collapsed:true}}function n(e,t){return {start:e,end:t,collapsed:e.paragraphIndex===t.paragraphIndex&&e.offset===t.offset}}function r(e,t){return !(e.paragraphIndex<t.start.paragraphIndex||e.paragraphIndex===t.start.paragraphIndex&&e.offset<t.start.offset||e.paragraphIndex>t.end.paragraphIndex||e.paragraphIndex===t.end.paragraphIndex&&e.offset>t.end.offset)}function o(e,t){return e.paragraphIndex<t.paragraphIndex?-1:e.paragraphIndex>t.paragraphIndex?1:e.offset<t.offset?-1:e.offset>t.offset?1:0}function i(e){return {askAI:"Ask AI",rewrite:"Rewrite",expand:"Expand",summarize:"Summarize",translate:"Translate",explain:"Explain",fixGrammar:"Fix Grammar",makeFormal:"Make Formal",makeCasual:"Make Casual",custom:"Custom Prompt"}[e]}function s(e){return {askAI:"Ask AI a question about this text",rewrite:"Rewrite this text in a different way",expand:"Expand this text with more details",summarize:"Summarize this text to be shorter",translate:"Translate this text to another language",explain:"Explain what this text means",fixGrammar:"Fix grammar and spelling errors",makeFormal:"Make the tone more formal",makeCasual:"Make the tone more casual",custom:"Enter a custom prompt"}[e]}var m=["askAI","rewrite","expand","summarize","translate","explain"];function p(e){return {...e,id:g()}}function g(){return `cmd_${Date.now()}_${Math.random().toString(36).substr(2,9)}`}var l={createCollapsedRange:a,createRange:n,isPositionInRange:r,comparePositions:o,getActionLabel:i,getActionDescription:s,createCommand:p,DEFAULT_AI_ACTIONS:m};export{a,n as b,r as c,o as d,i as e,s as f,m as g,p as h,l as i};
|
package/dist/chunk-QOUFE3VX.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {y,D,E as E$1,x as x$1,z as z$1,a,G as G$1,b as b$1,c}from'./chunk-YBIM6UJV.mjs';function g(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function E(t){let e=[];switch(t.alias&&e.push(`<w:alias w:val="${g(t.alias)}"/>`),t.tag&&e.push(`<w:tag w:val="${g(t.tag)}"/>`),t.id!=null&&e.push(`<w:id w:val="${t.id}"/>`),t.lock&&t.lock!=="unlocked"&&e.push(`<w:lock w:val="${t.lock}"/>`),t.placeholder&&e.push(`<w:placeholder><w:docPart w:val="${g(t.placeholder)}"/></w:placeholder>`),t.showingPlaceholder&&e.push("<w:showingPlcHdr/>"),t.sdtType){case "plainText":e.push("<w:text/>");break;case "date":e.push(t.dateFormat?`<w:date><w:dateFormat w:val="${g(t.dateFormat)}"/></w:date>`:"<w:date/>");break;case "dropDownList":case "comboBox":{let o=(t.listItems??[]).map(n=>`<w:listItem w:displayText="${g(n.displayText)}" w:value="${g(n.value)}"/>`).join("");e.push(`<w:${t.sdtType} w:lastValue="">${o}</w:${t.sdtType}>`);break}case "checkbox":e.push(`<w14:checkbox><w14:checked w14:val="${t.checked?"1":"0"}"/><w14:checkedState w14:val="2612" w14:font="MS Gothic"/><w14:uncheckedState w14:val="2610" w14:font="MS Gothic"/></w14:checkbox>`);break;case "picture":e.push("<w:picture/>");break}return `<w:sdtPr>${e.join("")}</w:sdtPr>`}var w=class extends Error{constructor(e){super(e),this.name="ContentControlCreateError";}};function H(t){return t.type==="run"?b$1(t).length:t.type==="hyperlink"?c(t).length:0}function O(t,e,o){let n=t.text.slice(e,o),r={type:"text",text:n};return (t.preserveSpace||/^\s|\s$/.test(n))&&(r.preserveSpace=true),r}function A(t,e){let o=[],n=[],r=0;for(let c of t.content)if(c.type==="text")if(r>=e)n.push(c);else if(r+c.text.length<=e)o.push(c),r+=c.text.length;else {let i=e-r;o.push(O(c,0,i)),n.push(O(c,i)),r+=c.text.length;}else (r>=e?n:o).push(c);return [{...t,content:o},{...t,content:n}]}function L(t,e,o,n){let r=[],c=[],i=[],a=0;for(let s of t){let d=H(s),l=a,u=a+d;if(a=u,u<=e){r.push(s);continue}if(l>=o){i.push(s);continue}if(l>=e&&u<=o){if(s.type==="inlineSdt")throw new w("The text span overlaps an existing inline content control; cannot wrap it.");if(!G$1(s))throw new w(`The text span contains a '${s.type}' that cannot be placed inside an inline content control.`);c.push(s);continue}if(s.type!=="run")throw new w(s.type==="inlineSdt"?"The text span overlaps an existing inline content control; cannot wrap it.":`A content-control boundary falls inside a '${s.type}'; wrap on a run boundary instead.`);let p=Math.max(e,l)-l,f=Math.min(o,u)-l,[h,y]=A(s,p),[m,I]=A(y,f-p);h.content.length>0&&r.push(h),c.push(m),I.content.length>0&&i.push(I);}return [...r,{...n,content:c},...i]}function J(t){return x$1(t,{},{includeHeadersFooters:true}).reduce((e,o)=>o.id!=null&&o.id>e?o.id:e,0)}var X=new Set(["richText","plainText","date","dropDownList","comboBox","checkbox","picture"]);function _(t,e){let o=t.sdtType??"richText";if(!X.has(o))throw new w(`Cannot create a '${o}' content control; supported types: ${[...X].join(", ")}.`);let n={sdtType:o,id:e};return t.tag!=null&&(n.tag=t.tag),t.alias!=null&&(n.alias=t.alias),t.lock!=null&&(n.lock=t.lock),t.listItems!=null&&(n.listItems=t.listItems),t.dateFormat!=null&&(n.dateFormat=t.dateFormat),t.checked!=null&&(n.checked=t.checked),t.showingPlaceholder&&(n.showingPlaceholder=true),n.rawPropertiesXml=E(n),n}function P(t,e,o,n){let r=false,c=[];for(let i of t){if(n.done){c.push(i);continue}if(i.type==="paragraph")e(i)?(c.push(o(i)),n.done=true,r=true):c.push(i);else if(i.type==="blockSdt"){let a=P(i.content,e,o,n);a!==i.content?(c.push({...i,content:a}),r=true):c.push(i);}else if(i.type==="table"){let a=false,s=i.rows.map(d=>{if(n.done)return d;let l=false,u=d.cells.map(p=>{if(n.done)return p;let f=p.content,h=P(f,e,o,n);return h!==f?(l=true,{...p,content:h}):p});return l?(a=true,{...d,cells:u}):d});a?(c.push({...i,rows:s}),r=true):c.push(i);}else c.push(i);}return r?c:t}function nt(t,e,o={}){if(!e.text)throw new w("`text` must be a non-empty string.");let n=e.occurrence??1;if(n<1)throw new w("`occurrence` must be >= 1.");if(o.id!=null&&y(t,{id:o.id},{includeHeadersFooters:true}))throw new w(`A content control with id ${o.id} already exists; omit \`id\` to auto-assign a unique one.`);let r=o.id??J(t)+1,c=_(o,r),i=u=>{let p=a(u),f=-1,h=0;for(let m=p.indexOf(e.text);m!==-1;m=p.indexOf(e.text,m+e.text.length))if(++h===n){f=m;break}if(f===-1)throw new w(h===0?`Text ${JSON.stringify(e.text)} was not found in the paragraph.`:`Occurrence ${n} of ${JSON.stringify(e.text)} not found (only ${h} present).`);let y={type:"inlineSdt",properties:c,content:[]};return {...u,content:L(u.content,f,f+e.text.length,y)}},a$1={done:false},s=P(t.package.document.content,u=>u.paraId===e.paraId,i,a$1);if(!a$1.done)throw new w(`No paragraph found with paraId ${JSON.stringify(e.paraId)}.`);let d=E$1(t,s),l=y(d,{id:r});if(!l)throw new w("Created control could not be located after insertion.");return {doc:d,control:l}}function q(t){return /<w15:repeatingSection[\s/>]/.test(t??"")}function z(t){return /<w15:repeatingSectionItem[\s/>]/.test(t??"")}function G(t){return q(t.rawPropertiesXml)}function Y(t){return z(t.rawPropertiesXml)}var b=class extends Error{constructor(e){super(e),this.name="RepeatingSectionError";}};function x(t,e){if(Array.isArray(t)){for(let n of t)x(n,e);return}if(!t||typeof t!="object")return;let o=t;(o.type==="blockSdt"||o.type==="inlineSdt")&&o.properties&&e(o);for(let[n,r]of Object.entries(o))n==="properties"||n==="rawPropertiesXml"||n==="rawEndPropertiesXml"||(Array.isArray(r)||r&&typeof r=="object")&&x(r,e);}function V(t){let e=0,o=n=>{typeof n.properties?.id=="number"&&(e=Math.max(e,n.properties.id));};x(t.package.document.content,o);for(let n of t.package.headers?.values()??[])x(n.content,o);for(let n of t.package.footers?.values()??[])x(n.content,o);return e}function Z(t,e){return t&&(/<w:id\b/.test(t)?t.replace(/(<w:id\b[^>]*\bw:val=")[^"]*(")/,`$1${e}$2`):/<w:sdtPr\b[^>]*\/>/.test(t)?t.replace(/<w:sdtPr\b([^>]*)\/>/,`<w:sdtPr$1><w:id w:val="${e}"/></w:sdtPr>`):t.replace(/(<w:sdtPr\b[^>]*[^/]>)/,`$1<w:id w:val="${e}"/>`))}function K(t,e){let o=structuredClone(t);return x(o,n=>{let r=e(),c=n.properties;n.properties={...c,id:r,rawPropertiesXml:Z(c.rawPropertiesXml,r)};}),o}function M(t,e){let o,n=r=>{for(let c of r){if(o)return;if(c.type==="blockSdt"){let i=c.properties;(e.tag===void 0||i.tag===e.tag)&&(e.alias===void 0||i.alias===e.alias)&&(e.id===void 0||i.id===e.id)?o=c:n(c.content);}else if(c.type==="table")for(let i of c.rows)for(let a of i.cells)n(a.content);}};if(n(t.package.document.content),!o)throw new z$1(e);if(!G(o.properties))throw new b(`Control ${e.tag??e.alias??e.id} is not a repeating section.`);return o}function j(t){let e=[];return t.content.forEach((o,n)=>{o.type==="blockSdt"&&Y(o.properties)&&e.push(n);}),e}function it(t,e,o={}){let n=M(t,e),r=j(n);if(r.length===0)throw new b("Repeating section has no item to clone.");let c=o.afterIndex??r.length-1,i=r[Math.max(0,Math.min(c,r.length-1))],a=n.content[i],s=V(t),d=K(a,()=>++s),l={done:false},u=f=>{let h=[...f.content];return h.splice(i+1,0,d),[{...f,content:h}]},p=D(t.package.document.content,e,u,l);return E$1(t,p)}function at(t,e,o){let n=M(t,e),r=j(n);if(r.length<=1)throw new b("Cannot remove the last item of a repeating section.");if(o<0||o>=r.length)throw new b(`Item index ${o} out of range (0..${r.length-1}).`);let c=r[o],i={done:false},a=d=>{let l=d.content.filter((u,p)=>p!==c);return [{...d,content:l}]},s=D(t.package.document.content,e,a,i);return E$1(t,s)}export{w as a,nt as b,G as c,Y as d,b as e,it as f,at as g};
|
package/dist/chunk-TYHI7RAD.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function d(a){let i=[];return a.descendants((n,l)=>{if(n.type.name==="paragraph"){let o=n.attrs.outlineLevel,r=n.attrs.styleId,e=o;if(e==null&&r){let t=r.match(/^[Hh]eading(\d)$/);t&&(e=parseInt(t[1],10)-1);}if(e!=null&&e>=0&&e<=8){let t="";n.forEach(s=>{s.isText&&(t+=s.text||"");}),t.trim()&&i.push({text:t.trim(),level:e,pmPos:l});}}}),i}export{d as a};
|
package/dist/chunk-UIEJWORW.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function b(e){return h(e).variables}function h(e){let t=[],n={body:[],headers:[],footers:[],footnotes:[],endnotes:[],textBoxes:[]};if(e.package?.document){let r=d(e.package.document);r.forEach(s=>{t.push({name:s,location:"body"});}),n.body=Array.from(new Set(r)).sort();}if(e.package?.document?.sections&&e.package.document.sections.forEach((r,s)=>{r.properties.headerReferences&&r.properties.headerReferences.forEach(R=>{});}),e.package?.footnotes){let r=u(e.package.footnotes);r.forEach(s=>{t.push({name:s,location:"footnote"});}),n.footnotes=Array.from(new Set(r)).sort();}if(e.package?.endnotes){let r=u(e.package.endnotes);r.forEach(s=>{t.push({name:s,location:"endnote"});}),n.endnotes=Array.from(new Set(r)).sort();}e.templateVariables&&e.templateVariables.forEach(r=>{t.some(s=>s.name===r)||t.push({name:r,location:"body"});});let o=new Set;return t.forEach(r=>o.add(r.name)),{variables:Array.from(o).sort(),totalOccurrences:t.length,byLocation:n,occurrences:t}}function d(e){let t=[];if(e.content&&t.push(...c(e.content)),e.sections)for(let n of e.sections)n.content&&t.push(...c(n.content));return t}function c(e){let t=[];for(let n of e)n.type==="paragraph"?t.push(...a(n)):n.type==="table"&&t.push(...l(n));return t}function a(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="run"?t.push(...i(n)):n.type==="hyperlink"?t.push(...m(n)):n.type==="simpleField"?t.push(...x(n)):n.type==="complexField"&&t.push(...V(n));return t}function i(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="text"&&n.text&&t.push(...g(n.text));return t}function m(e){let t=[];if(!e.children)return t;for(let n of e.children)n.type==="run"&&t.push(...i(n));return t}function x(e){let t=[];if(e.instruction&&t.push(...g(e.instruction)),e.content)for(let n of e.content)n.type==="run"&&t.push(...i(n));return t}function V(e){let t=[];if(e.fieldCode)for(let n of e.fieldCode)n.type==="run"&&t.push(...i(n));if(e.fieldResult)for(let n of e.fieldResult)n.type==="run"&&t.push(...i(n));return t}function l(e){let t=[];if(!e.rows)return t;for(let n of e.rows)if(n.cells)for(let o of n.cells)t.push(...y(o));return t}function y(e){let t=[];if(!e.content)return t;for(let n of e.content)n.type==="paragraph"?t.push(...a(n)):n.type==="table"&&t.push(...l(n));return t}function u(e){let t=[];for(let n of e)if(n.content)for(let o of n.content)o.type==="paragraph"&&t.push(...a(o));return t}var f=/\{([a-zA-Z_][a-zA-Z0-9_\-\.]*)\}/g,p=/\{([^{}]+)\}/g;function g(e){if(!e)return [];let t=[],n=new RegExp(f),o;for(;(o=n.exec(e))!==null;)t.push(o[1]);return t}function v(e){return f.test(e)}function k(e){return !(!e||typeof e!="string"||e.length===0||e.length>100||!/^[a-zA-Z_]/.test(e)||!/^[a-zA-Z_][a-zA-Z0-9_\-\.]*$/.test(e))}function I(e){if(!e)return "";let t=e.replace(/\s+/g,"_");return t=t.replace(/[^a-zA-Z0-9_\-\.]/g,""),t&&!/^[a-zA-Z_]/.test(t)&&(t="_"+t),t.substring(0,100)}function F(e){return `{${e}}`}function T(e){let t=e.match(/^\{(.+?)\}$/);return t?t[1]:null}function _(e,t){return e&&e.replace(p,(n,o)=>{let r=o.trim();return r in t?t[r]:n})}function B(e,t=""){return e&&e.replace(p,t)}function C(e){return b(e).length>0}export{b as a,h as b,d as c,a as d,g as e,v as f,k as g,I as h,F as i,T as j,_ as k,B as l,C as m};
|
package/dist/chunk-VAOUFAUH.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function i(){return [{styleId:"Normal",type:"paragraph",name:"Normal",default:true,qFormat:true,uiPriority:0,rPr:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:276}},{styleId:"Title",type:"paragraph",name:"Title",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:10,rPr:{fontSize:52,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:240}},{styleId:"Subtitle",type:"paragraph",name:"Subtitle",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:11,rPr:{fontSize:30,color:{rgb:"666666"},fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:240}},{styleId:"Heading1",type:"paragraph",name:"Heading 1",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:40,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:400,spaceAfter:120,lineSpacing:240}},{styleId:"Heading2",type:"paragraph",name:"Heading 2",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:32,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:360,spaceAfter:80,lineSpacing:240}},{styleId:"Heading3",type:"paragraph",name:"Heading 3",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:28,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:320,spaceAfter:80,lineSpacing:240}},{styleId:"Heading4",type:"paragraph",name:"Heading 4",basedOn:"Normal",next:"Normal",qFormat:true,uiPriority:9,rPr:{fontSize:24,bold:true,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{spaceBefore:280,spaceAfter:80,lineSpacing:240}}]}function r(){return {pageWidth:12240,pageHeight:15840,orientation:"portrait",marginTop:1440,marginBottom:1440,marginLeft:1440,marginRight:1440,headerDistance:720,footerDistance:720,gutter:0,columnCount:1,columnSpace:720,equalWidth:true,sectionStart:"nextPage",verticalAlign:"top"}}function n(e={}){let t=r();e.pageWidth!==void 0&&(t.pageWidth=Math.round(e.pageWidth)),e.pageHeight!==void 0&&(t.pageHeight=Math.round(e.pageHeight)),e.orientation!==void 0&&(t.orientation=e.orientation),e.marginTop!==void 0&&(t.marginTop=Math.round(e.marginTop)),e.marginBottom!==void 0&&(t.marginBottom=Math.round(e.marginBottom)),e.marginLeft!==void 0&&(t.marginLeft=Math.round(e.marginLeft)),e.marginRight!==void 0&&(t.marginRight=Math.round(e.marginRight));let a={type:"text",text:e.initialText||""};return {package:{document:{content:[{type:"paragraph",content:[{type:"run",content:e.initialText?[a]:[],formatting:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}}}],formatting:{lineSpacing:276}}],finalSectionProperties:t},styles:{docDefaults:{rPr:{fontSize:22,fontFamily:{ascii:"Arial",hAnsi:"Arial"}},pPr:{lineSpacing:276}},styles:i()}},templateVariables:[],warnings:[]}}function d(e,t={}){return n({...t,initialText:e})}export{n as a,d as b};
|