@betteroffice/docx 0.4.1 → 0.4.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.
Files changed (70) hide show
  1. package/dist/chunk-4PRCO6EC.mjs +1 -0
  2. package/dist/chunk-5Z22FORG.mjs +1 -0
  3. package/dist/chunk-7SUVUKWT.mjs +1 -0
  4. package/dist/chunk-7ZV6P6NZ.mjs +57 -0
  5. package/dist/{chunk-2QHGQA3V.mjs → chunk-AXFMDV66.mjs} +1 -1
  6. package/dist/{chunk-YLFKV2NT.mjs → chunk-EBYC3CX7.mjs} +1 -1
  7. package/dist/{chunk-3CYO46ML.mjs → chunk-GKWXOZZH.mjs} +1 -1
  8. package/dist/chunk-HGKSOBXK.mjs +1 -0
  9. package/dist/{chunk-DKWD4P4J.mjs → chunk-LIOWZSE7.mjs} +1 -1
  10. package/dist/chunk-ML6E23W2.mjs +1 -0
  11. package/dist/{chunk-NVN26RHH.mjs → chunk-MLEMGJP7.mjs} +1 -1
  12. package/dist/chunk-QBMNRD5V.mjs +2 -0
  13. package/dist/{chunk-2HLVVQIL.mjs → chunk-RNNTXPXC.mjs} +1 -1
  14. package/dist/chunk-UBUTIWXN.mjs +1 -0
  15. package/dist/{chunk-7DDF4RHB.mjs → chunk-VH7P4734.mjs} +1 -1
  16. package/dist/collaboration/index.d.mts +5 -5
  17. package/dist/compareDocx-CWOYEBCE.mjs +1 -0
  18. package/dist/{computeLayout-4MNWHE2T.mjs → computeLayout-ZTO6TBWX.mjs} +1 -1
  19. package/dist/{content-BzoC6bSz.d.mts → content-DSb-6a9T.d.mts} +5 -5
  20. package/dist/core.d.mts +3 -3
  21. package/dist/core.mjs +1 -1
  22. package/dist/{displayListQueries-DnHmHUPY.d.mts → displayListQueries-BVBDVXoP.d.mts} +2 -2
  23. package/dist/docx/index.d.mts +1 -1
  24. package/dist/docx/index.mjs +2 -2
  25. package/dist/editor/index.d.mts +10 -6
  26. package/dist/editor/index.mjs +1 -1
  27. package/dist/{frameDelta-ByU7HBuB.d.mts → frameDelta-CLeO7K5z.d.mts} +5 -2
  28. package/dist/generated/edit/docx_edit_bg.wasm +0 -0
  29. package/dist/generated/layout/docx_layout_bg.wasm +0 -0
  30. package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
  31. package/dist/generated/parse/docx_parse_bg.wasm +0 -0
  32. package/dist/{index-yOtBET85.d.mts → index-DzZVJC8-.d.mts} +230 -86
  33. package/dist/layout/index.d.mts +2 -2
  34. package/dist/layout/index.mjs +1 -1
  35. package/dist/layout/pagination/index.d.mts +3 -3
  36. package/dist/layout/render/index.d.mts +9 -9
  37. package/dist/layout/render/index.mjs +1 -1
  38. package/dist/{parseWasm-NLAG22EU.mjs → parseWasm-BESKFFA3.mjs} +1 -1
  39. package/dist/plugin-api/RenderedDomContext.d.mts +5 -5
  40. package/dist/plugin-api/index.d.mts +1 -1
  41. package/dist/plugin-api/resolveItemPositions.d.mts +1 -1
  42. package/dist/{rustDisplayList-DcaA5iok.d.mts → rustDisplayList-B7uPoItK.d.mts} +2 -2
  43. package/dist/types/content.d.mts +1 -1
  44. package/dist/types/document.d.mts +2 -2
  45. package/dist/{types-Buyw6dFd.d.mts → types-Cz7S77Ut.d.mts} +3 -1
  46. package/dist/utils/comments.d.mts +1 -1
  47. package/dist/utils/index.d.mts +1 -1
  48. package/dist/utils/index.mjs +1 -1
  49. package/dist/{wasm-IBCLSJQU.mjs → wasm-GFT55YT6.mjs} +1 -1
  50. package/dist/wasm-QI7MWC5D.mjs +1 -0
  51. package/dist/wasm-QXYYV7LU.mjs +1 -0
  52. package/dist/wasm-edit.d.mts +27 -2
  53. package/dist/wasm-edit.mjs +1 -1
  54. package/dist/wasm-layout.mjs +1 -1
  55. package/dist/wasm-opc.mjs +1 -1
  56. package/dist/wasm-parse.mjs +1 -1
  57. package/dist/yrs/index.d.mts +4 -4
  58. package/dist/yrs/index.mjs +1 -1
  59. package/dist/yrs/residentEngineWorker.mjs +1 -1
  60. package/package.json +1 -1
  61. package/dist/chunk-3OWET2KZ.mjs +0 -1
  62. package/dist/chunk-4GEXNR7A.mjs +0 -1
  63. package/dist/chunk-4QHAMEAS.mjs +0 -1
  64. package/dist/chunk-6CHGYCFU.mjs +0 -1
  65. package/dist/chunk-C5BX34CG.mjs +0 -2
  66. package/dist/chunk-EIPVFGIC.mjs +0 -1
  67. package/dist/chunk-FMOSOX5V.mjs +0 -57
  68. package/dist/compareDocx-QX2YF3EF.mjs +0 -1
  69. package/dist/wasm-6WSIEYWC.mjs +0 -1
  70. package/dist/wasm-GSI2XMOH.mjs +0 -1
@@ -0,0 +1 @@
1
+ import {d}from'./chunk-47Q2FMFF.mjs';import {c}from'./chunk-CTBUQRYQ.mjs';import {b as b$1}from'./chunk-UBUTIWXN.mjs';import {b}from'./chunk-TTRUPDAB.mjs';var ne=new WeakMap;function Hn(e){return ne.get(e)?.sourcePackage()??null}function zn(e,n){ne.set(e,n);}function Yn(e){let n=ne.get(e);if(!n)throw new Error("the session was not created by createYrsSession");return n}function Te(e){return e.type==="rawXml"}var E=class extends Error{constructor(n){super(n),this.name="ContentControlValueError";}};function V(e,n,t){let r=new RegExp(`<${n}\\b[^>]*>`).exec(e);if(!r)return;let o=new RegExp(`\\b${t}="([^"]*)"`).exec(r[0]);return o?o[1]:void 0}function te(e,n,t,r){let i=new RegExp(`<${n}\\b[^>]*?(/?)>`).exec(e);if(!i)return e;let l=i[0],s=i[1]==="/",a=l.slice(1,s?-2:-1),d=new RegExp(`\\b${t}="[^"]*"`).test(a)?a.replace(new RegExp(`\\b${t}="[^"]*"`),()=>`${t}="${r}"`):`${a} ${t}="${r}"`;return e.replace(l,()=>`<${d}${s?"/>":">"}`)}function Ue(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function qe(e,n){if(!e)return n;let t=parseInt(e,16);return Number.isNaN(t)||t<0||t>1114111||t>=55296&&t<=57343?n:String.fromCodePoint(t)}function Ge(e,n,t){let[r,o,i]=e.slice(0,10).split("-").map(f=>parseInt(f,10));if(!Se(r,o,i))return e;let l=n&&n.trim()?n:"M/d/yyyy",s=f=>String(f).padStart(2,"0"),a=new Date(Date.UTC(r,o-1,i)),u=f=>{try{return new Intl.DateTimeFormat(t||"en",{month:f,timeZone:"UTC"}).format(a)}catch{return new Intl.DateTimeFormat("en",{month:f,timeZone:"UTC"}).format(a)}},d={yyyy:String(r),yy:String(r).slice(-2),MMMM:u("long"),MMM:u("short"),MM:s(o),M:String(o),dd:s(i),d:String(i)};return l.replace(/yyyy|yy|MMMM|MMM|MM|M|dd|d/g,f=>d[f])}function Se(e,n,t){if(!e||!n||!t)return false;let r=new Date(Date.UTC(e,n-1,t));return r.getUTCFullYear()===e&&r.getUTCMonth()===n-1&&r.getUTCDate()===t}function re(e,n){return e?{type:"paragraph",content:[{type:"run",content:[{type:"text",text:e}],...n?{formatting:{fontFamily:{ascii:n,hAnsi:n,eastAsia:n,cs:n}}}:{}}]}:{type:"paragraph",content:[]}}function Ze(e){return e&&e.replace(/<w:showingPlcHdr\b[^>]*\/>/g,"").replace(/<w:showingPlcHdr\b[^>]*>[\s\S]*?<\/w:showingPlcHdr>/g,"")}function oe(e,n){let t=Ze(n);return {...e,showingPlaceholder:false,rawPropertiesXml:(t??n)||void 0}}function ie(e,n){let t=e.rawPropertiesXml??"";switch(n.kind){case "dropdown":{if(e.sdtType!=="dropDownList"&&e.sdtType!=="comboBox")throw new E(`Control is '${e.sdtType}', not a dropdown/combo box.`);let r=e.listItems?.find(u=>u.value===n.value||u.displayText===n.value);if(!r&&e.sdtType==="dropDownList")throw new E(`'${n.value}' is not one of the control's list items.`);let o=r?.value??n.value,i=r?.displayText??n.value,l=r?e.listItems?.indexOf(r):void 0,s=e.sdtType==="comboBox"?"w:comboBox":"w:dropDownList",a=te(t,s,"w:lastValue",Ue(o));return {properties:{...oe(e,a),listLastValue:o,controlState:{...e.controlState,value:i,selectedValue:o,selectedIndex:l,placeholder:false}},content:[re(i)]}}case "checkbox":{if(e.sdtType!=="checkbox")throw new E(`Control is '${e.sdtType}', not a checkbox.`);if(V(t,"w14:checked","w14:val")==null)throw new E("Checkbox control has no <w14:checked> state to update (not a Word checkbox).");let r=n.checked?"w14:checkedState":"w14:uncheckedState",o=qe(V(t,r,"w14:val"),n.checked?"\u2612":"\u2610"),i=V(t,r,"w14:font"),l=te(t,"w14:checked","w14:val",n.checked?"1":"0");return {properties:{...oe(e,l),checked:n.checked,controlState:{...e.controlState,checked:n.checked,value:o,placeholder:false}},content:[re(o,i)]}}case "date":{if(e.sdtType!=="date")throw new E(`Control is '${e.sdtType}', not a date control.`);let r=n.date.slice(0,10),[o,i,l]=/^\d{4}-\d{2}-\d{2}$/.test(r)?r.split("-").map(Number):[];if(!Se(o,i,l))throw new E(`Date must be ISO yyyy-mm-dd, got '${n.date}'.`);let s=`${r}T00:00:00`,a=te(t,"w:date","w:fullDate",s),u=e.dateState?.format??e.dateFormat??V(t,"w:dateFormat","w:val"),d=e.dateState?.language,f=Ge(r,u,d);return {properties:{...oe(e,a),dateFormat:u,dateState:{...e.dateState,fullDate:s,format:u},controlState:{...e.controlState,value:r,placeholder:false}},content:[re(f)]}}}}function Gn(e){return {sdtType:e.sdtType,id:e.id??null,alias:e.alias??null,tag:e.tag??null,lock:e.lock??null,placeholder:e.placeholder??null,showingPlaceholder:e.showingPlaceholder??false,dateFormat:e.dateFormat??null,listItems:e.listItems?JSON.stringify(e.listItems):null,checked:e.checked??null,dataBinding:e.dataBinding?JSON.stringify(e.dataBinding):null,multiLine:e.multiLine??null,rawPropertiesXml:e.rawPropertiesXml??null,rawEndPropertiesXml:e.rawEndPropertiesXml??null}}function le(e){let n={sdtType:e.sdtType??"richText"};if(typeof e.id=="number"&&(n.id=e.id),e.alias!=null&&(n.alias=String(e.alias)),e.tag!=null&&(n.tag=String(e.tag)),e.lock!=null&&(n.lock=e.lock),e.placeholder!=null&&(n.placeholder=String(e.placeholder)),e.showingPlaceholder&&(n.showingPlaceholder=true),e.dateFormat!=null&&(n.dateFormat=String(e.dateFormat)),typeof e.listItems=="string"&&e.listItems)try{n.listItems=JSON.parse(e.listItems);}catch{}if(e.checked!=null&&(n.checked=e.checked),typeof e.dataBinding=="string"&&e.dataBinding)try{n.dataBinding=JSON.parse(e.dataBinding);}catch{}return typeof e.multiLine=="boolean"&&(n.multiLine=e.multiLine),e.rawPropertiesXml!=null&&(n.rawPropertiesXml=String(e.rawPropertiesXml)),e.rawEndPropertiesXml!=null&&(n.rawEndPropertiesXml=String(e.rawEndPropertiesXml)),n}function xe(e){return e.numPrFromStyle!=null&&e.numPr!=null&&JSON.stringify(e.numPr)===JSON.stringify(e.numPrFromStyle)}function Re(e,n){return e===n||JSON.stringify(e)===JSON.stringify(n)}function Qe(e,n,t,r){return n[r]===void 0&&t?.[r]!==void 0&&Re(e[r],t[r])}function en(e,n){let t={...e},r=(o,i)=>{if(i)for(let l of o)delete t[l];};for(let o of Object.keys(t))o==="styleId"||o==="numPr"||o==="lineSpacing"||o==="lineSpacingRule"||o==="indentFirstLine"||o==="hangingIndent"||r([o],n[o]!==void 0&&Re(t[o],n[o]));return r(["lineSpacing","lineSpacingRule"],n.lineSpacing!==void 0&&t.lineSpacing===n.lineSpacing&&(t.lineSpacingRule??"auto")===(n.lineSpacingRule??"auto")),Object.values(t).some(o=>o!==void 0)?t:void 0}function Ae(e,n){if(e._originalFormatting){let o=e._originalFormatting,i={...o},l=s=>Qe(e,o,n,s);return !l("alignment")&&e.alignment!==(o.alignment||void 0)&&(i.alignment=e.alignment||void 0),xe(e)?(delete i.numPr,delete i.numPrFromStyle):e.numPr!==o.numPr&&JSON.stringify(e.numPr)!==JSON.stringify(o.numPr)&&(i.numPr=e.numPr||void 0,delete i.numPrFromStyle),e.styleId!==(o.styleId||void 0)&&(i.styleId=e.styleId||void 0),!l("pageBreakBefore")&&e.pageBreakBefore!==(o.pageBreakBefore||void 0)&&(i.pageBreakBefore=e.pageBreakBefore||void 0),!l("widowControl")&&e.widowControl!==(o.widowControl??void 0)&&(i.widowControl=e.widowControl??void 0),!l("autoSpaceDE")&&e.autoSpaceDE!==(o.autoSpaceDE??void 0)&&(i.autoSpaceDE=e.autoSpaceDE??void 0),!l("autoSpaceDN")&&e.autoSpaceDN!==(o.autoSpaceDN??void 0)&&(i.autoSpaceDN=e.autoSpaceDN??void 0),!l("bidi")&&e.bidi!==(o.bidi||void 0)&&(i.bidi=e.bidi||void 0),i}if(!(e.alignment||e.spaceBefore!=null||e.spaceAfter!=null||e.spaceBeforeLines!=null||e.spaceAfterLines!=null||e.beforeAutospacing!=null||e.afterAutospacing!=null||e.lineSpacing||e.indentLeft||e.indentRight||e.indentFirstLine||e.numPr||e.styleId||e.borders||e.shading||e.tabs||e.outlineLevel!=null||e.contextualSpacing||e.pageBreakBefore||e.widowControl!=null||e.autoSpaceDE!=null||e.autoSpaceDN!=null||e.bidi))return;let r={alignment:e.alignment||void 0,spaceBefore:e.spaceBefore??void 0,spaceAfter:e.spaceAfter??void 0,spaceBeforeLines:e.spaceBeforeLines??void 0,spaceAfterLines:e.spaceAfterLines??void 0,beforeAutospacing:e.beforeAutospacing??void 0,afterAutospacing:e.afterAutospacing??void 0,lineSpacing:e.lineSpacing||void 0,lineSpacingRule:e.lineSpacingRule||void 0,indentLeft:e.indentLeft||void 0,indentRight:e.indentRight||void 0,indentFirstLine:e.indentFirstLine||void 0,hangingIndent:e.hangingIndent||void 0,numPr:xe(e)?void 0:e.numPr||void 0,styleId:e.styleId||void 0,borders:e.borders||void 0,shading:e.shading||void 0,tabs:e.tabs||void 0,outlineLevel:e.outlineLevel??void 0,contextualSpacing:e.contextualSpacing||void 0,pageBreakBefore:e.pageBreakBefore||void 0,widowControl:e.widowControl??void 0,autoSpaceDE:e.autoSpaceDE??void 0,autoSpaceDN:e.autoSpaceDN??void 0,bidi:e.bidi||void 0};return n?en(r,n):r}function Fe(e){if(e._originalFormatting){let t=e._originalFormatting,r={...t};return e.styleId!==(t.styleId||void 0)&&(r.styleId=e.styleId||void 0),e.justification!==(t.justification||void 0)&&(r.justification=e.justification||void 0),e.floating!==(t.floating||void 0)&&(r.floating=e.floating||void 0),e.tableLayout!==(t.layout||void 0)&&(r.layout=e.tableLayout||void 0),e.look!==(t.look||void 0)&&(r.look=e.look||void 0),e.bidi!==(t.bidi||void 0)&&(r.bidi=e.bidi||void 0),(e.width!==t.width?.value||e.widthType!==t.width?.type)&&(r.width=e.width!=null||e.widthType?{value:e.width??0,type:e.widthType||"dxa"}:void 0),e.cellMargins&&(r.cellMargins=Pe(e.cellMargins)),r}if(e.styleId||e.width!=null||e.widthType||e.justification||e.tableLayout||e.floating||e.cellMargins||e.look||e.bidi)return {styleId:e.styleId||void 0,width:e.width!=null||e.widthType?{value:e.width??0,type:e.widthType||"dxa"}:void 0,justification:e.justification||void 0,layout:e.tableLayout||void 0,floating:e.floating||void 0,cellMargins:e.cellMargins?Pe(e.cellMargins):void 0,look:e.look||void 0,bidi:e.bidi||void 0}}function Pe(e){return {top:e.top!=null?{value:e.top,type:"dxa"}:void 0,bottom:e.bottom!=null?{value:e.bottom,type:"dxa"}:void 0,left:e.left!=null?{value:e.left,type:"dxa"}:void 0,right:e.right!=null?{value:e.right,type:"dxa"}:void 0}}function ve(e){if(e._originalFormatting){let n=e._originalFormatting,t={...n};return e.height!==(n.height?.value||void 0)&&(t.height=e.height?{value:e.height,type:"dxa"}:void 0),e.heightRule!==(n.heightRule||void 0)&&(t.heightRule=e.heightRule||void 0),e.isHeader!==(n.header||void 0)&&(t.header=e.isHeader||void 0),t}if(!(!e.height&&!e.isHeader))return {height:e.height?{value:e.height,type:"dxa"}:void 0,heightRule:e.heightRule||void 0,header:e.isHeader||void 0}}function Be(e){if(e._originalFormatting){let t=e._originalFormatting,r={...t};return e.colspan>1&&(r.gridSpan=e.colspan),e.width!=null&&(r.width={value:e.width,type:e.widthType||"dxa"}),e.verticalAlign!==(t.verticalAlign||void 0)&&(r.verticalAlign=e.verticalAlign||void 0),e.backgroundColor?r.shading=e._originalResolvedFill===e.backgroundColor&&t.shading?t.shading:{fill:{rgb:e.backgroundColor}}:t.shading&&(r.shading=void 0),e.borders&&(r.borders=e.borders),e.margins&&(r.margins=Ie(e.margins)),e.textDirection!==(t.textDirection||void 0)&&(r.textDirection=e.textDirection||void 0),r}if(e.colspan>1||e.rowspan>1||e.width!=null||e.verticalAlign||e.backgroundColor||e.borders||e.margins||e.textDirection)return {gridSpan:e.colspan>1?e.colspan:void 0,width:e.width!=null?{value:e.width,type:e.widthType||"dxa"}:void 0,verticalAlign:e.verticalAlign||void 0,textDirection:e.textDirection||void 0,shading:e.backgroundColor?{fill:{rgb:e.backgroundColor}}:void 0,borders:e.borders,margins:e.margins?Ie(e.margins):void 0}}function Ie(e){let n={};return e.top!=null&&(n.top={value:e.top,type:"dxa"}),e.bottom!=null&&(n.bottom={value:e.bottom,type:"dxa"}),e.left!=null&&(n.left={value:e.left,type:"dxa"}),e.right!=null&&(n.right={value:e.right,type:"dxa"}),n}var nn={paraId:null,textId:null,alignment:null,spaceBefore:null,spaceAfter:null,lineSpacing:null,lineSpacingRule:null,spacingExplicit:null,indentLeft:null,indentRight:null,indentFirstLine:null,hangingIndent:false,numPr:null,numPrFromStyle:null,listNumFmt:null,listIsBullet:null,listMarker:null,listMarkerHidden:null,listMarkerFontFamily:null,listMarkerFontSize:null,listMarkerSuffix:null,listLevelNumFmts:null,listAbstractNumId:null,listStartOverride:null,styleId:null,borders:null,shading:null,tabs:null,pageBreakBefore:null,renderedPageBreakBefore:null,keepNext:null,keepLines:null,widowControl:null,contextualSpacing:null,snapToGrid:null,autoSpaceDE:null,autoSpaceDN:null,defaultTextFormatting:null,sectionBreakType:null,bidi:null,outlineLevel:null,bookmarks:null,_originalFormatting:null,_originalRunBoundaries:null,_sectionProperties:null,pPrIns:null,pPrDel:null,pPrChange:null},tn={styleId:null,width:null,widthType:null,justification:null,columnWidths:null,tableLayout:null,floating:null,cellMargins:null,look:null,bidi:null,_originalFormatting:null,tblPrChange:null},rn={height:null,heightRule:null,isHeader:false,_originalFormatting:null,trIns:null,trDel:null,trPrChange:null},on={colspan:1,rowspan:1,colwidth:null,width:null,widthType:null,verticalAlign:null,backgroundColor:null,borders:null,margins:null,textDirection:null,noWrap:false,_originalFormatting:null,_originalResolvedFill:null,cellMarker:null,tcPrChange:null},ln=new Set(["bold","italic","superscript","subscript","allCaps","smallCaps","emboss","imprint","textShadow","textOutline","hidden","rtl"]);function w(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function T(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function y(e){return typeof e=="string"?e:void 0}function q(e){if(Array.isArray(e))return e.map(q);let n=w(e);if(!n)return e;let t={};for(let[r,o]of Object.entries(n))o!=null&&(t[r]=q(o));return t}function N(e){if(e==null)return "null";if(Array.isArray(e))return `[${e.map(N).join(",")}]`;let n=w(e);return n?`{${Object.keys(n).sort().map(t=>`${JSON.stringify(t)}:${N(n[t])}`).join(",")}}`:JSON.stringify(e)}function H(e){let n={...e};return delete n.hyperlink,delete n.ins,delete n.del,n}function X(e){let n={};e.bold&&(n.bold=true),e.italic&&(n.italic=true),(e.boldCs??e.bold)&&(n.boldCs=true),(e.italicCs??e.italic)&&(n.italicCs=true);let t=w(e.underline);t&&t.inheritedHyperlink!==true&&(n.underline={style:y(t.style)||"single",color:w(t.color)??null});let r=w(e.strike);r&&(r.double?n.doubleStrike=true:n.strike=true);let o=w(e.textColor);o&&o.inheritedHyperlink!==true&&(n.color={rgb:y(o.rgb)??null,themeColor:o.themeColor??null,themeTint:y(o.themeTint)??null,themeShade:y(o.themeShade)??null}),typeof e.highlight=="string"&&(n.highlight=e.highlight);let i=w(e.fontSize);if(i){let p=T(i.size),c=T(i.sizeCs);p!==void 0&&(n.fontSize=p),c!==void 0&&(n.fontSizeCs=c);}let l=w(e.fontFamily);if(l){let p=y(l.ascii);n.fontFamily={ascii:p??null,hAnsi:y(l.hAnsi)??null,eastAsia:y(l.eastAsia),cs:y(l.cs),asciiTheme:l.asciiTheme??null,hAnsiTheme:y(l.hAnsiTheme),eastAsiaTheme:y(l.eastAsiaTheme),csTheme:y(l.csTheme)};}e.superscript&&(n.vertAlign="superscript"),e.subscript&&(n.vertAlign="subscript"),e.allCaps&&(n.allCaps=true),e.smallCaps&&(n.smallCaps=true);let s=w(e.characterSpacing);if(s){let p=T(s.spacing),c=T(s.position),m=T(s.scale),S=T(s.kerning);p!==void 0&&(n.spacing=p),c!==void 0&&(n.position=c),m!==void 0&&(n.scale=m),S!==void 0&&(n.kerning=S);}e.emboss&&(n.emboss=true),e.imprint&&(n.imprint=true),e.textShadow&&(n.shadow=true);let a=w(e.emphasisMark);a&&(n.emphasisMark=y(a.type)||"dot"),e.textOutline&&(n.outline=true),e.hidden&&(n.hidden=true),e.rtl&&(n.rtl=true);let u=w(e.textEffect);u&&(n.effect=y(u.effect)||"blinkBackground");let d=w(e.modernTextEffects);d?.effects&&(n.modernEffects=d.effects);let f=w(e.runStyle),g=y(f?.styleId);return g&&(n.styleId=g),n}function J(e,n){let t=[],r="",o=()=>{r&&(t.push({type:"text",text:r}),r="");},i=n.fontFamily?[n.fontFamily.ascii,n.fontFamily.hAnsi,n.fontFamily.eastAsia,n.fontFamily.cs].filter(s=>!!s):[],l=i.length>0&&i.every(s=>s===i[0])?i[0]:null;for(let s of e){let a=s.codePointAt(0)??0;s==="\xAD"?(o(),t.push({type:"softHyphen"})):s==="\u2011"?(o(),t.push({type:"noBreakHyphen"})):l&&a>=61440&&a<=63743?(o(),t.push({type:"symbol",font:l,char:a.toString(16).toUpperCase().padStart(4,"0")})):r+=s;}return o(),t}function Q(e,n){let t=X(H(n));return {type:"run",formatting:Object.keys(t).length>0?t:void 0,content:J(e,t)}}function sn(e,n){for(let t of n.content){let r=e.content[e.content.length-1];r?.type==="text"&&t.type==="text"?r.text+=t.text:e.content.push(t);}}function an(e){let n=0xcbf29ce484222325n;for(let t of new TextEncoder().encode(e))n=(n^BigInt(t))*0x100000001b3n,n&=0xffffffffffffffffn;return Number(n&(1n<<53n)-1n)}function de(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"){let n=Number(e);return Number.isFinite(n)?n:an(e)}return 0}function K(e,n=false,t){let r=w(e);if(!r)return null;let o=y(r.author)||"Unknown",i=y(r.date);return {id:t??de(r.revisionId??r.id),author:o,...i?{date:i}:{}}}function dn(e,n,t){let r=w(e),o=r?.revisionId??r?.id;return typeof o=="string"?t?.get(o)?.[n]:void 0}function un(e){let n=w(e.hyperlink);if(!n)return null;let t=y(n.href)||"";return t.startsWith("#")?{type:"hyperlink",anchor:t.slice(1),tooltip:y(n.tooltip)||void 0,children:[]}:{type:"hyperlink",href:t,tooltip:y(n.tooltip)||void 0,rId:y(n.rId)||void 0,children:[]}}function cn(e){let n=w(e.hyperlink);return n?y(n.href)||"":null}function he(e,n){let t=y(e.fieldData);if(t&&t.length<=2e6)try{let d=JSON.parse(t);t.includes('"media:')&&_(d);let f=d.type==="simpleField"?d.content:d.fieldResult;if((d.type==="simpleField"||d.type==="complexField")&&typeof d.instruction=="string"&&Array.isArray(f)){let g=y(e.displayMode);return d.fieldTree&&g&&(d.fieldTree.displayMode=g),d}}catch{}let r=X(H(n)),o={type:"run",content:[{type:"text",text:y(e.displayText)||""}],...Object.keys(r).length>0?{formatting:r}:{}},i=y(e.instruction)||"",l=y(e.fieldType)||"UNKNOWN",s=e.fldLock===true||void 0,a=e.dirty===true||void 0,u=y(e.displayMode)||"result";return e.fieldKind==="complex"?{type:"complexField",instruction:i,fieldType:l,fieldCode:[],fieldResult:[o],fldLock:s,dirty:a,fieldTree:{version:1,displayMode:u}}:{type:"simpleField",instruction:i,fieldType:l,content:[o],fldLock:s,dirty:a,fieldTree:{version:1,displayMode:u}}}function Ee(e){return {type:"mathEquation",display:y(e.display)||"inline",ommlXml:y(e.ommlXml)||"",plainText:y(e.plainText)||void 0}}function ye(e,n){let t=w(e.rule),r=T(t?.height);if(!t||r===void 0||t.width!=null&&T(t.width)===void 0||t.widthPercent!=null&&T(t.widthPercent)===void 0||typeof t.alignment!="string"||typeof t.noShade!="boolean"||typeof t.color!="string"||typeof t.xml!="string")throw new Error("Malformed horizontalRule embed payload");let o={width:T(t.width)??null,widthPercent:T(t.widthPercent)??null,height:r,alignment:t.alignment,noShade:t.noShade,color:t.color,xml:t.xml},i=X(H(n));return {type:"run",content:[{type:"horizontalRule",rule:o}],...Object.keys(i).length>0?{formatting:i}:{}}}var W=null;function Oe(e){return W&&e.startsWith("media:")?W(e)??e:e}function _(e){if(Array.isArray(e)){for(let t of e)_(t);return}let n=w(e);if(n)for(let[t,r]of Object.entries(n))t==="src"&&typeof r=="string"?n[t]=Oe(r):_(r);}function Le(e){let n=e,t={type:y(n.wrapType)||"inline"};n.distTop!==void 0&&(t.distT=c(Number(n.distTop))),n.distBottom!==void 0&&(t.distB=c(Number(n.distBottom))),n.distLeft!==void 0&&(t.distL=c(Number(n.distLeft))),n.distRight!==void 0&&(t.distR=c(Number(n.distRight))),n.wrapText&&(t.wrapText=n.wrapText);let r={type:"image",rId:y(n.rId)||"",src:Oe(y(n.src)||""),alt:y(n.alt)||void 0,title:y(n.title)||void 0,shapeType:y(n.shapeType)||void 0,size:{width:c(Number(n.width)||0),height:c(Number(n.height)||0)},wrap:t};if(n.transform){let l={},s=n.transform.match(/rotate\(([-\d.]+)deg\)/)?.[1];s&&(l.rotation=Number.parseFloat(s)),n.transform.includes("scaleX(-1)")&&(l.flipH=true),n.transform.includes("scaleY(-1)")&&(l.flipV=true),(l.rotation||l.flipH||l.flipV)&&(r.transform=l);}if(n.position?.horizontal&&n.position.vertical&&(r.position={relativeHeight:n.position.relativeHeight,horizontal:{relativeTo:n.position.horizontal.relativeTo||"column",alignment:n.position.horizontal.align,posOffset:n.position.horizontal.posOffset},vertical:{relativeTo:n.position.vertical.relativeTo||"paragraph",alignment:n.position.vertical.align,posOffset:n.position.vertical.posOffset}}),n.borderWidth&&n.borderWidth>0){let l={solid:"solid",dotted:"dot",dashed:"dash",double:"solid",groove:"solid",ridge:"solid",inset:"solid",outset:"solid"};r.outline={width:c(n.borderWidth),color:n.borderColor?{rgb:n.borderColor.replace("#","")}:void 0,style:n.borderStyle&&l[n.borderStyle]||"solid"};}n.hlinkHref&&(r.hlinkHref=n.hlinkHref);let o={};n.cropTop!=null&&(o.top=n.cropTop),n.cropRight!=null&&(o.right=n.cropRight),n.cropBottom!=null&&(o.bottom=n.cropBottom),n.cropLeft!=null&&(o.left=n.cropLeft),Object.keys(o).length>0&&(r.crop=o),n.opacity!=null&&n.opacity<1&&(r.opacity=n.opacity),n.layoutInCell!=null&&(r.layoutInCell=n.layoutInCell),n.allowOverlap!=null&&(r.allowOverlap=n.allowOverlap);let i={};return n.effectExtentTop!=null&&(i.top=c(n.effectExtentTop)),n.effectExtentBottom!=null&&(i.bottom=c(n.effectExtentBottom)),n.effectExtentLeft!=null&&(i.left=c(n.effectExtentLeft)),n.effectExtentRight!=null&&(i.right=c(n.effectExtentRight)),Object.keys(i).length>0&&(r.padding=i),{type:"run",content:[{type:"drawing",image:r}]}}function fn(e){let n=y(e);if(!(!n||n.length>2e6))try{let t=JSON.parse(n);return t?.type!=="shape"||typeof t.shapeType!="string"?void 0:(w(t.size)||(t.size={width:0,height:0}),n.includes('"media:')&&_(t),t)}catch{return}}function je(e){let n=y(e.chartJson);if(!n)return null;try{let t=JSON.parse(n);return n.includes('"media:')&&_(t),t?.type!=="chart"||typeof t.chartType!="string"?null:{type:"run",content:[{type:"chart",chart:t}]}}catch{return null}}function $e(e){let n=fn(e.shapeJson)??{type:"shape",shapeType:"rect",size:{width:0,height:0}},t=y(e.shapeType);t&&(n.shapeType=t);let r=y(e.shapeId);if(r&&(n.id=r),e.width&&(n.size={...n.size,width:c(Number(e.width))}),e.height&&(n.size={...n.size,height:c(Number(e.height))}),Array.isArray(e.geometryPath)&&e.geometryPath.length>0&&(n.geometryPath=e.geometryPath),e.fillType==="gradient"&&typeof e.gradientStops=="string")try{let i=JSON.parse(e.gradientStops);n.fill={type:"gradient",gradient:{type:y(e.gradientType)||"linear",angle:T(e.gradientAngle)||void 0,stops:i.map(l=>({position:l.position,color:{rgb:l.color.replace("#","")}}))}};}catch{n.fill={type:"solid",color:{rgb:(y(e.fillColor)||"000000").replace("#","")}};}else typeof e.fillColor=="string"?n.fill={type:y(e.fillType)||"solid",color:{rgb:e.fillColor.replace("#","")}}:e.fillType==="none"&&(n.fill={type:"none"});if(typeof e.outlineWidth=="number"&&e.outlineWidth>0){let i={solid:"solid",dotted:"dot",dashed:"dash"},l=y(e.outlineStyle);n.outline={width:c(e.outlineWidth),color:typeof e.outlineColor=="string"?{rgb:e.outlineColor.replace("#","")}:void 0,style:l&&i[l]||"solid"};}let o={};if(typeof e.rotation=="number")o.rotation=e.rotation;else if(typeof e.transform=="string"){let i=e.transform.match(/rotate\(([-\d.]+)deg\)/)?.[1];i&&(o.rotation=Number.parseFloat(i));}return (e.flipH||String(e.transform||"").includes("scaleX(-1)"))&&(o.flipH=true),(e.flipV||String(e.transform||"").includes("scaleY(-1)"))&&(o.flipV=true),(o.rotation||o.flipH||o.flipV)&&(n.transform=o),{type:"run",content:[{type:"shape",shape:n}]}}function be(e){let n=le(e),t=y(e.propertiesJson);if(t&&t.length<=1e6)try{let l=JSON.parse(t);t.includes('"media:')&&_(l),l&&typeof l=="object"&&typeof l.sdtType=="string"&&(n=l);}catch{}let r=[];for(let l of Array.isArray(e.content)?e.content:[]){let s=w(l),a=y(s?.kind);if(!s||!a)continue;let u=w(s.attrs)??{};if(a==="text"){let d=y(s.text);d!==void 0&&r.push({kind:"text",text:d,attributes:u});continue}r.push({kind:"embed",embedKind:a,payload:w(s.payload)??{},attributes:u});}let o=ue(ee(r,void 0,true)),i=Ke(e.value);if(i)try{let l=ie(n,i);n=l.properties;let s=l.content[0];o=ue(s?.type==="paragraph"?s.content:[]);}catch{}return {type:"inlineSdt",properties:n,content:o}}function ue(e){return e.filter(n=>n.type==="run"||n.type==="hyperlink"||n.type==="simpleField"||n.type==="complexField"||n.type==="inlineSdt"||n.type==="mathEquation"||n.type==="insertion"||n.type==="deletion"||n.type==="moveFrom"||n.type==="moveTo")}function pn(e){return e.filter(n=>n.type==="run"||n.type==="hyperlink"||n.type==="simpleField"||n.type==="complexField"||n.type==="inlineSdt"||n.type==="mathEquation")}function Ke(e){let n=w(e);return n?.kind==="checkbox"&&typeof n.checked=="boolean"?{kind:"checkbox",checked:n.checked}:n?.kind==="dropdown"&&typeof n.value=="string"?{kind:"dropdown",value:n.value}:n?.kind==="date"&&typeof n.date=="string"?{kind:"date",date:n.date}:null}function _e(e){if(e.modelKind!=="commentReference")return null;let n=T(e.commentId);return {type:"run",content:[{type:"commentReference",...n!==void 0?{id:n}:{}}]}}function ce(e){if(e.kind==="text")return Q(e.text,e.attributes);switch(e.embedKind){case "break":return {type:"run",content:[{type:"break",breakType:"textWrapping"}]};case "tab":return He(e.attributes);case "image":return Le(e.payload);case "horizontalRule":return ye(e.payload,e.attributes);case "shape":return $e(e.payload);case "chart":return je(e.payload);case "field":return _e(e.payload)??he(e.payload,e.attributes);case "math":return Ee(e.payload);case "sdt":return be(e.payload);case "noteRef":{let n=e.payload.footnoteRefId,t=e.payload.endnoteRefId;return {type:"run",content:[n!==void 0?{type:"footnoteRef",id:de(n)}:{type:"endnoteRef",id:de(t)}]}}default:return null}}function He(e){let n=X(H(e));return {type:"run",content:[{type:"tab"}],...Object.keys(n).length>0?{formatting:n}:{}}}function gn(e,n,t){let r;if(t){let l=ce(e);r=ue(l?[l]:[])[0]??{type:"run",content:[]};}else e.kind==="embed"&&e.embedKind==="sdt"?r=be(e.payload):e.kind==="embed"&&e.embedKind==="image"?r=Le(e.payload):e.kind==="embed"&&e.embedKind==="tab"?r=He(e.attributes):e.kind==="embed"&&e.embedKind==="horizontalRule"?r=ye(e.payload,e.attributes):e.kind==="embed"&&e.embedKind==="shape"?r=$e(e.payload):e.kind==="embed"&&e.embedKind==="chart"?r=je(e.payload)??{type:"run",content:[]}:e.kind==="text"?r=Q(e.text,e.attributes):r={type:"run",content:[]};let i=(w(e.attributes.ins)??w(e.attributes.del))?.isMovePair===true;return e.attributes.ins?i?{type:"moveTo",info:n,content:[r]}:{type:"insertion",info:n,content:[r]}:i?{type:"moveFrom",info:n,content:[r]}:{type:"deletion",info:n,content:[r]}}function mn(e,n){let t;if(n.kind==="text")t=Q(n.text,n.attributes);else if(n.embedKind==="break")t={type:"run",content:[{type:"break",breakType:"textWrapping"}]};else if(n.embedKind==="tab")t={type:"run",content:[{type:"tab"}]};else if(n.embedKind==="horizontalRule")t=ye(n.payload,n.attributes);else if(n.embedKind==="field")t=_e(n.payload)??he(n.payload,n.attributes);else if(n.embedKind==="math")t=Ee(n.payload);else if(n.embedKind==="sdt"){let r=be(n.payload);(n.attributes.ins||n.attributes.del||b$1(r))&&(t=r);}t&&(t.type==="run"&&e.children.push(t),(t.type!=="run"||e.structuredChildren)&&(e.structuredChildren??(e.structuredChildren=[...e.children])).push(t));}function Me(e){let n=[];for(let t of e){let r={...t.attributes};delete r.fieldResult;let o=t.kind==="embed"&&t.embedKind==="tab"?{kind:"text",text:" ",attributes:r}:{...t,attributes:r},i=n.at(-1);o.kind==="text"&&i?.kind==="text"&&N(i.attributes)===N(r)?i.text+=o.text:n.push(o);}return N(n)}function hn(e){let n=[];for(let[o,i]of e.entries()){if(i.kind!=="embed"||i.embedKind!=="field")continue;let l=T(w(i.payload.resultProjection)?.id);l!==void 0&&n.push({id:l,owner:i,position:o});}if(n.length===0)return e;let t=new Map,r=e.filter((o,i)=>{let l=w(o.attributes.fieldResult),s=T(l?.id),a=T(l?.index),u=n.find(p=>p.id===s&&p.position>i)?.owner;if(a===void 0||!u)return true;let d=t.get(u)??new Map,f=d.get(a)??[],g={...o.attributes};return delete g.fieldResult,f.push({...o,attributes:g}),d.set(a,f),t.set(u,d),false});for(let{owner:o}of n){let i=he(o.payload,o.attributes);if(i.type!=="complexField")continue;let l=w(o.payload.resultProjection),s=Array.isArray(l?.children)?l.children:[],a=new Map;for(let f of s){let g=w(f),p=T(g?.index);if(p===void 0||!Array.isArray(g?.items))continue;let c=t.get(o)?.get(p)??[];if(Me(c)===Me(g.items))continue;let m=pn(ee(c)),S=p<0?i.structuredCode?.inline?.[-p-1]:i.structuredResult?.inline?.[p];S?.type==="hyperlink"&&m.length===1&&m[0]?.type==="hyperlink"&&(m[0]={...S,...m[0],structuredChildren:m[0].structuredChildren}),a.set(p,m);}if(a.size===0)continue;let u=(i.structuredResult?.inline??[]).flatMap((f,g)=>a.get(g)??[f]),d=i.structuredCode?.inline?.flatMap((f,g)=>a.get(-g-1)??[f]);i.structuredResult={...i.structuredResult,inline:u},d&&(i.structuredCode={...i.structuredCode,inline:d}),i.fieldTree&&(i.fieldTree.result={...i.fieldTree.result,inline:u},d&&(i.fieldTree.code={...i.fieldTree.code,inline:d})),i.fieldResult=u.flatMap(f=>f.type==="run"?[f]:f.type==="hyperlink"?f.children.filter(g=>g.type==="run"):[]),o.payload={...o.payload,fieldData:JSON.stringify(i)};}return r}function fe(e){return e?.type==="insertion"||e?.type==="deletion"||e?.type==="moveFrom"||e?.type==="moveTo"}function ee(e,n,t=false){e=hn(e);let r=[],o=null,i=null,l=null,s=()=>{o&&r.push(o),o=null,i=null;},a=()=>{l&&r.push(l),l=null;};for(let u of e){if(u.kind==="embed"&&u.embedKind==="noteRef"){s(),a();let c=ce(u);c&&r.push(c);continue}let d=u.attributes.ins??u.attributes.del,f=K(d,false,dn(d,u.attributes.ins?"insertion":"deletion",n));if(f){s(),a();let c=gn(u,f,t),m=r[r.length-1];fe(m)&&fe(c)&&m.type===c.type&&m.info.id===c.info.id&&m.info.author===c.info.author&&m.info.date===c.info.date?m.content.push(...c.content):r.push(c);continue}let g=cn(u.attributes);if(g!==null){s();let c=l?l.href||(l.anchor?`#${l.anchor}`:""):null;(!l||c!==g)&&(a(),l=un(u.attributes)),l&&mn(l,u);continue}if(a(),u.kind==="text"){let c=N(H(u.attributes)),m=Q(u.text,u.attributes);o&&i===c?sn(o,m):(s(),o=m,i=c);continue}s();let p=ce(u);p&&r.push(p);}return s(),a(),r}function yn(e){if(!e)return {};let n={};for(let t of e.split("|")){let r=t.indexOf(":");if(r<=0)return null;let o=t.slice(0,r),i;try{i=JSON.parse(t.slice(r+1));}catch{return null}o==="comment"||o==="footnoteRef"||(ln.has(o)?n[o]=true:o==="highlight"?n.highlight=i.color:o==="insertion"||o==="deletion"?n[o==="insertion"?"ins":"del"]=q({id:i.revisionId,author:i.author,date:i.date,isMovePair:i.isMovePair}):n[o]=q(i));}return n}function bn(e){return e.noteMarks?.length?e.noteMarks.map(n=>({type:n==="endnote"?"endnoteRefMark":"footnoteRefMark"})):null}function kn(e,n){let t=bn(e);if(t)return t;if(!e.breaks?.length)return J(e.text,n);let r=[],o=0;for(let i of e.breaks){let l=Math.min(Math.max(i.offset,o),e.text.length);l>o&&r.push(...J(e.text.slice(o,l),n)),r.push({type:"break",breakType:i.type}),o=l;}return o<e.text.length&&r.push(...J(e.text.slice(o),n)),r}function wn(e,n,t){if(!t?.length||!e.every(s=>s.type==="run"&&s.content.every(a=>a.type==="text"))||n.some(s=>s.kind!=="text"||s.attributes.hyperlink)||t.some(s=>s.noteMarks?.length&&s.text.length>0)||n.map(s=>s.kind==="text"?s.text:"").join("")!==t.map(s=>s.text).join(""))return e;let o=0,i=0,l=[];for(let s of t){let a=yn(s.marksKey);if(!a)return e;l.push(a);let u=s.text.length;for(;u>0;){let d=n[o];if(d?.kind!=="text"||N(H(d.attributes))!==N(a))return e;let f=d.text.length-i,g=Math.min(u,f);u-=g,i+=g,i===d.text.length&&(o+=1,i=0);}}return o!==n.length||i!==0?e:t.map((s,a)=>{let u=s.text.length===0?s.formatting:X(l[a]),d={type:"run",content:kn(s,u??{})};return u&&Object.keys(u).length>0&&(d.formatting=u),s.propertyChanges?.length&&(d.propertyChanges=s.propertyChanges),d})}function ze(e){return e.type==="text"||e.type==="instrText"?e.text.length:e.type==="symbol"?e.char.length:e.type==="tab"||e.type==="softHyphen"||e.type==="noBreakHyphen"||e.type==="footnoteRef"||e.type==="endnoteRef"||e.type==="horizontalRule"||e.type==="commentReference"||e.type==="drawing"||e.type==="shape"||e.type==="chart"||e.type==="break"&&(e.breakType===void 0||e.breakType==="textWrapping")?1:0}function Ye(e){return e.content.reduce((n,t)=>n+ze(t),0)}function We(e){return e.type==="run"?Ye(e):e.type==="simpleField"||e.type==="complexField"||e.type==="inlineSdt"||e.type==="mathEquation"?1:0}function $(e){switch(e.type){case "run":return Ye(e);case "hyperlink":return (e.structuredChildren??e.children).reduce((n,t)=>n+We(t),0);case "complexField":return [...e.structuredCode?.inline??[],...e.structuredResult?.inline??[]].filter(n=>n.type==="hyperlink"||n.type==="simpleField").reduce((n,t)=>n+$(t),1);case "simpleField":case "inlineSdt":case "mathEquation":return 1;case "insertion":case "deletion":case "moveFrom":case "moveTo":return e.content.reduce((n,t)=>n+$(t),0);default:return 0}}function se(e,n,t,r){let o=[],i=[],l=0;for(let s of e){let a=t(s);if(l>=n)i.push(s);else if(l+a<=n)o.push(s);else {let u=r(s,n-l);if(!u)return null;u[0]&&o.push(u[0]),u[1]&&i.push(u[1]);}l+=a;}return [o,i]}function Cn(e,n){return e.type!=="text"&&e.type!=="instrText"?null:[{...e,text:e.text.slice(0,n)},{...e,text:e.text.slice(n)}]}function Ne(e,n){if(n.length===0)return null;let t=n.filter(r=>r.type==="run"||r.type==="bookmarkStart"||r.type==="bookmarkEnd");return e.structuredChildren?{...e,children:t,structuredChildren:n}:{...e,children:t}}function pe(e,n){if(e.type==="run"){let t=se(e.content,n,ze,Cn);return t&&[t[0].length>0?{...e,content:t[0]}:null,t[1].length>0?{...e,content:t[1]}:null]}if(e.type==="hyperlink"){let t=e.structuredChildren??e.children,r=se(t,n,We,(o,i)=>o.type==="run"?pe(o,i):null);return r&&[Ne(e,r[0]),Ne(e,r[1])]}if(fe(e)){let t=se(e.content,n,$,(r,o)=>pe(r,o));return t&&[t[0].length>0?{...e,content:t[0]}:null,t[1].length>0?{...e,content:t[1]}:null]}return null}function ge(e,n,t=r=>r.kind==="start"?{type:"commentRangeStart",id:r.id}:{type:"commentRangeEnd",id:r.id}){if(n.length===0)return e;let r=new Set(n.filter(d=>d.kind==="end"&&n.some(f=>f.kind==="start"&&f.id===d.id&&f.offset===d.offset)).map(d=>`${d.offset}:${d.id}`)),o=d=>r.has(`${d.offset}:${d.id}`)?1:d.kind==="end"?0:2,i=[...n].sort((d,f)=>d.offset-f.offset||o(d)-o(f)||d.id-f.id||(d.kind===f.kind?0:d.kind==="start"?-1:1)),l=[],s=0,a=0,u=d=>{for(;a<i.length&&i[a].offset<=d;)l.push(t(i[a++]));};u(0);for(let d of e){let f=s+$(d),g=d;for(;g&&a<i.length&&i[a].offset<f;){let c=i[a].offset,m=pe(g,c-s);if(!m)break;m[0]&&l.push(m[0]),s=c,u(s),g=m[1];}let p=[];for(;a<i.length&&i[a].offset<f;)p.push(i[a++]);for(let c of p)c.kind==="start"&&l.push(t(c));g&&l.push(g);for(let c of p)c.kind==="end"&&l.push(t(c));s=f,u(s);}return u(Number.POSITIVE_INFINITY),l}function Tn(e){if(!Array.isArray(e.bookmarks))return [];let n=[];for(let t of e.bookmarks){let r=w(t),o=T(r?.id);if(!r||o===void 0)continue;let i=T(r.offset)??0,l={name:y(r.name),colFirst:T(r.colFirst),colLast:T(r.colLast)};r.kind==="start"?n.push({id:o,kind:"start",offset:i,...l}):r.kind==="end"?n.push({id:o,kind:"end",offset:i,...l}):(n.push({id:o,kind:"start",offset:0,...l}),n.push({id:o,kind:"end",offset:Number.MAX_SAFE_INTEGER,...l}));}return n}function G(e,n=[]){if(Array.isArray(e))for(let t of e)G(t,n);else if(e!==null&&typeof e=="object"){let t=e;t.type==="paragraph"&&n.push(t);for(let r of Object.values(t))G(r,n);}return n}function Sn(e,n){let t=G(n);if(!t.some(o=>typeof o.sourceOrdinal=="number"))return;let r=G(e);r.length===t.length&&r.forEach((o,i)=>{let l=t[i].sourceOrdinal;typeof l=="number"&&(o.sourceOrdinal=l);});}function xn(e,n){if(!n)return e;let t=e.reduce((i,l)=>i+$(l),0),r=[],o=0;for(let[i,l]of n.content.entries())l.type==="rawXml"&&r.push({id:i,kind:"start",offset:Math.min(o,t)}),o+=$(l);return ge(e,r,i=>n.content[i.id])}function Pn(e){let n={...nn,...e};return n.styleId=e.pStyle??null,n._sectionProperties=e.sectPr??null,delete n.pStyle,delete n.sectPr,n}function In(e,n,t,r,o,i,l){let s=Pn(n),a=ee(t,i);a=wn(a,t,Array.isArray(s._originalRunBoundaries)?s._originalRunBoundaries:void 0),a=xn(a,o),o&&Sn(a,o.content),a=ge(a,r);let u=Tn(n).map(p=>({...p,offset:p.offset===Number.MAX_SAFE_INTEGER?a.reduce((c,m)=>c+$(m),0):p.offset}));u.length>0&&(a=ge(a,u,p=>{let c=p;return c.kind==="start"?{type:"bookmarkStart",id:c.id,name:c.name||"",...c.colFirst!==void 0?{colFirst:c.colFirst}:{},...c.colLast!==void 0?{colLast:c.colLast}:{},position:{offset:c.offset}}:{type:"bookmarkEnd",id:c.id,position:{offset:c.offset}}}));let d={type:"paragraph",paraId:e||void 0,textId:o?.textId,...o?.extraAttributes?{extraAttributes:o.extraAttributes}:{},...o?.paraIdAttribute?{paraIdAttribute:o.paraIdAttribute}:{},formatting:Ae(s,l),content:a};o?.renderedPageBreakBefore&&(d.renderedPageBreakBefore=true);let f=K(n.pPrIns,true),g=K(n.pPrDel,true);return f&&(d.pPrIns=f),g&&(d.pPrDel=g),Array.isArray(n.pPrChange)&&n.pPrChange.length>0&&(d.propertyChanges=n.pPrChange),n.sectPr?d.sectionProperties=n.sectPr:n.sectionBreakType&&(d.sectionProperties={sectionStart:n.sectionBreakType}),d}function Rn(e){let n=e[0]?.cells,t=e[e.length-1]?.cells,r=n?.[0]?.formatting?.borders;if(!n||!t||!r)return;let o={top:r.top,left:r.left,bottom:t[0]?.formatting?.borders?.bottom,right:n[n.length-1]?.formatting?.borders?.right,insideH:e.length>1?r.bottom:void 0,insideV:n.length>1?r.right:void 0},i=Object.entries(o).filter(([,l])=>l!==void 0);return i.length>0?Object.fromEntries(i):void 0}function An(e){let n=new Map;e.forEach((r,o)=>{let i=0;for(let l of r.cells){let s=i;if(i+=l.formatting?.gridSpan??1,l.formatting?.vMerge){let a=n.get(s)??[];a.push({rowIndex:o,cell:l}),n.set(s,a);}}});let t=r=>{r.formatting&&(delete r.formatting.vMerge,Object.keys(r.formatting).length===0&&(r.formatting=void 0));};for(let r of n.values()){let o=null,i=0,l=-1,s=()=>{o&&i<2&&t(o),o=null,i=0;};for(let a of r){let u=a.cell.formatting?.vMerge;u==="restart"?(s(),o=a.cell,i=1,l=a.rowIndex):u==="continue"&&(o&&a.rowIndex===l+1?(i+=1,l=a.rowIndex):(s(),t(a.cell)));}s();}}function Fn(e,n){let t={...on,...n.tcPr??{}},r=n.story&&e.storyIds.has(n.story)?e.storyToBlocks(n.story):[],o={type:"tableCell",formatting:Be(t),content:r},i=t.cellMarker;if(i){let l=K(i.info,true)??{id:0,author:"Unknown"};i.kind==="ins"?o.structuralChange={type:"tableCellInsertion",info:l}:i.kind==="del"?o.structuralChange={type:"tableCellDeletion",info:l}:o.structuralChange={type:"tableCellMerge",info:l,...i.vMerge?{vMerge:i.vMerge}:{},...i.vMergeOrig?{vMergeOrig:i.vMergeOrig}:{}};}return Array.isArray(t.tcPrChange)&&t.tcPrChange.length>0&&(o.propertyChanges=t.tcPrChange),o}function vn(e,n){let t=Array.isArray(n.rows)?n.rows:[],r=[],o=[],i=0;t.forEach((p,c)=>{let m=0;for(let S of Array.isArray(p.cells)?p.cells:[]){for(;r[c]?.[m];)m+=1;let B=S.tcPr??{},O=T(B.rowspan)||1,D=T(B.colspan)||1;o.push({row:c,col:m,rowspan:O,colspan:D,cell:Fn(e,S)});for(let x=c;x<c+O;x+=1){r[x]??(r[x]=[]);for(let h=m;h<m+D;h+=1)r[x][h]=true;}m+=D,i=Math.max(i,m);}});let l=new Map(o.map(p=>[`${p.row}-${p.col}`,p])),s=new Map;for(let p of o)for(let c=p.row;c<p.row+p.rowspan;c+=1)for(let m=p.col;m<p.col+p.colspan;m+=1)s.set(`${c}-${m}`,p);let a=t.map((p,c)=>{let m=[];for(let x=0;x<i;){let h=l.get(`${c}-${x}`);if(h){let C={...h.cell.formatting??{}};h.colspan>1?C.gridSpan=h.colspan:delete C.gridSpan,h.rowspan>1?C.vMerge="restart":C.vMerge!=="restart"&&C.vMerge!=="continue"&&delete C.vMerge,m.push({...h.cell,formatting:Object.keys(C).length>0?C:void 0}),x+=h.colspan;continue}let b=s.get(`${c}-${x}`);if(!b){x+=1;continue}let k={...b.cell.formatting??{}};b.colspan>1?k.gridSpan=b.colspan:delete k.gridSpan,k.vMerge="continue",m.push({...b.cell,content:[],formatting:k}),x+=b.colspan;}let S={...rn,...p.trPr??{}},B={type:"tableRow",formatting:ve(S),cells:m},O=K(S.trIns,true),D=K(S.trDel,true);return O?B.structuralChange={type:"tableRowInsertion",info:O}:D&&(B.structuralChange={type:"tableRowDeletion",info:D}),Array.isArray(S.trPrChange)&&S.trPrChange.length>0&&(B.propertyChanges=S.trPrChange),B});An(a);let u=Array.isArray(n.grid)?n.grid.filter(p=>typeof p=="number"):[],d={...tn,...n.tblPr??{},columnWidths:u.length>0?u:void 0},f=Fe(d);if(!f?.borders){let p=Rn(a);p&&(f={...f??{},borders:p});}let g={type:"table",columnWidths:d.columnWidths||void 0,formatting:f,rows:a};return Array.isArray(d.tblPrChange)&&d.tblPrChange.length>0&&(g.propertyChanges=d.tblPrChange),g}function Bn(){return {type:"paragraph",content:[{type:"run",content:[{type:"break",breakType:"page"}]}]}}function ke(e){return e.type==="insertion"||e.type==="deletion"||e.type==="moveFrom"||e.type==="moveTo"?e.content.length>0&&e.content.every(ke):e.type==="run"&&e.content.length>0&&e.content.every(n=>n.type==="footnoteRefMark"||n.type==="endnoteRefMark")}function Mn(e){return e.some(n=>n.type==="paragraph"&&n.content.some(ke))}function Nn(e,n){if(Mn(e))return e;let t=n.find(a=>a.type==="paragraph")?.content??[],r=t.findIndex(a=>!ke(a)),o=t.slice(0,r<0?t.length:r);if(o.length===0)return e;let i=e.findIndex(a=>a.type==="paragraph");if(i<0)return e;let l=e[i],s=[...e];return s[i]={...l,content:[...o,...l.content]},s}function Dn(e){let n=new Map;for(let[t,r]of e){let o=0;for(let i of r){if(i.type!=="paragraph")continue;let l=v.get(i)?.sessionKey??(!i.repeatedParaId&&i.paraId||`${t}:p${o}`);o+=1,n.has(l)||n.set(l,i);}}return n}function En(e){let n=new Map,t=(r,o)=>{n.set(r,o);let i=0,l=0;for(let s of o){if(s.type==="blockSdt"){t(`${r}:sdt${l++}`,s.content);continue}if(s.type!=="table")continue;let a=i++;s.rows.forEach((u,d)=>{u.cells.forEach((f,g)=>{t(`${r}:t${a}:r${d}c${g}`,f.content);});});}};t("body",e.package.document.content);for(let[r,o]of e.package.headers??[])t(`hf:${r}`,o.content);for(let[r,o]of e.package.footers??[])t(`hf:${r}`,o.content);for(let r of e.package.footnotes??[])t(`fn:${r.id}`,r.content);for(let r of e.package.endnotes??[])t(`en:${r.id}`,r.content);return n}function On(e,n,t){let r=new Map;for(let o of n??[]){let i;try{i=e.resolveComment(t?.get(o.id)??String(o.id));}catch{continue}let l=new Map;for(let s of i){let a=l.get(s.story)??[];a.push(s),l.set(s.story,a);}for(let[s,a]of l){if(a.length===0)continue;let u=Math.min(...a.map(g=>g.start)),d=Math.max(...a.map(g=>g.end)),f=r.get(s)??[];f.push({id:o.id,start:u,end:d}),r.set(s,f);}}return r}function Ln(e,n){let t=0;for(let r=0;r<n.length;r+=1){let o=n[r];if(!Te(o))continue;let i=n.slice(r+1).find(a=>a.type==="paragraph"&&a.paraId&&e.some(u=>u.type==="paragraph"&&u.paraId===a.paraId)),l=i?.type==="paragraph"?e.findIndex(a=>a.type==="paragraph"&&a.paraId===i.paraId):-1,s=l>=0?l:Math.min(r+t,e.length);e.splice(s,0,o),t=Math.max(0,s-r);}return e}var v=new WeakMap;function dt(e){return v.get(e)?.sessionKey}function jn(e,n){let t=n.filter(o=>o.type==="paragraph"),r=0;return e.map(o=>{if(o.type!=="paragraph")return o;let i=t[r++];if(!i?.paraId)return o;let l={...o,paraId:i.paraId},s=v.get(i)?.sessionKey;return s&&v.set(l,{sessionKey:s}),l})}function $n(e){return e.map(n=>{if(n.type==="paragraph"){let t={...n},r=v.get(n)?.sessionKey;return r&&v.set(t,{sessionKey:r}),t}return n.type!=="table"?n:{...n,rows:n.rows.map(t=>({...t,cells:t.cells.map(r=>({...r,content:$n(r.content)}))}))}})}var De=new WeakMap;function Xe(e){let n=De.get(e);return n||(n={wholesale:true,clean:new Set,dirty:new Set,stories:new Map,parents:new Map},De.set(e,n)),n}function Z(e,n){if(e===n)return true;if(Array.isArray(e)&&Array.isArray(n))return e.length===n.length&&e.every((i,l)=>Z(i,n[l]));let t=w(e),r=w(n);if(!t||!r)return false;let o=Object.keys(t);return o.length===Object.keys(r).length&&o.every(i=>i in r&&Z(t[i],r[i]))}var U=/^(.*?)(?::t\d+:r\d+c\d+|:sdt\d+)$/,Kn=e=>e.kind==="embed"&&(e.embedKind==="pageBreak"||e.embedKind==="columnBreak");function ut(e,n){let t=Xe(e);if(n==="all"){t.wholesale=true,t.clean.clear(),t.dirty.clear(),t.stories.clear(),t.parents.clear();return}let r=typeof n=="string"?[n]:[...n],o=new Set(r);for(let i=0;i<r.length;i+=1){let l=r[i];t.dirty.add(l),t.clean.delete(l),t.stories.delete(l);let s=t.parents.get(l)??U.exec(l)?.[1];s&&!o.has(s)&&(o.add(s),r.push(s));}}var ae=[],me=class{constructor(n,t,r,o){b(this,"session",n);b(this,"revisionIds",o);b(this,"storyIds");b(this,"baseParagraphs");b(this,"baseStories");b(this,"comments");b(this,"subtreeComments",new Map);b(this,"memo");b(this,"styles");b(this,"syntheticDefaults");b(this,"inherited",new Map);this.storyIds=new Set(n.storyIds()),this.baseStories=En(t),this.baseParagraphs=Dn(this.baseStories),this.comments=On(n,t.package.document.comments,r),this.memo=Xe(n),this.styles=d(t.package.styles);let i=this.styles.getDefaultParagraphStyle();this.syntheticDefaults=i!==void 0&&!(t.package.styles?.styles??[]).includes(i);for(let[l,s]of this.comments){let a=new Set;for(let u=l;u!==void 0&&!a.has(u);u=this.memo.parents.get(u)??U.exec(u)?.[1]){a.add(u);let d=this.subtreeComments.get(u)??new Map;d.set(l,s),this.subtreeComments.set(u,d);}}}storyIsClean(n){return this.memo.wholesale?this.memo.clean.has(n):!this.memo.dirty.has(n)}cellContents(n,t){let r=[];for(let o of Array.isArray(n.rows)?n.rows:[])for(let i of Array.isArray(o.cells)?o.cells:[])i.story!==void 0&&this.memo.parents.set(i.story,t),r.push(i.story!==void 0&&this.storyIds.has(i.story)?this.storyToBlocks(i.story):ae);return r}inheritedFormatting(n,t){if(U.test(n)||this.syntheticDefaults||t.numPr!=null)return;let r=typeof t.pStyle=="string"?t.pStyle:"";if(!this.inherited.has(r)){let o=this.styles.resolveParagraphStyle(r||null).paragraphFormatting;if(o===void 0||o.numPr!=null)this.inherited.set(r,void 0);else {let i={...o};delete i.indentLeft,delete i.indentRight,this.inherited.set(r,i);}}return this.inherited.get(r)}storyToBlocks(n){let t=this.baseStories.get(n),r=this.comments.get(n)??[],o=this.subtreeComments.get(n),i=o?N(Object.fromEntries(o)):"",l=this.memo.stories.get(n);if(l!==void 0&&l.commentsKey===i&&this.storyIsClean(n)&&(U.test(n)||t===void 0||t===l.blocks))return l.blocks;let s=[],a=this.session.storyParagraphIds(n),u=this.session.storySegments(n),d=[],f=0,g=0,p=0,c=0,m=null,S=h=>{if(!m){m=new Map;for(let b of t??[]){let k=v.get(b)?.key;if(k===void 0)continue;let C=m.get(k);C?C.push(b):m.set(k,[b]);}}return m.get(h)??[]},B=(h,b,k)=>S(h).find(C=>{let P=v.get(C);return P?.inputs!==void 0&&P.children!==void 0&&Z(P.inputs,b)&&P.children.length===k.length&&P.children.every((A,R)=>A===k[R])}),O=h=>{let b=[];for(let k of r){if(k.start>=f&&k.start<=h){let C=Math.max(0,k.start-g);b.push({id:k.id,kind:"start",offset:C});}k.end>=f&&k.end<=h&&b.push({id:k.id,kind:"end",offset:Math.max(0,k.end-g)});}return b},D=(h,b)=>{let k=0;for(let C=0;C<h.length;C+=1)h[C]===" "&&(C>k&&d.push({kind:"text",text:h.slice(k,C),attributes:b}),d.push({kind:"embed",embedKind:"tab",payload:{},attributes:b}),k=C+1);k<h.length&&d.push({kind:"text",text:h.slice(k),attributes:b});};for(let h of u){if(h.kind==="text"){D(h.text,h.attributes),c+=h.text.length;continue}if(h.kind==="pilcrow"){let b=a[p]??"",k=this.baseParagraphs.get(h.paraId),C=O(c),P=[h.paraId,b,h.properties,h.attributes,d,C],A=k!==void 0?v.get(k):void 0,R;if(k!==void 0&&A?.inputs!==void 0&&Z(A.inputs,P))R=k;else {let M=P.map((L,j)=>j===4?L.map(Je=>({...Je})):L);R=In(b,h.properties,d,C,k,this.revisionIds,this.inheritedFormatting(n,h.properties)),v.set(R,{inputs:M,sessionKey:h.paraId});}s.push(R),d=[],p+=1,c+=1,f=c,g=c;continue}if(h.embedKind==="table"){let b=h.payload,k=[h.attributes,b],P=`T${(Array.isArray(b.rows)?b.rows[0]?.cells?.[0]:void 0)?.story??""}`,A=S(P).length>0?this.cellContents(b,n):void 0,R=A!==void 0?B(P,k,A):void 0,M;R?M=R:(M=vn(this,b),v.set(M,{key:P,inputs:k,children:A??this.cellContents(b,n)})),s.push(M);}else if(h.embedKind==="blockSdt"){let b=y(h.payload.story);b&&this.memo.parents.set(b,n);let k=b&&this.storyIds.has(b)?this.storyToBlocks(b):ae,C=[h.attributes,h.payload],P=B(`S${b??""}`,C,[k]);if(P)s.push(P);else {let A=le(h.payload),R=k,M=Ke(h.payload.value);if(M)try{let j=ie(A,M);A=j.properties,R=jn(j.content,k);}catch{}let L={type:"blockSdt",properties:A,content:R===ae?[]:R};if(R!==k&&b!==void 0){let j=this.memo.stories.get(b);j&&(j.blocks=L.content);}v.set(L,{key:`S${b??""}`,inputs:C,children:[L.content]}),s.push(L);}}else if(h.embedKind==="opaque"){let b=w(h.payload.blob);if(b?.type==="pageBreak")s.push(Bn());else {let k=t?.[s.length];b?.type==="blockSdt"&&k?.type==="blockSdt"&&s.push(k);}}else d.push(h);c+=1,d.every(Kn)&&(g=c);}if(d.length>0){let h=ee(d,this.revisionIds);h.length>0&&s.push({type:"paragraph",content:h});}let x=Ln(s,t??[]);return this.memo.stories.set(n,{commentsKey:i,blocks:x}),this.memo.dirty.delete(n),this.memo.clean.add(n),x}};function ct(e,n,t={}){return Ve(e,n,t)}function ft(e,n,t){return Ve(e,n,{storyIds:new Set(["body"])},t)}function Ve(e,n,t,r){let o=W;W=i=>e.mediaDataUrl?.(i)??null;try{return _n(e,n,t,r)}finally{W=o;}}function _n(e,n,t,r){let o=new me(e,n,t.commentIds,r),i=g=>t.storyIds===void 0||t.storyIds.has(g),l=o.storyIds.has("body")&&i("body")?o.storyToBlocks("body"):n.package.document.content,s=n.package.headers;s&&(t.storyIds===void 0||[...s.keys()].some(g=>i(`hf:${g}`)))&&(s=new Map([...s].map(([g,p])=>{let c=`hf:${g}`;return [g,o.storyIds.has(c)&&i(c)?{...p,content:o.storyToBlocks(c)}:p]})));let a=n.package.footers;a&&(t.storyIds===void 0||[...a.keys()].some(g=>i(`hf:${g}`)))&&(a=new Map([...a].map(([g,p])=>{let c=`hf:${g}`;return [g,o.storyIds.has(c)&&i(c)?{...p,content:o.storyToBlocks(c)}:p]})));let u=(g,p)=>t.storyIds===void 0||g?.some(m=>i(`${p}${m.id}`))?g?.map(m=>{let S=`${p}${m.id}`;return o.storyIds.has(S)&&i(S)?{...m,content:Nn(o.storyToBlocks(S),m.content),verbatimXml:void 0}:m}):g,d=u(n.package.footnotes,"fn:"),f=u(n.package.endnotes,"en:");return {...n,package:{...n.package,document:{...n.package.document,content:l},...s?{headers:s}:{},...a?{footers:a}:{},...d?{footnotes:d}:{},...f?{endnotes:f}:{}}}}export{Hn as a,zn as b,Yn as c,Te as d,Gn as e,dt as f,$n as g,ut as h,ct as i,ft as j};
@@ -1 +1 @@
1
- function i(e){return e?.sections?.at(-1)?.properties??e?.finalSectionProperties}function m(e,r){let t=e.sections?.map((o,n,s)=>n===s.length-1?{...o,properties:r(o.properties)}:o);return {...e,...t?{sections:t}:{},finalSectionProperties:r(e.finalSectionProperties??{})}}var a=new WeakMap;function c(e){let r=e?.package.document;if(!r)return [{properties:{}}];let t=(r.sections??[]).map(o=>({sectionId:o.id??o.properties.sectionId,properties:o.properties}));return t.push({sectionId:t.at(-1)?.sectionId??r.finalSectionProperties?.sectionId,properties:i(r)??{}}),t}function l(e,r,t){let o=[];for(let n of e?.package.footnotes??[])n.noteType&&n.noteType!=="normal"||o.push({id:n.id,noteKind:"footnote",height:0});for(let n of e?.package.endnotes??[])n.noteType&&n.noteType!=="normal"||o.push({id:n.id,noteKind:"endnote",height:0});return {bodyStory:"body",options:{contractVersion:e?.package.contractVersion,pageGap:r},regions:{sections:c(e),settings:e?.package.settings,watermark:i(e?.package.document)?.watermark},notes:{contents:o},renderEnv:{compatibilityFlags:e?.package.settings?.compatibilityFlags,...t,...y(e,t),tocStyleIds:[...new Set([...t.tocStyleIds??[],...(e?.package.styles?.styles??[]).filter(n=>n.type==="paragraph"&&typeof n.styleId=="string"&&n.styleId&&[n.styleId,n.name].some(s=>/^TOC\s*\d+$/i.test(s??""))).map(n=>n.styleId)])]}}}function y(e,r){if(r.defaultParagraphStyleId)return {};let t=e?.package.styles?.styles??[],o=t.find(s=>s.type==="paragraph"&&s.default&&s.styleId)?.styleId;return o?{defaultParagraphStyleId:o}:t.some(s=>s.type==="paragraph"&&s.styleId==="Normal")?{defaultParagraphStyleId:"Normal"}:{}}function h(e){return a.get(e)}function k(e){let r=l(e.document,e.pageGap,e.renderEnv);r.measurement=e.measurement;let t=e.session,o=JSON.parse(t.layoutDocumentWithRegionsRetainedJson(JSON.stringify(r))),n=t.residentWorkerProbe().layoutRevision,s=null,u=()=>s??(s=JSON.parse(t.retainedKernelInputsJson(n)));return a.set(o.layout,{get measured(){return u().measured},get options(){return u().options},...o.headersFooters?{headersFooters:o.headersFooters}:{},layoutRevision:n}),{layout:o.layout,notesConverged:o.notesConverged}}function L(e,r){let t=JSON.parse(e),o=()=>{throw new Error("the measured blocks of a worker-run layout live in the worker")};return a.set(t.layout,{get measured(){return o()},get options(){return o()},...t.headersFooters?{headersFooters:t.headersFooters}:{},...r!==void 0?{layoutRevision:r}:{}}),{layout:t.layout,notesConverged:t.notesConverged}}export{i as a,m as b,l as c,h as d,k as e,L as f};
1
+ function a(e){return e?.sections?.at(-1)?.properties??e?.finalSectionProperties}function m(e,r){let t=e.sections?.map((o,n,s)=>n===s.length-1?{...o,properties:r(o.properties)}:o);return {...e,...t?{sections:t}:{},finalSectionProperties:r(e.finalSectionProperties??{})}}var i=new WeakMap;function c(e){let r=e?.package.document;if(!r)return [{properties:{}}];let t=(r.sections??[]).map(o=>({sectionId:o.id??o.properties.sectionId,properties:o.properties}));return t.push({sectionId:t.at(-1)?.sectionId??r.finalSectionProperties?.sectionId,properties:a(r)??{}}),t}function l(e,r,t){let o=[];for(let n of e?.package.footnotes??[])n.noteType&&n.noteType!=="normal"||o.push({id:n.id,noteKind:"footnote",height:0});for(let n of e?.package.endnotes??[])n.noteType&&n.noteType!=="normal"||o.push({id:n.id,noteKind:"endnote",height:0});return {bodyStory:"body",options:{contractVersion:e?.package.contractVersion,pageGap:r},regions:{sections:c(e),settings:e?.package.settings,watermark:a(e?.package.document)?.watermark},notes:{contents:o},renderEnv:{compatibilityFlags:e?.package.settings?.compatibilityFlags,...t,...y(e,t),tocStyleIds:[...new Set([...t.tocStyleIds??[],...(e?.package.styles?.styles??[]).filter(n=>n.type==="paragraph"&&typeof n.styleId=="string"&&n.styleId&&[n.styleId,n.name].some(s=>/^TOC\s*\d+$/i.test(s??""))).map(n=>n.styleId)])]}}}function y(e,r){if(r.defaultParagraphStyleId)return {};let t=e?.package.styles?.styles??[],o=t.find(s=>s.type==="paragraph"&&s.default&&s.styleId)?.styleId;return o?{defaultParagraphStyleId:o}:t.some(s=>s.type==="paragraph"&&s.styleId==="Normal")?{defaultParagraphStyleId:"Normal"}:{}}function h(e){return i.get(e)}function k(e){let r=l(e.document,e.pageGap,e.renderEnv);r.measurement=e.measurement,e.cachedPageTotals&&(r.cachedPageTotals=true);let t=e.session,o=JSON.parse(t.layoutDocumentWithRegionsRetainedJson(JSON.stringify(r))),n=t.residentWorkerProbe().layoutRevision,s=null,u=()=>s??(s=JSON.parse(t.retainedKernelInputsJson(n)));return i.set(o.layout,{get measured(){return u().measured},get options(){return u().options},...o.headersFooters?{headersFooters:o.headersFooters}:{},layoutRevision:n}),{layout:o.layout,notesConverged:o.notesConverged}}function L(e,r){let t=JSON.parse(e),o=()=>{throw new Error("the measured blocks of a worker-run layout live in the worker")};return i.set(t.layout,{get measured(){return o()},get options(){return o()},...t.headersFooters?{headersFooters:t.headersFooters}:{},...r!==void 0?{layoutRevision:r}:{}}),{layout:t.layout,notesConverged:t.notesConverged}}export{a,m as b,l as c,h as d,k as e,L as f};
@@ -0,0 +1,2 @@
1
+ import {a as a$2}from'./chunk-UBUTIWXN.mjs';import {c,a,b as b$1}from'./chunk-AXFMDV66.mjs';import {a as a$1,g}from'./chunk-GKWXOZZH.mjs';var P={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"};var C=new TextEncoder,F=new TextDecoder("utf-8",{ignoreBOM:true});function K(e){return typeof e=="string"?C.encode(e):e instanceof Uint8Array?e:new Uint8Array(e)}function b(e){return e?F.decode(e):void 0}function Z(e){let t=c(Object.fromEntries(e)),r=new ArrayBuffer(t.byteLength);return new Uint8Array(r).set(t),r}function I(e){return e.startsWith("/")?e.slice(1):`word/${e}`}function M(e){let t=[{relsPath:"word/_rels/document.xml.rels",blocks:e.package.document.content}],r=c=>(c??[]).flatMap(i=>i.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 a=e.package.relationships;if(!a)return t;let l=(c,i)=>{if(c)for(let[f,d]of c.entries()){let p=a.get(f);if(!p||p.type!==i||!p.target)continue;let g=I(p.target).replace(/^word\//,"");t.push({relsPath:`word/_rels/${g}.rels`,blocks:d.content});}};return l(e.package.headers,P.header),l(e.package.footers,P.footer),t}async function H(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("")}async function ne(e,t,r={},n,o,a$2,l=false){await a(),await a$1();let c=o??{seed:await H(new Uint8Array(t)),now:new Date().toISOString()};L(c);let i=e.package,f={determinism:c,document:i.document,headerEntries:[...i.headers?.entries()??[]],footerEntries:[...i.footers?.entries()??[]],footnotes:i.footnotes??[],endnotes:i.endnotes??[],footnoteSeparators:i.footnoteSeparators??[],endnoteSeparators:i.endnoteSeparators??[],relationshipEntries:[...i.relationships?.entries()??[]],...i.numbering===void 0?{}:{numbering:i.numbering},options:{updateModifiedDate:r.updateModifiedDate??true,...r.modifiedBy===void 0?{}:{modifiedBy:r.modifiedBy}},...n===void 0?{}:{selective:{changedParaIds:[...n.changedParaIds],...n.sourceParagraphs===void 0?{}:{sourceParagraphs:n.sourceParagraphs}}},...a$2===void 0?{}:{paragraphIds:a$2}};R(f,"save");let d=g(JSON.stringify(f),new Uint8Array(t)),p=X(d);return !n&&!l&&W(e,t,p),{buffer:p,determinism:c}}function W(e,t,r){let n=b$1(new Uint8Array(t)),o=b$1(new Uint8Array(r));for(let c of M(e)){let i=b(n[c.relsPath])??"",f=b(o[c.relsPath])??"",d=new Set(x(i).map(s=>m(s,"Id"))),p=x(f).filter(s=>m(s,"Type")?.endsWith("/image")).map(s=>m(s,"Id")).filter(s=>!!s&&!d.has(s)),u=_(c.blocks);if(u.length>p.length)throw new Error(`Rust save image mutation mismatch in ${c.relsPath}: ${u.length} model images, ${p.length} relationships`);u.forEach((s,h)=>{s.rId=p[h];});let g=x(f).filter(s=>m(s,"Type")?.endsWith("/hyperlink")&&m(s,"TargetMode")==="External");for(let s of D(c.blocks)){if(!s.href){$(f,s.rId)||(s.rId=void 0);continue}let h=g.find(w=>j(m(w,"Target")??"")===s.href),y=h&&m(h,"Id");y&&(s.rId=y);}}let a=e.package.headers,l=e.package.relationships;if(!(!a||!l))for(let[c,i]of a){let f=i.watermark;if(!f||f.kind!=="picture")continue;let d=l.get(c);if(!d?.target)continue;let u=`word/_rels/${I(d.target).replace(/^word\//,"")}.rels`,g=b(o[u])??"";if($(g,f.relId))continue;let s=f.mediaPath?.split("/").pop(),h=x(g).find(w=>{if(!m(w,"Type")?.endsWith("/image"))return false;let O=m(w,"Target")?.split("/").pop();return s?O===s:true}),y=h&&m(h,"Id");y&&(f.relId=y);}}function _(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 a of o.content)a.type==="run"?r(a):a$2(a,l=>{l.type==="run"&&r(l);},false,true);else a$2(o,a=>{a.type==="run"&&r(a);});else if(n.type==="table")for(let o of n.rows)for(let a of o.cells)t.push(..._(a.content));return t}function D(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),n.type!=="run"&&a$2(n,o=>{o.type==="hyperlink"&&(o.href||o.rId)&&!o.anchor&&t.push(o);});else if(r.type==="table")for(let n of r.rows)for(let o of n.cells)t.push(...D(o.content));else r.type==="blockSdt"&&t.push(...D(r.content));return t}function x(e){return [...e.matchAll(/<Relationship\b[^>]*\/?>/g)].map(t=>t[0])}function m(e,t){return e.match(new RegExp(`\\b${t}="([^"]*)"`))?.[1]}function $(e,t){if(t)return x(e).find(r=>m(r,"Id")===t)}function j(e){return e.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&apos;/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(/&amp;/g,"&")}function L(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 N=new Set(["__proto__","constructor","prototype"]);function R(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)=>R(n,`${t}[${o}]`,r));else for(let n of Object.keys(e)){if(N.has(n))throw new TypeError(`${t} contains forbidden key ${n}`);R(e[n],`${t}.${n}`,r);}r.delete(e);}}function X(e){let t=new ArrayBuffer(e.byteLength);return new Uint8Array(t).set(e),t}
2
+ export{P as a,K as b,Z as c,ne as d};
@@ -1 +1 @@
1
- import {c as c$1}from'./chunk-6CHGYCFU.mjs';import {a}from'./chunk-TTRUPDAB.mjs';var U={};a(U,{build_display_list_json:()=>A,clear_measure_fonts:()=>D,close_display_list:()=>X,default:()=>J,hit_test_json:()=>z,hit_test_regions_by_handle:()=>N,hit_test_regions_json:()=>M,initSync:()=>S,install_panic_hook:()=>Y,layout_document_json:()=>T,measure_paragraph_json:()=>W,open_display_list:()=>K,outline_glyph_json:()=>O,range_rects_by_handle:()=>Q,range_rects_json:()=>B,range_rects_region_by_handle:()=>Z,range_rects_region_json:()=>$,register_measure_font:()=>I,register_substitute_measure_font:()=>H,update_display_list:()=>ee,vertical_move_by_handle:()=>ne,vertical_move_json:()=>te});function A(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u,i=o.build_display_list_json(_,a);var r=i[0],s=i[1];if(i[3])throw r=0,s=0,f(i[2]);return n=r,t=s,p(r,s)}finally{o.__wbindgen_free(n,t,1);}}function D(){let e=o.clear_measure_fonts();if(e[1])throw f(e[0])}function X(e){o.close_display_list(e);}function z(e,n,t,r){let s,_;try{let l=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),b=u,d=o.hit_test_json(l,b,n,t,r);var a=d[0],i=d[1];if(d[3])throw a=0,i=0,f(d[2]);return s=a,_=i,p(a,i)}finally{o.__wbindgen_free(s,_,1);}}function N(e,n,t,r){let s,_;try{let l=o.hit_test_regions_by_handle(e,n,t,r);var a=l[0],i=l[1];if(l[3])throw a=0,i=0,f(l[2]);return s=a,_=i,p(a,i)}finally{o.__wbindgen_free(s,_,1);}}function M(e,n,t,r){let s,_;try{let l=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),b=u,d=o.hit_test_regions_json(l,b,n,t,r);var a=d[0],i=d[1];if(d[3])throw a=0,i=0,f(d[2]);return s=a,_=i,p(a,i)}finally{o.__wbindgen_free(s,_,1);}}function Y(){o.install_panic_hook();}function T(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u,i=o.layout_document_json(_,a);var r=i[0],s=i[1];if(i[3])throw r=0,s=0,f(i[2]);return n=r,t=s,p(r,s)}finally{o.__wbindgen_free(n,t,1);}}function W(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u,i=o.measure_paragraph_json(_,a);var r=i[0],s=i[1];if(i[3])throw r=0,s=0,f(i[2]);return n=r,t=s,p(r,s)}finally{o.__wbindgen_free(n,t,1);}}function K(e){let n=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,r=o.open_display_list(n,t);if(r[2])throw f(r[1]);return r[0]>>>0}function O(e,n){let t,r;try{let a=o.outline_glyph_json(e,n);var s=a[0],_=a[1];if(a[3])throw s=0,_=0,f(a[2]);return t=s,r=_,p(s,_)}finally{o.__wbindgen_free(t,r,1);}}function Q(e,n,t){let r,s;try{let i=o.range_rects_by_handle(e,n,t);var _=i[0],a=i[1];if(i[3])throw _=0,a=0,f(i[2]);return r=_,s=a,p(_,a)}finally{o.__wbindgen_free(r,s,1);}}function B(e,n,t){let r,s;try{let i=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),l=u,b=o.range_rects_json(i,l,n,t);var _=b[0],a=b[1];if(b[3])throw _=0,a=0,f(b[2]);return r=_,s=a,p(_,a)}finally{o.__wbindgen_free(r,s,1);}}function Z(e,n,t,r,s){let _,a;try{let b=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),d=u,h=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),m=u,w=o.range_rects_region_by_handle(e,b,d,h,m,r,s);var i=w[0],l=w[1];if(w[3])throw i=0,l=0,f(w[2]);return _=i,a=l,p(i,l)}finally{o.__wbindgen_free(_,a,1);}}function $(e,n,t,r,s){let _,a;try{let b=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),d=u,h=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),m=u,w=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),G=u,E=o.range_rects_region_json(b,d,h,m,w,G,r,s);var i=E[0],l=E[1];if(E[3])throw i=0,l=0,f(E[2]);return _=i,a=l,p(i,l)}finally{o.__wbindgen_free(_,a,1);}}function I(e){let n=re(e,o.__wbindgen_malloc),t=u,r=o.register_measure_font(n,t);if(r[2])throw f(r[1]);return r[0]>>>0}function H(e,n){let t=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,s=o.register_substitute_measure_font(e,t,r);if(s[2])throw f(s[1]);return s[0]>>>0}function ee(e,n){let t=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,s=o.update_display_list(e,t,r);if(s[1])throw f(s[0])}function ne(e,n,t,r){let s,_;try{let l=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),b=u,d=o.vertical_move_by_handle(e,n,l,b,r);var a=d[0],i=d[1];if(d[3])throw a=0,i=0,f(d[2]);return s=a,_=i,p(a,i)}finally{o.__wbindgen_free(s,_,1);}}function te(e,n,t,r){let s,_;try{let l=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),b=u,d=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),h=u,m=o.vertical_move_json(l,b,n,d,h,r);var a=m[0],i=m[1];if(m[3])throw a=0,i=0,f(m[2]);return s=a,_=i,p(a,i)}finally{o.__wbindgen_free(s,_,1);}}function q(){return {__proto__:null,"./docx_layout_bg.js":{__proto__:null,__wbg_error_4feb385805d22acc:function(n,t){console.error(p(n,t));},__wbindgen_cast_0000000000000001:function(n,t){return p(n,t)},__wbindgen_init_externref_table:function(){let n=o.__wbindgen_externrefs,t=n.grow(4);n.set(0,void 0),n.set(t+0,void 0),n.set(t+1,null),n.set(t+2,true),n.set(t+3,false);}}}}function p(e,n){return se(e>>>0,n)}var x=null;function v(){return (x===null||x.byteLength===0)&&(x=new Uint8Array(o.memory.buffer)),x}function re(e,n){let t=n(e.length*1,1)>>>0;return v().set(e,t/1),u=e.length,t}function g(e,n,t){if(t===void 0){let i=R.encode(e),l=n(i.length,1)>>>0;return v().subarray(l,l+i.length).set(i),u=i.length,l}let r=e.length,s=n(r,1)>>>0,_=v(),a=0;for(;a<r;a++){let i=e.charCodeAt(a);if(i>127)break;_[s+a]=i;}if(a!==r){a!==0&&(e=e.slice(a)),s=t(s,r,r=a+e.length*3,1)>>>0;let i=v().subarray(s+a,s+r),l=R.encodeInto(e,i);a+=l.written,s=t(s,r,a,1)>>>0;}return u=a,s}function f(e){let n=o.__wbindgen_externrefs.get(e);return o.__externref_table_dealloc(e),n}var j=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true});j.decode();var oe=2146435072,L=0;function se(e,n){return L+=n,L>=oe&&(j=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}),j.decode(),L=n),j.decode(v().subarray(e,e+n))}var R=new TextEncoder;"encodeInto"in R||(R.encodeInto=function(e,n){let t=R.encode(e);return n.set(t),{read:e.length,written:t.length}});var u=0,o;function F(e,n){return o=e.exports,x=null,o.__wbindgen_start(),o}async function _e(e,n){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,n)}catch(s){if(e.ok&&t(e.type)&&e.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",s);else throw s}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,n)}else {let r=await WebAssembly.instantiate(e,n);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}function t(r){switch(r){case "basic":case "cors":case "default":return true}return false}}function S(e){if(o!==void 0)return o;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let n=q();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let t=new WebAssembly.Instance(e,n);return F(t)}async function J(e){if(o!==void 0)return o;if(e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),e===void 0)throw new Error("docx-layout requires an explicit module or URL");let n=q();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:t,module:r}=await _e(await e,n);return F(t)}var c=c$1({label:"docx-layout",preloadName:"preloadLayoutWasm",assetUrl:()=>new URL("./generated/layout/docx_layout_bg.wasm",import.meta.url),initAsync:J,initSync:S});function fe(e){return c.preload(e)}function ge(e,n,t,r){return c.ensure(),M(e,n,t,r)}function be(e,n,t){return c.ensure(),B(e,n,t)}function y(e){let n=U[e];return typeof n=="function"?n:void 0}function pe(){return c.ensure(),y("open_display_list")!==void 0}function ye(){return c.ensure(),y("range_rects_region_json")!==void 0}function me(e){c.ensure();let n=y("open_display_list");if(!n)throw new Error("open_display_list is not available in the embedded layout wasm yet");return n(e)}function we(e){c.ensure(),y("close_display_list")?.(e);}function he(e,n){c.ensure();let t=y("update_display_list");if(!t)throw new Error("update_display_list is not available in the embedded layout wasm yet");t(e,n);}function xe(){return c.ensure(),y("update_display_list")!==void 0}function ve(e,n,t,r){c.ensure();let s=y("hit_test_regions_by_handle");if(!s)throw new Error("hit_test_regions_by_handle is not available in the embedded layout wasm yet");return s(e,n,t,r)}function Re(e,n,t,r){c.ensure();let s=y("vertical_move_json");if(!s)throw new Error("vertical_move_json is not available in the embedded layout wasm");return s(e,n,t,r)}function Ee(e,n,t,r){c.ensure();let s=y("vertical_move_by_handle");if(!s)throw new Error("vertical_move_by_handle is not available in the embedded layout wasm");return s(e,n,t,r)}function je(e,n,t){c.ensure();let r=y("range_rects_by_handle");if(!r)throw new Error("range_rects_by_handle is not available in the embedded layout wasm yet");return r(e,n,t)}function Le(e,n,t,r,s){c.ensure();let _=y("range_rects_region_json");if(!_)throw new Error("range_rects_region_json is not available in the embedded layout wasm yet");return _(e,n,t,r,s)}function Ae(e,n,t,r,s){c.ensure();let _=y("range_rects_region_by_handle");if(!_)throw new Error("range_rects_region_by_handle is not available in the embedded layout wasm yet");return _(e,n,t,r,s)}function De(e){return c.ensure(),A(e)}function Me(e){return c.ensure(),T(e)}function Te(e){return c.ensure(),I(e)}function We(e,n){return c.ensure(),H(e,n)}function Oe(){c.ensure(),D();}function Be(e){return c.ensure(),W(e)}function le(){let e=O;return typeof e=="function"?e:void 0}function Ie(e,n){c.ensure();let t=le();if(!t)throw new Error("outline_glyph_json is not available in the embedded layout wasm yet");return t(e,n)}export{fe as a,ge as b,be as c,pe as d,ye as e,me as f,we as g,he as h,xe as i,ve as j,Re as k,Ee as l,je as m,Le as n,Ae as o,De as p,Me as q,Te as r,We as s,Oe as t,Be as u,Ie as v};
1
+ import {c as c$1}from'./chunk-HGKSOBXK.mjs';import {a}from'./chunk-TTRUPDAB.mjs';var U={};a(U,{build_display_list_json:()=>A,clear_measure_fonts:()=>D,close_display_list:()=>X,default:()=>J,hit_test_json:()=>z,hit_test_regions_by_handle:()=>N,hit_test_regions_json:()=>M,initSync:()=>S,install_panic_hook:()=>Y,layout_document_json:()=>T,measure_paragraph_json:()=>W,open_display_list:()=>K,outline_glyph_json:()=>O,range_rects_by_handle:()=>Q,range_rects_json:()=>B,range_rects_region_by_handle:()=>Z,range_rects_region_json:()=>$,register_measure_font:()=>I,register_substitute_measure_font:()=>H,update_display_list:()=>ee,vertical_move_by_handle:()=>ne,vertical_move_json:()=>te});function A(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u,i=o.build_display_list_json(_,a);var r=i[0],s=i[1];if(i[3])throw r=0,s=0,f(i[2]);return n=r,t=s,p(r,s)}finally{o.__wbindgen_free(n,t,1);}}function D(){let e=o.clear_measure_fonts();if(e[1])throw f(e[0])}function X(e){o.close_display_list(e);}function z(e,n,t,r){let s,_;try{let l=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),b=u,d=o.hit_test_json(l,b,n,t,r);var a=d[0],i=d[1];if(d[3])throw a=0,i=0,f(d[2]);return s=a,_=i,p(a,i)}finally{o.__wbindgen_free(s,_,1);}}function N(e,n,t,r){let s,_;try{let l=o.hit_test_regions_by_handle(e,n,t,r);var a=l[0],i=l[1];if(l[3])throw a=0,i=0,f(l[2]);return s=a,_=i,p(a,i)}finally{o.__wbindgen_free(s,_,1);}}function M(e,n,t,r){let s,_;try{let l=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),b=u,d=o.hit_test_regions_json(l,b,n,t,r);var a=d[0],i=d[1];if(d[3])throw a=0,i=0,f(d[2]);return s=a,_=i,p(a,i)}finally{o.__wbindgen_free(s,_,1);}}function Y(){o.install_panic_hook();}function T(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u,i=o.layout_document_json(_,a);var r=i[0],s=i[1];if(i[3])throw r=0,s=0,f(i[2]);return n=r,t=s,p(r,s)}finally{o.__wbindgen_free(n,t,1);}}function W(e){let n,t;try{let _=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),a=u,i=o.measure_paragraph_json(_,a);var r=i[0],s=i[1];if(i[3])throw r=0,s=0,f(i[2]);return n=r,t=s,p(r,s)}finally{o.__wbindgen_free(n,t,1);}}function K(e){let n=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),t=u,r=o.open_display_list(n,t);if(r[2])throw f(r[1]);return r[0]>>>0}function O(e,n){let t,r;try{let a=o.outline_glyph_json(e,n);var s=a[0],_=a[1];if(a[3])throw s=0,_=0,f(a[2]);return t=s,r=_,p(s,_)}finally{o.__wbindgen_free(t,r,1);}}function Q(e,n,t){let r,s;try{let i=o.range_rects_by_handle(e,n,t);var _=i[0],a=i[1];if(i[3])throw _=0,a=0,f(i[2]);return r=_,s=a,p(_,a)}finally{o.__wbindgen_free(r,s,1);}}function B(e,n,t){let r,s;try{let i=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),l=u,b=o.range_rects_json(i,l,n,t);var _=b[0],a=b[1];if(b[3])throw _=0,a=0,f(b[2]);return r=_,s=a,p(_,a)}finally{o.__wbindgen_free(r,s,1);}}function Z(e,n,t,r,s){let _,a;try{let b=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),d=u,h=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),m=u,w=o.range_rects_region_by_handle(e,b,d,h,m,r,s);var i=w[0],l=w[1];if(w[3])throw i=0,l=0,f(w[2]);return _=i,a=l,p(i,l)}finally{o.__wbindgen_free(_,a,1);}}function $(e,n,t,r,s){let _,a;try{let b=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),d=u,h=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),m=u,w=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),G=u,E=o.range_rects_region_json(b,d,h,m,w,G,r,s);var i=E[0],l=E[1];if(E[3])throw i=0,l=0,f(E[2]);return _=i,a=l,p(i,l)}finally{o.__wbindgen_free(_,a,1);}}function I(e){let n=re(e,o.__wbindgen_malloc),t=u,r=o.register_measure_font(n,t);if(r[2])throw f(r[1]);return r[0]>>>0}function H(e,n){let t=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,s=o.register_substitute_measure_font(e,t,r);if(s[2])throw f(s[1]);return s[0]>>>0}function ee(e,n){let t=g(n,o.__wbindgen_malloc,o.__wbindgen_realloc),r=u,s=o.update_display_list(e,t,r);if(s[1])throw f(s[0])}function ne(e,n,t,r){let s,_;try{let l=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),b=u,d=o.vertical_move_by_handle(e,n,l,b,r);var a=d[0],i=d[1];if(d[3])throw a=0,i=0,f(d[2]);return s=a,_=i,p(a,i)}finally{o.__wbindgen_free(s,_,1);}}function te(e,n,t,r){let s,_;try{let l=g(e,o.__wbindgen_malloc,o.__wbindgen_realloc),b=u,d=g(t,o.__wbindgen_malloc,o.__wbindgen_realloc),h=u,m=o.vertical_move_json(l,b,n,d,h,r);var a=m[0],i=m[1];if(m[3])throw a=0,i=0,f(m[2]);return s=a,_=i,p(a,i)}finally{o.__wbindgen_free(s,_,1);}}function q(){return {__proto__:null,"./docx_layout_bg.js":{__proto__:null,__wbg_error_80e96bcb285356d4:function(n,t){console.error(p(n,t));},__wbindgen_cast_0000000000000001:function(n,t){return p(n,t)},__wbindgen_init_externref_table:function(){let n=o.__wbindgen_externrefs,t=n.grow(4);n.set(0,void 0),n.set(t+0,void 0),n.set(t+1,null),n.set(t+2,true),n.set(t+3,false);}}}}function p(e,n){return se(e>>>0,n)}var x=null;function v(){return (x===null||x.byteLength===0)&&(x=new Uint8Array(o.memory.buffer)),x}function re(e,n){let t=n(e.length*1,1)>>>0;return v().set(e,t/1),u=e.length,t}function g(e,n,t){if(t===void 0){let i=R.encode(e),l=n(i.length,1)>>>0;return v().subarray(l,l+i.length).set(i),u=i.length,l}let r=e.length,s=n(r,1)>>>0,_=v(),a=0;for(;a<r;a++){let i=e.charCodeAt(a);if(i>127)break;_[s+a]=i;}if(a!==r){a!==0&&(e=e.slice(a)),s=t(s,r,r=a+e.length*3,1)>>>0;let i=v().subarray(s+a,s+r),l=R.encodeInto(e,i);a+=l.written,s=t(s,r,a,1)>>>0;}return u=a,s}function f(e){let n=o.__wbindgen_externrefs.get(e);return o.__externref_table_dealloc(e),n}var j=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true});j.decode();var oe=2146435072,L=0;function se(e,n){return L+=n,L>=oe&&(j=new TextDecoder("utf-8",{ignoreBOM:true,fatal:true}),j.decode(),L=n),j.decode(v().subarray(e,e+n))}var R=new TextEncoder;"encodeInto"in R||(R.encodeInto=function(e,n){let t=R.encode(e);return n.set(t),{read:e.length,written:t.length}});var u=0,o;function F(e,n){return o=e.exports,x=null,o.__wbindgen_start(),o}async function _e(e,n){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,n)}catch(s){if(e.ok&&t(e.type)&&e.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",s);else throw s}let r=await e.arrayBuffer();return await WebAssembly.instantiate(r,n)}else {let r=await WebAssembly.instantiate(e,n);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}function t(r){switch(r){case "basic":case "cors":case "default":return true}return false}}function S(e){if(o!==void 0)return o;e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let n=q();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let t=new WebAssembly.Instance(e,n);return F(t)}async function J(e){if(o!==void 0)return o;if(e!==void 0&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),e===void 0)throw new Error("docx-layout requires an explicit module or URL");let n=q();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:t,module:r}=await _e(await e,n);return F(t)}var c=c$1({label:"docx-layout",preloadName:"preloadLayoutWasm",assetUrl:()=>new URL("./generated/layout/docx_layout_bg.wasm",import.meta.url),initAsync:J,initSync:S});function fe(e){return c.preload(e)}function ge(e,n,t,r){return c.ensure(),M(e,n,t,r)}function be(e,n,t){return c.ensure(),B(e,n,t)}function y(e){let n=U[e];return typeof n=="function"?n:void 0}function pe(){return c.ensure(),y("open_display_list")!==void 0}function ye(){return c.ensure(),y("range_rects_region_json")!==void 0}function me(e){c.ensure();let n=y("open_display_list");if(!n)throw new Error("open_display_list is not available in the embedded layout wasm yet");return n(e)}function we(e){c.ensure(),y("close_display_list")?.(e);}function he(e,n){c.ensure();let t=y("update_display_list");if(!t)throw new Error("update_display_list is not available in the embedded layout wasm yet");t(e,n);}function xe(){return c.ensure(),y("update_display_list")!==void 0}function ve(e,n,t,r){c.ensure();let s=y("hit_test_regions_by_handle");if(!s)throw new Error("hit_test_regions_by_handle is not available in the embedded layout wasm yet");return s(e,n,t,r)}function Re(e,n,t,r){c.ensure();let s=y("vertical_move_json");if(!s)throw new Error("vertical_move_json is not available in the embedded layout wasm");return s(e,n,t,r)}function Ee(e,n,t,r){c.ensure();let s=y("vertical_move_by_handle");if(!s)throw new Error("vertical_move_by_handle is not available in the embedded layout wasm");return s(e,n,t,r)}function je(e,n,t){c.ensure();let r=y("range_rects_by_handle");if(!r)throw new Error("range_rects_by_handle is not available in the embedded layout wasm yet");return r(e,n,t)}function Le(e,n,t,r,s){c.ensure();let _=y("range_rects_region_json");if(!_)throw new Error("range_rects_region_json is not available in the embedded layout wasm yet");return _(e,n,t,r,s)}function Ae(e,n,t,r,s){c.ensure();let _=y("range_rects_region_by_handle");if(!_)throw new Error("range_rects_region_by_handle is not available in the embedded layout wasm yet");return _(e,n,t,r,s)}function De(e){return c.ensure(),A(e)}function Me(e){return c.ensure(),T(e)}function Te(e){return c.ensure(),I(e)}function We(e,n){return c.ensure(),H(e,n)}function Oe(){c.ensure(),D();}function Be(e){return c.ensure(),W(e)}function le(){let e=O;return typeof e=="function"?e:void 0}function Ie(e,n){c.ensure();let t=le();if(!t)throw new Error("outline_glyph_json is not available in the embedded layout wasm yet");return t(e,n)}export{fe as a,ge as b,be as c,pe as d,ye as e,me as f,we as g,he as h,xe as i,ve as j,Re as k,Ee as l,je as m,Le as n,Ae as o,De as p,Me as q,Te as r,We as s,Oe as t,Be as u,Ie as v};
@@ -0,0 +1 @@
1
+ function n(t,e,r=false,i=false){t.type==="inlineSdt"&&(r=true),(t.type==="insertion"||t.type==="deletion"||t.type==="moveFrom"||t.type==="moveTo")&&(i=true),r&&i&&e(t);let l;if(t.type==="inlineSdt"||t.type==="insertion"||t.type==="deletion"||t.type==="moveFrom"||t.type==="moveTo")l=t.content;else if(t.type==="hyperlink")l=t.structuredChildren??t.children;else if(t.type==="simpleField")l=t.structuredResult?.inline??t.content;else if(t.type==="complexField"){for(let p of t.structuredCode?.inline??t.fieldCode)p.type==="run"&&!(r&&i)||n(p,e,r,i);l=t.structuredResult?.inline??t.fieldResult;}else return;for(let p of l)p.type==="run"&&!(r&&i)||n(p,e,r,i);}function f(t){let e=false;return n(t,()=>{e=true;}),e}export{n as a,f as b};
@@ -1,4 +1,4 @@
1
- import {d}from'./chunk-YLFKV2NT.mjs';import {a as a$1,b as b$1}from'./chunk-2QHGQA3V.mjs';import {a as a$2}from'./chunk-3CYO46ML.mjs';import {a,c}from'./chunk-DLXIZBB6.mjs';async function In(e){if(e instanceof ArrayBuffer)return e;if(e instanceof Uint8Array){let n=new ArrayBuffer(e.byteLength);return new Uint8Array(n).set(e),n}if(e instanceof Blob)return e.arrayBuffer();throw new TypeError(`Unsupported DocxInput type: ${typeof e}`)}function ye(e){let n=e.replace(/[^0-9a-fA-F]/g,"");if(n.length!==32)return null;let t=new Uint8Array(16);for(let i=0;i<16;i++){let r=Number.parseInt(n.slice(i*2,i*2+2),16);if(Number.isNaN(r))return null;t[i]=r;}let o=new Uint8Array(16);for(let i=0;i<16;i++)o[i]=t[15-i];return o}function be(e){return e?ye(e)!==null:false}function we(e,n){let t=ye(n);if(!t)throw new Error(`Invalid embedded-font key: "${n}"`);let o=new Uint8Array(e.slice(0)),i=Math.min(32,o.length);for(let r=0;r<i;r++)o[r]^=t[r%16];return o.buffer}var je={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}},Je={"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 Ye(e){let n=e.toLowerCase();return n.includes("mono")||n.includes("courier")||n.includes("consolas")||n.includes("console")||n.includes("code")||n.includes("terminal")?"monospace":n.includes("times")||n.includes("georgia")||n.includes("garamond")||n.includes("palatino")||n.includes("baskerville")||n.includes("bodoni")||n.includes("cambria")||n.includes("mincho")||n.includes("\u660E\u671D")||n.includes("\u660E\u9AD4")||n.includes("\u5B8B")||n.includes("ming")||n.includes("song")||n.includes("serif")?"serif":n.includes("script")||n.includes("cursive")||n.includes("comic")||n.includes("brush")||n.includes("hand")?"cursive":"sans-serif"}var Ve={"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 Le(e){let n=e.trim().toLowerCase(),t=je[Ve[n]??n];if(t)return {googleFont:t.googleFont,cssFallback:t.fallbackStack.map(he).join(", "),originalFont:e,hasGoogleEquivalent:true,singleLineRatio:t.singleLineRatio};let o=Ye(e),i=Je[o];return {googleFont:null,cssFallback:`${he(e)}, ${i}`,originalFont:e,hasGoogleEquivalent:false,singleLineRatio:1.15}}var Xe={"\n":"\\a ","\r":"\\d ","\f":"\\c "};function Qe(e){return e.replace(/["\\]/g,"\\$&").replace(/[\n\r\f]/g,n=>Xe[n])}function he(e){return ["serif","sans-serif","monospace","cursive","fantasy","system-ui"].includes(e.toLowerCase())?e:/[\s,'"()]/.test(e)?`"${Qe(e)}"`:e}var g=new Set,L=new Map,W=new Set,S=new Map,Z=new Set,ee=new Set,_e=new Set([null]),z={scope:null},Ee=new Set,C=new Set;function P(e){!e.disposed&&(e.loadCallbacks.size>0||e.errorCallbacks.size>0)?C.add(e):C.delete(e);}function G(e){return e.has(null)?C:[...e].filter(n=>n!==null&&C.has(n))}var V=new Map,ne=new Map;function te(e,n,t){let o=e.get(n);return o||(o=new Set,e.set(n,o)),o.add(t),o}var y=false,D=true,j=new Set,O=new Set,oe=new Map,Ze=5*6e4;function ke(e){let n=oe.get(e);return n===void 0?false:Date.now()-n<Ze?true:(oe.delete(e),false)}function b(e,n,t=_e){let o=e instanceof Error?e.message:String(e),i=new Error(`[font] ${n}: ${o}`,{cause:e}),r=[...ee];for(let s of G(t))r.push(...s.errorCallbacks);if(r.length>0)for(let s of r)try{s(i);}catch(a){console.error("Font error subscriber threw:",a);}else console.warn(i.message);}function ve(e,n="normal",t="normal"){return `${e.trim()}|${n}|${t}`}var en=[[false,false],[true,false],[false,true],[true,true]],Re=5e3,nn=500,B=new Map,x=new Map,Pe=new Set,re=new Set,X=new Set,ie=0,N=[],M=null;function Ne(){if(M!==null&&(clearTimeout(M),M=null),N.length===0)return;let e=N;N=[],document.fonts.dispatchEvent(typeof FontFaceSetLoadEvent=="function"?new FontFaceSetLoadEvent("loadingdone",{fontfaces:e}):new Event("loadingdone"));}function tn(){ie-=1,N.length!==0&&(ie===0?Ne():M??(M=setTimeout(Ne,nn)));}function Be(e,n,t,o){return e.resolveFamily?e.resolveFamily(n,t,o):!t&&!o?e.resolve(n,false,false):void 0}function on(e,n,t,o,i,r){let s=ve(n,o?700:400,i?"italic":"normal"),a=B.get(s);if(a)return x.get(s)?.add(r),a;let c=Be(e,t,o,i);if(!c)return;ie+=1;let d=new Set([r]);x.set(s,d);let l=(async()=>{let f;try{f=new FontFace(n,await c(),{weight:o?"700":"400",style:i?"italic":"normal"});let u=f.status==="loaded";return document.fonts.add(f),await f.load(),u&&N.push(f),!0}catch(u){return f&&document.fonts.delete(f),b(u,`failed to register bundled "${n}"`,new Set([...d].flatMap(m=>[...m]))),false}finally{x.get(s)===d&&x.delete(s),tn();}})();return B.set(s,l),l.then(f=>{!f&&B.get(s)===l&&B.delete(s);}),l}function rn(e,n,t,o,i,r){if(typeof FontFace>"u"||document.fonts===void 0)return Promise.resolve("none");let s=t||o?(t??[400,700]).flatMap(l=>(o??["normal","italic"]).map(f=>[l>=600,f==="italic"])):en,a=s.map(()=>"pending"),c$1=false,d=()=>c$1&&a.every(l=>l==="unsupported")?"absent":a.includes("registered")?c$1&&a.every(l=>l==="registered"||l==="unsupported")?"complete":"partial":"none";return new Promise(l=>{let f=false,u=()=>{f||(f=true,clearTimeout(m),l(d()));},m=setTimeout(u,i);(async()=>{let w=await c();if(!w)return;c$1=true;let p=n.find(h=>s.some(([J,v])=>Be(w,h,J,v)))??e;await Promise.all(s.map(async([h,J],v)=>{let de=on(w,e,p,h,J,r);if(!de){a[v]="unsupported";return}Pe.add(e),a[v]=await de?"registered":"failed";}));})().catch(()=>{}).finally(u);})}function se(e,n){return j.has(e)||Pe.has(e)?false:O.has(e)?true:mn(e)?(O.add(e),queueMicrotask(()=>T([e],n)),true):false}function sn(e){let n=`${e.toLowerCase()}|`,t=[],o=[];for(let[i,r]of S)if(i.toLowerCase().startsWith(n)){t.push(r);let s=F.get(i)?.requesters??ne.get(i);s&&o.push(s);}return {promises:t,requesters:o}}function an(e,n,t){W.add(e),g.add(n),T([n],t);}function ln(e,n=[400,700],t=["normal","italic"]){let o=encodeURIComponent(e),i=[];for(let s of t){let a=s==="italic"?1:0;for(let c of n)i.push(`${a},${c}`);}i.sort();let r=i.join(";");return `https://fonts.googleapis.com/css2?family=${o}:ital,wght@${r}&display=swap`}function cn(e,n){return U(e,n,void 0,void 0,null)}async function U(e,n,t,o,i){if(typeof document>"u")return false;let r=e.trim();if(g.has(r))return true;let s=L.get(r);if(s){if(te(V,r,i),!t)return s;let u=o??Date.now()+Re;return s.then(m=>m||!X.has(r)?m:U(e,n,t,u,i))}if(!n&&se(r,new Set([i])))return true;let a$1=sn(r),c=a();if(!D&&!c&&a$1.promises.length===0)return false;let d=ln(r,n?.weights,n?.styles);if(!c&&a$1.promises.length===0&&ke(d))return false;let l=te(V,r,i),f=(async()=>{y=true;try{if(a$1.promises.length>0){if(await Promise.all(a$1.promises),g.has(r))return un([r],l,a$1.requesters),!0;if(!n&&se(r,l))return !0}if(c){let p=await rn(r,t?[r,t.trim()]:[r],n?.weights,n?.styles,o===void 0?Re:Math.max(0,o-Date.now()),l);return p==="absent"?X.add(r):X.delete(r),p==="none"||p==="absent"?!1:(p==="complete"?(re.delete(r),q(r)):re.add(r),T([r],l),!0)}if(!D||ke(d))return !1;let u=document.createElement("link");u.rel="stylesheet",u.href=d;let m=!1;return await new Promise(p=>{let h=setTimeout(()=>p(!1),5e3);u.onload=()=>{clearTimeout(h),p(!0);},u.onerror=()=>{clearTimeout(h),m=!0,p(!1);},document.head.appendChild(u);})?(await le(r,3e3),q(r),T([r],l),!0):(u.onload=null,u.onerror=null,u.remove(),m&&oe.set(d,Date.now()),!1)}catch(u){return b(u,`failed to load "${r}"`,l),false}finally{L.delete(r),V.delete(r),L.size===0&&S.size===0&&(y=false);}})();return L.set(r,f),f}async function fn(e,n){let t=e.filter(o=>!g.has(o.trim()));t.length!==0&&await Promise.all(t.map(o=>cn(o,n)));}function Ae(e){let n=e.trim();return g.has(n)||O.has(n)}function On(e){D=e;}function Un(){return D}function $n(){return y}function qn(){return Array.from(new Set([...g,...O]))}function Kn(e){return Z.add(e),()=>{Z.delete(e);}}function T(e,n=_e){let t=[...Z];for(let o of G(n))t.push(...o.loadCallbacks);for(let o of t)try{o(e);}catch(i){b(i,"load callback threw",n);}}function un(e,n,t){let o=new Set;for(let i of t)for(let r of G(i))o.add(r);for(let i of G(n))if(!o.has(i))for(let r of [...i.loadCallbacks])try{r(e);}catch(s){b(s,"load callback threw",new Set([i]));}}function Hn(e){return ee.add(e),()=>{ee.delete(e);}}async function le(e,n){if("fonts"in document)try{let t=`400 16px "${e}"`;return await Promise.race([document.fonts.load(t),new Promise(o=>setTimeout(o,n))]),document.fonts.check(t)}catch{}return await new Promise(t=>setTimeout(t,100)),true}var R,Ce=new Map,dn="abcdefghijklmnopqrstuvwxyz0123456789";function gn(){return R===void 0&&(R=document.createElement("canvas").getContext("2d"),R&&(R.textBaseline="top")),R}function mn(e,n="sans-serif"){if(typeof document>"u")return false;let t=gn();if(!t)return false;let o=r=>(t.font=r,t.measureText(dn).width),i=r=>{let s=Ce.get(r);return s===void 0&&(s=o(`72px ${r}`),Ce.set(r,s)),o(`72px "${e}", ${r}`)!==s};return i(n)||i(n==="sans-serif"?"serif":"sans-serif")}var pn={"<":"\\3c ",">":"\\3e ","\n":"\\a ","\r":"\\d ","\f":"\\c "},xe=e=>e.replace(/["\\]/g,"\\$&").replace(/[<>\n\r\f]/g,n=>pn[n]);async function Wn(e,n,t){if(typeof document>"u")return false;let o={family:e,data:n,weight:t?.weight,style:t?.style},i=e.trim();return Oe(o,z,De(i,[o]))}var F=new Map,I=new Map,A=new Map,Sn=256,_=new Set,$=new Map;function q(e){g.add(e),_.delete(e),$.delete(e);}function Te(e,n){g.has(n)||_.add(n),g.add(n),e.families.has(n)||(e.families.add(n),A.set(n,(A.get(n)??0)+1));}function K(e){return new Uint8Array(e.data)}function ae(e){let n=2166136261;for(let t=0;t<e.length;t+=1)n=Math.imul(n^e[t],16777619);return `${(n>>>0).toString(16).padStart(8,"0")}${e.length.toString(16)}`}function Me(e,n){if(e.length!==n.length)return false;for(let t=0;t<e.length;t+=1)if(e[t]!==n[t])return false;return true}function Fn(e){let n=String(e??"normal").trim().toLowerCase();if(n==="normal")return "400";if(n==="bold")return "700";let t=Number(n);return n!==""&&Number.isFinite(t)?String(t):n}function Ge(e,n,t){return `${e.trim().toLowerCase()}|${Fn(n)}|${t}`}function yn(e,n){let t=`${e}|${ae(n)}`;for(let o=0;;o+=1){let i=o===0?t:`${t}~${o}`,r=F.get(i);if(!r||Me(r.bytes,n))return i}}function Ie(e,n,t){let o=Ge(e,n.weight,n.style??"normal"),i=K(n);for(let r of I.get(o)??[])if(!Me(r.bytes,i)&&[...r.owners].some(s=>!t.has(s)))return true;return false}function De(e,n,t=Ee){if(!n.some(i=>Ie(e,i,t)))return e;let o=`${e}#${ae(new TextEncoder().encode(n.map(i=>ae(K(i))).join()))}`;for(let i=0;;i+=1){let r=i===0?o:`${o}~${i}`;if(!n.some(s=>Ie(r,s,Ee)))return r}}function Oe(e,n,t){let o=e.family.trim(),i=e.style??"normal",r=Ge(t,e.weight,i),s=yn(r,K(e)),a=t.toLowerCase()===o.toLowerCase();j.add(o);let c=F.get(s);if(c)return c.owners.add(n),c.settled||c.requesters.add(n.scope),a?c.promise.then(u=>(u&&F.get(s)===c&&Te(c,o),u)):c.promise;let d=K(e).slice(),l={key:s,cssSlot:r,cssFamily:t,families:new Set,requesters:new Set([n.scope]),settled:false,bytes:d,owners:new Set([n]),promise:Promise.resolve(false),style:null,url:null};F.set(s,l);let f=I.get(r);return f||(f=new Set,I.set(r,f)),f.add(l),l.promise=(async()=>{y=true;try{return l.url=URL.createObjectURL(new Blob([d],{type:"font/ttf"})),l.style=document.createElement("style"),l.style.textContent=`
1
+ import {d}from'./chunk-EBYC3CX7.mjs';import {a as a$1,b as b$1}from'./chunk-AXFMDV66.mjs';import {a as a$2}from'./chunk-GKWXOZZH.mjs';import {a,c}from'./chunk-DLXIZBB6.mjs';async function In(e){if(e instanceof ArrayBuffer)return e;if(e instanceof Uint8Array){let n=new ArrayBuffer(e.byteLength);return new Uint8Array(n).set(e),n}if(e instanceof Blob)return e.arrayBuffer();throw new TypeError(`Unsupported DocxInput type: ${typeof e}`)}function ye(e){let n=e.replace(/[^0-9a-fA-F]/g,"");if(n.length!==32)return null;let t=new Uint8Array(16);for(let i=0;i<16;i++){let r=Number.parseInt(n.slice(i*2,i*2+2),16);if(Number.isNaN(r))return null;t[i]=r;}let o=new Uint8Array(16);for(let i=0;i<16;i++)o[i]=t[15-i];return o}function be(e){return e?ye(e)!==null:false}function we(e,n){let t=ye(n);if(!t)throw new Error(`Invalid embedded-font key: "${n}"`);let o=new Uint8Array(e.slice(0)),i=Math.min(32,o.length);for(let r=0;r<i;r++)o[r]^=t[r%16];return o.buffer}var je={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}},Je={"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 Ye(e){let n=e.toLowerCase();return n.includes("mono")||n.includes("courier")||n.includes("consolas")||n.includes("console")||n.includes("code")||n.includes("terminal")?"monospace":n.includes("times")||n.includes("georgia")||n.includes("garamond")||n.includes("palatino")||n.includes("baskerville")||n.includes("bodoni")||n.includes("cambria")||n.includes("mincho")||n.includes("\u660E\u671D")||n.includes("\u660E\u9AD4")||n.includes("\u5B8B")||n.includes("ming")||n.includes("song")||n.includes("serif")?"serif":n.includes("script")||n.includes("cursive")||n.includes("comic")||n.includes("brush")||n.includes("hand")?"cursive":"sans-serif"}var Ve={"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 Le(e){let n=e.trim().toLowerCase(),t=je[Ve[n]??n];if(t)return {googleFont:t.googleFont,cssFallback:t.fallbackStack.map(he).join(", "),originalFont:e,hasGoogleEquivalent:true,singleLineRatio:t.singleLineRatio};let o=Ye(e),i=Je[o];return {googleFont:null,cssFallback:`${he(e)}, ${i}`,originalFont:e,hasGoogleEquivalent:false,singleLineRatio:1.15}}var Xe={"\n":"\\a ","\r":"\\d ","\f":"\\c "};function Qe(e){return e.replace(/["\\]/g,"\\$&").replace(/[\n\r\f]/g,n=>Xe[n])}function he(e){return ["serif","sans-serif","monospace","cursive","fantasy","system-ui"].includes(e.toLowerCase())?e:/[\s,'"()]/.test(e)?`"${Qe(e)}"`:e}var g=new Set,L=new Map,W=new Set,S=new Map,Z=new Set,ee=new Set,_e=new Set([null]),z={scope:null},Ee=new Set,C=new Set;function P(e){!e.disposed&&(e.loadCallbacks.size>0||e.errorCallbacks.size>0)?C.add(e):C.delete(e);}function G(e){return e.has(null)?C:[...e].filter(n=>n!==null&&C.has(n))}var V=new Map,ne=new Map;function te(e,n,t){let o=e.get(n);return o||(o=new Set,e.set(n,o)),o.add(t),o}var y=false,D=true,j=new Set,O=new Set,oe=new Map,Ze=5*6e4;function ke(e){let n=oe.get(e);return n===void 0?false:Date.now()-n<Ze?true:(oe.delete(e),false)}function b(e,n,t=_e){let o=e instanceof Error?e.message:String(e),i=new Error(`[font] ${n}: ${o}`,{cause:e}),r=[...ee];for(let s of G(t))r.push(...s.errorCallbacks);if(r.length>0)for(let s of r)try{s(i);}catch(a){console.error("Font error subscriber threw:",a);}else console.warn(i.message);}function ve(e,n="normal",t="normal"){return `${e.trim()}|${n}|${t}`}var en=[[false,false],[true,false],[false,true],[true,true]],Re=5e3,nn=500,B=new Map,x=new Map,Pe=new Set,re=new Set,X=new Set,ie=0,N=[],M=null;function Ne(){if(M!==null&&(clearTimeout(M),M=null),N.length===0)return;let e=N;N=[],document.fonts.dispatchEvent(typeof FontFaceSetLoadEvent=="function"?new FontFaceSetLoadEvent("loadingdone",{fontfaces:e}):new Event("loadingdone"));}function tn(){ie-=1,N.length!==0&&(ie===0?Ne():M??(M=setTimeout(Ne,nn)));}function Be(e,n,t,o){return e.resolveFamily?e.resolveFamily(n,t,o):!t&&!o?e.resolve(n,false,false):void 0}function on(e,n,t,o,i,r){let s=ve(n,o?700:400,i?"italic":"normal"),a=B.get(s);if(a)return x.get(s)?.add(r),a;let c=Be(e,t,o,i);if(!c)return;ie+=1;let d=new Set([r]);x.set(s,d);let l=(async()=>{let f;try{f=new FontFace(n,await c(),{weight:o?"700":"400",style:i?"italic":"normal"});let u=f.status==="loaded";return document.fonts.add(f),await f.load(),u&&N.push(f),!0}catch(u){return f&&document.fonts.delete(f),b(u,`failed to register bundled "${n}"`,new Set([...d].flatMap(m=>[...m]))),false}finally{x.get(s)===d&&x.delete(s),tn();}})();return B.set(s,l),l.then(f=>{!f&&B.get(s)===l&&B.delete(s);}),l}function rn(e,n,t,o,i,r){if(typeof FontFace>"u"||document.fonts===void 0)return Promise.resolve("none");let s=t||o?(t??[400,700]).flatMap(l=>(o??["normal","italic"]).map(f=>[l>=600,f==="italic"])):en,a=s.map(()=>"pending"),c$1=false,d=()=>c$1&&a.every(l=>l==="unsupported")?"absent":a.includes("registered")?c$1&&a.every(l=>l==="registered"||l==="unsupported")?"complete":"partial":"none";return new Promise(l=>{let f=false,u=()=>{f||(f=true,clearTimeout(m),l(d()));},m=setTimeout(u,i);(async()=>{let w=await c();if(!w)return;c$1=true;let p=n.find(h=>s.some(([J,v])=>Be(w,h,J,v)))??e;await Promise.all(s.map(async([h,J],v)=>{let de=on(w,e,p,h,J,r);if(!de){a[v]="unsupported";return}Pe.add(e),a[v]=await de?"registered":"failed";}));})().catch(()=>{}).finally(u);})}function se(e,n){return j.has(e)||Pe.has(e)?false:O.has(e)?true:mn(e)?(O.add(e),queueMicrotask(()=>T([e],n)),true):false}function sn(e){let n=`${e.toLowerCase()}|`,t=[],o=[];for(let[i,r]of S)if(i.toLowerCase().startsWith(n)){t.push(r);let s=F.get(i)?.requesters??ne.get(i);s&&o.push(s);}return {promises:t,requesters:o}}function an(e,n,t){W.add(e),g.add(n),T([n],t);}function ln(e,n=[400,700],t=["normal","italic"]){let o=encodeURIComponent(e),i=[];for(let s of t){let a=s==="italic"?1:0;for(let c of n)i.push(`${a},${c}`);}i.sort();let r=i.join(";");return `https://fonts.googleapis.com/css2?family=${o}:ital,wght@${r}&display=swap`}function cn(e,n){return U(e,n,void 0,void 0,null)}async function U(e,n,t,o,i){if(typeof document>"u")return false;let r=e.trim();if(g.has(r))return true;let s=L.get(r);if(s){if(te(V,r,i),!t)return s;let u=o??Date.now()+Re;return s.then(m=>m||!X.has(r)?m:U(e,n,t,u,i))}if(!n&&se(r,new Set([i])))return true;let a$1=sn(r),c=a();if(!D&&!c&&a$1.promises.length===0)return false;let d=ln(r,n?.weights,n?.styles);if(!c&&a$1.promises.length===0&&ke(d))return false;let l=te(V,r,i),f=(async()=>{y=true;try{if(a$1.promises.length>0){if(await Promise.all(a$1.promises),g.has(r))return un([r],l,a$1.requesters),!0;if(!n&&se(r,l))return !0}if(c){let p=await rn(r,t?[r,t.trim()]:[r],n?.weights,n?.styles,o===void 0?Re:Math.max(0,o-Date.now()),l);return p==="absent"?X.add(r):X.delete(r),p==="none"||p==="absent"?!1:(p==="complete"?(re.delete(r),q(r)):re.add(r),T([r],l),!0)}if(!D||ke(d))return !1;let u=document.createElement("link");u.rel="stylesheet",u.href=d;let m=!1;return await new Promise(p=>{let h=setTimeout(()=>p(!1),5e3);u.onload=()=>{clearTimeout(h),p(!0);},u.onerror=()=>{clearTimeout(h),m=!0,p(!1);},document.head.appendChild(u);})?(await le(r,3e3),q(r),T([r],l),!0):(u.onload=null,u.onerror=null,u.remove(),m&&oe.set(d,Date.now()),!1)}catch(u){return b(u,`failed to load "${r}"`,l),false}finally{L.delete(r),V.delete(r),L.size===0&&S.size===0&&(y=false);}})();return L.set(r,f),f}async function fn(e,n){let t=e.filter(o=>!g.has(o.trim()));t.length!==0&&await Promise.all(t.map(o=>cn(o,n)));}function Ae(e){let n=e.trim();return g.has(n)||O.has(n)}function On(e){D=e;}function Un(){return D}function $n(){return y}function qn(){return Array.from(new Set([...g,...O]))}function Kn(e){return Z.add(e),()=>{Z.delete(e);}}function T(e,n=_e){let t=[...Z];for(let o of G(n))t.push(...o.loadCallbacks);for(let o of t)try{o(e);}catch(i){b(i,"load callback threw",n);}}function un(e,n,t){let o=new Set;for(let i of t)for(let r of G(i))o.add(r);for(let i of G(n))if(!o.has(i))for(let r of [...i.loadCallbacks])try{r(e);}catch(s){b(s,"load callback threw",new Set([i]));}}function Hn(e){return ee.add(e),()=>{ee.delete(e);}}async function le(e,n){if("fonts"in document)try{let t=`400 16px "${e}"`;return await Promise.race([document.fonts.load(t),new Promise(o=>setTimeout(o,n))]),document.fonts.check(t)}catch{}return await new Promise(t=>setTimeout(t,100)),true}var R,Ce=new Map,dn="abcdefghijklmnopqrstuvwxyz0123456789";function gn(){return R===void 0&&(R=document.createElement("canvas").getContext("2d"),R&&(R.textBaseline="top")),R}function mn(e,n="sans-serif"){if(typeof document>"u")return false;let t=gn();if(!t)return false;let o=r=>(t.font=r,t.measureText(dn).width),i=r=>{let s=Ce.get(r);return s===void 0&&(s=o(`72px ${r}`),Ce.set(r,s)),o(`72px "${e}", ${r}`)!==s};return i(n)||i(n==="sans-serif"?"serif":"sans-serif")}var pn={"<":"\\3c ",">":"\\3e ","\n":"\\a ","\r":"\\d ","\f":"\\c "},xe=e=>e.replace(/["\\]/g,"\\$&").replace(/[<>\n\r\f]/g,n=>pn[n]);async function Wn(e,n,t){if(typeof document>"u")return false;let o={family:e,data:n,weight:t?.weight,style:t?.style},i=e.trim();return Oe(o,z,De(i,[o]))}var F=new Map,I=new Map,A=new Map,Sn=256,_=new Set,$=new Map;function q(e){g.add(e),_.delete(e),$.delete(e);}function Te(e,n){g.has(n)||_.add(n),g.add(n),e.families.has(n)||(e.families.add(n),A.set(n,(A.get(n)??0)+1));}function K(e){return new Uint8Array(e.data)}function ae(e){let n=2166136261;for(let t=0;t<e.length;t+=1)n=Math.imul(n^e[t],16777619);return `${(n>>>0).toString(16).padStart(8,"0")}${e.length.toString(16)}`}function Me(e,n){if(e.length!==n.length)return false;for(let t=0;t<e.length;t+=1)if(e[t]!==n[t])return false;return true}function Fn(e){let n=String(e??"normal").trim().toLowerCase();if(n==="normal")return "400";if(n==="bold")return "700";let t=Number(n);return n!==""&&Number.isFinite(t)?String(t):n}function Ge(e,n,t){return `${e.trim().toLowerCase()}|${Fn(n)}|${t}`}function yn(e,n){let t=`${e}|${ae(n)}`;for(let o=0;;o+=1){let i=o===0?t:`${t}~${o}`,r=F.get(i);if(!r||Me(r.bytes,n))return i}}function Ie(e,n,t){let o=Ge(e,n.weight,n.style??"normal"),i=K(n);for(let r of I.get(o)??[])if(!Me(r.bytes,i)&&[...r.owners].some(s=>!t.has(s)))return true;return false}function De(e,n,t=Ee){if(!n.some(i=>Ie(e,i,t)))return e;let o=`${e}#${ae(new TextEncoder().encode(n.map(i=>ae(K(i))).join()))}`;for(let i=0;;i+=1){let r=i===0?o:`${o}~${i}`;if(!n.some(s=>Ie(r,s,Ee)))return r}}function Oe(e,n,t){let o=e.family.trim(),i=e.style??"normal",r=Ge(t,e.weight,i),s=yn(r,K(e)),a=t.toLowerCase()===o.toLowerCase();j.add(o);let c=F.get(s);if(c)return c.owners.add(n),c.settled||c.requesters.add(n.scope),a?c.promise.then(u=>(u&&F.get(s)===c&&Te(c,o),u)):c.promise;let d=K(e).slice(),l={key:s,cssSlot:r,cssFamily:t,families:new Set,requesters:new Set([n.scope]),settled:false,bytes:d,owners:new Set([n]),promise:Promise.resolve(false),style:null,url:null};F.set(s,l);let f=I.get(r);return f||(f=new Set,I.set(r,f)),f.add(l),l.promise=(async()=>{y=true;try{return l.url=URL.createObjectURL(new Blob([d],{type:"font/ttf"})),l.style=document.createElement("style"),l.style.textContent=`
2
2
  @font-face {
3
3
  font-family: "${xe(t)}";
4
4
  src: url(${l.url}) format('truetype');
@@ -1,15 +1,15 @@
1
- import { C as CollaborationReplica, b as CollaborationTransport, c as CollaborationProviderOptions, d as CollaborationStatus, e as CollaborationPeer, f as CollaborationCursor, g as CollaborationPeerListener, h as CollaborationStatusListener, i as CollaborationErrorListener, j as YrsSelection, Y as YrsSession } from '../index-yOtBET85.mjs';
2
- export { k as CollaborationAwarenessState, l as CollaborationError, m as CollaborationErrorCode, n as CollaborationPresence, o as CollaborationResolvedUser, p as CollaborationStatusChange, q as CollaborationTextInsertion, r as CollaborationTransportEvent, s as CollaborationUpdateOrigin, t as CollaborationUser } from '../index-yOtBET85.mjs';
1
+ import { C as CollaborationReplica, b as CollaborationTransport, c as CollaborationProviderOptions, d as CollaborationStatus, e as CollaborationPeer, f as CollaborationCursor, g as CollaborationPeerListener, h as CollaborationStatusListener, i as CollaborationErrorListener, j as YrsSelection, Y as YrsSession } from '../index-DzZVJC8-.mjs';
2
+ export { k as CollaborationAwarenessState, l as CollaborationError, m as CollaborationErrorCode, n as CollaborationPresence, o as CollaborationResolvedUser, p as CollaborationStatusChange, q as CollaborationTextInsertion, r as CollaborationTransportEvent, s as CollaborationUpdateOrigin, t as CollaborationUser } from '../index-DzZVJC8-.mjs';
3
3
  import '../formatting-gqLFeJ9X.mjs';
4
4
  import '../types/document.mjs';
5
- import '../content-BzoC6bSz.mjs';
5
+ import '../content-DSb-6a9T.mjs';
6
6
  import '../docx/wrapTypes.mjs';
7
7
  import '../styles-AryxLAhx.mjs';
8
8
  import '../pagedExport-BmSlEhoP.mjs';
9
- import '../frameDelta-ByU7HBuB.mjs';
9
+ import '../frameDelta-CLeO7K5z.mjs';
10
10
  import '../loadWasmAsset-Cr95TImt.mjs';
11
- import '../rezip-Bxiq4Z_R.mjs';
12
11
  import '../plugin-api/index.mjs';
12
+ import '../rezip-Bxiq4Z_R.mjs';
13
13
 
14
14
  declare class CollaborationProvider {
15
15
  private readonly replica;
@@ -0,0 +1 @@
1
+ import {c,j}from'./chunk-ML6E23W2.mjs';import {d}from'./chunk-QBMNRD5V.mjs';import'./chunk-47Q2FMFF.mjs';import'./chunk-CTBUQRYQ.mjs';import'./chunk-UBUTIWXN.mjs';import'./chunk-LT2GCWZ3.mjs';import'./chunk-HPZFJGGM.mjs';import'./chunk-AXFMDV66.mjs';import'./chunk-GKWXOZZH.mjs';import'./chunk-HGKSOBXK.mjs';import'./chunk-TTRUPDAB.mjs';var l=1;function y(e){let s=new ArrayBuffer(e.byteLength);return new Uint8Array(s).set(e),s}async function S(e,s,g){let{createYrsSession:h}=await import('./yrs/index.mjs'),n=await h({clientId:l});try{let t=c(n),r=JSON.parse(t.compareDocx(e,s,JSON.stringify(g)));if(!r.ok)return {ok:!1,diagnostics:r.diagnostics};if(!r.save)return {ok:!0,docx:e.slice(),changes:r.changes,diagnostics:r.diagnostics};let o=r.save,d$1=n.materializeDocx();if(!d$1)throw new Error("the compared session holds no document");let i;try{let a=j(n,d$1,new Map(Object.entries(o.revisionIds))),p=await d(a,y(e),{updateModifiedDate:!1},{changedParaIds:[],sourceParagraphs:{partSha256:o.partSha256,paragraphs:o.paragraphs}},{seed:o.seed,now:o.now});i=new Uint8Array(p.buffer);}catch(a){let p=a instanceof Error?a.message:String(a);return JSON.parse(t.failComparedDocx(p))}let c$1=JSON.parse(t.finishComparedDocx(i));return c$1.ok?{...c$1,docx:i}:c$1}finally{n.destroy();}}export{S as compareDocxInSession};
@@ -1 +1 @@
1
- export{c as buildResidentRegionLayoutRequest,e as computeLayout,d as getLayoutKernelInputs,f as workerLayoutComputation}from'./chunk-NVN26RHH.mjs';import'./chunk-TTRUPDAB.mjs';
1
+ export{c as buildResidentRegionLayoutRequest,e as computeLayout,d as getLayoutKernelInputs,f as workerLayoutComputation}from'./chunk-MLEMGJP7.mjs';import'./chunk-TTRUPDAB.mjs';
@@ -1049,7 +1049,7 @@ interface InlineSdt {
1049
1049
  * level; the renderer must descend into all of them so docProps-bound
1050
1050
  * fields and similar template content survive paged rendering.
1051
1051
  */
1052
- content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation)[];
1052
+ content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation | TrackedRunChange)[];
1053
1053
  }
1054
1054
  /**
1055
1055
  * Block-level SDT (content control wrapping block content).
@@ -1287,7 +1287,7 @@ interface Insertion {
1287
1287
  /** Tracked change metadata */
1288
1288
  info: TrackedChangeInfo;
1289
1289
  /** Inserted content */
1290
- content: (Run | Hyperlink)[];
1290
+ content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation | TrackedRunChange)[];
1291
1291
  }
1292
1292
  /**
1293
1293
  * Deletion wrapper (w:del) — runs deleted by tracked changes
@@ -1297,7 +1297,7 @@ interface Deletion {
1297
1297
  /** Tracked change metadata */
1298
1298
  info: TrackedChangeInfo;
1299
1299
  /** Deleted content */
1300
- content: (Run | Hyperlink)[];
1300
+ content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation | TrackedRunChange)[];
1301
1301
  }
1302
1302
  /**
1303
1303
  * Move-from wrapper (w:moveFrom) — content moved away from this position
@@ -1307,7 +1307,7 @@ interface MoveFrom {
1307
1307
  /** Tracked change metadata */
1308
1308
  info: TrackedChangeInfo;
1309
1309
  /** Moved content */
1310
- content: (Run | Hyperlink)[];
1310
+ content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation | TrackedRunChange)[];
1311
1311
  }
1312
1312
  /**
1313
1313
  * Move-to wrapper (w:moveTo) — content moved into this position
@@ -1317,7 +1317,7 @@ interface MoveTo {
1317
1317
  /** Tracked change metadata */
1318
1318
  info: TrackedChangeInfo;
1319
1319
  /** Moved content */
1320
- content: (Run | Hyperlink)[];
1320
+ content: (Run | Hyperlink | SimpleField | ComplexField | InlineSdt | MathEquation | TrackedRunChange)[];
1321
1321
  }
1322
1322
  /**
1323
1323
  * Move-from range start marker (w:moveFromRangeStart) — ECMA-376 §17.13.5.22
package/dist/core.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  export { a as attemptSelectiveSave, p as parseDocx } from './selectiveSave-r-NMK6aI.mjs';
2
2
  import { Document } from './types/document.mjs';
3
3
  export { DocxPackage } from './types/document.mjs';
4
- import { g as DocumentBody, f as SectionProperties, b4 as Table } from './content-BzoC6bSz.mjs';
5
- export { B as BlockContent, m as BookmarkEnd, n as BookmarkStart, e as Comment, J as CommentRangeEnd, K as CommentRangeStart, T as Deletion, j as Endnote, Y as Field, a1 as FooterReference, i as Footnote, H as HeaderFooter, a4 as HeaderReference, a6 as Hyperlink, a8 as Image, ak as Insertion, ao as ListLevel, ar as MoveFrom, au as MoveTo, h as NumberingDefinitions, P as Paragraph, aG as ParagraphContent, aK as Run, aL as RunContent, aV as Shape, b5 as TableCell, b8 as TableRow, bb as TextBox, bc as TextContent, be as TrackedChangeInfo, bf as TrackedRunChange } from './content-BzoC6bSz.mjs';
4
+ import { g as DocumentBody, f as SectionProperties, b4 as Table } from './content-DSb-6a9T.mjs';
5
+ export { B as BlockContent, m as BookmarkEnd, n as BookmarkStart, e as Comment, J as CommentRangeEnd, K as CommentRangeStart, T as Deletion, j as Endnote, Y as Field, a1 as FooterReference, i as Footnote, H as HeaderFooter, a4 as HeaderReference, a6 as Hyperlink, a8 as Image, ak as Insertion, ao as ListLevel, ar as MoveFrom, au as MoveTo, h as NumberingDefinitions, P as Paragraph, aG as ParagraphContent, aK as Run, aL as RunContent, aV as Shape, b5 as TableCell, b8 as TableRow, bb as TextBox, bc as TextContent, be as TrackedChangeInfo, bf as TrackedRunChange } from './content-DSb-6a9T.mjs';
6
6
  export { c as createDocx, r as repackDocx, u as updateMultipleFiles } from './rezip-Bxiq4Z_R.mjs';
7
7
  import { D as DocxExportFailure, a as DocxExportOptions, b as DocxMarkdownContent, c as DocxStructuredContent, d as DocxPageExportOptions, e as DocxHeadlessLayoutOptions, f as DocxPagedStructuredContent, g as DocxSnapshotLayoutMap, h as DocxMarkdownOptions, i as DocxLayoutMap, j as DocxPageMarkdownOptions, k as DocxContentControlReadFailure, l as DocxContentControlQuery, m as DocxContentControlsOptions, n as DocxContentControlsSnapshot } from './pagedExport-BmSlEhoP.mjs';
8
8
  export { o as DocxAnchor, p as DocxAnchorScope, q as DocxCachedResult, r as DocxCommentMetadata, s as DocxContentControl, t as DocxContentControlDiagnostic, u as DocxContentControlSelector, v as DocxContentControlValue, w as DocxContentControlsResult, x as DocxControlMetadata, y as DocxExportBlock, z as DocxExportCell, A as DocxExportDiagnostic, B as DocxExportDiagnosticCode, C as DocxExportFailureCode, E as DocxExportInline, F as DocxExportPage, G as DocxExportRefusal, H as DocxExportResult, I as DocxExportStory, J as DocxExportTable, K as DocxFormattingMark, L as DocxFragmentGeometry, M as DocxHeadingInfo, N as DocxHeadlessFont, O as DocxInlineRevision, P as DocxLayoutProvenance, Q as DocxListInfo, R as DocxPageDiagnostic, S as DocxPageFragment, T as DocxPageMapContent, U as DocxParagraphData, V as DocxParagraphHeading, W as DocxRevisionView, X as DocxSnapshotLayoutProvenance, Y as DocxStoryKind, Z as DocxStoryOccurrence, _ as DocxStorySelection, $ as DocxUnlocatedReason } from './pagedExport-BmSlEhoP.mjs';
@@ -10,7 +10,7 @@ export { emuToPixels, emuToTwips, formatPx, halfPointsToPixels, pixelsToEmu, pix
10
10
  export { T as ThemeMatrixCell, b as blendColors, c as canRenderFont, a as colorsEqual, d as createRgbColor, e as createThemeColor, f as darkenColor, g as ensureHexPrefix, h as generateThemeTintShadeMatrix, i as getContrastingColor, j as getLoadedFonts, k as getThemeTintShadeHex, l as isBlack, m as isFontLoaded, n as isFontsLoading, o as isGoogleFontsEnabled, p as isWhite, q as lightenColor, r as loadFont, s as loadFontFromBuffer, t as loadFonts, u as onFontsLoaded, v as parseColorString, w as preloadCommonFonts, x as resolveColor, y as resolveHighlightColor, z as resolveHighlightToCss, A as resolveShadingColor, B as setGoogleFontsEnabled } from './fontLoader-BNSs0E8K.mjs';
11
11
  export { D as DocxInput, t as toArrayBuffer } from './docxInput-DTbCa48g.mjs';
12
12
  export { EditorPluginCore, PanelConfig, PluginPanelProps, PointPosition, PositionCoordinates, RenderedDomContext } from './plugin-api/index.mjs';
13
- export { B as BlockExtent, F as FootnoteContent, L as Layout, b as LayoutBlock, P as Page, R as ResolvedLine, c as ResolvedSegment } from './types-Buyw6dFd.mjs';
13
+ export { B as BlockExtent, F as FootnoteContent, L as Layout, b as LayoutBlock, P as Page, R as ResolvedLine, c as ResolvedSegment } from './types-Cz7S77Ut.mjs';
14
14
  export { a as ParagraphFormatting, b as TextFormatting, f as Theme, x as ThemeColorScheme, z as ThemeFont, A as ThemeFontScheme } from './formatting-gqLFeJ9X.mjs';
15
15
  export { d as Relationship, a as Style, S as StyleDefinitions } from './styles-AryxLAhx.mjs';
16
16
  import './docx/wrapTypes.mjs';
package/dist/core.mjs CHANGED
@@ -1 +1 @@
1
- export{h as attemptSelectiveSave,g as createDocx,a as parseDocx,e as repackDocx,c as serializeDocumentBody,b as serializeDocx,d as serializeSectionProperties,f as updateMultipleFiles}from'./chunk-FMOSOX5V.mjs';import'./chunk-C5BX34CG.mjs';export{f as blendColors,r as colorsEqual,o as createRgbColor,n as createThemeColor,d as darkenColor,p as ensureHexPrefix,h as generateThemeTintShadeMatrix,c as getContrastingColor,g as getThemeTintShadeHex,k as isBlack,l as isWhite,e as lightenColor,m as parseColorString,a as resolveColor,i as resolveHighlightColor,q as resolveHighlightToCss,j as resolveShadingColor}from'./chunk-LTVVQMHB.mjs';export{b as emuToPixels,i as emuToTwips,q as formatPx,k as halfPointsToPixels,c as pixelsToEmu,h as pixelsToTwips,d as pointsToPixels,j as twipsToEmu,g as twipsToPixels}from'./chunk-CTBUQRYQ.mjs';export{n as canRenderFont,k as getLoadedFonts,g as isFontLoaded,j as isFontsLoading,i as isGoogleFontsEnabled,e as loadFont,o as loadFontFromBuffer,f as loadFonts,l as onFontsLoaded,w as preloadCommonFonts,h as setGoogleFontsEnabled,a as toArrayBuffer}from'./chunk-7DDF4RHB.mjs';import'./chunk-YLFKV2NT.mjs';import'./chunk-LT2GCWZ3.mjs';import'./chunk-HPZFJGGM.mjs';import'./chunk-2QHGQA3V.mjs';import'./chunk-3CYO46ML.mjs';import'./chunk-6CHGYCFU.mjs';import'./chunk-DLXIZBB6.mjs';import {b as b$1}from'./chunk-TTRUPDAB.mjs';var v="0.4.1";var f=class extends Error{constructor(t){super(t.message);b$1(this,"failure");this.name="DocxExportError",this.failure=t;}};async function g(){let e=await import('./wasm-edit.mjs');return await e.preloadEditWasm(),e}function D(e){let o=JSON.parse(e);if(!o.ok)throw new f(o.failure);return o.content}async function Rt(e,o){let t=await g();return D(t.exportDocxStructuredJson(e,JSON.stringify(o)))}async function It(e,o){let t=await g();return D(t.exportDocxMarkdownJson(e,JSON.stringify(o)))}async function Ft(e,o={}){let t=await g();return D(t.renderDocxMarkdownJson(JSON.stringify(e),JSON.stringify(o)))}function Nt(e,o){let t={};for(let[n,r]of Object.entries(e.package.theme?.colorScheme??{}))typeof r=="string"&&(t[n]=r);return {themeColors:t,defaultTabStopTwips:o?.defaultTabStopTwips??e.package.settings?.defaultTabStop??null,numericIds:{},showHiddenText:o?.showHiddenText??false}}function At(e){let o;try{o=atob(e.data);}catch{throw new TypeError(`font ${JSON.stringify(e.key)} is not base64`)}let t=new Uint8Array(o.length);for(let n=0;n<o.length;n+=1)t[n]=o.charCodeAt(n);return t}async function Lt(e,o,t){await g();let[{createYrsSession:n},{buildResidentRegionLayoutRequest:r}]=await Promise.all([import('./yrs/index.mjs'),import('./computeLayout-4MNWHE2T.mjs')]),i=new Map,a=t.fonts.map((l,p)=>{if(i.has(l.key))throw new TypeError(`font key ${JSON.stringify(l.key)} is repeated`);return i.set(l.key,p),At(l)}),h=l=>l.map(p=>{let x=i.get(p);if(x===void 0)throw new TypeError(`font key ${JSON.stringify(p)} is not a font`);return x}),C=await n({clientId:1});try{let{document:l}=C.openDocx(e,!0),p=r(l,0,Nt(l,t.renderEnvironment)),x=l.package.settings?.compatibilityFlags,E={};p.measurement={fontChains:E,defaults:{fontSize:t.measurementDefaults?.fontSize??11,fontFamily:t.measurementDefaults?.fontFamily??"Calibri"},compat:{noLeading:t.compatibility?.noLeading??x?.noLeading??!1,doNotExpandShiftReturn:t.compatibility?.doNotExpandShiftReturn??x?.doNotExpandShiftReturn??!1},authoritativeShaping:!0};let L=JSON.parse(C.layoutFontRequirementsJson(JSON.stringify(p)));for(let d of L)E[d.key]=h(t.fontChains?.[d.key]??t.fontChains?.[d.family.toLowerCase()]??t.defaultChain);let P=new Uint8Array(a.reduce((d,M)=>d+M.length,0)),k=0;for(let d of a)P.set(d,k),k+=d.length;let T=C.exportSnapshotWithPrivateFonts(P,Uint32Array.from(a,d=>d.length),JSON.stringify(p),o);if(!T.ok)throw new f(T.failure);return T.content}finally{C.destroy();}}async function Mt(e,o={}){let t=await g();return D(t.renderDocxMarkdownWithPagesJson(JSON.stringify(e),JSON.stringify(o)))}async function jt(e,o,t){let{compareDocxInSession:n}=await import('./compareDocx-QX2YF3EF.mjs');return n(e,o,t)}var b=class extends Error{constructor(t){super(t.message);b$1(this,"failure");this.name="DocxContentControlsError",this.failure=t;}};async function O(){let e=await import('./wasm-edit.mjs');return await e.preloadEditWasm(),e}function R(e){let o=JSON.parse(e);if(!o.ok)throw new b(o.failure);return o.content}async function Bt(e,o={}){let t=await O();return R(t.listDocxContentControlsJson(e,JSON.stringify(o)))}async function Jt(e,o,t={}){let n=await O();return R(n.findDocxContentControlsJson(e,JSON.stringify(o),JSON.stringify(t)))}var Ut={includeHeaders:true,includeFooters:true,includePageNumbers:true,pageRange:null,scale:1,printBackground:true,margins:"default"};function Ht(){return {...Ut}}function Wt(){typeof window<"u"&&window.print();}var _t="@media print { body { margin: 0; padding: 0; } @page { margin: 0; } }";function $t(e="Document",o){if(typeof window>"u")return null;let t=window.open("","_blank");if(!t)return null;t.opener=null;let n=t.document;n.title=e;let r=n.createElement("style");r.textContent=_t,n.head.appendChild(r);let i=new DOMParser().parseFromString(o,"text/html");for(let a of Array.from(i.body.childNodes))n.body.appendChild(n.importNode(a,true));return t}function Xt(e,o){if(!e||!e.trim())return null;let t=e.trim();if(/^\d+$/.test(t)){let r=parseInt(t,10);return r>=1&&r<=o?{start:r,end:r}:null}let n=t.match(/^(\d+)-(\d+)$/);if(n){let r=parseInt(n[1],10),i=parseInt(n[2],10);if(r>=1&&i<=o&&r<=i)return {start:r,end:i}}return null}function zt(e,o){return e?e.start===e.end?`Page ${e.start}`:`Pages ${e.start}-${e.end}`:`All (${o} pages)`}function Vt(){return typeof window<"u"&&typeof window.print=="function"}var m=class{constructor(o){b$1(this,"listeners",new Set);b$1(this,"snapshot");b$1(this,"subscribe",o=>(this.listeners.add(o),()=>{this.listeners.delete(o);}));b$1(this,"getSnapshot",()=>this.snapshot);this.snapshot=o;}setSnapshot(o){this.snapshot=o,this.notify();}notify(){for(let o of this.listeners)o();}};var y={TABLE_INDEX:"data-table-index",ROW_INDEX:"data-row",COLUMN_INDEX:"data-col",TABLE_CELL:"data-table-cell"};function I(e,o){if(!(e instanceof Element))return null;let t=e;for(;t&&t!==o;){if(t.tagName==="TD"||t.tagName==="TH"){let n=t.getAttribute(y.ROW_INDEX),r=t.getAttribute(y.COLUMN_INDEX);if(n!==null&&r!==null){let i=t;for(;i&&i!==o;){if(i.tagName==="TABLE"){let a=i.getAttribute(y.TABLE_INDEX);if(a!==null)return {tableIndex:parseInt(a,10),rowIndex:parseInt(n,10),columnIndex:parseInt(r,10)};break}i=i.parentElement;}}break}t=t.parentElement;}return null}function F(e,o){if(!e.package?.document?.content)return null;let t=0;for(let n of e.package.document.content)if(n.type==="table"){if(t===o)return n;t++;}return null}function N(e,o,t){if(!e.package?.document?.content)return e;let n=0,r=e.package.document.content.map(i=>{if(i.type==="table"){if(n===o)return n++,t;n++;}return i});return {...e,package:{...e.package,document:{...e.package.document,content:r}}}}function A(e,o){if(!e.package?.document?.content)return e;let t=0,n=e.package.document.content.filter(r=>{if(r.type==="table"){let i=t===o;return t++,!i}return true});return {...e,package:{...e.package,document:{...e.package.document,content:n}}}}var S=class extends m{constructor(){super({selectedCell:null});}selectCell(o){this.setSnapshot({selectedCell:o});}clearSelection(){this.setSnapshot({selectedCell:null});}isCellSelected(o,t,n){let{selectedCell:r}=this.getSnapshot();return r?r.tableIndex===o&&r.rowIndex===t&&r.columnIndex===n:false}getSelectedCell(){return this.getSnapshot().selectedCell}};var w=class extends m{constructor(){super({notifications:[]});b$1(this,"notifications",[]);b$1(this,"idCounter",0);b$1(this,"timers",new Set);}showError(t,n){return this.addNotification(t,"error",n)}showWarning(t,n){return this.addNotification(t,"warning",n)}showInfo(t,n){return this.addNotification(t,"info",n)}dismiss(t){this.notifications=this.notifications.map(r=>r.id===t?{...r,dismissed:true}:r),this.emitSnapshot();let n=setTimeout(()=>{this.timers.delete(n),this.notifications=this.notifications.filter(r=>r.id!==t),this.emitSnapshot();},300);this.timers.add(n);}clearAll(){this.notifications=[];for(let t of this.timers)clearTimeout(t);this.timers.clear(),this.emitSnapshot();}destroy(){for(let t of this.timers)clearTimeout(t);this.timers.clear(),this.notifications=[];}addNotification(t,n,r){let i=`error-${++this.idCounter}-${Date.now()}`,a={id:i,message:t,severity:n,details:r,timestamp:Date.now()};if(this.notifications=[...this.notifications,a],this.emitSnapshot(),n!=="error"){let h=setTimeout(()=>{this.timers.delete(h),this.dismiss(i);},5e3);this.timers.add(h);}return i}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};var Se=v;export{b as DocxContentControlsError,f as DocxExportError,w as ErrorManager,m as Subscribable,y as TABLE_DATA_ATTRIBUTES,S as TableSelectionManager,Se as VERSION,jt as compareDocx,A as deleteTableFromDocument,It as exportDocxMarkdown,Rt as exportDocxStructured,Lt as exportDocxStructuredWithPages,Jt as findDocxContentControls,I as findTableFromClick,zt as formatPageRange,Ht as getDefaultPrintOptions,F as getTableFromDocument,Vt as isPrintSupported,Bt as listDocxContentControls,$t as openPrintWindow,Xt as parsePageRange,Ft as renderDocxMarkdown,Mt as renderDocxMarkdownWithPages,Wt as triggerPrint,N as updateTableInDocument};
1
+ export{h as attemptSelectiveSave,g as createDocx,a as parseDocx,e as repackDocx,c as serializeDocumentBody,b as serializeDocx,d as serializeSectionProperties,f as updateMultipleFiles}from'./chunk-7ZV6P6NZ.mjs';import'./chunk-QBMNRD5V.mjs';export{f as blendColors,r as colorsEqual,o as createRgbColor,n as createThemeColor,d as darkenColor,p as ensureHexPrefix,h as generateThemeTintShadeMatrix,c as getContrastingColor,g as getThemeTintShadeHex,k as isBlack,l as isWhite,e as lightenColor,m as parseColorString,a as resolveColor,i as resolveHighlightColor,q as resolveHighlightToCss,j as resolveShadingColor}from'./chunk-LTVVQMHB.mjs';export{b as emuToPixels,i as emuToTwips,q as formatPx,k as halfPointsToPixels,c as pixelsToEmu,h as pixelsToTwips,d as pointsToPixels,j as twipsToEmu,g as twipsToPixels}from'./chunk-CTBUQRYQ.mjs';export{n as canRenderFont,k as getLoadedFonts,g as isFontLoaded,j as isFontsLoading,i as isGoogleFontsEnabled,e as loadFont,o as loadFontFromBuffer,f as loadFonts,l as onFontsLoaded,w as preloadCommonFonts,h as setGoogleFontsEnabled,a as toArrayBuffer}from'./chunk-VH7P4734.mjs';import'./chunk-EBYC3CX7.mjs';import'./chunk-UBUTIWXN.mjs';import'./chunk-LT2GCWZ3.mjs';import'./chunk-HPZFJGGM.mjs';import'./chunk-AXFMDV66.mjs';import'./chunk-GKWXOZZH.mjs';import'./chunk-HGKSOBXK.mjs';import'./chunk-DLXIZBB6.mjs';import {b as b$1}from'./chunk-TTRUPDAB.mjs';var v="0.4.2";var f=class extends Error{constructor(t){super(t.message);b$1(this,"failure");this.name="DocxExportError",this.failure=t;}};async function g(){let e=await import('./wasm-edit.mjs');return await e.preloadEditWasm(),e}function D(e){let o=JSON.parse(e);if(!o.ok)throw new f(o.failure);return o.content}async function Rt(e,o){let t=await g();return D(t.exportDocxStructuredJson(e,JSON.stringify(o)))}async function It(e,o){let t=await g();return D(t.exportDocxMarkdownJson(e,JSON.stringify(o)))}async function Ft(e,o={}){let t=await g();return D(t.renderDocxMarkdownJson(JSON.stringify(e),JSON.stringify(o)))}function Nt(e,o){let t={};for(let[n,r]of Object.entries(e.package.theme?.colorScheme??{}))typeof r=="string"&&(t[n]=r);return {themeColors:t,defaultTabStopTwips:o?.defaultTabStopTwips??e.package.settings?.defaultTabStop??null,numericIds:{},showHiddenText:o?.showHiddenText??false}}function At(e){let o;try{o=atob(e.data);}catch{throw new TypeError(`font ${JSON.stringify(e.key)} is not base64`)}let t=new Uint8Array(o.length);for(let n=0;n<o.length;n+=1)t[n]=o.charCodeAt(n);return t}async function Lt(e,o,t){await g();let[{createYrsSession:n},{buildResidentRegionLayoutRequest:r}]=await Promise.all([import('./yrs/index.mjs'),import('./computeLayout-ZTO6TBWX.mjs')]),i=new Map,a=t.fonts.map((l,p)=>{if(i.has(l.key))throw new TypeError(`font key ${JSON.stringify(l.key)} is repeated`);return i.set(l.key,p),At(l)}),h=l=>l.map(p=>{let x=i.get(p);if(x===void 0)throw new TypeError(`font key ${JSON.stringify(p)} is not a font`);return x}),C=await n({clientId:1});try{let{document:l}=C.openDocx(e,!0),p=r(l,0,Nt(l,t.renderEnvironment)),x=l.package.settings?.compatibilityFlags,E={};p.measurement={fontChains:E,defaults:{fontSize:t.measurementDefaults?.fontSize??11,fontFamily:t.measurementDefaults?.fontFamily??"Calibri"},compat:{noLeading:t.compatibility?.noLeading??x?.noLeading??!1,doNotExpandShiftReturn:t.compatibility?.doNotExpandShiftReturn??x?.doNotExpandShiftReturn??!1},authoritativeShaping:!0};let L=JSON.parse(C.layoutFontRequirementsJson(JSON.stringify(p)));for(let d of L)E[d.key]=h(t.fontChains?.[d.key]??t.fontChains?.[d.family.toLowerCase()]??t.defaultChain);let P=new Uint8Array(a.reduce((d,M)=>d+M.length,0)),k=0;for(let d of a)P.set(d,k),k+=d.length;let T=C.exportSnapshotWithPrivateFonts(P,Uint32Array.from(a,d=>d.length),JSON.stringify(p),o);if(!T.ok)throw new f(T.failure);return T.content}finally{C.destroy();}}async function Mt(e,o={}){let t=await g();return D(t.renderDocxMarkdownWithPagesJson(JSON.stringify(e),JSON.stringify(o)))}async function jt(e,o,t){let{compareDocxInSession:n}=await import('./compareDocx-CWOYEBCE.mjs');return n(e,o,t)}var b=class extends Error{constructor(t){super(t.message);b$1(this,"failure");this.name="DocxContentControlsError",this.failure=t;}};async function O(){let e=await import('./wasm-edit.mjs');return await e.preloadEditWasm(),e}function R(e){let o=JSON.parse(e);if(!o.ok)throw new b(o.failure);return o.content}async function Bt(e,o={}){let t=await O();return R(t.listDocxContentControlsJson(e,JSON.stringify(o)))}async function Jt(e,o,t={}){let n=await O();return R(n.findDocxContentControlsJson(e,JSON.stringify(o),JSON.stringify(t)))}var Ut={includeHeaders:true,includeFooters:true,includePageNumbers:true,pageRange:null,scale:1,printBackground:true,margins:"default"};function Ht(){return {...Ut}}function Wt(){typeof window<"u"&&window.print();}var _t="@media print { body { margin: 0; padding: 0; } @page { margin: 0; } }";function $t(e="Document",o){if(typeof window>"u")return null;let t=window.open("","_blank");if(!t)return null;t.opener=null;let n=t.document;n.title=e;let r=n.createElement("style");r.textContent=_t,n.head.appendChild(r);let i=new DOMParser().parseFromString(o,"text/html");for(let a of Array.from(i.body.childNodes))n.body.appendChild(n.importNode(a,true));return t}function Xt(e,o){if(!e||!e.trim())return null;let t=e.trim();if(/^\d+$/.test(t)){let r=parseInt(t,10);return r>=1&&r<=o?{start:r,end:r}:null}let n=t.match(/^(\d+)-(\d+)$/);if(n){let r=parseInt(n[1],10),i=parseInt(n[2],10);if(r>=1&&i<=o&&r<=i)return {start:r,end:i}}return null}function zt(e,o){return e?e.start===e.end?`Page ${e.start}`:`Pages ${e.start}-${e.end}`:`All (${o} pages)`}function Vt(){return typeof window<"u"&&typeof window.print=="function"}var m=class{constructor(o){b$1(this,"listeners",new Set);b$1(this,"snapshot");b$1(this,"subscribe",o=>(this.listeners.add(o),()=>{this.listeners.delete(o);}));b$1(this,"getSnapshot",()=>this.snapshot);this.snapshot=o;}setSnapshot(o){this.snapshot=o,this.notify();}notify(){for(let o of this.listeners)o();}};var y={TABLE_INDEX:"data-table-index",ROW_INDEX:"data-row",COLUMN_INDEX:"data-col",TABLE_CELL:"data-table-cell"};function I(e,o){if(!(e instanceof Element))return null;let t=e;for(;t&&t!==o;){if(t.tagName==="TD"||t.tagName==="TH"){let n=t.getAttribute(y.ROW_INDEX),r=t.getAttribute(y.COLUMN_INDEX);if(n!==null&&r!==null){let i=t;for(;i&&i!==o;){if(i.tagName==="TABLE"){let a=i.getAttribute(y.TABLE_INDEX);if(a!==null)return {tableIndex:parseInt(a,10),rowIndex:parseInt(n,10),columnIndex:parseInt(r,10)};break}i=i.parentElement;}}break}t=t.parentElement;}return null}function F(e,o){if(!e.package?.document?.content)return null;let t=0;for(let n of e.package.document.content)if(n.type==="table"){if(t===o)return n;t++;}return null}function N(e,o,t){if(!e.package?.document?.content)return e;let n=0,r=e.package.document.content.map(i=>{if(i.type==="table"){if(n===o)return n++,t;n++;}return i});return {...e,package:{...e.package,document:{...e.package.document,content:r}}}}function A(e,o){if(!e.package?.document?.content)return e;let t=0,n=e.package.document.content.filter(r=>{if(r.type==="table"){let i=t===o;return t++,!i}return true});return {...e,package:{...e.package,document:{...e.package.document,content:n}}}}var S=class extends m{constructor(){super({selectedCell:null});}selectCell(o){this.setSnapshot({selectedCell:o});}clearSelection(){this.setSnapshot({selectedCell:null});}isCellSelected(o,t,n){let{selectedCell:r}=this.getSnapshot();return r?r.tableIndex===o&&r.rowIndex===t&&r.columnIndex===n:false}getSelectedCell(){return this.getSnapshot().selectedCell}};var w=class extends m{constructor(){super({notifications:[]});b$1(this,"notifications",[]);b$1(this,"idCounter",0);b$1(this,"timers",new Set);}showError(t,n){return this.addNotification(t,"error",n)}showWarning(t,n){return this.addNotification(t,"warning",n)}showInfo(t,n){return this.addNotification(t,"info",n)}dismiss(t){this.notifications=this.notifications.map(r=>r.id===t?{...r,dismissed:true}:r),this.emitSnapshot();let n=setTimeout(()=>{this.timers.delete(n),this.notifications=this.notifications.filter(r=>r.id!==t),this.emitSnapshot();},300);this.timers.add(n);}clearAll(){this.notifications=[];for(let t of this.timers)clearTimeout(t);this.timers.clear(),this.emitSnapshot();}destroy(){for(let t of this.timers)clearTimeout(t);this.timers.clear(),this.notifications=[];}addNotification(t,n,r){let i=`error-${++this.idCounter}-${Date.now()}`,a={id:i,message:t,severity:n,details:r,timestamp:Date.now()};if(this.notifications=[...this.notifications,a],this.emitSnapshot(),n!=="error"){let h=setTimeout(()=>{this.timers.delete(h),this.dismiss(i);},5e3);this.timers.add(h);}return i}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};var Se=v;export{b as DocxContentControlsError,f as DocxExportError,w as ErrorManager,m as Subscribable,y as TABLE_DATA_ATTRIBUTES,S as TableSelectionManager,Se as VERSION,jt as compareDocx,A as deleteTableFromDocument,It as exportDocxMarkdown,Rt as exportDocxStructured,Lt as exportDocxStructuredWithPages,Jt as findDocxContentControls,I as findTableFromClick,zt as formatPageRange,Ht as getDefaultPrintOptions,F as getTableFromDocument,Vt as isPrintSupported,Bt as listDocxContentControls,$t as openPrintWindow,Xt as parsePageRange,Ft as renderDocxMarkdown,Mt as renderDocxMarkdownWithPages,Wt as triggerPrint,N as updateTableInDocument};
@@ -1,5 +1,5 @@
1
- import { I as ImagePrimitive, D as DisplayList } from './frameDelta-ByU7HBuB.mjs';
2
- import { R as RustDisplayListQueryEngine } from './rustDisplayList-DcaA5iok.mjs';
1
+ import { I as ImagePrimitive, D as DisplayList } from './frameDelta-CLeO7K5z.mjs';
2
+ import { R as RustDisplayListQueryEngine } from './rustDisplayList-B7uPoItK.mjs';
3
3
 
4
4
  /**
5
5
  * Locate an image primitive in a built DisplayList by its document position.
@@ -1,7 +1,7 @@
1
1
  export { a as attemptSelectiveSave, p as parseDocx } from '../selectiveSave-r-NMK6aI.mjs';
2
2
  export { c as createDocx, r as repackDocx, u as updateMultipleFiles } from '../rezip-Bxiq4Z_R.mjs';
3
3
  import { WrapType } from './wrapTypes.mjs';
4
- import { B as BlockContent, e as Comment, W as Watermark } from '../content-BzoC6bSz.mjs';
4
+ import { B as BlockContent, e as Comment, W as Watermark } from '../content-DSb-6a9T.mjs';
5
5
  import { Document } from '../types/document.mjs';
6
6
  import '../docxInput-DTbCa48g.mjs';
7
7
  import '../formatting-gqLFeJ9X.mjs';
@@ -1,2 +1,2 @@
1
- export{h as attemptSelectiveSave,g as createDocx,a as parseDocx,e as repackDocx,f as updateMultipleFiles}from'../chunk-FMOSOX5V.mjs';import {a}from'../chunk-C5BX34CG.mjs';import'../chunk-7DDF4RHB.mjs';import'../chunk-YLFKV2NT.mjs';import'../chunk-LT2GCWZ3.mjs';import'../chunk-HPZFJGGM.mjs';import'../chunk-2QHGQA3V.mjs';import'../chunk-3CYO46ML.mjs';import'../chunk-6CHGYCFU.mjs';import'../chunk-DLXIZBB6.mjs';import'../chunk-TTRUPDAB.mjs';function E(e,t,o,r,i,l){let u=e.includes("w")||e.includes("e"),a=e.includes("n")||e.includes("s"),c=e.includes("w")?-1:1,f=e.includes("n")?-1:1,p=u?r+t*c:r,g=a?i+o*f:i;if(u&&a&&l){let d=Math.max(p/r,g/i);p=r*d,g=i*d;}let m=d=>Math.max(20,Math.min(2e3,d));return {width:u?m(p):r,height:a?m(g):i}}function q(e,t,o){let r=()=>t.position?.horizontal&&t.position.vertical?t.position:o?.initialPositionEmu?{horizontal:{relativeTo:"column",posOffset:o.initialPositionEmu.horizontalEmu},vertical:{relativeTo:"paragraph",posOffset:o.initialPositionEmu.verticalEmu}}:{horizontal:{relativeTo:"column",posOffset:0},vertical:{relativeTo:"paragraph",posOffset:0}};switch(e){case "inline":return {wrapType:"inline",displayMode:"inline",cssFloat:"none",wrapText:void 0,position:void 0,distTop:void 0,distBottom:void 0,distLeft:void 0,distRight:void 0};case "squareLeft":case "squareRight":{let i=e==="squareLeft"?"left":"right";return {wrapType:t.wrapType==="tight"||t.wrapType==="through"?t.wrapType:"square",displayMode:"float",cssFloat:i,wrapText:i==="left"?"right":"left",position:r()}}case "square":case "tight":case "through":{let i=t.cssFloat==="left"||t.cssFloat==="right"?t.cssFloat:"left";return {wrapType:e,displayMode:"float",cssFloat:i,wrapText:i==="left"?"right":"left",position:r()}}case "topAndBottom":return {wrapType:"topAndBottom",displayMode:"block",cssFloat:"none",wrapText:"bothSides",position:r()};case "behind":case "inFront":return {wrapType:e,displayMode:"float",cssFloat:"none",wrapText:"bothSides",position:r()}}}function W(e,t){return e==="inline"?"inline":e==="behind"?"behind":e==="inFront"?"inFront":e==="square"||e==="tight"||e==="through"?t==="right"?"squareRight":"squareLeft":null}var _=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function B(e,t){return true}function z(e){switch(e){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function K(e,t){let o=t.filter(u=>u.parentId!=null);if(o.length===0)return false;let r=false,i=new Map;for(let u of o){let a=i.get(u.parentId);a?a.push(u.id):i.set(u.parentId,[u.id]);}function l(u){for(let a of u)if(a.type==="paragraph"){if(!a.content.some(f=>f.type==="commentRangeStart"||f.type==="commentRangeEnd"))continue;let c=[];for(let f of a.content)if(f.type==="commentRangeStart"){c.push(f);let p=i.get(f.id);if(p)for(let g of p)c.push({type:"commentRangeStart",id:g}),r=true;}else if(f.type==="commentRangeEnd"){c.push(f);let p=i.get(f.id);if(p)for(let g of p)c.push({type:"commentRangeEnd",id:g}),r=true;}else c.push(f);a.content=c;}else if(a.type==="table")for(let c of a.rows)for(let f of c.cells)l(f.content);}return l(e),r}function X(e,t){let o=new Set(t.map(a=>a.id)),r=t.filter(a=>a.parentId!=null&&!o.has(a.parentId));if(r.length===0)return false;let i=false,l=new Map;for(let a of r){let c=l.get(a.parentId);c?c.push(a.id):l.set(a.parentId,[a.id]);}function u(a){for(let c of a)if(c.type==="paragraph"){if(!c.content.some(m=>(m.type==="insertion"||m.type==="deletion")&&l.has(m.info.id)))continue;let p=[],g=c.content;for(let m=0;m<g.length;m++){let d=g[m];if((d.type==="insertion"||d.type==="deletion")&&l.has(d.info.id)){let y=l.get(d.info.id);for(let I of y)p.push({type:"commentRangeStart",id:I}),i=true;p.push(d);let h=g[m+1];h&&(h.type==="insertion"||h.type==="deletion")&&h.type!==d.type&&h.info.author===d.info.author&&h.info.date===d.info.date&&(p.push(h),m++);for(let I of y)p.push({type:"commentRangeEnd",id:I});}else p.push(d);}c.content=p;}else if(c.type==="table")for(let f of c.rows)for(let p of f.cells)u(p.content);}return u(e),i}function $(e){let t=e?.package.headers;if(t){for(let o of t.values())if(o.watermark)return o.watermark}}function G(e){let t=e.package.headers;if(!t||t.size===0)return e;let o=false,r=new Map;for(let[i,l]of t)if(l.watermark){let{watermark:u,...a}=l;r.set(i,a),o=true;}else r.set(i,l);return o?{...e,package:{...e.package,headers:r}}:e}function N(e,t){let o=e.package.headers;if(!o||o.size===0)return e;let r=new Map;for(let[i,l]of o)r.set(i,{...l,watermark:{...t}});return {...e,package:{...e.package,headers:r}}}function j(e){let t=e.package.document,o=[];if(t.sections)for(let r of t.sections)r.properties&&o.push(r.properties);return t.finalSectionProperties&&o.push(t.finalSectionProperties),o}function U(e,t){let o=e.package,r=o.document,i=o.headers,l=j(e),u=new Set;if(i)for(let n of i.values())u.add(n.hdrFtrType);let a$1=!i||i.size===0,c=l.some(n=>n.titlePg),f=l.some(n=>n.evenAndOddHeaders),p=a$1,g=c&&!u.has("first"),m=f&&!u.has("even");if(!p&&!g&&!m)return e;let d=o.relationships?new Map(o.relationships):new Map,y=new Map(i??[]),h=new Set;for(let n of d.values())n.target&&h.add(n.target.replace(/^\/?word\//,"").toLowerCase());function I(){let n=1;for(;h.has(`header${n}.xml`);)n++;let s=`header${n}.xml`;return h.add(s.toLowerCase()),s}function F(n){let s=`rIdWmHdr${n[0].toUpperCase()}${n.slice(1)}`,T=1;for(;d.has(s);)s=`rIdWmHdr${n[0].toUpperCase()}${n.slice(1)}${T++}`;return d.set(s,{id:s,type:a.header,target:I()}),y.set(s,{type:"header",hdrFtrType:n,content:[],watermark:{...t}}),s}let L={};function v(n){return L[n]??(L[n]=F(n))}function b(n,s){let T=n?.headerReferences?[...n.headerReferences]:[];return T.some(S=>S.type===s)?n??{}:(T.push({type:s,rId:v(s)}),{...n??{},headerReferences:T})}function k(n){let s=n;return p&&(s=b(s,"default")),g&&s?.titlePg&&(s=b(s,"first")),m&&s?.evenAndOddHeaders&&(s=b(s,"even")),s}let M=k(r.finalSectionProperties),R=r.sections?.map(n=>({...n,properties:k(n.properties)??n.properties}));return {...e,package:{...o,relationships:d,headers:y,document:{...r,finalSectionProperties:M,...R?{sections:R}:{}}}}}function Y(e,t){if(!t)return G(e);let o=N(e,t);return U(o,t)}
2
- export{_ as IMAGE_LAYOUT_OPTIONS,E as calculateResizedImageDimensions,W as deriveLayoutChoice,$ as getDocumentWatermark,K as injectReplyRangeMarkers,X as injectTCReplyRangeMarkers,B as isImageLayoutOptionEnabled,q as resolveImageLayoutAttrs,Y as setDocumentWatermark,z as toolbarValueToLayoutTarget};
1
+ export{h as attemptSelectiveSave,g as createDocx,a as parseDocx,e as repackDocx,f as updateMultipleFiles}from'../chunk-7ZV6P6NZ.mjs';import {a as a$1}from'../chunk-QBMNRD5V.mjs';import'../chunk-VH7P4734.mjs';import'../chunk-EBYC3CX7.mjs';import {a}from'../chunk-UBUTIWXN.mjs';import'../chunk-LT2GCWZ3.mjs';import'../chunk-HPZFJGGM.mjs';import'../chunk-AXFMDV66.mjs';import'../chunk-GKWXOZZH.mjs';import'../chunk-HGKSOBXK.mjs';import'../chunk-DLXIZBB6.mjs';import'../chunk-TTRUPDAB.mjs';function q(e,t,r,i,a,f){let p=e.includes("w")||e.includes("e"),l=e.includes("n")||e.includes("s"),g=e.includes("w")?-1:1,n=e.includes("n")?-1:1,s=p?i+t*g:i,d=l?a+r*n:a;if(p&&l&&f){let m=Math.max(s/i,d/a);s=i*m,d=a*m;}let u=m=>Math.max(20,Math.min(2e3,m));return {width:p?u(s):i,height:l?u(d):a}}function W(e,t,r){let i=()=>t.position?.horizontal&&t.position.vertical?t.position:r?.initialPositionEmu?{horizontal:{relativeTo:"column",posOffset:r.initialPositionEmu.horizontalEmu},vertical:{relativeTo:"paragraph",posOffset:r.initialPositionEmu.verticalEmu}}:{horizontal:{relativeTo:"column",posOffset:0},vertical:{relativeTo:"paragraph",posOffset:0}};switch(e){case "inline":return {wrapType:"inline",displayMode:"inline",cssFloat:"none",wrapText:void 0,position:void 0,distTop:void 0,distBottom:void 0,distLeft:void 0,distRight:void 0};case "squareLeft":case "squareRight":{let a=e==="squareLeft"?"left":"right";return {wrapType:t.wrapType==="tight"||t.wrapType==="through"?t.wrapType:"square",displayMode:"float",cssFloat:a,wrapText:a==="left"?"right":"left",position:i()}}case "square":case "tight":case "through":{let a=t.cssFloat==="left"||t.cssFloat==="right"?t.cssFloat:"left";return {wrapType:e,displayMode:"float",cssFloat:a,wrapText:a==="left"?"right":"left",position:i()}}case "topAndBottom":return {wrapType:"topAndBottom",displayMode:"block",cssFloat:"none",wrapText:"bothSides",position:i()};case "behind":case "inFront":return {wrapType:e,displayMode:"float",cssFloat:"none",wrapText:"bothSides",position:i()}}}function _(e,t){return e==="inline"?"inline":e==="behind"?"behind":e==="inFront"?"inFront":e==="square"||e==="tight"||e==="through"?t==="right"?"squareRight":"squareLeft":null}var B=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function z(e,t){return true}function K(e){switch(e){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(e,t){let r=t.filter(p=>p.parentId!=null);if(r.length===0)return false;let i=false,a=new Map;for(let p of r){let l=a.get(p.parentId);l?l.push(p.id):a.set(p.parentId,[p.id]);}function f(p){for(let l of p)if(l.type==="paragraph"){if(!l.content.some(n=>n.type==="commentRangeStart"||n.type==="commentRangeEnd"))continue;let g=[];for(let n of l.content)if(n.type==="commentRangeStart"){g.push(n);let s=a.get(n.id);if(s)for(let d of s)g.push({type:"commentRangeStart",id:d}),i=true;}else if(n.type==="commentRangeEnd"){g.push(n);let s=a.get(n.id);if(s)for(let d of s)g.push({type:"commentRangeEnd",id:d}),i=true;}else g.push(n);l.content=g;}else if(l.type==="table")for(let g of l.rows)for(let n of g.cells)f(n.content);}return f(e),i}function $(e,t){let r=new Set(t.map(n=>n.id)),i=t.filter(n=>n.parentId!=null&&!r.has(n.parentId));if(i.length===0)return false;let a$1=false,f=new Map;for(let n of i){let s=f.get(n.parentId);s?s.push(n.id):f.set(n.parentId,[n.id]);}let p=[];function l(n){if(n.type==="run")return p;let s=n.type==="insertion"||n.type==="deletion"?f.get(n.info.id)??p:p,d;return a(n,u=>{let m;if(u.type==="insertion"||u.type==="deletion"||u.type==="moveFrom"||u.type==="moveTo"?m=u.info.id:u.type==="inlineSdt"&&(n.type==="insertion"||n.type==="deletion"||n.type==="moveFrom"||n.type==="moveTo")&&(m=n.info.id),m===void 0)return;let y=f.get(m);if(y){d??(d=new Set(s));for(let h of y)d.add(h);}}),d?[...d]:s}function g(n){for(let s of n)if(s.type==="paragraph"){if(!s.content.some(y=>l(y).length>0))continue;let u=[],m=s.content;for(let y=0;y<m.length;y++){let h=m[y],L=l(h);if(L.length>0){for(let T of L)u.push({type:"commentRangeStart",id:T}),a$1=true;u.push(h);let I=m[y+1];I&&(h.type==="insertion"||h.type==="deletion")&&(I.type==="insertion"||I.type==="deletion")&&I.type!==h.type&&I.info.author===h.info.author&&I.info.date===h.info.date&&(u.push(I),y++);for(let T of L)u.push({type:"commentRangeEnd",id:T});}else u.push(h);}s.content=u;}else if(s.type==="table")for(let d of s.rows)for(let u of d.cells)g(u.content);}return g(e),a$1}function G(e){let t=e?.package.headers;if(t){for(let r of t.values())if(r.watermark)return r.watermark}}function N(e){let t=e.package.headers;if(!t||t.size===0)return e;let r=false,i=new Map;for(let[a,f]of t)if(f.watermark){let{watermark:p,...l}=f;i.set(a,l),r=true;}else i.set(a,f);return r?{...e,package:{...e.package,headers:i}}:e}function j(e,t){let r=e.package.headers;if(!r||r.size===0)return e;let i=new Map;for(let[a,f]of r)i.set(a,{...f,watermark:{...t}});return {...e,package:{...e.package,headers:i}}}function U(e){let t=e.package.document,r=[];if(t.sections)for(let i of t.sections)i.properties&&r.push(i.properties);return t.finalSectionProperties&&r.push(t.finalSectionProperties),r}function Y(e,t){let r=e.package,i=r.document,a=r.headers,f=U(e),p=new Set;if(a)for(let o of a.values())p.add(o.hdrFtrType);let l=!a||a.size===0,g=f.some(o=>o.titlePg),n=f.some(o=>o.evenAndOddHeaders),s=l,d=g&&!p.has("first"),u=n&&!p.has("even");if(!s&&!d&&!u)return e;let m=r.relationships?new Map(r.relationships):new Map,y=new Map(a??[]),h=new Set;for(let o of m.values())o.target&&h.add(o.target.replace(/^\/?word\//,"").toLowerCase());function L(){let o=1;for(;h.has(`header${o}.xml`);)o++;let c=`header${o}.xml`;return h.add(c.toLowerCase()),c}function I(o){let c=`rIdWmHdr${o[0].toUpperCase()}${o.slice(1)}`,b=1;for(;m.has(c);)c=`rIdWmHdr${o[0].toUpperCase()}${o.slice(1)}${b++}`;return m.set(c,{id:c,type:a$1.header,target:L()}),y.set(c,{type:"header",hdrFtrType:o,content:[],watermark:{...t}}),c}let T={};function S(o){return T[o]??(T[o]=I(o))}function x(o,c){let b=o?.headerReferences?[...o.headerReferences]:[];return b.some(A=>A.type===c)?o??{}:(b.push({type:c,rId:S(c)}),{...o??{},headerReferences:b})}function k(o){let c=o;return s&&(c=x(c,"default")),d&&c?.titlePg&&(c=x(c,"first")),u&&c?.evenAndOddHeaders&&(c=x(c,"even")),c}let M=k(i.finalSectionProperties),v=i.sections?.map(o=>({...o,properties:k(o.properties)??o.properties}));return {...e,package:{...r,relationships:m,headers:y,document:{...i,finalSectionProperties:M,...v?{sections:v}:{}}}}}function V(e,t){if(!t)return N(e);let r=j(e,t);return Y(r,t)}
2
+ export{B as IMAGE_LAYOUT_OPTIONS,q as calculateResizedImageDimensions,_ as deriveLayoutChoice,G as getDocumentWatermark,X as injectReplyRangeMarkers,$ as injectTCReplyRangeMarkers,z as isImageLayoutOptionEnabled,W as resolveImageLayoutAttrs,V as setDocumentWatermark,K as toolbarValueToLayoutTarget};