@file-viewer/web-full 2.1.4 → 2.1.5

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.
@@ -1,4 +1,4 @@
1
- (function(){var Oo=Object.create,Ge=Object.defineProperty,Bo=Object.getOwnPropertyDescriptor,No=Object.getOwnPropertyNames,Fo=Object.getPrototypeOf,Lo=Object.prototype.hasOwnProperty,vt=(m,C)=>()=>(m&&(C=m(m=0)),C),We=(m,C)=>()=>(C||(m((C={exports:{}}).exports,C),m=null),C.exports),we=(m,C)=>{let d={};for(var f in m)Ge(d,f,{get:m[f],enumerable:!0});return C||Ge(d,Symbol.toStringTag,{value:"Module"}),d},Ho=(m,C,d,f)=>{if(C&&typeof C=="object"||typeof C=="function")for(var g=No(C),y=0,E=g.length,h;y<E;y++)h=g[y],!Lo.call(m,h)&&h!==d&&Ge(m,h,{get:(w=>C[w]).bind(null,h),enumerable:!(f=Bo(C,h))||f.enumerable});return m},ze=(m,C,d)=>(d=m!=null?Oo(Fo(m)):{},Ho(C||!m||!m.__esModule?Ge(d,"default",{value:m,enumerable:!0}):d,m)),dn,pn,un,mr,gn,mn,Uo=vt((()=>{dn="vendor/docx/docx.worker.js",pn="vendor/docx/jszip.min.js",un="http://localhost/",mr=(m,C,d={})=>{const f=m?String(m):C,g=d.documentBaseUrl||un,y=d.baseUrl?d.baseUrl.endsWith("/")?d.baseUrl:`${d.baseUrl}/`:g,E=d.baseUrl?new URL(y,g).href:y,h=new URL(f,E).href;return d.trimTrailingSlash?h.replace(/\/+$/,""):h},gn=(m,C)=>mr(m?.workerUrl,dn,{documentBaseUrl:C}),mn=(m,C)=>mr(m?.workerJsZipUrl,pn,{documentBaseUrl:C})})),An=vt((()=>{Uo()})),Ar,br,Cr,vr,ie,jo,fe=vt((()=>{Ar=["zip","zipx","7z","rar","tar","gz","gzip","tgz","bz2","bzip2","tbz","tbz2","xz","txz","lzma","zst","tzst","cab","ar","cpio","iso","xar","lha","lzh","jar","war","ear","apk","cbz","cbr"],br=["glb","gltf","obj","stl","ply","fbx","dae","3ds","3mf","amf","usd","usda","usdc","usdz","kmz","step","stp","iges","igs","ifc","3dm","brep","pcd","wrl","vrml","xyz","vtk","vtp"],Cr=["txt","json","js","mjs","cjs","css","java","py","html","htm","jsx","ts","tsx","xml","log","vue","yaml","yml","ini","sh","bash","sql","go","rs","php","c","cpp","cc","h","hpp","cs","diff","patch","bundle","bdl","jsonc","json5","ipynb","toml","proto","hcl","tex","gv","http","react","rb","swift","kt"],vr=["gif","jpg","jpeg","bmp","tiff","tif","png","svg","webp","avif","ico","heic","heif","jxl"],ie=[{id:"office-word-openxml",label:"Word OpenXML",category:"office",extensions:["docx","docm","dotx","dotm"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"office-word-binary",label:"Word Binary",category:"office",extensions:["doc","dot"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"office-presentation",label:"PowerPoint",category:"office",extensions:["pptx","pptm","potx","potm","ppsx","ppsm"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"open-document",label:"Open Document",category:"office",extensions:["rtf","odt","odp"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"spreadsheet-openxml",label:"Spreadsheet",category:"office",extensions:["xlsx","xltx","xlsm","xlsb","xls","xlt","xltm","csv","ods","fods","numbers"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:"provider",search:!0}},{id:"pdf",label:"PDF",category:"document",extensions:["pdf"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:"provider"}},{id:"ofd",label:"OFD",category:"document",extensions:["ofd"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"typst",label:"Typst",category:"document",extensions:["typ","typst"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"archive",label:"Archive",category:"archive",extensions:Ar,async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!0}},{id:"email",label:"Email",category:"email",extensions:["eml","msg","mbox"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:!0}},{id:"eda",label:"EDA",category:"eda",extensions:["olb","dra","gds","oas","oasis"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"cad",label:"CAD",category:"cad",extensions:["dxf","dwg","dwf","dwfx","xps"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!1}},{id:"model",label:"3D Model",category:"model",extensions:br,async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:"provider",search:!1}},{id:"geo",label:"Geospatial",category:"geo",extensions:["geojson","kml","gpx","shp"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"drawing",label:"Drawing",category:"drawing",extensions:["excalidraw","drawio","dio","mermaid","mmd","plantuml","puml"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"mindmap",label:"Mind Map",category:"mindmap",extensions:["xmind"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"epub",label:"EPUB",category:"ebook",extensions:["epub"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:"provider"}},{id:"umd",label:"UMD",category:"ebook",extensions:["umd"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"image",label:"Image",category:"image",extensions:vr,async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!1}},{id:"markdown",label:"Markdown",category:"markdown",extensions:["md","markdown"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"code",label:"Code and Text",category:"code",extensions:Cr,async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"video",label:"Video",category:"media",extensions:["mp4","webm","m3u8"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!1}},{id:"audio",label:"Audio",category:"media",extensions:["mp3","mpeg","wav","ogg","oga","opus","m4a","aac","flac","weba","midi","mid"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!1}},{id:"data-asset",label:"Data Asset",category:"asset",extensions:["ttf","otf","woff","woff2","psd","ai","eps","sqlite","wasm","parquet","avro","webarchive"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:!0}}],jo=Object.freeze(Array.from(new Set(ie.flatMap(m=>m.extensions))).sort())})),Go,Wo,zo=vt((()=>{Go=["[data-viewer-anchor-id]",".pdfViewer .page",".docx-wrapper section",".docx p",".docx li",".docx table",".markdown-body h1",".markdown-body h2",".markdown-body h3",".markdown-body h4",".markdown-body h5",".markdown-body h6",".markdown-body p",".markdown-body li",".markdown-body pre",".markdown-body table","article h1","article h2","article h3","article h4","article h5","article h6","article p","article li","article pre","article table","pre code","p","li","tr","h1","h2","h3","h4","h5","h6","pre","table"].join(","),Wo=[".viewer-actions",".viewer-watermark",".state-panel",".pdf-toolbar",".pdf-nav-pane",".flyfish-search-match"].join(",")})),yr,$e,Ve,$o=vt((()=>{yr=new WeakMap,$e=(m,C)=>{yr.set(m,C),m.dataset.viewerZoomProvider=m.dataset.viewerZoomProvider||"custom",m.__flyfishViewerZoomProvider=C},Ve=m=>{m&&(yr.delete(m),delete m.dataset.viewerZoomProvider,delete m.__flyfishViewerZoomProvider)}})),_e=vt((()=>{zo(),$o()})),Vo,bn=vt((()=>{_e(),Vo=["script","style","textarea","input","select","button",".viewer-actions",".viewer-watermark",".state-panel",".pdf-toolbar",".pdf-nav-pane",".flyfish-search-match",".textLayer",".annotationLayer",".xfaLayer","svg","canvas","iframe","video","audio"].join(",")})),Cn=vt((()=>{_e(),bn()})),Xe,Er=vt((()=>{_e(),Xe=()=>{const m=new Set;return{emit(){m.forEach(C=>C())},subscribe(C){return m.add(C),()=>{m.delete(C)}}}}})),vn,Te,Jt,wr,Ye,yn,_r,Tr,Xo=vt((()=>{vn=96,Te=m=>!Number.isFinite(m)||m<=0?0:Number(m.toFixed(3)),Jt=m=>`${Te(m)}px`,wr=m=>`${Number((Te(m)/vn).toFixed(4))}in`,Ye=m=>{const C=Number.parseFloat(m);return Number.isFinite(C)&&C>0?C:0},yn=(m,C={})=>{const d=window.getComputedStyle(m),f=Ye(d.width)||m.offsetWidth||C.width||m.getBoundingClientRect().width,g=Ye(d.height)||Ye(d.minHeight)||m.offsetHeight||C.height||m.getBoundingClientRect().height;return{width:Te(f),height:Te(g)}},_r=(m,C,d={})=>{const f=Jt(C.width),g=Jt(C.height),y=d.heightMode||"fixed";m.classList.add("viewer-print-page"),m.style.setProperty("--viewer-print-page-width",f),m.style.setProperty("--viewer-print-page-height",g),m.style.width=f,m.style.maxWidth="none",m.style.minHeight=g,y==="fixed"?(m.style.height=g,m.style.overflow="hidden"):(m.style.height="auto",m.style.overflow="visible")},Tr=({selector:m,width:C,height:d,heightMode:f="fixed"})=>{const g=Jt(C),y=Jt(d),E=f==="fixed"?`height:${y}!important;min-height:${y}!important;overflow:hidden!important;`:`height:auto!important;min-height:${y}!important;overflow:visible!important;`;return`
1
+ (function(){var Fo=Object.create,Ge=Object.defineProperty,Lo=Object.getOwnPropertyDescriptor,Ho=Object.getOwnPropertyNames,Uo=Object.getPrototypeOf,jo=Object.prototype.hasOwnProperty,vt=(m,C)=>()=>(m&&(C=m(m=0)),C),We=(m,C)=>()=>(C||(m((C={exports:{}}).exports,C),m=null),C.exports),_e=(m,C)=>{let d={};for(var f in m)Ge(d,f,{get:m[f],enumerable:!0});return C||Ge(d,Symbol.toStringTag,{value:"Module"}),d},Go=(m,C,d,f)=>{if(C&&typeof C=="object"||typeof C=="function")for(var g=Ho(C),y=0,E=g.length,h;y<E;y++)h=g[y],!jo.call(m,h)&&h!==d&&Ge(m,h,{get:(w=>C[w]).bind(null,h),enumerable:!(f=Lo(C,h))||f.enumerable});return m},ze=(m,C,d)=>(d=m!=null?Fo(Uo(m)):{},Go(C||!m||!m.__esModule?Ge(d,"default",{value:m,enumerable:!0}):d,m)),dn,pn,un,mr,gn,mn,Wo=vt((()=>{dn="vendor/docx/docx.worker.js",pn="vendor/docx/jszip.min.js",un="http://localhost/",mr=(m,C,d={})=>{const f=m?String(m):C,g=d.documentBaseUrl||un,y=d.baseUrl?d.baseUrl.endsWith("/")?d.baseUrl:`${d.baseUrl}/`:g,E=d.baseUrl?new URL(y,g).href:y,h=new URL(f,E).href;return d.trimTrailingSlash?h.replace(/\/+$/,""):h},gn=(m,C)=>mr(m?.workerUrl,dn,{documentBaseUrl:C}),mn=(m,C)=>mr(m?.workerJsZipUrl,pn,{documentBaseUrl:C})})),An=vt((()=>{Wo()})),Ar,br,Cr,vr,ie,zo,fe=vt((()=>{Ar=["zip","zipx","7z","rar","tar","gz","gzip","tgz","bz2","bzip2","tbz","tbz2","xz","txz","lzma","zst","tzst","cab","ar","cpio","iso","xar","lha","lzh","jar","war","ear","apk","cbz","cbr"],br=["glb","gltf","obj","stl","ply","fbx","dae","3ds","3mf","amf","usd","usda","usdc","usdz","kmz","step","stp","iges","igs","ifc","3dm","brep","pcd","wrl","vrml","xyz","vtk","vtp"],Cr=["txt","json","js","mjs","cjs","css","java","py","html","htm","jsx","ts","tsx","xml","log","vue","yaml","yml","ini","sh","bash","sql","go","rs","php","c","cpp","cc","h","hpp","cs","diff","patch","bundle","bdl","jsonc","json5","ipynb","toml","proto","hcl","tex","gv","http","react","rb","swift","kt"],vr=["gif","jpg","jpeg","bmp","tiff","tif","png","svg","webp","avif","ico","heic","heif","jxl"],ie=[{id:"office-word-openxml",label:"Word OpenXML",category:"office",extensions:["docx","docm","dotx","dotm"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"office-word-binary",label:"Word Binary",category:"office",extensions:["doc","dot"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"office-presentation",label:"PowerPoint",category:"office",extensions:["pptx","pptm","potx","potm","ppsx","ppsm"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"open-document",label:"Open Document",category:"office",extensions:["rtf","odt","odp"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"spreadsheet-openxml",label:"Spreadsheet",category:"office",extensions:["xlsx","xltx","xlsm","xlsb","xls","xlt","xltm","csv","ods","fods","numbers"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:"provider",search:!0}},{id:"pdf",label:"PDF",category:"document",extensions:["pdf"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:"provider"}},{id:"ofd",label:"OFD",category:"document",extensions:["ofd"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"typst",label:"Typst",category:"document",extensions:["typ","typst"],async:!0,capabilities:{download:!0,print:"adapter",exportHtml:"adapter",zoom:"provider",search:!0}},{id:"archive",label:"Archive",category:"archive",extensions:Ar,async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!0}},{id:"email",label:"Email",category:"email",extensions:["eml","msg","mbox"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:!0}},{id:"eda",label:"EDA",category:"eda",extensions:["olb","dra","gds","oas","oasis"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"cad",label:"CAD",category:"cad",extensions:["dxf","dwg","dwf","dwfx","xps"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!1}},{id:"model",label:"3D Model",category:"model",extensions:br,async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:"provider",search:!1}},{id:"geo",label:"Geospatial",category:"geo",extensions:["geojson","kml","gpx","shp"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"drawing",label:"Drawing",category:"drawing",extensions:["excalidraw","drawio","dio","mermaid","mmd","plantuml","puml"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"mindmap",label:"Mind Map",category:"mindmap",extensions:["xmind"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"epub",label:"EPUB",category:"ebook",extensions:["epub"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:"provider"}},{id:"umd",label:"UMD",category:"ebook",extensions:["umd"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!0}},{id:"image",label:"Image",category:"image",extensions:vr,async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:"provider",search:!1}},{id:"markdown",label:"Markdown",category:"markdown",extensions:["md","markdown"],async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"code",label:"Code and Text",category:"code",extensions:Cr,async:!0,capabilities:{download:!0,print:!0,exportHtml:!0,zoom:!1,search:!0}},{id:"video",label:"Video",category:"media",extensions:["mp4","webm","m3u8"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!1}},{id:"audio",label:"Audio",category:"media",extensions:["mp3","mpeg","wav","ogg","oga","opus","m4a","aac","flac","weba","midi","mid"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!1,zoom:!1,search:!1}},{id:"data-asset",label:"Data Asset",category:"asset",extensions:["ttf","otf","woff","woff2","psd","ai","eps","sqlite","wasm","parquet","avro","webarchive"],async:!0,capabilities:{download:!0,print:!1,exportHtml:!0,zoom:!1,search:!0}}],zo=Object.freeze(Array.from(new Set(ie.flatMap(m=>m.extensions))).sort())})),$o,Vo,Xo=vt((()=>{$o=["[data-viewer-anchor-id]",".pdfViewer .page",".docx-wrapper section",".docx p",".docx li",".docx table",".markdown-body h1",".markdown-body h2",".markdown-body h3",".markdown-body h4",".markdown-body h5",".markdown-body h6",".markdown-body p",".markdown-body li",".markdown-body pre",".markdown-body table","article h1","article h2","article h3","article h4","article h5","article h6","article p","article li","article pre","article table","pre code","p","li","tr","h1","h2","h3","h4","h5","h6","pre","table"].join(","),Vo=[".viewer-actions",".viewer-watermark",".state-panel",".pdf-toolbar",".pdf-nav-pane",".flyfish-search-match"].join(",")})),yr,$e,Ve,Yo=vt((()=>{yr=new WeakMap,$e=(m,C)=>{yr.set(m,C),m.dataset.viewerZoomProvider=m.dataset.viewerZoomProvider||"custom",m.__flyfishViewerZoomProvider=C},Ve=m=>{m&&(yr.delete(m),delete m.dataset.viewerZoomProvider,delete m.__flyfishViewerZoomProvider)}})),Te=vt((()=>{Xo(),Yo()})),Ko,bn=vt((()=>{Te(),Ko=["script","style","textarea","input","select","button",".viewer-actions",".viewer-watermark",".state-panel",".pdf-toolbar",".pdf-nav-pane",".flyfish-search-match",".textLayer",".annotationLayer",".xfaLayer","svg","canvas","iframe","video","audio"].join(",")})),Cn=vt((()=>{Te(),bn()})),Xe,Er=vt((()=>{Te(),Xe=()=>{const m=new Set;return{emit(){m.forEach(C=>C())},subscribe(C){return m.add(C),()=>{m.delete(C)}}}}})),vn,xe,Jt,wr,Ye,yn,_r,Tr,Jo=vt((()=>{vn=96,xe=m=>!Number.isFinite(m)||m<=0?0:Number(m.toFixed(3)),Jt=m=>`${xe(m)}px`,wr=m=>`${Number((xe(m)/vn).toFixed(4))}in`,Ye=m=>{const C=Number.parseFloat(m);return Number.isFinite(C)&&C>0?C:0},yn=(m,C={})=>{const d=window.getComputedStyle(m),f=Ye(d.width)||m.offsetWidth||C.width||m.getBoundingClientRect().width,g=Ye(d.height)||Ye(d.minHeight)||m.offsetHeight||C.height||m.getBoundingClientRect().height;return{width:xe(f),height:xe(g)}},_r=(m,C,d={})=>{const f=Jt(C.width),g=Jt(C.height),y=d.heightMode||"fixed";m.classList.add("viewer-print-page"),m.style.setProperty("--viewer-print-page-width",f),m.style.setProperty("--viewer-print-page-height",g),m.style.width=f,m.style.maxWidth="none",m.style.minHeight=g,y==="fixed"?(m.style.height=g,m.style.overflow="hidden"):(m.style.height="auto",m.style.overflow="visible")},Tr=({selector:m,width:C,height:d,heightMode:f="fixed"})=>{const g=Jt(C),y=Jt(d),E=f==="fixed"?`height:${y}!important;min-height:${y}!important;overflow:hidden!important;`:`height:auto!important;min-height:${y}!important;overflow:visible!important;`;return`
2
2
  @page { size: ${wr(C)} ${wr(d)}; margin: 0; }
3
3
  @media print {
4
4
  html, body {
@@ -21,7 +21,7 @@
21
21
  page-break-after: auto;
22
22
  }
23
23
  }
24
- `}})),$t,Ke=vt((()=>{$t=m=>m.trim().replace(/^\./,"").toLowerCase()})),Yo,En,wn,xr,_n,Tn,xn,Sr,Sn,de,be=vt((()=>{Yo="zh-CN",En={"toolbar.zoomGroup":"缩放控制","toolbar.zoomOut":"缩小预览","toolbar.zoomIn":"放大预览","toolbar.zoomReset":"还原比例","toolbar.download":"下载","toolbar.downloadTitle":"下载原始文件","toolbar.print":"打印","toolbar.printTitle":"打印完整渲染内容","toolbar.exportHtml":"HTML","toolbar.exportHtmlTitle":"导出当前渲染后的 HTML","state.ready.title":"预览完成","state.ready.message":"文件内容已完成渲染。","state.empty.title":"暂无文件","state.empty.message":"请选择文件或提供可访问的文件地址后开始预览。","state.unsupported.install.title":"需要装配预览能力","state.unsupported.install.message":"{extension} 格式已在支持矩阵中,但当前项目尚未装配 {rendererLabel} renderer。","state.unsupported.install.description":"推荐安装 {presetPackage},通过 options.preset / options.renderers 注入对应能力{rendererTip};Vite 项目也可以使用 @file-viewer/vite-plugin 自动发现已安装 preset。","state.unsupported.title":"暂不支持在线预览","state.unsupported.message":"不支持{extension}格式的在线预览,请下载后预览或转换为支持的格式。","state.unsupported.description":"支持 Office、PDF、OFD、Typst、压缩包、邮件、OLB/DRA、CAD、地理数据、3D 模型、Excalidraw、draw.io、EPUB、UMD、Markdown、代码/文本、图片、音视频、字体和数据资产的在线预览","state.error.title":"预览失败","preview.downloading":"正在下载文件资源...","preview.streamingPdf":"正在建立 PDF 流式预览...","preview.reading":"正在解析文件内容...","error.download":"下载失败","error.print":"打印失败","error.exportHtml":"导出 HTML 失败","error.noDownloadSource":"当前没有可下载的源文件","error.noExportContent":"当前没有可导出的预览内容","error.printUnavailable":"当前文件类型不支持完整打印,请下载原文件后在本地应用中打印","error.printWindowBlocked":"浏览器拦截了打印窗口","error.remoteDownload":"文件下载失败","error.localRead":"读取文件异常","error.load":"加载文件异常","error.stream":"加载 PDF 流式预览异常","error.beforeOperation":"操作前置校验失败","operation.download":"下载原始文件","operation.print":"打印完整渲染内容","operation.exportHtml":"导出渲染 HTML","operation.zoomIn":"放大预览","operation.zoomOut":"缩小预览","operation.zoomReset":"还原预览比例","pdf.toolbar.toggleNavigation":"切换导航窗格","pdf.toolbar.previousPage":"上一页","pdf.toolbar.nextPage":"下一页","pdf.toolbar.fitWidth":"适合宽度","pdf.toolbar.zoomOut":"缩小","pdf.toolbar.zoomIn":"放大","pdf.toolbar.rotateLeft":"向左旋转","pdf.toolbar.rotateRight":"向右旋转","pdf.nav.typeLabel":"PDF 导航类型","pdf.nav.pagesTab":"页面","pdf.nav.outlineTab":"目录","pdf.nav.pagesTitle":"页面导航","pdf.nav.outlineTitle":"目录导航","pdf.nav.pageCount":"{count} 页","pdf.nav.itemCount":"{count} 项","pdf.nav.pageLabel":"第 {page} 页","pdf.nav.outlineEmpty":"当前 PDF 没有可用目录","pdf.nav.outlineFallbackTitle":"目录 {index}","pdf.thumbnail.alt":"第 {page} 页缩略图","pdf.state.loading":"正在加载 PDF...","pdf.error.browserWindow":"PDF 预览需要浏览器窗口","pdf.error.missingSource":"PDF 缺少可读取的数据源","pdf.error.loadFailed":"PDF 加载失败","pdf.error.notLoaded":"PDF 尚未加载完成,请稍后再试","pdf.error.unloaded":"PDF 已卸载,无法继续打印","pdf.error.canvasUnavailable":"当前浏览器无法创建 PDF 打印画布","pdf.export.pageTitle":"{title} - 第 {page} 页","spreadsheet.loading.kicker":"Excel 表格","spreadsheet.loading.title":"正在解析 Excel 工作簿","spreadsheet.loading.hint":"正在准备工作表、样式和大数据视口,请稍候。","spreadsheet.loading.streaming":"正在平滑补充可视区数据","spreadsheet.tabs.ariaLabel":"工作表列表","spreadsheet.state.parsingWorkbook":"正在解析 Excel 工作簿,请耐心等待...","spreadsheet.state.preparingSheet":"正在准备工作表内容...","spreadsheet.state.preparingSheetNamed":"正在准备「{name}」...","spreadsheet.state.cachedRows":"已缓存 {cached} / {total} 行","spreadsheet.state.rows":"共 {rows} 行,按视口预取平滑加载","spreadsheet.state.rowsAndColumns":"共 {rows} 行,{cols} 列,按视口预取平滑加载","spreadsheet.error.parseFailed":"Excel 解析失败","spreadsheet.error.workerFailed":"Excel Worker 运行失败","archive.error.nestedUnsupported":"不支持 .{type} 格式的在线预览,请下载后预览或转换为支持的格式","archive.loading.readingDirectory":"正在读取压缩包目录...","archive.loading.readingDirectoryHint":"大文件会在 Worker 中解析,避免阻塞主线程。","archive.search.placeholder":"筛选压缩包内文件","archive.preview.title":"压缩包内预览","archive.preview.chooseFile":"请选择一个文件","archive.preview.downloadFile":"下载文件","archive.error.title":"压缩包预览提示","archive.stats.summary":"{count} 个文件 · {size} · {previewable} 个可直接预览","archive.warning.encrypted":"检测到加密内容,当前在线预览不接收密码,建议下载后本地解压。","archive.empty.title":"选择左侧文件即可预览","archive.empty.message":"压缩包只读取目录;文件内容会在点击后按需解压,并在体积允许时缓存到 IndexedDB。","archive.loading.initializingCandidate":"正在初始化 {label}...","archive.loading.initializingCandidateHint":"如果当前服务器没有正确发布 Worker/WASM,会自动切换兼容模式。","archive.error.candidateInitTimeout":"{label} 初始化超时","archive.error.encryptedCheckTimeout":"{label} 加密检测超时","archive.loading.directoryReadyHint":"目录读取完成后,点击内部文件才会按需解压。","archive.error.candidateReadTimeout":"{label} 读取目录超时","archive.loading.workerFallback":"Worker 不可用,正在切换 ZIP/TAR 兼容模式...","archive.loading.workerFallbackHint":"兼容模式无需额外静态 Worker,适合手机 WebView 或本地临时服务器。","archive.notice.workerFallback":"当前环境的 libarchive Worker 未能启动,已自动切换到 ZIP/TAR/GZIP 兼容模式。RAR、7z 等格式仍建议发布 vendor/libarchive/worker-bundle.js 与 libarchive.wasm。","archive.error.tooLarge":"压缩包体积 {size} 超过安全上限 {limit},请下载后在本地解压。","archive.loading.initializingWorker":"正在初始化压缩包解析 Worker...","archive.loading.initializingWorkerHint":"大文件会在 Worker 中解析,避免阻塞主线程。","archive.error.workerInitFailed":"压缩包 Worker 初始化失败","archive.error.entryTooLarge":"压缩包内文件 {name} 体积 {size} 超过预览上限 {limit}。","archive.loading.extracting":"正在按需解压 {name}...","archive.loading.rendering":"正在渲染 {name}...","archive.loading.exporting":"正在导出 {name}...","media.audio.title":"音频预览","media.audio.description":"使用浏览器原生播放器打开,兼容性取决于当前浏览器支持的音频编码。","media.audio.unsupported":"当前浏览器不支持音频播放。","media.video.title":"视频预览","media.video.unsupported":"当前浏览器不支持该视频格式。","media.video.hlsHint":"HLS 会优先使用原始 URL 加载分片;如果传入的是本地单文件清单,请确保分片地址可被浏览器访问。","media.midi.title":"MIDI 文件","media.midi.loading":"正在解析 MIDI 轨道...","media.midi.trackHeader":"轨道","media.midi.instrumentHeader":"乐器","media.midi.channelHeader":"通道","media.midi.noteCountHeader":"音符数","media.midi.durationHeader":"时长","media.midi.durationStat":"时长","media.midi.trackStat":"轨道","media.midi.noteStat":"音符","media.midi.parseFailed":"MIDI 解析失败","email.mbox.subject":"{filename} · 第 1 封","email.mbox.summary":"MBOX 共识别 {count} 封邮件,当前展示第 1 封。","email.error.title":"邮件预览提示","email.meta.from":"发件人","email.meta.to":"收件人","email.meta.cc":"抄送","email.meta.date":"时间","email.tabs.text":"正文","email.tabs.headers":"头信息","email.attachments.title":"附件","email.attachments.empty":"暂无附件","email.attachments.download":"下载附件","email.attachments.opening":"正在打开附件 {name}...","email.attachments.nestedUnavailable":"当前运行环境未提供附件嵌套预览入口,请下载 {name} 后查看。","email.loading.parsing":"正在解析邮件...","data.font.sample":"Flyfish Viewer 轻量预览 AaBbCc 1234567890","data.error.fontFaceUnsupported":"当前浏览器不支持 FontFace API","data.title.font":"字体文件预览","data.title.sqlite":"SQLite 数据库预览","data.title.parquet":"Parquet 列式数据预览","data.title.avro":"Avro 对象容器预览","data.title.wasm":"WebAssembly 模块预览","data.title.eps":"EPS 矢量文件摘要","data.title.ai":"Illustrator 文件摘要","data.title.webarchive":"WebArchive 摘要预览","data.title.summary":"数据资产摘要","data.label.format":"格式","data.label.size":"大小","data.label.rendering":"渲染方式","data.label.objects":"对象数","data.label.sampleTable":"示例表","data.label.rows":"行数","data.label.columns":"列数","data.label.sampleRows":"示例行","data.label.imports":"导入","data.label.exports":"导出","data.label.magic":"Magic","data.label.note":"说明","data.label.container":"容器","data.value.schemaRead":"已读取","data.value.schemaUnread":"未读取","data.note.aiSummary":"非 PDF-compatible AI 按摘要展示","data.note.postscriptSummary":"PostScript 摘要展示","data.note.webarchive":"安全提取可读片段,不执行网页脚本","data.image.alt":"资产预览","psd.title":"PSD 图层预览","psd.action.fit":"适合","psd.action.showAll":"全显","psd.action.hideAll":"全隐","psd.layers.title":"图层","psd.layers.redrawable":"{count} 可重绘","psd.layers.empty":"未发现可展示图层,使用合成图预览。","psd.layers.hidden":"隐藏","drawing.error.viewerLoadFailed":"diagrams.net viewer 加载失败","drawing.error.excalidrawEmpty":"Excalidraw 文件中没有可预览图元","drawing.error.excalidrawTimeout":"Excalidraw 官方导出超时,自动切换 rough.js 兼容渲染","drawing.error.drawioParseFailed":"Draw.io XML 解析失败:{message}","drawing.error.drawioNoModel":"当前 Draw.io 文件没有可直接渲染的 mxGraphModel。","drawing.error.drawioNoElements":"当前 Draw.io 文件没有可预览图元。","drawing.error.viewerInitFailed":"diagrams.net viewer 未正确初始化","drawing.error.drawioTimeout":"diagrams.net 官方 Viewer 加载超时,自动切换本地 SVG 预览","drawing.error.svgParseFailed":"SVG 解析失败","drawing.error.plantumlRenderFailed":"PlantUML SVG 渲染失败:{status}","drawing.title.excalidraw":"Excalidraw 官方 SVG 预览","drawing.title.mermaid":"Mermaid SVG 预览","drawing.title.plantuml":"PlantUML SVG 预览","drawing.title.drawio":"Draw.io 离线 SVG 预览","drawing.toolbar.zoomOut":"缩小","drawing.toolbar.zoomIn":"放大","drawing.toolbar.fit":"适合","drawing.toolbar.fitWidth":"适合宽度","drawing.state.loading":"正在加载绘图预览...","text.code.loadingHighlight":"正在加载高亮...","ebook.toc":"目录","ebook.reading":"阅读中","ebook.itemCount":"{count} 项","epub.title":"EPUB 电子书","epub.previousPage":"上一页","epub.nextPage":"下一页","epub.loading":"正在解析 EPUB...","epub.chapterFallback":"章节 {index}","epub.renderIncomplete":"EPUB 正文渲染未完成,请刷新后重试","umd.title":"UMD 电子书","umd.previousChapter":"上一章","umd.nextChapter":"下一章","umd.loading":"正在解析 UMD...","umd.emptyContent":"未解析到正文内容","umd.chapterFallback":"章节 {index}","umd.galleryFallback":"图集 {index}","umd.warningBodyTooShort":"UMD 正文长度小于声明长度,文件可能不完整","umd.error.unexpectedEnd":"UMD 文件结构不完整,读取时遇到意外结尾","umd.error.invalidFile":"不是有效的 UMD 电子书文件","typst.summaryRenderer":"Typst WASM 渲染器","typst.pageSummary.empty":"0 页","typst.pageSummary.ready":"{count} 页 / {width} x {height} pt","typst.status.compiling":"正在编译","typst.status.failed":"编译失败","typst.status.rendered":"已渲染","typst.loading.title":"正在解析 Typst","typst.loading.hint":"加载编译器并生成页面预览...","typst.error.title":"Typst 渲染失败","typst.error.timeout":"Typst WASM / 字体加载或编译超过 {seconds} 秒","typst.error.timeoutHint":"请检查 Typst compiler WASM、renderer WASM、字体目录的下载速度和缓存策略;弱网或跨境部署可通过 options.typst.renderTimeoutMs 调大浏览器端加载/编译超时。","typst.error.assetHint":"Typst 需要本地 compiler / renderer WASM 和字体目录。请运行 file-viewer-copy-assets,或配置 options.typst.compilerWasmUrl / options.typst.rendererWasmUrl / options.typst.fontAssetsUrl,并确认服务器以 application/wasm 返回 WASM。","typst.error.svgParseFailed":"Typst SVG 解析失败","typst.error.wasmLoadFailed":"Typst WASM 加载失败","xmind.toolbar.zoomOut":"缩小","xmind.toolbar.zoomIn":"放大","xmind.toolbar.fit":"适合","xmind.toolbar.fitTitle":"适配画布","xmind.state.loading":"正在解析 XMind 脑图...","xmind.stats.nodes":"节点","xmind.stats.depth":"层级","xmind.stats.theme":"主题","xmind.stats.template":"模板","xmind.badge.paused":"暂停","xmind.badge.collapsed":"折叠","xmind.badge.floating":"浮动","xmind.badge.summary":"概要","xmind.badge.callout":"标注","xmind.imageResource":"图片资源: {name}","xmind.error.unrecognized":"无法识别 XMind 文件: ZIP 中未找到 content.json 或 content.xml","xmind.error.noCanvas":"XMind 文件中没有可预览的画布","cad.toolbar.fit":"适配","cad.toolbar.zoomOut":"缩小","cad.toolbar.zoomIn":"放大","cad.layers.title":"图层","cad.layers.count":"{count} 项","cad.inspector.title":"结构","cad.inspector.entities":"实体","cad.inspector.blocks":"块","cad.inspector.pages":"页面","cad.inspector.drawn":"绘制","cad.state.loadingViewer":"正在加载 CAD 预览器...","cad.state.parsing":"正在解析 CAD...","cad.error.parseFailed":"CAD 文件解析失败","image.alt":"图片","image.lightbox.alt":"图片预览","image.lightbox.close":"关闭图片预览","gitBundle.error.invalid":"当前文件不是标准 Git bundle。","gitBundle.error.missingPack":"Git bundle header 后未找到 PACK 数据。","gitBundle.notice.delta":"当前 bundle 包含 delta 压缩对象。预览器已在浏览器端解析常规 OFS_DELTA / REF_DELTA;若仍有缺失文件,通常是包体过大、对象过多或依赖外部 prerequisite。","gitBundle.title.history":"历史记录","gitBundle.title.fileTree":"文件树","gitBundle.file.choose":"选择文件查看内容","gitBundle.file.noTree":"当前 bundle 的 tree/blob 可能被 delta 压缩,暂未解析到可展开文件。","gitBundle.file.none":"未解析到文件","gitBundle.history.empty":"当前 bundle 未解析到 commit 对象,仅展示 refs 和 pack 摘要。","gitBundle.toolbar.summary":"{commits} commits · {files} files","gitBundle.meta.bundle":"Bundle","gitBundle.meta.refs":"Refs","gitBundle.meta.commits":"Commits","gitBundle.meta.objects":"Objects","gitBundle.meta.deltas":"Deltas","gitBundle.meta.objectFormat":"Object format","gitBundle.meta.objectTypes":"Object types","geo.error.unrecognized":"无法识别的 GeoJSON 数据","geo.error.xmlParseFailed":"XML 解析失败","geo.error.unsupported":"不支持 .{type} 地理格式","geo.title":"地理数据预览","geo.featureCount":"要素数","geo.bounds":"范围","geo.geometryTypes":"几何类型","geo.aria":"地理数据 SVG 预览","geo.loading":"正在解析地理数据...","model.toolbar.fit":"适配","model.toolbar.rotate":"旋转","model.toolbar.wireframe":"线框","model.toolbar.grid":"网格","model.toolbar.axes":"坐标","model.state.loadingSummary":"正在加载模型","model.state.loading":"正在解析 3D 模型...","model.state.loaded":"模型已加载","model.state.parseFailed":"模型解析失败","model.summary.meshes":"{count} 个网格","model.summary.points":"{count} 个点云","model.error.daeEmpty":"DAE 模型未解析出有效场景","model.error.unsupported":"暂不支持 .{type} 模型格式","model.error.parseFailed":"{type} 模型解析失败","model.notice.signature":"检测到文件签名: {signature}。","loading.generic.label":"文件内容","loading.generic.hint":"正在整理内容结构并生成预览。","loading.word.label":"Word 文档","loading.word.hint":"正在准备分页、文本样式和文档结构。","loading.wordWorker.hint":"正在通过 Worker 准备文档结构、文本样式和分页结果。","loading.sheet.label":"Excel 表格","loading.sheet.hint":"正在准备工作表、样式和可视区数据。","loading.csv.label":"表格数据","loading.csv.hint":"正在准备行列数据和基础样式。","loading.presentation.label":"PPT 演示文稿","loading.presentation.hint":"正在构建幻灯片布局和媒体内容。","loading.pdf.label":"PDF 文档","loading.pdf.hint":"正在载入页面位图、文本层和缩放视图。","loading.ofd.label":"OFD 版式文件","loading.ofd.hint":"正在解析国产版式文档和页面对象。","loading.archive.label":"压缩包","loading.archive.hint":"正在启动 Worker 并读取压缩包目录。","loading.email.label":"邮件文件","loading.email.hint":"正在解析邮件头、正文和附件。","loading.msg.hint":"正在解析 Outlook 邮件和附件。","loading.eda.label":"EDA 文件","loading.eda.hint":"正在读取 EDA 容器结构和可读属性。","loading.cad.label":"CAD 图纸","loading.cad.hint":"正在准备 CAD 图层、几何对象和画布视图。","loading.dwg.hint":"正在通过 Worker 加载 DWG 几何和 LibreDWG WASM。","loading.dwf.hint":"正在加载 DWF native renderer 与 W2D/W3D 图形。","loading.dwfx.hint":"正在加载 DWFx/XPS native renderer 与页面图形。","loading.xps.hint":"正在加载 XPS native renderer 与嵌入字体。","loading.drawio.label":"draw.io 图纸","loading.drawio.hint":"正在解析图元、连线和 SVG 预览。","loading.excalidraw.label":"Excalidraw 图纸","loading.excalidraw.hint":"正在解析手绘图元并生成安全 SVG。","loading.epub.label":"EPUB 电子书","loading.epub.hint":"正在解析目录、章节资源和阅读分页。","loading.umd.label":"UMD 电子书","loading.umd.hint":"正在解析移动电子书结构、目录和压缩正文。","loading.image.label":"图片文件","loading.image.hint":"正在解码像素数据并生成预览。","loading.video.label":"视频文件","loading.video.hint":"正在准备媒体资源和播放组件。","loading.audio.label":"音频文件","loading.audio.hint":"正在准备音频资源和播放控件。"},wn={"toolbar.zoomGroup":"Zoom controls","toolbar.zoomOut":"Zoom out","toolbar.zoomIn":"Zoom in","toolbar.zoomReset":"Reset zoom","toolbar.download":"Download","toolbar.downloadTitle":"Download the original file","toolbar.print":"Print","toolbar.printTitle":"Print the complete rendered document","toolbar.exportHtml":"HTML","toolbar.exportHtmlTitle":"Export the rendered HTML","state.ready.title":"Preview ready","state.ready.message":"The file has been rendered.","state.empty.title":"No file selected","state.empty.message":"Choose a file or provide an accessible URL to start previewing.","state.unsupported.install.title":"Preview capability required","state.unsupported.install.message":"{extension} is in the supported matrix, but {rendererLabel} renderer is not assembled in this project.","state.unsupported.install.description":"Install {presetPackage} and pass the capability through options.preset / options.renderers{rendererTip}. Vite projects can also use @file-viewer/vite-plugin to auto-discover installed presets.","state.unsupported.title":"Online preview is not supported yet","state.unsupported.message":"{extension} cannot be previewed online. Download it or convert it to a supported format.","state.unsupported.description":"Supports online preview for Office, PDF, OFD, Typst, archives, email, OLB/DRA, CAD, geospatial data, 3D models, Excalidraw, draw.io, EPUB, UMD, Markdown, code/text, images, audio/video, fonts, and structured data assets.","state.error.title":"Preview failed","preview.downloading":"Downloading file resources...","preview.streamingPdf":"Preparing streaming PDF preview...","preview.reading":"Parsing file content...","error.download":"Download failed","error.print":"Print failed","error.exportHtml":"HTML export failed","error.noDownloadSource":"There is no original file source to download.","error.noExportContent":"There is no rendered preview content to export.","error.printUnavailable":"This file type does not support full-document printing. Download the original file and print it locally.","error.printWindowBlocked":"The browser blocked the print window.","error.remoteDownload":"File download failed","error.localRead":"Failed to read local file","error.load":"Failed to load file","error.stream":"Failed to load streaming PDF preview","error.beforeOperation":"Before-operation check failed","operation.download":"Download original file","operation.print":"Print complete rendered content","operation.exportHtml":"Export rendered HTML","operation.zoomIn":"Zoom in","operation.zoomOut":"Zoom out","operation.zoomReset":"Reset preview zoom","pdf.toolbar.toggleNavigation":"Toggle navigation pane","pdf.toolbar.previousPage":"Previous page","pdf.toolbar.nextPage":"Next page","pdf.toolbar.fitWidth":"Fit to width","pdf.toolbar.zoomOut":"Zoom out","pdf.toolbar.zoomIn":"Zoom in","pdf.toolbar.rotateLeft":"Rotate left","pdf.toolbar.rotateRight":"Rotate right","pdf.nav.typeLabel":"PDF navigation type","pdf.nav.pagesTab":"Pages","pdf.nav.outlineTab":"Outline","pdf.nav.pagesTitle":"Page navigation","pdf.nav.outlineTitle":"Outline navigation","pdf.nav.pageCount":"{count} pages","pdf.nav.itemCount":"{count} items","pdf.nav.pageLabel":"Page {page}","pdf.nav.outlineEmpty":"This PDF has no available outline.","pdf.nav.outlineFallbackTitle":"Outline {index}","pdf.thumbnail.alt":"Page {page} thumbnail","pdf.state.loading":"Loading PDF...","pdf.error.browserWindow":"PDF preview requires a browser window","pdf.error.missingSource":"PDF has no readable data source","pdf.error.loadFailed":"Failed to load PDF","pdf.error.notLoaded":"The PDF is not loaded yet. Please try again later.","pdf.error.unloaded":"The PDF has been unloaded and cannot continue printing.","pdf.error.canvasUnavailable":"This browser cannot create a PDF print canvas.","pdf.export.pageTitle":"{title} - Page {page}","spreadsheet.loading.kicker":"Excel workbook","spreadsheet.loading.title":"Parsing Excel workbook","spreadsheet.loading.hint":"Preparing worksheets, styles, and virtualized viewport data.","spreadsheet.loading.streaming":"Loading visible worksheet data","spreadsheet.tabs.ariaLabel":"Worksheet list","spreadsheet.state.parsingWorkbook":"Parsing the Excel workbook. Please wait...","spreadsheet.state.preparingSheet":"Preparing worksheet content...","spreadsheet.state.preparingSheetNamed":"Preparing “{name}”...","spreadsheet.state.cachedRows":"Cached {cached} / {total} rows","spreadsheet.state.rows":"{rows} rows, loading smoothly by viewport","spreadsheet.state.rowsAndColumns":"{rows} rows, {cols} columns, loading smoothly by viewport","spreadsheet.error.parseFailed":"Failed to parse Excel","spreadsheet.error.workerFailed":"Excel Worker failed","archive.error.nestedUnsupported":".{type} cannot be previewed online. Download it or convert it to a supported format.","archive.loading.readingDirectory":"Reading archive directory...","archive.loading.readingDirectoryHint":"Large files are parsed in a Worker to keep the main thread responsive.","archive.search.placeholder":"Filter files inside the archive","archive.preview.title":"Archive entry preview","archive.preview.chooseFile":"Choose a file","archive.preview.downloadFile":"Download file","archive.error.title":"Archive preview notice","archive.stats.summary":"{count} files · {size} · {previewable} directly previewable","archive.warning.encrypted":"Encrypted content was detected. Online preview does not accept passwords; download and extract it locally.","archive.empty.title":"Choose a file from the left to preview","archive.empty.message":"The archive directory is read first. File contents are extracted on demand and cached in IndexedDB when size allows.","archive.loading.initializingCandidate":"Initializing {label}...","archive.loading.initializingCandidateHint":"If the server does not publish Worker/WASM assets correctly, the viewer falls back automatically.","archive.error.candidateInitTimeout":"{label} initialization timed out","archive.error.encryptedCheckTimeout":"{label} encryption check timed out","archive.loading.directoryReadyHint":"After the directory is ready, click an entry to extract it on demand.","archive.error.candidateReadTimeout":"{label} directory read timed out","archive.loading.workerFallback":"Worker unavailable. Switching to ZIP/TAR compatibility mode...","archive.loading.workerFallbackHint":"Compatibility mode needs no static Worker and works well in mobile WebViews or temporary local servers.","archive.notice.workerFallback":"The libarchive Worker could not start in this environment, so ZIP/TAR/GZIP compatibility mode is active. RAR, 7z, and similar formats should still publish vendor/libarchive/worker-bundle.js and libarchive.wasm.","archive.error.tooLarge":"Archive size {size} exceeds the safety limit {limit}. Download and extract it locally.","archive.loading.initializingWorker":"Initializing archive parsing Worker...","archive.loading.initializingWorkerHint":"Large files are parsed in a Worker to keep the main thread responsive.","archive.error.workerInitFailed":"Archive Worker initialization failed","archive.error.entryTooLarge":"Entry {name} is {size}, exceeding the preview limit {limit}.","archive.loading.extracting":"Extracting {name} on demand...","archive.loading.rendering":"Rendering {name}...","archive.loading.exporting":"Exporting {name}...","media.audio.title":"Audio preview","media.audio.description":"Opened with the browser-native audio player. Codec support depends on the current browser.","media.audio.unsupported":"This browser does not support audio playback.","media.video.title":"Video preview","media.video.unsupported":"This browser does not support this video format.","media.video.hlsHint":"HLS prefers the original URL for segment loading. If the input is a local single-file playlist, make sure segment URLs are reachable by the browser.","media.midi.title":"MIDI file","media.midi.loading":"Parsing MIDI tracks...","media.midi.trackHeader":"Track","media.midi.instrumentHeader":"Instrument","media.midi.channelHeader":"Channel","media.midi.noteCountHeader":"Notes","media.midi.durationHeader":"Duration","media.midi.durationStat":"Duration","media.midi.trackStat":"Tracks","media.midi.noteStat":"Notes","media.midi.parseFailed":"Failed to parse MIDI","email.mbox.subject":"{filename} · message 1","email.mbox.summary":"Detected {count} messages in the MBOX archive. Showing message 1.","email.error.title":"Email preview notice","email.meta.from":"From","email.meta.to":"To","email.meta.cc":"Cc","email.meta.date":"Date","email.tabs.text":"Body","email.tabs.headers":"Headers","email.attachments.title":"Attachments","email.attachments.empty":"No attachments","email.attachments.download":"Download attachment","email.attachments.opening":"Opening attachment {name}...","email.attachments.nestedUnavailable":"Nested attachment preview is not available in this environment. Download {name} to inspect it.","email.loading.parsing":"Parsing email...","data.font.sample":"Flyfish Viewer preview AaBbCc 1234567890","data.error.fontFaceUnsupported":"This browser does not support the FontFace API","data.title.font":"Font file preview","data.title.sqlite":"SQLite database preview","data.title.parquet":"Parquet columnar data preview","data.title.avro":"Avro object container preview","data.title.wasm":"WebAssembly module preview","data.title.eps":"EPS vector file summary","data.title.ai":"Illustrator file summary","data.title.webarchive":"WebArchive summary preview","data.title.summary":"Data asset summary","data.label.format":"Format","data.label.size":"Size","data.label.rendering":"Renderer","data.label.objects":"Objects","data.label.sampleTable":"Sample table","data.label.rows":"Rows","data.label.columns":"Columns","data.label.sampleRows":"Sample rows","data.label.imports":"Imports","data.label.exports":"Exports","data.label.magic":"Magic","data.label.note":"Note","data.label.container":"Container","data.value.schemaRead":"Read","data.value.schemaUnread":"Not read","data.note.aiSummary":"Non PDF-compatible AI is shown as a safe summary.","data.note.postscriptSummary":"PostScript summary preview","data.note.webarchive":"Readable fragments are extracted safely. Web scripts are not executed.","data.image.alt":"Asset preview","psd.title":"PSD layer preview","psd.action.fit":"Fit","psd.action.showAll":"Show all","psd.action.hideAll":"Hide all","psd.layers.title":"Layers","psd.layers.redrawable":"{count} redrawable","psd.layers.empty":"No displayable layers were found. Showing the composite image.","psd.layers.hidden":"hidden","drawing.error.viewerLoadFailed":"Failed to load the diagrams.net viewer","drawing.error.excalidrawEmpty":"This Excalidraw file has no previewable elements","drawing.error.excalidrawTimeout":"Official Excalidraw export timed out. Falling back to the rough.js renderer.","drawing.error.drawioParseFailed":"Failed to parse Draw.io XML: {message}","drawing.error.drawioNoModel":"This Draw.io file has no directly renderable mxGraphModel.","drawing.error.drawioNoElements":"This Draw.io file has no previewable elements.","drawing.error.viewerInitFailed":"The diagrams.net viewer was not initialized correctly","drawing.error.drawioTimeout":"Official diagrams.net Viewer timed out. Falling back to the local SVG preview.","drawing.error.svgParseFailed":"Failed to parse SVG","drawing.error.plantumlRenderFailed":"Failed to render PlantUML SVG: {status}","drawing.title.excalidraw":"Official Excalidraw SVG preview","drawing.title.mermaid":"Mermaid SVG preview","drawing.title.plantuml":"PlantUML SVG preview","drawing.title.drawio":"Draw.io offline SVG preview","drawing.toolbar.zoomOut":"Zoom out","drawing.toolbar.zoomIn":"Zoom in","drawing.toolbar.fit":"Fit","drawing.toolbar.fitWidth":"Fit width","drawing.state.loading":"Loading drawing preview...","text.code.loadingHighlight":"Loading syntax highlighting...","ebook.toc":"Table of contents","ebook.reading":"Reading","ebook.itemCount":"{count} items","epub.title":"EPUB ebook","epub.previousPage":"Previous","epub.nextPage":"Next","epub.loading":"Parsing EPUB...","epub.chapterFallback":"Chapter {index}","epub.renderIncomplete":"EPUB content did not finish rendering. Refresh and try again.","umd.title":"UMD ebook","umd.previousChapter":"Previous chapter","umd.nextChapter":"Next chapter","umd.loading":"Parsing UMD...","umd.emptyContent":"No readable body content was parsed.","umd.chapterFallback":"Chapter {index}","umd.galleryFallback":"Gallery {index}","umd.warningBodyTooShort":"The UMD body is shorter than declared and may be incomplete.","umd.error.unexpectedEnd":"The UMD structure is incomplete and ended unexpectedly.","umd.error.invalidFile":"This is not a valid UMD ebook file.","typst.summaryRenderer":"Typst WASM renderer","typst.pageSummary.empty":"0 pages","typst.pageSummary.ready":"{count} pages / {width} x {height} pt","typst.status.compiling":"Compiling","typst.status.failed":"Compilation failed","typst.status.rendered":"Rendered","typst.loading.title":"Parsing Typst","typst.loading.hint":"Loading the compiler and generating page previews...","typst.error.title":"Typst render failed","typst.error.timeout":"Typst WASM / font loading or compilation exceeded {seconds} seconds","typst.error.timeoutHint":"Check the download speed and cache strategy for the Typst compiler WASM, renderer WASM, and font directory. On weak networks or cross-region deployments, increase options.typst.renderTimeoutMs.","typst.error.assetHint":"Typst requires local compiler / renderer WASM files and a font directory. Run file-viewer-copy-assets, or configure options.typst.compilerWasmUrl / options.typst.rendererWasmUrl / options.typst.fontAssetsUrl, and make sure the server returns WASM with application/wasm.","typst.error.svgParseFailed":"Failed to parse Typst SVG","typst.error.wasmLoadFailed":"Failed to load Typst WASM","xmind.toolbar.zoomOut":"Zoom out","xmind.toolbar.zoomIn":"Zoom in","xmind.toolbar.fit":"Fit","xmind.toolbar.fitTitle":"Fit canvas","xmind.state.loading":"Parsing XMind mind map...","xmind.stats.nodes":"Nodes","xmind.stats.depth":"Depth","xmind.stats.theme":"Theme","xmind.stats.template":"Template","xmind.badge.paused":"Paused","xmind.badge.collapsed":"Collapsed","xmind.badge.floating":"Floating","xmind.badge.summary":"Summary","xmind.badge.callout":"Callout","xmind.imageResource":"Image resource: {name}","xmind.error.unrecognized":"Unrecognized XMind file: content.json or content.xml was not found in the ZIP package.","xmind.error.noCanvas":"This XMind file has no previewable canvas.","cad.toolbar.fit":"Fit","cad.toolbar.zoomOut":"Zoom out","cad.toolbar.zoomIn":"Zoom in","cad.layers.title":"Layers","cad.layers.count":"{count} items","cad.inspector.title":"Structure","cad.inspector.entities":"Entities","cad.inspector.blocks":"Blocks","cad.inspector.pages":"Pages","cad.inspector.drawn":"Drawn","cad.state.loadingViewer":"Loading CAD viewer...","cad.state.parsing":"Parsing CAD...","cad.error.parseFailed":"Failed to parse CAD file","image.alt":"Image","image.lightbox.alt":"Image preview","image.lightbox.close":"Close image preview","gitBundle.error.invalid":"This file is not a valid Git bundle.","gitBundle.error.missingPack":"No PACK data was found after the Git bundle header.","gitBundle.notice.delta":"This bundle contains delta-compressed objects. The viewer resolves common OFS_DELTA / REF_DELTA objects in the browser. Missing files usually indicate a very large bundle, too many objects, or an external prerequisite.","gitBundle.title.history":"History","gitBundle.title.fileTree":"File tree","gitBundle.file.choose":"Select a file to inspect","gitBundle.file.noTree":"The tree/blob objects in this bundle may be delta-compressed, and no expandable files were parsed.","gitBundle.file.none":"No files parsed","gitBundle.history.empty":"No commit objects were parsed. Showing refs and pack summary only.","gitBundle.toolbar.summary":"{commits} commits · {files} files","gitBundle.meta.bundle":"Bundle","gitBundle.meta.refs":"Refs","gitBundle.meta.commits":"Commits","gitBundle.meta.objects":"Objects","gitBundle.meta.deltas":"Deltas","gitBundle.meta.objectFormat":"Object format","gitBundle.meta.objectTypes":"Object types","geo.error.unrecognized":"Unrecognized GeoJSON data","geo.error.xmlParseFailed":"Failed to parse XML","geo.error.unsupported":".{type} geospatial format is not supported","geo.title":"Geospatial preview","geo.featureCount":"Features","geo.bounds":"Bounds","geo.geometryTypes":"Geometry types","geo.aria":"Geospatial SVG preview","geo.loading":"Parsing geospatial data...","model.toolbar.fit":"Fit","model.toolbar.rotate":"Rotate","model.toolbar.wireframe":"Wireframe","model.toolbar.grid":"Grid","model.toolbar.axes":"Axes","model.state.loadingSummary":"Loading model","model.state.loading":"Parsing 3D model...","model.state.loaded":"Model loaded","model.state.parseFailed":"Failed to parse model","model.summary.meshes":"{count} meshes","model.summary.points":"{count} point clouds","model.error.daeEmpty":"The DAE model did not contain a valid scene.","model.error.unsupported":".{type} model format is not supported yet","model.error.parseFailed":"Failed to parse {type} model","model.notice.signature":"Detected file signature: {signature}.","loading.generic.label":"File content","loading.generic.hint":"Preparing content structure and preview.","loading.word.label":"Word document","loading.word.hint":"Preparing document structure, text styles, and layout.","loading.wordWorker.hint":"Preparing document structure, text styles, and layout in a Worker.","loading.sheet.label":"Excel workbook","loading.sheet.hint":"Preparing worksheets, styles, and viewport data.","loading.csv.label":"Tabular data","loading.csv.hint":"Preparing rows, columns, and basic styling.","loading.presentation.label":"PowerPoint deck","loading.presentation.hint":"Building slide layout and media content.","loading.pdf.label":"PDF document","loading.pdf.hint":"Loading page bitmaps, text layers, and zoom view.","loading.ofd.label":"OFD layout document","loading.ofd.hint":"Parsing OFD pages and layout objects.","loading.archive.label":"Archive","loading.archive.hint":"Starting Worker and reading archive entries.","loading.email.label":"Email file","loading.email.hint":"Parsing message headers, body, and attachments.","loading.msg.hint":"Parsing Outlook message and attachments.","loading.eda.label":"EDA file","loading.eda.hint":"Reading EDA container structure and properties.","loading.cad.label":"CAD drawing","loading.cad.hint":"Preparing CAD layers, geometry, and canvas view.","loading.dwg.hint":"Loading DWG geometry and LibreDWG WASM in a Worker.","loading.dwf.hint":"Loading native DWF renderer and W2D/W3D graphics.","loading.dwfx.hint":"Loading native DWFx/XPS renderer and page graphics.","loading.xps.hint":"Loading native XPS renderer and embedded fonts.","loading.drawio.label":"draw.io diagram","loading.drawio.hint":"Parsing shapes, connectors, and SVG preview.","loading.excalidraw.label":"Excalidraw scene","loading.excalidraw.hint":"Parsing hand-drawn elements and generating safe SVG.","loading.epub.label":"EPUB ebook","loading.epub.hint":"Parsing table of contents, chapter resources, and reading pages.","loading.umd.label":"UMD ebook","loading.umd.hint":"Parsing mobile ebook metadata, table of contents, and compressed chapters.","loading.image.label":"Image file","loading.image.hint":"Decoding pixels and generating preview.","loading.video.label":"Video file","loading.video.hint":"Preparing media resource and player.","loading.audio.label":"Audio file","loading.audio.hint":"Preparing audio resource and playback controls."},xr=Object.freeze({"zh-CN":En,"en-US":wn}),_n=()=>{var m;if(!(typeof navigator>"u"))return((m=navigator.languages)===null||m===void 0?void 0:m[0])||navigator.language},Tn=m=>{const C=!m||m==="auto"?_n():m;return String(C||"zh-CN").toLowerCase().startsWith("zh")?"zh-CN":"en-US"},xn=m=>{var C;return((C=m?.i18n)===null||C===void 0?void 0:C.messages)||m?.messages},Sr=m=>{var C;return Tn(((C=m?.i18n)===null||C===void 0?void 0:C.locale)||m?.locale)},Sn=(m,C={})=>m.replace(/\{([a-zA-Z0-9_.-]+)\}/g,(d,f)=>{const g=C[f];return g==null?"":String(g)}),de=(m,C,d={})=>{const f=Sr(m),g=xn(m);return Sn((typeof g=="function"?g(C,d,f):g?.[C])||xr[f][C]||xr["zh-CN"][C],d)}})),Pr=vt((()=>{be()})),Pn,Je,Ze=vt((()=>{fe(),Ke(),Pn=m=>({...m,extensions:m.extensions.map($t)}),Je=(m=ie)=>{const C=new Map,d=new Map,f=g=>{const y=Pn(g),E=C.get(y.id);E&&E.extensions.forEach(h=>{var w;((w=d.get(h))===null||w===void 0?void 0:w.id)===E.id&&d.delete(h)}),C.set(y.id,y),y.extensions.forEach(h=>{const w=d.get(h);if(w&&w.id!==y.id)throw new Error(`File extension "${h}" is already registered by renderer "${w.id}".`);d.set(h,y)})};return m.forEach(f),{register:f,unregister(g){const y=C.get(g);return y?(y.extensions.forEach(E=>{var h;((h=d.get(E))===null||h===void 0?void 0:h.id)===g&&d.delete(E)}),C.delete(g),!0):!1},getById(g){return C.get(g)},getByExtension(g){return d.get($t(g))},hasExtension(g){return d.has($t(g))},list(){return Array.from(C.values())},listExtensions(){return Array.from(d.keys()).sort()}}}})),Dr,Rr=vt((()=>{fe(),Ze(),Ke(),Dr=({registry:m=Je(ie),handlers:C,fallbackHandler:d,fallbackKey:f="error"})=>{const g=Array.from(C).reduce((w,A)=>(w.set(A.rendererId,A.handler),w),new Map),y=new Map,E=[];m.list().forEach(w=>{const A=g.get(w.id);if(!A){E.push(w.id);return}w.extensions.forEach(r=>{y.set($t(r),A)})}),d&&f&&y.set($t(f),d);const h=w=>y.get($t(w));return{handlersByRendererId:g,handlersByExtension:y,missingRendererIds:E,get:h,resolve(w){return h(w)||(f?h(f):void 0)},has(w){return y.has($t(w))},listExtensions(){return Array.from(y.keys()).sort()}}}})),Ko,Jo,Zo,kr=vt((()=>{fe(),Ko=Object.freeze({download:!1,print:!1,exportHtml:!1,zoom:!1,zoomIn:!1,zoomOut:!1,zoomReset:!1}),Jo=["pptx","pptm","potx","potm","ppsx","ppsm","ofd","dxf","dwg","dwf","dwfx","xps","excalidraw","drawio","dio","mermaid","mmd","plantuml","puml","umd","md","markdown","olb","dra",...Cr,...vr],Zo=["xlsx","xltx","xlsm","xlsb","xls","xlt","xltm","csv","ods","fods","numbers",...Ar,"eml","msg","epub","mp4","mp3","mpeg","wav","ogg","oga","opus","m4a","aac","flac","weba",...br]})),xe=vt((()=>{kr(),be(),Pr()})),qo,Ir,Dn,Rn,kn,In,Mn,On,Bn,Mr,Nn,qe=vt((()=>{Ke(),fe(),be(),qo=Object.freeze({downloading:"正在下载文件资源...",streamingPdf:"正在建立 PDF 流式预览...",reading:"正在解析文件内容..."}),Ir=Object.freeze({accent:"#5f6f82",soft:"rgba(95, 111, 130, 0.12)",badge:"DOC",label:"文件内容",hint:"正在整理内容结构并生成预览。"}),Dn=m=>{const C=$t(m);return C?`.${C}`:"当前"},Rn={"office-word-openxml":"@file-viewer/renderer-word","office-word-binary":"@file-viewer/renderer-word","office-presentation":"@file-viewer/renderer-presentation","open-document":"@file-viewer/renderer-word","spreadsheet-openxml":"@file-viewer/renderer-spreadsheet",pdf:"@file-viewer/renderer-pdf",ofd:"@file-viewer/renderer-ofd",typst:"@file-viewer/renderer-typst",archive:"@file-viewer/renderer-archive",email:"@file-viewer/renderer-email",eda:"@file-viewer/renderer-eda",cad:"@file-viewer/renderer-cad",model:"@file-viewer/renderer-3d",geo:"@file-viewer/renderer-geo",drawing:"@file-viewer/renderer-drawing",mindmap:"@file-viewer/renderer-mindmap",epub:"@file-viewer/renderer-epub",umd:"@file-viewer/renderer-epub",image:"@file-viewer/renderer-image",markdown:"@file-viewer/renderer-text",code:"@file-viewer/renderer-text",video:"@file-viewer/renderer-media",audio:"@file-viewer/renderer-media","data-asset":"@file-viewer/renderer-data"},kn=new Set(["office-word-openxml","office-word-binary","office-presentation","open-document","spreadsheet-openxml","pdf","ofd"]),In=new Set(["image","markdown","code","video","audio"]),Mn=new Set(["typst","archive","eda","cad","model","geo","drawing","mindmap","data-asset"]),On=m=>kn.has(m.id)?{packageName:"@file-viewer/preset-office",vitePreset:"office",label:"Office preset"}:Mn.has(m.id)?{packageName:"@file-viewer/preset-engineering",vitePreset:"engineering",label:"Engineering preset"}:In.has(m.id)?{packageName:"@file-viewer/preset-lite",vitePreset:"lite",label:"Lite preset"}:{packageName:"@file-viewer/preset-all",vitePreset:"all",label:"Full preset"},Bn=(m="")=>{const C=$t(m),d=ie.find(g=>g.extensions.map($t).includes(C));if(!d)return null;const f=On(d);return{extension:C,rendererId:d.id,rendererLabel:d.label,rendererCategory:d.category,rendererPackage:Rn[d.id],presetPackage:f.packageName,vitePreset:f.vitePreset,presetLabel:f.label}},Mr=({state:m,extension:C="",title:d,message:f,description:g,theme:y=Ir,recoverable:E})=>({state:m,extension:$t(C),title:d,message:f,description:g,theme:y,recoverable:E}),Nn=(m="",C=Ir,d)=>{const f=Dn(m),g=Bn(m);if(g){const y=Sr(d),E=g.rendererPackage?y==="zh-CN"?`;如果需要极致裁剪,也可以只安装 ${g.rendererPackage}`:`; for a strict custom cut, install only ${g.rendererPackage}`:"";return Mr({state:"unsupported",extension:m,title:de(d,"state.unsupported.install.title"),message:de(d,"state.unsupported.install.message",{extension:f,rendererLabel:g.rendererLabel}),description:de(d,"state.unsupported.install.description",{extension:f,rendererLabel:g.rendererLabel,presetPackage:g.presetPackage,vitePreset:g.vitePreset,rendererTip:E}),theme:C,recoverable:!0})}return Mr({state:"unsupported",extension:m,title:de(d,"state.unsupported.title"),message:de(d,"state.unsupported.message",{extension:f}),description:de(d,"state.unsupported.description"),theme:C,recoverable:!0})}})),Qe=vt((()=>{xe(),qe(),be()})),Fn,Or,Ln,Hn,Un,Br=vt((()=>{fe(),Rr(),Ze(),Qe(),Fn=(m,C)=>({rendered:m,destroy:()=>C?C():Or(m)}),Or=m=>{if(!m||typeof m!="object")return;const C=m;if(typeof C.unmount=="function")return C.unmount();if(typeof C.$destroy=="function")return C.$destroy();if(typeof C.destroy=="function")return C.destroy()},Ln=({source:m,options:C,registerExportAdapter:d,renderContext:f})=>({filename:m.filename,url:m.url,streamUrl:m.url,options:C,registerExportAdapter:d,...f}),Hn=({handler:m,getTarget:C=g=>g.surface.container,createContext:d=Ln,destroy:f})=>async g=>{const{source:y}=g;if(!y.buffer)throw new Error("FileRenderHandler renderer requires an ArrayBuffer source.");const E=C(g),h=await m(y.buffer,E,y.extension,d(g));return Fn(h,()=>f?f(h,g):Or(h))},Un=({definitions:m=ie,handlers:C,getTarget:d,createContext:f,destroy:g})=>{const y=Je(m),E=Dr({registry:y,handlers:C});return{registry:Je(y.list().map(h=>{const w=E.handlersByRendererId.get(h.id);return w?{...h,load:Hn({handler:w,getTarget:d,createContext:f,destroy:g})}:h})),dispatcher:E,missingRendererIds:E.missingRendererIds}}})),Qo=we({default:()=>ta});async function ta(m,C,d){const f=await Vn(m,d);let g=1,y=0;const E=Xe(),h=document.createElement("div");h.className="image-viewer",h.dataset.viewerZoomProvider="image";const w=document.createElement("div");w.className="image-stage";const A=document.createElement("img");A.alt="图片",A.src=f,w.append(A),h.append(w);const r=Yn(f),n=()=>r.open();A.addEventListener("click",n),document.body.append(r.element);const e=()=>{y=h.clientHeight||0,Nr(A,y,g),E.emit()},t=new ResizeObserver(e);t.observe(h);const p=()=>({scale:g,label:`${Math.round(g*100)}%`,canZoomIn:g<5,canZoomOut:g>.1,canReset:g!==1,minScale:.1,maxScale:5}),c=s=>(g=Xn(s),Nr(A,y,g),E.emit(),p());return $e(h,{zoomIn:()=>c(g+.15),zoomOut:()=>c(g-.15),resetZoom:()=>c(1),setZoom:c,getState:p,subscribe:E.subscribe}),C.replaceChildren(Wn(),h),e(),{$el:C,unmount(){Ve(h),t.disconnect(),A.removeEventListener("click",n),r.destroy(),C.replaceChildren()}}}var jn,Gn,Wn,zn,$n,Vn,Xn,Nr,Yn,ea=vt((()=>{_e(),Er(),jn={avif:"image/avif",bmp:"image/bmp",gif:"image/gif",heic:"image/heic",heif:"image/heif",ico:"image/x-icon",jxl:"image/jxl",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp"},Gn=`
24
+ `}})),$t,Ke=vt((()=>{$t=m=>m.trim().replace(/^\./,"").toLowerCase()})),Zo,En,wn,xr,_n,Tn,xn,Sr,Sn,de,Ce=vt((()=>{Zo="zh-CN",En={"toolbar.zoomGroup":"缩放控制","toolbar.zoomOut":"缩小预览","toolbar.zoomIn":"放大预览","toolbar.zoomReset":"还原比例","toolbar.download":"下载","toolbar.downloadTitle":"下载原始文件","toolbar.print":"打印","toolbar.printTitle":"打印完整渲染内容","toolbar.exportHtml":"HTML","toolbar.exportHtmlTitle":"导出当前渲染后的 HTML","state.ready.title":"预览完成","state.ready.message":"文件内容已完成渲染。","state.empty.title":"暂无文件","state.empty.message":"请选择文件或提供可访问的文件地址后开始预览。","state.unsupported.install.title":"需要装配预览能力","state.unsupported.install.message":"{extension} 格式已在支持矩阵中,但当前项目尚未装配 {rendererLabel} renderer。","state.unsupported.install.description":"推荐安装 {presetPackage},通过 options.preset / options.renderers 注入对应能力{rendererTip};Vite 项目也可以使用 @file-viewer/vite-plugin 自动发现已安装 preset。","state.unsupported.title":"暂不支持在线预览","state.unsupported.message":"不支持{extension}格式的在线预览,请下载后预览或转换为支持的格式。","state.unsupported.description":"支持 Office、PDF、OFD、Typst、压缩包、邮件、OLB/DRA、CAD、地理数据、3D 模型、Excalidraw、draw.io、EPUB、UMD、Markdown、代码/文本、图片、音视频、字体和数据资产的在线预览","state.error.title":"预览失败","preview.downloading":"正在下载文件资源...","preview.streamingPdf":"正在建立 PDF 流式预览...","preview.reading":"正在解析文件内容...","error.download":"下载失败","error.print":"打印失败","error.exportHtml":"导出 HTML 失败","error.noDownloadSource":"当前没有可下载的源文件","error.noExportContent":"当前没有可导出的预览内容","error.printUnavailable":"当前文件类型不支持完整打印,请下载原文件后在本地应用中打印","error.printWindowBlocked":"浏览器拦截了打印窗口","error.remoteDownload":"文件下载失败","error.localRead":"读取文件异常","error.load":"加载文件异常","error.stream":"加载 PDF 流式预览异常","error.beforeOperation":"操作前置校验失败","operation.download":"下载原始文件","operation.print":"打印完整渲染内容","operation.exportHtml":"导出渲染 HTML","operation.zoomIn":"放大预览","operation.zoomOut":"缩小预览","operation.zoomReset":"还原预览比例","pdf.toolbar.toggleNavigation":"切换导航窗格","pdf.toolbar.previousPage":"上一页","pdf.toolbar.nextPage":"下一页","pdf.toolbar.fitWidth":"适合宽度","pdf.toolbar.zoomOut":"缩小","pdf.toolbar.zoomIn":"放大","pdf.toolbar.rotateLeft":"向左旋转","pdf.toolbar.rotateRight":"向右旋转","pdf.nav.typeLabel":"PDF 导航类型","pdf.nav.pagesTab":"页面","pdf.nav.outlineTab":"目录","pdf.nav.pagesTitle":"页面导航","pdf.nav.outlineTitle":"目录导航","pdf.nav.pageCount":"{count} 页","pdf.nav.itemCount":"{count} 项","pdf.nav.pageLabel":"第 {page} 页","pdf.nav.outlineEmpty":"当前 PDF 没有可用目录","pdf.nav.outlineFallbackTitle":"目录 {index}","pdf.thumbnail.alt":"第 {page} 页缩略图","pdf.state.loading":"正在加载 PDF...","pdf.error.browserWindow":"PDF 预览需要浏览器窗口","pdf.error.missingSource":"PDF 缺少可读取的数据源","pdf.error.loadFailed":"PDF 加载失败","pdf.error.notLoaded":"PDF 尚未加载完成,请稍后再试","pdf.error.unloaded":"PDF 已卸载,无法继续打印","pdf.error.canvasUnavailable":"当前浏览器无法创建 PDF 打印画布","pdf.export.pageTitle":"{title} - 第 {page} 页","spreadsheet.loading.kicker":"Excel 表格","spreadsheet.loading.title":"正在解析 Excel 工作簿","spreadsheet.loading.hint":"正在准备工作表、样式和大数据视口,请稍候。","spreadsheet.loading.streaming":"正在平滑补充可视区数据","spreadsheet.tabs.ariaLabel":"工作表列表","spreadsheet.state.parsingWorkbook":"正在解析 Excel 工作簿,请耐心等待...","spreadsheet.state.preparingSheet":"正在准备工作表内容...","spreadsheet.state.preparingSheetNamed":"正在准备「{name}」...","spreadsheet.state.cachedRows":"已缓存 {cached} / {total} 行","spreadsheet.state.rows":"共 {rows} 行,按视口预取平滑加载","spreadsheet.state.rowsAndColumns":"共 {rows} 行,{cols} 列,按视口预取平滑加载","spreadsheet.error.parseFailed":"Excel 解析失败","spreadsheet.error.workerFailed":"Excel Worker 运行失败","archive.error.nestedUnsupported":"不支持 .{type} 格式的在线预览,请下载后预览或转换为支持的格式","archive.loading.readingDirectory":"正在读取压缩包目录...","archive.loading.readingDirectoryHint":"大文件会在 Worker 中解析,避免阻塞主线程。","archive.search.placeholder":"筛选压缩包内文件","archive.preview.title":"压缩包内预览","archive.preview.chooseFile":"请选择一个文件","archive.preview.downloadFile":"下载文件","archive.error.title":"压缩包预览提示","archive.stats.summary":"{count} 个文件 · {size} · {previewable} 个可直接预览","archive.warning.encrypted":"检测到加密内容,当前在线预览不接收密码,建议下载后本地解压。","archive.empty.title":"选择左侧文件即可预览","archive.empty.message":"压缩包只读取目录;文件内容会在点击后按需解压,并在体积允许时缓存到 IndexedDB。","archive.loading.initializingCandidate":"正在初始化 {label}...","archive.loading.initializingCandidateHint":"如果当前服务器没有正确发布 Worker/WASM,会自动切换兼容模式。","archive.error.candidateInitTimeout":"{label} 初始化超时","archive.error.encryptedCheckTimeout":"{label} 加密检测超时","archive.loading.directoryReadyHint":"目录读取完成后,点击内部文件才会按需解压。","archive.error.candidateReadTimeout":"{label} 读取目录超时","archive.loading.workerFallback":"Worker 不可用,正在切换 ZIP/TAR 兼容模式...","archive.loading.workerFallbackHint":"兼容模式无需额外静态 Worker,适合手机 WebView 或本地临时服务器。","archive.notice.workerFallback":"当前环境的 libarchive Worker 未能启动,已自动切换到 ZIP/TAR/GZIP 兼容模式。RAR、7z 等格式仍建议发布 vendor/libarchive/worker-bundle.js 与 libarchive.wasm。","archive.error.tooLarge":"压缩包体积 {size} 超过安全上限 {limit},请下载后在本地解压。","archive.loading.initializingWorker":"正在初始化压缩包解析 Worker...","archive.loading.initializingWorkerHint":"大文件会在 Worker 中解析,避免阻塞主线程。","archive.error.workerInitFailed":"压缩包 Worker 初始化失败","archive.error.entryTooLarge":"压缩包内文件 {name} 体积 {size} 超过预览上限 {limit}。","archive.loading.extracting":"正在按需解压 {name}...","archive.loading.rendering":"正在渲染 {name}...","archive.loading.exporting":"正在导出 {name}...","media.audio.title":"音频预览","media.audio.description":"使用浏览器原生播放器打开,兼容性取决于当前浏览器支持的音频编码。","media.audio.unsupported":"当前浏览器不支持音频播放。","media.video.title":"视频预览","media.video.unsupported":"当前浏览器不支持该视频格式。","media.video.hlsHint":"HLS 会优先使用原始 URL 加载分片;如果传入的是本地单文件清单,请确保分片地址可被浏览器访问。","media.midi.title":"MIDI 文件","media.midi.loading":"正在解析 MIDI 轨道...","media.midi.trackHeader":"轨道","media.midi.instrumentHeader":"乐器","media.midi.channelHeader":"通道","media.midi.noteCountHeader":"音符数","media.midi.durationHeader":"时长","media.midi.durationStat":"时长","media.midi.trackStat":"轨道","media.midi.noteStat":"音符","media.midi.parseFailed":"MIDI 解析失败","email.mbox.subject":"{filename} · 第 1 封","email.mbox.summary":"MBOX 共识别 {count} 封邮件,当前展示第 1 封。","email.error.title":"邮件预览提示","email.meta.from":"发件人","email.meta.to":"收件人","email.meta.cc":"抄送","email.meta.date":"时间","email.tabs.text":"正文","email.tabs.headers":"头信息","email.attachments.title":"附件","email.attachments.empty":"暂无附件","email.attachments.download":"下载附件","email.attachments.opening":"正在打开附件 {name}...","email.attachments.nestedUnavailable":"当前运行环境未提供附件嵌套预览入口,请下载 {name} 后查看。","email.loading.parsing":"正在解析邮件...","data.font.sample":"Flyfish Viewer 轻量预览 AaBbCc 1234567890","data.error.fontFaceUnsupported":"当前浏览器不支持 FontFace API","data.title.font":"字体文件预览","data.title.sqlite":"SQLite 数据库预览","data.title.parquet":"Parquet 列式数据预览","data.title.avro":"Avro 对象容器预览","data.title.wasm":"WebAssembly 模块预览","data.title.eps":"EPS 矢量文件摘要","data.title.ai":"Illustrator 文件摘要","data.title.webarchive":"WebArchive 摘要预览","data.title.summary":"数据资产摘要","data.label.format":"格式","data.label.size":"大小","data.label.rendering":"渲染方式","data.label.objects":"对象数","data.label.sampleTable":"示例表","data.label.rows":"行数","data.label.columns":"列数","data.label.sampleRows":"示例行","data.label.imports":"导入","data.label.exports":"导出","data.label.magic":"Magic","data.label.note":"说明","data.label.container":"容器","data.value.schemaRead":"已读取","data.value.schemaUnread":"未读取","data.note.aiSummary":"非 PDF-compatible AI 按摘要展示","data.note.postscriptSummary":"PostScript 摘要展示","data.note.webarchive":"安全提取可读片段,不执行网页脚本","data.image.alt":"资产预览","psd.title":"PSD 图层预览","psd.action.fit":"适合","psd.action.showAll":"全显","psd.action.hideAll":"全隐","psd.layers.title":"图层","psd.layers.redrawable":"{count} 可重绘","psd.layers.empty":"未发现可展示图层,使用合成图预览。","psd.layers.hidden":"隐藏","drawing.error.viewerLoadFailed":"diagrams.net viewer 加载失败","drawing.error.excalidrawEmpty":"Excalidraw 文件中没有可预览图元","drawing.error.excalidrawTimeout":"Excalidraw 官方导出超时,自动切换 rough.js 兼容渲染","drawing.error.drawioParseFailed":"Draw.io XML 解析失败:{message}","drawing.error.drawioNoModel":"当前 Draw.io 文件没有可直接渲染的 mxGraphModel。","drawing.error.drawioNoElements":"当前 Draw.io 文件没有可预览图元。","drawing.error.viewerInitFailed":"diagrams.net viewer 未正确初始化","drawing.error.drawioTimeout":"diagrams.net 官方 Viewer 加载超时,自动切换本地 SVG 预览","drawing.error.svgParseFailed":"SVG 解析失败","drawing.error.plantumlRenderFailed":"PlantUML SVG 渲染失败:{status}","drawing.title.excalidraw":"Excalidraw 官方 SVG 预览","drawing.title.mermaid":"Mermaid SVG 预览","drawing.title.plantuml":"PlantUML SVG 预览","drawing.title.drawio":"Draw.io 离线 SVG 预览","drawing.toolbar.zoomOut":"缩小","drawing.toolbar.zoomIn":"放大","drawing.toolbar.fit":"适合","drawing.toolbar.fitWidth":"适合宽度","drawing.state.loading":"正在加载绘图预览...","text.code.loadingHighlight":"正在加载高亮...","ebook.toc":"目录","ebook.reading":"阅读中","ebook.itemCount":"{count} 项","epub.title":"EPUB 电子书","epub.previousPage":"上一页","epub.nextPage":"下一页","epub.loading":"正在解析 EPUB...","epub.chapterFallback":"章节 {index}","epub.renderIncomplete":"EPUB 正文渲染未完成,请刷新后重试","umd.title":"UMD 电子书","umd.previousChapter":"上一章","umd.nextChapter":"下一章","umd.loading":"正在解析 UMD...","umd.emptyContent":"未解析到正文内容","umd.chapterFallback":"章节 {index}","umd.galleryFallback":"图集 {index}","umd.warningBodyTooShort":"UMD 正文长度小于声明长度,文件可能不完整","umd.error.unexpectedEnd":"UMD 文件结构不完整,读取时遇到意外结尾","umd.error.invalidFile":"不是有效的 UMD 电子书文件","typst.summaryRenderer":"Typst WASM 渲染器","typst.pageSummary.empty":"0 页","typst.pageSummary.ready":"{count} 页 / {width} x {height} pt","typst.status.compiling":"正在编译","typst.status.failed":"编译失败","typst.status.rendered":"已渲染","typst.loading.title":"正在解析 Typst","typst.loading.hint":"加载编译器并生成页面预览...","typst.error.title":"Typst 渲染失败","typst.error.timeout":"Typst WASM / 字体加载或编译超过 {seconds} 秒","typst.error.timeoutHint":"请检查 Typst compiler WASM、renderer WASM、字体目录的下载速度和缓存策略;弱网或跨境部署可通过 options.typst.renderTimeoutMs 调大浏览器端加载/编译超时。","typst.error.assetHint":"Typst 需要本地 compiler / renderer WASM 和字体目录。请运行 file-viewer-copy-assets,或配置 options.typst.compilerWasmUrl / options.typst.rendererWasmUrl / options.typst.fontAssetsUrl,并确认服务器以 application/wasm 返回 WASM。","typst.error.svgParseFailed":"Typst SVG 解析失败","typst.error.wasmLoadFailed":"Typst WASM 加载失败","xmind.toolbar.zoomOut":"缩小","xmind.toolbar.zoomIn":"放大","xmind.toolbar.fit":"适合","xmind.toolbar.fitTitle":"适配画布","xmind.state.loading":"正在解析 XMind 脑图...","xmind.stats.nodes":"节点","xmind.stats.depth":"层级","xmind.stats.theme":"主题","xmind.stats.template":"模板","xmind.badge.paused":"暂停","xmind.badge.collapsed":"折叠","xmind.badge.floating":"浮动","xmind.badge.summary":"概要","xmind.badge.callout":"标注","xmind.imageResource":"图片资源: {name}","xmind.error.unrecognized":"无法识别 XMind 文件: ZIP 中未找到 content.json 或 content.xml","xmind.error.noCanvas":"XMind 文件中没有可预览的画布","cad.toolbar.fit":"适配","cad.toolbar.zoomOut":"缩小","cad.toolbar.zoomIn":"放大","cad.layers.title":"图层","cad.layers.count":"{count} 项","cad.inspector.title":"结构","cad.inspector.entities":"实体","cad.inspector.blocks":"块","cad.inspector.pages":"页面","cad.inspector.drawn":"绘制","cad.state.loadingViewer":"正在加载 CAD 预览器...","cad.state.parsing":"正在解析 CAD...","cad.error.parseFailed":"CAD 文件解析失败","image.alt":"图片","image.lightbox.alt":"图片预览","image.lightbox.close":"关闭图片预览","gitBundle.error.invalid":"当前文件不是标准 Git bundle。","gitBundle.error.missingPack":"Git bundle header 后未找到 PACK 数据。","gitBundle.notice.delta":"当前 bundle 包含 delta 压缩对象。预览器已在浏览器端解析常规 OFS_DELTA / REF_DELTA;若仍有缺失文件,通常是包体过大、对象过多或依赖外部 prerequisite。","gitBundle.title.history":"历史记录","gitBundle.title.fileTree":"文件树","gitBundle.file.choose":"选择文件查看内容","gitBundle.file.noTree":"当前 bundle 的 tree/blob 可能被 delta 压缩,暂未解析到可展开文件。","gitBundle.file.none":"未解析到文件","gitBundle.history.empty":"当前 bundle 未解析到 commit 对象,仅展示 refs 和 pack 摘要。","gitBundle.toolbar.summary":"{commits} commits · {files} files","gitBundle.meta.bundle":"Bundle","gitBundle.meta.refs":"Refs","gitBundle.meta.commits":"Commits","gitBundle.meta.objects":"Objects","gitBundle.meta.deltas":"Deltas","gitBundle.meta.objectFormat":"Object format","gitBundle.meta.objectTypes":"Object types","geo.error.unrecognized":"无法识别的 GeoJSON 数据","geo.error.xmlParseFailed":"XML 解析失败","geo.error.unsupported":"不支持 .{type} 地理格式","geo.title":"地理数据预览","geo.featureCount":"要素数","geo.bounds":"范围","geo.geometryTypes":"几何类型","geo.aria":"地理数据 SVG 预览","geo.loading":"正在解析地理数据...","model.toolbar.fit":"适配","model.toolbar.rotate":"旋转","model.toolbar.wireframe":"线框","model.toolbar.grid":"网格","model.toolbar.axes":"坐标","model.state.loadingSummary":"正在加载模型","model.state.loading":"正在解析 3D 模型...","model.state.loaded":"模型已加载","model.state.parseFailed":"模型解析失败","model.summary.meshes":"{count} 个网格","model.summary.points":"{count} 个点云","model.error.daeEmpty":"DAE 模型未解析出有效场景","model.error.unsupported":"暂不支持 .{type} 模型格式","model.error.parseFailed":"{type} 模型解析失败","model.notice.signature":"检测到文件签名: {signature}。","loading.generic.label":"文件内容","loading.generic.hint":"正在整理内容结构并生成预览。","loading.word.label":"Word 文档","loading.word.hint":"正在准备分页、文本样式和文档结构。","loading.wordWorker.hint":"正在通过 Worker 准备文档结构、文本样式和分页结果。","loading.sheet.label":"Excel 表格","loading.sheet.hint":"正在准备工作表、样式和可视区数据。","loading.csv.label":"表格数据","loading.csv.hint":"正在准备行列数据和基础样式。","loading.presentation.label":"PPT 演示文稿","loading.presentation.hint":"正在构建幻灯片布局和媒体内容。","loading.pdf.label":"PDF 文档","loading.pdf.hint":"正在载入页面位图、文本层和缩放视图。","loading.ofd.label":"OFD 版式文件","loading.ofd.hint":"正在解析国产版式文档和页面对象。","loading.archive.label":"压缩包","loading.archive.hint":"正在启动 Worker 并读取压缩包目录。","loading.email.label":"邮件文件","loading.email.hint":"正在解析邮件头、正文和附件。","loading.msg.hint":"正在解析 Outlook 邮件和附件。","loading.eda.label":"EDA 文件","loading.eda.hint":"正在读取 EDA 容器结构和可读属性。","loading.cad.label":"CAD 图纸","loading.cad.hint":"正在准备 CAD 图层、几何对象和画布视图。","loading.dwg.hint":"正在通过 Worker 加载 DWG 几何和 LibreDWG WASM。","loading.dwf.hint":"正在加载 DWF native renderer 与 W2D/W3D 图形。","loading.dwfx.hint":"正在加载 DWFx/XPS native renderer 与页面图形。","loading.xps.hint":"正在加载 XPS native renderer 与嵌入字体。","loading.drawio.label":"draw.io 图纸","loading.drawio.hint":"正在解析图元、连线和 SVG 预览。","loading.excalidraw.label":"Excalidraw 图纸","loading.excalidraw.hint":"正在解析手绘图元并生成安全 SVG。","loading.epub.label":"EPUB 电子书","loading.epub.hint":"正在解析目录、章节资源和阅读分页。","loading.umd.label":"UMD 电子书","loading.umd.hint":"正在解析移动电子书结构、目录和压缩正文。","loading.image.label":"图片文件","loading.image.hint":"正在解码像素数据并生成预览。","loading.video.label":"视频文件","loading.video.hint":"正在准备媒体资源和播放组件。","loading.audio.label":"音频文件","loading.audio.hint":"正在准备音频资源和播放控件。"},wn={"toolbar.zoomGroup":"Zoom controls","toolbar.zoomOut":"Zoom out","toolbar.zoomIn":"Zoom in","toolbar.zoomReset":"Reset zoom","toolbar.download":"Download","toolbar.downloadTitle":"Download the original file","toolbar.print":"Print","toolbar.printTitle":"Print the complete rendered document","toolbar.exportHtml":"HTML","toolbar.exportHtmlTitle":"Export the rendered HTML","state.ready.title":"Preview ready","state.ready.message":"The file has been rendered.","state.empty.title":"No file selected","state.empty.message":"Choose a file or provide an accessible URL to start previewing.","state.unsupported.install.title":"Preview capability required","state.unsupported.install.message":"{extension} is in the supported matrix, but {rendererLabel} renderer is not assembled in this project.","state.unsupported.install.description":"Install {presetPackage} and pass the capability through options.preset / options.renderers{rendererTip}. Vite projects can also use @file-viewer/vite-plugin to auto-discover installed presets.","state.unsupported.title":"Online preview is not supported yet","state.unsupported.message":"{extension} cannot be previewed online. Download it or convert it to a supported format.","state.unsupported.description":"Supports online preview for Office, PDF, OFD, Typst, archives, email, OLB/DRA, CAD, geospatial data, 3D models, Excalidraw, draw.io, EPUB, UMD, Markdown, code/text, images, audio/video, fonts, and structured data assets.","state.error.title":"Preview failed","preview.downloading":"Downloading file resources...","preview.streamingPdf":"Preparing streaming PDF preview...","preview.reading":"Parsing file content...","error.download":"Download failed","error.print":"Print failed","error.exportHtml":"HTML export failed","error.noDownloadSource":"There is no original file source to download.","error.noExportContent":"There is no rendered preview content to export.","error.printUnavailable":"This file type does not support full-document printing. Download the original file and print it locally.","error.printWindowBlocked":"The browser blocked the print window.","error.remoteDownload":"File download failed","error.localRead":"Failed to read local file","error.load":"Failed to load file","error.stream":"Failed to load streaming PDF preview","error.beforeOperation":"Before-operation check failed","operation.download":"Download original file","operation.print":"Print complete rendered content","operation.exportHtml":"Export rendered HTML","operation.zoomIn":"Zoom in","operation.zoomOut":"Zoom out","operation.zoomReset":"Reset preview zoom","pdf.toolbar.toggleNavigation":"Toggle navigation pane","pdf.toolbar.previousPage":"Previous page","pdf.toolbar.nextPage":"Next page","pdf.toolbar.fitWidth":"Fit to width","pdf.toolbar.zoomOut":"Zoom out","pdf.toolbar.zoomIn":"Zoom in","pdf.toolbar.rotateLeft":"Rotate left","pdf.toolbar.rotateRight":"Rotate right","pdf.nav.typeLabel":"PDF navigation type","pdf.nav.pagesTab":"Pages","pdf.nav.outlineTab":"Outline","pdf.nav.pagesTitle":"Page navigation","pdf.nav.outlineTitle":"Outline navigation","pdf.nav.pageCount":"{count} pages","pdf.nav.itemCount":"{count} items","pdf.nav.pageLabel":"Page {page}","pdf.nav.outlineEmpty":"This PDF has no available outline.","pdf.nav.outlineFallbackTitle":"Outline {index}","pdf.thumbnail.alt":"Page {page} thumbnail","pdf.state.loading":"Loading PDF...","pdf.error.browserWindow":"PDF preview requires a browser window","pdf.error.missingSource":"PDF has no readable data source","pdf.error.loadFailed":"Failed to load PDF","pdf.error.notLoaded":"The PDF is not loaded yet. Please try again later.","pdf.error.unloaded":"The PDF has been unloaded and cannot continue printing.","pdf.error.canvasUnavailable":"This browser cannot create a PDF print canvas.","pdf.export.pageTitle":"{title} - Page {page}","spreadsheet.loading.kicker":"Excel workbook","spreadsheet.loading.title":"Parsing Excel workbook","spreadsheet.loading.hint":"Preparing worksheets, styles, and virtualized viewport data.","spreadsheet.loading.streaming":"Loading visible worksheet data","spreadsheet.tabs.ariaLabel":"Worksheet list","spreadsheet.state.parsingWorkbook":"Parsing the Excel workbook. Please wait...","spreadsheet.state.preparingSheet":"Preparing worksheet content...","spreadsheet.state.preparingSheetNamed":"Preparing “{name}”...","spreadsheet.state.cachedRows":"Cached {cached} / {total} rows","spreadsheet.state.rows":"{rows} rows, loading smoothly by viewport","spreadsheet.state.rowsAndColumns":"{rows} rows, {cols} columns, loading smoothly by viewport","spreadsheet.error.parseFailed":"Failed to parse Excel","spreadsheet.error.workerFailed":"Excel Worker failed","archive.error.nestedUnsupported":".{type} cannot be previewed online. Download it or convert it to a supported format.","archive.loading.readingDirectory":"Reading archive directory...","archive.loading.readingDirectoryHint":"Large files are parsed in a Worker to keep the main thread responsive.","archive.search.placeholder":"Filter files inside the archive","archive.preview.title":"Archive entry preview","archive.preview.chooseFile":"Choose a file","archive.preview.downloadFile":"Download file","archive.error.title":"Archive preview notice","archive.stats.summary":"{count} files · {size} · {previewable} directly previewable","archive.warning.encrypted":"Encrypted content was detected. Online preview does not accept passwords; download and extract it locally.","archive.empty.title":"Choose a file from the left to preview","archive.empty.message":"The archive directory is read first. File contents are extracted on demand and cached in IndexedDB when size allows.","archive.loading.initializingCandidate":"Initializing {label}...","archive.loading.initializingCandidateHint":"If the server does not publish Worker/WASM assets correctly, the viewer falls back automatically.","archive.error.candidateInitTimeout":"{label} initialization timed out","archive.error.encryptedCheckTimeout":"{label} encryption check timed out","archive.loading.directoryReadyHint":"After the directory is ready, click an entry to extract it on demand.","archive.error.candidateReadTimeout":"{label} directory read timed out","archive.loading.workerFallback":"Worker unavailable. Switching to ZIP/TAR compatibility mode...","archive.loading.workerFallbackHint":"Compatibility mode needs no static Worker and works well in mobile WebViews or temporary local servers.","archive.notice.workerFallback":"The libarchive Worker could not start in this environment, so ZIP/TAR/GZIP compatibility mode is active. RAR, 7z, and similar formats should still publish vendor/libarchive/worker-bundle.js and libarchive.wasm.","archive.error.tooLarge":"Archive size {size} exceeds the safety limit {limit}. Download and extract it locally.","archive.loading.initializingWorker":"Initializing archive parsing Worker...","archive.loading.initializingWorkerHint":"Large files are parsed in a Worker to keep the main thread responsive.","archive.error.workerInitFailed":"Archive Worker initialization failed","archive.error.entryTooLarge":"Entry {name} is {size}, exceeding the preview limit {limit}.","archive.loading.extracting":"Extracting {name} on demand...","archive.loading.rendering":"Rendering {name}...","archive.loading.exporting":"Exporting {name}...","media.audio.title":"Audio preview","media.audio.description":"Opened with the browser-native audio player. Codec support depends on the current browser.","media.audio.unsupported":"This browser does not support audio playback.","media.video.title":"Video preview","media.video.unsupported":"This browser does not support this video format.","media.video.hlsHint":"HLS prefers the original URL for segment loading. If the input is a local single-file playlist, make sure segment URLs are reachable by the browser.","media.midi.title":"MIDI file","media.midi.loading":"Parsing MIDI tracks...","media.midi.trackHeader":"Track","media.midi.instrumentHeader":"Instrument","media.midi.channelHeader":"Channel","media.midi.noteCountHeader":"Notes","media.midi.durationHeader":"Duration","media.midi.durationStat":"Duration","media.midi.trackStat":"Tracks","media.midi.noteStat":"Notes","media.midi.parseFailed":"Failed to parse MIDI","email.mbox.subject":"{filename} · message 1","email.mbox.summary":"Detected {count} messages in the MBOX archive. Showing message 1.","email.error.title":"Email preview notice","email.meta.from":"From","email.meta.to":"To","email.meta.cc":"Cc","email.meta.date":"Date","email.tabs.text":"Body","email.tabs.headers":"Headers","email.attachments.title":"Attachments","email.attachments.empty":"No attachments","email.attachments.download":"Download attachment","email.attachments.opening":"Opening attachment {name}...","email.attachments.nestedUnavailable":"Nested attachment preview is not available in this environment. Download {name} to inspect it.","email.loading.parsing":"Parsing email...","data.font.sample":"Flyfish Viewer preview AaBbCc 1234567890","data.error.fontFaceUnsupported":"This browser does not support the FontFace API","data.title.font":"Font file preview","data.title.sqlite":"SQLite database preview","data.title.parquet":"Parquet columnar data preview","data.title.avro":"Avro object container preview","data.title.wasm":"WebAssembly module preview","data.title.eps":"EPS vector file summary","data.title.ai":"Illustrator file summary","data.title.webarchive":"WebArchive summary preview","data.title.summary":"Data asset summary","data.label.format":"Format","data.label.size":"Size","data.label.rendering":"Renderer","data.label.objects":"Objects","data.label.sampleTable":"Sample table","data.label.rows":"Rows","data.label.columns":"Columns","data.label.sampleRows":"Sample rows","data.label.imports":"Imports","data.label.exports":"Exports","data.label.magic":"Magic","data.label.note":"Note","data.label.container":"Container","data.value.schemaRead":"Read","data.value.schemaUnread":"Not read","data.note.aiSummary":"Non PDF-compatible AI is shown as a safe summary.","data.note.postscriptSummary":"PostScript summary preview","data.note.webarchive":"Readable fragments are extracted safely. Web scripts are not executed.","data.image.alt":"Asset preview","psd.title":"PSD layer preview","psd.action.fit":"Fit","psd.action.showAll":"Show all","psd.action.hideAll":"Hide all","psd.layers.title":"Layers","psd.layers.redrawable":"{count} redrawable","psd.layers.empty":"No displayable layers were found. Showing the composite image.","psd.layers.hidden":"hidden","drawing.error.viewerLoadFailed":"Failed to load the diagrams.net viewer","drawing.error.excalidrawEmpty":"This Excalidraw file has no previewable elements","drawing.error.excalidrawTimeout":"Official Excalidraw export timed out. Falling back to the rough.js renderer.","drawing.error.drawioParseFailed":"Failed to parse Draw.io XML: {message}","drawing.error.drawioNoModel":"This Draw.io file has no directly renderable mxGraphModel.","drawing.error.drawioNoElements":"This Draw.io file has no previewable elements.","drawing.error.viewerInitFailed":"The diagrams.net viewer was not initialized correctly","drawing.error.drawioTimeout":"Official diagrams.net Viewer timed out. Falling back to the local SVG preview.","drawing.error.svgParseFailed":"Failed to parse SVG","drawing.error.plantumlRenderFailed":"Failed to render PlantUML SVG: {status}","drawing.title.excalidraw":"Official Excalidraw SVG preview","drawing.title.mermaid":"Mermaid SVG preview","drawing.title.plantuml":"PlantUML SVG preview","drawing.title.drawio":"Draw.io offline SVG preview","drawing.toolbar.zoomOut":"Zoom out","drawing.toolbar.zoomIn":"Zoom in","drawing.toolbar.fit":"Fit","drawing.toolbar.fitWidth":"Fit width","drawing.state.loading":"Loading drawing preview...","text.code.loadingHighlight":"Loading syntax highlighting...","ebook.toc":"Table of contents","ebook.reading":"Reading","ebook.itemCount":"{count} items","epub.title":"EPUB ebook","epub.previousPage":"Previous","epub.nextPage":"Next","epub.loading":"Parsing EPUB...","epub.chapterFallback":"Chapter {index}","epub.renderIncomplete":"EPUB content did not finish rendering. Refresh and try again.","umd.title":"UMD ebook","umd.previousChapter":"Previous chapter","umd.nextChapter":"Next chapter","umd.loading":"Parsing UMD...","umd.emptyContent":"No readable body content was parsed.","umd.chapterFallback":"Chapter {index}","umd.galleryFallback":"Gallery {index}","umd.warningBodyTooShort":"The UMD body is shorter than declared and may be incomplete.","umd.error.unexpectedEnd":"The UMD structure is incomplete and ended unexpectedly.","umd.error.invalidFile":"This is not a valid UMD ebook file.","typst.summaryRenderer":"Typst WASM renderer","typst.pageSummary.empty":"0 pages","typst.pageSummary.ready":"{count} pages / {width} x {height} pt","typst.status.compiling":"Compiling","typst.status.failed":"Compilation failed","typst.status.rendered":"Rendered","typst.loading.title":"Parsing Typst","typst.loading.hint":"Loading the compiler and generating page previews...","typst.error.title":"Typst render failed","typst.error.timeout":"Typst WASM / font loading or compilation exceeded {seconds} seconds","typst.error.timeoutHint":"Check the download speed and cache strategy for the Typst compiler WASM, renderer WASM, and font directory. On weak networks or cross-region deployments, increase options.typst.renderTimeoutMs.","typst.error.assetHint":"Typst requires local compiler / renderer WASM files and a font directory. Run file-viewer-copy-assets, or configure options.typst.compilerWasmUrl / options.typst.rendererWasmUrl / options.typst.fontAssetsUrl, and make sure the server returns WASM with application/wasm.","typst.error.svgParseFailed":"Failed to parse Typst SVG","typst.error.wasmLoadFailed":"Failed to load Typst WASM","xmind.toolbar.zoomOut":"Zoom out","xmind.toolbar.zoomIn":"Zoom in","xmind.toolbar.fit":"Fit","xmind.toolbar.fitTitle":"Fit canvas","xmind.state.loading":"Parsing XMind mind map...","xmind.stats.nodes":"Nodes","xmind.stats.depth":"Depth","xmind.stats.theme":"Theme","xmind.stats.template":"Template","xmind.badge.paused":"Paused","xmind.badge.collapsed":"Collapsed","xmind.badge.floating":"Floating","xmind.badge.summary":"Summary","xmind.badge.callout":"Callout","xmind.imageResource":"Image resource: {name}","xmind.error.unrecognized":"Unrecognized XMind file: content.json or content.xml was not found in the ZIP package.","xmind.error.noCanvas":"This XMind file has no previewable canvas.","cad.toolbar.fit":"Fit","cad.toolbar.zoomOut":"Zoom out","cad.toolbar.zoomIn":"Zoom in","cad.layers.title":"Layers","cad.layers.count":"{count} items","cad.inspector.title":"Structure","cad.inspector.entities":"Entities","cad.inspector.blocks":"Blocks","cad.inspector.pages":"Pages","cad.inspector.drawn":"Drawn","cad.state.loadingViewer":"Loading CAD viewer...","cad.state.parsing":"Parsing CAD...","cad.error.parseFailed":"Failed to parse CAD file","image.alt":"Image","image.lightbox.alt":"Image preview","image.lightbox.close":"Close image preview","gitBundle.error.invalid":"This file is not a valid Git bundle.","gitBundle.error.missingPack":"No PACK data was found after the Git bundle header.","gitBundle.notice.delta":"This bundle contains delta-compressed objects. The viewer resolves common OFS_DELTA / REF_DELTA objects in the browser. Missing files usually indicate a very large bundle, too many objects, or an external prerequisite.","gitBundle.title.history":"History","gitBundle.title.fileTree":"File tree","gitBundle.file.choose":"Select a file to inspect","gitBundle.file.noTree":"The tree/blob objects in this bundle may be delta-compressed, and no expandable files were parsed.","gitBundle.file.none":"No files parsed","gitBundle.history.empty":"No commit objects were parsed. Showing refs and pack summary only.","gitBundle.toolbar.summary":"{commits} commits · {files} files","gitBundle.meta.bundle":"Bundle","gitBundle.meta.refs":"Refs","gitBundle.meta.commits":"Commits","gitBundle.meta.objects":"Objects","gitBundle.meta.deltas":"Deltas","gitBundle.meta.objectFormat":"Object format","gitBundle.meta.objectTypes":"Object types","geo.error.unrecognized":"Unrecognized GeoJSON data","geo.error.xmlParseFailed":"Failed to parse XML","geo.error.unsupported":".{type} geospatial format is not supported","geo.title":"Geospatial preview","geo.featureCount":"Features","geo.bounds":"Bounds","geo.geometryTypes":"Geometry types","geo.aria":"Geospatial SVG preview","geo.loading":"Parsing geospatial data...","model.toolbar.fit":"Fit","model.toolbar.rotate":"Rotate","model.toolbar.wireframe":"Wireframe","model.toolbar.grid":"Grid","model.toolbar.axes":"Axes","model.state.loadingSummary":"Loading model","model.state.loading":"Parsing 3D model...","model.state.loaded":"Model loaded","model.state.parseFailed":"Failed to parse model","model.summary.meshes":"{count} meshes","model.summary.points":"{count} point clouds","model.error.daeEmpty":"The DAE model did not contain a valid scene.","model.error.unsupported":".{type} model format is not supported yet","model.error.parseFailed":"Failed to parse {type} model","model.notice.signature":"Detected file signature: {signature}.","loading.generic.label":"File content","loading.generic.hint":"Preparing content structure and preview.","loading.word.label":"Word document","loading.word.hint":"Preparing document structure, text styles, and layout.","loading.wordWorker.hint":"Preparing document structure, text styles, and layout in a Worker.","loading.sheet.label":"Excel workbook","loading.sheet.hint":"Preparing worksheets, styles, and viewport data.","loading.csv.label":"Tabular data","loading.csv.hint":"Preparing rows, columns, and basic styling.","loading.presentation.label":"PowerPoint deck","loading.presentation.hint":"Building slide layout and media content.","loading.pdf.label":"PDF document","loading.pdf.hint":"Loading page bitmaps, text layers, and zoom view.","loading.ofd.label":"OFD layout document","loading.ofd.hint":"Parsing OFD pages and layout objects.","loading.archive.label":"Archive","loading.archive.hint":"Starting Worker and reading archive entries.","loading.email.label":"Email file","loading.email.hint":"Parsing message headers, body, and attachments.","loading.msg.hint":"Parsing Outlook message and attachments.","loading.eda.label":"EDA file","loading.eda.hint":"Reading EDA container structure and properties.","loading.cad.label":"CAD drawing","loading.cad.hint":"Preparing CAD layers, geometry, and canvas view.","loading.dwg.hint":"Loading DWG geometry and LibreDWG WASM in a Worker.","loading.dwf.hint":"Loading native DWF renderer and W2D/W3D graphics.","loading.dwfx.hint":"Loading native DWFx/XPS renderer and page graphics.","loading.xps.hint":"Loading native XPS renderer and embedded fonts.","loading.drawio.label":"draw.io diagram","loading.drawio.hint":"Parsing shapes, connectors, and SVG preview.","loading.excalidraw.label":"Excalidraw scene","loading.excalidraw.hint":"Parsing hand-drawn elements and generating safe SVG.","loading.epub.label":"EPUB ebook","loading.epub.hint":"Parsing table of contents, chapter resources, and reading pages.","loading.umd.label":"UMD ebook","loading.umd.hint":"Parsing mobile ebook metadata, table of contents, and compressed chapters.","loading.image.label":"Image file","loading.image.hint":"Decoding pixels and generating preview.","loading.video.label":"Video file","loading.video.hint":"Preparing media resource and player.","loading.audio.label":"Audio file","loading.audio.hint":"Preparing audio resource and playback controls."},xr=Object.freeze({"zh-CN":En,"en-US":wn}),_n=()=>{var m;if(!(typeof navigator>"u"))return((m=navigator.languages)===null||m===void 0?void 0:m[0])||navigator.language},Tn=m=>{const C=!m||m==="auto"?_n():m;return String(C||"zh-CN").toLowerCase().startsWith("zh")?"zh-CN":"en-US"},xn=m=>{var C;return((C=m?.i18n)===null||C===void 0?void 0:C.messages)||m?.messages},Sr=m=>{var C;return Tn(((C=m?.i18n)===null||C===void 0?void 0:C.locale)||m?.locale)},Sn=(m,C={})=>m.replace(/\{([a-zA-Z0-9_.-]+)\}/g,(d,f)=>{const g=C[f];return g==null?"":String(g)}),de=(m,C,d={})=>{const f=Sr(m),g=xn(m);return Sn((typeof g=="function"?g(C,d,f):g?.[C])||xr[f][C]||xr["zh-CN"][C],d)}})),Pr=vt((()=>{Ce()})),Pn,Je,Ze=vt((()=>{fe(),Ke(),Pn=m=>({...m,extensions:m.extensions.map($t)}),Je=(m=ie)=>{const C=new Map,d=new Map,f=g=>{const y=Pn(g),E=C.get(y.id);E&&E.extensions.forEach(h=>{var w;((w=d.get(h))===null||w===void 0?void 0:w.id)===E.id&&d.delete(h)}),C.set(y.id,y),y.extensions.forEach(h=>{const w=d.get(h);if(w&&w.id!==y.id)throw new Error(`File extension "${h}" is already registered by renderer "${w.id}".`);d.set(h,y)})};return m.forEach(f),{register:f,unregister(g){const y=C.get(g);return y?(y.extensions.forEach(E=>{var h;((h=d.get(E))===null||h===void 0?void 0:h.id)===g&&d.delete(E)}),C.delete(g),!0):!1},getById(g){return C.get(g)},getByExtension(g){return d.get($t(g))},hasExtension(g){return d.has($t(g))},list(){return Array.from(C.values())},listExtensions(){return Array.from(d.keys()).sort()}}}})),Dr,Rr=vt((()=>{fe(),Ze(),Ke(),Dr=({registry:m=Je(ie),handlers:C,fallbackHandler:d,fallbackKey:f="error"})=>{const g=Array.from(C).reduce((w,A)=>(w.set(A.rendererId,A.handler),w),new Map),y=new Map,E=[];m.list().forEach(w=>{const A=g.get(w.id);if(!A){E.push(w.id);return}w.extensions.forEach(r=>{y.set($t(r),A)})}),d&&f&&y.set($t(f),d);const h=w=>y.get($t(w));return{handlersByRendererId:g,handlersByExtension:y,missingRendererIds:E,get:h,resolve(w){return h(w)||(f?h(f):void 0)},has(w){return y.has($t(w))},listExtensions(){return Array.from(y.keys()).sort()}}}})),qo,Qo,ta,kr=vt((()=>{fe(),qo=Object.freeze({download:!1,print:!1,exportHtml:!1,zoom:!1,zoomIn:!1,zoomOut:!1,zoomReset:!1}),Qo=["pptx","pptm","potx","potm","ppsx","ppsm","ofd","dxf","dwg","dwf","dwfx","xps","excalidraw","drawio","dio","mermaid","mmd","plantuml","puml","umd","md","markdown","olb","dra",...Cr,...vr],ta=["xlsx","xltx","xlsm","xlsb","xls","xlt","xltm","csv","ods","fods","numbers",...Ar,"eml","msg","epub","mp4","mp3","mpeg","wav","ogg","oga","opus","m4a","aac","flac","weba",...br]})),Se=vt((()=>{kr(),Ce(),Pr()})),ea,Ir,Dn,Rn,kn,In,Mn,On,Bn,Mr,Nn,qe=vt((()=>{Ke(),fe(),Ce(),ea=Object.freeze({downloading:"正在下载文件资源...",streamingPdf:"正在建立 PDF 流式预览...",reading:"正在解析文件内容..."}),Ir=Object.freeze({accent:"#5f6f82",soft:"rgba(95, 111, 130, 0.12)",badge:"DOC",label:"文件内容",hint:"正在整理内容结构并生成预览。"}),Dn=m=>{const C=$t(m);return C?`.${C}`:"当前"},Rn={"office-word-openxml":"@file-viewer/renderer-word","office-word-binary":"@file-viewer/renderer-word","office-presentation":"@file-viewer/renderer-presentation","open-document":"@file-viewer/renderer-word","spreadsheet-openxml":"@file-viewer/renderer-spreadsheet",pdf:"@file-viewer/renderer-pdf",ofd:"@file-viewer/renderer-ofd",typst:"@file-viewer/renderer-typst",archive:"@file-viewer/renderer-archive",email:"@file-viewer/renderer-email",eda:"@file-viewer/renderer-eda",cad:"@file-viewer/renderer-cad",model:"@file-viewer/renderer-3d",geo:"@file-viewer/renderer-geo",drawing:"@file-viewer/renderer-drawing",mindmap:"@file-viewer/renderer-mindmap",epub:"@file-viewer/renderer-epub",umd:"@file-viewer/renderer-epub",image:"@file-viewer/renderer-image",markdown:"@file-viewer/renderer-text",code:"@file-viewer/renderer-text",video:"@file-viewer/renderer-media",audio:"@file-viewer/renderer-media","data-asset":"@file-viewer/renderer-data"},kn=new Set(["office-word-openxml","office-word-binary","office-presentation","open-document","spreadsheet-openxml","pdf","ofd"]),In=new Set(["image","markdown","code","video","audio"]),Mn=new Set(["typst","archive","eda","cad","model","geo","drawing","mindmap","data-asset"]),On=m=>kn.has(m.id)?{packageName:"@file-viewer/preset-office",vitePreset:"office",label:"Office preset"}:Mn.has(m.id)?{packageName:"@file-viewer/preset-engineering",vitePreset:"engineering",label:"Engineering preset"}:In.has(m.id)?{packageName:"@file-viewer/preset-lite",vitePreset:"lite",label:"Lite preset"}:{packageName:"@file-viewer/preset-all",vitePreset:"all",label:"Full preset"},Bn=(m="")=>{const C=$t(m),d=ie.find(g=>g.extensions.map($t).includes(C));if(!d)return null;const f=On(d);return{extension:C,rendererId:d.id,rendererLabel:d.label,rendererCategory:d.category,rendererPackage:Rn[d.id],presetPackage:f.packageName,vitePreset:f.vitePreset,presetLabel:f.label}},Mr=({state:m,extension:C="",title:d,message:f,description:g,theme:y=Ir,recoverable:E})=>({state:m,extension:$t(C),title:d,message:f,description:g,theme:y,recoverable:E}),Nn=(m="",C=Ir,d)=>{const f=Dn(m),g=Bn(m);if(g){const y=Sr(d),E=g.rendererPackage?y==="zh-CN"?`;如果需要极致裁剪,也可以只安装 ${g.rendererPackage}`:`; for a strict custom cut, install only ${g.rendererPackage}`:"";return Mr({state:"unsupported",extension:m,title:de(d,"state.unsupported.install.title"),message:de(d,"state.unsupported.install.message",{extension:f,rendererLabel:g.rendererLabel}),description:de(d,"state.unsupported.install.description",{extension:f,rendererLabel:g.rendererLabel,presetPackage:g.presetPackage,vitePreset:g.vitePreset,rendererTip:E}),theme:C,recoverable:!0})}return Mr({state:"unsupported",extension:m,title:de(d,"state.unsupported.title"),message:de(d,"state.unsupported.message",{extension:f}),description:de(d,"state.unsupported.description"),theme:C,recoverable:!0})}})),Qe=vt((()=>{Se(),qe(),Ce()})),Fn,Or,Ln,Hn,Un,Br=vt((()=>{fe(),Rr(),Ze(),Qe(),Fn=(m,C)=>({rendered:m,destroy:()=>C?C():Or(m)}),Or=m=>{if(!m||typeof m!="object")return;const C=m;if(typeof C.unmount=="function")return C.unmount();if(typeof C.$destroy=="function")return C.$destroy();if(typeof C.destroy=="function")return C.destroy()},Ln=({source:m,options:C,registerExportAdapter:d,renderContext:f})=>({filename:m.filename,url:m.url,streamUrl:m.url,options:C,registerExportAdapter:d,...f}),Hn=({handler:m,getTarget:C=g=>g.surface.container,createContext:d=Ln,destroy:f})=>async g=>{const{source:y}=g;if(!y.buffer)throw new Error("FileRenderHandler renderer requires an ArrayBuffer source.");const E=C(g),h=await m(y.buffer,E,y.extension,d(g));return Fn(h,()=>f?f(h,g):Or(h))},Un=({definitions:m=ie,handlers:C,getTarget:d,createContext:f,destroy:g})=>{const y=Je(m),E=Dr({registry:y,handlers:C});return{registry:Je(y.list().map(h=>{const w=E.handlersByRendererId.get(h.id);return w?{...h,load:Hn({handler:w,getTarget:d,createContext:f,destroy:g})}:h})),dispatcher:E,missingRendererIds:E.missingRendererIds}}})),ra=_e({default:()=>na});async function na(m,C,d){const f=await Vn(m,d);let g=1,y=0;const E=Xe(),h=document.createElement("div");h.className="image-viewer",h.dataset.viewerZoomProvider="image";const w=document.createElement("div");w.className="image-stage";const A=document.createElement("img");A.alt="图片",A.src=f,w.append(A),h.append(w);const r=Yn(f),n=()=>r.open();A.addEventListener("click",n),document.body.append(r.element);const e=()=>{y=h.clientHeight||0,Nr(A,y,g),E.emit()},t=new ResizeObserver(e);t.observe(h);const p=()=>({scale:g,label:`${Math.round(g*100)}%`,canZoomIn:g<5,canZoomOut:g>.1,canReset:g!==1,minScale:.1,maxScale:5}),c=s=>(g=Xn(s),Nr(A,y,g),E.emit(),p());return $e(h,{zoomIn:()=>c(g+.15),zoomOut:()=>c(g-.15),resetZoom:()=>c(1),setZoom:c,getState:p,subscribe:E.subscribe}),C.replaceChildren(Wn(),h),e(),{$el:C,unmount(){Ve(h),t.disconnect(),A.removeEventListener("click",n),r.destroy(),C.replaceChildren()}}}var jn,Gn,Wn,zn,$n,Vn,Xn,Nr,Yn,ia=vt((()=>{Te(),Er(),jn={avif:"image/avif",bmp:"image/bmp",gif:"image/gif",heic:"image/heic",heif:"image/heif",ico:"image/x-icon",jxl:"image/jxl",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",svg:"image/svg+xml",tif:"image/tiff",tiff:"image/tiff",webp:"image/webp"},Gn=`
25
25
  .image-viewer{position:relative;width:100%;height:100%;overflow:auto;background:#eef1f4;box-sizing:border-box}
26
26
  .image-stage{min-width:100%;min-height:100%;display:flex;align-items:center;justify-content:center;padding:24px;box-sizing:border-box}
27
27
  .image-stage img{display:block;width:auto;max-width:none;margin:0 auto;border:0;box-shadow:0 18px 48px rgba(15,23,42,.16);background:#fff;cursor:zoom-in}
@@ -32,8 +32,8 @@
32
32
  .file-viewer[data-viewer-theme='dark'] .image-viewer{background:#101820}
33
33
  @media (prefers-color-scheme:dark){.file-viewer[data-viewer-theme='system'] .image-viewer{background:#101820}}
34
34
  @media (max-width:767px){.image-stage{padding:12px}.image-lightbox{padding:16px}.image-lightbox button{top:12px;right:12px}}
35
- `,Wn=()=>{const m=document.createElement("style");return m.textContent=Gn,m},zn=m=>jn[(m||"").trim().toLowerCase()]||"image/*",$n=async m=>await new Promise((C,d)=>{const f=new FileReader;f.onload=g=>{var y;const E=(y=g.target)===null||y===void 0?void 0:y.result;if(typeof E=="string"){C(E);return}d(new Error("Unable to read image data URL."))},f.onerror=()=>d(f.error||new Error("Unable to read image data URL.")),f.readAsDataURL(m)}),Vn=async(m,C)=>{const d=(C||"").trim().toLowerCase();if(d==="heic"||d==="heif")throw new Error("HEIC/HEIF image conversion has moved out of @file-viewer/core. Install and pass @file-viewer/renderer-image, or use @file-viewer/preset-all.");return $n(new Blob([m],{type:zn(d)}))},Xn=m=>Math.min(5,Math.max(.1,Number(m.toFixed(2)))),Nr=(m,C,d)=>{if(C>0){m.style.height=`${Math.max(1,Math.round(C*d))}px`;return}m.style.height=`${d*100}%`},Yn=m=>{const C=document.createElement("div");C.className="image-lightbox",C.hidden=!0,C.setAttribute("role","dialog"),C.setAttribute("aria-modal","true");const d=document.createElement("img");d.alt="Preview image",d.src=m;const f=document.createElement("button");f.type="button",f.setAttribute("aria-label","Close image preview"),f.textContent="x";const g=()=>{C.hidden=!0};return f.addEventListener("click",g),d.addEventListener("click",g),C.addEventListener("click",y=>{y.target===C&&g()}),C.append(d,f),{element:C,open(){C.hidden=!1},destroy(){f.removeEventListener("click",g),d.removeEventListener("click",g),C.remove()}}}})),Kn,tr,Fr,Jn,Zn,qn,Qn,ti,ei,er,ra,na,ia,ri=vt((()=>{fe(),Br(),Rr(),qe(),Kn=m=>({$el:m,unmount(){}}),tr=[{rendererId:"image",handler:async(m,C,d)=>{const{default:f}=await Promise.resolve().then(()=>(ea(),Qo));return f(m,C,d)}}],Fr=["image"],Jn=tr.filter(m=>Fr.includes(m.rendererId)),Zn=ie.filter(m=>Fr.includes(m.id)),qn=m=>m==="none"?[]:m==="lite"?Zn:ie,Qn=m=>m==="none"?[]:m==="lite"?Jn:tr,ti=async(m,C,d)=>{const f=Nn(d),g=document.createElement("div");g.style.textAlign="center",g.style.marginTop="80px";const y=document.createElement("div");if(y.textContent=f.message,g.appendChild(y),f.description){const E=document.createElement("div");E.textContent=f.description,g.appendChild(E)}return C.replaceChildren(g),Kn(C)},ei=(m={})=>{const C=m.builtinRenderers||"all",d=Un({definitions:qn(C),handlers:Qn(C)});return{...d,dispatcher:Dr({registry:d.registry,handlers:tr,fallbackHandler:ti})}},er=ei(),ra=er.registry,na=er.dispatcher,ia=er.missingRendererIds})),oa=vt((()=>{be()})),aa=vt((()=>{xe(),Qe()})),sa=vt((()=>{xe()})),la=vt((()=>{Cn(),Er(),Pr(),kr(),xe(),Ze(),Br(),ri(),Qe(),qe()})),Lr=vt((()=>{An(),fe(),bn(),Cn(),Er(),_e(),Xo(),Pr(),be(),Ze(),ri(),kr(),xe(),oa(),aa(),sa(),Rr(),Br(),Ke(),qe(),Qe(),la()})),Hr=We(((m,C)=>{(function(d){typeof m=="object"&&typeof C<"u"?C.exports=d():typeof define=="function"&&define.amd?define([],d):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).JSZip=d()})(function(){return(function d(f,g,y){function E(A,r){if(!g[A]){if(!f[A]){var n=typeof require=="function"&&require;if(!r&&n)return n(A,!0);if(h)return h(A,!0);var e=new Error("Cannot find module '"+A+"'");throw e.code="MODULE_NOT_FOUND",e}var t=g[A]={exports:{}};f[A][0].call(t.exports,function(p){var c=f[A][1][p];return E(c||p)},t,t.exports,d,f,g,y)}return g[A].exports}for(var h=typeof require=="function"&&require,w=0;w<y.length;w++)E(y[w]);return E})({1:[function(d,f,g){"use strict";var y=d("./utils"),E=d("./support"),h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";g.encode=function(w){for(var A,r,n,e,t,p,c,s=[],l=0,u=w.length,o=u,i=y.getTypeOf(w)!=="string";l<w.length;)o=u-l,n=i?(A=w[l++],r=l<u?w[l++]:0,l<u?w[l++]:0):(A=w.charCodeAt(l++),r=l<u?w.charCodeAt(l++):0,l<u?w.charCodeAt(l++):0),e=A>>2,t=(3&A)<<4|r>>4,p=1<o?(15&r)<<2|n>>6:64,c=2<o?63&n:64,s.push(h.charAt(e)+h.charAt(t)+h.charAt(p)+h.charAt(c));return s.join("")},g.decode=function(w){var A,r,n,e,t,p,c=0,s=0,l="data:";if(w.substr(0,l.length)===l)throw new Error("Invalid base64 input, it looks like a data url.");var u,o=3*(w=w.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(w.charAt(w.length-1)===h.charAt(64)&&o--,w.charAt(w.length-2)===h.charAt(64)&&o--,o%1!=0)throw new Error("Invalid base64 input, bad content length.");for(u=E.uint8array?new Uint8Array(0|o):new Array(0|o);c<w.length;)A=h.indexOf(w.charAt(c++))<<2|(e=h.indexOf(w.charAt(c++)))>>4,r=(15&e)<<4|(t=h.indexOf(w.charAt(c++)))>>2,n=(3&t)<<6|(p=h.indexOf(w.charAt(c++))),u[s++]=A,t!==64&&(u[s++]=r),p!==64&&(u[s++]=n);return u}},{"./support":30,"./utils":32}],2:[function(d,f,g){"use strict";var y=d("./external"),E=d("./stream/DataWorker"),h=d("./stream/Crc32Probe"),w=d("./stream/DataLengthProbe");function A(r,n,e,t,p){this.compressedSize=r,this.uncompressedSize=n,this.crc32=e,this.compression=t,this.compressedContent=p}A.prototype={getContentWorker:function(){var r=new E(y.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new w("data_length")),n=this;return r.on("end",function(){if(this.streamInfo.data_length!==n.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),r},getCompressedWorker:function(){return new E(y.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},A.createWorkerFrom=function(r,n,e){return r.pipe(new h).pipe(new w("uncompressedSize")).pipe(n.compressWorker(e)).pipe(new w("compressedSize")).withStreamInfo("compression",n)},f.exports=A},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(d,f,g){"use strict";var y=d("./stream/GenericWorker");g.STORE={magic:"\0\0",compressWorker:function(){return new y("STORE compression")},uncompressWorker:function(){return new y("STORE decompression")}},g.DEFLATE=d("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(d,f,g){"use strict";var y=d("./utils"),E=(function(){for(var h,w=[],A=0;A<256;A++){h=A;for(var r=0;r<8;r++)h=1&h?3988292384^h>>>1:h>>>1;w[A]=h}return w})();f.exports=function(h,w){return h!==void 0&&h.length?y.getTypeOf(h)!=="string"?(function(A,r,n,e){var t=E,p=e+n;A^=-1;for(var c=e;c<p;c++)A=A>>>8^t[255&(A^r[c])];return-1^A})(0|w,h,h.length,0):(function(A,r,n,e){var t=E,p=e+n;A^=-1;for(var c=e;c<p;c++)A=A>>>8^t[255&(A^r.charCodeAt(c))];return-1^A})(0|w,h,h.length,0):0}},{"./utils":32}],5:[function(d,f,g){"use strict";g.base64=!1,g.binary=!1,g.dir=!1,g.createFolders=!0,g.date=null,g.compression=null,g.compressionOptions=null,g.comment=null,g.unixPermissions=null,g.dosPermissions=null},{}],6:[function(d,f,g){"use strict";var y=null;y=typeof Promise<"u"?Promise:d("lie"),f.exports={Promise:y}},{lie:37}],7:[function(d,f,g){"use strict";var y=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",E=d("pako"),h=d("./utils"),w=d("./stream/GenericWorker"),A=y?"uint8array":"array";function r(n,e){w.call(this,"FlateWorker/"+n),this._pako=null,this._pakoAction=n,this._pakoOptions=e,this.meta={}}g.magic="\b\0",h.inherits(r,w),r.prototype.processChunk=function(n){this.meta=n.meta,this._pako===null&&this._createPako(),this._pako.push(h.transformTo(A,n.data),!1)},r.prototype.flush=function(){w.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},r.prototype.cleanUp=function(){w.prototype.cleanUp.call(this),this._pako=null},r.prototype._createPako=function(){this._pako=new E[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var n=this;this._pako.onData=function(e){n.push({data:e,meta:n.meta})}},g.compressWorker=function(n){return new r("Deflate",n)},g.uncompressWorker=function(){return new r("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(d,f,g){"use strict";function y(t,p){var c,s="";for(c=0;c<p;c++)s+=String.fromCharCode(255&t),t>>>=8;return s}function E(t,p,c,s,l,u){var o,i,a=t.file,b=t.compression,v=u!==A.utf8encode,_=h.transformTo("string",u(a.name)),T=h.transformTo("string",A.utf8encode(a.name)),k=a.comment,M=h.transformTo("string",u(k)),R=h.transformTo("string",A.utf8encode(k)),O=T.length!==a.name.length,P=R.length!==k.length,N="",it="",J="",ot=a.dir,tt=a.date,ht={crc32:0,compressedSize:0,uncompressedSize:0};p&&!c||(ht.crc32=t.crc32,ht.compressedSize=t.compressedSize,ht.uncompressedSize=t.uncompressedSize);var W=0;p&&(W|=8),v||!O&&!P||(W|=2048);var G=0,gt=0;ot&&(G|=16),l==="UNIX"?(gt=798,G|=(function(j,U){var at=j;return j||(at=U?16893:33204),(65535&at)<<16})(a.unixPermissions,ot)):(gt=20,G|=(function(j){return 63&(j||0)})(a.dosPermissions)),o=tt.getUTCHours(),o<<=6,o|=tt.getUTCMinutes(),o<<=5,o|=tt.getUTCSeconds()/2,i=tt.getUTCFullYear()-1980,i<<=4,i|=tt.getUTCMonth()+1,i<<=5,i|=tt.getUTCDate(),O&&(it=y(1,1)+y(r(_),4)+T,N+="up"+y(it.length,2)+it),P&&(J=y(1,1)+y(r(M),4)+R,N+="uc"+y(J.length,2)+J);var nt="";return nt+=`
36
- \0`,nt+=y(W,2),nt+=b.magic,nt+=y(o,2),nt+=y(i,2),nt+=y(ht.crc32,4),nt+=y(ht.compressedSize,4),nt+=y(ht.uncompressedSize,4),nt+=y(_.length,2),nt+=y(N.length,2),{fileRecord:n.LOCAL_FILE_HEADER+nt+_+N,dirRecord:n.CENTRAL_FILE_HEADER+y(gt,2)+nt+y(M.length,2)+"\0\0\0\0"+y(G,4)+y(s,4)+_+N+M}}var h=d("../utils"),w=d("../stream/GenericWorker"),A=d("../utf8"),r=d("../crc32"),n=d("../signature");function e(t,p,c,s){w.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=c,this.encodeFileName=s,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}h.inherits(e,w),e.prototype.push=function(t){var p=t.meta.percent||0,c=this.entriesCount,s=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,w.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:c?(p+100*(c-s-1))/c:100}}))},e.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var p=this.streamFiles&&!t.file.dir;if(p){var c=E(t,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:c.fileRecord,meta:{percent:0}})}else this.accumulate=!0},e.prototype.closedSource=function(t){this.accumulate=!1;var p=this.streamFiles&&!t.file.dir,c=E(t,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(c.dirRecord),p)this.push({data:(function(s){return n.DATA_DESCRIPTOR+y(s.crc32,4)+y(s.compressedSize,4)+y(s.uncompressedSize,4)})(t),meta:{percent:100}});else for(this.push({data:c.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},e.prototype.flush=function(){for(var t=this.bytesWritten,p=0;p<this.dirRecords.length;p++)this.push({data:this.dirRecords[p],meta:{percent:100}});var c=this.bytesWritten-t,s=(function(l,u,o,i,a){var b=h.transformTo("string",a(i));return n.CENTRAL_DIRECTORY_END+"\0\0\0\0"+y(l,2)+y(l,2)+y(u,4)+y(o,4)+y(b.length,2)+b})(this.dirRecords.length,c,t,this.zipComment,this.encodeFileName);this.push({data:s,meta:{percent:100}})},e.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},e.prototype.registerPrevious=function(t){this._sources.push(t);var p=this;return t.on("data",function(c){p.processChunk(c)}),t.on("end",function(){p.closedSource(p.previous.streamInfo),p._sources.length?p.prepareNextSource():p.end()}),t.on("error",function(c){p.error(c)}),this},e.prototype.resume=function(){return!!w.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},e.prototype.error=function(t){var p=this._sources;if(!w.prototype.error.call(this,t))return!1;for(var c=0;c<p.length;c++)try{p[c].error(t)}catch{}return!0},e.prototype.lock=function(){w.prototype.lock.call(this);for(var t=this._sources,p=0;p<t.length;p++)t[p].lock()},f.exports=e},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(d,f,g){"use strict";var y=d("../compressions"),E=d("./ZipFileWorker");g.generateWorker=function(h,w,A){var r=new E(w.streamFiles,A,w.platform,w.encodeFileName),n=0;try{h.forEach(function(e,t){n++;var p=(function(u,o){var i=u||o,a=y[i];if(!a)throw new Error(i+" is not a valid compression method !");return a})(t.options.compression,w.compression),c=t.options.compressionOptions||w.compressionOptions||{},s=t.dir,l=t.date;t._compressWorker(p,c).withStreamInfo("file",{name:e,dir:s,date:l,comment:t.comment||"",unixPermissions:t.unixPermissions,dosPermissions:t.dosPermissions}).pipe(r)}),r.entriesCount=n}catch(e){r.error(e)}return r}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(d,f,g){"use strict";function y(){if(!(this instanceof y))return new y;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var E=new y;for(var h in this)typeof this[h]!="function"&&(E[h]=this[h]);return E}}(y.prototype=d("./object")).loadAsync=d("./load"),y.support=d("./support"),y.defaults=d("./defaults"),y.version="3.10.1",y.loadAsync=function(E,h){return new y().loadAsync(E,h)},y.external=d("./external"),f.exports=y},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(d,f,g){"use strict";var y=d("./utils"),E=d("./external"),h=d("./utf8"),w=d("./zipEntries"),A=d("./stream/Crc32Probe"),r=d("./nodejsUtils");function n(e){return new E.Promise(function(t,p){var c=e.decompressed.getContentWorker().pipe(new A);c.on("error",function(s){p(s)}).on("end",function(){c.streamInfo.crc32!==e.decompressed.crc32?p(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}f.exports=function(e,t){var p=this;return t=y.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:h.utf8decode}),r.isNode&&r.isStream(e)?E.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):y.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(c){var s=new w(t);return s.load(c),s}).then(function(c){var s=[E.Promise.resolve(c)],l=c.files;if(t.checkCRC32)for(var u=0;u<l.length;u++)s.push(n(l[u]));return E.Promise.all(s)}).then(function(c){for(var s=c.shift(),l=s.files,u=0;u<l.length;u++){var o=l[u],i=o.fileNameStr,a=y.resolve(o.fileNameStr);p.file(a,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:t.createFolders}),o.dir||(p.file(a).unsafeOriginalName=i)}return s.zipComment.length&&(p.comment=s.zipComment),p})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(d,f,g){"use strict";var y=d("../utils"),E=d("../stream/GenericWorker");function h(w,A){E.call(this,"Nodejs stream input adapter for "+w),this._upstreamEnded=!1,this._bindStream(A)}y.inherits(h,E),h.prototype._bindStream=function(w){var A=this;(this._stream=w).pause(),w.on("data",function(r){A.push({data:r,meta:{percent:0}})}).on("error",function(r){A.isPaused?this.generatedError=r:A.error(r)}).on("end",function(){A.isPaused?A._upstreamEnded=!0:A.end()})},h.prototype.pause=function(){return!!E.prototype.pause.call(this)&&(this._stream.pause(),!0)},h.prototype.resume=function(){return!!E.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},f.exports=h},{"../stream/GenericWorker":28,"../utils":32}],13:[function(d,f,g){"use strict";var y=d("readable-stream").Readable;function E(h,w,A){y.call(this,w),this._helper=h;var r=this;h.on("data",function(n,e){r.push(n)||r._helper.pause(),A&&A(e)}).on("error",function(n){r.emit("error",n)}).on("end",function(){r.push(null)})}d("../utils").inherits(E,y),E.prototype._read=function(){this._helper.resume()},f.exports=E},{"../utils":32,"readable-stream":16}],14:[function(d,f,g){"use strict";f.exports={isNode:typeof Buffer<"u",newBufferFrom:function(y,E){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(y,E);if(typeof y=="number")throw new Error('The "data" argument must not be a number');return new Buffer(y,E)},allocBuffer:function(y){if(Buffer.alloc)return Buffer.alloc(y);var E=new Buffer(y);return E.fill(0),E},isBuffer:function(y){return Buffer.isBuffer(y)},isStream:function(y){return y&&typeof y.on=="function"&&typeof y.pause=="function"&&typeof y.resume=="function"}}},{}],15:[function(d,f,g){"use strict";function y(i,a,b){var v,_=h.getTypeOf(a),T=h.extend(b||{},r);T.date=T.date||new Date,T.compression!==null&&(T.compression=T.compression.toUpperCase()),typeof T.unixPermissions=="string"&&(T.unixPermissions=parseInt(T.unixPermissions,8)),T.unixPermissions&&16384&T.unixPermissions&&(T.dir=!0),T.dosPermissions&&16&T.dosPermissions&&(T.dir=!0),T.dir&&(i=l(i)),T.createFolders&&(v=s(i))&&u.call(this,v,!0);var k=_==="string"&&T.binary===!1&&T.base64===!1;b&&b.binary!==void 0||(T.binary=!k),(a instanceof n&&a.uncompressedSize===0||T.dir||!a||a.length===0)&&(T.base64=!1,T.binary=!0,a="",T.compression="STORE",_="string");var M=null;M=a instanceof n||a instanceof w?a:p.isNode&&p.isStream(a)?new c(i,a):h.prepareContent(i,a,T.binary,T.optimizedBinaryString,T.base64);var R=new e(i,M,T);this.files[i]=R}var E=d("./utf8"),h=d("./utils"),w=d("./stream/GenericWorker"),A=d("./stream/StreamHelper"),r=d("./defaults"),n=d("./compressedObject"),e=d("./zipObject"),t=d("./generate"),p=d("./nodejsUtils"),c=d("./nodejs/NodejsStreamInputAdapter"),s=function(i){i.slice(-1)==="/"&&(i=i.substring(0,i.length-1));var a=i.lastIndexOf("/");return 0<a?i.substring(0,a):""},l=function(i){return i.slice(-1)!=="/"&&(i+="/"),i},u=function(i,a){return a=a!==void 0?a:r.createFolders,i=l(i),this.files[i]||y.call(this,i,null,{dir:!0,createFolders:a}),this.files[i]};function o(i){return Object.prototype.toString.call(i)==="[object RegExp]"}f.exports={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(i){var a,b,v;for(a in this.files)v=this.files[a],(b=a.slice(this.root.length,a.length))&&a.slice(0,this.root.length)===this.root&&i(b,v)},filter:function(i){var a=[];return this.forEach(function(b,v){i(b,v)&&a.push(v)}),a},file:function(i,a,b){if(arguments.length!==1)return i=this.root+i,y.call(this,i,a,b),this;if(o(i)){var v=i;return this.filter(function(T,k){return!k.dir&&v.test(T)})}var _=this.files[this.root+i];return _&&!_.dir?_:null},folder:function(i){if(!i)return this;if(o(i))return this.filter(function(_,T){return T.dir&&i.test(_)});var a=this.root+i,b=u.call(this,a),v=this.clone();return v.root=b.name,v},remove:function(i){i=this.root+i;var a=this.files[i];if(a||(i.slice(-1)!=="/"&&(i+="/"),a=this.files[i]),a&&!a.dir)delete this.files[i];else for(var b=this.filter(function(_,T){return T.name.slice(0,i.length)===i}),v=0;v<b.length;v++)delete this.files[b[v].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(i){var a,b={};try{if((b=h.extend(i||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:E.utf8encode})).type=b.type.toLowerCase(),b.compression=b.compression.toUpperCase(),b.type==="binarystring"&&(b.type="string"),!b.type)throw new Error("No output type specified.");h.checkSupport(b.type),b.platform!=="darwin"&&b.platform!=="freebsd"&&b.platform!=="linux"&&b.platform!=="sunos"||(b.platform="UNIX"),b.platform==="win32"&&(b.platform="DOS");var v=b.comment||this.comment||"";a=t.generateWorker(this,b,v)}catch(_){(a=new w("error")).error(_)}return new A(a,b.type||"string",b.mimeType)},generateAsync:function(i,a){return this.generateInternalStream(i).accumulate(a)},generateNodeStream:function(i,a){return(i=i||{}).type||(i.type="nodebuffer"),this.generateInternalStream(i).toNodejsStream(a)}}},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(d,f,g){"use strict";f.exports=d("stream")},{stream:void 0}],17:[function(d,f,g){"use strict";var y=d("./DataReader");function E(h){y.call(this,h);for(var w=0;w<this.data.length;w++)h[w]=255&h[w]}d("../utils").inherits(E,y),E.prototype.byteAt=function(h){return this.data[this.zero+h]},E.prototype.lastIndexOfSignature=function(h){for(var w=h.charCodeAt(0),A=h.charCodeAt(1),r=h.charCodeAt(2),n=h.charCodeAt(3),e=this.length-4;0<=e;--e)if(this.data[e]===w&&this.data[e+1]===A&&this.data[e+2]===r&&this.data[e+3]===n)return e-this.zero;return-1},E.prototype.readAndCheckSignature=function(h){var w=h.charCodeAt(0),A=h.charCodeAt(1),r=h.charCodeAt(2),n=h.charCodeAt(3),e=this.readData(4);return w===e[0]&&A===e[1]&&r===e[2]&&n===e[3]},E.prototype.readData=function(h){if(this.checkOffset(h),h===0)return[];var w=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,w},f.exports=E},{"../utils":32,"./DataReader":18}],18:[function(d,f,g){"use strict";var y=d("../utils");function E(h){this.data=h,this.length=h.length,this.index=0,this.zero=0}E.prototype={checkOffset:function(h){this.checkIndex(this.index+h)},checkIndex:function(h){if(this.length<this.zero+h||h<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+h+"). Corrupted zip ?")},setIndex:function(h){this.checkIndex(h),this.index=h},skip:function(h){this.setIndex(this.index+h)},byteAt:function(){},readInt:function(h){var w,A=0;for(this.checkOffset(h),w=this.index+h-1;w>=this.index;w--)A=(A<<8)+this.byteAt(w);return this.index+=h,A},readString:function(h){return y.transformTo("string",this.readData(h))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var h=this.readInt(4);return new Date(Date.UTC(1980+(h>>25&127),(h>>21&15)-1,h>>16&31,h>>11&31,h>>5&63,(31&h)<<1))}},f.exports=E},{"../utils":32}],19:[function(d,f,g){"use strict";var y=d("./Uint8ArrayReader");function E(h){y.call(this,h)}d("../utils").inherits(E,y),E.prototype.readData=function(h){this.checkOffset(h);var w=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,w},f.exports=E},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(d,f,g){"use strict";var y=d("./DataReader");function E(h){y.call(this,h)}d("../utils").inherits(E,y),E.prototype.byteAt=function(h){return this.data.charCodeAt(this.zero+h)},E.prototype.lastIndexOfSignature=function(h){return this.data.lastIndexOf(h)-this.zero},E.prototype.readAndCheckSignature=function(h){return h===this.readData(4)},E.prototype.readData=function(h){this.checkOffset(h);var w=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,w},f.exports=E},{"../utils":32,"./DataReader":18}],21:[function(d,f,g){"use strict";var y=d("./ArrayReader");function E(h){y.call(this,h)}d("../utils").inherits(E,y),E.prototype.readData=function(h){if(this.checkOffset(h),h===0)return new Uint8Array(0);var w=this.data.subarray(this.zero+this.index,this.zero+this.index+h);return this.index+=h,w},f.exports=E},{"../utils":32,"./ArrayReader":17}],22:[function(d,f,g){"use strict";var y=d("../utils"),E=d("../support"),h=d("./ArrayReader"),w=d("./StringReader"),A=d("./NodeBufferReader"),r=d("./Uint8ArrayReader");f.exports=function(n){var e=y.getTypeOf(n);return y.checkSupport(e),e!=="string"||E.uint8array?e==="nodebuffer"?new A(n):E.uint8array?new r(y.transformTo("uint8array",n)):new h(y.transformTo("array",n)):new w(n)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(d,f,g){"use strict";g.LOCAL_FILE_HEADER="PK",g.CENTRAL_FILE_HEADER="PK",g.CENTRAL_DIRECTORY_END="PK",g.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",g.ZIP64_CENTRAL_DIRECTORY_END="PK",g.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(d,f,g){"use strict";var y=d("./GenericWorker"),E=d("../utils");function h(w){y.call(this,"ConvertWorker to "+w),this.destType=w}E.inherits(h,y),h.prototype.processChunk=function(w){this.push({data:E.transformTo(this.destType,w.data),meta:w.meta})},f.exports=h},{"../utils":32,"./GenericWorker":28}],25:[function(d,f,g){"use strict";var y=d("./GenericWorker"),E=d("../crc32");function h(){y.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}d("../utils").inherits(h,y),h.prototype.processChunk=function(w){this.streamInfo.crc32=E(w.data,this.streamInfo.crc32||0),this.push(w)},f.exports=h},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(d,f,g){"use strict";var y=d("../utils"),E=d("./GenericWorker");function h(w){E.call(this,"DataLengthProbe for "+w),this.propName=w,this.withStreamInfo(w,0)}y.inherits(h,E),h.prototype.processChunk=function(w){if(w){var A=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=A+w.data.length}E.prototype.processChunk.call(this,w)},f.exports=h},{"../utils":32,"./GenericWorker":28}],27:[function(d,f,g){"use strict";var y=d("../utils"),E=d("./GenericWorker");function h(w){E.call(this,"DataWorker");var A=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,w.then(function(r){A.dataIsReady=!0,A.data=r,A.max=r&&r.length||0,A.type=y.getTypeOf(r),A.isPaused||A._tickAndRepeat()},function(r){A.error(r)})}y.inherits(h,E),h.prototype.cleanUp=function(){E.prototype.cleanUp.call(this),this.data=null},h.prototype.resume=function(){return!!E.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,y.delay(this._tickAndRepeat,[],this)),!0)},h.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(y.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},h.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var w=null,A=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":w=this.data.substring(this.index,A);break;case"uint8array":w=this.data.subarray(this.index,A);break;case"array":case"nodebuffer":w=this.data.slice(this.index,A)}return this.index=A,this.push({data:w,meta:{percent:this.max?this.index/this.max*100:0}})},f.exports=h},{"../utils":32,"./GenericWorker":28}],28:[function(d,f,g){"use strict";function y(E){this.name=E||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}y.prototype={push:function(E){this.emit("data",E)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(E){this.emit("error",E)}return!0},error:function(E){return!this.isFinished&&(this.isPaused?this.generatedError=E:(this.isFinished=!0,this.emit("error",E),this.previous&&this.previous.error(E),this.cleanUp()),!0)},on:function(E,h){return this._listeners[E].push(h),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(E,h){if(this._listeners[E])for(var w=0;w<this._listeners[E].length;w++)this._listeners[E][w].call(this,h)},pipe:function(E){return E.registerPrevious(this)},registerPrevious:function(E){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=E.streamInfo,this.mergeStreamInfo(),this.previous=E;var h=this;return E.on("data",function(w){h.processChunk(w)}),E.on("end",function(){h.end()}),E.on("error",function(w){h.error(w)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var E=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),E=!0),this.previous&&this.previous.resume(),!E},flush:function(){},processChunk:function(E){this.push(E)},withStreamInfo:function(E,h){return this.extraStreamInfo[E]=h,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var E in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,E)&&(this.streamInfo[E]=this.extraStreamInfo[E])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var E="Worker "+this.name;return this.previous?this.previous+" -> "+E:E}},f.exports=y},{}],29:[function(d,f,g){"use strict";var y=d("../utils"),E=d("./ConvertWorker"),h=d("./GenericWorker"),w=d("../base64"),A=d("../support"),r=d("../external"),n=null;if(A.nodestream)try{n=d("../nodejs/NodejsStreamOutputAdapter")}catch{}function e(p,c){return new r.Promise(function(s,l){var u=[],o=p._internalType,i=p._outputType,a=p._mimeType;p.on("data",function(b,v){u.push(b),c&&c(v)}).on("error",function(b){u=[],l(b)}).on("end",function(){try{s((function(b,v,_){switch(b){case"blob":return y.newBlob(y.transformTo("arraybuffer",v),_);case"base64":return w.encode(v);default:return y.transformTo(b,v)}})(i,(function(b,v){var _,T=0,k=null,M=0;for(_=0;_<v.length;_++)M+=v[_].length;switch(b){case"string":return v.join("");case"array":return Array.prototype.concat.apply([],v);case"uint8array":for(k=new Uint8Array(M),_=0;_<v.length;_++)k.set(v[_],T),T+=v[_].length;return k;case"nodebuffer":return Buffer.concat(v);default:throw new Error("concat : unsupported type '"+b+"'")}})(o,u),a))}catch(b){l(b)}u=[]}).resume()})}function t(p,c,s){var l=c;switch(c){case"blob":case"arraybuffer":l="uint8array";break;case"base64":l="string"}try{this._internalType=l,this._outputType=c,this._mimeType=s,y.checkSupport(l),this._worker=p.pipe(new E(l)),p.lock()}catch(u){this._worker=new h("error"),this._worker.error(u)}}t.prototype={accumulate:function(p){return e(this,p)},on:function(p,c){var s=this;return p==="data"?this._worker.on(p,function(l){c.call(s,l.data,l.meta)}):this._worker.on(p,function(){y.delay(c,arguments,s)}),this},resume:function(){return y.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(p){if(y.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new n(this,{objectMode:this._outputType!=="nodebuffer"},p)}},f.exports=t},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(d,f,g){"use strict";if(g.base64=!0,g.array=!0,g.string=!0,g.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",g.nodebuffer=typeof Buffer<"u",g.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")g.blob=!1;else{var y=new ArrayBuffer(0);try{g.blob=new Blob([y],{type:"application/zip"}).size===0}catch{try{var E=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);E.append(y),g.blob=E.getBlob("application/zip").size===0}catch{g.blob=!1}}}try{g.nodestream=!!d("readable-stream").Readable}catch{g.nodestream=!1}},{"readable-stream":16}],31:[function(d,f,g){"use strict";for(var y=d("./utils"),E=d("./support"),h=d("./nodejsUtils"),w=d("./stream/GenericWorker"),A=new Array(256),r=0;r<256;r++)A[r]=252<=r?6:248<=r?5:240<=r?4:224<=r?3:192<=r?2:1;A[254]=A[254]=1;function n(){w.call(this,"utf-8 decode"),this.leftOver=null}function e(){w.call(this,"utf-8 encode")}g.utf8encode=function(t){return E.nodebuffer?h.newBufferFrom(t,"utf-8"):(function(p){var c,s,l,u,o,i=p.length,a=0;for(u=0;u<i;u++)(64512&(s=p.charCodeAt(u)))==55296&&u+1<i&&(64512&(l=p.charCodeAt(u+1)))==56320&&(s=65536+(s-55296<<10)+(l-56320),u++),a+=s<128?1:s<2048?2:s<65536?3:4;for(c=E.uint8array?new Uint8Array(a):new Array(a),u=o=0;o<a;u++)(64512&(s=p.charCodeAt(u)))==55296&&u+1<i&&(64512&(l=p.charCodeAt(u+1)))==56320&&(s=65536+(s-55296<<10)+(l-56320),u++),s<128?c[o++]=s:(s<2048?c[o++]=192|s>>>6:(s<65536?c[o++]=224|s>>>12:(c[o++]=240|s>>>18,c[o++]=128|s>>>12&63),c[o++]=128|s>>>6&63),c[o++]=128|63&s);return c})(t)},g.utf8decode=function(t){return E.nodebuffer?y.transformTo("nodebuffer",t).toString("utf-8"):(function(p){var c,s,l,u,o=p.length,i=new Array(2*o);for(c=s=0;c<o;)if((l=p[c++])<128)i[s++]=l;else if(4<(u=A[l]))i[s++]=65533,c+=u-1;else{for(l&=u===2?31:u===3?15:7;1<u&&c<o;)l=l<<6|63&p[c++],u--;1<u?i[s++]=65533:l<65536?i[s++]=l:(l-=65536,i[s++]=55296|l>>10&1023,i[s++]=56320|1023&l)}return i.length!==s&&(i.subarray?i=i.subarray(0,s):i.length=s),y.applyFromCharCode(i)})(t=y.transformTo(E.uint8array?"uint8array":"array",t))},y.inherits(n,w),n.prototype.processChunk=function(t){var p=y.transformTo(E.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(E.uint8array){var c=p;(p=new Uint8Array(c.length+this.leftOver.length)).set(this.leftOver,0),p.set(c,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var s=(function(u,o){var i;for((o=o||u.length)>u.length&&(o=u.length),i=o-1;0<=i&&(192&u[i])==128;)i--;return i<0||i===0?o:i+A[u[i]]>o?i:o})(p),l=p;s!==p.length&&(E.uint8array?(l=p.subarray(0,s),this.leftOver=p.subarray(s,p.length)):(l=p.slice(0,s),this.leftOver=p.slice(s,p.length))),this.push({data:g.utf8decode(l),meta:t.meta})},n.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:g.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},g.Utf8DecodeWorker=n,y.inherits(e,w),e.prototype.processChunk=function(t){this.push({data:g.utf8encode(t.data),meta:t.meta})},g.Utf8EncodeWorker=e},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(d,f,g){"use strict";var y=d("./support"),E=d("./base64"),h=d("./nodejsUtils"),w=d("./external");function A(c){return c}function r(c,s){for(var l=0;l<c.length;++l)s[l]=255&c.charCodeAt(l);return s}d("setimmediate"),g.newBlob=function(c,s){g.checkSupport("blob");try{return new Blob([c],{type:s})}catch{try{var l=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return l.append(c),l.getBlob(s)}catch{throw new Error("Bug : can't construct the Blob.")}}};var n={stringifyByChunk:function(c,s,l){var u=[],o=0,i=c.length;if(i<=l)return String.fromCharCode.apply(null,c);for(;o<i;)s==="array"||s==="nodebuffer"?u.push(String.fromCharCode.apply(null,c.slice(o,Math.min(o+l,i)))):u.push(String.fromCharCode.apply(null,c.subarray(o,Math.min(o+l,i)))),o+=l;return u.join("")},stringifyByChar:function(c){for(var s="",l=0;l<c.length;l++)s+=String.fromCharCode(c[l]);return s},applyCanBeUsed:{uint8array:(function(){try{return y.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return y.nodebuffer&&String.fromCharCode.apply(null,h.allocBuffer(1)).length===1}catch{return!1}})()}};function e(c){var s=65536,l=g.getTypeOf(c),u=!0;if(l==="uint8array"?u=n.applyCanBeUsed.uint8array:l==="nodebuffer"&&(u=n.applyCanBeUsed.nodebuffer),u)for(;1<s;)try{return n.stringifyByChunk(c,l,s)}catch{s=Math.floor(s/2)}return n.stringifyByChar(c)}function t(c,s){for(var l=0;l<c.length;l++)s[l]=c[l];return s}g.applyFromCharCode=e;var p={};p.string={string:A,array:function(c){return r(c,new Array(c.length))},arraybuffer:function(c){return p.string.uint8array(c).buffer},uint8array:function(c){return r(c,new Uint8Array(c.length))},nodebuffer:function(c){return r(c,h.allocBuffer(c.length))}},p.array={string:e,array:A,arraybuffer:function(c){return new Uint8Array(c).buffer},uint8array:function(c){return new Uint8Array(c)},nodebuffer:function(c){return h.newBufferFrom(c)}},p.arraybuffer={string:function(c){return e(new Uint8Array(c))},array:function(c){return t(new Uint8Array(c),new Array(c.byteLength))},arraybuffer:A,uint8array:function(c){return new Uint8Array(c)},nodebuffer:function(c){return h.newBufferFrom(new Uint8Array(c))}},p.uint8array={string:e,array:function(c){return t(c,new Array(c.length))},arraybuffer:function(c){return c.buffer},uint8array:A,nodebuffer:function(c){return h.newBufferFrom(c)}},p.nodebuffer={string:e,array:function(c){return t(c,new Array(c.length))},arraybuffer:function(c){return p.nodebuffer.uint8array(c).buffer},uint8array:function(c){return t(c,new Uint8Array(c.length))},nodebuffer:A},g.transformTo=function(c,s){return s=s||"",c?(g.checkSupport(c),p[g.getTypeOf(s)][c](s)):s},g.resolve=function(c){for(var s=c.split("/"),l=[],u=0;u<s.length;u++){var o=s[u];o==="."||o===""&&u!==0&&u!==s.length-1||(o===".."?l.pop():l.push(o))}return l.join("/")},g.getTypeOf=function(c){return typeof c=="string"?"string":Object.prototype.toString.call(c)==="[object Array]"?"array":y.nodebuffer&&h.isBuffer(c)?"nodebuffer":y.uint8array&&c instanceof Uint8Array?"uint8array":y.arraybuffer&&c instanceof ArrayBuffer?"arraybuffer":void 0},g.checkSupport=function(c){if(!y[c.toLowerCase()])throw new Error(c+" is not supported by this platform")},g.MAX_VALUE_16BITS=65535,g.MAX_VALUE_32BITS=-1,g.pretty=function(c){var s,l,u="";for(l=0;l<(c||"").length;l++)u+="\\x"+((s=c.charCodeAt(l))<16?"0":"")+s.toString(16).toUpperCase();return u},g.delay=function(c,s,l){setImmediate(function(){c.apply(l||null,s||[])})},g.inherits=function(c,s){function l(){}l.prototype=s.prototype,c.prototype=new l},g.extend=function(){var c,s,l={};for(c=0;c<arguments.length;c++)for(s in arguments[c])Object.prototype.hasOwnProperty.call(arguments[c],s)&&l[s]===void 0&&(l[s]=arguments[c][s]);return l},g.prepareContent=function(c,s,l,u,o){return w.Promise.resolve(s).then(function(i){return y.blob&&(i instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(i))!==-1)&&typeof FileReader<"u"?new w.Promise(function(a,b){var v=new FileReader;v.onload=function(_){a(_.target.result)},v.onerror=function(_){b(_.target.error)},v.readAsArrayBuffer(i)}):i}).then(function(i){var a=g.getTypeOf(i);return a?(a==="arraybuffer"?i=g.transformTo("uint8array",i):a==="string"&&(o?i=E.decode(i):l&&u!==!0&&(i=(function(b){return r(b,y.uint8array?new Uint8Array(b.length):new Array(b.length))})(i))),i):w.Promise.reject(new Error("Can't read the data of '"+c+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(d,f,g){"use strict";var y=d("./reader/readerFor"),E=d("./utils"),h=d("./signature"),w=d("./zipEntry"),A=d("./support");function r(n){this.files=[],this.loadOptions=n}r.prototype={checkSignature:function(n){if(!this.reader.readAndCheckSignature(n)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+E.pretty(e)+", expected "+E.pretty(n)+")")}},isSignature:function(n,e){var t=this.reader.index;this.reader.setIndex(n);var p=this.reader.readString(4)===e;return this.reader.setIndex(t),p},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var n=this.reader.readData(this.zipCommentLength),e=A.uint8array?"uint8array":"array",t=E.transformTo(e,n);this.zipComment=this.loadOptions.decodeFileName(t)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var n,e,t,p=this.zip64EndOfCentralSize-44;0<p;)n=this.reader.readInt(2),e=this.reader.readInt(4),t=this.reader.readData(e),this.zip64ExtensibleData[n]={id:n,length:e,value:t}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var n,e;for(n=0;n<this.files.length;n++)e=this.files[n],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(h.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var n;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(h.CENTRAL_FILE_HEADER);)(n=new w({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(n);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var n=this.reader.lastIndexOfSignature(h.CENTRAL_DIRECTORY_END);if(n<0)throw this.isSignature(0,h.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(n);var e=n;if(this.checkSignature(h.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===E.MAX_VALUE_16BITS||this.diskWithCentralDirStart===E.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===E.MAX_VALUE_16BITS||this.centralDirRecords===E.MAX_VALUE_16BITS||this.centralDirSize===E.MAX_VALUE_32BITS||this.centralDirOffset===E.MAX_VALUE_32BITS){if(this.zip64=!0,(n=this.reader.lastIndexOfSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(n),this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,h.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(h.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var t=this.centralDirOffset+this.centralDirSize;this.zip64&&(t+=20,t+=12+this.zip64EndOfCentralSize);var p=e-t;if(0<p)this.isSignature(e,h.CENTRAL_FILE_HEADER)||(this.reader.zero=p);else if(p<0)throw new Error("Corrupted zip: missing "+Math.abs(p)+" bytes.")},prepareReader:function(n){this.reader=y(n)},load:function(n){this.prepareReader(n),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},f.exports=r},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(d,f,g){"use strict";var y=d("./reader/readerFor"),E=d("./utils"),h=d("./compressedObject"),w=d("./crc32"),A=d("./utf8"),r=d("./compressions"),n=d("./support");function e(t,p){this.options=t,this.loadOptions=p}e.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(t){var p,c;if(t.skip(22),this.fileNameLength=t.readInt(2),c=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(c),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((p=(function(s){for(var l in r)if(Object.prototype.hasOwnProperty.call(r,l)&&r[l].magic===s)return r[l];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+E.pretty(this.compressionMethod)+" unknown (inner file : "+E.transformTo("string",this.fileName)+")");this.decompressed=new h(this.compressedSize,this.uncompressedSize,this.crc32,p,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var p=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(p),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),t==0&&(this.dosPermissions=63&this.externalFileAttributes),t==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=y(this.extraFields[1].value);this.uncompressedSize===E.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===E.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===E.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===E.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var p,c,s,l=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<l;)p=t.readInt(2),c=t.readInt(2),s=t.readData(c),this.extraFields[p]={id:p,length:c,value:s};t.setIndex(l)},handleUTF8:function(){var t=n.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=A.utf8decode(this.fileName),this.fileCommentStr=A.utf8decode(this.fileComment);else{var p=this.findExtraFieldUnicodePath();if(p!==null)this.fileNameStr=p;else{var c=E.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(c)}var s=this.findExtraFieldUnicodeComment();if(s!==null)this.fileCommentStr=s;else{var l=E.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(l)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var p=y(t.value);return p.readInt(1)!==1||w(this.fileName)!==p.readInt(4)?null:A.utf8decode(p.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var p=y(t.value);return p.readInt(1)!==1||w(this.fileComment)!==p.readInt(4)?null:A.utf8decode(p.readData(t.length-5))}return null}},f.exports=e},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(d,f,g){"use strict";function y(p,c,s){this.name=p,this.dir=s.dir,this.date=s.date,this.comment=s.comment,this.unixPermissions=s.unixPermissions,this.dosPermissions=s.dosPermissions,this._data=c,this._dataBinary=s.binary,this.options={compression:s.compression,compressionOptions:s.compressionOptions}}var E=d("./stream/StreamHelper"),h=d("./stream/DataWorker"),w=d("./utf8"),A=d("./compressedObject"),r=d("./stream/GenericWorker");y.prototype={internalStream:function(p){var c=null,s="string";try{if(!p)throw new Error("No output type specified.");var l=(s=p.toLowerCase())==="string"||s==="text";s!=="binarystring"&&s!=="text"||(s="string"),c=this._decompressWorker();var u=!this._dataBinary;u&&!l&&(c=c.pipe(new w.Utf8EncodeWorker)),!u&&l&&(c=c.pipe(new w.Utf8DecodeWorker))}catch(o){(c=new r("error")).error(o)}return new E(c,s,"")},async:function(p,c){return this.internalStream(p).accumulate(c)},nodeStream:function(p,c){return this.internalStream(p||"nodebuffer").toNodejsStream(c)},_compressWorker:function(p,c){if(this._data instanceof A&&this._data.compression.magic===p.magic)return this._data.getCompressedWorker();var s=this._decompressWorker();return this._dataBinary||(s=s.pipe(new w.Utf8EncodeWorker)),A.createWorkerFrom(s,p,c)},_decompressWorker:function(){return this._data instanceof A?this._data.getContentWorker():this._data instanceof r?this._data:new h(this._data)}};for(var n=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],e=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},t=0;t<n.length;t++)y.prototype[n[t]]=e;f.exports=y},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(d,f,g){(function(y){"use strict";var E,h,w=y.MutationObserver||y.WebKitMutationObserver;if(w){var A=0,r=new w(p),n=y.document.createTextNode("");r.observe(n,{characterData:!0}),E=function(){n.data=A=++A%2}}else if(y.setImmediate||y.MessageChannel===void 0)E="document"in y&&"onreadystatechange"in y.document.createElement("script")?function(){var c=y.document.createElement("script");c.onreadystatechange=function(){p(),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},y.document.documentElement.appendChild(c)}:function(){setTimeout(p,0)};else{var e=new y.MessageChannel;e.port1.onmessage=p,E=function(){e.port2.postMessage(0)}}var t=[];function p(){var c,s;h=!0;for(var l=t.length;l;){for(s=t,t=[],c=-1;++c<l;)s[c]();l=t.length}h=!1}f.exports=function(c){t.push(c)!==1||h||E()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(d,f,g){"use strict";var y=d("immediate");function E(){}var h={},w=["REJECTED"],A=["FULFILLED"],r=["PENDING"];function n(l){if(typeof l!="function")throw new TypeError("resolver must be a function");this.state=r,this.queue=[],this.outcome=void 0,l!==E&&c(this,l)}function e(l,u,o){this.promise=l,typeof u=="function"&&(this.onFulfilled=u,this.callFulfilled=this.otherCallFulfilled),typeof o=="function"&&(this.onRejected=o,this.callRejected=this.otherCallRejected)}function t(l,u,o){y(function(){var i;try{i=u(o)}catch(a){return h.reject(l,a)}i===l?h.reject(l,new TypeError("Cannot resolve promise with itself")):h.resolve(l,i)})}function p(l){var u=l&&l.then;if(l&&(typeof l=="object"||typeof l=="function")&&typeof u=="function")return function(){u.apply(l,arguments)}}function c(l,u){var o=!1;function i(v){o||(o=!0,h.reject(l,v))}function a(v){o||(o=!0,h.resolve(l,v))}var b=s(function(){u(a,i)});b.status==="error"&&i(b.value)}function s(l,u){var o={};try{o.value=l(u),o.status="success"}catch(i){o.status="error",o.value=i}return o}(f.exports=n).prototype.finally=function(l){if(typeof l!="function")return this;var u=this.constructor;return this.then(function(o){return u.resolve(l()).then(function(){return o})},function(o){return u.resolve(l()).then(function(){throw o})})},n.prototype.catch=function(l){return this.then(null,l)},n.prototype.then=function(l,u){if(typeof l!="function"&&this.state===A||typeof u!="function"&&this.state===w)return this;var o=new this.constructor(E);return this.state!==r?t(o,this.state===A?l:u,this.outcome):this.queue.push(new e(o,l,u)),o},e.prototype.callFulfilled=function(l){h.resolve(this.promise,l)},e.prototype.otherCallFulfilled=function(l){t(this.promise,this.onFulfilled,l)},e.prototype.callRejected=function(l){h.reject(this.promise,l)},e.prototype.otherCallRejected=function(l){t(this.promise,this.onRejected,l)},h.resolve=function(l,u){var o=s(p,u);if(o.status==="error")return h.reject(l,o.value);var i=o.value;if(i)c(l,i);else{l.state=A,l.outcome=u;for(var a=-1,b=l.queue.length;++a<b;)l.queue[a].callFulfilled(u)}return l},h.reject=function(l,u){l.state=w,l.outcome=u;for(var o=-1,i=l.queue.length;++o<i;)l.queue[o].callRejected(u);return l},n.resolve=function(l){return l instanceof this?l:h.resolve(new this(E),l)},n.reject=function(l){var u=new this(E);return h.reject(u,l)},n.all=function(l){var u=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var o=l.length,i=!1;if(!o)return this.resolve([]);for(var a=new Array(o),b=0,v=-1,_=new this(E);++v<o;)T(l[v],v);return _;function T(k,M){u.resolve(k).then(function(R){a[M]=R,++b!==o||i||(i=!0,h.resolve(_,a))},function(R){i||(i=!0,h.reject(_,R))})}},n.race=function(l){var u=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var o=l.length,i=!1;if(!o)return this.resolve([]);for(var a=-1,b=new this(E);++a<o;)v=l[a],u.resolve(v).then(function(_){i||(i=!0,h.resolve(b,_))},function(_){i||(i=!0,h.reject(b,_))});var v;return b}},{immediate:36}],38:[function(d,f,g){"use strict";var y={};(0,d("./lib/utils/common").assign)(y,d("./lib/deflate"),d("./lib/inflate"),d("./lib/zlib/constants")),f.exports=y},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(d,f,g){"use strict";var y=d("./zlib/deflate"),E=d("./utils/common"),h=d("./utils/strings"),w=d("./zlib/messages"),A=d("./zlib/zstream"),r=Object.prototype.toString,n=0,e=-1,t=0,p=8;function c(l){if(!(this instanceof c))return new c(l);this.options=E.assign({level:e,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:t,to:""},l||{});var u=this.options;u.raw&&0<u.windowBits?u.windowBits=-u.windowBits:u.gzip&&0<u.windowBits&&u.windowBits<16&&(u.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new A,this.strm.avail_out=0;var o=y.deflateInit2(this.strm,u.level,u.method,u.windowBits,u.memLevel,u.strategy);if(o!==n)throw new Error(w[o]);if(u.header&&y.deflateSetHeader(this.strm,u.header),u.dictionary){var i;if(i=typeof u.dictionary=="string"?h.string2buf(u.dictionary):r.call(u.dictionary)==="[object ArrayBuffer]"?new Uint8Array(u.dictionary):u.dictionary,(o=y.deflateSetDictionary(this.strm,i))!==n)throw new Error(w[o]);this._dict_set=!0}}function s(l,u){var o=new c(u);if(o.push(l,!0),o.err)throw o.msg||w[o.err];return o.result}c.prototype.push=function(l,u){var o,i,a=this.strm,b=this.options.chunkSize;if(this.ended)return!1;i=u===~~u?u:u===!0?4:0,typeof l=="string"?a.input=h.string2buf(l):r.call(l)==="[object ArrayBuffer]"?a.input=new Uint8Array(l):a.input=l,a.next_in=0,a.avail_in=a.input.length;do{if(a.avail_out===0&&(a.output=new E.Buf8(b),a.next_out=0,a.avail_out=b),(o=y.deflate(a,i))!==1&&o!==n)return this.onEnd(o),!(this.ended=!0);a.avail_out!==0&&(a.avail_in!==0||i!==4&&i!==2)||(this.options.to==="string"?this.onData(h.buf2binstring(E.shrinkBuf(a.output,a.next_out))):this.onData(E.shrinkBuf(a.output,a.next_out)))}while((0<a.avail_in||a.avail_out===0)&&o!==1);return i===4?(o=y.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===n):i!==2||(this.onEnd(n),!(a.avail_out=0))},c.prototype.onData=function(l){this.chunks.push(l)},c.prototype.onEnd=function(l){l===n&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=E.flattenChunks(this.chunks)),this.chunks=[],this.err=l,this.msg=this.strm.msg},g.Deflate=c,g.deflate=s,g.deflateRaw=function(l,u){return(u=u||{}).raw=!0,s(l,u)},g.gzip=function(l,u){return(u=u||{}).gzip=!0,s(l,u)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(d,f,g){"use strict";var y=d("./zlib/inflate"),E=d("./utils/common"),h=d("./utils/strings"),w=d("./zlib/constants"),A=d("./zlib/messages"),r=d("./zlib/zstream"),n=d("./zlib/gzheader"),e=Object.prototype.toString;function t(c){if(!(this instanceof t))return new t(c);this.options=E.assign({chunkSize:16384,windowBits:0,to:""},c||{});var s=this.options;s.raw&&0<=s.windowBits&&s.windowBits<16&&(s.windowBits=-s.windowBits,s.windowBits===0&&(s.windowBits=-15)),!(0<=s.windowBits&&s.windowBits<16)||c&&c.windowBits||(s.windowBits+=32),15<s.windowBits&&s.windowBits<48&&(15&s.windowBits)==0&&(s.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new r,this.strm.avail_out=0;var l=y.inflateInit2(this.strm,s.windowBits);if(l!==w.Z_OK)throw new Error(A[l]);this.header=new n,y.inflateGetHeader(this.strm,this.header)}function p(c,s){var l=new t(s);if(l.push(c,!0),l.err)throw l.msg||A[l.err];return l.result}t.prototype.push=function(c,s){var l,u,o,i,a,b,v=this.strm,_=this.options.chunkSize,T=this.options.dictionary,k=!1;if(this.ended)return!1;u=s===~~s?s:s===!0?w.Z_FINISH:w.Z_NO_FLUSH,typeof c=="string"?v.input=h.binstring2buf(c):e.call(c)==="[object ArrayBuffer]"?v.input=new Uint8Array(c):v.input=c,v.next_in=0,v.avail_in=v.input.length;do{if(v.avail_out===0&&(v.output=new E.Buf8(_),v.next_out=0,v.avail_out=_),(l=y.inflate(v,w.Z_NO_FLUSH))===w.Z_NEED_DICT&&T&&(b=typeof T=="string"?h.string2buf(T):e.call(T)==="[object ArrayBuffer]"?new Uint8Array(T):T,l=y.inflateSetDictionary(this.strm,b)),l===w.Z_BUF_ERROR&&k===!0&&(l=w.Z_OK,k=!1),l!==w.Z_STREAM_END&&l!==w.Z_OK)return this.onEnd(l),!(this.ended=!0);v.next_out&&(v.avail_out!==0&&l!==w.Z_STREAM_END&&(v.avail_in!==0||u!==w.Z_FINISH&&u!==w.Z_SYNC_FLUSH)||(this.options.to==="string"?(o=h.utf8border(v.output,v.next_out),i=v.next_out-o,a=h.buf2string(v.output,o),v.next_out=i,v.avail_out=_-i,i&&E.arraySet(v.output,v.output,o,i,0),this.onData(a)):this.onData(E.shrinkBuf(v.output,v.next_out)))),v.avail_in===0&&v.avail_out===0&&(k=!0)}while((0<v.avail_in||v.avail_out===0)&&l!==w.Z_STREAM_END);return l===w.Z_STREAM_END&&(u=w.Z_FINISH),u===w.Z_FINISH?(l=y.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===w.Z_OK):u!==w.Z_SYNC_FLUSH||(this.onEnd(w.Z_OK),!(v.avail_out=0))},t.prototype.onData=function(c){this.chunks.push(c)},t.prototype.onEnd=function(c){c===w.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=E.flattenChunks(this.chunks)),this.chunks=[],this.err=c,this.msg=this.strm.msg},g.Inflate=t,g.inflate=p,g.inflateRaw=function(c,s){return(s=s||{}).raw=!0,p(c,s)},g.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(d,f,g){"use strict";var y=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";g.assign=function(w){for(var A=Array.prototype.slice.call(arguments,1);A.length;){var r=A.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(w[n]=r[n])}}return w},g.shrinkBuf=function(w,A){return w.length===A?w:w.subarray?w.subarray(0,A):(w.length=A,w)};var E={arraySet:function(w,A,r,n,e){if(A.subarray&&w.subarray)w.set(A.subarray(r,r+n),e);else for(var t=0;t<n;t++)w[e+t]=A[r+t]},flattenChunks:function(w){var A,r,n,e,t,p;for(A=n=0,r=w.length;A<r;A++)n+=w[A].length;for(p=new Uint8Array(n),A=e=0,r=w.length;A<r;A++)t=w[A],p.set(t,e),e+=t.length;return p}},h={arraySet:function(w,A,r,n,e){for(var t=0;t<n;t++)w[e+t]=A[r+t]},flattenChunks:function(w){return[].concat.apply([],w)}};g.setTyped=function(w){w?(g.Buf8=Uint8Array,g.Buf16=Uint16Array,g.Buf32=Int32Array,g.assign(g,E)):(g.Buf8=Array,g.Buf16=Array,g.Buf32=Array,g.assign(g,h))},g.setTyped(y)},{}],42:[function(d,f,g){"use strict";var y=d("./common"),E=!0,h=!0;try{String.fromCharCode.apply(null,[0])}catch{E=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{h=!1}for(var w=new y.Buf8(256),A=0;A<256;A++)w[A]=252<=A?6:248<=A?5:240<=A?4:224<=A?3:192<=A?2:1;function r(n,e){if(e<65537&&(n.subarray&&h||!n.subarray&&E))return String.fromCharCode.apply(null,y.shrinkBuf(n,e));for(var t="",p=0;p<e;p++)t+=String.fromCharCode(n[p]);return t}w[254]=w[254]=1,g.string2buf=function(n){var e,t,p,c,s,l=n.length,u=0;for(c=0;c<l;c++)(64512&(t=n.charCodeAt(c)))==55296&&c+1<l&&(64512&(p=n.charCodeAt(c+1)))==56320&&(t=65536+(t-55296<<10)+(p-56320),c++),u+=t<128?1:t<2048?2:t<65536?3:4;for(e=new y.Buf8(u),c=s=0;s<u;c++)(64512&(t=n.charCodeAt(c)))==55296&&c+1<l&&(64512&(p=n.charCodeAt(c+1)))==56320&&(t=65536+(t-55296<<10)+(p-56320),c++),t<128?e[s++]=t:(t<2048?e[s++]=192|t>>>6:(t<65536?e[s++]=224|t>>>12:(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63),e[s++]=128|t>>>6&63),e[s++]=128|63&t);return e},g.buf2binstring=function(n){return r(n,n.length)},g.binstring2buf=function(n){for(var e=new y.Buf8(n.length),t=0,p=e.length;t<p;t++)e[t]=n.charCodeAt(t);return e},g.buf2string=function(n,e){var t,p,c,s,l=e||n.length,u=new Array(2*l);for(t=p=0;t<l;)if((c=n[t++])<128)u[p++]=c;else if(4<(s=w[c]))u[p++]=65533,t+=s-1;else{for(c&=s===2?31:s===3?15:7;1<s&&t<l;)c=c<<6|63&n[t++],s--;1<s?u[p++]=65533:c<65536?u[p++]=c:(c-=65536,u[p++]=55296|c>>10&1023,u[p++]=56320|1023&c)}return r(u,p)},g.utf8border=function(n,e){var t;for((e=e||n.length)>n.length&&(e=n.length),t=e-1;0<=t&&(192&n[t])==128;)t--;return t<0||t===0?e:t+w[n[t]]>e?t:e}},{"./common":41}],43:[function(d,f,g){"use strict";f.exports=function(y,E,h,w){for(var A=65535&y|0,r=y>>>16&65535|0,n=0;h!==0;){for(h-=n=2e3<h?2e3:h;r=r+(A=A+E[w++]|0)|0,--n;);A%=65521,r%=65521}return A|r<<16|0}},{}],44:[function(d,f,g){"use strict";f.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(d,f,g){"use strict";var y=(function(){for(var E,h=[],w=0;w<256;w++){E=w;for(var A=0;A<8;A++)E=1&E?3988292384^E>>>1:E>>>1;h[w]=E}return h})();f.exports=function(E,h,w,A){var r=y,n=A+w;E^=-1;for(var e=A;e<n;e++)E=E>>>8^r[255&(E^h[e])];return-1^E}},{}],46:[function(d,f,g){"use strict";var y,E=d("../utils/common"),h=d("./trees"),w=d("./adler32"),A=d("./crc32"),r=d("./messages"),n=0,e=4,t=0,p=-2,c=-1,s=4,l=2,u=8,o=9,i=286,a=30,b=19,v=2*i+1,_=15,T=3,k=258,M=k+T+1,R=42,O=113,P=1,N=2,it=3,J=4;function ot(S,$){return S.msg=r[$],$}function tt(S){return(S<<1)-(4<S?9:0)}function ht(S){for(var $=S.length;0<=--$;)S[$]=0}function W(S){var $=S.state,z=$.pending;z>S.avail_out&&(z=S.avail_out),z!==0&&(E.arraySet(S.output,$.pending_buf,$.pending_out,z,S.next_out),S.next_out+=z,$.pending_out+=z,S.total_out+=z,S.avail_out-=z,$.pending-=z,$.pending===0&&($.pending_out=0))}function G(S,$){h._tr_flush_block(S,0<=S.block_start?S.block_start:-1,S.strstart-S.block_start,$),S.block_start=S.strstart,W(S.strm)}function gt(S,$){S.pending_buf[S.pending++]=$}function nt(S,$){S.pending_buf[S.pending++]=$>>>8&255,S.pending_buf[S.pending++]=255&$}function j(S,$){var z,x,D=S.max_chain_length,I=S.strstart,H=S.prev_length,L=S.nice_match,B=S.strstart>S.w_size-M?S.strstart-(S.w_size-M):0,Y=S.window,Q=S.w_mask,K=S.prev,lt=S.strstart+k,ft=Y[I+H-1],X=Y[I+H];S.prev_length>=S.good_match&&(D>>=2),L>S.lookahead&&(L=S.lookahead);do if(Y[(z=$)+H]===X&&Y[z+H-1]===ft&&Y[z]===Y[I]&&Y[++z]===Y[I+1]){I+=2,z++;do;while(Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&I<lt);if(x=k-(lt-I),I=lt-k,H<x){if(S.match_start=$,L<=(H=x))break;ft=Y[I+H-1],X=Y[I+H]}}while(($=K[$&Q])>B&&--D!=0);return H<=S.lookahead?H:S.lookahead}function U(S){var $,z,x,D,I,H,L,B,Y,Q,K=S.w_size;do{if(D=S.window_size-S.lookahead-S.strstart,S.strstart>=K+(K-M)){for(E.arraySet(S.window,S.window,K,K,0),S.match_start-=K,S.strstart-=K,S.block_start-=K,$=z=S.hash_size;x=S.head[--$],S.head[$]=K<=x?x-K:0,--z;);for($=z=K;x=S.prev[--$],S.prev[$]=K<=x?x-K:0,--z;);D+=K}if(S.strm.avail_in===0)break;if(H=S.strm,L=S.window,B=S.strstart+S.lookahead,Y=D,Q=void 0,Q=H.avail_in,Y<Q&&(Q=Y),z=Q===0?0:(H.avail_in-=Q,E.arraySet(L,H.input,H.next_in,Q,B),H.state.wrap===1?H.adler=w(H.adler,L,Q,B):H.state.wrap===2&&(H.adler=A(H.adler,L,Q,B)),H.next_in+=Q,H.total_in+=Q,Q),S.lookahead+=z,S.lookahead+S.insert>=T)for(I=S.strstart-S.insert,S.ins_h=S.window[I],S.ins_h=(S.ins_h<<S.hash_shift^S.window[I+1])&S.hash_mask;S.insert&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[I+T-1])&S.hash_mask,S.prev[I&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=I,I++,S.insert--,!(S.lookahead+S.insert<T)););}while(S.lookahead<M&&S.strm.avail_in!==0)}function at(S,$){for(var z,x;;){if(S.lookahead<M){if(U(S),S.lookahead<M&&$===n)return P;if(S.lookahead===0)break}if(z=0,S.lookahead>=T&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+T-1])&S.hash_mask,z=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),z!==0&&S.strstart-z<=S.w_size-M&&(S.match_length=j(S,z)),S.match_length>=T)if(x=h._tr_tally(S,S.strstart-S.match_start,S.match_length-T),S.lookahead-=S.match_length,S.match_length<=S.max_lazy_match&&S.lookahead>=T){for(S.match_length--;S.strstart++,S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+T-1])&S.hash_mask,z=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart,--S.match_length!=0;);S.strstart++}else S.strstart+=S.match_length,S.match_length=0,S.ins_h=S.window[S.strstart],S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+1])&S.hash_mask;else x=h._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++;if(x&&(G(S,!1),S.strm.avail_out===0))return P}return S.insert=S.strstart<T-1?S.strstart:T-1,$===e?(G(S,!0),S.strm.avail_out===0?it:J):S.last_lit&&(G(S,!1),S.strm.avail_out===0)?P:N}function rt(S,$){for(var z,x,D;;){if(S.lookahead<M){if(U(S),S.lookahead<M&&$===n)return P;if(S.lookahead===0)break}if(z=0,S.lookahead>=T&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+T-1])&S.hash_mask,z=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),S.prev_length=S.match_length,S.prev_match=S.match_start,S.match_length=T-1,z!==0&&S.prev_length<S.max_lazy_match&&S.strstart-z<=S.w_size-M&&(S.match_length=j(S,z),S.match_length<=5&&(S.strategy===1||S.match_length===T&&4096<S.strstart-S.match_start)&&(S.match_length=T-1)),S.prev_length>=T&&S.match_length<=S.prev_length){for(D=S.strstart+S.lookahead-T,x=h._tr_tally(S,S.strstart-1-S.prev_match,S.prev_length-T),S.lookahead-=S.prev_length-1,S.prev_length-=2;++S.strstart<=D&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+T-1])&S.hash_mask,z=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),--S.prev_length!=0;);if(S.match_available=0,S.match_length=T-1,S.strstart++,x&&(G(S,!1),S.strm.avail_out===0))return P}else if(S.match_available){if((x=h._tr_tally(S,0,S.window[S.strstart-1]))&&G(S,!1),S.strstart++,S.lookahead--,S.strm.avail_out===0)return P}else S.match_available=1,S.strstart++,S.lookahead--}return S.match_available&&(x=h._tr_tally(S,0,S.window[S.strstart-1]),S.match_available=0),S.insert=S.strstart<T-1?S.strstart:T-1,$===e?(G(S,!0),S.strm.avail_out===0?it:J):S.last_lit&&(G(S,!1),S.strm.avail_out===0)?P:N}function V(S,$,z,x,D){this.good_length=S,this.max_lazy=$,this.nice_length=z,this.max_chain=x,this.func=D}function et(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=u,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new E.Buf16(2*v),this.dyn_dtree=new E.Buf16(2*(2*a+1)),this.bl_tree=new E.Buf16(2*(2*b+1)),ht(this.dyn_ltree),ht(this.dyn_dtree),ht(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new E.Buf16(_+1),this.heap=new E.Buf16(2*i+1),ht(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new E.Buf16(2*i+1),ht(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function q(S){var $;return S&&S.state?(S.total_in=S.total_out=0,S.data_type=l,($=S.state).pending=0,$.pending_out=0,$.wrap<0&&($.wrap=-$.wrap),$.status=$.wrap?R:O,S.adler=$.wrap===2?0:1,$.last_flush=n,h._tr_init($),t):ot(S,p)}function F(S){var $=q(S);return $===t&&(function(z){z.window_size=2*z.w_size,ht(z.head),z.max_lazy_match=y[z.level].max_lazy,z.good_match=y[z.level].good_length,z.nice_match=y[z.level].nice_length,z.max_chain_length=y[z.level].max_chain,z.strstart=0,z.block_start=0,z.lookahead=0,z.insert=0,z.match_length=z.prev_length=T-1,z.match_available=0,z.ins_h=0})(S.state),$}function ut(S,$,z,x,D,I){if(!S)return p;var H=1;if($===c&&($=6),x<0?(H=0,x=-x):15<x&&(H=2,x-=16),D<1||o<D||z!==u||x<8||15<x||$<0||9<$||I<0||s<I)return ot(S,p);x===8&&(x=9);var L=new et;return(S.state=L).strm=S,L.wrap=H,L.gzhead=null,L.w_bits=x,L.w_size=1<<L.w_bits,L.w_mask=L.w_size-1,L.hash_bits=D+7,L.hash_size=1<<L.hash_bits,L.hash_mask=L.hash_size-1,L.hash_shift=~~((L.hash_bits+T-1)/T),L.window=new E.Buf8(2*L.w_size),L.head=new E.Buf16(L.hash_size),L.prev=new E.Buf16(L.w_size),L.lit_bufsize=1<<D+6,L.pending_buf_size=4*L.lit_bufsize,L.pending_buf=new E.Buf8(L.pending_buf_size),L.d_buf=1*L.lit_bufsize,L.l_buf=3*L.lit_bufsize,L.level=$,L.strategy=I,L.method=z,F(S)}y=[new V(0,0,0,0,function(S,$){var z=65535;for(z>S.pending_buf_size-5&&(z=S.pending_buf_size-5);;){if(S.lookahead<=1){if(U(S),S.lookahead===0&&$===n)return P;if(S.lookahead===0)break}S.strstart+=S.lookahead,S.lookahead=0;var x=S.block_start+z;if((S.strstart===0||S.strstart>=x)&&(S.lookahead=S.strstart-x,S.strstart=x,G(S,!1),S.strm.avail_out===0)||S.strstart-S.block_start>=S.w_size-M&&(G(S,!1),S.strm.avail_out===0))return P}return S.insert=0,$===e?(G(S,!0),S.strm.avail_out===0?it:J):(S.strstart>S.block_start&&(G(S,!1),S.strm.avail_out),P)}),new V(4,4,8,4,at),new V(4,5,16,8,at),new V(4,6,32,32,at),new V(4,4,16,16,rt),new V(8,16,32,32,rt),new V(8,16,128,128,rt),new V(8,32,128,256,rt),new V(32,128,258,1024,rt),new V(32,258,258,4096,rt)],g.deflateInit=function(S,$){return ut(S,$,u,15,8,0)},g.deflateInit2=ut,g.deflateReset=F,g.deflateResetKeep=q,g.deflateSetHeader=function(S,$){return S&&S.state?S.state.wrap!==2?p:(S.state.gzhead=$,t):p},g.deflate=function(S,$){var z,x,D,I;if(!S||!S.state||5<$||$<0)return S?ot(S,p):p;if(x=S.state,!S.output||!S.input&&S.avail_in!==0||x.status===666&&$!==e)return ot(S,S.avail_out===0?-5:p);if(x.strm=S,z=x.last_flush,x.last_flush=$,x.status===R)if(x.wrap===2)S.adler=0,gt(x,31),gt(x,139),gt(x,8),x.gzhead?(gt(x,(x.gzhead.text?1:0)+(x.gzhead.hcrc?2:0)+(x.gzhead.extra?4:0)+(x.gzhead.name?8:0)+(x.gzhead.comment?16:0)),gt(x,255&x.gzhead.time),gt(x,x.gzhead.time>>8&255),gt(x,x.gzhead.time>>16&255),gt(x,x.gzhead.time>>24&255),gt(x,x.level===9?2:2<=x.strategy||x.level<2?4:0),gt(x,255&x.gzhead.os),x.gzhead.extra&&x.gzhead.extra.length&&(gt(x,255&x.gzhead.extra.length),gt(x,x.gzhead.extra.length>>8&255)),x.gzhead.hcrc&&(S.adler=A(S.adler,x.pending_buf,x.pending,0)),x.gzindex=0,x.status=69):(gt(x,0),gt(x,0),gt(x,0),gt(x,0),gt(x,0),gt(x,x.level===9?2:2<=x.strategy||x.level<2?4:0),gt(x,3),x.status=O);else{var H=u+(x.w_bits-8<<4)<<8;H|=(2<=x.strategy||x.level<2?0:x.level<6?1:x.level===6?2:3)<<6,x.strstart!==0&&(H|=32),H+=31-H%31,x.status=O,nt(x,H),x.strstart!==0&&(nt(x,S.adler>>>16),nt(x,65535&S.adler)),S.adler=1}if(x.status===69)if(x.gzhead.extra){for(D=x.pending;x.gzindex<(65535&x.gzhead.extra.length)&&(x.pending!==x.pending_buf_size||(x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),W(S),D=x.pending,x.pending!==x.pending_buf_size));)gt(x,255&x.gzhead.extra[x.gzindex]),x.gzindex++;x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),x.gzindex===x.gzhead.extra.length&&(x.gzindex=0,x.status=73)}else x.status=73;if(x.status===73)if(x.gzhead.name){D=x.pending;do{if(x.pending===x.pending_buf_size&&(x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),W(S),D=x.pending,x.pending===x.pending_buf_size)){I=1;break}I=x.gzindex<x.gzhead.name.length?255&x.gzhead.name.charCodeAt(x.gzindex++):0,gt(x,I)}while(I!==0);x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),I===0&&(x.gzindex=0,x.status=91)}else x.status=91;if(x.status===91)if(x.gzhead.comment){D=x.pending;do{if(x.pending===x.pending_buf_size&&(x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),W(S),D=x.pending,x.pending===x.pending_buf_size)){I=1;break}I=x.gzindex<x.gzhead.comment.length?255&x.gzhead.comment.charCodeAt(x.gzindex++):0,gt(x,I)}while(I!==0);x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),I===0&&(x.status=103)}else x.status=103;if(x.status===103&&(x.gzhead.hcrc?(x.pending+2>x.pending_buf_size&&W(S),x.pending+2<=x.pending_buf_size&&(gt(x,255&S.adler),gt(x,S.adler>>8&255),S.adler=0,x.status=O)):x.status=O),x.pending!==0){if(W(S),S.avail_out===0)return x.last_flush=-1,t}else if(S.avail_in===0&&tt($)<=tt(z)&&$!==e)return ot(S,-5);if(x.status===666&&S.avail_in!==0)return ot(S,-5);if(S.avail_in!==0||x.lookahead!==0||$!==n&&x.status!==666){var L=x.strategy===2?(function(B,Y){for(var Q;;){if(B.lookahead===0&&(U(B),B.lookahead===0)){if(Y===n)return P;break}if(B.match_length=0,Q=h._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++,Q&&(G(B,!1),B.strm.avail_out===0))return P}return B.insert=0,Y===e?(G(B,!0),B.strm.avail_out===0?it:J):B.last_lit&&(G(B,!1),B.strm.avail_out===0)?P:N})(x,$):x.strategy===3?(function(B,Y){for(var Q,K,lt,ft,X=B.window;;){if(B.lookahead<=k){if(U(B),B.lookahead<=k&&Y===n)return P;if(B.lookahead===0)break}if(B.match_length=0,B.lookahead>=T&&0<B.strstart&&(K=X[lt=B.strstart-1])===X[++lt]&&K===X[++lt]&&K===X[++lt]){ft=B.strstart+k;do;while(K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&lt<ft);B.match_length=k-(ft-lt),B.match_length>B.lookahead&&(B.match_length=B.lookahead)}if(B.match_length>=T?(Q=h._tr_tally(B,1,B.match_length-T),B.lookahead-=B.match_length,B.strstart+=B.match_length,B.match_length=0):(Q=h._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++),Q&&(G(B,!1),B.strm.avail_out===0))return P}return B.insert=0,Y===e?(G(B,!0),B.strm.avail_out===0?it:J):B.last_lit&&(G(B,!1),B.strm.avail_out===0)?P:N})(x,$):y[x.level].func(x,$);if(L!==it&&L!==J||(x.status=666),L===P||L===it)return S.avail_out===0&&(x.last_flush=-1),t;if(L===N&&($===1?h._tr_align(x):$!==5&&(h._tr_stored_block(x,0,0,!1),$===3&&(ht(x.head),x.lookahead===0&&(x.strstart=0,x.block_start=0,x.insert=0))),W(S),S.avail_out===0))return x.last_flush=-1,t}return $!==e?t:x.wrap<=0?1:(x.wrap===2?(gt(x,255&S.adler),gt(x,S.adler>>8&255),gt(x,S.adler>>16&255),gt(x,S.adler>>24&255),gt(x,255&S.total_in),gt(x,S.total_in>>8&255),gt(x,S.total_in>>16&255),gt(x,S.total_in>>24&255)):(nt(x,S.adler>>>16),nt(x,65535&S.adler)),W(S),0<x.wrap&&(x.wrap=-x.wrap),x.pending!==0?t:1)},g.deflateEnd=function(S){var $;return S&&S.state?($=S.state.status)!==R&&$!==69&&$!==73&&$!==91&&$!==103&&$!==O&&$!==666?ot(S,p):(S.state=null,$===O?ot(S,-3):t):p},g.deflateSetDictionary=function(S,$){var z,x,D,I,H,L,B,Y,Q=$.length;if(!S||!S.state||(I=(z=S.state).wrap)===2||I===1&&z.status!==R||z.lookahead)return p;for(I===1&&(S.adler=w(S.adler,$,Q,0)),z.wrap=0,Q>=z.w_size&&(I===0&&(ht(z.head),z.strstart=0,z.block_start=0,z.insert=0),Y=new E.Buf8(z.w_size),E.arraySet(Y,$,Q-z.w_size,z.w_size,0),$=Y,Q=z.w_size),H=S.avail_in,L=S.next_in,B=S.input,S.avail_in=Q,S.next_in=0,S.input=$,U(z);z.lookahead>=T;){for(x=z.strstart,D=z.lookahead-(T-1);z.ins_h=(z.ins_h<<z.hash_shift^z.window[x+T-1])&z.hash_mask,z.prev[x&z.w_mask]=z.head[z.ins_h],z.head[z.ins_h]=x,x++,--D;);z.strstart=x,z.lookahead=T-1,U(z)}return z.strstart+=z.lookahead,z.block_start=z.strstart,z.insert=z.lookahead,z.lookahead=0,z.match_length=z.prev_length=T-1,z.match_available=0,S.next_in=L,S.input=B,S.avail_in=H,z.wrap=I,t},g.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(d,f,g){"use strict";f.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(d,f,g){"use strict";f.exports=function(y,E){var h=y.state,w=y.next_in,A,r,n,e,t,p,c,s,l,u,o,i,a,b,v,_,T,k,M,R,O,P=y.input,N;A=w+(y.avail_in-5),r=y.next_out,N=y.output,n=r-(E-y.avail_out),e=r+(y.avail_out-257),t=h.dmax,p=h.wsize,c=h.whave,s=h.wnext,l=h.window,u=h.hold,o=h.bits,i=h.lencode,a=h.distcode,b=(1<<h.lenbits)-1,v=(1<<h.distbits)-1;t:do{o<15&&(u+=P[w++]<<o,o+=8,u+=P[w++]<<o,o+=8),_=i[u&b];e:for(;;){if(u>>>=T=_>>>24,o-=T,(T=_>>>16&255)===0)N[r++]=65535&_;else{if(!(16&T)){if((64&T)==0){_=i[(65535&_)+(u&(1<<T)-1)];continue e}if(32&T){h.mode=12;break t}y.msg="invalid literal/length code",h.mode=30;break t}k=65535&_,(T&=15)&&(o<T&&(u+=P[w++]<<o,o+=8),k+=u&(1<<T)-1,u>>>=T,o-=T),o<15&&(u+=P[w++]<<o,o+=8,u+=P[w++]<<o,o+=8),_=a[u&v];r:for(;;){if(u>>>=T=_>>>24,o-=T,!(16&(T=_>>>16&255))){if((64&T)==0){_=a[(65535&_)+(u&(1<<T)-1)];continue r}y.msg="invalid distance code",h.mode=30;break t}if(M=65535&_,o<(T&=15)&&(u+=P[w++]<<o,(o+=8)<T&&(u+=P[w++]<<o,o+=8)),t<(M+=u&(1<<T)-1)){y.msg="invalid distance too far back",h.mode=30;break t}if(u>>>=T,o-=T,(T=r-n)<M){if(c<(T=M-T)&&h.sane){y.msg="invalid distance too far back",h.mode=30;break t}if(O=l,(R=0)===s){if(R+=p-T,T<k){for(k-=T;N[r++]=l[R++],--T;);R=r-M,O=N}}else if(s<T){if(R+=p+s-T,(T-=s)<k){for(k-=T;N[r++]=l[R++],--T;);if(R=0,s<k){for(k-=T=s;N[r++]=l[R++],--T;);R=r-M,O=N}}}else if(R+=s-T,T<k){for(k-=T;N[r++]=l[R++],--T;);R=r-M,O=N}for(;2<k;)N[r++]=O[R++],N[r++]=O[R++],N[r++]=O[R++],k-=3;k&&(N[r++]=O[R++],1<k&&(N[r++]=O[R++]))}else{for(R=r-M;N[r++]=N[R++],N[r++]=N[R++],N[r++]=N[R++],2<(k-=3););k&&(N[r++]=N[R++],1<k&&(N[r++]=N[R++]))}break}}break}}while(w<A&&r<e);w-=k=o>>3,u&=(1<<(o-=k<<3))-1,y.next_in=w,y.next_out=r,y.avail_in=w<A?A-w+5:5-(w-A),y.avail_out=r<e?e-r+257:257-(r-e),h.hold=u,h.bits=o}},{}],49:[function(d,f,g){"use strict";var y=d("../utils/common"),E=d("./adler32"),h=d("./crc32"),w=d("./inffast"),A=d("./inftrees"),r=1,n=2,e=0,t=-2,p=1,c=852,s=592;function l(R){return(R>>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new y.Buf16(320),this.work=new y.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(R){var O;return R&&R.state?(O=R.state,R.total_in=R.total_out=O.total=0,R.msg="",O.wrap&&(R.adler=1&O.wrap),O.mode=p,O.last=0,O.havedict=0,O.dmax=32768,O.head=null,O.hold=0,O.bits=0,O.lencode=O.lendyn=new y.Buf32(c),O.distcode=O.distdyn=new y.Buf32(s),O.sane=1,O.back=-1,e):t}function i(R){var O;return R&&R.state?((O=R.state).wsize=0,O.whave=0,O.wnext=0,o(R)):t}function a(R,O){var P,N;return R&&R.state?(N=R.state,O<0?(P=0,O=-O):(P=1+(O>>4),O<48&&(O&=15)),O&&(O<8||15<O)?t:(N.window!==null&&N.wbits!==O&&(N.window=null),N.wrap=P,N.wbits=O,i(R))):t}function b(R,O){var P,N;return R?(N=new u,(R.state=N).window=null,(P=a(R,O))!==e&&(R.state=null),P):t}var v,_,T=!0;function k(R){if(T){var O;for(v=new y.Buf32(512),_=new y.Buf32(32),O=0;O<144;)R.lens[O++]=8;for(;O<256;)R.lens[O++]=9;for(;O<280;)R.lens[O++]=7;for(;O<288;)R.lens[O++]=8;for(A(r,R.lens,0,288,v,0,R.work,{bits:9}),O=0;O<32;)R.lens[O++]=5;A(n,R.lens,0,32,_,0,R.work,{bits:5}),T=!1}R.lencode=v,R.lenbits=9,R.distcode=_,R.distbits=5}function M(R,O,P,N){var it,J=R.state;return J.window===null&&(J.wsize=1<<J.wbits,J.wnext=0,J.whave=0,J.window=new y.Buf8(J.wsize)),N>=J.wsize?(y.arraySet(J.window,O,P-J.wsize,J.wsize,0),J.wnext=0,J.whave=J.wsize):(N<(it=J.wsize-J.wnext)&&(it=N),y.arraySet(J.window,O,P-N,it,J.wnext),(N-=it)?(y.arraySet(J.window,O,P-N,N,0),J.wnext=N,J.whave=J.wsize):(J.wnext+=it,J.wnext===J.wsize&&(J.wnext=0),J.whave<J.wsize&&(J.whave+=it))),0}g.inflateReset=i,g.inflateReset2=a,g.inflateResetKeep=o,g.inflateInit=function(R){return b(R,15)},g.inflateInit2=b,g.inflate=function(R,O){var P,N,it,J,ot,tt,ht,W,G,gt,nt,j,U,at,rt,V,et,q,F,ut,S,$,z,x,D=0,I=new y.Buf8(4),H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!R||!R.state||!R.output||!R.input&&R.avail_in!==0)return t;(P=R.state).mode===12&&(P.mode=13),ot=R.next_out,it=R.output,ht=R.avail_out,J=R.next_in,N=R.input,tt=R.avail_in,W=P.hold,G=P.bits,gt=tt,nt=ht,$=e;t:for(;;)switch(P.mode){case p:if(P.wrap===0){P.mode=13;break}for(;G<16;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(2&P.wrap&&W===35615){I[P.check=0]=255&W,I[1]=W>>>8&255,P.check=h(P.check,I,2,0),G=W=0,P.mode=2;break}if(P.flags=0,P.head&&(P.head.done=!1),!(1&P.wrap)||(((255&W)<<8)+(W>>8))%31){R.msg="incorrect header check",P.mode=30;break}if((15&W)!=8){R.msg="unknown compression method",P.mode=30;break}if(G-=4,S=8+(15&(W>>>=4)),P.wbits===0)P.wbits=S;else if(S>P.wbits){R.msg="invalid window size",P.mode=30;break}P.dmax=1<<S,R.adler=P.check=1,P.mode=512&W?10:12,G=W=0;break;case 2:for(;G<16;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(P.flags=W,(255&P.flags)!=8){R.msg="unknown compression method",P.mode=30;break}if(57344&P.flags){R.msg="unknown header flags set",P.mode=30;break}P.head&&(P.head.text=W>>8&1),512&P.flags&&(I[0]=255&W,I[1]=W>>>8&255,P.check=h(P.check,I,2,0)),G=W=0,P.mode=3;case 3:for(;G<32;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.head&&(P.head.time=W),512&P.flags&&(I[0]=255&W,I[1]=W>>>8&255,I[2]=W>>>16&255,I[3]=W>>>24&255,P.check=h(P.check,I,4,0)),G=W=0,P.mode=4;case 4:for(;G<16;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.head&&(P.head.xflags=255&W,P.head.os=W>>8),512&P.flags&&(I[0]=255&W,I[1]=W>>>8&255,P.check=h(P.check,I,2,0)),G=W=0,P.mode=5;case 5:if(1024&P.flags){for(;G<16;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.length=W,P.head&&(P.head.extra_len=W),512&P.flags&&(I[0]=255&W,I[1]=W>>>8&255,P.check=h(P.check,I,2,0)),G=W=0}else P.head&&(P.head.extra=null);P.mode=6;case 6:if(1024&P.flags&&(tt<(j=P.length)&&(j=tt),j&&(P.head&&(S=P.head.extra_len-P.length,P.head.extra||(P.head.extra=new Array(P.head.extra_len)),y.arraySet(P.head.extra,N,J,j,S)),512&P.flags&&(P.check=h(P.check,N,j,J)),tt-=j,J+=j,P.length-=j),P.length))break t;P.length=0,P.mode=7;case 7:if(2048&P.flags){if(tt===0)break t;for(j=0;S=N[J+j++],P.head&&S&&P.length<65536&&(P.head.name+=String.fromCharCode(S)),S&&j<tt;);if(512&P.flags&&(P.check=h(P.check,N,j,J)),tt-=j,J+=j,S)break t}else P.head&&(P.head.name=null);P.length=0,P.mode=8;case 8:if(4096&P.flags){if(tt===0)break t;for(j=0;S=N[J+j++],P.head&&S&&P.length<65536&&(P.head.comment+=String.fromCharCode(S)),S&&j<tt;);if(512&P.flags&&(P.check=h(P.check,N,j,J)),tt-=j,J+=j,S)break t}else P.head&&(P.head.comment=null);P.mode=9;case 9:if(512&P.flags){for(;G<16;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(W!==(65535&P.check)){R.msg="header crc mismatch",P.mode=30;break}G=W=0}P.head&&(P.head.hcrc=P.flags>>9&1,P.head.done=!0),R.adler=P.check=0,P.mode=12;break;case 10:for(;G<32;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}R.adler=P.check=l(W),G=W=0,P.mode=11;case 11:if(P.havedict===0)return R.next_out=ot,R.avail_out=ht,R.next_in=J,R.avail_in=tt,P.hold=W,P.bits=G,2;R.adler=P.check=1,P.mode=12;case 12:if(O===5||O===6)break t;case 13:if(P.last){W>>>=7&G,G-=7&G,P.mode=27;break}for(;G<3;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}switch(P.last=1&W,G-=1,3&(W>>>=1)){case 0:P.mode=14;break;case 1:if(k(P),P.mode=20,O!==6)break;W>>>=2,G-=2;break t;case 2:P.mode=17;break;case 3:R.msg="invalid block type",P.mode=30}W>>>=2,G-=2;break;case 14:for(W>>>=7&G,G-=7&G;G<32;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if((65535&W)!=(W>>>16^65535)){R.msg="invalid stored block lengths",P.mode=30;break}if(P.length=65535&W,G=W=0,P.mode=15,O===6)break t;case 15:P.mode=16;case 16:if(j=P.length){if(tt<j&&(j=tt),ht<j&&(j=ht),j===0)break t;y.arraySet(it,N,J,j,ot),tt-=j,J+=j,ht-=j,ot+=j,P.length-=j;break}P.mode=12;break;case 17:for(;G<14;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(P.nlen=257+(31&W),W>>>=5,G-=5,P.ndist=1+(31&W),W>>>=5,G-=5,P.ncode=4+(15&W),W>>>=4,G-=4,286<P.nlen||30<P.ndist){R.msg="too many length or distance symbols",P.mode=30;break}P.have=0,P.mode=18;case 18:for(;P.have<P.ncode;){for(;G<3;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.lens[H[P.have++]]=7&W,W>>>=3,G-=3}for(;P.have<19;)P.lens[H[P.have++]]=0;if(P.lencode=P.lendyn,P.lenbits=7,z={bits:P.lenbits},$=A(0,P.lens,0,19,P.lencode,0,P.work,z),P.lenbits=z.bits,$){R.msg="invalid code lengths set",P.mode=30;break}P.have=0,P.mode=19;case 19:for(;P.have<P.nlen+P.ndist;){for(;V=(D=P.lencode[W&(1<<P.lenbits)-1])>>>16&255,et=65535&D,!((rt=D>>>24)<=G);){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(et<16)W>>>=rt,G-=rt,P.lens[P.have++]=et;else{if(et===16){for(x=rt+2;G<x;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(W>>>=rt,G-=rt,P.have===0){R.msg="invalid bit length repeat",P.mode=30;break}S=P.lens[P.have-1],j=3+(3&W),W>>>=2,G-=2}else if(et===17){for(x=rt+3;G<x;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}G-=rt,S=0,j=3+(7&(W>>>=rt)),W>>>=3,G-=3}else{for(x=rt+7;G<x;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}G-=rt,S=0,j=11+(127&(W>>>=rt)),W>>>=7,G-=7}if(P.have+j>P.nlen+P.ndist){R.msg="invalid bit length repeat",P.mode=30;break}for(;j--;)P.lens[P.have++]=S}}if(P.mode===30)break;if(P.lens[256]===0){R.msg="invalid code -- missing end-of-block",P.mode=30;break}if(P.lenbits=9,z={bits:P.lenbits},$=A(r,P.lens,0,P.nlen,P.lencode,0,P.work,z),P.lenbits=z.bits,$){R.msg="invalid literal/lengths set",P.mode=30;break}if(P.distbits=6,P.distcode=P.distdyn,z={bits:P.distbits},$=A(n,P.lens,P.nlen,P.ndist,P.distcode,0,P.work,z),P.distbits=z.bits,$){R.msg="invalid distances set",P.mode=30;break}if(P.mode=20,O===6)break t;case 20:P.mode=21;case 21:if(6<=tt&&258<=ht){R.next_out=ot,R.avail_out=ht,R.next_in=J,R.avail_in=tt,P.hold=W,P.bits=G,w(R,nt),ot=R.next_out,it=R.output,ht=R.avail_out,J=R.next_in,N=R.input,tt=R.avail_in,W=P.hold,G=P.bits,P.mode===12&&(P.back=-1);break}for(P.back=0;V=(D=P.lencode[W&(1<<P.lenbits)-1])>>>16&255,et=65535&D,!((rt=D>>>24)<=G);){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(V&&(240&V)==0){for(q=rt,F=V,ut=et;V=(D=P.lencode[ut+((W&(1<<q+F)-1)>>q)])>>>16&255,et=65535&D,!(q+(rt=D>>>24)<=G);){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}W>>>=q,G-=q,P.back+=q}if(W>>>=rt,G-=rt,P.back+=rt,P.length=et,V===0){P.mode=26;break}if(32&V){P.back=-1,P.mode=12;break}if(64&V){R.msg="invalid literal/length code",P.mode=30;break}P.extra=15&V,P.mode=22;case 22:if(P.extra){for(x=P.extra;G<x;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.length+=W&(1<<P.extra)-1,W>>>=P.extra,G-=P.extra,P.back+=P.extra}P.was=P.length,P.mode=23;case 23:for(;V=(D=P.distcode[W&(1<<P.distbits)-1])>>>16&255,et=65535&D,!((rt=D>>>24)<=G);){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if((240&V)==0){for(q=rt,F=V,ut=et;V=(D=P.distcode[ut+((W&(1<<q+F)-1)>>q)])>>>16&255,et=65535&D,!(q+(rt=D>>>24)<=G);){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}W>>>=q,G-=q,P.back+=q}if(W>>>=rt,G-=rt,P.back+=rt,64&V){R.msg="invalid distance code",P.mode=30;break}P.offset=et,P.extra=15&V,P.mode=24;case 24:if(P.extra){for(x=P.extra;G<x;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.offset+=W&(1<<P.extra)-1,W>>>=P.extra,G-=P.extra,P.back+=P.extra}if(P.offset>P.dmax){R.msg="invalid distance too far back",P.mode=30;break}P.mode=25;case 25:if(ht===0)break t;if(j=nt-ht,P.offset>j){if((j=P.offset-j)>P.whave&&P.sane){R.msg="invalid distance too far back",P.mode=30;break}U=j>P.wnext?(j-=P.wnext,P.wsize-j):P.wnext-j,j>P.length&&(j=P.length),at=P.window}else at=it,U=ot-P.offset,j=P.length;for(ht<j&&(j=ht),ht-=j,P.length-=j;it[ot++]=at[U++],--j;);P.length===0&&(P.mode=21);break;case 26:if(ht===0)break t;it[ot++]=P.length,ht--,P.mode=21;break;case 27:if(P.wrap){for(;G<32;){if(tt===0)break t;tt--,W|=N[J++]<<G,G+=8}if(nt-=ht,R.total_out+=nt,P.total+=nt,nt&&(R.adler=P.check=P.flags?h(P.check,it,nt,ot-nt):E(P.check,it,nt,ot-nt)),nt=ht,(P.flags?W:l(W))!==P.check){R.msg="incorrect data check",P.mode=30;break}G=W=0}P.mode=28;case 28:if(P.wrap&&P.flags){for(;G<32;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(W!==(4294967295&P.total)){R.msg="incorrect length check",P.mode=30;break}G=W=0}P.mode=29;case 29:$=1;break t;case 30:$=-3;break t;case 31:return-4;default:return t}return R.next_out=ot,R.avail_out=ht,R.next_in=J,R.avail_in=tt,P.hold=W,P.bits=G,(P.wsize||nt!==R.avail_out&&P.mode<30&&(P.mode<27||O!==4))&&M(R,R.output,R.next_out,nt-R.avail_out)?(P.mode=31,-4):(gt-=R.avail_in,nt-=R.avail_out,R.total_in+=gt,R.total_out+=nt,P.total+=nt,P.wrap&&nt&&(R.adler=P.check=P.flags?h(P.check,it,nt,R.next_out-nt):E(P.check,it,nt,R.next_out-nt)),R.data_type=P.bits+(P.last?64:0)+(P.mode===12?128:0)+(P.mode===20||P.mode===15?256:0),(gt==0&&nt===0||O===4)&&$===e&&($=-5),$)},g.inflateEnd=function(R){if(!R||!R.state)return t;var O=R.state;return O.window&&(O.window=null),R.state=null,e},g.inflateGetHeader=function(R,O){var P;return R&&R.state?(2&(P=R.state).wrap)==0?t:((P.head=O).done=!1,e):t},g.inflateSetDictionary=function(R,O){var P,N=O.length;return R&&R.state?(P=R.state).wrap!==0&&P.mode!==11?t:P.mode===11&&E(1,O,N,0)!==P.check?-3:M(R,O,N,N)?(P.mode=31,-4):(P.havedict=1,e):t},g.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(d,f,g){"use strict";var y=d("../utils/common"),E=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],h=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],w=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],A=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];f.exports=function(r,n,e,t,p,c,s,l){var u,o,i,a,b,v,_,T,k,M=l.bits,R=0,O=0,P=0,N=0,it=0,J=0,ot=0,tt=0,ht=0,W=0,G=null,gt=0,nt=new y.Buf16(16),j=new y.Buf16(16),U=null,at=0;for(R=0;R<=15;R++)nt[R]=0;for(O=0;O<t;O++)nt[n[e+O]]++;for(it=M,N=15;1<=N&&nt[N]===0;N--);if(N<it&&(it=N),N===0)return p[c++]=20971520,p[c++]=20971520,l.bits=1,0;for(P=1;P<N&&nt[P]===0;P++);for(it<P&&(it=P),R=tt=1;R<=15;R++)if(tt<<=1,(tt-=nt[R])<0)return-1;if(0<tt&&(r===0||N!==1))return-1;for(j[1]=0,R=1;R<15;R++)j[R+1]=j[R]+nt[R];for(O=0;O<t;O++)n[e+O]!==0&&(s[j[n[e+O]]++]=O);if(v=r===0?(G=U=s,19):r===1?(G=E,gt-=257,U=h,at-=257,256):(G=w,U=A,-1),R=P,b=c,ot=O=W=0,i=-1,a=(ht=1<<(J=it))-1,r===1&&852<ht||r===2&&592<ht)return 1;for(;;){for(_=R-ot,k=s[O]<v?(T=0,s[O]):s[O]>v?(T=U[at+s[O]],G[gt+s[O]]):(T=96,0),u=1<<R-ot,P=o=1<<J;p[b+(W>>ot)+(o-=u)]=_<<24|T<<16|k|0,o!==0;);for(u=1<<R-1;W&u;)u>>=1;if(u!==0?(W&=u-1,W+=u):W=0,O++,--nt[R]==0){if(R===N)break;R=n[e+s[O]]}if(it<R&&(W&a)!==i){for(ot===0&&(ot=it),b+=P,tt=1<<(J=R-ot);J+ot<N&&!((tt-=nt[J+ot])<=0);)J++,tt<<=1;if(ht+=1<<J,r===1&&852<ht||r===2&&592<ht)return 1;p[i=W&a]=it<<24|J<<16|b-c|0}}return W!==0&&(p[b+W]=R-ot<<24|4194304),l.bits=it,0}},{"../utils/common":41}],51:[function(d,f,g){"use strict";f.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(d,f,g){"use strict";var y=d("../utils/common"),E=0,h=1;function w(D){for(var I=D.length;0<=--I;)D[I]=0}var A=0,r=29,n=256,e=n+1+r,t=30,p=19,c=2*e+1,s=15,l=16,u=7,o=256,i=16,a=17,b=18,v=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],_=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],M=new Array(2*(e+2));w(M);var R=new Array(2*t);w(R);var O=new Array(512);w(O);var P=new Array(256);w(P);var N=new Array(r);w(N);var it,J,ot,tt=new Array(t);function ht(D,I,H,L,B){this.static_tree=D,this.extra_bits=I,this.extra_base=H,this.elems=L,this.max_length=B,this.has_stree=D&&D.length}function W(D,I){this.dyn_tree=D,this.max_code=0,this.stat_desc=I}function G(D){return D<256?O[D]:O[256+(D>>>7)]}function gt(D,I){D.pending_buf[D.pending++]=255&I,D.pending_buf[D.pending++]=I>>>8&255}function nt(D,I,H){D.bi_valid>l-H?(D.bi_buf|=I<<D.bi_valid&65535,gt(D,D.bi_buf),D.bi_buf=I>>l-D.bi_valid,D.bi_valid+=H-l):(D.bi_buf|=I<<D.bi_valid&65535,D.bi_valid+=H)}function j(D,I,H){nt(D,H[2*I],H[2*I+1])}function U(D,I){for(var H=0;H|=1&D,D>>>=1,H<<=1,0<--I;);return H>>>1}function at(D,I,H){var L,B,Y=new Array(s+1),Q=0;for(L=1;L<=s;L++)Y[L]=Q=Q+H[L-1]<<1;for(B=0;B<=I;B++){var K=D[2*B+1];K!==0&&(D[2*B]=U(Y[K]++,K))}}function rt(D){var I;for(I=0;I<e;I++)D.dyn_ltree[2*I]=0;for(I=0;I<t;I++)D.dyn_dtree[2*I]=0;for(I=0;I<p;I++)D.bl_tree[2*I]=0;D.dyn_ltree[2*o]=1,D.opt_len=D.static_len=0,D.last_lit=D.matches=0}function V(D){8<D.bi_valid?gt(D,D.bi_buf):0<D.bi_valid&&(D.pending_buf[D.pending++]=D.bi_buf),D.bi_buf=0,D.bi_valid=0}function et(D,I,H,L){var B=2*I,Y=2*H;return D[B]<D[Y]||D[B]===D[Y]&&L[I]<=L[H]}function q(D,I,H){for(var L=D.heap[H],B=H<<1;B<=D.heap_len&&(B<D.heap_len&&et(I,D.heap[B+1],D.heap[B],D.depth)&&B++,!et(I,L,D.heap[B],D.depth));)D.heap[H]=D.heap[B],H=B,B<<=1;D.heap[H]=L}function F(D,I,H){var L,B,Y,Q,K=0;if(D.last_lit!==0)for(;L=D.pending_buf[D.d_buf+2*K]<<8|D.pending_buf[D.d_buf+2*K+1],B=D.pending_buf[D.l_buf+K],K++,L===0?j(D,B,I):(j(D,(Y=P[B])+n+1,I),(Q=v[Y])!==0&&nt(D,B-=N[Y],Q),j(D,Y=G(--L),H),(Q=_[Y])!==0&&nt(D,L-=tt[Y],Q)),K<D.last_lit;);j(D,o,I)}function ut(D,I){var H,L,B,Y=I.dyn_tree,Q=I.stat_desc.static_tree,K=I.stat_desc.has_stree,lt=I.stat_desc.elems,ft=-1;for(D.heap_len=0,D.heap_max=c,H=0;H<lt;H++)Y[2*H]!==0?(D.heap[++D.heap_len]=ft=H,D.depth[H]=0):Y[2*H+1]=0;for(;D.heap_len<2;)Y[2*(B=D.heap[++D.heap_len]=ft<2?++ft:0)]=1,D.depth[B]=0,D.opt_len--,K&&(D.static_len-=Q[2*B+1]);for(I.max_code=ft,H=D.heap_len>>1;1<=H;H--)q(D,Y,H);for(B=lt;H=D.heap[1],D.heap[1]=D.heap[D.heap_len--],q(D,Y,1),L=D.heap[1],D.heap[--D.heap_max]=H,D.heap[--D.heap_max]=L,Y[2*B]=Y[2*H]+Y[2*L],D.depth[B]=(D.depth[H]>=D.depth[L]?D.depth[H]:D.depth[L])+1,Y[2*H+1]=Y[2*L+1]=B,D.heap[1]=B++,q(D,Y,1),2<=D.heap_len;);D.heap[--D.heap_max]=D.heap[1],(function(X,mt){var At,Et,ct,yt,Rt,St,It=mt.dyn_tree,Lt=mt.max_code,Ft=mt.stat_desc.static_tree,_t=mt.stat_desc.has_stree,Mt=mt.stat_desc.extra_bits,Ct=mt.stat_desc.extra_base,Dt=mt.stat_desc.max_length,bt=0;for(yt=0;yt<=s;yt++)X.bl_count[yt]=0;for(It[2*X.heap[X.heap_max]+1]=0,At=X.heap_max+1;At<c;At++)Dt<(yt=It[2*It[2*(Et=X.heap[At])+1]+1]+1)&&(yt=Dt,bt++),It[2*Et+1]=yt,Lt<Et||(X.bl_count[yt]++,Rt=0,Ct<=Et&&(Rt=Mt[Et-Ct]),St=It[2*Et],X.opt_len+=St*(yt+Rt),_t&&(X.static_len+=St*(Ft[2*Et+1]+Rt)));if(bt!==0){do{for(yt=Dt-1;X.bl_count[yt]===0;)yt--;X.bl_count[yt]--,X.bl_count[yt+1]+=2,X.bl_count[Dt]--,bt-=2}while(0<bt);for(yt=Dt;yt!==0;yt--)for(Et=X.bl_count[yt];Et!==0;)Lt<(ct=X.heap[--At])||(It[2*ct+1]!==yt&&(X.opt_len+=(yt-It[2*ct+1])*It[2*ct],It[2*ct+1]=yt),Et--)}})(D,I),at(Y,ft,D.bl_count)}function S(D,I,H){var L,B,Y=-1,Q=I[1],K=0,lt=7,ft=4;for(Q===0&&(lt=138,ft=3),I[2*(H+1)+1]=65535,L=0;L<=H;L++)B=Q,Q=I[2*(L+1)+1],++K<lt&&B===Q||(K<ft?D.bl_tree[2*B]+=K:B!==0?(B!==Y&&D.bl_tree[2*B]++,D.bl_tree[2*i]++):K<=10?D.bl_tree[2*a]++:D.bl_tree[2*b]++,Y=B,ft=(K=0)===Q?(lt=138,3):B===Q?(lt=6,3):(lt=7,4))}function $(D,I,H){var L,B,Y=-1,Q=I[1],K=0,lt=7,ft=4;for(Q===0&&(lt=138,ft=3),L=0;L<=H;L++)if(B=Q,Q=I[2*(L+1)+1],!(++K<lt&&B===Q)){if(K<ft)for(;j(D,B,D.bl_tree),--K!=0;);else B!==0?(B!==Y&&(j(D,B,D.bl_tree),K--),j(D,i,D.bl_tree),nt(D,K-3,2)):K<=10?(j(D,a,D.bl_tree),nt(D,K-3,3)):(j(D,b,D.bl_tree),nt(D,K-11,7));Y=B,ft=(K=0)===Q?(lt=138,3):B===Q?(lt=6,3):(lt=7,4)}}w(tt);var z=!1;function x(D,I,H,L){nt(D,(A<<1)+(L?1:0),3),(function(B,Y,Q,K){V(B),K&&(gt(B,Q),gt(B,~Q)),y.arraySet(B.pending_buf,B.window,Y,Q,B.pending),B.pending+=Q})(D,I,H,!0)}g._tr_init=function(D){z||((function(){var I,H,L,B,Y,Q=new Array(s+1);for(B=L=0;B<r-1;B++)for(N[B]=L,I=0;I<1<<v[B];I++)P[L++]=B;for(P[L-1]=B,B=Y=0;B<16;B++)for(tt[B]=Y,I=0;I<1<<_[B];I++)O[Y++]=B;for(Y>>=7;B<t;B++)for(tt[B]=Y<<7,I=0;I<1<<_[B]-7;I++)O[256+Y++]=B;for(H=0;H<=s;H++)Q[H]=0;for(I=0;I<=143;)M[2*I+1]=8,I++,Q[8]++;for(;I<=255;)M[2*I+1]=9,I++,Q[9]++;for(;I<=279;)M[2*I+1]=7,I++,Q[7]++;for(;I<=287;)M[2*I+1]=8,I++,Q[8]++;for(at(M,e+1,Q),I=0;I<t;I++)R[2*I+1]=5,R[2*I]=U(I,5);it=new ht(M,v,n+1,e,s),J=new ht(R,_,0,t,s),ot=new ht(new Array(0),T,0,p,u)})(),z=!0),D.l_desc=new W(D.dyn_ltree,it),D.d_desc=new W(D.dyn_dtree,J),D.bl_desc=new W(D.bl_tree,ot),D.bi_buf=0,D.bi_valid=0,rt(D)},g._tr_stored_block=x,g._tr_flush_block=function(D,I,H,L){var B,Y,Q=0;0<D.level?(D.strm.data_type===2&&(D.strm.data_type=(function(K){var lt,ft=4093624447;for(lt=0;lt<=31;lt++,ft>>>=1)if(1&ft&&K.dyn_ltree[2*lt]!==0)return E;if(K.dyn_ltree[18]!==0||K.dyn_ltree[20]!==0||K.dyn_ltree[26]!==0)return h;for(lt=32;lt<n;lt++)if(K.dyn_ltree[2*lt]!==0)return h;return E})(D)),ut(D,D.l_desc),ut(D,D.d_desc),Q=(function(K){var lt;for(S(K,K.dyn_ltree,K.l_desc.max_code),S(K,K.dyn_dtree,K.d_desc.max_code),ut(K,K.bl_desc),lt=p-1;3<=lt&&K.bl_tree[2*k[lt]+1]===0;lt--);return K.opt_len+=3*(lt+1)+5+5+4,lt})(D),B=D.opt_len+3+7>>>3,(Y=D.static_len+3+7>>>3)<=B&&(B=Y)):B=Y=H+5,H+4<=B&&I!==-1?x(D,I,H,L):D.strategy===4||Y===B?(nt(D,2+(L?1:0),3),F(D,M,R)):(nt(D,4+(L?1:0),3),(function(K,lt,ft,X){var mt;for(nt(K,lt-257,5),nt(K,ft-1,5),nt(K,X-4,4),mt=0;mt<X;mt++)nt(K,K.bl_tree[2*k[mt]+1],3);$(K,K.dyn_ltree,lt-1),$(K,K.dyn_dtree,ft-1)})(D,D.l_desc.max_code+1,D.d_desc.max_code+1,Q+1),F(D,D.dyn_ltree,D.dyn_dtree)),rt(D),L&&V(D)},g._tr_tally=function(D,I,H){return D.pending_buf[D.d_buf+2*D.last_lit]=I>>>8&255,D.pending_buf[D.d_buf+2*D.last_lit+1]=255&I,D.pending_buf[D.l_buf+D.last_lit]=255&H,D.last_lit++,I===0?D.dyn_ltree[2*H]++:(D.matches++,I--,D.dyn_ltree[2*(P[H]+n+1)]++,D.dyn_dtree[2*G(I)]++),D.last_lit===D.lit_bufsize-1},g._tr_align=function(D){nt(D,2,3),j(D,o,M),(function(I){I.bi_valid===16?(gt(I,I.bi_buf),I.bi_buf=0,I.bi_valid=0):8<=I.bi_valid&&(I.pending_buf[I.pending++]=255&I.bi_buf,I.bi_buf>>=8,I.bi_valid-=8)})(D)}},{"../utils/common":41}],53:[function(d,f,g){"use strict";f.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(d,f,g){(function(y){(function(E,h){"use strict";if(!E.setImmediate){var w,A,r,n,e=1,t={},p=!1,c=E.document,s=Object.getPrototypeOf&&Object.getPrototypeOf(E);s=s&&s.setTimeout?s:E,w={}.toString.call(E.process)==="[object process]"?function(i){process.nextTick(function(){u(i)})}:(function(){if(E.postMessage&&!E.importScripts){var i=!0,a=E.onmessage;return E.onmessage=function(){i=!1},E.postMessage("","*"),E.onmessage=a,i}})()?(n="setImmediate$"+Math.random()+"$",E.addEventListener?E.addEventListener("message",o,!1):E.attachEvent("onmessage",o),function(i){E.postMessage(n+i,"*")}):E.MessageChannel?((r=new MessageChannel).port1.onmessage=function(i){u(i.data)},function(i){r.port2.postMessage(i)}):c&&"onreadystatechange"in c.createElement("script")?(A=c.documentElement,function(i){var a=c.createElement("script");a.onreadystatechange=function(){u(i),a.onreadystatechange=null,A.removeChild(a),a=null},A.appendChild(a)}):function(i){setTimeout(u,0,i)},s.setImmediate=function(i){typeof i!="function"&&(i=new Function(""+i));for(var a=new Array(arguments.length-1),b=0;b<a.length;b++)a[b]=arguments[b+1];return t[e]={callback:i,args:a},w(e),e++},s.clearImmediate=l}function l(i){delete t[i]}function u(i){if(p)setTimeout(u,0,i);else{var a=t[i];if(a){p=!0;try{(function(b){var v=b.callback,_=b.args;switch(_.length){case 0:v();break;case 1:v(_[0]);break;case 2:v(_[0],_[1]);break;case 3:v(_[0],_[1],_[2]);break;default:v.apply(h,_)}})(a)}finally{l(i),p=!1}}}}function o(i){i.source===E&&typeof i.data=="string"&&i.data.indexOf(n)===0&&u(+i.data.slice(n.length))}})(typeof self>"u"?y===void 0?this:y:self)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})),ca=we({awaitRenderedLayout:()=>hi,collectLayoutSnapshot:()=>fi,default:()=>Zt,defaultOptions:()=>oi,parseAsync:()=>ai,parseAsyncInWorker:()=>si,renderAsync:()=>ci,renderDocument:()=>li,yieldToBrowser:()=>di}),ni,Zt,ii,Se,rr,oi,ai,si,li,ci,hi,fi,di,ha=vt((()=>{ni=ze(Hr(),1),Zt=(ii=ni.default,Se={"./comments/comments-extended-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.CommentsExtendedPart=void 0;const f=m("../common/part"),g=m("../utils");class y extends f.Part{constructor(h,w){super(h,w),this.comments=[]}parseXml(h){const w=this._package.xmlParser;for(let A of w.elements(h,"commentEx"))this.comments.push({paraId:w.attr(A,"paraId"),paraIdParent:w.attr(A,"paraIdParent"),done:w.boolAttr(A,"done")});this.commentMap=(0,g.keyBy)(this.comments,A=>A.paraId)}}d.CommentsExtendedPart=y},"./comments/comments-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.CommentsPart=void 0;const f=m("../common/part"),g=m("../utils");class y extends f.Part{constructor(h,w,A){super(h,w),this._documentParser=A}parseXml(h){this.comments=this._documentParser.parseComments(h),this.commentMap=(0,g.keyBy)(this.comments,w=>w.id)}}d.CommentsPart=y},"./comments/elements":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.WmlCommentRangeEnd=d.WmlCommentRangeStart=d.WmlCommentReference=d.WmlComment=void 0;const f=m("../document/dom");class g extends f.OpenXmlElementBase{constructor(){super(...arguments),this.type=f.DomType.Comment}}d.WmlComment=g;class y extends f.OpenXmlElementBase{constructor(A){super(),this.id=A,this.type=f.DomType.CommentReference}}d.WmlCommentReference=y;class E extends f.OpenXmlElementBase{constructor(A){super(),this.id=A,this.type=f.DomType.CommentRangeStart}}d.WmlCommentRangeStart=E;class h extends f.OpenXmlElementBase{constructor(A){super(),this.id=A,this.type=f.DomType.CommentRangeEnd}}d.WmlCommentRangeEnd=h},"./common/content-types":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseContentTypes=function(f,g){return g.elements(f).map(y=>({extension:g.attr(y,"Extension"),partName:g.attr(y,"PartName"),contentType:g.attr(y,"ContentType")}))}},"./common/open-xml-package":function(m,C,d){var f=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(d,"__esModule",{value:!0}),d.OpenXmlPackage=void 0;const g=f(m("jszip")),y=m("../parser/xml-parser"),E=m("../utils"),h=m("./relationship"),w=m("./content-types");class A{constructor(e,t){this._zip=e,this.options=t,this.xmlParser=new y.XmlParser}get(e){const t=(function(p){return p.startsWith("/")?p.substr(1):p})(e);return this._zip.files[t]??this._zip.files[t.replace(/\//g,"\\")]}update(e,t){this._zip.file(e,t)}static async load(e,t){return new A(await g.default.loadAsync(e),t)}save(e="blob"){return this._zip.generateAsync({type:e})}load(e,t="string"){return this.get(e)?.async(t)??Promise.resolve(null)}async loadRelationships(e=null){let t="_rels/.rels";if(e!=null){const[c,s]=(0,E.splitPath)(e);t=`${c}_rels/${s}.rels`}const p=await this.load(t);return p?(0,h.parseRelationships)(r(this.parseXmlDocument(p)),this.xmlParser):null}async loadContentTypes(){const e=await this.load("[Content_Types].xml");return e?(0,w.parseContentTypes)(r(this.parseXmlDocument(e)),this.xmlParser):[]}parseXmlDocument(e){return(0,y.parseXmlString)(e,this.options.trimXmlDeclaration)}}function r(n){return n.firstElementChild??n.documentElement}d.OpenXmlPackage=A},"./common/part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.Part=void 0;const f=m("../parser/xml-parser");d.Part=class{constructor(g,y){this._package=g,this.path=y}async load(){this.rels=await this._package.loadRelationships(this.path);const g=await this._package.load(this.path),y=this._package.parseXmlDocument(g);this._package.options.keepOrigin&&(this._xmlDocument=y),this.parseXml(y.firstElementChild??y.documentElement)}save(){this._package.update(this.path,(0,f.serializeXmlString)(this._xmlDocument))}parseXml(g){}}},"./common/relationship":function(m,C,d){var f;Object.defineProperty(d,"__esModule",{value:!0}),d.RelationshipTypes=void 0,d.parseRelationships=function(g,y){return y.elements(g).map(E=>({id:y.attr(E,"Id"),type:y.attr(E,"Type"),target:y.attr(E,"Target"),targetMode:y.attr(E,"TargetMode")}))},(function(g){g.OfficeDocument="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",g.FontTable="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",g.Image="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",g.Numbering="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",g.Styles="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",g.StylesWithEffects="http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects",g.Theme="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",g.Settings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",g.WebSettings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",g.Hyperlink="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",g.Footnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",g.Endnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",g.Footer="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",g.Header="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",g.ExtendedProperties="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",g.CoreProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",g.CustomProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/custom-properties",g.Comments="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",g.CommentsExtended="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",g.AltChunk="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk",g.Chart="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",g.ChartUserShapes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes",g.DiagramData="http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData",g.DiagramLayout="http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout",g.DiagramQuickStyle="http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle",g.DiagramColors="http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors",g.Ink="http://schemas.microsoft.com/office/2007/relationships/ink",g.ContentPart="http://schemas.openxmlformats.org/officeDocument/2006/relationships/contentPart"})(f||(d.RelationshipTypes=f={}))},"./document/bookmarks":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseBookmarkStart=function(g,y){return{type:f.DomType.BookmarkStart,id:y.attr(g,"id"),name:y.attr(g,"name"),colFirst:y.intAttr(g,"colFirst"),colLast:y.intAttr(g,"colLast")}},d.parseBookmarkEnd=function(g,y){return{type:f.DomType.BookmarkEnd,id:y.attr(g,"id")}};const f=m("./dom")},"./document/border":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseBorder=g,d.parseBorders=function(y,E){var h={};for(let w of E.elements(y))switch(w.localName){case"left":h.left=g(w,E);break;case"top":h.top=g(w,E);break;case"right":h.right=g(w,E);break;case"bottom":h.bottom=g(w,E)}return h};const f=m("./common");function g(y,E){return{type:E.attr(y,"val"),color:E.attr(y,"color"),size:E.lengthAttr(y,"sz",f.LengthUsage.Border),offset:E.lengthAttr(y,"space",f.LengthUsage.Point),frame:E.boolAttr(y,"frame"),shadow:E.boolAttr(y,"shadow")}}},"./document/common":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.LengthUsage=d.ns=void 0,d.convertLength=function(g,y=d.LengthUsage.Dxa){if(g==null||g===""||/.+(p[xt]|[%])$/i.test(g))return g;var E=parseFloat(g);if(Number.isNaN(E))return null;var h=E*y.mul;return y.min!=null&&y.max!=null&&(h=(0,f.clamp)(h,y.min,y.max)),`${h.toFixed(2)}${y.unit}`},d.convertBoolean=function(g,y=!1){switch(g){case"1":case"on":case"true":return!0;case"0":case"off":case"false":return!1;default:return y}},d.convertPercentage=function(g){return g?parseInt(g)/100:null},d.parseCommonProperty=function(g,y,E){if(g.namespaceURI!=d.ns.wordml)return!1;switch(g.localName){case"color":y.color=E.attr(g,"val");break;case"sz":y.fontSize=E.lengthAttr(g,"val",d.LengthUsage.FontSize);break;case"szCs":y.fontSize??(y.fontSize=E.lengthAttr(g,"val",d.LengthUsage.FontSize));break;default:return!1}return!0};const f=m("../utils");d.ns={wordml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",drawingml:"http://schemas.openxmlformats.org/drawingml/2006/main",picture:"http://schemas.openxmlformats.org/drawingml/2006/picture",wordprocessingCanvas:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",wordprocessingGroup:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wordprocessingShape:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",chart:"http://schemas.openxmlformats.org/drawingml/2006/chart",diagram:"http://schemas.openxmlformats.org/drawingml/2006/diagram",relationship:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",drawing2014:"http://schemas.microsoft.com/office/drawing/2014/main",ink2010:"http://schemas.microsoft.com/office/2010/ink",word2010:"http://schemas.microsoft.com/office/word/2010/wordml",compatibility:"http://schemas.openxmlformats.org/markup-compatibility/2006",math:"http://schemas.openxmlformats.org/officeDocument/2006/math"},d.LengthUsage={Dxa:{mul:.05,unit:"pt"},SignedDxa:{mul:.05,unit:"pt"},Emu:{mul:1/12700,unit:"pt"},FontSize:{mul:.5,unit:"pt"},SignedHalfPoint:{mul:.5,unit:"pt"},Border:{mul:.125,unit:"pt",min:.25,max:12},Point:{mul:1,unit:"pt"},Percent:{mul:.02,unit:"%"},LineHeight:{mul:1/240,unit:""},VmlEmu:{mul:1/12700,unit:""}}},"./document/document-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.DocumentPart=void 0;const f=m("../common/part");class g extends f.Part{constructor(E,h,w){super(E,h),this._documentParser=w}parseXml(E){this.body=this._documentParser.parseDocumentFile(E)}}d.DocumentPart=g},"./document/document":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0})},"./document/dom":function(m,C,d){var f;Object.defineProperty(d,"__esModule",{value:!0}),d.OpenXmlElementBase=d.DomType=void 0,(function(g){g.Document="document",g.Paragraph="paragraph",g.Run="run",g.Break="break",g.NoBreakHyphen="noBreakHyphen",g.Table="table",g.Row="row",g.Cell="cell",g.Hyperlink="hyperlink",g.SmartTag="smartTag",g.Drawing="drawing",g.Image="image",g.Text="text",g.Tab="tab",g.PositionalTab="positionalTab",g.SoftHyphen="softHyphen",g.Symbol="symbol",g.BookmarkStart="bookmarkStart",g.BookmarkEnd="bookmarkEnd",g.Footer="footer",g.Header="header",g.FootnoteReference="footnoteReference",g.EndnoteReference="endnoteReference",g.Footnote="footnote",g.Endnote="endnote",g.SimpleField="simpleField",g.ComplexField="complexField",g.Instruction="instruction",g.VmlPicture="vmlPicture",g.MmlMath="mmlMath",g.Shape="shape",g.MmlMathParagraph="mmlMathParagraph",g.MmlFraction="mmlFraction",g.MmlFunction="mmlFunction",g.MmlFunctionName="mmlFunctionName",g.MmlNumerator="mmlNumerator",g.MmlDenominator="mmlDenominator",g.MmlRadical="mmlRadical",g.MmlBase="mmlBase",g.MmlDegree="mmlDegree",g.MmlSuperscript="mmlSuperscript",g.MmlSubscript="mmlSubscript",g.MmlPreSubSuper="mmlPreSubSuper",g.MmlSubArgument="mmlSubArgument",g.MmlSuperArgument="mmlSuperArgument",g.MmlNary="mmlNary",g.MmlDelimiter="mmlDelimiter",g.MmlRun="mmlRun",g.MmlEquationArray="mmlEquationArray",g.MmlLimit="mmlLimit",g.MmlLimitLower="mmlLimitLower",g.MmlLimitUpper="mmlLimitUpper",g.MmlSubSuperscript="mmlSubSuperscript",g.MmlPhantom="mmlPhantom",g.MmlBorderBox="mmlBorderBox",g.MmlAccent="mmlAccent",g.MmlMatrix="mmlMatrix",g.MmlMatrixRow="mmlMatrixRow",g.MmlBox="mmlBox",g.MmlBar="mmlBar",g.MmlGroupChar="mmlGroupChar",g.VmlElement="vmlElement",g.Chart="chart",g.SmartArt="smartArt",g.Ink="ink",g.Ruby="ruby",g.RubyBase="rubyBase",g.RubyText="rubyText",g.Inserted="inserted",g.Deleted="deleted",g.DeletedText="deletedText",g.Comment="comment",g.CommentReference="commentReference",g.CommentRangeStart="commentRangeStart",g.CommentRangeEnd="commentRangeEnd",g.AltChunk="altChunk"})(f||(d.DomType=f={})),d.OpenXmlElementBase=class{constructor(){this.children=[],this.cssStyle={}}}},"./document/fields":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0})},"./document/line-spacing":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseLineSpacing=function(f,g){return{before:g.lengthAttr(f,"before"),after:g.lengthAttr(f,"after"),line:g.intAttr(f,"line"),lineRule:g.attr(f,"lineRule")}}},"./document/paragraph":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseParagraphProperties=function(r,n){let e={};for(let t of n.elements(r))h(t,e,n);return e},d.parseParagraphProperty=h,d.parseTabs=w,d.parseNumbering=A;const f=m("./common"),g=m("./section"),y=m("./line-spacing"),E=m("./run");function h(r,n,e){if(r.namespaceURI!=f.ns.wordml)return!1;if((0,f.parseCommonProperty)(r,n,e))return!0;switch(r.localName){case"tabs":n.tabs=w(r,e);break;case"sectPr":n.sectionProps=(0,g.parseSectionProperties)(r,e);break;case"numPr":n.numbering=A(r,e);break;case"spacing":return n.lineSpacing=(0,y.parseLineSpacing)(r,e),!1;case"textAlignment":return n.textAlignment=e.attr(r,"val"),!1;case"keepLines":n.keepLines=e.boolAttr(r,"val",!0);break;case"keepNext":n.keepNext=e.boolAttr(r,"val",!0);break;case"pageBreakBefore":n.pageBreakBefore=e.boolAttr(r,"val",!0);break;case"widowControl":n.widowControl=e.boolAttr(r,"val",!0);break;case"outlineLvl":n.outlineLevel=e.intAttr(r,"val");break;case"pStyle":n.styleName=e.attr(r,"val");break;case"rPr":n.runProps=(0,E.parseRunProperties)(r,e);break;default:return!1}return!0}function w(r,n){return n.elements(r,"tab").map(e=>({position:n.lengthAttr(e,"pos"),leader:n.attr(e,"leader"),style:n.attr(e,"val")}))}function A(r,n){var e={};for(let t of n.elements(r))switch(t.localName){case"numId":e.id=n.attr(t,"val");break;case"ilvl":e.level=n.intAttr(t,"val")}return e}},"./document/run":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseRunProperties=function(y,E){let h={};for(let w of E.elements(y))g(w,h,E);return h},d.parseRunProperty=g;const f=m("./common");function g(y,E,h){return!!(0,f.parseCommonProperty)(y,E,h)}},"./document/section":function(m,C,d){var f=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(d,"__esModule",{value:!0}),d.SectionType=void 0,d.isSectionPageBreak=function(n){return n==null||n===E.NextPage||n===E.EvenPage||n===E.OddPage},d.isSectionColumnBreak=function(n){return n===E.NextColumn},d.parseSectionProperties=function(n,e=g.default){var t={};for(let p of e.elements(n))switch(p.localName){case"pgSz":t.pageSize={width:e.lengthAttr(p,"w"),height:e.lengthAttr(p,"h"),orientation:e.attr(p,"orient")};break;case"type":t.type=e.attr(p,"val");break;case"pgMar":t.pageMargins={left:e.lengthAttr(p,"left"),right:e.lengthAttr(p,"right"),top:e.lengthAttr(p,"top"),bottom:e.lengthAttr(p,"bottom"),header:e.lengthAttr(p,"header"),footer:e.lengthAttr(p,"footer"),gutter:e.lengthAttr(p,"gutter")};break;case"cols":t.columns=h(p,e);break;case"headerReference":(t.headerRefs??(t.headerRefs=[])).push(r(p,e));break;case"footerReference":(t.footerRefs??(t.footerRefs=[])).push(r(p,e));break;case"titlePg":t.titlePage=e.boolAttr(p,"val",!0);break;case"pgBorders":t.pageBorders=(0,y.parseBorders)(p,e);break;case"pgNumType":t.pageNumber=w(p,e);break;case"docGrid":t.docGrid=A(p,e)}return t};const g=f(m("../parser/xml-parser")),y=m("./border");var E;function h(n,e){return{numberOfColumns:e.intAttr(n,"num"),space:e.lengthAttr(n,"space"),separator:e.boolAttr(n,"sep"),equalWidth:e.boolAttr(n,"equalWidth",!0),columns:e.elements(n,"col").map(t=>({width:e.lengthAttr(t,"w"),space:e.lengthAttr(t,"space")}))}}function w(n,e){return{chapSep:e.attr(n,"chapSep"),chapStyle:e.attr(n,"chapStyle"),format:e.attr(n,"fmt"),start:e.intAttr(n,"start")}}function A(n,e){const t=e.intAttr(n,"charSpace",null);return{type:e.attr(n,"type"),linePitch:e.lengthAttr(n,"linePitch"),charSpace:t==null?null:`${(t/4096).toFixed(4)}em`,charSpaceRaw:t}}function r(n,e){return{id:e.attr(n,"id"),type:e.attr(n,"type")}}(function(n){n.Continuous="continuous",n.NextPage="nextPage",n.NextColumn="nextColumn",n.EvenPage="evenPage",n.OddPage="oddPage"})(E||(d.SectionType=E={}))},"./document/style":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0})},"./document-parser":function(m,C,d){var f=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(d,"__esModule",{value:!0}),d.DocumentParser=d.autos=void 0;const g=m("./document/dom"),y=m("./document/paragraph"),E=m("./document/section"),h=f(m("./parser/xml-parser")),w=m("./document/run"),A=m("./document/bookmarks"),r=m("./document/common"),n=m("./vml/vml"),e=m("./comments/elements"),t=m("./utils");d.autos={shd:"inherit",color:"black",borderColor:"black",highlight:"transparent"};const p=[r.ns.wordprocessingShape,r.ns.wordprocessingCanvas,r.ns.wordprocessingGroup,r.ns.drawingml,r.ns.picture],c={oMath:g.DomType.MmlMath,oMathPara:g.DomType.MmlMathParagraph,f:g.DomType.MmlFraction,func:g.DomType.MmlFunction,fName:g.DomType.MmlFunctionName,num:g.DomType.MmlNumerator,den:g.DomType.MmlDenominator,rad:g.DomType.MmlRadical,deg:g.DomType.MmlDegree,e:g.DomType.MmlBase,sSup:g.DomType.MmlSuperscript,sSub:g.DomType.MmlSubscript,sPre:g.DomType.MmlPreSubSuper,sup:g.DomType.MmlSuperArgument,sub:g.DomType.MmlSubArgument,d:g.DomType.MmlDelimiter,nary:g.DomType.MmlNary,eqArr:g.DomType.MmlEquationArray,lim:g.DomType.MmlLimit,limLow:g.DomType.MmlLimitLower,limUpp:g.DomType.MmlLimitUpper,sSubSup:g.DomType.MmlSubSuperscript,phant:g.DomType.MmlPhantom,borderBox:g.DomType.MmlBorderBox,acc:g.DomType.MmlAccent,m:g.DomType.MmlMatrix,mr:g.DomType.MmlMatrixRow,box:g.DomType.MmlBox,bar:g.DomType.MmlBar,groupChr:g.DomType.MmlGroupChar};d.DocumentParser=class{constructor(o){this.options={ignoreWidth:!1,debug:!1,hideWebHiddenContent:!1,...o}}parseNotes(o,i,a){var b=[];for(let v of h.default.elements(o,i)){const _=new a;_.id=h.default.attr(v,"id"),_.noteType=h.default.attr(v,"type"),_.children=this.parseBodyElements(v),b.push(_)}return b}parseComments(o){var i=[];for(let a of h.default.elements(o,"comment")){const b=new e.WmlComment;b.id=h.default.attr(a,"id"),b.author=h.default.attr(a,"author"),b.initials=h.default.attr(a,"initials"),b.date=h.default.attr(a,"date"),b.children=this.parseBodyElements(a),i.push(b)}return i}parseDocumentFile(o){var i=h.default.element(o,"body"),a=h.default.element(o,"background"),b=h.default.element(i,"sectPr");return{type:g.DomType.Document,children:this.parseBodyElements(i),props:b?(0,E.parseSectionProperties)(b,h.default):{},cssStyle:a?this.parseBackground(a):{}}}parseBackground(o){var i={},a=l.colorAttr(o,"color");return a&&(i["background-color"]=a),i}parseBodyElements(o){var i=[];for(const a of h.default.elements(o))switch(a.localName){case"p":i.push(this.parseParagraph(a));break;case"altChunk":i.push(this.parseAltChunk(a));break;case"tbl":i.push(this.parseTable(a));break;case"sdt":i.push(...this.parseSdt(a,b=>this.parseBodyElements(b)))}return i}parseStylesFile(o){var i=[];for(const a of h.default.elements(o))switch(a.localName){case"style":i.push(this.parseStyle(a));break;case"docDefaults":i.push(this.parseDefaultStyles(a))}return i}parseDefaultStyles(o){var i={id:null,name:null,target:null,basedOn:null,styles:[]};for(const v of h.default.elements(o))switch(v.localName){case"rPrDefault":var a=h.default.element(v,"rPr");a&&i.styles.push({target:"span",values:this.parseDefaultProperties(a,{})});break;case"pPrDefault":var b=h.default.element(v,"pPr");b&&i.styles.push({target:"p",values:this.parseDefaultProperties(b,{})})}return i}parseStyle(o){var i={id:h.default.attr(o,"styleId"),isDefault:h.default.boolAttr(o,"default"),name:null,target:null,basedOn:null,styles:[],linked:null};switch(h.default.attr(o,"type")){case"paragraph":i.target="p";break;case"table":i.target="table";break;case"character":i.target="span"}for(const a of h.default.elements(o))switch(a.localName){case"basedOn":i.basedOn=h.default.attr(a,"val");break;case"name":i.name=h.default.attr(a,"val");break;case"link":i.linked=h.default.attr(a,"val");break;case"next":i.next=h.default.attr(a,"val");break;case"aliases":i.aliases=h.default.attr(a,"val").split(",");break;case"pPr":i.styles.push({target:"p",values:this.parseDefaultProperties(a,{})}),i.paragraphProps=(0,y.parseParagraphProperties)(a,h.default);break;case"rPr":i.styles.push({target:"span",values:this.parseDefaultProperties(a,{})}),i.runProps=(0,w.parseRunProperties)(a,h.default);break;case"tblPr":case"tcPr":i.styles.push({target:"td",values:this.parseDefaultProperties(a,{})});break;case"tblStylePr":for(let b of this.parseTableStyle(a))i.styles.push(b);break;case"rsid":case"qFormat":case"hidden":case"semiHidden":case"unhideWhenUsed":case"autoRedefine":case"uiPriority":break;default:this.options.debug&&console.warn(`DOCX: Unknown style element: ${a.localName}`)}return i}parseTableStyle(o){var i=[],a="",b="";switch(h.default.attr(o,"type")){case"firstRow":b=".first-row",a="tr.first-row td";break;case"lastRow":b=".last-row",a="tr.last-row td";break;case"firstCol":b=".first-col",a="td.first-col";break;case"lastCol":b=".last-col",a="td.last-col";break;case"band1Vert":b=":not(.no-vband)",a="td.odd-col";break;case"band2Vert":b=":not(.no-vband)",a="td.even-col";break;case"band1Horz":b=":not(.no-hband)",a="tr.odd-row";break;case"band2Horz":b=":not(.no-hband)",a="tr.even-row";break;default:return[]}for(const v of h.default.elements(o))switch(v.localName){case"pPr":i.push({target:`${a} p`,mod:b,values:this.parseDefaultProperties(v,{})});break;case"rPr":i.push({target:`${a} span`,mod:b,values:this.parseDefaultProperties(v,{})});break;case"tblPr":case"tcPr":i.push({target:a,mod:b,values:this.parseDefaultProperties(v,{})})}return i}parseNumberingFile(o){const i=[],a=[],b={},v=[],_=[];for(const T of h.default.elements(o))switch(T.localName){case"numPicBullet":a.push(this.parseNumberingPicBullet(T));break;case"abstractNum":v.push(T);break;case"num":_.push(T)}for(const T of v)b[h.default.attr(T,"abstractNumId")]=this.parseAbstractNumbering(T,a);for(const T of _){const k=h.default.attr(T,"numId"),M=(b[h.default.elementAttr(T,"abstractNumId","val")]??[]).map(R=>this.cloneNumberingLevel(R,k));for(const R of h.default.elements(T,"lvlOverride")){const O=h.default.intAttr(R,"ilvl"),P=h.default.element(R,"lvl"),N=h.default.element(R,"startOverride");let it=M.find(J=>J.level==O);if(P){it=this.parseNumberingLevel(k,P,a);const J=M.findIndex(ot=>ot.level==O);J>=0?M[J]=it:M.push(it)}N&&it&&(it.start=h.default.intAttr(N,"val",it.start))}i.push(...M)}return i}cloneNumberingLevel(o,i){return{...o,id:i,pStyle:{...o.pStyle},rStyle:{...o.rStyle},bullet:o.bullet?{...o.bullet}:null}}parseNumberingPicBullet(o){const i=h.default.intAttr(o,"numPicBulletId"),a=h.default.element(o,"pict"),b=a&&h.default.element(a,"shape"),v=b&&h.default.element(b,"imagedata");if(v)return{id:i,src:h.default.attr(v,"id"),style:h.default.attr(b,"style")};const _=h.default.element(o,"drawing"),T=_?this.findDescendant(_,"blip"):null;if(T){const k=_?this.findDescendant(_,"extent"):null,M=[];if(k){const R=h.default.lengthAttr(k,"cx",r.LengthUsage.Emu),O=h.default.lengthAttr(k,"cy",r.LengthUsage.Emu);R&&M.push(`width:${R};`),O&&M.push(`height:${O};`)}return{id:i,src:h.default.attr(T,"embed")??h.default.attr(T,"link"),style:M.join("")||void 0}}return null}parseAbstractNumbering(o,i){var a=[],b=h.default.attr(o,"abstractNumId");for(const v of h.default.elements(o))v.localName==="lvl"&&a.push(this.parseNumberingLevel(b,v,i));return a}parseNumberingLevel(o,i,a){var b={id:o,level:h.default.intAttr(i,"ilvl"),start:1,pStyleName:void 0,pStyle:{},rStyle:{},suff:"tab"};for(const _ of h.default.elements(i))switch(_.localName){case"start":b.start=h.default.intAttr(_,"val");break;case"pPr":this.parseDefaultProperties(_,b.pStyle);break;case"rPr":this.parseDefaultProperties(_,b.rStyle);break;case"lvlPicBulletId":var v=h.default.intAttr(_,"val");b.bullet=a.find(T=>T?.id==v);break;case"lvlText":b.levelText=h.default.attr(_,"val");break;case"pStyle":b.pStyleName=h.default.attr(_,"val");break;case"numFmt":b.format=h.default.attr(_,"val");break;case"lvlRestart":b.restart=h.default.intAttr(_,"val");break;case"suff":b.suff=h.default.attr(_,"val")}return b}parseSdt(o,i){const a=h.default.element(o,"sdtContent");return a?i(a):[]}parseInserted(o,i){return{type:g.DomType.Inserted,children:i(o)?.children??[]}}parseDeleted(o,i){return{type:g.DomType.Deleted,children:i(o)?.children??[]}}parseAltChunk(o){return{type:g.DomType.AltChunk,children:[],id:h.default.attr(o,"id")}}parseParagraph(o){var i={type:g.DomType.Paragraph,children:[]};for(let a of h.default.elements(o))switch(a.localName){case"pPr":this.parseParagraphProperties(a,i);break;case"r":i.children.push(this.parseRun(a,i));break;case"hyperlink":i.children.push(this.parseHyperlink(a,i));break;case"smartTag":i.children.push(this.parseSmartTag(a,i));break;case"bookmarkStart":i.children.push((0,A.parseBookmarkStart)(a,h.default));break;case"bookmarkEnd":i.children.push((0,A.parseBookmarkEnd)(a,h.default));break;case"commentRangeStart":i.children.push(new e.WmlCommentRangeStart(h.default.attr(a,"id")));break;case"commentRangeEnd":i.children.push(new e.WmlCommentRangeEnd(h.default.attr(a,"id")));break;case"oMath":case"oMathPara":{const b=this.parseMathElement(a);b&&i.children.push(b);break}case"sdt":i.children.push(...this.parseSdt(a,b=>this.parseParagraph(b).children));break;case"ins":i.children.push(this.parseInserted(a,b=>this.parseParagraph(b)));break;case"del":i.children.push(this.parseDeleted(a,b=>this.parseParagraph(b)))}return i}parseParagraphProperties(o,i){this.parseDefaultProperties(o,i.cssStyle={},null,a=>{if(a.localName=="rPr"){h.default.element(a,"del")&&(i.props={...i.props??{},deletedParagraphMark:!0});const b=i.cssStyle["background-color"];return this.parseDefaultProperties(a,i.cssStyle),b==null?delete i.cssStyle["background-color"]:i.cssStyle["background-color"]=b,(0,y.parseParagraphProperty)(a,i,h.default),!0}if((0,y.parseParagraphProperty)(a,i,h.default))return!0;switch(a.localName){case"pStyle":i.styleName=h.default.attr(a,"val");break;case"cnfStyle":i.className=u.classNameOfCnfStyle(a);break;case"framePr":this.parseFrame(a,i);break;default:return!1}return!0})}parseFrame(o,i){h.default.attr(o,"dropCap")=="drop"&&(i.cssStyle.float="left")}parseHyperlink(o,i){var a={type:g.DomType.Hyperlink,parent:i,children:[]};a.anchor=h.default.attr(o,"anchor"),a.id=h.default.attr(o,"id");for(const b of h.default.elements(o))b.localName==="r"&&a.children.push(this.parseRun(b,a));return a}parseSmartTag(o,i){var a={type:g.DomType.SmartTag,parent:i,children:[]},b=h.default.attr(o,"uri"),v=h.default.attr(o,"element");b&&(a.uri=b),v&&(a.element=v);for(const _ of h.default.elements(o))switch(_.localName){case"r":a.children.push(this.parseRun(_,a));break;case"smartTag":a.children.push(this.parseSmartTag(_,a))}return a}parseSimpleField(o,i){const a={type:g.DomType.SimpleField,parent:i,children:[],instruction:h.default.attr(o,"instr"),lock:h.default.boolAttr(o,"lock",!1),dirty:h.default.boolAttr(o,"dirty",!1)};for(const b of h.default.elements(o))switch(b.localName){case"r":a.children.push(this.parseRun(b,a));break;case"hyperlink":a.children.push(this.parseHyperlink(b,a));break;case"smartTag":a.children.push(this.parseSmartTag(b,a));break;case"bookmarkStart":a.children.push((0,A.parseBookmarkStart)(b,h.default));break;case"bookmarkEnd":a.children.push((0,A.parseBookmarkEnd)(b,h.default));break;case"commentRangeStart":a.children.push(new e.WmlCommentRangeStart(h.default.attr(b,"id")));break;case"commentRangeEnd":a.children.push(new e.WmlCommentRangeEnd(h.default.attr(b,"id")));break;case"sdt":a.children.push(...this.parseSdt(b,v=>this.parseParagraph(v).children));break;case"ins":a.children.push(this.parseInserted(b,v=>this.parseParagraph(v)));break;case"del":a.children.push(this.parseDeleted(b,v=>this.parseParagraph(v)))}return a}parseRun(o,i){var a={type:g.DomType.Run,parent:i,children:[]};for(let b of h.default.elements(o))if(b=this.checkAlternateContent(b),b)switch(b.localName){case"t":a.children.push({type:g.DomType.Text,text:b.textContent});break;case"delText":a.children.push({type:g.DomType.DeletedText,text:b.textContent});break;case"commentReference":a.children.push(new e.WmlCommentReference(h.default.attr(b,"id")));break;case"fldSimple":a.children.push(this.parseSimpleField(b,a));break;case"instrText":a.fieldRun=!0,a.children.push({type:g.DomType.Instruction,text:b.textContent});break;case"fldChar":a.fieldRun=!0,a.children.push({type:g.DomType.ComplexField,charType:h.default.attr(b,"fldCharType"),lock:h.default.boolAttr(b,"lock",!1),dirty:h.default.boolAttr(b,"dirty",!1)});break;case"noBreakHyphen":a.children.push({type:g.DomType.NoBreakHyphen});break;case"softHyphen":a.children.push({type:g.DomType.SoftHyphen});break;case"cr":a.children.push({type:g.DomType.Break,break:"line"});break;case"ptab":a.children.push({type:g.DomType.PositionalTab});break;case"br":a.children.push({type:g.DomType.Break,break:h.default.attr(b,"type")||"textWrapping"});break;case"lastRenderedPageBreak":a.children.push({type:g.DomType.Break,break:"lastRenderedPageBreak"});break;case"sym":a.children.push({type:g.DomType.Symbol,font:(0,t.encloseFontFamily)(h.default.attr(b,"font")),char:h.default.hexAttr(b,"char")});break;case"tab":a.children.push({type:g.DomType.Tab});break;case"footnoteReference":a.children.push({type:g.DomType.FootnoteReference,id:h.default.attr(b,"id")});break;case"endnoteReference":a.children.push({type:g.DomType.EndnoteReference,id:h.default.attr(b,"id")});break;case"drawing":let v=this.parseDrawing(b);v&&a.children.push(v);break;case"pict":case"object":a.children.push(this.parseVmlPicture(b));break;case"ruby":a.children.push(this.parseRuby(b));break;case"rPr":this.parseRunProperties(b,a)}return a}parseRuby(o){const i={type:g.DomType.Ruby,children:[]};for(const a of h.default.elements(o))switch(a.localName){case"rubyPr":for(const b of h.default.elements(a))b.localName==="rubyAlign"&&(i.align=h.default.attr(b,"val"));break;case"rt":i.children.push(this.parseRubyContent(a,g.DomType.RubyText));break;case"rubyBase":i.children.push(this.parseRubyContent(a,g.DomType.RubyBase))}return i}parseRubyContent(o,i){const a={type:i,children:[]};for(const b of h.default.elements(o))if(b.localName=="r")a.children.push(this.parseRun(b,a));else if(i==g.DomType.RubyText&&b.localName=="rPr"){const v=h.default.element(b,"hps"),_=v?h.default.intAttr(v,"val",null):null;_!=null&&(a.cssStyle={...a.cssStyle??{},fontSize:_/2+"pt"})}return a}parseMathElement(o){const i=`${o.localName}Pr`,a={type:c[o.localName],children:[]};let b=!1;const v=_=>{if(c[_.localName]){const k=this.parseMathElement(_);k?(k.parent=a,a.children.push(k)):b=!0}else if(_.localName=="r"){var T=this.parseRun(_,a);T.type=g.DomType.MmlRun,a.children.push(T)}else if(_.localName==i)a.props=this.parseMathProperies(_);else if(_.localName=="ins")for(const k of h.default.elements(_))v(k);else if(_.localName=="del")if(this.options.renderChanges)for(const k of h.default.elements(_))v(k);else b=!0};for(const _ of h.default.elements(o))v(_);return b&&!this.hasVisibleMathContent(a)?null:a}hasVisibleMathContent(o){for(const i of o.children??[]){switch(i.type){case g.DomType.Text:if(i.text?.length)return!0;break;case g.DomType.DeletedText:if(this.options.renderChanges&&i.text?.length)return!0;break;case g.DomType.Symbol:case g.DomType.Tab:case g.DomType.PositionalTab:case g.DomType.NoBreakHyphen:case g.DomType.Break:return!0}if(this.hasVisibleMathContent(i))return!0}return!1}parseMathProperies(o){const i={};for(const a of h.default.elements(o))switch(a.localName){case"chr":i.char=h.default.attr(a,"val");break;case"vertJc":i.verticalJustification=h.default.attr(a,"val");break;case"pos":i.position=h.default.attr(a,"val");break;case"degHide":i.hideDegree=h.default.boolAttr(a,"val");break;case"begChr":i.beginChar=h.default.attr(a,"val");break;case"endChr":i.endChar=h.default.attr(a,"val");break;case"limLoc":i.limitLocation=h.default.attr(a,"val");break;case"grow":i.grow=h.default.boolAttr(a,"val");break;case"sepChr":i.separatorChar=h.default.attr(a,"val")}return i}parseRunProperties(o,i){this.parseDefaultProperties(o,i.cssStyle={},null,a=>{switch(a.localName){case"rStyle":i.styleName=h.default.attr(a,"val");break;case"vertAlign":i.verticalAlign=u.valueOfVertAlign(a,!0);break;default:return!1}return!0})}parseVmlPicture(o){const i={type:g.DomType.VmlPicture,children:[]};for(const a of h.default.elements(o)){const b=(0,n.parseVmlElement)(a,this);b&&i.children.push(b)}return i}checkAlternateContent(o){if(o.localName!="AlternateContent")return o;for(const a of h.default.elements(o).filter(b=>b.localName=="Choice")){const b=(h.default.attr(a,"Requires")??"").split(/\s+/).filter(Boolean);if(b.length>0&&b.every(v=>p.includes(o.lookupNamespaceURI(v)))){const v=h.default.elements(a)[0];if(v)return v}}const i=h.default.element(o,"Fallback");return i?h.default.elements(i)[0]:null}parseDrawing(o){for(var i of h.default.elements(o))switch(i.localName){case"inline":case"anchor":return this.parseDrawingWrapper(i)}}parseDrawingWrapper(o){var i,a,b,v,_,T,k,M,R,O,P,N={type:g.DomType.Drawing,children:[],cssStyle:{},props:{}},it=o.localName=="anchor";const J=(S,$)=>{$&&(N.cssStyle[S]=u.addSize(N.cssStyle[S],$))};J("margin-left",h.default.lengthAttr(o,"distL",r.LengthUsage.Emu)),J("margin-top",h.default.lengthAttr(o,"distT",r.LengthUsage.Emu)),J("margin-right",h.default.lengthAttr(o,"distR",r.LengthUsage.Emu)),J("margin-bottom",h.default.lengthAttr(o,"distB",r.LengthUsage.Emu));let ot=null,tt=null,ht=null,W=h.default.boolAttr(o,"simplePos",!1),G=h.default.boolAttr(o,"behindDoc",!1),gt=h.default.intAttr(o,"relativeHeight",null);gt!=null&&(N.cssStyle["z-index"]=`${Math.max(1,Math.round(gt/1e3))}`),G&&(N.cssStyle["z-index"]="0");let nt={relative:"page",align:"left",offset:"0"},j={relative:"page",align:"top",offset:"0"},U=!1,at=!1,rt=!1;for(var V of h.default.elements(o))switch(V.localName){case"simplePos":W&&(nt.offset=h.default.lengthAttr(V,"x",r.LengthUsage.Emu),j.offset=h.default.lengthAttr(V,"y",r.LengthUsage.Emu),at=nt.offset!=null,rt=j.offset!=null);break;case"extent":N.cssStyle.width=h.default.lengthAttr(V,"cx",r.LengthUsage.Emu),N.cssStyle.height=h.default.lengthAttr(V,"cy",r.LengthUsage.Emu);break;case"effectExtent":J("margin-left",h.default.lengthAttr(V,"l",r.LengthUsage.Emu)),J("margin-top",h.default.lengthAttr(V,"t",r.LengthUsage.Emu)),J("margin-right",h.default.lengthAttr(V,"r",r.LengthUsage.Emu)),J("margin-bottom",h.default.lengthAttr(V,"b",r.LengthUsage.Emu));break;case"docPr":N.props.title=h.default.attr(V,"title")??h.default.attr(V,"name"),N.props.alt=h.default.attr(V,"descr")??N.props.title;break;case"positionH":case"positionV":if(!W){let S=V.localName=="positionH",$=S?nt:j;var et=h.default.element(V,"align"),q=h.default.element(V,"posOffset");$.relative=h.default.attr(V,"relativeFrom")??$.relative,et&&($.align=et.textContent,S&&(U=!0)),q&&($.offset=(0,r.convertLength)(q.textContent,r.LengthUsage.Emu),S?at=$.offset!=null:rt=$.offset!=null)}break;case"wrapTopAndBottom":ot="wrapTopAndBottom";break;case"wrapNone":ot="wrapNone";break;case"wrapSquare":ot="wrapSquare",tt=h.default.attr(V,"wrapText");break;case"wrapTight":ot="wrapTight",tt=h.default.attr(V,"wrapText"),ht=this.parseWrapPolygon(V);break;case"wrapThrough":ot="wrapThrough",tt=h.default.attr(V,"wrapText"),ht=this.parseWrapPolygon(V);break;case"graphic":var F=this.parseGraphic(V);F&&(F.type==g.DomType.Image?((i=F).alt??(i.alt=N.props.alt),(a=F).title??(a.title=N.props.title)):F.type==g.DomType.Shape?((b=F).alt??(b.alt=N.props.alt),(v=F).title??(v.title=N.props.title)):F.type==g.DomType.Chart?((_=F).alt??(_.alt=N.props.alt),(T=F).title??(T.title=N.props.title)):F.type==g.DomType.SmartArt?((k=F).alt??(k.alt=N.props.alt),(M=F).title??(M.title=N.props.title)):F.type==g.DomType.Ink&&((R=F).alt??(R.alt=N.props.alt),(O=F).title??(O.title=N.props.title)),N.children.push(F))}N.props.anchorPosition={horizontal:{...nt},vertical:{...j},wrapType:ot,layoutInCell:h.default.boolAttr(o,"layoutInCell",!0),simplePos:W};const ut=()=>{switch(nt.align){case"center":N.cssStyle["margin-left"]="auto",N.cssStyle["margin-right"]="auto";break;case"right":N.cssStyle["margin-left"]="auto"}};return ot=="wrapTopAndBottom"?(N.cssStyle.display="block",N.cssStyle.clear="both",U?ut():at&&nt.offset&&(N.cssStyle["margin-inline-start"]=u.addSize(N.cssStyle["margin-inline-start"],nt.offset)),rt&&j.offset&&(N.cssStyle["margin-top"]=u.addSize(N.cssStyle["margin-top"],j.offset))):ot=="wrapNone"?(N.cssStyle.display="block",N.cssStyle.position=it?"absolute":"relative",nt.offset&&(N.cssStyle.left=nt.offset),j.offset&&(N.cssStyle.top=j.offset)):ot=="wrapSquare"||ot=="wrapTight"||ot=="wrapThrough"?(ht&&(N.cssStyle["shape-outside"]=ht,(P=N.cssStyle)["clip-path"]??(P["clip-path"]=ht)),tt=="left"?N.cssStyle.float="right":tt=="right"?N.cssStyle.float="left":nt.align=="left"||nt.align=="right"?N.cssStyle.float=nt.align:(N.cssStyle.display="block",ut())):!it||nt.align!="left"&&nt.align!="right"?N.cssStyle["vertical-align"]="text-bottom":N.cssStyle.float=nt.align,N}parseWrapPolygon(o){const i=h.default.element(o,"wrapPolygon");if(!i)return null;const a=[],b=v=>{const _=h.default.lengthAttr(v,"x",r.LengthUsage.Emu),T=h.default.lengthAttr(v,"y",r.LengthUsage.Emu);_&&T&&a.push(`${_} ${T}`)};for(const v of h.default.elements(i))v.localName!="start"&&v.localName!="lineTo"||b(v);return a.length>=3?`polygon(${a.join(", ")})`:null}parseGraphic(o){var i=h.default.element(o,"graphicData");if(!i)return null;for(let b of h.default.elements(i))switch(b.localName){case"pic":return this.parsePicture(b);case"wpc":case"wgp":case"grpSp":return this.parseDrawingContainer(b);case"wsp":case"sp":case"cxnSp":return this.parseWordprocessingShape(b);case"chart":return this.parseChartReference(b);case"relIds":case"diagram":return this.parseSmartArtReference(b);case"contentPart":case"ink":return this.parseInkReference(b)}const a=this.findDescendant(i,"contentPart");return a?this.parseInkReference(a):null}parseDrawingContainer(o){const i={type:g.DomType.Shape,children:[],cssStyle:{display:"inline-block",position:"relative",width:"100%",height:"100%",overflow:"visible","box-sizing":"border-box"},props:{dmlContainer:!0}},a=this.parseDmlGroupTransform(o);for(const b of h.default.elements(o))switch(b.localName){case"wsp":case"sp":case"cxnSp":const v=this.parseDmlPositionedShape(b,a);v&&i.children.push(v);break;case"grpSp":case"wgp":const _=this.parseDrawingContainer(b);_&&i.children.push(_)}return i}parseDmlGroupTransform(o){const i=h.default.element(o,"grpSpPr"),a=i?h.default.element(i,"xfrm"):h.default.element(o,"xfrm"),b=a?h.default.element(a,"off"):null,v=a?h.default.element(a,"ext"):null,_=a?h.default.element(a,"chOff"):null,T=a?h.default.element(a,"chExt"):null,k=v?h.default.floatAttr(v,"cx",null):null,M=v?h.default.floatAttr(v,"cy",null):null,R=T?h.default.floatAttr(T,"cx",null):null,O=T?h.default.floatAttr(T,"cy",null):null;return{offsetX:_?h.default.floatAttr(_,"x",0):0,offsetY:_?h.default.floatAttr(_,"y",0):0,left:b?h.default.floatAttr(b,"x",0):0,top:b?h.default.floatAttr(b,"y",0):0,scaleX:k&&R?k/R:1,scaleY:M&&O?M/O:1}}parseDmlPositionedShape(o,i){const a=h.default.element(o,"spPr");if(!a)return null;const b=this.parseDmlShapeBounds(a,i),v=[];let _=null,T=!1;for(const J of h.default.elements(o))switch(J.localName){case"txbx":case"textBox":T=!0;for(const ot of h.default.elements(J,"txbxContent"))v.push(...this.parseBodyElements(ot));break;case"bodyPr":_=J}_??(_=h.default.element(o,"bodyPr"));const k={position:"absolute",left:this.pt(b.left),top:this.pt(b.top),width:this.pt(b.width),height:this.pt(b.height),"box-sizing":"border-box",overflow:"hidden"},M=h.default.element(o,"cNvPr"),R=h.default.element(a,"custGeom"),O=h.default.element(a,"prstGeom"),P=this.parseDmlFillStyle(a),N=this.parseDmlLineStyle(h.default.element(a,"ln"));if(R){const J=this.parseDmlCustomGeometry(R);return{type:g.DomType.Shape,children:[],cssStyle:{...k,overflow:"visible"},props:{dmlSvg:!0,viewBox:J?.viewBox??"0 0 1 1",pathD:J?.d??"",fill:P.fill??"none",stroke:N.stroke??"none",strokeWidth:N.strokeWidth??"0",strokeDasharray:N.strokeDasharray},title:M?h.default.attr(M,"title")??h.default.attr(M,"name"):null,alt:M?h.default.attr(M,"descr"):null}}P.backgroundColor&&(k["background-color"]=P.backgroundColor),P.backgroundImage&&(k["background-image"]=P.backgroundImage),N.stroke&&N.stroke!="none"?k.border=`${N.strokeWidth||"0.75pt"} ${N.borderType||"solid"} ${N.stroke}`:k.border="none";const it=T?this.parseDmlTextBoxProperties(_):null;return{type:g.DomType.Shape,children:v,cssStyle:k,props:{dmlShape:!0,presetGeometry:O?h.default.attr(O,"prst"):null,...it},title:M?h.default.attr(M,"title")??h.default.attr(M,"name"):null,alt:M?h.default.attr(M,"descr"):null}}parseDmlShapeBounds(o,i){const a=h.default.element(o,"xfrm"),b=a?h.default.element(a,"off"):null,v=a?h.default.element(a,"ext"):null,_=i?.scaleX??1,T=i?.scaleY??1,k=i?.offsetX??0,M=i?.offsetY??0,R=i?.left??0,O=i?.top??0,P=b?h.default.floatAttr(b,"x",0):0,N=b?h.default.floatAttr(b,"y",0):0,it=v?h.default.floatAttr(v,"cx",0):0,J=v?h.default.floatAttr(v,"cy",0):0;return{left:this.emuToPt(R+(P-k)*_),top:this.emuToPt(O+(N-M)*T),width:Math.max(0,this.emuToPt(it*_)),height:Math.max(0,this.emuToPt(J*T))}}parseDmlFillStyle(o){if(h.default.element(o,"noFill"))return{fill:"none",backgroundColor:"transparent"};const i=h.default.element(o,"solidFill");if(i){const b=this.parseDmlColor(i)??"transparent";return{fill:b,backgroundColor:b}}const a=h.default.element(o,"pattFill");if(a){const b=this.parseDmlColor(h.default.element(a,"fgClr"))??"currentColor",v=this.parseDmlColor(h.default.element(a,"bgClr"))??"transparent",_=h.default.attr(a,"prst");return{fill:v,backgroundColor:v,backgroundImage:`repeating-linear-gradient(${_&&_.toLowerCase().includes("horz")?"0deg":"90deg"}, ${b} 0, ${b} 0.75pt, ${v} 0.75pt, ${v} 3pt)`}}return{fill:"none",backgroundColor:"transparent"}}parseDmlLineStyle(o){if(!o||h.default.element(o,"noFill"))return{stroke:"none",strokeWidth:"0",borderType:"none"};const i=this.parseDmlColor(h.default.element(o,"solidFill"))??"black",a=h.default.attr(o,"w")?this.pt(this.emuToPt(h.default.floatAttr(o,"w",0))):"0.75pt",b=h.default.elementAttr(o,"prstDash","val");let v=null,_="solid";return b&&b!="solid"&&(_="dashed",v=b=="dot"?"1 2":"4 3"),{stroke:i,strokeWidth:a,borderType:_,strokeDasharray:v}}parseDmlCustomGeometry(o){const i=h.default.element(o,"pathLst"),a=i?h.default.elements(i,"path"):[];let b="",v=1,_=1;for(const T of a){const k=h.default.floatAttr(T,"w",v),M=h.default.floatAttr(T,"h",_);v=Math.max(v,k||1),_=Math.max(_,M||1),b+=this.parseDmlPathData(T,k||1,M||1)}return{d:b.trim(),viewBox:`0 0 ${v} ${_}`}}parseDmlPathData(o,i,a){const b=[],v=_=>{const T=h.default.element(_,"pt");return T?`${this.dmlCoord(h.default.attr(T,"x"),i,a)} ${this.dmlCoord(h.default.attr(T,"y"),i,a)}`:"0 0"};for(const _ of h.default.elements(o))switch(_.localName){case"moveTo":b.push(`M ${v(_)}`);break;case"lnTo":b.push(`L ${v(_)}`);break;case"cubicBezTo":const T=h.default.elements(_,"pt").map(M=>`${this.dmlCoord(h.default.attr(M,"x"),i,a)} ${this.dmlCoord(h.default.attr(M,"y"),i,a)}`);T.length==3&&b.push(`C ${T.join(" ")}`);break;case"quadBezTo":const k=h.default.elements(_,"pt").map(M=>`${this.dmlCoord(h.default.attr(M,"x"),i,a)} ${this.dmlCoord(h.default.attr(M,"y"),i,a)}`);k.length==2&&b.push(`Q ${k.join(" ")}`);break;case"close":b.push("Z")}return b.join(" ")+" "}dmlCoord(o,i,a){if(o=="w"||o=="r")return i;if(o=="h"||o=="b")return a;if(o=="l"||o=="t")return 0;const b=parseFloat(o);return Number.isFinite(b)?b:0}dmlVerticalAlign(o){switch(o?h.default.attr(o,"anchor"):null){case"ctr":return"center";case"b":return"flex-end";default:return"flex-start"}}applyDmlTextInsets(o,i){if(o)for(const[a,b]of Object.entries({lIns:"padding-left",tIns:"padding-top",rIns:"padding-right",bIns:"padding-bottom"})){const v=h.default.attr(o,a);v!=null&&(i[b]=this.pt(this.emuToPt(parseFloat(v))))}}parseDmlTextBoxProperties(o){const i={};return this.applyDmlTextInsets(o,i),{dmlTextBox:!0,textInsets:i,textVerticalAlign:this.dmlVerticalAlign(o)}}emuToPt(o){return(Number.isFinite(o)?o:0)/12700}pt(o){return Math.round(100*o)/100+"pt"}parseChartReference(o){return{type:g.DomType.Chart,id:h.default.attr(o,"id"),cssStyle:{width:"100%",height:"100%"}}}parseSmartArtReference(o){const i=o.localName=="relIds"?o:this.findDescendant(o,"relIds");return{type:g.DomType.SmartArt,dataId:i?h.default.attr(i,"dm"):h.default.attr(o,"dm"),layoutId:i?h.default.attr(i,"lo"):h.default.attr(o,"lo"),styleId:i?h.default.attr(i,"qs"):h.default.attr(o,"qs"),colorId:i?h.default.attr(i,"cs"):h.default.attr(o,"cs"),cssStyle:{width:"100%",height:"100%"}}}parseInkReference(o){return{type:g.DomType.Ink,id:h.default.attr(o,"id"),cssStyle:{width:"100%",height:"100%"}}}parseGraphicPlaceholder(o){return{type:g.DomType.Shape,children:[{type:g.DomType.Text,text:`[${o}]`}],cssStyle:{display:"inline-flex","align-items":"center","justify-content":"center",border:"1px solid #999","background-color":"#f8f8f8",color:"#555","min-width":"2in","min-height":"1in"}}}parseWordprocessingShape(o){const i={type:g.DomType.Shape,children:[],cssStyle:{display:"inline-block",position:"relative","box-sizing":"border-box",overflow:"hidden"}},a=this.findDescendant(o,"cNvPr");let b=null,v=!1;a&&(i.title=h.default.attr(a,"title")??h.default.attr(a,"name"),i.alt=h.default.attr(a,"descr")??i.title);for(const _ of h.default.elements(o))switch(_.localName){case"spPr":this.parseDmlShapeProperties(_,i.cssStyle);break;case"txbx":case"textBox":v=!0;for(const T of h.default.elements(_,"txbxContent"))i.children.push(...this.parseBodyElements(T));break;case"bodyPr":b=_}return v&&(i.props={...i.props??{},...this.parseDmlTextBoxProperties(b)}),i}parseDmlShapeProperties(o,i){const a=h.default.element(o,"xfrm");if(a)for(const T of h.default.elements(a))switch(T.localName){case"ext":i.width=h.default.lengthAttr(T,"cx",r.LengthUsage.Emu),i.height=h.default.lengthAttr(T,"cy",r.LengthUsage.Emu);break;case"off":i.left=h.default.lengthAttr(T,"x",r.LengthUsage.Emu),i.top=h.default.lengthAttr(T,"y",r.LengthUsage.Emu)}const b=h.default.element(o,"solidFill"),v=h.default.element(o,"noFill"),_=h.default.element(o,"ln");if(b?i["background-color"]=this.parseDmlColor(b)??i["background-color"]:v&&(i["background-color"]="transparent"),_){const T=this.parseDmlColor(h.default.element(_,"solidFill"))??"black",k=h.default.lengthAttr(_,"w",r.LengthUsage.Emu)??"1px",M=h.default.elementAttr(_,"prstDash","val");i.border=`${k} ${M&&M!="solid"?"dashed":"solid"} ${T}`}}parseDmlColor(o){if(!o)return null;const i=h.default.element(o,"srgbClr"),a=h.default.element(o,"schemeClr"),b=h.default.element(o,"prstClr"),v=h.default.element(o,"sysClr");if(i)return this.applyDmlColorTransforms(i,`#${h.default.attr(i,"val")}`);if(a){const _=this.resolveDmlSchemeColor(h.default.attr(a,"val")),T=this.dmlSchemeColorFallback(_);return this.applyDmlColorTransforms(a,`var(--docx-${_}-color${T?`, ${T}`:""})`)}return v?this.applyDmlColorTransforms(v,`#${h.default.attr(v,"lastClr")??h.default.attr(v,"val")}`):b?this.applyDmlColorTransforms(b,h.default.attr(b,"val")):null}resolveDmlSchemeColor(o){switch(o){case"bg1":return"lt1";case"tx1":return"dk1";case"bg2":return"lt2";case"tx2":return"dk2";default:return o}}dmlSchemeColorFallback(o){switch(o){case"dk1":return"#000000";case"lt1":return"#FFFFFF";case"dk2":return"#44546A";case"lt2":return"#E7E6E6";case"accent1":return"#4472C4";case"accent2":return"#ED7D31";case"accent3":return"#A5A5A5";case"accent4":return"#FFC000";case"accent5":return"#5B9BD5";case"accent6":return"#70AD47";case"hlink":return"#0563C1";case"folHlink":return"#954F72";default:return null}}applyDmlColorTransforms(o,i){const a=h.default.elementAttr(o,"lumMod","val"),b=h.default.elementAttr(o,"lumOff","val");if(a!=null){const v=Math.max(0,Math.min(100,parseFloat(a)/1e3));Number.isFinite(v)&&v<100&&(i=`color-mix(in srgb, ${i} ${v}%, black)`)}if(b!=null){const v=Math.max(0,Math.min(100,parseFloat(b)/1e3));Number.isFinite(v)&&v>0&&(i=`color-mix(in srgb, ${i} ${100-v}%, white)`)}return i}findDescendant(o,i){for(const a of h.default.elements(o)){if(a.localName==i)return a;const b=this.findDescendant(a,i);if(b)return b}return null}parsePicture(o){var i={type:g.DomType.Image,src:"",cssStyle:{}},a=h.default.element(o,"blipFill"),b=a?h.default.element(a,"blip"):null,v=a?h.default.element(a,"srcRect"):null;i.src=b?h.default.attr(b,"embed")??h.default.attr(b,"link"):"";const _=this.findDescendant(o,"cNvPr");_&&(i.title=h.default.attr(_,"title")??h.default.attr(_,"name"),i.alt=h.default.attr(_,"descr")??i.title),v&&(i.srcRect=[h.default.intAttr(v,"l",0)/1e5,h.default.intAttr(v,"t",0)/1e5,h.default.intAttr(v,"r",0)/1e5,h.default.intAttr(v,"b",0)/1e5]);var T=h.default.element(o,"spPr"),k=T?h.default.element(T,"xfrm"):null,M=[];if(i.cssStyle.display="block",i.cssStyle.position="relative",i.cssStyle["object-fit"]="contain",k)for(var R of(i.rotation=h.default.intAttr(k,"rot",0)/6e4,h.default.boolAttr(k,"flipH",!1)&&M.push("scaleX(-1)"),h.default.boolAttr(k,"flipV",!1)&&M.push("scaleY(-1)"),h.default.elements(k)))switch(R.localName){case"ext":i.cssStyle.width=h.default.lengthAttr(R,"cx",r.LengthUsage.Emu),i.cssStyle.height=h.default.lengthAttr(R,"cy",r.LengthUsage.Emu);break;case"off":i.cssStyle.left=h.default.lengthAttr(R,"x",r.LengthUsage.Emu),i.cssStyle.top=h.default.lengthAttr(R,"y",r.LengthUsage.Emu)}return M.length>0&&(i.cssStyle.transform=M.join(" ")),i.cssStyle.width||(i.cssStyle.width="100%"),i.cssStyle.height||(i.cssStyle.height="100%"),i}parseTable(o){var i={type:g.DomType.Table,children:[]};for(const a of h.default.elements(o))switch(a.localName){case"tr":i.children.push(this.parseTableRow(a));break;case"tblGrid":i.columns=this.parseTableColumns(a);break;case"tblPr":this.parseTableProperties(a,i)}return i}parseTableColumns(o){var i=[];for(const a of h.default.elements(o))a.localName==="gridCol"&&i.push({width:h.default.lengthAttr(a,"w")});return i}parseTableProperties(o,i){i.cssStyle={},i.cellStyle={};let a=null;switch(this.parseDefaultProperties(o,i.cssStyle,i.cellStyle,b=>{switch(b.localName){case"tblStyle":i.styleName=h.default.attr(b,"val");break;case"tblLook":i.className=u.classNameOftblLook(b);break;case"tblInd":a=this.parseTableIndentation(b);break;case"tblpPr":this.parseTablePosition(b,i);break;case"tblStyleColBandSize":i.colBandSize=h.default.intAttr(b,"val");break;case"tblStyleRowBandSize":i.rowBandSize=h.default.intAttr(b,"val");break;case"hidden":i.cssStyle.display="none";break;default:return!1}return!0}),i.cssStyle["text-align"]){case"center":delete i.cssStyle["text-align"],i.cssStyle["margin-left"]="auto",i.cssStyle["margin-right"]="auto";break;case"right":delete i.cssStyle["text-align"],i.cssStyle["margin-left"]="auto";break;default:delete i.cssStyle["text-align"],a&&(i.cssStyle["margin-inline-start"]=u.addSize(i.cssStyle["margin-inline-start"],a))}}parseTableIndentation(o){const i=h.default.attr(o,"type");return i=="pct"||i=="auto"?null:h.default.lengthAttr(o,"w",r.LengthUsage.SignedDxa)}parseTablePosition(o,i){var a=h.default.lengthAttr(o,"topFromText"),b=h.default.lengthAttr(o,"bottomFromText"),v=h.default.lengthAttr(o,"rightFromText"),_=h.default.lengthAttr(o,"leftFromText");i.cssStyle.float="left",i.cssStyle["margin-bottom"]=u.addSize(i.cssStyle["margin-bottom"],b),i.cssStyle["margin-left"]=u.addSize(i.cssStyle["margin-left"],_),i.cssStyle["margin-right"]=u.addSize(i.cssStyle["margin-right"],v),i.cssStyle["margin-top"]=u.addSize(i.cssStyle["margin-top"],a)}parseTableRow(o){var i={type:g.DomType.Row,children:[]};for(const a of h.default.elements(o))switch(a.localName){case"tc":i.children.push(this.parseTableCell(a));break;case"trPr":case"tblPrEx":this.parseTableRowProperties(a,i)}return i}parseTableRowProperties(o,i){const a={};i.cssStyle=this.parseDefaultProperties(o,a,null,b=>{switch(b.localName){case"cnfStyle":i.className=u.classNameOfCnfStyle(b);break;case"tblHeader":i.isHeader=h.default.boolAttr(b,"val");break;case"gridBefore":i.gridBefore=h.default.intAttr(b,"val");break;case"gridAfter":i.gridAfter=h.default.intAttr(b,"val");break;case"cantSplit":h.default.boolAttr(b,"val",!0)&&(a["break-inside"]="avoid");break;default:return!1}return!0})}parseTableCell(o){var i={type:g.DomType.Cell,children:[]};for(const a of h.default.elements(o))switch(a.localName){case"tbl":i.children.push(this.parseTable(a));break;case"p":i.children.push(this.parseParagraph(a));break;case"tcPr":this.parseTableCellProperties(a,i)}return i}parseTableCellProperties(o,i){i.cssStyle=this.parseDefaultProperties(o,{},null,a=>{switch(a.localName){case"gridSpan":i.span=h.default.intAttr(a,"val",null);break;case"vMerge":i.verticalMerge=h.default.attr(a,"val")??"continue";break;case"cnfStyle":i.className=u.classNameOfCnfStyle(a);break;default:return!1}return!0}),this.parseTableCellVerticalText(o,i)}parseTableCellVerticalText(o,i){const a={btLr:{writingMode:"vertical-rl",transform:"rotate(180deg)"},lrTb:{writingMode:"vertical-lr",transform:"none"},tbRl:{writingMode:"vertical-rl",transform:"none"}};for(const b of h.default.elements(o))if(b.localName==="textDirection"){const v=a[h.default.attr(b,"val")]||{writingMode:"horizontal-tb"};i.cssStyle["writing-mode"]=v.writingMode,i.cssStyle.transform=v.transform}}parseDefaultProperties(o,i=null,a=null,b=null){i=i||{};for(const v of h.default.elements(o))if(!b?.(v))switch(v.localName){case"jc":i["text-align"]=u.valueOfJc(v);break;case"textAlignment":i["vertical-align"]=u.valueOfTextAlignment(v);break;case"color":i.color=l.colorAttr(v,"val",null,d.autos.color);break;case"sz":i["font-size"]=i["min-height"]=h.default.lengthAttr(v,"val",r.LengthUsage.FontSize);break;case"szCs":i["font-size"]??(i["font-size"]=h.default.lengthAttr(v,"val",r.LengthUsage.FontSize)),i["min-height"]??(i["min-height"]=i["font-size"]);break;case"shd":i["background-color"]=l.colorAttr(v,"fill",null,d.autos.shd);break;case"highlight":i["background-color"]=l.colorAttr(v,"val",null,d.autos.highlight);break;case"vertAlign":i["vertical-align"]=u.valueOfVertAlign(v);break;case"position":i["vertical-align"]=h.default.lengthAttr(v,"val",r.LengthUsage.SignedHalfPoint);break;case"scale":i["font-stretch"]=`${h.default.intAttr(v,"val",100)}%`;break;case"tcW":if(this.options.ignoreWidth)break;case"tblW":i.width=u.valueOfSize(v,"w");break;case"trHeight":this.parseTrHeight(v,i);break;case"strike":i["text-decoration"]=h.default.boolAttr(v,"val",!0)?"line-through":"none";break;case"dstrike":h.default.boolAttr(v,"val",!0)?(i["text-decoration-line"]="line-through",i["text-decoration-style"]="double"):i["text-decoration"]="none";break;case"b":i["font-weight"]=h.default.boolAttr(v,"val",!0)?"bold":"normal";break;case"i":i["font-style"]=h.default.boolAttr(v,"val",!0)?"italic":"normal";break;case"bCs":i["--docx-bidi-font-weight"]=h.default.boolAttr(v,"val",!0)?"bold":"normal",i.direction=="rtl"&&(i["font-weight"]=i["--docx-bidi-font-weight"]);break;case"iCs":i["--docx-bidi-font-style"]=h.default.boolAttr(v,"val",!0)?"italic":"normal",i.direction=="rtl"&&(i["font-style"]=i["--docx-bidi-font-style"]);break;case"caps":i["text-transform"]=h.default.boolAttr(v,"val",!0)?"uppercase":"none";break;case"smallCaps":i["font-variant"]=h.default.boolAttr(v,"val",!0)?"small-caps":"none";break;case"rtl":h.default.boolAttr(v,"val",!0)&&(i.direction="rtl",i["unicode-bidi"]="embed",i["--docx-bidi-font-weight"]&&(i["font-weight"]=i["--docx-bidi-font-weight"]),i["--docx-bidi-font-style"]&&(i["font-style"]=i["--docx-bidi-font-style"]));break;case"outline":h.default.boolAttr(v,"val",!0)&&(i["-webkit-text-stroke"]="0.5px currentColor");break;case"shadow":h.default.boolAttr(v,"val",!0)&&(i["text-shadow"]="1px 1px 0 currentColor");break;case"emboss":h.default.boolAttr(v,"val",!0)&&(i["text-shadow"]="-1px -1px 0 rgba(255,255,255,.75), 1px 1px 0 rgba(0,0,0,.35)");break;case"imprint":h.default.boolAttr(v,"val",!0)&&(i["text-shadow"]="1px 1px 0 rgba(255,255,255,.75), -1px -1px 0 rgba(0,0,0,.35)");break;case"em":i["text-emphasis-style"]=u.valueOfEmphasisMark(v);break;case"u":this.parseUnderline(v,i);break;case"ind":case"tblInd":this.parseIndentation(v,i);break;case"rFonts":this.parseFont(v,i);break;case"tblBorders":this.parseBorderProperties(v,a||i);break;case"tblCellSpacing":i["border-spacing"]=u.valueOfMargin(v),i["border-collapse"]="separate";break;case"pBdr":this.parseBorderProperties(v,i);break;case"bdr":i.border=u.valueOfBorder(v);break;case"tcBorders":this.parseBorderProperties(v,i);break;case"vanish":h.default.boolAttr(v,"val",!0)&&(i.display="none");break;case"kern":i["font-kerning"]=h.default.intAttr(v,"val",0)>0?"normal":"none";break;case"noWrap":i["white-space"]=h.default.boolAttr(v,"val",!0)?"nowrap":"normal";break;case"snapToGrid":i["--docx-snap-to-grid"]=h.default.boolAttr(v,"val",!0)?"1":"0";break;case"fitText":this.parseFitText(v,i);break;case"eastAsianLayout":this.parseEastAsianLayout(v,i);break;case"tblCellMar":case"tcMar":this.parseMarginProperties(v,a||i);break;case"tblLayout":i["table-layout"]=u.valueOfTblLayout(v);break;case"vAlign":i["vertical-align"]=u.valueOfTextAlignment(v);break;case"spacing":o.localName=="pPr"?this.parseSpacing(v,i):o.localName=="rPr"&&(i["letter-spacing"]=h.default.lengthAttr(v,"val",r.LengthUsage.SignedDxa));break;case"wordWrap":h.default.boolAttr(v,"val")&&(i["overflow-wrap"]="break-word");break;case"suppressAutoHyphens":i.hyphens=h.default.boolAttr(v,"val",!0)?"none":"auto";break;case"lang":i.$lang=h.default.attr(v,"val");break;case"rtl":case"bidi":h.default.boolAttr(v,"val",!0)&&(i.direction="rtl");break;case"pageBreakBefore":h.default.boolAttr(v,"val",!0)&&(i["break-before"]="page");break;case"keepLines":h.default.boolAttr(v,"val",!0)&&(i["break-inside"]="avoid");break;case"keepNext":h.default.boolAttr(v,"val",!0)&&(i["break-after"]="avoid");break;case"widowControl":h.default.boolAttr(v,"val",!0)&&(i.orphans="2",i.widows="2");break;case"webHidden":this.options.hideWebHiddenContent&&h.default.boolAttr(v,"val",!0)&&(i.display="none");break;case"specVanish":h.default.boolAttr(v,"val",!0)&&(i.display="none");break;case"tabs":case"outlineLvl":case"contextualSpacing":case"tblStyleColBandSize":case"tblStyleRowBandSize":case"suppressLineNumbers":case"noProof":break;default:this.options.debug&&console.warn(`DOCX: Unknown document element: ${o.localName}.${v.localName}`)}return i}parseFitText(o,i){const a=h.default.lengthAttr(o,"val");a&&(i.display="inline-block",i.width=a,i["text-align"]="justify",i["text-align-last"]="justify")}parseEastAsianLayout(o,i){h.default.boolAttr(o,"combine",!1)&&(i["text-combine-upright"]="all"),h.default.boolAttr(o,"vert",!1)&&(i["writing-mode"]="vertical-rl"),h.default.boolAttr(o,"vertCompress",!1)&&(i["font-stretch"]="condensed")}parseUnderline(o,i){var a=h.default.attr(o,"val");if(a!=null){switch(a){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":i["text-decoration"]="underline dashed";break;case"dotted":case"dottedHeavy":i["text-decoration"]="underline dotted";break;case"double":i["text-decoration"]="underline double";break;case"single":case"thick":case"words":i["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":i["text-decoration"]="underline wavy";break;case"none":i["text-decoration"]="none"}var b=l.colorAttr(o,"color");b&&(i["text-decoration-color"]=b)}}parseFont(o,i){var a=h.default.attr(o,"ascii"),b=h.default.attr(o,"hAnsi"),v=h.default.attr(o,"eastAsia"),_=h.default.attr(o,"cs"),T=[a,b,u.themeValue(o,"asciiTheme"),u.themeValue(o,"hAnsiTheme"),v,u.themeValue(o,"eastAsiaTheme"),_,u.themeValue(o,"cstheme")??u.themeValue(o,"csTheme")].filter(k=>k).map(k=>(0,t.encloseFontFamily)(k));if(T.length>0){const k=(i["font-family"]??"").split(",").map(M=>M.trim()).filter(M=>M);i["font-family"]=[...new Set([...k,...T])].join(", ")}}parseIndentation(o,i){var a=h.default.lengthAttr(o,"firstLine"),b=h.default.lengthAttr(o,"hanging"),v=h.default.lengthAttr(o,"left"),_=h.default.lengthAttr(o,"start"),T=h.default.lengthAttr(o,"right"),k=h.default.lengthAttr(o,"end");a&&(i["text-indent"]=a,i["--docx-text-indent"]=a),b&&(i["text-indent"]=`-${b}`,i["--docx-text-indent"]=`-${b}`,i["--docx-hanging-indent"]=b),(v||_)&&(i["margin-inline-start"]=v||_,i["--docx-margin-inline-start"]=v||_),(T||k)&&(i["margin-inline-end"]=T||k,i["--docx-margin-inline-end"]=T||k)}parseSpacing(o,i){var a=h.default.lengthAttr(o,"before"),b=h.default.lengthAttr(o,"after"),v=h.default.intAttr(o,"beforeLines",null),_=h.default.intAttr(o,"afterLines",null),T=h.default.boolAttr(o,"beforeAutospacing",!1),k=h.default.boolAttr(o,"afterAutospacing",!1),M=h.default.intAttr(o,"line",null),R=h.default.attr(o,"lineRule");if(T?i["margin-top"]="auto":v!=null?i["margin-top"]=`${(v/100).toFixed(2)}em`:a&&(i["margin-top"]=a),k?i["margin-bottom"]="auto":_!=null?i["margin-bottom"]=`${(_/100).toFixed(2)}em`:b&&(i["margin-bottom"]=b),M!==null)switch(R??"auto"){case"auto":default:i["line-height"]=`${(M/240).toFixed(2)}`;break;case"atLeast":i["line-height"]=`max(1em, ${(M/20).toFixed(2)}pt)`,i["min-height"]=`${(M/20).toFixed(2)}pt`;break;case"exact":case"exactly":i["line-height"]=i["min-height"]=`${(M/20).toFixed(2)}pt`}}parseMarginProperties(o,i){for(const a of h.default.elements(o))switch(a.localName){case"left":case"start":i["padding-left"]=u.valueOfMargin(a);break;case"right":case"end":i["padding-right"]=u.valueOfMargin(a);break;case"top":i["padding-top"]=u.valueOfMargin(a);break;case"bottom":i["padding-bottom"]=u.valueOfMargin(a)}}parseTrHeight(o,i){h.default.attr(o,"hRule"),i.height=h.default.lengthAttr(o,"val")}parseBorderProperties(o,i){for(const a of h.default.elements(o)){const b=u.valueOfBorder(a);switch(a.localName){case"start":case"left":i["border-left"]=b;break;case"end":case"right":i["border-right"]=b;break;case"top":i["border-top"]=b;break;case"bottom":i["border-bottom"]=b;break;case"insideH":i["border-top"]??(i["border-top"]=b),i["border-bottom"]??(i["border-bottom"]=b);break;case"insideV":i["border-left"]??(i["border-left"]=b),i["border-right"]??(i["border-right"]=b)}}}};const s=["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","none","red","white","yellow"];class l{static colorAttr(i,a,b=null,v="black"){var _=h.default.attr(i,a);if(_)return _=="auto"?v:s.includes(_)?_:`#${_}`;var T=h.default.attr(i,"themeColor");return T?`var(--docx-${T}-color)`:b}}class u{static themeValue(i,a){var b=h.default.attr(i,a);return b?`var(--docx-${b}-font)`:null}static valueOfSize(i,a){var b=r.LengthUsage.Dxa;switch(h.default.attr(i,"type")){case"dxa":break;case"pct":b=r.LengthUsage.Percent;break;case"auto":return"auto"}return h.default.lengthAttr(i,a,b)}static valueOfMargin(i){return h.default.lengthAttr(i,"w")}static valueOfBorder(i){var a=u.parseBorderType(h.default.attr(i,"val"));if(a=="none")return"none";var b=l.colorAttr(i,"color",d.autos.borderColor,d.autos.borderColor);return`${h.default.lengthAttr(i,"sz",r.LengthUsage.Border)??"1pt"} ${a} ${b=="auto"?d.autos.borderColor:b}`}static parseBorderType(i){switch(i){case"single":case"dashDotStroked":case"thick":case"thickThinLargeGap":case"thickThinMediumGap":case"thickThinSmallGap":case"thinThickLargeGap":case"thinThickMediumGap":case"thinThickSmallGap":case"thinThickThinLargeGap":case"thinThickThinMediumGap":case"thinThickThinSmallGap":case"threeDEmboss":case"threeDEngrave":case"wave":return"solid";case"dashed":case"dashSmallGap":return"dashed";case"dotDash":case"dotDotDash":case"dotted":return"dotted";case"double":case"doubleWave":case"triple":return"double";case"inset":return"inset";case"nil":case"none":return"none";case"outset":return"outset"}return"solid"}static valueOfTblLayout(i){return h.default.attr(i,"val")=="fixed"?"fixed":"auto"}static classNameOfCnfStyle(i){const a=h.default.attr(i,"val");return["first-row","last-row","first-col","last-col","odd-col","even-col","odd-row","even-row","ne-cell","nw-cell","se-cell","sw-cell"].filter((b,v)=>a[v]=="1").join(" ")}static valueOfJc(i){var a=h.default.attr(i,"val");switch(a){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":return"justify"}return a}static valueOfVertAlign(i,a=!1){var b=h.default.attr(i,"val");switch(b){case"subscript":return"sub";case"superscript":return a?"sup":"super"}return a?null:b}static valueOfEmphasisMark(i){switch(h.default.attr(i,"val")){case"none":return"none";case"comma":return'"﹐"';case"circle":return"circle";default:return"dot"}}static valueOfTextAlignment(i){var a=h.default.attr(i,"val");switch(a){case"auto":case"baseline":return"baseline";case"top":return"top";case"center":return"middle";case"bottom":return"bottom"}return a}static addSize(i,a){return i&&i!="0.00pt"&&i!="0px"?a&&a!="0.00pt"&&a!="0px"?`calc(${i} + ${a})`:i:a}static classNameOftblLook(i){const a=h.default.hexAttr(i,"val",0);let b="";return(h.default.boolAttr(i,"firstRow")||32&a)&&(b+=" first-row"),(h.default.boolAttr(i,"lastRow")||64&a)&&(b+=" last-row"),(h.default.boolAttr(i,"firstColumn")||128&a)&&(b+=" first-col"),(h.default.boolAttr(i,"lastColumn")||256&a)&&(b+=" last-col"),(h.default.boolAttr(i,"noHBand")||512&a)&&(b+=" no-hband"),(h.default.boolAttr(i,"noVBand")||1024&a)&&(b+=" no-vband"),b.trim()}}},"./document-props/core-props-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.CorePropsPart=void 0;const f=m("../common/part"),g=m("./core-props");class y extends f.Part{parseXml(h){this.props=(0,g.parseCoreProps)(h,this._package.xmlParser)}}d.CorePropsPart=y},"./document-props/core-props":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseCoreProps=function(f,g){const y={};for(let E of g.elements(f))switch(E.localName){case"title":y.title=E.textContent;break;case"description":y.description=E.textContent;break;case"subject":y.subject=E.textContent;break;case"creator":y.creator=E.textContent;break;case"keywords":y.keywords=E.textContent;break;case"language":y.language=E.textContent;break;case"lastModifiedBy":y.lastModifiedBy=E.textContent;break;case"revision":E.textContent&&(y.revision=parseInt(E.textContent))}return y}},"./document-props/custom-props-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.CustomPropsPart=void 0;const f=m("../common/part"),g=m("./custom-props");class y extends f.Part{parseXml(h){this.props=(0,g.parseCustomProps)(h,this._package.xmlParser)}}d.CustomPropsPart=y},"./document-props/custom-props":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseCustomProps=function(f,g){return g.elements(f,"property").map(y=>{const E=y.firstChild;return{formatId:g.attr(y,"fmtid"),name:g.attr(y,"name"),type:E.nodeName,value:E.textContent}})}},"./document-props/extended-props-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.ExtendedPropsPart=void 0;const f=m("../common/part"),g=m("./extended-props");class y extends f.Part{parseXml(h){this.props=(0,g.parseExtendedProps)(h,this._package.xmlParser)}}d.ExtendedPropsPart=y},"./document-props/extended-props":function(m,C,d){function f(g){if(g!==void 0)return parseInt(g)}Object.defineProperty(d,"__esModule",{value:!0}),d.parseExtendedProps=function(g,y){const E={};for(let h of y.elements(g))switch(h.localName){case"Template":E.template=h.textContent;break;case"Pages":E.pages=f(h.textContent);break;case"Words":E.words=f(h.textContent);break;case"Characters":E.characters=f(h.textContent);break;case"Application":E.application=h.textContent;break;case"Lines":E.lines=f(h.textContent);break;case"Paragraphs":E.paragraphs=f(h.textContent);break;case"Company":E.company=h.textContent;break;case"AppVersion":E.appVersion=h.textContent}return E}},"./docx-preview-worker":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0});const f=m("./word-document"),g=m("./document-parser"),y=m("./input-validation"),E=self;function h(w,A,r={}){E.postMessage({id:w,type:A,...r})}E.onmessage=async w=>{const A=w.data;if(!A||A.type!=="parse")return;const r=A.id;try{const n={...A.options,useWorker:!1,h:void 0,progress:void 0};(0,y.assertNonEmptyDocxInput)(A.data),h(r,"progress",{message:"Loading package relationships"});const e=await f.WordDocument.load(A.data,new g.DocumentParser(n),n);h(r,"progress",{message:"Serializing parsed document model"}),h(r,"parsed",{snapshot:await e.createSnapshot()})}catch(n){h(r,"error",{error:{message:n?.message??`${n}`,stack:n?.stack}})}}},"./docx-preview":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.defaultOptions=void 0,d.parseAsync=A,d.renderDocument=n,d.renderAsync=async function(a,b,v,_){const T={...d.defaultOptions,..._};(0,h.assertViewerLicense)("docx",T.licenseToken);const k=await A(a,T),M=await n(k,T);v??(v=b),v.innerHTML="",b.innerHTML="";let R=0;for(let P of M)(P.nodeName==="STYLE"?v:b).appendChild(P),R++,T.renderYieldEveryMs>0&&R%8==0&&await i();l(b,T.className);let O=null;return T.awaitLayout&&(T.progress?.({phase:"layout",message:"Measuring rendered pages"}),O=await c(b,T),l(b,T.className)),T.progress?.({phase:"done",current:O?.pageCount,total:O?.pageCount,message:"DOCX render complete"}),k},d.parseAsyncInWorker=p,d.awaitRenderedLayout=c,d.collectLayoutSnapshot=s,d.syncNumberingMarkerStyles=l,d.yieldToBrowser=i;const f=m("./word-document"),g=m("./document-parser"),y=m("./html-renderer"),E=m("./html"),h=m("./license-gate"),w=m("./input-validation");function A(a,b){const v={...d.defaultOptions,...b};return(0,h.assertViewerLicense)("docx",v.licenseToken),(0,w.assertNonEmptyDocxInput)(a),(function(_){return!(!_.useWorker||!_.workerUrl||typeof Worker>"u")})(v)?p(a,v).catch(_=>{if(!v.workerFallback)throw _;return v.debug&&console.warn("docx-preview: worker parsing failed; falling back to main thread",_),r(a,{...v,useWorker:!1})}):r(a,v)}function r(a,b){return(0,w.assertNonEmptyDocxInput)(a),b.progress?.({phase:"parse",message:"Parsing DOCX on main thread"}),f.WordDocument.load(a,new g.DocumentParser(b),b)}async function n(a,b){const v={...d.defaultOptions,...b};return(0,h.assertViewerLicense)("docx",v.licenseToken),await new y.HtmlRenderer().render(a,v)}function e(a){const{h:b,progress:v,licenseToken:_,...T}=a;return{...T,useWorker:!1}}d.defaultOptions={ignoreHeight:!1,ignoreWidth:!1,fixedPageHeight:!0,ignoreFonts:!1,breakPages:!0,strictWordCompatibility:!0,paginationTolerance:2,maxDynamicPaginationPasses:1e3,awaitLayout:!0,useWorker:!0,workerUrl:void 0,workerJsZipUrl:void 0,workerFallback:!0,workerTimeout:12e4,renderPageBatchSize:2,renderYieldEveryMs:16,progress:void 0,preserveComplexFieldResults:!0,updatePageReferences:!1,hideWebHiddenContent:!1,debug:!1,experimental:!1,className:"docx",inWrapper:!0,hideWrapperOnPrint:!1,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!1,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1,renderAltChunks:!0,h:E.h};let t=0;function p(a,b){const v={...d.defaultOptions,...b};return(0,h.assertViewerLicense)("docx",v.licenseToken),(0,w.assertNonEmptyDocxInput)(a),v.workerUrl&&typeof Worker<"u"?(v.progress?.({phase:"worker",message:"Starting DOCX parse worker"}),new Promise((_,T)=>{const k=++t,M=new Worker(v.workerUrl);let R=!1,O=null;const P=()=>{R=!0,O&&clearTimeout(O),M.terminate()};v.workerTimeout>0&&(O=setTimeout(()=>{R||(P(),T(new Error(`docx-preview worker timed out after ${v.workerTimeout}ms`)))},v.workerTimeout)),M.onerror=N=>{R||(P(),T(new Error(N.message||"docx-preview worker error")))},M.onmessage=N=>{const it=N.data??{};if(it.id===k||it.type==="ready")if(it.type!=="progress"){if(it.type==="parsed")return P(),v.progress?.({phase:"worker",message:"Worker parse complete"}),void _(f.WordDocument.fromSnapshot(it.snapshot,v));if(it.type==="error"){P();const J=new Error(it.error?.message??"docx-preview worker parse failed");J.stack=it.error?.stack,T(J)}}else v.progress?.({phase:"worker",current:it.current,total:it.total,message:it.message})},M.postMessage({type:"parse",id:k,data:a,options:e(v),jsZipUrl:v.workerJsZipUrl})})):r(a,{...v,useWorker:!1})}async function c(a,b){const v={...d.defaultOptions,...b};await(async function(T){const k=Array.from(T.querySelectorAll("img"));await Promise.allSettled(k.map(M=>M.complete?Promise.resolve():new Promise(R=>{M.addEventListener("load",R,{once:!0}),M.addEventListener("error",R,{once:!0})})))})(a),document.fonts?.ready&&await document.fonts.ready;const _=a.querySelector(`.${v.className}-wrapper`);if(v.breakPages&&v.fixedPageHeight&&!v.ignoreHeight&&_)for(let T=0;T<Math.max(2,Math.min(120,v.maxDynamicPaginationPasses??120))&&(await i(),_.dataset.docxPaginated!=="true")&&(_.dataset.docxPaginating==="true"||_.dataset.docxPaginationScheduled==="true");T++);return await i(),s(a,v)}function s(a,b){const v={...d.defaultOptions,...b},_=Array.from(a.querySelectorAll(`section.${v.className}`)).map((T,k)=>{const M=Array.from(T.querySelectorAll("[data-docx-field-instr]")),R=Array.from(T.querySelectorAll("img")).filter(P=>!P.complete||P.naturalWidth===0).length,O=T.clientHeight>0&&T.scrollHeight>T.clientHeight+(v.paginationTolerance??2);return{index:k+1,section:T.dataset.docxSection??"",pageNumber:parseInt(T.dataset.docxPageNumber??`${k+1}`,10),sectionPageNumber:parseInt(T.dataset.docxSectionPageNumber??"1",10),width:T.clientWidth,height:T.clientHeight,scrollHeight:T.scrollHeight,overflow:O,textLength:T.textContent?.length??0,anchors:Array.from(T.querySelectorAll("[id]")).map(P=>P.id).filter(Boolean),fields:M.map(P=>({instruction:P.dataset.docxFieldInstr??"",value:P.textContent??""})),floats:T.querySelectorAll('[data-docx-float="true"]').length,unresolvedMedia:R}});return{pageCount:_.length,overflowPages:_.filter(T=>T.overflow).map(T=>T.index),unresolvedMedia:_.reduce((T,k)=>T+k.unresolvedMedia,0),pages:_}}function l(a,b="docx"){if(!a||typeof getComputedStyle!="function")return;const v=Array.from(a.querySelectorAll("p")),_=`${b}-num-`;for(const T of v){if(!T.className?.includes(_))continue;const k=getComputedStyle(T,"::before");if(!k.content||k.content=="none"||k.content=="normal")continue;const M=u(T);if(!M||M==T)continue;const R=getComputedStyle(M);o(T,"--docx-marker-font-family",R.fontFamily),o(T,"--docx-marker-font-size",R.fontSize),o(T,"--docx-marker-font-style",R.fontStyle),o(T,"--docx-marker-font-weight",R.fontWeight)}}function u(a){const b=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);for(;b.nextNode();){const v=b.currentNode;if(!v.nodeValue?.trim())continue;const _=v.parentElement;if(!_||_==a)return a;const T=getComputedStyle(_);if(T.display!="none"&&T.visibility!="hidden")return _}return null}function o(a,b,v){v&&a.style.setProperty(b,v)}function i(){return new Promise(a=>{const b=globalThis;typeof b.requestIdleCallback=="function"?b.requestIdleCallback(()=>a(),{timeout:32}):typeof b.requestAnimationFrame=="function"?b.requestAnimationFrame(()=>a()):setTimeout(a,0)})}},"./font-table/font-table":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.FontTablePart=void 0;const f=m("../common/part"),g=m("./fonts");class y extends f.Part{parseXml(h){this.fonts=(0,g.parseFonts)(h,this._package.xmlParser)}}d.FontTablePart=y},"./font-table/fonts":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseFonts=function(E,h){return h.elements(E).map(w=>g(w,h))},d.parseFont=g,d.parseEmbedFontRef=y;const f={embedRegular:"regular",embedBold:"bold",embedItalic:"italic",embedBoldItalic:"boldItalic"};function g(E,h){let w={name:h.attr(E,"name"),embedFontRefs:[]};for(let A of h.elements(E))switch(A.localName){case"family":w.family=h.attr(A,"val");break;case"altName":w.altName=h.attr(A,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":w.embedFontRefs.push(y(A,h))}return w}function y(E,h){return{id:h.attr(E,"id"),key:h.attr(E,"fontKey"),type:f[E.localName]}}},"./header-footer/elements":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.WmlFooter=d.WmlHeader=void 0;const f=m("../document/dom");class g extends f.OpenXmlElementBase{constructor(){super(...arguments),this.type=f.DomType.Header}}d.WmlHeader=g;class y extends f.OpenXmlElementBase{constructor(){super(...arguments),this.type=f.DomType.Footer}}d.WmlFooter=y},"./header-footer/parts":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.FooterPart=d.HeaderPart=d.BaseHeaderFooterPart=void 0;const f=m("../common/part"),g=m("./elements");class y extends f.Part{constructor(h,w,A){super(h,w),this._documentParser=A}parseXml(h){this.rootElement=this.createRootElement(),this.rootElement.children=this._documentParser.parseBodyElements(h)}}d.BaseHeaderFooterPart=y,d.HeaderPart=class extends y{createRootElement(){return new g.WmlHeader}},d.FooterPart=class extends y{createRootElement(){return new g.WmlFooter}}},"./html-renderer":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.HtmlRenderer=void 0;const f=m("./document/dom"),g=m("./utils"),y=m("./javascript"),E=m("./document/section"),h=m("./html"),w=m("./parser/xml-parser");function A(e){return e>="0"&&e<="9"}function r(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=913&&t<=1023||t>=119808&&t<=120831}function n(e){return"()+-−=<>≤≥≈≠×÷*/·∙∑Σ∏∫√∞∂∇,.;:[]{}|‖!′″→←↔⇒⇔∈∉⊂⊃⊆⊇∧∨¬".includes(e)}d.HtmlRenderer=class{constructor(){this.className="docx",this.styleMap={},this.currentPart=null,this.currentSectionProps=null,this.currentPageNumber=1,this.currentSectionNumber=1,this.currentSectionPageNumber=1,this.totalPages=1,this.sectionPageCount=1,this.tableVerticalMerges=[],this.currentVerticalMerge=null,this.tableCellPositions=[],this.currentCellPosition=null,this.currentTableRow=null,this.footnoteMap={},this.endnoteMap={},this.currentEndnoteIds=[],this.usedHederFooterParts=[],this.currentTabs=[],this.currentParagraph=null,this.currentParagraphTabIndex=0,this.currentParagraphTabCount=0,this.commentMap={},this.bookmarkTextMap={},this.bookmarkIdToName={},this.tocEntries=[],this.fieldSeqCounters={},this.fieldSetValues={},this.headingIndex=0,this.tasks=[],this.postRenderTasks=[],this.h=h.h}async render(e,t){this.document=e,this.options=t,this.className=t.className,this.rootSelector=t.inWrapper?`.${this.className}-wrapper`:":root",this.h=t.h??h.h,this.styleMap=null,this.tasks=[],this.postRenderTasks=[],this.currentTabs=[],this.fieldSeqCounters={},this.fieldSetValues={},this.headingIndex=0,this.options.renderComments&&globalThis.Highlight&&(this.commentHighlight=new Highlight);const p=[...this.renderDefaultStyle()];e.themePart&&p.push(...this.renderTheme(e.themePart)),e.stylesPart!=null&&(this.styleMap=this.processStyles(e.stylesPart.styles),p.push(...this.renderStyles(e.stylesPart.styles))),e.numberingPart&&(this.prodessNumberings(e.numberingPart.domNumberings),p.push(...await this.renderNumbering(e.numberingPart.domNumberings))),e.footnotesPart&&(this.footnoteMap=(0,g.keyBy)(e.footnotesPart.notes,s=>s.id)),e.endnotesPart&&(this.endnoteMap=(0,g.keyBy)(e.endnotesPart.notes,s=>s.id)),e.settingsPart&&(this.defaultTabSize=e.settingsPart.settings?.defaultTabStop),!t.ignoreFonts&&e.fontTablePart&&p.push(...await this.renderFontTable(e.fontTablePart));var c=await this.renderSections(e.documentPart.body);if(this.options.inWrapper){const s=this.renderWrapper(c);p.push(s),this.shouldRunDynamicPagination()&&this.scheduleDynamicPagination(s)}else p.push(...c);return this.commentHighlight&&t.renderComments&&CSS.highlights.set(`${this.className}-comments`,this.commentHighlight),await Promise.allSettled(this.tasks),this.postRenderTasks.forEach(s=>s()),this.refreshTabStops(),p}renderTheme(e){const t={},p=e.theme?.fontScheme;p&&(p.majorFont&&(t["--docx-majorHAnsi-font"]=p.majorFont.latinTypeface,t["--docx-majorEastAsia-font"]=p.majorFont.eaTypeface??p.majorFont.latinTypeface,t["--docx-majorBidi-font"]=p.majorFont.csTypeface??p.majorFont.latinTypeface,t["--docx-majorCs-font"]=p.majorFont.csTypeface??p.majorFont.latinTypeface),p.minorFont&&(t["--docx-minorHAnsi-font"]=p.minorFont.latinTypeface,t["--docx-minorEastAsia-font"]=p.minorFont.eaTypeface??p.minorFont.latinTypeface,t["--docx-minorBidi-font"]=p.minorFont.csTypeface??p.minorFont.latinTypeface,t["--docx-minorCs-font"]=p.minorFont.csTypeface??p.minorFont.latinTypeface));const c=e.theme?.colorScheme;if(c)for(let[l,u]of Object.entries(c.colors))t[`--docx-${l}-color`]=`#${u}`;const s=this.styleToString(`.${this.className}`,t);return[this.h({tagName:"#comment",children:["docxjs document theme values"]}),this.h({tagName:"style",children:[s]})]}async renderFontTable(e){const t=[];for(let p of e.fonts)for(let c of p.embedFontRefs)try{const s=await this.document.loadFont(c.id,c.key),l={"font-family":(0,g.encloseFontFamily)(p.name),src:`url(${s})`};c.type!="bold"&&c.type!="boldItalic"||(l["font-weight"]="bold"),c.type!="italic"&&c.type!="boldItalic"||(l["font-style"]="italic"),t.push(this.h({tagName:"#comment",children:[`docxjs ${p.name} font`]})),t.push(this.h({tagName:"style",children:[this.styleToString("@font-face",l)]}))}catch{this.options.debug&&console.warn(`Can't load font with id ${c.id} and key ${c.key}`)}return t}processStyleName(e){return e?`${this.className}_${(0,g.escapeClassName)(e)}`:this.className}processStyles(e){const t=(0,g.keyBy)(e.filter(c=>c.id!=null),c=>c.id);for(const c of e.filter(s=>s.basedOn)){var p=t[c.basedOn];if(p){c.paragraphProps=(0,g.mergeDeep)({},p.paragraphProps,c.paragraphProps),c.runProps=(0,g.mergeDeep)({},p.runProps,c.runProps);for(const s of p.styles){const l=c.styles.find(u=>u.target==s.target);l?this.copyStyleProperties(s.values,l.values):c.styles.push({...s,values:{...s.values}})}}else this.options.debug&&console.warn(`Can't find base style ${c.basedOn}`)}for(let c of e)c.cssName=this.processStyleName(c.id);return t}prodessNumberings(e){for(let t of e.filter(p=>p.pStyleName)){const p=this.findStyle(t.pStyleName);p?.paragraphProps?.numbering&&(p.paragraphProps.numbering.level=t.level)}}processElement(e){if(e.children)for(var t of e.children)t.parent=e,t.type==f.DomType.Table?this.processTable(t):this.processElement(t)}processTable(e){const t=e.children??[];let p=e.columns?.length??0;for(const l of t){let u=l.gridBefore??0;for(const o of l.children??[])u+=o.span??1;p=Math.max(p,u+(l.gridAfter??0))}const c=Math.max(e.rowBandSize??1,1),s=Math.max(e.colBandSize??1,1);t.forEach((l,u)=>{u==0&&this.appendClassName(l,"first-row"),u==t.length-1&&this.appendClassName(l,"last-row"),this.appendClassName(l,Math.floor(u/c)%2==0?"odd-row":"even-row");let o=l.gridBefore??0;for(const i of l.children??[]){i.cssStyle=this.copyStyleProperties(e.cellStyle,i.cssStyle,["border-left","border-right","border-top","border-bottom","padding-left","padding-right","padding-top","padding-bottom"]);const a=i.span??1,b=o+a-1;o==0&&this.appendClassName(i,"first-col"),p>0&&b>=p-1&&this.appendClassName(i,"last-col"),this.appendClassName(i,Math.floor(o/s)%2==0?"odd-col":"even-col"),this.processElement(i),o+=a}})}collectDocumentMetadata(e){this.bookmarkTextMap={},this.bookmarkIdToName={},this.tocEntries=[];const t={},p=c=>{if(c.type!=f.DomType.Deleted||this.options.renderChanges){switch(c.type){case f.DomType.BookmarkStart:{const s=c;s.id&&s.name&&(this.bookmarkIdToName[s.id]=s.name,t[s.id]=[]);break}case f.DomType.BookmarkEnd:{const s=c,l=this.bookmarkIdToName[s.id];l&&t[s.id]&&(this.bookmarkTextMap[l]=t[s.id].join("").trim(),delete t[s.id]);break}case f.DomType.Text:for(const s of Object.keys(t))t[s].push(c.text??"");break;case f.DomType.DeletedText:if(this.options.renderChanges)for(const s of Object.keys(t))t[s].push(c.text??"")}for(const s of c.children??[])p(s)}};for(const c of e.children??[])p(c);for(const[c,s]of Object.entries(t)){const l=this.bookmarkIdToName[c];l&&(this.bookmarkTextMap[l]=s.join("").trim())}for(const c of e.children??[])this.collectTocEntries(c)}collectTocEntries(e){if(e.type!=f.DomType.Deleted||this.options.renderChanges){if(e.type==f.DomType.Paragraph){const t=e,p=this.findStyle(t.styleName),c=this.extractText(t).trim();let s=t.outlineLevel??p?.paragraphProps?.outlineLevel;if(s==null&&t.styleName){const l=/heading(\d+)|(?:^|[-_ ])h(\d+)$/i.exec(t.styleName);l&&(s=parseInt(l[1]??l[2],10)-1)}if(c&&s!=null&&s>=0&&s<9){const l=this.findFirstBookmark(t),u=l?.name&&!l.name.startsWith("_")?l.name:`${this.className}-heading-${++this.headingIndex}`;t.props={...t.props??{},anchorId:u},this.tocEntries.push({level:s+1,text:c,id:u})}}for(const t of e.children??[])this.collectTocEntries(t)}}findFirstBookmark(e){if(e.type==f.DomType.BookmarkStart)return e;for(const t of e.children??[]){const p=this.findFirstBookmark(t);if(p)return p}return null}extractText(e){switch(e.type){case f.DomType.Text:return e.text??"";case f.DomType.DeletedText:return this.options.renderChanges?e.text??"":"";case f.DomType.Deleted:return this.options.renderChanges?(e.children??[]).map(t=>this.extractText(t)).join(""):"";case f.DomType.Inserted:return(e.children??[]).map(t=>this.extractText(t)).join("");case f.DomType.Tab:case f.DomType.PositionalTab:return" ";case f.DomType.NoBreakHyphen:return"‑";case f.DomType.SoftHyphen:return"";case f.DomType.Break:return`
35
+ `,Wn=()=>{const m=document.createElement("style");return m.textContent=Gn,m},zn=m=>jn[(m||"").trim().toLowerCase()]||"image/*",$n=async m=>await new Promise((C,d)=>{const f=new FileReader;f.onload=g=>{var y;const E=(y=g.target)===null||y===void 0?void 0:y.result;if(typeof E=="string"){C(E);return}d(new Error("Unable to read image data URL."))},f.onerror=()=>d(f.error||new Error("Unable to read image data URL.")),f.readAsDataURL(m)}),Vn=async(m,C)=>{const d=(C||"").trim().toLowerCase();if(d==="heic"||d==="heif")throw new Error("HEIC/HEIF image conversion has moved out of @file-viewer/core. Install and pass @file-viewer/renderer-image, or use @file-viewer/preset-all.");return $n(new Blob([m],{type:zn(d)}))},Xn=m=>Math.min(5,Math.max(.1,Number(m.toFixed(2)))),Nr=(m,C,d)=>{if(C>0){m.style.height=`${Math.max(1,Math.round(C*d))}px`;return}m.style.height=`${d*100}%`},Yn=m=>{const C=document.createElement("div");C.className="image-lightbox",C.hidden=!0,C.setAttribute("role","dialog"),C.setAttribute("aria-modal","true");const d=document.createElement("img");d.alt="Preview image",d.src=m;const f=document.createElement("button");f.type="button",f.setAttribute("aria-label","Close image preview"),f.textContent="x";const g=()=>{C.hidden=!0};return f.addEventListener("click",g),d.addEventListener("click",g),C.addEventListener("click",y=>{y.target===C&&g()}),C.append(d,f),{element:C,open(){C.hidden=!1},destroy(){f.removeEventListener("click",g),d.removeEventListener("click",g),C.remove()}}}})),Kn,tr,Fr,Jn,Zn,qn,Qn,ti,ei,er,oa,aa,sa,ri=vt((()=>{fe(),Br(),Rr(),qe(),Kn=m=>({$el:m,unmount(){}}),tr=[{rendererId:"image",handler:async(m,C,d)=>{const{default:f}=await Promise.resolve().then(()=>(ia(),ra));return f(m,C,d)}}],Fr=["image"],Jn=tr.filter(m=>Fr.includes(m.rendererId)),Zn=ie.filter(m=>Fr.includes(m.id)),qn=m=>m==="none"?[]:m==="lite"?Zn:ie,Qn=m=>m==="none"?[]:m==="lite"?Jn:tr,ti=async(m,C,d)=>{const f=Nn(d),g=document.createElement("div");g.style.textAlign="center",g.style.marginTop="80px";const y=document.createElement("div");if(y.textContent=f.message,g.appendChild(y),f.description){const E=document.createElement("div");E.textContent=f.description,g.appendChild(E)}return C.replaceChildren(g),Kn(C)},ei=(m={})=>{const C=m.builtinRenderers||"all",d=Un({definitions:qn(C),handlers:Qn(C)});return{...d,dispatcher:Dr({registry:d.registry,handlers:tr,fallbackHandler:ti})}},er=ei(),oa=er.registry,aa=er.dispatcher,sa=er.missingRendererIds})),la=vt((()=>{Ce()})),ca=vt((()=>{Se(),Qe()})),ha=vt((()=>{Se()})),fa=vt((()=>{Cn(),Er(),Pr(),kr(),Se(),Ze(),Br(),ri(),Qe(),qe()})),Lr=vt((()=>{An(),fe(),bn(),Cn(),Er(),Te(),Jo(),Pr(),Ce(),Ze(),ri(),kr(),Se(),la(),ca(),ha(),Rr(),Br(),Ke(),qe(),Qe(),fa()})),Hr=We(((m,C)=>{(function(d){typeof m=="object"&&typeof C<"u"?C.exports=d():typeof define=="function"&&define.amd?define([],d):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).JSZip=d()})(function(){return(function d(f,g,y){function E(A,r){if(!g[A]){if(!f[A]){var n=typeof require=="function"&&require;if(!r&&n)return n(A,!0);if(h)return h(A,!0);var e=new Error("Cannot find module '"+A+"'");throw e.code="MODULE_NOT_FOUND",e}var t=g[A]={exports:{}};f[A][0].call(t.exports,function(p){var c=f[A][1][p];return E(c||p)},t,t.exports,d,f,g,y)}return g[A].exports}for(var h=typeof require=="function"&&require,w=0;w<y.length;w++)E(y[w]);return E})({1:[function(d,f,g){"use strict";var y=d("./utils"),E=d("./support"),h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";g.encode=function(w){for(var A,r,n,e,t,p,c,s=[],l=0,u=w.length,o=u,i=y.getTypeOf(w)!=="string";l<w.length;)o=u-l,n=i?(A=w[l++],r=l<u?w[l++]:0,l<u?w[l++]:0):(A=w.charCodeAt(l++),r=l<u?w.charCodeAt(l++):0,l<u?w.charCodeAt(l++):0),e=A>>2,t=(3&A)<<4|r>>4,p=1<o?(15&r)<<2|n>>6:64,c=2<o?63&n:64,s.push(h.charAt(e)+h.charAt(t)+h.charAt(p)+h.charAt(c));return s.join("")},g.decode=function(w){var A,r,n,e,t,p,c=0,s=0,l="data:";if(w.substr(0,l.length)===l)throw new Error("Invalid base64 input, it looks like a data url.");var u,o=3*(w=w.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(w.charAt(w.length-1)===h.charAt(64)&&o--,w.charAt(w.length-2)===h.charAt(64)&&o--,o%1!=0)throw new Error("Invalid base64 input, bad content length.");for(u=E.uint8array?new Uint8Array(0|o):new Array(0|o);c<w.length;)A=h.indexOf(w.charAt(c++))<<2|(e=h.indexOf(w.charAt(c++)))>>4,r=(15&e)<<4|(t=h.indexOf(w.charAt(c++)))>>2,n=(3&t)<<6|(p=h.indexOf(w.charAt(c++))),u[s++]=A,t!==64&&(u[s++]=r),p!==64&&(u[s++]=n);return u}},{"./support":30,"./utils":32}],2:[function(d,f,g){"use strict";var y=d("./external"),E=d("./stream/DataWorker"),h=d("./stream/Crc32Probe"),w=d("./stream/DataLengthProbe");function A(r,n,e,t,p){this.compressedSize=r,this.uncompressedSize=n,this.crc32=e,this.compression=t,this.compressedContent=p}A.prototype={getContentWorker:function(){var r=new E(y.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new w("data_length")),n=this;return r.on("end",function(){if(this.streamInfo.data_length!==n.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),r},getCompressedWorker:function(){return new E(y.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},A.createWorkerFrom=function(r,n,e){return r.pipe(new h).pipe(new w("uncompressedSize")).pipe(n.compressWorker(e)).pipe(new w("compressedSize")).withStreamInfo("compression",n)},f.exports=A},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(d,f,g){"use strict";var y=d("./stream/GenericWorker");g.STORE={magic:"\0\0",compressWorker:function(){return new y("STORE compression")},uncompressWorker:function(){return new y("STORE decompression")}},g.DEFLATE=d("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(d,f,g){"use strict";var y=d("./utils"),E=(function(){for(var h,w=[],A=0;A<256;A++){h=A;for(var r=0;r<8;r++)h=1&h?3988292384^h>>>1:h>>>1;w[A]=h}return w})();f.exports=function(h,w){return h!==void 0&&h.length?y.getTypeOf(h)!=="string"?(function(A,r,n,e){var t=E,p=e+n;A^=-1;for(var c=e;c<p;c++)A=A>>>8^t[255&(A^r[c])];return-1^A})(0|w,h,h.length,0):(function(A,r,n,e){var t=E,p=e+n;A^=-1;for(var c=e;c<p;c++)A=A>>>8^t[255&(A^r.charCodeAt(c))];return-1^A})(0|w,h,h.length,0):0}},{"./utils":32}],5:[function(d,f,g){"use strict";g.base64=!1,g.binary=!1,g.dir=!1,g.createFolders=!0,g.date=null,g.compression=null,g.compressionOptions=null,g.comment=null,g.unixPermissions=null,g.dosPermissions=null},{}],6:[function(d,f,g){"use strict";var y=null;y=typeof Promise<"u"?Promise:d("lie"),f.exports={Promise:y}},{lie:37}],7:[function(d,f,g){"use strict";var y=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",E=d("pako"),h=d("./utils"),w=d("./stream/GenericWorker"),A=y?"uint8array":"array";function r(n,e){w.call(this,"FlateWorker/"+n),this._pako=null,this._pakoAction=n,this._pakoOptions=e,this.meta={}}g.magic="\b\0",h.inherits(r,w),r.prototype.processChunk=function(n){this.meta=n.meta,this._pako===null&&this._createPako(),this._pako.push(h.transformTo(A,n.data),!1)},r.prototype.flush=function(){w.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},r.prototype.cleanUp=function(){w.prototype.cleanUp.call(this),this._pako=null},r.prototype._createPako=function(){this._pako=new E[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var n=this;this._pako.onData=function(e){n.push({data:e,meta:n.meta})}},g.compressWorker=function(n){return new r("Deflate",n)},g.uncompressWorker=function(){return new r("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(d,f,g){"use strict";function y(t,p){var c,s="";for(c=0;c<p;c++)s+=String.fromCharCode(255&t),t>>>=8;return s}function E(t,p,c,s,l,u){var o,i,a=t.file,b=t.compression,v=u!==A.utf8encode,_=h.transformTo("string",u(a.name)),T=h.transformTo("string",A.utf8encode(a.name)),k=a.comment,M=h.transformTo("string",u(k)),R=h.transformTo("string",A.utf8encode(k)),O=T.length!==a.name.length,P=R.length!==k.length,N="",it="",J="",ot=a.dir,tt=a.date,ht={crc32:0,compressedSize:0,uncompressedSize:0};p&&!c||(ht.crc32=t.crc32,ht.compressedSize=t.compressedSize,ht.uncompressedSize=t.uncompressedSize);var W=0;p&&(W|=8),v||!O&&!P||(W|=2048);var G=0,gt=0;ot&&(G|=16),l==="UNIX"?(gt=798,G|=(function(j,U){var at=j;return j||(at=U?16893:33204),(65535&at)<<16})(a.unixPermissions,ot)):(gt=20,G|=(function(j){return 63&(j||0)})(a.dosPermissions)),o=tt.getUTCHours(),o<<=6,o|=tt.getUTCMinutes(),o<<=5,o|=tt.getUTCSeconds()/2,i=tt.getUTCFullYear()-1980,i<<=4,i|=tt.getUTCMonth()+1,i<<=5,i|=tt.getUTCDate(),O&&(it=y(1,1)+y(r(_),4)+T,N+="up"+y(it.length,2)+it),P&&(J=y(1,1)+y(r(M),4)+R,N+="uc"+y(J.length,2)+J);var nt="";return nt+=`
36
+ \0`,nt+=y(W,2),nt+=b.magic,nt+=y(o,2),nt+=y(i,2),nt+=y(ht.crc32,4),nt+=y(ht.compressedSize,4),nt+=y(ht.uncompressedSize,4),nt+=y(_.length,2),nt+=y(N.length,2),{fileRecord:n.LOCAL_FILE_HEADER+nt+_+N,dirRecord:n.CENTRAL_FILE_HEADER+y(gt,2)+nt+y(M.length,2)+"\0\0\0\0"+y(G,4)+y(s,4)+_+N+M}}var h=d("../utils"),w=d("../stream/GenericWorker"),A=d("../utf8"),r=d("../crc32"),n=d("../signature");function e(t,p,c,s){w.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=p,this.zipPlatform=c,this.encodeFileName=s,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}h.inherits(e,w),e.prototype.push=function(t){var p=t.meta.percent||0,c=this.entriesCount,s=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,w.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:c?(p+100*(c-s-1))/c:100}}))},e.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var p=this.streamFiles&&!t.file.dir;if(p){var c=E(t,p,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:c.fileRecord,meta:{percent:0}})}else this.accumulate=!0},e.prototype.closedSource=function(t){this.accumulate=!1;var p=this.streamFiles&&!t.file.dir,c=E(t,p,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(c.dirRecord),p)this.push({data:(function(s){return n.DATA_DESCRIPTOR+y(s.crc32,4)+y(s.compressedSize,4)+y(s.uncompressedSize,4)})(t),meta:{percent:100}});else for(this.push({data:c.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},e.prototype.flush=function(){for(var t=this.bytesWritten,p=0;p<this.dirRecords.length;p++)this.push({data:this.dirRecords[p],meta:{percent:100}});var c=this.bytesWritten-t,s=(function(l,u,o,i,a){var b=h.transformTo("string",a(i));return n.CENTRAL_DIRECTORY_END+"\0\0\0\0"+y(l,2)+y(l,2)+y(u,4)+y(o,4)+y(b.length,2)+b})(this.dirRecords.length,c,t,this.zipComment,this.encodeFileName);this.push({data:s,meta:{percent:100}})},e.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},e.prototype.registerPrevious=function(t){this._sources.push(t);var p=this;return t.on("data",function(c){p.processChunk(c)}),t.on("end",function(){p.closedSource(p.previous.streamInfo),p._sources.length?p.prepareNextSource():p.end()}),t.on("error",function(c){p.error(c)}),this},e.prototype.resume=function(){return!!w.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},e.prototype.error=function(t){var p=this._sources;if(!w.prototype.error.call(this,t))return!1;for(var c=0;c<p.length;c++)try{p[c].error(t)}catch{}return!0},e.prototype.lock=function(){w.prototype.lock.call(this);for(var t=this._sources,p=0;p<t.length;p++)t[p].lock()},f.exports=e},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(d,f,g){"use strict";var y=d("../compressions"),E=d("./ZipFileWorker");g.generateWorker=function(h,w,A){var r=new E(w.streamFiles,A,w.platform,w.encodeFileName),n=0;try{h.forEach(function(e,t){n++;var p=(function(u,o){var i=u||o,a=y[i];if(!a)throw new Error(i+" is not a valid compression method !");return a})(t.options.compression,w.compression),c=t.options.compressionOptions||w.compressionOptions||{},s=t.dir,l=t.date;t._compressWorker(p,c).withStreamInfo("file",{name:e,dir:s,date:l,comment:t.comment||"",unixPermissions:t.unixPermissions,dosPermissions:t.dosPermissions}).pipe(r)}),r.entriesCount=n}catch(e){r.error(e)}return r}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(d,f,g){"use strict";function y(){if(!(this instanceof y))return new y;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var E=new y;for(var h in this)typeof this[h]!="function"&&(E[h]=this[h]);return E}}(y.prototype=d("./object")).loadAsync=d("./load"),y.support=d("./support"),y.defaults=d("./defaults"),y.version="3.10.1",y.loadAsync=function(E,h){return new y().loadAsync(E,h)},y.external=d("./external"),f.exports=y},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(d,f,g){"use strict";var y=d("./utils"),E=d("./external"),h=d("./utf8"),w=d("./zipEntries"),A=d("./stream/Crc32Probe"),r=d("./nodejsUtils");function n(e){return new E.Promise(function(t,p){var c=e.decompressed.getContentWorker().pipe(new A);c.on("error",function(s){p(s)}).on("end",function(){c.streamInfo.crc32!==e.decompressed.crc32?p(new Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}f.exports=function(e,t){var p=this;return t=y.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:h.utf8decode}),r.isNode&&r.isStream(e)?E.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):y.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(c){var s=new w(t);return s.load(c),s}).then(function(c){var s=[E.Promise.resolve(c)],l=c.files;if(t.checkCRC32)for(var u=0;u<l.length;u++)s.push(n(l[u]));return E.Promise.all(s)}).then(function(c){for(var s=c.shift(),l=s.files,u=0;u<l.length;u++){var o=l[u],i=o.fileNameStr,a=y.resolve(o.fileNameStr);p.file(a,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:t.createFolders}),o.dir||(p.file(a).unsafeOriginalName=i)}return s.zipComment.length&&(p.comment=s.zipComment),p})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(d,f,g){"use strict";var y=d("../utils"),E=d("../stream/GenericWorker");function h(w,A){E.call(this,"Nodejs stream input adapter for "+w),this._upstreamEnded=!1,this._bindStream(A)}y.inherits(h,E),h.prototype._bindStream=function(w){var A=this;(this._stream=w).pause(),w.on("data",function(r){A.push({data:r,meta:{percent:0}})}).on("error",function(r){A.isPaused?this.generatedError=r:A.error(r)}).on("end",function(){A.isPaused?A._upstreamEnded=!0:A.end()})},h.prototype.pause=function(){return!!E.prototype.pause.call(this)&&(this._stream.pause(),!0)},h.prototype.resume=function(){return!!E.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},f.exports=h},{"../stream/GenericWorker":28,"../utils":32}],13:[function(d,f,g){"use strict";var y=d("readable-stream").Readable;function E(h,w,A){y.call(this,w),this._helper=h;var r=this;h.on("data",function(n,e){r.push(n)||r._helper.pause(),A&&A(e)}).on("error",function(n){r.emit("error",n)}).on("end",function(){r.push(null)})}d("../utils").inherits(E,y),E.prototype._read=function(){this._helper.resume()},f.exports=E},{"../utils":32,"readable-stream":16}],14:[function(d,f,g){"use strict";f.exports={isNode:typeof Buffer<"u",newBufferFrom:function(y,E){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(y,E);if(typeof y=="number")throw new Error('The "data" argument must not be a number');return new Buffer(y,E)},allocBuffer:function(y){if(Buffer.alloc)return Buffer.alloc(y);var E=new Buffer(y);return E.fill(0),E},isBuffer:function(y){return Buffer.isBuffer(y)},isStream:function(y){return y&&typeof y.on=="function"&&typeof y.pause=="function"&&typeof y.resume=="function"}}},{}],15:[function(d,f,g){"use strict";function y(i,a,b){var v,_=h.getTypeOf(a),T=h.extend(b||{},r);T.date=T.date||new Date,T.compression!==null&&(T.compression=T.compression.toUpperCase()),typeof T.unixPermissions=="string"&&(T.unixPermissions=parseInt(T.unixPermissions,8)),T.unixPermissions&&16384&T.unixPermissions&&(T.dir=!0),T.dosPermissions&&16&T.dosPermissions&&(T.dir=!0),T.dir&&(i=l(i)),T.createFolders&&(v=s(i))&&u.call(this,v,!0);var k=_==="string"&&T.binary===!1&&T.base64===!1;b&&b.binary!==void 0||(T.binary=!k),(a instanceof n&&a.uncompressedSize===0||T.dir||!a||a.length===0)&&(T.base64=!1,T.binary=!0,a="",T.compression="STORE",_="string");var M=null;M=a instanceof n||a instanceof w?a:p.isNode&&p.isStream(a)?new c(i,a):h.prepareContent(i,a,T.binary,T.optimizedBinaryString,T.base64);var R=new e(i,M,T);this.files[i]=R}var E=d("./utf8"),h=d("./utils"),w=d("./stream/GenericWorker"),A=d("./stream/StreamHelper"),r=d("./defaults"),n=d("./compressedObject"),e=d("./zipObject"),t=d("./generate"),p=d("./nodejsUtils"),c=d("./nodejs/NodejsStreamInputAdapter"),s=function(i){i.slice(-1)==="/"&&(i=i.substring(0,i.length-1));var a=i.lastIndexOf("/");return 0<a?i.substring(0,a):""},l=function(i){return i.slice(-1)!=="/"&&(i+="/"),i},u=function(i,a){return a=a!==void 0?a:r.createFolders,i=l(i),this.files[i]||y.call(this,i,null,{dir:!0,createFolders:a}),this.files[i]};function o(i){return Object.prototype.toString.call(i)==="[object RegExp]"}f.exports={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(i){var a,b,v;for(a in this.files)v=this.files[a],(b=a.slice(this.root.length,a.length))&&a.slice(0,this.root.length)===this.root&&i(b,v)},filter:function(i){var a=[];return this.forEach(function(b,v){i(b,v)&&a.push(v)}),a},file:function(i,a,b){if(arguments.length!==1)return i=this.root+i,y.call(this,i,a,b),this;if(o(i)){var v=i;return this.filter(function(T,k){return!k.dir&&v.test(T)})}var _=this.files[this.root+i];return _&&!_.dir?_:null},folder:function(i){if(!i)return this;if(o(i))return this.filter(function(_,T){return T.dir&&i.test(_)});var a=this.root+i,b=u.call(this,a),v=this.clone();return v.root=b.name,v},remove:function(i){i=this.root+i;var a=this.files[i];if(a||(i.slice(-1)!=="/"&&(i+="/"),a=this.files[i]),a&&!a.dir)delete this.files[i];else for(var b=this.filter(function(_,T){return T.name.slice(0,i.length)===i}),v=0;v<b.length;v++)delete this.files[b[v].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(i){var a,b={};try{if((b=h.extend(i||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:E.utf8encode})).type=b.type.toLowerCase(),b.compression=b.compression.toUpperCase(),b.type==="binarystring"&&(b.type="string"),!b.type)throw new Error("No output type specified.");h.checkSupport(b.type),b.platform!=="darwin"&&b.platform!=="freebsd"&&b.platform!=="linux"&&b.platform!=="sunos"||(b.platform="UNIX"),b.platform==="win32"&&(b.platform="DOS");var v=b.comment||this.comment||"";a=t.generateWorker(this,b,v)}catch(_){(a=new w("error")).error(_)}return new A(a,b.type||"string",b.mimeType)},generateAsync:function(i,a){return this.generateInternalStream(i).accumulate(a)},generateNodeStream:function(i,a){return(i=i||{}).type||(i.type="nodebuffer"),this.generateInternalStream(i).toNodejsStream(a)}}},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(d,f,g){"use strict";f.exports=d("stream")},{stream:void 0}],17:[function(d,f,g){"use strict";var y=d("./DataReader");function E(h){y.call(this,h);for(var w=0;w<this.data.length;w++)h[w]=255&h[w]}d("../utils").inherits(E,y),E.prototype.byteAt=function(h){return this.data[this.zero+h]},E.prototype.lastIndexOfSignature=function(h){for(var w=h.charCodeAt(0),A=h.charCodeAt(1),r=h.charCodeAt(2),n=h.charCodeAt(3),e=this.length-4;0<=e;--e)if(this.data[e]===w&&this.data[e+1]===A&&this.data[e+2]===r&&this.data[e+3]===n)return e-this.zero;return-1},E.prototype.readAndCheckSignature=function(h){var w=h.charCodeAt(0),A=h.charCodeAt(1),r=h.charCodeAt(2),n=h.charCodeAt(3),e=this.readData(4);return w===e[0]&&A===e[1]&&r===e[2]&&n===e[3]},E.prototype.readData=function(h){if(this.checkOffset(h),h===0)return[];var w=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,w},f.exports=E},{"../utils":32,"./DataReader":18}],18:[function(d,f,g){"use strict";var y=d("../utils");function E(h){this.data=h,this.length=h.length,this.index=0,this.zero=0}E.prototype={checkOffset:function(h){this.checkIndex(this.index+h)},checkIndex:function(h){if(this.length<this.zero+h||h<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+h+"). Corrupted zip ?")},setIndex:function(h){this.checkIndex(h),this.index=h},skip:function(h){this.setIndex(this.index+h)},byteAt:function(){},readInt:function(h){var w,A=0;for(this.checkOffset(h),w=this.index+h-1;w>=this.index;w--)A=(A<<8)+this.byteAt(w);return this.index+=h,A},readString:function(h){return y.transformTo("string",this.readData(h))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var h=this.readInt(4);return new Date(Date.UTC(1980+(h>>25&127),(h>>21&15)-1,h>>16&31,h>>11&31,h>>5&63,(31&h)<<1))}},f.exports=E},{"../utils":32}],19:[function(d,f,g){"use strict";var y=d("./Uint8ArrayReader");function E(h){y.call(this,h)}d("../utils").inherits(E,y),E.prototype.readData=function(h){this.checkOffset(h);var w=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,w},f.exports=E},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(d,f,g){"use strict";var y=d("./DataReader");function E(h){y.call(this,h)}d("../utils").inherits(E,y),E.prototype.byteAt=function(h){return this.data.charCodeAt(this.zero+h)},E.prototype.lastIndexOfSignature=function(h){return this.data.lastIndexOf(h)-this.zero},E.prototype.readAndCheckSignature=function(h){return h===this.readData(4)},E.prototype.readData=function(h){this.checkOffset(h);var w=this.data.slice(this.zero+this.index,this.zero+this.index+h);return this.index+=h,w},f.exports=E},{"../utils":32,"./DataReader":18}],21:[function(d,f,g){"use strict";var y=d("./ArrayReader");function E(h){y.call(this,h)}d("../utils").inherits(E,y),E.prototype.readData=function(h){if(this.checkOffset(h),h===0)return new Uint8Array(0);var w=this.data.subarray(this.zero+this.index,this.zero+this.index+h);return this.index+=h,w},f.exports=E},{"../utils":32,"./ArrayReader":17}],22:[function(d,f,g){"use strict";var y=d("../utils"),E=d("../support"),h=d("./ArrayReader"),w=d("./StringReader"),A=d("./NodeBufferReader"),r=d("./Uint8ArrayReader");f.exports=function(n){var e=y.getTypeOf(n);return y.checkSupport(e),e!=="string"||E.uint8array?e==="nodebuffer"?new A(n):E.uint8array?new r(y.transformTo("uint8array",n)):new h(y.transformTo("array",n)):new w(n)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(d,f,g){"use strict";g.LOCAL_FILE_HEADER="PK",g.CENTRAL_FILE_HEADER="PK",g.CENTRAL_DIRECTORY_END="PK",g.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",g.ZIP64_CENTRAL_DIRECTORY_END="PK",g.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(d,f,g){"use strict";var y=d("./GenericWorker"),E=d("../utils");function h(w){y.call(this,"ConvertWorker to "+w),this.destType=w}E.inherits(h,y),h.prototype.processChunk=function(w){this.push({data:E.transformTo(this.destType,w.data),meta:w.meta})},f.exports=h},{"../utils":32,"./GenericWorker":28}],25:[function(d,f,g){"use strict";var y=d("./GenericWorker"),E=d("../crc32");function h(){y.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}d("../utils").inherits(h,y),h.prototype.processChunk=function(w){this.streamInfo.crc32=E(w.data,this.streamInfo.crc32||0),this.push(w)},f.exports=h},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(d,f,g){"use strict";var y=d("../utils"),E=d("./GenericWorker");function h(w){E.call(this,"DataLengthProbe for "+w),this.propName=w,this.withStreamInfo(w,0)}y.inherits(h,E),h.prototype.processChunk=function(w){if(w){var A=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=A+w.data.length}E.prototype.processChunk.call(this,w)},f.exports=h},{"../utils":32,"./GenericWorker":28}],27:[function(d,f,g){"use strict";var y=d("../utils"),E=d("./GenericWorker");function h(w){E.call(this,"DataWorker");var A=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,w.then(function(r){A.dataIsReady=!0,A.data=r,A.max=r&&r.length||0,A.type=y.getTypeOf(r),A.isPaused||A._tickAndRepeat()},function(r){A.error(r)})}y.inherits(h,E),h.prototype.cleanUp=function(){E.prototype.cleanUp.call(this),this.data=null},h.prototype.resume=function(){return!!E.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,y.delay(this._tickAndRepeat,[],this)),!0)},h.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(y.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},h.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var w=null,A=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":w=this.data.substring(this.index,A);break;case"uint8array":w=this.data.subarray(this.index,A);break;case"array":case"nodebuffer":w=this.data.slice(this.index,A)}return this.index=A,this.push({data:w,meta:{percent:this.max?this.index/this.max*100:0}})},f.exports=h},{"../utils":32,"./GenericWorker":28}],28:[function(d,f,g){"use strict";function y(E){this.name=E||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}y.prototype={push:function(E){this.emit("data",E)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(E){this.emit("error",E)}return!0},error:function(E){return!this.isFinished&&(this.isPaused?this.generatedError=E:(this.isFinished=!0,this.emit("error",E),this.previous&&this.previous.error(E),this.cleanUp()),!0)},on:function(E,h){return this._listeners[E].push(h),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(E,h){if(this._listeners[E])for(var w=0;w<this._listeners[E].length;w++)this._listeners[E][w].call(this,h)},pipe:function(E){return E.registerPrevious(this)},registerPrevious:function(E){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=E.streamInfo,this.mergeStreamInfo(),this.previous=E;var h=this;return E.on("data",function(w){h.processChunk(w)}),E.on("end",function(){h.end()}),E.on("error",function(w){h.error(w)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var E=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),E=!0),this.previous&&this.previous.resume(),!E},flush:function(){},processChunk:function(E){this.push(E)},withStreamInfo:function(E,h){return this.extraStreamInfo[E]=h,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var E in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,E)&&(this.streamInfo[E]=this.extraStreamInfo[E])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var E="Worker "+this.name;return this.previous?this.previous+" -> "+E:E}},f.exports=y},{}],29:[function(d,f,g){"use strict";var y=d("../utils"),E=d("./ConvertWorker"),h=d("./GenericWorker"),w=d("../base64"),A=d("../support"),r=d("../external"),n=null;if(A.nodestream)try{n=d("../nodejs/NodejsStreamOutputAdapter")}catch{}function e(p,c){return new r.Promise(function(s,l){var u=[],o=p._internalType,i=p._outputType,a=p._mimeType;p.on("data",function(b,v){u.push(b),c&&c(v)}).on("error",function(b){u=[],l(b)}).on("end",function(){try{s((function(b,v,_){switch(b){case"blob":return y.newBlob(y.transformTo("arraybuffer",v),_);case"base64":return w.encode(v);default:return y.transformTo(b,v)}})(i,(function(b,v){var _,T=0,k=null,M=0;for(_=0;_<v.length;_++)M+=v[_].length;switch(b){case"string":return v.join("");case"array":return Array.prototype.concat.apply([],v);case"uint8array":for(k=new Uint8Array(M),_=0;_<v.length;_++)k.set(v[_],T),T+=v[_].length;return k;case"nodebuffer":return Buffer.concat(v);default:throw new Error("concat : unsupported type '"+b+"'")}})(o,u),a))}catch(b){l(b)}u=[]}).resume()})}function t(p,c,s){var l=c;switch(c){case"blob":case"arraybuffer":l="uint8array";break;case"base64":l="string"}try{this._internalType=l,this._outputType=c,this._mimeType=s,y.checkSupport(l),this._worker=p.pipe(new E(l)),p.lock()}catch(u){this._worker=new h("error"),this._worker.error(u)}}t.prototype={accumulate:function(p){return e(this,p)},on:function(p,c){var s=this;return p==="data"?this._worker.on(p,function(l){c.call(s,l.data,l.meta)}):this._worker.on(p,function(){y.delay(c,arguments,s)}),this},resume:function(){return y.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(p){if(y.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new n(this,{objectMode:this._outputType!=="nodebuffer"},p)}},f.exports=t},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(d,f,g){"use strict";if(g.base64=!0,g.array=!0,g.string=!0,g.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",g.nodebuffer=typeof Buffer<"u",g.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")g.blob=!1;else{var y=new ArrayBuffer(0);try{g.blob=new Blob([y],{type:"application/zip"}).size===0}catch{try{var E=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);E.append(y),g.blob=E.getBlob("application/zip").size===0}catch{g.blob=!1}}}try{g.nodestream=!!d("readable-stream").Readable}catch{g.nodestream=!1}},{"readable-stream":16}],31:[function(d,f,g){"use strict";for(var y=d("./utils"),E=d("./support"),h=d("./nodejsUtils"),w=d("./stream/GenericWorker"),A=new Array(256),r=0;r<256;r++)A[r]=252<=r?6:248<=r?5:240<=r?4:224<=r?3:192<=r?2:1;A[254]=A[254]=1;function n(){w.call(this,"utf-8 decode"),this.leftOver=null}function e(){w.call(this,"utf-8 encode")}g.utf8encode=function(t){return E.nodebuffer?h.newBufferFrom(t,"utf-8"):(function(p){var c,s,l,u,o,i=p.length,a=0;for(u=0;u<i;u++)(64512&(s=p.charCodeAt(u)))==55296&&u+1<i&&(64512&(l=p.charCodeAt(u+1)))==56320&&(s=65536+(s-55296<<10)+(l-56320),u++),a+=s<128?1:s<2048?2:s<65536?3:4;for(c=E.uint8array?new Uint8Array(a):new Array(a),u=o=0;o<a;u++)(64512&(s=p.charCodeAt(u)))==55296&&u+1<i&&(64512&(l=p.charCodeAt(u+1)))==56320&&(s=65536+(s-55296<<10)+(l-56320),u++),s<128?c[o++]=s:(s<2048?c[o++]=192|s>>>6:(s<65536?c[o++]=224|s>>>12:(c[o++]=240|s>>>18,c[o++]=128|s>>>12&63),c[o++]=128|s>>>6&63),c[o++]=128|63&s);return c})(t)},g.utf8decode=function(t){return E.nodebuffer?y.transformTo("nodebuffer",t).toString("utf-8"):(function(p){var c,s,l,u,o=p.length,i=new Array(2*o);for(c=s=0;c<o;)if((l=p[c++])<128)i[s++]=l;else if(4<(u=A[l]))i[s++]=65533,c+=u-1;else{for(l&=u===2?31:u===3?15:7;1<u&&c<o;)l=l<<6|63&p[c++],u--;1<u?i[s++]=65533:l<65536?i[s++]=l:(l-=65536,i[s++]=55296|l>>10&1023,i[s++]=56320|1023&l)}return i.length!==s&&(i.subarray?i=i.subarray(0,s):i.length=s),y.applyFromCharCode(i)})(t=y.transformTo(E.uint8array?"uint8array":"array",t))},y.inherits(n,w),n.prototype.processChunk=function(t){var p=y.transformTo(E.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(E.uint8array){var c=p;(p=new Uint8Array(c.length+this.leftOver.length)).set(this.leftOver,0),p.set(c,this.leftOver.length)}else p=this.leftOver.concat(p);this.leftOver=null}var s=(function(u,o){var i;for((o=o||u.length)>u.length&&(o=u.length),i=o-1;0<=i&&(192&u[i])==128;)i--;return i<0||i===0?o:i+A[u[i]]>o?i:o})(p),l=p;s!==p.length&&(E.uint8array?(l=p.subarray(0,s),this.leftOver=p.subarray(s,p.length)):(l=p.slice(0,s),this.leftOver=p.slice(s,p.length))),this.push({data:g.utf8decode(l),meta:t.meta})},n.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:g.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},g.Utf8DecodeWorker=n,y.inherits(e,w),e.prototype.processChunk=function(t){this.push({data:g.utf8encode(t.data),meta:t.meta})},g.Utf8EncodeWorker=e},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(d,f,g){"use strict";var y=d("./support"),E=d("./base64"),h=d("./nodejsUtils"),w=d("./external");function A(c){return c}function r(c,s){for(var l=0;l<c.length;++l)s[l]=255&c.charCodeAt(l);return s}d("setimmediate"),g.newBlob=function(c,s){g.checkSupport("blob");try{return new Blob([c],{type:s})}catch{try{var l=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return l.append(c),l.getBlob(s)}catch{throw new Error("Bug : can't construct the Blob.")}}};var n={stringifyByChunk:function(c,s,l){var u=[],o=0,i=c.length;if(i<=l)return String.fromCharCode.apply(null,c);for(;o<i;)s==="array"||s==="nodebuffer"?u.push(String.fromCharCode.apply(null,c.slice(o,Math.min(o+l,i)))):u.push(String.fromCharCode.apply(null,c.subarray(o,Math.min(o+l,i)))),o+=l;return u.join("")},stringifyByChar:function(c){for(var s="",l=0;l<c.length;l++)s+=String.fromCharCode(c[l]);return s},applyCanBeUsed:{uint8array:(function(){try{return y.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return y.nodebuffer&&String.fromCharCode.apply(null,h.allocBuffer(1)).length===1}catch{return!1}})()}};function e(c){var s=65536,l=g.getTypeOf(c),u=!0;if(l==="uint8array"?u=n.applyCanBeUsed.uint8array:l==="nodebuffer"&&(u=n.applyCanBeUsed.nodebuffer),u)for(;1<s;)try{return n.stringifyByChunk(c,l,s)}catch{s=Math.floor(s/2)}return n.stringifyByChar(c)}function t(c,s){for(var l=0;l<c.length;l++)s[l]=c[l];return s}g.applyFromCharCode=e;var p={};p.string={string:A,array:function(c){return r(c,new Array(c.length))},arraybuffer:function(c){return p.string.uint8array(c).buffer},uint8array:function(c){return r(c,new Uint8Array(c.length))},nodebuffer:function(c){return r(c,h.allocBuffer(c.length))}},p.array={string:e,array:A,arraybuffer:function(c){return new Uint8Array(c).buffer},uint8array:function(c){return new Uint8Array(c)},nodebuffer:function(c){return h.newBufferFrom(c)}},p.arraybuffer={string:function(c){return e(new Uint8Array(c))},array:function(c){return t(new Uint8Array(c),new Array(c.byteLength))},arraybuffer:A,uint8array:function(c){return new Uint8Array(c)},nodebuffer:function(c){return h.newBufferFrom(new Uint8Array(c))}},p.uint8array={string:e,array:function(c){return t(c,new Array(c.length))},arraybuffer:function(c){return c.buffer},uint8array:A,nodebuffer:function(c){return h.newBufferFrom(c)}},p.nodebuffer={string:e,array:function(c){return t(c,new Array(c.length))},arraybuffer:function(c){return p.nodebuffer.uint8array(c).buffer},uint8array:function(c){return t(c,new Uint8Array(c.length))},nodebuffer:A},g.transformTo=function(c,s){return s=s||"",c?(g.checkSupport(c),p[g.getTypeOf(s)][c](s)):s},g.resolve=function(c){for(var s=c.split("/"),l=[],u=0;u<s.length;u++){var o=s[u];o==="."||o===""&&u!==0&&u!==s.length-1||(o===".."?l.pop():l.push(o))}return l.join("/")},g.getTypeOf=function(c){return typeof c=="string"?"string":Object.prototype.toString.call(c)==="[object Array]"?"array":y.nodebuffer&&h.isBuffer(c)?"nodebuffer":y.uint8array&&c instanceof Uint8Array?"uint8array":y.arraybuffer&&c instanceof ArrayBuffer?"arraybuffer":void 0},g.checkSupport=function(c){if(!y[c.toLowerCase()])throw new Error(c+" is not supported by this platform")},g.MAX_VALUE_16BITS=65535,g.MAX_VALUE_32BITS=-1,g.pretty=function(c){var s,l,u="";for(l=0;l<(c||"").length;l++)u+="\\x"+((s=c.charCodeAt(l))<16?"0":"")+s.toString(16).toUpperCase();return u},g.delay=function(c,s,l){setImmediate(function(){c.apply(l||null,s||[])})},g.inherits=function(c,s){function l(){}l.prototype=s.prototype,c.prototype=new l},g.extend=function(){var c,s,l={};for(c=0;c<arguments.length;c++)for(s in arguments[c])Object.prototype.hasOwnProperty.call(arguments[c],s)&&l[s]===void 0&&(l[s]=arguments[c][s]);return l},g.prepareContent=function(c,s,l,u,o){return w.Promise.resolve(s).then(function(i){return y.blob&&(i instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(i))!==-1)&&typeof FileReader<"u"?new w.Promise(function(a,b){var v=new FileReader;v.onload=function(_){a(_.target.result)},v.onerror=function(_){b(_.target.error)},v.readAsArrayBuffer(i)}):i}).then(function(i){var a=g.getTypeOf(i);return a?(a==="arraybuffer"?i=g.transformTo("uint8array",i):a==="string"&&(o?i=E.decode(i):l&&u!==!0&&(i=(function(b){return r(b,y.uint8array?new Uint8Array(b.length):new Array(b.length))})(i))),i):w.Promise.reject(new Error("Can't read the data of '"+c+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(d,f,g){"use strict";var y=d("./reader/readerFor"),E=d("./utils"),h=d("./signature"),w=d("./zipEntry"),A=d("./support");function r(n){this.files=[],this.loadOptions=n}r.prototype={checkSignature:function(n){if(!this.reader.readAndCheckSignature(n)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+E.pretty(e)+", expected "+E.pretty(n)+")")}},isSignature:function(n,e){var t=this.reader.index;this.reader.setIndex(n);var p=this.reader.readString(4)===e;return this.reader.setIndex(t),p},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var n=this.reader.readData(this.zipCommentLength),e=A.uint8array?"uint8array":"array",t=E.transformTo(e,n);this.zipComment=this.loadOptions.decodeFileName(t)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var n,e,t,p=this.zip64EndOfCentralSize-44;0<p;)n=this.reader.readInt(2),e=this.reader.readInt(4),t=this.reader.readData(e),this.zip64ExtensibleData[n]={id:n,length:e,value:t}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var n,e;for(n=0;n<this.files.length;n++)e=this.files[n],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(h.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var n;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(h.CENTRAL_FILE_HEADER);)(n=new w({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(n);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var n=this.reader.lastIndexOfSignature(h.CENTRAL_DIRECTORY_END);if(n<0)throw this.isSignature(0,h.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(n);var e=n;if(this.checkSignature(h.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===E.MAX_VALUE_16BITS||this.diskWithCentralDirStart===E.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===E.MAX_VALUE_16BITS||this.centralDirRecords===E.MAX_VALUE_16BITS||this.centralDirSize===E.MAX_VALUE_32BITS||this.centralDirOffset===E.MAX_VALUE_32BITS){if(this.zip64=!0,(n=this.reader.lastIndexOfSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(n),this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,h.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(h.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(h.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var t=this.centralDirOffset+this.centralDirSize;this.zip64&&(t+=20,t+=12+this.zip64EndOfCentralSize);var p=e-t;if(0<p)this.isSignature(e,h.CENTRAL_FILE_HEADER)||(this.reader.zero=p);else if(p<0)throw new Error("Corrupted zip: missing "+Math.abs(p)+" bytes.")},prepareReader:function(n){this.reader=y(n)},load:function(n){this.prepareReader(n),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},f.exports=r},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(d,f,g){"use strict";var y=d("./reader/readerFor"),E=d("./utils"),h=d("./compressedObject"),w=d("./crc32"),A=d("./utf8"),r=d("./compressions"),n=d("./support");function e(t,p){this.options=t,this.loadOptions=p}e.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(t){var p,c;if(t.skip(22),this.fileNameLength=t.readInt(2),c=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(c),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((p=(function(s){for(var l in r)if(Object.prototype.hasOwnProperty.call(r,l)&&r[l].magic===s)return r[l];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+E.pretty(this.compressionMethod)+" unknown (inner file : "+E.transformTo("string",this.fileName)+")");this.decompressed=new h(this.compressedSize,this.uncompressedSize,this.crc32,p,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var p=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(p),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),t==0&&(this.dosPermissions=63&this.externalFileAttributes),t==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=y(this.extraFields[1].value);this.uncompressedSize===E.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===E.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===E.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===E.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var p,c,s,l=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index+4<l;)p=t.readInt(2),c=t.readInt(2),s=t.readData(c),this.extraFields[p]={id:p,length:c,value:s};t.setIndex(l)},handleUTF8:function(){var t=n.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=A.utf8decode(this.fileName),this.fileCommentStr=A.utf8decode(this.fileComment);else{var p=this.findExtraFieldUnicodePath();if(p!==null)this.fileNameStr=p;else{var c=E.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(c)}var s=this.findExtraFieldUnicodeComment();if(s!==null)this.fileCommentStr=s;else{var l=E.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(l)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var p=y(t.value);return p.readInt(1)!==1||w(this.fileName)!==p.readInt(4)?null:A.utf8decode(p.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var p=y(t.value);return p.readInt(1)!==1||w(this.fileComment)!==p.readInt(4)?null:A.utf8decode(p.readData(t.length-5))}return null}},f.exports=e},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(d,f,g){"use strict";function y(p,c,s){this.name=p,this.dir=s.dir,this.date=s.date,this.comment=s.comment,this.unixPermissions=s.unixPermissions,this.dosPermissions=s.dosPermissions,this._data=c,this._dataBinary=s.binary,this.options={compression:s.compression,compressionOptions:s.compressionOptions}}var E=d("./stream/StreamHelper"),h=d("./stream/DataWorker"),w=d("./utf8"),A=d("./compressedObject"),r=d("./stream/GenericWorker");y.prototype={internalStream:function(p){var c=null,s="string";try{if(!p)throw new Error("No output type specified.");var l=(s=p.toLowerCase())==="string"||s==="text";s!=="binarystring"&&s!=="text"||(s="string"),c=this._decompressWorker();var u=!this._dataBinary;u&&!l&&(c=c.pipe(new w.Utf8EncodeWorker)),!u&&l&&(c=c.pipe(new w.Utf8DecodeWorker))}catch(o){(c=new r("error")).error(o)}return new E(c,s,"")},async:function(p,c){return this.internalStream(p).accumulate(c)},nodeStream:function(p,c){return this.internalStream(p||"nodebuffer").toNodejsStream(c)},_compressWorker:function(p,c){if(this._data instanceof A&&this._data.compression.magic===p.magic)return this._data.getCompressedWorker();var s=this._decompressWorker();return this._dataBinary||(s=s.pipe(new w.Utf8EncodeWorker)),A.createWorkerFrom(s,p,c)},_decompressWorker:function(){return this._data instanceof A?this._data.getContentWorker():this._data instanceof r?this._data:new h(this._data)}};for(var n=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],e=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},t=0;t<n.length;t++)y.prototype[n[t]]=e;f.exports=y},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(d,f,g){(function(y){"use strict";var E,h,w=y.MutationObserver||y.WebKitMutationObserver;if(w){var A=0,r=new w(p),n=y.document.createTextNode("");r.observe(n,{characterData:!0}),E=function(){n.data=A=++A%2}}else if(y.setImmediate||y.MessageChannel===void 0)E="document"in y&&"onreadystatechange"in y.document.createElement("script")?function(){var c=y.document.createElement("script");c.onreadystatechange=function(){p(),c.onreadystatechange=null,c.parentNode.removeChild(c),c=null},y.document.documentElement.appendChild(c)}:function(){setTimeout(p,0)};else{var e=new y.MessageChannel;e.port1.onmessage=p,E=function(){e.port2.postMessage(0)}}var t=[];function p(){var c,s;h=!0;for(var l=t.length;l;){for(s=t,t=[],c=-1;++c<l;)s[c]();l=t.length}h=!1}f.exports=function(c){t.push(c)!==1||h||E()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(d,f,g){"use strict";var y=d("immediate");function E(){}var h={},w=["REJECTED"],A=["FULFILLED"],r=["PENDING"];function n(l){if(typeof l!="function")throw new TypeError("resolver must be a function");this.state=r,this.queue=[],this.outcome=void 0,l!==E&&c(this,l)}function e(l,u,o){this.promise=l,typeof u=="function"&&(this.onFulfilled=u,this.callFulfilled=this.otherCallFulfilled),typeof o=="function"&&(this.onRejected=o,this.callRejected=this.otherCallRejected)}function t(l,u,o){y(function(){var i;try{i=u(o)}catch(a){return h.reject(l,a)}i===l?h.reject(l,new TypeError("Cannot resolve promise with itself")):h.resolve(l,i)})}function p(l){var u=l&&l.then;if(l&&(typeof l=="object"||typeof l=="function")&&typeof u=="function")return function(){u.apply(l,arguments)}}function c(l,u){var o=!1;function i(v){o||(o=!0,h.reject(l,v))}function a(v){o||(o=!0,h.resolve(l,v))}var b=s(function(){u(a,i)});b.status==="error"&&i(b.value)}function s(l,u){var o={};try{o.value=l(u),o.status="success"}catch(i){o.status="error",o.value=i}return o}(f.exports=n).prototype.finally=function(l){if(typeof l!="function")return this;var u=this.constructor;return this.then(function(o){return u.resolve(l()).then(function(){return o})},function(o){return u.resolve(l()).then(function(){throw o})})},n.prototype.catch=function(l){return this.then(null,l)},n.prototype.then=function(l,u){if(typeof l!="function"&&this.state===A||typeof u!="function"&&this.state===w)return this;var o=new this.constructor(E);return this.state!==r?t(o,this.state===A?l:u,this.outcome):this.queue.push(new e(o,l,u)),o},e.prototype.callFulfilled=function(l){h.resolve(this.promise,l)},e.prototype.otherCallFulfilled=function(l){t(this.promise,this.onFulfilled,l)},e.prototype.callRejected=function(l){h.reject(this.promise,l)},e.prototype.otherCallRejected=function(l){t(this.promise,this.onRejected,l)},h.resolve=function(l,u){var o=s(p,u);if(o.status==="error")return h.reject(l,o.value);var i=o.value;if(i)c(l,i);else{l.state=A,l.outcome=u;for(var a=-1,b=l.queue.length;++a<b;)l.queue[a].callFulfilled(u)}return l},h.reject=function(l,u){l.state=w,l.outcome=u;for(var o=-1,i=l.queue.length;++o<i;)l.queue[o].callRejected(u);return l},n.resolve=function(l){return l instanceof this?l:h.resolve(new this(E),l)},n.reject=function(l){var u=new this(E);return h.reject(u,l)},n.all=function(l){var u=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var o=l.length,i=!1;if(!o)return this.resolve([]);for(var a=new Array(o),b=0,v=-1,_=new this(E);++v<o;)T(l[v],v);return _;function T(k,M){u.resolve(k).then(function(R){a[M]=R,++b!==o||i||(i=!0,h.resolve(_,a))},function(R){i||(i=!0,h.reject(_,R))})}},n.race=function(l){var u=this;if(Object.prototype.toString.call(l)!=="[object Array]")return this.reject(new TypeError("must be an array"));var o=l.length,i=!1;if(!o)return this.resolve([]);for(var a=-1,b=new this(E);++a<o;)v=l[a],u.resolve(v).then(function(_){i||(i=!0,h.resolve(b,_))},function(_){i||(i=!0,h.reject(b,_))});var v;return b}},{immediate:36}],38:[function(d,f,g){"use strict";var y={};(0,d("./lib/utils/common").assign)(y,d("./lib/deflate"),d("./lib/inflate"),d("./lib/zlib/constants")),f.exports=y},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(d,f,g){"use strict";var y=d("./zlib/deflate"),E=d("./utils/common"),h=d("./utils/strings"),w=d("./zlib/messages"),A=d("./zlib/zstream"),r=Object.prototype.toString,n=0,e=-1,t=0,p=8;function c(l){if(!(this instanceof c))return new c(l);this.options=E.assign({level:e,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:t,to:""},l||{});var u=this.options;u.raw&&0<u.windowBits?u.windowBits=-u.windowBits:u.gzip&&0<u.windowBits&&u.windowBits<16&&(u.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new A,this.strm.avail_out=0;var o=y.deflateInit2(this.strm,u.level,u.method,u.windowBits,u.memLevel,u.strategy);if(o!==n)throw new Error(w[o]);if(u.header&&y.deflateSetHeader(this.strm,u.header),u.dictionary){var i;if(i=typeof u.dictionary=="string"?h.string2buf(u.dictionary):r.call(u.dictionary)==="[object ArrayBuffer]"?new Uint8Array(u.dictionary):u.dictionary,(o=y.deflateSetDictionary(this.strm,i))!==n)throw new Error(w[o]);this._dict_set=!0}}function s(l,u){var o=new c(u);if(o.push(l,!0),o.err)throw o.msg||w[o.err];return o.result}c.prototype.push=function(l,u){var o,i,a=this.strm,b=this.options.chunkSize;if(this.ended)return!1;i=u===~~u?u:u===!0?4:0,typeof l=="string"?a.input=h.string2buf(l):r.call(l)==="[object ArrayBuffer]"?a.input=new Uint8Array(l):a.input=l,a.next_in=0,a.avail_in=a.input.length;do{if(a.avail_out===0&&(a.output=new E.Buf8(b),a.next_out=0,a.avail_out=b),(o=y.deflate(a,i))!==1&&o!==n)return this.onEnd(o),!(this.ended=!0);a.avail_out!==0&&(a.avail_in!==0||i!==4&&i!==2)||(this.options.to==="string"?this.onData(h.buf2binstring(E.shrinkBuf(a.output,a.next_out))):this.onData(E.shrinkBuf(a.output,a.next_out)))}while((0<a.avail_in||a.avail_out===0)&&o!==1);return i===4?(o=y.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===n):i!==2||(this.onEnd(n),!(a.avail_out=0))},c.prototype.onData=function(l){this.chunks.push(l)},c.prototype.onEnd=function(l){l===n&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=E.flattenChunks(this.chunks)),this.chunks=[],this.err=l,this.msg=this.strm.msg},g.Deflate=c,g.deflate=s,g.deflateRaw=function(l,u){return(u=u||{}).raw=!0,s(l,u)},g.gzip=function(l,u){return(u=u||{}).gzip=!0,s(l,u)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(d,f,g){"use strict";var y=d("./zlib/inflate"),E=d("./utils/common"),h=d("./utils/strings"),w=d("./zlib/constants"),A=d("./zlib/messages"),r=d("./zlib/zstream"),n=d("./zlib/gzheader"),e=Object.prototype.toString;function t(c){if(!(this instanceof t))return new t(c);this.options=E.assign({chunkSize:16384,windowBits:0,to:""},c||{});var s=this.options;s.raw&&0<=s.windowBits&&s.windowBits<16&&(s.windowBits=-s.windowBits,s.windowBits===0&&(s.windowBits=-15)),!(0<=s.windowBits&&s.windowBits<16)||c&&c.windowBits||(s.windowBits+=32),15<s.windowBits&&s.windowBits<48&&(15&s.windowBits)==0&&(s.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new r,this.strm.avail_out=0;var l=y.inflateInit2(this.strm,s.windowBits);if(l!==w.Z_OK)throw new Error(A[l]);this.header=new n,y.inflateGetHeader(this.strm,this.header)}function p(c,s){var l=new t(s);if(l.push(c,!0),l.err)throw l.msg||A[l.err];return l.result}t.prototype.push=function(c,s){var l,u,o,i,a,b,v=this.strm,_=this.options.chunkSize,T=this.options.dictionary,k=!1;if(this.ended)return!1;u=s===~~s?s:s===!0?w.Z_FINISH:w.Z_NO_FLUSH,typeof c=="string"?v.input=h.binstring2buf(c):e.call(c)==="[object ArrayBuffer]"?v.input=new Uint8Array(c):v.input=c,v.next_in=0,v.avail_in=v.input.length;do{if(v.avail_out===0&&(v.output=new E.Buf8(_),v.next_out=0,v.avail_out=_),(l=y.inflate(v,w.Z_NO_FLUSH))===w.Z_NEED_DICT&&T&&(b=typeof T=="string"?h.string2buf(T):e.call(T)==="[object ArrayBuffer]"?new Uint8Array(T):T,l=y.inflateSetDictionary(this.strm,b)),l===w.Z_BUF_ERROR&&k===!0&&(l=w.Z_OK,k=!1),l!==w.Z_STREAM_END&&l!==w.Z_OK)return this.onEnd(l),!(this.ended=!0);v.next_out&&(v.avail_out!==0&&l!==w.Z_STREAM_END&&(v.avail_in!==0||u!==w.Z_FINISH&&u!==w.Z_SYNC_FLUSH)||(this.options.to==="string"?(o=h.utf8border(v.output,v.next_out),i=v.next_out-o,a=h.buf2string(v.output,o),v.next_out=i,v.avail_out=_-i,i&&E.arraySet(v.output,v.output,o,i,0),this.onData(a)):this.onData(E.shrinkBuf(v.output,v.next_out)))),v.avail_in===0&&v.avail_out===0&&(k=!0)}while((0<v.avail_in||v.avail_out===0)&&l!==w.Z_STREAM_END);return l===w.Z_STREAM_END&&(u=w.Z_FINISH),u===w.Z_FINISH?(l=y.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===w.Z_OK):u!==w.Z_SYNC_FLUSH||(this.onEnd(w.Z_OK),!(v.avail_out=0))},t.prototype.onData=function(c){this.chunks.push(c)},t.prototype.onEnd=function(c){c===w.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=E.flattenChunks(this.chunks)),this.chunks=[],this.err=c,this.msg=this.strm.msg},g.Inflate=t,g.inflate=p,g.inflateRaw=function(c,s){return(s=s||{}).raw=!0,p(c,s)},g.ungzip=p},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(d,f,g){"use strict";var y=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";g.assign=function(w){for(var A=Array.prototype.slice.call(arguments,1);A.length;){var r=A.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)r.hasOwnProperty(n)&&(w[n]=r[n])}}return w},g.shrinkBuf=function(w,A){return w.length===A?w:w.subarray?w.subarray(0,A):(w.length=A,w)};var E={arraySet:function(w,A,r,n,e){if(A.subarray&&w.subarray)w.set(A.subarray(r,r+n),e);else for(var t=0;t<n;t++)w[e+t]=A[r+t]},flattenChunks:function(w){var A,r,n,e,t,p;for(A=n=0,r=w.length;A<r;A++)n+=w[A].length;for(p=new Uint8Array(n),A=e=0,r=w.length;A<r;A++)t=w[A],p.set(t,e),e+=t.length;return p}},h={arraySet:function(w,A,r,n,e){for(var t=0;t<n;t++)w[e+t]=A[r+t]},flattenChunks:function(w){return[].concat.apply([],w)}};g.setTyped=function(w){w?(g.Buf8=Uint8Array,g.Buf16=Uint16Array,g.Buf32=Int32Array,g.assign(g,E)):(g.Buf8=Array,g.Buf16=Array,g.Buf32=Array,g.assign(g,h))},g.setTyped(y)},{}],42:[function(d,f,g){"use strict";var y=d("./common"),E=!0,h=!0;try{String.fromCharCode.apply(null,[0])}catch{E=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{h=!1}for(var w=new y.Buf8(256),A=0;A<256;A++)w[A]=252<=A?6:248<=A?5:240<=A?4:224<=A?3:192<=A?2:1;function r(n,e){if(e<65537&&(n.subarray&&h||!n.subarray&&E))return String.fromCharCode.apply(null,y.shrinkBuf(n,e));for(var t="",p=0;p<e;p++)t+=String.fromCharCode(n[p]);return t}w[254]=w[254]=1,g.string2buf=function(n){var e,t,p,c,s,l=n.length,u=0;for(c=0;c<l;c++)(64512&(t=n.charCodeAt(c)))==55296&&c+1<l&&(64512&(p=n.charCodeAt(c+1)))==56320&&(t=65536+(t-55296<<10)+(p-56320),c++),u+=t<128?1:t<2048?2:t<65536?3:4;for(e=new y.Buf8(u),c=s=0;s<u;c++)(64512&(t=n.charCodeAt(c)))==55296&&c+1<l&&(64512&(p=n.charCodeAt(c+1)))==56320&&(t=65536+(t-55296<<10)+(p-56320),c++),t<128?e[s++]=t:(t<2048?e[s++]=192|t>>>6:(t<65536?e[s++]=224|t>>>12:(e[s++]=240|t>>>18,e[s++]=128|t>>>12&63),e[s++]=128|t>>>6&63),e[s++]=128|63&t);return e},g.buf2binstring=function(n){return r(n,n.length)},g.binstring2buf=function(n){for(var e=new y.Buf8(n.length),t=0,p=e.length;t<p;t++)e[t]=n.charCodeAt(t);return e},g.buf2string=function(n,e){var t,p,c,s,l=e||n.length,u=new Array(2*l);for(t=p=0;t<l;)if((c=n[t++])<128)u[p++]=c;else if(4<(s=w[c]))u[p++]=65533,t+=s-1;else{for(c&=s===2?31:s===3?15:7;1<s&&t<l;)c=c<<6|63&n[t++],s--;1<s?u[p++]=65533:c<65536?u[p++]=c:(c-=65536,u[p++]=55296|c>>10&1023,u[p++]=56320|1023&c)}return r(u,p)},g.utf8border=function(n,e){var t;for((e=e||n.length)>n.length&&(e=n.length),t=e-1;0<=t&&(192&n[t])==128;)t--;return t<0||t===0?e:t+w[n[t]]>e?t:e}},{"./common":41}],43:[function(d,f,g){"use strict";f.exports=function(y,E,h,w){for(var A=65535&y|0,r=y>>>16&65535|0,n=0;h!==0;){for(h-=n=2e3<h?2e3:h;r=r+(A=A+E[w++]|0)|0,--n;);A%=65521,r%=65521}return A|r<<16|0}},{}],44:[function(d,f,g){"use strict";f.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(d,f,g){"use strict";var y=(function(){for(var E,h=[],w=0;w<256;w++){E=w;for(var A=0;A<8;A++)E=1&E?3988292384^E>>>1:E>>>1;h[w]=E}return h})();f.exports=function(E,h,w,A){var r=y,n=A+w;E^=-1;for(var e=A;e<n;e++)E=E>>>8^r[255&(E^h[e])];return-1^E}},{}],46:[function(d,f,g){"use strict";var y,E=d("../utils/common"),h=d("./trees"),w=d("./adler32"),A=d("./crc32"),r=d("./messages"),n=0,e=4,t=0,p=-2,c=-1,s=4,l=2,u=8,o=9,i=286,a=30,b=19,v=2*i+1,_=15,T=3,k=258,M=k+T+1,R=42,O=113,P=1,N=2,it=3,J=4;function ot(S,$){return S.msg=r[$],$}function tt(S){return(S<<1)-(4<S?9:0)}function ht(S){for(var $=S.length;0<=--$;)S[$]=0}function W(S){var $=S.state,z=$.pending;z>S.avail_out&&(z=S.avail_out),z!==0&&(E.arraySet(S.output,$.pending_buf,$.pending_out,z,S.next_out),S.next_out+=z,$.pending_out+=z,S.total_out+=z,S.avail_out-=z,$.pending-=z,$.pending===0&&($.pending_out=0))}function G(S,$){h._tr_flush_block(S,0<=S.block_start?S.block_start:-1,S.strstart-S.block_start,$),S.block_start=S.strstart,W(S.strm)}function gt(S,$){S.pending_buf[S.pending++]=$}function nt(S,$){S.pending_buf[S.pending++]=$>>>8&255,S.pending_buf[S.pending++]=255&$}function j(S,$){var z,x,D=S.max_chain_length,I=S.strstart,H=S.prev_length,L=S.nice_match,B=S.strstart>S.w_size-M?S.strstart-(S.w_size-M):0,Y=S.window,Q=S.w_mask,K=S.prev,lt=S.strstart+k,ft=Y[I+H-1],X=Y[I+H];S.prev_length>=S.good_match&&(D>>=2),L>S.lookahead&&(L=S.lookahead);do if(Y[(z=$)+H]===X&&Y[z+H-1]===ft&&Y[z]===Y[I]&&Y[++z]===Y[I+1]){I+=2,z++;do;while(Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&Y[++I]===Y[++z]&&I<lt);if(x=k-(lt-I),I=lt-k,H<x){if(S.match_start=$,L<=(H=x))break;ft=Y[I+H-1],X=Y[I+H]}}while(($=K[$&Q])>B&&--D!=0);return H<=S.lookahead?H:S.lookahead}function U(S){var $,z,x,D,I,H,L,B,Y,Q,K=S.w_size;do{if(D=S.window_size-S.lookahead-S.strstart,S.strstart>=K+(K-M)){for(E.arraySet(S.window,S.window,K,K,0),S.match_start-=K,S.strstart-=K,S.block_start-=K,$=z=S.hash_size;x=S.head[--$],S.head[$]=K<=x?x-K:0,--z;);for($=z=K;x=S.prev[--$],S.prev[$]=K<=x?x-K:0,--z;);D+=K}if(S.strm.avail_in===0)break;if(H=S.strm,L=S.window,B=S.strstart+S.lookahead,Y=D,Q=void 0,Q=H.avail_in,Y<Q&&(Q=Y),z=Q===0?0:(H.avail_in-=Q,E.arraySet(L,H.input,H.next_in,Q,B),H.state.wrap===1?H.adler=w(H.adler,L,Q,B):H.state.wrap===2&&(H.adler=A(H.adler,L,Q,B)),H.next_in+=Q,H.total_in+=Q,Q),S.lookahead+=z,S.lookahead+S.insert>=T)for(I=S.strstart-S.insert,S.ins_h=S.window[I],S.ins_h=(S.ins_h<<S.hash_shift^S.window[I+1])&S.hash_mask;S.insert&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[I+T-1])&S.hash_mask,S.prev[I&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=I,I++,S.insert--,!(S.lookahead+S.insert<T)););}while(S.lookahead<M&&S.strm.avail_in!==0)}function at(S,$){for(var z,x;;){if(S.lookahead<M){if(U(S),S.lookahead<M&&$===n)return P;if(S.lookahead===0)break}if(z=0,S.lookahead>=T&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+T-1])&S.hash_mask,z=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),z!==0&&S.strstart-z<=S.w_size-M&&(S.match_length=j(S,z)),S.match_length>=T)if(x=h._tr_tally(S,S.strstart-S.match_start,S.match_length-T),S.lookahead-=S.match_length,S.match_length<=S.max_lazy_match&&S.lookahead>=T){for(S.match_length--;S.strstart++,S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+T-1])&S.hash_mask,z=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart,--S.match_length!=0;);S.strstart++}else S.strstart+=S.match_length,S.match_length=0,S.ins_h=S.window[S.strstart],S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+1])&S.hash_mask;else x=h._tr_tally(S,0,S.window[S.strstart]),S.lookahead--,S.strstart++;if(x&&(G(S,!1),S.strm.avail_out===0))return P}return S.insert=S.strstart<T-1?S.strstart:T-1,$===e?(G(S,!0),S.strm.avail_out===0?it:J):S.last_lit&&(G(S,!1),S.strm.avail_out===0)?P:N}function rt(S,$){for(var z,x,D;;){if(S.lookahead<M){if(U(S),S.lookahead<M&&$===n)return P;if(S.lookahead===0)break}if(z=0,S.lookahead>=T&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+T-1])&S.hash_mask,z=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),S.prev_length=S.match_length,S.prev_match=S.match_start,S.match_length=T-1,z!==0&&S.prev_length<S.max_lazy_match&&S.strstart-z<=S.w_size-M&&(S.match_length=j(S,z),S.match_length<=5&&(S.strategy===1||S.match_length===T&&4096<S.strstart-S.match_start)&&(S.match_length=T-1)),S.prev_length>=T&&S.match_length<=S.prev_length){for(D=S.strstart+S.lookahead-T,x=h._tr_tally(S,S.strstart-1-S.prev_match,S.prev_length-T),S.lookahead-=S.prev_length-1,S.prev_length-=2;++S.strstart<=D&&(S.ins_h=(S.ins_h<<S.hash_shift^S.window[S.strstart+T-1])&S.hash_mask,z=S.prev[S.strstart&S.w_mask]=S.head[S.ins_h],S.head[S.ins_h]=S.strstart),--S.prev_length!=0;);if(S.match_available=0,S.match_length=T-1,S.strstart++,x&&(G(S,!1),S.strm.avail_out===0))return P}else if(S.match_available){if((x=h._tr_tally(S,0,S.window[S.strstart-1]))&&G(S,!1),S.strstart++,S.lookahead--,S.strm.avail_out===0)return P}else S.match_available=1,S.strstart++,S.lookahead--}return S.match_available&&(x=h._tr_tally(S,0,S.window[S.strstart-1]),S.match_available=0),S.insert=S.strstart<T-1?S.strstart:T-1,$===e?(G(S,!0),S.strm.avail_out===0?it:J):S.last_lit&&(G(S,!1),S.strm.avail_out===0)?P:N}function V(S,$,z,x,D){this.good_length=S,this.max_lazy=$,this.nice_length=z,this.max_chain=x,this.func=D}function et(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=u,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new E.Buf16(2*v),this.dyn_dtree=new E.Buf16(2*(2*a+1)),this.bl_tree=new E.Buf16(2*(2*b+1)),ht(this.dyn_ltree),ht(this.dyn_dtree),ht(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new E.Buf16(_+1),this.heap=new E.Buf16(2*i+1),ht(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new E.Buf16(2*i+1),ht(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function q(S){var $;return S&&S.state?(S.total_in=S.total_out=0,S.data_type=l,($=S.state).pending=0,$.pending_out=0,$.wrap<0&&($.wrap=-$.wrap),$.status=$.wrap?R:O,S.adler=$.wrap===2?0:1,$.last_flush=n,h._tr_init($),t):ot(S,p)}function F(S){var $=q(S);return $===t&&(function(z){z.window_size=2*z.w_size,ht(z.head),z.max_lazy_match=y[z.level].max_lazy,z.good_match=y[z.level].good_length,z.nice_match=y[z.level].nice_length,z.max_chain_length=y[z.level].max_chain,z.strstart=0,z.block_start=0,z.lookahead=0,z.insert=0,z.match_length=z.prev_length=T-1,z.match_available=0,z.ins_h=0})(S.state),$}function ut(S,$,z,x,D,I){if(!S)return p;var H=1;if($===c&&($=6),x<0?(H=0,x=-x):15<x&&(H=2,x-=16),D<1||o<D||z!==u||x<8||15<x||$<0||9<$||I<0||s<I)return ot(S,p);x===8&&(x=9);var L=new et;return(S.state=L).strm=S,L.wrap=H,L.gzhead=null,L.w_bits=x,L.w_size=1<<L.w_bits,L.w_mask=L.w_size-1,L.hash_bits=D+7,L.hash_size=1<<L.hash_bits,L.hash_mask=L.hash_size-1,L.hash_shift=~~((L.hash_bits+T-1)/T),L.window=new E.Buf8(2*L.w_size),L.head=new E.Buf16(L.hash_size),L.prev=new E.Buf16(L.w_size),L.lit_bufsize=1<<D+6,L.pending_buf_size=4*L.lit_bufsize,L.pending_buf=new E.Buf8(L.pending_buf_size),L.d_buf=1*L.lit_bufsize,L.l_buf=3*L.lit_bufsize,L.level=$,L.strategy=I,L.method=z,F(S)}y=[new V(0,0,0,0,function(S,$){var z=65535;for(z>S.pending_buf_size-5&&(z=S.pending_buf_size-5);;){if(S.lookahead<=1){if(U(S),S.lookahead===0&&$===n)return P;if(S.lookahead===0)break}S.strstart+=S.lookahead,S.lookahead=0;var x=S.block_start+z;if((S.strstart===0||S.strstart>=x)&&(S.lookahead=S.strstart-x,S.strstart=x,G(S,!1),S.strm.avail_out===0)||S.strstart-S.block_start>=S.w_size-M&&(G(S,!1),S.strm.avail_out===0))return P}return S.insert=0,$===e?(G(S,!0),S.strm.avail_out===0?it:J):(S.strstart>S.block_start&&(G(S,!1),S.strm.avail_out),P)}),new V(4,4,8,4,at),new V(4,5,16,8,at),new V(4,6,32,32,at),new V(4,4,16,16,rt),new V(8,16,32,32,rt),new V(8,16,128,128,rt),new V(8,32,128,256,rt),new V(32,128,258,1024,rt),new V(32,258,258,4096,rt)],g.deflateInit=function(S,$){return ut(S,$,u,15,8,0)},g.deflateInit2=ut,g.deflateReset=F,g.deflateResetKeep=q,g.deflateSetHeader=function(S,$){return S&&S.state?S.state.wrap!==2?p:(S.state.gzhead=$,t):p},g.deflate=function(S,$){var z,x,D,I;if(!S||!S.state||5<$||$<0)return S?ot(S,p):p;if(x=S.state,!S.output||!S.input&&S.avail_in!==0||x.status===666&&$!==e)return ot(S,S.avail_out===0?-5:p);if(x.strm=S,z=x.last_flush,x.last_flush=$,x.status===R)if(x.wrap===2)S.adler=0,gt(x,31),gt(x,139),gt(x,8),x.gzhead?(gt(x,(x.gzhead.text?1:0)+(x.gzhead.hcrc?2:0)+(x.gzhead.extra?4:0)+(x.gzhead.name?8:0)+(x.gzhead.comment?16:0)),gt(x,255&x.gzhead.time),gt(x,x.gzhead.time>>8&255),gt(x,x.gzhead.time>>16&255),gt(x,x.gzhead.time>>24&255),gt(x,x.level===9?2:2<=x.strategy||x.level<2?4:0),gt(x,255&x.gzhead.os),x.gzhead.extra&&x.gzhead.extra.length&&(gt(x,255&x.gzhead.extra.length),gt(x,x.gzhead.extra.length>>8&255)),x.gzhead.hcrc&&(S.adler=A(S.adler,x.pending_buf,x.pending,0)),x.gzindex=0,x.status=69):(gt(x,0),gt(x,0),gt(x,0),gt(x,0),gt(x,0),gt(x,x.level===9?2:2<=x.strategy||x.level<2?4:0),gt(x,3),x.status=O);else{var H=u+(x.w_bits-8<<4)<<8;H|=(2<=x.strategy||x.level<2?0:x.level<6?1:x.level===6?2:3)<<6,x.strstart!==0&&(H|=32),H+=31-H%31,x.status=O,nt(x,H),x.strstart!==0&&(nt(x,S.adler>>>16),nt(x,65535&S.adler)),S.adler=1}if(x.status===69)if(x.gzhead.extra){for(D=x.pending;x.gzindex<(65535&x.gzhead.extra.length)&&(x.pending!==x.pending_buf_size||(x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),W(S),D=x.pending,x.pending!==x.pending_buf_size));)gt(x,255&x.gzhead.extra[x.gzindex]),x.gzindex++;x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),x.gzindex===x.gzhead.extra.length&&(x.gzindex=0,x.status=73)}else x.status=73;if(x.status===73)if(x.gzhead.name){D=x.pending;do{if(x.pending===x.pending_buf_size&&(x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),W(S),D=x.pending,x.pending===x.pending_buf_size)){I=1;break}I=x.gzindex<x.gzhead.name.length?255&x.gzhead.name.charCodeAt(x.gzindex++):0,gt(x,I)}while(I!==0);x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),I===0&&(x.gzindex=0,x.status=91)}else x.status=91;if(x.status===91)if(x.gzhead.comment){D=x.pending;do{if(x.pending===x.pending_buf_size&&(x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),W(S),D=x.pending,x.pending===x.pending_buf_size)){I=1;break}I=x.gzindex<x.gzhead.comment.length?255&x.gzhead.comment.charCodeAt(x.gzindex++):0,gt(x,I)}while(I!==0);x.gzhead.hcrc&&x.pending>D&&(S.adler=A(S.adler,x.pending_buf,x.pending-D,D)),I===0&&(x.status=103)}else x.status=103;if(x.status===103&&(x.gzhead.hcrc?(x.pending+2>x.pending_buf_size&&W(S),x.pending+2<=x.pending_buf_size&&(gt(x,255&S.adler),gt(x,S.adler>>8&255),S.adler=0,x.status=O)):x.status=O),x.pending!==0){if(W(S),S.avail_out===0)return x.last_flush=-1,t}else if(S.avail_in===0&&tt($)<=tt(z)&&$!==e)return ot(S,-5);if(x.status===666&&S.avail_in!==0)return ot(S,-5);if(S.avail_in!==0||x.lookahead!==0||$!==n&&x.status!==666){var L=x.strategy===2?(function(B,Y){for(var Q;;){if(B.lookahead===0&&(U(B),B.lookahead===0)){if(Y===n)return P;break}if(B.match_length=0,Q=h._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++,Q&&(G(B,!1),B.strm.avail_out===0))return P}return B.insert=0,Y===e?(G(B,!0),B.strm.avail_out===0?it:J):B.last_lit&&(G(B,!1),B.strm.avail_out===0)?P:N})(x,$):x.strategy===3?(function(B,Y){for(var Q,K,lt,ft,X=B.window;;){if(B.lookahead<=k){if(U(B),B.lookahead<=k&&Y===n)return P;if(B.lookahead===0)break}if(B.match_length=0,B.lookahead>=T&&0<B.strstart&&(K=X[lt=B.strstart-1])===X[++lt]&&K===X[++lt]&&K===X[++lt]){ft=B.strstart+k;do;while(K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&K===X[++lt]&&lt<ft);B.match_length=k-(ft-lt),B.match_length>B.lookahead&&(B.match_length=B.lookahead)}if(B.match_length>=T?(Q=h._tr_tally(B,1,B.match_length-T),B.lookahead-=B.match_length,B.strstart+=B.match_length,B.match_length=0):(Q=h._tr_tally(B,0,B.window[B.strstart]),B.lookahead--,B.strstart++),Q&&(G(B,!1),B.strm.avail_out===0))return P}return B.insert=0,Y===e?(G(B,!0),B.strm.avail_out===0?it:J):B.last_lit&&(G(B,!1),B.strm.avail_out===0)?P:N})(x,$):y[x.level].func(x,$);if(L!==it&&L!==J||(x.status=666),L===P||L===it)return S.avail_out===0&&(x.last_flush=-1),t;if(L===N&&($===1?h._tr_align(x):$!==5&&(h._tr_stored_block(x,0,0,!1),$===3&&(ht(x.head),x.lookahead===0&&(x.strstart=0,x.block_start=0,x.insert=0))),W(S),S.avail_out===0))return x.last_flush=-1,t}return $!==e?t:x.wrap<=0?1:(x.wrap===2?(gt(x,255&S.adler),gt(x,S.adler>>8&255),gt(x,S.adler>>16&255),gt(x,S.adler>>24&255),gt(x,255&S.total_in),gt(x,S.total_in>>8&255),gt(x,S.total_in>>16&255),gt(x,S.total_in>>24&255)):(nt(x,S.adler>>>16),nt(x,65535&S.adler)),W(S),0<x.wrap&&(x.wrap=-x.wrap),x.pending!==0?t:1)},g.deflateEnd=function(S){var $;return S&&S.state?($=S.state.status)!==R&&$!==69&&$!==73&&$!==91&&$!==103&&$!==O&&$!==666?ot(S,p):(S.state=null,$===O?ot(S,-3):t):p},g.deflateSetDictionary=function(S,$){var z,x,D,I,H,L,B,Y,Q=$.length;if(!S||!S.state||(I=(z=S.state).wrap)===2||I===1&&z.status!==R||z.lookahead)return p;for(I===1&&(S.adler=w(S.adler,$,Q,0)),z.wrap=0,Q>=z.w_size&&(I===0&&(ht(z.head),z.strstart=0,z.block_start=0,z.insert=0),Y=new E.Buf8(z.w_size),E.arraySet(Y,$,Q-z.w_size,z.w_size,0),$=Y,Q=z.w_size),H=S.avail_in,L=S.next_in,B=S.input,S.avail_in=Q,S.next_in=0,S.input=$,U(z);z.lookahead>=T;){for(x=z.strstart,D=z.lookahead-(T-1);z.ins_h=(z.ins_h<<z.hash_shift^z.window[x+T-1])&z.hash_mask,z.prev[x&z.w_mask]=z.head[z.ins_h],z.head[z.ins_h]=x,x++,--D;);z.strstart=x,z.lookahead=T-1,U(z)}return z.strstart+=z.lookahead,z.block_start=z.strstart,z.insert=z.lookahead,z.lookahead=0,z.match_length=z.prev_length=T-1,z.match_available=0,S.next_in=L,S.input=B,S.avail_in=H,z.wrap=I,t},g.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(d,f,g){"use strict";f.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(d,f,g){"use strict";f.exports=function(y,E){var h=y.state,w=y.next_in,A,r,n,e,t,p,c,s,l,u,o,i,a,b,v,_,T,k,M,R,O,P=y.input,N;A=w+(y.avail_in-5),r=y.next_out,N=y.output,n=r-(E-y.avail_out),e=r+(y.avail_out-257),t=h.dmax,p=h.wsize,c=h.whave,s=h.wnext,l=h.window,u=h.hold,o=h.bits,i=h.lencode,a=h.distcode,b=(1<<h.lenbits)-1,v=(1<<h.distbits)-1;t:do{o<15&&(u+=P[w++]<<o,o+=8,u+=P[w++]<<o,o+=8),_=i[u&b];e:for(;;){if(u>>>=T=_>>>24,o-=T,(T=_>>>16&255)===0)N[r++]=65535&_;else{if(!(16&T)){if((64&T)==0){_=i[(65535&_)+(u&(1<<T)-1)];continue e}if(32&T){h.mode=12;break t}y.msg="invalid literal/length code",h.mode=30;break t}k=65535&_,(T&=15)&&(o<T&&(u+=P[w++]<<o,o+=8),k+=u&(1<<T)-1,u>>>=T,o-=T),o<15&&(u+=P[w++]<<o,o+=8,u+=P[w++]<<o,o+=8),_=a[u&v];r:for(;;){if(u>>>=T=_>>>24,o-=T,!(16&(T=_>>>16&255))){if((64&T)==0){_=a[(65535&_)+(u&(1<<T)-1)];continue r}y.msg="invalid distance code",h.mode=30;break t}if(M=65535&_,o<(T&=15)&&(u+=P[w++]<<o,(o+=8)<T&&(u+=P[w++]<<o,o+=8)),t<(M+=u&(1<<T)-1)){y.msg="invalid distance too far back",h.mode=30;break t}if(u>>>=T,o-=T,(T=r-n)<M){if(c<(T=M-T)&&h.sane){y.msg="invalid distance too far back",h.mode=30;break t}if(O=l,(R=0)===s){if(R+=p-T,T<k){for(k-=T;N[r++]=l[R++],--T;);R=r-M,O=N}}else if(s<T){if(R+=p+s-T,(T-=s)<k){for(k-=T;N[r++]=l[R++],--T;);if(R=0,s<k){for(k-=T=s;N[r++]=l[R++],--T;);R=r-M,O=N}}}else if(R+=s-T,T<k){for(k-=T;N[r++]=l[R++],--T;);R=r-M,O=N}for(;2<k;)N[r++]=O[R++],N[r++]=O[R++],N[r++]=O[R++],k-=3;k&&(N[r++]=O[R++],1<k&&(N[r++]=O[R++]))}else{for(R=r-M;N[r++]=N[R++],N[r++]=N[R++],N[r++]=N[R++],2<(k-=3););k&&(N[r++]=N[R++],1<k&&(N[r++]=N[R++]))}break}}break}}while(w<A&&r<e);w-=k=o>>3,u&=(1<<(o-=k<<3))-1,y.next_in=w,y.next_out=r,y.avail_in=w<A?A-w+5:5-(w-A),y.avail_out=r<e?e-r+257:257-(r-e),h.hold=u,h.bits=o}},{}],49:[function(d,f,g){"use strict";var y=d("../utils/common"),E=d("./adler32"),h=d("./crc32"),w=d("./inffast"),A=d("./inftrees"),r=1,n=2,e=0,t=-2,p=1,c=852,s=592;function l(R){return(R>>>24&255)+(R>>>8&65280)+((65280&R)<<8)+((255&R)<<24)}function u(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new y.Buf16(320),this.work=new y.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function o(R){var O;return R&&R.state?(O=R.state,R.total_in=R.total_out=O.total=0,R.msg="",O.wrap&&(R.adler=1&O.wrap),O.mode=p,O.last=0,O.havedict=0,O.dmax=32768,O.head=null,O.hold=0,O.bits=0,O.lencode=O.lendyn=new y.Buf32(c),O.distcode=O.distdyn=new y.Buf32(s),O.sane=1,O.back=-1,e):t}function i(R){var O;return R&&R.state?((O=R.state).wsize=0,O.whave=0,O.wnext=0,o(R)):t}function a(R,O){var P,N;return R&&R.state?(N=R.state,O<0?(P=0,O=-O):(P=1+(O>>4),O<48&&(O&=15)),O&&(O<8||15<O)?t:(N.window!==null&&N.wbits!==O&&(N.window=null),N.wrap=P,N.wbits=O,i(R))):t}function b(R,O){var P,N;return R?(N=new u,(R.state=N).window=null,(P=a(R,O))!==e&&(R.state=null),P):t}var v,_,T=!0;function k(R){if(T){var O;for(v=new y.Buf32(512),_=new y.Buf32(32),O=0;O<144;)R.lens[O++]=8;for(;O<256;)R.lens[O++]=9;for(;O<280;)R.lens[O++]=7;for(;O<288;)R.lens[O++]=8;for(A(r,R.lens,0,288,v,0,R.work,{bits:9}),O=0;O<32;)R.lens[O++]=5;A(n,R.lens,0,32,_,0,R.work,{bits:5}),T=!1}R.lencode=v,R.lenbits=9,R.distcode=_,R.distbits=5}function M(R,O,P,N){var it,J=R.state;return J.window===null&&(J.wsize=1<<J.wbits,J.wnext=0,J.whave=0,J.window=new y.Buf8(J.wsize)),N>=J.wsize?(y.arraySet(J.window,O,P-J.wsize,J.wsize,0),J.wnext=0,J.whave=J.wsize):(N<(it=J.wsize-J.wnext)&&(it=N),y.arraySet(J.window,O,P-N,it,J.wnext),(N-=it)?(y.arraySet(J.window,O,P-N,N,0),J.wnext=N,J.whave=J.wsize):(J.wnext+=it,J.wnext===J.wsize&&(J.wnext=0),J.whave<J.wsize&&(J.whave+=it))),0}g.inflateReset=i,g.inflateReset2=a,g.inflateResetKeep=o,g.inflateInit=function(R){return b(R,15)},g.inflateInit2=b,g.inflate=function(R,O){var P,N,it,J,ot,tt,ht,W,G,gt,nt,j,U,at,rt,V,et,q,F,ut,S,$,z,x,D=0,I=new y.Buf8(4),H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!R||!R.state||!R.output||!R.input&&R.avail_in!==0)return t;(P=R.state).mode===12&&(P.mode=13),ot=R.next_out,it=R.output,ht=R.avail_out,J=R.next_in,N=R.input,tt=R.avail_in,W=P.hold,G=P.bits,gt=tt,nt=ht,$=e;t:for(;;)switch(P.mode){case p:if(P.wrap===0){P.mode=13;break}for(;G<16;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(2&P.wrap&&W===35615){I[P.check=0]=255&W,I[1]=W>>>8&255,P.check=h(P.check,I,2,0),G=W=0,P.mode=2;break}if(P.flags=0,P.head&&(P.head.done=!1),!(1&P.wrap)||(((255&W)<<8)+(W>>8))%31){R.msg="incorrect header check",P.mode=30;break}if((15&W)!=8){R.msg="unknown compression method",P.mode=30;break}if(G-=4,S=8+(15&(W>>>=4)),P.wbits===0)P.wbits=S;else if(S>P.wbits){R.msg="invalid window size",P.mode=30;break}P.dmax=1<<S,R.adler=P.check=1,P.mode=512&W?10:12,G=W=0;break;case 2:for(;G<16;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(P.flags=W,(255&P.flags)!=8){R.msg="unknown compression method",P.mode=30;break}if(57344&P.flags){R.msg="unknown header flags set",P.mode=30;break}P.head&&(P.head.text=W>>8&1),512&P.flags&&(I[0]=255&W,I[1]=W>>>8&255,P.check=h(P.check,I,2,0)),G=W=0,P.mode=3;case 3:for(;G<32;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.head&&(P.head.time=W),512&P.flags&&(I[0]=255&W,I[1]=W>>>8&255,I[2]=W>>>16&255,I[3]=W>>>24&255,P.check=h(P.check,I,4,0)),G=W=0,P.mode=4;case 4:for(;G<16;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.head&&(P.head.xflags=255&W,P.head.os=W>>8),512&P.flags&&(I[0]=255&W,I[1]=W>>>8&255,P.check=h(P.check,I,2,0)),G=W=0,P.mode=5;case 5:if(1024&P.flags){for(;G<16;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.length=W,P.head&&(P.head.extra_len=W),512&P.flags&&(I[0]=255&W,I[1]=W>>>8&255,P.check=h(P.check,I,2,0)),G=W=0}else P.head&&(P.head.extra=null);P.mode=6;case 6:if(1024&P.flags&&(tt<(j=P.length)&&(j=tt),j&&(P.head&&(S=P.head.extra_len-P.length,P.head.extra||(P.head.extra=new Array(P.head.extra_len)),y.arraySet(P.head.extra,N,J,j,S)),512&P.flags&&(P.check=h(P.check,N,j,J)),tt-=j,J+=j,P.length-=j),P.length))break t;P.length=0,P.mode=7;case 7:if(2048&P.flags){if(tt===0)break t;for(j=0;S=N[J+j++],P.head&&S&&P.length<65536&&(P.head.name+=String.fromCharCode(S)),S&&j<tt;);if(512&P.flags&&(P.check=h(P.check,N,j,J)),tt-=j,J+=j,S)break t}else P.head&&(P.head.name=null);P.length=0,P.mode=8;case 8:if(4096&P.flags){if(tt===0)break t;for(j=0;S=N[J+j++],P.head&&S&&P.length<65536&&(P.head.comment+=String.fromCharCode(S)),S&&j<tt;);if(512&P.flags&&(P.check=h(P.check,N,j,J)),tt-=j,J+=j,S)break t}else P.head&&(P.head.comment=null);P.mode=9;case 9:if(512&P.flags){for(;G<16;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(W!==(65535&P.check)){R.msg="header crc mismatch",P.mode=30;break}G=W=0}P.head&&(P.head.hcrc=P.flags>>9&1,P.head.done=!0),R.adler=P.check=0,P.mode=12;break;case 10:for(;G<32;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}R.adler=P.check=l(W),G=W=0,P.mode=11;case 11:if(P.havedict===0)return R.next_out=ot,R.avail_out=ht,R.next_in=J,R.avail_in=tt,P.hold=W,P.bits=G,2;R.adler=P.check=1,P.mode=12;case 12:if(O===5||O===6)break t;case 13:if(P.last){W>>>=7&G,G-=7&G,P.mode=27;break}for(;G<3;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}switch(P.last=1&W,G-=1,3&(W>>>=1)){case 0:P.mode=14;break;case 1:if(k(P),P.mode=20,O!==6)break;W>>>=2,G-=2;break t;case 2:P.mode=17;break;case 3:R.msg="invalid block type",P.mode=30}W>>>=2,G-=2;break;case 14:for(W>>>=7&G,G-=7&G;G<32;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if((65535&W)!=(W>>>16^65535)){R.msg="invalid stored block lengths",P.mode=30;break}if(P.length=65535&W,G=W=0,P.mode=15,O===6)break t;case 15:P.mode=16;case 16:if(j=P.length){if(tt<j&&(j=tt),ht<j&&(j=ht),j===0)break t;y.arraySet(it,N,J,j,ot),tt-=j,J+=j,ht-=j,ot+=j,P.length-=j;break}P.mode=12;break;case 17:for(;G<14;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(P.nlen=257+(31&W),W>>>=5,G-=5,P.ndist=1+(31&W),W>>>=5,G-=5,P.ncode=4+(15&W),W>>>=4,G-=4,286<P.nlen||30<P.ndist){R.msg="too many length or distance symbols",P.mode=30;break}P.have=0,P.mode=18;case 18:for(;P.have<P.ncode;){for(;G<3;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.lens[H[P.have++]]=7&W,W>>>=3,G-=3}for(;P.have<19;)P.lens[H[P.have++]]=0;if(P.lencode=P.lendyn,P.lenbits=7,z={bits:P.lenbits},$=A(0,P.lens,0,19,P.lencode,0,P.work,z),P.lenbits=z.bits,$){R.msg="invalid code lengths set",P.mode=30;break}P.have=0,P.mode=19;case 19:for(;P.have<P.nlen+P.ndist;){for(;V=(D=P.lencode[W&(1<<P.lenbits)-1])>>>16&255,et=65535&D,!((rt=D>>>24)<=G);){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(et<16)W>>>=rt,G-=rt,P.lens[P.have++]=et;else{if(et===16){for(x=rt+2;G<x;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(W>>>=rt,G-=rt,P.have===0){R.msg="invalid bit length repeat",P.mode=30;break}S=P.lens[P.have-1],j=3+(3&W),W>>>=2,G-=2}else if(et===17){for(x=rt+3;G<x;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}G-=rt,S=0,j=3+(7&(W>>>=rt)),W>>>=3,G-=3}else{for(x=rt+7;G<x;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}G-=rt,S=0,j=11+(127&(W>>>=rt)),W>>>=7,G-=7}if(P.have+j>P.nlen+P.ndist){R.msg="invalid bit length repeat",P.mode=30;break}for(;j--;)P.lens[P.have++]=S}}if(P.mode===30)break;if(P.lens[256]===0){R.msg="invalid code -- missing end-of-block",P.mode=30;break}if(P.lenbits=9,z={bits:P.lenbits},$=A(r,P.lens,0,P.nlen,P.lencode,0,P.work,z),P.lenbits=z.bits,$){R.msg="invalid literal/lengths set",P.mode=30;break}if(P.distbits=6,P.distcode=P.distdyn,z={bits:P.distbits},$=A(n,P.lens,P.nlen,P.ndist,P.distcode,0,P.work,z),P.distbits=z.bits,$){R.msg="invalid distances set",P.mode=30;break}if(P.mode=20,O===6)break t;case 20:P.mode=21;case 21:if(6<=tt&&258<=ht){R.next_out=ot,R.avail_out=ht,R.next_in=J,R.avail_in=tt,P.hold=W,P.bits=G,w(R,nt),ot=R.next_out,it=R.output,ht=R.avail_out,J=R.next_in,N=R.input,tt=R.avail_in,W=P.hold,G=P.bits,P.mode===12&&(P.back=-1);break}for(P.back=0;V=(D=P.lencode[W&(1<<P.lenbits)-1])>>>16&255,et=65535&D,!((rt=D>>>24)<=G);){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(V&&(240&V)==0){for(q=rt,F=V,ut=et;V=(D=P.lencode[ut+((W&(1<<q+F)-1)>>q)])>>>16&255,et=65535&D,!(q+(rt=D>>>24)<=G);){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}W>>>=q,G-=q,P.back+=q}if(W>>>=rt,G-=rt,P.back+=rt,P.length=et,V===0){P.mode=26;break}if(32&V){P.back=-1,P.mode=12;break}if(64&V){R.msg="invalid literal/length code",P.mode=30;break}P.extra=15&V,P.mode=22;case 22:if(P.extra){for(x=P.extra;G<x;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.length+=W&(1<<P.extra)-1,W>>>=P.extra,G-=P.extra,P.back+=P.extra}P.was=P.length,P.mode=23;case 23:for(;V=(D=P.distcode[W&(1<<P.distbits)-1])>>>16&255,et=65535&D,!((rt=D>>>24)<=G);){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if((240&V)==0){for(q=rt,F=V,ut=et;V=(D=P.distcode[ut+((W&(1<<q+F)-1)>>q)])>>>16&255,et=65535&D,!(q+(rt=D>>>24)<=G);){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}W>>>=q,G-=q,P.back+=q}if(W>>>=rt,G-=rt,P.back+=rt,64&V){R.msg="invalid distance code",P.mode=30;break}P.offset=et,P.extra=15&V,P.mode=24;case 24:if(P.extra){for(x=P.extra;G<x;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}P.offset+=W&(1<<P.extra)-1,W>>>=P.extra,G-=P.extra,P.back+=P.extra}if(P.offset>P.dmax){R.msg="invalid distance too far back",P.mode=30;break}P.mode=25;case 25:if(ht===0)break t;if(j=nt-ht,P.offset>j){if((j=P.offset-j)>P.whave&&P.sane){R.msg="invalid distance too far back",P.mode=30;break}U=j>P.wnext?(j-=P.wnext,P.wsize-j):P.wnext-j,j>P.length&&(j=P.length),at=P.window}else at=it,U=ot-P.offset,j=P.length;for(ht<j&&(j=ht),ht-=j,P.length-=j;it[ot++]=at[U++],--j;);P.length===0&&(P.mode=21);break;case 26:if(ht===0)break t;it[ot++]=P.length,ht--,P.mode=21;break;case 27:if(P.wrap){for(;G<32;){if(tt===0)break t;tt--,W|=N[J++]<<G,G+=8}if(nt-=ht,R.total_out+=nt,P.total+=nt,nt&&(R.adler=P.check=P.flags?h(P.check,it,nt,ot-nt):E(P.check,it,nt,ot-nt)),nt=ht,(P.flags?W:l(W))!==P.check){R.msg="incorrect data check",P.mode=30;break}G=W=0}P.mode=28;case 28:if(P.wrap&&P.flags){for(;G<32;){if(tt===0)break t;tt--,W+=N[J++]<<G,G+=8}if(W!==(4294967295&P.total)){R.msg="incorrect length check",P.mode=30;break}G=W=0}P.mode=29;case 29:$=1;break t;case 30:$=-3;break t;case 31:return-4;default:return t}return R.next_out=ot,R.avail_out=ht,R.next_in=J,R.avail_in=tt,P.hold=W,P.bits=G,(P.wsize||nt!==R.avail_out&&P.mode<30&&(P.mode<27||O!==4))&&M(R,R.output,R.next_out,nt-R.avail_out)?(P.mode=31,-4):(gt-=R.avail_in,nt-=R.avail_out,R.total_in+=gt,R.total_out+=nt,P.total+=nt,P.wrap&&nt&&(R.adler=P.check=P.flags?h(P.check,it,nt,R.next_out-nt):E(P.check,it,nt,R.next_out-nt)),R.data_type=P.bits+(P.last?64:0)+(P.mode===12?128:0)+(P.mode===20||P.mode===15?256:0),(gt==0&&nt===0||O===4)&&$===e&&($=-5),$)},g.inflateEnd=function(R){if(!R||!R.state)return t;var O=R.state;return O.window&&(O.window=null),R.state=null,e},g.inflateGetHeader=function(R,O){var P;return R&&R.state?(2&(P=R.state).wrap)==0?t:((P.head=O).done=!1,e):t},g.inflateSetDictionary=function(R,O){var P,N=O.length;return R&&R.state?(P=R.state).wrap!==0&&P.mode!==11?t:P.mode===11&&E(1,O,N,0)!==P.check?-3:M(R,O,N,N)?(P.mode=31,-4):(P.havedict=1,e):t},g.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(d,f,g){"use strict";var y=d("../utils/common"),E=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],h=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],w=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],A=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];f.exports=function(r,n,e,t,p,c,s,l){var u,o,i,a,b,v,_,T,k,M=l.bits,R=0,O=0,P=0,N=0,it=0,J=0,ot=0,tt=0,ht=0,W=0,G=null,gt=0,nt=new y.Buf16(16),j=new y.Buf16(16),U=null,at=0;for(R=0;R<=15;R++)nt[R]=0;for(O=0;O<t;O++)nt[n[e+O]]++;for(it=M,N=15;1<=N&&nt[N]===0;N--);if(N<it&&(it=N),N===0)return p[c++]=20971520,p[c++]=20971520,l.bits=1,0;for(P=1;P<N&&nt[P]===0;P++);for(it<P&&(it=P),R=tt=1;R<=15;R++)if(tt<<=1,(tt-=nt[R])<0)return-1;if(0<tt&&(r===0||N!==1))return-1;for(j[1]=0,R=1;R<15;R++)j[R+1]=j[R]+nt[R];for(O=0;O<t;O++)n[e+O]!==0&&(s[j[n[e+O]]++]=O);if(v=r===0?(G=U=s,19):r===1?(G=E,gt-=257,U=h,at-=257,256):(G=w,U=A,-1),R=P,b=c,ot=O=W=0,i=-1,a=(ht=1<<(J=it))-1,r===1&&852<ht||r===2&&592<ht)return 1;for(;;){for(_=R-ot,k=s[O]<v?(T=0,s[O]):s[O]>v?(T=U[at+s[O]],G[gt+s[O]]):(T=96,0),u=1<<R-ot,P=o=1<<J;p[b+(W>>ot)+(o-=u)]=_<<24|T<<16|k|0,o!==0;);for(u=1<<R-1;W&u;)u>>=1;if(u!==0?(W&=u-1,W+=u):W=0,O++,--nt[R]==0){if(R===N)break;R=n[e+s[O]]}if(it<R&&(W&a)!==i){for(ot===0&&(ot=it),b+=P,tt=1<<(J=R-ot);J+ot<N&&!((tt-=nt[J+ot])<=0);)J++,tt<<=1;if(ht+=1<<J,r===1&&852<ht||r===2&&592<ht)return 1;p[i=W&a]=it<<24|J<<16|b-c|0}}return W!==0&&(p[b+W]=R-ot<<24|4194304),l.bits=it,0}},{"../utils/common":41}],51:[function(d,f,g){"use strict";f.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(d,f,g){"use strict";var y=d("../utils/common"),E=0,h=1;function w(D){for(var I=D.length;0<=--I;)D[I]=0}var A=0,r=29,n=256,e=n+1+r,t=30,p=19,c=2*e+1,s=15,l=16,u=7,o=256,i=16,a=17,b=18,v=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],_=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],T=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],k=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],M=new Array(2*(e+2));w(M);var R=new Array(2*t);w(R);var O=new Array(512);w(O);var P=new Array(256);w(P);var N=new Array(r);w(N);var it,J,ot,tt=new Array(t);function ht(D,I,H,L,B){this.static_tree=D,this.extra_bits=I,this.extra_base=H,this.elems=L,this.max_length=B,this.has_stree=D&&D.length}function W(D,I){this.dyn_tree=D,this.max_code=0,this.stat_desc=I}function G(D){return D<256?O[D]:O[256+(D>>>7)]}function gt(D,I){D.pending_buf[D.pending++]=255&I,D.pending_buf[D.pending++]=I>>>8&255}function nt(D,I,H){D.bi_valid>l-H?(D.bi_buf|=I<<D.bi_valid&65535,gt(D,D.bi_buf),D.bi_buf=I>>l-D.bi_valid,D.bi_valid+=H-l):(D.bi_buf|=I<<D.bi_valid&65535,D.bi_valid+=H)}function j(D,I,H){nt(D,H[2*I],H[2*I+1])}function U(D,I){for(var H=0;H|=1&D,D>>>=1,H<<=1,0<--I;);return H>>>1}function at(D,I,H){var L,B,Y=new Array(s+1),Q=0;for(L=1;L<=s;L++)Y[L]=Q=Q+H[L-1]<<1;for(B=0;B<=I;B++){var K=D[2*B+1];K!==0&&(D[2*B]=U(Y[K]++,K))}}function rt(D){var I;for(I=0;I<e;I++)D.dyn_ltree[2*I]=0;for(I=0;I<t;I++)D.dyn_dtree[2*I]=0;for(I=0;I<p;I++)D.bl_tree[2*I]=0;D.dyn_ltree[2*o]=1,D.opt_len=D.static_len=0,D.last_lit=D.matches=0}function V(D){8<D.bi_valid?gt(D,D.bi_buf):0<D.bi_valid&&(D.pending_buf[D.pending++]=D.bi_buf),D.bi_buf=0,D.bi_valid=0}function et(D,I,H,L){var B=2*I,Y=2*H;return D[B]<D[Y]||D[B]===D[Y]&&L[I]<=L[H]}function q(D,I,H){for(var L=D.heap[H],B=H<<1;B<=D.heap_len&&(B<D.heap_len&&et(I,D.heap[B+1],D.heap[B],D.depth)&&B++,!et(I,L,D.heap[B],D.depth));)D.heap[H]=D.heap[B],H=B,B<<=1;D.heap[H]=L}function F(D,I,H){var L,B,Y,Q,K=0;if(D.last_lit!==0)for(;L=D.pending_buf[D.d_buf+2*K]<<8|D.pending_buf[D.d_buf+2*K+1],B=D.pending_buf[D.l_buf+K],K++,L===0?j(D,B,I):(j(D,(Y=P[B])+n+1,I),(Q=v[Y])!==0&&nt(D,B-=N[Y],Q),j(D,Y=G(--L),H),(Q=_[Y])!==0&&nt(D,L-=tt[Y],Q)),K<D.last_lit;);j(D,o,I)}function ut(D,I){var H,L,B,Y=I.dyn_tree,Q=I.stat_desc.static_tree,K=I.stat_desc.has_stree,lt=I.stat_desc.elems,ft=-1;for(D.heap_len=0,D.heap_max=c,H=0;H<lt;H++)Y[2*H]!==0?(D.heap[++D.heap_len]=ft=H,D.depth[H]=0):Y[2*H+1]=0;for(;D.heap_len<2;)Y[2*(B=D.heap[++D.heap_len]=ft<2?++ft:0)]=1,D.depth[B]=0,D.opt_len--,K&&(D.static_len-=Q[2*B+1]);for(I.max_code=ft,H=D.heap_len>>1;1<=H;H--)q(D,Y,H);for(B=lt;H=D.heap[1],D.heap[1]=D.heap[D.heap_len--],q(D,Y,1),L=D.heap[1],D.heap[--D.heap_max]=H,D.heap[--D.heap_max]=L,Y[2*B]=Y[2*H]+Y[2*L],D.depth[B]=(D.depth[H]>=D.depth[L]?D.depth[H]:D.depth[L])+1,Y[2*H+1]=Y[2*L+1]=B,D.heap[1]=B++,q(D,Y,1),2<=D.heap_len;);D.heap[--D.heap_max]=D.heap[1],(function(X,mt){var At,Et,ct,yt,Rt,St,It=mt.dyn_tree,Lt=mt.max_code,Ft=mt.stat_desc.static_tree,_t=mt.stat_desc.has_stree,Mt=mt.stat_desc.extra_bits,Ct=mt.stat_desc.extra_base,Dt=mt.stat_desc.max_length,bt=0;for(yt=0;yt<=s;yt++)X.bl_count[yt]=0;for(It[2*X.heap[X.heap_max]+1]=0,At=X.heap_max+1;At<c;At++)Dt<(yt=It[2*It[2*(Et=X.heap[At])+1]+1]+1)&&(yt=Dt,bt++),It[2*Et+1]=yt,Lt<Et||(X.bl_count[yt]++,Rt=0,Ct<=Et&&(Rt=Mt[Et-Ct]),St=It[2*Et],X.opt_len+=St*(yt+Rt),_t&&(X.static_len+=St*(Ft[2*Et+1]+Rt)));if(bt!==0){do{for(yt=Dt-1;X.bl_count[yt]===0;)yt--;X.bl_count[yt]--,X.bl_count[yt+1]+=2,X.bl_count[Dt]--,bt-=2}while(0<bt);for(yt=Dt;yt!==0;yt--)for(Et=X.bl_count[yt];Et!==0;)Lt<(ct=X.heap[--At])||(It[2*ct+1]!==yt&&(X.opt_len+=(yt-It[2*ct+1])*It[2*ct],It[2*ct+1]=yt),Et--)}})(D,I),at(Y,ft,D.bl_count)}function S(D,I,H){var L,B,Y=-1,Q=I[1],K=0,lt=7,ft=4;for(Q===0&&(lt=138,ft=3),I[2*(H+1)+1]=65535,L=0;L<=H;L++)B=Q,Q=I[2*(L+1)+1],++K<lt&&B===Q||(K<ft?D.bl_tree[2*B]+=K:B!==0?(B!==Y&&D.bl_tree[2*B]++,D.bl_tree[2*i]++):K<=10?D.bl_tree[2*a]++:D.bl_tree[2*b]++,Y=B,ft=(K=0)===Q?(lt=138,3):B===Q?(lt=6,3):(lt=7,4))}function $(D,I,H){var L,B,Y=-1,Q=I[1],K=0,lt=7,ft=4;for(Q===0&&(lt=138,ft=3),L=0;L<=H;L++)if(B=Q,Q=I[2*(L+1)+1],!(++K<lt&&B===Q)){if(K<ft)for(;j(D,B,D.bl_tree),--K!=0;);else B!==0?(B!==Y&&(j(D,B,D.bl_tree),K--),j(D,i,D.bl_tree),nt(D,K-3,2)):K<=10?(j(D,a,D.bl_tree),nt(D,K-3,3)):(j(D,b,D.bl_tree),nt(D,K-11,7));Y=B,ft=(K=0)===Q?(lt=138,3):B===Q?(lt=6,3):(lt=7,4)}}w(tt);var z=!1;function x(D,I,H,L){nt(D,(A<<1)+(L?1:0),3),(function(B,Y,Q,K){V(B),K&&(gt(B,Q),gt(B,~Q)),y.arraySet(B.pending_buf,B.window,Y,Q,B.pending),B.pending+=Q})(D,I,H,!0)}g._tr_init=function(D){z||((function(){var I,H,L,B,Y,Q=new Array(s+1);for(B=L=0;B<r-1;B++)for(N[B]=L,I=0;I<1<<v[B];I++)P[L++]=B;for(P[L-1]=B,B=Y=0;B<16;B++)for(tt[B]=Y,I=0;I<1<<_[B];I++)O[Y++]=B;for(Y>>=7;B<t;B++)for(tt[B]=Y<<7,I=0;I<1<<_[B]-7;I++)O[256+Y++]=B;for(H=0;H<=s;H++)Q[H]=0;for(I=0;I<=143;)M[2*I+1]=8,I++,Q[8]++;for(;I<=255;)M[2*I+1]=9,I++,Q[9]++;for(;I<=279;)M[2*I+1]=7,I++,Q[7]++;for(;I<=287;)M[2*I+1]=8,I++,Q[8]++;for(at(M,e+1,Q),I=0;I<t;I++)R[2*I+1]=5,R[2*I]=U(I,5);it=new ht(M,v,n+1,e,s),J=new ht(R,_,0,t,s),ot=new ht(new Array(0),T,0,p,u)})(),z=!0),D.l_desc=new W(D.dyn_ltree,it),D.d_desc=new W(D.dyn_dtree,J),D.bl_desc=new W(D.bl_tree,ot),D.bi_buf=0,D.bi_valid=0,rt(D)},g._tr_stored_block=x,g._tr_flush_block=function(D,I,H,L){var B,Y,Q=0;0<D.level?(D.strm.data_type===2&&(D.strm.data_type=(function(K){var lt,ft=4093624447;for(lt=0;lt<=31;lt++,ft>>>=1)if(1&ft&&K.dyn_ltree[2*lt]!==0)return E;if(K.dyn_ltree[18]!==0||K.dyn_ltree[20]!==0||K.dyn_ltree[26]!==0)return h;for(lt=32;lt<n;lt++)if(K.dyn_ltree[2*lt]!==0)return h;return E})(D)),ut(D,D.l_desc),ut(D,D.d_desc),Q=(function(K){var lt;for(S(K,K.dyn_ltree,K.l_desc.max_code),S(K,K.dyn_dtree,K.d_desc.max_code),ut(K,K.bl_desc),lt=p-1;3<=lt&&K.bl_tree[2*k[lt]+1]===0;lt--);return K.opt_len+=3*(lt+1)+5+5+4,lt})(D),B=D.opt_len+3+7>>>3,(Y=D.static_len+3+7>>>3)<=B&&(B=Y)):B=Y=H+5,H+4<=B&&I!==-1?x(D,I,H,L):D.strategy===4||Y===B?(nt(D,2+(L?1:0),3),F(D,M,R)):(nt(D,4+(L?1:0),3),(function(K,lt,ft,X){var mt;for(nt(K,lt-257,5),nt(K,ft-1,5),nt(K,X-4,4),mt=0;mt<X;mt++)nt(K,K.bl_tree[2*k[mt]+1],3);$(K,K.dyn_ltree,lt-1),$(K,K.dyn_dtree,ft-1)})(D,D.l_desc.max_code+1,D.d_desc.max_code+1,Q+1),F(D,D.dyn_ltree,D.dyn_dtree)),rt(D),L&&V(D)},g._tr_tally=function(D,I,H){return D.pending_buf[D.d_buf+2*D.last_lit]=I>>>8&255,D.pending_buf[D.d_buf+2*D.last_lit+1]=255&I,D.pending_buf[D.l_buf+D.last_lit]=255&H,D.last_lit++,I===0?D.dyn_ltree[2*H]++:(D.matches++,I--,D.dyn_ltree[2*(P[H]+n+1)]++,D.dyn_dtree[2*G(I)]++),D.last_lit===D.lit_bufsize-1},g._tr_align=function(D){nt(D,2,3),j(D,o,M),(function(I){I.bi_valid===16?(gt(I,I.bi_buf),I.bi_buf=0,I.bi_valid=0):8<=I.bi_valid&&(I.pending_buf[I.pending++]=255&I.bi_buf,I.bi_buf>>=8,I.bi_valid-=8)})(D)}},{"../utils/common":41}],53:[function(d,f,g){"use strict";f.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(d,f,g){(function(y){(function(E,h){"use strict";if(!E.setImmediate){var w,A,r,n,e=1,t={},p=!1,c=E.document,s=Object.getPrototypeOf&&Object.getPrototypeOf(E);s=s&&s.setTimeout?s:E,w={}.toString.call(E.process)==="[object process]"?function(i){process.nextTick(function(){u(i)})}:(function(){if(E.postMessage&&!E.importScripts){var i=!0,a=E.onmessage;return E.onmessage=function(){i=!1},E.postMessage("","*"),E.onmessage=a,i}})()?(n="setImmediate$"+Math.random()+"$",E.addEventListener?E.addEventListener("message",o,!1):E.attachEvent("onmessage",o),function(i){E.postMessage(n+i,"*")}):E.MessageChannel?((r=new MessageChannel).port1.onmessage=function(i){u(i.data)},function(i){r.port2.postMessage(i)}):c&&"onreadystatechange"in c.createElement("script")?(A=c.documentElement,function(i){var a=c.createElement("script");a.onreadystatechange=function(){u(i),a.onreadystatechange=null,A.removeChild(a),a=null},A.appendChild(a)}):function(i){setTimeout(u,0,i)},s.setImmediate=function(i){typeof i!="function"&&(i=new Function(""+i));for(var a=new Array(arguments.length-1),b=0;b<a.length;b++)a[b]=arguments[b+1];return t[e]={callback:i,args:a},w(e),e++},s.clearImmediate=l}function l(i){delete t[i]}function u(i){if(p)setTimeout(u,0,i);else{var a=t[i];if(a){p=!0;try{(function(b){var v=b.callback,_=b.args;switch(_.length){case 0:v();break;case 1:v(_[0]);break;case 2:v(_[0],_[1]);break;case 3:v(_[0],_[1],_[2]);break;default:v.apply(h,_)}})(a)}finally{l(i),p=!1}}}}function o(i){i.source===E&&typeof i.data=="string"&&i.data.indexOf(n)===0&&u(+i.data.slice(n.length))}})(typeof self>"u"?y===void 0?this:y:self)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})),da=_e({awaitRenderedLayout:()=>hi,collectLayoutSnapshot:()=>fi,default:()=>Zt,defaultOptions:()=>oi,parseAsync:()=>ai,parseAsyncInWorker:()=>si,renderAsync:()=>ci,renderDocument:()=>li,yieldToBrowser:()=>di}),ni,Zt,ii,Pe,rr,oi,ai,si,li,ci,hi,fi,di,pa=vt((()=>{ni=ze(Hr(),1),Zt=(ii=ni.default,Pe={"./comments/comments-extended-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.CommentsExtendedPart=void 0;const f=m("../common/part"),g=m("../utils");class y extends f.Part{constructor(h,w){super(h,w),this.comments=[]}parseXml(h){const w=this._package.xmlParser;for(let A of w.elements(h,"commentEx"))this.comments.push({paraId:w.attr(A,"paraId"),paraIdParent:w.attr(A,"paraIdParent"),done:w.boolAttr(A,"done")});this.commentMap=(0,g.keyBy)(this.comments,A=>A.paraId)}}d.CommentsExtendedPart=y},"./comments/comments-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.CommentsPart=void 0;const f=m("../common/part"),g=m("../utils");class y extends f.Part{constructor(h,w,A){super(h,w),this._documentParser=A}parseXml(h){this.comments=this._documentParser.parseComments(h),this.commentMap=(0,g.keyBy)(this.comments,w=>w.id)}}d.CommentsPart=y},"./comments/elements":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.WmlCommentRangeEnd=d.WmlCommentRangeStart=d.WmlCommentReference=d.WmlComment=void 0;const f=m("../document/dom");class g extends f.OpenXmlElementBase{constructor(){super(...arguments),this.type=f.DomType.Comment}}d.WmlComment=g;class y extends f.OpenXmlElementBase{constructor(A){super(),this.id=A,this.type=f.DomType.CommentReference}}d.WmlCommentReference=y;class E extends f.OpenXmlElementBase{constructor(A){super(),this.id=A,this.type=f.DomType.CommentRangeStart}}d.WmlCommentRangeStart=E;class h extends f.OpenXmlElementBase{constructor(A){super(),this.id=A,this.type=f.DomType.CommentRangeEnd}}d.WmlCommentRangeEnd=h},"./common/content-types":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseContentTypes=function(f,g){return g.elements(f).map(y=>({extension:g.attr(y,"Extension"),partName:g.attr(y,"PartName"),contentType:g.attr(y,"ContentType")}))}},"./common/open-xml-package":function(m,C,d){var f=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(d,"__esModule",{value:!0}),d.OpenXmlPackage=void 0;const g=f(m("jszip")),y=m("../parser/xml-parser"),E=m("../utils"),h=m("./relationship"),w=m("./content-types");class A{constructor(e,t){this._zip=e,this.options=t,this.xmlParser=new y.XmlParser}get(e){const t=(function(p){return p.startsWith("/")?p.substr(1):p})(e);return this._zip.files[t]??this._zip.files[t.replace(/\//g,"\\")]}update(e,t){this._zip.file(e,t)}static async load(e,t){return new A(await g.default.loadAsync(e),t)}save(e="blob"){return this._zip.generateAsync({type:e})}load(e,t="string"){return this.get(e)?.async(t)??Promise.resolve(null)}async loadRelationships(e=null){let t="_rels/.rels";if(e!=null){const[c,s]=(0,E.splitPath)(e);t=`${c}_rels/${s}.rels`}const p=await this.load(t);return p?(0,h.parseRelationships)(r(this.parseXmlDocument(p)),this.xmlParser):null}async loadContentTypes(){const e=await this.load("[Content_Types].xml");return e?(0,w.parseContentTypes)(r(this.parseXmlDocument(e)),this.xmlParser):[]}parseXmlDocument(e){return(0,y.parseXmlString)(e,this.options.trimXmlDeclaration)}}function r(n){return n.firstElementChild??n.documentElement}d.OpenXmlPackage=A},"./common/part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.Part=void 0;const f=m("../parser/xml-parser");d.Part=class{constructor(g,y){this._package=g,this.path=y}async load(){this.rels=await this._package.loadRelationships(this.path);const g=await this._package.load(this.path),y=this._package.parseXmlDocument(g);this._package.options.keepOrigin&&(this._xmlDocument=y),this.parseXml(y.firstElementChild??y.documentElement)}save(){this._package.update(this.path,(0,f.serializeXmlString)(this._xmlDocument))}parseXml(g){}}},"./common/relationship":function(m,C,d){var f;Object.defineProperty(d,"__esModule",{value:!0}),d.RelationshipTypes=void 0,d.parseRelationships=function(g,y){return y.elements(g).map(E=>({id:y.attr(E,"Id"),type:y.attr(E,"Type"),target:y.attr(E,"Target"),targetMode:y.attr(E,"TargetMode")}))},(function(g){g.OfficeDocument="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",g.FontTable="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",g.Image="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",g.Numbering="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",g.Styles="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",g.StylesWithEffects="http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects",g.Theme="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",g.Settings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",g.WebSettings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",g.Hyperlink="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",g.Footnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",g.Endnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",g.Footer="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",g.Header="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",g.ExtendedProperties="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",g.CoreProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",g.CustomProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/custom-properties",g.Comments="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",g.CommentsExtended="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",g.AltChunk="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk",g.Chart="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",g.ChartUserShapes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes",g.DiagramData="http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramData",g.DiagramLayout="http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramLayout",g.DiagramQuickStyle="http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramQuickStyle",g.DiagramColors="http://schemas.openxmlformats.org/officeDocument/2006/relationships/diagramColors",g.Ink="http://schemas.microsoft.com/office/2007/relationships/ink",g.ContentPart="http://schemas.openxmlformats.org/officeDocument/2006/relationships/contentPart"})(f||(d.RelationshipTypes=f={}))},"./document/bookmarks":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseBookmarkStart=function(g,y){return{type:f.DomType.BookmarkStart,id:y.attr(g,"id"),name:y.attr(g,"name"),colFirst:y.intAttr(g,"colFirst"),colLast:y.intAttr(g,"colLast")}},d.parseBookmarkEnd=function(g,y){return{type:f.DomType.BookmarkEnd,id:y.attr(g,"id")}};const f=m("./dom")},"./document/border":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseBorder=g,d.parseBorders=function(y,E){var h={};for(let w of E.elements(y))switch(w.localName){case"left":h.left=g(w,E);break;case"top":h.top=g(w,E);break;case"right":h.right=g(w,E);break;case"bottom":h.bottom=g(w,E)}return h};const f=m("./common");function g(y,E){return{type:E.attr(y,"val"),color:E.attr(y,"color"),size:E.lengthAttr(y,"sz",f.LengthUsage.Border),offset:E.lengthAttr(y,"space",f.LengthUsage.Point),frame:E.boolAttr(y,"frame"),shadow:E.boolAttr(y,"shadow")}}},"./document/common":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.LengthUsage=d.ns=void 0,d.convertLength=function(g,y=d.LengthUsage.Dxa){if(g==null||g===""||/.+(p[xt]|[%])$/i.test(g))return g;var E=parseFloat(g);if(Number.isNaN(E))return null;var h=E*y.mul;return y.min!=null&&y.max!=null&&(h=(0,f.clamp)(h,y.min,y.max)),`${h.toFixed(2)}${y.unit}`},d.convertBoolean=function(g,y=!1){switch(g){case"1":case"on":case"true":return!0;case"0":case"off":case"false":return!1;default:return y}},d.convertPercentage=function(g){return g?parseInt(g)/100:null},d.parseCommonProperty=function(g,y,E){if(g.namespaceURI!=d.ns.wordml)return!1;switch(g.localName){case"color":y.color=E.attr(g,"val");break;case"sz":y.fontSize=E.lengthAttr(g,"val",d.LengthUsage.FontSize);break;case"szCs":y.fontSize??(y.fontSize=E.lengthAttr(g,"val",d.LengthUsage.FontSize));break;default:return!1}return!0};const f=m("../utils");d.ns={wordml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",drawingml:"http://schemas.openxmlformats.org/drawingml/2006/main",picture:"http://schemas.openxmlformats.org/drawingml/2006/picture",wordprocessingCanvas:"http://schemas.microsoft.com/office/word/2010/wordprocessingCanvas",wordprocessingGroup:"http://schemas.microsoft.com/office/word/2010/wordprocessingGroup",wordprocessingShape:"http://schemas.microsoft.com/office/word/2010/wordprocessingShape",chart:"http://schemas.openxmlformats.org/drawingml/2006/chart",diagram:"http://schemas.openxmlformats.org/drawingml/2006/diagram",relationship:"http://schemas.openxmlformats.org/officeDocument/2006/relationships",drawing2014:"http://schemas.microsoft.com/office/drawing/2014/main",ink2010:"http://schemas.microsoft.com/office/2010/ink",word2010:"http://schemas.microsoft.com/office/word/2010/wordml",compatibility:"http://schemas.openxmlformats.org/markup-compatibility/2006",math:"http://schemas.openxmlformats.org/officeDocument/2006/math"},d.LengthUsage={Dxa:{mul:.05,unit:"pt"},SignedDxa:{mul:.05,unit:"pt"},Emu:{mul:1/12700,unit:"pt"},FontSize:{mul:.5,unit:"pt"},SignedHalfPoint:{mul:.5,unit:"pt"},Border:{mul:.125,unit:"pt",min:.25,max:12},Point:{mul:1,unit:"pt"},Percent:{mul:.02,unit:"%"},LineHeight:{mul:1/240,unit:""},VmlEmu:{mul:1/12700,unit:""}}},"./document/document-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.DocumentPart=void 0;const f=m("../common/part");class g extends f.Part{constructor(E,h,w){super(E,h),this._documentParser=w}parseXml(E){this.body=this._documentParser.parseDocumentFile(E)}}d.DocumentPart=g},"./document/document":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0})},"./document/dom":function(m,C,d){var f;Object.defineProperty(d,"__esModule",{value:!0}),d.OpenXmlElementBase=d.DomType=void 0,(function(g){g.Document="document",g.Paragraph="paragraph",g.Run="run",g.Break="break",g.NoBreakHyphen="noBreakHyphen",g.Table="table",g.Row="row",g.Cell="cell",g.Hyperlink="hyperlink",g.SmartTag="smartTag",g.Drawing="drawing",g.Image="image",g.Text="text",g.Tab="tab",g.PositionalTab="positionalTab",g.SoftHyphen="softHyphen",g.Symbol="symbol",g.BookmarkStart="bookmarkStart",g.BookmarkEnd="bookmarkEnd",g.Footer="footer",g.Header="header",g.FootnoteReference="footnoteReference",g.EndnoteReference="endnoteReference",g.Footnote="footnote",g.Endnote="endnote",g.SimpleField="simpleField",g.ComplexField="complexField",g.Instruction="instruction",g.VmlPicture="vmlPicture",g.MmlMath="mmlMath",g.Shape="shape",g.MmlMathParagraph="mmlMathParagraph",g.MmlFraction="mmlFraction",g.MmlFunction="mmlFunction",g.MmlFunctionName="mmlFunctionName",g.MmlNumerator="mmlNumerator",g.MmlDenominator="mmlDenominator",g.MmlRadical="mmlRadical",g.MmlBase="mmlBase",g.MmlDegree="mmlDegree",g.MmlSuperscript="mmlSuperscript",g.MmlSubscript="mmlSubscript",g.MmlPreSubSuper="mmlPreSubSuper",g.MmlSubArgument="mmlSubArgument",g.MmlSuperArgument="mmlSuperArgument",g.MmlNary="mmlNary",g.MmlDelimiter="mmlDelimiter",g.MmlRun="mmlRun",g.MmlEquationArray="mmlEquationArray",g.MmlLimit="mmlLimit",g.MmlLimitLower="mmlLimitLower",g.MmlLimitUpper="mmlLimitUpper",g.MmlSubSuperscript="mmlSubSuperscript",g.MmlPhantom="mmlPhantom",g.MmlBorderBox="mmlBorderBox",g.MmlAccent="mmlAccent",g.MmlMatrix="mmlMatrix",g.MmlMatrixRow="mmlMatrixRow",g.MmlBox="mmlBox",g.MmlBar="mmlBar",g.MmlGroupChar="mmlGroupChar",g.VmlElement="vmlElement",g.Chart="chart",g.SmartArt="smartArt",g.Ink="ink",g.Ruby="ruby",g.RubyBase="rubyBase",g.RubyText="rubyText",g.Inserted="inserted",g.Deleted="deleted",g.DeletedText="deletedText",g.Comment="comment",g.CommentReference="commentReference",g.CommentRangeStart="commentRangeStart",g.CommentRangeEnd="commentRangeEnd",g.AltChunk="altChunk"})(f||(d.DomType=f={})),d.OpenXmlElementBase=class{constructor(){this.children=[],this.cssStyle={}}}},"./document/fields":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0})},"./document/line-spacing":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseLineSpacing=function(f,g){return{before:g.lengthAttr(f,"before"),after:g.lengthAttr(f,"after"),line:g.intAttr(f,"line"),lineRule:g.attr(f,"lineRule")}}},"./document/paragraph":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseParagraphProperties=function(r,n){let e={};for(let t of n.elements(r))h(t,e,n);return e},d.parseParagraphProperty=h,d.parseTabs=w,d.parseNumbering=A;const f=m("./common"),g=m("./section"),y=m("./line-spacing"),E=m("./run");function h(r,n,e){if(r.namespaceURI!=f.ns.wordml)return!1;if((0,f.parseCommonProperty)(r,n,e))return!0;switch(r.localName){case"tabs":n.tabs=w(r,e);break;case"sectPr":n.sectionProps=(0,g.parseSectionProperties)(r,e);break;case"numPr":n.numbering=A(r,e);break;case"spacing":return n.lineSpacing=(0,y.parseLineSpacing)(r,e),!1;case"textAlignment":return n.textAlignment=e.attr(r,"val"),!1;case"keepLines":n.keepLines=e.boolAttr(r,"val",!0);break;case"keepNext":n.keepNext=e.boolAttr(r,"val",!0);break;case"pageBreakBefore":n.pageBreakBefore=e.boolAttr(r,"val",!0);break;case"widowControl":n.widowControl=e.boolAttr(r,"val",!0);break;case"outlineLvl":n.outlineLevel=e.intAttr(r,"val");break;case"pStyle":n.styleName=e.attr(r,"val");break;case"rPr":n.runProps=(0,E.parseRunProperties)(r,e);break;default:return!1}return!0}function w(r,n){return n.elements(r,"tab").map(e=>({position:n.lengthAttr(e,"pos"),leader:n.attr(e,"leader"),style:n.attr(e,"val")}))}function A(r,n){var e={};for(let t of n.elements(r))switch(t.localName){case"numId":e.id=n.attr(t,"val");break;case"ilvl":e.level=n.intAttr(t,"val")}return e}},"./document/run":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseRunProperties=function(y,E){let h={};for(let w of E.elements(y))g(w,h,E);return h},d.parseRunProperty=g;const f=m("./common");function g(y,E,h){return!!(0,f.parseCommonProperty)(y,E,h)}},"./document/section":function(m,C,d){var f=this&&this.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(d,"__esModule",{value:!0}),d.SectionType=void 0,d.isSectionPageBreak=function(n){return n==null||n===E.NextPage||n===E.EvenPage||n===E.OddPage},d.isSectionColumnBreak=function(n){return n===E.NextColumn},d.parseSectionProperties=function(n,e=g.default){var t={};for(let p of e.elements(n))switch(p.localName){case"pgSz":t.pageSize={width:e.lengthAttr(p,"w"),height:e.lengthAttr(p,"h"),orientation:e.attr(p,"orient")};break;case"type":t.type=e.attr(p,"val");break;case"pgMar":t.pageMargins={left:e.lengthAttr(p,"left"),right:e.lengthAttr(p,"right"),top:e.lengthAttr(p,"top"),bottom:e.lengthAttr(p,"bottom"),header:e.lengthAttr(p,"header"),footer:e.lengthAttr(p,"footer"),gutter:e.lengthAttr(p,"gutter")};break;case"cols":t.columns=h(p,e);break;case"headerReference":(t.headerRefs??(t.headerRefs=[])).push(r(p,e));break;case"footerReference":(t.footerRefs??(t.footerRefs=[])).push(r(p,e));break;case"titlePg":t.titlePage=e.boolAttr(p,"val",!0);break;case"pgBorders":t.pageBorders=(0,y.parseBorders)(p,e);break;case"pgNumType":t.pageNumber=w(p,e);break;case"docGrid":t.docGrid=A(p,e)}return t};const g=f(m("../parser/xml-parser")),y=m("./border");var E;function h(n,e){return{numberOfColumns:e.intAttr(n,"num"),space:e.lengthAttr(n,"space"),separator:e.boolAttr(n,"sep"),equalWidth:e.boolAttr(n,"equalWidth",!0),columns:e.elements(n,"col").map(t=>({width:e.lengthAttr(t,"w"),space:e.lengthAttr(t,"space")}))}}function w(n,e){return{chapSep:e.attr(n,"chapSep"),chapStyle:e.attr(n,"chapStyle"),format:e.attr(n,"fmt"),start:e.intAttr(n,"start")}}function A(n,e){const t=e.intAttr(n,"charSpace",null);return{type:e.attr(n,"type"),linePitch:e.lengthAttr(n,"linePitch"),charSpace:t==null?null:`${(t/4096).toFixed(4)}em`,charSpaceRaw:t}}function r(n,e){return{id:e.attr(n,"id"),type:e.attr(n,"type")}}(function(n){n.Continuous="continuous",n.NextPage="nextPage",n.NextColumn="nextColumn",n.EvenPage="evenPage",n.OddPage="oddPage"})(E||(d.SectionType=E={}))},"./document/style":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0})},"./document-parser":function(m,C,d){var f=this&&this.__importDefault||function(o){return o&&o.__esModule?o:{default:o}};Object.defineProperty(d,"__esModule",{value:!0}),d.DocumentParser=d.autos=void 0;const g=m("./document/dom"),y=m("./document/paragraph"),E=m("./document/section"),h=f(m("./parser/xml-parser")),w=m("./document/run"),A=m("./document/bookmarks"),r=m("./document/common"),n=m("./vml/vml"),e=m("./comments/elements"),t=m("./utils");d.autos={shd:"inherit",color:"black",borderColor:"black",highlight:"transparent"};const p=[r.ns.wordprocessingShape,r.ns.wordprocessingCanvas,r.ns.wordprocessingGroup,r.ns.drawingml,r.ns.picture],c={oMath:g.DomType.MmlMath,oMathPara:g.DomType.MmlMathParagraph,f:g.DomType.MmlFraction,func:g.DomType.MmlFunction,fName:g.DomType.MmlFunctionName,num:g.DomType.MmlNumerator,den:g.DomType.MmlDenominator,rad:g.DomType.MmlRadical,deg:g.DomType.MmlDegree,e:g.DomType.MmlBase,sSup:g.DomType.MmlSuperscript,sSub:g.DomType.MmlSubscript,sPre:g.DomType.MmlPreSubSuper,sup:g.DomType.MmlSuperArgument,sub:g.DomType.MmlSubArgument,d:g.DomType.MmlDelimiter,nary:g.DomType.MmlNary,eqArr:g.DomType.MmlEquationArray,lim:g.DomType.MmlLimit,limLow:g.DomType.MmlLimitLower,limUpp:g.DomType.MmlLimitUpper,sSubSup:g.DomType.MmlSubSuperscript,phant:g.DomType.MmlPhantom,borderBox:g.DomType.MmlBorderBox,acc:g.DomType.MmlAccent,m:g.DomType.MmlMatrix,mr:g.DomType.MmlMatrixRow,box:g.DomType.MmlBox,bar:g.DomType.MmlBar,groupChr:g.DomType.MmlGroupChar};d.DocumentParser=class{constructor(o){this.options={ignoreWidth:!1,debug:!1,hideWebHiddenContent:!1,...o}}parseNotes(o,i,a){var b=[];for(let v of h.default.elements(o,i)){const _=new a;_.id=h.default.attr(v,"id"),_.noteType=h.default.attr(v,"type"),_.children=this.parseBodyElements(v),b.push(_)}return b}parseComments(o){var i=[];for(let a of h.default.elements(o,"comment")){const b=new e.WmlComment;b.id=h.default.attr(a,"id"),b.author=h.default.attr(a,"author"),b.initials=h.default.attr(a,"initials"),b.date=h.default.attr(a,"date"),b.children=this.parseBodyElements(a),i.push(b)}return i}parseDocumentFile(o){var i=h.default.element(o,"body"),a=h.default.element(o,"background"),b=h.default.element(i,"sectPr");return{type:g.DomType.Document,children:this.parseBodyElements(i),props:b?(0,E.parseSectionProperties)(b,h.default):{},cssStyle:a?this.parseBackground(a):{}}}parseBackground(o){var i={},a=l.colorAttr(o,"color");return a&&(i["background-color"]=a),i}parseBodyElements(o){var i=[];for(const a of h.default.elements(o))switch(a.localName){case"p":i.push(this.parseParagraph(a));break;case"altChunk":i.push(this.parseAltChunk(a));break;case"tbl":i.push(this.parseTable(a));break;case"sdt":i.push(...this.parseSdt(a,b=>this.parseBodyElements(b)))}return i}parseStylesFile(o){var i=[];for(const a of h.default.elements(o))switch(a.localName){case"style":i.push(this.parseStyle(a));break;case"docDefaults":i.push(this.parseDefaultStyles(a))}return i}parseDefaultStyles(o){var i={id:null,name:null,target:null,basedOn:null,styles:[]};for(const v of h.default.elements(o))switch(v.localName){case"rPrDefault":var a=h.default.element(v,"rPr");a&&i.styles.push({target:"span",values:this.parseDefaultProperties(a,{})});break;case"pPrDefault":var b=h.default.element(v,"pPr");b&&i.styles.push({target:"p",values:this.parseDefaultProperties(b,{})})}return i}parseStyle(o){var i={id:h.default.attr(o,"styleId"),isDefault:h.default.boolAttr(o,"default"),name:null,target:null,basedOn:null,styles:[],linked:null};switch(h.default.attr(o,"type")){case"paragraph":i.target="p";break;case"table":i.target="table";break;case"character":i.target="span"}for(const a of h.default.elements(o))switch(a.localName){case"basedOn":i.basedOn=h.default.attr(a,"val");break;case"name":i.name=h.default.attr(a,"val");break;case"link":i.linked=h.default.attr(a,"val");break;case"next":i.next=h.default.attr(a,"val");break;case"aliases":i.aliases=h.default.attr(a,"val").split(",");break;case"pPr":i.styles.push({target:"p",values:this.parseDefaultProperties(a,{})}),i.paragraphProps=(0,y.parseParagraphProperties)(a,h.default);break;case"rPr":i.styles.push({target:"span",values:this.parseDefaultProperties(a,{})}),i.runProps=(0,w.parseRunProperties)(a,h.default);break;case"tblPr":case"tcPr":i.styles.push({target:"td",values:this.parseDefaultProperties(a,{})});break;case"tblStylePr":for(let b of this.parseTableStyle(a))i.styles.push(b);break;case"rsid":case"qFormat":case"hidden":case"semiHidden":case"unhideWhenUsed":case"autoRedefine":case"uiPriority":break;default:this.options.debug&&console.warn(`DOCX: Unknown style element: ${a.localName}`)}return i}parseTableStyle(o){var i=[],a="",b="";switch(h.default.attr(o,"type")){case"firstRow":b=".first-row",a="tr.first-row td";break;case"lastRow":b=".last-row",a="tr.last-row td";break;case"firstCol":b=".first-col",a="td.first-col";break;case"lastCol":b=".last-col",a="td.last-col";break;case"band1Vert":b=":not(.no-vband)",a="td.odd-col";break;case"band2Vert":b=":not(.no-vband)",a="td.even-col";break;case"band1Horz":b=":not(.no-hband)",a="tr.odd-row";break;case"band2Horz":b=":not(.no-hband)",a="tr.even-row";break;default:return[]}for(const v of h.default.elements(o))switch(v.localName){case"pPr":i.push({target:`${a} p`,mod:b,values:this.parseDefaultProperties(v,{})});break;case"rPr":i.push({target:`${a} span`,mod:b,values:this.parseDefaultProperties(v,{})});break;case"tblPr":case"tcPr":i.push({target:a,mod:b,values:this.parseDefaultProperties(v,{})})}return i}parseNumberingFile(o){const i=[],a=[],b={},v=[],_=[];for(const T of h.default.elements(o))switch(T.localName){case"numPicBullet":a.push(this.parseNumberingPicBullet(T));break;case"abstractNum":v.push(T);break;case"num":_.push(T)}for(const T of v)b[h.default.attr(T,"abstractNumId")]=this.parseAbstractNumbering(T,a);for(const T of _){const k=h.default.attr(T,"numId"),M=(b[h.default.elementAttr(T,"abstractNumId","val")]??[]).map(R=>this.cloneNumberingLevel(R,k));for(const R of h.default.elements(T,"lvlOverride")){const O=h.default.intAttr(R,"ilvl"),P=h.default.element(R,"lvl"),N=h.default.element(R,"startOverride");let it=M.find(J=>J.level==O);if(P){it=this.parseNumberingLevel(k,P,a);const J=M.findIndex(ot=>ot.level==O);J>=0?M[J]=it:M.push(it)}N&&it&&(it.start=h.default.intAttr(N,"val",it.start))}i.push(...M)}return i}cloneNumberingLevel(o,i){return{...o,id:i,pStyle:{...o.pStyle},rStyle:{...o.rStyle},bullet:o.bullet?{...o.bullet}:null}}parseNumberingPicBullet(o){const i=h.default.intAttr(o,"numPicBulletId"),a=h.default.element(o,"pict"),b=a&&h.default.element(a,"shape"),v=b&&h.default.element(b,"imagedata");if(v)return{id:i,src:h.default.attr(v,"id"),style:h.default.attr(b,"style")};const _=h.default.element(o,"drawing"),T=_?this.findDescendant(_,"blip"):null;if(T){const k=_?this.findDescendant(_,"extent"):null,M=[];if(k){const R=h.default.lengthAttr(k,"cx",r.LengthUsage.Emu),O=h.default.lengthAttr(k,"cy",r.LengthUsage.Emu);R&&M.push(`width:${R};`),O&&M.push(`height:${O};`)}return{id:i,src:h.default.attr(T,"embed")??h.default.attr(T,"link"),style:M.join("")||void 0}}return null}parseAbstractNumbering(o,i){var a=[],b=h.default.attr(o,"abstractNumId");for(const v of h.default.elements(o))v.localName==="lvl"&&a.push(this.parseNumberingLevel(b,v,i));return a}parseNumberingLevel(o,i,a){var b={id:o,level:h.default.intAttr(i,"ilvl"),start:1,pStyleName:void 0,pStyle:{},rStyle:{},suff:"tab"};for(const _ of h.default.elements(i))switch(_.localName){case"start":b.start=h.default.intAttr(_,"val");break;case"pPr":this.parseDefaultProperties(_,b.pStyle);break;case"rPr":this.parseDefaultProperties(_,b.rStyle);break;case"lvlPicBulletId":var v=h.default.intAttr(_,"val");b.bullet=a.find(T=>T?.id==v);break;case"lvlText":b.levelText=h.default.attr(_,"val");break;case"pStyle":b.pStyleName=h.default.attr(_,"val");break;case"numFmt":b.format=h.default.attr(_,"val");break;case"lvlRestart":b.restart=h.default.intAttr(_,"val");break;case"suff":b.suff=h.default.attr(_,"val")}return b}parseSdt(o,i){const a=h.default.element(o,"sdtContent");return a?i(a):[]}parseInserted(o,i){return{type:g.DomType.Inserted,children:i(o)?.children??[]}}parseDeleted(o,i){return{type:g.DomType.Deleted,children:i(o)?.children??[]}}parseAltChunk(o){return{type:g.DomType.AltChunk,children:[],id:h.default.attr(o,"id")}}parseParagraph(o){var i={type:g.DomType.Paragraph,children:[]};for(let a of h.default.elements(o))switch(a.localName){case"pPr":this.parseParagraphProperties(a,i);break;case"r":i.children.push(this.parseRun(a,i));break;case"hyperlink":i.children.push(this.parseHyperlink(a,i));break;case"smartTag":i.children.push(this.parseSmartTag(a,i));break;case"bookmarkStart":i.children.push((0,A.parseBookmarkStart)(a,h.default));break;case"bookmarkEnd":i.children.push((0,A.parseBookmarkEnd)(a,h.default));break;case"commentRangeStart":i.children.push(new e.WmlCommentRangeStart(h.default.attr(a,"id")));break;case"commentRangeEnd":i.children.push(new e.WmlCommentRangeEnd(h.default.attr(a,"id")));break;case"oMath":case"oMathPara":{const b=this.parseMathElement(a);b&&i.children.push(b);break}case"sdt":i.children.push(...this.parseSdt(a,b=>this.parseParagraph(b).children));break;case"ins":i.children.push(this.parseInserted(a,b=>this.parseParagraph(b)));break;case"del":i.children.push(this.parseDeleted(a,b=>this.parseParagraph(b)))}return i}parseParagraphProperties(o,i){this.parseDefaultProperties(o,i.cssStyle={},null,a=>{if(a.localName=="rPr"){h.default.element(a,"del")&&(i.props={...i.props??{},deletedParagraphMark:!0});const b=i.cssStyle["background-color"];return this.parseDefaultProperties(a,i.cssStyle),b==null?delete i.cssStyle["background-color"]:i.cssStyle["background-color"]=b,(0,y.parseParagraphProperty)(a,i,h.default),!0}if((0,y.parseParagraphProperty)(a,i,h.default))return!0;switch(a.localName){case"pStyle":i.styleName=h.default.attr(a,"val");break;case"cnfStyle":i.className=u.classNameOfCnfStyle(a);break;case"framePr":this.parseFrame(a,i);break;default:return!1}return!0})}parseFrame(o,i){h.default.attr(o,"dropCap")=="drop"&&(i.cssStyle.float="left")}parseHyperlink(o,i){var a={type:g.DomType.Hyperlink,parent:i,children:[]};a.anchor=h.default.attr(o,"anchor"),a.id=h.default.attr(o,"id");for(const b of h.default.elements(o))b.localName==="r"&&a.children.push(this.parseRun(b,a));return a}parseSmartTag(o,i){var a={type:g.DomType.SmartTag,parent:i,children:[]},b=h.default.attr(o,"uri"),v=h.default.attr(o,"element");b&&(a.uri=b),v&&(a.element=v);for(const _ of h.default.elements(o))switch(_.localName){case"r":a.children.push(this.parseRun(_,a));break;case"smartTag":a.children.push(this.parseSmartTag(_,a))}return a}parseSimpleField(o,i){const a={type:g.DomType.SimpleField,parent:i,children:[],instruction:h.default.attr(o,"instr"),lock:h.default.boolAttr(o,"lock",!1),dirty:h.default.boolAttr(o,"dirty",!1)};for(const b of h.default.elements(o))switch(b.localName){case"r":a.children.push(this.parseRun(b,a));break;case"hyperlink":a.children.push(this.parseHyperlink(b,a));break;case"smartTag":a.children.push(this.parseSmartTag(b,a));break;case"bookmarkStart":a.children.push((0,A.parseBookmarkStart)(b,h.default));break;case"bookmarkEnd":a.children.push((0,A.parseBookmarkEnd)(b,h.default));break;case"commentRangeStart":a.children.push(new e.WmlCommentRangeStart(h.default.attr(b,"id")));break;case"commentRangeEnd":a.children.push(new e.WmlCommentRangeEnd(h.default.attr(b,"id")));break;case"sdt":a.children.push(...this.parseSdt(b,v=>this.parseParagraph(v).children));break;case"ins":a.children.push(this.parseInserted(b,v=>this.parseParagraph(v)));break;case"del":a.children.push(this.parseDeleted(b,v=>this.parseParagraph(v)))}return a}parseRun(o,i){var a={type:g.DomType.Run,parent:i,children:[]};for(let b of h.default.elements(o))if(b=this.checkAlternateContent(b),b)switch(b.localName){case"t":a.children.push({type:g.DomType.Text,text:b.textContent});break;case"delText":a.children.push({type:g.DomType.DeletedText,text:b.textContent});break;case"commentReference":a.children.push(new e.WmlCommentReference(h.default.attr(b,"id")));break;case"fldSimple":a.children.push(this.parseSimpleField(b,a));break;case"instrText":a.fieldRun=!0,a.children.push({type:g.DomType.Instruction,text:b.textContent});break;case"fldChar":a.fieldRun=!0,a.children.push({type:g.DomType.ComplexField,charType:h.default.attr(b,"fldCharType"),lock:h.default.boolAttr(b,"lock",!1),dirty:h.default.boolAttr(b,"dirty",!1)});break;case"noBreakHyphen":a.children.push({type:g.DomType.NoBreakHyphen});break;case"softHyphen":a.children.push({type:g.DomType.SoftHyphen});break;case"cr":a.children.push({type:g.DomType.Break,break:"line"});break;case"ptab":a.children.push({type:g.DomType.PositionalTab});break;case"br":a.children.push({type:g.DomType.Break,break:h.default.attr(b,"type")||"textWrapping"});break;case"lastRenderedPageBreak":a.children.push({type:g.DomType.Break,break:"lastRenderedPageBreak"});break;case"sym":a.children.push({type:g.DomType.Symbol,font:(0,t.encloseFontFamily)(h.default.attr(b,"font")),char:h.default.hexAttr(b,"char")});break;case"tab":a.children.push({type:g.DomType.Tab});break;case"footnoteReference":a.children.push({type:g.DomType.FootnoteReference,id:h.default.attr(b,"id")});break;case"endnoteReference":a.children.push({type:g.DomType.EndnoteReference,id:h.default.attr(b,"id")});break;case"drawing":let v=this.parseDrawing(b);v&&a.children.push(v);break;case"pict":case"object":a.children.push(this.parseVmlPicture(b));break;case"ruby":a.children.push(this.parseRuby(b));break;case"rPr":this.parseRunProperties(b,a)}return a}parseRuby(o){const i={type:g.DomType.Ruby,children:[]};for(const a of h.default.elements(o))switch(a.localName){case"rubyPr":for(const b of h.default.elements(a))b.localName==="rubyAlign"&&(i.align=h.default.attr(b,"val"));break;case"rt":i.children.push(this.parseRubyContent(a,g.DomType.RubyText));break;case"rubyBase":i.children.push(this.parseRubyContent(a,g.DomType.RubyBase))}return i}parseRubyContent(o,i){const a={type:i,children:[]};for(const b of h.default.elements(o))if(b.localName=="r")a.children.push(this.parseRun(b,a));else if(i==g.DomType.RubyText&&b.localName=="rPr"){const v=h.default.element(b,"hps"),_=v?h.default.intAttr(v,"val",null):null;_!=null&&(a.cssStyle={...a.cssStyle??{},fontSize:_/2+"pt"})}return a}parseMathElement(o){const i=`${o.localName}Pr`,a={type:c[o.localName],children:[]};let b=!1;const v=_=>{if(c[_.localName]){const k=this.parseMathElement(_);k?(k.parent=a,a.children.push(k)):b=!0}else if(_.localName=="r"){var T=this.parseRun(_,a);T.type=g.DomType.MmlRun,a.children.push(T)}else if(_.localName==i)a.props=this.parseMathProperies(_);else if(_.localName=="ins")for(const k of h.default.elements(_))v(k);else if(_.localName=="del")if(this.options.renderChanges)for(const k of h.default.elements(_))v(k);else b=!0};for(const _ of h.default.elements(o))v(_);return b&&!this.hasVisibleMathContent(a)?null:a}hasVisibleMathContent(o){for(const i of o.children??[]){switch(i.type){case g.DomType.Text:if(i.text?.length)return!0;break;case g.DomType.DeletedText:if(this.options.renderChanges&&i.text?.length)return!0;break;case g.DomType.Symbol:case g.DomType.Tab:case g.DomType.PositionalTab:case g.DomType.NoBreakHyphen:case g.DomType.Break:return!0}if(this.hasVisibleMathContent(i))return!0}return!1}parseMathProperies(o){const i={};for(const a of h.default.elements(o))switch(a.localName){case"chr":i.char=h.default.attr(a,"val");break;case"vertJc":i.verticalJustification=h.default.attr(a,"val");break;case"pos":i.position=h.default.attr(a,"val");break;case"degHide":i.hideDegree=h.default.boolAttr(a,"val");break;case"begChr":i.beginChar=h.default.attr(a,"val");break;case"endChr":i.endChar=h.default.attr(a,"val");break;case"limLoc":i.limitLocation=h.default.attr(a,"val");break;case"grow":i.grow=h.default.boolAttr(a,"val");break;case"sepChr":i.separatorChar=h.default.attr(a,"val")}return i}parseRunProperties(o,i){this.parseDefaultProperties(o,i.cssStyle={},null,a=>{switch(a.localName){case"rStyle":i.styleName=h.default.attr(a,"val");break;case"vertAlign":i.verticalAlign=u.valueOfVertAlign(a,!0);break;default:return!1}return!0})}parseVmlPicture(o){const i={type:g.DomType.VmlPicture,children:[]};for(const a of h.default.elements(o)){const b=(0,n.parseVmlElement)(a,this);b&&i.children.push(b)}return i}checkAlternateContent(o){if(o.localName!="AlternateContent")return o;for(const a of h.default.elements(o).filter(b=>b.localName=="Choice")){const b=(h.default.attr(a,"Requires")??"").split(/\s+/).filter(Boolean);if(b.length>0&&b.every(v=>p.includes(o.lookupNamespaceURI(v)))){const v=h.default.elements(a)[0];if(v)return v}}const i=h.default.element(o,"Fallback");return i?h.default.elements(i)[0]:null}parseDrawing(o){for(var i of h.default.elements(o))switch(i.localName){case"inline":case"anchor":return this.parseDrawingWrapper(i)}}parseDrawingWrapper(o){var i,a,b,v,_,T,k,M,R,O,P,N={type:g.DomType.Drawing,children:[],cssStyle:{},props:{}},it=o.localName=="anchor";const J=(S,$)=>{$&&(N.cssStyle[S]=u.addSize(N.cssStyle[S],$))};J("margin-left",h.default.lengthAttr(o,"distL",r.LengthUsage.Emu)),J("margin-top",h.default.lengthAttr(o,"distT",r.LengthUsage.Emu)),J("margin-right",h.default.lengthAttr(o,"distR",r.LengthUsage.Emu)),J("margin-bottom",h.default.lengthAttr(o,"distB",r.LengthUsage.Emu));let ot=null,tt=null,ht=null,W=h.default.boolAttr(o,"simplePos",!1),G=h.default.boolAttr(o,"behindDoc",!1),gt=h.default.intAttr(o,"relativeHeight",null);gt!=null&&(N.cssStyle["z-index"]=`${Math.max(1,Math.round(gt/1e3))}`),G&&(N.cssStyle["z-index"]="0");let nt={relative:"page",align:"left",offset:"0"},j={relative:"page",align:"top",offset:"0"},U=!1,at=!1,rt=!1;for(var V of h.default.elements(o))switch(V.localName){case"simplePos":W&&(nt.offset=h.default.lengthAttr(V,"x",r.LengthUsage.Emu),j.offset=h.default.lengthAttr(V,"y",r.LengthUsage.Emu),at=nt.offset!=null,rt=j.offset!=null);break;case"extent":N.cssStyle.width=h.default.lengthAttr(V,"cx",r.LengthUsage.Emu),N.cssStyle.height=h.default.lengthAttr(V,"cy",r.LengthUsage.Emu);break;case"effectExtent":J("margin-left",h.default.lengthAttr(V,"l",r.LengthUsage.Emu)),J("margin-top",h.default.lengthAttr(V,"t",r.LengthUsage.Emu)),J("margin-right",h.default.lengthAttr(V,"r",r.LengthUsage.Emu)),J("margin-bottom",h.default.lengthAttr(V,"b",r.LengthUsage.Emu));break;case"docPr":N.props.title=h.default.attr(V,"title")??h.default.attr(V,"name"),N.props.alt=h.default.attr(V,"descr")??N.props.title;break;case"positionH":case"positionV":if(!W){let S=V.localName=="positionH",$=S?nt:j;var et=h.default.element(V,"align"),q=h.default.element(V,"posOffset");$.relative=h.default.attr(V,"relativeFrom")??$.relative,et&&($.align=et.textContent,S&&(U=!0)),q&&($.offset=(0,r.convertLength)(q.textContent,r.LengthUsage.Emu),S?at=$.offset!=null:rt=$.offset!=null)}break;case"wrapTopAndBottom":ot="wrapTopAndBottom";break;case"wrapNone":ot="wrapNone";break;case"wrapSquare":ot="wrapSquare",tt=h.default.attr(V,"wrapText");break;case"wrapTight":ot="wrapTight",tt=h.default.attr(V,"wrapText"),ht=this.parseWrapPolygon(V);break;case"wrapThrough":ot="wrapThrough",tt=h.default.attr(V,"wrapText"),ht=this.parseWrapPolygon(V);break;case"graphic":var F=this.parseGraphic(V);F&&(F.type==g.DomType.Image?((i=F).alt??(i.alt=N.props.alt),(a=F).title??(a.title=N.props.title)):F.type==g.DomType.Shape?((b=F).alt??(b.alt=N.props.alt),(v=F).title??(v.title=N.props.title)):F.type==g.DomType.Chart?((_=F).alt??(_.alt=N.props.alt),(T=F).title??(T.title=N.props.title)):F.type==g.DomType.SmartArt?((k=F).alt??(k.alt=N.props.alt),(M=F).title??(M.title=N.props.title)):F.type==g.DomType.Ink&&((R=F).alt??(R.alt=N.props.alt),(O=F).title??(O.title=N.props.title)),N.children.push(F))}N.props.anchorPosition={horizontal:{...nt},vertical:{...j},wrapType:ot,layoutInCell:h.default.boolAttr(o,"layoutInCell",!0),simplePos:W};const ut=()=>{switch(nt.align){case"center":N.cssStyle["margin-left"]="auto",N.cssStyle["margin-right"]="auto";break;case"right":N.cssStyle["margin-left"]="auto"}};return ot=="wrapTopAndBottom"?(N.cssStyle.display="block",N.cssStyle.clear="both",U?ut():at&&nt.offset&&(N.cssStyle["margin-inline-start"]=u.addSize(N.cssStyle["margin-inline-start"],nt.offset)),rt&&j.offset&&(N.cssStyle["margin-top"]=u.addSize(N.cssStyle["margin-top"],j.offset))):ot=="wrapNone"?(N.cssStyle.display="block",N.cssStyle.position=it?"absolute":"relative",nt.offset&&(N.cssStyle.left=nt.offset),j.offset&&(N.cssStyle.top=j.offset)):ot=="wrapSquare"||ot=="wrapTight"||ot=="wrapThrough"?(ht&&(N.cssStyle["shape-outside"]=ht,(P=N.cssStyle)["clip-path"]??(P["clip-path"]=ht)),tt=="left"?N.cssStyle.float="right":tt=="right"?N.cssStyle.float="left":nt.align=="left"||nt.align=="right"?N.cssStyle.float=nt.align:(N.cssStyle.display="block",ut())):!it||nt.align!="left"&&nt.align!="right"?N.cssStyle["vertical-align"]="text-bottom":N.cssStyle.float=nt.align,N}parseWrapPolygon(o){const i=h.default.element(o,"wrapPolygon");if(!i)return null;const a=[],b=v=>{const _=h.default.lengthAttr(v,"x",r.LengthUsage.Emu),T=h.default.lengthAttr(v,"y",r.LengthUsage.Emu);_&&T&&a.push(`${_} ${T}`)};for(const v of h.default.elements(i))v.localName!="start"&&v.localName!="lineTo"||b(v);return a.length>=3?`polygon(${a.join(", ")})`:null}parseGraphic(o){var i=h.default.element(o,"graphicData");if(!i)return null;for(let b of h.default.elements(i))switch(b.localName){case"pic":return this.parsePicture(b);case"wpc":case"wgp":case"grpSp":return this.parseDrawingContainer(b);case"wsp":case"sp":case"cxnSp":return this.parseWordprocessingShape(b);case"chart":return this.parseChartReference(b);case"relIds":case"diagram":return this.parseSmartArtReference(b);case"contentPart":case"ink":return this.parseInkReference(b)}const a=this.findDescendant(i,"contentPart");return a?this.parseInkReference(a):null}parseDrawingContainer(o){const i={type:g.DomType.Shape,children:[],cssStyle:{display:"inline-block",position:"relative",width:"100%",height:"100%",overflow:"visible","box-sizing":"border-box"},props:{dmlContainer:!0}},a=this.parseDmlGroupTransform(o);for(const b of h.default.elements(o))switch(b.localName){case"wsp":case"sp":case"cxnSp":const v=this.parseDmlPositionedShape(b,a);v&&i.children.push(v);break;case"grpSp":case"wgp":const _=this.parseDrawingContainer(b);_&&i.children.push(_)}return i}parseDmlGroupTransform(o){const i=h.default.element(o,"grpSpPr"),a=i?h.default.element(i,"xfrm"):h.default.element(o,"xfrm"),b=a?h.default.element(a,"off"):null,v=a?h.default.element(a,"ext"):null,_=a?h.default.element(a,"chOff"):null,T=a?h.default.element(a,"chExt"):null,k=v?h.default.floatAttr(v,"cx",null):null,M=v?h.default.floatAttr(v,"cy",null):null,R=T?h.default.floatAttr(T,"cx",null):null,O=T?h.default.floatAttr(T,"cy",null):null;return{offsetX:_?h.default.floatAttr(_,"x",0):0,offsetY:_?h.default.floatAttr(_,"y",0):0,left:b?h.default.floatAttr(b,"x",0):0,top:b?h.default.floatAttr(b,"y",0):0,scaleX:k&&R?k/R:1,scaleY:M&&O?M/O:1}}parseDmlPositionedShape(o,i){const a=h.default.element(o,"spPr");if(!a)return null;const b=this.parseDmlShapeBounds(a,i),v=[];let _=null,T=!1;for(const J of h.default.elements(o))switch(J.localName){case"txbx":case"textBox":T=!0;for(const ot of h.default.elements(J,"txbxContent"))v.push(...this.parseBodyElements(ot));break;case"bodyPr":_=J}_??(_=h.default.element(o,"bodyPr"));const k={position:"absolute",left:this.pt(b.left),top:this.pt(b.top),width:this.pt(b.width),height:this.pt(b.height),"box-sizing":"border-box",overflow:"hidden"},M=h.default.element(o,"cNvPr"),R=h.default.element(a,"custGeom"),O=h.default.element(a,"prstGeom"),P=this.parseDmlFillStyle(a),N=this.parseDmlLineStyle(h.default.element(a,"ln"));if(R){const J=this.parseDmlCustomGeometry(R);return{type:g.DomType.Shape,children:[],cssStyle:{...k,overflow:"visible"},props:{dmlSvg:!0,viewBox:J?.viewBox??"0 0 1 1",pathD:J?.d??"",fill:P.fill??"none",stroke:N.stroke??"none",strokeWidth:N.strokeWidth??"0",strokeDasharray:N.strokeDasharray},title:M?h.default.attr(M,"title")??h.default.attr(M,"name"):null,alt:M?h.default.attr(M,"descr"):null}}P.backgroundColor&&(k["background-color"]=P.backgroundColor),P.backgroundImage&&(k["background-image"]=P.backgroundImage),N.stroke&&N.stroke!="none"?k.border=`${N.strokeWidth||"0.75pt"} ${N.borderType||"solid"} ${N.stroke}`:k.border="none";const it=T?this.parseDmlTextBoxProperties(_):null;return{type:g.DomType.Shape,children:v,cssStyle:k,props:{dmlShape:!0,presetGeometry:O?h.default.attr(O,"prst"):null,...it},title:M?h.default.attr(M,"title")??h.default.attr(M,"name"):null,alt:M?h.default.attr(M,"descr"):null}}parseDmlShapeBounds(o,i){const a=h.default.element(o,"xfrm"),b=a?h.default.element(a,"off"):null,v=a?h.default.element(a,"ext"):null,_=i?.scaleX??1,T=i?.scaleY??1,k=i?.offsetX??0,M=i?.offsetY??0,R=i?.left??0,O=i?.top??0,P=b?h.default.floatAttr(b,"x",0):0,N=b?h.default.floatAttr(b,"y",0):0,it=v?h.default.floatAttr(v,"cx",0):0,J=v?h.default.floatAttr(v,"cy",0):0;return{left:this.emuToPt(R+(P-k)*_),top:this.emuToPt(O+(N-M)*T),width:Math.max(0,this.emuToPt(it*_)),height:Math.max(0,this.emuToPt(J*T))}}parseDmlFillStyle(o){if(h.default.element(o,"noFill"))return{fill:"none",backgroundColor:"transparent"};const i=h.default.element(o,"solidFill");if(i){const b=this.parseDmlColor(i)??"transparent";return{fill:b,backgroundColor:b}}const a=h.default.element(o,"pattFill");if(a){const b=this.parseDmlColor(h.default.element(a,"fgClr"))??"currentColor",v=this.parseDmlColor(h.default.element(a,"bgClr"))??"transparent",_=h.default.attr(a,"prst");return{fill:v,backgroundColor:v,backgroundImage:`repeating-linear-gradient(${_&&_.toLowerCase().includes("horz")?"0deg":"90deg"}, ${b} 0, ${b} 0.75pt, ${v} 0.75pt, ${v} 3pt)`}}return{fill:"none",backgroundColor:"transparent"}}parseDmlLineStyle(o){if(!o||h.default.element(o,"noFill"))return{stroke:"none",strokeWidth:"0",borderType:"none"};const i=this.parseDmlColor(h.default.element(o,"solidFill"))??"black",a=h.default.attr(o,"w")?this.pt(this.emuToPt(h.default.floatAttr(o,"w",0))):"0.75pt",b=h.default.elementAttr(o,"prstDash","val");let v=null,_="solid";return b&&b!="solid"&&(_="dashed",v=b=="dot"?"1 2":"4 3"),{stroke:i,strokeWidth:a,borderType:_,strokeDasharray:v}}parseDmlCustomGeometry(o){const i=h.default.element(o,"pathLst"),a=i?h.default.elements(i,"path"):[];let b="",v=1,_=1;for(const T of a){const k=h.default.floatAttr(T,"w",v),M=h.default.floatAttr(T,"h",_);v=Math.max(v,k||1),_=Math.max(_,M||1),b+=this.parseDmlPathData(T,k||1,M||1)}return{d:b.trim(),viewBox:`0 0 ${v} ${_}`}}parseDmlPathData(o,i,a){const b=[],v=_=>{const T=h.default.element(_,"pt");return T?`${this.dmlCoord(h.default.attr(T,"x"),i,a)} ${this.dmlCoord(h.default.attr(T,"y"),i,a)}`:"0 0"};for(const _ of h.default.elements(o))switch(_.localName){case"moveTo":b.push(`M ${v(_)}`);break;case"lnTo":b.push(`L ${v(_)}`);break;case"cubicBezTo":const T=h.default.elements(_,"pt").map(M=>`${this.dmlCoord(h.default.attr(M,"x"),i,a)} ${this.dmlCoord(h.default.attr(M,"y"),i,a)}`);T.length==3&&b.push(`C ${T.join(" ")}`);break;case"quadBezTo":const k=h.default.elements(_,"pt").map(M=>`${this.dmlCoord(h.default.attr(M,"x"),i,a)} ${this.dmlCoord(h.default.attr(M,"y"),i,a)}`);k.length==2&&b.push(`Q ${k.join(" ")}`);break;case"close":b.push("Z")}return b.join(" ")+" "}dmlCoord(o,i,a){if(o=="w"||o=="r")return i;if(o=="h"||o=="b")return a;if(o=="l"||o=="t")return 0;const b=parseFloat(o);return Number.isFinite(b)?b:0}dmlVerticalAlign(o){switch(o?h.default.attr(o,"anchor"):null){case"ctr":return"center";case"b":return"flex-end";default:return"flex-start"}}applyDmlTextInsets(o,i){if(o)for(const[a,b]of Object.entries({lIns:"padding-left",tIns:"padding-top",rIns:"padding-right",bIns:"padding-bottom"})){const v=h.default.attr(o,a);v!=null&&(i[b]=this.pt(this.emuToPt(parseFloat(v))))}}parseDmlTextBoxProperties(o){const i={};return this.applyDmlTextInsets(o,i),{dmlTextBox:!0,textInsets:i,textVerticalAlign:this.dmlVerticalAlign(o)}}emuToPt(o){return(Number.isFinite(o)?o:0)/12700}pt(o){return Math.round(100*o)/100+"pt"}parseChartReference(o){return{type:g.DomType.Chart,id:h.default.attr(o,"id"),cssStyle:{width:"100%",height:"100%"}}}parseSmartArtReference(o){const i=o.localName=="relIds"?o:this.findDescendant(o,"relIds");return{type:g.DomType.SmartArt,dataId:i?h.default.attr(i,"dm"):h.default.attr(o,"dm"),layoutId:i?h.default.attr(i,"lo"):h.default.attr(o,"lo"),styleId:i?h.default.attr(i,"qs"):h.default.attr(o,"qs"),colorId:i?h.default.attr(i,"cs"):h.default.attr(o,"cs"),cssStyle:{width:"100%",height:"100%"}}}parseInkReference(o){return{type:g.DomType.Ink,id:h.default.attr(o,"id"),cssStyle:{width:"100%",height:"100%"}}}parseGraphicPlaceholder(o){return{type:g.DomType.Shape,children:[{type:g.DomType.Text,text:`[${o}]`}],cssStyle:{display:"inline-flex","align-items":"center","justify-content":"center",border:"1px solid #999","background-color":"#f8f8f8",color:"#555","min-width":"2in","min-height":"1in"}}}parseWordprocessingShape(o){const i={type:g.DomType.Shape,children:[],cssStyle:{display:"inline-block",position:"relative","box-sizing":"border-box",overflow:"hidden"}},a=this.findDescendant(o,"cNvPr");let b=null,v=!1;a&&(i.title=h.default.attr(a,"title")??h.default.attr(a,"name"),i.alt=h.default.attr(a,"descr")??i.title);for(const _ of h.default.elements(o))switch(_.localName){case"spPr":this.parseDmlShapeProperties(_,i.cssStyle);break;case"txbx":case"textBox":v=!0;for(const T of h.default.elements(_,"txbxContent"))i.children.push(...this.parseBodyElements(T));break;case"bodyPr":b=_}return v&&(i.props={...i.props??{},...this.parseDmlTextBoxProperties(b)}),i}parseDmlShapeProperties(o,i){const a=h.default.element(o,"xfrm");if(a)for(const T of h.default.elements(a))switch(T.localName){case"ext":i.width=h.default.lengthAttr(T,"cx",r.LengthUsage.Emu),i.height=h.default.lengthAttr(T,"cy",r.LengthUsage.Emu);break;case"off":i.left=h.default.lengthAttr(T,"x",r.LengthUsage.Emu),i.top=h.default.lengthAttr(T,"y",r.LengthUsage.Emu)}const b=h.default.element(o,"solidFill"),v=h.default.element(o,"noFill"),_=h.default.element(o,"ln");if(b?i["background-color"]=this.parseDmlColor(b)??i["background-color"]:v&&(i["background-color"]="transparent"),_){const T=this.parseDmlColor(h.default.element(_,"solidFill"))??"black",k=h.default.lengthAttr(_,"w",r.LengthUsage.Emu)??"1px",M=h.default.elementAttr(_,"prstDash","val");i.border=`${k} ${M&&M!="solid"?"dashed":"solid"} ${T}`}}parseDmlColor(o){if(!o)return null;const i=h.default.element(o,"srgbClr"),a=h.default.element(o,"schemeClr"),b=h.default.element(o,"prstClr"),v=h.default.element(o,"sysClr");if(i)return this.applyDmlColorTransforms(i,`#${h.default.attr(i,"val")}`);if(a){const _=this.resolveDmlSchemeColor(h.default.attr(a,"val")),T=this.dmlSchemeColorFallback(_);return this.applyDmlColorTransforms(a,`var(--docx-${_}-color${T?`, ${T}`:""})`)}return v?this.applyDmlColorTransforms(v,`#${h.default.attr(v,"lastClr")??h.default.attr(v,"val")}`):b?this.applyDmlColorTransforms(b,h.default.attr(b,"val")):null}resolveDmlSchemeColor(o){switch(o){case"bg1":return"lt1";case"tx1":return"dk1";case"bg2":return"lt2";case"tx2":return"dk2";default:return o}}dmlSchemeColorFallback(o){switch(o){case"dk1":return"#000000";case"lt1":return"#FFFFFF";case"dk2":return"#44546A";case"lt2":return"#E7E6E6";case"accent1":return"#4472C4";case"accent2":return"#ED7D31";case"accent3":return"#A5A5A5";case"accent4":return"#FFC000";case"accent5":return"#5B9BD5";case"accent6":return"#70AD47";case"hlink":return"#0563C1";case"folHlink":return"#954F72";default:return null}}applyDmlColorTransforms(o,i){const a=h.default.elementAttr(o,"lumMod","val"),b=h.default.elementAttr(o,"lumOff","val");if(a!=null){const v=Math.max(0,Math.min(100,parseFloat(a)/1e3));Number.isFinite(v)&&v<100&&(i=`color-mix(in srgb, ${i} ${v}%, black)`)}if(b!=null){const v=Math.max(0,Math.min(100,parseFloat(b)/1e3));Number.isFinite(v)&&v>0&&(i=`color-mix(in srgb, ${i} ${100-v}%, white)`)}return i}findDescendant(o,i){for(const a of h.default.elements(o)){if(a.localName==i)return a;const b=this.findDescendant(a,i);if(b)return b}return null}parsePicture(o){var i={type:g.DomType.Image,src:"",cssStyle:{}},a=h.default.element(o,"blipFill"),b=a?h.default.element(a,"blip"):null,v=a?h.default.element(a,"srcRect"):null;i.src=b?h.default.attr(b,"embed")??h.default.attr(b,"link"):"";const _=this.findDescendant(o,"cNvPr");_&&(i.title=h.default.attr(_,"title")??h.default.attr(_,"name"),i.alt=h.default.attr(_,"descr")??i.title),v&&(i.srcRect=[h.default.intAttr(v,"l",0)/1e5,h.default.intAttr(v,"t",0)/1e5,h.default.intAttr(v,"r",0)/1e5,h.default.intAttr(v,"b",0)/1e5]);var T=h.default.element(o,"spPr"),k=T?h.default.element(T,"xfrm"):null,M=[];if(i.cssStyle.display="block",i.cssStyle.position="relative",i.cssStyle["object-fit"]="contain",k)for(var R of(i.rotation=h.default.intAttr(k,"rot",0)/6e4,h.default.boolAttr(k,"flipH",!1)&&M.push("scaleX(-1)"),h.default.boolAttr(k,"flipV",!1)&&M.push("scaleY(-1)"),h.default.elements(k)))switch(R.localName){case"ext":i.cssStyle.width=h.default.lengthAttr(R,"cx",r.LengthUsage.Emu),i.cssStyle.height=h.default.lengthAttr(R,"cy",r.LengthUsage.Emu);break;case"off":i.cssStyle.left=h.default.lengthAttr(R,"x",r.LengthUsage.Emu),i.cssStyle.top=h.default.lengthAttr(R,"y",r.LengthUsage.Emu)}return M.length>0&&(i.cssStyle.transform=M.join(" ")),i.cssStyle.width||(i.cssStyle.width="100%"),i.cssStyle.height||(i.cssStyle.height="100%"),i}parseTable(o){var i={type:g.DomType.Table,children:[]};for(const a of h.default.elements(o))switch(a.localName){case"tr":i.children.push(this.parseTableRow(a));break;case"tblGrid":i.columns=this.parseTableColumns(a);break;case"tblPr":this.parseTableProperties(a,i)}return i}parseTableColumns(o){var i=[];for(const a of h.default.elements(o))a.localName==="gridCol"&&i.push({width:h.default.lengthAttr(a,"w")});return i}parseTableProperties(o,i){i.cssStyle={},i.cellStyle={};let a=null;switch(this.parseDefaultProperties(o,i.cssStyle,i.cellStyle,b=>{switch(b.localName){case"tblStyle":i.styleName=h.default.attr(b,"val");break;case"tblLook":i.className=u.classNameOftblLook(b);break;case"tblInd":a=this.parseTableIndentation(b);break;case"tblpPr":this.parseTablePosition(b,i);break;case"tblStyleColBandSize":i.colBandSize=h.default.intAttr(b,"val");break;case"tblStyleRowBandSize":i.rowBandSize=h.default.intAttr(b,"val");break;case"hidden":i.cssStyle.display="none";break;default:return!1}return!0}),i.cssStyle["text-align"]){case"center":delete i.cssStyle["text-align"],i.cssStyle["margin-left"]="auto",i.cssStyle["margin-right"]="auto";break;case"right":delete i.cssStyle["text-align"],i.cssStyle["margin-left"]="auto";break;default:delete i.cssStyle["text-align"],a&&(i.cssStyle["margin-inline-start"]=u.addSize(i.cssStyle["margin-inline-start"],a))}}parseTableIndentation(o){const i=h.default.attr(o,"type");return i=="pct"||i=="auto"?null:h.default.lengthAttr(o,"w",r.LengthUsage.SignedDxa)}parseTablePosition(o,i){var a=h.default.lengthAttr(o,"topFromText"),b=h.default.lengthAttr(o,"bottomFromText"),v=h.default.lengthAttr(o,"rightFromText"),_=h.default.lengthAttr(o,"leftFromText");i.cssStyle.float="left",i.cssStyle["margin-bottom"]=u.addSize(i.cssStyle["margin-bottom"],b),i.cssStyle["margin-left"]=u.addSize(i.cssStyle["margin-left"],_),i.cssStyle["margin-right"]=u.addSize(i.cssStyle["margin-right"],v),i.cssStyle["margin-top"]=u.addSize(i.cssStyle["margin-top"],a)}parseTableRow(o){var i={type:g.DomType.Row,children:[]};for(const a of h.default.elements(o))switch(a.localName){case"tc":i.children.push(this.parseTableCell(a));break;case"trPr":case"tblPrEx":this.parseTableRowProperties(a,i)}return i}parseTableRowProperties(o,i){const a={};i.cssStyle=this.parseDefaultProperties(o,a,null,b=>{switch(b.localName){case"cnfStyle":i.className=u.classNameOfCnfStyle(b);break;case"tblHeader":i.isHeader=h.default.boolAttr(b,"val");break;case"gridBefore":i.gridBefore=h.default.intAttr(b,"val");break;case"gridAfter":i.gridAfter=h.default.intAttr(b,"val");break;case"cantSplit":h.default.boolAttr(b,"val",!0)&&(a["break-inside"]="avoid");break;default:return!1}return!0})}parseTableCell(o){var i={type:g.DomType.Cell,children:[]};for(const a of h.default.elements(o))switch(a.localName){case"tbl":i.children.push(this.parseTable(a));break;case"p":i.children.push(this.parseParagraph(a));break;case"tcPr":this.parseTableCellProperties(a,i)}return i}parseTableCellProperties(o,i){i.cssStyle=this.parseDefaultProperties(o,{},null,a=>{switch(a.localName){case"gridSpan":i.span=h.default.intAttr(a,"val",null);break;case"vMerge":i.verticalMerge=h.default.attr(a,"val")??"continue";break;case"cnfStyle":i.className=u.classNameOfCnfStyle(a);break;default:return!1}return!0}),this.parseTableCellVerticalText(o,i)}parseTableCellVerticalText(o,i){const a={btLr:{writingMode:"vertical-rl",transform:"rotate(180deg)"},lrTb:{writingMode:"vertical-lr",transform:"none"},tbRl:{writingMode:"vertical-rl",transform:"none"}};for(const b of h.default.elements(o))if(b.localName==="textDirection"){const v=a[h.default.attr(b,"val")]||{writingMode:"horizontal-tb"};i.cssStyle["writing-mode"]=v.writingMode,i.cssStyle.transform=v.transform}}parseDefaultProperties(o,i=null,a=null,b=null){i=i||{};for(const v of h.default.elements(o))if(!b?.(v))switch(v.localName){case"jc":i["text-align"]=u.valueOfJc(v);break;case"textAlignment":i["vertical-align"]=u.valueOfTextAlignment(v);break;case"color":i.color=l.colorAttr(v,"val",null,d.autos.color);break;case"sz":i["font-size"]=i["min-height"]=h.default.lengthAttr(v,"val",r.LengthUsage.FontSize);break;case"szCs":i["font-size"]??(i["font-size"]=h.default.lengthAttr(v,"val",r.LengthUsage.FontSize)),i["min-height"]??(i["min-height"]=i["font-size"]);break;case"shd":i["background-color"]=l.colorAttr(v,"fill",null,d.autos.shd);break;case"highlight":i["background-color"]=l.colorAttr(v,"val",null,d.autos.highlight);break;case"vertAlign":i["vertical-align"]=u.valueOfVertAlign(v);break;case"position":i["vertical-align"]=h.default.lengthAttr(v,"val",r.LengthUsage.SignedHalfPoint);break;case"scale":i["font-stretch"]=`${h.default.intAttr(v,"val",100)}%`;break;case"tcW":if(this.options.ignoreWidth)break;case"tblW":i.width=u.valueOfSize(v,"w");break;case"trHeight":this.parseTrHeight(v,i);break;case"strike":i["text-decoration"]=h.default.boolAttr(v,"val",!0)?"line-through":"none";break;case"dstrike":h.default.boolAttr(v,"val",!0)?(i["text-decoration-line"]="line-through",i["text-decoration-style"]="double"):i["text-decoration"]="none";break;case"b":i["font-weight"]=h.default.boolAttr(v,"val",!0)?"bold":"normal";break;case"i":i["font-style"]=h.default.boolAttr(v,"val",!0)?"italic":"normal";break;case"bCs":i["--docx-bidi-font-weight"]=h.default.boolAttr(v,"val",!0)?"bold":"normal",i.direction=="rtl"&&(i["font-weight"]=i["--docx-bidi-font-weight"]);break;case"iCs":i["--docx-bidi-font-style"]=h.default.boolAttr(v,"val",!0)?"italic":"normal",i.direction=="rtl"&&(i["font-style"]=i["--docx-bidi-font-style"]);break;case"caps":i["text-transform"]=h.default.boolAttr(v,"val",!0)?"uppercase":"none";break;case"smallCaps":i["font-variant"]=h.default.boolAttr(v,"val",!0)?"small-caps":"none";break;case"rtl":h.default.boolAttr(v,"val",!0)&&(i.direction="rtl",i["unicode-bidi"]="embed",i["--docx-bidi-font-weight"]&&(i["font-weight"]=i["--docx-bidi-font-weight"]),i["--docx-bidi-font-style"]&&(i["font-style"]=i["--docx-bidi-font-style"]));break;case"outline":h.default.boolAttr(v,"val",!0)&&(i["-webkit-text-stroke"]="0.5px currentColor");break;case"shadow":h.default.boolAttr(v,"val",!0)&&(i["text-shadow"]="1px 1px 0 currentColor");break;case"emboss":h.default.boolAttr(v,"val",!0)&&(i["text-shadow"]="-1px -1px 0 rgba(255,255,255,.75), 1px 1px 0 rgba(0,0,0,.35)");break;case"imprint":h.default.boolAttr(v,"val",!0)&&(i["text-shadow"]="1px 1px 0 rgba(255,255,255,.75), -1px -1px 0 rgba(0,0,0,.35)");break;case"em":i["text-emphasis-style"]=u.valueOfEmphasisMark(v);break;case"u":this.parseUnderline(v,i);break;case"ind":case"tblInd":this.parseIndentation(v,i);break;case"rFonts":this.parseFont(v,i);break;case"tblBorders":this.parseBorderProperties(v,a||i);break;case"tblCellSpacing":i["border-spacing"]=u.valueOfMargin(v),i["border-collapse"]="separate";break;case"pBdr":this.parseBorderProperties(v,i);break;case"bdr":i.border=u.valueOfBorder(v);break;case"tcBorders":this.parseBorderProperties(v,i);break;case"vanish":h.default.boolAttr(v,"val",!0)&&(i.display="none");break;case"kern":i["font-kerning"]=h.default.intAttr(v,"val",0)>0?"normal":"none";break;case"noWrap":i["white-space"]=h.default.boolAttr(v,"val",!0)?"nowrap":"normal";break;case"snapToGrid":i["--docx-snap-to-grid"]=h.default.boolAttr(v,"val",!0)?"1":"0";break;case"fitText":this.parseFitText(v,i);break;case"eastAsianLayout":this.parseEastAsianLayout(v,i);break;case"tblCellMar":case"tcMar":this.parseMarginProperties(v,a||i);break;case"tblLayout":i["table-layout"]=u.valueOfTblLayout(v);break;case"vAlign":i["vertical-align"]=u.valueOfTextAlignment(v);break;case"spacing":o.localName=="pPr"?this.parseSpacing(v,i):o.localName=="rPr"&&(i["letter-spacing"]=h.default.lengthAttr(v,"val",r.LengthUsage.SignedDxa));break;case"wordWrap":h.default.boolAttr(v,"val")&&(i["overflow-wrap"]="break-word");break;case"suppressAutoHyphens":i.hyphens=h.default.boolAttr(v,"val",!0)?"none":"auto";break;case"lang":i.$lang=h.default.attr(v,"val");break;case"rtl":case"bidi":h.default.boolAttr(v,"val",!0)&&(i.direction="rtl");break;case"pageBreakBefore":h.default.boolAttr(v,"val",!0)&&(i["break-before"]="page");break;case"keepLines":h.default.boolAttr(v,"val",!0)&&(i["break-inside"]="avoid");break;case"keepNext":h.default.boolAttr(v,"val",!0)&&(i["break-after"]="avoid");break;case"widowControl":h.default.boolAttr(v,"val",!0)&&(i.orphans="2",i.widows="2");break;case"webHidden":this.options.hideWebHiddenContent&&h.default.boolAttr(v,"val",!0)&&(i.display="none");break;case"specVanish":h.default.boolAttr(v,"val",!0)&&(i.display="none");break;case"tabs":case"outlineLvl":case"contextualSpacing":case"tblStyleColBandSize":case"tblStyleRowBandSize":case"suppressLineNumbers":case"noProof":break;default:this.options.debug&&console.warn(`DOCX: Unknown document element: ${o.localName}.${v.localName}`)}return i}parseFitText(o,i){const a=h.default.lengthAttr(o,"val");a&&(i.display="inline-block",i.width=a,i["text-align"]="justify",i["text-align-last"]="justify")}parseEastAsianLayout(o,i){h.default.boolAttr(o,"combine",!1)&&(i["text-combine-upright"]="all"),h.default.boolAttr(o,"vert",!1)&&(i["writing-mode"]="vertical-rl"),h.default.boolAttr(o,"vertCompress",!1)&&(i["font-stretch"]="condensed")}parseUnderline(o,i){var a=h.default.attr(o,"val");if(a!=null){switch(a){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":i["text-decoration"]="underline dashed";break;case"dotted":case"dottedHeavy":i["text-decoration"]="underline dotted";break;case"double":i["text-decoration"]="underline double";break;case"single":case"thick":case"words":i["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":i["text-decoration"]="underline wavy";break;case"none":i["text-decoration"]="none"}var b=l.colorAttr(o,"color");b&&(i["text-decoration-color"]=b)}}parseFont(o,i){var a=h.default.attr(o,"ascii"),b=h.default.attr(o,"hAnsi"),v=h.default.attr(o,"eastAsia"),_=h.default.attr(o,"cs"),T=[a,b,u.themeValue(o,"asciiTheme"),u.themeValue(o,"hAnsiTheme"),v,u.themeValue(o,"eastAsiaTheme"),_,u.themeValue(o,"cstheme")??u.themeValue(o,"csTheme")].filter(k=>k).map(k=>(0,t.encloseFontFamily)(k));if(T.length>0){const k=(i["font-family"]??"").split(",").map(M=>M.trim()).filter(M=>M);i["font-family"]=[...new Set([...k,...T])].join(", ")}}parseIndentation(o,i){var a=h.default.lengthAttr(o,"firstLine"),b=h.default.lengthAttr(o,"hanging"),v=h.default.lengthAttr(o,"left"),_=h.default.lengthAttr(o,"start"),T=h.default.lengthAttr(o,"right"),k=h.default.lengthAttr(o,"end");a&&(i["text-indent"]=a,i["--docx-text-indent"]=a),b&&(i["text-indent"]=`-${b}`,i["--docx-text-indent"]=`-${b}`,i["--docx-hanging-indent"]=b),(v||_)&&(i["margin-inline-start"]=v||_,i["--docx-margin-inline-start"]=v||_),(T||k)&&(i["margin-inline-end"]=T||k,i["--docx-margin-inline-end"]=T||k)}parseSpacing(o,i){var a=h.default.lengthAttr(o,"before"),b=h.default.lengthAttr(o,"after"),v=h.default.intAttr(o,"beforeLines",null),_=h.default.intAttr(o,"afterLines",null),T=h.default.boolAttr(o,"beforeAutospacing",!1),k=h.default.boolAttr(o,"afterAutospacing",!1),M=h.default.intAttr(o,"line",null),R=h.default.attr(o,"lineRule");if(T?i["margin-top"]="auto":v!=null?i["margin-top"]=`${(v/100).toFixed(2)}em`:a&&(i["margin-top"]=a),k?i["margin-bottom"]="auto":_!=null?i["margin-bottom"]=`${(_/100).toFixed(2)}em`:b&&(i["margin-bottom"]=b),M!==null)switch(R??"auto"){case"auto":default:i["line-height"]=`${(M/240).toFixed(2)}`;break;case"atLeast":i["line-height"]=`max(1em, ${(M/20).toFixed(2)}pt)`,i["min-height"]=`${(M/20).toFixed(2)}pt`;break;case"exact":case"exactly":i["line-height"]=i["min-height"]=`${(M/20).toFixed(2)}pt`}}parseMarginProperties(o,i){for(const a of h.default.elements(o))switch(a.localName){case"left":case"start":i["padding-left"]=u.valueOfMargin(a);break;case"right":case"end":i["padding-right"]=u.valueOfMargin(a);break;case"top":i["padding-top"]=u.valueOfMargin(a);break;case"bottom":i["padding-bottom"]=u.valueOfMargin(a)}}parseTrHeight(o,i){h.default.attr(o,"hRule"),i.height=h.default.lengthAttr(o,"val")}parseBorderProperties(o,i){for(const a of h.default.elements(o)){const b=u.valueOfBorder(a);switch(a.localName){case"start":case"left":i["border-left"]=b;break;case"end":case"right":i["border-right"]=b;break;case"top":i["border-top"]=b;break;case"bottom":i["border-bottom"]=b;break;case"insideH":i["border-top"]??(i["border-top"]=b),i["border-bottom"]??(i["border-bottom"]=b);break;case"insideV":i["border-left"]??(i["border-left"]=b),i["border-right"]??(i["border-right"]=b)}}}};const s=["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","none","red","white","yellow"];class l{static colorAttr(i,a,b=null,v="black"){var _=h.default.attr(i,a);if(_)return _=="auto"?v:s.includes(_)?_:`#${_}`;var T=h.default.attr(i,"themeColor");return T?`var(--docx-${T}-color)`:b}}class u{static themeValue(i,a){var b=h.default.attr(i,a);return b?`var(--docx-${b}-font)`:null}static valueOfSize(i,a){var b=r.LengthUsage.Dxa;switch(h.default.attr(i,"type")){case"dxa":break;case"pct":b=r.LengthUsage.Percent;break;case"auto":return"auto"}return h.default.lengthAttr(i,a,b)}static valueOfMargin(i){return h.default.lengthAttr(i,"w")}static valueOfBorder(i){var a=u.parseBorderType(h.default.attr(i,"val"));if(a=="none")return"none";var b=l.colorAttr(i,"color",d.autos.borderColor,d.autos.borderColor);return`${h.default.lengthAttr(i,"sz",r.LengthUsage.Border)??"1pt"} ${a} ${b=="auto"?d.autos.borderColor:b}`}static parseBorderType(i){switch(i){case"single":case"dashDotStroked":case"thick":case"thickThinLargeGap":case"thickThinMediumGap":case"thickThinSmallGap":case"thinThickLargeGap":case"thinThickMediumGap":case"thinThickSmallGap":case"thinThickThinLargeGap":case"thinThickThinMediumGap":case"thinThickThinSmallGap":case"threeDEmboss":case"threeDEngrave":case"wave":return"solid";case"dashed":case"dashSmallGap":return"dashed";case"dotDash":case"dotDotDash":case"dotted":return"dotted";case"double":case"doubleWave":case"triple":return"double";case"inset":return"inset";case"nil":case"none":return"none";case"outset":return"outset"}return"solid"}static valueOfTblLayout(i){return h.default.attr(i,"val")=="fixed"?"fixed":"auto"}static classNameOfCnfStyle(i){const a=h.default.attr(i,"val");return["first-row","last-row","first-col","last-col","odd-col","even-col","odd-row","even-row","ne-cell","nw-cell","se-cell","sw-cell"].filter((b,v)=>a[v]=="1").join(" ")}static valueOfJc(i){var a=h.default.attr(i,"val");switch(a){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":return"justify"}return a}static valueOfVertAlign(i,a=!1){var b=h.default.attr(i,"val");switch(b){case"subscript":return"sub";case"superscript":return a?"sup":"super"}return a?null:b}static valueOfEmphasisMark(i){switch(h.default.attr(i,"val")){case"none":return"none";case"comma":return'"﹐"';case"circle":return"circle";default:return"dot"}}static valueOfTextAlignment(i){var a=h.default.attr(i,"val");switch(a){case"auto":case"baseline":return"baseline";case"top":return"top";case"center":return"middle";case"bottom":return"bottom"}return a}static addSize(i,a){return i&&i!="0.00pt"&&i!="0px"?a&&a!="0.00pt"&&a!="0px"?`calc(${i} + ${a})`:i:a}static classNameOftblLook(i){const a=h.default.hexAttr(i,"val",0);let b="";return(h.default.boolAttr(i,"firstRow")||32&a)&&(b+=" first-row"),(h.default.boolAttr(i,"lastRow")||64&a)&&(b+=" last-row"),(h.default.boolAttr(i,"firstColumn")||128&a)&&(b+=" first-col"),(h.default.boolAttr(i,"lastColumn")||256&a)&&(b+=" last-col"),(h.default.boolAttr(i,"noHBand")||512&a)&&(b+=" no-hband"),(h.default.boolAttr(i,"noVBand")||1024&a)&&(b+=" no-vband"),b.trim()}}},"./document-props/core-props-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.CorePropsPart=void 0;const f=m("../common/part"),g=m("./core-props");class y extends f.Part{parseXml(h){this.props=(0,g.parseCoreProps)(h,this._package.xmlParser)}}d.CorePropsPart=y},"./document-props/core-props":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseCoreProps=function(f,g){const y={};for(let E of g.elements(f))switch(E.localName){case"title":y.title=E.textContent;break;case"description":y.description=E.textContent;break;case"subject":y.subject=E.textContent;break;case"creator":y.creator=E.textContent;break;case"keywords":y.keywords=E.textContent;break;case"language":y.language=E.textContent;break;case"lastModifiedBy":y.lastModifiedBy=E.textContent;break;case"revision":E.textContent&&(y.revision=parseInt(E.textContent))}return y}},"./document-props/custom-props-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.CustomPropsPart=void 0;const f=m("../common/part"),g=m("./custom-props");class y extends f.Part{parseXml(h){this.props=(0,g.parseCustomProps)(h,this._package.xmlParser)}}d.CustomPropsPart=y},"./document-props/custom-props":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseCustomProps=function(f,g){return g.elements(f,"property").map(y=>{const E=y.firstChild;return{formatId:g.attr(y,"fmtid"),name:g.attr(y,"name"),type:E.nodeName,value:E.textContent}})}},"./document-props/extended-props-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.ExtendedPropsPart=void 0;const f=m("../common/part"),g=m("./extended-props");class y extends f.Part{parseXml(h){this.props=(0,g.parseExtendedProps)(h,this._package.xmlParser)}}d.ExtendedPropsPart=y},"./document-props/extended-props":function(m,C,d){function f(g){if(g!==void 0)return parseInt(g)}Object.defineProperty(d,"__esModule",{value:!0}),d.parseExtendedProps=function(g,y){const E={};for(let h of y.elements(g))switch(h.localName){case"Template":E.template=h.textContent;break;case"Pages":E.pages=f(h.textContent);break;case"Words":E.words=f(h.textContent);break;case"Characters":E.characters=f(h.textContent);break;case"Application":E.application=h.textContent;break;case"Lines":E.lines=f(h.textContent);break;case"Paragraphs":E.paragraphs=f(h.textContent);break;case"Company":E.company=h.textContent;break;case"AppVersion":E.appVersion=h.textContent}return E}},"./docx-preview-worker":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0});const f=m("./word-document"),g=m("./document-parser"),y=m("./input-validation"),E=self;function h(w,A,r={}){E.postMessage({id:w,type:A,...r})}E.onmessage=async w=>{const A=w.data;if(!A||A.type!=="parse")return;const r=A.id;try{const n={...A.options,useWorker:!1,h:void 0,progress:void 0};(0,y.assertNonEmptyDocxInput)(A.data),h(r,"progress",{message:"Loading package relationships"});const e=await f.WordDocument.load(A.data,new g.DocumentParser(n),n);h(r,"progress",{message:"Serializing parsed document model"}),h(r,"parsed",{snapshot:await e.createSnapshot()})}catch(n){h(r,"error",{error:{message:n?.message??`${n}`,stack:n?.stack}})}}},"./docx-preview":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.defaultOptions=void 0,d.parseAsync=A,d.renderDocument=n,d.renderAsync=async function(a,b,v,_){const T={...d.defaultOptions,..._};(0,h.assertViewerLicense)("docx",T.licenseToken);const k=await A(a,T),M=await n(k,T);v??(v=b),v.innerHTML="",b.innerHTML="";let R=0;for(let P of M)(P.nodeName==="STYLE"?v:b).appendChild(P),R++,T.renderYieldEveryMs>0&&R%8==0&&await i();l(b,T.className);let O=null;return T.awaitLayout&&(T.progress?.({phase:"layout",message:"Measuring rendered pages"}),O=await c(b,T),l(b,T.className)),T.progress?.({phase:"done",current:O?.pageCount,total:O?.pageCount,message:"DOCX render complete"}),k},d.parseAsyncInWorker=p,d.awaitRenderedLayout=c,d.collectLayoutSnapshot=s,d.syncNumberingMarkerStyles=l,d.yieldToBrowser=i;const f=m("./word-document"),g=m("./document-parser"),y=m("./html-renderer"),E=m("./html"),h=m("./license-gate"),w=m("./input-validation");function A(a,b){const v={...d.defaultOptions,...b};return(0,h.assertViewerLicense)("docx",v.licenseToken),(0,w.assertNonEmptyDocxInput)(a),(function(_){return!(!_.useWorker||!_.workerUrl||typeof Worker>"u")})(v)?p(a,v).catch(_=>{if(!v.workerFallback)throw _;return v.debug&&console.warn("docx-preview: worker parsing failed; falling back to main thread",_),r(a,{...v,useWorker:!1})}):r(a,v)}function r(a,b){return(0,w.assertNonEmptyDocxInput)(a),b.progress?.({phase:"parse",message:"Parsing DOCX on main thread"}),f.WordDocument.load(a,new g.DocumentParser(b),b)}async function n(a,b){const v={...d.defaultOptions,...b};return(0,h.assertViewerLicense)("docx",v.licenseToken),await new y.HtmlRenderer().render(a,v)}function e(a){const{h:b,progress:v,licenseToken:_,...T}=a;return{...T,useWorker:!1}}d.defaultOptions={ignoreHeight:!1,ignoreWidth:!1,fixedPageHeight:!0,ignoreFonts:!1,breakPages:!0,strictWordCompatibility:!0,paginationTolerance:2,maxDynamicPaginationPasses:1e3,awaitLayout:!0,useWorker:!0,workerUrl:void 0,workerJsZipUrl:void 0,workerFallback:!0,workerTimeout:12e4,renderPageBatchSize:2,renderYieldEveryMs:16,progress:void 0,preserveComplexFieldResults:!0,updatePageReferences:!1,hideWebHiddenContent:!1,debug:!1,experimental:!1,className:"docx",inWrapper:!0,hideWrapperOnPrint:!1,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!1,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1,renderAltChunks:!0,h:E.h};let t=0;function p(a,b){const v={...d.defaultOptions,...b};return(0,h.assertViewerLicense)("docx",v.licenseToken),(0,w.assertNonEmptyDocxInput)(a),v.workerUrl&&typeof Worker<"u"?(v.progress?.({phase:"worker",message:"Starting DOCX parse worker"}),new Promise((_,T)=>{const k=++t,M=new Worker(v.workerUrl);let R=!1,O=null;const P=()=>{R=!0,O&&clearTimeout(O),M.terminate()};v.workerTimeout>0&&(O=setTimeout(()=>{R||(P(),T(new Error(`docx-preview worker timed out after ${v.workerTimeout}ms`)))},v.workerTimeout)),M.onerror=N=>{R||(P(),T(new Error(N.message||"docx-preview worker error")))},M.onmessage=N=>{const it=N.data??{};if(it.id===k||it.type==="ready")if(it.type!=="progress"){if(it.type==="parsed")return P(),v.progress?.({phase:"worker",message:"Worker parse complete"}),void _(f.WordDocument.fromSnapshot(it.snapshot,v));if(it.type==="error"){P();const J=new Error(it.error?.message??"docx-preview worker parse failed");J.stack=it.error?.stack,T(J)}}else v.progress?.({phase:"worker",current:it.current,total:it.total,message:it.message})},M.postMessage({type:"parse",id:k,data:a,options:e(v),jsZipUrl:v.workerJsZipUrl})})):r(a,{...v,useWorker:!1})}async function c(a,b){const v={...d.defaultOptions,...b};await(async function(T){const k=Array.from(T.querySelectorAll("img"));await Promise.allSettled(k.map(M=>M.complete?Promise.resolve():new Promise(R=>{M.addEventListener("load",R,{once:!0}),M.addEventListener("error",R,{once:!0})})))})(a),document.fonts?.ready&&await document.fonts.ready;const _=a.querySelector(`.${v.className}-wrapper`);if(v.breakPages&&v.fixedPageHeight&&!v.ignoreHeight&&_)for(let T=0;T<Math.max(2,Math.min(120,v.maxDynamicPaginationPasses??120))&&(await i(),_.dataset.docxPaginated!=="true")&&(_.dataset.docxPaginating==="true"||_.dataset.docxPaginationScheduled==="true");T++);return await i(),s(a,v)}function s(a,b){const v={...d.defaultOptions,...b},_=Array.from(a.querySelectorAll(`section.${v.className}`)).map((T,k)=>{const M=Array.from(T.querySelectorAll("[data-docx-field-instr]")),R=Array.from(T.querySelectorAll("img")).filter(P=>!P.complete||P.naturalWidth===0).length,O=T.clientHeight>0&&T.scrollHeight>T.clientHeight+(v.paginationTolerance??2);return{index:k+1,section:T.dataset.docxSection??"",pageNumber:parseInt(T.dataset.docxPageNumber??`${k+1}`,10),sectionPageNumber:parseInt(T.dataset.docxSectionPageNumber??"1",10),width:T.clientWidth,height:T.clientHeight,scrollHeight:T.scrollHeight,overflow:O,textLength:T.textContent?.length??0,anchors:Array.from(T.querySelectorAll("[id]")).map(P=>P.id).filter(Boolean),fields:M.map(P=>({instruction:P.dataset.docxFieldInstr??"",value:P.textContent??""})),floats:T.querySelectorAll('[data-docx-float="true"]').length,unresolvedMedia:R}});return{pageCount:_.length,overflowPages:_.filter(T=>T.overflow).map(T=>T.index),unresolvedMedia:_.reduce((T,k)=>T+k.unresolvedMedia,0),pages:_}}function l(a,b="docx"){if(!a||typeof getComputedStyle!="function")return;const v=Array.from(a.querySelectorAll("p")),_=`${b}-num-`;for(const T of v){if(!T.className?.includes(_))continue;const k=getComputedStyle(T,"::before");if(!k.content||k.content=="none"||k.content=="normal")continue;const M=u(T);if(!M||M==T)continue;const R=getComputedStyle(M);o(T,"--docx-marker-font-family",R.fontFamily),o(T,"--docx-marker-font-size",R.fontSize),o(T,"--docx-marker-font-style",R.fontStyle),o(T,"--docx-marker-font-weight",R.fontWeight)}}function u(a){const b=document.createTreeWalker(a,NodeFilter.SHOW_TEXT);for(;b.nextNode();){const v=b.currentNode;if(!v.nodeValue?.trim())continue;const _=v.parentElement;if(!_||_==a)return a;const T=getComputedStyle(_);if(T.display!="none"&&T.visibility!="hidden")return _}return null}function o(a,b,v){v&&a.style.setProperty(b,v)}function i(){return new Promise(a=>{const b=globalThis;typeof b.requestIdleCallback=="function"?b.requestIdleCallback(()=>a(),{timeout:32}):typeof b.requestAnimationFrame=="function"?b.requestAnimationFrame(()=>a()):setTimeout(a,0)})}},"./font-table/font-table":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.FontTablePart=void 0;const f=m("../common/part"),g=m("./fonts");class y extends f.Part{parseXml(h){this.fonts=(0,g.parseFonts)(h,this._package.xmlParser)}}d.FontTablePart=y},"./font-table/fonts":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseFonts=function(E,h){return h.elements(E).map(w=>g(w,h))},d.parseFont=g,d.parseEmbedFontRef=y;const f={embedRegular:"regular",embedBold:"bold",embedItalic:"italic",embedBoldItalic:"boldItalic"};function g(E,h){let w={name:h.attr(E,"name"),embedFontRefs:[]};for(let A of h.elements(E))switch(A.localName){case"family":w.family=h.attr(A,"val");break;case"altName":w.altName=h.attr(A,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":w.embedFontRefs.push(y(A,h))}return w}function y(E,h){return{id:h.attr(E,"id"),key:h.attr(E,"fontKey"),type:f[E.localName]}}},"./header-footer/elements":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.WmlFooter=d.WmlHeader=void 0;const f=m("../document/dom");class g extends f.OpenXmlElementBase{constructor(){super(...arguments),this.type=f.DomType.Header}}d.WmlHeader=g;class y extends f.OpenXmlElementBase{constructor(){super(...arguments),this.type=f.DomType.Footer}}d.WmlFooter=y},"./header-footer/parts":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.FooterPart=d.HeaderPart=d.BaseHeaderFooterPart=void 0;const f=m("../common/part"),g=m("./elements");class y extends f.Part{constructor(h,w,A){super(h,w),this._documentParser=A}parseXml(h){this.rootElement=this.createRootElement(),this.rootElement.children=this._documentParser.parseBodyElements(h)}}d.BaseHeaderFooterPart=y,d.HeaderPart=class extends y{createRootElement(){return new g.WmlHeader}},d.FooterPart=class extends y{createRootElement(){return new g.WmlFooter}}},"./html-renderer":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.HtmlRenderer=void 0;const f=m("./document/dom"),g=m("./utils"),y=m("./javascript"),E=m("./document/section"),h=m("./html"),w=m("./parser/xml-parser");function A(e){return e>="0"&&e<="9"}function r(e){if(!e)return!1;const t=e.charCodeAt(0);return t>=65&&t<=90||t>=97&&t<=122||t>=913&&t<=1023||t>=119808&&t<=120831}function n(e){return"()+-−=<>≤≥≈≠×÷*/·∙∑Σ∏∫√∞∂∇,.;:[]{}|‖!′″→←↔⇒⇔∈∉⊂⊃⊆⊇∧∨¬".includes(e)}d.HtmlRenderer=class{constructor(){this.className="docx",this.styleMap={},this.currentPart=null,this.currentSectionProps=null,this.currentPageNumber=1,this.currentSectionNumber=1,this.currentSectionPageNumber=1,this.totalPages=1,this.sectionPageCount=1,this.tableVerticalMerges=[],this.currentVerticalMerge=null,this.tableCellPositions=[],this.currentCellPosition=null,this.currentTableRow=null,this.footnoteMap={},this.endnoteMap={},this.currentEndnoteIds=[],this.usedHederFooterParts=[],this.currentTabs=[],this.currentParagraph=null,this.currentParagraphTabIndex=0,this.currentParagraphTabCount=0,this.commentMap={},this.bookmarkTextMap={},this.bookmarkIdToName={},this.tocEntries=[],this.fieldSeqCounters={},this.fieldSetValues={},this.headingIndex=0,this.tasks=[],this.postRenderTasks=[],this.h=h.h}async render(e,t){this.document=e,this.options=t,this.className=t.className,this.rootSelector=t.inWrapper?`.${this.className}-wrapper`:":root",this.h=t.h??h.h,this.styleMap=null,this.tasks=[],this.postRenderTasks=[],this.currentTabs=[],this.fieldSeqCounters={},this.fieldSetValues={},this.headingIndex=0,this.options.renderComments&&globalThis.Highlight&&(this.commentHighlight=new Highlight);const p=[...this.renderDefaultStyle()];e.themePart&&p.push(...this.renderTheme(e.themePart)),e.stylesPart!=null&&(this.styleMap=this.processStyles(e.stylesPart.styles),p.push(...this.renderStyles(e.stylesPart.styles))),e.numberingPart&&(this.prodessNumberings(e.numberingPart.domNumberings),p.push(...await this.renderNumbering(e.numberingPart.domNumberings))),e.footnotesPart&&(this.footnoteMap=(0,g.keyBy)(e.footnotesPart.notes,s=>s.id)),e.endnotesPart&&(this.endnoteMap=(0,g.keyBy)(e.endnotesPart.notes,s=>s.id)),e.settingsPart&&(this.defaultTabSize=e.settingsPart.settings?.defaultTabStop),!t.ignoreFonts&&e.fontTablePart&&p.push(...await this.renderFontTable(e.fontTablePart));var c=await this.renderSections(e.documentPart.body);if(this.options.inWrapper){const s=this.renderWrapper(c);p.push(s),this.shouldRunDynamicPagination()&&this.scheduleDynamicPagination(s)}else p.push(...c);return this.commentHighlight&&t.renderComments&&CSS.highlights.set(`${this.className}-comments`,this.commentHighlight),await Promise.allSettled(this.tasks),this.postRenderTasks.forEach(s=>s()),this.refreshTabStops(),p}renderTheme(e){const t={},p=e.theme?.fontScheme;p&&(p.majorFont&&(t["--docx-majorHAnsi-font"]=p.majorFont.latinTypeface,t["--docx-majorEastAsia-font"]=p.majorFont.eaTypeface??p.majorFont.latinTypeface,t["--docx-majorBidi-font"]=p.majorFont.csTypeface??p.majorFont.latinTypeface,t["--docx-majorCs-font"]=p.majorFont.csTypeface??p.majorFont.latinTypeface),p.minorFont&&(t["--docx-minorHAnsi-font"]=p.minorFont.latinTypeface,t["--docx-minorEastAsia-font"]=p.minorFont.eaTypeface??p.minorFont.latinTypeface,t["--docx-minorBidi-font"]=p.minorFont.csTypeface??p.minorFont.latinTypeface,t["--docx-minorCs-font"]=p.minorFont.csTypeface??p.minorFont.latinTypeface));const c=e.theme?.colorScheme;if(c)for(let[l,u]of Object.entries(c.colors))t[`--docx-${l}-color`]=`#${u}`;const s=this.styleToString(`.${this.className}`,t);return[this.h({tagName:"#comment",children:["docxjs document theme values"]}),this.h({tagName:"style",children:[s]})]}async renderFontTable(e){const t=[];for(let p of e.fonts)for(let c of p.embedFontRefs)try{const s=await this.document.loadFont(c.id,c.key),l={"font-family":(0,g.encloseFontFamily)(p.name),src:`url(${s})`};c.type!="bold"&&c.type!="boldItalic"||(l["font-weight"]="bold"),c.type!="italic"&&c.type!="boldItalic"||(l["font-style"]="italic"),t.push(this.h({tagName:"#comment",children:[`docxjs ${p.name} font`]})),t.push(this.h({tagName:"style",children:[this.styleToString("@font-face",l)]}))}catch{this.options.debug&&console.warn(`Can't load font with id ${c.id} and key ${c.key}`)}return t}processStyleName(e){return e?`${this.className}_${(0,g.escapeClassName)(e)}`:this.className}processStyles(e){const t=(0,g.keyBy)(e.filter(c=>c.id!=null),c=>c.id);for(const c of e.filter(s=>s.basedOn)){var p=t[c.basedOn];if(p){c.paragraphProps=(0,g.mergeDeep)({},p.paragraphProps,c.paragraphProps),c.runProps=(0,g.mergeDeep)({},p.runProps,c.runProps);for(const s of p.styles){const l=c.styles.find(u=>u.target==s.target);l?this.copyStyleProperties(s.values,l.values):c.styles.push({...s,values:{...s.values}})}}else this.options.debug&&console.warn(`Can't find base style ${c.basedOn}`)}for(let c of e)c.cssName=this.processStyleName(c.id);return t}prodessNumberings(e){for(let t of e.filter(p=>p.pStyleName)){const p=this.findStyle(t.pStyleName);p?.paragraphProps?.numbering&&(p.paragraphProps.numbering.level=t.level)}}processElement(e){if(e.children)for(var t of e.children)t.parent=e,t.type==f.DomType.Table?this.processTable(t):this.processElement(t)}processTable(e){const t=e.children??[];let p=e.columns?.length??0;for(const l of t){let u=l.gridBefore??0;for(const o of l.children??[])u+=o.span??1;p=Math.max(p,u+(l.gridAfter??0))}const c=Math.max(e.rowBandSize??1,1),s=Math.max(e.colBandSize??1,1);t.forEach((l,u)=>{u==0&&this.appendClassName(l,"first-row"),u==t.length-1&&this.appendClassName(l,"last-row"),this.appendClassName(l,Math.floor(u/c)%2==0?"odd-row":"even-row");let o=l.gridBefore??0;for(const i of l.children??[]){i.cssStyle=this.copyStyleProperties(e.cellStyle,i.cssStyle,["border-left","border-right","border-top","border-bottom","padding-left","padding-right","padding-top","padding-bottom"]);const a=i.span??1,b=o+a-1;o==0&&this.appendClassName(i,"first-col"),p>0&&b>=p-1&&this.appendClassName(i,"last-col"),this.appendClassName(i,Math.floor(o/s)%2==0?"odd-col":"even-col"),this.processElement(i),o+=a}})}collectDocumentMetadata(e){this.bookmarkTextMap={},this.bookmarkIdToName={},this.tocEntries=[];const t={},p=c=>{if(c.type!=f.DomType.Deleted||this.options.renderChanges){switch(c.type){case f.DomType.BookmarkStart:{const s=c;s.id&&s.name&&(this.bookmarkIdToName[s.id]=s.name,t[s.id]=[]);break}case f.DomType.BookmarkEnd:{const s=c,l=this.bookmarkIdToName[s.id];l&&t[s.id]&&(this.bookmarkTextMap[l]=t[s.id].join("").trim(),delete t[s.id]);break}case f.DomType.Text:for(const s of Object.keys(t))t[s].push(c.text??"");break;case f.DomType.DeletedText:if(this.options.renderChanges)for(const s of Object.keys(t))t[s].push(c.text??"")}for(const s of c.children??[])p(s)}};for(const c of e.children??[])p(c);for(const[c,s]of Object.entries(t)){const l=this.bookmarkIdToName[c];l&&(this.bookmarkTextMap[l]=s.join("").trim())}for(const c of e.children??[])this.collectTocEntries(c)}collectTocEntries(e){if(e.type!=f.DomType.Deleted||this.options.renderChanges){if(e.type==f.DomType.Paragraph){const t=e,p=this.findStyle(t.styleName),c=this.extractText(t).trim();let s=t.outlineLevel??p?.paragraphProps?.outlineLevel;if(s==null&&t.styleName){const l=/heading(\d+)|(?:^|[-_ ])h(\d+)$/i.exec(t.styleName);l&&(s=parseInt(l[1]??l[2],10)-1)}if(c&&s!=null&&s>=0&&s<9){const l=this.findFirstBookmark(t),u=l?.name&&!l.name.startsWith("_")?l.name:`${this.className}-heading-${++this.headingIndex}`;t.props={...t.props??{},anchorId:u},this.tocEntries.push({level:s+1,text:c,id:u})}}for(const t of e.children??[])this.collectTocEntries(t)}}findFirstBookmark(e){if(e.type==f.DomType.BookmarkStart)return e;for(const t of e.children??[]){const p=this.findFirstBookmark(t);if(p)return p}return null}extractText(e){switch(e.type){case f.DomType.Text:return e.text??"";case f.DomType.DeletedText:return this.options.renderChanges?e.text??"":"";case f.DomType.Deleted:return this.options.renderChanges?(e.children??[]).map(t=>this.extractText(t)).join(""):"";case f.DomType.Inserted:return(e.children??[]).map(t=>this.extractText(t)).join("");case f.DomType.Tab:case f.DomType.PositionalTab:return" ";case f.DomType.NoBreakHyphen:return"‑";case f.DomType.SoftHyphen:return"";case f.DomType.Break:return`
37
37
  `;case f.DomType.Instruction:case f.DomType.ComplexField:return""}return(e.children??[]).map(t=>this.extractText(t)).join("")}appendClassName(e,t){e.className=(0,h.cx)(e.className,t)}copyStyleProperties(e,t,p=null){if(!e)return t;for(var c of(t??(t={}),p??(p=Object.getOwnPropertyNames(e)),p))e.hasOwnProperty(c)&&!t.hasOwnProperty(c)&&(t[c]=e[c]);return t}createPageElement(e,t,p){const c={...p};let s=null,l=null;if(t){if(t.pageMargins&&(c.paddingLeft=this.addSize(t.pageMargins.left,t.pageMargins.gutter),c.paddingRight=t.pageMargins.right,c.paddingTop=t.pageMargins.top,c.paddingBottom=t.pageMargins.bottom),t.pageSize){let o=t.pageSize.width,i=t.pageSize.height;if(t.pageSize.orientation=="landscape"){const a=this.parseCssLengthValue(o),b=this.parseCssLengthValue(i);a!=null&&b!=null&&a<b&&([o,i]=[i,o])}s=o,l=i,this.options.ignoreWidth||(c.width=o),(!this.options.ignoreHeight||!this.options.breakPages)&&(c.minHeight=i,!this.options.ignoreHeight&&this.options.breakPages&&this.options.fixedPageHeight&&(c.height=i))}t.pageBorders&&(this.applyPageBorder(c,"top",t.pageBorders.top),this.applyPageBorder(c,"right",t.pageBorders.right),this.applyPageBorder(c,"bottom",t.pageBorders.bottom),this.applyPageBorder(c,"left",t.pageBorders.left))}const u=this.h({tagName:"section",className:e,style:c});return s&&this.setCssStyle(u,"--docx-page-width",s),l&&this.setCssStyle(u,"--docx-page-height",l),u}addSize(e,t){return e?t&&t!="0.00pt"&&t!="0px"?`calc(${e} + ${t})`:e:t}parseCssLengthValue(e){if(!e)return null;const t=/^(-?\d+(?:\.\d+)?)/.exec(e);return t?parseFloat(t[1]):null}applyPageBorder(e,t,p){if(!p)return;const c=this.borderTypeToCss(p.type);e[`border-${t}`]=c=="none"?"none":`${p.size??"1px"} ${c} ${this.borderColor(p.color)}`}borderTypeToCss(e){switch(e){case"nil":case"none":return"none";case"double":case"triple":return"double";case"dashed":case"dashSmallGap":return"dashed";case"dotted":case"dotDash":case"dotDotDash":return"dotted"}return"solid"}borderColor(e){return e&&e!="auto"?/^[0-9a-f]{6}$/i.test(e)?`#${e}`:e:"black"}createSectionContent(e){const t={},p=e.columns?.numberOfColumns??e.columns?.columns?.length;return e.docGrid&&(e.docGrid.linePitch&&(t["--docx-doc-grid-line-pitch"]=e.docGrid.linePitch),e.docGrid.charSpace&&(t.letterSpacing=e.docGrid.charSpace)),this.document.settingsPart?.settings?.kinsoku&&(t.lineBreak="strict",t.wordBreak="keep-all"),this.document.settingsPart?.settings?.overflowPunctuation&&(t.hangingPunctuation="allow-end"),this.document.settingsPart?.settings?.topLinePunctuation&&(t["text-spacing-trim"]="space-start"),(this.document.settingsPart?.settings?.autoSpaceDE||this.document.settingsPart?.settings?.autoSpaceDN)&&(t["text-autospace"]=[this.document.settingsPart?.settings?.autoSpaceDE?"ideograph-alpha":null,this.document.settingsPart?.settings?.autoSpaceDN?"ideograph-numeric":null].filter(Boolean).join(" ")),e.columns&&p&&(t.columnCount=`${p}`,t.columnGap=e.columns.space,!e.columns.equalWidth&&e.columns.columns?.length>0&&(t.columnWidth=e.columns.columns[0].width,t.columnGap=e.columns.columns[0].space??t.columnGap),e.columns.separator&&(t.columnRule="1px solid black")),this.h({tagName:"article",style:t})}async renderSections(e){const t=[];this.processElement(e),this.collectDocumentMetadata(e);const p=this.splitBySection(e.children,e.props),c=this.groupByPageBreaks(p);let s=null,l=0,u=0;const o=new Map,i=new Map,a=new Map,b=new Map,v=T=>{if(!a.has(T)){const k=++u;a.set(T,`${this.className}-section-${k}`),b.set(T,k)}};for(const T of c){const k=T[0].sectProps;v(k),o.set(k,(o.get(k)??0)+1)}this.totalPages=c.length;for(let T=0,k=c.length;T<k;T++){this.currentFootnoteIds=[];let M=c[T][0].sectProps;v(M);const R=s!=M;l=R&&M?.pageNumber?.start!=null?M.pageNumber.start:l+1,this.currentPageNumber=l,this.currentSectionNumber=b.get(M)??1,this.currentSectionProps=M,this.currentSectionPageNumber=(i.get(M)??0)+1,this.sectionPageCount=o.get(M)??1,i.set(M,this.currentSectionPageNumber);const O=this.createPageElement(this.className,M,e.cssStyle);O.dataset.docxSection=a.get(M),O.dataset.docxSectionNumber=`${this.currentSectionNumber}`,O.dataset.docxSectionPageNumber=`${this.currentSectionPageNumber}`,O.dataset.docxSectionPageCount=`${this.sectionPageCount}`,O.dataset.docxPageNumber=`${l}`,R&&M?.pageNumber?.start!=null&&(O.dataset.docxPageStart=`${M.pageNumber.start}`),this.options.renderHeaders&&this.renderHeaderFooter(M.headerRefs,M,l,R,O);for(const P of c[T]){this.currentSectionProps=P.sectProps;var _=this.createSectionContent(P.sectProps);P.columnBreak&&(_.style.breakBefore="column"),this.renderElements(P.elements,_),O.appendChild(_),M=P.sectProps}if(this.options.renderFootnotes){const P=this.renderNotes(this.currentFootnoteIds,this.footnoteMap,this.document.footnotesPart);P&&O.appendChild(P)}if(this.options.renderEndnotes&&T==k-1){const P=this.renderNotes(this.currentEndnoteIds,this.endnoteMap,this.document.endnotesPart);P&&O.appendChild(P)}this.currentSectionProps=M,this.options.renderFooters&&this.renderHeaderFooter(M.footerRefs,M,l,R,O),t.push(O),await this.yieldDuringRender(T+1,k),s=M}return t}renderHeaderFooter(e,t,p,c,s){if(!e)return;const l=!!this.document.settingsPart?.settings?.evenAndOddHeaders,u=e.find(a=>a.type=="default");var o=(t.titlePage&&c?e.find(a=>a.type=="first"):null)??(l&&p%2==0?e.find(a=>a.type=="even"):null)??u??e.find(a=>a.type=="first")??(l?e.find(a=>a.type=="even"):null),i=o&&this.document.findPartByRelId(o.id,this.document.documentPart);if(i){this.currentPart=i,this.usedHederFooterParts.includes(i.path)||(this.processElement(i.rootElement),this.usedHederFooterParts.push(i.path));const[a]=this.renderElements([i.rootElement],s);t?.pageMargins&&(i.rootElement.type===f.DomType.Header?(a.style.marginTop=`calc(${t.pageMargins.header} - ${t.pageMargins.top})`,a.style.minHeight=`calc(${t.pageMargins.top} - ${t.pageMargins.header})`):i.rootElement.type===f.DomType.Footer&&(a.style.marginBottom=`calc(${t.pageMargins.footer} - ${t.pageMargins.bottom})`,a.style.minHeight=`calc(${t.pageMargins.bottom} - ${t.pageMargins.footer})`)),this.currentPart=null}}isPageBreakElement(e){return e.type==f.DomType.Break&&(e.break=="lastRenderedPageBreak"?!this.options.ignoreLastRenderedPageBreak:e.break=="page")}isPageBreakSection(e,t){return!(!e||!t||e.pageSize?.orientation==t.pageSize?.orientation&&e.pageSize?.width==t.pageSize?.width&&e.pageSize?.height==t.pageSize?.height)}splitBySection(e,t){let p={sectProps:null,elements:[],pageBreak:!1,columnBreak:!1},c=[p];const s=(u=!1,o=!1)=>{if(p.elements.length==0&&p.sectProps==null)return p.pageBreak||(p.pageBreak=u),void(p.columnBreak||(p.columnBreak=o));p.pageBreak||(p.pageBreak=u),p.columnBreak||(p.columnBreak=o),p={sectProps:null,elements:[],pageBreak:!1,columnBreak:!1},c.push(p)};for(let u of e){if(u.type!=f.DomType.Paragraph){if(u.type==f.DomType.Table)for(const v of this.splitTableByPageBreaks(u))v.table.children?.length&&p.elements.push(v.table),v.breakAfter&&s(!0);else p.elements.push(u);continue}const o=u,i=this.findStyle(o.styleName),a=o.pageBreakBefore??i?.paragraphProps?.pageBreakBefore;this.options.breakPages&&a&&p.elements.length>0&&s(!0);const b=this.splitParagraphByPageBreaks(o);for(const v of b)p.elements.push(v.paragraph),v.breakAfter&&s(!0);o.sectionProps&&(p.sectProps=o.sectionProps,s((0,E.isSectionPageBreak)(o.sectionProps.type),(0,E.isSectionColumnBreak)(o.sectionProps.type)))}if(c=c.filter(u=>u.elements.length>0),c.length==0)return[{sectProps:t,elements:[],pageBreak:!1,columnBreak:!1}];let l=null;for(let u=c.length-1;u>=0;u--)c[u].sectProps==null?c[u].sectProps=l??t:l=c[u].sectProps;return c}hasPageBreakElement(e){return!!this.isPageBreakElement(e)||(e.children?.some(t=>this.hasPageBreakElement(t))??!1)}splitTableByPageBreaks(e){if(!this.options.breakPages||!e.children?.length)return[{table:e,breakAfter:!1}];if(!e.children.some(u=>this.hasPageBreakElement(u)))return[{table:e,breakAfter:!1}];const t=e.children,p=[];for(const u of t){if(!u.isHeader)break;p.push(u)}const c=[];let s=[];const l=u=>{if(s.length==0&&c.length>0)return;const o=c.length>0;let i=s;o&&p.length>0&&!s.some(a=>a.isHeader)&&(i=[...p,...s]),c.push({table:{...e,children:i},breakAfter:u}),s=[]};for(const u of t)s.push(u),this.hasPageBreakElement(u)&&l(!0);return l(!1),c.length>0?c:[{table:e,breakAfter:!1}]}splitElementByPageBreaks(e){if(this.isPageBreakElement(e))return[{breakAfter:!0}];if(!e.children?.length)return[{element:e}];const t=[];let p={...e,children:[]};const c=()=>{p.children.length>0&&t.push({element:p}),p={...e,children:[]}};for(const s of e.children)for(const l of this.splitElementByPageBreaks(s))l.element&&p.children.push(l.element),l.breakAfter&&(c(),t.push({breakAfter:!0}));return c(),t.length>0?t:[{element:e}]}splitParagraphByPageBreaks(e){if(!this.options.breakPages||!e.children?.length)return[{paragraph:e,breakAfter:!1}];const t=[];let p={...e,children:[]};const c=l=>{(p.children.length>0||t.length==0)&&t.push({paragraph:p,breakAfter:l}),p={...e,sectionProps:null,children:[]}};for(const l of e.children)for(const u of this.splitElementByPageBreaks(l))u.element&&p.children.push(u.element),u.breakAfter&&c(!0);(p.children.length>0||t.length==0)&&t.push({paragraph:p,breakAfter:!1});const s=t[t.length-1]?.paragraph;for(const l of t)l.paragraph!=s&&(l.paragraph.sectionProps=null);return t}styleValuesForTarget(e,t){return e?.styles?.find(p=>p.target==t)?.values}styleValue(e,t,p){return this.styleValuesForTarget(e,t)?.[p]}effectiveParagraphCssValue(e,t,p){return e.cssStyle?.[p]??this.styleValue(t,"p",p)}isInsideTableCell(e){for(let t=e.parent;t;t=t.parent)if(t.type==f.DomType.Cell)return!0;return!1}paragraphUsesDocumentGrid(e,t){if(!this.currentSectionProps?.docGrid?.linePitch||this.isInsideTableCell(e)&&!this.document.settingsPart?.settings?.adjustLineHeightInTable)return!1;const p=this.effectiveParagraphCssValue(e,t,"--docx-snap-to-grid");return p==null||!/^(0|false|off)$/i.test(p)}setCssStyle(e,t,p){const c=e.style;typeof c.setProperty=="function"?c.setProperty(t,p):c[t]=p}applyDocumentGridLinePitch(e,t,p){if(!this.paragraphUsesDocumentGrid(e,t)||this.effectiveParagraphCssValue(e,t,"line-height"))return;const c=this.currentSectionProps.docGrid.linePitch,s=this.effectiveParagraphCssValue(e,t,"min-height");if(!s)return void this.setCssStyle(p,"min-height",c);const l=this.parseCssLengthValue(s),u=this.parseCssLengthValue(c);l!=null&&u!=null?l<u&&this.setCssStyle(p,"min-height",c):this.setCssStyle(p,"min-height",`max(${s}, ${c})`)}groupByPageBreaks(e){let t=[],p=null;const c=[t];for(let s of e)p&&(p.pageBreak||this.isPageBreakSection(p.sectProps,s.sectProps))&&(t=[],c.push(t)),t.push(s),p=s;return c.filter(s=>s.length>0)}async yieldDuringRender(e,t){const p=this.options.renderPageBatchSize??0;this.options.progress&&this.options.progress({phase:"render",current:e,total:t,message:`Rendered ${e}/${t} logical pages`}),p>0&&e%p==0&&await this.yieldToBrowser()}async yieldToBrowser(){(this.options.renderYieldEveryMs??0)<=0||await new Promise(e=>{const t=globalThis;typeof t.requestIdleCallback=="function"?t.requestIdleCallback(()=>e(),{timeout:Math.max(1,this.options.renderYieldEveryMs??16)}):typeof t.requestAnimationFrame=="function"?t.requestAnimationFrame(()=>e()):setTimeout(e,0)})}renderWrapper(e){return this.h({tagName:"div",className:this.className+"-wrapper",children:e})}shouldRunDynamicPagination(){return!(!this.options.breakPages||!this.options.fixedPageHeight||this.options.ignoreHeight||typeof document>"u"||typeof requestAnimationFrame!="function")}scheduleDynamicPagination(e){if(!e||e.dataset.docxPaginated=="true"||e.dataset.docxPaginating=="true"||e.dataset.docxPaginationScheduled=="true")return;e.dataset.docxPaginationScheduled="true";const t=()=>{(document.fonts?.ready??Promise.resolve()).finally(()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>this.performDynamicPagination(e)))})},p=()=>{e&&e.dataset.docxPaginated!="true"&&e.dataset.docxPaginating!="true"&&(e.isConnected?t():setTimeout(p,0))};p()}async performDynamicPagination(e){if(!e||e.dataset.docxPaginated=="true"||e.dataset.docxPaginating=="true")return;if(!e.isConnected)return void setTimeout(()=>this.performDynamicPagination(e),0);delete e.dataset.docxPaginationScheduled,e.dataset.docxPaginating="true";const t=Array.from(e.querySelectorAll(":scope > section."+this.className)),p=this.options.maxDynamicPaginationPasses??1e3;let c=0;for(let s=0;s<t.length;s++){const l=t[s];let u=l.querySelector(":scope > article");for(s%2==0&&await this.yieldToBrowser();u&&this.isPageOverflowing(l)&&u.children.length>0&&c++<p;){const o=this.createContinuationPage(l),i=o.querySelector(":scope > article");let a=!1,b=0;for(;this.isPageOverflowing(l)&&u.lastElementChild&&b++<500;)if(b%20==0&&await this.yieldToBrowser(),u.children.length>1){let v=this.pickPaginationChunk(u);if(v.length==0)break;if(v.length>=u.children.length){if(this.splitOverflowBlock(u.lastElementChild,l,i)){a=!0;continue}v=[u.lastElementChild]}for(let _=v.length-1;_>=0;_--)i.prepend(v[_]),a=!0}else{if(!this.splitOverflowBlock(u.lastElementChild,l,i))break;a=!0}if(!a||i.children.length==0){o.remove();break}t.splice(s+1,0,o)}}this.cleanupEmptyNumberedParagraphs(e),this.removeEmptyDynamicPages(e),this.updateDynamicFieldPages(e),delete e.dataset.docxPaginating,e.dataset.docxPaginated="true"}pickPaginationChunk(e){const t=Array.from(e.children);if(t.length==0)return[];let p=t.length-1;for(;p>0&&this.isKeepWithNext(t[p-1]);)p--;return t.slice(p)}isKeepWithNext(e){if(e.dataset.docxKeepNext=="true")return!0;const t=getComputedStyle(e);return t.breakAfter=="avoid"||t.pageBreakAfter=="avoid"}isPageOverflowing(e){const t=this.options.paginationTolerance??2,p=e.clientHeight;if(p<=0)return!1;if(e.scrollHeight>p+t)return!0;const c=e.getBoundingClientRect();let s=c.top;for(const l of Array.from(e.children)){const u=l.getBoundingClientRect();if(s=Math.max(s,u.bottom),l.tagName.toLowerCase()=="article")for(const o of Array.from(l.children)){const i=o.getBoundingClientRect();s=Math.max(s,i.bottom)}}return s>c.bottom+t}createContinuationPage(e){const t=e.cloneNode(!0);t.dataset.docxDynamicPage="true",t.removeAttribute("id");for(const p of Array.from(t.querySelectorAll(":scope > article")))p.textContent="";return e.after(t),t}splitOverflowBlock(e,t,p){if(!e||e.dataset.docxKeepLines=="true")return!1;const c=getComputedStyle(e);if(c.breakInside=="avoid"||c.pageBreakInside=="avoid")return!1;switch(e.tagName.toLowerCase()){case"p":return this.splitParagraphBlock(e,t,p);case"table":return this.splitTableBlock(e,t,p)}return!1}splitParagraphBlock(e,t,p){if(!e.hasChildNodes())return!1;const c=this.cloneBlockShell(e);c.dataset.docxContinued="true",p.prepend(c);let s=!1,l=0;for(;this.isPageOverflowing(t)&&e.hasChildNodes()&&l++<1e3&&this.moveTailInlineNode(e,c,t);)s=!0,this.removeEmptyInlineContainers(e);return s?(e.hasChildNodes()?this.options.strictWordCompatibility&&e.dataset.docxWidowControl=="true"&&this.rebalanceWidowOrphan(e,c,t):e.remove(),!0):(c.remove(),!1)}splitTableBlock(e,t,p){const c=this.tableContentRows(e);if(c.length<=1)return!1;const s=this.cloneBlockShell(e);s.dataset.docxContinued="true";for(const o of Array.from(e.children))o.tagName?.toLowerCase()=="colgroup"&&s.appendChild(o.cloneNode(!0));for(const o of c.filter(i=>i.dataset.docxRepeatHeader=="true")){const i=o.cloneNode(!0);i.dataset.docxRepeatedHeader="true",s.appendChild(i)}p.prepend(s);let l=!1,u=0;for(;this.isPageOverflowing(t)&&this.tableContentRows(e).length>1&&u++<500;){const o=this.tableContentRows(e).filter(a=>a.dataset.docxRepeatedHeader!="true"),i=o[o.length-1];if(!i)break;s.insertBefore(i,this.firstMovedTableRow(s)),l=!0}return!!l||(s.remove(),!1)}cloneBlockShell(e){const t=e.cloneNode(!1);return t.removeAttribute("id"),t}tableContentRows(e){return Array.from(e.querySelectorAll(":scope > tr, :scope > tbody > tr"))}firstMovedTableRow(e){return this.tableContentRows(e).find(t=>t.dataset.docxRepeatedHeader!="true")??null}moveTailInlineNode(e,t,p){const c=e.lastChild;if(!c)return!1;if(c.nodeType==Node.TEXT_NODE)return this.moveTextTail(c,t,p);if(c instanceof Element&&c.childNodes.length>0&&c.tagName?.toLowerCase()!="br"){const s=c.cloneNode(!1);s.removeAttribute("id"),t.prepend(s);const l=this.moveTailInlineNode(c,s,p);return c.hasChildNodes()||c.remove(),s.hasChildNodes()||s.remove(),l}return t.prepend(c),!0}moveTextTail(e,t,p){const c=e.data??"";if(!c)return!1;const s=document.createTextNode("");if(t.prepend(s),c.length==1)return s.data=c,e.remove(),!0;let l=1,u=c.length,o=c.length;for(;l<=u;){const i=Math.floor((l+u)/2);e.data=c.substring(0,c.length-i),s.data=c.substring(c.length-i),this.isPageOverflowing(p)?l=i+1:(o=i,u=i-1)}return o=this.adjustSplitToWordBoundary(c,o),e.data=c.substring(0,c.length-o),s.data=c.substring(c.length-o),e.data||e.remove(),!0}adjustSplitToWordBoundary(e,t){if(t<=1||t>=e.length)return t;const p=e.length-t,c=e.lastIndexOf(" ",p);return c>0&&p-c<32?e.length-c-1:t}removeEmptyInlineContainers(e){for(const t of Array.from(e.childNodes))t instanceof HTMLElement&&(this.removeEmptyInlineContainers(t),t.hasChildNodes()||/^(br|img|svg|math)$/i.test(t.tagName)||t.remove())}cleanupEmptyNumberedParagraphs(e){const t=`p[class*="${this.className}-num-"]`;for(const p of Array.from(e.querySelectorAll(t))){if(this.hasVisiblePaginationContent(p)||!p.id&&!p.querySelector("[id], a[name]"))continue;const c=this.findNextVisiblePaginationBlock(e,p);c&&this.moveAnchorsToBlock(p,c),p.remove()}}removeEmptyDynamicPages(e){const t=Array.from(e.querySelectorAll(`:scope > section.${this.className}[data-docx-dynamic-page="true"]`));for(const p of t){const c=p.querySelector(":scope > article");c&&!Array.from(c.children).some(s=>this.hasVisiblePaginationContent(s))&&p.remove()}}findNextVisiblePaginationBlock(e,t){const p=Array.from(e.querySelectorAll("article p, article table, article figure, article img, article svg, article math"));for(let c=p.indexOf(t)+1;c<p.length;c++){const s=p[c];if(this.hasVisiblePaginationContent(s))return s}return null}hasVisiblePaginationContent(e){return(e.textContent??"").replace(/\s+/g,"").length>0||!!e.querySelector("br,img,svg,math,object,canvas,video,table")}moveAnchorsToBlock(e,t){const p=Array.from(e.querySelectorAll("[id], a[name]"));e.id&&!t.id&&(t.id=e.id);for(let c=p.length-1;c>=0;c--){const s=p[c];s.id&&t.querySelector(`#${CSS.escape(s.id)}`)||t.prepend(s)}}rebalanceWidowOrphan(e,t,p){const c=this.visualLineCount(e),s=this.visualLineCount(t);if(c>=2&&s>=2)return;if(c<2&&e.parentElement&&t.hasChildNodes())return t.prepend(...Array.from(e.childNodes)),void e.remove();let l=0;for(;this.visualLineCount(t)<2&&e.hasChildNodes()&&l++<20&&!this.isPageOverflowing(p)&&this.moveTailInlineNode(e,t,p););}visualLineCount(e){try{const t=document.createRange();t.selectNodeContents(e);const p=Array.from(t.getClientRects());t.detach?.();const c=new Set(p.map(s=>Math.round(s.top)));return Math.max(c.size,1)}catch{return 1}}updateDynamicFieldPages(e){const t=Array.from(e.querySelectorAll(":scope > section."+this.className)),p={},c={},s={},l=[],u=[];let o=0,i="";for(const a of t){const b=a.dataset.docxSection??"";c[b]=(c[b]??0)+1}if(t.forEach((a,b)=>{const v=a.dataset.docxSection??"";if(v!=i){const _=a.dataset.docxPageStart!=null?parseInt(a.dataset.docxPageStart,10):null;o=Number.isFinite(_)?_:o+1,s[v]=1,i=v}else o++,s[v]=(s[v]??0)+1;a.dataset.docxPageNumber=`${o}`,a.dataset.docxSectionPageNumber=`${s[v]}`,a.dataset.docxSectionPageCount=`${c[v]??1}`,l[b]=o,u[b]=s[v];for(const _ of Array.from(a.querySelectorAll("[id]")))_.id&&p[_.id]==null&&(p[_.id]=o)}),t.forEach((a,b)=>{const v=a.dataset.docxSection??"";for(const _ of Array.from(a.querySelectorAll("[data-docx-field-instr]"))){const T=this.evaluateDynamicField(_.dataset.docxFieldInstr,l[b]??b+1,t.length,p,c[v]??1,u[b]??1,parseInt(a.dataset.docxSectionNumber??"1",10));T!=null&&(_.textContent=T)}}),this.options.updatePageReferences)for(const a of Array.from(e.querySelectorAll("[data-docx-page-ref]")))a.textContent=`${p[a.dataset.docxPageRef]??1}`}evaluateDynamicField(e,t,p,c,s=p,l=t,u=1){const o=this.tokenizeFieldInstruction((e??"").replace(/\s+/g," ").trim()),i=o[0]?.replace(/^=/,"").toUpperCase();let a=null;switch(i){case"PAGE":a=this.formatFieldNumber(t,this.fieldFormatSwitchToNumFormat(this.fieldSwitch(o,"\\*")??this.currentSectionProps?.pageNumber?.format));break;case"NUMPAGES":a=this.formatFieldNumber(p,this.fieldFormatSwitchToNumFormat(this.fieldSwitch(o,"\\*")??this.currentSectionProps?.pageNumber?.format));break;case"SECTIONPAGES":a=this.formatFieldNumber(s,this.fieldFormatSwitchToNumFormat(this.fieldSwitch(o,"\\*")??this.currentSectionProps?.pageNumber?.format));break;case"SECTION":a=this.formatFieldNumber(u,this.fieldFormatSwitchToNumFormat(this.fieldSwitch(o,"\\*")??"decimal"));break;case"PAGEREF":{if(!this.options.updatePageReferences)return null;const b=this.firstFieldArgument(o);a=b?`${c[b]??1}`:"";break}}return a==null?null:this.applyFieldFormatting(a,e)}renderDefaultStyle(){var e=this.className,t=`
38
38
  .${e}-wrapper { background: gray; padding: 30px; padding-bottom: 0px; display: flex; flex-flow: column; align-items: center; }
39
39
  .${e}-wrapper>section.${e} { background: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); margin-bottom: 30px; }`;this.options.hideWrapperOnPrint&&(t=`@media not print { ${t} }`);var p=`${t}
@@ -82,7 +82,7 @@ section.${e}>footer { z-index: 1; }
82
82
  `),[this.h({tagName:"#comment",children:["docxjs library predefined styles"]}),this.h({tagName:"style",children:[p]})]}async renderNumbering(e){var t="",p=[];const c=new Map,s=new Map(e.map(a=>[`${a.id}:${a.level}`,this.numFormatToCssValue(a.format)])),l=(a,b)=>{const v=c.get(a)??[];v.push(b),c.set(a,v)};for(var u of e){var o=`p.${this.numberingClass(u.id,u.level)}`,i="none";if(u.bullet){let a=`--${this.className}-${u.bullet.src}`.toLowerCase();t+=this.styleToString(`${o}:before`,{content:"' '",display:"inline-block",background:`var(${a})`},u.bullet.style);try{const b=await this.document.loadNumberingImage(u.bullet.src);t+=`${this.rootSelector} { ${a}: url(${b}) }`}catch{this.options.debug&&console.warn(`Can't load numbering image with src ${u.bullet.src}`)}}else if(u.levelText){let a=this.numberingCounter(u.id,u.level);const b=a+" "+(u.start-1),v=this.numberingRestartLevel(u);v!=null&&l(`p.${this.numberingClass(u.id,v)}`,b),p.push(b);const _=this.normalizeNumberingLevelText(u.levelText,u.format,u.rStyle),T=this.numberingMarkerRunStyle(u.rStyle,_.normalized);t+=this.styleToString(`${o}:before`,{content:this.levelTextToContent(_.text,u.suff,u.id,this.numFormatToCssValue(u.format),s),"counter-increment":a,"font-family":"var(--docx-marker-font-family, inherit)","font-size":"var(--docx-marker-font-size, inherit)","font-style":"var(--docx-marker-font-style, inherit)","font-weight":"var(--docx-marker-font-weight, inherit)",...T})}else i=this.numFormatToCssValue(u.format);t+=this.styleToString(o,{display:"list-item","list-style-position":"inside","list-style-type":i,...u.pStyle})}for(const[a,b]of c)t+=this.styleToString(a,{"counter-set":b.join(" ")});return p.length>0&&(t+=this.styleToString(this.rootSelector,{"counter-reset":p.join(" ")})),[this.h({tagName:"#comment",children:["docxjs document numbering styles"]}),this.h({tagName:"style",children:[t]})]}renderStyles(e){var t="";const p=this.styleMap,c=(0,g.keyBy)(e.filter(o=>o.isDefault),o=>o.target);for(const o of e){var s=o.styles;if(o.linked){var l=o.linked&&p[o.linked];l?s=s.concat(l.styles):this.options.debug&&console.warn(`Can't find linked style ${o.linked}`)}for(const i of s){var u=`${o.target??""}.${o.cssName}${i.mod??""}`;o.target!=i.target&&(u+=` ${i.target}`),c[o.target]==o&&(u=`.${this.className} ${o.target}, `+u),t+=this.styleToString(u,i.values)}}return[this.h({tagName:"#comment",children:["docxjs document styles"]}),this.h({tagName:"style",children:[t]})]}renderNotes(e,t,p){var c=e.map(s=>t[s]).filter(s=>s);if(c.length>0){const s=this.currentPart;this.currentPart=p??s;const l=this.renderElements(c);return this.currentPart=s,this.h({tagName:"ol",children:l})}}renderElement(e){switch(e.type){case f.DomType.Paragraph:return this.renderParagraph(e);case f.DomType.BookmarkStart:return this.renderBookmarkStart(e);case f.DomType.BookmarkEnd:return null;case f.DomType.Run:return this.renderRun(e);case f.DomType.Table:return this.renderTable(e);case f.DomType.Row:return this.renderTableRow(e);case f.DomType.Cell:return this.renderTableCell(e);case f.DomType.Hyperlink:return this.renderHyperlink(e);case f.DomType.SmartTag:return this.renderSmartTag(e);case f.DomType.Drawing:return this.renderDrawing(e);case f.DomType.Image:return this.renderImage(e);case f.DomType.Shape:return this.renderShape(e);case f.DomType.Chart:return this.renderChart(e);case f.DomType.SmartArt:return this.renderSmartArt(e);case f.DomType.Ink:return this.renderInk(e);case f.DomType.SimpleField:return this.renderSimpleField(e);case f.DomType.Instruction:case f.DomType.ComplexField:return null;case f.DomType.Text:return this.renderText(e);case f.DomType.DeletedText:return this.renderDeletedText(e);case f.DomType.Tab:return this.renderTab(e);case f.DomType.Symbol:return this.renderSymbol(e);case f.DomType.Break:return this.renderBreak(e);case f.DomType.Footer:return this.renderContainer(e,"footer");case f.DomType.Header:return this.renderContainer(e,"header");case f.DomType.Footnote:case f.DomType.Endnote:return this.renderContainer(e,"li");case f.DomType.FootnoteReference:return this.renderFootnoteReference(e);case f.DomType.EndnoteReference:return this.renderEndnoteReference(e);case f.DomType.NoBreakHyphen:return this.h("‑");case f.DomType.SoftHyphen:return this.h("­");case f.DomType.PositionalTab:return this.renderTab(e);case f.DomType.Ruby:return this.renderRuby(e);case f.DomType.RubyBase:return this.renderContainer(e,"span");case f.DomType.RubyText:return this.toHTML(e,h.ns.html,"rt");case f.DomType.VmlPicture:return this.renderVmlPicture(e);case f.DomType.VmlElement:return this.renderVmlElement(e);case f.DomType.MmlMath:return this.renderContainerNS(e,h.ns.mathML,"math",{xmlns:h.ns.mathML});case f.DomType.MmlMathParagraph:return this.renderMmlMathParagraph(e);case f.DomType.MmlFraction:return this.renderContainerNS(e,h.ns.mathML,"mfrac");case f.DomType.MmlBase:return this.renderContainerNS(e,h.ns.mathML,e.parent?.type==f.DomType.MmlMatrixRow?"mtd":"mrow");case f.DomType.MmlNumerator:case f.DomType.MmlDenominator:case f.DomType.MmlFunction:case f.DomType.MmlLimit:case f.DomType.MmlBox:return this.renderContainerNS(e,h.ns.mathML,"mrow");case f.DomType.MmlGroupChar:return this.renderMmlGroupChar(e);case f.DomType.MmlLimitLower:return this.renderContainerNS(e,h.ns.mathML,"munder");case f.DomType.MmlLimitUpper:return this.renderContainerNS(e,h.ns.mathML,"mover");case f.DomType.MmlSubSuperscript:return this.renderContainerNS(e,h.ns.mathML,"msubsup");case f.DomType.MmlPhantom:return this.renderMmlPhantom(e);case f.DomType.MmlBorderBox:return this.renderContainerNS(e,h.ns.mathML,"menclose");case f.DomType.MmlAccent:return this.renderMmlAccent(e);case f.DomType.MmlMatrix:return this.renderContainerNS(e,h.ns.mathML,"mtable");case f.DomType.MmlMatrixRow:return this.renderContainerNS(e,h.ns.mathML,"mtr");case f.DomType.MmlRadical:return this.renderMmlRadical(e);case f.DomType.MmlSuperscript:return this.renderContainerNS(e,h.ns.mathML,"msup");case f.DomType.MmlSubscript:return this.renderContainerNS(e,h.ns.mathML,"msub");case f.DomType.MmlDegree:case f.DomType.MmlSuperArgument:case f.DomType.MmlSubArgument:return this.renderContainerNS(e,h.ns.mathML,"mrow");case f.DomType.MmlFunctionName:return this.renderContainerNS(e,h.ns.mathML,"mi");case f.DomType.MmlDelimiter:return this.renderMmlDelimiter(e);case f.DomType.MmlRun:return this.renderMmlRun(e);case f.DomType.MmlNary:return this.renderMmlNary(e);case f.DomType.MmlPreSubSuper:return this.renderMmlPreSubSuper(e);case f.DomType.MmlBar:return this.renderMmlBar(e);case f.DomType.MmlEquationArray:return this.renderMllList(e);case f.DomType.Inserted:return this.renderInserted(e);case f.DomType.Deleted:return this.renderDeleted(e);case f.DomType.CommentRangeStart:return this.renderCommentRangeStart(e);case f.DomType.CommentRangeEnd:return this.renderCommentRangeEnd(e);case f.DomType.CommentReference:return this.renderCommentReference(e);case f.DomType.AltChunk:return this.renderAltChunk(e)}return null}renderElements(e,t){if(e==null)return null;const p=[];for(let c=0;c<e.length;c++){const s=this.tryRenderComplexField(e,c);s?(p.push(...(0,g.asArray)(s.node).filter(l=>l!=null)),c=s.nextIndex-1):p.push(...(0,g.asArray)(this.renderElement(e[c])).filter(l=>l!=null))}return t&&p.forEach(c=>t.appendChild((0,g.isString)(c)?document.createTextNode(c):c)),p}tryRenderComplexField(e,t){if(!this.hasFieldChar(e[t],"begin"))return null;let p=0,c=!1,s="";const l=[];for(let u=t;u<e.length;u++){const o=e[u],i=o.type==f.DomType.Run?{...o,fieldRun:!1,children:[]}:null;if(o.type==f.DomType.Run){for(const a of o.children??[]){if(a.type==f.DomType.ComplexField){const b=a;if(b.charType=="begin")p++;else if(b.charType=="separate"&&p==1)c=!0;else if(b.charType=="end"&&(p--,p==0))return i.children.length>0&&l.push(i),{node:this.renderSimpleField({type:f.DomType.SimpleField,instruction:s,lock:!1,dirty:!1,children:l}),nextIndex:u+1};continue}c||p!=1||a.type!=f.DomType.Instruction?c&&p>0&&i.children.push(a):s+=a.text??""}i.children.length>0&&l.push(i)}else c&&p>0&&l.push(o)}return null}hasFieldChar(e,t){return e.type==f.DomType.Run&&e.children?.some(p=>p.type==f.DomType.ComplexField&&p.charType==t)}renderContainer(e,t){return this.h({tagName:t,children:this.renderElements(e.children)})}renderContainerNS(e,t,p,c){return this.h({ns:t,tagName:p,children:this.renderElements(e.children),...c})}effectiveParagraphTabs(e,t){if(!e?.length)return t;if(!t?.length)return e;const p=[...t];for(const c of e){const s=this.parseCssLengthValue(c.position),l=p.findIndex(u=>this.parseCssLengthValue(u.position)==s);l>=0?p[l]=c:p.push(c)}return p.sort((c,s)=>(this.parseCssLengthValue(c.position)??0)-(this.parseCssLengthValue(s.position)??0))}countParagraphTabs(e){let t=0;const p=c=>{c.type!=f.DomType.Tab&&c.type!=f.DomType.PositionalTab||t++;for(const s of c.children??[])p(s)};return p(e),t}isLeaderTabStop(e){return!!e?.leader&&e.leader!="none"&&e.style!="clear"}resolveRenderedTabStop(e,t,p){if(!e?.length)return null;const c=e[Math.min(t,Math.max(e.length-1,0))],s=[...e].reverse().find(o=>this.isLeaderTabStop(o)),l=this.findStyle(this.currentParagraph?.styleName),u=!!s&&!!(this.currentParagraph?.numbering??l?.paragraphProps?.numbering)&&this.isTocParagraphStyle(this.currentParagraph?.styleName,l);return s?p<=1?u?s:c:t>=p-1?s:this.isLeaderTabStop(c)?e.slice(0,Math.min(t+1,e.length)).reverse().find(o=>!this.isLeaderTabStop(o)&&o.style!="clear")??e.find(o=>!this.isLeaderTabStop(o)&&o.style!="clear")??null:c:c}renderParagraph(e){const t=this.findStyle(e.styleName);e.tabs=this.effectiveParagraphTabs(e.tabs,t?.paragraphProps?.tabs);const p=this.currentParagraph,c=this.currentParagraphTabIndex,s=this.currentParagraphTabCount;this.currentParagraph=e,this.currentParagraphTabIndex=0,this.currentParagraphTabCount=this.countParagraphTabs(e);const l=this.renderElements(e.children),u=e.props?.deletedParagraphMark&&!this.options.renderChanges;if(u&&!this.hasRenderedContent(l))return this.currentParagraph=p,this.currentParagraphTabIndex=c,this.currentParagraphTabCount=s,null;if(u)return this.currentParagraph=p,this.currentParagraphTabIndex=c,this.currentParagraphTabCount=s,l;var o=this.toHTML(e,h.ns.html,"p",this.wrapTabLeaderChildren(l,!0));this.currentParagraph=p,this.currentParagraphTabIndex=c,this.currentParagraphTabCount=s;const i=e.numbering??t?.paragraphProps?.numbering;i&&o.classList.add(this.numberingClass(i.id,i.level));const a=t?.paragraphProps;(e.pageBreakBefore??a?.pageBreakBefore)&&(o.style.breakBefore="page",o.dataset.docxPageBreakBefore="true"),(e.keepLines??a?.keepLines)&&(o.style.breakInside="avoid",o.dataset.docxKeepLines="true"),(e.keepNext??a?.keepNext)&&(o.style.breakAfter="avoid",o.dataset.docxKeepNext="true"),(e.widowControl??a?.widowControl)&&(o.style.orphans="2",o.style.widows="2",o.dataset.docxWidowControl="true"),this.applyDocumentGridLinePitch(e,t,o);const b=e.tabs?.find(v=>this.isLeaderTabStop(v));return b&&(o.classList.add(`${this.className}-tab-leader-paragraph`),o.dataset.docxHasTabLeader="true",o.dataset.docxTabLeader=b.leader,o.dataset.docxTabAlign=b.style),this.isTocParagraphStyle(e.styleName,t)&&(o.classList.add(`${this.className}-toc-paragraph`),o.dataset.docxTocEntry="true"),this.hasParagraphRelativeAnchor(e)&&(o.style.position&&o.style.position!="static"||(o.style.position="relative"),o.dataset.docxAnchorContext="paragraph"),e.props?.anchorId&&(o.id=e.props.anchorId,o.setAttribute("id",e.props.anchorId)),o}hasParagraphRelativeAnchor(e){for(const t of e.children??[]){if(t.type==f.DomType.Drawing&&t.cssStyle?.position=="absolute"){const p=t.props?.anchorPosition,c=p?.vertical?.relative,s=p?.horizontal?.relative;if(c=="paragraph"||c=="line"||c=="character"||s=="character")return!0}if(this.hasParagraphRelativeAnchor(t))return!0}return!1}renderHyperlink(e){const t=this.renderElements(e.children),p=this.toH(e,h.ns.html,"a",this.wrapTabLeaderChildren(t));return p.href="",e.id&&(p.href=(this.currentPart??this.document.documentPart)?.rels?.find(c=>c.id==e.id&&c.targetMode==="External")?.target??p.href),!p.href&&e.anchor&&(p.href+=`#${e.anchor}`),this.h(p)}wrapTabLeaderChildren(e,t=!1){if(!e?.length||e.some(o=>this.hasCssClass(o,`${this.className}-tab-leader-title`)))return e;let p=-1;for(let o=e.length-1;o>=0;o--)if(this.isTabLeaderNode(e[o])){p=o;break}if(p<0)return e;const c=e.slice(0,p),s=e[p],l=e.slice(p+1);this.addCssClass(s,`${this.className}-tab-leader-fill`);const u=[this.h({tagName:"span",className:`${this.className}-tab-leader-title`,children:c}),s,this.h({tagName:"span",className:`${this.className}-tab-leader-page`,children:l})];return t?[this.h({tagName:"span",className:`${this.className}-tab-leader-line`,children:u})]:u}isTabLeaderNode(e){const t=this.nodeDatasetValue(e,"docxTabLeader");return this.hasCssClass(e,this.tabStopClass())&&!!t&&t!="none"}nodeDatasetValue(e,t){const p=e,c=p?.dataset?.[t];if(c!=null)return String(c);const s="data-"+t.replace(/[A-Z]/g,l=>"-"+l.toLowerCase());return typeof p?.getAttribute=="function"?p.getAttribute(s):p?.attributes?.[s]}hasCssClass(e,t){const p=e;return!(!p||!t)&&(typeof p.classList?.contains=="function"?p.classList.contains(t):this.nodeClassName(p).split(/\s+/).includes(t))}addCssClass(e,t){const p=e;if(!p||!t||this.hasCssClass(e,t))return;if(typeof p.classList?.add=="function")return void p.classList.add(t);const c=(0,h.cx)(this.nodeClassName(p),t);typeof p.setAttribute=="function"?p.setAttribute("class",c):(p.attributes??(p.attributes={}),p.attributes.class=c)}nodeClassName(e){return typeof e?.className=="string"?e.className:typeof e?.className?.baseVal=="string"?e.className.baseVal:typeof e?.getAttribute=="function"?e.getAttribute("class")??"":e?.attributes?.class??""}renderSmartTag(e){return this.renderContainer(e,"span")}renderCommentRangeStart(e){if(!this.options.renderComments)return null;const t=new Range;this.commentHighlight?.add(t);const p=this.h({tagName:"#comment",children:[`start of comment #${e.id}`]});return this.later(()=>t.setStart(p,0)),this.commentMap[e.id]=t,p}renderCommentRangeEnd(e){if(!this.options.renderComments)return null;const t=this.commentMap[e.id],p=this.h({tagName:"#comment",children:[`end of comment #${e.id}`]});return this.later(()=>t?.setEnd(p,0)),p}renderCommentReference(e){if(!this.options.renderComments)return null;var t=this.document.commentsPart?.commentMap[e.id];if(!t)return null;const p=this.h({tagName:"span",className:`${this.className}-comment-ref`,children:["💬"]}),c=this.h({tagName:"div",className:`${this.className}-comment-popover`,children:[this.h({tagName:"div",className:`${this.className}-comment-author`,children:[t.author]}),this.h({tagName:"div",className:`${this.className}-comment-date`,children:[new Date(t.date).toLocaleString()]}),...this.renderElements(t.children)]});return this.h({tagName:"#fragment",children:[this.h({tagName:"#comment",children:[`comment #${t.id} by ${t.author} on ${t.date}`]}),p,c]})}renderAltChunk(e){if(!this.options.renderAltChunks)return null;var t=this.h({tagName:"iframe",sandbox:"",referrerPolicy:"no-referrer",loading:"lazy"});return this.tasks.push(this.document.loadAltChunk(e.id,this.currentPart).then(p=>{t.srcdoc=p})),t}renderDrawing(e){e.cssStyle?.["shape-outside"]&&(e.className=(0,h.cx)(e.className,`${this.className}-float-wrap`));var t=this.toHTML(e,h.ns.html,"div");return(e.cssStyle?.float||e.cssStyle?.position=="absolute")&&(t.dataset.docxFloat="true"),t.style.display||(t.style.display="inline-block"),t.style.position||(t.style.position="relative"),t.style.textIndent="0px",t}renderImage(e){let t=this.toHTML(e,h.ns.html,"img",[]),p=e.cssStyle?.transform;if(e.alt&&(t.alt=e.alt),e.title&&(t.title=e.title),e.srcRect&&e.srcRect.some(o=>o!=0)){var[c,s,l,u]=e.srcRect;p=`${p??""} scale(${1/(1-c-l)}, ${1/(1-s-u)})`,t.style.clipPath=`inset(${(100*s).toFixed(2)}% ${(100*l).toFixed(2)}% ${(100*u).toFixed(2)}% ${(100*c).toFixed(2)}%)`,t.style.transformOrigin="top left"}return e.rotation&&(p=`rotate(${e.rotation}deg) ${p??""}`),t.style.transform=p?.trim(),this.document&&e.src&&this.tasks.push(this.document.loadDocumentImage(e.src,this.currentPart).then(o=>{t.src=o,o&&t.setAttribute("src",o)})),t}renderShape(e){if(e.props?.dmlSvg)return this.renderDmlSvgShape(e);const t=e.props?.dmlTextBox?[this.renderDmlTextBox(e)]:null,p=this.toHTML(e,h.ns.html,"div",t);return p.style.display||(p.style.display="inline-block"),e.title&&(p.title=e.title),e.alt&&(p.setAttribute("role","img"),p.setAttribute("aria-label",e.alt)),p}renderDmlTextBox(e){return this.h({tagName:"div",className:`${this.className}-shape-textbox`,style:{"box-sizing":"border-box",display:"flex","flex-direction":"column","justify-content":e.props?.textVerticalAlign??"flex-start","align-items":"stretch",width:"100%",height:"100%",overflow:"hidden",...e.props?.textInsets??{}},children:this.renderElements(e.children)})}renderDmlSvgShape(e){const t=this.createSvgElement("svg",{style:e.cssStyle}),p=e.props??{};t.setAttribute("viewBox",p.viewBox??"0 0 1 1"),t.setAttribute("preserveAspectRatio","none"),t.setAttribute("focusable","false"),e.title&&t.appendChild(this.createSvgElement("title",null,[e.title])),e.alt&&(t.setAttribute("role","img"),t.setAttribute("aria-label",e.alt));const c=this.createSvgElement("path");return c.setAttribute("d",p.pathD??""),c.setAttribute("fill",p.fill??"none"),c.setAttribute("stroke",p.stroke??"none"),c.setAttribute("stroke-width",p.strokeWidth??"0"),c.setAttribute("stroke-linejoin","round"),c.setAttribute("stroke-linecap","round"),p.strokeDasharray&&c.setAttribute("stroke-dasharray",p.strokeDasharray),t.appendChild(c),t}renderChart(e){const t=this.toHTML(e,h.ns.html,"div",[]);if(t.className=(0,h.cx)(t.className,`${this.className}-chart`),e.title&&(t.title=e.title),e.alt&&(t.setAttribute("role","img"),t.setAttribute("aria-label",e.alt)),t.appendChild(this.renderGraphicLoading("Chart")),e.id){const p=this.currentPart;this.tasks.push(this.document.loadRelationshipXml(e.id,p).then(c=>{t.textContent="",t.appendChild(c?this.renderChartSvg(c):this.renderGraphicLoading("Chart"))}).catch(()=>{t.textContent="",t.appendChild(this.renderGraphicLoading("Chart"))}))}return t}renderSmartArt(e){const t=this.toHTML(e,h.ns.html,"div",[]);if(t.className=(0,h.cx)(t.className,`${this.className}-smartart`),e.title&&(t.title=e.title),e.alt&&(t.setAttribute("role","img"),t.setAttribute("aria-label",e.alt)),t.appendChild(this.renderGraphicLoading("SmartArt")),e.dataId){const p=this.currentPart;this.tasks.push(this.document.loadRelationshipXml(e.dataId,p).then(c=>{t.textContent="",t.appendChild(c?this.renderSmartArtSvg(c):this.renderGraphicLoading("SmartArt"))}).catch(()=>{t.textContent="",t.appendChild(this.renderGraphicLoading("SmartArt"))}))}return t}renderInk(e){const t=this.toHTML(e,h.ns.html,"div",[]);if(t.className=(0,h.cx)(t.className,`${this.className}-ink`),e.title&&(t.title=e.title),e.alt&&(t.setAttribute("role","img"),t.setAttribute("aria-label",e.alt)),t.appendChild(this.renderGraphicLoading("Ink")),e.id){const p=this.currentPart;this.tasks.push(this.document.loadRelationshipText(e.id,p).then(c=>{if(t.textContent="",c?.trim().startsWith("<"))try{t.appendChild(this.renderInkSvg((0,w.parseXmlString)(c,!0)));return}catch{}return this.document.loadRelationshipBlobUrl(e.id,p).then(s=>{t.textContent="",s?t.appendChild(this.h({tagName:"img",src:s,alt:e.alt??"Ink",style:{width:"100%",height:"100%",objectFit:"contain"}})):t.appendChild(this.renderGraphicLoading("Ink"))})}).catch(()=>{t.textContent="",t.appendChild(this.renderGraphicLoading("Ink"))}))}return t}renderGraphicLoading(e){return this.h({tagName:"span",style:{display:"inline-flex","align-items":"center","justify-content":"center",width:"100%",height:"100%","min-width":"2in","min-height":"1in",border:"1px solid currentColor"},children:[`[${e}]`]})}renderChartSvg(e){const t=e.documentElement,p=this.detectChartType(t),c=this.parseChartSeries(t,p),s=this.createSvgElement("svg",{style:{width:"100%",height:"100%",display:"block"}});s.setAttribute("viewBox","0 0 640 360"),s.setAttribute("preserveAspectRatio","xMidYMid meet");const l=this.extractChartTitle(t);if(l&&s.appendChild(this.svgText(l,320,24,"middle","14px","bold")),c.length==0||c.every(u=>u.values.length==0))return s.appendChild(this.svgText("Chart",320,180,"middle","18px")),s;switch(p){case"pieChart":case"doughnutChart":this.drawPieChart(s,c[0]);break;case"lineChart":case"scatterChart":case"areaChart":this.drawLineChart(s,c,p=="areaChart");break;default:this.drawBarChart(s,c)}return s}detectChartType(e){return["barChart","bar3DChart","lineChart","pieChart","doughnutChart","areaChart","scatterChart","ofPieChart","radarChart"].find(t=>this.firstByLocal(e,t))??"barChart"}parseChartSeries(e,t){const p=this.firstByLocal(e,t)??e;return this.elementsByLocal(p,"ser").map((c,s)=>{const l=this.firstByLocal(c,"tx"),u=this.firstByLocal(c,"cat")??this.firstByLocal(c,"xVal"),o=this.firstByLocal(c,"val")??this.firstByLocal(c,"yVal"),i=this.chartCacheValues(u),a=this.chartCacheValues(o).map(b=>parseFloat(b)).filter(b=>!Number.isNaN(b));return{name:this.chartText(l)||`Series ${s+1}`,categories:i.length>0?i:a.map((b,v)=>`${v+1}`),values:a}})}chartCacheValues(e){return e?this.elementsByLocal(e,"pt").map(t=>({index:parseInt(t.getAttribute("idx")??"0",10),value:this.firstByLocal(t,"v")?.textContent??""})).sort((t,p)=>t.index-p.index).map(t=>t.value):[]}chartText(e){if(!e)return"";const t=this.chartCacheValues(e);return t.length>0?t.join(" "):this.elementsByLocal(e,"t").map(p=>p.textContent).filter(Boolean).join(" ").trim()}extractChartTitle(e){const t=this.firstByLocal(e,"title");return this.chartText(t)}drawBarChart(e,t){const c=t[0]?.categories??[],s=Math.max(1,...t.flatMap(o=>o.values)),l=540/Math.max(c.length,1),u=l/Math.max(t.length+1,2);e.appendChild(this.svgLine(60,300,600,300)),e.appendChild(this.svgLine(60,300,60,70)),t.forEach((o,i)=>{o.values.forEach((a,b)=>{const v=Math.max(0,a/s*230),_=this.createSvgElement("rect");_.setAttribute("x",""+(60+b*l+i*u+.2*u)),_.setAttribute("y",""+(300-v)),_.setAttribute("width",""+.8*u),_.setAttribute("height",`${v}`),_.style.fill=this.chartColor(i),e.appendChild(_)})}),c.slice(0,12).forEach((o,i)=>{e.appendChild(this.svgText(o,60+i*l+l/2,318,"middle","10px"))}),t.forEach((o,i)=>this.drawLegend(e,o.name,i,70+130*i,335))}drawLineChart(e,t,p=!1){const s=Math.max(1,...t.flatMap(o=>o.values)),l=Math.max(...t.map(o=>o.values.length),1),u=540/Math.max(l-1,1);e.appendChild(this.svgLine(60,300,600,300)),e.appendChild(this.svgLine(60,300,60,70)),t.forEach((o,i)=>{const a=o.values.map((v,_)=>[60+_*u,300-v/s*230]),b=this.createSvgElement("path");if(b.setAttribute("d",a.map((v,_)=>`${_==0?"M":"L"}${v[0]},${v[1]}`).join(" ")),b.style.stroke=this.chartColor(i),b.style.strokeWidth="2",b.style.fill="none",e.appendChild(b),p&&a.length>1){const v=this.createSvgElement("path");v.setAttribute("d",`${a.map((_,T)=>`${T==0?"M":"L"}${_[0]},${_[1]}`).join(" ")} L${a[a.length-1][0]},300 L${a[0][0]},300 Z`),v.style.fill=this.chartColor(i),v.style.opacity="0.25",e.appendChild(v)}for(const[v,_]of a){const T=this.createSvgElement("circle");T.setAttribute("cx",`${v}`),T.setAttribute("cy",`${_}`),T.setAttribute("r","3"),T.style.fill=this.chartColor(i),e.appendChild(T)}}),(t[0]?.categories??[]).slice(0,12).forEach((o,i)=>{e.appendChild(this.svgText(o,60+i*u,318,"middle","10px"))}),t.forEach((o,i)=>this.drawLegend(e,o.name,i,70+130*i,335))}drawPieChart(e,t){const p=t.values,c=t.categories,s=p.reduce((u,o)=>u+Math.max(0,o),0)||1;let l=-90;p.forEach((u,o)=>{const i=Math.max(0,u)/s*360,a=this.createSvgElement("path");a.setAttribute("d",this.pieSlicePath(300,180,110,l,l+i)),a.style.fill=this.chartColor(o),e.appendChild(a),this.drawLegend(e,c[o]??`${o+1}`,o,450,90+22*o),l+=i})}pieSlicePath(e,t,p,c,s){const l=this.polar(e,t,p,s),u=this.polar(e,t,p,c),o=s-c<=180?"0":"1";return`M${e},${t} L${l.x},${l.y} A${p},${p} 0 ${o},0 ${u.x},${u.y} Z`}polar(e,t,p,c){const s=(c-90)*Math.PI/180;return{x:e+p*Math.cos(s),y:t+p*Math.sin(s)}}drawLegend(e,t,p,c,s){const l=this.createSvgElement("rect");l.setAttribute("x",`${c}`),l.setAttribute("y",""+(s-10)),l.setAttribute("width","10"),l.setAttribute("height","10"),l.style.fill=this.chartColor(p),e.appendChild(l),e.appendChild(this.svgText(t,c+14,s,"start","10px"))}chartColor(e){return`hsl(${47*e%360}, 65%, 48%)`}renderSmartArtSvg(e){const t=e.documentElement,p=this.elementsByLocal(t,"pt").map(i=>({id:i.getAttribute("modelId"),type:i.getAttribute("type"),text:this.elementsByLocal(i,"t").map(a=>a.textContent).filter(Boolean).join(" ").trim()})).filter(i=>i.id&&i.text&&i.type!="doc"),c=this.elementsByLocal(t,"cxn").map(i=>({src:i.getAttribute("srcId"),dst:i.getAttribute("destId")})).filter(i=>i.src&&i.dst&&p.some(a=>a.id==i.src)&&p.some(a=>a.id==i.dst)),s=this.createSvgElement("svg",{style:{width:"100%",height:"100%",display:"block"}});if(s.setAttribute("viewBox","0 0 640 360"),s.setAttribute("preserveAspectRatio","xMidYMid meet"),p.length==0)return s.appendChild(this.svgText("SmartArt",320,180,"middle","18px")),s;const l=this.layoutDiagramNodes(p,c),u={},o=Math.min(90,260/Math.max(l.length,1));l.forEach((i,a)=>{const b=55+a*o,v=560/Math.max(i.length,1);i.forEach((_,T)=>{u[_.id]={x:40+v*T+Math.max(0,v-140)/2,y:b}})});for(const i of c){const a=u[i.src],b=u[i.dst];a&&b&&s.appendChild(this.svgLine(a.x+70,a.y+44,b.x+70,b.y))}return p.forEach((i,a)=>{const b=u[i.id];if(!b)return;const v=this.createSvgElement("rect");v.setAttribute("x",`${b.x}`),v.setAttribute("y",`${b.y}`),v.setAttribute("width","140"),v.setAttribute("height","44"),v.setAttribute("rx","8"),v.style.fill=this.chartColor(a),v.style.opacity="0.18",v.style.stroke=this.chartColor(a),s.appendChild(v),s.appendChild(this.svgText(i.text,b.x+70,b.y+27,"middle","11px"))}),s}layoutDiagramNodes(e,t){const p=new Map(e.map(o=>[o.id,0]));t.forEach(o=>p.set(o.dst,(p.get(o.dst)??0)+1));let c=e.filter(o=>(p.get(o.id)??0)==0);const s=new Set,l=[];for(c.length==0&&(c=e.slice(0,1));c.length>0;){l.push(c),c.forEach(i=>s.add(i.id));const o=t.filter(i=>c.some(a=>a.id==i.src)).map(i=>i.dst).filter(i=>!s.has(i));c=[...new Set(o)].map(i=>e.find(a=>a.id==i)).filter(Boolean)}const u=e.filter(o=>!s.has(o.id));return u.length>0&&l.push(u),l}renderInkSvg(e){const t=this.createSvgElement("svg",{style:{width:"100%",height:"100%",display:"block"}});t.setAttribute("viewBox","0 0 640 360"),t.setAttribute("preserveAspectRatio","xMidYMid meet");const p=this.elementsByLocal(e.documentElement,"trace").map(_=>this.inkTraceToPoints(_.textContent)),c=this.elementsByLocal(e.documentElement,"path").map(_=>_.getAttribute("d")).filter(Boolean);if(p.length==0&&c.length==0)return t.appendChild(this.svgText("Ink",320,180,"middle","18px")),t;const s=p.flat(),l=Math.min(...s.map(_=>_[0]),0),u=Math.min(...s.map(_=>_[1]),0),o=Math.max(...s.map(_=>_[0]),640),i=Math.max(...s.map(_=>_[1]),360),a=Math.min(600/Math.max(o-l,1),320/Math.max(i-u,1)),b=20-l*a,v=20-u*a;for(const _ of p){if(_.length<2)continue;const T=this.createSvgElement("path");T.setAttribute("d",_.map((k,M)=>`${M==0?"M":"L"}${k[0]*a+b},${k[1]*a+v}`).join(" ")),T.style.fill="none",T.style.stroke="currentColor",T.style.strokeWidth="2",T.style.strokeLinecap="round",T.style.strokeLinejoin="round",t.appendChild(T)}for(const _ of c){const T=this.createSvgElement("path");T.setAttribute("d",_),T.style.fill="none",T.style.stroke="currentColor",T.style.strokeWidth="2",t.appendChild(T)}return t}inkTraceToPoints(e){const t=(e??"").match(/-?\d+(?:\.\d+)?/g)?.map(Number)??[],p=[];for(let c=0;c+1<t.length;c+=2)p.push([t[c],t[c+1]]);return p}svgLine(e,t,p,c){const s=this.createSvgElement("line");return s.setAttribute("x1",`${e}`),s.setAttribute("y1",`${t}`),s.setAttribute("x2",`${p}`),s.setAttribute("y2",`${c}`),s.style.stroke="currentColor",s.style.strokeWidth="1",s}svgText(e,t,p,c="start",s="12px",l=null){const u=this.createSvgElement("text");return u.setAttribute("x",`${t}`),u.setAttribute("y",`${p}`),u.setAttribute("text-anchor",c),u.style.fill="currentColor",u.style.fontSize=s,l&&(u.style.fontWeight=l),u.appendChild(document.createTextNode(e)),u}elementsByLocal(e,t){const p=e.documentElement??e;return Array.from(p.getElementsByTagName("*")).filter(c=>c.localName==t)}firstByLocal(e,t){return this.elementsByLocal(e,t)[0]??null}renderSimpleField(e){const t=this.evaluateFieldNode(e);return t===void 0?this.renderElements(e.children??[]):t==null?null:(0,g.isString)(t)?this.renderFieldText(t,e.instruction):t}renderFieldText(e,t){const p=this.h({tagName:"span",className:`${this.className}-field`,children:[e]});return t&&(p.dataset.docxFieldInstr=t),p}evaluateFieldNode(e){const t=(e.instruction??"").replace(/\s+/g," ").trim();if(!t)return;if(t.startsWith("=")){const s=this.evaluateFormula(t.substring(1));return s==null?void 0:this.applyFieldFormatting(`${s}`,t)}const p=this.tokenizeFieldInstruction(t),c=p[0]?.replace(/^=/,"").toUpperCase();if(!this.shouldPreserveStoredFieldResult(c,e))switch(c){case"PAGE":return this.applyFieldFormatting(this.formatFieldNumber(this.currentPageNumber,this.currentSectionProps?.pageNumber?.format),t);case"NUMPAGES":return this.applyFieldFormatting(this.formatFieldNumber(this.totalPages,this.currentSectionProps?.pageNumber?.format),t);case"SECTIONPAGES":return this.applyFieldFormatting(this.formatFieldNumber(this.sectionPageCount,this.currentSectionProps?.pageNumber?.format),t);case"SECTION":return this.applyFieldFormatting(this.formatFieldNumber(this.currentSectionNumber,"decimal"),t);case"DATE":case"TIME":case"CREATEDATE":case"SAVEDATE":case"PRINTDATE":return this.applyFieldFormatting(this.evaluateDateField(p,c),t);case"AUTHOR":return this.applyFieldFormatting(this.document.corePropsPart?.props?.creator??"",t);case"TITLE":return this.applyFieldFormatting(this.document.corePropsPart?.props?.title??"",t);case"SUBJECT":return this.applyFieldFormatting(this.document.corePropsPart?.props?.subject??"",t);case"KEYWORDS":return this.applyFieldFormatting(this.document.corePropsPart?.props?.keywords??"",t);case"NUMWORDS":return this.applyFieldFormatting(`${this.document.extendedPropsPart?.props?.words??""}`,t);case"NUMCHARS":return this.applyFieldFormatting(`${this.document.extendedPropsPart?.props?.characters??""}`,t);case"FILENAME":return this.applyFieldFormatting(this.document.documentPart?.path?.split("/").pop()??"",t);case"DOCPROPERTY":return this.applyFieldFormatting(this.evaluateDocPropertyField(p),t);case"DOCVARIABLE":return this.applyFieldFormatting(this.evaluateDocVariableField(p),t);case"MERGEFIELD":return;case"SET":return this.evaluateSetField(p),null;case"QUOTE":return this.applyFieldFormatting(p.slice(1).map(s=>this.resolveFieldValue(s)).join(""),t);case"HYPERLINK":return this.renderHyperlinkField(p,e);case"IF":return this.applyFieldFormatting(this.evaluateIfField(p),t);case"REF":case"STYLEREF":case"NOTEREF":return this.applyFieldFormatting(this.evaluateRefField(p),t);case"PAGEREF":return this.applyFieldFormatting(this.evaluatePageRefField(p),t);case"SEQ":return this.applyFieldFormatting(this.evaluateSeqField(p),t);case"LISTNUM":return this.applyFieldFormatting(this.evaluateListNumField(p),t);case"TC":case"XE":return null;case"TOC":return this.renderTocField(p);case"SYMBOL":return this.evaluateSymbolField(p)}}shouldPreserveStoredFieldResult(e,t){if(!this.options.preserveComplexFieldResults||!t.children?.length)return!1;switch(e){case"PAGE":case"NUMPAGES":case"SECTIONPAGES":case"SECTION":return!1;case"PAGEREF":return!this.options.updatePageReferences;case"TOC":case"REF":case"STYLEREF":case"NOTEREF":case"SEQ":case"LISTNUM":case"IF":case"DOCVARIABLE":case"MERGEFIELD":return!0}return!1}tokenizeFieldInstruction(e){const t=[];let p="",c=null,s=!1;for(const l of e)s?(p+=l,s=!1):l!="\\"?l!='"'&&l!="'"?!/\s/.test(l)||c?p+=l:p&&(t.push(p),p=""):c==l?(c=null,t.push(p),p=""):c?p+=l:(p.trim()&&t.push(p.trim()),p="",c=l):c?s=!0:(p&&(t.push(p),p=""),p="\\");return p&&t.push(p),t}fieldSwitch(e,t){const p=t.toLowerCase(),c=e.findIndex(s=>s.toLowerCase()==p);return c>=0?e[c+1]:null}hasFieldSwitch(e,t){const p=t.toLowerCase();return e.some(c=>c.toLowerCase()==p)}firstFieldArgument(e,t=1){for(let p=t;p<e.length;p++){if(!e[p]?.startsWith("\\"))return e[p];p++}return null}evaluateDateField(e,t){const p=this.fieldSwitch(e,"\\@"),c=new Date;return p?this.formatFieldDate(c,p):t=="TIME"?c.toLocaleTimeString():c.toLocaleDateString()}formatFieldDate(e,t){const p=(a,b=2)=>`${a}`.padStart(b,"0"),c=["January","February","March","April","May","June","July","August","September","October","November","December"],s=c.map(a=>a.substring(0,3)),l=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],u=l.map(a=>a.substring(0,3)),o=[[/yyyy/g,`${e.getFullYear()}`],[/yy/g,p(e.getFullYear()%100)],[/MMMM/g,c[e.getMonth()]],[/MMM/g,s[e.getMonth()]],[/MM/g,p(e.getMonth()+1)],[/M/g,`${e.getMonth()+1}`],[/dddd/g,l[e.getDay()]],[/ddd/g,u[e.getDay()]],[/dd/g,p(e.getDate())],[/d/g,`${e.getDate()}`],[/HH/g,p(e.getHours())],[/H/g,`${e.getHours()}`],[/hh/g,p((e.getHours()+11)%12+1)],[/h/g,""+((e.getHours()+11)%12+1)],[/mm/g,p(e.getMinutes())],[/m/g,`${e.getMinutes()}`],[/ss/g,p(e.getSeconds())],[/s/g,`${e.getSeconds()}`],[/AM\/PM/g,e.getHours()<12?"AM":"PM"],[/am\/pm/g,e.getHours()<12?"am":"pm"]];let i=t;for(const[a,b]of o)i=i.replace(a,b);return i}evaluateDocPropertyField(e){const t=this.firstFieldArgument(e)?.toLowerCase();if(!t)return"";const p={...this.document.corePropsPart?.props??{},...this.document.extendedPropsPart?.props??{}};for(const[c,s]of Object.entries(p))if(c.toLowerCase()==t)return s==null?"":`${s}`;return""}evaluateSetField(e){const t=this.firstFieldArgument(e);if(!t)return;const p=e.slice(e.indexOf(t)+1).filter(c=>!c.startsWith("\\")).map(c=>this.resolveFieldValue(c)).join(" ");this.fieldSetValues[t]=p}evaluateDocVariableField(e){const t=this.firstFieldArgument(e);return t?this.fieldSetValues[t]??"":""}renderHyperlinkField(e,t){const p=this.fieldSwitch(e,"\\l"),c=this.firstFieldArgument(e)??"",s=p?`${c}#${p}`:c,l=this.h({tagName:"a",href:s,children:this.renderElements(t.children??[])});return l.textContent||(l.textContent=s||p),l}evaluateIfField(e){const t=["<>",">=","<=","=",">","<"],p=e.findIndex((k,M)=>M>0&&t.includes(k));if(p<0)return"";const c=this.resolveFieldValue(e.slice(1,p).join(" ")),s=e[p],l=this.resolveFieldValue(e[p+1]??""),u=e[p+2]??"",o=e[p+3]??"",i=parseFloat(c),a=parseFloat(l),b=!Number.isNaN(i)&&!Number.isNaN(a),v=b?i:c,_=b?a:l;let T=!1;switch(s){case"=":T=v==_;break;case"<>":T=v!=_;break;case">":T=v>_;break;case"<":T=v<_;break;case">=":T=v>=_;break;case"<=":T=v<=_}return this.resolveFieldValue(T?u:o)}resolveFieldValue(e){const t=(e??"").trim();if(/^[-+]?\d+(?:\.\d+)?$/.test(t))return t;if(this.bookmarkTextMap.hasOwnProperty(t))return this.bookmarkTextMap[t];if(this.fieldSetValues.hasOwnProperty(t))return this.fieldSetValues[t];if(t.startsWith("=")){const c=this.evaluateFormula(t.substring(1));return c==null?"":`${c}`}const p=this.tokenizeFieldInstruction(t)[0]?.toUpperCase();if(["PAGE","NUMPAGES","SECTIONPAGES","SECTION","DATE","TIME","AUTHOR","TITLE","SUBJECT","KEYWORDS","REF","PAGEREF","SEQ","DOCPROPERTY"].includes(p)){const c=this.evaluateFieldNode({type:f.DomType.SimpleField,instruction:t,lock:!1,dirty:!1,children:[]});if((0,g.isString)(c))return c}return t}evaluateRefField(e){const t=this.firstFieldArgument(e);return t?this.bookmarkTextMap[t]??this.fieldSetValues[t]??"":""}evaluatePageRefField(e){const t=this.firstFieldArgument(e);return t?`${this.bookmarkTextMap[t]!=null?Math.max(this.currentPageNumber,1):1}`:""}evaluateSeqField(e){const t=this.firstFieldArgument(e);if(!t||this.hasFieldSwitch(e,"\\h"))return"";const p=this.fieldSwitch(e,"\\r"),c=this.hasFieldSwitch(e,"\\c");p!=null?this.fieldSeqCounters[t]=parseInt(p,10)||0:c||(this.fieldSeqCounters[t]=(this.fieldSeqCounters[t]??0)+1);const s=this.fieldSwitch(e,"\\*")??"decimal";return this.formatFieldNumber(this.fieldSeqCounters[t]??0,this.fieldFormatSwitchToNumFormat(s))}evaluateListNumField(e){const t=this.firstFieldArgument(e)??"LISTNUM";this.fieldSeqCounters[t]=(this.fieldSeqCounters[t]??0)+1;const p=this.fieldSwitch(e,"*")??"decimal";return this.formatFieldNumber(this.fieldSeqCounters[t],this.fieldFormatSwitchToNumFormat(p))}renderTocField(e){let t=1,p=9;const c=this.fieldSwitch(e,"\\o");if(c){const l=/(\d+)\s*-\s*(\d+)/.exec(c);l&&(t=parseInt(l[1],10),p=parseInt(l[2],10))}const s=this.tocEntries.filter(l=>l.level>=t&&l.level<=p).map(l=>{const u=this.h({tagName:"span",className:`${this.className}-toc-page`,children:["1"]});return u.dataset.docxPageRef=l.id,this.h({tagName:"div",className:`${this.className}-toc-entry ${this.className}-toc-level-${l.level}`,children:[this.h({tagName:"a",className:`${this.className}-toc-title`,href:`#${l.id}`,children:[l.text]}),u]})});return this.h({tagName:"div",className:`${this.className}-toc`,children:s})}evaluateSymbolField(e){const t=parseInt(e[1],10);return Number.isFinite(t)?String.fromCharCode(t):""}evaluateFormula(e){const t=e.replace(/,/g,"").trim();if(!/^[0-9+\-*/().\s]+$/.test(t))return null;try{const p=Function(`"use strict"; return (${t});`)();return Number.isFinite(p)?p:null}catch{return null}}applyFieldFormatting(e,t){const p=this.tokenizeFieldInstruction(t);let c=e??"";const s=this.fieldSwitch(p,"\\*"),l=s?.toUpperCase(),u=this.fieldSwitch(p,"\\#");if(u){const o=parseFloat(c);Number.isNaN(o)||(c=this.formatNumberPicture(o,u))}switch(l){case"UPPER":c=c.toUpperCase();break;case"LOWER":c=c.toLowerCase();break;case"FIRSTCAP":c=c.substring(0,1).toUpperCase()+c.substring(1).toLowerCase();break;case"CAPS":c=c.replace(/\b\w/g,o=>o.toUpperCase());break;case"ROMAN":{const o=parseInt(c,10);Number.isNaN(o)||(c=s=="roman"?this.toRoman(o).toLowerCase():this.toRoman(o).toUpperCase());break}case"ALPHABETIC":{const o=parseInt(c,10);Number.isNaN(o)||(c=s=="alphabetic"?this.toLetters(o).toLowerCase():this.toLetters(o).toUpperCase());break}}return c}formatNumberPicture(e,t){const p=t.indexOf("."),c=p>=0?t.length-p-1:0;let s=e.toFixed(c);if(t.includes(",")){const[l,u]=s.split(".");s=l.replace(/\B(?=(\d{3})+(?!\d))/g,",")+(u!=null?`.${u}`:"")}return s}fieldFormatSwitchToNumFormat(e){if(e=="roman")return"lowerRoman";if(e=="alphabetic")return"lowerLetter";switch(e?.toUpperCase()){case"ROMAN":return"upperRoman";case"ALPHABETIC":return"upperLetter";default:return"decimal"}}formatFieldNumber(e,t){switch(t){case"upperRoman":return this.toRoman(e).toUpperCase();case"lowerRoman":return this.toRoman(e).toLowerCase();case"upperLetter":return this.toLetters(e).toUpperCase();case"lowerLetter":return this.toLetters(e).toLowerCase();case"decimalZero":return e<10?`0${e}`:`${e}`;default:return`${e}`}}toRoman(e){const t=[[1e3,"M"],[900,"CM"],[500,"D"],[400,"CD"],[100,"C"],[90,"XC"],[50,"L"],[40,"XL"],[10,"X"],[9,"IX"],[5,"V"],[4,"IV"],[1,"I"]];let p=Math.max(Math.floor(e),0),c="";for(const[s,l]of t)for(;p>=s;)c+=l,p-=s;return c||`${e}`}toLetters(e){let t=Math.max(Math.floor(e),1),p="";for(;t>0;)t--,p=String.fromCharCode(65+t%26)+p,t=Math.floor(t/26);return p}renderRuby(e){const t=e.children?.find(l=>l.type==f.DomType.RubyBase),p=e.children?.find(l=>l.type==f.DomType.RubyText),c=[...t?this.renderElements(t.children):[],...p?(0,g.asArray)(this.renderElement(p)).filter(l=>l!=null):[]],s=this.h({tagName:"ruby",children:c});return e.align&&(s.style.rubyAlign=e.align),s}hasRenderedContent(e){for(const t of e??[]){if(!t)continue;const p=t,c=p.nodeType,s=String(p.localName??p.tagName??p.nodeName??"").toLowerCase();if(c==3||s=="#text"){if((p.textContent??p.text??p.data??"").length)return!0;continue}if(["br","img","svg","math","table"].includes(s)||(p.textContent??"").length)return!0;const l=Array.from(p.childNodes??p.children??[]);if(l.length&&this.hasRenderedContent(l))return!0}return!1}renderText(e){return this.h(this.applyCjkLineBreakGuards(e.text))}applyCjkLineBreakGuards(e){if(!e||!this.document.settingsPart?.settings?.kinsoku)return e;const t=this.document.settingsPart.settings.noLineBreaksBefore??`!),.:;?]}¢°·'"†‡›℃∶、。々〉》」』】〕〗〙〛〜゠ァィゥェォッャュョヮ・ー-?!%,.:;゛゜ヽヾゝゞー`,p=this.document.settingsPart.settings.noLineBreaksAfter??`([{$£¥'"“‘〈《「『【〔〖〘〚`;let c="";for(const s of e)t.includes(s)&&(c+="⁠"),c+=s,p.includes(s)&&(c+="⁠");return c}renderDeletedText(e){return this.options.renderChanges?this.renderText(e):null}renderBreak(e){switch(e.break){case"textWrapping":case"line":return this.h({tagName:"br"});case"column":return this.h({tagName:"span",style:{breakAfter:"column"}});case"page":return this.options.breakPages?null:this.h({tagName:"span",style:{breakAfter:"page"}});case"lastRenderedPageBreak":return this.options.breakPages||this.options.ignoreLastRenderedPageBreak?null:this.h({tagName:"span",style:{breakAfter:"page"}})}return null}renderInserted(e){return this.options.renderChanges?this.renderContainer(e,"ins"):this.renderElements(e.children)}renderDeleted(e){return this.options.renderChanges?this.renderContainer(e,"del"):null}renderSymbol(e){return this.h({tagName:"span",children:[String.fromCharCode(e.char)],style:{fontFamily:e.font}})}renderFootnoteReference(e){return this.currentFootnoteIds.push(e.id),this.h({tagName:"sup",children:[`${this.currentFootnoteIds.length}`]})}renderEndnoteReference(e){return this.currentEndnoteIds.push(e.id),this.h({tagName:"sup",children:[`${this.currentEndnoteIds.length}`]})}renderTab(e){const t=(this.currentParagraph??(function(u,o){for(var i=u.parent;i!=null&&i.type!=o;)i=i.parent;return i})(e,f.DomType.Paragraph))?.tabs??[],p=t.filter(u=>u?.style!="clear"),c=this.currentParagraphTabIndex++,s=this.resolveRenderedTabStop(p,c,this.currentParagraphTabCount);var l=this.h({tagName:"span",className:this.tabStopClass(),children:[" "]});return l.dataset.docxTab="true",s&&(l.dataset.docxTabAlign=s.style??"left",l.dataset.docxTabLeader=s.leader??"none",s.position&&(l.dataset.docxTabPos=s.position)),this.options.experimental&&this.currentTabs.push({stops:t,span:l}),l}renderBookmarkStart(e){const t=this.h({tagName:"span"});return e.name&&(t.id=e.name,t.setAttribute("id",e.name)),t}renderRun(e){const t=e.fieldRun?e.children?.filter(s=>s.type!=f.DomType.Instruction&&s.type!=f.DomType.ComplexField):e.children;if(e.fieldRun&&(!t||t.length==0))return null;let p=this.renderElements(t);if(e.verticalAlign&&(p=[this.h({tagName:e.verticalAlign,children:this.renderElements(t)})]),!e.verticalAlign&&t?.length==1&&(t[0].type==f.DomType.Tab||t[0].type==f.DomType.PositionalTab)&&p?.length==1){const s=p[0];return e.cssStyle&&Object.assign(s.style,e.cssStyle),e.className&&s.classList.add(e.className),s}const c=this.toHTML(e,h.ns.html,"span",p);return e.id&&(c.id=e.id),c}renderTable(e){e.columns?.length&&!e.cssStyle?.["table-layout"]&&(e.cssStyle??(e.cssStyle={}),e.cssStyle["table-layout"]="fixed"),this.tableCellPositions.push(this.currentCellPosition),this.tableVerticalMerges.push(this.currentVerticalMerge),this.currentVerticalMerge={},this.currentCellPosition={col:0,row:0};const t=[];return e.columns&&t.push(this.renderTableColumns(e.columns)),t.push(...this.renderElements(e.children)),this.currentVerticalMerge=this.tableVerticalMerges.pop(),this.currentCellPosition=this.tableCellPositions.pop(),this.toHTML(e,h.ns.html,"table",t)}renderTableColumns(e){const t=e.map(p=>this.h({tagName:"col",style:{width:p.width}}));return this.h({tagName:"colgroup",children:t})}renderTableRow(e){this.currentCellPosition.col=0;const t=[],p=this.currentTableRow;this.currentTableRow=e,e.gridBefore&&t.push(this.renderTableCellPlaceholder(e.gridBefore)),t.push(...this.renderElements(e.children)),e.gridAfter&&t.push(this.renderTableCellPlaceholder(e.gridAfter)),this.currentTableRow=p,this.currentCellPosition.row++;const c=this.toHTML(e,h.ns.html,"tr",t);return e.isHeader&&(c.dataset.docxRepeatHeader="true"),c}renderTableCellPlaceholder(e){return this.h({tagName:"td",colSpan:e,style:{border:"none"}})}renderTableCell(e){const t=this.currentTableRow?.isHeader?"th":"td";let p=this.toHTML(e,h.ns.html,t);const c=this.currentCellPosition.col;return e.verticalMerge?e.verticalMerge=="restart"?(this.currentVerticalMerge[c]=p,p.rowSpan=1):this.currentVerticalMerge[c]&&(this.currentVerticalMerge[c].rowSpan+=1,p.style.display="none"):this.currentVerticalMerge[c]=null,e.span&&(p.colSpan=e.span),this.currentCellPosition.col+=p.colSpan,p}renderVmlPicture(e){return this.renderContainer(e,"div")}renderVmlElement(e){var t=this.h({ns:h.ns.svg,tagName:"svg",style:e.cssStyleText});const p=this.renderVmlChildElement(e);e.imageHref?.id&&this.tasks.push(this.document?.loadDocumentImage(e.imageHref.id,this.currentPart).then(s=>p.setAttribute("href",s))),t.appendChild(p);const c=globalThis.requestAnimationFrame;return(typeof c=="function"?c.bind(globalThis):s=>setTimeout(()=>s(Date.now()),0))(()=>{try{const s=t.firstElementChild,l=typeof s?.getBBox=="function"?s.getBBox():null;l&&Number.isFinite(l.width)&&Number.isFinite(l.height)&&l.width>0&&l.height>0&&(t.setAttribute("width",`${Math.ceil(l.x+l.width)}`),t.setAttribute("height",`${Math.ceil(l.y+l.height)}`))}catch{}}),t}renderVmlChildElement(e){const t=this.createSvgElement(e.tagName);Object.entries(e.attrs).forEach(([p,c])=>t.setAttribute(p,c));for(let p of e.children)if(p.type==f.DomType.VmlElement)t.appendChild(this.renderVmlChildElement(p));else for(const c of(0,g.asArray)(this.renderElement(p)).filter(s=>s!=null))t.appendChild((0,g.isString)(c)?document.createTextNode(c):c);return t}renderMmlMathParagraph(e){const t=this.renderElements(e.children);for(const p of t)p?.localName=="math"&&p.setAttribute("display","block");return this.h({tagName:"div",className:`${this.className}-math-paragraph`,style:{textAlign:"center"},children:t})}renderMmlPhantom(e){return this.renderContainerNS(e,h.ns.mathML,"mphantom")}renderMmlAccent(e){const t=e.children?.find(s=>s.type==f.DomType.MmlBase),p=this.createMathMLElement("mo",null,[e.props?.char??"^"]),c=t?(0,g.asArray)(this.renderElement(t)).filter(s=>s!=null):[];return this.createMathMLElement("mover",null,[...c,p])}renderMmlRadical(e){const t=e.children.find(c=>c.type==f.DomType.MmlBase);if(e.props?.hideDegree)return this.createMathMLElement("msqrt",null,this.renderElements([t]));const p=e.children.find(c=>c.type==f.DomType.MmlDegree);return this.createMathMLElement("mroot",null,this.renderElements([t,p]))}renderMmlDelimiter(e){const t=[],p=e.props?.beginChar,c=e.props?.endChar;return p!==""&&t.push(this.createMathMLElement("mo",null,[p??"("])),t.push(...this.renderElements(e.children)),c!==""&&t.push(this.createMathMLElement("mo",null,[c??")"])),this.createMathMLElement("mrow",null,t)}renderMmlNary(e){const t=[],p=(0,g.keyBy)(e.children,i=>i.type),c=p[f.DomType.MmlSuperArgument],s=p[f.DomType.MmlSubArgument],l=c?this.createMathMLElement("mrow",null,this.renderElements(c.children)):null,u=s?this.createMathMLElement("mrow",null,this.renderElements(s.children)):null,o=this.createMathMLElement("mo",null,[e.props?.char??"∫"]);return l&&u?t.push(this.createMathMLElement("munderover",null,[o,u,l])):l?t.push(this.createMathMLElement("mover",null,[o,l])):u?t.push(this.createMathMLElement("munder",null,[o,u])):t.push(o),p[f.DomType.MmlBase]&&t.push(...this.renderElements(p[f.DomType.MmlBase].children)),this.createMathMLElement("mrow",null,t)}renderMmlPreSubSuper(e){const t=[],p=(0,g.keyBy)(e.children,i=>i.type),c=p[f.DomType.MmlSuperArgument],s=p[f.DomType.MmlSubArgument],l=this.createMathMLElement("mrow",null,c?this.renderElements(c.children):[]),u=this.createMathMLElement("mrow",null,s?this.renderElements(s.children):[]),o=this.createMathMLElement("mrow",null,[]);return t.push(this.createMathMLElement("msubsup",null,[o,u,l])),p[f.DomType.MmlBase]&&t.push(...this.renderElements(p[f.DomType.MmlBase].children)),this.createMathMLElement("mrow",null,t)}renderMmlGroupChar(e){const t=e.props?.verticalJustification==="bot"?"munder":"mover",p=this.createMathMLElement("mrow",null,this.renderElements(e.children)),c=this.createMathMLElement("mo",null,[e.props?.char??"⏞"]);return this.createMathMLElement(t,null,[p,c])}renderMmlBar(e){const t={};switch(e.props.position){case"top":t.textDecoration="overline";break;case"bottom":t.textDecoration="underline"}return this.renderContainerNS(e,h.ns.mathML,"mrow",{style:t})}renderMmlRun(e){const t=this.extractMathRunText(e);if(t!=null){const p=this.renderMathTextTokens(t,e.cssStyle);return p.length?p:null}return this.renderContainerNS(e,h.ns.mathML,"mrow")}extractMathRunText(e){let t="";for(const p of e.children??[])switch(p.type){case f.DomType.Text:t+=p.text??"";break;case f.DomType.DeletedText:this.options.renderChanges&&(t+=p.text??"");break;case f.DomType.Symbol:t+=String.fromCharCode(p.char);break;case f.DomType.Tab:t+=" ";break;case f.DomType.NoBreakHyphen:t+="‑";break;case f.DomType.SoftHyphen:break;default:return null}return t}renderMathTextTokens(e,t){const p=[];let c=0;for(;c<e.length;){const s=e[c];if(/\s/.test(s)){let l=c+1;for(;l<e.length&&/\s/.test(e[l]);)l++;p.push(this.createMathMLElement("mspace",{width:.25*Math.max(1,l-c)+"em"})),c=l;continue}if(A(s)){let l=c+1;for(;l<e.length&&(A(e[l])||e[l]==".");)l++;p.push(this.createMathToken("mn",e.substring(c,l),t)),c=l;continue}if(r(s)){let l=c+1;for(;l<e.length&&r(e[l]);)l++;p.push(this.createMathToken("mi",e.substring(c,l),t)),c=l;continue}n(s)?p.push(this.createMathToken("mo",s,t)):p.push(this.createMathToken("mtext",s,t)),c++}return p}createMathToken(e,t,p){return this.createMathMLElement(e,p?{style:p}:null,[t])}renderMllList(e){const t=this.renderElements(e.children).map(p=>this.createMathMLElement("mtr",null,[this.createMathMLElement("mtd",null,[p])]));return this.toHTML(e,h.ns.mathML,"mtable",t)}toH(e,t,p,c=null){const{$lang:s,...l}=e.cssStyle??{};return{ns:t,tagName:p,className:(0,h.cx)(e.className,e.styleName&&this.processStyleName(e.styleName)),lang:s,style:l,children:c??this.renderElements(e.children)}}toHTML(e,t,p,c=null){return this.h(this.toH(e,t,p,c))}findStyle(e){return e&&this.styleMap?.[e]}isTocParagraphStyle(e,t){return[e,t?.id,t?.name,t?.cssName,...t?.aliases??[]].filter(Boolean).map(p=>String(p).replace(/[\s_-]+/g,"").toLowerCase()).some(p=>/^toc[1-9]$/.test(p))}numberingClass(e,t){return`${this.className}-num-${e}-${t}`}tabStopClass(){return`${this.className}-tab-stop`}styleToString(e,t,p=null){let c=`${e} {\r
83
83
  `;for(const s in t)s.startsWith("$")||(c+=` ${s}: ${t[s]};\r
84
84
  `);return p&&(c+=p),c+`}\r
85
- `}numberingCounter(e,t){return`${this.className}-num-${e}-${t}`}numberingRestartLevel(e){if(e.level<=0)return null;if(e.restart==null)return e.level-1;if(e.restart==0)return null;const t=e.restart-1;return t>=0&&t<e.level?t:null}numberingMarkerRunStyle(e,t){if(!e)return e;const p={...e};return t&&delete p["font-family"],p}normalizeNumberingLevelText(e,t,p){if(t!="bullet"||!e)return{text:e,normalized:!1};const c=(p?.["font-family"]??"").toLowerCase();let s=!1,l=null;if(c.includes("wingdings"))l=this.wingdingsBulletMap();else{if(!c.includes("symbol"))return{text:e,normalized:!1};l=this.symbolBulletMap()}let u="";for(const o of e){const i=l[o.charCodeAt(0)];i?(u+=i,s=!0):u+=o}return{text:u,normalized:s}}symbolBulletMap(){return{183:"•",8226:"•",61623:"•"}}wingdingsBulletMap(){return{61548:"●",61550:"■",61557:"◆",61598:"·",61599:"•",61600:"▪",61601:"○",61604:"◉",61605:"◎",61607:"▪",61608:"◻",61656:"➢",61672:"➔",61690:"▫",61691:"✗",61692:"✓",61693:"☒",61694:"☑"}}levelTextToContent(e,t,p,c,s){const l=[];let u=0;for(const a of e.matchAll(/%\d+/g)){a.index>u&&l.push(`"${this.escapeCssString(e.substring(u,a.index))}"`);let b=parseInt(a[0].substring(1),10)-1;const v=s?.get(`${p}:${b}`)??c??"decimal";l.push(`counter(${this.numberingCounter(p,b)}, ${v})`),u=a.index+a[0].length}const o=e.substring(u);o&&l.push(`"${this.escapeCssString(o)}"`);const i=this.numberingSuffixToCssContent(t);return i&&l.push(i),l.length>0?l.join(" "):'""'}numberingSuffixToCssContent(e){switch(e||"tab"){case"nothing":return"";case"space":return'"\\000020"';default:return'"\\000009"'}}escapeCssString(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r?\n/g,"\\A ")}numFormatToCssValue(e){return{none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"}[e]??e??"decimal"}refreshTabStops(){this.options.experimental&&setTimeout(()=>{const e=(0,y.computePixelToPoint)();for(let t of this.currentTabs)(0,y.updateTabStop)(t.span,t.stops,this.defaultTabSize,e)},500)}createElementNS(e,t,p,c){return this.h({ns:e,tagName:t,children:c,...p})}createElement(e,t,p){return this.createElementNS(h.ns.html,e,t,p)}createMathMLElement(e,t,p){return this.createElementNS(h.ns.mathML,e,t,p)}createSvgElement(e,t,p){return this.createElementNS(h.ns.svg,e,t,p)}later(e){this.postRenderTasks.push(e)}}},"./html":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.ns=void 0,d.h=function y(E){if((0,f.isString)(E))return document.createTextNode(E);if(E instanceof Node)return E;const{ns:h,tagName:w,className:A,style:r,children:n,...e}=E;if(w==="#fragment")return document.createDocumentFragment();if(w==="#comment")return document.createComment(n[0]);const t=h?document.createElementNS(h,w):document.createElement(w);if(A&&t.setAttribute("class",A),r&&((0,f.isString)(r)?t.setAttribute("style",r):Object.assign(t.style,r)),e)for(const[p,c]of Object.entries(e))c!==void 0&&(t[p]=c);return n&&n.forEach(p=>t.appendChild(y(p))),t},d.cx=function(...y){return y.filter(Boolean).join(" ")};const f=m("./utils");var g;(function(y){y.html="http://www.w3.org/1999/xhtml",y.svg="http://www.w3.org/2000/svg",y.mathML="http://www.w3.org/1998/Math/MathML"})(g||(d.ns=g={}))},"./input-validation":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.EMPTY_DOCX_ERROR_MESSAGE=void 0,d.assertNonEmptyDocxInput=function(f){if((function(g){return g==null?0:typeof Blob<"u"&&g instanceof Blob?g.size:typeof ArrayBuffer<"u"&&(g instanceof ArrayBuffer||ArrayBuffer.isView(g))?g.byteLength:typeof g.size=="number"?g.size:typeof g.byteLength=="number"?g.byteLength:typeof g.length=="number"?g.length:null})(f)===0)throw new Error(d.EMPTY_DOCX_ERROR_MESSAGE)},d.EMPTY_DOCX_ERROR_MESSAGE="文件为空或尚未保存,无法作为 Word 文档打开。请在 WPS/Word 中保存后重新上传。"},"./javascript":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.computePixelToPoint=function(h=document.body){const w=document.createElement("div");w.style.width="100pt",h.appendChild(w);const A=100/w.offsetWidth;return h.removeChild(w),A},d.updateTabStop=function(h,w,A,r=.75){const n=h.closest("p");if(!n)return;const e=h.getBoundingClientRect(),t=n.getBoundingClientRect(),p=getComputedStyle(n),c=y(p.marginInlineStart||p.marginLeft),s=y(p.marginInlineEnd||p.marginRight),l=w?.length>0?w.map(M=>({pos:E(M.position),leader:M.leader,style:M.style})).sort((M,R)=>M.pos-R.pos):[f],u=l[l.length-1],o=(t.width+c+s)*r,i=Number.isFinite(E(A))?E(A):36;let a=u.pos+i;if(a<o)for(;a<o&&l.length<g;a+=i)l.push({...f,pos:a});const b=t.left-c,v=(e.left-b)*r,_=l.find(M=>M.style!="clear"&&M.pos>v);if(_==null)return;let T=1;if(_.style=="right"||_.style=="center"){const M=Array.from(n.querySelectorAll(`.${h.className}`)),R=M.indexOf(h)+1,O=document.createRange();O.setStart(h,1),R<M.length?O.setEndBefore(M[R]):O.setEndAfter(n);const P=_.style=="center"?.5:1,N=O.getBoundingClientRect(),it=N.left+P*N.width-b;T=_.pos-it*r}else T=_.pos-v;const k=Math.max(Number.isFinite(T)?T:0,0);switch(h.innerHTML="&nbsp;",h.style.display="inline-block",h.style.width=`${k.toFixed(2)}pt`,h.style.minWidth="0pt",h.style.lineHeight="1",h.style.whiteSpace="nowrap",h.style.wordSpacing="normal",h.style.textDecoration="none",h.style.borderBottom="",h.style.height="",h.style.transform="",_.leader){case"dot":case"middleDot":h.style.borderBottom="1px dotted currentColor",h.style.height=".85em",h.style.transform="translateY(-.18em)";break;case"hyphen":case"heavy":case"underscore":h.style.borderBottom="1px solid currentColor",h.style.height=".85em",h.style.transform="translateY(-.18em)"}};const f={pos:0,leader:"none",style:"left"},g=50;function y(h){const w=parseFloat(h);return Number.isFinite(w)?w:0}function E(h){return parseFloat(h)}},"./length":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.Length=void 0;const f=m("./utils");class g{constructor(E,h){this.value=E,this.type=h}static parse(E){const h=parseFloat(E),w=/p[tx]$/i.exec(E)?.[0];return new g(h,w)}static from(E){return(0,f.isString)(E)?g.parse(E):E instanceof g?E:null}add(E){if(E.type!==this.type)throw new Error("Can't do math on different types");return new g(this.value+E.value,this.type)}mul(E){return new g(this.value*E,this.type)}valueOf(){return this.value}toString(){return`${this.value.toFixed(2)}${this.type??""}`}}d.Length=g},"./license-gate":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.assertViewerLicense=function(f,g){}},"./metafile/emf-to-svg":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.isEmfBinary=E,d.convertEmfToSvgDataUrl=function(x,D){const I=h(x,D);return I?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(I)}`:null},d.convertEmfToSvg=h;const f={HEADER:1,POLYBEZIER:2,POLYGON:3,POLYLINE:4,POLYBEZIERTO:5,POLYLINETO:6,POLYPOLYLINE:7,POLYPOLYGON:8,SETWINDOWEXTEX:9,SETWINDOWORGEX:10,SETVIEWPORTEXTEX:11,SETVIEWPORTORGEX:12,EOF:14,SETPIXELV:15,SETMAPMODE:17,SETBKMODE:18,SETPOLYFILLMODE:19,SETTEXTALIGN:22,SETTEXTCOLOR:24,SETBKCOLOR:25,MOVETOEX:27,SCALEVIEWPORTEXTEX:31,SCALEWINDOWEXTEX:32,SAVEDC:33,RESTOREDC:34,SETWORLDTRANSFORM:35,MODIFYWORLDTRANSFORM:36,SELECTOBJECT:37,CREATEPEN:38,CREATEBRUSHINDIRECT:39,DELETEOBJECT:40,ANGLEARC:41,ELLIPSE:42,RECTANGLE:43,ROUNDRECT:44,ARC:45,CHORD:46,PIE:47,LINETO:54,ARCTO:55,POLYDRAW:56,BEGINPATH:59,ENDPATH:60,CLOSEFIGURE:61,FILLPATH:62,STROKEANDFILLPATH:63,STROKEPATH:64,BITBLT:76,STRETCHBLT:77,STRETCHDIBITS:81,EXTCREATEFONTINDIRECTW:82,EXTTEXTOUTA:83,EXTTEXTOUTW:84,POLYBEZIER16:85,POLYGON16:86,POLYLINE16:87,POLYBEZIERTO16:88,POLYLINETO16:89,POLYPOLYLINE16:90,POLYPOLYGON16:91,POLYDRAW16:92,EXTCREATEPEN:95,POLYTEXTOUTA:96,POLYTEXTOUTW:97,SMALLTEXTOUT:108,ALPHABLEND:114,TRANSPARENTBLT:116},g={0:{type:"brush",color:"#ffffff"},1:{type:"brush",color:"#c0c0c0"},2:{type:"brush",color:"#808080"},3:{type:"brush",color:"#404040"},4:{type:"brush",color:"#000000"},5:{type:"brush",color:"none",nullBrush:!0},6:{type:"pen",color:"#ffffff",width:1},7:{type:"pen",color:"#000000",width:1},8:{type:"pen",color:"none",width:0,nullPen:!0},18:{type:"brush",color:"#ffffff"},19:{type:"pen",color:"#000000",width:1}},y={m11:1,m12:0,m21:0,m22:1,dx:0,dy:0};function E(x){if(!x||x.length<48)return!1;const D=e(x);return D.getUint32(0,!0)==f.HEADER&&D.getUint32(40,!0)==1179469088}function h(x,D={}){if(!E(x))return null;const I=e(x),H=I.getUint32(4,!0),L=t(I,8),B=t(I,24),Y=I.byteLength>=52?I.getUint32(48,!0):0,Q=Math.max(1,L.right-L.left),K=Math.max(1,L.bottom-L.top),lt=Math.max(1,B.right-B.left)/100,ft=Math.max(1,B.bottom-B.top)/100,X={world:n(y),windowOrg:{x:0,y:0},windowExt:null,viewportOrg:{x:0,y:0},viewportExt:null,pen:{type:"pen",color:"#000000",width:1},brush:{type:"brush",color:"#ffffff",nullBrush:!0},font:null,textColor:"#000000",bkColor:"#ffffff",bkMode:1,polyFillMode:1,textAlign:0,currentPoint:{x:0,y:0}},mt=[],At={},Et=[];let ct=Math.max(8,H||108),yt=1,Rt="",St=!1,It=0;const Lt=D.maxRecords??Math.max(1e4,Y+100),Ft=D.maxShapes??5e4,_t=Ct=>{!Ct||It>=Ft||(Et.push(Ct),It++)},Mt=Ct=>{Ct&&(Rt+=(Rt?" ":"")+Ct)};for(;ct+8<=I.byteLength&&yt++<=Lt;){const Ct=I.getUint32(ct,!0),Dt=I.getUint32(ct+4,!0);if(Dt<8||ct+Dt>I.byteLength)break;switch(Ct){case f.EOF:ct+=Dt,yt=Lt+1;break;case f.SETWINDOWEXTEX:X.windowExt=c(I,ct+8);break;case f.SETWINDOWORGEX:X.windowOrg=p(I,ct+8);break;case f.SETVIEWPORTEXTEX:X.viewportExt=c(I,ct+8);break;case f.SETVIEWPORTORGEX:X.viewportOrg=p(I,ct+8);break;case f.SCALEWINDOWEXTEX:X.windowExt&&(X.windowExt=a(I,ct,X.windowExt));break;case f.SCALEVIEWPORTEXTEX:X.viewportExt&&(X.viewportExt=a(I,ct,X.viewportExt));break;case f.SETWORLDTRANSFORM:X.world=l(I,ct+8);break;case f.MODIFYWORLDTRANSFORM:{const bt=l(I,ct+8),wt=I.getUint32(ct+32,!0);wt==1?X.world=n(y):wt==2?X.world=u(bt,X.world):wt==3?X.world=u(X.world,bt):wt==4&&(X.world=bt);break}case f.SAVEDC:mt.push(w(X));break;case f.RESTOREDC:{const bt=I.getInt32(ct+8,!0);if(bt<0)for(let wt=0;wt<Math.min(-bt,mt.length);wt++)Object.assign(X,mt.pop());else if(bt>0&&bt<=mt.length){const wt=mt[bt-1];mt.length=bt-1,Object.assign(X,w(wt))}break}case f.SETBKMODE:X.bkMode=I.getUint32(ct+8,!0);break;case f.SETPOLYFILLMODE:X.polyFillMode=I.getUint32(ct+8,!0);break;case f.SETTEXTALIGN:X.textAlign=I.getUint32(ct+8,!0);break;case f.SETTEXTCOLOR:X.textColor=b(I.getUint32(ct+8,!0));break;case f.SETBKCOLOR:X.bkColor=b(I.getUint32(ct+8,!0));break;case f.CREATEPEN:{const bt=I.getUint32(ct+8,!0),wt=I.getUint32(ct+12,!0),jt=Math.abs(I.getInt32(ct+16,!0));At[bt]={type:"pen",color:b(I.getUint32(ct+24,!0)),width:jt||1,nullPen:(15&wt)==5};break}case f.EXTCREATEPEN:{const bt=I.getUint32(ct+8,!0),wt=I.getUint32(ct+28,!0),jt=Math.abs(I.getInt32(ct+32,!0)),ee=I.getUint32(ct+36,!0);At[bt]={type:"pen",color:b(I.getUint32(ct+40,!0)),width:jt||1,nullPen:(15&wt)==5||ee==1};break}case f.CREATEBRUSHINDIRECT:{const bt=I.getUint32(ct+8,!0),wt=I.getUint32(ct+12,!0);At[bt]={type:"brush",color:b(I.getUint32(ct+16,!0)),nullBrush:wt==1};break}case f.EXTCREATEFONTINDIRECTW:At[I.getUint32(ct+8,!0)]=W(I,ct+12,Dt-12);break;case f.SELECTOBJECT:{const bt=I.getUint32(ct+8,!0),wt=2147483648&bt?g[2147483647&bt]:At[bt];wt?.type=="pen"?X.pen=A(wt):wt?.type=="brush"?X.brush=r(wt):wt?.type=="font"&&(X.font={...wt});break}case f.DELETEOBJECT:delete At[I.getUint32(ct+8,!0)];break;case f.BEGINPATH:St=!0,Rt="";break;case f.ENDPATH:St=!1;break;case f.CLOSEFIGURE:Mt("Z");break;case f.MOVETOEX:{const bt=o(X,p(I,ct+8));X.currentPoint=bt,St&&Mt(`M ${_(bt.x)} ${_(bt.y)}`);break}case f.LINETO:{const bt=o(X,p(I,ct+8));St?Mt(`L ${_(bt.x)} ${_(bt.y)}`):_t(`<path d="M ${_(X.currentPoint.x)} ${_(X.currentPoint.y)} L ${_(bt.x)} ${_(bt.y)}" ${k(X,!1,!0)}/>`),X.currentPoint=bt;break}case f.POLYLINE:case f.POLYGON:O(I,ct,Ct==f.POLYGON,!1,St,X,Mt,_t);break;case f.POLYLINETO:O(I,ct,!1,!0,St,X,Mt,_t);break;case f.POLYLINE16:case f.POLYGON16:R(I,ct,Ct==f.POLYGON16,!1,St,X,Mt,_t);break;case f.POLYLINETO16:R(I,ct,!1,!0,St,X,Mt,_t);break;case f.POLYBEZIER:N(I,ct,!1,!1,St,X,Mt,_t);break;case f.POLYBEZIERTO:N(I,ct,!1,!0,St,X,Mt,_t);break;case f.POLYBEZIER16:N(I,ct,!0,!1,St,X,Mt,_t);break;case f.POLYBEZIERTO16:N(I,ct,!0,!0,St,X,Mt,_t);break;case f.POLYPOLYLINE:case f.POLYPOLYGON:it(I,ct,Ct==f.POLYPOLYGON,!1,St,X,Mt,_t);break;case f.POLYPOLYLINE16:case f.POLYPOLYGON16:it(I,ct,Ct==f.POLYPOLYGON16,!0,St,X,Mt,_t);break;case f.POLYDRAW:J(I,ct,!1,St,X,Mt,_t);break;case f.POLYDRAW16:J(I,ct,!0,St,X,Mt,_t);break;case f.RECTANGLE:ot(I,ct,X,_t,!1);break;case f.ELLIPSE:tt(I,ct,X,_t);break;case f.ROUNDRECT:ot(I,ct,X,_t,!0);break;case f.ARC:case f.ARCTO:case f.CHORD:case f.PIE:ht(I,ct,Ct,St,X,Mt,_t);break;case f.FILLPATH:M(Rt,X,_t,!0,!1),Rt="";break;case f.STROKEPATH:M(Rt,X,_t,!1,!0),Rt="";break;case f.STROKEANDFILLPATH:M(Rt,X,_t,!0,!0),Rt="";break;case f.EXTTEXTOUTA:case f.EXTTEXTOUTW:G(I,ct,Dt,X,_t,Ct==f.EXTTEXTOUTW);break;case f.POLYTEXTOUTA:case f.POLYTEXTOUTW:gt(I,ct,Dt,X,_t,Ct==f.POLYTEXTOUTW);break;case f.SMALLTEXTOUT:nt(I,ct,Dt,X,_t);break;case f.SETPIXELV:et(I,ct,X,_t);break;case f.BITBLT:case f.STRETCHBLT:case f.STRETCHDIBITS:case f.ALPHABLEND:case f.TRANSPARENTBLT:q(I,ct,Dt,Ct,X,_t)}ct+=Dt}if(Rt&&M(Rt,X,_t,!0,!0),!Et.length){const Ct=(function(Dt,bt){const wt=(function(Kt){const re=(function(Pt){const Ot=[137,80,78,71,13,10,26,10];for(let kt=0;kt+Ot.length+12<=Pt.length;kt++){if(!F(Pt,Ot,kt))continue;let Gt=kt+8;for(;Gt+12<=Pt.length;){const pt=ut(Pt,Gt),fn=String.fromCharCode(Pt[Gt+4],Pt[Gt+5],Pt[Gt+6],Pt[Gt+7]);if(Gt+=12+pt,Gt>Pt.length)break;if(fn=="IEND")return Pt.subarray(kt,Gt)}}return null})(Kt);if(re)return`data:image/png;base64,${z(re)}`;const Vt=(function(Pt){for(let Ot=0;Ot+4<Pt.length;Ot++)if(Pt[Ot]==255&&Pt[Ot+1]==216&&Pt[Ot+2]==255){for(let kt=Ot+4;kt+1<Pt.length;kt++)if(Pt[kt]==255&&Pt[kt+1]==217)return Pt.subarray(Ot,kt+2)}return null})(Kt);if(Vt)return`data:image/jpeg;base64,${z(Vt)}`;const ne=(function(Pt){for(let Ot=0;Ot+14<Pt.length;Ot++){if(Pt[Ot]!=66||Pt[Ot+1]!=77)continue;const kt=S(Pt,Ot+2);if(kt>14&&Ot+kt<=Pt.length)return Pt.subarray(Ot,Ot+kt)}return null})(Kt);return ne?`data:image/bmp;base64,${z(ne)}`:null})(Dt);if(!wt)return[];const jt=Math.max(1,bt.right-bt.left),ee=Math.max(1,bt.bottom-bt.top);return[`<image x="${_(bt.left)}" y="${_(bt.top)}" width="${_(jt)}" height="${_(ee)}" href="${wt}" preserveAspectRatio="xMidYMid meet"/>`]})(x,L);Ct.length&&Et.push(...Ct)}return Et.length?`<svg xmlns="http://www.w3.org/2000/svg" width="${_(lt)}mm" height="${_(ft)}mm" viewBox="${_(L.left)} ${_(L.top)} ${_(Q)} ${_(K)}" preserveAspectRatio="xMidYMid meet" data-docx-metafile="emf">${Et.join("")}</svg>`:(function(Ct,Dt,bt,wt,jt){return`<svg xmlns="http://www.w3.org/2000/svg" width="${_(wt)}mm" height="${_(jt)}mm" viewBox="${_(bt.left)} ${_(bt.top)} ${_(Ct)} ${_(Dt)}" preserveAspectRatio="xMidYMid meet" data-docx-metafile="emf"><rect x="${_(bt.left)}" y="${_(bt.top)}" width="${_(Ct)}" height="${_(Dt)}" fill="none" stroke="#999" stroke-width="1"/><text x="${_(bt.left+Ct/2)}" y="${_(bt.top+Dt/2)}" text-anchor="middle" font-size="12" fill="#666">${T("Unsupported EMF image")}</text></svg>`})(Q,K,L,lt,ft)}function w(x){return{world:n(x.world),windowOrg:{...x.windowOrg},windowExt:x.windowExt?{...x.windowExt}:null,viewportOrg:{...x.viewportOrg},viewportExt:x.viewportExt?{...x.viewportExt}:null,pen:A(x.pen),brush:r(x.brush),font:x.font?{...x.font}:null,textColor:x.textColor,bkColor:x.bkColor,bkMode:x.bkMode,polyFillMode:x.polyFillMode,textAlign:x.textAlign,currentPoint:{...x.currentPoint}}}function A(x){return{...x}}function r(x){return{...x}}function n(x){return{...x}}function e(x){return new DataView(x.buffer,x.byteOffset,x.byteLength)}function t(x,D){return{left:x.getInt32(D,!0),top:x.getInt32(D+4,!0),right:x.getInt32(D+8,!0),bottom:x.getInt32(D+12,!0)}}function p(x,D){return{x:x.getInt32(D,!0),y:x.getInt32(D+4,!0)}}function c(x,D){return p(x,D)}function s(x,D){return{x:x.getInt16(D,!0),y:x.getInt16(D+2,!0)}}function l(x,D){return{m11:x.getFloat32(D,!0),m12:x.getFloat32(D+4,!0),m21:x.getFloat32(D+8,!0),m22:x.getFloat32(D+12,!0),dx:x.getFloat32(D+16,!0),dy:x.getFloat32(D+20,!0)}}function u(x,D){return{m11:x.m11*D.m11+x.m12*D.m21,m12:x.m11*D.m12+x.m12*D.m22,m21:x.m21*D.m11+x.m22*D.m21,m22:x.m21*D.m12+x.m22*D.m22,dx:x.dx*D.m11+x.dy*D.m21+D.dx,dy:x.dx*D.m12+x.dy*D.m22+D.dy}}function o(x,D){const I=x.world;let H=D.x*I.m11+D.y*I.m21+I.dx,L=D.x*I.m12+D.y*I.m22+I.dy;return x.windowExt&&x.viewportExt&&x.windowExt.x&&x.windowExt.y&&(H=(H-x.windowOrg.x)*x.viewportExt.x/x.windowExt.x+x.viewportOrg.x,L=(L-x.windowOrg.y)*x.viewportExt.y/x.windowExt.y+x.viewportOrg.y),{x:H,y:L}}function i(x){let D=Math.hypot(x.world.m11,x.world.m12),I=Math.hypot(x.world.m21,x.world.m22);x.windowExt&&x.viewportExt&&x.windowExt.x&&x.windowExt.y&&(D*=Math.abs(x.viewportExt.x/x.windowExt.x),I*=Math.abs(x.viewportExt.y/x.windowExt.y));const H=(D+I)/2;return Number.isFinite(H)&&H>0?H:1}function a(x,D,I){const H=x.getInt32(D+8,!0),L=x.getInt32(D+12,!0),B=x.getInt32(D+16,!0),Y=x.getInt32(D+20,!0);return{x:L?I.x*H/L:I.x,y:Y?I.y*B/Y:I.y}}function b(x){const D=x>>8&255,I=x>>16&255;return`#${v(255&x)}${v(D)}${v(I)}`}function v(x){return Math.max(0,Math.min(255,0|x)).toString(16).padStart(2,"0")}function _(x){return Number.isFinite(x)?""+Math.round(1e3*x)/1e3:"0"}function T(x){return`${x??""}`.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F]/g,"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function k(x,D,I){const H=[];if(D&&!x.brush.nullBrush?(H.push(`fill="${x.brush.color}"`),H.push(`fill-rule="${x.polyFillMode==2?"nonzero":"evenodd"}"`)):H.push('fill="none"'),I&&!x.pen.nullPen){const L=i(x),B=x.pen.width==0?1:Math.max(.35,x.pen.width*L);H.push(`stroke="${x.pen.color}"`),H.push(`stroke-width="${_(B)}"`),H.push('stroke-linecap="square"'),H.push('stroke-linejoin="miter"')}else H.push('stroke="none"');return H.join(" ")}function M(x,D,I,H,L){x&&I(`<path d="${x}" ${k(D,H,L)}/>`)}function R(x,D,I,H,L,B,Y,Q){const K=x.getUint32(D+24,!0);if(!K||D+28+4*K>x.byteLength)return;const lt=[];for(let ft=0;ft<K;ft++)lt.push(o(B,s(x,D+28+4*ft)));P(lt,I,H,L,B,Y,Q)}function O(x,D,I,H,L,B,Y,Q){const K=x.getUint32(D+24,!0);if(!K||D+28+8*K>x.byteLength)return;const lt=[];for(let ft=0;ft<K;ft++)lt.push(o(B,p(x,D+28+8*ft)));P(lt,I,H,L,B,Y,Q)}function P(x,D,I,H,L,B,Y){if(!x.length)return;let Q=H&&I?"":I?`M ${_(L.currentPoint.x)} ${_(L.currentPoint.y)}`:`M ${_(x[0].x)} ${_(x[0].y)}`;for(let K=I?0:1;K<x.length;K++)Q+=` L ${_(x[K].x)} ${_(x[K].y)}`;D&&(Q+=" Z"),L.currentPoint=x[x.length-1],H?B(Q.trim()):Y(`<path d="${Q.trim()}" ${k(L,D,!0)}/>`)}function N(x,D,I,H,L,B,Y,Q){const K=x.getUint32(D+24,!0),lt=I?4:8;if(!K||D+28+K*lt>x.byteLength)return;const ft=[];for(let At=0;At<K;At++){const Et=I?s(x,D+28+At*lt):p(x,D+28+At*lt);ft.push(o(B,Et))}let X=L&&H?"":H?`M ${_(B.currentPoint.x)} ${_(B.currentPoint.y)}`:`M ${_(ft[0].x)} ${_(ft[0].y)}`,mt=H?B.currentPoint:ft[0];for(let At=H?0:1;At+2<ft.length;At+=3){const Et=ft[At],ct=ft[At+1],yt=ft[At+2];X+=` C ${_(Et.x)} ${_(Et.y)} ${_(ct.x)} ${_(ct.y)} ${_(yt.x)} ${_(yt.y)}`,mt=yt}B.currentPoint=mt,L?Y(X.trim()):Q(`<path d="${X.trim()}" ${k(B,!1,!0)}/>`)}function it(x,D,I,H,L,B,Y,Q){const K=x.getUint32(D+24,!0),lt=x.getUint32(D+28,!0),ft=D+32,X=ft+4*K,mt=H?4:8;if(!K||!lt||X+lt*mt>x.byteLength)return;let At=0;for(let Et=0;Et<K;Et++){const ct=x.getUint32(ft+4*Et,!0);if(!ct||At+ct>lt)break;const yt=[];for(let Rt=0;Rt<ct;Rt++){const St=X+(At+Rt)*mt,It=H?s(x,St):p(x,St);yt.push(o(B,It))}P(yt,I,!1,L,B,Y,Q),At+=ct}}function J(x,D,I,H,L,B,Y){const Q=x.getUint32(D+24,!0),K=I?4:8,lt=D+28,ft=lt+Q*K;if(!Q||ft+Q>x.byteLength)return;const X=[];for(let Et=0;Et<Q;Et++){const ct=lt+Et*K,yt=I?s(x,ct):p(x,ct);X.push(o(L,yt))}let mt="",At=0;for(;At<Q;){const Et=x.getUint8(ft+At),ct=6&Et;ct==6?(mt+=` M ${_(X[At].x)} ${_(X[At].y)}`,L.currentPoint=X[At],At++):ct==2?(mt+=` L ${_(X[At].x)} ${_(X[At].y)}`,L.currentPoint=X[At],At++):ct==4&&At+2<Q?(mt+=` C ${_(X[At].x)} ${_(X[At].y)} ${_(X[At+1].x)} ${_(X[At+1].y)} ${_(X[At+2].x)} ${_(X[At+2].y)}`,L.currentPoint=X[At+2],At+=3):At++,1&Et&&(mt+=" Z")}mt=mt.trim(),mt&&(H?B(mt):Y(`<path d="${mt}" ${k(L,!1,!0)}/>`))}function ot(x,D,I,H,L){const B=t(x,D+8),Y=o(I,{x:B.left,y:B.top}),Q=o(I,{x:B.right,y:B.bottom}),K=Math.min(Y.x,Q.x),lt=Math.min(Y.y,Q.y),ft=Math.abs(Q.x-Y.x),X=Math.abs(Q.y-Y.y),mt=L?` rx="${_(Math.min(ft,X)/8)}" ry="${_(Math.min(ft,X)/8)}"`:"";H(`<rect x="${_(K)}" y="${_(lt)}" width="${_(ft)}" height="${_(X)}"${mt} ${k(I,!0,!0)}/>`)}function tt(x,D,I,H){const L=t(x,D+8),B=o(I,{x:L.left,y:L.top}),Y=o(I,{x:L.right,y:L.bottom}),Q=(B.x+Y.x)/2,K=(B.y+Y.y)/2,lt=Math.abs(Y.x-B.x)/2,ft=Math.abs(Y.y-B.y)/2;H(`<ellipse cx="${_(Q)}" cy="${_(K)}" rx="${_(lt)}" ry="${_(ft)}" ${k(I,!0,!0)}/>`)}function ht(x,D,I,H,L,B,Y){const Q=t(x,D+8),K=p(x,D+24),lt=p(x,D+32),ft=(Q.left+Q.right)/2,X=(Q.top+Q.bottom)/2,mt=Math.abs(Q.right-Q.left)/2,At=Math.abs(Q.bottom-Q.top)/2;if(!mt||!At)return;const Et=Math.atan2(K.y-X,K.x-ft);let ct=Math.atan2(lt.y-X,lt.x-ft),yt=ct-Et;yt<=0&&(yt+=2*Math.PI);const Rt=yt>Math.PI?1:0,St=o(L,{x:ft+Math.cos(Et)*mt,y:X+Math.sin(Et)*At}),It=o(L,{x:ft+Math.cos(ct)*mt,y:X+Math.sin(ct)*At}),Lt=o(L,{x:ft,y:X}),Ft=o(L,{x:ft+mt,y:X}),_t=o(L,{x:ft,y:X+At}),Mt=Math.max(.01,Math.abs(Ft.x-Lt.x)||Math.abs(_t.x-Lt.x)),Ct=Math.max(.01,Math.abs(_t.y-Lt.y)||Math.abs(Ft.y-Lt.y)),Dt=`A ${_(Mt)} ${_(Ct)} 0 ${Rt} 1 ${_(It.x)} ${_(It.y)}`;let bt=`M ${_(St.x)} ${_(St.y)} ${Dt}`,wt=!1;I==f.CHORD?(bt+=" Z",wt=!0):I==f.PIE&&(bt+=` L ${_(Lt.x)} ${_(Lt.y)} Z`,wt=!0),I==f.ARCTO&&(L.currentPoint=It),H?B(bt):Y(`<path d="${bt}" ${k(L,wt,!0)}/>`)}function W(x,D,I){const H=I>=4?x.getInt32(D,!0):12,L=I>=20?x.getInt32(D+16,!0):400,B=I>=21&&x.getUint8(D+20)!=0,Y=I>=22&&x.getUint8(D+21)!=0;let Q="";const K=D+28,lt=Math.max(0,Math.min(64,I-28));for(let ft=0;ft+1<lt;ft+=2){const X=x.getUint16(K+ft,!0);if(!X)break;Q+=String.fromCharCode(X)}return{type:"font",family:Q,size:Math.abs(H)||12,weight:L,italic:B,underline:Y}}function G(x,D,I,H,L,B){if(I<76)return;const Y=o(H,p(x,D+36)),Q=x.getUint32(D+44,!0),K=x.getUint32(D+48,!0);!Q||K<=0||K+Q*(B?2:1)>I||V(B?j(x,D+K,Q):U(new Uint8Array(x.buffer,x.byteOffset+D+K,Q)),Y,H,L)}function gt(x,D,I,H,L,B){if(I<40)return;const Y=x.getUint32(D+36,!0);let Q=D+40;for(let K=0;K<Y&&Q+40<=D+I;K++,Q+=40){const lt=o(H,p(x,Q)),ft=x.getUint32(Q+8,!0),X=x.getUint32(Q+12,!0);!ft||!X||X+ft*(B?2:1)>I||V(B?j(x,D+X,ft):U(new Uint8Array(x.buffer,x.byteOffset+D+X,ft)),lt,H,L)}}function nt(x,D,I,H,L){if(I<36)return;const B=o(H,p(x,D+8)),Y=x.getUint32(D+16,!0),Q=512&x.getUint32(D+20,!0)?40:28;!Y||Q+Y>I||V(U(new Uint8Array(x.buffer,x.byteOffset+D+Q,Y)),B,H,L)}function j(x,D,I){let H="";for(let L=0;L<I;L++){const B=x.getUint16(D+2*L,!0);B&&(H+=String.fromCharCode(B))}return H}function U(x){if(!x.length)return"";const D=globalThis.TextDecoder;if(D)try{return new D("gb18030").decode(x).replace(/\0+$/g,"")}catch{try{return new D("windows-1252").decode(x).replace(/\0+$/g,"")}catch{}}let I="";for(const H of x)H&&(I+=String.fromCharCode(H));return I}function at(x){const D=6&x.textAlign;return D==6?'text-anchor="middle"':D==2?'text-anchor="end"':""}function rt(x){const D=24&x.textAlign;return D==0?'dominant-baseline="text-before-edge"':D==8?'dominant-baseline="text-after-edge"':""}function V(x,D,I,H){x&&H(`<text ${(function(L,B){const Y=L.font,Q=Math.max(1,(Y?.size??12)*i(L));return[`x="${_(B.x)}"`,`y="${_(B.y)}"`,`fill="${L.textColor}"`,`font-size="${_(Q)}"`,Y?.family?`font-family="${T(Y.family)}"`:"",Y?.weight?`font-weight="${Y.weight>=600?"bold":"normal"}"`:"",Y?.italic?'font-style="italic"':"",Y?.underline?'text-decoration="underline"':"",at(L),rt(L)].filter(Boolean).join(" ")})(I,D)}>${T(x)}</text>`)}function et(x,D,I,H){if(D+20>x.byteLength)return;const L=o(I,p(x,D+8)),B=b(x.getUint32(D+16,!0));H(`<rect x="${_(L.x)}" y="${_(L.y)}" width="1" height="1" fill="${B}" stroke="none"/>`)}function q(x,D,I,H,L,B){let Y=0,Q=0,K=0,lt=0,ft=0,X=0,mt=0,At=0;if(H==f.STRETCHDIBITS){if(I<80)return;Y=x.getInt32(D+24,!0),Q=x.getInt32(D+28,!0),ft=x.getUint32(D+48,!0),X=x.getUint32(D+52,!0),mt=x.getUint32(D+56,!0),At=x.getUint32(D+60,!0),K=x.getInt32(D+72,!0),lt=x.getInt32(D+76,!0)}else{if(I<100)return;Y=x.getInt32(D+24,!0),Q=x.getInt32(D+28,!0),K=x.getInt32(D+32,!0),lt=x.getInt32(D+36,!0),ft=x.getUint32(D+84,!0),X=x.getUint32(D+88,!0),mt=x.getUint32(D+92,!0),At=x.getUint32(D+96,!0)}if(!ft||!X||!mt||!At||ft+X>I||mt+At>I)return;const Et=(function(Ft,_t,Mt,Ct,Dt,bt){const wt=_t+Mt,jt=_t+Dt;if(Ct<4||wt+Ct>Ft.byteLength||jt+bt>Ft.byteLength)return null;const ee=Ft.getUint32(wt,!0)>=40&&Ct>=20?Ft.getUint32(wt+16,!0):0,Kt=new Uint8Array(Ft.buffer,Ft.byteOffset+jt,bt);if(ee==4)return`data:image/jpeg;base64,${z(Kt)}`;if(ee==5)return`data:image/png;base64,${z(Kt)}`;const re=new Uint8Array(Ct+bt);return re.set(new Uint8Array(Ft.buffer,Ft.byteOffset+wt,Ct),0),re.set(Kt,Ct),(function(Vt,ne){if(!Vt?.length||ne<=0||ne>Vt.length)return null;const Pt=14+Vt.length,Ot=14+ne,kt=new Uint8Array(Pt);return kt[0]=66,kt[1]=77,$(kt,2,Pt),$(kt,10,Ot),kt.set(Vt,14),`data:image/bmp;base64,${z(kt)}`})(re,Ct)})(x,D,ft,X,mt,At);if(!Et)return;const ct=o(L,{x:Y,y:Q}),yt=o(L,{x:Y+K,y:Q+lt}),Rt=Math.min(ct.x,yt.x),St=Math.min(ct.y,yt.y),It=Math.abs(yt.x-ct.x),Lt=Math.abs(yt.y-ct.y);B(`<image x="${_(Rt)}" y="${_(St)}" width="${_(It)}" height="${_(Lt)}" href="${Et}" preserveAspectRatio="none"/>`)}function F(x,D,I){for(let H=0;H<D.length;H++)if(x[I+H]!=D[H])return!1;return!0}function ut(x,D){return(x[D]<<24|x[D+1]<<16|x[D+2]<<8|x[D+3])>>>0}function S(x,D){return(x[D]|x[D+1]<<8|x[D+2]<<16|x[D+3]<<24)>>>0}function $(x,D,I){x[D]=255&I,x[D+1]=I>>8&255,x[D+2]=I>>16&255,x[D+3]=I>>24&255}function z(x){let D="";for(let H=0;H<x.length;H+=32768)D+=String.fromCharCode(...x.subarray(H,H+32768));if(typeof btoa=="function")return btoa(D);const I=globalThis.Buffer;return I?I.from(x).toString("base64"):D}},"./notes/elements":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.WmlEndnote=d.WmlFootnote=d.WmlBaseNote=void 0;const f=m("../document/dom");class g{}d.WmlBaseNote=g,d.WmlFootnote=class extends g{constructor(){super(...arguments),this.type=f.DomType.Footnote}},d.WmlEndnote=class extends g{constructor(){super(...arguments),this.type=f.DomType.Endnote}}},"./notes/parts":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.EndnotesPart=d.FootnotesPart=d.BaseNotePart=void 0;const f=m("../common/part"),g=m("./elements");class y extends f.Part{constructor(h,w,A){super(h,w),this._documentParser=A}}d.BaseNotePart=y,d.FootnotesPart=class extends y{constructor(E,h,w){super(E,h,w)}parseXml(E){this.notes=this._documentParser.parseNotes(E,"footnote",g.WmlFootnote)}},d.EndnotesPart=class extends y{constructor(E,h,w){super(E,h,w)}parseXml(E){this.notes=this._documentParser.parseNotes(E,"endnote",g.WmlEndnote)}}},"./numbering/numbering-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.NumberingPart=void 0;const f=m("../common/part"),g=m("./numbering");class y extends f.Part{constructor(h,w,A){super(h,w),this._documentParser=A}parseXml(h){Object.assign(this,(0,g.parseNumberingPart)(h,this._package.xmlParser)),this.domNumberings=this._documentParser.parseNumberingFile(h)}}d.NumberingPart=y},"./numbering/numbering":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseNumberingPart=function(n,e){let t={numberings:[],abstractNumberings:[],bulletPictures:[]};for(let p of e.elements(n))switch(p.localName){case"num":t.numberings.push(y(p,e));break;case"abstractNum":t.abstractNumberings.push(E(p,e));break;case"numPicBullet":t.bulletPictures.push(A(p,e))}return t},d.parseNumbering=y,d.parseAbstractNumbering=E,d.parseNumberingLevel=h,d.parseNumberingLevelOverrride=w,d.parseNumberingBulletPicture=A;const f=m("../document/paragraph"),g=m("../document/run");function y(n,e){let t={id:e.attr(n,"numId"),overrides:[]};for(let p of e.elements(n))switch(p.localName){case"abstractNumId":t.abstractId=e.attr(p,"val");break;case"lvlOverride":t.overrides.push(w(p,e))}return t}function E(n,e){let t={id:e.attr(n,"abstractNumId"),levels:[]};for(let p of e.elements(n))switch(p.localName){case"name":t.name=e.attr(p,"val");break;case"multiLevelType":t.multiLevelType=e.attr(p,"val");break;case"numStyleLink":t.numberingStyleLink=e.attr(p,"val");break;case"styleLink":t.styleLink=e.attr(p,"val");break;case"lvl":t.levels.push(h(p,e))}return t}function h(n,e){let t={level:e.intAttr(n,"ilvl")};for(let p of e.elements(n))switch(p.localName){case"start":t.start=e.attr(p,"val");break;case"lvlRestart":t.restart=e.intAttr(p,"val");break;case"numFmt":t.format=e.attr(p,"val");break;case"lvlText":t.text=e.attr(p,"val");break;case"lvlJc":t.justification=e.attr(p,"val");break;case"lvlPicBulletId":t.bulletPictureId=e.attr(p,"val");break;case"pStyle":t.paragraphStyle=e.attr(p,"val");break;case"pPr":t.paragraphProps=(0,f.parseParagraphProperties)(p,e);break;case"rPr":t.runProps=(0,g.parseRunProperties)(p,e)}return t}function w(n,e){let t={level:e.intAttr(n,"ilvl")};for(let p of e.elements(n))switch(p.localName){case"startOverride":t.start=e.intAttr(p,"val");break;case"lvl":t.numberingLevel=h(p,e)}return t}function A(n,e){var t=e.attr(n,"numPicBulletId"),p=e.element(n,"pict"),c=p&&e.element(p,"shape"),s=c&&e.element(c,"imagedata");if(s)return{id:t,referenceId:e.attr(s,"id"),style:e.attr(c,"style")};var l=e.element(n,"drawing"),u=l&&r(l,"blip",e);return u?{id:t,referenceId:e.attr(u,"embed")??e.attr(u,"link"),style:null}:null}function r(n,e,t){for(const p of t.elements(n)){if(p.localName==e)return p;const c=r(p,e,t);if(c)return c}return null}},"./parser/xml-parser":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.XmlParser=void 0,d.parseXmlString=function(y,E=!1){var h;E&&(y=y.replace(/<[?].*[?]>/,"")),y=(h=y).charCodeAt(0)===65279?h.substring(1):h;const w=new DOMParser().parseFromString(y,"application/xml"),A=(r=w,r.getElementsByTagName("parsererror")[0]?.textContent);var r;if(A)throw new Error(A);return w},d.serializeXmlString=function(y){return new XMLSerializer().serializeToString(y)};const f=m("../document/common");class g{elements(E,h=null){const w=[];for(let A=0,r=E.childNodes.length;A<r;A++){let n=E.childNodes.item(A);n.nodeType!=1||h!=null&&n.localName!=h||w.push(n)}return w}element(E,h){for(let w=0,A=E.childNodes.length;w<A;w++){let r=E.childNodes.item(w);if(r.nodeType==1&&r.localName==h)return r}return null}elementAttr(E,h,w){var A=this.element(E,h);return A?this.attr(A,w):void 0}attrs(E){return Array.from(E.attributes)}attr(E,h){for(let w=0,A=E.attributes.length;w<A;w++){let r=E.attributes.item(w);if(r.localName==h)return r.value}return null}intAttr(E,h,w=null){var A=this.attr(E,h);return A!=null&&A!==""?parseInt(A,10):w}hexAttr(E,h,w=null){var A=this.attr(E,h);return A!=null&&A!==""?parseInt(A,16):w}floatAttr(E,h,w=null){var A=this.attr(E,h);return A!=null&&A!==""?parseFloat(A):w}boolAttr(E,h,w=null){return(0,f.convertBoolean)(this.attr(E,h),w)}lengthAttr(E,h,w=f.LengthUsage.Dxa){return(0,f.convertLength)(this.attr(E,h),w)}}d.XmlParser=g,d.default=new g},"./settings/settings-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.SettingsPart=void 0;const f=m("../common/part"),g=m("./settings");class y extends f.Part{constructor(h,w){super(h,w)}parseXml(h){this.settings=(0,g.parseSettings)(h,this._package.xmlParser)}}d.SettingsPart=y},"./settings/settings":function(m,C,d){function f(g,y){var E={defaultNoteIds:[]};for(let h of y.elements(g))switch(h.localName){case"numFmt":E.nummeringFormat=y.attr(h,"val");break;case"footnote":case"endnote":E.defaultNoteIds.push(y.attr(h,"id"))}return E}Object.defineProperty(d,"__esModule",{value:!0}),d.parseSettings=function(g,y){var E={};for(let h of y.elements(g))switch(h.localName){case"defaultTabStop":E.defaultTabStop=y.lengthAttr(h,"val");break;case"footnotePr":E.footnoteProps=f(h,y);break;case"endnotePr":E.endnoteProps=f(h,y);break;case"autoHyphenation":E.autoHyphenation=y.boolAttr(h,"val");break;case"kinsoku":E.kinsoku=y.boolAttr(h,"val",!0);break;case"overflowPunct":E.overflowPunctuation=y.boolAttr(h,"val",!0);break;case"topLinePunct":E.topLinePunctuation=y.boolAttr(h,"val",!0);break;case"autoSpaceDE":E.autoSpaceDE=y.boolAttr(h,"val",!0);break;case"autoSpaceDN":E.autoSpaceDN=y.boolAttr(h,"val",!0);break;case"noLineBreaksAfter":E.noLineBreaksAfter=y.attr(h,"val")||h.textContent||"";break;case"noLineBreaksBefore":E.noLineBreaksBefore=y.attr(h,"val")||h.textContent||"";break;case"evenAndOddHeaders":E.evenAndOddHeaders=y.boolAttr(h,"val",!0);break;case"splitPgBreakAndParaMark":E.splitPageBreakAndParagraphMark=y.boolAttr(h,"val",!0);break;case"compat":for(const w of y.elements(h))w.localName=="adjustLineHeightInTable"&&(E.adjustLineHeightInTable=y.boolAttr(w,"val",!0))}return E},d.parseNoteProperties=f},"./styles/styles-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.StylesPart=void 0;const f=m("../common/part");class g extends f.Part{constructor(E,h,w){super(E,h),this._documentParser=w}parseXml(E){this.styles=this._documentParser.parseStylesFile(E)}}d.StylesPart=g},"./theme/theme-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.ThemePart=void 0;const f=m("../common/part"),g=m("./theme");class y extends f.Part{constructor(h,w){super(h,w)}parseXml(h){this.theme=(0,g.parseTheme)(h,this._package.xmlParser)}}d.ThemePart=y},"./theme/theme":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.DmlTheme=void 0,d.parseTheme=function(h,w){var A=new f,r=w.element(h,"themeElements");for(let n of w.elements(r))switch(n.localName){case"clrScheme":A.colorScheme=g(n,w);break;case"fontScheme":A.fontScheme=y(n,w)}return A},d.parseColorScheme=g,d.parseFontScheme=y,d.parseFontInfo=E;class f{}function g(h,w){var A={name:w.attr(h,"name"),colors:{}};for(let e of w.elements(h)){var r=w.element(e,"srgbClr"),n=w.element(e,"sysClr");r?A.colors[e.localName]=w.attr(r,"val"):n&&(A.colors[e.localName]=w.attr(n,"lastClr"))}return A}function y(h,w){var A={name:w.attr(h,"name")};for(let r of w.elements(h))switch(r.localName){case"majorFont":A.majorFont=E(r,w);break;case"minorFont":A.minorFont=E(r,w)}return A}function E(h,w){return{latinTypeface:w.elementAttr(h,"latin","typeface"),eaTypeface:w.elementAttr(h,"ea","typeface"),csTypeface:w.elementAttr(h,"cs","typeface")}}d.DmlTheme=f},"./utils":function(m,C,d){function f(g){return g&&typeof g=="object"&&!Array.isArray(g)}Object.defineProperty(d,"__esModule",{value:!0}),d.escapeClassName=function(g){return g?.replace(/[ .]+/g,"-").replace(/[&]+/g,"and").toLowerCase()},d.encloseFontFamily=function(g){return/^[^"'].*\s.*[^"']$/.test(g)?`'${g}'`:g},d.splitPath=function(g){let y=g.lastIndexOf("/")+1;return[y==0?"":g.substring(0,y),y==0?g:g.substring(y)]},d.resolvePath=function(g,y){try{return new URL(g,"http://docx/"+y).toString().substring(12)}catch{return`${y}${g}`}},d.keyBy=function(g,y){return g.reduce((E,h)=>(E[y(h)]=h,E),{})},d.blobToBase64=function(g){return new Promise((y,E)=>{const h=new FileReader;h.onloadend=()=>y(h.result),h.onerror=()=>E(),h.readAsDataURL(g)})},d.isObject=f,d.isString=function(g){return typeof g=="string"||g instanceof String},d.mergeDeep=function g(y,...E){if(!E.length)return y;const h=E.shift();if(f(y)&&f(h))for(const w in h)f(h[w])?g(y[w]??(y[w]={}),h[w]):y[w]=h[w];return g(y,...E)},d.parseCssRules=function(g){const y={};for(const E of(g??"").split(";")){const h=E.indexOf(":");if(h<=0)continue;const w=E.substring(0,h).trim(),A=E.substring(h+1).trim();w&&(y[w]=A)}return y},d.formatCssRules=function(g){return Object.entries(g??{}).map(([y,E])=>`${y}: ${E}`).join(";")},d.asArray=function(g){return Array.isArray(g)?g:[g]},d.clamp=function(g,y,E){return y>g?y:E<g?E:g}},"./vml/vml":function(m,C,d){var f=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(d,"__esModule",{value:!0}),d.VmlElement=void 0,d.parseVmlElement=function c(s,l){var u=new h;switch(s.localName){case"rect":u.tagName="rect",Object.assign(u.attrs,{width:"100%",height:"100%"});break;case"oval":u.tagName="ellipse",Object.assign(u.attrs,{cx:"50%",cy:"50%",rx:"50%",ry:"50%"});break;case"line":u.tagName="line";break;case"shape":u.tagName="g";break;case"textbox":u.tagName="foreignObject",Object.assign(u.attrs,{width:"100%",height:"100%"});break;default:return null}for(const o of E.default.attrs(s))switch(o.localName){case"style":u.cssStyleText=o.value;break;case"fillcolor":u.attrs.fill=o.value;break;case"strokecolor":u.attrs.stroke=o.value;break;case"strokeweight":u.attrs["stroke-width"]=(0,g.convertLength)(o.value,g.LengthUsage.Point)??o.value;break;case"filled":o.value!="f"&&o.value!="false"||(u.attrs.fill="none");break;case"stroked":o.value!="f"&&o.value!="false"||(u.attrs.stroke="none");break;case"path":u.tagName="path",u.attrs.d=p(o.value);break;case"from":const[i,a]=t(o.value);Object.assign(u.attrs,{x1:i,y1:a});break;case"to":const[b,v]=t(o.value);Object.assign(u.attrs,{x2:b,y2:v})}for(const o of E.default.elements(s))switch(o.localName){case"stroke":Object.assign(u.attrs,n(o));break;case"fill":Object.assign(u.attrs,e(o));break;case"imagedata":u.tagName="image",Object.assign(u.attrs,w(o)),u.imageHref={id:E.default.attr(o,"id")??E.default.attr(o,"relid")??E.default.attr(o,"pict"),title:E.default.attr(o,"title")};break;case"txbxContent":u.children.push(...l.parseBodyElements(o));break;default:const i=c(o,l);i&&u.children.push(i)}return u};const g=m("../document/common"),y=m("../document/dom"),E=f(m("../parser/xml-parser"));class h extends y.OpenXmlElementBase{constructor(){super(...arguments),this.type=y.DomType.VmlElement,this.attrs={}}}function w(c){const s=A(E.default.attr(c,"cropleft")),l=A(E.default.attr(c,"croptop")),u=A(E.default.attr(c,"cropright")),o=A(E.default.attr(c,"cropbottom")),i=Math.max(1e-4,1-s-u),a=Math.max(1e-4,1-l-o),b={x:r(-s/i),y:r(-l/a),width:r(1/i),height:r(1/a)};return(s||l||u||o)&&(b.preserveAspectRatio="none"),b}function A(c){if(!c)return 0;const s=String(c).trim();if(!s)return 0;let l;return l=/^-?\d+(\.\d+)?f$/i.test(s)?parseFloat(s.slice(0,-1))/65536:s.endsWith("%")?parseFloat(s)/100:parseFloat(s),Number.isFinite(l)?Math.max(0,Math.min(.9999,l)):0}function r(c){return Math.round(1e5*c)/1e3+"%"}function n(c){const s={},l=E.default.attr(c,"color"),u=E.default.attr(c,"weight"),o=E.default.attr(c,"on");return o=="f"||o=="false"?s.stroke="none":l&&(s.stroke=l),s["stroke-width"]=u?(0,g.convertLength)(u,g.LengthUsage.Point)??u:"1px",s}function e(c){const s={},l=E.default.attr(c,"color")??E.default.attr(c,"color2"),u=E.default.attr(c,"on"),o=E.default.attr(c,"opacity");return u=="f"||u=="false"?s.fill="none":l&&(s.fill=l),o&&(s["fill-opacity"]=o.endsWith("%")?""+parseFloat(o)/100:o),s}function t(c){return c.split(",")}function p(c){return c.replace(/([mlxe])|([-\d]+)|([,])/g,s=>/[-\d]/.test(s)?(0,g.convertLength)(s,g.LengthUsage.VmlEmu):/[ml,]/.test(s)?s:"")}d.VmlElement=h},"./word-document":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.WordDocument=void 0,d.deobfuscate=_;const f=m("./common/relationship"),g=m("./font-table/font-table"),y=m("./common/open-xml-package"),E=m("./document/document-part"),h=m("./utils"),w=m("./numbering/numbering-part"),A=m("./styles/styles-part"),r=m("./header-footer/parts"),n=m("./document-props/extended-props-part"),e=m("./document-props/core-props-part"),t=m("./theme/theme-part"),p=m("./notes/parts"),c=m("./settings/settings-part"),s=m("./document-props/custom-props-part"),l=m("./comments/comments-part"),u=m("./comments/comments-extended-part"),o=m("./parser/xml-parser"),i=m("./metafile/emf-to-svg"),a=[{type:f.RelationshipTypes.OfficeDocument,target:"word/document.xml"},{type:f.RelationshipTypes.ExtendedProperties,target:"docProps/app.xml"},{type:f.RelationshipTypes.CoreProperties,target:"docProps/core.xml"},{type:f.RelationshipTypes.CustomProperties,target:"docProps/custom.xml"}];class b{constructor(){this.parts=[],this.partsMap={},this.contentTypes=[],this._snapshotAssetDataUrls=null,this._snapshotTextParts=null}static fromSnapshot(k,M){const R=new b;R._options=M,R.rels=k.rels??[],R.contentTypes=k.contentTypes??[],R.parts=[],R.partsMap={},R._snapshotAssetDataUrls=k.assetDataUrls??{},R._snapshotTextParts=k.textParts??{},R._package={load:O=>Promise.resolve(R._snapshotTextParts?.[v(O)]??null),parseXmlDocument:O=>(0,o.parseXmlString)(O,M?.trimXmlDeclaration??!0),get:O=>R._snapshotTextParts?.[v(O)]!=null?{}:null};for(const O of k.parts??[]){const P=R.restoreSnapshotPart(O);P&&(R.parts.push(P),R.partsMap[P.path]=P)}return R}static async load(k,M,R){var O=new b;return O._options=R,O._parser=M,O._package=await y.OpenXmlPackage.load(k,R),O.rels=await O._package.loadRelationships(),O.contentTypes=await O._package.loadContentTypes(),await Promise.all(a.map(P=>{const N=O.rels.find(it=>it.type===P.type)??P;return O.loadRelationshipPart(N.target,N.type)})),O}restoreSnapshotPart(k){const M={path:k.path,rels:k.rels??[]};switch(Object.assign(M,k.data??{}),k.kind){case"document":this.documentPart=M;break;case"fontTable":this.fontTablePart=M;break;case"numbering":this.numberingPart=M;break;case"styles":this.stylesPart=M;break;case"theme":this.themePart=M;break;case"footnotes":this.footnotesPart=M;break;case"endnotes":this.endnotesPart=M;break;case"coreProps":this.corePropsPart=M;break;case"extendedProps":this.extendedPropsPart=M;break;case"settings":this.settingsPart=M;break;case"comments":M.commentMap=(0,h.keyBy)(M.comments??[],R=>R.id),this.commentsPart=M;break;case"commentsExtended":M.commentMap=(0,h.keyBy)(M.comments??[],R=>R.paraId),this.commentsExtendedPart=M}return M}async createSnapshot(){const k={rels:this.rels??[],contentTypes:this.contentTypes??[],parts:this.parts.map(M=>this.snapshotPart(M)).filter(Boolean),assetDataUrls:{},textParts:{}};return await this.preloadSnapshotRelationshipTargets(k),k}snapshotPart(k){const M=k;let R="part",O={};if(k===this.documentPart)R="document",O={body:M.body};else if(k===this.fontTablePart)R="fontTable",O={fonts:M.fonts};else if(k===this.numberingPart)R="numbering",O={numberings:M.numberings,abstractNumberings:M.abstractNumberings,bulletPictures:M.bulletPictures,domNumberings:M.domNumberings};else if(k===this.stylesPart)R="styles",O={styles:M.styles};else if(k===this.themePart)R="theme",O={theme:M.theme};else if(k===this.footnotesPart)R="footnotes",O={notes:M.notes};else if(k===this.endnotesPart)R="endnotes",O={notes:M.notes};else if(k===this.corePropsPart)R="coreProps",O={props:M.props};else if(k===this.extendedPropsPart)R="extendedProps",O={props:M.props};else if(k===this.settingsPart)R="settings",O={settings:M.settings};else if(k===this.commentsPart)R="comments",O={comments:M.comments};else if(k===this.commentsExtendedPart)R="commentsExtended",O={comments:M.comments};else{if(!M.rootElement)return null;R=M.rootElement.type==="header"?"header":"footer",O={rootElement:M.rootElement}}return{kind:R,path:k.path,rels:k.rels??[],data:O}}async preloadSnapshotRelationshipTargets(k){const M=new Set,R=O=>{for(const P of O?.rels??[]){if(!P||P.targetMode==="External")continue;const N=v(this.resolveRelationshipTarget(O,P));N&&!M.has(N)&&M.add(N)}};for(const O of this.parts)R(O);for(const O of M){if(this.partsMap[O])continue;const P=O.toLowerCase(),N=/\.(xml|rels|html?|txt)$/i.test(P);try{if(N){const it=await this._package.load(O,"string");it!=null&&(k.textParts[O]=it)}else{const it=await this.loadPackageAssetDataUrl(O);it&&(k.assetDataUrls[O]=it)}}catch(it){this._options?.debug&&console.warn(`docx-preview: unable to preload relationship target ${O}`,it)}}}blobWithContentType(k,M){if(!k)return null;if(M){const R=this.contentTypes.find(O=>O.partName===M||O.extension&&M.endsWith(`.${O.extension}`));return R?new Blob([k],{type:R.contentType}):k}return k}save(k="blob"){return this._package.save(k)}async loadRelationshipPart(k,M){if(this.partsMap[k])return this.partsMap[k];if(!this._package.get(k))return null;let R=null;switch(M){case f.RelationshipTypes.OfficeDocument:this.documentPart=R=new E.DocumentPart(this._package,k,this._parser);break;case f.RelationshipTypes.FontTable:this.fontTablePart=R=new g.FontTablePart(this._package,k);break;case f.RelationshipTypes.Numbering:this.numberingPart=R=new w.NumberingPart(this._package,k,this._parser);break;case f.RelationshipTypes.Styles:this.stylesPart=R=new A.StylesPart(this._package,k,this._parser);break;case f.RelationshipTypes.Theme:this.themePart=R=new t.ThemePart(this._package,k);break;case f.RelationshipTypes.Footnotes:this.footnotesPart=R=new p.FootnotesPart(this._package,k,this._parser);break;case f.RelationshipTypes.Endnotes:this.endnotesPart=R=new p.EndnotesPart(this._package,k,this._parser);break;case f.RelationshipTypes.Footer:R=new r.FooterPart(this._package,k,this._parser);break;case f.RelationshipTypes.Header:R=new r.HeaderPart(this._package,k,this._parser);break;case f.RelationshipTypes.CoreProperties:this.corePropsPart=R=new e.CorePropsPart(this._package,k);break;case f.RelationshipTypes.ExtendedProperties:this.extendedPropsPart=R=new n.ExtendedPropsPart(this._package,k);break;case f.RelationshipTypes.CustomProperties:R=new s.CustomPropsPart(this._package,k);break;case f.RelationshipTypes.Settings:this.settingsPart=R=new c.SettingsPart(this._package,k);break;case f.RelationshipTypes.Comments:this.commentsPart=R=new l.CommentsPart(this._package,k,this._parser);break;case f.RelationshipTypes.CommentsExtended:this.commentsExtendedPart=R=new u.CommentsExtendedPart(this._package,k)}if(R==null)return Promise.resolve(null);if(this.partsMap[k]=R,this.parts.push(R),await R.load(),R.rels?.length>0){const[O]=(0,h.splitPath)(R.path);await Promise.all(R.rels.filter(P=>P.targetMode!=="External").map(P=>this.loadRelationshipPart((0,h.resolvePath)(P.target,O),P.type)))}return R}async loadRelationshipXml(k,M){const R=M??this.documentPart,O=this.getRelById(R,k);if(!O||O.targetMode==="External")return null;const P=v(this.resolveRelationshipTarget(R,O)),N=P?this._snapshotTextParts?.[P]??await this._package.load(P,"string"):null;return N?this._package.parseXmlDocument(N):null}async loadRelationshipText(k,M){const R=M??this.documentPart,O=this.getRelById(R,k);if(!O||O.targetMode==="External")return null;const P=v(this.resolveRelationshipTarget(R,O));return P?Promise.resolve(this._snapshotTextParts?.[P]??this._package.load(P,"string")):Promise.resolve(null)}async loadRelationshipBlobUrl(k,M){const R=M??this.documentPart,O=this.getRelById(R,k);if(!O)return null;if(O.targetMode==="External")return O.target;const P=v(this.resolveRelationshipTarget(R,O));return P?this.loadPackageAssetUrl(P):null}async loadDocumentImage(k,M){const R=M??this.documentPart,O=this.getRelById(R,k);if(!O)return null;if(O.targetMode==="External")return O.target;const P=v(this.resolveRelationshipTarget(R,O));return P?this.loadPackageAssetUrl(P):null}async loadNumberingImage(k){const M=v(this.getPathById(this.numberingPart,k));return M?this.loadPackageAssetUrl(M):null}async loadFont(k,M){const R=v(this.getPathById(this.fontTablePart,k));if(!R)return null;if(this._snapshotAssetDataUrls?.[R])return this._snapshotAssetDataUrls[R];const O=await this._package.load(R,"uint8array");return O&&this.blobToURL(new Blob([_(O,M)]),R)}async loadAltChunk(k,M){const R=M??this.documentPart,O=this.getRelById(R,k);if(!O||O.targetMode==="External")return Promise.resolve(null);const P=v(this.resolveRelationshipTarget(R,O));return P?Promise.resolve(this._snapshotTextParts?.[P]??this._package.load(P,"string")):Promise.resolve(null)}blobToURL(k,M){return k?(k=this.blobWithContentType(k,M),this._options.useBase64URL?(0,h.blobToBase64)(k):URL.createObjectURL(k)):null}async loadPackageAssetUrl(k){const M=v(k);if(!M)return null;if(this._snapshotAssetDataUrls?.[M])return this._snapshotAssetDataUrls[M];if(this.isEmfAsset(M)){const R=await this._package.load(M,"uint8array");return R?this.convertEmfAsset(R,M)||this.blobToURL(new Blob([R],{type:this.contentTypeForPath(M)||"image/x-emf"}),M):null}return this.blobToURL(await this._package.load(M,"blob"),M)}async loadPackageAssetDataUrl(k){const M=v(k);if(!M)return null;if(this.isEmfAsset(M)){const P=await this._package.load(M,"uint8array");if(!P)return null;const N=this.convertEmfAsset(P,M);if(N)return N;const it=P?new Blob([P],{type:this.contentTypeForPath(M)||"image/x-emf"}):null;return it?(0,h.blobToBase64)(it):null}const R=await this._package.load(M,"blob"),O=this.blobWithContentType(R,M);return O?(0,h.blobToBase64)(O):null}convertEmfAsset(k,M){if(!k||!(0,i.isEmfBinary)(k))return null;try{return(0,i.convertEmfToSvgDataUrl)(k)}catch(R){return this._options?.debug&&console.warn(`docx-preview: unable to convert EMF asset ${M}`,R),null}}isEmfAsset(k){const M=this.contentTypeForPath(k).toLowerCase();return/\.emf$/i.test(k??"")||M=="image/x-emf"||M=="image/emf"}contentTypeForPath(k){const M=v(k??"").toLowerCase();for(const O of this.contentTypes??[])if(O.partName&&v(O.partName).toLowerCase()==M)return O.contentType??"";const R=/\.([^.\/]+)$/.exec(M)?.[1]??"";return R?(this.contentTypes??[]).find(O=>O.extension?.toLowerCase()==R)?.contentType??"":""}findPartByRelId(k,M=null){var R=this.getRelById(M,k);const O=R&&R.targetMode!=="External"?this.resolveRelationshipTarget(M,R):null;return O?this.partsMap[O]:null}getRelById(k,M){return(k?.rels??this.rels??[]).find(R=>R.id==M)}getPathById(k,M){const R=this.getRelById(k,M);return R&&R.targetMode!=="External"?this.resolveRelationshipTarget(k,R):null}resolveRelationshipTarget(k,M){const[R]=k?(0,h.splitPath)(k.path):[""];return v((0,h.resolvePath)(M.target,R))}}function v(T){return T&&T.startsWith("/")?T.substring(1):T}function _(T,k){const M=k.replace(/{|}|-/g,""),R=new Array(16);for(let O=0;O<16;O++)R[16-O-1]=parseInt(M.substring(2*O,2*O+2),16);for(let O=0;O<32;O++)T[O]=T[O]^R[O%16];return T}d.WordDocument=b}},rr={},(function m(C,d){var f=(function(y,E){if(y==="jszip")return"jszip";if(y[0]==="."){var h=(function(w){for(var A=w.split("/"),r=[],n=0;n<A.length;n++){var e=A[n];e&&e!=="."&&(e===".."?r.pop():r.push(e))}return"./"+r.join("/")})(E.substring(0,E.lastIndexOf("/")+1)+y);if(Se[h])return h;if(Se[h+"/index"])return h+"/index"}if(Se[y])return y;throw new Error("Cannot resolve module "+y+" from "+E)})(C,d||"./docx-preview");if(f==="jszip")return ii;if(rr[f])return rr[f].exports;var g={exports:{}};return rr[f]=g,Se[f](function(y){return m(y,f)},g,g.exports),g.exports})("./docx-preview","./docx-preview")),oi=Zt.defaultOptions,ai=Zt.parseAsync,si=Zt.parseAsyncInWorker,li=Zt.renderDocument,ci=Zt.renderAsync,hi=Zt.awaitRenderedLayout,fi=Zt.collectLayoutSnapshot,di=Zt.yieldToBrowser})),fa=we({default:()=>Ha});function Pe(m){return m.localName||m.tagName.split(":").pop()||m.tagName}function le(m,C){return Array.from(m.querySelectorAll("*")).filter(d=>Pe(d)===C)}function Ut(m,C){return le(m,C)[0]}function pi(m,C,d){return(d?m.getAttributeNS(d,C):null)||m.getAttribute(C)||m.getAttribute(`r:${C}`)}function ui(m){return m?(m.textContent||"").replace(/\s+/g," ").trim():""}function nr(m,C){let d=m?.parentElement||null;for(;d;){if(Pe(d)===C)return d;d=d.parentElement}return null}function Ur(m){const C=Pe(m)==="p"?m:nr(m,"p");if(!C)return;let d=0,f=C.previousElementSibling;for(;f;)Pe(f)==="p"&&(d+=1),f=f.previousElementSibling;return d}function ir(m,C){var d;const f=((d=Ie(C))===null||d===void 0?void 0:d.DOMParser)||globalThis.DOMParser;if(!f)return null;const g=new f().parseFromString(m,"application/xml");return g.querySelector("parsererror")?null:g}function jr(m){const C=[];return m.split("/").forEach(d=>{if(!(!d||d===".")){if(d===".."){C.pop();return}C.push(d)}}),C.join("/")}function gi(m){const C=m.lastIndexOf("/");return C>=0?m.slice(0,C):""}function da(m){const C=gi(m);return jr(`${C}/_rels/${m.slice(C?C.length+1:0)}.rels`)}function mi(m,C){return C.startsWith("/")?jr(C.slice(1)):jr(`${gi(m)}/${C}`)}function pa(m){var C;switch((C=m.split(".").pop())===null||C===void 0?void 0:C.toLowerCase()){case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"bmp":return"image/bmp";case"webp":return"image/webp";case"svg":return"image/svg+xml";default:return"application/octet-stream"}}function Ai(m){if(!m)return;const C=m.trim().match(/^(-?\d+(?:\.\d+)?)(px|pt|in|cm|mm)?$/i);if(!C)return;const d=Number(C[1]);if(!(!Number.isFinite(d)||d<=0))switch((C[2]||"px").toLowerCase()){case"pt":return d*96/72;case"in":return d*96;case"cm":return d*96/2.54;case"mm":return d*96/25.4;default:return d}}function ua(m){const C=new Map;return m&&m.split(";").forEach(d=>{const f=d.indexOf(":");f<=0||C.set(d.slice(0,f).trim().toLowerCase(),d.slice(f+1).trim())}),C}function ga(m){const C=ua(m);return{width:Ai(C.get("width")),height:Ai(C.get("height"))}}function ma(m){const C=nr(m,"inline")||nr(m,"anchor"),d=C?Ut(C,"extent"):void 0,f=Number(d?.getAttribute("cx")),g=Number(d?.getAttribute("cy"));return{width:Number.isFinite(f)&&f>0?f/zr:void 0,height:Number.isFinite(g)&&g>0?g/zr:void 0}}async function bi(m,C,d){const f=m.file(da(C)),g=new Map;if(!f)return g;const y=ir(await f.async("text"),d);return y&&le(y,"Relationship").forEach(E=>{const h=E.getAttribute("Id"),w=E.getAttribute("Target");!h||!w||g.set(h,{id:h,type:E.getAttribute("Type")||"",target:w,targetMode:E.getAttribute("TargetMode")||void 0})}),g}async function Aa(m,C){const d=m.file(C);if(!d)return;const f=await d.async("base64");return`data:${pa(C)};base64,${f}`}function ba(m){return Object.keys(m.files).filter(C=>C==="word/document.xml"||/^word\/header\d+\.xml$/i.test(C)||/^word\/footer\d+\.xml$/i.test(C)).sort((C,d)=>C==="word/document.xml"?-1:d==="word/document.xml"?1:C.localeCompare(d))}function Ca(m,C,d){const f=`${C?.getAttribute("id")||""} ${C?.getAttribute("o:spid")||""}`.toLowerCase(),g=(d||"").toLowerCase();return m.includes("/header")&&(f.includes("watermark")||g.includes("z-index:-")||g.includes("mso-position-horizontal:center"))?"watermark":C?.getAttribute("o:ole")==="t"||C?.getAttribute("ole")==="t"?"ole-preview":"vml-image"}async function va(m,C){var d;const f=[],g=new Set;for(const y of ba(m)){const E=m.file(y);if(!E)continue;const h=ir(await E.async("text"),C);if(!h)continue;const w=await bi(m,y,C);for(const A of le(h,"imagedata")){const r=pi(A,"id","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),n=r?w.get(r):void 0;if(!n||n.targetMode==="External"||!n.type.includes("/image"))continue;const e=mi(y,n.target),t=await Aa(m,e);if(!t)continue;const p=nr(A,"shape"),c=p?.getAttribute("style")||void 0,s=Ca(y,p,c),l=s==="watermark"?`${s}:${e}`:`${s}:${y}:${e}:${(d=Ur(A))!==null&&d!==void 0?d:"end"}`;g.has(l)||(g.add(l),f.push({role:s,key:l,dataUrl:t,sourcePath:e,partPath:y,title:A.getAttribute("o:title")||A.getAttribute("title")||void 0,style:c,...ga(c),paragraphIndex:y==="word/document.xml"?Ur(A):void 0}))}}return f}function De(m){return m?le(m,"pt").sort((C,d)=>Number(C.getAttribute("idx")||0)-Number(d.getAttribute("idx")||0)).map(C=>ui(Ut(C,"v"))).filter(Boolean):[]}function ya(m){const C=De(Ut(Ut(m,"tx")||m,"strCache"))[0]||De(Ut(Ut(m,"tx")||m,"numCache"))[0]||"Series",d=De(Ut(Ut(m,"cat")||m,"strCache")),f=De(Ut(Ut(m,"cat")||m,"numCache")),g=De(Ut(Ut(m,"val")||m,"numCache")).map(y=>Number(y)).filter(y=>Number.isFinite(y));return{name:C,categories:d.length?d:f,values:g}}function Ea(m,C,d,f){const g=["lineChart","barChart","pieChart","areaChart","scatterChart"].map(r=>le(m,r)[0]).find(Boolean),y=g?Pe(g):"chart",E=ui(Ut(Ut(m,"title")||m,"t"))||C.split("/").pop()||"Chart",h=le(g||m,"ser").map(ya).filter(r=>r.values.length),{width:w,height:A}=ma(d);if(h.length)return{key:`chart:${C}:${f??"end"}`,title:E,type:y,sourcePath:C,series:h,width:w,height:A,paragraphIndex:f}}async function wa(m,C){const d="word/document.xml",f=m.file(d);if(!f)return[];const g=ir(await f.async("text"),C);if(!g)return[];const y=await bi(m,d,C),E=[],h=new Set;for(const w of le(g,"chart")){const A=pi(w,"id","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),r=A?y.get(A):void 0;if(!r||r.targetMode==="External"||!r.type.includes("/chart"))continue;const n=mi(d,r.target),e=m.file(n);if(!e)continue;const t=ir(await e.async("text"),C),p=Ur(w),c=t?Ea(t,n,w,p):void 0;!c||h.has(c.key)||(h.add(c.key),E.push(c))}return E}function ce(m){return m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function _a(m){var C;const d=Math.max(360,Math.round(m.width||520)),f=Math.max(220,Math.round(m.height||320)),g={top:52,right:30,bottom:56,left:54},y=d-g.left-g.right,E=f-g.top-g.bottom,h=m.series.flatMap(u=>u.values),w=Math.max(...h,1),A=Math.min(...h,0),r=Math.max(w-A,1),n=["#2563eb","#10b981","#f97316","#8b5cf6","#ef4444"],e=Math.max(...m.series.map(u=>u.values.length),1),t=u=>g.left+(e===1?y/2:u*y/(e-1)),p=u=>g.top+E-(u-A)/r*E,c=m.series.map((u,o)=>{const i=n[o%n.length];return`<polyline points="${u.values.map((a,b)=>`${t(b).toFixed(1)},${p(a).toFixed(1)}`).join(" ")}" fill="none" stroke="${i}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>${u.values.map((a,b)=>`<circle cx="${t(b).toFixed(1)}" cy="${p(a).toFixed(1)}" r="3.5" fill="${i}"><title>${ce(u.name)}: ${ce(String(a))}</title></circle>`).join("")}`}).join(""),s=(((C=m.series.find(u=>u.categories.length))===null||C===void 0?void 0:C.categories)||[]).slice(0,e).map((u,o)=>{const i=t(o),a=u.length>14?`${u.slice(0,13)}...`:u;return`<text x="${i.toFixed(1)}" y="${f-22}" text-anchor="middle" fill="#64748b" font-size="11">${ce(a)}</text>`}).join(""),l=m.series.slice(0,5).map((u,o)=>`<g transform="translate(${g.left+o*98} 30)"><rect width="10" height="10" rx="2" fill="${n[o%n.length]}"/><text x="15" y="9" fill="#475569" font-size="11">${ce(u.name)}</text></g>`).join("");return`<svg viewBox="0 0 ${d} ${f}" role="img" aria-label="${ce(m.title)}">
85
+ `}numberingCounter(e,t){return`${this.className}-num-${e}-${t}`}numberingRestartLevel(e){if(e.level<=0)return null;if(e.restart==null)return e.level-1;if(e.restart==0)return null;const t=e.restart-1;return t>=0&&t<e.level?t:null}numberingMarkerRunStyle(e,t){if(!e)return e;const p={...e};return t&&delete p["font-family"],p}normalizeNumberingLevelText(e,t,p){if(t!="bullet"||!e)return{text:e,normalized:!1};const c=(p?.["font-family"]??"").toLowerCase();let s=!1,l=null;if(c.includes("wingdings"))l=this.wingdingsBulletMap();else{if(!c.includes("symbol"))return{text:e,normalized:!1};l=this.symbolBulletMap()}let u="";for(const o of e){const i=l[o.charCodeAt(0)];i?(u+=i,s=!0):u+=o}return{text:u,normalized:s}}symbolBulletMap(){return{183:"•",8226:"•",61623:"•"}}wingdingsBulletMap(){return{61548:"●",61550:"■",61557:"◆",61598:"·",61599:"•",61600:"▪",61601:"○",61604:"◉",61605:"◎",61607:"▪",61608:"◻",61656:"➢",61672:"➔",61690:"▫",61691:"✗",61692:"✓",61693:"☒",61694:"☑"}}levelTextToContent(e,t,p,c,s){const l=[];let u=0;for(const a of e.matchAll(/%\d+/g)){a.index>u&&l.push(`"${this.escapeCssString(e.substring(u,a.index))}"`);let b=parseInt(a[0].substring(1),10)-1;const v=s?.get(`${p}:${b}`)??c??"decimal";l.push(`counter(${this.numberingCounter(p,b)}, ${v})`),u=a.index+a[0].length}const o=e.substring(u);o&&l.push(`"${this.escapeCssString(o)}"`);const i=this.numberingSuffixToCssContent(t);return i&&l.push(i),l.length>0?l.join(" "):'""'}numberingSuffixToCssContent(e){switch(e||"tab"){case"nothing":return"";case"space":return'"\\000020"';default:return'"\\000009"'}}escapeCssString(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r?\n/g,"\\A ")}numFormatToCssValue(e){return{none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"}[e]??e??"decimal"}refreshTabStops(){this.options.experimental&&setTimeout(()=>{const e=(0,y.computePixelToPoint)();for(let t of this.currentTabs)(0,y.updateTabStop)(t.span,t.stops,this.defaultTabSize,e)},500)}createElementNS(e,t,p,c){return this.h({ns:e,tagName:t,children:c,...p})}createElement(e,t,p){return this.createElementNS(h.ns.html,e,t,p)}createMathMLElement(e,t,p){return this.createElementNS(h.ns.mathML,e,t,p)}createSvgElement(e,t,p){return this.createElementNS(h.ns.svg,e,t,p)}later(e){this.postRenderTasks.push(e)}}},"./html":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.ns=void 0,d.h=function y(E){if((0,f.isString)(E))return document.createTextNode(E);if(E instanceof Node)return E;const{ns:h,tagName:w,className:A,style:r,children:n,...e}=E;if(w==="#fragment")return document.createDocumentFragment();if(w==="#comment")return document.createComment(n[0]);const t=h?document.createElementNS(h,w):document.createElement(w);if(A&&t.setAttribute("class",A),r&&((0,f.isString)(r)?t.setAttribute("style",r):Object.assign(t.style,r)),e)for(const[p,c]of Object.entries(e))c!==void 0&&(t[p]=c);return n&&n.forEach(p=>t.appendChild(y(p))),t},d.cx=function(...y){return y.filter(Boolean).join(" ")};const f=m("./utils");var g;(function(y){y.html="http://www.w3.org/1999/xhtml",y.svg="http://www.w3.org/2000/svg",y.mathML="http://www.w3.org/1998/Math/MathML"})(g||(d.ns=g={}))},"./input-validation":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.EMPTY_DOCX_ERROR_MESSAGE=void 0,d.assertNonEmptyDocxInput=function(f){if((function(g){return g==null?0:typeof Blob<"u"&&g instanceof Blob?g.size:typeof ArrayBuffer<"u"&&(g instanceof ArrayBuffer||ArrayBuffer.isView(g))?g.byteLength:typeof g.size=="number"?g.size:typeof g.byteLength=="number"?g.byteLength:typeof g.length=="number"?g.length:null})(f)===0)throw new Error(d.EMPTY_DOCX_ERROR_MESSAGE)},d.EMPTY_DOCX_ERROR_MESSAGE="文件为空或尚未保存,无法作为 Word 文档打开。请在 WPS/Word 中保存后重新上传。"},"./javascript":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.computePixelToPoint=function(h=document.body){const w=document.createElement("div");w.style.width="100pt",h.appendChild(w);const A=100/w.offsetWidth;return h.removeChild(w),A},d.updateTabStop=function(h,w,A,r=.75){const n=h.closest("p");if(!n)return;const e=h.getBoundingClientRect(),t=n.getBoundingClientRect(),p=getComputedStyle(n),c=y(p.marginInlineStart||p.marginLeft),s=y(p.marginInlineEnd||p.marginRight),l=w?.length>0?w.map(M=>({pos:E(M.position),leader:M.leader,style:M.style})).sort((M,R)=>M.pos-R.pos):[f],u=l[l.length-1],o=(t.width+c+s)*r,i=Number.isFinite(E(A))?E(A):36;let a=u.pos+i;if(a<o)for(;a<o&&l.length<g;a+=i)l.push({...f,pos:a});const b=t.left-c,v=(e.left-b)*r,_=l.find(M=>M.style!="clear"&&M.pos>v);if(_==null)return;let T=1;if(_.style=="right"||_.style=="center"){const M=Array.from(n.querySelectorAll(`.${h.className}`)),R=M.indexOf(h)+1,O=document.createRange();O.setStart(h,1),R<M.length?O.setEndBefore(M[R]):O.setEndAfter(n);const P=_.style=="center"?.5:1,N=O.getBoundingClientRect(),it=N.left+P*N.width-b;T=_.pos-it*r}else T=_.pos-v;const k=Math.max(Number.isFinite(T)?T:0,0);switch(h.innerHTML="&nbsp;",h.style.display="inline-block",h.style.width=`${k.toFixed(2)}pt`,h.style.minWidth="0pt",h.style.lineHeight="1",h.style.whiteSpace="nowrap",h.style.wordSpacing="normal",h.style.textDecoration="none",h.style.borderBottom="",h.style.height="",h.style.transform="",_.leader){case"dot":case"middleDot":h.style.borderBottom="1px dotted currentColor",h.style.height=".85em",h.style.transform="translateY(-.18em)";break;case"hyphen":case"heavy":case"underscore":h.style.borderBottom="1px solid currentColor",h.style.height=".85em",h.style.transform="translateY(-.18em)"}};const f={pos:0,leader:"none",style:"left"},g=50;function y(h){const w=parseFloat(h);return Number.isFinite(w)?w:0}function E(h){return parseFloat(h)}},"./length":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.Length=void 0;const f=m("./utils");class g{constructor(E,h){this.value=E,this.type=h}static parse(E){const h=parseFloat(E),w=/p[tx]$/i.exec(E)?.[0];return new g(h,w)}static from(E){return(0,f.isString)(E)?g.parse(E):E instanceof g?E:null}add(E){if(E.type!==this.type)throw new Error("Can't do math on different types");return new g(this.value+E.value,this.type)}mul(E){return new g(this.value*E,this.type)}valueOf(){return this.value}toString(){return`${this.value.toFixed(2)}${this.type??""}`}}d.Length=g},"./license-gate":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.assertViewerLicense=function(f,g){}},"./metafile/emf-to-svg":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.isEmfBinary=E,d.convertEmfToSvgDataUrl=function(x,D){const I=h(x,D);return I?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(I)}`:null},d.convertEmfToSvg=h;const f={HEADER:1,POLYBEZIER:2,POLYGON:3,POLYLINE:4,POLYBEZIERTO:5,POLYLINETO:6,POLYPOLYLINE:7,POLYPOLYGON:8,SETWINDOWEXTEX:9,SETWINDOWORGEX:10,SETVIEWPORTEXTEX:11,SETVIEWPORTORGEX:12,EOF:14,SETPIXELV:15,SETMAPMODE:17,SETBKMODE:18,SETPOLYFILLMODE:19,SETTEXTALIGN:22,SETTEXTCOLOR:24,SETBKCOLOR:25,MOVETOEX:27,SCALEVIEWPORTEXTEX:31,SCALEWINDOWEXTEX:32,SAVEDC:33,RESTOREDC:34,SETWORLDTRANSFORM:35,MODIFYWORLDTRANSFORM:36,SELECTOBJECT:37,CREATEPEN:38,CREATEBRUSHINDIRECT:39,DELETEOBJECT:40,ANGLEARC:41,ELLIPSE:42,RECTANGLE:43,ROUNDRECT:44,ARC:45,CHORD:46,PIE:47,LINETO:54,ARCTO:55,POLYDRAW:56,BEGINPATH:59,ENDPATH:60,CLOSEFIGURE:61,FILLPATH:62,STROKEANDFILLPATH:63,STROKEPATH:64,BITBLT:76,STRETCHBLT:77,STRETCHDIBITS:81,EXTCREATEFONTINDIRECTW:82,EXTTEXTOUTA:83,EXTTEXTOUTW:84,POLYBEZIER16:85,POLYGON16:86,POLYLINE16:87,POLYBEZIERTO16:88,POLYLINETO16:89,POLYPOLYLINE16:90,POLYPOLYGON16:91,POLYDRAW16:92,EXTCREATEPEN:95,POLYTEXTOUTA:96,POLYTEXTOUTW:97,SMALLTEXTOUT:108,ALPHABLEND:114,TRANSPARENTBLT:116},g={0:{type:"brush",color:"#ffffff"},1:{type:"brush",color:"#c0c0c0"},2:{type:"brush",color:"#808080"},3:{type:"brush",color:"#404040"},4:{type:"brush",color:"#000000"},5:{type:"brush",color:"none",nullBrush:!0},6:{type:"pen",color:"#ffffff",width:1},7:{type:"pen",color:"#000000",width:1},8:{type:"pen",color:"none",width:0,nullPen:!0},18:{type:"brush",color:"#ffffff"},19:{type:"pen",color:"#000000",width:1}},y={m11:1,m12:0,m21:0,m22:1,dx:0,dy:0};function E(x){if(!x||x.length<48)return!1;const D=e(x);return D.getUint32(0,!0)==f.HEADER&&D.getUint32(40,!0)==1179469088}function h(x,D={}){if(!E(x))return null;const I=e(x),H=I.getUint32(4,!0),L=t(I,8),B=t(I,24),Y=I.byteLength>=52?I.getUint32(48,!0):0,Q=Math.max(1,L.right-L.left),K=Math.max(1,L.bottom-L.top),lt=Math.max(1,B.right-B.left)/100,ft=Math.max(1,B.bottom-B.top)/100,X={world:n(y),windowOrg:{x:0,y:0},windowExt:null,viewportOrg:{x:0,y:0},viewportExt:null,pen:{type:"pen",color:"#000000",width:1},brush:{type:"brush",color:"#ffffff",nullBrush:!0},font:null,textColor:"#000000",bkColor:"#ffffff",bkMode:1,polyFillMode:1,textAlign:0,currentPoint:{x:0,y:0}},mt=[],At={},Et=[];let ct=Math.max(8,H||108),yt=1,Rt="",St=!1,It=0;const Lt=D.maxRecords??Math.max(1e4,Y+100),Ft=D.maxShapes??5e4,_t=Ct=>{!Ct||It>=Ft||(Et.push(Ct),It++)},Mt=Ct=>{Ct&&(Rt+=(Rt?" ":"")+Ct)};for(;ct+8<=I.byteLength&&yt++<=Lt;){const Ct=I.getUint32(ct,!0),Dt=I.getUint32(ct+4,!0);if(Dt<8||ct+Dt>I.byteLength)break;switch(Ct){case f.EOF:ct+=Dt,yt=Lt+1;break;case f.SETWINDOWEXTEX:X.windowExt=c(I,ct+8);break;case f.SETWINDOWORGEX:X.windowOrg=p(I,ct+8);break;case f.SETVIEWPORTEXTEX:X.viewportExt=c(I,ct+8);break;case f.SETVIEWPORTORGEX:X.viewportOrg=p(I,ct+8);break;case f.SCALEWINDOWEXTEX:X.windowExt&&(X.windowExt=a(I,ct,X.windowExt));break;case f.SCALEVIEWPORTEXTEX:X.viewportExt&&(X.viewportExt=a(I,ct,X.viewportExt));break;case f.SETWORLDTRANSFORM:X.world=l(I,ct+8);break;case f.MODIFYWORLDTRANSFORM:{const bt=l(I,ct+8),wt=I.getUint32(ct+32,!0);wt==1?X.world=n(y):wt==2?X.world=u(bt,X.world):wt==3?X.world=u(X.world,bt):wt==4&&(X.world=bt);break}case f.SAVEDC:mt.push(w(X));break;case f.RESTOREDC:{const bt=I.getInt32(ct+8,!0);if(bt<0)for(let wt=0;wt<Math.min(-bt,mt.length);wt++)Object.assign(X,mt.pop());else if(bt>0&&bt<=mt.length){const wt=mt[bt-1];mt.length=bt-1,Object.assign(X,w(wt))}break}case f.SETBKMODE:X.bkMode=I.getUint32(ct+8,!0);break;case f.SETPOLYFILLMODE:X.polyFillMode=I.getUint32(ct+8,!0);break;case f.SETTEXTALIGN:X.textAlign=I.getUint32(ct+8,!0);break;case f.SETTEXTCOLOR:X.textColor=b(I.getUint32(ct+8,!0));break;case f.SETBKCOLOR:X.bkColor=b(I.getUint32(ct+8,!0));break;case f.CREATEPEN:{const bt=I.getUint32(ct+8,!0),wt=I.getUint32(ct+12,!0),jt=Math.abs(I.getInt32(ct+16,!0));At[bt]={type:"pen",color:b(I.getUint32(ct+24,!0)),width:jt||1,nullPen:(15&wt)==5};break}case f.EXTCREATEPEN:{const bt=I.getUint32(ct+8,!0),wt=I.getUint32(ct+28,!0),jt=Math.abs(I.getInt32(ct+32,!0)),ee=I.getUint32(ct+36,!0);At[bt]={type:"pen",color:b(I.getUint32(ct+40,!0)),width:jt||1,nullPen:(15&wt)==5||ee==1};break}case f.CREATEBRUSHINDIRECT:{const bt=I.getUint32(ct+8,!0),wt=I.getUint32(ct+12,!0);At[bt]={type:"brush",color:b(I.getUint32(ct+16,!0)),nullBrush:wt==1};break}case f.EXTCREATEFONTINDIRECTW:At[I.getUint32(ct+8,!0)]=W(I,ct+12,Dt-12);break;case f.SELECTOBJECT:{const bt=I.getUint32(ct+8,!0),wt=2147483648&bt?g[2147483647&bt]:At[bt];wt?.type=="pen"?X.pen=A(wt):wt?.type=="brush"?X.brush=r(wt):wt?.type=="font"&&(X.font={...wt});break}case f.DELETEOBJECT:delete At[I.getUint32(ct+8,!0)];break;case f.BEGINPATH:St=!0,Rt="";break;case f.ENDPATH:St=!1;break;case f.CLOSEFIGURE:Mt("Z");break;case f.MOVETOEX:{const bt=o(X,p(I,ct+8));X.currentPoint=bt,St&&Mt(`M ${_(bt.x)} ${_(bt.y)}`);break}case f.LINETO:{const bt=o(X,p(I,ct+8));St?Mt(`L ${_(bt.x)} ${_(bt.y)}`):_t(`<path d="M ${_(X.currentPoint.x)} ${_(X.currentPoint.y)} L ${_(bt.x)} ${_(bt.y)}" ${k(X,!1,!0)}/>`),X.currentPoint=bt;break}case f.POLYLINE:case f.POLYGON:O(I,ct,Ct==f.POLYGON,!1,St,X,Mt,_t);break;case f.POLYLINETO:O(I,ct,!1,!0,St,X,Mt,_t);break;case f.POLYLINE16:case f.POLYGON16:R(I,ct,Ct==f.POLYGON16,!1,St,X,Mt,_t);break;case f.POLYLINETO16:R(I,ct,!1,!0,St,X,Mt,_t);break;case f.POLYBEZIER:N(I,ct,!1,!1,St,X,Mt,_t);break;case f.POLYBEZIERTO:N(I,ct,!1,!0,St,X,Mt,_t);break;case f.POLYBEZIER16:N(I,ct,!0,!1,St,X,Mt,_t);break;case f.POLYBEZIERTO16:N(I,ct,!0,!0,St,X,Mt,_t);break;case f.POLYPOLYLINE:case f.POLYPOLYGON:it(I,ct,Ct==f.POLYPOLYGON,!1,St,X,Mt,_t);break;case f.POLYPOLYLINE16:case f.POLYPOLYGON16:it(I,ct,Ct==f.POLYPOLYGON16,!0,St,X,Mt,_t);break;case f.POLYDRAW:J(I,ct,!1,St,X,Mt,_t);break;case f.POLYDRAW16:J(I,ct,!0,St,X,Mt,_t);break;case f.RECTANGLE:ot(I,ct,X,_t,!1);break;case f.ELLIPSE:tt(I,ct,X,_t);break;case f.ROUNDRECT:ot(I,ct,X,_t,!0);break;case f.ARC:case f.ARCTO:case f.CHORD:case f.PIE:ht(I,ct,Ct,St,X,Mt,_t);break;case f.FILLPATH:M(Rt,X,_t,!0,!1),Rt="";break;case f.STROKEPATH:M(Rt,X,_t,!1,!0),Rt="";break;case f.STROKEANDFILLPATH:M(Rt,X,_t,!0,!0),Rt="";break;case f.EXTTEXTOUTA:case f.EXTTEXTOUTW:G(I,ct,Dt,X,_t,Ct==f.EXTTEXTOUTW);break;case f.POLYTEXTOUTA:case f.POLYTEXTOUTW:gt(I,ct,Dt,X,_t,Ct==f.POLYTEXTOUTW);break;case f.SMALLTEXTOUT:nt(I,ct,Dt,X,_t);break;case f.SETPIXELV:et(I,ct,X,_t);break;case f.BITBLT:case f.STRETCHBLT:case f.STRETCHDIBITS:case f.ALPHABLEND:case f.TRANSPARENTBLT:q(I,ct,Dt,Ct,X,_t)}ct+=Dt}if(Rt&&M(Rt,X,_t,!0,!0),!Et.length){const Ct=(function(Dt,bt){const wt=(function(Kt){const re=(function(Pt){const Ot=[137,80,78,71,13,10,26,10];for(let kt=0;kt+Ot.length+12<=Pt.length;kt++){if(!F(Pt,Ot,kt))continue;let Gt=kt+8;for(;Gt+12<=Pt.length;){const pt=ut(Pt,Gt),fn=String.fromCharCode(Pt[Gt+4],Pt[Gt+5],Pt[Gt+6],Pt[Gt+7]);if(Gt+=12+pt,Gt>Pt.length)break;if(fn=="IEND")return Pt.subarray(kt,Gt)}}return null})(Kt);if(re)return`data:image/png;base64,${z(re)}`;const Vt=(function(Pt){for(let Ot=0;Ot+4<Pt.length;Ot++)if(Pt[Ot]==255&&Pt[Ot+1]==216&&Pt[Ot+2]==255){for(let kt=Ot+4;kt+1<Pt.length;kt++)if(Pt[kt]==255&&Pt[kt+1]==217)return Pt.subarray(Ot,kt+2)}return null})(Kt);if(Vt)return`data:image/jpeg;base64,${z(Vt)}`;const ne=(function(Pt){for(let Ot=0;Ot+14<Pt.length;Ot++){if(Pt[Ot]!=66||Pt[Ot+1]!=77)continue;const kt=S(Pt,Ot+2);if(kt>14&&Ot+kt<=Pt.length)return Pt.subarray(Ot,Ot+kt)}return null})(Kt);return ne?`data:image/bmp;base64,${z(ne)}`:null})(Dt);if(!wt)return[];const jt=Math.max(1,bt.right-bt.left),ee=Math.max(1,bt.bottom-bt.top);return[`<image x="${_(bt.left)}" y="${_(bt.top)}" width="${_(jt)}" height="${_(ee)}" href="${wt}" preserveAspectRatio="xMidYMid meet"/>`]})(x,L);Ct.length&&Et.push(...Ct)}return Et.length?`<svg xmlns="http://www.w3.org/2000/svg" width="${_(lt)}mm" height="${_(ft)}mm" viewBox="${_(L.left)} ${_(L.top)} ${_(Q)} ${_(K)}" preserveAspectRatio="xMidYMid meet" data-docx-metafile="emf">${Et.join("")}</svg>`:(function(Ct,Dt,bt,wt,jt){return`<svg xmlns="http://www.w3.org/2000/svg" width="${_(wt)}mm" height="${_(jt)}mm" viewBox="${_(bt.left)} ${_(bt.top)} ${_(Ct)} ${_(Dt)}" preserveAspectRatio="xMidYMid meet" data-docx-metafile="emf"><rect x="${_(bt.left)}" y="${_(bt.top)}" width="${_(Ct)}" height="${_(Dt)}" fill="none" stroke="#999" stroke-width="1"/><text x="${_(bt.left+Ct/2)}" y="${_(bt.top+Dt/2)}" text-anchor="middle" font-size="12" fill="#666">${T("Unsupported EMF image")}</text></svg>`})(Q,K,L,lt,ft)}function w(x){return{world:n(x.world),windowOrg:{...x.windowOrg},windowExt:x.windowExt?{...x.windowExt}:null,viewportOrg:{...x.viewportOrg},viewportExt:x.viewportExt?{...x.viewportExt}:null,pen:A(x.pen),brush:r(x.brush),font:x.font?{...x.font}:null,textColor:x.textColor,bkColor:x.bkColor,bkMode:x.bkMode,polyFillMode:x.polyFillMode,textAlign:x.textAlign,currentPoint:{...x.currentPoint}}}function A(x){return{...x}}function r(x){return{...x}}function n(x){return{...x}}function e(x){return new DataView(x.buffer,x.byteOffset,x.byteLength)}function t(x,D){return{left:x.getInt32(D,!0),top:x.getInt32(D+4,!0),right:x.getInt32(D+8,!0),bottom:x.getInt32(D+12,!0)}}function p(x,D){return{x:x.getInt32(D,!0),y:x.getInt32(D+4,!0)}}function c(x,D){return p(x,D)}function s(x,D){return{x:x.getInt16(D,!0),y:x.getInt16(D+2,!0)}}function l(x,D){return{m11:x.getFloat32(D,!0),m12:x.getFloat32(D+4,!0),m21:x.getFloat32(D+8,!0),m22:x.getFloat32(D+12,!0),dx:x.getFloat32(D+16,!0),dy:x.getFloat32(D+20,!0)}}function u(x,D){return{m11:x.m11*D.m11+x.m12*D.m21,m12:x.m11*D.m12+x.m12*D.m22,m21:x.m21*D.m11+x.m22*D.m21,m22:x.m21*D.m12+x.m22*D.m22,dx:x.dx*D.m11+x.dy*D.m21+D.dx,dy:x.dx*D.m12+x.dy*D.m22+D.dy}}function o(x,D){const I=x.world;let H=D.x*I.m11+D.y*I.m21+I.dx,L=D.x*I.m12+D.y*I.m22+I.dy;return x.windowExt&&x.viewportExt&&x.windowExt.x&&x.windowExt.y&&(H=(H-x.windowOrg.x)*x.viewportExt.x/x.windowExt.x+x.viewportOrg.x,L=(L-x.windowOrg.y)*x.viewportExt.y/x.windowExt.y+x.viewportOrg.y),{x:H,y:L}}function i(x){let D=Math.hypot(x.world.m11,x.world.m12),I=Math.hypot(x.world.m21,x.world.m22);x.windowExt&&x.viewportExt&&x.windowExt.x&&x.windowExt.y&&(D*=Math.abs(x.viewportExt.x/x.windowExt.x),I*=Math.abs(x.viewportExt.y/x.windowExt.y));const H=(D+I)/2;return Number.isFinite(H)&&H>0?H:1}function a(x,D,I){const H=x.getInt32(D+8,!0),L=x.getInt32(D+12,!0),B=x.getInt32(D+16,!0),Y=x.getInt32(D+20,!0);return{x:L?I.x*H/L:I.x,y:Y?I.y*B/Y:I.y}}function b(x){const D=x>>8&255,I=x>>16&255;return`#${v(255&x)}${v(D)}${v(I)}`}function v(x){return Math.max(0,Math.min(255,0|x)).toString(16).padStart(2,"0")}function _(x){return Number.isFinite(x)?""+Math.round(1e3*x)/1e3:"0"}function T(x){return`${x??""}`.replace(/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F-\u009F]/g,"").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function k(x,D,I){const H=[];if(D&&!x.brush.nullBrush?(H.push(`fill="${x.brush.color}"`),H.push(`fill-rule="${x.polyFillMode==2?"nonzero":"evenodd"}"`)):H.push('fill="none"'),I&&!x.pen.nullPen){const L=i(x),B=x.pen.width==0?1:Math.max(.35,x.pen.width*L);H.push(`stroke="${x.pen.color}"`),H.push(`stroke-width="${_(B)}"`),H.push('stroke-linecap="square"'),H.push('stroke-linejoin="miter"')}else H.push('stroke="none"');return H.join(" ")}function M(x,D,I,H,L){x&&I(`<path d="${x}" ${k(D,H,L)}/>`)}function R(x,D,I,H,L,B,Y,Q){const K=x.getUint32(D+24,!0);if(!K||D+28+4*K>x.byteLength)return;const lt=[];for(let ft=0;ft<K;ft++)lt.push(o(B,s(x,D+28+4*ft)));P(lt,I,H,L,B,Y,Q)}function O(x,D,I,H,L,B,Y,Q){const K=x.getUint32(D+24,!0);if(!K||D+28+8*K>x.byteLength)return;const lt=[];for(let ft=0;ft<K;ft++)lt.push(o(B,p(x,D+28+8*ft)));P(lt,I,H,L,B,Y,Q)}function P(x,D,I,H,L,B,Y){if(!x.length)return;let Q=H&&I?"":I?`M ${_(L.currentPoint.x)} ${_(L.currentPoint.y)}`:`M ${_(x[0].x)} ${_(x[0].y)}`;for(let K=I?0:1;K<x.length;K++)Q+=` L ${_(x[K].x)} ${_(x[K].y)}`;D&&(Q+=" Z"),L.currentPoint=x[x.length-1],H?B(Q.trim()):Y(`<path d="${Q.trim()}" ${k(L,D,!0)}/>`)}function N(x,D,I,H,L,B,Y,Q){const K=x.getUint32(D+24,!0),lt=I?4:8;if(!K||D+28+K*lt>x.byteLength)return;const ft=[];for(let At=0;At<K;At++){const Et=I?s(x,D+28+At*lt):p(x,D+28+At*lt);ft.push(o(B,Et))}let X=L&&H?"":H?`M ${_(B.currentPoint.x)} ${_(B.currentPoint.y)}`:`M ${_(ft[0].x)} ${_(ft[0].y)}`,mt=H?B.currentPoint:ft[0];for(let At=H?0:1;At+2<ft.length;At+=3){const Et=ft[At],ct=ft[At+1],yt=ft[At+2];X+=` C ${_(Et.x)} ${_(Et.y)} ${_(ct.x)} ${_(ct.y)} ${_(yt.x)} ${_(yt.y)}`,mt=yt}B.currentPoint=mt,L?Y(X.trim()):Q(`<path d="${X.trim()}" ${k(B,!1,!0)}/>`)}function it(x,D,I,H,L,B,Y,Q){const K=x.getUint32(D+24,!0),lt=x.getUint32(D+28,!0),ft=D+32,X=ft+4*K,mt=H?4:8;if(!K||!lt||X+lt*mt>x.byteLength)return;let At=0;for(let Et=0;Et<K;Et++){const ct=x.getUint32(ft+4*Et,!0);if(!ct||At+ct>lt)break;const yt=[];for(let Rt=0;Rt<ct;Rt++){const St=X+(At+Rt)*mt,It=H?s(x,St):p(x,St);yt.push(o(B,It))}P(yt,I,!1,L,B,Y,Q),At+=ct}}function J(x,D,I,H,L,B,Y){const Q=x.getUint32(D+24,!0),K=I?4:8,lt=D+28,ft=lt+Q*K;if(!Q||ft+Q>x.byteLength)return;const X=[];for(let Et=0;Et<Q;Et++){const ct=lt+Et*K,yt=I?s(x,ct):p(x,ct);X.push(o(L,yt))}let mt="",At=0;for(;At<Q;){const Et=x.getUint8(ft+At),ct=6&Et;ct==6?(mt+=` M ${_(X[At].x)} ${_(X[At].y)}`,L.currentPoint=X[At],At++):ct==2?(mt+=` L ${_(X[At].x)} ${_(X[At].y)}`,L.currentPoint=X[At],At++):ct==4&&At+2<Q?(mt+=` C ${_(X[At].x)} ${_(X[At].y)} ${_(X[At+1].x)} ${_(X[At+1].y)} ${_(X[At+2].x)} ${_(X[At+2].y)}`,L.currentPoint=X[At+2],At+=3):At++,1&Et&&(mt+=" Z")}mt=mt.trim(),mt&&(H?B(mt):Y(`<path d="${mt}" ${k(L,!1,!0)}/>`))}function ot(x,D,I,H,L){const B=t(x,D+8),Y=o(I,{x:B.left,y:B.top}),Q=o(I,{x:B.right,y:B.bottom}),K=Math.min(Y.x,Q.x),lt=Math.min(Y.y,Q.y),ft=Math.abs(Q.x-Y.x),X=Math.abs(Q.y-Y.y),mt=L?` rx="${_(Math.min(ft,X)/8)}" ry="${_(Math.min(ft,X)/8)}"`:"";H(`<rect x="${_(K)}" y="${_(lt)}" width="${_(ft)}" height="${_(X)}"${mt} ${k(I,!0,!0)}/>`)}function tt(x,D,I,H){const L=t(x,D+8),B=o(I,{x:L.left,y:L.top}),Y=o(I,{x:L.right,y:L.bottom}),Q=(B.x+Y.x)/2,K=(B.y+Y.y)/2,lt=Math.abs(Y.x-B.x)/2,ft=Math.abs(Y.y-B.y)/2;H(`<ellipse cx="${_(Q)}" cy="${_(K)}" rx="${_(lt)}" ry="${_(ft)}" ${k(I,!0,!0)}/>`)}function ht(x,D,I,H,L,B,Y){const Q=t(x,D+8),K=p(x,D+24),lt=p(x,D+32),ft=(Q.left+Q.right)/2,X=(Q.top+Q.bottom)/2,mt=Math.abs(Q.right-Q.left)/2,At=Math.abs(Q.bottom-Q.top)/2;if(!mt||!At)return;const Et=Math.atan2(K.y-X,K.x-ft);let ct=Math.atan2(lt.y-X,lt.x-ft),yt=ct-Et;yt<=0&&(yt+=2*Math.PI);const Rt=yt>Math.PI?1:0,St=o(L,{x:ft+Math.cos(Et)*mt,y:X+Math.sin(Et)*At}),It=o(L,{x:ft+Math.cos(ct)*mt,y:X+Math.sin(ct)*At}),Lt=o(L,{x:ft,y:X}),Ft=o(L,{x:ft+mt,y:X}),_t=o(L,{x:ft,y:X+At}),Mt=Math.max(.01,Math.abs(Ft.x-Lt.x)||Math.abs(_t.x-Lt.x)),Ct=Math.max(.01,Math.abs(_t.y-Lt.y)||Math.abs(Ft.y-Lt.y)),Dt=`A ${_(Mt)} ${_(Ct)} 0 ${Rt} 1 ${_(It.x)} ${_(It.y)}`;let bt=`M ${_(St.x)} ${_(St.y)} ${Dt}`,wt=!1;I==f.CHORD?(bt+=" Z",wt=!0):I==f.PIE&&(bt+=` L ${_(Lt.x)} ${_(Lt.y)} Z`,wt=!0),I==f.ARCTO&&(L.currentPoint=It),H?B(bt):Y(`<path d="${bt}" ${k(L,wt,!0)}/>`)}function W(x,D,I){const H=I>=4?x.getInt32(D,!0):12,L=I>=20?x.getInt32(D+16,!0):400,B=I>=21&&x.getUint8(D+20)!=0,Y=I>=22&&x.getUint8(D+21)!=0;let Q="";const K=D+28,lt=Math.max(0,Math.min(64,I-28));for(let ft=0;ft+1<lt;ft+=2){const X=x.getUint16(K+ft,!0);if(!X)break;Q+=String.fromCharCode(X)}return{type:"font",family:Q,size:Math.abs(H)||12,weight:L,italic:B,underline:Y}}function G(x,D,I,H,L,B){if(I<76)return;const Y=o(H,p(x,D+36)),Q=x.getUint32(D+44,!0),K=x.getUint32(D+48,!0);!Q||K<=0||K+Q*(B?2:1)>I||V(B?j(x,D+K,Q):U(new Uint8Array(x.buffer,x.byteOffset+D+K,Q)),Y,H,L)}function gt(x,D,I,H,L,B){if(I<40)return;const Y=x.getUint32(D+36,!0);let Q=D+40;for(let K=0;K<Y&&Q+40<=D+I;K++,Q+=40){const lt=o(H,p(x,Q)),ft=x.getUint32(Q+8,!0),X=x.getUint32(Q+12,!0);!ft||!X||X+ft*(B?2:1)>I||V(B?j(x,D+X,ft):U(new Uint8Array(x.buffer,x.byteOffset+D+X,ft)),lt,H,L)}}function nt(x,D,I,H,L){if(I<36)return;const B=o(H,p(x,D+8)),Y=x.getUint32(D+16,!0),Q=512&x.getUint32(D+20,!0)?40:28;!Y||Q+Y>I||V(U(new Uint8Array(x.buffer,x.byteOffset+D+Q,Y)),B,H,L)}function j(x,D,I){let H="";for(let L=0;L<I;L++){const B=x.getUint16(D+2*L,!0);B&&(H+=String.fromCharCode(B))}return H}function U(x){if(!x.length)return"";const D=globalThis.TextDecoder;if(D)try{return new D("gb18030").decode(x).replace(/\0+$/g,"")}catch{try{return new D("windows-1252").decode(x).replace(/\0+$/g,"")}catch{}}let I="";for(const H of x)H&&(I+=String.fromCharCode(H));return I}function at(x){const D=6&x.textAlign;return D==6?'text-anchor="middle"':D==2?'text-anchor="end"':""}function rt(x){const D=24&x.textAlign;return D==0?'dominant-baseline="text-before-edge"':D==8?'dominant-baseline="text-after-edge"':""}function V(x,D,I,H){x&&H(`<text ${(function(L,B){const Y=L.font,Q=Math.max(1,(Y?.size??12)*i(L));return[`x="${_(B.x)}"`,`y="${_(B.y)}"`,`fill="${L.textColor}"`,`font-size="${_(Q)}"`,Y?.family?`font-family="${T(Y.family)}"`:"",Y?.weight?`font-weight="${Y.weight>=600?"bold":"normal"}"`:"",Y?.italic?'font-style="italic"':"",Y?.underline?'text-decoration="underline"':"",at(L),rt(L)].filter(Boolean).join(" ")})(I,D)}>${T(x)}</text>`)}function et(x,D,I,H){if(D+20>x.byteLength)return;const L=o(I,p(x,D+8)),B=b(x.getUint32(D+16,!0));H(`<rect x="${_(L.x)}" y="${_(L.y)}" width="1" height="1" fill="${B}" stroke="none"/>`)}function q(x,D,I,H,L,B){let Y=0,Q=0,K=0,lt=0,ft=0,X=0,mt=0,At=0;if(H==f.STRETCHDIBITS){if(I<80)return;Y=x.getInt32(D+24,!0),Q=x.getInt32(D+28,!0),ft=x.getUint32(D+48,!0),X=x.getUint32(D+52,!0),mt=x.getUint32(D+56,!0),At=x.getUint32(D+60,!0),K=x.getInt32(D+72,!0),lt=x.getInt32(D+76,!0)}else{if(I<100)return;Y=x.getInt32(D+24,!0),Q=x.getInt32(D+28,!0),K=x.getInt32(D+32,!0),lt=x.getInt32(D+36,!0),ft=x.getUint32(D+84,!0),X=x.getUint32(D+88,!0),mt=x.getUint32(D+92,!0),At=x.getUint32(D+96,!0)}if(!ft||!X||!mt||!At||ft+X>I||mt+At>I)return;const Et=(function(Ft,_t,Mt,Ct,Dt,bt){const wt=_t+Mt,jt=_t+Dt;if(Ct<4||wt+Ct>Ft.byteLength||jt+bt>Ft.byteLength)return null;const ee=Ft.getUint32(wt,!0)>=40&&Ct>=20?Ft.getUint32(wt+16,!0):0,Kt=new Uint8Array(Ft.buffer,Ft.byteOffset+jt,bt);if(ee==4)return`data:image/jpeg;base64,${z(Kt)}`;if(ee==5)return`data:image/png;base64,${z(Kt)}`;const re=new Uint8Array(Ct+bt);return re.set(new Uint8Array(Ft.buffer,Ft.byteOffset+wt,Ct),0),re.set(Kt,Ct),(function(Vt,ne){if(!Vt?.length||ne<=0||ne>Vt.length)return null;const Pt=14+Vt.length,Ot=14+ne,kt=new Uint8Array(Pt);return kt[0]=66,kt[1]=77,$(kt,2,Pt),$(kt,10,Ot),kt.set(Vt,14),`data:image/bmp;base64,${z(kt)}`})(re,Ct)})(x,D,ft,X,mt,At);if(!Et)return;const ct=o(L,{x:Y,y:Q}),yt=o(L,{x:Y+K,y:Q+lt}),Rt=Math.min(ct.x,yt.x),St=Math.min(ct.y,yt.y),It=Math.abs(yt.x-ct.x),Lt=Math.abs(yt.y-ct.y);B(`<image x="${_(Rt)}" y="${_(St)}" width="${_(It)}" height="${_(Lt)}" href="${Et}" preserveAspectRatio="none"/>`)}function F(x,D,I){for(let H=0;H<D.length;H++)if(x[I+H]!=D[H])return!1;return!0}function ut(x,D){return(x[D]<<24|x[D+1]<<16|x[D+2]<<8|x[D+3])>>>0}function S(x,D){return(x[D]|x[D+1]<<8|x[D+2]<<16|x[D+3]<<24)>>>0}function $(x,D,I){x[D]=255&I,x[D+1]=I>>8&255,x[D+2]=I>>16&255,x[D+3]=I>>24&255}function z(x){let D="";for(let H=0;H<x.length;H+=32768)D+=String.fromCharCode(...x.subarray(H,H+32768));if(typeof btoa=="function")return btoa(D);const I=globalThis.Buffer;return I?I.from(x).toString("base64"):D}},"./notes/elements":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.WmlEndnote=d.WmlFootnote=d.WmlBaseNote=void 0;const f=m("../document/dom");class g{}d.WmlBaseNote=g,d.WmlFootnote=class extends g{constructor(){super(...arguments),this.type=f.DomType.Footnote}},d.WmlEndnote=class extends g{constructor(){super(...arguments),this.type=f.DomType.Endnote}}},"./notes/parts":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.EndnotesPart=d.FootnotesPart=d.BaseNotePart=void 0;const f=m("../common/part"),g=m("./elements");class y extends f.Part{constructor(h,w,A){super(h,w),this._documentParser=A}}d.BaseNotePart=y,d.FootnotesPart=class extends y{constructor(E,h,w){super(E,h,w)}parseXml(E){this.notes=this._documentParser.parseNotes(E,"footnote",g.WmlFootnote)}},d.EndnotesPart=class extends y{constructor(E,h,w){super(E,h,w)}parseXml(E){this.notes=this._documentParser.parseNotes(E,"endnote",g.WmlEndnote)}}},"./numbering/numbering-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.NumberingPart=void 0;const f=m("../common/part"),g=m("./numbering");class y extends f.Part{constructor(h,w,A){super(h,w),this._documentParser=A}parseXml(h){Object.assign(this,(0,g.parseNumberingPart)(h,this._package.xmlParser)),this.domNumberings=this._documentParser.parseNumberingFile(h)}}d.NumberingPart=y},"./numbering/numbering":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.parseNumberingPart=function(n,e){let t={numberings:[],abstractNumberings:[],bulletPictures:[]};for(let p of e.elements(n))switch(p.localName){case"num":t.numberings.push(y(p,e));break;case"abstractNum":t.abstractNumberings.push(E(p,e));break;case"numPicBullet":t.bulletPictures.push(A(p,e))}return t},d.parseNumbering=y,d.parseAbstractNumbering=E,d.parseNumberingLevel=h,d.parseNumberingLevelOverrride=w,d.parseNumberingBulletPicture=A;const f=m("../document/paragraph"),g=m("../document/run");function y(n,e){let t={id:e.attr(n,"numId"),overrides:[]};for(let p of e.elements(n))switch(p.localName){case"abstractNumId":t.abstractId=e.attr(p,"val");break;case"lvlOverride":t.overrides.push(w(p,e))}return t}function E(n,e){let t={id:e.attr(n,"abstractNumId"),levels:[]};for(let p of e.elements(n))switch(p.localName){case"name":t.name=e.attr(p,"val");break;case"multiLevelType":t.multiLevelType=e.attr(p,"val");break;case"numStyleLink":t.numberingStyleLink=e.attr(p,"val");break;case"styleLink":t.styleLink=e.attr(p,"val");break;case"lvl":t.levels.push(h(p,e))}return t}function h(n,e){let t={level:e.intAttr(n,"ilvl")};for(let p of e.elements(n))switch(p.localName){case"start":t.start=e.attr(p,"val");break;case"lvlRestart":t.restart=e.intAttr(p,"val");break;case"numFmt":t.format=e.attr(p,"val");break;case"lvlText":t.text=e.attr(p,"val");break;case"lvlJc":t.justification=e.attr(p,"val");break;case"lvlPicBulletId":t.bulletPictureId=e.attr(p,"val");break;case"pStyle":t.paragraphStyle=e.attr(p,"val");break;case"pPr":t.paragraphProps=(0,f.parseParagraphProperties)(p,e);break;case"rPr":t.runProps=(0,g.parseRunProperties)(p,e)}return t}function w(n,e){let t={level:e.intAttr(n,"ilvl")};for(let p of e.elements(n))switch(p.localName){case"startOverride":t.start=e.intAttr(p,"val");break;case"lvl":t.numberingLevel=h(p,e)}return t}function A(n,e){var t=e.attr(n,"numPicBulletId"),p=e.element(n,"pict"),c=p&&e.element(p,"shape"),s=c&&e.element(c,"imagedata");if(s)return{id:t,referenceId:e.attr(s,"id"),style:e.attr(c,"style")};var l=e.element(n,"drawing"),u=l&&r(l,"blip",e);return u?{id:t,referenceId:e.attr(u,"embed")??e.attr(u,"link"),style:null}:null}function r(n,e,t){for(const p of t.elements(n)){if(p.localName==e)return p;const c=r(p,e,t);if(c)return c}return null}},"./parser/xml-parser":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.XmlParser=void 0,d.parseXmlString=function(y,E=!1){var h;E&&(y=y.replace(/<[?].*[?]>/,"")),y=(h=y).charCodeAt(0)===65279?h.substring(1):h;const w=new DOMParser().parseFromString(y,"application/xml"),A=(r=w,r.getElementsByTagName("parsererror")[0]?.textContent);var r;if(A)throw new Error(A);return w},d.serializeXmlString=function(y){return new XMLSerializer().serializeToString(y)};const f=m("../document/common");class g{elements(E,h=null){const w=[];for(let A=0,r=E.childNodes.length;A<r;A++){let n=E.childNodes.item(A);n.nodeType!=1||h!=null&&n.localName!=h||w.push(n)}return w}element(E,h){for(let w=0,A=E.childNodes.length;w<A;w++){let r=E.childNodes.item(w);if(r.nodeType==1&&r.localName==h)return r}return null}elementAttr(E,h,w){var A=this.element(E,h);return A?this.attr(A,w):void 0}attrs(E){return Array.from(E.attributes)}attr(E,h){for(let w=0,A=E.attributes.length;w<A;w++){let r=E.attributes.item(w);if(r.localName==h)return r.value}return null}intAttr(E,h,w=null){var A=this.attr(E,h);return A!=null&&A!==""?parseInt(A,10):w}hexAttr(E,h,w=null){var A=this.attr(E,h);return A!=null&&A!==""?parseInt(A,16):w}floatAttr(E,h,w=null){var A=this.attr(E,h);return A!=null&&A!==""?parseFloat(A):w}boolAttr(E,h,w=null){return(0,f.convertBoolean)(this.attr(E,h),w)}lengthAttr(E,h,w=f.LengthUsage.Dxa){return(0,f.convertLength)(this.attr(E,h),w)}}d.XmlParser=g,d.default=new g},"./settings/settings-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.SettingsPart=void 0;const f=m("../common/part"),g=m("./settings");class y extends f.Part{constructor(h,w){super(h,w)}parseXml(h){this.settings=(0,g.parseSettings)(h,this._package.xmlParser)}}d.SettingsPart=y},"./settings/settings":function(m,C,d){function f(g,y){var E={defaultNoteIds:[]};for(let h of y.elements(g))switch(h.localName){case"numFmt":E.nummeringFormat=y.attr(h,"val");break;case"footnote":case"endnote":E.defaultNoteIds.push(y.attr(h,"id"))}return E}Object.defineProperty(d,"__esModule",{value:!0}),d.parseSettings=function(g,y){var E={};for(let h of y.elements(g))switch(h.localName){case"defaultTabStop":E.defaultTabStop=y.lengthAttr(h,"val");break;case"footnotePr":E.footnoteProps=f(h,y);break;case"endnotePr":E.endnoteProps=f(h,y);break;case"autoHyphenation":E.autoHyphenation=y.boolAttr(h,"val");break;case"kinsoku":E.kinsoku=y.boolAttr(h,"val",!0);break;case"overflowPunct":E.overflowPunctuation=y.boolAttr(h,"val",!0);break;case"topLinePunct":E.topLinePunctuation=y.boolAttr(h,"val",!0);break;case"autoSpaceDE":E.autoSpaceDE=y.boolAttr(h,"val",!0);break;case"autoSpaceDN":E.autoSpaceDN=y.boolAttr(h,"val",!0);break;case"noLineBreaksAfter":E.noLineBreaksAfter=y.attr(h,"val")||h.textContent||"";break;case"noLineBreaksBefore":E.noLineBreaksBefore=y.attr(h,"val")||h.textContent||"";break;case"evenAndOddHeaders":E.evenAndOddHeaders=y.boolAttr(h,"val",!0);break;case"splitPgBreakAndParaMark":E.splitPageBreakAndParagraphMark=y.boolAttr(h,"val",!0);break;case"compat":for(const w of y.elements(h))w.localName=="adjustLineHeightInTable"&&(E.adjustLineHeightInTable=y.boolAttr(w,"val",!0))}return E},d.parseNoteProperties=f},"./styles/styles-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.StylesPart=void 0;const f=m("../common/part");class g extends f.Part{constructor(E,h,w){super(E,h),this._documentParser=w}parseXml(E){this.styles=this._documentParser.parseStylesFile(E)}}d.StylesPart=g},"./theme/theme-part":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.ThemePart=void 0;const f=m("../common/part"),g=m("./theme");class y extends f.Part{constructor(h,w){super(h,w)}parseXml(h){this.theme=(0,g.parseTheme)(h,this._package.xmlParser)}}d.ThemePart=y},"./theme/theme":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.DmlTheme=void 0,d.parseTheme=function(h,w){var A=new f,r=w.element(h,"themeElements");for(let n of w.elements(r))switch(n.localName){case"clrScheme":A.colorScheme=g(n,w);break;case"fontScheme":A.fontScheme=y(n,w)}return A},d.parseColorScheme=g,d.parseFontScheme=y,d.parseFontInfo=E;class f{}function g(h,w){var A={name:w.attr(h,"name"),colors:{}};for(let e of w.elements(h)){var r=w.element(e,"srgbClr"),n=w.element(e,"sysClr");r?A.colors[e.localName]=w.attr(r,"val"):n&&(A.colors[e.localName]=w.attr(n,"lastClr"))}return A}function y(h,w){var A={name:w.attr(h,"name")};for(let r of w.elements(h))switch(r.localName){case"majorFont":A.majorFont=E(r,w);break;case"minorFont":A.minorFont=E(r,w)}return A}function E(h,w){return{latinTypeface:w.elementAttr(h,"latin","typeface"),eaTypeface:w.elementAttr(h,"ea","typeface"),csTypeface:w.elementAttr(h,"cs","typeface")}}d.DmlTheme=f},"./utils":function(m,C,d){function f(g){return g&&typeof g=="object"&&!Array.isArray(g)}Object.defineProperty(d,"__esModule",{value:!0}),d.escapeClassName=function(g){return g?.replace(/[ .]+/g,"-").replace(/[&]+/g,"and").toLowerCase()},d.encloseFontFamily=function(g){return/^[^"'].*\s.*[^"']$/.test(g)?`'${g}'`:g},d.splitPath=function(g){let y=g.lastIndexOf("/")+1;return[y==0?"":g.substring(0,y),y==0?g:g.substring(y)]},d.resolvePath=function(g,y){try{return new URL(g,"http://docx/"+y).toString().substring(12)}catch{return`${y}${g}`}},d.keyBy=function(g,y){return g.reduce((E,h)=>(E[y(h)]=h,E),{})},d.blobToBase64=function(g){return new Promise((y,E)=>{const h=new FileReader;h.onloadend=()=>y(h.result),h.onerror=()=>E(),h.readAsDataURL(g)})},d.isObject=f,d.isString=function(g){return typeof g=="string"||g instanceof String},d.mergeDeep=function g(y,...E){if(!E.length)return y;const h=E.shift();if(f(y)&&f(h))for(const w in h)f(h[w])?g(y[w]??(y[w]={}),h[w]):y[w]=h[w];return g(y,...E)},d.parseCssRules=function(g){const y={};for(const E of(g??"").split(";")){const h=E.indexOf(":");if(h<=0)continue;const w=E.substring(0,h).trim(),A=E.substring(h+1).trim();w&&(y[w]=A)}return y},d.formatCssRules=function(g){return Object.entries(g??{}).map(([y,E])=>`${y}: ${E}`).join(";")},d.asArray=function(g){return Array.isArray(g)?g:[g]},d.clamp=function(g,y,E){return y>g?y:E<g?E:g}},"./vml/vml":function(m,C,d){var f=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(d,"__esModule",{value:!0}),d.VmlElement=void 0,d.parseVmlElement=function c(s,l){var u=new h;switch(s.localName){case"rect":u.tagName="rect",Object.assign(u.attrs,{width:"100%",height:"100%"});break;case"oval":u.tagName="ellipse",Object.assign(u.attrs,{cx:"50%",cy:"50%",rx:"50%",ry:"50%"});break;case"line":u.tagName="line";break;case"shape":u.tagName="g";break;case"textbox":u.tagName="foreignObject",Object.assign(u.attrs,{width:"100%",height:"100%"});break;default:return null}for(const o of E.default.attrs(s))switch(o.localName){case"style":u.cssStyleText=o.value;break;case"fillcolor":u.attrs.fill=o.value;break;case"strokecolor":u.attrs.stroke=o.value;break;case"strokeweight":u.attrs["stroke-width"]=(0,g.convertLength)(o.value,g.LengthUsage.Point)??o.value;break;case"filled":o.value!="f"&&o.value!="false"||(u.attrs.fill="none");break;case"stroked":o.value!="f"&&o.value!="false"||(u.attrs.stroke="none");break;case"path":u.tagName="path",u.attrs.d=p(o.value);break;case"from":const[i,a]=t(o.value);Object.assign(u.attrs,{x1:i,y1:a});break;case"to":const[b,v]=t(o.value);Object.assign(u.attrs,{x2:b,y2:v})}for(const o of E.default.elements(s))switch(o.localName){case"stroke":Object.assign(u.attrs,n(o));break;case"fill":Object.assign(u.attrs,e(o));break;case"imagedata":u.tagName="image",Object.assign(u.attrs,w(o)),u.imageHref={id:E.default.attr(o,"id")??E.default.attr(o,"relid")??E.default.attr(o,"pict"),title:E.default.attr(o,"title")};break;case"txbxContent":u.children.push(...l.parseBodyElements(o));break;default:const i=c(o,l);i&&u.children.push(i)}return u};const g=m("../document/common"),y=m("../document/dom"),E=f(m("../parser/xml-parser"));class h extends y.OpenXmlElementBase{constructor(){super(...arguments),this.type=y.DomType.VmlElement,this.attrs={}}}function w(c){const s=A(E.default.attr(c,"cropleft")),l=A(E.default.attr(c,"croptop")),u=A(E.default.attr(c,"cropright")),o=A(E.default.attr(c,"cropbottom")),i=Math.max(1e-4,1-s-u),a=Math.max(1e-4,1-l-o),b={x:r(-s/i),y:r(-l/a),width:r(1/i),height:r(1/a)};return(s||l||u||o)&&(b.preserveAspectRatio="none"),b}function A(c){if(!c)return 0;const s=String(c).trim();if(!s)return 0;let l;return l=/^-?\d+(\.\d+)?f$/i.test(s)?parseFloat(s.slice(0,-1))/65536:s.endsWith("%")?parseFloat(s)/100:parseFloat(s),Number.isFinite(l)?Math.max(0,Math.min(.9999,l)):0}function r(c){return Math.round(1e5*c)/1e3+"%"}function n(c){const s={},l=E.default.attr(c,"color"),u=E.default.attr(c,"weight"),o=E.default.attr(c,"on");return o=="f"||o=="false"?s.stroke="none":l&&(s.stroke=l),s["stroke-width"]=u?(0,g.convertLength)(u,g.LengthUsage.Point)??u:"1px",s}function e(c){const s={},l=E.default.attr(c,"color")??E.default.attr(c,"color2"),u=E.default.attr(c,"on"),o=E.default.attr(c,"opacity");return u=="f"||u=="false"?s.fill="none":l&&(s.fill=l),o&&(s["fill-opacity"]=o.endsWith("%")?""+parseFloat(o)/100:o),s}function t(c){return c.split(",")}function p(c){return c.replace(/([mlxe])|([-\d]+)|([,])/g,s=>/[-\d]/.test(s)?(0,g.convertLength)(s,g.LengthUsage.VmlEmu):/[ml,]/.test(s)?s:"")}d.VmlElement=h},"./word-document":function(m,C,d){Object.defineProperty(d,"__esModule",{value:!0}),d.WordDocument=void 0,d.deobfuscate=_;const f=m("./common/relationship"),g=m("./font-table/font-table"),y=m("./common/open-xml-package"),E=m("./document/document-part"),h=m("./utils"),w=m("./numbering/numbering-part"),A=m("./styles/styles-part"),r=m("./header-footer/parts"),n=m("./document-props/extended-props-part"),e=m("./document-props/core-props-part"),t=m("./theme/theme-part"),p=m("./notes/parts"),c=m("./settings/settings-part"),s=m("./document-props/custom-props-part"),l=m("./comments/comments-part"),u=m("./comments/comments-extended-part"),o=m("./parser/xml-parser"),i=m("./metafile/emf-to-svg"),a=[{type:f.RelationshipTypes.OfficeDocument,target:"word/document.xml"},{type:f.RelationshipTypes.ExtendedProperties,target:"docProps/app.xml"},{type:f.RelationshipTypes.CoreProperties,target:"docProps/core.xml"},{type:f.RelationshipTypes.CustomProperties,target:"docProps/custom.xml"}];class b{constructor(){this.parts=[],this.partsMap={},this.contentTypes=[],this._snapshotAssetDataUrls=null,this._snapshotTextParts=null}static fromSnapshot(k,M){const R=new b;R._options=M,R.rels=k.rels??[],R.contentTypes=k.contentTypes??[],R.parts=[],R.partsMap={},R._snapshotAssetDataUrls=k.assetDataUrls??{},R._snapshotTextParts=k.textParts??{},R._package={load:O=>Promise.resolve(R._snapshotTextParts?.[v(O)]??null),parseXmlDocument:O=>(0,o.parseXmlString)(O,M?.trimXmlDeclaration??!0),get:O=>R._snapshotTextParts?.[v(O)]!=null?{}:null};for(const O of k.parts??[]){const P=R.restoreSnapshotPart(O);P&&(R.parts.push(P),R.partsMap[P.path]=P)}return R}static async load(k,M,R){var O=new b;return O._options=R,O._parser=M,O._package=await y.OpenXmlPackage.load(k,R),O.rels=await O._package.loadRelationships(),O.contentTypes=await O._package.loadContentTypes(),await Promise.all(a.map(P=>{const N=O.rels.find(it=>it.type===P.type)??P;return O.loadRelationshipPart(N.target,N.type)})),O}restoreSnapshotPart(k){const M={path:k.path,rels:k.rels??[]};switch(Object.assign(M,k.data??{}),k.kind){case"document":this.documentPart=M;break;case"fontTable":this.fontTablePart=M;break;case"numbering":this.numberingPart=M;break;case"styles":this.stylesPart=M;break;case"theme":this.themePart=M;break;case"footnotes":this.footnotesPart=M;break;case"endnotes":this.endnotesPart=M;break;case"coreProps":this.corePropsPart=M;break;case"extendedProps":this.extendedPropsPart=M;break;case"settings":this.settingsPart=M;break;case"comments":M.commentMap=(0,h.keyBy)(M.comments??[],R=>R.id),this.commentsPart=M;break;case"commentsExtended":M.commentMap=(0,h.keyBy)(M.comments??[],R=>R.paraId),this.commentsExtendedPart=M}return M}async createSnapshot(){const k={rels:this.rels??[],contentTypes:this.contentTypes??[],parts:this.parts.map(M=>this.snapshotPart(M)).filter(Boolean),assetDataUrls:{},textParts:{}};return await this.preloadSnapshotRelationshipTargets(k),k}snapshotPart(k){const M=k;let R="part",O={};if(k===this.documentPart)R="document",O={body:M.body};else if(k===this.fontTablePart)R="fontTable",O={fonts:M.fonts};else if(k===this.numberingPart)R="numbering",O={numberings:M.numberings,abstractNumberings:M.abstractNumberings,bulletPictures:M.bulletPictures,domNumberings:M.domNumberings};else if(k===this.stylesPart)R="styles",O={styles:M.styles};else if(k===this.themePart)R="theme",O={theme:M.theme};else if(k===this.footnotesPart)R="footnotes",O={notes:M.notes};else if(k===this.endnotesPart)R="endnotes",O={notes:M.notes};else if(k===this.corePropsPart)R="coreProps",O={props:M.props};else if(k===this.extendedPropsPart)R="extendedProps",O={props:M.props};else if(k===this.settingsPart)R="settings",O={settings:M.settings};else if(k===this.commentsPart)R="comments",O={comments:M.comments};else if(k===this.commentsExtendedPart)R="commentsExtended",O={comments:M.comments};else{if(!M.rootElement)return null;R=M.rootElement.type==="header"?"header":"footer",O={rootElement:M.rootElement}}return{kind:R,path:k.path,rels:k.rels??[],data:O}}async preloadSnapshotRelationshipTargets(k){const M=new Set,R=O=>{for(const P of O?.rels??[]){if(!P||P.targetMode==="External")continue;const N=v(this.resolveRelationshipTarget(O,P));N&&!M.has(N)&&M.add(N)}};for(const O of this.parts)R(O);for(const O of M){if(this.partsMap[O])continue;const P=O.toLowerCase(),N=/\.(xml|rels|html?|txt)$/i.test(P);try{if(N){const it=await this._package.load(O,"string");it!=null&&(k.textParts[O]=it)}else{const it=await this.loadPackageAssetDataUrl(O);it&&(k.assetDataUrls[O]=it)}}catch(it){this._options?.debug&&console.warn(`docx-preview: unable to preload relationship target ${O}`,it)}}}blobWithContentType(k,M){if(!k)return null;if(M){const R=this.contentTypes.find(O=>O.partName===M||O.extension&&M.endsWith(`.${O.extension}`));return R?new Blob([k],{type:R.contentType}):k}return k}save(k="blob"){return this._package.save(k)}async loadRelationshipPart(k,M){if(this.partsMap[k])return this.partsMap[k];if(!this._package.get(k))return null;let R=null;switch(M){case f.RelationshipTypes.OfficeDocument:this.documentPart=R=new E.DocumentPart(this._package,k,this._parser);break;case f.RelationshipTypes.FontTable:this.fontTablePart=R=new g.FontTablePart(this._package,k);break;case f.RelationshipTypes.Numbering:this.numberingPart=R=new w.NumberingPart(this._package,k,this._parser);break;case f.RelationshipTypes.Styles:this.stylesPart=R=new A.StylesPart(this._package,k,this._parser);break;case f.RelationshipTypes.Theme:this.themePart=R=new t.ThemePart(this._package,k);break;case f.RelationshipTypes.Footnotes:this.footnotesPart=R=new p.FootnotesPart(this._package,k,this._parser);break;case f.RelationshipTypes.Endnotes:this.endnotesPart=R=new p.EndnotesPart(this._package,k,this._parser);break;case f.RelationshipTypes.Footer:R=new r.FooterPart(this._package,k,this._parser);break;case f.RelationshipTypes.Header:R=new r.HeaderPart(this._package,k,this._parser);break;case f.RelationshipTypes.CoreProperties:this.corePropsPart=R=new e.CorePropsPart(this._package,k);break;case f.RelationshipTypes.ExtendedProperties:this.extendedPropsPart=R=new n.ExtendedPropsPart(this._package,k);break;case f.RelationshipTypes.CustomProperties:R=new s.CustomPropsPart(this._package,k);break;case f.RelationshipTypes.Settings:this.settingsPart=R=new c.SettingsPart(this._package,k);break;case f.RelationshipTypes.Comments:this.commentsPart=R=new l.CommentsPart(this._package,k,this._parser);break;case f.RelationshipTypes.CommentsExtended:this.commentsExtendedPart=R=new u.CommentsExtendedPart(this._package,k)}if(R==null)return Promise.resolve(null);if(this.partsMap[k]=R,this.parts.push(R),await R.load(),R.rels?.length>0){const[O]=(0,h.splitPath)(R.path);await Promise.all(R.rels.filter(P=>P.targetMode!=="External").map(P=>this.loadRelationshipPart((0,h.resolvePath)(P.target,O),P.type)))}return R}async loadRelationshipXml(k,M){const R=M??this.documentPart,O=this.getRelById(R,k);if(!O||O.targetMode==="External")return null;const P=v(this.resolveRelationshipTarget(R,O)),N=P?this._snapshotTextParts?.[P]??await this._package.load(P,"string"):null;return N?this._package.parseXmlDocument(N):null}async loadRelationshipText(k,M){const R=M??this.documentPart,O=this.getRelById(R,k);if(!O||O.targetMode==="External")return null;const P=v(this.resolveRelationshipTarget(R,O));return P?Promise.resolve(this._snapshotTextParts?.[P]??this._package.load(P,"string")):Promise.resolve(null)}async loadRelationshipBlobUrl(k,M){const R=M??this.documentPart,O=this.getRelById(R,k);if(!O)return null;if(O.targetMode==="External")return O.target;const P=v(this.resolveRelationshipTarget(R,O));return P?this.loadPackageAssetUrl(P):null}async loadDocumentImage(k,M){const R=M??this.documentPart,O=this.getRelById(R,k);if(!O)return null;if(O.targetMode==="External")return O.target;const P=v(this.resolveRelationshipTarget(R,O));return P?this.loadPackageAssetUrl(P):null}async loadNumberingImage(k){const M=v(this.getPathById(this.numberingPart,k));return M?this.loadPackageAssetUrl(M):null}async loadFont(k,M){const R=v(this.getPathById(this.fontTablePart,k));if(!R)return null;if(this._snapshotAssetDataUrls?.[R])return this._snapshotAssetDataUrls[R];const O=await this._package.load(R,"uint8array");return O&&this.blobToURL(new Blob([_(O,M)]),R)}async loadAltChunk(k,M){const R=M??this.documentPart,O=this.getRelById(R,k);if(!O||O.targetMode==="External")return Promise.resolve(null);const P=v(this.resolveRelationshipTarget(R,O));return P?Promise.resolve(this._snapshotTextParts?.[P]??this._package.load(P,"string")):Promise.resolve(null)}blobToURL(k,M){return k?(k=this.blobWithContentType(k,M),this._options.useBase64URL?(0,h.blobToBase64)(k):URL.createObjectURL(k)):null}async loadPackageAssetUrl(k){const M=v(k);if(!M)return null;if(this._snapshotAssetDataUrls?.[M])return this._snapshotAssetDataUrls[M];if(this.isEmfAsset(M)){const R=await this._package.load(M,"uint8array");return R?this.convertEmfAsset(R,M)||this.blobToURL(new Blob([R],{type:this.contentTypeForPath(M)||"image/x-emf"}),M):null}return this.blobToURL(await this._package.load(M,"blob"),M)}async loadPackageAssetDataUrl(k){const M=v(k);if(!M)return null;if(this.isEmfAsset(M)){const P=await this._package.load(M,"uint8array");if(!P)return null;const N=this.convertEmfAsset(P,M);if(N)return N;const it=P?new Blob([P],{type:this.contentTypeForPath(M)||"image/x-emf"}):null;return it?(0,h.blobToBase64)(it):null}const R=await this._package.load(M,"blob"),O=this.blobWithContentType(R,M);return O?(0,h.blobToBase64)(O):null}convertEmfAsset(k,M){if(!k||!(0,i.isEmfBinary)(k))return null;try{return(0,i.convertEmfToSvgDataUrl)(k)}catch(R){return this._options?.debug&&console.warn(`docx-preview: unable to convert EMF asset ${M}`,R),null}}isEmfAsset(k){const M=this.contentTypeForPath(k).toLowerCase();return/\.emf$/i.test(k??"")||M=="image/x-emf"||M=="image/emf"}contentTypeForPath(k){const M=v(k??"").toLowerCase();for(const O of this.contentTypes??[])if(O.partName&&v(O.partName).toLowerCase()==M)return O.contentType??"";const R=/\.([^.\/]+)$/.exec(M)?.[1]??"";return R?(this.contentTypes??[]).find(O=>O.extension?.toLowerCase()==R)?.contentType??"":""}findPartByRelId(k,M=null){var R=this.getRelById(M,k);const O=R&&R.targetMode!=="External"?this.resolveRelationshipTarget(M,R):null;return O?this.partsMap[O]:null}getRelById(k,M){return(k?.rels??this.rels??[]).find(R=>R.id==M)}getPathById(k,M){const R=this.getRelById(k,M);return R&&R.targetMode!=="External"?this.resolveRelationshipTarget(k,R):null}resolveRelationshipTarget(k,M){const[R]=k?(0,h.splitPath)(k.path):[""];return v((0,h.resolvePath)(M.target,R))}}function v(T){return T&&T.startsWith("/")?T.substring(1):T}function _(T,k){const M=k.replace(/{|}|-/g,""),R=new Array(16);for(let O=0;O<16;O++)R[16-O-1]=parseInt(M.substring(2*O,2*O+2),16);for(let O=0;O<32;O++)T[O]=T[O]^R[O%16];return T}d.WordDocument=b}},rr={},(function m(C,d){var f=(function(y,E){if(y==="jszip")return"jszip";if(y[0]==="."){var h=(function(w){for(var A=w.split("/"),r=[],n=0;n<A.length;n++){var e=A[n];e&&e!=="."&&(e===".."?r.pop():r.push(e))}return"./"+r.join("/")})(E.substring(0,E.lastIndexOf("/")+1)+y);if(Pe[h])return h;if(Pe[h+"/index"])return h+"/index"}if(Pe[y])return y;throw new Error("Cannot resolve module "+y+" from "+E)})(C,d||"./docx-preview");if(f==="jszip")return ii;if(rr[f])return rr[f].exports;var g={exports:{}};return rr[f]=g,Pe[f](function(y){return m(y,f)},g,g.exports),g.exports})("./docx-preview","./docx-preview")),oi=Zt.defaultOptions,ai=Zt.parseAsync,si=Zt.parseAsyncInWorker,li=Zt.renderDocument,ci=Zt.renderAsync,hi=Zt.awaitRenderedLayout,fi=Zt.collectLayoutSnapshot,di=Zt.yieldToBrowser})),ua=_e({default:()=>Ga});function De(m){return m.localName||m.tagName.split(":").pop()||m.tagName}function le(m,C){return Array.from(m.querySelectorAll("*")).filter(d=>De(d)===C)}function Ut(m,C){return le(m,C)[0]}function pi(m,C,d){return(d?m.getAttributeNS(d,C):null)||m.getAttribute(C)||m.getAttribute(`r:${C}`)}function ui(m){return m?(m.textContent||"").replace(/\s+/g," ").trim():""}function nr(m,C){let d=m?.parentElement||null;for(;d;){if(De(d)===C)return d;d=d.parentElement}return null}function Ur(m){const C=De(m)==="p"?m:nr(m,"p");if(!C)return;let d=0,f=C.previousElementSibling;for(;f;)De(f)==="p"&&(d+=1),f=f.previousElementSibling;return d}function ir(m,C){var d;const f=((d=pe(C))===null||d===void 0?void 0:d.DOMParser)||globalThis.DOMParser;if(!f)return null;const g=new f().parseFromString(m,"application/xml");return g.querySelector("parsererror")?null:g}function jr(m){const C=[];return m.split("/").forEach(d=>{if(!(!d||d===".")){if(d===".."){C.pop();return}C.push(d)}}),C.join("/")}function gi(m){const C=m.lastIndexOf("/");return C>=0?m.slice(0,C):""}function ga(m){const C=gi(m);return jr(`${C}/_rels/${m.slice(C?C.length+1:0)}.rels`)}function mi(m,C){return C.startsWith("/")?jr(C.slice(1)):jr(`${gi(m)}/${C}`)}function ma(m){var C;switch((C=m.split(".").pop())===null||C===void 0?void 0:C.toLowerCase()){case"png":return"image/png";case"jpg":case"jpeg":return"image/jpeg";case"gif":return"image/gif";case"bmp":return"image/bmp";case"webp":return"image/webp";case"svg":return"image/svg+xml";default:return"application/octet-stream"}}function Ai(m){if(!m)return;const C=m.trim().match(/^(-?\d+(?:\.\d+)?)(px|pt|in|cm|mm)?$/i);if(!C)return;const d=Number(C[1]);if(!(!Number.isFinite(d)||d<=0))switch((C[2]||"px").toLowerCase()){case"pt":return d*96/72;case"in":return d*96;case"cm":return d*96/2.54;case"mm":return d*96/25.4;default:return d}}function Aa(m){const C=new Map;return m&&m.split(";").forEach(d=>{const f=d.indexOf(":");f<=0||C.set(d.slice(0,f).trim().toLowerCase(),d.slice(f+1).trim())}),C}function ba(m){const C=Aa(m);return{width:Ai(C.get("width")),height:Ai(C.get("height"))}}function Ca(m){const C=nr(m,"inline")||nr(m,"anchor"),d=C?Ut(C,"extent"):void 0,f=Number(d?.getAttribute("cx")),g=Number(d?.getAttribute("cy"));return{width:Number.isFinite(f)&&f>0?f/zr:void 0,height:Number.isFinite(g)&&g>0?g/zr:void 0}}async function bi(m,C,d){const f=m.file(ga(C)),g=new Map;if(!f)return g;const y=ir(await f.async("text"),d);return y&&le(y,"Relationship").forEach(E=>{const h=E.getAttribute("Id"),w=E.getAttribute("Target");!h||!w||g.set(h,{id:h,type:E.getAttribute("Type")||"",target:w,targetMode:E.getAttribute("TargetMode")||void 0})}),g}async function va(m,C){const d=m.file(C);if(!d)return;const f=await d.async("base64");return`data:${ma(C)};base64,${f}`}function ya(m){return Object.keys(m.files).filter(C=>C==="word/document.xml"||/^word\/header\d+\.xml$/i.test(C)||/^word\/footer\d+\.xml$/i.test(C)).sort((C,d)=>C==="word/document.xml"?-1:d==="word/document.xml"?1:C.localeCompare(d))}function Ea(m,C,d){const f=`${C?.getAttribute("id")||""} ${C?.getAttribute("o:spid")||""}`.toLowerCase(),g=(d||"").toLowerCase();return m.includes("/header")&&(f.includes("watermark")||g.includes("z-index:-")||g.includes("mso-position-horizontal:center"))?"watermark":C?.getAttribute("o:ole")==="t"||C?.getAttribute("ole")==="t"?"ole-preview":"vml-image"}async function wa(m,C){var d;const f=[],g=new Set;for(const y of ya(m)){const E=m.file(y);if(!E)continue;const h=ir(await E.async("text"),C);if(!h)continue;const w=await bi(m,y,C);for(const A of le(h,"imagedata")){const r=pi(A,"id","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),n=r?w.get(r):void 0;if(!n||n.targetMode==="External"||!n.type.includes("/image"))continue;const e=mi(y,n.target),t=await va(m,e);if(!t)continue;const p=nr(A,"shape"),c=p?.getAttribute("style")||void 0,s=Ea(y,p,c),l=s==="watermark"?`${s}:${e}`:`${s}:${y}:${e}:${(d=Ur(A))!==null&&d!==void 0?d:"end"}`;g.has(l)||(g.add(l),f.push({role:s,key:l,dataUrl:t,sourcePath:e,partPath:y,title:A.getAttribute("o:title")||A.getAttribute("title")||void 0,style:c,...ba(c),paragraphIndex:y==="word/document.xml"?Ur(A):void 0}))}}return f}function Re(m){return m?le(m,"pt").sort((C,d)=>Number(C.getAttribute("idx")||0)-Number(d.getAttribute("idx")||0)).map(C=>ui(Ut(C,"v"))).filter(Boolean):[]}function _a(m){const C=Re(Ut(Ut(m,"tx")||m,"strCache"))[0]||Re(Ut(Ut(m,"tx")||m,"numCache"))[0]||"Series",d=Re(Ut(Ut(m,"cat")||m,"strCache")),f=Re(Ut(Ut(m,"cat")||m,"numCache")),g=Re(Ut(Ut(m,"val")||m,"numCache")).map(y=>Number(y)).filter(y=>Number.isFinite(y));return{name:C,categories:d.length?d:f,values:g}}function Ta(m,C,d,f){const g=["lineChart","barChart","pieChart","areaChart","scatterChart"].map(r=>le(m,r)[0]).find(Boolean),y=g?De(g):"chart",E=ui(Ut(Ut(m,"title")||m,"t"))||C.split("/").pop()||"Chart",h=le(g||m,"ser").map(_a).filter(r=>r.values.length),{width:w,height:A}=Ca(d);if(h.length)return{key:`chart:${C}:${f??"end"}`,title:E,type:y,sourcePath:C,series:h,width:w,height:A,paragraphIndex:f}}async function xa(m,C){const d="word/document.xml",f=m.file(d);if(!f)return[];const g=ir(await f.async("text"),C);if(!g)return[];const y=await bi(m,d,C),E=[],h=new Set;for(const w of le(g,"chart")){const A=pi(w,"id","http://schemas.openxmlformats.org/officeDocument/2006/relationships"),r=A?y.get(A):void 0;if(!r||r.targetMode==="External"||!r.type.includes("/chart"))continue;const n=mi(d,r.target),e=m.file(n);if(!e)continue;const t=ir(await e.async("text"),C),p=Ur(w),c=t?Ta(t,n,w,p):void 0;!c||h.has(c.key)||(h.add(c.key),E.push(c))}return E}function ce(m){return m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function Sa(m){var C;const d=Math.max(360,Math.round(m.width||520)),f=Math.max(220,Math.round(m.height||320)),g={top:52,right:30,bottom:56,left:54},y=d-g.left-g.right,E=f-g.top-g.bottom,h=m.series.flatMap(u=>u.values),w=Math.max(...h,1),A=Math.min(...h,0),r=Math.max(w-A,1),n=["#2563eb","#10b981","#f97316","#8b5cf6","#ef4444"],e=Math.max(...m.series.map(u=>u.values.length),1),t=u=>g.left+(e===1?y/2:u*y/(e-1)),p=u=>g.top+E-(u-A)/r*E,c=m.series.map((u,o)=>{const i=n[o%n.length];return`<polyline points="${u.values.map((a,b)=>`${t(b).toFixed(1)},${p(a).toFixed(1)}`).join(" ")}" fill="none" stroke="${i}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"/>${u.values.map((a,b)=>`<circle cx="${t(b).toFixed(1)}" cy="${p(a).toFixed(1)}" r="3.5" fill="${i}"><title>${ce(u.name)}: ${ce(String(a))}</title></circle>`).join("")}`}).join(""),s=(((C=m.series.find(u=>u.categories.length))===null||C===void 0?void 0:C.categories)||[]).slice(0,e).map((u,o)=>{const i=t(o),a=u.length>14?`${u.slice(0,13)}...`:u;return`<text x="${i.toFixed(1)}" y="${f-22}" text-anchor="middle" fill="#64748b" font-size="11">${ce(a)}</text>`}).join(""),l=m.series.slice(0,5).map((u,o)=>`<g transform="translate(${g.left+o*98} 30)"><rect width="10" height="10" rx="2" fill="${n[o%n.length]}"/><text x="15" y="9" fill="#475569" font-size="11">${ce(u.name)}</text></g>`).join("");return`<svg viewBox="0 0 ${d} ${f}" role="img" aria-label="${ce(m.title)}">
86
86
  <rect x="0" y="0" width="${d}" height="${f}" rx="8" fill="#ffffff"/>
87
87
  <text x="${g.left}" y="22" fill="#0f172a" font-size="15" font-weight="700">${ce(m.title)}</text>
88
88
  ${l}
@@ -92,7 +92,7 @@ section.${e}>footer { z-index: 1; }
92
92
  <text x="${g.left-8}" y="${g.top+E}" text-anchor="end" fill="#64748b" font-size="11">${ce(A.toFixed(1))}</text>
93
93
  ${c}
94
94
  ${s}
95
- </svg>`}function Ta(m){return Array.from(m.querySelectorAll("section.docx"))}function xa(m){return Array.from(m.querySelectorAll("section.docx > article"))}function Sa(m,C){if(C===void 0)return;const d=Array.from(m.querySelectorAll("section.docx > article p"));return d[Math.min(Math.max(C,0),Math.max(d.length-1,0))]}function Ci(m,C,d){const f=Sa(m,d);if(f){f.after(C);return}const g=xa(m)[0];g&&g.appendChild(C)}function Pa(m,C){const d=Ta(m);d.length&&C.forEach(f=>{if(f.role==="watermark"){d.forEach(E=>{const h=m.ownerDocument.createElement("img");h.className="docx-vml-watermark",h.src=f.dataUrl,h.alt=f.title||"",h.dataset.docxFallback=f.key,E.prepend(h)});return}const g=m.ownerDocument.createElement("figure");g.className="docx-vml-fallback",g.dataset.docxFallback=f.key,f.width&&(g.style.width=`${Math.round(f.width)}px`);const y=m.ownerDocument.createElement("img");y.src=f.dataUrl,y.alt=f.title||(f.role==="ole-preview"?"Embedded object preview":"Document image"),f.width&&(y.style.width=`${Math.round(f.width)}px`),f.height&&(y.style.height=`${Math.round(f.height)}px`),g.appendChild(y),Ci(m,g,f.paragraphIndex)})}function Da(m,C){C.forEach(d=>{const f=m.ownerDocument.createElement("figure");f.className="docx-chart-fallback",f.dataset.docxFallback=d.key,d.width&&(f.style.width=`${Math.round(d.width)}px`),f.innerHTML=_a(d),Ci(m,f,d.paragraphIndex)})}async function Ra(m,C){try{const{default:d}=await Promise.resolve().then(()=>ze(Hr(),1)),f=await d.loadAsync(m.slice(0)),[g,y]=await Promise.all([va(f,C),wa(f,C)]);g.length&&Pa(C,g),y.length&&Da(C,y)}catch(d){console.warn("[file-viewer] DOCX 兼容增强解析失败,已保留 @file-viewer/docx 原始渲染结果。",d)}}function ka(m){const C=m.ownerDocument.createElement("style");return C.textContent=Ri,m.prepend(C),C}function vi(m,C,d){const f=m.cloneNode(!1);f.innerHTML="",f.dataset.docxPaginated="true",f.style.minHeight=`${d}px`,f.style.height=`${d}px`,f.style.overflow="hidden";const g=C.cloneNode(!1);return f.appendChild(g),Array.from(m.children).forEach(y=>{y!==C&&f.appendChild(y.cloneNode(!0))}),{page:f,article:g}}function Ia(m){var C;const d=(C=m.ownerDocument.defaultView)===null||C===void 0?void 0:C.getComputedStyle(m),f=d?parseFloat(d.minHeight):0;return Number.isFinite(f)&&f>0?f:m.offsetHeight}function Ma(m){const C=m.querySelector(".docx-wrapper");C&&Array.from(C.children).forEach(d=>{if(!Me(d,m)||!d.matches("section.docx"))return;const f=d.querySelector(":scope > article");if(!Me(f,m))return;const g=Ia(d),y=Array.from(f.childNodes);if(!g||y.length<2||d.scrollHeight<=g*1.15)return;let E=vi(d,f,g);d.before(E.page),y.forEach(h=>{E.article.appendChild(h),!(E.page.scrollHeight<=g+1||E.article.childNodes.length===1)&&(E.article.removeChild(h),E=vi(d,f,g),d.before(E.page),E.article.appendChild(h))}),d.remove()})}function Oa(m,C){const d=m.querySelector(".docx-wrapper");return d?Array.from(d.children).flatMap(f=>{if(!Me(f,m)||!f.matches("section.docx"))return[];const g=m.ownerDocument.createElement("div");return g.className=C?"docx-page-frame":"docx-flow-frame",f.before(g),g.appendChild(f),[g]}):[]}function Ba(m,C){m.classList.add("docx-fit-viewer");const d=ka(m),f=Di(C);f&&Ma(m);const g=Oa(m,f),y=Ie(m),E=y?.ResizeObserver;let h=0,w=1,A=1,r=1;const n=Xe(),e=l=>Math.min(or,Math.max(ke,Number(l.toFixed(2)))),t=()=>{y&&(y.cancelAnimationFrame(h),h=y.requestAnimationFrame(()=>{let l=1;g.forEach(u=>{const o=u.firstElementChild;if(!Me(o,m))return;o.style.transform="translateX(-50%)";const i=o.offsetWidth,a=f?o.offsetHeight:Math.max(o.scrollHeight,o.offsetHeight);if(!i||!a)return;const b=Math.max(m.clientWidth-28,120),v=Math.min(1,Math.max(ke,b/i)),_=e(v*w);l=_,r=v,o.style.transform=`translateX(-50%) scale(${_})`,u.style.width=`${Math.ceil(Math.max(i*_,m.clientWidth-28,120))}px`,u.style.maxWidth="none",u.style.height=`${Math.ceil(a*_)}px`}),A=l,n.emit()}))},p=()=>({scale:A,label:`${Math.round(A*100)}%`,canZoomIn:A<or,canZoomOut:A>ke,canReset:w!==1,minScale:ke,maxScale:or}),c=l=>(w=Math.min(6,Math.max(.2,Number(l.toFixed(2)))),t(),p());m.dataset.viewerZoomProvider="docx",$e(m,{zoomIn:()=>c(w+Wr),zoomOut:()=>c(w-Wr),resetZoom:()=>c(1),setZoom:l=>c(l/Math.max(r,.01)),getState:p,subscribe:n.subscribe});const s=E?new E(t):null;return s?.observe(m),g.forEach(l=>{const u=Gr(l);u&&s?.observe(u)}),t(),()=>{y?.cancelAnimationFrame(h),s?.disconnect(),Ve(m),d.remove(),m.classList.remove("docx-fit-viewer")}}function Gr(m){var C;const d=m.firstElementChild,f=(C=m.ownerDocument.defaultView)===null||C===void 0?void 0:C.HTMLElement;return f&&d instanceof f?d:null}function yi(m){return!!m?.classList.contains("docx-flow-frame")}function Ei(m){const C=m?Gr(m):null;if(!C)return Re;const d=yn(C,Re);return yi(m)?{width:d.width,height:Math.max(C.scrollHeight||0,C.offsetHeight||0,Re.height)}:d}function Na(m,C){const d=yi(m),f=Jt(C.width),g=Jt(C.height);_r(m,C,{heightMode:d?"min":"fixed"}),m.style.margin="0 auto 18px";const y=Gr(m);y&&(y.style.position="relative",y.style.top="auto",y.style.left="auto",y.style.width=f,y.style.maxWidth="none",y.style.minHeight=d?"0":g,y.style.height=d?"auto":g,y.style.margin="0 auto",y.style.transform="none",y.style.transformOrigin="top left",y.style.overflow=d?"visible":"hidden",y.style.boxShadow="none")}function Fa(m){const C=m.querySelector(".docx-page-frame, .docx-flow-frame"),d=Ei(C||void 0);return Tr({selector:C?.classList.contains("docx-flow-frame")?".viewer-export-content .docx-flow-frame":".viewer-export-content .docx-page-frame",width:d.width,height:C?.classList.contains("docx-flow-frame")?Re.height:d.height,heightMode:C?.classList.contains("docx-flow-frame")?"min":"fixed"})}function La(m){const C=Array.from(m.querySelectorAll(".docx-page-frame, .docx-flow-frame")),d=m.cloneNode(!0),f=m.ownerDocument.createElement("div");f.className="docx-print-document";const g=Array.from(d.querySelectorAll("style")).filter(y=>{var E;return!(!((E=y.textContent)===null||E===void 0)&&E.includes(".docx-fit-viewer"))}).map(y=>y.outerHTML).join("");return d.querySelectorAll(".docx-page-frame, .docx-flow-frame").forEach((y,E)=>{Na(y,Ei(C[E])),f.appendChild(y.cloneNode(!0))}),f.childElementCount?`${g}${f.outerHTML}`:d.innerHTML}async function Ha(m,C,d){var f;Si(m);let g=!1;const y=()=>{var r;g||(g=!0,(r=d?.onProgressiveRender)===null||r===void 0||r.call(d))},E=Pi(C,d,y),{defaultOptions:h,renderAsync:w}=await xi();C.dataset.docxWorker=E.useWorker?"self":"false",await w(m,C,void 0,{...h,...E}),y(),await Ra(m,C);const A=Ba(C,d);return(f=d?.registerExportAdapter)===null||f===void 0||f.call(d,{includeDocumentStyles:!1,beforeSnapshot:()=>{const r=Ie(C);r&&r.dispatchEvent(new r.Event("resize"))},printStyle:()=>Fa(C),toHtml:()=>La(C)}),{$el:C,unmount(){var r;(r=d?.registerExportAdapter)===null||r===void 0||r.call(d,null),A(),delete C.dataset.docxWorker,C.innerHTML=""}}}var Re,wi,_i,ke,or,Wr,zr,Ti,xi,Si,Pi,Ie,Me,Di,Ri,Ua=vt((()=>{An(),Lr(),Re={width:794,height:1123},wi=2,_i=12e4,ke=.24,or=3,Wr=.15,zr=9525,Ti=20555,xi=(()=>{const m={module:null,async load(){return this.module||(this.module=Promise.resolve().then(()=>(ha(),ca))),this.module}};return async()=>await m.load()})(),Si=m=>{if((m.byteLength>=4?new DataView(m).getUint16(0,!1):0)!==Ti)throw new Error("文件不是有效的 DOCX/OOXML 压缩包,可能下载不完整或被服务端错误内容替换,请重新上传或检查文件源。")},Pi=(m,C,d)=>{var f,g,y,E,h,w,A,r,n,e,t,p;const c=(f=C?.options)===null||f===void 0?void 0:f.docx,s=m.ownerDocument.URL||void 0,l=c?.worker!==!1,u=c?.visualPagination===!0,o=i=>{(i.phase==="render"||i.phase==="layout"||i.phase==="done")&&d()};return{debug:!1,experimental:!1,useWorker:l,workerUrl:l?gn(c,s):void 0,workerJsZipUrl:l?mn(c,s):void 0,workerFallback:!0,workerTimeout:(g=c?.workerTimeout)!==null&&g!==void 0?g:_i,renderPageBatchSize:(y=c?.renderPageBatchSize)!==null&&y!==void 0?y:c?.progressive===!1?Number.MAX_SAFE_INTEGER:wi,renderYieldEveryMs:(E=c?.renderYieldEveryMs)!==null&&E!==void 0?E:16,strictWordCompatibility:(h=c?.strictWordCompatibility)!==null&&h!==void 0?h:!0,paginationTolerance:(w=c?.paginationTolerance)!==null&&w!==void 0?w:2,breakPages:u,maxDynamicPaginationPasses:u?(A=c?.maxDynamicPaginationPasses)!==null&&A!==void 0?A:1e3:0,awaitLayout:(r=c?.awaitLayout)!==null&&r!==void 0?r:u,preserveComplexFieldResults:(n=c?.preserveComplexFieldResults)!==null&&n!==void 0?n:!0,updatePageReferences:(e=c?.updatePageReferences)!==null&&e!==void 0?e:!1,hideWebHiddenContent:(t=c?.hideWebHiddenContent)!==null&&t!==void 0?t:!1,ignoreLastRenderedPageBreak:(p=c?.ignoreLastRenderedPageBreak)!==null&&p!==void 0?p:!u,progress:o}},Ie=m=>m.ownerDocument.defaultView,Me=(m,C)=>{var d;const f=(d=Ie(C))===null||d===void 0?void 0:d.HTMLElement;return f?m instanceof f:m instanceof HTMLElement},Di=m=>{var C,d;return((d=(C=m?.options)===null||C===void 0?void 0:C.docx)===null||d===void 0?void 0:d.visualPagination)===!0},Ri=`
95
+ </svg>`}function Pa(m){return Array.from(m.querySelectorAll("section.docx"))}function Da(m){return Array.from(m.querySelectorAll("section.docx > article"))}function Ra(m,C){if(C===void 0)return;const d=Array.from(m.querySelectorAll("section.docx > article p"));return d[Math.min(Math.max(C,0),Math.max(d.length-1,0))]}function Ci(m,C,d){const f=Ra(m,d);if(f){f.after(C);return}const g=Da(m)[0];g&&g.appendChild(C)}function ka(m,C){const d=Pa(m);d.length&&C.forEach(f=>{if(f.role==="watermark"){d.forEach(E=>{const h=m.ownerDocument.createElement("img");h.className="docx-vml-watermark",h.src=f.dataUrl,h.alt=f.title||"",h.dataset.docxFallback=f.key,E.prepend(h)});return}const g=m.ownerDocument.createElement("figure");g.className="docx-vml-fallback",g.dataset.docxFallback=f.key,f.width&&(g.style.width=`${Math.round(f.width)}px`);const y=m.ownerDocument.createElement("img");y.src=f.dataUrl,y.alt=f.title||(f.role==="ole-preview"?"Embedded object preview":"Document image"),f.width&&(y.style.width=`${Math.round(f.width)}px`),f.height&&(y.style.height=`${Math.round(f.height)}px`),g.appendChild(y),Ci(m,g,f.paragraphIndex)})}function Ia(m,C){C.forEach(d=>{const f=m.ownerDocument.createElement("figure");f.className="docx-chart-fallback",f.dataset.docxFallback=d.key,d.width&&(f.style.width=`${Math.round(d.width)}px`),f.innerHTML=Sa(d),Ci(m,f,d.paragraphIndex)})}async function Ma(m,C){try{const{default:d}=await Promise.resolve().then(()=>ze(Hr(),1)),f=await d.loadAsync(m.slice(0)),[g,y]=await Promise.all([wa(f,C),xa(f,C)]);g.length&&ka(C,g),y.length&&Ia(C,y)}catch(d){console.warn("[file-viewer] DOCX 兼容增强解析失败,已保留 @file-viewer/docx 原始渲染结果。",d)}}function Oa(m){const C=m.ownerDocument.createElement("style");return C.textContent=Mi,m.prepend(C),C}function vi(m,C,d){const f=m.cloneNode(!1);f.innerHTML="",f.dataset.docxPaginated="true",f.style.minHeight=`${d}px`,f.style.height=`${d}px`,f.style.overflow="hidden";const g=C.cloneNode(!1);return f.appendChild(g),Array.from(m.children).forEach(y=>{y!==C&&f.appendChild(y.cloneNode(!0))}),{page:f,article:g}}function Ba(m){var C;const d=(C=m.ownerDocument.defaultView)===null||C===void 0?void 0:C.getComputedStyle(m),f=d?parseFloat(d.minHeight):0;return Number.isFinite(f)&&f>0?f:m.offsetHeight}function Na(m){const C=m.querySelector(".docx-wrapper");C&&Array.from(C.children).forEach(d=>{if(!Me(d,m)||!d.matches("section.docx"))return;const f=d.querySelector(":scope > article");if(!Me(f,m))return;const g=Ba(d),y=Array.from(f.childNodes);if(!g||y.length<2||d.scrollHeight<=g*1.15)return;let E=vi(d,f,g);d.before(E.page),y.forEach(h=>{E.article.appendChild(h),!(E.page.scrollHeight<=g+1||E.article.childNodes.length===1)&&(E.article.removeChild(h),E=vi(d,f,g),d.before(E.page),E.article.appendChild(h))}),d.remove()})}function Fa(m,C){const d=m.querySelector(".docx-wrapper");return d?Array.from(d.children).flatMap(f=>{if(!Me(f,m)||!f.matches("section.docx"))return[];const g=m.ownerDocument.createElement("div");return g.className=C?"docx-page-frame":"docx-flow-frame",f.before(g),g.appendChild(f),[g]}):[]}function La(m,C){m.classList.add("docx-fit-viewer");const d=Oa(m),f=Ii(C);f&&Na(m);const g=Fa(m,f),y=pe(m),E=y?.ResizeObserver;let h=0,w=1,A=1,r=1;const n=Xe(),e=l=>Math.min(or,Math.max(Ie,Number(l.toFixed(2)))),t=()=>{y&&(y.cancelAnimationFrame(h),h=y.requestAnimationFrame(()=>{let l=1;g.forEach(u=>{const o=u.firstElementChild;if(!Me(o,m))return;o.style.transform="translateX(-50%)";const i=o.offsetWidth,a=f?o.offsetHeight:Math.max(o.scrollHeight,o.offsetHeight);if(!i||!a)return;const b=Math.max(m.clientWidth-28,120),v=Math.min(1,Math.max(Ie,b/i)),_=e(v*w);l=_,r=v,o.style.transform=`translateX(-50%) scale(${_})`,u.style.width=`${Math.ceil(Math.max(i*_,m.clientWidth-28,120))}px`,u.style.maxWidth="none",u.style.height=`${Math.ceil(a*_)}px`}),A=l,n.emit()}))},p=()=>({scale:A,label:`${Math.round(A*100)}%`,canZoomIn:A<or,canZoomOut:A>Ie,canReset:w!==1,minScale:Ie,maxScale:or}),c=l=>(w=Math.min(6,Math.max(.2,Number(l.toFixed(2)))),t(),p());m.dataset.viewerZoomProvider="docx",$e(m,{zoomIn:()=>c(w+Wr),zoomOut:()=>c(w-Wr),resetZoom:()=>c(1),setZoom:l=>c(l/Math.max(r,.01)),getState:p,subscribe:n.subscribe});const s=E?new E(t):null;return s?.observe(m),g.forEach(l=>{const u=Gr(l);u&&s?.observe(u)}),t(),()=>{y?.cancelAnimationFrame(h),s?.disconnect(),Ve(m),d.remove(),m.classList.remove("docx-fit-viewer")}}function Gr(m){var C;const d=m.firstElementChild,f=(C=m.ownerDocument.defaultView)===null||C===void 0?void 0:C.HTMLElement;return f&&d instanceof f?d:null}function yi(m){return!!m?.classList.contains("docx-flow-frame")}function Ei(m){const C=m?Gr(m):null;if(!C)return ke;const d=yn(C,ke);return yi(m)?{width:d.width,height:Math.max(C.scrollHeight||0,C.offsetHeight||0,ke.height)}:d}function Ha(m,C){const d=yi(m),f=Jt(C.width),g=Jt(C.height);_r(m,C,{heightMode:d?"min":"fixed"}),m.style.margin="0 auto 18px";const y=Gr(m);y&&(y.style.position="relative",y.style.top="auto",y.style.left="auto",y.style.width=f,y.style.maxWidth="none",y.style.minHeight=d?"0":g,y.style.height=d?"auto":g,y.style.margin="0 auto",y.style.transform="none",y.style.transformOrigin="top left",y.style.overflow=d?"visible":"hidden",y.style.boxShadow="none")}function Ua(m){const C=m.querySelector(".docx-page-frame, .docx-flow-frame"),d=Ei(C||void 0);return Tr({selector:C?.classList.contains("docx-flow-frame")?".viewer-export-content .docx-flow-frame":".viewer-export-content .docx-page-frame",width:d.width,height:C?.classList.contains("docx-flow-frame")?ke.height:d.height,heightMode:C?.classList.contains("docx-flow-frame")?"min":"fixed"})}function ja(m){const C=Array.from(m.querySelectorAll(".docx-page-frame, .docx-flow-frame")),d=m.cloneNode(!0),f=m.ownerDocument.createElement("div");f.className="docx-print-document";const g=Array.from(d.querySelectorAll("style")).filter(y=>{var E;return!(!((E=y.textContent)===null||E===void 0)&&E.includes(".docx-fit-viewer"))}).map(y=>y.outerHTML).join("");return d.querySelectorAll(".docx-page-frame, .docx-flow-frame").forEach((y,E)=>{Ha(y,Ei(C[E])),f.appendChild(y.cloneNode(!0))}),f.childElementCount?`${g}${f.outerHTML}`:d.innerHTML}async function Ga(m,C,d){var f;Pi(m);let g=!1;const y=()=>{var r;g||(g=!0,(r=d?.onProgressiveRender)===null||r===void 0||r.call(d))},E=ki(C,d,y),{defaultOptions:h,renderAsync:w}=await Si();C.dataset.docxWorker=E.useWorker?"self":"false",await w(m,C,void 0,{...h,...E}),y(),await Ma(m,C);const A=La(C,d);return(f=d?.registerExportAdapter)===null||f===void 0||f.call(d,{includeDocumentStyles:!1,beforeSnapshot:()=>{const r=pe(C);r&&r.dispatchEvent(new r.Event("resize"))},printStyle:()=>Ua(C),toHtml:()=>ja(C)}),{$el:C,unmount(){var r;(r=d?.registerExportAdapter)===null||r===void 0||r.call(d,null),A(),delete C.dataset.docxWorker,C.innerHTML=""}}}var ke,wi,_i,Ti,Ie,or,Wr,zr,xi,Si,Pi,pe,Di,Ri,ki,Me,Ii,Mi,Wa=vt((()=>{An(),Lr(),ke={width:794,height:1123},wi=2,_i=5e3,Ti=new Set(["file:","about:","data:"]),Ie=.24,or=3,Wr=.15,zr=9525,xi=20555,Si=(()=>{const m={module:null,async load(){return this.module||(this.module=Promise.resolve().then(()=>(pa(),da))),this.module}};return async()=>await m.load()})(),Pi=m=>{if((m.byteLength>=4?new DataView(m).getUint16(0,!1):0)!==xi)throw new Error("文件不是有效的 DOCX/OOXML 压缩包,可能下载不完整或被服务端错误内容替换,请重新上传或检查文件源。")},pe=m=>m.ownerDocument.defaultView,Di=m=>{var C,d,f;const g=[m.ownerDocument.URL,(d=(C=pe(m))===null||C===void 0?void 0:C.location)===null||d===void 0?void 0:d.href,(f=globalThis.location)===null||f===void 0?void 0:f.href].filter(Boolean);for(const y of g)try{return new URL(y).protocol}catch{}return""},Ri=(m,C)=>{var d,f;return C?.worker===!1?!1:C?.worker===!0?!0:((f=(d=pe(m))===null||d===void 0?void 0:d.Worker)!==null&&f!==void 0?f:globalThis.Worker)?!Ti.has(Di(m)):!1},ki=(m,C,d)=>{var f,g,y,E,h,w,A,r,n,e,t,p;const c=(f=C?.options)===null||f===void 0?void 0:f.docx,s=m.ownerDocument.URL||void 0,l=Ri(m,c),u=c?.visualPagination===!0,o=i=>{(i.phase==="render"||i.phase==="layout"||i.phase==="done")&&d()};return{debug:!1,experimental:!1,useWorker:l,workerUrl:l?gn(c,s):void 0,workerJsZipUrl:l?mn(c,s):void 0,workerFallback:!0,workerTimeout:(g=c?.workerTimeout)!==null&&g!==void 0?g:_i,renderPageBatchSize:(y=c?.renderPageBatchSize)!==null&&y!==void 0?y:c?.progressive===!1?Number.MAX_SAFE_INTEGER:wi,renderYieldEveryMs:(E=c?.renderYieldEveryMs)!==null&&E!==void 0?E:16,strictWordCompatibility:(h=c?.strictWordCompatibility)!==null&&h!==void 0?h:!0,paginationTolerance:(w=c?.paginationTolerance)!==null&&w!==void 0?w:2,breakPages:u,maxDynamicPaginationPasses:u?(A=c?.maxDynamicPaginationPasses)!==null&&A!==void 0?A:1e3:0,awaitLayout:(r=c?.awaitLayout)!==null&&r!==void 0?r:u,preserveComplexFieldResults:(n=c?.preserveComplexFieldResults)!==null&&n!==void 0?n:!0,updatePageReferences:(e=c?.updatePageReferences)!==null&&e!==void 0?e:!1,hideWebHiddenContent:(t=c?.hideWebHiddenContent)!==null&&t!==void 0?t:!1,ignoreLastRenderedPageBreak:(p=c?.ignoreLastRenderedPageBreak)!==null&&p!==void 0?p:!u,progress:o}},Me=(m,C)=>{var d;const f=(d=pe(C))===null||d===void 0?void 0:d.HTMLElement;return f?m instanceof f:m instanceof HTMLElement},Ii=m=>{var C,d;return((d=(C=m?.options)===null||C===void 0?void 0:C.docx)===null||d===void 0?void 0:d.visualPagination)===!0},Mi=`
96
96
  .docx-fit-viewer {
97
97
  box-sizing: border-box;
98
98
  height: 100%;
@@ -185,9 +185,9 @@ section.${e}>footer { z-index: 1; }
185
185
  width: 100%;
186
186
  height: auto;
187
187
  }
188
- `}));function qt(m){return String(m).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Xt(m="id"){return Xr+=1,`${m}-${Xr}`}function Oe(m){return m%2===0?m:m+1}function ja(m){const C=m instanceof Uint8Array?m:m instanceof ArrayBuffer?new Uint8Array(m):new Uint8Array(m.buffer,m.byteOffset,m.byteLength);if(Vr)return Vr.from(C).toString("base64");let d="";const f=32768;for(let g=0;g<C.length;g+=f)d+=String.fromCharCode(...C.subarray(g,Math.min(g+f,C.length)));return btoa(d)}function ar(m,C="application/octet-stream"){return`data:${C};base64,${ja(m)}`}function ki(m){return String(m??"").toLowerCase().replace(/[^a-z0-9\u4e00-\u9fa5]+/g,"-").replace(/^-+|-+$/g,"")||"item"}function Ii(m,C){if(m===C)return!0;if(!m||!C)return!1;const d=Object.keys(m),f=Object.keys(C);if(d.length!==f.length)return!1;for(const g of d)if(m[g]!==C[g])return!1;return!0}function sr(m,C,d){const f=d?{message:C,...d}:{message:C};return m.push(f),f}function oe(m,C=96){if(!(m==null||Number.isNaN(m)))return m/1440*C}function Ga(m){return String(m??"").replace(/\u000b/g,`
188
+ `}));function qt(m){return String(m).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function Xt(m="id"){return Xr+=1,`${m}-${Xr}`}function Oe(m){return m%2===0?m:m+1}function za(m){const C=m instanceof Uint8Array?m:m instanceof ArrayBuffer?new Uint8Array(m):new Uint8Array(m.buffer,m.byteOffset,m.byteLength);if(Vr)return Vr.from(C).toString("base64");let d="";const f=32768;for(let g=0;g<C.length;g+=f)d+=String.fromCharCode(...C.subarray(g,Math.min(g+f,C.length)));return btoa(d)}function ar(m,C="application/octet-stream"){return`data:${C};base64,${za(m)}`}function Oi(m){return String(m??"").toLowerCase().replace(/[^a-z0-9\u4e00-\u9fa5]+/g,"-").replace(/^-+|-+$/g,"")||"item"}function Bi(m,C){if(m===C)return!0;if(!m||!C)return!1;const d=Object.keys(m),f=Object.keys(C);if(d.length!==f.length)return!1;for(const g of d)if(m[g]!==C[g])return!1;return!0}function sr(m,C,d){const f=d?{message:C,...d}:{message:C};return m.push(f),f}function oe(m,C=96){if(!(m==null||Number.isNaN(m)))return m/1440*C}function $a(m){return String(m??"").replace(/\u000b/g,`
189
189
  `).replace(/\u000c/g,`
190
- `)}function $r(m="utf-8"){return new TextDecoder(m,{fatal:!1})}var Vr,Xr,Ce=vt((()=>{Vr=globalThis.Buffer,Xr=0}));function Be(m){"@babel/helpers - typeof";return Be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},Be(m)}var Mi=vt((()=>{}));function Wa(m,C){if(Be(m)!="object"||!m)return m;var d=m[Symbol.toPrimitive];if(d!==void 0){var f=d.call(m,C||"default");if(Be(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(m)}var za=vt((()=>{Mi()}));function $a(m){var C=Wa(m,"string");return Be(C)=="symbol"?C:C+""}var Va=vt((()=>{Mi(),za()}));function Yr(m,C,d){return(C=$a(C))in m?Object.defineProperty(m,C,{value:d,enumerable:!0,configurable:!0,writable:!0}):m[C]=d,m}var Oi=vt((()=>{Va()}));function Xa(m){if(m instanceof Uint8Array)return m;if(m instanceof ArrayBuffer)return new Uint8Array(m);if(ArrayBuffer.isView(m))return new Uint8Array(m.buffer,m.byteOffset,m.byteLength);throw new TypeError("Unsupported binary input")}var Kr,Bi,xt,pe=vt((()=>{Ce(),Oi(),Kr=$r("utf-16le"),Bi=$r(typeof TextDecoder<"u"?"windows-1252":"latin1"),xt=class{constructor(m){if(Yr(this,"bytes",void 0),Yr(this,"view",void 0),Yr(this,"length",void 0),m instanceof Uint8Array)this.bytes=m;else if(m instanceof ArrayBuffer)this.bytes=new Uint8Array(m);else if(ArrayBuffer.isView(m))this.bytes=new Uint8Array(m.buffer,m.byteOffset,m.byteLength);else throw new TypeError("BinaryReader expects ArrayBuffer or Uint8Array");this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.length=this.bytes.byteLength}ensure(m,C=1){return m>=0&&m+C<=this.length}u8(m){return this.ensure(m,1)?this.view.getUint8(m):0}i8(m){return this.ensure(m,1)?this.view.getInt8(m):0}u16(m){return this.ensure(m,2)?this.view.getUint16(m,!0):0}i16(m){return this.ensure(m,2)?this.view.getInt16(m,!0):0}u32(m){return this.ensure(m,4)?this.view.getUint32(m,!0):0}i32(m){return this.ensure(m,4)?this.view.getInt32(m,!0):0}u64(m){const C=this.u32(m);return this.u32(m+4)*4294967296+C}slice(m,C){return this.ensure(m,C)?this.bytes.subarray(m,m+C):new Uint8Array(0)}array(m,C,d){const f=[],g=d.byteWidth??1;for(let y=0;y<C;y+=1)f.push(d.call(this,m+y*g));return f}utf16le(m,C){return this.ensure(m,C)?Kr.decode(this.slice(m,C)):""}latin1(m,C){return this.ensure(m,C)?Bi.decode(this.slice(m,C)):""}ascii(m,C){if(!this.ensure(m,C))return"";let d="";const f=this.slice(m,C);for(let g=0;g<f.length;g+=1)d+=String.fromCharCode(f[g]??0);return d}utf16z(m,C){const d=this.slice(m,C);let f=d.length;for(let g=0;g+1<d.length;g+=2)if(d[g]===0&&d[g+1]===0){f=g;break}return Kr.decode(d.subarray(0,f))}},xt.prototype.u8.byteWidth=1,xt.prototype.i8.byteWidth=1,xt.prototype.u16.byteWidth=2,xt.prototype.i16.byteWidth=2,xt.prototype.u32.byteWidth=4,xt.prototype.i32.byteWidth=4}));function Ni(m){return m===Ne||m===ue||m===Li||m===Hi}function Jr(m,C,d){const f=512+d*C,g=f+C;if(f<0||f>=m.length)throw new Error(`Sector ${d} is out of bounds`);if(g<=m.length)return m.subarray(f,g);const y=new Uint8Array(C);return y.set(m.subarray(f)),y}function Fi(m,C,d=Ui){const f=[],g=new Set;let y=m,E=0;for(;y!==ue&&y!==Ne&&y>=0;){if(g.has(y))throw new Error(`Detected sector loop at ${y}`);if(g.add(y),f.push(y),y=C(y),E+=1,E>d)throw new Error("Sector chain exceeds safe limit")}return f}function lr(m,C,d,f,g=null){if(d===ue||d===Ne||d<0)return new Uint8Array(0);const y=Fi(d,w=>f[w]??ue),E=new Uint8Array(y.length*C);let h=0;for(const w of y)E.set(Jr(m,C,w),h),h+=C;return g==null?E:E.subarray(0,Math.min(g,E.length))}function Ya(m){function C(g,y){if(g<0||g>=m.length)return;const E=m[g];E&&(C(E.leftSiblingId,y),y.push(g),C(E.rightSiblingId,y))}function d(g){const y=m[g];if(!y||y.childId<0)return;const E=[];C(y.childId,E),y.children=E;for(const h of E){const w=m[h];w&&(w.parentId=g,d(h))}}const f=m.find(g=>g.objectType===5);if(!f)throw new Error("CFB root storage not found");return d(f.id),f}function Ka(m){const C=new Map;for(const d of m){if(!d||!d.name)continue;const f=[];let g=d;for(;g;)g.objectType!==5&&f.push(g.name),g=g.parentId!=null?m[g.parentId]??null:null;const y=`/${f.reverse().join("/")}`;d.path=y==="/"?`/${d.name}`:y,C.set(d.path,d)}return C}function Ja(m){return m.replace(/\u0000+$/,"")}function Za(m,C={}){const d=Xa(m),f=new xt(d),g=[];for(let ot=0;ot<Zr.length;ot+=1)if(f.u8(ot)!==Zr[ot])throw new Error("Not a Compound File Binary document");const y=f.u16(26),E=f.u16(30),h=f.u16(32),w=1<<E,A=1<<h,r=f.u32(40),n=f.u32(44),e=f.i32(48),t=f.u32(52),p=f.u32(56),c=f.i32(60),s=f.u32(64),l=f.i32(68),u=f.u32(72);p!==ji&&sr(g,`Unexpected mini stream cutoff size ${p}`);const o=[];for(let ot=0;ot<109;ot+=1){const tt=f.i32(76+ot*4);!Ni(tt)&&tt>=0&&o.push(tt)}const i=[...o];let a=l,b=0;for(;a!==ue&&a!==Ne&&a>=0;){const ot=new xt(Jr(d,w,a)),tt=w/4-1;for(let ht=0;ht<tt;ht+=1){const W=ot.i32(ht*4);!Ni(W)&&W>=0&&i.push(W)}if(a=ot.i32(w-4),b+=1,b>u+4){sr(g,"DIFAT chain exceeded declared sector count; stopping early");break}}n&&i.length<n&&sr(g,`FAT sector count mismatch: header says ${n}, found ${i.length}`);const v=[];for(const ot of i){const tt=new xt(Jr(d,w,ot));for(let ht=0;ht<w/4;ht+=1)v.push(tt.i32(ht*4))}const _=lr(d,w,e,v),T=new xt(_),k=[];for(let ot=0,tt=0;ot+128<=_.length;ot+=128,tt+=1){const ht=T.u16(ot+64),W=Ja(T.utf16le(ot,Math.max(0,ht-2)));!W&&T.u8(ot+66)===0||k.push({id:tt,name:W,objectType:T.u8(ot+66),colorFlag:T.u8(ot+67),leftSiblingId:T.i32(ot+68),rightSiblingId:T.i32(ot+72),childId:T.i32(ot+76),clsid:T.slice(ot+80,16),stateBits:T.u32(ot+96),creationTime:T.u64(ot+100),modifiedTime:T.u64(ot+108),startSector:T.i32(ot+116),streamSize:y===3?T.u32(ot+120):T.u64(ot+120),children:[],parentId:null})}const M=Ya(k),R=Ka(k),O=[];if(s&&c>=0){const ot=lr(d,w,c,v),tt=new xt(ot);for(let ht=0;ht+4<=ot.length;ht+=4)O.push(tt.i32(ht))}const P=lr(d,w,M.startSector,v,M.streamSize);function N(ot){if(ot.startSector<0)return new Uint8Array(0);const tt=Fi(ot.startSector,G=>O[G]??ue),ht=new Uint8Array(tt.length*A);let W=0;for(const G of tt){const gt=G*A,nt=gt+A;if(nt>P.length)throw new Error(`Mini sector ${G} is out of bounds`);ht.set(P.subarray(gt,nt),W),W+=A}return ht.subarray(0,Math.min(ot.streamSize,ht.length))}function it(ot){const tt=typeof ot=="string"?R.get(ot)??null:ot;return!tt||tt.objectType!==2&&tt.objectType!==5?null:tt.objectType===5?P:tt.streamSize<p&&tt.startSector>=0&&O.length?N(tt):lr(d,w,tt.startSector,v,tt.streamSize)}function J(ot){const tt=typeof ot=="string"?R.get(ot)??null:ot;return tt?(tt.children||[]).map(ht=>k[ht]).filter(ht=>!!ht):[]}return{bytes:d,majorVersion:y,sectorSize:w,miniSectorSize:A,numDirSectors:r,numFatSectors:n,firstDirSector:e,transactionSignature:t,miniStreamCutoffSize:p,warnings:g,entries:k,root:M,pathMap:R,getEntry(ot){return R.get(ot)??null},getStream:it,listChildren:J,findByName(ot,tt="/"){const ht=tt==="/"?M:R.get(tt)??null;if(!ht)return null;const W=[ht];for(;W.length;){const G=W.pop();if(G){if(G.name===ot)return G;for(const gt of G.children||[]){const nt=k[gt];nt&&W.push(nt)}}}return null}}}var Zr,Ne,ue,Li,Hi,Ui,ji,qa=vt((()=>{pe(),Ce(),Zr=[208,207,17,224,161,177,26,225],Ne=4294967295,ue=4294967294,Li=4294967293,Hi=4294967292,Ui=1<<20,ji=4096}));function Qa(m){return m.replace(/[\x82-\x8C\x91-\x9C\x9F]/g,C=>Gi[C]||C)}function ts(m){let C="";for(let d=0;d<m.length;d+=1)C+=String.fromCharCode(m[d]??0);return Qa(C)}function es(m){return new TextDecoder("utf-16le").decode(m)}function rs(m,C){const d=C.fcClx,f=C.lcbClx;if(d==null||f==null||f<=0)throw new Error("FIB does not point to a CLX structure");const g=m.subarray(d,d+f),y=new xt(g);let E=0;const h=[];for(;E<g.length&&y.u8(E)===1;){const A=y.u16(E+1);h.push({type:1,cbGrpprl:A,bytes:y.slice(E+3,A)}),E+=3+A}if(y.u8(E)!==2)throw new Error("CLX does not contain a Pcdt marker");const w=y.u32(E+1);return{prcs:h,pcdt:{lcb:w,pieceTable:ns(y.slice(E+5,w))}}}function ns(m){if(!m.length)throw new Error("Empty PlcPcd");const C=new xt(m),d=(m.length-4)/12;if(!Number.isInteger(d)||d<0)throw new Error("Invalid PlcPcd size");const f=[];for(let E=0;E<d+1;E+=1)f.push(C.u32(E*4));const g=[];let y=(d+1)*4;for(let E=0;E<d;E+=1){const h=C.u16(y),w=C.u32(y+2)>>>0,A=C.u16(y+6),r=!!(w&1073741824),n=w&1073741823,e=f[E]??0,t=f[E+1]??e,p=r?Math.floor(n/2):n,c=r?t-e:(t-e)*2;g.push({index:E,descriptor:h,fNoParaLast:!!(h&1),fRaw:!!(h&2),prm:A,compressed:r,fcRaw:w,fc:n,cpStart:e,cpEnd:t,actualByteStart:p,byteLength:c,actualByteEnd:p+c}),y+=8}return{cps:f,pieces:g}}function is(m,C){const d=m.subarray(C.actualByteStart,C.actualByteEnd);return C.compressed?ts(d):es(d)}function os(m,C){return C.pcdt.pieceTable.pieces.map(d=>is(m,d))}function cr(m,C,d=null){const f=m.pcdt.pieceTable.pieces,g=d??!!(C&1073741824),y=d==null?C&1073741823:C,E=g?Math.floor(y/2):y;for(const h of f){if(E<h.actualByteStart||E>h.actualByteEnd)continue;const w=E-h.actualByteStart,A=h.cpStart+Math.floor(w/(h.compressed?1:2));if(A>=h.cpStart&&A<=h.cpEnd)return A}for(const h of f){if(C<h.actualByteStart||C>h.actualByteEnd)continue;const w=C-h.actualByteStart,A=h.cpStart+Math.floor(w/(h.compressed?1:2));if(A>=h.cpStart&&A<=h.cpEnd)return A}return null}function as(m,C,d,f,g){if(g<=f)return"";const y=[];for(let E=0;E<C.pcdt.pieceTable.pieces.length;E+=1){const h=C.pcdt.pieceTable.pieces[E];if(h.cpEnd<=f)continue;if(h.cpStart>=g)break;const w=Math.max(f,h.cpStart)-h.cpStart,A=Math.min(g,h.cpEnd)-h.cpStart;y.push((d[E]??"").slice(w,A))}return y.join("")}function ss(m){const C=[];let d=0;for(let f=0;f<m.length;f+=1){const g=m[f];(g==="\r"||g==="\x07")&&(C.push({cpStart:d,cpEnd:f+1,terminator:g}),d=f+1)}return d<m.length&&C.push({cpStart:d,cpEnd:m.length,terminator:""}),C}var Gi,Wi=vt((()=>{pe(),Gi={"‚":"‚","ƒ":"ƒ","„":"„","…":"…","†":"†","‡":"‡","ˆ":"ˆ","‰":"‰","Š":"Š","‹":"‹","Œ":"Œ","‘":"‘","’":"’","“":"“","”":"”","•":"•","–":"–","—":"—","˜":"˜","™":"™","š":"š","›":"›","œ":"œ","Ÿ":"Ÿ"}})),zt,zi,$i,Vi,hr,fr=vt((()=>{zt={paragraph:"\r",cellMark:"\x07",picture:"",fieldStart:"",fieldSeparator:"",fieldEnd:"",annotationRef:"",hardLineBreak:"\v",pageBreak:"\f",nonBreakingHyphen:"",nonRequiredHyphen:""},zi={0:"none",1:"single",2:"word",3:"double",4:"dotted",5:"hidden",6:"thick",7:"dash",9:"dot-dash",10:"dot-dot-dash",11:"wave",16:"dotted-heavy",17:"dashed-heavy",18:"dash-long",19:"dash-long-heavy",20:"dot-dash-heavy",21:"dot-dot-dash-heavy",22:"wavy-heavy",23:"wavy-double"},$i={0:"left",1:"center",2:"right",3:"justify",4:"distributed"},Vi={0:"top",1:"center",2:"bottom"},hr={1:"#000000",2:"#0000ff",3:"#00ffff",4:"#00ff00",5:"#ff00ff",6:"#ff0000",7:"#ffff00",8:"#ffffff",9:"#000080",10:"#008080",11:"#008000",12:"#800080",13:"#800000",14:"#808000",15:"#808080",16:"#c0c0c0"}}));function ls(m){const C=new xt(m),d=cs(C);let f=32;const g=C.u16(f);f+=2;const y=C.slice(f,g*2);f+=g*2;const E=C.u16(f);f+=2;const h=C.slice(f,E*4);f+=E*4;const w=C.u16(f);f+=2;const A=C.slice(f,w*8);f+=w*8;const r=C.ensure(f,2)?C.u16(f):0;C.ensure(f,2)&&(f+=2);const n=r?C.slice(f,r*2):new Uint8Array(0),e=hs(h),t=fs(A,w);return{base:d,csw:g,cslw:E,cbRgFcLcb:w,cswNew:r,nFibNew:r?new xt(n).u16(0):0,fibRgWBytes:y,fibRgLwBytes:h,fibRgFcLcbBytes:A,fibRgCswNewBytes:n,fibRgLw:e,fibRgFcLcb:t}}function cs(m){const C=m.u16(0),d=m.u16(2),f=m.u16(6),g=m.u16(8),y=m.u16(10),E=m.u16(18);return{wIdent:C,nFib:d,lid:f,pnNext:g,flags:y,envFlags:E,fDot:!!(y&1),fGlsy:!!(y&2),fComplex:!!(y&4),fHasPic:!!(y&8),cQuickSaves:y>>4&15,fEncrypted:!!(y&256),fWhichTblStm:y&512?1:0,fReadOnlyRecommended:!!(y&1024),fWriteReservation:!!(y&2048),fExtChar:!!(y&4096),fLoadOverride:!!(y&8192),fFarEast:!!(y&16384),fObfuscated:!!(y&32768),nFibBack:m.u16(12),lKey:m.u32(14),envr:m.u8(18),fMac:!!(E&1),fEmptySpecial:!!(E&2),fLoadOverridePage:!!(E&4)}}function hs(m){const C=new xt(m),d=[];for(let f=0;f+4<=m.length;f+=4)d.push(C.i32(f));return{raw:d,cbMac:d[0]??0,ccpText:d[3]??0,ccpFtn:d[4]??0,ccpHdd:d[5]??0,ccpMcr:d[6]??0,ccpAtn:d[7]??0,ccpEdn:d[8]??0,ccpTxbx:d[9]??0,ccpHdrTxbx:d[10]??0}}function fs(m,C){const d=new xt(m),f={_pairs:[]},g=[];for(let y=0;y<C&&y*8+8<=m.length;y+=1){const E=d.u32(y*8),h=d.u32(y*8+4),w=Xi[y]||`Field${y}`;f[`fc${w}`]=E,f[`lcb${w}`]=h,g.push({name:w,fc:E,lcb:h,index:y})}return f._pairs=g,f}var Xi,ds=vt((()=>{pe(),Xi=["StshfOrig","Stshf","PlcffndRef","PlcffndTxt","PlcfandRef","PlcfandTxt","PlcfSed","PlcPad","PlcfPhe","SttbfGlsy","PlcfGlsy","PlcfHdd","PlcfBteChpx","PlcfBtePapx","PlcfSea","SttbfFfn","PlcfFldMom","PlcfFldHdr","PlcfFldFtn","PlcfFldAtn","PlcfFldMcr","SttbfBkmk","PlcfBkf","PlcfBkl","Cmds","Unused1","SttbfMcr","PrDrvr","PrEnvPort","PrEnvLand","Wss","Dop","SttbfAssoc","Clx","PlcfPgdFtn","AutosaveSource","GrpXstAtnOwners","SttbfAtnBkmk","Unused2","Unused3","PlcSpaMom","PlcSpaHdr","PlcfAtnBkf","PlcfAtnBkl","Pms","FormFldSttbs","PlcfendRef","PlcfendTxt","PlcfFldEdn","Unused4","DggInfo","SttbfRMark","SttbfCaption","SttbfAutoCaption","PlcfWkb","PlcfSpl","PlcftxbxTxt","PlcfFldTxbx","PlcfHdrtxbxTxt","PlcffldHdrTxbx","StwUser","SttbTtmbd","CookieData","PgdMotherOldOld","BkdMotherOldOld","PgdFtnOldOld","BkdFtnOldOld","PgdEdnOldOld","BkdEdnOldOld","SttbfIntlFld","RouteSlip","SttbSavedBy","SttbFnm","PlfLst","PlfLfo","PlcfTxbxBkd","PlcfTxbxHdrBkd","DocUndoWord9","RgbUse","Usp","Uskf","PlcupcRgbUse","PlcupcUsp","SttbGlsyStyle","Plgosl","Plcocx","PlcfBteLvc","dwLowDateTime","dwHighDateTime","PlcfLvcPre10","PlcfAsumy","PlcfGram","SttbListNames","SttbfUssr"]}));function ps(m){return m>>13&7}function Nt(m,C=0){return C+2>m.length?0:(m[C]??0)|(m[C+1]??0)<<8}function Bt(m,C=0){const d=Nt(m,C);return d>32767?d-65536:d}function dr(m,C=0){return C+4>m.length?0:((m[C]??0)|(m[C+1]??0)<<8|(m[C+2]??0)<<16|(m[C+3]??0)<<24>>>0)>>>0}function ge(m,C=0){return{first:m[C]??0,lim:m[C+1]??0}}function Yt(m,C=0){if(C+4>m.length)return null;const d=dr(m,C)>>>0;return{raw:d,lineWidth:d&255,borderType:d>>8&255,color:d>>16&255}}function us(m,C=0){const d=Nt(m,C);return{raw:d,horzMerge:d&3,textFlow:d>>2&7,vertMerge:d>>5&3,vertAlign:d>>7&3,ftsWidth:d>>9&7,fitText:!!(d&4096),noWrap:!!(d&8192),hideMark:!!(d&16384)}}function Yi(m,C=0){return C+20>m.length?null:{tcgrf:us(m,C),wWidth:Nt(m,C+2),borders:{top:Yt(m,C+4)||{},left:Yt(m,C+8)||{},bottom:Yt(m,C+12)||{},right:Yt(m,C+16)||{}}}}function gs(m){if(m.length<3)return null;const C=Nt(m,0),d=m[2]??0;let f=3;const g=[];for(let E=0;E<d+1&&f+2<=m.length;E+=1)g.push(Bt(m,f)),f+=2;const y=[];for(let E=0;E<d&&f+20<=m.length;E+=1){const h=Yi(m,f);h&&y.push(h),f+=20}return{cb:C,numberOfColumns:d,rgdxaCenter:g,cells:y}}function ve(m){return m.length?{cb:m[0]??0,range:ge(m,1),value:m[3]??0,extra:m.subarray(4)}:null}function qr(m){if(!m.length)return null;const C=m[0]??0,d=Nt(m,4);return{cb:C,range:ge(m,1),ftsWidth:m[3]??0,width:d,wWidth:d}}function ms(m){return m.length?{cb:m[0]??0,range:ge(m,1),border:Yt(m,3)||{},extra:m.subarray(7)}:null}function Qr(m){if(!m.length)return null;const C=Nt(m,1);return{ftsWidth:m[0]??0,width:C,wWidth:C}}function As(m){if(!m.length)return null;const C=m[0]??0,d=ge(m,1),f=d.lim-d.first;let g=3;const y=[];for(let h=0;h<f&&g+2<=m.length;h+=1)y.push(Bt(m,g)),g+=2;const E=[];for(let h=0;h<f&&g+20<=m.length;h+=1)E.push(Yi(m,g)),g+=20;return{cb:C,range:d,itcFirst:d.first,ctc:f,dxaCol:y,cells:E}}function bs(m,C,d){const f=d>>13&7;if(C>=m.length)return 0;if(d===Z.sprmTDefTable){const g=Nt(m,C);return g?g+1:0}if(Ki.has(d))return(m[C]??0)+1;switch(f){case 0:return 1;case 1:return 1;case 2:return 2;case 3:return 4;case 4:return 2;case 5:return 2;case 6:return(m[C]??0)+1;case 7:return 3;default:return 0}}function Tt(m){return!!(m[0]??0)}function st(m,C,d,f,g){return{kind:m,name:C,value:d,raw:f,operandBytes:g}}function Cs(m,C){const d=ps(m),f=C,g=m;switch(m){case Z.sprmCPicLocation:return st("char","pictureOffset",dr(f,0)>>>0,g,f);case Z.sprmCFData:return st("char","data",Tt(f),g,f);case Z.sprmCFOle2:return st("char","ole2",Tt(f),g,f);case Z.sprmCIstd:return st("char","charStyleId",Nt(f,0),g,f);case Z.sprmCPlain:return st("char","plain",Tt(f),g,f);case Z.sprmCFBold:return st("char","bold",Tt(f),g,f);case Z.sprmCFItalic:return st("char","italic",Tt(f),g,f);case Z.sprmCFStrike:return st("char","strike",Tt(f),g,f);case Z.sprmCFOutline:return st("char","outline",Tt(f),g,f);case Z.sprmCFShadow:return st("char","shadow",Tt(f),g,f);case Z.sprmCFSmallCaps:return st("char","smallCaps",Tt(f),g,f);case Z.sprmCFCaps:return st("char","caps",Tt(f),g,f);case Z.sprmCFVanish:return st("char","hidden",Tt(f),g,f);case Z.sprmCKul:return st("char","underline",f[0]??0,g,f);case Z.sprmCDxaSpace:return st("char","spacing",Bt(f,0),g,f);case Z.sprmCIco:case Z.sprmCIcoBi:return st("char","colorIndex",f[0]??0,g,f);case Z.sprmCHighlight:{const y=f[0]??0;return st("char","highlight",{index:y,color:hr[y]},g,f)}case Z.sprmCHps:case Z.sprmCHpsBi:return st("char","fontSizeHalfPoints",Nt(f,0),g,f);case Z.sprmCHpsPos:return st("char","positionHalfPoints",Bt(f,0),g,f);case Z.sprmCSymbol:return st("char","symbol",{font:Nt(f,0),charCode:Nt(f,2)},g,f);case Z.sprmCRgFtc0:case Z.sprmCRgFtc1:case Z.sprmCRgFtc2:case Z.sprmCFtcBi:return st("char","fontFamilyId",Nt(f,0),g,f);case Z.sprmCCharScale:return st("char","scale",Nt(f,0),g,f);case Z.sprmCFDStrike:return st("char","doubleStrike",Tt(f),g,f);case Z.sprmCFImprint:return st("char","imprint",Tt(f),g,f);case Z.sprmCFSpec:return st("char","special",Tt(f),g,f);case Z.sprmCFObj:return st("char","object",Tt(f),g,f);case Z.sprmCFEmboss:return st("char","emboss",Tt(f),g,f);case Z.sprmCFBiDi:return st("char","rtl",Tt(f),g,f);case Z.sprmCFBoldBi:return st("char","boldBi",Tt(f),g,f);case Z.sprmCFItalicBi:return st("char","italicBi",Tt(f),g,f);case Z.sprmPIstd:return st("para","styleId",Nt(f,0),g,f);case Z.sprmPJc80:case Z.sprmPJc:return st("para","alignment",f[0]??0,g,f);case Z.sprmPFKeep:return st("para","keepLines",Tt(f),g,f);case Z.sprmPFKeepFollow:return st("para","keepNext",Tt(f),g,f);case Z.sprmPFPageBreakBefore:return st("para","pageBreakBefore",Tt(f),g,f);case Z.sprmPIlvl:return st("para","listLevel",f[0]??0,g,f);case Z.sprmPIlfo:return st("para","listId",Nt(f,0),g,f);case Z.sprmPDxaRight80:case Z.sprmPDxaRight:return st("para","rightIndent",Bt(f,0),g,f);case Z.sprmPDxaLeft80:case Z.sprmPDxaLeft:return st("para","leftIndent",Bt(f,0),g,f);case Z.sprmPDxaLeft180:case Z.sprmPDxaLeft1:return st("para","firstLineIndent",Bt(f,0),g,f);case Z.sprmPDyaLine:return st("para","lineSpacing",Bt(f,0),g,f);case Z.sprmPDyaBefore:return st("para","spacingBefore",Bt(f,0),g,f);case Z.sprmPDyaAfter:return st("para","spacingAfter",Bt(f,0),g,f);case Z.sprmPFInTable:return st("para","inTable",Tt(f),g,f);case Z.sprmPFTtp:return st("para","tableRowEnd",Tt(f),g,f);case Z.sprmPDxaAbs:return st("para","frameLeft",Bt(f,0),g,f);case Z.sprmPDyaAbs:return st("para","frameTop",Bt(f,0),g,f);case Z.sprmPDxaWidth:return st("para","frameWidth",Bt(f,0),g,f);case Z.sprmPPc:return st("para","framePosition",f[0]??0,g,f);case Z.sprmPWr:return st("para","frameWrap",f[0]??0,g,f);case Z.sprmPBrcTop80:case Z.sprmPBrcTop:return st("para","borderTop",Yt(f,0),g,f);case Z.sprmPBrcLeft80:case Z.sprmPBrcLeft:return st("para","borderLeft",Yt(f,0),g,f);case Z.sprmPBrcBottom80:case Z.sprmPBrcBottom:return st("para","borderBottom",Yt(f,0),g,f);case Z.sprmPBrcRight80:case Z.sprmPBrcRight:return st("para","borderRight",Yt(f,0),g,f);case Z.sprmPBrcBetween80:case Z.sprmPBrcBetween:return st("para","borderBetween",Yt(f,0),g,f);case Z.sprmPBrcBar80:case Z.sprmPBrcBar:return st("para","borderBar",Yt(f,0),g,f);case Z.sprmPWHeightAbs:return st("para","frameHeight",Bt(f,0),g,f);case Z.sprmPShd80:case Z.sprmPShd:return st("para","shading",f.slice(),g,f);case Z.sprmPDyaFromText:return st("para","distanceFromTextY",Bt(f,0),g,f);case Z.sprmPDxaFromText:return st("para","distanceFromTextX",Bt(f,0),g,f);case Z.sprmPFLocked:return st("para","locked",Tt(f),g,f);case Z.sprmPFWidowControl:return st("para","widowControl",Tt(f),g,f);case Z.sprmPFBiDi:return st("para","rtlPara",Tt(f),g,f);case Z.sprmPFAdjustRight:return st("para","adjustRight",Tt(f),g,f);case Z.sprmPItap:return st("para","itap",dr(f,0),g,f);case Z.sprmPDtap:return st("para","dtap",dr(f,0),g,f);case Z.sprmPFInnerTableCell:return st("para","innerTableCell",Tt(f),g,f);case Z.sprmPFInnerTtp:return st("para","innerTableRowEnd",Tt(f),g,f);case Z.sprmPFDyaBeforeAuto:return st("para","spacingBeforeAuto",Tt(f),g,f);case Z.sprmPFDyaAfterAuto:return st("para","spacingAfterAuto",Tt(f),g,f);case Z.sprmTJc90:return st("table","alignment",Nt(f,0),g,f);case Z.sprmTDxaLeft:return st("table","leftIndent",Bt(f,0),g,f);case Z.sprmTDxaGapHalf:return st("table","gapHalf",Nt(f,0),g,f);case Z.sprmTFCantSplit90:return st("table","cantSplit",Tt(f),g,f);case Z.sprmTTableHeader:return st("table","header",Tt(f),g,f);case Z.sprmTDyaRowHeight:return st("table","rowHeight",Bt(f,0),g,f);case Z.sprmTDefTable:return st("table","defTable",gs(f),g,f);case Z.sprmTFBiDi:return st("table","rtl",Tt(f),g,f);case Z.sprmTPc:return st("table","positionCode",f[0]??0,g,f);case Z.sprmTDxaAbs:return st("table","absLeft",Bt(f,0),g,f);case Z.sprmTDyaAbs:return st("table","absTop",Bt(f,0),g,f);case Z.sprmTDxaFromText:return st("table","distanceLeft",Bt(f,0),g,f);case Z.sprmTDyaFromText:return st("table","distanceTop",Bt(f,0),g,f);case Z.sprmTTableWidth:return st("table","tableWidth",Qr(f),g,f);case Z.sprmTFAutofit:return st("table","autoFit",Tt(f),g,f);case Z.sprmTWidthBefore:return st("table","widthBefore",Qr(f),g,f);case Z.sprmTWidthAfter:return st("table","widthAfter",Qr(f),g,f);case Z.sprmTInsert:return st("table","insertCells",As(f),g,f);case Z.sprmTDelete:return st("table","deleteCells",ge(f,0),g,f);case Z.sprmTDxaCol:return st("table","columnWidth",qr(f),g,f);case Z.sprmTMerge:return st("table","merge",ge(f,0),g,f);case Z.sprmTSplit:return st("table","split",ge(f,0),g,f);case Z.sprmTTextFlow:return st("table","textFlow",ve(f),g,f);case Z.sprmTVertMerge:return st("table","vertMerge",ve(f),g,f);case Z.sprmTVertAlign:return st("table","vertAlign",ve(f),g,f);case Z.sprmTSetShd:case Z.sprmTSetShdOdd:return st("table","setShading",ve(f),g,f);case Z.sprmTSetBrc80:case Z.sprmTSetBrc:return st("table","setBorder",ms(f),g,f);case Z.sprmTCellPadding:case Z.sprmTCellPaddingDefault:return st("table","cellPadding",qr(f),g,f);case Z.sprmTCellWidth:return st("table","cellWidth",qr(f),g,f);case Z.sprmTFitText:return st("table","fitText",ve(f),g,f);case Z.sprmTFCellNoWrap:return st("table","cellNoWrap",ve(f),g,f);case Z.sprmTIstd:return st("table","styleId",Nt(f,0),g,f);default:return{kind:d===1?"para":d===2?"char":d===5?"table":"unknown",name:`sprm_${m.toString(16)}`,value:f,raw:m,operandBytes:f}}}function Fe(m,C,d){const f=[];let g=C;for(;g+2<=d;){const y=Nt(m,g);g+=2;const E=bs(m,g,y);if(!E||g+E>d)break;const h=m.subarray(g,g+E);g+=E,f.push(Cs(y,h))}return f}var Z,Ki,Ji=vt((()=>{fr(),Z={sprmCFRMarkDel:2048,sprmCFRMark:2049,sprmCFFldVanish:2050,sprmCPicLocation:27139,sprmCIbstRMark:18436,sprmCDttmRMark:26629,sprmCFData:2054,sprmCFOle2:2058,sprmCHighlight:10764,sprmCIstd:18992,sprmCPlain:10803,sprmCFBold:2101,sprmCFItalic:2102,sprmCFStrike:2103,sprmCFOutline:2104,sprmCFShadow:2105,sprmCFSmallCaps:2106,sprmCFCaps:2107,sprmCFVanish:2108,sprmCKul:10814,sprmCDxaSpace:34880,sprmCIco:10818,sprmCHps:19011,sprmCHpsPos:18501,sprmCSymbol:27145,sprmCHpsKern:18507,sprmCRgFtc0:19023,sprmCRgFtc1:19024,sprmCRgFtc2:19025,sprmCCharScale:18514,sprmCFDStrike:10835,sprmCFImprint:2132,sprmCFSpec:2133,sprmCFObj:2134,sprmCFEmboss:2136,sprmCFBiDi:2138,sprmCFBoldBi:2140,sprmCFItalicBi:2141,sprmCFtcBi:19038,sprmCIcoBi:19040,sprmCHpsBi:19041,sprmPIstd:17920,sprmPIstdPermute:50689,sprmPIncLvl:9730,sprmPJc80:9219,sprmPFKeep:9221,sprmPFKeepFollow:9222,sprmPFPageBreakBefore:9223,sprmPIlvl:9738,sprmPIlfo:17931,sprmPChgTabsPapx:50701,sprmPDxaRight80:33806,sprmPDxaLeft80:33807,sprmPNest80:17936,sprmPDxaLeft180:33809,sprmPDyaLine:25618,sprmPDyaBefore:42003,sprmPDyaAfter:42004,sprmPChgTabs:50709,sprmPFInTable:9238,sprmPFTtp:9239,sprmPDxaAbs:33816,sprmPDyaAbs:33817,sprmPDxaWidth:33818,sprmPPc:9755,sprmPWr:9251,sprmPBrcTop80:25636,sprmPBrcLeft80:25637,sprmPBrcBottom80:25638,sprmPBrcRight80:25639,sprmPBrcBetween80:25640,sprmPBrcBar80:26153,sprmPWHeightAbs:17451,sprmPDcs:17452,sprmPShd80:17453,sprmPDyaFromText:33838,sprmPDxaFromText:33839,sprmPFLocked:9264,sprmPFWidowControl:9265,sprmPFBiDi:9281,sprmPHugePapx:26182,sprmPFAdjustRight:9288,sprmPItap:26185,sprmPDtap:26186,sprmPFInnerTableCell:9291,sprmPFInnerTtp:9292,sprmPShd:50765,sprmPBrcTop:50766,sprmPBrcLeft:50767,sprmPBrcBottom:50768,sprmPBrcRight:50769,sprmPBrcBetween:50770,sprmPBrcBar:50771,sprmPDxcRight:17493,sprmPDxcLeft:17494,sprmPDxcLeft1:17495,sprmPDylBefore:17496,sprmPDylAfter:17497,sprmPFDyaBeforeAuto:9307,sprmPFDyaAfterAuto:9308,sprmPDxaRight:33885,sprmPDxaLeft:33886,sprmPNest:18015,sprmPDxaLeft1:33888,sprmPJc:9313,sprmTJc90:21504,sprmTDxaLeft:38401,sprmTDxaGapHalf:38402,sprmTFCantSplit90:13315,sprmTTableHeader:13316,sprmTTableBorders80:54789,sprmTDyaRowHeight:37895,sprmTDefTable:54792,sprmTDefTableShd80:54793,sprmTTlp:29706,sprmTFBiDi:22027,sprmTDefTableShd3rd:54796,sprmTPc:13837,sprmTDxaAbs:37902,sprmTDyaAbs:37903,sprmTDxaFromText:37904,sprmTDyaFromText:37905,sprmTDefTableShd:54802,sprmTTableBorders:54803,sprmTTableWidth:62996,sprmTFAutofit:13845,sprmTWidthBefore:62999,sprmTWidthAfter:63e3,sprmTSetBrc80:54816,sprmTInsert:30241,sprmTDelete:22050,sprmTDxaCol:30243,sprmTMerge:22052,sprmTSplit:22053,sprmTTextFlow:30249,sprmTVertMerge:54827,sprmTVertAlign:54828,sprmTSetShd:54829,sprmTSetShdOdd:54830,sprmTSetBrc:54831,sprmTCellPadding:54834,sprmTCellPaddingDefault:54835,sprmTCellWidth:54837,sprmTFitText:63030,sprmTFCellNoWrap:54841,sprmTIstd:22074},Ki=new Set([Z.sprmPChgTabs,Z.sprmPChgTabsPapx,Z.sprmTDefTable,Z.sprmTTableBorders80,Z.sprmTTableBorders,Z.sprmTDefTableShd,Z.sprmTDefTableShd80,Z.sprmTDefTableShd3rd,Z.sprmTSetBrc80,Z.sprmTSetBrc,Z.sprmTSetShd,Z.sprmTSetShdOdd,Z.sprmTCellPadding,Z.sprmTCellPaddingDefault,Z.sprmTCellWidth,Z.sprmTVertAlign,Z.sprmTVertMerge,Z.sprmTTextFlow,Z.sprmTDxaCol])}));function Zi(m,C,d){if(C==null||d==null||d<=0)return{aFC:[],pages:[]};const f=new xt(m.subarray(C,C+d)),g=Math.floor((d-4)/8);if(g<=0)return{aFC:[],pages:[]};const y=[];for(let w=0;w<=g;w+=1)y.push(f.u32(w*4)>>>0);const E=[],h=(g+1)*4;for(let w=0;w<g;w+=1)E.push(f.u32(h+w*4)&4194303);return{aFC:y,pages:E}}function vs(m,C){const d=C*512,f=m.subarray(d,d+512);if(f.length<512)return null;const g=new xt(f),y=g.u8(511);if(!y||y>100)return null;const E=[];for(let r=0;r<=y;r+=1)E.push(g.u32(r*4)>>>0);const h=[],w=[],A=(y+1)*4;for(let r=0;r<y;r+=1){const n=g.u8(A+r);h.push(n),w.push(n?d+n*2:0)}return{crun:y,rgfc:E,rgb:h,chpxOffsets:w}}function ys(m,C){const d=C*512,f=m.subarray(d,d+512);if(f.length<512)return null;const g=new xt(f),y=g.u8(511);if(y>29)return null;const E=[];for(let r=0;r<=y;r+=1)E.push(g.u32(r*4)>>>0);const h=(y+1)*4,w=[],A=[];for(let r=0;r<y;r+=1){const n=g.u8(h+r*13);w.push(n),A.push(n?d+n*2:0)}return{cpara:y,rgfc:E,bOffsets:w,papxOffsets:A}}function Es(m,C,d,f){const g=d.fibRgFcLcb.fcPlcfBteChpx,y=d.fibRgFcLcb.lcbPlcfBteChpx,E=Zi(C,g,y),h=[];for(const w of E.pages){const A=vs(m,w);if(A)for(let r=0;r<A.crun;r+=1){const n=A.rgfc[r]??0,e=A.rgfc[r+1]??n,t=cr(f,n),p=cr(f,e);if(t==null||p==null||p<=t)continue;const c=A.chpxOffsets[r]?_s(m,A.chpxOffsets[r]):[];h.push({cpStart:t,cpEnd:p,fcStart:n,fcEnd:e,properties:c})}}return h.sort((w,A)=>w.cpStart-A.cpStart||w.cpEnd-A.cpEnd),h}function ws(m,C,d,f){const g=d.fibRgFcLcb.fcPlcfBtePapx,y=d.fibRgFcLcb.lcbPlcfBtePapx,E=Zi(C,g,y),h=[];for(const w of E.pages){const A=ys(m,w);if(A)for(let r=0;r<A.cpara;r+=1){const n=A.rgfc[r]??0,e=A.rgfc[r+1]??n,t=cr(f,n),p=cr(f,e);if(t==null||p==null||p<t)continue;const c=A.papxOffsets[r]?Ts(m,A.papxOffsets[r]):{styleId:0,properties:[]};h.push({cpStart:t,cpEnd:p,fcStart:n,fcEnd:e,styleId:c.styleId,properties:c.properties,rawOffset:A.papxOffsets[r]??0})}}return h.sort((w,A)=>w.cpStart-A.cpStart||w.cpEnd-A.cpEnd),h}function _s(m,C){if(C==null||C<0||C>=m.length)return[];const d=m[C]??0;if(!d)return[];const f=C+1;return Fe(m,f,Math.min(m.length,f+d))}function Ts(m,C){if(C==null||C<0||C>=m.length)return{styleId:0,properties:[]};const d=new xt(m),f=d.u8(C);if(f===0&&!d.ensure(C+1,1))return{styleId:0,properties:[]};let g,y;return f===0?(y=d.u8(C+1)*2,g=C+2):(y=f-1,g=C+1),y<2||!d.ensure(g,Math.max(2,y))?{styleId:0,properties:[]}:{styleId:d.u16(g),properties:Fe(m,g+2,Math.min(m.length,g+y))}}var xs=vt((()=>{pe(),Ji(),Wi()}));function Ss(m,C){let d=C;for(;d+1<m.length&&!(m[d]===0&&m[d+1]===0);)d+=2;return{value:new TextDecoder("utf-16le").decode(m.subarray(C,d)),nextOffset:Math.min(m.length,d+2)}}function Ps(m,C){if(!m.length)return null;const d=new xt(m),f=d.u8(0),g=d.u8(1),y=d.u16(2),E=d.u8(4),h=d.u8(5),w=d.slice(6,10),A=d.slice(16,24),r=40;let n="",e="";if(m.length>r){const t=new TextDecoder("utf-16le").decode(m.subarray(r)).split("\0").filter(Boolean);if(n=t[0]||"",e=t[1]||"",!e&&h){const p=r+h*2;p+2<=m.length&&(e=Ss(m,p).value)}}return{index:C,cbFfnM1:f,ffid:g,weight:y,charset:E,ixchSzAlt:h,panose:w,fontSignature:A,name:n,altName:e}}function Ds(m,C){const d=C.fcSttbfFfn,f=C.lcbSttbfFfn;if(d==null||f==null||f<=0)return{header:null,fonts:[],byIndex(r){return r==null,null}};const g=m.subarray(d,d+f),y=new xt(g),E=y.u16(0),h=y.u16(2);let w=4;const A=[];for(let r=0;r<E&&w<g.length;r+=1){const n=y.u8(w)+1,e=Ps(g.subarray(w,Math.min(w+n,g.length)),r);e&&A.push(e),w+=n+h}return{header:{cData:E,cbExtra:h},fonts:A,byIndex(r){return r==null||r<0?null:A[r]||null}}}var Rs=vt((()=>{pe()}));function qi(m,C,d=0){if(d+C.length>m.length)return!1;for(let f=0;f<C.length;f+=1)if(m[d+f]!==C[f])return!1;return!0}function ks(m){const C=[{mime:"image/png",magic:[137,80,78,71],end:Is},{mime:"image/jpeg",magic:[255,216,255],end:Ms},{mime:"image/gif",magic:[71,73,70,56],end:Os},{mime:"image/bmp",magic:[66,77],end:Bs},{mime:"image/tiff",magic:[73,73,42,0],end:null},{mime:"image/tiff",magic:[77,77,0,42],end:null},{mime:"image/emf",magic:[1,0,0,0],end:Ns},{mime:"image/wmf",magic:[215,205,198,154],end:null}];for(let d=0;d<m.length-4;d+=1)for(const f of C)if(qi(m,f.magic,d)){const g=f.end?f.end(m,d):m.length;return{mime:f.mime,start:d,end:g||m.length}}return null}function Is(m,C){for(let d=C+8;d+8<m.length;d+=1)if(qi(m,[73,69,78,68],d))return d+8;return m.length}function Ms(m,C){for(let d=C+2;d+1<m.length;d+=1)if(m[d]===255&&m[d+1]===217)return d+2;return m.length}function Os(m,C){for(let d=C+6;d<m.length;d+=1)if(m[d]===59)return d+1;return m.length}function Bs(m,C){if(C+6<=m.length){const d=new xt(m.subarray(C)).u32(2);if(d>0&&C+d<=m.length)return C+d}return m.length}function Ns(m,C){if(C+48<=m.length){const d=new xt(m.subarray(C)).u32(40);if(d>0&&C+d<=m.length)return C+d}return m.length}function Fs(m,C,d={}){if(!m||C==null||C<0||C+68>m.length)return null;const f=new xt(m),g=f.i32(C),y=f.u16(C+4),E=g>0&&C+g<=m.length?g:Math.min(m.length-C,d.maxPictureBytes||8*1024*1024),h=m.subarray(C,C+E),w=Math.min(y||68,h.length),A=ks(h.subarray(w));if(!A)return{id:Xt("asset-img"),type:"image",mime:"application/octet-stream",bytes:h,dataUrl:ar(h,"application/octet-stream"),meta:{pictureOffset:C,lcb:g,cbHeader:y}};const r=w+A.start,n=Math.min(w+A.end,h.length),e=h.subarray(r,n);return{id:Xt("asset-img"),type:"image",mime:A.mime,bytes:e,dataUrl:ar(e,A.mime),meta:{pictureOffset:C,lcb:g,cbHeader:y}}}function tn(m,C){let d=C;for(;d<m.length&&m[d]!==0;)d+=1;return{value:new TextDecoder("windows-1252").decode(m.subarray(C,d)),nextOffset:d+1}}function Ls(m){const C=new xt(m);for(const d of[4,6])try{let f=d;const g=tn(m,f);f=g.nextOffset;const y=tn(m,f);f=y.nextOffset;const E=tn(m,f);if(f=E.nextOffset,f+4>m.length)continue;const h=C.u32(f);if(f+=4,h>0&&f+h<=m.length){const w=m.subarray(f,f+h);return{label:g.value,originalPath:y.value,tempPath:E.value,dataSize:h,bytes:w}}}catch{}return null}function Hs(m,C){const d=m.listChildren(C).filter(w=>w.objectType===2||w.objectType===5),f=new Map(d.map(w=>[w.name.toLowerCase(),w])),g=f.get("objinfo")||f.get("objinfo")||f.get("objinfo"),y=f.get("ole10native")||f.get("ole10native")||f.get("ole10native"),E=f.get("package")||f.get("contents")||f.get("content"),h={entry:C,streams:d,displayName:C.name,attachment:null,objectData:null};if(y){const w=Ls(m.getStream(y)||new Uint8Array(0));if(w){const A=w.label||w.originalPath.split(/[\\/]/).pop()||`${C.name}.bin`;return h.attachment={id:Xt("asset-ole"),type:"attachment",name:A,mime:"application/octet-stream",bytes:w.bytes,dataUrl:ar(w.bytes,"application/octet-stream"),meta:w},h}}if(E){const w=m.getStream(E)||new Uint8Array(0);h.attachment={id:Xt("asset-pkg"),type:"attachment",name:`${ki(C.name)}.bin`,mime:"application/octet-stream",bytes:w,dataUrl:ar(w,"application/octet-stream"),meta:{stream:E.name}}}return g&&(h.objectData=m.getStream(g)||new Uint8Array(0)),h}function Us(m){const C=m.getEntry("/ObjectPool");if(!C)return new Map;const d=m.listChildren(C).filter(g=>g.objectType===1),f=new Map;for(const g of d)f.set(g.name,Hs(m,g));return f}var js=vt((()=>{pe(),Ce()}));function en(m){const C={bold:!1,italic:!1,strike:!1,underline:0,fontSizeHalfPoints:void 0,fontFamilyId:void 0,colorIndex:void 0,highlight:void 0,spacing:0,positionHalfPoints:0,scale:100,hidden:!1,smallCaps:!1,caps:!1,outline:!1,shadow:!1,emboss:!1,imprint:!1,rtl:!1,pictureOffset:void 0,data:!1,ole2:!1,object:!1,special:!1,charStyleId:void 0};for(const d of m||[])switch(d.name){case"plain":d.value&&(C.bold=!1,C.italic=!1,C.strike=!1,C.underline=0,C.smallCaps=!1,C.caps=!1);break;case"bold":case"italic":case"strike":case"hidden":case"smallCaps":case"caps":case"outline":case"shadow":case"emboss":case"imprint":case"rtl":case"data":case"ole2":case"object":case"special":C[d.name]=!!d.value;break;case"underline":C.underline=d.value??0;break;case"fontSizeHalfPoints":C.fontSizeHalfPoints=d.value;break;case"fontFamilyId":C.fontFamilyId=d.value;break;case"colorIndex":C.colorIndex=d.value;break;case"highlight":C.highlight=d.value;break;case"spacing":C.spacing=d.value||0;break;case"positionHalfPoints":C.positionHalfPoints=d.value||0;break;case"scale":C.scale=d.value||100;break;case"pictureOffset":C.pictureOffset=d.value;break;case"charStyleId":C.charStyleId=d.value;break;default:C[d.name]=d.value;break}return C}function Gs(m){const C={styleId:0,alignment:0,spacingBefore:0,spacingAfter:0,lineSpacing:0,leftIndent:0,rightIndent:0,firstLineIndent:0,keepLines:!1,keepNext:!1,pageBreakBefore:!1,widowControl:!1,inTable:!1,tableRowEnd:!1,innerTableCell:!1,innerTableRowEnd:!1,itap:0,dtap:0,listLevel:void 0,listId:void 0,rtlPara:!1,adjustRight:!1,frameLeft:void 0,frameTop:void 0,frameWidth:void 0,frameHeight:void 0,framePosition:void 0,frameWrap:void 0,borders:{},shading:void 0};for(const d of m||[])switch(d.name){case"styleId":C.styleId=d.value||0;break;case"alignment":C.alignment=d.value??0;break;case"spacingBefore":C.spacingBefore=d.value||0;break;case"spacingAfter":C.spacingAfter=d.value||0;break;case"lineSpacing":C.lineSpacing=d.value||0;break;case"leftIndent":C.leftIndent=d.value||0;break;case"rightIndent":C.rightIndent=d.value||0;break;case"firstLineIndent":C.firstLineIndent=d.value||0;break;case"keepLines":case"keepNext":case"pageBreakBefore":case"widowControl":case"inTable":case"tableRowEnd":case"innerTableCell":case"innerTableRowEnd":case"rtlPara":case"adjustRight":C[d.name]=!!d.value;break;case"itap":C.itap=d.value||0;break;case"dtap":C.dtap=d.value||0;break;case"listLevel":C.listLevel=d.value;break;case"listId":C.listId=d.value;break;case"frameLeft":C.frameLeft=d.value;break;case"frameTop":C.frameTop=d.value;break;case"frameWidth":C.frameWidth=d.value;break;case"frameHeight":C.frameHeight=d.value;break;case"framePosition":C.framePosition=d.value;break;case"frameWrap":C.frameWrap=d.value;break;case"borderTop":C.borders.top=d.value;break;case"borderLeft":C.borders.left=d.value;break;case"borderBottom":C.borders.bottom=d.value;break;case"borderRight":C.borders.right=d.value;break;case"borderBetween":C.borders.between=d.value;break;case"borderBar":C.borders.bar=d.value;break;case"shading":C.shading=d.value;break;default:C[d.name]=d.value;break}return C}function pr(m){const C={styleId:void 0,alignment:0,leftIndent:0,gapHalf:0,cantSplit:!1,header:!1,rowHeight:0,rtl:!1,positionCode:void 0,absLeft:void 0,absTop:void 0,distanceLeft:void 0,distanceTop:void 0,tableWidth:void 0,autoFit:void 0,widthBefore:void 0,widthAfter:void 0,defTable:void 0,operations:[]};for(const d of m||[])switch(d.name){case"styleId":C.styleId=d.value;break;case"alignment":C.alignment=d.value??0;break;case"leftIndent":C.leftIndent=d.value||0;break;case"gapHalf":C.gapHalf=d.value||0;break;case"cantSplit":case"header":case"rtl":C[d.name]=!!d.value;break;case"rowHeight":C.rowHeight=d.value||0;break;case"positionCode":C.positionCode=d.value;break;case"absLeft":C.absLeft=d.value;break;case"absTop":C.absTop=d.value;break;case"distanceLeft":C.distanceLeft=d.value;break;case"distanceTop":C.distanceTop=d.value;break;case"tableWidth":C.tableWidth=d.value;break;case"autoFit":C.autoFit=d.value;break;case"widthBefore":C.widthBefore=d.value;break;case"widthAfter":C.widthAfter=d.value;break;case"defTable":C.defTable=d.value;break;default:C.operations.push(d);break}return C}function rn(m){return m?.inTable?Math.max(1,m.itap||(m.dtap?m.dtap:1)):0}function Ws(m){return $i[m]||"left"}function zs(m){return zi[m]||(m?"single":"none")}function $s(m){return Vi[m]||"top"}function Qt(m,C,d){if(!C)return;const f=Math.max(0,C.first||0),g=Math.max(f,C.lim||f);for(let y=f;y<g&&y<m.length;y+=1)d(m[y],y)}function Vs(m){const C=m?.defTable;if(!C||!Array.isArray(C.cells))return[];const d=C.cells.map((f,g)=>({index:g,width:f?.wWidth,ftsWidth:f?.tcgrf?.ftsWidth,borders:f?.borders||{},merge:f?.tcgrf?.horzMerge||0,vertMerge:f?.tcgrf?.vertMerge||0,vertAlign:f?.tcgrf?.vertAlign||0,fitText:!!f?.tcgrf?.fitText,noWrap:!!f?.tcgrf?.noWrap,hideMark:!!f?.tcgrf?.hideMark,textFlow:f?.tcgrf?.textFlow||0,rightBoundary:C.rgdxaCenter?.[g+1],leftBoundary:C.rgdxaCenter?.[g]}));for(const f of m.operations||[])switch(f.name){case"merge":Qt(d,f.value,(g,y)=>{y===f.value.first?g.merge=2:g.merge=1});break;case"split":Qt(d,f.value,g=>{g.merge=0});break;case"cellWidth":case"columnWidth":Qt(d,f.value.range,g=>{const y=f.value;g.width=y.width,g.ftsWidth=y.ftsWidth});break;case"vertMerge":Qt(d,f.value.range,g=>{g.vertMerge=f.value.value});break;case"vertAlign":Qt(d,f.value.range,g=>{g.vertAlign=f.value.value});break;case"setBorder":Qt(d,f.value.range,g=>{g.borders={...g.borders||{},all:f.value.border}});break;case"setShading":Qt(d,f.value.range,g=>{g.shading=f.value.value});break;case"fitText":Qt(d,f.value.range,g=>{g.fitText=!!f.value.value});break;case"cellNoWrap":Qt(d,f.value.range,g=>{g.noWrap=!!f.value.value});break;case"textFlow":Qt(d,f.value.range,g=>{g.textFlow=f.value.value});break;default:break}return d}var Qi=vt((()=>{fr()}));function ye(...m){const C=new Map;for(const d of m)for(const f of d||[])C.set(`${f.kind}:${f.name}`,f);return Array.from(C.values())}function Xs(m){const C={para:[],char:[],table:[]};for(const d of m||[])d.kind==="para"?C.para.push(d):d.kind==="char"?C.char.push(d):d.kind==="table"&&C.table.push(d);return C}function Ys(m,C){const d=new xt(m),f=d.u16(C),g=C+2,y=f*2,E=d.utf16le(g,y),h=g+y+2;return{value:E.replace(/\u0000+$/,""),nextOffset:h}}function Ks(m,C){const d=new xt(m),f=d.u16(C),g=d.u16(C+2),y=d.u16(C+4);return{sti:f&4095,flags1:f>>12,stk:g&15,istdBase:g>>4&4095,cupx:y&15,istdNext:y>>4&4095,bchUpe:d.u16(C+6),grfstd:d.u16(C+8)}}function to(m,C){const d=new xt(m).u16(C),f=C+2,g=f+d,y=m.subarray(f,Math.min(g,m.length));let E=0,h=[];return y.length>=2&&(E=y[0]|(y[1]??0)<<8,h=Fe(y,2,y.length)),{cbUpx:d,styleId:E,properties:h,nextOffset:Oe(g)}}function nn(m,C){const d=new xt(m).u16(C),f=C+2,g=f+d,y=m.subarray(f,Math.min(g,m.length));return{cbUpx:d,properties:Fe(y,0,y.length),nextOffset:Oe(g)}}function Js(m,C){const d=new xt(m).u16(C),f=C+2,g=f+d,y=m.subarray(f,Math.min(g,m.length));return{cbUpx:d,properties:Fe(y,0,y.length),nextOffset:Oe(g)}}function Zs(m,C,d){if(!m.length)return{istd:d,empty:!0,name:"",stdfBase:{istdBase:4095,istdNext:0,stk:1,cupx:0},paraProps:[],charProps:[],tableProps:[]};const f=Math.max(10,Math.min(C||10,m.length)),g=Ks(m,0);let y=f;const E=Ys(m,y);y=E.nextOffset;let h=[],w=[],A=[];try{if(g.stk===1){if(g.cupx>=1&&y+2<=m.length){const r=to(m,y);h=r.properties,y=r.nextOffset}g.cupx>=2&&y+2<=m.length&&(w=nn(m,y).properties)}else if(g.stk===2)y+2<=m.length&&(w=nn(m,y).properties);else if(g.stk===3){if(g.cupx>=1&&y+2<=m.length){const r=Js(m,y);A=r.properties,y=r.nextOffset}if(g.cupx>=2&&y+2<=m.length){const r=to(m,y);h=r.properties,y=r.nextOffset}g.cupx>=3&&y+2<=m.length&&(w=nn(m,y).properties)}}catch{}return{istd:d,name:E.value,stdfBase:g,paraProps:h,charProps:w,tableProps:A,empty:!1}}function qs(m,C){const d=C.fcStshf,f=C.lcbStshf;if(d==null||f==null||f<=0)return{styles:new Map,header:null,resolveStyle(e){return on(new Map,e)}};const g=m.subarray(d,d+f),y=new xt(g),E=y.u16(0),h=y.u16(2),w=y.u16(4),A={cbStshi:E,cstd:h,cbSTDBaseInFile:w,ftcAsci:y.u16(12),ftcFE:y.u16(14),ftcOther:y.u16(16)};let r=2+E;const n=new Map;for(let e=0;e<h&&r+2<=g.length;e+=1){const t=y.u16(r),p=r+2,c=p+t;if(t===0){n.set(e,{istd:e,empty:!0,name:"",stdfBase:{istdBase:4095,istdNext:0,stk:1,cupx:0},paraProps:[],charProps:[],tableProps:[]}),r=Oe(c);continue}const s=Zs(g.subarray(p,Math.min(c,g.length)),w,e);n.set(e,s),r=Oe(c)}return{header:A,styles:n,resolveStyle(e){return on(n,e)}}}function on(m,C,d=new Set){if(C==null||C===4095||d.has(C))return{paraProps:[],charProps:[],tableProps:[],styleIds:[]};const f=m.get(C);if(!f||f.empty)return{paraProps:[],charProps:[],tableProps:[],styleIds:[]};d.add(C);const g=on(m,f.stdfBase?.istdBase,d);return{styleIds:[...g.styleIds,C],paraProps:ye(g.paraProps,f.paraProps),charProps:ye(g.charProps,f.charProps),tableProps:ye(g.tableProps,f.tableProps)}}var Qs=vt((()=>{pe(),Ce(),Ji()}));function tl(m,C,d,f){let g=f?.index||0;for(;g<m.length&&m[g].cpEnd<=C;)g+=1;f&&(f.index=g);const y=[];let E=g;for(;E<m.length&&m[E].cpStart<d;)m[E].cpEnd>C&&y.push(m[E]),E+=1;return y}function el(m){return String(m||"").trim()}function eo(m){const C=String(m||"").replace(/[\r\n\t]+/g," ").replace(/\s+/g," ").trim();if(!C)return null;const d=C.toUpperCase();if(d.startsWith("HYPERLINK")){const f=C.slice(9).trim(),g=f.match(/"([^"]+)"/)?.[1]||f.split(/\s+/)[0]||"";return g?{type:"hyperlink",href:g}:null}if(d.startsWith("INCLUDEPICTURE")){const f=C.slice(14).trim();return{type:"includePicture",target:f.match(/"([^"]+)"/)?.[1]||f.split(/\s+/)[0]||""}}return d.startsWith("EMBED")?{type:"embed",raw:C}:d.startsWith("LINK")?{type:"link",raw:C}:{type:"unknown",raw:C}}function rl(m,C){if(!C.text)return;const d=m[m.length-1];if(d&&d.type==="text"&&d.href===C.href&&Ii(d.style,C.style)){d.text+=C.text;return}m.push(C)}function me(m,C,d){if(!d)return;const f=m.length?m[m.length-1].nodes:C;d.type==="text"?rl(f,d):f.push(d)}function nl(m,C){const d=[`_${C}`,`_${String(C)}`,`_${C.toString(16)}`,`_${C.toString(16).toUpperCase()}`];for(const f of d)if(m.has(f))return m.get(f)||null;return null}function il(m,C,d,f,g,y={}){return function(h){const w=h?.pictureOffset;if(w==null)return null;if(g.has(w))return g.get(w)||null;let A=null;const r=nl(C,w);if((h.ole2||h.object||h.data)&&r?.attachment&&(A=r.attachment,f.add(r.entry.name)),!A&&m?.length){const n=Fs(m,w,y);n&&n.mime!=="application/octet-stream"?A=n:!A&&r?.attachment?(A=r.attachment,f.add(r.entry.name)):n&&(A=n)}return!A&&r?.attachment&&(A=r.attachment,f.add(r.entry.name)),A&&d.push(A),g.set(w,A),A}}function ol(m){switch(m){case zt.nonBreakingHyphen:return"-";case zt.nonRequiredHyphen:return"";case zt.annotationRef:return"";default:return m}}function al(m,C){const d=[],f=[];for(const g of m)if(!(!g.text||g.state.hidden))for(const y of g.text){const E=ol(y);if(E===zt.fieldStart){f.push({instruction:"",parsed:null,readingInstruction:!0,nodes:[]});continue}if(E===zt.fieldSeparator){const w=f[f.length-1];w&&(w.parsed=eo(w.instruction),w.readingInstruction=!1);continue}if(E===zt.fieldEnd){const w=f.pop();if(!w)continue;let A=w.nodes;if(w.readingInstruction&&(w.parsed=eo(w.instruction)),w.parsed?.type==="hyperlink"){const r=w.parsed.href;A=A.map(n=>n.type==="lineBreak"||n.type==="pageBreak"?n:{...n,href:r})}for(const r of A)me(f,d,r);continue}const h=f[f.length-1];if(h?.readingInstruction){h.instruction+=E;continue}if(E===zt.hardLineBreak){me(f,d,{type:"lineBreak"});continue}if(E===zt.pageBreak){me(f,d,{type:"pageBreak"});continue}if(E===zt.picture){const w=C(g.state);w?.type==="image"?me(f,d,{type:"image",asset:w,style:g.state}):w?.type==="attachment"&&me(f,d,{type:"attachment",asset:w,style:g.state});continue}me(f,d,{type:"text",text:Ga(E),style:g.state})}for(;f.length;){const g=f.pop();for(const y of g.nodes)me(f,d,y)}return d}function sl(m,C,d,f,g,y,E){const h=tl(d,m.cpStart,m.cpEnd,E),w=new Set([m.cpStart,m.cpEnd]);for(const n of h)w.add(Math.max(m.cpStart,n.cpStart)),w.add(Math.min(m.cpEnd,n.cpEnd));const A=Array.from(w).sort((n,e)=>n-e),r=[];for(let n=0;n<A.length-1;n+=1){const e=A[n],t=A[n+1];if(t<=e)continue;const p=h.find(b=>b.cpStart<=e&&b.cpEnd>=t)?.properties||[],c=en(p),s=en(ye(g,c.charStyleId!=null?f.resolveStyle(c.charStyleId).charProps:[],p)),l=y(s.fontFamilyId);l&&(s.fontFamily=l.name||l.altName||void 0);const u=e-m.cpStart,o=t-m.cpStart,i=C.slice(u,o);if(!i)continue;const a=r[r.length-1];if(a&&Ii(a.state,s)){a.text+=i,a.cpEnd=t;continue}r.push({cpStart:e,cpEnd:t,text:i,state:s})}if(!r.length&&C){const n=en(g),e=y(n.fontFamilyId);e&&(n.fontFamily=e.name||e.altName||void 0),r.push({cpStart:m.cpStart,cpEnd:m.cpEnd,text:C,state:n})}return r}function ll(m,C,d,f,g,y,E){const h=Xs(m.properties||[]),w=m.styleId||h.para.find(o=>o.name==="styleId")?.value||0,A=d.resolveStyle(w),r=ye(A.paraProps,h.para),n=Gs(r),e=pr(h.table),t=ye(e.styleId!=null?d.resolveStyle(e.styleId).tableProps:[],h.table),p=pr(t),c=A.charProps,l=sl(m,C,g,d,c,o=>f.byIndex(o),E),u=al(l,y);return{id:Xt("para"),cpStart:m.cpStart,cpEnd:m.cpEnd,terminator:m.terminator||"",text:C,rawProperties:m.properties||[],styleId:w,styleName:el(d.styles.get(w)?.name),paraProps:r,paraState:n,tableProps:t,tableState:p,segments:l,inlines:u}}function cl(m){for(const C of m)for(let d=0;d<C.cells.length;d+=1){const f=C.cells[d],g=f.meta?.merge||0;if(f.colIndex=d,f.colspan=1,f.rowspan=1,f.hidden=!1,g===1){f.hidden=!0;continue}if(g>1){let y=d+1;for(;y<C.cells.length&&(C.cells[y].meta?.merge||0)===1;)C.cells[y].hidden=!0,f.colspan+=1,y+=1}}for(let C=0;C<m.length;C+=1){const d=m[C];for(const f of d.cells){if(f.hidden)continue;const g=f.meta?.vertMerge||0;if(g===1){f.hidden=!0;continue}if(g>1){let y=C+1;for(;y<m.length;){let E=!0;for(let h=f.colIndex||0;h<(f.colIndex||0)+(f.colspan||1);h+=1){const w=m[y].cells[h];if(!w||(w.meta?.vertMerge||0)!==1){E=!1;break}}if(!E)break;for(let h=f.colIndex||0;h<(f.colIndex||0)+(f.colspan||1);h+=1)m[y].cells[h].hidden=!0;f.rowspan=(f.rowspan||1)+1,y+=1}}}}}function an(m){return{type:"paragraph",id:m.id,styleId:m.styleId,styleName:m.styleName,paraState:m.paraState,inlines:m.inlines,text:m.text}}function hl(m){const C=[];let d={cells:[]},f=[];for(const E of m)if(f.push(E),E.terminator===zt.cellMark&&(d.cells.push({id:Xt("cell"),paragraphs:f.map(an),meta:null}),f=[],E.paraState.tableRowEnd||E.paraState.innerTableRowEnd)){const h=Vs(E.tableState);for(;h.length&&d.cells.length>h.length&&d.cells[d.cells.length-1].paragraphs.every(A=>!A.text&&!(A.inlines||[]).length);)d.cells.pop();d.cells.forEach((A,r)=>{A.meta=h[r]||{index:r}});const w=h.length?(h[h.length-1].rightBoundary||0)-(h[0].leftBoundary||0):0;C.push({id:Xt("row"),cells:d.cells,state:E.tableState,gridWidthTwips:w}),d={cells:[]}}f.length&&d.cells.push({id:Xt("cell"),paragraphs:f.map(an),meta:null}),d.cells.length&&C.push({id:Xt("row"),cells:d.cells,state:m[0]?.tableState||pr([]),gridWidthTwips:0}),cl(C);const g=C.find(E=>E.gridWidthTwips)?.gridWidthTwips||0,y=Math.max(...m.map(E=>rn(E.paraState)),1);return{type:"table",id:Xt("table"),depth:y,rows:C,state:C[0]?.state||pr([]),gridWidthTwips:g}}function fl(m){const C=[];let d=0;for(;d<m.length;){const f=m[d];if(rn(f.paraState)<=0){C.push(an(f)),d+=1;continue}const g=[];for(;d<m.length&&rn(m[d].paraState)>0;)g.push(m[d]),d+=1;C.push(hl(g))}return C}function dl(m,C={}){const d=[],f=Za(m,C);d.push(...f.warnings||[]);const g=f.getStream("/WordDocument");if(!g)throw new Error("Missing WordDocument stream");const y=ls(g);if(y.base.wIdent!==42476&&sr(d,`Unexpected FIB identifier: 0x${y.base.wIdent.toString(16)}`),y.base.fEncrypted)throw new Error("Encrypted .doc files are not supported yet");const E=f.getStream(y.base.fWhichTblStm?"/1Table":"/0Table");if(!E)throw new Error("Missing table stream");const h=f.getStream("/Data")||new Uint8Array(0),w=rs(E,y.fibRgFcLcb),A=os(g,w),r=A.join(""),n=y.fibRgLw.ccpText>0?y.fibRgLw.ccpText:r.length,e=qs(E,y.fibRgFcLcb),t=Ds(E,y.fibRgFcLcb),p=Es(g,E,y,w).filter(T=>T.cpStart<n),c=ws(g,E,y,w).filter(T=>T.cpStart<n).map(T=>({...T,cpEnd:Math.min(T.cpEnd,n)})),s=c.length?c.map(T=>({cpStart:T.cpStart,cpEnd:T.cpEnd,terminator:r[T.cpEnd-1]||"",styleId:T.styleId,properties:T.properties})):ss(r.slice(0,n)).map(T=>({...T,styleId:0,properties:[]})),l=Us(f),u=[],o=new Set,i=il(h,l,u,o,new Map,C),a={index:0},b=s.map(T=>{const k=as(g,w,A,T.cpStart,T.cpEnd),M=T.terminator===zt.paragraph||T.terminator===zt.cellMark?T.terminator:"",R=M&&k.endsWith(M)?k.slice(0,-1):k;return ll({...T,terminator:M},R,e,t,p,i,a)}),v=fl(b),_=Array.from(l.values()).filter(T=>T?.attachment&&!o.has(T.entry.name)).map(T=>T.attachment);for(const T of _)u.push(T);return _.length&&v.push({type:"attachments",id:Xt("attachments"),items:_}),{kind:"msdoc",version:1,warnings:d,meta:{fib:{wIdent:y.base.wIdent,nFib:y.base.nFib,fWhichTblStm:y.base.fWhichTblStm,fComplex:y.base.fComplex,fEncrypted:y.base.fEncrypted,ccpText:y.fibRgLw.ccpText},counts:{paragraphs:b.length,blocks:v.length,assets:u.length,styles:e.styles.size,fonts:t.fonts.length}},fonts:t.fonts,styles:Array.from(e.styles.values()).map(T=>({istd:T.istd,name:T.name,type:T.stdfBase?.stk,basedOn:T.stdfBase?.istdBase,next:T.stdfBase?.istdNext})),blocks:v,assets:u}}var ro=vt((()=>{qa(),Ce(),Wi(),fr(),ds(),xs(),Rs(),js(),Qi(),Qs()}));function Le(m){return Object.entries(m).filter(([,C])=>C!=null&&C!=="").map(([C,d])=>`${C}:${d}`).join(";")}function ae(m){if(!m)return null;const C=Math.max(1,Math.round((m.lineWidth??8)/8*1.3333)),d=m.borderType,f=d===6?"double":d===3?"dotted":d===2?"dashed":"solid",g=m.color;return`${C}px ${f} ${g&&Ee[g]||"#666"}`}function pl(m){const C={"text-align":Ws(m.alignment)},d=oe(m.spacingBefore),f=oe(m.spacingAfter),g=oe(m.leftIndent),y=oe(m.rightIndent),E=oe(m.firstLineIndent);if(d&&(C["margin-top"]=`${d}px`),f&&(C["margin-bottom"]=`${f}px`),g&&(C["margin-left"]=`${g}px`),y&&(C["margin-right"]=`${y}px`),E&&(C["text-indent"]=`${E}px`),m.lineSpacing){const n=Math.abs(m.lineSpacing)/240;n&&(C["line-height"]=String(Math.max(1,n)))}m.keepLines&&(C["break-inside"]="avoid"),m.keepNext&&(C["break-after"]="avoid"),m.pageBreakBefore&&(C["break-before"]="page"),m.rtlPara&&(C.direction="rtl");const h=ae(m.borders?.top),w=ae(m.borders?.right),A=ae(m.borders?.bottom),r=ae(m.borders?.left);return h&&(C["border-top"]=h),w&&(C["border-right"]=w),A&&(C["border-bottom"]=A),r&&(C["border-left"]=r),C}function ul(m){const C=zs(m);if(!m||C==="none")return{};const d={"text-decoration-line":"underline"};return C==="double"||C==="wavy-double"?d["text-decoration-style"]="double":C.includes("dot")||C==="dotted-heavy"?d["text-decoration-style"]="dotted":C.includes("dash")?d["text-decoration-style"]="dashed":C.includes("wave")||C.includes("wavy")?d["text-decoration-style"]="wavy":d["text-decoration-style"]="solid",d}function no(m){const C={};(m.bold||m.boldBi)&&(C["font-weight"]="700"),(m.italic||m.italicBi)&&(C["font-style"]="italic"),(m.strike||m.doubleStrike)&&(C["text-decoration-line"]=`${C["text-decoration-line"]?`${C["text-decoration-line"]} `:""}line-through`),Object.assign(C,ul(m.underline)),m.fontSizeHalfPoints&&(C["font-size"]=`${m.fontSizeHalfPoints/2}pt`),m.fontFamily&&(C["font-family"]=`'${String(m.fontFamily).replace(/'/g,"\\'")}', sans-serif`),m.colorIndex&&Ee[m.colorIndex]&&(C.color=Ee[m.colorIndex]);const d=typeof m.highlight=="number"?m.highlight:m.highlight?.index;return d&&hr[d]&&(C["background-color"]=hr[d]),m.smallCaps&&(C["font-variant-caps"]="small-caps"),m.caps&&(C["text-transform"]="uppercase"),m.scale&&m.scale!==100&&(C.display="inline-block",C.transform=`scaleX(${m.scale/100})`,C["transform-origin"]="left center"),m.positionHalfPoints>0&&(C["vertical-align"]="super"),m.positionHalfPoints<0&&(C["vertical-align"]="sub"),m.outline&&(C["text-shadow"]="0 0 0.02em currentColor"),(m.shadow||m.emboss||m.imprint)&&(C["text-shadow"]=C["text-shadow"]?`${C["text-shadow"]}, 0.06em 0.06em 0.08em rgba(0,0,0,.25)`:"0.06em 0.06em 0.08em rgba(0,0,0,.25)"),m.rtl&&(C.direction="rtl"),C}function gl(m){const C=qt(m.text),d=no(m.style);d["white-space"]="break-spaces";const f=Le(d),g=`<span${f?` style="${f}"`:""}>${C}</span>`;return m.href?`<a class="msdoc-link" href="${qt(m.href)}" target="_blank" rel="noreferrer noopener">${g}</a>`:g}function ml(m){const C=no(m.style);C["max-width"]="100%",C.height="auto";const d=`<img class="msdoc-image" src="${qt(m.asset.dataUrl)}" alt="" style="${Le(C)}">`;return m.href?`<a class="msdoc-link" href="${qt(m.href)}" target="_blank" rel="noreferrer noopener">${d}</a>`:d}function Al(m){const C=qt(m.asset.name||"embedded-file"),d=`<a class="msdoc-attachment" href="${qt(m.asset.dataUrl)}" download="${C}">📎 ${C}</a>`;return m.href?`<a class="msdoc-link" href="${qt(m.href)}" target="_blank" rel="noreferrer noopener">${d}</a>`:d}function bl(m){return m.map(C=>C.type==="text"?gl(C):C.type==="image"?ml(C):C.type==="attachment"?Al(C):C.type==="lineBreak"?"<br>":C.type==="pageBreak"?'<span class="msdoc-page-break"></span>':"").join("")}function io(m,C={}){const d=C.inline?"div":"p",f=Le(pl(m.paraState)),g=bl(m.inlines||[])||"<br>",y=["msdoc-paragraph"];return m.styleName&&y.push(`msdoc-style-${ki(m.styleName)}`),`<${d} class="${y.join(" ")}"${f?` style="${f}"`:""}>${g}</${d}>`}function Cl(m){const C={},d=oe(m.meta?.rightBoundary!=null&&m.meta?.leftBoundary!=null?m.meta.rightBoundary-m.meta.leftBoundary:m.meta?.width);d&&(C.width=`${d}px`),m.meta?.noWrap&&(C["white-space"]="nowrap"),m.meta?.fitText&&(C["text-align"]="justify"),m.meta?.vertAlign!=null&&(C["vertical-align"]=$s(m.meta.vertAlign));const f=ae(m.meta?.borders?.all),g=ae(m.meta?.borders?.top)||f,y=ae(m.meta?.borders?.right)||f,E=ae(m.meta?.borders?.bottom)||f,h=ae(m.meta?.borders?.left)||f;g&&(C["border-top"]=g),y&&(C["border-right"]=y),E&&(C["border-bottom"]=E),h&&(C["border-left"]=h);const w=typeof m.meta?.shading=="object"&&m.meta?.shading&&"color"in m.meta.shading?m.meta.shading.color:void 0;return w&&Ee[w]&&(C["background-color"]=Ee[w]),C}function vl(m){const C={},d=oe(m.gridWidthTwips||m.state?.tableWidth?.wWidth);d?C.width=`${d}px`:C.width="100%";const f=oe(m.state?.leftIndent);return f&&(C["margin-left"]=`${f}px`),C["border-collapse"]="collapse",C["table-layout"]="fixed",C}function yl(m){const C=m.rows.map(d=>{const f=d.state?.rowHeight?oe(Math.abs(d.state.rowHeight)):null;return`<tr class="msdoc-row"${f?` style="height:${f}px"`:""}>${d.cells.filter(g=>!g.hidden).map(g=>{const y=[];(g.colspan??1)>1&&y.push(` colspan="${g.colspan}"`),(g.rowspan??1)>1&&y.push(` rowspan="${g.rowspan}"`);const E=Le(Cl(g)),h=g.paragraphs.map(w=>io(w,{inline:!0})).join("");return`<td class="msdoc-cell"${y.join("")}${E?` style="${E}"`:""}>${h||'<div class="msdoc-paragraph"><br></div>'}</td>`}).join("")}</tr>`}).join("");return`<table class="msdoc-table msdoc-table-depth-${m.depth}" style="${Le(vl(m))}"><tbody>${C}</tbody></table>`}function El(m){return`<section class="msdoc-attachments"><div class="msdoc-attachments-title">Embedded attachments</div><ul>${m.items.map(C=>`<li><a class="msdoc-attachment" href="${qt(C.dataUrl)}" download="${qt(C.name||"embedded-file")}">📎 ${qt(C.name||"embedded-file")}</a></li>`).join("")}</ul></section>`}function oo(){return`
190
+ `)}function $r(m="utf-8"){return new TextDecoder(m,{fatal:!1})}var Vr,Xr,ve=vt((()=>{Vr=globalThis.Buffer,Xr=0}));function Be(m){"@babel/helpers - typeof";return Be=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(C){return typeof C}:function(C){return C&&typeof Symbol=="function"&&C.constructor===Symbol&&C!==Symbol.prototype?"symbol":typeof C},Be(m)}var Ni=vt((()=>{}));function Va(m,C){if(Be(m)!="object"||!m)return m;var d=m[Symbol.toPrimitive];if(d!==void 0){var f=d.call(m,C||"default");if(Be(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(m)}var Xa=vt((()=>{Ni()}));function Ya(m){var C=Va(m,"string");return Be(C)=="symbol"?C:C+""}var Ka=vt((()=>{Ni(),Xa()}));function Yr(m,C,d){return(C=Ya(C))in m?Object.defineProperty(m,C,{value:d,enumerable:!0,configurable:!0,writable:!0}):m[C]=d,m}var Fi=vt((()=>{Ka()}));function Ja(m){if(m instanceof Uint8Array)return m;if(m instanceof ArrayBuffer)return new Uint8Array(m);if(ArrayBuffer.isView(m))return new Uint8Array(m.buffer,m.byteOffset,m.byteLength);throw new TypeError("Unsupported binary input")}var Kr,Li,xt,ue=vt((()=>{ve(),Fi(),Kr=$r("utf-16le"),Li=$r(typeof TextDecoder<"u"?"windows-1252":"latin1"),xt=class{constructor(m){if(Yr(this,"bytes",void 0),Yr(this,"view",void 0),Yr(this,"length",void 0),m instanceof Uint8Array)this.bytes=m;else if(m instanceof ArrayBuffer)this.bytes=new Uint8Array(m);else if(ArrayBuffer.isView(m))this.bytes=new Uint8Array(m.buffer,m.byteOffset,m.byteLength);else throw new TypeError("BinaryReader expects ArrayBuffer or Uint8Array");this.view=new DataView(this.bytes.buffer,this.bytes.byteOffset,this.bytes.byteLength),this.length=this.bytes.byteLength}ensure(m,C=1){return m>=0&&m+C<=this.length}u8(m){return this.ensure(m,1)?this.view.getUint8(m):0}i8(m){return this.ensure(m,1)?this.view.getInt8(m):0}u16(m){return this.ensure(m,2)?this.view.getUint16(m,!0):0}i16(m){return this.ensure(m,2)?this.view.getInt16(m,!0):0}u32(m){return this.ensure(m,4)?this.view.getUint32(m,!0):0}i32(m){return this.ensure(m,4)?this.view.getInt32(m,!0):0}u64(m){const C=this.u32(m);return this.u32(m+4)*4294967296+C}slice(m,C){return this.ensure(m,C)?this.bytes.subarray(m,m+C):new Uint8Array(0)}array(m,C,d){const f=[],g=d.byteWidth??1;for(let y=0;y<C;y+=1)f.push(d.call(this,m+y*g));return f}utf16le(m,C){return this.ensure(m,C)?Kr.decode(this.slice(m,C)):""}latin1(m,C){return this.ensure(m,C)?Li.decode(this.slice(m,C)):""}ascii(m,C){if(!this.ensure(m,C))return"";let d="";const f=this.slice(m,C);for(let g=0;g<f.length;g+=1)d+=String.fromCharCode(f[g]??0);return d}utf16z(m,C){const d=this.slice(m,C);let f=d.length;for(let g=0;g+1<d.length;g+=2)if(d[g]===0&&d[g+1]===0){f=g;break}return Kr.decode(d.subarray(0,f))}},xt.prototype.u8.byteWidth=1,xt.prototype.i8.byteWidth=1,xt.prototype.u16.byteWidth=2,xt.prototype.i16.byteWidth=2,xt.prototype.u32.byteWidth=4,xt.prototype.i32.byteWidth=4}));function Hi(m){return m===Ne||m===ge||m===ji||m===Gi}function Jr(m,C,d){const f=512+d*C,g=f+C;if(f<0||f>=m.length)throw new Error(`Sector ${d} is out of bounds`);if(g<=m.length)return m.subarray(f,g);const y=new Uint8Array(C);return y.set(m.subarray(f)),y}function Ui(m,C,d=Wi){const f=[],g=new Set;let y=m,E=0;for(;y!==ge&&y!==Ne&&y>=0;){if(g.has(y))throw new Error(`Detected sector loop at ${y}`);if(g.add(y),f.push(y),y=C(y),E+=1,E>d)throw new Error("Sector chain exceeds safe limit")}return f}function lr(m,C,d,f,g=null){if(d===ge||d===Ne||d<0)return new Uint8Array(0);const y=Ui(d,w=>f[w]??ge),E=new Uint8Array(y.length*C);let h=0;for(const w of y)E.set(Jr(m,C,w),h),h+=C;return g==null?E:E.subarray(0,Math.min(g,E.length))}function Za(m){function C(g,y){if(g<0||g>=m.length)return;const E=m[g];E&&(C(E.leftSiblingId,y),y.push(g),C(E.rightSiblingId,y))}function d(g){const y=m[g];if(!y||y.childId<0)return;const E=[];C(y.childId,E),y.children=E;for(const h of E){const w=m[h];w&&(w.parentId=g,d(h))}}const f=m.find(g=>g.objectType===5);if(!f)throw new Error("CFB root storage not found");return d(f.id),f}function qa(m){const C=new Map;for(const d of m){if(!d||!d.name)continue;const f=[];let g=d;for(;g;)g.objectType!==5&&f.push(g.name),g=g.parentId!=null?m[g.parentId]??null:null;const y=`/${f.reverse().join("/")}`;d.path=y==="/"?`/${d.name}`:y,C.set(d.path,d)}return C}function Qa(m){return m.replace(/\u0000+$/,"")}function ts(m,C={}){const d=Ja(m),f=new xt(d),g=[];for(let ot=0;ot<Zr.length;ot+=1)if(f.u8(ot)!==Zr[ot])throw new Error("Not a Compound File Binary document");const y=f.u16(26),E=f.u16(30),h=f.u16(32),w=1<<E,A=1<<h,r=f.u32(40),n=f.u32(44),e=f.i32(48),t=f.u32(52),p=f.u32(56),c=f.i32(60),s=f.u32(64),l=f.i32(68),u=f.u32(72);p!==zi&&sr(g,`Unexpected mini stream cutoff size ${p}`);const o=[];for(let ot=0;ot<109;ot+=1){const tt=f.i32(76+ot*4);!Hi(tt)&&tt>=0&&o.push(tt)}const i=[...o];let a=l,b=0;for(;a!==ge&&a!==Ne&&a>=0;){const ot=new xt(Jr(d,w,a)),tt=w/4-1;for(let ht=0;ht<tt;ht+=1){const W=ot.i32(ht*4);!Hi(W)&&W>=0&&i.push(W)}if(a=ot.i32(w-4),b+=1,b>u+4){sr(g,"DIFAT chain exceeded declared sector count; stopping early");break}}n&&i.length<n&&sr(g,`FAT sector count mismatch: header says ${n}, found ${i.length}`);const v=[];for(const ot of i){const tt=new xt(Jr(d,w,ot));for(let ht=0;ht<w/4;ht+=1)v.push(tt.i32(ht*4))}const _=lr(d,w,e,v),T=new xt(_),k=[];for(let ot=0,tt=0;ot+128<=_.length;ot+=128,tt+=1){const ht=T.u16(ot+64),W=Qa(T.utf16le(ot,Math.max(0,ht-2)));!W&&T.u8(ot+66)===0||k.push({id:tt,name:W,objectType:T.u8(ot+66),colorFlag:T.u8(ot+67),leftSiblingId:T.i32(ot+68),rightSiblingId:T.i32(ot+72),childId:T.i32(ot+76),clsid:T.slice(ot+80,16),stateBits:T.u32(ot+96),creationTime:T.u64(ot+100),modifiedTime:T.u64(ot+108),startSector:T.i32(ot+116),streamSize:y===3?T.u32(ot+120):T.u64(ot+120),children:[],parentId:null})}const M=Za(k),R=qa(k),O=[];if(s&&c>=0){const ot=lr(d,w,c,v),tt=new xt(ot);for(let ht=0;ht+4<=ot.length;ht+=4)O.push(tt.i32(ht))}const P=lr(d,w,M.startSector,v,M.streamSize);function N(ot){if(ot.startSector<0)return new Uint8Array(0);const tt=Ui(ot.startSector,G=>O[G]??ge),ht=new Uint8Array(tt.length*A);let W=0;for(const G of tt){const gt=G*A,nt=gt+A;if(nt>P.length)throw new Error(`Mini sector ${G} is out of bounds`);ht.set(P.subarray(gt,nt),W),W+=A}return ht.subarray(0,Math.min(ot.streamSize,ht.length))}function it(ot){const tt=typeof ot=="string"?R.get(ot)??null:ot;return!tt||tt.objectType!==2&&tt.objectType!==5?null:tt.objectType===5?P:tt.streamSize<p&&tt.startSector>=0&&O.length?N(tt):lr(d,w,tt.startSector,v,tt.streamSize)}function J(ot){const tt=typeof ot=="string"?R.get(ot)??null:ot;return tt?(tt.children||[]).map(ht=>k[ht]).filter(ht=>!!ht):[]}return{bytes:d,majorVersion:y,sectorSize:w,miniSectorSize:A,numDirSectors:r,numFatSectors:n,firstDirSector:e,transactionSignature:t,miniStreamCutoffSize:p,warnings:g,entries:k,root:M,pathMap:R,getEntry(ot){return R.get(ot)??null},getStream:it,listChildren:J,findByName(ot,tt="/"){const ht=tt==="/"?M:R.get(tt)??null;if(!ht)return null;const W=[ht];for(;W.length;){const G=W.pop();if(G){if(G.name===ot)return G;for(const gt of G.children||[]){const nt=k[gt];nt&&W.push(nt)}}}return null}}}var Zr,Ne,ge,ji,Gi,Wi,zi,es=vt((()=>{ue(),ve(),Zr=[208,207,17,224,161,177,26,225],Ne=4294967295,ge=4294967294,ji=4294967293,Gi=4294967292,Wi=1<<20,zi=4096}));function rs(m){return m.replace(/[\x82-\x8C\x91-\x9C\x9F]/g,C=>$i[C]||C)}function ns(m){let C="";for(let d=0;d<m.length;d+=1)C+=String.fromCharCode(m[d]??0);return rs(C)}function is(m){return new TextDecoder("utf-16le").decode(m)}function os(m,C){const d=C.fcClx,f=C.lcbClx;if(d==null||f==null||f<=0)throw new Error("FIB does not point to a CLX structure");const g=m.subarray(d,d+f),y=new xt(g);let E=0;const h=[];for(;E<g.length&&y.u8(E)===1;){const A=y.u16(E+1);h.push({type:1,cbGrpprl:A,bytes:y.slice(E+3,A)}),E+=3+A}if(y.u8(E)!==2)throw new Error("CLX does not contain a Pcdt marker");const w=y.u32(E+1);return{prcs:h,pcdt:{lcb:w,pieceTable:as(y.slice(E+5,w))}}}function as(m){if(!m.length)throw new Error("Empty PlcPcd");const C=new xt(m),d=(m.length-4)/12;if(!Number.isInteger(d)||d<0)throw new Error("Invalid PlcPcd size");const f=[];for(let E=0;E<d+1;E+=1)f.push(C.u32(E*4));const g=[];let y=(d+1)*4;for(let E=0;E<d;E+=1){const h=C.u16(y),w=C.u32(y+2)>>>0,A=C.u16(y+6),r=!!(w&1073741824),n=w&1073741823,e=f[E]??0,t=f[E+1]??e,p=r?Math.floor(n/2):n,c=r?t-e:(t-e)*2;g.push({index:E,descriptor:h,fNoParaLast:!!(h&1),fRaw:!!(h&2),prm:A,compressed:r,fcRaw:w,fc:n,cpStart:e,cpEnd:t,actualByteStart:p,byteLength:c,actualByteEnd:p+c}),y+=8}return{cps:f,pieces:g}}function ss(m,C){const d=m.subarray(C.actualByteStart,C.actualByteEnd);return C.compressed?ns(d):is(d)}function ls(m,C){return C.pcdt.pieceTable.pieces.map(d=>ss(m,d))}function cr(m,C,d=null){const f=m.pcdt.pieceTable.pieces,g=d??!!(C&1073741824),y=d==null?C&1073741823:C,E=g?Math.floor(y/2):y;for(const h of f){if(E<h.actualByteStart||E>h.actualByteEnd)continue;const w=E-h.actualByteStart,A=h.cpStart+Math.floor(w/(h.compressed?1:2));if(A>=h.cpStart&&A<=h.cpEnd)return A}for(const h of f){if(C<h.actualByteStart||C>h.actualByteEnd)continue;const w=C-h.actualByteStart,A=h.cpStart+Math.floor(w/(h.compressed?1:2));if(A>=h.cpStart&&A<=h.cpEnd)return A}return null}function cs(m,C,d,f,g){if(g<=f)return"";const y=[];for(let E=0;E<C.pcdt.pieceTable.pieces.length;E+=1){const h=C.pcdt.pieceTable.pieces[E];if(h.cpEnd<=f)continue;if(h.cpStart>=g)break;const w=Math.max(f,h.cpStart)-h.cpStart,A=Math.min(g,h.cpEnd)-h.cpStart;y.push((d[E]??"").slice(w,A))}return y.join("")}function hs(m){const C=[];let d=0;for(let f=0;f<m.length;f+=1){const g=m[f];(g==="\r"||g==="\x07")&&(C.push({cpStart:d,cpEnd:f+1,terminator:g}),d=f+1)}return d<m.length&&C.push({cpStart:d,cpEnd:m.length,terminator:""}),C}var $i,Vi=vt((()=>{ue(),$i={"‚":"‚","ƒ":"ƒ","„":"„","…":"…","†":"†","‡":"‡","ˆ":"ˆ","‰":"‰","Š":"Š","‹":"‹","Œ":"Œ","‘":"‘","’":"’","“":"“","”":"”","•":"•","–":"–","—":"—","˜":"˜","™":"™","š":"š","›":"›","œ":"œ","Ÿ":"Ÿ"}})),zt,Xi,Yi,Ki,hr,fr=vt((()=>{zt={paragraph:"\r",cellMark:"\x07",picture:"",fieldStart:"",fieldSeparator:"",fieldEnd:"",annotationRef:"",hardLineBreak:"\v",pageBreak:"\f",nonBreakingHyphen:"",nonRequiredHyphen:""},Xi={0:"none",1:"single",2:"word",3:"double",4:"dotted",5:"hidden",6:"thick",7:"dash",9:"dot-dash",10:"dot-dot-dash",11:"wave",16:"dotted-heavy",17:"dashed-heavy",18:"dash-long",19:"dash-long-heavy",20:"dot-dash-heavy",21:"dot-dot-dash-heavy",22:"wavy-heavy",23:"wavy-double"},Yi={0:"left",1:"center",2:"right",3:"justify",4:"distributed"},Ki={0:"top",1:"center",2:"bottom"},hr={1:"#000000",2:"#0000ff",3:"#00ffff",4:"#00ff00",5:"#ff00ff",6:"#ff0000",7:"#ffff00",8:"#ffffff",9:"#000080",10:"#008080",11:"#008000",12:"#800080",13:"#800000",14:"#808000",15:"#808080",16:"#c0c0c0"}}));function fs(m){const C=new xt(m),d=ds(C);let f=32;const g=C.u16(f);f+=2;const y=C.slice(f,g*2);f+=g*2;const E=C.u16(f);f+=2;const h=C.slice(f,E*4);f+=E*4;const w=C.u16(f);f+=2;const A=C.slice(f,w*8);f+=w*8;const r=C.ensure(f,2)?C.u16(f):0;C.ensure(f,2)&&(f+=2);const n=r?C.slice(f,r*2):new Uint8Array(0),e=ps(h),t=us(A,w);return{base:d,csw:g,cslw:E,cbRgFcLcb:w,cswNew:r,nFibNew:r?new xt(n).u16(0):0,fibRgWBytes:y,fibRgLwBytes:h,fibRgFcLcbBytes:A,fibRgCswNewBytes:n,fibRgLw:e,fibRgFcLcb:t}}function ds(m){const C=m.u16(0),d=m.u16(2),f=m.u16(6),g=m.u16(8),y=m.u16(10),E=m.u16(18);return{wIdent:C,nFib:d,lid:f,pnNext:g,flags:y,envFlags:E,fDot:!!(y&1),fGlsy:!!(y&2),fComplex:!!(y&4),fHasPic:!!(y&8),cQuickSaves:y>>4&15,fEncrypted:!!(y&256),fWhichTblStm:y&512?1:0,fReadOnlyRecommended:!!(y&1024),fWriteReservation:!!(y&2048),fExtChar:!!(y&4096),fLoadOverride:!!(y&8192),fFarEast:!!(y&16384),fObfuscated:!!(y&32768),nFibBack:m.u16(12),lKey:m.u32(14),envr:m.u8(18),fMac:!!(E&1),fEmptySpecial:!!(E&2),fLoadOverridePage:!!(E&4)}}function ps(m){const C=new xt(m),d=[];for(let f=0;f+4<=m.length;f+=4)d.push(C.i32(f));return{raw:d,cbMac:d[0]??0,ccpText:d[3]??0,ccpFtn:d[4]??0,ccpHdd:d[5]??0,ccpMcr:d[6]??0,ccpAtn:d[7]??0,ccpEdn:d[8]??0,ccpTxbx:d[9]??0,ccpHdrTxbx:d[10]??0}}function us(m,C){const d=new xt(m),f={_pairs:[]},g=[];for(let y=0;y<C&&y*8+8<=m.length;y+=1){const E=d.u32(y*8),h=d.u32(y*8+4),w=Ji[y]||`Field${y}`;f[`fc${w}`]=E,f[`lcb${w}`]=h,g.push({name:w,fc:E,lcb:h,index:y})}return f._pairs=g,f}var Ji,gs=vt((()=>{ue(),Ji=["StshfOrig","Stshf","PlcffndRef","PlcffndTxt","PlcfandRef","PlcfandTxt","PlcfSed","PlcPad","PlcfPhe","SttbfGlsy","PlcfGlsy","PlcfHdd","PlcfBteChpx","PlcfBtePapx","PlcfSea","SttbfFfn","PlcfFldMom","PlcfFldHdr","PlcfFldFtn","PlcfFldAtn","PlcfFldMcr","SttbfBkmk","PlcfBkf","PlcfBkl","Cmds","Unused1","SttbfMcr","PrDrvr","PrEnvPort","PrEnvLand","Wss","Dop","SttbfAssoc","Clx","PlcfPgdFtn","AutosaveSource","GrpXstAtnOwners","SttbfAtnBkmk","Unused2","Unused3","PlcSpaMom","PlcSpaHdr","PlcfAtnBkf","PlcfAtnBkl","Pms","FormFldSttbs","PlcfendRef","PlcfendTxt","PlcfFldEdn","Unused4","DggInfo","SttbfRMark","SttbfCaption","SttbfAutoCaption","PlcfWkb","PlcfSpl","PlcftxbxTxt","PlcfFldTxbx","PlcfHdrtxbxTxt","PlcffldHdrTxbx","StwUser","SttbTtmbd","CookieData","PgdMotherOldOld","BkdMotherOldOld","PgdFtnOldOld","BkdFtnOldOld","PgdEdnOldOld","BkdEdnOldOld","SttbfIntlFld","RouteSlip","SttbSavedBy","SttbFnm","PlfLst","PlfLfo","PlcfTxbxBkd","PlcfTxbxHdrBkd","DocUndoWord9","RgbUse","Usp","Uskf","PlcupcRgbUse","PlcupcUsp","SttbGlsyStyle","Plgosl","Plcocx","PlcfBteLvc","dwLowDateTime","dwHighDateTime","PlcfLvcPre10","PlcfAsumy","PlcfGram","SttbListNames","SttbfUssr"]}));function ms(m){return m>>13&7}function Nt(m,C=0){return C+2>m.length?0:(m[C]??0)|(m[C+1]??0)<<8}function Bt(m,C=0){const d=Nt(m,C);return d>32767?d-65536:d}function dr(m,C=0){return C+4>m.length?0:((m[C]??0)|(m[C+1]??0)<<8|(m[C+2]??0)<<16|(m[C+3]??0)<<24>>>0)>>>0}function me(m,C=0){return{first:m[C]??0,lim:m[C+1]??0}}function Yt(m,C=0){if(C+4>m.length)return null;const d=dr(m,C)>>>0;return{raw:d,lineWidth:d&255,borderType:d>>8&255,color:d>>16&255}}function As(m,C=0){const d=Nt(m,C);return{raw:d,horzMerge:d&3,textFlow:d>>2&7,vertMerge:d>>5&3,vertAlign:d>>7&3,ftsWidth:d>>9&7,fitText:!!(d&4096),noWrap:!!(d&8192),hideMark:!!(d&16384)}}function Zi(m,C=0){return C+20>m.length?null:{tcgrf:As(m,C),wWidth:Nt(m,C+2),borders:{top:Yt(m,C+4)||{},left:Yt(m,C+8)||{},bottom:Yt(m,C+12)||{},right:Yt(m,C+16)||{}}}}function bs(m){if(m.length<3)return null;const C=Nt(m,0),d=m[2]??0;let f=3;const g=[];for(let E=0;E<d+1&&f+2<=m.length;E+=1)g.push(Bt(m,f)),f+=2;const y=[];for(let E=0;E<d&&f+20<=m.length;E+=1){const h=Zi(m,f);h&&y.push(h),f+=20}return{cb:C,numberOfColumns:d,rgdxaCenter:g,cells:y}}function ye(m){return m.length?{cb:m[0]??0,range:me(m,1),value:m[3]??0,extra:m.subarray(4)}:null}function qr(m){if(!m.length)return null;const C=m[0]??0,d=Nt(m,4);return{cb:C,range:me(m,1),ftsWidth:m[3]??0,width:d,wWidth:d}}function Cs(m){return m.length?{cb:m[0]??0,range:me(m,1),border:Yt(m,3)||{},extra:m.subarray(7)}:null}function Qr(m){if(!m.length)return null;const C=Nt(m,1);return{ftsWidth:m[0]??0,width:C,wWidth:C}}function vs(m){if(!m.length)return null;const C=m[0]??0,d=me(m,1),f=d.lim-d.first;let g=3;const y=[];for(let h=0;h<f&&g+2<=m.length;h+=1)y.push(Bt(m,g)),g+=2;const E=[];for(let h=0;h<f&&g+20<=m.length;h+=1)E.push(Zi(m,g)),g+=20;return{cb:C,range:d,itcFirst:d.first,ctc:f,dxaCol:y,cells:E}}function ys(m,C,d){const f=d>>13&7;if(C>=m.length)return 0;if(d===Z.sprmTDefTable){const g=Nt(m,C);return g?g+1:0}if(qi.has(d))return(m[C]??0)+1;switch(f){case 0:return 1;case 1:return 1;case 2:return 2;case 3:return 4;case 4:return 2;case 5:return 2;case 6:return(m[C]??0)+1;case 7:return 3;default:return 0}}function Tt(m){return!!(m[0]??0)}function st(m,C,d,f,g){return{kind:m,name:C,value:d,raw:f,operandBytes:g}}function Es(m,C){const d=ms(m),f=C,g=m;switch(m){case Z.sprmCPicLocation:return st("char","pictureOffset",dr(f,0)>>>0,g,f);case Z.sprmCFData:return st("char","data",Tt(f),g,f);case Z.sprmCFOle2:return st("char","ole2",Tt(f),g,f);case Z.sprmCIstd:return st("char","charStyleId",Nt(f,0),g,f);case Z.sprmCPlain:return st("char","plain",Tt(f),g,f);case Z.sprmCFBold:return st("char","bold",Tt(f),g,f);case Z.sprmCFItalic:return st("char","italic",Tt(f),g,f);case Z.sprmCFStrike:return st("char","strike",Tt(f),g,f);case Z.sprmCFOutline:return st("char","outline",Tt(f),g,f);case Z.sprmCFShadow:return st("char","shadow",Tt(f),g,f);case Z.sprmCFSmallCaps:return st("char","smallCaps",Tt(f),g,f);case Z.sprmCFCaps:return st("char","caps",Tt(f),g,f);case Z.sprmCFVanish:return st("char","hidden",Tt(f),g,f);case Z.sprmCKul:return st("char","underline",f[0]??0,g,f);case Z.sprmCDxaSpace:return st("char","spacing",Bt(f,0),g,f);case Z.sprmCIco:case Z.sprmCIcoBi:return st("char","colorIndex",f[0]??0,g,f);case Z.sprmCHighlight:{const y=f[0]??0;return st("char","highlight",{index:y,color:hr[y]},g,f)}case Z.sprmCHps:case Z.sprmCHpsBi:return st("char","fontSizeHalfPoints",Nt(f,0),g,f);case Z.sprmCHpsPos:return st("char","positionHalfPoints",Bt(f,0),g,f);case Z.sprmCSymbol:return st("char","symbol",{font:Nt(f,0),charCode:Nt(f,2)},g,f);case Z.sprmCRgFtc0:case Z.sprmCRgFtc1:case Z.sprmCRgFtc2:case Z.sprmCFtcBi:return st("char","fontFamilyId",Nt(f,0),g,f);case Z.sprmCCharScale:return st("char","scale",Nt(f,0),g,f);case Z.sprmCFDStrike:return st("char","doubleStrike",Tt(f),g,f);case Z.sprmCFImprint:return st("char","imprint",Tt(f),g,f);case Z.sprmCFSpec:return st("char","special",Tt(f),g,f);case Z.sprmCFObj:return st("char","object",Tt(f),g,f);case Z.sprmCFEmboss:return st("char","emboss",Tt(f),g,f);case Z.sprmCFBiDi:return st("char","rtl",Tt(f),g,f);case Z.sprmCFBoldBi:return st("char","boldBi",Tt(f),g,f);case Z.sprmCFItalicBi:return st("char","italicBi",Tt(f),g,f);case Z.sprmPIstd:return st("para","styleId",Nt(f,0),g,f);case Z.sprmPJc80:case Z.sprmPJc:return st("para","alignment",f[0]??0,g,f);case Z.sprmPFKeep:return st("para","keepLines",Tt(f),g,f);case Z.sprmPFKeepFollow:return st("para","keepNext",Tt(f),g,f);case Z.sprmPFPageBreakBefore:return st("para","pageBreakBefore",Tt(f),g,f);case Z.sprmPIlvl:return st("para","listLevel",f[0]??0,g,f);case Z.sprmPIlfo:return st("para","listId",Nt(f,0),g,f);case Z.sprmPDxaRight80:case Z.sprmPDxaRight:return st("para","rightIndent",Bt(f,0),g,f);case Z.sprmPDxaLeft80:case Z.sprmPDxaLeft:return st("para","leftIndent",Bt(f,0),g,f);case Z.sprmPDxaLeft180:case Z.sprmPDxaLeft1:return st("para","firstLineIndent",Bt(f,0),g,f);case Z.sprmPDyaLine:return st("para","lineSpacing",Bt(f,0),g,f);case Z.sprmPDyaBefore:return st("para","spacingBefore",Bt(f,0),g,f);case Z.sprmPDyaAfter:return st("para","spacingAfter",Bt(f,0),g,f);case Z.sprmPFInTable:return st("para","inTable",Tt(f),g,f);case Z.sprmPFTtp:return st("para","tableRowEnd",Tt(f),g,f);case Z.sprmPDxaAbs:return st("para","frameLeft",Bt(f,0),g,f);case Z.sprmPDyaAbs:return st("para","frameTop",Bt(f,0),g,f);case Z.sprmPDxaWidth:return st("para","frameWidth",Bt(f,0),g,f);case Z.sprmPPc:return st("para","framePosition",f[0]??0,g,f);case Z.sprmPWr:return st("para","frameWrap",f[0]??0,g,f);case Z.sprmPBrcTop80:case Z.sprmPBrcTop:return st("para","borderTop",Yt(f,0),g,f);case Z.sprmPBrcLeft80:case Z.sprmPBrcLeft:return st("para","borderLeft",Yt(f,0),g,f);case Z.sprmPBrcBottom80:case Z.sprmPBrcBottom:return st("para","borderBottom",Yt(f,0),g,f);case Z.sprmPBrcRight80:case Z.sprmPBrcRight:return st("para","borderRight",Yt(f,0),g,f);case Z.sprmPBrcBetween80:case Z.sprmPBrcBetween:return st("para","borderBetween",Yt(f,0),g,f);case Z.sprmPBrcBar80:case Z.sprmPBrcBar:return st("para","borderBar",Yt(f,0),g,f);case Z.sprmPWHeightAbs:return st("para","frameHeight",Bt(f,0),g,f);case Z.sprmPShd80:case Z.sprmPShd:return st("para","shading",f.slice(),g,f);case Z.sprmPDyaFromText:return st("para","distanceFromTextY",Bt(f,0),g,f);case Z.sprmPDxaFromText:return st("para","distanceFromTextX",Bt(f,0),g,f);case Z.sprmPFLocked:return st("para","locked",Tt(f),g,f);case Z.sprmPFWidowControl:return st("para","widowControl",Tt(f),g,f);case Z.sprmPFBiDi:return st("para","rtlPara",Tt(f),g,f);case Z.sprmPFAdjustRight:return st("para","adjustRight",Tt(f),g,f);case Z.sprmPItap:return st("para","itap",dr(f,0),g,f);case Z.sprmPDtap:return st("para","dtap",dr(f,0),g,f);case Z.sprmPFInnerTableCell:return st("para","innerTableCell",Tt(f),g,f);case Z.sprmPFInnerTtp:return st("para","innerTableRowEnd",Tt(f),g,f);case Z.sprmPFDyaBeforeAuto:return st("para","spacingBeforeAuto",Tt(f),g,f);case Z.sprmPFDyaAfterAuto:return st("para","spacingAfterAuto",Tt(f),g,f);case Z.sprmTJc90:return st("table","alignment",Nt(f,0),g,f);case Z.sprmTDxaLeft:return st("table","leftIndent",Bt(f,0),g,f);case Z.sprmTDxaGapHalf:return st("table","gapHalf",Nt(f,0),g,f);case Z.sprmTFCantSplit90:return st("table","cantSplit",Tt(f),g,f);case Z.sprmTTableHeader:return st("table","header",Tt(f),g,f);case Z.sprmTDyaRowHeight:return st("table","rowHeight",Bt(f,0),g,f);case Z.sprmTDefTable:return st("table","defTable",bs(f),g,f);case Z.sprmTFBiDi:return st("table","rtl",Tt(f),g,f);case Z.sprmTPc:return st("table","positionCode",f[0]??0,g,f);case Z.sprmTDxaAbs:return st("table","absLeft",Bt(f,0),g,f);case Z.sprmTDyaAbs:return st("table","absTop",Bt(f,0),g,f);case Z.sprmTDxaFromText:return st("table","distanceLeft",Bt(f,0),g,f);case Z.sprmTDyaFromText:return st("table","distanceTop",Bt(f,0),g,f);case Z.sprmTTableWidth:return st("table","tableWidth",Qr(f),g,f);case Z.sprmTFAutofit:return st("table","autoFit",Tt(f),g,f);case Z.sprmTWidthBefore:return st("table","widthBefore",Qr(f),g,f);case Z.sprmTWidthAfter:return st("table","widthAfter",Qr(f),g,f);case Z.sprmTInsert:return st("table","insertCells",vs(f),g,f);case Z.sprmTDelete:return st("table","deleteCells",me(f,0),g,f);case Z.sprmTDxaCol:return st("table","columnWidth",qr(f),g,f);case Z.sprmTMerge:return st("table","merge",me(f,0),g,f);case Z.sprmTSplit:return st("table","split",me(f,0),g,f);case Z.sprmTTextFlow:return st("table","textFlow",ye(f),g,f);case Z.sprmTVertMerge:return st("table","vertMerge",ye(f),g,f);case Z.sprmTVertAlign:return st("table","vertAlign",ye(f),g,f);case Z.sprmTSetShd:case Z.sprmTSetShdOdd:return st("table","setShading",ye(f),g,f);case Z.sprmTSetBrc80:case Z.sprmTSetBrc:return st("table","setBorder",Cs(f),g,f);case Z.sprmTCellPadding:case Z.sprmTCellPaddingDefault:return st("table","cellPadding",qr(f),g,f);case Z.sprmTCellWidth:return st("table","cellWidth",qr(f),g,f);case Z.sprmTFitText:return st("table","fitText",ye(f),g,f);case Z.sprmTFCellNoWrap:return st("table","cellNoWrap",ye(f),g,f);case Z.sprmTIstd:return st("table","styleId",Nt(f,0),g,f);default:return{kind:d===1?"para":d===2?"char":d===5?"table":"unknown",name:`sprm_${m.toString(16)}`,value:f,raw:m,operandBytes:f}}}function Fe(m,C,d){const f=[];let g=C;for(;g+2<=d;){const y=Nt(m,g);g+=2;const E=ys(m,g,y);if(!E||g+E>d)break;const h=m.subarray(g,g+E);g+=E,f.push(Es(y,h))}return f}var Z,qi,Qi=vt((()=>{fr(),Z={sprmCFRMarkDel:2048,sprmCFRMark:2049,sprmCFFldVanish:2050,sprmCPicLocation:27139,sprmCIbstRMark:18436,sprmCDttmRMark:26629,sprmCFData:2054,sprmCFOle2:2058,sprmCHighlight:10764,sprmCIstd:18992,sprmCPlain:10803,sprmCFBold:2101,sprmCFItalic:2102,sprmCFStrike:2103,sprmCFOutline:2104,sprmCFShadow:2105,sprmCFSmallCaps:2106,sprmCFCaps:2107,sprmCFVanish:2108,sprmCKul:10814,sprmCDxaSpace:34880,sprmCIco:10818,sprmCHps:19011,sprmCHpsPos:18501,sprmCSymbol:27145,sprmCHpsKern:18507,sprmCRgFtc0:19023,sprmCRgFtc1:19024,sprmCRgFtc2:19025,sprmCCharScale:18514,sprmCFDStrike:10835,sprmCFImprint:2132,sprmCFSpec:2133,sprmCFObj:2134,sprmCFEmboss:2136,sprmCFBiDi:2138,sprmCFBoldBi:2140,sprmCFItalicBi:2141,sprmCFtcBi:19038,sprmCIcoBi:19040,sprmCHpsBi:19041,sprmPIstd:17920,sprmPIstdPermute:50689,sprmPIncLvl:9730,sprmPJc80:9219,sprmPFKeep:9221,sprmPFKeepFollow:9222,sprmPFPageBreakBefore:9223,sprmPIlvl:9738,sprmPIlfo:17931,sprmPChgTabsPapx:50701,sprmPDxaRight80:33806,sprmPDxaLeft80:33807,sprmPNest80:17936,sprmPDxaLeft180:33809,sprmPDyaLine:25618,sprmPDyaBefore:42003,sprmPDyaAfter:42004,sprmPChgTabs:50709,sprmPFInTable:9238,sprmPFTtp:9239,sprmPDxaAbs:33816,sprmPDyaAbs:33817,sprmPDxaWidth:33818,sprmPPc:9755,sprmPWr:9251,sprmPBrcTop80:25636,sprmPBrcLeft80:25637,sprmPBrcBottom80:25638,sprmPBrcRight80:25639,sprmPBrcBetween80:25640,sprmPBrcBar80:26153,sprmPWHeightAbs:17451,sprmPDcs:17452,sprmPShd80:17453,sprmPDyaFromText:33838,sprmPDxaFromText:33839,sprmPFLocked:9264,sprmPFWidowControl:9265,sprmPFBiDi:9281,sprmPHugePapx:26182,sprmPFAdjustRight:9288,sprmPItap:26185,sprmPDtap:26186,sprmPFInnerTableCell:9291,sprmPFInnerTtp:9292,sprmPShd:50765,sprmPBrcTop:50766,sprmPBrcLeft:50767,sprmPBrcBottom:50768,sprmPBrcRight:50769,sprmPBrcBetween:50770,sprmPBrcBar:50771,sprmPDxcRight:17493,sprmPDxcLeft:17494,sprmPDxcLeft1:17495,sprmPDylBefore:17496,sprmPDylAfter:17497,sprmPFDyaBeforeAuto:9307,sprmPFDyaAfterAuto:9308,sprmPDxaRight:33885,sprmPDxaLeft:33886,sprmPNest:18015,sprmPDxaLeft1:33888,sprmPJc:9313,sprmTJc90:21504,sprmTDxaLeft:38401,sprmTDxaGapHalf:38402,sprmTFCantSplit90:13315,sprmTTableHeader:13316,sprmTTableBorders80:54789,sprmTDyaRowHeight:37895,sprmTDefTable:54792,sprmTDefTableShd80:54793,sprmTTlp:29706,sprmTFBiDi:22027,sprmTDefTableShd3rd:54796,sprmTPc:13837,sprmTDxaAbs:37902,sprmTDyaAbs:37903,sprmTDxaFromText:37904,sprmTDyaFromText:37905,sprmTDefTableShd:54802,sprmTTableBorders:54803,sprmTTableWidth:62996,sprmTFAutofit:13845,sprmTWidthBefore:62999,sprmTWidthAfter:63e3,sprmTSetBrc80:54816,sprmTInsert:30241,sprmTDelete:22050,sprmTDxaCol:30243,sprmTMerge:22052,sprmTSplit:22053,sprmTTextFlow:30249,sprmTVertMerge:54827,sprmTVertAlign:54828,sprmTSetShd:54829,sprmTSetShdOdd:54830,sprmTSetBrc:54831,sprmTCellPadding:54834,sprmTCellPaddingDefault:54835,sprmTCellWidth:54837,sprmTFitText:63030,sprmTFCellNoWrap:54841,sprmTIstd:22074},qi=new Set([Z.sprmPChgTabs,Z.sprmPChgTabsPapx,Z.sprmTDefTable,Z.sprmTTableBorders80,Z.sprmTTableBorders,Z.sprmTDefTableShd,Z.sprmTDefTableShd80,Z.sprmTDefTableShd3rd,Z.sprmTSetBrc80,Z.sprmTSetBrc,Z.sprmTSetShd,Z.sprmTSetShdOdd,Z.sprmTCellPadding,Z.sprmTCellPaddingDefault,Z.sprmTCellWidth,Z.sprmTVertAlign,Z.sprmTVertMerge,Z.sprmTTextFlow,Z.sprmTDxaCol])}));function to(m,C,d){if(C==null||d==null||d<=0)return{aFC:[],pages:[]};const f=new xt(m.subarray(C,C+d)),g=Math.floor((d-4)/8);if(g<=0)return{aFC:[],pages:[]};const y=[];for(let w=0;w<=g;w+=1)y.push(f.u32(w*4)>>>0);const E=[],h=(g+1)*4;for(let w=0;w<g;w+=1)E.push(f.u32(h+w*4)&4194303);return{aFC:y,pages:E}}function ws(m,C){const d=C*512,f=m.subarray(d,d+512);if(f.length<512)return null;const g=new xt(f),y=g.u8(511);if(!y||y>100)return null;const E=[];for(let r=0;r<=y;r+=1)E.push(g.u32(r*4)>>>0);const h=[],w=[],A=(y+1)*4;for(let r=0;r<y;r+=1){const n=g.u8(A+r);h.push(n),w.push(n?d+n*2:0)}return{crun:y,rgfc:E,rgb:h,chpxOffsets:w}}function _s(m,C){const d=C*512,f=m.subarray(d,d+512);if(f.length<512)return null;const g=new xt(f),y=g.u8(511);if(y>29)return null;const E=[];for(let r=0;r<=y;r+=1)E.push(g.u32(r*4)>>>0);const h=(y+1)*4,w=[],A=[];for(let r=0;r<y;r+=1){const n=g.u8(h+r*13);w.push(n),A.push(n?d+n*2:0)}return{cpara:y,rgfc:E,bOffsets:w,papxOffsets:A}}function Ts(m,C,d,f){const g=d.fibRgFcLcb.fcPlcfBteChpx,y=d.fibRgFcLcb.lcbPlcfBteChpx,E=to(C,g,y),h=[];for(const w of E.pages){const A=ws(m,w);if(A)for(let r=0;r<A.crun;r+=1){const n=A.rgfc[r]??0,e=A.rgfc[r+1]??n,t=cr(f,n),p=cr(f,e);if(t==null||p==null||p<=t)continue;const c=A.chpxOffsets[r]?Ss(m,A.chpxOffsets[r]):[];h.push({cpStart:t,cpEnd:p,fcStart:n,fcEnd:e,properties:c})}}return h.sort((w,A)=>w.cpStart-A.cpStart||w.cpEnd-A.cpEnd),h}function xs(m,C,d,f){const g=d.fibRgFcLcb.fcPlcfBtePapx,y=d.fibRgFcLcb.lcbPlcfBtePapx,E=to(C,g,y),h=[];for(const w of E.pages){const A=_s(m,w);if(A)for(let r=0;r<A.cpara;r+=1){const n=A.rgfc[r]??0,e=A.rgfc[r+1]??n,t=cr(f,n),p=cr(f,e);if(t==null||p==null||p<t)continue;const c=A.papxOffsets[r]?Ps(m,A.papxOffsets[r]):{styleId:0,properties:[]};h.push({cpStart:t,cpEnd:p,fcStart:n,fcEnd:e,styleId:c.styleId,properties:c.properties,rawOffset:A.papxOffsets[r]??0})}}return h.sort((w,A)=>w.cpStart-A.cpStart||w.cpEnd-A.cpEnd),h}function Ss(m,C){if(C==null||C<0||C>=m.length)return[];const d=m[C]??0;if(!d)return[];const f=C+1;return Fe(m,f,Math.min(m.length,f+d))}function Ps(m,C){if(C==null||C<0||C>=m.length)return{styleId:0,properties:[]};const d=new xt(m),f=d.u8(C);if(f===0&&!d.ensure(C+1,1))return{styleId:0,properties:[]};let g,y;return f===0?(y=d.u8(C+1)*2,g=C+2):(y=f-1,g=C+1),y<2||!d.ensure(g,Math.max(2,y))?{styleId:0,properties:[]}:{styleId:d.u16(g),properties:Fe(m,g+2,Math.min(m.length,g+y))}}var Ds=vt((()=>{ue(),Qi(),Vi()}));function Rs(m,C){let d=C;for(;d+1<m.length&&!(m[d]===0&&m[d+1]===0);)d+=2;return{value:new TextDecoder("utf-16le").decode(m.subarray(C,d)),nextOffset:Math.min(m.length,d+2)}}function ks(m,C){if(!m.length)return null;const d=new xt(m),f=d.u8(0),g=d.u8(1),y=d.u16(2),E=d.u8(4),h=d.u8(5),w=d.slice(6,10),A=d.slice(16,24),r=40;let n="",e="";if(m.length>r){const t=new TextDecoder("utf-16le").decode(m.subarray(r)).split("\0").filter(Boolean);if(n=t[0]||"",e=t[1]||"",!e&&h){const p=r+h*2;p+2<=m.length&&(e=Rs(m,p).value)}}return{index:C,cbFfnM1:f,ffid:g,weight:y,charset:E,ixchSzAlt:h,panose:w,fontSignature:A,name:n,altName:e}}function Is(m,C){const d=C.fcSttbfFfn,f=C.lcbSttbfFfn;if(d==null||f==null||f<=0)return{header:null,fonts:[],byIndex(r){return r==null,null}};const g=m.subarray(d,d+f),y=new xt(g),E=y.u16(0),h=y.u16(2);let w=4;const A=[];for(let r=0;r<E&&w<g.length;r+=1){const n=y.u8(w)+1,e=ks(g.subarray(w,Math.min(w+n,g.length)),r);e&&A.push(e),w+=n+h}return{header:{cData:E,cbExtra:h},fonts:A,byIndex(r){return r==null||r<0?null:A[r]||null}}}var Ms=vt((()=>{ue()}));function eo(m,C,d=0){if(d+C.length>m.length)return!1;for(let f=0;f<C.length;f+=1)if(m[d+f]!==C[f])return!1;return!0}function Os(m){const C=[{mime:"image/png",magic:[137,80,78,71],end:Bs},{mime:"image/jpeg",magic:[255,216,255],end:Ns},{mime:"image/gif",magic:[71,73,70,56],end:Fs},{mime:"image/bmp",magic:[66,77],end:Ls},{mime:"image/tiff",magic:[73,73,42,0],end:null},{mime:"image/tiff",magic:[77,77,0,42],end:null},{mime:"image/emf",magic:[1,0,0,0],end:Hs},{mime:"image/wmf",magic:[215,205,198,154],end:null}];for(let d=0;d<m.length-4;d+=1)for(const f of C)if(eo(m,f.magic,d)){const g=f.end?f.end(m,d):m.length;return{mime:f.mime,start:d,end:g||m.length}}return null}function Bs(m,C){for(let d=C+8;d+8<m.length;d+=1)if(eo(m,[73,69,78,68],d))return d+8;return m.length}function Ns(m,C){for(let d=C+2;d+1<m.length;d+=1)if(m[d]===255&&m[d+1]===217)return d+2;return m.length}function Fs(m,C){for(let d=C+6;d<m.length;d+=1)if(m[d]===59)return d+1;return m.length}function Ls(m,C){if(C+6<=m.length){const d=new xt(m.subarray(C)).u32(2);if(d>0&&C+d<=m.length)return C+d}return m.length}function Hs(m,C){if(C+48<=m.length){const d=new xt(m.subarray(C)).u32(40);if(d>0&&C+d<=m.length)return C+d}return m.length}function Us(m,C,d={}){if(!m||C==null||C<0||C+68>m.length)return null;const f=new xt(m),g=f.i32(C),y=f.u16(C+4),E=g>0&&C+g<=m.length?g:Math.min(m.length-C,d.maxPictureBytes||8*1024*1024),h=m.subarray(C,C+E),w=Math.min(y||68,h.length),A=Os(h.subarray(w));if(!A)return{id:Xt("asset-img"),type:"image",mime:"application/octet-stream",bytes:h,dataUrl:ar(h,"application/octet-stream"),meta:{pictureOffset:C,lcb:g,cbHeader:y}};const r=w+A.start,n=Math.min(w+A.end,h.length),e=h.subarray(r,n);return{id:Xt("asset-img"),type:"image",mime:A.mime,bytes:e,dataUrl:ar(e,A.mime),meta:{pictureOffset:C,lcb:g,cbHeader:y}}}function tn(m,C){let d=C;for(;d<m.length&&m[d]!==0;)d+=1;return{value:new TextDecoder("windows-1252").decode(m.subarray(C,d)),nextOffset:d+1}}function js(m){const C=new xt(m);for(const d of[4,6])try{let f=d;const g=tn(m,f);f=g.nextOffset;const y=tn(m,f);f=y.nextOffset;const E=tn(m,f);if(f=E.nextOffset,f+4>m.length)continue;const h=C.u32(f);if(f+=4,h>0&&f+h<=m.length){const w=m.subarray(f,f+h);return{label:g.value,originalPath:y.value,tempPath:E.value,dataSize:h,bytes:w}}}catch{}return null}function Gs(m,C){const d=m.listChildren(C).filter(w=>w.objectType===2||w.objectType===5),f=new Map(d.map(w=>[w.name.toLowerCase(),w])),g=f.get("objinfo")||f.get("objinfo")||f.get("objinfo"),y=f.get("ole10native")||f.get("ole10native")||f.get("ole10native"),E=f.get("package")||f.get("contents")||f.get("content"),h={entry:C,streams:d,displayName:C.name,attachment:null,objectData:null};if(y){const w=js(m.getStream(y)||new Uint8Array(0));if(w){const A=w.label||w.originalPath.split(/[\\/]/).pop()||`${C.name}.bin`;return h.attachment={id:Xt("asset-ole"),type:"attachment",name:A,mime:"application/octet-stream",bytes:w.bytes,dataUrl:ar(w.bytes,"application/octet-stream"),meta:w},h}}if(E){const w=m.getStream(E)||new Uint8Array(0);h.attachment={id:Xt("asset-pkg"),type:"attachment",name:`${Oi(C.name)}.bin`,mime:"application/octet-stream",bytes:w,dataUrl:ar(w,"application/octet-stream"),meta:{stream:E.name}}}return g&&(h.objectData=m.getStream(g)||new Uint8Array(0)),h}function Ws(m){const C=m.getEntry("/ObjectPool");if(!C)return new Map;const d=m.listChildren(C).filter(g=>g.objectType===1),f=new Map;for(const g of d)f.set(g.name,Gs(m,g));return f}var zs=vt((()=>{ue(),ve()}));function en(m){const C={bold:!1,italic:!1,strike:!1,underline:0,fontSizeHalfPoints:void 0,fontFamilyId:void 0,colorIndex:void 0,highlight:void 0,spacing:0,positionHalfPoints:0,scale:100,hidden:!1,smallCaps:!1,caps:!1,outline:!1,shadow:!1,emboss:!1,imprint:!1,rtl:!1,pictureOffset:void 0,data:!1,ole2:!1,object:!1,special:!1,charStyleId:void 0};for(const d of m||[])switch(d.name){case"plain":d.value&&(C.bold=!1,C.italic=!1,C.strike=!1,C.underline=0,C.smallCaps=!1,C.caps=!1);break;case"bold":case"italic":case"strike":case"hidden":case"smallCaps":case"caps":case"outline":case"shadow":case"emboss":case"imprint":case"rtl":case"data":case"ole2":case"object":case"special":C[d.name]=!!d.value;break;case"underline":C.underline=d.value??0;break;case"fontSizeHalfPoints":C.fontSizeHalfPoints=d.value;break;case"fontFamilyId":C.fontFamilyId=d.value;break;case"colorIndex":C.colorIndex=d.value;break;case"highlight":C.highlight=d.value;break;case"spacing":C.spacing=d.value||0;break;case"positionHalfPoints":C.positionHalfPoints=d.value||0;break;case"scale":C.scale=d.value||100;break;case"pictureOffset":C.pictureOffset=d.value;break;case"charStyleId":C.charStyleId=d.value;break;default:C[d.name]=d.value;break}return C}function $s(m){const C={styleId:0,alignment:0,spacingBefore:0,spacingAfter:0,lineSpacing:0,leftIndent:0,rightIndent:0,firstLineIndent:0,keepLines:!1,keepNext:!1,pageBreakBefore:!1,widowControl:!1,inTable:!1,tableRowEnd:!1,innerTableCell:!1,innerTableRowEnd:!1,itap:0,dtap:0,listLevel:void 0,listId:void 0,rtlPara:!1,adjustRight:!1,frameLeft:void 0,frameTop:void 0,frameWidth:void 0,frameHeight:void 0,framePosition:void 0,frameWrap:void 0,borders:{},shading:void 0};for(const d of m||[])switch(d.name){case"styleId":C.styleId=d.value||0;break;case"alignment":C.alignment=d.value??0;break;case"spacingBefore":C.spacingBefore=d.value||0;break;case"spacingAfter":C.spacingAfter=d.value||0;break;case"lineSpacing":C.lineSpacing=d.value||0;break;case"leftIndent":C.leftIndent=d.value||0;break;case"rightIndent":C.rightIndent=d.value||0;break;case"firstLineIndent":C.firstLineIndent=d.value||0;break;case"keepLines":case"keepNext":case"pageBreakBefore":case"widowControl":case"inTable":case"tableRowEnd":case"innerTableCell":case"innerTableRowEnd":case"rtlPara":case"adjustRight":C[d.name]=!!d.value;break;case"itap":C.itap=d.value||0;break;case"dtap":C.dtap=d.value||0;break;case"listLevel":C.listLevel=d.value;break;case"listId":C.listId=d.value;break;case"frameLeft":C.frameLeft=d.value;break;case"frameTop":C.frameTop=d.value;break;case"frameWidth":C.frameWidth=d.value;break;case"frameHeight":C.frameHeight=d.value;break;case"framePosition":C.framePosition=d.value;break;case"frameWrap":C.frameWrap=d.value;break;case"borderTop":C.borders.top=d.value;break;case"borderLeft":C.borders.left=d.value;break;case"borderBottom":C.borders.bottom=d.value;break;case"borderRight":C.borders.right=d.value;break;case"borderBetween":C.borders.between=d.value;break;case"borderBar":C.borders.bar=d.value;break;case"shading":C.shading=d.value;break;default:C[d.name]=d.value;break}return C}function pr(m){const C={styleId:void 0,alignment:0,leftIndent:0,gapHalf:0,cantSplit:!1,header:!1,rowHeight:0,rtl:!1,positionCode:void 0,absLeft:void 0,absTop:void 0,distanceLeft:void 0,distanceTop:void 0,tableWidth:void 0,autoFit:void 0,widthBefore:void 0,widthAfter:void 0,defTable:void 0,operations:[]};for(const d of m||[])switch(d.name){case"styleId":C.styleId=d.value;break;case"alignment":C.alignment=d.value??0;break;case"leftIndent":C.leftIndent=d.value||0;break;case"gapHalf":C.gapHalf=d.value||0;break;case"cantSplit":case"header":case"rtl":C[d.name]=!!d.value;break;case"rowHeight":C.rowHeight=d.value||0;break;case"positionCode":C.positionCode=d.value;break;case"absLeft":C.absLeft=d.value;break;case"absTop":C.absTop=d.value;break;case"distanceLeft":C.distanceLeft=d.value;break;case"distanceTop":C.distanceTop=d.value;break;case"tableWidth":C.tableWidth=d.value;break;case"autoFit":C.autoFit=d.value;break;case"widthBefore":C.widthBefore=d.value;break;case"widthAfter":C.widthAfter=d.value;break;case"defTable":C.defTable=d.value;break;default:C.operations.push(d);break}return C}function rn(m){return m?.inTable?Math.max(1,m.itap||(m.dtap?m.dtap:1)):0}function Vs(m){return Yi[m]||"left"}function Xs(m){return Xi[m]||(m?"single":"none")}function Ys(m){return Ki[m]||"top"}function Qt(m,C,d){if(!C)return;const f=Math.max(0,C.first||0),g=Math.max(f,C.lim||f);for(let y=f;y<g&&y<m.length;y+=1)d(m[y],y)}function Ks(m){const C=m?.defTable;if(!C||!Array.isArray(C.cells))return[];const d=C.cells.map((f,g)=>({index:g,width:f?.wWidth,ftsWidth:f?.tcgrf?.ftsWidth,borders:f?.borders||{},merge:f?.tcgrf?.horzMerge||0,vertMerge:f?.tcgrf?.vertMerge||0,vertAlign:f?.tcgrf?.vertAlign||0,fitText:!!f?.tcgrf?.fitText,noWrap:!!f?.tcgrf?.noWrap,hideMark:!!f?.tcgrf?.hideMark,textFlow:f?.tcgrf?.textFlow||0,rightBoundary:C.rgdxaCenter?.[g+1],leftBoundary:C.rgdxaCenter?.[g]}));for(const f of m.operations||[])switch(f.name){case"merge":Qt(d,f.value,(g,y)=>{y===f.value.first?g.merge=2:g.merge=1});break;case"split":Qt(d,f.value,g=>{g.merge=0});break;case"cellWidth":case"columnWidth":Qt(d,f.value.range,g=>{const y=f.value;g.width=y.width,g.ftsWidth=y.ftsWidth});break;case"vertMerge":Qt(d,f.value.range,g=>{g.vertMerge=f.value.value});break;case"vertAlign":Qt(d,f.value.range,g=>{g.vertAlign=f.value.value});break;case"setBorder":Qt(d,f.value.range,g=>{g.borders={...g.borders||{},all:f.value.border}});break;case"setShading":Qt(d,f.value.range,g=>{g.shading=f.value.value});break;case"fitText":Qt(d,f.value.range,g=>{g.fitText=!!f.value.value});break;case"cellNoWrap":Qt(d,f.value.range,g=>{g.noWrap=!!f.value.value});break;case"textFlow":Qt(d,f.value.range,g=>{g.textFlow=f.value.value});break;default:break}return d}var ro=vt((()=>{fr()}));function Ee(...m){const C=new Map;for(const d of m)for(const f of d||[])C.set(`${f.kind}:${f.name}`,f);return Array.from(C.values())}function Js(m){const C={para:[],char:[],table:[]};for(const d of m||[])d.kind==="para"?C.para.push(d):d.kind==="char"?C.char.push(d):d.kind==="table"&&C.table.push(d);return C}function Zs(m,C){const d=new xt(m),f=d.u16(C),g=C+2,y=f*2,E=d.utf16le(g,y),h=g+y+2;return{value:E.replace(/\u0000+$/,""),nextOffset:h}}function qs(m,C){const d=new xt(m),f=d.u16(C),g=d.u16(C+2),y=d.u16(C+4);return{sti:f&4095,flags1:f>>12,stk:g&15,istdBase:g>>4&4095,cupx:y&15,istdNext:y>>4&4095,bchUpe:d.u16(C+6),grfstd:d.u16(C+8)}}function no(m,C){const d=new xt(m).u16(C),f=C+2,g=f+d,y=m.subarray(f,Math.min(g,m.length));let E=0,h=[];return y.length>=2&&(E=y[0]|(y[1]??0)<<8,h=Fe(y,2,y.length)),{cbUpx:d,styleId:E,properties:h,nextOffset:Oe(g)}}function nn(m,C){const d=new xt(m).u16(C),f=C+2,g=f+d,y=m.subarray(f,Math.min(g,m.length));return{cbUpx:d,properties:Fe(y,0,y.length),nextOffset:Oe(g)}}function Qs(m,C){const d=new xt(m).u16(C),f=C+2,g=f+d,y=m.subarray(f,Math.min(g,m.length));return{cbUpx:d,properties:Fe(y,0,y.length),nextOffset:Oe(g)}}function tl(m,C,d){if(!m.length)return{istd:d,empty:!0,name:"",stdfBase:{istdBase:4095,istdNext:0,stk:1,cupx:0},paraProps:[],charProps:[],tableProps:[]};const f=Math.max(10,Math.min(C||10,m.length)),g=qs(m,0);let y=f;const E=Zs(m,y);y=E.nextOffset;let h=[],w=[],A=[];try{if(g.stk===1){if(g.cupx>=1&&y+2<=m.length){const r=no(m,y);h=r.properties,y=r.nextOffset}g.cupx>=2&&y+2<=m.length&&(w=nn(m,y).properties)}else if(g.stk===2)y+2<=m.length&&(w=nn(m,y).properties);else if(g.stk===3){if(g.cupx>=1&&y+2<=m.length){const r=Qs(m,y);A=r.properties,y=r.nextOffset}if(g.cupx>=2&&y+2<=m.length){const r=no(m,y);h=r.properties,y=r.nextOffset}g.cupx>=3&&y+2<=m.length&&(w=nn(m,y).properties)}}catch{}return{istd:d,name:E.value,stdfBase:g,paraProps:h,charProps:w,tableProps:A,empty:!1}}function el(m,C){const d=C.fcStshf,f=C.lcbStshf;if(d==null||f==null||f<=0)return{styles:new Map,header:null,resolveStyle(e){return on(new Map,e)}};const g=m.subarray(d,d+f),y=new xt(g),E=y.u16(0),h=y.u16(2),w=y.u16(4),A={cbStshi:E,cstd:h,cbSTDBaseInFile:w,ftcAsci:y.u16(12),ftcFE:y.u16(14),ftcOther:y.u16(16)};let r=2+E;const n=new Map;for(let e=0;e<h&&r+2<=g.length;e+=1){const t=y.u16(r),p=r+2,c=p+t;if(t===0){n.set(e,{istd:e,empty:!0,name:"",stdfBase:{istdBase:4095,istdNext:0,stk:1,cupx:0},paraProps:[],charProps:[],tableProps:[]}),r=Oe(c);continue}const s=tl(g.subarray(p,Math.min(c,g.length)),w,e);n.set(e,s),r=Oe(c)}return{header:A,styles:n,resolveStyle(e){return on(n,e)}}}function on(m,C,d=new Set){if(C==null||C===4095||d.has(C))return{paraProps:[],charProps:[],tableProps:[],styleIds:[]};const f=m.get(C);if(!f||f.empty)return{paraProps:[],charProps:[],tableProps:[],styleIds:[]};d.add(C);const g=on(m,f.stdfBase?.istdBase,d);return{styleIds:[...g.styleIds,C],paraProps:Ee(g.paraProps,f.paraProps),charProps:Ee(g.charProps,f.charProps),tableProps:Ee(g.tableProps,f.tableProps)}}var rl=vt((()=>{ue(),ve(),Qi()}));function nl(m,C,d,f){let g=f?.index||0;for(;g<m.length&&m[g].cpEnd<=C;)g+=1;f&&(f.index=g);const y=[];let E=g;for(;E<m.length&&m[E].cpStart<d;)m[E].cpEnd>C&&y.push(m[E]),E+=1;return y}function il(m){return String(m||"").trim()}function io(m){const C=String(m||"").replace(/[\r\n\t]+/g," ").replace(/\s+/g," ").trim();if(!C)return null;const d=C.toUpperCase();if(d.startsWith("HYPERLINK")){const f=C.slice(9).trim(),g=f.match(/"([^"]+)"/)?.[1]||f.split(/\s+/)[0]||"";return g?{type:"hyperlink",href:g}:null}if(d.startsWith("INCLUDEPICTURE")){const f=C.slice(14).trim();return{type:"includePicture",target:f.match(/"([^"]+)"/)?.[1]||f.split(/\s+/)[0]||""}}return d.startsWith("EMBED")?{type:"embed",raw:C}:d.startsWith("LINK")?{type:"link",raw:C}:{type:"unknown",raw:C}}function ol(m,C){if(!C.text)return;const d=m[m.length-1];if(d&&d.type==="text"&&d.href===C.href&&Bi(d.style,C.style)){d.text+=C.text;return}m.push(C)}function Ae(m,C,d){if(!d)return;const f=m.length?m[m.length-1].nodes:C;d.type==="text"?ol(f,d):f.push(d)}function al(m,C){const d=[`_${C}`,`_${String(C)}`,`_${C.toString(16)}`,`_${C.toString(16).toUpperCase()}`];for(const f of d)if(m.has(f))return m.get(f)||null;return null}function sl(m,C,d,f,g,y={}){return function(h){const w=h?.pictureOffset;if(w==null)return null;if(g.has(w))return g.get(w)||null;let A=null;const r=al(C,w);if((h.ole2||h.object||h.data)&&r?.attachment&&(A=r.attachment,f.add(r.entry.name)),!A&&m?.length){const n=Us(m,w,y);n&&n.mime!=="application/octet-stream"?A=n:!A&&r?.attachment?(A=r.attachment,f.add(r.entry.name)):n&&(A=n)}return!A&&r?.attachment&&(A=r.attachment,f.add(r.entry.name)),A&&d.push(A),g.set(w,A),A}}function ll(m){switch(m){case zt.nonBreakingHyphen:return"-";case zt.nonRequiredHyphen:return"";case zt.annotationRef:return"";default:return m}}function cl(m,C){const d=[],f=[];for(const g of m)if(!(!g.text||g.state.hidden))for(const y of g.text){const E=ll(y);if(E===zt.fieldStart){f.push({instruction:"",parsed:null,readingInstruction:!0,nodes:[]});continue}if(E===zt.fieldSeparator){const w=f[f.length-1];w&&(w.parsed=io(w.instruction),w.readingInstruction=!1);continue}if(E===zt.fieldEnd){const w=f.pop();if(!w)continue;let A=w.nodes;if(w.readingInstruction&&(w.parsed=io(w.instruction)),w.parsed?.type==="hyperlink"){const r=w.parsed.href;A=A.map(n=>n.type==="lineBreak"||n.type==="pageBreak"?n:{...n,href:r})}for(const r of A)Ae(f,d,r);continue}const h=f[f.length-1];if(h?.readingInstruction){h.instruction+=E;continue}if(E===zt.hardLineBreak){Ae(f,d,{type:"lineBreak"});continue}if(E===zt.pageBreak){Ae(f,d,{type:"pageBreak"});continue}if(E===zt.picture){const w=C(g.state);w?.type==="image"?Ae(f,d,{type:"image",asset:w,style:g.state}):w?.type==="attachment"&&Ae(f,d,{type:"attachment",asset:w,style:g.state});continue}Ae(f,d,{type:"text",text:$a(E),style:g.state})}for(;f.length;){const g=f.pop();for(const y of g.nodes)Ae(f,d,y)}return d}function hl(m,C,d,f,g,y,E){const h=nl(d,m.cpStart,m.cpEnd,E),w=new Set([m.cpStart,m.cpEnd]);for(const n of h)w.add(Math.max(m.cpStart,n.cpStart)),w.add(Math.min(m.cpEnd,n.cpEnd));const A=Array.from(w).sort((n,e)=>n-e),r=[];for(let n=0;n<A.length-1;n+=1){const e=A[n],t=A[n+1];if(t<=e)continue;const p=h.find(b=>b.cpStart<=e&&b.cpEnd>=t)?.properties||[],c=en(p),s=en(Ee(g,c.charStyleId!=null?f.resolveStyle(c.charStyleId).charProps:[],p)),l=y(s.fontFamilyId);l&&(s.fontFamily=l.name||l.altName||void 0);const u=e-m.cpStart,o=t-m.cpStart,i=C.slice(u,o);if(!i)continue;const a=r[r.length-1];if(a&&Bi(a.state,s)){a.text+=i,a.cpEnd=t;continue}r.push({cpStart:e,cpEnd:t,text:i,state:s})}if(!r.length&&C){const n=en(g),e=y(n.fontFamilyId);e&&(n.fontFamily=e.name||e.altName||void 0),r.push({cpStart:m.cpStart,cpEnd:m.cpEnd,text:C,state:n})}return r}function fl(m,C,d,f,g,y,E){const h=Js(m.properties||[]),w=m.styleId||h.para.find(o=>o.name==="styleId")?.value||0,A=d.resolveStyle(w),r=Ee(A.paraProps,h.para),n=$s(r),e=pr(h.table),t=Ee(e.styleId!=null?d.resolveStyle(e.styleId).tableProps:[],h.table),p=pr(t),c=A.charProps,l=hl(m,C,g,d,c,o=>f.byIndex(o),E),u=cl(l,y);return{id:Xt("para"),cpStart:m.cpStart,cpEnd:m.cpEnd,terminator:m.terminator||"",text:C,rawProperties:m.properties||[],styleId:w,styleName:il(d.styles.get(w)?.name),paraProps:r,paraState:n,tableProps:t,tableState:p,segments:l,inlines:u}}function dl(m){for(const C of m)for(let d=0;d<C.cells.length;d+=1){const f=C.cells[d],g=f.meta?.merge||0;if(f.colIndex=d,f.colspan=1,f.rowspan=1,f.hidden=!1,g===1){f.hidden=!0;continue}if(g>1){let y=d+1;for(;y<C.cells.length&&(C.cells[y].meta?.merge||0)===1;)C.cells[y].hidden=!0,f.colspan+=1,y+=1}}for(let C=0;C<m.length;C+=1){const d=m[C];for(const f of d.cells){if(f.hidden)continue;const g=f.meta?.vertMerge||0;if(g===1){f.hidden=!0;continue}if(g>1){let y=C+1;for(;y<m.length;){let E=!0;for(let h=f.colIndex||0;h<(f.colIndex||0)+(f.colspan||1);h+=1){const w=m[y].cells[h];if(!w||(w.meta?.vertMerge||0)!==1){E=!1;break}}if(!E)break;for(let h=f.colIndex||0;h<(f.colIndex||0)+(f.colspan||1);h+=1)m[y].cells[h].hidden=!0;f.rowspan=(f.rowspan||1)+1,y+=1}}}}}function an(m){return{type:"paragraph",id:m.id,styleId:m.styleId,styleName:m.styleName,paraState:m.paraState,inlines:m.inlines,text:m.text}}function pl(m){const C=[];let d={cells:[]},f=[];for(const E of m)if(f.push(E),E.terminator===zt.cellMark&&(d.cells.push({id:Xt("cell"),paragraphs:f.map(an),meta:null}),f=[],E.paraState.tableRowEnd||E.paraState.innerTableRowEnd)){const h=Ks(E.tableState);for(;h.length&&d.cells.length>h.length&&d.cells[d.cells.length-1].paragraphs.every(A=>!A.text&&!(A.inlines||[]).length);)d.cells.pop();d.cells.forEach((A,r)=>{A.meta=h[r]||{index:r}});const w=h.length?(h[h.length-1].rightBoundary||0)-(h[0].leftBoundary||0):0;C.push({id:Xt("row"),cells:d.cells,state:E.tableState,gridWidthTwips:w}),d={cells:[]}}f.length&&d.cells.push({id:Xt("cell"),paragraphs:f.map(an),meta:null}),d.cells.length&&C.push({id:Xt("row"),cells:d.cells,state:m[0]?.tableState||pr([]),gridWidthTwips:0}),dl(C);const g=C.find(E=>E.gridWidthTwips)?.gridWidthTwips||0,y=Math.max(...m.map(E=>rn(E.paraState)),1);return{type:"table",id:Xt("table"),depth:y,rows:C,state:C[0]?.state||pr([]),gridWidthTwips:g}}function ul(m){const C=[];let d=0;for(;d<m.length;){const f=m[d];if(rn(f.paraState)<=0){C.push(an(f)),d+=1;continue}const g=[];for(;d<m.length&&rn(m[d].paraState)>0;)g.push(m[d]),d+=1;C.push(pl(g))}return C}function gl(m,C={}){const d=[],f=ts(m,C);d.push(...f.warnings||[]);const g=f.getStream("/WordDocument");if(!g)throw new Error("Missing WordDocument stream");const y=fs(g);if(y.base.wIdent!==42476&&sr(d,`Unexpected FIB identifier: 0x${y.base.wIdent.toString(16)}`),y.base.fEncrypted)throw new Error("Encrypted .doc files are not supported yet");const E=f.getStream(y.base.fWhichTblStm?"/1Table":"/0Table");if(!E)throw new Error("Missing table stream");const h=f.getStream("/Data")||new Uint8Array(0),w=os(E,y.fibRgFcLcb),A=ls(g,w),r=A.join(""),n=y.fibRgLw.ccpText>0?y.fibRgLw.ccpText:r.length,e=el(E,y.fibRgFcLcb),t=Is(E,y.fibRgFcLcb),p=Ts(g,E,y,w).filter(T=>T.cpStart<n),c=xs(g,E,y,w).filter(T=>T.cpStart<n).map(T=>({...T,cpEnd:Math.min(T.cpEnd,n)})),s=c.length?c.map(T=>({cpStart:T.cpStart,cpEnd:T.cpEnd,terminator:r[T.cpEnd-1]||"",styleId:T.styleId,properties:T.properties})):hs(r.slice(0,n)).map(T=>({...T,styleId:0,properties:[]})),l=Ws(f),u=[],o=new Set,i=sl(h,l,u,o,new Map,C),a={index:0},b=s.map(T=>{const k=cs(g,w,A,T.cpStart,T.cpEnd),M=T.terminator===zt.paragraph||T.terminator===zt.cellMark?T.terminator:"",R=M&&k.endsWith(M)?k.slice(0,-1):k;return fl({...T,terminator:M},R,e,t,p,i,a)}),v=ul(b),_=Array.from(l.values()).filter(T=>T?.attachment&&!o.has(T.entry.name)).map(T=>T.attachment);for(const T of _)u.push(T);return _.length&&v.push({type:"attachments",id:Xt("attachments"),items:_}),{kind:"msdoc",version:1,warnings:d,meta:{fib:{wIdent:y.base.wIdent,nFib:y.base.nFib,fWhichTblStm:y.base.fWhichTblStm,fComplex:y.base.fComplex,fEncrypted:y.base.fEncrypted,ccpText:y.fibRgLw.ccpText},counts:{paragraphs:b.length,blocks:v.length,assets:u.length,styles:e.styles.size,fonts:t.fonts.length}},fonts:t.fonts,styles:Array.from(e.styles.values()).map(T=>({istd:T.istd,name:T.name,type:T.stdfBase?.stk,basedOn:T.stdfBase?.istdBase,next:T.stdfBase?.istdNext})),blocks:v,assets:u}}var oo=vt((()=>{es(),ve(),Vi(),fr(),gs(),Ds(),Ms(),zs(),ro(),rl()}));function Le(m){return Object.entries(m).filter(([,C])=>C!=null&&C!=="").map(([C,d])=>`${C}:${d}`).join(";")}function ae(m){if(!m)return null;const C=Math.max(1,Math.round((m.lineWidth??8)/8*1.3333)),d=m.borderType,f=d===6?"double":d===3?"dotted":d===2?"dashed":"solid",g=m.color;return`${C}px ${f} ${g&&we[g]||"#666"}`}function ml(m){const C={"text-align":Vs(m.alignment)},d=oe(m.spacingBefore),f=oe(m.spacingAfter),g=oe(m.leftIndent),y=oe(m.rightIndent),E=oe(m.firstLineIndent);if(d&&(C["margin-top"]=`${d}px`),f&&(C["margin-bottom"]=`${f}px`),g&&(C["margin-left"]=`${g}px`),y&&(C["margin-right"]=`${y}px`),E&&(C["text-indent"]=`${E}px`),m.lineSpacing){const n=Math.abs(m.lineSpacing)/240;n&&(C["line-height"]=String(Math.max(1,n)))}m.keepLines&&(C["break-inside"]="avoid"),m.keepNext&&(C["break-after"]="avoid"),m.pageBreakBefore&&(C["break-before"]="page"),m.rtlPara&&(C.direction="rtl");const h=ae(m.borders?.top),w=ae(m.borders?.right),A=ae(m.borders?.bottom),r=ae(m.borders?.left);return h&&(C["border-top"]=h),w&&(C["border-right"]=w),A&&(C["border-bottom"]=A),r&&(C["border-left"]=r),C}function Al(m){const C=Xs(m);if(!m||C==="none")return{};const d={"text-decoration-line":"underline"};return C==="double"||C==="wavy-double"?d["text-decoration-style"]="double":C.includes("dot")||C==="dotted-heavy"?d["text-decoration-style"]="dotted":C.includes("dash")?d["text-decoration-style"]="dashed":C.includes("wave")||C.includes("wavy")?d["text-decoration-style"]="wavy":d["text-decoration-style"]="solid",d}function ao(m){const C={};(m.bold||m.boldBi)&&(C["font-weight"]="700"),(m.italic||m.italicBi)&&(C["font-style"]="italic"),(m.strike||m.doubleStrike)&&(C["text-decoration-line"]=`${C["text-decoration-line"]?`${C["text-decoration-line"]} `:""}line-through`),Object.assign(C,Al(m.underline)),m.fontSizeHalfPoints&&(C["font-size"]=`${m.fontSizeHalfPoints/2}pt`),m.fontFamily&&(C["font-family"]=`'${String(m.fontFamily).replace(/'/g,"\\'")}', sans-serif`),m.colorIndex&&we[m.colorIndex]&&(C.color=we[m.colorIndex]);const d=typeof m.highlight=="number"?m.highlight:m.highlight?.index;return d&&hr[d]&&(C["background-color"]=hr[d]),m.smallCaps&&(C["font-variant-caps"]="small-caps"),m.caps&&(C["text-transform"]="uppercase"),m.scale&&m.scale!==100&&(C.display="inline-block",C.transform=`scaleX(${m.scale/100})`,C["transform-origin"]="left center"),m.positionHalfPoints>0&&(C["vertical-align"]="super"),m.positionHalfPoints<0&&(C["vertical-align"]="sub"),m.outline&&(C["text-shadow"]="0 0 0.02em currentColor"),(m.shadow||m.emboss||m.imprint)&&(C["text-shadow"]=C["text-shadow"]?`${C["text-shadow"]}, 0.06em 0.06em 0.08em rgba(0,0,0,.25)`:"0.06em 0.06em 0.08em rgba(0,0,0,.25)"),m.rtl&&(C.direction="rtl"),C}function bl(m){const C=qt(m.text),d=ao(m.style);d["white-space"]="break-spaces";const f=Le(d),g=`<span${f?` style="${f}"`:""}>${C}</span>`;return m.href?`<a class="msdoc-link" href="${qt(m.href)}" target="_blank" rel="noreferrer noopener">${g}</a>`:g}function Cl(m){const C=ao(m.style);C["max-width"]="100%",C.height="auto";const d=`<img class="msdoc-image" src="${qt(m.asset.dataUrl)}" alt="" style="${Le(C)}">`;return m.href?`<a class="msdoc-link" href="${qt(m.href)}" target="_blank" rel="noreferrer noopener">${d}</a>`:d}function vl(m){const C=qt(m.asset.name||"embedded-file"),d=`<a class="msdoc-attachment" href="${qt(m.asset.dataUrl)}" download="${C}">📎 ${C}</a>`;return m.href?`<a class="msdoc-link" href="${qt(m.href)}" target="_blank" rel="noreferrer noopener">${d}</a>`:d}function yl(m){return m.map(C=>C.type==="text"?bl(C):C.type==="image"?Cl(C):C.type==="attachment"?vl(C):C.type==="lineBreak"?"<br>":C.type==="pageBreak"?'<span class="msdoc-page-break"></span>':"").join("")}function so(m,C={}){const d=C.inline?"div":"p",f=Le(ml(m.paraState)),g=yl(m.inlines||[])||"<br>",y=["msdoc-paragraph"];return m.styleName&&y.push(`msdoc-style-${Oi(m.styleName)}`),`<${d} class="${y.join(" ")}"${f?` style="${f}"`:""}>${g}</${d}>`}function El(m){const C={},d=oe(m.meta?.rightBoundary!=null&&m.meta?.leftBoundary!=null?m.meta.rightBoundary-m.meta.leftBoundary:m.meta?.width);d&&(C.width=`${d}px`),m.meta?.noWrap&&(C["white-space"]="nowrap"),m.meta?.fitText&&(C["text-align"]="justify"),m.meta?.vertAlign!=null&&(C["vertical-align"]=Ys(m.meta.vertAlign));const f=ae(m.meta?.borders?.all),g=ae(m.meta?.borders?.top)||f,y=ae(m.meta?.borders?.right)||f,E=ae(m.meta?.borders?.bottom)||f,h=ae(m.meta?.borders?.left)||f;g&&(C["border-top"]=g),y&&(C["border-right"]=y),E&&(C["border-bottom"]=E),h&&(C["border-left"]=h);const w=typeof m.meta?.shading=="object"&&m.meta?.shading&&"color"in m.meta.shading?m.meta.shading.color:void 0;return w&&we[w]&&(C["background-color"]=we[w]),C}function wl(m){const C={},d=oe(m.gridWidthTwips||m.state?.tableWidth?.wWidth);d?C.width=`${d}px`:C.width="100%";const f=oe(m.state?.leftIndent);return f&&(C["margin-left"]=`${f}px`),C["border-collapse"]="collapse",C["table-layout"]="fixed",C}function _l(m){const C=m.rows.map(d=>{const f=d.state?.rowHeight?oe(Math.abs(d.state.rowHeight)):null;return`<tr class="msdoc-row"${f?` style="height:${f}px"`:""}>${d.cells.filter(g=>!g.hidden).map(g=>{const y=[];(g.colspan??1)>1&&y.push(` colspan="${g.colspan}"`),(g.rowspan??1)>1&&y.push(` rowspan="${g.rowspan}"`);const E=Le(El(g)),h=g.paragraphs.map(w=>so(w,{inline:!0})).join("");return`<td class="msdoc-cell"${y.join("")}${E?` style="${E}"`:""}>${h||'<div class="msdoc-paragraph"><br></div>'}</td>`}).join("")}</tr>`}).join("");return`<table class="msdoc-table msdoc-table-depth-${m.depth}" style="${Le(wl(m))}"><tbody>${C}</tbody></table>`}function Tl(m){return`<section class="msdoc-attachments"><div class="msdoc-attachments-title">Embedded attachments</div><ul>${m.items.map(C=>`<li><a class="msdoc-attachment" href="${qt(C.dataUrl)}" download="${qt(C.name||"embedded-file")}">📎 ${qt(C.name||"embedded-file")}</a></li>`).join("")}</ul></section>`}function lo(){return`
191
191
  .msdoc-root{box-sizing:border-box;max-width:100%;padding:24px;background:#fff;color:#111;font:14px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
192
192
  .msdoc-root *{box-sizing:border-box}
193
193
  .msdoc-paragraph{margin:0 0 8px;white-space:normal;word-break:break-word;overflow-wrap:anywhere}
@@ -201,8 +201,8 @@ section.${e}>footer { z-index: 1; }
201
201
  .msdoc-attachments{margin-top:20px;padding-top:12px;border-top:1px solid #e5e7eb}
202
202
  .msdoc-attachments-title{font-weight:600;margin-bottom:8px}
203
203
  .msdoc-page-break{display:block;height:0;border-top:1px dashed #cbd5e1;margin:16px 0}
204
- `}function wl(m,C={}){const d=C.css??oo();return{html:m.blocks.map(f=>f.type==="paragraph"?io(f):f.type==="table"?yl(f):f.type==="attachments"?El(f):"").join(""),css:d,warnings:m.warnings||[],meta:m.meta,assets:m.assets||[],parsed:m}}var Ee,ao=vt((()=>{Ce(),fr(),Qi(),Ee={1:"#000000",2:"#0000ff",3:"#00ffff",4:"#00ff00",5:"#ff00ff",6:"#ff0000",7:"#ffff00",8:"#ffffff",9:"#000080",10:"#008080",11:"#008000",12:"#800080",13:"#800000",14:"#808000",15:"#808080",16:"#c0c0c0"}}));async function _l(m){if(m instanceof ArrayBuffer)return m;if(ArrayBuffer.isView(m)){const C=new Uint8Array(m.byteLength);return C.set(new Uint8Array(m.buffer,m.byteOffset,m.byteLength)),C.buffer}if(typeof Blob<"u"&&m instanceof Blob)return await m.arrayBuffer();if(typeof m=="string"){const C=await fetch(m);if(!C.ok)throw new Error(`Failed to fetch document: ${C.status}`);return await C.arrayBuffer()}throw new TypeError("Unsupported input type")}async function Tl(m,C={}){const d=await _l(m);return C.workerClient?C.workerClient.parseToHtml(d,{parseOptions:C.parseOptions||{},renderOptions:C.renderOptions||{}}):wl(dl(d,C.parseOptions||{}),C.renderOptions||{})}var xl=vt((()=>{ro(),ao()})),Sl=vt((()=>{ro(),ao(),xl(),Oi()})),Pl=we({default:()=>Ol});function Dl(m){return m.replace(/<(p|table|section)([^>]*?)style="([^"]*?\bbreak-before\s*:\s*page;?[^"]*?)"([^>]*)>/gi,C=>`${sn}${C}`)}function Rl(m){return`<div class="msdoc-stage">${Dl(m).split(sn).map(C=>`<section class="msdoc-page"><div class="msdoc-root">${C||so}</div></section>`).join("")}</div>`}function kl(m){const C=m.cloneNode(!0);return C.classList.remove("msdoc-zoom-viewer"),C.querySelectorAll("style[data-msdoc-zoom]").forEach(d=>d.remove()),C.querySelectorAll(".msdoc-stage, .msdoc-page, .msdoc-root").forEach(d=>{d.style.height="auto",d.style.maxHeight="none",d.style.overflow="visible",d.style.transform="none"}),C.querySelectorAll(".msdoc-page").forEach(d=>{_r(d,te,{heightMode:"min"}),d.style.position="relative",d.style.width=Jt(te.width),d.style.maxWidth="none",d.style.margin="0 auto 18px";const f=d.querySelector(".msdoc-root");f&&(f.style.position="relative",f.style.top="auto",f.style.left="auto",f.style.width=Jt(te.width),f.style.maxWidth="none",f.style.minHeight=Jt(te.height),f.style.height="auto",f.style.transform="none",f.style.transformOrigin="top left",f.style.boxShadow="none",f.style.border="0",f.style.overflow="visible")}),C.innerHTML}function Il(){return Tr({selector:".viewer-export-content .msdoc-page",width:te.width,height:te.height,heightMode:"min"})}function Ml(m){const C=Array.from(m.querySelectorAll(".msdoc-page"));if(!C.length)return()=>{};m.classList.add("msdoc-zoom-viewer");const d=ho(m),f=d?.ResizeObserver,g=m.ownerDocument.createElement("style");g.dataset.msdocZoom="true",g.textContent=co,m.prepend(g);const y=Xe();let E=0,h=1,w=1,A=1;const r=c=>Math.min(ur,Math.max(He,Number(c.toFixed(2)))),n=()=>{d&&(d.cancelAnimationFrame(E),E=d.requestAnimationFrame(()=>{let c=1,s=1;C.forEach(l=>{const u=l.querySelector(".msdoc-root");if(!u)return;const o=u.offsetWidth||te.width,i=Math.max(u.scrollHeight,u.offsetHeight,te.height),a=Math.max(m.clientWidth-48,120),b=Math.min(1,Math.max(He,a/o)),v=r(b*h);c=v,s=b,u.style.transform=`translateX(-50%) scale(${v})`,l.style.width=`${Math.ceil(Math.max(o*v,120))}px`,l.style.height=`${Math.ceil(i*v)}px`}),w=c,A=s,y.emit()}))},e=()=>({scale:w,label:`${Math.round(w*100)}%`,canZoomIn:w<ur,canZoomOut:w>He,canReset:h!==1,minScale:He,maxScale:ur}),t=c=>(h=Math.min(6,Math.max(.2,Number(c.toFixed(2)))),n(),e());m.dataset.viewerZoomProvider="doc",$e(m,{zoomIn:()=>t(h+ln),zoomOut:()=>t(h-ln),resetZoom:()=>t(1),setZoom:c=>t(c/Math.max(A,.01)),getState:e,subscribe:y.subscribe});const p=f?new f(n):null;return p?.observe(m),C.forEach(c=>{const s=c.querySelector(".msdoc-root");s&&p?.observe(s)}),n(),()=>{d?.cancelAnimationFrame(E),p?.disconnect(),Ve(m),g.remove(),m.classList.remove("msdoc-zoom-viewer")}}async function Ol(m,C,d){var f;const g=await Tl(m,{renderOptions:{css:`${oo()}
205
- ${lo}`}});C.innerHTML=`<style data-msdoc>${g.css}</style>${Rl(g.html)}`;const y=Ml(C);return(f=d?.registerExportAdapter)===null||f===void 0||f.call(d,{includeDocumentStyles:!1,printStyle:Il,toHtml:()=>kl(C)}),{$el:C,unmount(){var E;(E=d?.registerExportAdapter)===null||E===void 0||E.call(d,null),y(),C.innerHTML=""}}}var sn,so,te,He,ur,ln,lo,co,ho,Bl=vt((()=>{Sl(),Lr(),sn='<span class="msdoc-page-break"></span>',so='<p class="msdoc-paragraph"><br></p>',te={width:794,height:1123},He=.24,ur=3,ln=.15,lo=`
204
+ `}function xl(m,C={}){const d=C.css??lo();return{html:m.blocks.map(f=>f.type==="paragraph"?so(f):f.type==="table"?_l(f):f.type==="attachments"?Tl(f):"").join(""),css:d,warnings:m.warnings||[],meta:m.meta,assets:m.assets||[],parsed:m}}var we,co=vt((()=>{ve(),fr(),ro(),we={1:"#000000",2:"#0000ff",3:"#00ffff",4:"#00ff00",5:"#ff00ff",6:"#ff0000",7:"#ffff00",8:"#ffffff",9:"#000080",10:"#008080",11:"#008000",12:"#800080",13:"#800000",14:"#808000",15:"#808080",16:"#c0c0c0"}}));async function Sl(m){if(m instanceof ArrayBuffer)return m;if(ArrayBuffer.isView(m)){const C=new Uint8Array(m.byteLength);return C.set(new Uint8Array(m.buffer,m.byteOffset,m.byteLength)),C.buffer}if(typeof Blob<"u"&&m instanceof Blob)return await m.arrayBuffer();if(typeof m=="string"){const C=await fetch(m);if(!C.ok)throw new Error(`Failed to fetch document: ${C.status}`);return await C.arrayBuffer()}throw new TypeError("Unsupported input type")}async function Pl(m,C={}){const d=await Sl(m);return C.workerClient?C.workerClient.parseToHtml(d,{parseOptions:C.parseOptions||{},renderOptions:C.renderOptions||{}}):xl(gl(d,C.parseOptions||{}),C.renderOptions||{})}var Dl=vt((()=>{oo(),co()})),Rl=vt((()=>{oo(),co(),Dl(),Fi()})),kl=_e({default:()=>Fl});function Il(m){return m.replace(/<(p|table|section)([^>]*?)style="([^"]*?\bbreak-before\s*:\s*page;?[^"]*?)"([^>]*)>/gi,C=>`${sn}${C}`)}function Ml(m){return`<div class="msdoc-stage">${Il(m).split(sn).map(C=>`<section class="msdoc-page"><div class="msdoc-root">${C||ho}</div></section>`).join("")}</div>`}function Ol(m){const C=m.cloneNode(!0);return C.classList.remove("msdoc-zoom-viewer"),C.querySelectorAll("style[data-msdoc-zoom]").forEach(d=>d.remove()),C.querySelectorAll(".msdoc-stage, .msdoc-page, .msdoc-root").forEach(d=>{d.style.height="auto",d.style.maxHeight="none",d.style.overflow="visible",d.style.transform="none"}),C.querySelectorAll(".msdoc-page").forEach(d=>{_r(d,te,{heightMode:"min"}),d.style.position="relative",d.style.width=Jt(te.width),d.style.maxWidth="none",d.style.margin="0 auto 18px";const f=d.querySelector(".msdoc-root");f&&(f.style.position="relative",f.style.top="auto",f.style.left="auto",f.style.width=Jt(te.width),f.style.maxWidth="none",f.style.minHeight=Jt(te.height),f.style.height="auto",f.style.transform="none",f.style.transformOrigin="top left",f.style.boxShadow="none",f.style.border="0",f.style.overflow="visible")}),C.innerHTML}function Bl(){return Tr({selector:".viewer-export-content .msdoc-page",width:te.width,height:te.height,heightMode:"min"})}function Nl(m){const C=Array.from(m.querySelectorAll(".msdoc-page"));if(!C.length)return()=>{};m.classList.add("msdoc-zoom-viewer");const d=uo(m),f=d?.ResizeObserver,g=m.ownerDocument.createElement("style");g.dataset.msdocZoom="true",g.textContent=po,m.prepend(g);const y=Xe();let E=0,h=1,w=1,A=1;const r=c=>Math.min(ur,Math.max(He,Number(c.toFixed(2)))),n=()=>{d&&(d.cancelAnimationFrame(E),E=d.requestAnimationFrame(()=>{let c=1,s=1;C.forEach(l=>{const u=l.querySelector(".msdoc-root");if(!u)return;const o=u.offsetWidth||te.width,i=Math.max(u.scrollHeight,u.offsetHeight,te.height),a=Math.max(m.clientWidth-48,120),b=Math.min(1,Math.max(He,a/o)),v=r(b*h);c=v,s=b,u.style.transform=`translateX(-50%) scale(${v})`,l.style.width=`${Math.ceil(Math.max(o*v,120))}px`,l.style.height=`${Math.ceil(i*v)}px`}),w=c,A=s,y.emit()}))},e=()=>({scale:w,label:`${Math.round(w*100)}%`,canZoomIn:w<ur,canZoomOut:w>He,canReset:h!==1,minScale:He,maxScale:ur}),t=c=>(h=Math.min(6,Math.max(.2,Number(c.toFixed(2)))),n(),e());m.dataset.viewerZoomProvider="doc",$e(m,{zoomIn:()=>t(h+ln),zoomOut:()=>t(h-ln),resetZoom:()=>t(1),setZoom:c=>t(c/Math.max(A,.01)),getState:e,subscribe:y.subscribe});const p=f?new f(n):null;return p?.observe(m),C.forEach(c=>{const s=c.querySelector(".msdoc-root");s&&p?.observe(s)}),n(),()=>{d?.cancelAnimationFrame(E),p?.disconnect(),Ve(m),g.remove(),m.classList.remove("msdoc-zoom-viewer")}}async function Fl(m,C,d){var f;const g=await Pl(m,{renderOptions:{css:`${lo()}
205
+ ${fo}`}});C.innerHTML=`<style data-msdoc>${g.css}</style>${Ml(g.html)}`;const y=Nl(C);return(f=d?.registerExportAdapter)===null||f===void 0||f.call(d,{includeDocumentStyles:!1,printStyle:Bl,toHtml:()=>Ol(C)}),{$el:C,unmount(){var E;(E=d?.registerExportAdapter)===null||E===void 0||E.call(d,null),y(),C.innerHTML=""}}}var sn,ho,te,He,ur,ln,fo,po,uo,Ll=vt((()=>{Rl(),Lr(),sn='<span class="msdoc-page-break"></span>',ho='<p class="msdoc-paragraph"><br></p>',te={width:794,height:1123},He=.24,ur=3,ln=.15,fo=`
206
206
  .msdoc-stage{
207
207
  box-sizing:border-box;
208
208
  min-height:100%;
@@ -277,7 +277,7 @@ ${lo}`}});C.innerHTML=`<style data-msdoc>${g.css}</style>${Rl(g.html)}`;const y=
277
277
  box-shadow:none;
278
278
  }
279
279
  }
280
- `,co=`
280
+ `,po=`
281
281
  .msdoc-zoom-viewer{
282
282
  box-sizing:border-box;
283
283
  height:100%;
@@ -301,7 +301,7 @@ ${lo}`}});C.innerHTML=`<style data-msdoc>${g.css}</style>${Rl(g.html)}`;const y=
301
301
  margin:0;
302
302
  transform-origin:top center;
303
303
  }
304
- `,ho=m=>m.ownerDocument.defaultView})),fo=We(((m,C)=>{(function(f,g){typeof m=="object"&&typeof C=="object"?C.exports=g():typeof define=="function"&&define.amd?define([],g):typeof m=="object"?m.EMFJS=g():f.EMFJS=g()})(m,()=>(()=>{"use strict";var d={"./src/emfjs/Bitmap.ts":((E,h,w)=>{w.r(h),w.d(h,{BitmapInfo:()=>e,DIBitmap:()=>t});var A=w("./src/emfjs/Helper.ts"),r=(function(){function p(c,s){s&&c.skip(4),this.width=c.readUint16(),this.height=c.readUint16(),this.planes=c.readUint16(),this.bitcount=c.readUint16()}return p.prototype.colors=function(){return this.bitcount<=8?1<<this.bitcount:0},p})(),n=(function(){function p(c,s){s&&c.skip(4),this.width=c.readInt32(),this.height=c.readInt32(),this.planes=c.readUint16(),this.bitcount=c.readUint16(),this.compression=c.readUint32(),this.sizeimage=c.readUint32(),this.xpelspermeter=c.readInt32(),this.ypelspermeter=c.readInt32(),this.clrused=c.readUint32(),this.clrimportant=c.readUint32()}return p.prototype.colors=function(){return this.clrused!==0?this.clrused<256?this.clrused:256:this.bitcount>8?0:1<<this.bitcount},p})(),e=(function(){function p(c,s){this._usergb=s;var l=c.readUint32();if(this._infosize=l,l===A.Helper.GDI.BITMAPCOREHEADER_SIZE)this._header=new r(c,!1),this._infosize+=this._header.colors()*(s?3:2);else{this._header=new n(c,!1);var u=this._header.compression===A.Helper.GDI.BitmapCompression.BI_BITFIELDS?3:0;l<=A.Helper.GDI.BITMAPINFOHEADER_SIZE+u*4&&(this._infosize=A.Helper.GDI.BITMAPINFOHEADER_SIZE+u*4),this._infosize+=this._header.colors()*(s?4:2)}}return p.prototype.getWidth=function(){return this._header.width},p.prototype.getHeight=function(){return Math.abs(this._header.height)},p.prototype.infosize=function(){return this._infosize},p.prototype.header=function(){return this._header},p})(),t=(function(){function p(c,s){this._reader=c,this._offset=c.pos,this._location=s,this._info=new e(c,!0)}return p.prototype.getWidth=function(){return this._info.getWidth()},p.prototype.getHeight=function(){return this._info.getHeight()},p.prototype.totalSize=function(){return this._location.header.size+this._location.data.size},p.prototype.makeBitmapFileHeader=function(){var c=new Uint8Array(new ArrayBuffer(14));return c[0]=66,c[1]=77,A.Helper._writeUint32Val(c,2,this.totalSize()+14),A.Helper._writeUint32Val(c,10,this._info.infosize()+14),A.Helper._blobToBinary(c)},p.prototype.base64ref=function(){var c=this._reader.pos;this._reader.seek(this._offset);var s="image/bmp",l=this._info.header(),u;if(l instanceof n&&l.compression!=null)switch(l.compression){case A.Helper.GDI.BitmapCompression.BI_JPEG:s="data:image/jpeg";break;case A.Helper.GDI.BitmapCompression.BI_PNG:s="data:image/png";break;default:u=this.makeBitmapFileHeader();break}else u=this.makeBitmapFileHeader();this._reader.seek(this._location.header.offset),u!=null?u+=this._reader.readBinary(this._location.header.size):u=this._reader.readBinary(this._location.header.size),this._reader.seek(this._location.data.offset),u+=this._reader.readBinary(this._location.data.size);var o="data:"+s+";base64,"+btoa(u);return this._reader.seek(c),o},p})()}),"./src/emfjs/Blob.ts":((E,h,w)=>{w.r(h),w.d(h,{Blob:()=>r});var A=w("./src/emfjs/Helper.ts"),r=(function(){function n(e,t){e instanceof n?(this.blob=e.blob,this.data=e.data,this.pos=t||e.pos):(this.blob=e,this.data=new Uint8Array(e),this.pos=t||0)}return n.prototype.eof=function(){return this.pos>=this.data.length},n.prototype.seek=function(e){if(e<0||e>this.data.length)throw new A.EMFJSError("Invalid seek position");this.pos=e},n.prototype.skip=function(e){var t=this.pos+e;if(t>this.data.length)throw new A.EMFJSError("Unexpected end of file");this.pos=t},n.prototype.readBinary=function(e){if(this.pos+e>this.data.length)throw new A.EMFJSError("Unexpected end of file");for(var t="";e-- >0;)t+=String.fromCharCode(this.data[this.pos++]);return t},n.prototype.readInt8=function(){if(this.pos+1>this.data.length)throw new A.EMFJSError("Unexpected end of file");return this.data[this.pos++]},n.prototype.readUint8=function(){return this.readInt8()>>>0},n.prototype.readInt32=function(){if(this.pos+4>this.data.length)throw new A.EMFJSError("Unexpected end of file");var e=this.data[this.pos++];return e|=this.data[this.pos++]<<8,e|=this.data[this.pos++]<<16,e|=this.data[this.pos++]<<24,e},n.prototype.readUint32=function(){return this.readInt32()>>>0},n.prototype.readUint16=function(){if(this.pos+2>this.data.length)throw new A.EMFJSError("Unexpected end of file");var e=this.data[this.pos++];return e|=this.data[this.pos++]<<8,e},n.prototype.readInt16=function(){var e=this.readUint16();return e>32767&&(e-=65536),e},n.prototype.readString=function(e){if(this.pos+e>this.data.length)throw new A.EMFJSError("Unexpected end of file");for(var t="",p=0;p<e;p++)t+=String.fromCharCode(this.data[this.pos++]>>>0);return t},n.prototype.readNullTermString=function(e){var t="";if(e>0){e--;for(var p=0;p<e;p++){if(this.pos+p+1>this.data.length)throw new A.EMFJSError("Unexpected end of file");var c=this.data[this.pos+p]>>>0;if(c===0)break;t+=String.fromCharCode(c)}}return t},n.prototype.readFixedSizeUnicodeString=function(e){for(var t="",p=0;p<e;p++){var c=this.readUint16();if(c===0){++p<e&&this.skip((e-p)*2);break}t+=String.fromCharCode(c)}return t},n})()}),"./src/emfjs/EMFRecords.ts":((E,h,w)=>{w.r(h),w.d(h,{EMFRecords:()=>p});var A=w("./src/emfjs/Helper.ts"),r=w("./src/emfjs/Primitives.ts"),n=w("./src/emfjs/Region.ts"),e=w("./src/emfjs/Style.ts"),t=(function(){function c(s,l){var u=s.pos-8;if(this.size=l,this.bounds=new r.RectL(s),this.frame=new r.RectL(s),s.readUint32()!==A.Helper.GDI.FormatSignature.ENHMETA_SIGNATURE)throw new A.EMFJSError("Invalid header signature");s.skip(4),s.skip(4),s.skip(4),s.skip(2),s.skip(2);var o=s.readUint32(),i=s.readUint32();this.nPalEntries=s.readUint32(),this.refDevCx=s.readUint32(),this.refDevCy=s.readUint32(),this.refDevCxMm=s.readUint32(),this.refDevCyMm=s.readUint32();var a=l;if(o>0){if(i<88)throw new A.EMFJSError("Invalid header description offset");if(a=i+o*2,a>l)throw new A.EMFJSError("Invalid header description length");var b=s.pos;s.seek(u+i),this.description=s.readFixedSizeUnicodeString(o),s.seek(b)}else this.description="";if(a>=100){var v=s.readUint32(),_=s.readUint32();if(s.readUint32()!==0)throw new A.EMFJSError("OpenGL records are not yet supported");if(_!==0){if(_<100||_<a)throw new A.EMFJSError("Invalid pixel format offset");if(a=_+v,a>l)throw new A.EMFJSError("Invalid pixel format size")}a>=108&&(this.displayDevCxUm=s.readUint32(),this.displayDevCyUm=s.readUint32())}}return c.prototype.toString=function(){return"{bounds: "+this.bounds.toString()+", frame: "+this.frame.toString()+", description: "+this.description+"}"},c})(),p=(function(){function c(s,l){this._records=[],this._header=new t(s,l);var u=!1,o=l,i=function(){s.seek(o);var b=s.readUint32(),v=s.readUint32();if(v<8)throw new A.EMFJSError("Invalid record size");switch(b){case A.Helper.GDI.RecordType.EMR_EOF:return u=!0,"break-main_loop";case A.Helper.GDI.RecordType.EMR_SETMAPMODE:var _=s.readInt32();a._records.push(function(pt){pt.setMapMode(_)});break;case A.Helper.GDI.RecordType.EMR_SETWINDOWORGEX:var T=s.readInt32(),k=s.readInt32();a._records.push(function(pt){pt.setWindowOrgEx(T,k)});break;case A.Helper.GDI.RecordType.EMR_SETWINDOWEXTEX:var M=s.readUint32(),R=s.readUint32();a._records.push(function(pt){pt.setWindowExtEx(M,R)});break;case A.Helper.GDI.RecordType.EMR_SETVIEWPORTORGEX:var O=s.readInt32(),P=s.readInt32();a._records.push(function(pt){pt.setViewportOrgEx(O,P)});break;case A.Helper.GDI.RecordType.EMR_SETVIEWPORTEXTEX:var N=s.readUint32(),it=s.readUint32();a._records.push(function(pt){pt.setViewportExtEx(N,it)});break;case A.Helper.GDI.RecordType.EMR_SAVEDC:a._records.push(function(pt){pt.saveDC()});break;case A.Helper.GDI.RecordType.EMR_RESTOREDC:var J=s.readInt32();a._records.push(function(pt){pt.restoreDC(J)});break;case A.Helper.GDI.RecordType.EMR_SETBKMODE:var ot=s.readUint32();a._records.push(function(pt){pt.setBkMode(ot)});break;case A.Helper.GDI.RecordType.EMR_SETBKCOLOR:var tt=new e.ColorRef(s);a._records.push(function(pt){pt.setBkColor(tt)});break;case A.Helper.GDI.RecordType.EMR_CREATEBRUSHINDIRECT:var ht=s.readUint32(),W=new e.Brush(s);a._records.push(function(pt){pt.createBrush(ht,W)});break;case A.Helper.GDI.RecordType.EMR_CREATEPEN:var G=s.readUint32(),gt=new e.Pen(s,null);a._records.push(function(pt){pt.createPen(G,gt)});break;case A.Helper.GDI.RecordType.EMR_EXTCREATEPEN:var nt=s.readUint32(),j=s.readUint32(),U=s.readUint32(),at=s.readUint32(),rt=s.readUint32(),V=new e.Pen(s,{header:{off:j,size:U},data:{off:at,size:rt}});a._records.push(function(pt){pt.createPen(nt,V)});break;case A.Helper.GDI.RecordType.EMR_SELECTOBJECT:var et=s.readUint32();a._records.push(function(pt){pt.selectObject(et,null)});break;case A.Helper.GDI.RecordType.EMR_DELETEOBJECT:var q=s.readUint32();a._records.push(function(pt){pt.deleteObject(q)});break;case A.Helper.GDI.RecordType.EMR_RECTANGLE:var F=new r.RectL(s);a._records.push(function(pt){pt.rectangle(F,0,0)});break;case A.Helper.GDI.RecordType.EMR_ROUNDRECT:var ut=new r.RectL(s),S=new r.SizeL(s);a._records.push(function(pt){pt.rectangle(ut,S.cx,S.cy)});break;case A.Helper.GDI.RecordType.EMR_LINETO:var $=s.readInt32(),z=s.readInt32();a._records.push(function(pt){pt.lineTo($,z)});break;case A.Helper.GDI.RecordType.EMR_MOVETOEX:var x=s.readInt32(),D=s.readInt32();a._records.push(function(pt){pt.moveToEx(x,D)});break;case A.Helper.GDI.RecordType.EMR_POLYGON:case A.Helper.GDI.RecordType.EMR_POLYGON16:for(var L=b===A.Helper.GDI.RecordType.EMR_POLYGON16,I=new r.RectL(s),Ct=s.readUint32(),H=[];Ct>0;)H.push(L?new r.PointS(s):new r.PointL(s)),Ct--;a._records.push(function(pt){pt.polygon(H,I,!0)});break;case A.Helper.GDI.RecordType.EMR_POLYPOLYGON:case A.Helper.GDI.RecordType.EMR_POLYPOLYGON16:var L=b===A.Helper.GDI.RecordType.EMR_POLYPOLYGON16,B=new r.RectL(s),Y=s.readUint32();s.skip(4);for(var Q=[],K=0;K<Y;K++)Q.push(s.readUint32());for(var lt=[],K=0;K<Y;K++){for(var ft=Q[K],X=[],mt=0;mt<ft;mt++)X.push(L?new r.PointS(s):new r.PointL(s));lt.push(X)}a._records.push(function(pt){pt.polyPolygon(lt,B)});break;case A.Helper.GDI.RecordType.EMR_SETPOLYFILLMODE:var At=s.readUint32();a._records.push(function(pt){pt.setPolyFillMode(At)});break;case A.Helper.GDI.RecordType.EMR_POLYLINE16:case A.Helper.GDI.RecordType.EMR_POLYLINETO16:for(var Et=b===A.Helper.GDI.RecordType.EMR_POLYLINETO16,ct=new r.RectL(s),Ct=s.readUint32(),yt=[];Ct>0;)yt.push(new r.PointS(s)),Ct--;a._records.push(function(pt){pt.polyline(Et,yt,ct)});break;case A.Helper.GDI.RecordType.EMR_POLYBEZIER:case A.Helper.GDI.RecordType.EMR_POLYBEZIERTO:for(var Rt=b===A.Helper.GDI.RecordType.EMR_POLYBEZIERTO,St=new r.RectL(s),Ct=s.readUint32(),It=[];Ct>0;)It.push(new r.PointL(s)),Ct--;a._records.push(function(pt){pt.polybezier(Rt,It,St)});break;case A.Helper.GDI.RecordType.EMR_POLYBEZIER16:for(var Lt=new r.RectL(s),Ft=new r.PointL(s),Ct=s.readUint32(),_t=[Ft];Ct>0;)_t.push(new r.PointS(s)),Ct--;a._records.push(function(pt){pt.polybezier(!1,_t,Lt)});break;case A.Helper.GDI.RecordType.EMR_POLYBEZIERTO16:for(var Mt=new r.RectL(s),Ct=s.readUint32(),Dt=[];Ct>0;)Dt.push(new r.PointS(s)),Ct--;a._records.push(function(pt){pt.polybezier(!0,Dt,Mt)});break;case A.Helper.GDI.RecordType.EMR_SETTEXTALIGN:var bt=s.readUint32();a._records.push(function(pt){pt.setTextAlign(bt)});break;case A.Helper.GDI.RecordType.EMR_SETSTRETCHBLTMODE:var wt=s.readUint32();a._records.push(function(pt){pt.setStretchBltMode(wt)});break;case A.Helper.GDI.RecordType.EMR_SETBRUSHORGEX:var jt=new r.PointL(s);a._records.push(function(pt){pt.setBrushOrgEx(jt)});break;case A.Helper.GDI.RecordType.EMR_BEGINPATH:a._records.push(function(pt){pt.beginPath()});break;case A.Helper.GDI.RecordType.EMR_ENDPATH:a._records.push(function(pt){pt.endPath()});break;case A.Helper.GDI.RecordType.EMR_ABORTPATH:a._records.push(function(pt){pt.abortPath()});break;case A.Helper.GDI.RecordType.EMR_CLOSEFIGURE:a._records.push(function(pt){pt.closeFigure()});break;case A.Helper.GDI.RecordType.EMR_FILLPATH:var ee=new r.RectL(s);a._records.push(function(pt){pt.fillPath(ee)});break;case A.Helper.GDI.RecordType.EMR_STROKEPATH:var Kt=new r.RectL(s);a._records.push(function(pt){pt.strokePath(Kt)});break;case A.Helper.GDI.RecordType.EMR_SELECTCLIPPATH:var re=s.readUint32();a._records.push(function(pt){pt.selectClipPath(re)});break;case A.Helper.GDI.RecordType.EMR_EXTSELECTCLIPRGN:s.skip(4);var Vt=s.readUint32(),ne=Vt!==A.Helper.GDI.RegionMode.RGN_COPY?new n.Region(s):null;a._records.push(function(pt){pt.selectClipRgn(Vt,ne)});break;case A.Helper.GDI.RecordType.EMR_OFFSETCLIPRGN:var Pt=new r.PointL(s);a._records.push(function(pt){pt.offsetClipRgn(Pt)});break;case A.Helper.GDI.RecordType.EMR_SETMITERLIMIT:var Ot=s.readUint32();a._records.push(function(pt){pt.setMiterLimit(Ot)});break;case A.Helper.GDI.RecordType.EMR_POLYLINE:case A.Helper.GDI.RecordType.EMR_POLYLINETO:case A.Helper.GDI.RecordType.EMR_POLYPOLYLINE:case A.Helper.GDI.RecordType.EMR_SETPIXELV:case A.Helper.GDI.RecordType.EMR_SETMAPPERFLAGS:case A.Helper.GDI.RecordType.EMR_SETROP2:case A.Helper.GDI.RecordType.EMR_SETCOLORADJUSTMENT:case A.Helper.GDI.RecordType.EMR_SETTEXTCOLOR:case A.Helper.GDI.RecordType.EMR_SETMETARGN:case A.Helper.GDI.RecordType.EMR_EXCLUDECLIPRECT:case A.Helper.GDI.RecordType.EMR_INTERSECTCLIPRECT:case A.Helper.GDI.RecordType.EMR_SCALEVIEWPORTEXTEX:case A.Helper.GDI.RecordType.EMR_SCALEWINDOWEXTEX:case A.Helper.GDI.RecordType.EMR_SETWORLDTRANSFORM:case A.Helper.GDI.RecordType.EMR_MODIFYWORLDTRANSFORM:case A.Helper.GDI.RecordType.EMR_ANGLEARC:case A.Helper.GDI.RecordType.EMR_ELLIPSE:case A.Helper.GDI.RecordType.EMR_ARC:case A.Helper.GDI.RecordType.EMR_CHORD:case A.Helper.GDI.RecordType.EMR_PIE:case A.Helper.GDI.RecordType.EMR_SELECTPALETTE:case A.Helper.GDI.RecordType.EMR_CREATEPALETTE:case A.Helper.GDI.RecordType.EMR_SETPALETTEENTRIES:case A.Helper.GDI.RecordType.EMR_RESIZEPALETTE:case A.Helper.GDI.RecordType.EMR_REALIZEPALETTE:case A.Helper.GDI.RecordType.EMR_EXTFLOODFILL:case A.Helper.GDI.RecordType.EMR_ARCTO:case A.Helper.GDI.RecordType.EMR_POLYDRAW:case A.Helper.GDI.RecordType.EMR_SETARCDIRECTION:case A.Helper.GDI.RecordType.EMR_STROKEANDFILLPATH:case A.Helper.GDI.RecordType.EMR_FLATTENPATH:case A.Helper.GDI.RecordType.EMR_WIDENPATH:case A.Helper.GDI.RecordType.EMR_COMMENT:case A.Helper.GDI.RecordType.EMR_FILLRGN:case A.Helper.GDI.RecordType.EMR_FRAMERGN:case A.Helper.GDI.RecordType.EMR_INVERTRGN:case A.Helper.GDI.RecordType.EMR_PAINTRGN:case A.Helper.GDI.RecordType.EMR_BITBLT:case A.Helper.GDI.RecordType.EMR_STRETCHBLT:case A.Helper.GDI.RecordType.EMR_MASKBLT:case A.Helper.GDI.RecordType.EMR_PLGBLT:case A.Helper.GDI.RecordType.EMR_SETDIBITSTODEVICE:case A.Helper.GDI.RecordType.EMR_STRETCHDIBITS:case A.Helper.GDI.RecordType.EMR_EXTCREATEFONTINDIRECTW:case A.Helper.GDI.RecordType.EMR_EXTTEXTOUTA:case A.Helper.GDI.RecordType.EMR_EXTTEXTOUTW:case A.Helper.GDI.RecordType.EMR_POLYPOLYLINE16:case A.Helper.GDI.RecordType.EMR_POLYDRAW16:case A.Helper.GDI.RecordType.EMR_CREATEMONOBRUSH:case A.Helper.GDI.RecordType.EMR_CREATEDIBPATTERNBRUSHPT:case A.Helper.GDI.RecordType.EMR_POLYTEXTOUTA:case A.Helper.GDI.RecordType.EMR_POLYTEXTOUTW:case A.Helper.GDI.RecordType.EMR_SETICMMODE:case A.Helper.GDI.RecordType.EMR_CREATECOLORSPACE:case A.Helper.GDI.RecordType.EMR_SETCOLORSPACE:case A.Helper.GDI.RecordType.EMR_DELETECOLORSPACE:case A.Helper.GDI.RecordType.EMR_GLSRECORD:case A.Helper.GDI.RecordType.EMR_GLSBOUNDEDRECORD:case A.Helper.GDI.RecordType.EMR_PIXELFORMAT:case A.Helper.GDI.RecordType.EMR_DRAWESCAPE:case A.Helper.GDI.RecordType.EMR_EXTESCAPE:case A.Helper.GDI.RecordType.EMR_SMALLTEXTOUT:case A.Helper.GDI.RecordType.EMR_FORCEUFIMAPPING:case A.Helper.GDI.RecordType.EMR_NAMEDESCAPE:case A.Helper.GDI.RecordType.EMR_COLORCORRECTPALETTE:case A.Helper.GDI.RecordType.EMR_SETICMPROFILEA:case A.Helper.GDI.RecordType.EMR_SETICMPROFILEW:case A.Helper.GDI.RecordType.EMR_ALPHABLEND:case A.Helper.GDI.RecordType.EMR_SETLAYOUT:case A.Helper.GDI.RecordType.EMR_TRANSPARENTBLT:case A.Helper.GDI.RecordType.EMR_GRADIENTFILL:case A.Helper.GDI.RecordType.EMR_SETLINKEDUFIS:case A.Helper.GDI.RecordType.EMR_SETTEXTJUSTIFICATION:case A.Helper.GDI.RecordType.EMR_COLORMATCHTOTARGETW:case A.Helper.GDI.RecordType.EMR_CREATECOLORSPACEW:default:var kt="UNKNOWN";for(var Gt in A.Helper.GDI.RecordType)if(A.Helper.GDI.RecordType[Gt]===b){kt=Gt;break}A.Helper.log("[EMF] "+kt+" record (0x"+b.toString(16)+") at offset 0x"+o.toString(16)+" with "+v+" bytes");break}o+=v},a=this;t:for(;!u;)switch(i()){case"break-main_loop":break t}if(!u)throw new A.EMFJSError("Could not read all records")}return c.prototype.play=function(s){for(var l=this._records.length,u=0;u<l;u++)this._records[u](s)},c})()}),"./src/emfjs/GDIContext.ts":((E,h,w)=>{w.r(h),w.d(h,{GDIContext:()=>u});var A=w("./src/emfjs/Helper.ts"),r=w("./src/emfjs/Primitives.ts"),n=w("./src/emfjs/Region.ts"),e=w("./src/emfjs/Style.ts"),t=(function(){var o=function(i,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,v){b.__proto__=v}||function(b,v){for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(b[_]=v[_])},o(i,a)};return function(i,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(i,a);function b(){this.constructor=i}i.prototype=a===null?Object.create(a):(b.prototype=a.prototype,new b)}})(),p=(function(o){t(i,o);function i(a,b){var v=o.call(this,"path")||this;return a!=null?v.svgPath=a:v.svgPath=b.svgPath,v}return i.prototype.clone=function(){return new i(null,this)},i.prototype.toString=function(){return"{[path]}"},i})(r.Obj);function c(){var o=function(T,k,M){return new e.Brush(null,{style:A.Helper.GDI.BrushStyle.BS_SOLID,color:new e.ColorRef(null,T,k,M)})},i=function(T,k,M){return new e.Pen(null,A.Helper.GDI.PenStyle.PS_SOLID,1,new e.ColorRef(null,T,k,M),null)},a={WHITE_BRUSH:o(255,255,255),LTGRAY_BRUSH:o(212,208,200),GRAY_BRUSH:o(128,128,128),DKGRAY_BRUSH:o(64,64,64),BLACK_BRUSH:o(0,0,0),NULL_BRUSH:new e.Brush(null,{style:A.Helper.GDI.BrushStyle.BS_NULL}),WHITE_PEN:i(255,255,255),BLACK_PEN:i(0,0,0),NULL_PEN:new e.Pen(null,A.Helper.GDI.PenStyle.PS_NULL,0,null,null),OEM_FIXED_FONT:null,ANSI_FIXED_FONT:null,ANSI_VAR_FONT:null,SYSTEM_FONT:null,DEVICE_DEFAULT_FONT:null,DEFAULT_PALETTE:null,SYSTEM_FIXED_FONT:null,DEFAULT_GUI_FONT:null},b={};for(var v in a){var _=A.Helper.GDI.StockObject[v]-2147483648;b[_.toString()]=a[v]}return b}var s=c(),l=(function(){function o(i,a){if(i!=null){this._svggroup=i._svggroup,this._svgclipChanged=i._svgclipChanged,this._svgtextbkfilter=i._svgtextbkfilter,this.mapmode=i.mapmode,this.stretchmode=i.stretchmode,this.textalign=i.textalign,this.bkmode=i.bkmode,this.textcolor=i.textcolor.clone(),this.bkcolor=i.bkcolor.clone(),this.polyfillmode=i.polyfillmode,this.miterlimit=i.miterlimit,this.wx=i.wx,this.wy=i.wy,this.ww=i.ww,this.wh=i.wh,this.vx=i.vx,this.vy=i.vy,this.vw=i.vw,this.vh=i.vh,this.x=i.x,this.y=i.y,this.nextbrx=i.nextbrx,this.nextbry=i.nextbry,this.brx=i.brx,this.bry=i.bry,this.clip=i.clip,this.ownclip=!1,this.selected={};for(var b in i.selected)this.selected[b]=i.selected[b]}else{this._svggroup=null,this._svgclipChanged=!1,this._svgtextbkfilter=null,this.mapmode=A.Helper.GDI.MapMode.MM_ANISOTROPIC,this.stretchmode=A.Helper.GDI.StretchMode.COLORONCOLOR,this.textalign=0,this.bkmode=A.Helper.GDI.MixMode.OPAQUE,this.textcolor=new e.ColorRef(null,0,0,0),this.bkcolor=new e.ColorRef(null,255,255,255),this.polyfillmode=A.Helper.GDI.PolygonFillMode.ALTERNATE,this.miterlimit=10,this.wx=0,this.wy=0,this.ww=0,this.wh=0,this.vx=0,this.vy=0,this.vw=0,this.vh=0,this.x=0,this.y=0,this.nextbrx=0,this.nextbry=0,this.brx=0,this.bry=0,this.clip=null,this.ownclip=!1,this.selected={};for(var b in a){var v=a[b];this.selected[b]=v!=null?v.clone():null}}}return o})(),u=(function(){function o(i){this._svg=i,this._svgdefs=null,this._svgPatterns={},this._svgClipPaths={},this._svgPath=null,this.defObjects={brush:new e.Brush(null,{style:A.Helper.GDI.BrushStyle.BS_SOLID,color:new e.ColorRef(null,0,0,0)}),pen:new e.Pen(null,A.Helper.GDI.PenStyle.PS_SOLID,1,new e.ColorRef(null,0,0,0),null),font:new e.Font(null,null),palette:null,region:null},this.state=new l(null,this.defObjects),this.statestack=[this.state],this.objects={}}return o.prototype.setMapMode=function(i){A.Helper.log("[gdi] setMapMode: mode="+i),this.state.mapmode=i,this.state._svggroup=null},o.prototype.setWindowOrgEx=function(i,a){A.Helper.log("[gdi] setWindowOrgEx: x="+i+" y="+a),this.state.wx=i,this.state.wy=a,this.state._svggroup=null},o.prototype.setWindowExtEx=function(i,a){A.Helper.log("[gdi] setWindowExtEx: x="+i+" y="+a),this.state.ww=i,this.state.wh=a,this.state._svggroup=null},o.prototype.setViewportOrgEx=function(i,a){A.Helper.log("[gdi] setViewportOrgEx: x="+i+" y="+a),this.state.vx=i,this.state.vy=a,this.state._svggroup=null},o.prototype.setViewportExtEx=function(i,a){A.Helper.log("[gdi] setViewportExtEx: x="+i+" y="+a),this.state.vw=i,this.state.vh=a,this.state._svggroup=null},o.prototype.setBrushOrgEx=function(i){A.Helper.log("[gdi] setBrushOrgEx: x="+i.x+" y="+i.y),this.state.nextbrx=i.x,this.state.nextbry=i.y},o.prototype.saveDC=function(){A.Helper.log("[gdi] saveDC");var i=this.state;this.state=new l(this.state),this.statestack.push(i),this.state._svggroup=null},o.prototype.restoreDC=function(i){if(A.Helper.log("[gdi] restoreDC: saved="+i),this.statestack.length>1)if(i===-1)this.state=this.statestack.pop();else{if(i<-1)throw new A.EMFJSError("restoreDC: relative restore not implemented");if(i>1)throw new A.EMFJSError("restoreDC: absolute restore not implemented")}else throw new A.EMFJSError("No saved contexts");this.state._svggroup=null},o.prototype.setStretchBltMode=function(i){A.Helper.log("[gdi] setStretchBltMode: stretchMode="+i)},o.prototype.rectangle=function(i,a,b){A.Helper.log("[gdi] rectangle: rect="+i.toString()+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());var v=this._todevY(i.bottom),_=this._todevX(i.right),T=this._todevY(i.top),k=this._todevX(i.left);a=this._todevH(a),b=this._todevH(b),A.Helper.log("[gdi] rectangle: TRANSLATED: bottom="+v+" right="+_+" top="+T+" left="+k+" rh="+b+" rw="+a),this._pushGroup();var M=this._applyOpts(null,!0,!0,!1);this._svg.rect(this.state._svggroup,k,T,_-k,v-T,a/2,b/2,M)},o.prototype.lineTo=function(i,a){A.Helper.log("[gdi] lineTo: x="+i+" y="+a+" with pen "+this.state.selected.pen.toString());var b=this._todevX(i),v=this._todevY(a),_=this._todevX(this.state.x),T=this._todevY(this.state.y);this.state.x=i,this.state.y=a,A.Helper.log("[gdi] lineTo: TRANSLATED: toX="+b+" toY="+v+" fromX="+_+" fromY="+T),this._pushGroup();var k=this._applyOpts(null,!0,!1,!1);this._svg.line(this.state._svggroup,_,T,b,v,k)},o.prototype.moveToEx=function(i,a){A.Helper.log("[gdi] moveToEx: x="+i+" y="+a),this.state.x=i,this.state.y=a,this._svgPath!=null&&(this._svgPath.move(this.state.x,this.state.y),A.Helper.log("[gdi] new path: "+this._svgPath.path()))},o.prototype.polygon=function(i,a,b){A.Helper.log("[gdi] polygon: points="+i+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());for(var v=[],_=0;_<i.length;_++){var T=i[_];v.push([this._todevX(T.x),this._todevY(T.y)])}b&&this._pushGroup();var k={"fill-rule":this.state.polyfillmode===A.Helper.GDI.PolygonFillMode.ALTERNATE?"evenodd":"nonzero"};this._applyOpts(k,!0,!0,!1),this._svg.polygon(this.state._svggroup,v,k)},o.prototype.polyPolygon=function(i,a){A.Helper.log("[gdi] polyPolygon: polygons.length="+i.length+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());for(var b=i.length,v=0;v<b;v++)this.polygon(i[v],a,v===0)},o.prototype.polyline=function(i,a,b){A.Helper.log("[gdi] polyline: isLineTo="+i.toString()+", points="+a+", bounds="+b.toString()+" with pen "+this.state.selected.pen.toString());for(var v=[],_=0;_<a.length;_++){var T=a[_];v.push([this._todevX(T.x),this._todevY(T.y)])}if(this._svgPath!=null){if(!i||v.length===0)this._svgPath.move(this._todevX(this.state.x),this._todevY(this.state.y));else{var k=v[0];this._svgPath.move(k[0],k[1])}this._svgPath.line(v),A.Helper.log("[gdi] new path: "+this._svgPath.path())}else{this._pushGroup();var M=this._applyOpts(null,!0,!1,!1);if(i&&a.length>0){var R=a[0];(R.x!==this.state.x||R.y!==this.state.y)&&v.unshift([this._todevX(this.state.x),this._todevY(this.state.y)])}this._svg.polyline(this.state._svggroup,v,M)}if(a.length>0){var O=a[a.length-1];this.state.x=O.x,this.state.y=O.y}},o.prototype.polybezier=function(i,a,b){A.Helper.log("[gdi] polybezier: isPolyBezierTo="+i.toString()+", points="+a+", bounds="+b.toString()+" with pen "+this.state.selected.pen.toString());for(var v=[],_=0;_<a.length;_++){var T=a[_];v.push({x:this._todevX(T.x),y:this._todevY(T.y)})}if(this._svgPath!=null){if(i&&v.length>0){var k=v[0];this._svgPath.move(k.x,k.y)}else this._svgPath.move(this._todevX(this.state.x),this._todevY(this.state.y));if(v.length<(i?3:4))throw new A.EMFJSError("Not enough points to draw bezier");for(var _=i?1:0;_+3<=v.length;_+=3){var M=v[_],R=v[_+1],O=v[_+2];this._svgPath.curveC(M.x,M.y,R.x,R.y,O.x,O.y)}A.Helper.log("[gdi] new path: "+this._svgPath.path())}else throw new A.EMFJSError("polybezier not implemented (not a path)");if(a.length>0){var P=a[a.length-1];this.state.x=P.x,this.state.y=P.y}},o.prototype.selectClipPath=function(i){A.Helper.log("[gdi] selectClipPath: rgnMode=0x"+i.toString(16))},o.prototype.selectClipRgn=function(i,a){if(A.Helper.log("[gdi] selectClipRgn: rgnMode=0x"+i.toString(16)),i===A.Helper.GDI.RegionMode.RGN_COPY)this.state.selected.region=a,this.state.clip=null,this.state.ownclip=!1;else throw a==null?new A.EMFJSError("No clip region to select"):new A.EMFJSError("Not implemented: rgnMode=0x"+i.toString(16));this.state._svgclipChanged=!0},o.prototype.offsetClipRgn=function(i){A.Helper.log("[gdi] offsetClipRgn: offset="+i.toString()),this._getClipRgn().offset(i.x,i.y)},o.prototype.setTextAlign=function(i){A.Helper.log("[gdi] setTextAlign: textAlignmentMode=0x"+i.toString(16)),this.state.textalign=i},o.prototype.setMiterLimit=function(i){A.Helper.log("[gdi] setMiterLimit: miterLimit="+i),this.state.miterlimit=i},o.prototype.setBkMode=function(i){A.Helper.log("[gdi] setBkMode: bkMode=0x"+i.toString(16)),this.state.bkmode=i},o.prototype.setBkColor=function(i){A.Helper.log("[gdi] setBkColor: bkColor="+i.toString()),this.state.bkcolor=i,this.state._svgtextbkfilter=null},o.prototype.setPolyFillMode=function(i){A.Helper.log("[gdi] setPolyFillMode: polyFillMode="+i),this.state.polyfillmode=i},o.prototype.createBrush=function(i,a){var b=this._storeObject(a,i);A.Helper.log("[gdi] createBrush: brush="+a.toString()+" with handle "+b)},o.prototype.createPen=function(i,a){var b=this._storeObject(a,i);A.Helper.log("[gdi] createPen: pen="+a.toString()+" width handle "+b)},o.prototype.createPenEx=function(i,a){var b=this._storeObject(a,i);A.Helper.log("[gdi] createPenEx: pen="+a.toString()+" width handle "+b)},o.prototype.selectObject=function(i,a){var b=this._getObject(i);b!=null&&(a==null||b.type===a)?(this._selectObject(b),A.Helper.log("[gdi] selectObject: objIdx="+i+(b?" selected "+b.type+": "+b.toString():"[invalid index]"))):A.Helper.log("[gdi] selectObject: objIdx="+i+(b?" invalid object type: "+b.type:"[invalid index]"))},o.prototype.abortPath=function(){A.Helper.log("[gdi] abortPath"),this._svgPath!=null&&(this._svgPath=null)},o.prototype.beginPath=function(){A.Helper.log("[gdi] beginPath"),this._svgPath!=null&&(this._svgPath=null),this._svgPath=this._svg.createPath()},o.prototype.closeFigure=function(){if(A.Helper.log("[gdi] closeFigure"),this._svgPath==null)throw new A.EMFJSError("No path bracket: cannot close figure");this._svgPath.close()},o.prototype.fillPath=function(i){if(A.Helper.log("[gdi] fillPath"),this.state.selected.path==null)throw new A.EMFJSError("No path selected");var a=this.state.selected.path,b=this._applyOpts(null,!0,!0,!1);this._svg.path(this.state._svggroup,a.svgPath,b),this._pushGroup(),this.state.selected.path=null},o.prototype.strokePath=function(i){if(A.Helper.log("[gdi] strokePath"),this.state.selected.path==null)throw new A.EMFJSError("No path selected");var a=this.state.selected.path,b=this._applyOpts({fill:"none"},!0,!1,!1);this._svg.path(this.state._svggroup,a.svgPath,b),this._pushGroup(),this.state.selected.path=null},o.prototype.endPath=function(){if(A.Helper.log("[gdi] endPath"),this._svgPath==null)throw new A.EMFJSError("No path bracket: cannot end path");this._pushGroup(),this._selectObject(new p(this._svgPath)),this._svgPath=null},o.prototype.deleteObject=function(i){var a=this._deleteObject(i);A.Helper.log("[gdi] deleteObject: objIdx="+i+(a?" deleted object":"[invalid index]"))},o.prototype._pushGroup=function(){if(this.state._svggroup==null||this.state._svgclipChanged){this.state._svgclipChanged=!1,this.state._svgtextbkfilter=null;var i={viewBox:[this.state.vx,this.state.vy,this.state.vw,this.state.vh].join(" "),preserveAspectRatio:"none"};this.state.clip!=null?(A.Helper.log("[gdi] new svg x="+this.state.vx+" y="+this.state.vy+" width="+this.state.vw+" height="+this.state.vh+" with clipping"),i["clip-path"]="url(#"+this._getSvgClipPathForRegion(this.state.clip)+")"):A.Helper.log("[gdi] new svg x="+this.state.vx+" y="+this.state.vy+" width="+this.state.vw+" height="+this.state.vh+" without clipping"),this.state._svggroup=this._svg.svg(this.state._svggroup,this.state.vx,this.state.vy,this.state.vw,this.state.vh,i)}},o.prototype._getStockObject=function(i){return i>=2147483648&&i<=2147483665?s[(i-2147483648).toString()]:i===A.Helper.GDI.StockObject.DC_BRUSH?this.state.selected.brush:i===A.Helper.GDI.StockObject.DC_PEN?this.state.selected.pen:null},o.prototype._storeObject=function(i,a){if(!a){for(a=0;this.objects[a.toString()]!=null&&a<=65535;)a++;if(a>65535)return A.Helper.log("[gdi] Too many objects!"),-1}return this.objects[a.toString()]=i,a},o.prototype._getObject=function(i){var a=this.objects[i.toString()];return a==null&&(a=this._getStockObject(i),a==null&&A.Helper.log("[gdi] No object with handle "+i)),a},o.prototype._getSvgDef=function(){return this._svgdefs==null&&(this._svgdefs=this._svg.defs()),this._svgdefs},o.prototype._getSvgClipPathForRegion=function(i){for(var a in this._svgClipPaths)if(this._svgClipPaths[a]===i)return a;var b=A.Helper._makeUniqueId("c"),v=this._svg.clipPath(this._getSvgDef(),b,"userSpaceOnUse");switch(i.complexity){case 1:this._svg.rect(v,this._todevX(i.bounds.left),this._todevY(i.bounds.top),this._todevW(i.bounds.right-i.bounds.left),this._todevH(i.bounds.bottom-i.bounds.top),{fill:"black","stroke-width":0});break;case 2:for(var _=0;_<i.scans.length;_++)for(var T=i.scans[_],k=0;k<T.scanlines.length;k++){var M=T.scanlines[k];this._svg.rect(v,this._todevX(M.left),this._todevY(T.top),this._todevW(M.right-M.left),this._todevH(T.bottom-T.top),{fill:"black","stroke-width":0})}break}return this._svgClipPaths[b]=i,b},o.prototype._getSvgPatternForBrush=function(i){for(var a in this._svgPatterns)if(this._svgPatterns[a]===i)return a;var b,v,_;switch(i.style){case A.Helper.GDI.BrushStyle.BS_PATTERN:b=i.pattern.getWidth(),v=i.pattern.getHeight();break;case A.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:b=i.dibpatternpt.getWidth(),v=i.dibpatternpt.getHeight(),_=i.dibpatternpt.base64ref();break;default:throw new A.EMFJSError("Invalid brush style")}var T=A.Helper._makeUniqueId("p"),k=this._svg.pattern(this._getSvgDef(),T,this.state.brx,this.state.bry,b,v,{patternUnits:"userSpaceOnUse"});return this._svg.image(k,0,0,b,v,_),this._svgPatterns[T]=i,T},o.prototype._selectObject=function(i){switch(this.state.selected[i.type]=i,i.type){case"region":this.state._svgclipChanged=!0;break;case"brush":this.state.brx=this.state.nextbrx,this.state.bry=this.state.nextbry;break}},o.prototype._deleteObject=function(i){var a=this.objects[i.toString()];if(a!=null){for(var b=0;b<this.statestack.length;b++){var v=this.statestack[b];v.selected[a.type]===a&&(v.selected[a.type]=this.defObjects[a.type].clone())}return delete this.objects[i.toString()],!0}return A.Helper.log("[gdi] Cannot delete object with invalid handle "+i),!1},o.prototype._getClipRgn=function(){return this.state.clip!=null?this.state.ownclip||(this.state.clip=this.state.clip.clone()):this.state.selected.region!=null?this.state.clip=this.state.selected.region.clone():this.state.clip=(0,n.CreateSimpleRegion)(this.state.wx,this.state.wy,this.state.wx+this.state.ww,this.state.wy+this.state.wh),this.state.ownclip=!0,this.state.clip},o.prototype._todevX=function(i){return Math.floor((i-this.state.wx)*(this.state.vw/this.state.ww))+this.state.vx},o.prototype._todevY=function(i){return Math.floor((i-this.state.wy)*(this.state.vh/this.state.wh))+this.state.vy},o.prototype._todevW=function(i){return Math.floor(i*(this.state.vw/this.state.ww))+this.state.vx},o.prototype._todevH=function(i){return Math.floor(i*(this.state.vh/this.state.wh))+this.state.vy},o.prototype._tologicalX=function(i){return Math.floor((i-this.state.vx)/(this.state.vw/this.state.ww))+this.state.wx},o.prototype._tologicalY=function(i){return Math.floor((i-this.state.vy)/(this.state.vh/this.state.wh))+this.state.wy},o.prototype._tologicalW=function(i){return Math.floor(i/(this.state.vw/this.state.ww))+this.state.wx},o.prototype._tologicalH=function(i){return Math.floor(i/(this.state.vh/this.state.wh))+this.state.wy},o.prototype._applyOpts=function(i,a,b,v){if(i==null&&(i={}),a){var _=this.state.selected.pen;if(_.style!==A.Helper.GDI.PenStyle.PS_NULL){i.stroke="#"+_.color.toHex(),i["stroke-width"]=_.width,i["stroke-miterlimit"]=this.state.miterlimit,i["stroke-linecap"]="round";var T=1;i["stroke-linejoin"]="round";var k=i["stroke-width"]*4,M=i["stroke-width"]*2;switch(_.style){case A.Helper.GDI.PenStyle.PS_DASH:i["stroke-dasharray"]=[k,M].toString();break;case A.Helper.GDI.PenStyle.PS_DOT:i["stroke-dasharray"]=[T,M].toString();break;case A.Helper.GDI.PenStyle.PS_DASHDOT:i["stroke-dasharray"]=[k,M,T,M].toString();break;case A.Helper.GDI.PenStyle.PS_DASHDOTDOT:i["stroke-dasharray"]=[k,M,T,M,T,M].toString();break}}}if(b){var R=this.state.selected.brush;switch(R.style){case A.Helper.GDI.BrushStyle.BS_SOLID:i.fill="#"+R.color.toHex();break;case A.Helper.GDI.BrushStyle.BS_PATTERN:case A.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:i.fill="url(#"+this._getSvgPatternForBrush(R)+")";break;case A.Helper.GDI.BrushStyle.BS_NULL:i.fill="none";break;default:A.Helper.log("[gdi] unsupported brush style: "+R.style),i.fill="none";break}}if(v){var O=this.state.selected.font;i["font-family"]=O.facename,i["font-size"]=Math.abs(O.height),i.fill="#"+this.state.textcolor.toHex()}return i},o})()}),"./src/emfjs/Helper.ts":((E,h,w)=>{w.r(h),w.d(h,{EMFJSError:()=>r,Helper:()=>t,loggingEnabled:()=>e});var A=(function(){var p=function(c,s){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&(l[o]=u[o])},p(c,s)};return function(c,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");p(c,s);function l(){this.constructor=c}c.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}})(),r=(function(p){A(c,p);function c(s){var l=this.constructor,u=p.call(this,s)||this;return Object.setPrototypeOf(u,l.prototype),u}return c})(Error),n=!0;function e(p){n=p}var t=(function(){function p(){}return p.log=function(c){n&&console.log(c)},p._makeUniqueId=function(c){return"EMFJS_"+c+this._uniqueId++},p._writeUint32Val=function(c,s,l){c[s++]=l&255,c[s++]=l>>>8&255,c[s++]=l>>>16&255,c[s++]=l>>>24&255},p._blobToBinary=function(c){for(var s="",l=c.length,u=0;u<l;u++)s+=String.fromCharCode(c[u]);return s},p.GDI={FormatSignature:{ENHMETA_SIGNATURE:1179469088,EPS_SIGNATURE:1179865157},BITMAPINFOHEADER_SIZE:40,BITMAPCOREHEADER_SIZE:12,RecordType:{EMR_POLYBEZIER:2,EMR_POLYGON:3,EMR_POLYLINE:4,EMR_POLYBEZIERTO:5,EMR_POLYLINETO:6,EMR_POLYPOLYLINE:7,EMR_POLYPOLYGON:8,EMR_SETWINDOWEXTEX:9,EMR_SETWINDOWORGEX:10,EMR_SETVIEWPORTEXTEX:11,EMR_SETVIEWPORTORGEX:12,EMR_SETBRUSHORGEX:13,EMR_EOF:14,EMR_SETPIXELV:15,EMR_SETMAPPERFLAGS:16,EMR_SETMAPMODE:17,EMR_SETBKMODE:18,EMR_SETPOLYFILLMODE:19,EMR_SETROP2:20,EMR_SETSTRETCHBLTMODE:21,EMR_SETTEXTALIGN:22,EMR_SETCOLORADJUSTMENT:23,EMR_SETTEXTCOLOR:24,EMR_SETBKCOLOR:25,EMR_OFFSETCLIPRGN:26,EMR_MOVETOEX:27,EMR_SETMETARGN:28,EMR_EXCLUDECLIPRECT:29,EMR_INTERSECTCLIPRECT:30,EMR_SCALEVIEWPORTEXTEX:31,EMR_SCALEWINDOWEXTEX:32,EMR_SAVEDC:33,EMR_RESTOREDC:34,EMR_SETWORLDTRANSFORM:35,EMR_MODIFYWORLDTRANSFORM:36,EMR_SELECTOBJECT:37,EMR_CREATEPEN:38,EMR_CREATEBRUSHINDIRECT:39,EMR_DELETEOBJECT:40,EMR_ANGLEARC:41,EMR_ELLIPSE:42,EMR_RECTANGLE:43,EMR_ROUNDRECT:44,EMR_ARC:45,EMR_CHORD:46,EMR_PIE:47,EMR_SELECTPALETTE:48,EMR_CREATEPALETTE:49,EMR_SETPALETTEENTRIES:50,EMR_RESIZEPALETTE:51,EMR_REALIZEPALETTE:52,EMR_EXTFLOODFILL:53,EMR_LINETO:54,EMR_ARCTO:55,EMR_POLYDRAW:56,EMR_SETARCDIRECTION:57,EMR_SETMITERLIMIT:58,EMR_BEGINPATH:59,EMR_ENDPATH:60,EMR_CLOSEFIGURE:61,EMR_FILLPATH:62,EMR_STROKEANDFILLPATH:63,EMR_STROKEPATH:64,EMR_FLATTENPATH:65,EMR_WIDENPATH:66,EMR_SELECTCLIPPATH:67,EMR_ABORTPATH:68,EMR_COMMENT:70,EMR_FILLRGN:71,EMR_FRAMERGN:72,EMR_INVERTRGN:73,EMR_PAINTRGN:74,EMR_EXTSELECTCLIPRGN:75,EMR_BITBLT:76,EMR_STRETCHBLT:77,EMR_MASKBLT:78,EMR_PLGBLT:79,EMR_SETDIBITSTODEVICE:80,EMR_STRETCHDIBITS:81,EMR_EXTCREATEFONTINDIRECTW:82,EMR_EXTTEXTOUTA:83,EMR_EXTTEXTOUTW:84,EMR_POLYBEZIER16:85,EMR_POLYGON16:86,EMR_POLYLINE16:87,EMR_POLYBEZIERTO16:88,EMR_POLYLINETO16:89,EMR_POLYPOLYLINE16:90,EMR_POLYPOLYGON16:91,EMR_POLYDRAW16:92,EMR_CREATEMONOBRUSH:93,EMR_CREATEDIBPATTERNBRUSHPT:94,EMR_EXTCREATEPEN:95,EMR_POLYTEXTOUTA:96,EMR_POLYTEXTOUTW:97,EMR_SETICMMODE:98,EMR_CREATECOLORSPACE:99,EMR_SETCOLORSPACE:100,EMR_DELETECOLORSPACE:101,EMR_GLSRECORD:102,EMR_GLSBOUNDEDRECORD:103,EMR_PIXELFORMAT:104,EMR_DRAWESCAPE:105,EMR_EXTESCAPE:106,EMR_SMALLTEXTOUT:108,EMR_FORCEUFIMAPPING:109,EMR_NAMEDESCAPE:110,EMR_COLORCORRECTPALETTE:111,EMR_SETICMPROFILEA:112,EMR_SETICMPROFILEW:113,EMR_ALPHABLEND:114,EMR_SETLAYOUT:115,EMR_TRANSPARENTBLT:116,EMR_GRADIENTFILL:118,EMR_SETLINKEDUFIS:119,EMR_SETTEXTJUSTIFICATION:120,EMR_COLORMATCHTOTARGETW:121,EMR_CREATECOLORSPACEW:122},MetafileEscapes:{NEWFRAME:1,ABORTDOC:2,NEXTBAND:3,SETCOLORTABLE:4,GETCOLORTABLE:5,FLUSHOUT:6,DRAFTMODE:7,QUERYESCSUPPORT:8,SETABORTPROC:9,STARTDOC:10,ENDDOC:11,GETPHYSPAGESIZE:12,GETPRINTINGOFFSET:13,GETSCALINGFACTOR:14,META_ESCAPE_ENHANCED_METAFILE:15,SETPENWIDTH:16,SETCOPYCOUNT:17,SETPAPERSOURCE:18,PASSTHROUGH:19,GETTECHNOLOGY:20,SETLINECAP:21,SETLINEJOIN:22,SETMITERLIMIT:23,BANDINFO:24,DRAWPATTERNRECT:25,GETVECTORPENSIZE:26,GETVECTORBRUSHSIZE:27,ENABLEDUPLEX:28,GETSETPAPERBINS:29,GETSETPRINTORIENT:30,ENUMPAPERBINS:31,SETDIBSCALING:32,EPSPRINTING:33,ENUMPAPERMETRICS:34,GETSETPAPERMETRICS:35,POSTSCRIPT_DATA:37,POSTSCRIPT_IGNORE:38,GETDEVICEUNITS:42,GETEXTENDEDTEXTMETRICS:256,GETPAIRKERNTABLE:258,EXTTEXTOUT:512,GETFACENAME:513,DOWNLOADFACE:514,METAFILE_DRIVER:2049,QUERYDIBSUPPORT:3073,BEGIN_PATH:4096,CLIP_TO_PATH:4097,END_PATH:4098,OPEN_CHANNEL:4110,DOWNLOADHEADER:4111,CLOSE_CHANNEL:4112,POSTSCRIPT_PASSTHROUGH:4115,ENCAPSULATED_POSTSCRIPT:4116,POSTSCRIPT_IDENTIFY:4117,POSTSCRIPT_INJECTION:4118,CHECKJPEGFORMAT:4119,CHECKPNGFORMAT:4120,GET_PS_FEATURESETTING:4121,MXDC_ESCAPE:4122,SPCLPASSTHROUGH2:4568},MapMode:{MM_TEXT:1,MM_LOMETRIC:2,MM_HIMETRIC:3,MM_LOENGLISH:4,MM_HIENGLISH:5,MM_TWIPS:6,MM_ISOTROPIC:7,MM_ANISOTROPIC:8},StretchMode:{BLACKONWHITE:1,WHITEONBLACK:2,COLORONCOLOR:3,HALFTONE:4},MixMode:{TRANSPARENT:1,OPAQUE:2},BrushStyle:{BS_SOLID:0,BS_NULL:1,BS_HATCHED:2,BS_PATTERN:3,BS_INDEXED:4,BS_DIBPATTERN:5,BS_DIBPATTERNPT:6,BS_PATTERN8X8:7,BS_DIBPATTERN8X8:8,BS_MONOPATTERN:9},PenStyle:{PS_COSMETIC:0,PS_ENDCAP_ROUND:0,PS_JOIN_ROUND:0,PS_SOLID:0,PS_DASH:1,PS_DOT:2,PS_DASHDOT:3,PS_DASHDOTDOT:4,PS_NULL:5,PS_INSIDEFRAME:6,PS_USERSTYLE:7,PS_ALTERNATE:8,PS_ENDCAP_SQUARE:256,PS_ENDCAP_FLAT:512,PS_JOIN_BEVEL:4096,PS_JOIN_MITER:8192,PS_GEOMETRIC:65536},PolygonFillMode:{ALTERNATE:1,WINDING:2},BitmapCompression:{BI_RGB:0,BI_RLE8:1,BI_RLE4:2,BI_BITFIELDS:3,BI_JPEG:4,BI_PNG:5},RegionMode:{RGN_AND:1,RGN_OR:2,RGN_XOR:3,RGN_DIFF:4,RGN_COPY:5},StockObject:{WHITE_BRUSH:2147483648,LTGRAY_BRUSH:2147483649,GRAY_BRUSH:2147483650,DKGRAY_BRUSH:2147483651,BLACK_BRUSH:2147483652,NULL_BRUSH:2147483653,WHITE_PEN:2147483654,BLACK_PEN:2147483655,NULL_PEN:2147483656,OEM_FIXED_FONT:2147483658,ANSI_FIXED_FONT:2147483659,ANSI_VAR_FONT:2147483660,SYSTEM_FONT:2147483661,DEVICE_DEFAULT_FONT:2147483662,DEFAULT_PALETTE:2147483663,SYSTEM_FIXED_FONT:2147483664,DEFAULT_GUI_FONT:2147483665,DC_BRUSH:2147483666,DC_PEN:2147483667}},p._uniqueId=0,p})()}),"./src/emfjs/Primitives.ts":((E,h,w)=>{w.r(h),w.d(h,{Obj:()=>p,PointL:()=>n,PointS:()=>r,RectL:()=>e,SizeL:()=>t});var A=w("./src/emfjs/Helper.ts"),r=(function(){function c(s,l,u){s!=null?(this.x=s.readInt16(),this.y=s.readInt16()):(this.x=l,this.y=u)}return c.prototype.clone=function(){return new c(null,this.x,this.y)},c.prototype.toString=function(){return"{x: "+this.x+", y: "+this.y+"}"},c})(),n=(function(){function c(s,l,u){s!=null?(this.x=s.readInt32(),this.y=s.readInt32()):(this.x=l,this.y=u)}return c.prototype.clone=function(){return new c(null,this.x,this.y)},c.prototype.toString=function(){return"{x: "+this.x+", y: "+this.y+"}"},c})(),e=(function(){function c(s,l,u,o,i){s!=null?(this.left=s.readInt32(),this.top=s.readInt32(),this.right=s.readInt32(),this.bottom=s.readInt32()):(this.bottom=i,this.right=o,this.top=u,this.left=l)}return c.prototype.clone=function(){return new c(null,this.left,this.top,this.right,this.bottom)},c.prototype.toString=function(){return"{left: "+this.left+", top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+"}"},c.prototype.empty=function(){return this.left>=this.right||this.top>=this.bottom},c.prototype.intersect=function(s){return this.empty()||s.empty()||this.left>=s.right||this.top>=s.bottom||this.right<=s.left||this.bottom<=s.top?null:new c(null,Math.max(this.left,s.left),Math.max(this.top,s.top),Math.min(this.right,s.right),Math.min(this.bottom,s.bottom))},c})(),t=(function(){function c(s,l,u){s!=null?(this.cx=s.readUint32(),this.cy=s.readUint32()):(this.cx=l,this.cy=u)}return c.prototype.clone=function(){return new c(null,this.cx,this.cy)},c.prototype.toString=function(){return"{cx: "+this.cx+", cy: "+this.cy+"}"},c})(),p=(function(){function c(s){this.type=s}return c.prototype.clone=function(){throw new A.EMFJSError("clone not implemented")},c.prototype.toString=function(){throw new A.EMFJSError("toString not implemented")},c})()}),"./src/emfjs/Region.ts":((E,h,w)=>{w.r(h),w.d(h,{CreateSimpleRegion:()=>t,Region:()=>e,Scan:()=>p});var A=w("./src/emfjs/Helper.ts"),r=w("./src/emfjs/Primitives.ts"),n=(function(){var c=function(s,l){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,o){u.__proto__=o}||function(u,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(u[i]=o[i])},c(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");c(s,l);function u(){this.constructor=s}s.prototype=l===null?Object.create(l):(u.prototype=l.prototype,new u)}})(),e=(function(c){n(s,c);function s(l,u){var o=c.call(this,"region")||this;if(l!=null){if(l.readUint32()!==32)throw new A.EMFJSError("Invalid region header");l.skip(4);var i=l.readUint32(),a=l.readUint32();if(i*16!==a)throw new A.EMFJSError("Invalid region data");o.bounds=new r.RectL(l),o.scans=[];for(var b=void 0,v=0;v<i;v++){var _=new r.RectL(l);b||b.top!==_.top||b.bottom!==_.bottom?(b=new p(_),o.scans.push(b)):b.append(_)}o._updateComplexity()}else if(u!=null){if(o.bounds=u.bounds!=null?u.bounds.clone():null,u.scans!=null){o.scans=[];for(var v=0;v<u.scans.length;v++)o.scans.push(u.scans[v].clone())}else o.scans=null;o.complexity=u.complexity}else o.bounds=null,o.scans=null,o.complexity=0;return o}return s.prototype.clone=function(){return new s(null,this)},s.prototype.toString=function(){return"{complexity: "+["null","simple","complex"][this.complexity]+" bounds: "+(this.bounds!=null?this.bounds.toString():"[none]")+" #scans: "+(this.scans!=null?this.scans.length:"[none]")+"}"},s.prototype._updateComplexity=function(){if(this.bounds==null)this.complexity=0,this.scans=null;else if(this.bounds.empty())this.complexity=0,this.scans=null,this.bounds=null;else if(this.scans==null)this.complexity=1;else if(this.complexity=2,this.scans.length===1){var l=this.scans[0];if(l.top===this.bounds.top&&l.bottom===this.bounds.bottom&&l.scanlines.length===1){var u=l.scanlines[0];u.left===this.bounds.left&&u.right===this.bounds.right&&(this.scans=null,this.complexity=1)}}},s.prototype.subtract=function(l){if(A.Helper.log("[emf] Region "+this.toString()+" subtract "+l.toString()),this.bounds!=null&&this.bounds.intersect(l)!=null){this.scans==null&&(this.scans=[],this.scans.push(new p(new r.RectL(null,this.bounds.left,this.bounds.top,this.bounds.right,this.bounds.bottom))),this.complexity=2);for(var u=0;u<this.scans.length;){var o=this.scans[u];if(o.bottom>=l.top){var i=o.clone();o.bottom=l.top-1,i.top=l.top,o.top>=o.bottom?this.scans[u]=i:(A.Helper.log("[emf] Region split top scan "+u+" for substraction"),this.scans.splice(++u,0,i));break}u++}for(var a=u;u<this.scans.length;){var o=this.scans[u];if(o.top>l.bottom)break;if(o.bottom>l.bottom){var i=o.clone();o.bottom=l.bottom,i.top=l.bottom+1,o.top>=o.bottom?this.scans[u]=i:(A.Helper.log("[emf] Region split bottom scan "+u+" for substraction"),this.scans.splice(++u,0,i));break}u++}if(a<this.scans.length){var b=u;for(u=a;u<b;){var o=this.scans[u];if(!o.subtract(l.left,l.right)){A.Helper.log("[emf] Region remove now empty scan "+u+" due to subtraction"),this.scans.splice(u,1),b--;continue}u++}}if(this.scans!=null){for(var v=void 0,_,T=void 0,k=void 0,M=this.scans.length,R=0;R<M;R++){var o=this.scans[R];R===0&&(_=o.top),R===M-1&&(k=o.bottom);var O=o.scanlines.length;if(O>0){var P=o.scanlines[0];(v==null||P.left<v)&&(v=P.left),P=o.scanlines[O-1],(T==null||P.right>T)&&(T=P.right)}}v!=null&&_!=null&&T!=null&&k!=null?(this.bounds=new r.RectL(null,v,_,T,k),this._updateComplexity()):(this.bounds=null,this.scans=null,this.complexity=0)}else this._updateComplexity()}A.Helper.log("[emf] Region subtraction -> "+this.toString())},s.prototype.intersect=function(l){if(A.Helper.log("[emf] Region "+this.toString()+" intersect with "+l.toString()),this.bounds!=null)if(this.bounds=this.bounds.intersect(l),this.bounds!=null){if(this.scans!=null){for(var u=0;u<this.scans.length;){var o=this.scans[u];if(o.bottom<this.bounds.top)u++;else break}for(u>0&&(A.Helper.log("[emf] Region remove "+u+" scans from top"),this.scans.splice(0,u),this.scans.length>0&&(this.scans[0].top=this.bounds.top)),u=0;u<this.scans.length;){var o=this.scans[u];if(o.top>this.bounds.bottom){A.Helper.log("[emf] Region remove "+(this.scans.length-u)+" scans from bottom"),this.scans.splice(u,this.scans.length-u);break}if(!o.intersect(this.bounds.left,this.bounds.right)){A.Helper.log("[emf] Region remove now empty scan "+u+" due to intersection"),this.scans.splice(u,1);continue}u++}this.scans.length>0&&(this.scans[this.scans.length-1].bottom=this.bounds.bottom),this._updateComplexity()}}else this.scans=null,this.complexity=0;A.Helper.log("[emf] Region intersection -> "+this.toString())},s.prototype.offset=function(l,u){if(this.bounds!=null&&(this.bounds.left+=l,this.bounds.top+=u,this.bounds.right+=l,this.bounds.bottom+=u),this.scans!=null)for(var o=this.scans.length,i=0;i<o;i++){var a=this.scans[i];a.top+=u,a.bottom+=u;for(var b=a.scanlines.length,v=0;v<b;v++){var _=a.scanlines[v];_.left+=l,_.right+=l}}},s})(r.Obj);function t(c,s,l,u){var o=new e(null,null);return o.bounds=new r.RectL(null,c,s,l,u),o._updateComplexity(),o}var p=(function(){function c(s,l){if(s!=null)this.top=s.top,this.bottom=s.bottom,this.scanlines=[{left:s.left,right:s.right}];else if(l!=null){this.top=l.top,this.bottom=l.bottom,this.scanlines=[];for(var u=0;u<l.scanlines.length;u++){var o=l.scanlines[u];this.scanlines.push({left:o.left,right:o.right})}}}return c.prototype.clone=function(){return new c(null,this)},c.prototype.append=function(s){this.scanlines.push({left:s.left,right:s.right})},c.prototype.subtract=function(s,l){for(var u=0;u<this.scanlines.length;){var o=this.scanlines[u];if(o.left<=s){if(o.right>=s&&(o.right=s-1,o.left>=o.right)){this.scanlines.splice(u,1);continue}u++}else break}for(var i=u,a=0;u<this.scanlines.length;){var o=this.scanlines[u];if(o.right>l){o.left=l,a=u-i,o.left>=o.right&&a++;break}u++}return a>0&&i<this.scanlines.length&&this.scanlines.splice(i,a),this.scanlines.length>0},c.prototype.intersect=function(s,l){for(var u=0;u<this.scanlines.length;u++){var o=this.scanlines[u];if(o.left>=s||o.right>=s){u>0&&this.scanlines.splice(0,u);break}}if(this.scanlines.length>0){var o=this.scanlines[0];o.left<s&&(o.left=s);for(var u=0;u<this.scanlines.length;u++)if(o=this.scanlines[u],o.left>l){this.scanlines.splice(u,this.scanlines.length-u);break}this.scanlines.length>0&&(o=this.scanlines[this.scanlines.length-1],o.right>l&&(o.right=l))}return this.scanlines.length>0},c})()}),"./src/emfjs/Renderer.ts":((E,h,w)=>{w.r(h),w.d(h,{Renderer:()=>p});var A=w("./src/util/index.ts"),r=w("./src/emfjs/Blob.ts"),n=w("./src/emfjs/EMFRecords.ts"),e=w("./src/emfjs/GDIContext.ts"),t=w("./src/emfjs/Helper.ts"),p=(function(){function s(l){this.parse(l),t.Helper.log("EMFJS.Renderer instantiated")}return s.prototype.render=function(l){var u=document.createElementNS("http://www.w3.org/2000/svg","svg");return this._render(new A.SVG(u),l.mapMode,l.wExt,l.hExt,l.xExt,l.yExt),u.setAttribute("viewBox",[0,0,l.xExt,l.yExt].join(" ")),u.setAttribute("preserveAspectRatio","none"),u.setAttribute("width",l.width),u.setAttribute("height",l.height),u},s.prototype.parse=function(l){this._img=null;var u=new r.Blob(l);if(u.readUint32()!==1)throw new t.EMFJSError("Not an EMF file");var o=u.readUint32();if(o%4!==0)throw new t.EMFJSError("Not an EMF file");if(this._img=new c(u,o),this._img==null)throw new t.EMFJSError("Format not recognized")},s.prototype._render=function(l,u,o,i,a,b){var v=new e.GDIContext(l);v.setWindowExtEx(o,i),v.setViewportExtEx(a,b),v.setMapMode(u),t.Helper.log("[EMF] BEGIN RENDERING --->"),this._img.render(v),t.Helper.log("[EMF] <--- DONE RENDERING")},s})(),c=(function(){function s(l,u){this._hdrsize=u,this._records=new n.EMFRecords(l,this._hdrsize)}return s.prototype.render=function(l){this._records.play(l)},s})()}),"./src/emfjs/Style.ts":((E,h,w)=>{w.r(h),w.d(h,{Brush:()=>c,ColorRef:()=>t,Font:()=>p,Pen:()=>s});var A=w("./src/emfjs/Bitmap.ts"),r=w("./src/emfjs/Helper.ts"),n=w("./src/emfjs/Primitives.ts"),e=(function(){var l=function(u,o){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&(i[b]=a[b])},l(u,o)};return function(u,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");l(u,o);function i(){this.constructor=u}u.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)}})(),t=(function(){function l(u,o,i,a){u!=null?(this.r=u.readUint8(),this.g=u.readUint8(),this.b=u.readUint8(),u.skip(1)):(this.r=o,this.g=i,this.b=a)}return l.prototype.clone=function(){return new l(null,this.r,this.g,this.b)},l.prototype.toHex=function(){return(16777216+(this.r<<16|this.g<<8|this.b)).toString(16).slice(1)},l.prototype.toString=function(){return"{r: "+this.r+", g: "+this.g+", b: "+this.b+"}"},l})(),p=(function(l){e(u,l);function u(o,i){var a=l.call(this,"font")||this;if(o!=null){a.height=o.readInt32(),a.width=o.readInt32(),a.escapement=o.readInt32(),a.orientation=o.readInt32(),a.weight=o.readInt32(),a.italic=o.readUint8(),a.underline=o.readUint8(),a.strikeout=o.readUint8(),a.charset=o.readUint8(),a.outprecision=o.readUint8(),a.clipprecision=o.readUint8(),a.quality=o.readUint8();var b=o.readUint8();a.pitch=b&15,a.family=b>>6&3;var v=i,_=o.pos;a.facename=o.readFixedSizeUnicodeString(Math.min(v-(o.pos-_),32))}else i!=null?(i=i,a.height=i.height,a.width=i.width,a.escapement=i.escapement,a.orientation=i.orientation,a.weight=i.weight,a.italic=i.italic,a.underline=i.underline,a.strikeout=i.strikeout,a.charset=i.charset,a.outprecision=i.outprecision,a.clipprecision=i.clipprecision,a.quality=i.quality,a.pitch=i.pitch,a.family=i.family,a.facename=i.facename):(a.height=-80,a.width=0,a.escapement=0,a.orientation=0,a.weight=400,a.italic=0,a.underline=0,a.strikeout=0,a.charset=0,a.outprecision=0,a.clipprecision=0,a.quality=0,a.pitch=0,a.family=0,a.facename="Helvetica");return a}return u.prototype.clone=function(){return new u(null,this)},u.prototype.toString=function(){return JSON.stringify(this)},u})(n.Obj),c=(function(l){e(u,l);function u(o,i){var a=l.call(this,"brush")||this;if(o!=null){var b=o.pos;switch(a.style=o.readUint32(),a.style){case r.Helper.GDI.BrushStyle.BS_SOLID:a.color=new t(o);break;case r.Helper.GDI.BrushStyle.BS_PATTERN:a.pattern=new A.DIBitmap(o);break;case r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:a.dibpatternpt=new A.DIBitmap(o);break;case r.Helper.GDI.BrushStyle.BS_HATCHED:a.color=new t(o),a.hatchstyle=o.readUint32();break}o.seek(b+12)}else switch(a.style=i.style,a.style){case r.Helper.GDI.BrushStyle.BS_SOLID:a.color=i.color.clone();break;case r.Helper.GDI.BrushStyle.BS_PATTERN:a.pattern=i.pattern;break;case r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:a.dibpatternpt=i.dibpatternpt;break;case r.Helper.GDI.BrushStyle.BS_HATCHED:a.color=i.color.clone(),a.hatchstyle=i.hatchstyle;break}return a}return u.prototype.clone=function(){return new u(null,this)},u.prototype.toString=function(){var o="{style: "+this.style;switch(this.style){case r.Helper.GDI.BrushStyle.BS_SOLID:o+=", color: "+this.color.toString();break;case r.Helper.GDI.BrushStyle.BS_HATCHED:o+=", color: "+this.color.toString()+", hatchstyle: "+this.hatchstyle;break}return o+"}"},u})(n.Obj),s=(function(l){e(u,l);function u(o,i,a,b,v){var _=l.call(this,"pen")||this;return o!=null?i!=null?(_.style=o.readUint32()&255,_.width=o.readUint32(),_.brush=new c(o),_.color=_.brush.color!=null?_.brush.color.clone():new t(null,0,0,0)):(_.style=o.readUint32()&255,_.width=new n.PointL(o).x,_.color=new t(o)):(_.style=i,_.width=a,b!=null&&(_.color=b),v!=null&&(_.brush=v)),_}return u.prototype.clone=function(){return new u(null,this.style,this.width,this.color!=null?this.color.clone():null,this.brush!=null?this.brush.clone():null)},u.prototype.toString=function(){return"{style: "+this.style+", width: "+this.width+", color: "+(this.color!=null?this.color.toString():"none")+"}"},u})(n.Obj)}),"./src/util/SVG.ts":((E,h,w)=>{w.r(h),w.d(h,{SVG:()=>n,SVGFilters:()=>A,SVGPathBuilder:()=>r});var A=(function(){function e(){}return e.prototype.flood=function(t,p,c,s,l){var u=document.createElementNS("http://www.w3.org/2000/svg","feFlood");p&&u.setAttribute("id",p),u.setAttribute("flood-color",c),u.setAttribute("flood-opacity",s.toString()),t.appendChild(u)},e.prototype.composite=function(t,p,c,s,l,u,o,i,a){var b=document.createElementNS("http://www.w3.org/2000/svg","feComposite");p&&b.setAttribute("id",p),b.setAttribute("in",c),b.setAttribute("in2",s),t.appendChild(b)},e})(),r=(function(){function e(){this._path=""}return e.prototype.move=function(t,p){this._path+=" M ".concat(t," ").concat(p)},e.prototype.path=function(){return this._path.substr(1)},e.prototype.line=function(t){var p=this;t.forEach(function(c){p._path+=" L ".concat(c[0]," ").concat(c[1])})},e.prototype.curveC=function(t,p,c,s,l,u){this._path+=" C ".concat(t," ").concat(p,", ").concat(c," ").concat(s,", ").concat(l," ").concat(u)},e.prototype.close=function(){this._path+=" Z"},e})(),n=(function(){function e(t){this.filters=new A,this._defs=void 0,this._svg=t}return e.prototype.svg=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");return o.setAttribute("x",p.toString()),o.setAttribute("y",c.toString()),o.setAttribute("width",s.toString()),o.setAttribute("height",l.toString()),this._appendSettings(u,o),t!=null?t.appendChild(o):this._svg.appendChild(o),o},e.prototype.image=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.setAttribute("x",p.toString()),i.setAttribute("y",c.toString()),i.setAttribute("width",s.toString()),i.setAttribute("height",l.toString()),i.setAttributeNS("http://www.w3.org/1999/xlink","href",u),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.rect=function(t,p,c,s,l,u,o,i){var a=document.createElementNS("http://www.w3.org/2000/svg","rect");return a.setAttribute("x",p.toString()),a.setAttribute("y",c.toString()),a.setAttribute("width",s.toString()),a.setAttribute("height",l.toString()),u!==void 0&&(u instanceof Number?a.setAttribute("rx",u.toString()):u instanceof Object&&this._appendSettings(u,a)),o!==void 0&&a.setAttribute("ry",o.toString()),this._appendSettings(i,a),t.appendChild(a),a},e.prototype.line=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","line");return o.setAttribute("x1",p.toString()),o.setAttribute("y1",c.toString()),o.setAttribute("x2",s.toString()),o.setAttribute("y2",l.toString()),this._appendSettings(u,o),t.appendChild(o),o},e.prototype.polygon=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","polygon");return s.setAttribute("points",p.map(function(l){return l.join(",")}).join(" ")),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.polyline=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","polyline");return s.setAttribute("points",p.map(function(l){return l.join(",")}).join(" ")),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.ellipse=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return o.setAttribute("cx",p.toString()),o.setAttribute("cy",c.toString()),o.setAttribute("rx",s.toString()),o.setAttribute("ry",l.toString()),this._appendSettings(u,o),t.appendChild(o),o},e.prototype.path=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",p.path()),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.text=function(t,p,c,s,l){var u=document.createElementNS("http://www.w3.org/2000/svg","text");u.setAttribute("x",p.toString()),u.setAttribute("y",c.toString()),this._appendSettings(l,u);var o=document.createTextNode(s);return u.appendChild(o),t.appendChild(u),u},e.prototype.filter=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","filter");return i.setAttribute("x",c.toString()),i.setAttribute("y",s.toString()),i.setAttribute("width",l.toString()),i.setAttribute("height",u.toString()),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.pattern=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","pattern");return p&&i.setAttribute("id",p),i.setAttribute("x",c.toString()),i.setAttribute("y",s.toString()),i.setAttribute("width",l.toString()),i.setAttribute("height",u.toString()),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.defs=function(){if(this._defs===void 0){var t=document.createElementNS("http://www.w3.org/2000/svg","defs");this._svg.appendChild(t),this._defs=t}return this._defs},e.prototype.clipPath=function(t,p,c,s){var l=document.createElementNS("http://www.w3.org/2000/svg","clipPath");return p&&l.setAttribute("id",p),c===void 0&&(c="userSpaceOnUse"),l.setAttribute("clipPathUnits",c),this._appendSettings(s,l),t.appendChild(l),l},e.prototype.createPath=function(){return new r},e.prototype._appendSettings=function(t,p){t!==void 0&&Object.keys(t).forEach(function(c){p.setAttribute(c,t[c])})},e})()}),"./src/util/index.ts":((E,h,w)=>{w.r(h),w.d(h,{SVG:()=>A.SVG});var A=w("./src/util/SVG.ts")})},f={};function g(E){var h=f[E];if(h!==void 0)return h.exports;var w=f[E]={exports:{}};return d[E](w,w.exports,g),w.exports}g.d=(E,h)=>{for(var w in h)g.o(h,w)&&!g.o(E,w)&&Object.defineProperty(E,w,{enumerable:!0,get:h[w]})},g.o=(E,h)=>Object.prototype.hasOwnProperty.call(E,h),g.r=E=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(E,"__esModule",{value:!0})};var y={};return(()=>{g.r(y),g.d(y,{Error:()=>h.EMFJSError,Renderer:()=>E.Renderer,loggingEnabled:()=>h.loggingEnabled});var E=g("./src/emfjs/Renderer.ts"),h=g("./src/emfjs/Helper.ts")})(),y})())})),po=We(((m,C)=>{(function(f,g){typeof m=="object"&&typeof C=="object"?C.exports=g():typeof define=="function"&&define.amd?define([],g):typeof m=="object"?m.WMFJS=g():f.WMFJS=g()})(m,()=>(()=>{"use strict";var d={"./src/util/SVG.ts":((E,h,w)=>{w.r(h),w.d(h,{SVG:()=>n,SVGFilters:()=>A,SVGPathBuilder:()=>r});var A=(function(){function e(){}return e.prototype.flood=function(t,p,c,s,l){var u=document.createElementNS("http://www.w3.org/2000/svg","feFlood");p&&u.setAttribute("id",p),u.setAttribute("flood-color",c),u.setAttribute("flood-opacity",s.toString()),t.appendChild(u)},e.prototype.composite=function(t,p,c,s,l,u,o,i,a){var b=document.createElementNS("http://www.w3.org/2000/svg","feComposite");p&&b.setAttribute("id",p),b.setAttribute("in",c),b.setAttribute("in2",s),t.appendChild(b)},e})(),r=(function(){function e(){this._path=""}return e.prototype.move=function(t,p){this._path+=" M ".concat(t," ").concat(p)},e.prototype.path=function(){return this._path.substr(1)},e.prototype.line=function(t){var p=this;t.forEach(function(c){p._path+=" L ".concat(c[0]," ").concat(c[1])})},e.prototype.curveC=function(t,p,c,s,l,u){this._path+=" C ".concat(t," ").concat(p,", ").concat(c," ").concat(s,", ").concat(l," ").concat(u)},e.prototype.close=function(){this._path+=" Z"},e})(),n=(function(){function e(t){this.filters=new A,this._defs=void 0,this._svg=t}return e.prototype.svg=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");return o.setAttribute("x",p.toString()),o.setAttribute("y",c.toString()),o.setAttribute("width",s.toString()),o.setAttribute("height",l.toString()),this._appendSettings(u,o),t!=null?t.appendChild(o):this._svg.appendChild(o),o},e.prototype.image=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.setAttribute("x",p.toString()),i.setAttribute("y",c.toString()),i.setAttribute("width",s.toString()),i.setAttribute("height",l.toString()),i.setAttributeNS("http://www.w3.org/1999/xlink","href",u),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.rect=function(t,p,c,s,l,u,o,i){var a=document.createElementNS("http://www.w3.org/2000/svg","rect");return a.setAttribute("x",p.toString()),a.setAttribute("y",c.toString()),a.setAttribute("width",s.toString()),a.setAttribute("height",l.toString()),u!==void 0&&(u instanceof Number?a.setAttribute("rx",u.toString()):u instanceof Object&&this._appendSettings(u,a)),o!==void 0&&a.setAttribute("ry",o.toString()),this._appendSettings(i,a),t.appendChild(a),a},e.prototype.line=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","line");return o.setAttribute("x1",p.toString()),o.setAttribute("y1",c.toString()),o.setAttribute("x2",s.toString()),o.setAttribute("y2",l.toString()),this._appendSettings(u,o),t.appendChild(o),o},e.prototype.polygon=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","polygon");return s.setAttribute("points",p.map(function(l){return l.join(",")}).join(" ")),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.polyline=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","polyline");return s.setAttribute("points",p.map(function(l){return l.join(",")}).join(" ")),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.ellipse=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return o.setAttribute("cx",p.toString()),o.setAttribute("cy",c.toString()),o.setAttribute("rx",s.toString()),o.setAttribute("ry",l.toString()),this._appendSettings(u,o),t.appendChild(o),o},e.prototype.path=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",p.path()),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.text=function(t,p,c,s,l){var u=document.createElementNS("http://www.w3.org/2000/svg","text");u.setAttribute("x",p.toString()),u.setAttribute("y",c.toString()),this._appendSettings(l,u);var o=document.createTextNode(s);return u.appendChild(o),t.appendChild(u),u},e.prototype.filter=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","filter");return i.setAttribute("x",c.toString()),i.setAttribute("y",s.toString()),i.setAttribute("width",l.toString()),i.setAttribute("height",u.toString()),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.pattern=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","pattern");return p&&i.setAttribute("id",p),i.setAttribute("x",c.toString()),i.setAttribute("y",s.toString()),i.setAttribute("width",l.toString()),i.setAttribute("height",u.toString()),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.defs=function(){if(this._defs===void 0){var t=document.createElementNS("http://www.w3.org/2000/svg","defs");this._svg.appendChild(t),this._defs=t}return this._defs},e.prototype.clipPath=function(t,p,c,s){var l=document.createElementNS("http://www.w3.org/2000/svg","clipPath");return p&&l.setAttribute("id",p),c===void 0&&(c="userSpaceOnUse"),l.setAttribute("clipPathUnits",c),this._appendSettings(s,l),t.appendChild(l),l},e.prototype.createPath=function(){return new r},e.prototype._appendSettings=function(t,p){t!==void 0&&Object.keys(t).forEach(function(c){p.setAttribute(c,t[c])})},e})()}),"./src/util/index.ts":((E,h,w)=>{w.r(h),w.d(h,{SVG:()=>A.SVG});var A=w("./src/util/SVG.ts")}),"./src/wmfjs/Bitmap.ts":((E,h,w)=>{w.r(h),w.d(h,{Bitmap16:()=>c,BitmapInfo:()=>t,DIBitmap:()=>p,PatternBitmap16:()=>s});var A=w("./src/wmfjs/Helper.ts"),r=(function(){var l=function(u,o){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&(i[b]=a[b])},l(u,o)};return function(u,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");l(u,o);function i(){this.constructor=u}u.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)}})(),n=(function(){function l(u,o){o&&u.skip(4),this.width=u.readUint16(),this.height=u.readUint16(),this.planes=u.readUint16(),this.bitcount=u.readUint16()}return l.prototype.colors=function(){return this.bitcount<=8?1<<this.bitcount:0},l})(),e=(function(){function l(u,o){o&&u.skip(4),this.width=u.readInt32(),this.height=u.readInt32(),this.planes=u.readUint16(),this.bitcount=u.readUint16(),this.compression=u.readUint32(),this.sizeimage=u.readUint32(),this.xpelspermeter=u.readInt32(),this.ypelspermeter=u.readInt32(),this.clrused=u.readUint32(),this.clrimportant=u.readUint32()}return l.prototype.colors=function(){return this.clrused!==0?this.clrused<256?this.clrused:256:this.bitcount>8?0:1<<this.bitcount},l})(),t=(function(){function l(u,o){this._reader=u,this._offset=u.pos,this._usergb=o;var i=u.readUint32();if(this._infosize=i,i===A.Helper.GDI.BITMAPCOREHEADER_SIZE)this._header=new n(u,!1),this._infosize+=this._header.colors()*(o?3:2);else{this._header=new e(u,!1);var a=this._header.compression===A.Helper.GDI.BitmapCompression.BI_BITFIELDS?3:0;i<=A.Helper.GDI.BITMAPINFOHEADER_SIZE+a*4&&(this._infosize=A.Helper.GDI.BITMAPINFOHEADER_SIZE+a*4),this._infosize+=this._header.colors()*(o?4:2)}}return l.prototype.getWidth=function(){return this._header.width},l.prototype.getHeight=function(){return Math.abs(this._header.height)},l.prototype.infosize=function(){return this._infosize},l.prototype.header=function(){return this._header},l})(),p=(function(){function l(u,o){this._reader=u,this._offset=u.pos,this._size=o,this._info=new t(u,!0)}return l.prototype.getWidth=function(){return this._info.getWidth()},l.prototype.getHeight=function(){return this._info.getHeight()},l.prototype.base64ref=function(){var u=this._reader.pos;this._reader.seek(this._offset);var o="image/bmp",i=this._info.header(),a;if(i instanceof e&&i.compression!=null)switch(i.compression){case A.Helper.GDI.BitmapCompression.BI_JPEG:o="data:image/jpeg";break;case A.Helper.GDI.BitmapCompression.BI_PNG:o="data:image/png";break;default:a=this.makeBitmapFileHeader();break}else a=this.makeBitmapFileHeader();a!=null?a+=this._reader.readBinary(this._size):a=this._reader.readBinary(this._size);var b="data:"+o+";base64,"+btoa(a);return this._reader.seek(u),b},l.prototype.makeBitmapFileHeader=function(){var u=new Uint8Array(new ArrayBuffer(14));return u[0]=66,u[1]=77,A.Helper._writeUint32Val(u,2,this._size+14),A.Helper._writeUint32Val(u,10,this._info.infosize()+14),A.Helper._blobToBinary(u)},l})(),c=(function(){function l(u,o){if(u!=null){if(o=o,this._reader=u,this._offset=u.pos,this._size=o,this.type=u.readInt16(),this.width=u.readInt16(),this.height=u.readInt16(),this.widthBytes=u.readInt16(),this.planes=u.readUint8(),this.bitsPixel=u.readUint8(),this.bitsOffset=u.pos,this.bitsSize=(this.width*this.bitsPixel+15>>4<<1)*this.height,this.bitsSize>o-10)throw new A.WMFJSError("Bitmap should have "+this.bitsSize+" bytes, but has "+(o-10))}else{var i=o;this._reader=i._reader,this._offset=i._offset,this._size=i._size,this.type=i.type,this.width=i.width,this.height=i.height,this.widthBytes=i.widthBytes,this.planes=i.planes,this.bitsPixel=i.bitsPixel,this.bitsOffset=i.bitsOffset,this.bitsSize=i.bitsSize}}return l.prototype.getWidth=function(){return this.width},l.prototype.getHeight=function(){return this.height},l.prototype.clone=function(){return new l(null,this)},l})(),s=(function(l){r(u,l);function u(o,i){var a=l.call(this,o,i)||this;return o!=null&&(a.bitsOffset+=22),a}return u.prototype.clone=function(){return new u(null,this)},u})(c)}),"./src/wmfjs/Blob.ts":((E,h,w)=>{w.r(h),w.d(h,{Blob:()=>r});var A=w("./src/wmfjs/Helper.ts"),r=(function(){function n(e,t){e instanceof n?(this.blob=e.blob,this.data=e.data,this.pos=t||e.pos):(this.blob=e,this.data=new Uint8Array(e),this.pos=t||0)}return n.prototype.eof=function(){return this.pos>=this.data.length},n.prototype.seek=function(e){if(e<0||e>this.data.length)throw new A.WMFJSError("Invalid seek position");this.pos=e},n.prototype.skip=function(e){var t=this.pos+e;if(t>this.data.length)throw new A.WMFJSError("Unexpected end of file");this.pos=t},n.prototype.readBinary=function(e){if(this.pos+e>this.data.length)throw new A.WMFJSError("Unexpected end of file");for(var t="";e-- >0;)t+=String.fromCharCode(this.data[this.pos++]);return t},n.prototype.readInt8=function(){if(this.pos+1>this.data.length)throw new A.WMFJSError("Unexpected end of file");return this.data[this.pos++]},n.prototype.readUint8=function(){return this.readInt8()>>>0},n.prototype.readInt32=function(){if(this.pos+4>this.data.length)throw new A.WMFJSError("Unexpected end of file");var e=this.data[this.pos++];return e|=this.data[this.pos++]<<8,e|=this.data[this.pos++]<<16,e|=this.data[this.pos++]<<24,e},n.prototype.readUint32=function(){return this.readInt32()>>>0},n.prototype.readUint16=function(){if(this.pos+2>this.data.length)throw new A.WMFJSError("Unexpected end of file");var e=this.data[this.pos++];return e|=this.data[this.pos++]<<8,e},n.prototype.readInt16=function(){var e=this.readUint16();return e>32767&&(e-=65536),e},n.prototype.readString=function(e){if(this.pos+e>this.data.length)throw new A.WMFJSError("Unexpected end of file");for(var t="",p=0;p<e;p++)t+=String.fromCharCode(this.data[this.pos++]>>>0);return t},n.prototype.readNullTermString=function(e){var t="";if(e>0){e--;for(var p=0;p<e;p++){if(this.pos+p+1>this.data.length)throw new A.WMFJSError("Unexpected end of file");var c=this.data[this.pos+p]>>>0;if(c===0)break;t+=String.fromCharCode(c)}}return t},n})()}),"./src/wmfjs/GDIContext.ts":((E,h,w)=>{w.r(h),w.d(h,{GDIContext:()=>p});var A=w("./src/wmfjs/Helper.ts"),r=w("./src/wmfjs/Primitives.ts"),n=w("./src/wmfjs/Region.ts"),e=w("./src/wmfjs/Style.ts"),t=(function(){function c(s,l){if(s!=null){this._svggroup=s._svggroup,this._svgclipChanged=s._svgclipChanged,this._svgtextbkfilter=s._svgtextbkfilter,this.mapmode=s.mapmode,this.stretchmode=s.stretchmode,this.textalign=s.textalign,this.bkmode=s.bkmode,this.textcolor=s.textcolor.clone(),this.bkcolor=s.bkcolor.clone(),this.polyfillmode=s.polyfillmode,this.wx=s.wx,this.wy=s.wy,this.ww=s.ww,this.wh=s.wh,this.vx=s.vx,this.vy=s.vy,this.vw=s.vw,this.vh=s.vh,this.x=s.x,this.y=s.y,this.clip=s.clip,this.ownclip=!1,this.selected={};for(var u in s.selected)this.selected[u]=s.selected[u]}else{this._svggroup=null,this._svgclipChanged=!1,this._svgtextbkfilter=null,this.mapmode=A.Helper.GDI.MapMode.MM_ANISOTROPIC,this.stretchmode=A.Helper.GDI.StretchMode.COLORONCOLOR,this.textalign=0,this.bkmode=A.Helper.GDI.MixMode.OPAQUE,this.textcolor=new e.ColorRef(null,0,0,0),this.bkcolor=new e.ColorRef(null,255,255,255),this.polyfillmode=A.Helper.GDI.PolyFillMode.ALTERNATE,this.wx=0,this.wy=0,this.ww=0,this.wh=0,this.vx=0,this.vy=0,this.vw=0,this.vh=0,this.x=0,this.y=0,this.clip=null,this.ownclip=!1,this.selected={};for(var u in l){var o=l[u];this.selected[u]=o!=null?o.clone():null}}}return c})(),p=(function(){function c(s){this._svg=s,this._svgdefs=null,this._svgPatterns={},this._svgClipPaths={},this.defObjects={brush:new e.Brush(null,null),pen:new e.Pen(null,A.Helper.GDI.PenStyle.PS_SOLID,new r.PointS(null,1,1),new e.ColorRef(null,0,0,0),0,0),font:new e.Font(null,null),palette:null,region:null},this.state=new t(null,this.defObjects),this.statestack=[this.state],this.objects={}}return c.prototype.setMapMode=function(s){A.Helper.log("[gdi] setMapMode: mode="+s),this.state.mapmode=s,this.state._svggroup=null},c.prototype.setWindowOrg=function(s,l){A.Helper.log("[gdi] setWindowOrg: x="+s+" y="+l),this.state.wx=s,this.state.wy=l,this.state._svggroup=null},c.prototype.setWindowExt=function(s,l){A.Helper.log("[gdi] setWindowExt: x="+s+" y="+l),this.state.ww=s,this.state.wh=l,this.state._svggroup=null},c.prototype.offsetWindowOrg=function(s,l){A.Helper.log("[gdi] offsetWindowOrg: offX="+s+" offY="+l),this.state.wx+=s,this.state.wy+=l,this.state._svggroup=null},c.prototype.setViewportOrg=function(s,l){A.Helper.log("[gdi] setViewportOrg: x="+s+" y="+l),this.state.vx=s,this.state.vy=l,this.state._svggroup=null},c.prototype.setViewportExt=function(s,l){A.Helper.log("[gdi] setViewportExt: x="+s+" y="+l),this.state.vw=s,this.state.vh=l,this.state._svggroup=null},c.prototype.offsetViewportOrg=function(s,l){A.Helper.log("[gdi] offsetViewportOrg: offX="+s+" offY="+l),this.state.vx+=s,this.state.vy+=l,this.state._svggroup=null},c.prototype.saveDC=function(){A.Helper.log("[gdi] saveDC");var s=this.state;this.state=new t(this.state),this.statestack.push(s),this.state._svggroup=null},c.prototype.restoreDC=function(s){if(A.Helper.log("[gdi] restoreDC: saved="+s),this.statestack.length>1)if(s===-1)this.state=this.statestack.pop();else{if(s<-1)throw new A.WMFJSError("restoreDC: relative restore not implemented");if(s>1)throw new A.WMFJSError("restoreDC: absolute restore not implemented")}else throw new A.WMFJSError("No saved contexts");this.state._svggroup=null},c.prototype.escape=function(s,l,u,o){A.Helper.log("[gdi] escape: func="+s+" offset="+u+" count="+o)},c.prototype.setStretchBltMode=function(s){A.Helper.log("[gdi] setStretchBltMode: stretchMode="+s)},c.prototype.stretchDib=function(s,l,u,o,i,a,b,v,_,T,k){A.Helper.log("[gdi] stretchDib: srcX="+s+" srcY="+l+" srcW="+u+" srcH="+o+" dstX="+i+" dstY="+a+" dstW="+b+" dstH="+v+" rasterOp=0x"+_.toString(16)),s=this._todevX(s),l=this._todevY(l),u=this._todevW(u),o=this._todevH(o),i=this._todevX(i),a=this._todevY(a),b=this._todevW(b),v=this._todevH(v),A.Helper.log("[gdi] stretchDib: TRANSLATED: srcX="+s+" srcY="+l+" srcW="+u+" srcH="+o+" dstX="+i+" dstY="+a+" dstW="+b+" dstH="+v+" rasterOp=0x"+_.toString(16)+" colorUsage=0x"+T.toString(16)),this._pushGroup(),this._svg.image(this.state._svggroup,i,a,b,v,k.base64ref())},c.prototype.dibBits=function(s,l,u,o,i,a,b,v){A.Helper.log("[gdi] stretchDibBits: srcX="+s+" srcY="+l+" dstX="+u+" dstY="+o+" width="+i+" height="+a+" rasterOp=0x"+b.toString(16)),s=this._todevX(s),l=this._todevY(l),u=this._todevX(u),o=this._todevY(o),i=this._todevW(i),a=this._todevH(a),A.Helper.log("[gdi] dibBits: TRANSLATED: srcX="+s+" srcY="+l+NaN+u+" dstY="+o+" width="+i+" height="+a+" rasterOp=0x"+b.toString(16)),this._pushGroup(),this._svg.image(this.state._svggroup,u,o,i,a,v.base64ref())},c.prototype.stretchDibBits=function(s,l,u,o,i,a,b,v,_,T){A.Helper.log("[gdi] stretchDibBits: srcX="+s+" srcY="+l+" srcW="+u+" srcH="+o+" dstX="+i+" dstY="+a+" dstW="+b+" dstH="+v+" rasterOp=0x"+_.toString(16)),s=this._todevX(s),l=this._todevY(l),u=this._todevW(u),o=this._todevH(o),i=this._todevX(i),a=this._todevY(a),b=this._todevW(b),v=this._todevH(v),A.Helper.log("[gdi] stretchDibBits: TRANSLATED: srcX="+s+" srcY="+l+" srcW="+u+" srcH="+o+" dstX="+i+" dstY="+a+" dstW="+b+" dstH="+v+" rasterOp=0x"+_.toString(16)),this._pushGroup(),this._svg.image(this.state._svggroup,i,a,b,v,T.base64ref())},c.prototype.rectangle=function(s,l,u){A.Helper.log("[gdi] rectangle: rect="+s.toString()+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());var o=this._todevY(s.bottom),i=this._todevX(s.right),a=this._todevY(s.top),b=this._todevX(s.left);l=this._todevH(l),u=this._todevH(u),A.Helper.log("[gdi] rectangle: TRANSLATED: bottom="+o+" right="+i+" top="+a+" left="+b+" rh="+u+" rw="+l),this._pushGroup();var v=this._applyOpts(null,!0,!0,!1);this._svg.rect(this.state._svggroup,b,a,i-b,o-a,l/2,u/2,v)},c.prototype.textOut=function(s,l,u){A.Helper.log("[gdi] textOut: x="+s+" y="+l+" text="+u+" with font "+this.state.selected.font.toString()),s=this._todevX(s),l=this._todevY(l),A.Helper.log("[gdi] textOut: TRANSLATED: x="+s+" y="+l),this._pushGroup();var o=this._applyOpts(null,!1,!1,!0);if(this.state.selected.font.escapement!==0&&(o.transform="rotate("+[-this.state.selected.font.escapement/10,s,l]+")",o.style="dominant-baseline: middle; text-anchor: start;"),this.state.bkmode===A.Helper.GDI.MixMode.OPAQUE){if(this.state._svgtextbkfilter==null){var i=A.Helper._makeUniqueId("f"),a=this._svg.filter(this._getSvgDef(),i,0,0,1,1);this._svg.filters.flood(a,null,"#"+this.state.bkcolor.toHex(),1),this._svg.filters.composite(a,null,null,"SourceGraphic"),this.state._svgtextbkfilter=a}o.filter="url(#"+this.state._svgtextbkfilter.id+")"}this._svg.text(this.state._svggroup,s,l,u,o)},c.prototype.extTextOut=function(s,l,u,o,i,a){A.Helper.log("[gdi] extTextOut: x="+s+" y="+l+" text="+u+" with font "+this.state.selected.font.toString()),s=this._todevX(s),l=this._todevY(l),A.Helper.log("[gdi] extTextOut: TRANSLATED: x="+s+" y="+l),this._pushGroup();var b=this._applyOpts(null,!1,!1,!0);if(this.state.selected.font.escapement!==0&&(b.transform="rotate("+[-this.state.selected.font.escapement/10,s,l]+")",b.style="dominant-baseline: middle; text-anchor: start;"),this.state.bkmode===A.Helper.GDI.MixMode.OPAQUE){if(this.state._svgtextbkfilter==null){var v=A.Helper._makeUniqueId("f"),_=this._svg.filter(this._getSvgDef(),v,0,0,1,1);this._svg.filters.flood(_,null,"#"+this.state.bkcolor.toHex(),1),this._svg.filters.composite(_,null,null,"SourceGraphic"),this.state._svgtextbkfilter=_}b.filter="url(#"+this.state._svgtextbkfilter.id+")"}this._svg.text(this.state._svggroup,s,l,u,b)},c.prototype.lineTo=function(s,l){A.Helper.log("[gdi] lineTo: x="+s+" y="+l+" with pen "+this.state.selected.pen.toString());var u=this._todevX(s),o=this._todevY(l),i=this._todevX(this.state.x),a=this._todevY(this.state.y);this.state.x=s,this.state.y=l,A.Helper.log("[gdi] lineTo: TRANSLATED: toX="+u+" toY="+o+" fromX="+i+" fromY="+a),this._pushGroup();var b=this._applyOpts(null,!0,!1,!1);this._svg.line(this.state._svggroup,i,a,u,o,b)},c.prototype.moveTo=function(s,l){A.Helper.log("[gdi] moveTo: x="+s+" y="+l),this.state.x=s,this.state.y=l},c.prototype.polygon=function(s,l){A.Helper.log("[gdi] polygon: points="+s+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());for(var u=[],o=0;o<s.length;o++){var i=s[o];u.push([this._todevX(i.x),this._todevY(i.y)])}A.Helper.log("[gdi] polygon: TRANSLATED: pts="+u),l&&this._pushGroup();var a={"fill-rule":this.state.polyfillmode===A.Helper.GDI.PolyFillMode.ALTERNATE?"evenodd":"nonzero"};this._applyOpts(a,!0,!0,!1),this._svg.polygon(this.state._svggroup,u,a)},c.prototype.polyPolygon=function(s){A.Helper.log("[gdi] polyPolygon: polygons.length="+s.length+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());for(var l=s.length,u=0;u<l;u++)this.polygon(s[u],u===0)},c.prototype.polyline=function(s){A.Helper.log("[gdi] polyline: points="+s+" with pen "+this.state.selected.pen.toString());for(var l=[],u=0;u<s.length;u++){var o=s[u];l.push([this._todevX(o.x),this._todevY(o.y)])}A.Helper.log("[gdi] polyline: TRANSLATED: pts="+l),this._pushGroup();var i=this._applyOpts({fill:"none"},!0,!1,!1);this._svg.polyline(this.state._svggroup,l,i)},c.prototype.ellipse=function(s){A.Helper.log("[gdi] ellipse: rect="+s.toString()+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());var l=this._todevY(s.bottom),u=this._todevX(s.right),o=this._todevY(s.top),i=this._todevX(s.left);A.Helper.log("[gdi] ellipse: TRANSLATED: bottom="+l+" right="+u+" top="+o+" left="+i),this._pushGroup();var a=(u-i)/2,b=(l-o)/2,v=this._applyOpts(null,!0,!0,!1);this._svg.ellipse(this.state._svggroup,i+a,o+b,a,b,v)},c.prototype.excludeClipRect=function(s){A.Helper.log("[gdi] excludeClipRect: rect="+s.toString()),this._getClipRgn().subtract(s)},c.prototype.intersectClipRect=function(s){A.Helper.log("[gdi] intersectClipRect: rect="+s.toString()),this._getClipRgn().intersect(s)},c.prototype.offsetClipRgn=function(s,l){A.Helper.log("[gdi] offsetClipRgn: offX="+s+" offY="+l),this._getClipRgn().offset(s,l)},c.prototype.setTextAlign=function(s){A.Helper.log("[gdi] setTextAlign: textAlignmentMode=0x"+s.toString(16)),this.state.textalign=s},c.prototype.setBkMode=function(s){A.Helper.log("[gdi] setBkMode: bkMode=0x"+s.toString(16)),this.state.bkmode=s},c.prototype.setTextColor=function(s){A.Helper.log("[gdi] setTextColor: textColor="+s.toString()),this.state.textcolor=s},c.prototype.setBkColor=function(s){A.Helper.log("[gdi] setBkColor: bkColor="+s.toString()),this.state.bkcolor=s,this.state._svgtextbkfilter=null},c.prototype.setPolyFillMode=function(s){A.Helper.log("[gdi] setPolyFillMode: polyFillMode="+s),this.state.polyfillmode=s},c.prototype.createBrush=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createBrush: brush="+s.toString()+" with handle "+l)},c.prototype.createFont=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createFont: font="+s.toString()+" with handle "+l)},c.prototype.createPen=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createPen: pen="+s.toString()+" width handle "+l)},c.prototype.createPalette=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createPalette: palette="+s.toString()+" width handle "+l)},c.prototype.createRegion=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createRegion: region="+s.toString()+" width handle "+l)},c.prototype.createPatternBrush=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createRegion: region="+s.toString()+" width handle "+l)},c.prototype.selectObject=function(s,l){var u=this._getObject(s);u!=null&&(l==null||u.type===l)?(this._selectObject(u),A.Helper.log("[gdi] selectObject: objIdx="+s+(u?" selected "+u.type+": "+u.toString():"[invalid index]"))):A.Helper.log("[gdi] selectObject: objIdx="+s+(u?" invalid object type: "+u.type:"[invalid index]"))},c.prototype.deleteObject=function(s){var l=this._deleteObject(s);A.Helper.log("[gdi] deleteObject: objIdx="+s+(l?" deleted object":"[invalid index]"))},c.prototype._pushGroup=function(){if(this.state._svggroup==null||this.state._svgclipChanged){this.state._svgclipChanged=!1,this.state._svgtextbkfilter=null;var s={viewBox:[this.state.vx,this.state.vy,this.state.vw,this.state.vh].join(" "),preserveAspectRatio:"none"};this.state.clip!=null?(A.Helper.log("[gdi] new svg x="+this.state.vx+" y="+this.state.vy+" width="+this.state.vw+" height="+this.state.vh+" with clipping"),s["clip-path"]="url(#"+this._getSvgClipPathForRegion(this.state.clip)+")"):A.Helper.log("[gdi] new svg x="+this.state.vx+" y="+this.state.vy+" width="+this.state.vw+" height="+this.state.vh+" without clipping"),this.state._svggroup=this._svg.svg(this.state._svggroup,this.state.vx,this.state.vy,this.state.vw,this.state.vh,s)}},c.prototype._storeObject=function(s){for(var l=0;this.objects[l.toString()]!=null&&l<=65535;)l++;return l>65535?(A.Helper.log("[gdi] Too many objects!"),-1):(this.objects[l.toString()]=s,l)},c.prototype._getObject=function(s){var l=this.objects[s.toString()];return l==null&&A.Helper.log("[gdi] No object with handle "+s),l},c.prototype._getSvgDef=function(){return this._svgdefs==null&&(this._svgdefs=this._svg.defs()),this._svgdefs},c.prototype._getSvgClipPathForRegion=function(s){for(var l in this._svgClipPaths)if(this._svgClipPaths[l]===s)return l;var u=A.Helper._makeUniqueId("c"),o=this._svg.clipPath(this._getSvgDef(),u,"userSpaceOnUse");switch(s.complexity){case 1:this._svg.rect(o,this._todevX(s.bounds.left),this._todevY(s.bounds.top),this._todevW(s.bounds.right-s.bounds.left),this._todevH(s.bounds.bottom-s.bounds.top),{fill:"black","stroke-width":0});break;case 2:for(var i=0;i<s.scans.length;i++)for(var a=s.scans[i],b=0;b<a.scanlines.length;b++){var v=a.scanlines[b];this._svg.rect(o,this._todevX(v.left),this._todevY(a.top),this._todevW(v.right-v.left),this._todevH(a.bottom-a.top),{fill:"black","stroke-width":0})}break}return this._svgClipPaths[u]=s,u},c.prototype._getSvgPatternForBrush=function(s){for(var l in this._svgPatterns)if(this._svgPatterns[l]===s)return l;var u,o,i;switch(s.style){case A.Helper.GDI.BrushStyle.BS_PATTERN:u=s.pattern.getWidth(),o=s.pattern.getHeight();break;case A.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:u=s.dibpatternpt.getWidth(),o=s.dibpatternpt.getHeight(),i=s.dibpatternpt.base64ref();break;default:throw new A.WMFJSError("Invalid brush style")}var a=A.Helper._makeUniqueId("p"),b=this._svg.pattern(this._getSvgDef(),a,0,0,u,o,{patternUnits:"userSpaceOnUse"});return this._svg.image(b,0,0,u,o,i),this._svgPatterns[a]=s,a},c.prototype._selectObject=function(s){this.state.selected[s.type]=s,s.type==="region"&&(this.state._svgclipChanged=!0)},c.prototype._deleteObject=function(s){var l=this.objects[s.toString()];if(l!=null){for(var u=0;u<this.statestack.length;u++){var o=this.statestack[u];o.selected[l.type]===l&&(o.selected[l.type]=this.defObjects[l.type].clone())}return delete this.objects[s.toString()],!0}return A.Helper.log("[gdi] Cannot delete object with invalid handle "+s),!1},c.prototype._getClipRgn=function(){return this.state.clip!=null?this.state.ownclip||(this.state.clip=this.state.clip.clone()):this.state.selected.region!=null?this.state.clip=this.state.selected.region.clone():this.state.clip=(0,n.CreateSimpleRegion)(this.state.wx,this.state.wy,this.state.wx+this.state.ww,this.state.wy+this.state.wh),this.state.ownclip=!0,this.state.clip},c.prototype._todevX=function(s){return Math.floor((s-this.state.wx)*(this.state.vw/this.state.ww))+this.state.vx},c.prototype._todevY=function(s){return Math.floor((s-this.state.wy)*(this.state.vh/this.state.wh))+this.state.vy},c.prototype._todevW=function(s){return Math.floor(s*(this.state.vw/this.state.ww))+this.state.vx},c.prototype._todevH=function(s){return Math.floor(s*(this.state.vh/this.state.wh))+this.state.vy},c.prototype._tologicalX=function(s){return Math.floor((s-this.state.vx)/(this.state.vw/this.state.ww))+this.state.wx},c.prototype._tologicalY=function(s){return Math.floor((s-this.state.vy)/(this.state.vh/this.state.wh))+this.state.wy},c.prototype._tologicalW=function(s){return Math.floor(s/(this.state.vw/this.state.ww))+this.state.wx},c.prototype._tologicalH=function(s){return Math.floor(s/(this.state.vh/this.state.wh))+this.state.wy},c.prototype._applyOpts=function(s,l,u,o){if(s==null&&(s={}),l){var i=this.state.selected.pen;if(i.style!==A.Helper.GDI.PenStyle.PS_NULL){s.stroke="#"+i.color.toHex(),s["stroke-width"]=this._todevW(i.width.x);var a=void 0;(i.linecap&A.Helper.GDI.PenStyle.PS_ENDCAP_SQUARE)!==0?(s["stroke-linecap"]="square",a=1):(i.linecap&A.Helper.GDI.PenStyle.PS_ENDCAP_FLAT)!==0?(s["stroke-linecap"]="butt",a=s["stroke-width"]):(s["stroke-linecap"]="round",a=1),(i.join&A.Helper.GDI.PenStyle.PS_JOIN_BEVEL)!==0?s["stroke-linejoin"]="bevel":(i.join&A.Helper.GDI.PenStyle.PS_JOIN_MITER)!==0?s["stroke-linejoin"]="miter":s["stroke-linejoin"]="round";var b=s["stroke-width"]*4,v=s["stroke-width"]*2;switch(i.style){case A.Helper.GDI.PenStyle.PS_DASH:s["stroke-dasharray"]=[b,v].toString();break;case A.Helper.GDI.PenStyle.PS_DOT:s["stroke-dasharray"]=[a,v].toString();break;case A.Helper.GDI.PenStyle.PS_DASHDOT:s["stroke-dasharray"]=[b,v,a,v].toString();break;case A.Helper.GDI.PenStyle.PS_DASHDOTDOT:s["stroke-dasharray"]=[b,v,a,v,a,v].toString();break}}}if(u){var _=this.state.selected.brush;switch(_.style){case A.Helper.GDI.BrushStyle.BS_SOLID:s.fill="#"+_.color.toHex();break;case A.Helper.GDI.BrushStyle.BS_PATTERN:case A.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:s.fill="url(#"+this._getSvgPatternForBrush(_)+")";break;case A.Helper.GDI.BrushStyle.BS_NULL:s.fill="none";break;default:A.Helper.log("[gdi] unsupported brush style: "+_.style),s.fill="none";break}}if(o){var T=this.state.selected.font;s["font-family"]=T.facename,s["font-size"]=this._todevH(Math.abs(T.height)),s.fill="#"+this.state.textcolor.toHex()}return s},c})()}),"./src/wmfjs/Helper.ts":((E,h,w)=>{w.r(h),w.d(h,{Helper:()=>t,WMFJSError:()=>r,loggingEnabled:()=>e});var A=(function(){var p=function(c,s){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&(l[o]=u[o])},p(c,s)};return function(c,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");p(c,s);function l(){this.constructor=c}c.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}})(),r=(function(p){A(c,p);function c(s){var l=this.constructor,u=p.call(this,s)||this;return Object.setPrototypeOf(u,l.prototype),u}return c})(Error),n=!0;function e(p){n=p}var t=(function(){function p(){}return p.log=function(c){n&&console.log(c)},p._makeUniqueId=function(c){return"wmfjs_"+c+this._uniqueId++},p._writeUint32Val=function(c,s,l){c[s++]=l&255,c[s++]=l>>>8&255,c[s++]=l>>>16&255,c[s++]=l>>>24&255},p._blobToBinary=function(c){for(var s="",l=c.length,u=0;u<l;u++)s+=String.fromCharCode(c[u]);return s},p.GDI={METAHEADER_SIZE:18,BITMAPINFOHEADER_SIZE:40,BITMAPCOREHEADER_SIZE:12,MetafileType:{MEMORYMETAFILE:1,DISKMETAFILE:2},MetafileVersion:{METAVERSION100:256,METAVERSION300:768},RecordType:{META_EOF:0,META_REALIZEPALETTE:53,META_SETPALENTRIES:55,META_SETBKMODE:258,META_SETMAPMODE:259,META_SETROP2:260,META_SETRELABS:261,META_SETPOLYFILLMODE:262,META_SETSTRETCHBLTMODE:263,META_SETTEXTCHAREXTRA:264,META_RESTOREDC:295,META_RESIZEPALETTE:313,META_DIBCREATEPATTERNBRUSH:322,META_SETLAYOUT:329,META_SETBKCOLOR:513,META_SETTEXTCOLOR:521,META_OFFSETVIEWPORTORG:529,META_LINETO:531,META_MOVETO:532,META_OFFSETCLIPRGN:544,META_FILLREGION:552,META_SETMAPPERFLAGS:561,META_SELECTPALETTE:564,META_POLYGON:804,META_POLYLINE:805,META_SETTEXTJUSTIFICATION:522,META_SETWINDOWORG:523,META_SETWINDOWEXT:524,META_SETVIEWPORTORG:525,META_SETVIEWPORTEXT:526,META_OFFSETWINDOWORG:527,META_SCALEWINDOWEXT:1040,META_SCALEVIEWPORTEXT:1042,META_EXCLUDECLIPRECT:1045,META_INTERSECTCLIPRECT:1046,META_ELLIPSE:1048,META_FLOODFILL:1049,META_FRAMEREGION:1065,META_ANIMATEPALETTE:1078,META_TEXTOUT:1313,META_POLYPOLYGON:1336,META_EXTFLOODFILL:1352,META_RECTANGLE:1051,META_SETPIXEL:1055,META_ROUNDRECT:1564,META_PATBLT:1565,META_SAVEDC:30,META_PIE:2074,META_STRETCHBLT:2851,META_ESCAPE:1574,META_INVERTREGION:298,META_PAINTREGION:299,META_SELECTCLIPREGION:300,META_SELECTOBJECT:301,META_SETTEXTALIGN:302,META_ARC:2071,META_CHORD:2096,META_BITBLT:2338,META_EXTTEXTOUT:2610,META_SETDIBTODEV:3379,META_DIBBITBLT:2368,META_DIBSTRETCHBLT:2881,META_STRETCHDIB:3907,META_DELETEOBJECT:496,META_CREATEPALETTE:247,META_CREATEPATTERNBRUSH:505,META_CREATEPENINDIRECT:762,META_CREATEFONTINDIRECT:763,META_CREATEBRUSHINDIRECT:764,META_CREATEREGION:1791},MetafileEscapes:{NEWFRAME:1,ABORTDOC:2,NEXTBAND:3,SETCOLORTABLE:4,GETCOLORTABLE:5,FLUSHOUT:6,DRAFTMODE:7,QUERYESCSUPPORT:8,SETABORTPROC:9,STARTDOC:10,ENDDOC:11,GETPHYSPAGESIZE:12,GETPRINTINGOFFSET:13,GETSCALINGFACTOR:14,META_ESCAPE_ENHANCED_METAFILE:15,SETPENWIDTH:16,SETCOPYCOUNT:17,SETPAPERSOURCE:18,PASSTHROUGH:19,GETTECHNOLOGY:20,SETLINECAP:21,SETLINEJOIN:22,SETMITERLIMIT:23,BANDINFO:24,DRAWPATTERNRECT:25,GETVECTORPENSIZE:26,GETVECTORBRUSHSIZE:27,ENABLEDUPLEX:28,GETSETPAPERBINS:29,GETSETPRINTORIENT:30,ENUMPAPERBINS:31,SETDIBSCALING:32,EPSPRINTING:33,ENUMPAPERMETRICS:34,GETSETPAPERMETRICS:35,POSTSCRIPT_DATA:37,POSTSCRIPT_IGNORE:38,GETDEVICEUNITS:42,GETEXTENDEDTEXTMETRICS:256,GETPAIRKERNTABLE:258,EXTTEXTOUT:512,GETFACENAME:513,DOWNLOADFACE:514,METAFILE_DRIVER:2049,QUERYDIBSUPPORT:3073,BEGIN_PATH:4096,CLIP_TO_PATH:4097,END_PATH:4098,OPEN_CHANNEL:4110,DOWNLOADHEADER:4111,CLOSE_CHANNEL:4112,POSTSCRIPT_PASSTHROUGH:4115,ENCAPSULATED_POSTSCRIPT:4116,POSTSCRIPT_IDENTIFY:4117,POSTSCRIPT_INJECTION:4118,CHECKJPEGFORMAT:4119,CHECKPNGFORMAT:4120,GET_PS_FEATURESETTING:4121,MXDC_ESCAPE:4122,SPCLPASSTHROUGH2:4568},MapMode:{MM_TEXT:1,MM_LOMETRIC:2,MM_HIMETRIC:3,MM_LOENGLISH:4,MM_HIENGLISH:5,MM_TWIPS:6,MM_ISOTROPIC:7,MM_ANISOTROPIC:8},StretchMode:{BLACKONWHITE:1,WHITEONBLACK:2,COLORONCOLOR:3,HALFTONE:4},TextAlignmentMode:{TA_UPDATECP:1,TA_RIGHT:2,TA_CENTER:6,TA_BOTTOM:8,TA_BASELINE:24,TA_RTLREADING:256},MixMode:{TRANSPARENT:1,OPAQUE:2},VerticalTextAlignmentMode:{VTA_BOTTOM:2,VTA_CENTER:6,VTA_LEFT:8,VTA_BASELINE:24},BrushStyle:{BS_SOLID:0,BS_NULL:1,BS_HATCHED:2,BS_PATTERN:3,BS_INDEXED:4,BS_DIBPATTERN:5,BS_DIBPATTERNPT:6,BS_PATTERN8X8:7,BS_DIBPATTERN8X8:8,BS_MONOPATTERN:9},PenStyle:{PS_SOLID:0,PS_DASH:1,PS_DOT:2,PS_DASHDOT:3,PS_DASHDOTDOT:4,PS_NULL:5,PS_INSIDEFRAME:6,PS_USERSTYLE:7,PS_ALTERNATE:8,PS_ENDCAP_SQUARE:256,PS_ENDCAP_FLAT:512,PS_JOIN_BEVEL:4096,PS_JOIN_MITER:8192},PolyFillMode:{ALTERNATE:1,WINDING:2},ColorUsage:{DIB_RGB_COLORS:0,DIB_PAL_COLORS:1,DIB_PAL_INDICES:2},PaletteEntryFlag:{PC_RESERVED:1,PC_EXPLICIT:2,PC_NOCOLLAPSE:4},BitmapCompression:{BI_RGB:0,BI_RLE8:1,BI_RLE4:2,BI_BITFIELDS:3,BI_JPEG:4,BI_PNG:5}},p._uniqueId=0,p})()}),"./src/wmfjs/Primitives.ts":((E,h,w)=>{w.r(h),w.d(h,{Obj:()=>e,PointS:()=>r,Rect:()=>n});var A=w("./src/wmfjs/Helper.ts"),r=(function(){function t(p,c,s){p!=null?(this.x=p.readInt16(),this.y=p.readInt16()):(this.x=c,this.y=s)}return t.prototype.clone=function(){return new t(null,this.x,this.y)},t.prototype.toString=function(){return"{x: "+this.x+", y: "+this.y+"}"},t})(),n=(function(){function t(p,c,s,l,u){p!=null?(this.bottom=p.readInt16(),this.right=p.readInt16(),this.top=p.readInt16(),this.left=p.readInt16()):(this.bottom=u,this.right=l,this.top=s,this.left=c)}return t.prototype.clone=function(){return new t(null,this.left,this.top,this.right,this.bottom)},t.prototype.toString=function(){return"{left: "+this.left+", top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+"}"},t.prototype.empty=function(){return this.left>=this.right||this.top>=this.bottom},t.prototype.intersect=function(p){return this.empty()||p.empty()||this.left>=p.right||this.top>=p.bottom||this.right<=p.left||this.bottom<=p.top?null:new t(null,Math.max(this.left,p.left),Math.max(this.top,p.top),Math.min(this.right,p.right),Math.min(this.bottom,p.bottom))},t})(),e=(function(){function t(p){this.type=p}return t.prototype.clone=function(){throw new A.WMFJSError("clone not implemented")},t.prototype.toString=function(){throw new A.WMFJSError("toString not implemented")},t})()}),"./src/wmfjs/Region.ts":((E,h,w)=>{w.r(h),w.d(h,{CreateSimpleRegion:()=>t,Region:()=>e,Scan:()=>p});var A=w("./src/wmfjs/Helper.ts"),r=w("./src/wmfjs/Primitives.ts"),n=(function(){var c=function(s,l){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,o){u.__proto__=o}||function(u,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(u[i]=o[i])},c(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");c(s,l);function u(){this.constructor=s}s.prototype=l===null?Object.create(l):(u.prototype=l.prototype,new u)}})(),e=(function(c){n(s,c);function s(l,u){var o=c.call(this,"region")||this;if(l!=null){if(l.skip(2),l.readInt16()!==6)throw new A.WMFJSError("Invalid region identifier");l.skip(2),l.readInt16();var i=l.readInt16();l.skip(2);var a=l.readInt16(),b=l.readInt16(),v=l.readInt16(),_=l.readInt16();o.bounds=new r.Rect(null,a,b,v,_),o.scans=[];for(var T=0;T<i;T++)o.scans.push(new p(l));o._updateComplexity()}else if(u!=null){if(o.bounds=u.bounds!=null?u.bounds.clone():null,u.scans!=null){o.scans=[];for(var T=0;T<u.scans.length;T++)o.scans.push(u.scans[T].clone())}else o.scans=null;o.complexity=u.complexity}else o.bounds=null,o.scans=null,o.complexity=0;return o}return s.prototype.clone=function(){return new s(null,this)},s.prototype.toString=function(){return"{complexity: "+["null","simple","complex"][this.complexity]+" bounds: "+(this.bounds!=null?this.bounds.toString():"[none]")+" #scans: "+(this.scans!=null?this.scans.length:"[none]")+"}"},s.prototype._updateComplexity=function(){if(this.bounds==null)this.complexity=0,this.scans=null;else if(this.bounds.empty())this.complexity=0,this.scans=null,this.bounds=null;else if(this.scans==null)this.complexity=1;else if(this.complexity=2,this.scans.length===1){var l=this.scans[0];if(l.top===this.bounds.top&&l.bottom===this.bounds.bottom&&l.scanlines.length===1){var u=l.scanlines[0];u.left===this.bounds.left&&u.right===this.bounds.right&&(this.scans=null,this.complexity=1)}}},s.prototype.subtract=function(l){if(A.Helper.log("[wmf] Region "+this.toString()+" subtract "+l.toString()),this.bounds!=null&&this.bounds.intersect(l)!=null){this.scans==null&&(this.scans=[],this.scans.push(new p(null,null,this.bounds.top,this.bounds.bottom,[{left:this.bounds.left,right:this.bounds.right}])),this.complexity=2);for(var u=0;u<this.scans.length;){var o=this.scans[u];if(o.bottom>=l.top){var i=o.clone();o.bottom=l.top-1,i.top=l.top,o.top>=o.bottom?this.scans[u]=i:(A.Helper.log("[wmf] Region split top scan "+u+" for substraction"),this.scans.splice(++u,0,i));break}u++}for(var a=u;u<this.scans.length;){var o=this.scans[u];if(o.top>l.bottom)break;if(o.bottom>l.bottom){var i=o.clone();o.bottom=l.bottom,i.top=l.bottom+1,o.top>=o.bottom?this.scans[u]=i:(A.Helper.log("[wmf] Region split bottom scan "+u+" for substraction"),this.scans.splice(++u,0,i));break}u++}if(a<this.scans.length){var b=u;for(u=a;u<b;){var o=this.scans[u];if(!o.subtract(l.left,l.right)){A.Helper.log("[wmf] Region remove now empty scan "+u+" due to subtraction"),this.scans.splice(u,1),b--;continue}u++}}if(this.scans!=null){for(var v=void 0,_,T=void 0,k=void 0,M=this.scans.length,R=0;R<M;R++){var o=this.scans[R];R===0&&(_=o.top),R===M-1&&(k=o.bottom);var O=o.scanlines.length;if(O>0){var P=o.scanlines[0];(v==null||P.left<v)&&(v=P.left),P=o.scanlines[O-1],(T==null||P.right>T)&&(T=P.right)}}v!=null&&_!=null&&T!=null&&k!=null?(this.bounds=new r.Rect(null,v,_,T,k),this._updateComplexity()):(this.bounds=null,this.scans=null,this.complexity=0)}else this._updateComplexity()}A.Helper.log("[wmf] Region subtraction -> "+this.toString())},s.prototype.intersect=function(l){if(A.Helper.log("[wmf] Region "+this.toString()+" intersect with "+l.toString()),this.bounds!=null)if(this.bounds=this.bounds.intersect(l),this.bounds!=null){if(this.scans!=null){for(var u=0;u<this.scans.length;){var o=this.scans[u];if(o.bottom<this.bounds.top)u++;else break}for(u>0&&(A.Helper.log("[wmf] Region remove "+u+" scans from top"),this.scans.splice(0,u),this.scans.length>0&&(this.scans[0].top=this.bounds.top)),u=0;u<this.scans.length;){var o=this.scans[u];if(o.top>this.bounds.bottom){A.Helper.log("[wmf] Region remove "+(this.scans.length-u)+" scans from bottom"),this.scans.splice(u,this.scans.length-u);break}if(!o.intersect(this.bounds.left,this.bounds.right)){A.Helper.log("[wmf] Region remove now empty scan "+u+" due to intersection"),this.scans.splice(u,1);continue}u++}this.scans.length>0&&(this.scans[this.scans.length-1].bottom=this.bounds.bottom),this._updateComplexity()}}else this.scans=null,this.complexity=0;A.Helper.log("[wmf] Region intersection -> "+this.toString())},s.prototype.offset=function(l,u){if(this.bounds!=null&&(this.bounds.left+=l,this.bounds.top+=u,this.bounds.right+=l,this.bounds.bottom+=u),this.scans!=null)for(var o=this.scans.length,i=0;i<o;i++){var a=this.scans[i];a.top+=u,a.bottom+=u;for(var b=a.scanlines.length,v=0;v<b;v++){var _=a.scanlines[v];_.left+=l,_.right+=l}}},s})(r.Obj);function t(c,s,l,u){var o=new e(null,null);return o.bounds=new r.Rect(null,c,s,l,u),o._updateComplexity(),o}var p=(function(){function c(s,l,u,o,i){if(s!=null){var a=s.readUint16();this.top=s.readUint16(),this.bottom=s.readUint16(),this.scanlines=[];for(var b=0;b<a;b++){var v=s.readUint16(),_=s.readUint16();this.scanlines.push({left:v,right:_})}s.skip(2)}else if(l!=null){this.top=l.top,this.bottom=l.bottom,this.scanlines=[];for(var b=0;b<l.scanlines.length;b++){var T=l.scanlines[b];this.scanlines.push({left:T.left,right:T.right})}}else this.top=u,this.bottom=o,this.scanlines=i}return c.prototype.clone=function(){return new c(null,this)},c.prototype.subtract=function(s,l){for(var u=0;u<this.scanlines.length;){var o=this.scanlines[u];if(o.left<=s){if(o.right>=s&&(o.right=s-1,o.left>=o.right)){this.scanlines.splice(u,1);continue}u++}else break}for(var i=u,a=0;u<this.scanlines.length;){var o=this.scanlines[u];if(o.right>l){o.left=l,a=u-i,o.left>=o.right&&a++;break}u++}return a>0&&i<this.scanlines.length&&this.scanlines.splice(i,a),this.scanlines.length>0},c.prototype.intersect=function(s,l){for(var u=0;u<this.scanlines.length;u++){var o=this.scanlines[u];if(o.left>=s||o.right>=s){u>0&&this.scanlines.splice(0,u);break}}if(this.scanlines.length>0){var o=this.scanlines[0];o.left<s&&(o.left=s);for(var u=0;u<this.scanlines.length;u++)if(o=this.scanlines[u],o.left>l){this.scanlines.splice(u,this.scanlines.length-u);break}this.scanlines.length>0&&(o=this.scanlines[this.scanlines.length-1],o.right>l&&(o.right=l))}return this.scanlines.length>0},c.prototype.toString=function(){return"{ #scanlines: "+this.scanlines.length+"}"},c})()}),"./src/wmfjs/Renderer.ts":((E,h,w)=>{w.r(h),w.d(h,{Renderer:()=>p});var A=w("./src/util/index.ts"),r=w("./src/wmfjs/Blob.ts"),n=w("./src/wmfjs/GDIContext.ts"),e=w("./src/wmfjs/Helper.ts"),t=w("./src/wmfjs/WMFRecords.ts"),p=(function(){function u(o){this.parse(o),e.Helper.log("WMFJS.Renderer instantiated")}return u.prototype.render=function(o){var i=document.createElementNS("http://www.w3.org/2000/svg","svg");return this._render(new A.SVG(i),o.mapMode,o.xExt,o.yExt),i.setAttribute("viewBox",[0,0,o.xExt,o.yExt].join(" ")),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("width",o.width),i.setAttribute("height",o.height),i},u.prototype.parse=function(o){this._img=null;var i=new r.Blob(o),a,b,v,_,T=i.readUint32();switch(T===2596720087?(v=new s(i),_=i.pos,a=i.readUint16(),b=i.readUint16()):(_=0,a=T&65535,b=T>>>16&65535),a){case e.Helper.GDI.MetafileType.MEMORYMETAFILE:case e.Helper.GDI.MetafileType.DISKMETAFILE:if(b===e.Helper.GDI.METAHEADER_SIZE/2){var k=i.readUint16();switch(k){case e.Helper.GDI.MetafileVersion.METAVERSION100:case e.Helper.GDI.MetafileVersion.METAVERSION300:this._img=new l(i,v,k,_+b*2);break}}break}if(this._img==null)throw new e.WMFJSError("Format not recognized")},u.prototype._render=function(o,i,a,b){var v=new n.GDIContext(o);v.setViewportExt(a,b),v.setMapMode(i),e.Helper.log("[WMF] BEGIN RENDERING --->"),this._img.render(v),e.Helper.log("[WMF] <--- DONE RENDERING")},u})(),c=(function(){function u(o){this.left=o.readInt16(),this.top=o.readInt16(),this.right=o.readInt16(),this.bottom=o.readInt16()}return u.prototype.toString=function(){return"{left: "+this.left+", top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+"}"},u})(),s=(function(){function u(o){o.skip(2),this.boundingBox=new c(o),this.unitsPerInch=o.readInt16(),o.skip(4),o.skip(2),e.Helper.log("Got bounding box "+this.boundingBox+" and "+this.unitsPerInch+" units/inch")}return u})(),l=(function(){function u(o,i,a,b){this._version=a,this._hdrsize=b,this._placable=i,this._records=new t.WMFRecords(o,this._hdrsize)}return u.prototype.render=function(o){this._records.play(o)},u})()}),"./src/wmfjs/Style.ts":((E,h,w)=>{w.r(h),w.d(h,{Brush:()=>c,ColorRef:()=>t,Font:()=>p,Palette:()=>u,PaletteEntry:()=>l,Pen:()=>s});var A=w("./src/wmfjs/Bitmap.ts"),r=w("./src/wmfjs/Helper.ts"),n=w("./src/wmfjs/Primitives.ts"),e=(function(){var o=function(i,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,v){b.__proto__=v}||function(b,v){for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(b[_]=v[_])},o(i,a)};return function(i,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(i,a);function b(){this.constructor=i}i.prototype=a===null?Object.create(a):(b.prototype=a.prototype,new b)}})(),t=(function(){function o(i,a,b,v){i!=null?(this.r=i.readUint8(),this.g=i.readUint8(),this.b=i.readUint8(),i.skip(1)):(this.r=a,this.g=b,this.b=v)}return o.prototype.clone=function(){return new o(null,this.r,this.g,this.b)},o.prototype.toHex=function(){return(16777216+(this.r<<16|this.g<<8|this.b)).toString(16).slice(1)},o.prototype.toString=function(){return"{r: "+this.r+", g: "+this.g+", b: "+this.b+"}"},o})(),p=(function(o){e(i,o);function i(a,b){var v=o.call(this,"font")||this;if(a!=null){v.height=a.readInt16(),v.width=a.readInt16(),v.escapement=a.readInt16(),v.orientation=a.readInt16(),v.weight=a.readInt16(),v.italic=a.readUint8(),v.underline=a.readUint8(),v.strikeout=a.readUint8(),v.charset=a.readUint8(),v.outprecision=a.readUint8(),v.clipprecision=a.readUint8(),v.quality=a.readUint8();var _=a.readUint8();v.pitch=_&15,v.family=_>>6&3;var T=b,k=a.pos;v.facename=a.readNullTermString(Math.min(T-(a.pos-k),32))}else b!=null?(b=b,v.height=b.height,v.width=b.width,v.escapement=b.escapement,v.orientation=b.orientation,v.weight=b.weight,v.italic=b.italic,v.underline=b.underline,v.strikeout=b.strikeout,v.charset=b.charset,v.outprecision=b.outprecision,v.clipprecision=b.clipprecision,v.quality=b.quality,v.pitch=b.pitch,v.family=b.family,v.facename=b.facename):(v.height=-80,v.width=0,v.escapement=0,v.orientation=0,v.weight=400,v.italic=0,v.underline=0,v.strikeout=0,v.charset=0,v.outprecision=0,v.clipprecision=0,v.quality=0,v.pitch=0,v.family=0,v.facename="Helvetica");return v}return i.prototype.clone=function(){return new i(null,this)},i.prototype.toString=function(){return JSON.stringify(this)},i})(n.Obj),c=(function(o){e(i,o);function i(a,b,v){var _=o.call(this,"brush")||this;if(a!=null){var T=b,k=a.pos;if(v===!0||v===!1)switch(_.style=a.readUint16(),v&&_.style!==r.Helper.GDI.BrushStyle.BS_PATTERN&&(_.style=r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT),_.style){case r.Helper.GDI.BrushStyle.BS_SOLID:_.color=new t(a);break;case r.Helper.GDI.BrushStyle.BS_PATTERN:a.skip(v?2:6),_.pattern=new A.Bitmap16(a,T-(a.pos-k));break;case r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:_.colorusage=v?a.readUint16():a.readUint32(),v||a.skip(2),_.dibpatternpt=new A.DIBitmap(a,T-(a.pos-k));break;case r.Helper.GDI.BrushStyle.BS_HATCHED:_.color=new t(a),_.hatchstyle=a.readUint16();break}else v instanceof A.PatternBitmap16&&(_.style=r.Helper.GDI.BrushStyle.BS_PATTERN,_.pattern=v)}else if(b!=null)switch(b=b,_.style=b.style,_.style){case r.Helper.GDI.BrushStyle.BS_SOLID:_.color=b.color.clone();break;case r.Helper.GDI.BrushStyle.BS_PATTERN:_.pattern=b.pattern.clone();break;case r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:_.colorusage=b.colorusage,_.dibpatternpt=b.dibpatternpt;break;case r.Helper.GDI.BrushStyle.BS_HATCHED:_.color=b.color.clone(),_.hatchstyle=b.hatchstyle;break}return _}return i.prototype.clone=function(){return new i(null,this)},i.prototype.toString=function(){var a="{style: "+this.style;switch(this.style){case r.Helper.GDI.BrushStyle.BS_SOLID:a+=", color: "+this.color.toString();break;case r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:a+=", colorusage: "+this.colorusage;break;case r.Helper.GDI.BrushStyle.BS_HATCHED:a+=", color: "+this.color.toString()+", hatchstyle: "+this.hatchstyle;break}return a+"}"},i})(n.Obj),s=(function(o){e(i,o);function i(a,b,v,_,T,k){var M=o.call(this,"pen")||this;return a!=null?(b=a.readUint16(),M.style=b&255,M.width=new n.PointS(a),M.color=new t(a),M.linecap=b&(r.Helper.GDI.PenStyle.PS_ENDCAP_SQUARE|r.Helper.GDI.PenStyle.PS_ENDCAP_FLAT),M.join=b&(r.Helper.GDI.PenStyle.PS_JOIN_BEVEL|r.Helper.GDI.PenStyle.PS_JOIN_MITER)):(M.style=b,M.width=v,M.color=_,M.linecap=T,M.join=k),M}return i.prototype.clone=function(){return new i(null,this.style,this.width.clone(),this.color.clone(),this.linecap,this.join)},i.prototype.toString=function(){return"{style: "+this.style+", width: "+this.width.toString()+", color: "+this.color.toString()+", linecap: "+this.linecap+", join: "+this.join+"}"},i})(n.Obj),l=(function(){function o(i,a){i!=null?(this.flag=i.readUint8(),this.b=i.readUint8(),this.g=i.readUint8(),this.r=i.readUint8()):(this.flag=a.flag,this.b=a.b,this.g=a.g,this.r=a.r)}return o.prototype.clone=function(){return new o(null,this)},o})(),u=(function(o){e(i,o);function i(a,b){var v=o.call(this,"palette")||this;if(a!=null){v.start=a.readUint16();var _=a.readUint16();for(v.entries=[];_>0;)v.entries.push(new l(a)),_--}else{v.start=b.start,v.entries=[];for(var T=b.entries.length,k=0;k<T;k++)v.entries.push(b.entries[k])}return v}return i.prototype.clone=function(){return new i(null,this)},i.prototype.toString=function(){return"{ #entries: "+this.entries.length+"}"},i})(n.Obj)}),"./src/wmfjs/WMFRecords.ts":((E,h,w)=>{w.r(h),w.d(h,{WMFRecords:()=>c});var A=w("./src/wmfjs/Bitmap.ts"),r=w("./src/wmfjs/Blob.ts"),n=w("./src/wmfjs/Helper.ts"),e=w("./src/wmfjs/Primitives.ts"),t=w("./src/wmfjs/Region.ts"),p=w("./src/wmfjs/Style.ts"),c=(function(){function s(l,u){this._records=[];var o=!1,i=u,a=function(){l.seek(i);var v=l.readUint32();if(v<3)throw new n.WMFJSError("Invalid record size");var _=l.readUint16();switch(_){case n.Helper.GDI.RecordType.META_EOF:return o=!0,"break-main_loop";case n.Helper.GDI.RecordType.META_SETMAPMODE:var T=l.readUint16();b._records.push(function(dt){dt.setMapMode(T)});break;case n.Helper.GDI.RecordType.META_SETWINDOWORG:var k=l.readInt16(),M=l.readInt16();b._records.push(function(dt){dt.setWindowOrg(M,k)});break;case n.Helper.GDI.RecordType.META_SETWINDOWEXT:var R=l.readInt16(),O=l.readInt16();b._records.push(function(dt){dt.setWindowExt(O,R)});break;case n.Helper.GDI.RecordType.META_OFFSETWINDOWORG:var P=l.readInt16(),N=l.readInt16();b._records.push(function(dt){dt.offsetWindowOrg(N,P)});break;case n.Helper.GDI.RecordType.META_SETVIEWPORTORG:var it=l.readInt16(),J=l.readInt16();b._records.push(function(dt){dt.setViewportOrg(J,it)});break;case n.Helper.GDI.RecordType.META_SETVIEWPORTEXT:var ot=l.readInt16(),tt=l.readInt16();b._records.push(function(dt){dt.setViewportExt(tt,ot)});break;case n.Helper.GDI.RecordType.META_OFFSETVIEWPORTORG:var ht=l.readInt16(),W=l.readInt16();b._records.push(function(dt){dt.offsetViewportOrg(W,ht)});break;case n.Helper.GDI.RecordType.META_SAVEDC:b._records.push(function(dt){dt.saveDC()});break;case n.Helper.GDI.RecordType.META_RESTOREDC:var G=l.readInt16();b._records.push(function(dt){dt.restoreDC(G)});break;case n.Helper.GDI.RecordType.META_SETSTRETCHBLTMODE:var gt=l.readUint16();b._records.push(function(dt){dt.setStretchBltMode(gt)});break;case n.Helper.GDI.RecordType.META_DIBBITBLT:var F=(_>>8)+3!==v,nt=l.readUint16()|l.readUint16()<<16,j=l.readInt16(),U=l.readInt16();F||l.skip(2);var at=l.readInt16(),rt=l.readInt16(),V=l.readInt16(),et=l.readInt16();if(F){var Wt=v*2-(l.pos-i),q=new A.DIBitmap(l,Wt);b._records.push(function(cc){cc.dibBits(U,j,et,V,rt,at,nt,q)})}break;case n.Helper.GDI.RecordType.META_DIBSTRETCHBLT:var F=(_>>8)+3!==v,ut=l.readUint16()|l.readUint16()<<16,S=l.readInt16(),$=l.readInt16(),z=l.readInt16(),x=l.readInt16(),D=l.readInt16(),I=l.readInt16(),H=l.readInt16(),L=l.readInt16(),Wt=v*2-(l.pos-i),B=new A.DIBitmap(l,Wt);b._records.push(function(dt){dt.stretchDibBits(x,z,$,S,L,H,I,D,ut,B)});break;case n.Helper.GDI.RecordType.META_STRETCHDIB:var Y=l.readUint16()|l.readUint16()<<16,Q=l.readInt16(),K=l.readInt16(),lt=l.readInt16(),ft=l.readInt16(),X=l.readInt16(),mt=l.readInt16(),At=l.readInt16(),Et=l.readInt16(),ct=l.readInt16(),Wt=v*2-(l.pos-i),yt=new A.DIBitmap(l,Wt);b._records.push(function(dt){dt.stretchDib(X,ft,lt,K,ct,Et,At,mt,Y,Q,yt)});break;case n.Helper.GDI.RecordType.META_ESCAPE:var Rt=l.readUint16(),St=l.readUint16(),It=l.pos,Lt=new r.Blob(l,It);b._records.push(function(dt){dt.escape(Rt,Lt,It,St)});break;case n.Helper.GDI.RecordType.META_SETTEXTALIGN:var Ft=l.readUint16();b._records.push(function(dt){dt.setTextAlign(Ft)});break;case n.Helper.GDI.RecordType.META_SETBKMODE:var _t=l.readUint16();b._records.push(function(dt){dt.setBkMode(_t)});break;case n.Helper.GDI.RecordType.META_SETTEXTCOLOR:var Mt=new p.ColorRef(l);b._records.push(function(dt){dt.setTextColor(Mt)});break;case n.Helper.GDI.RecordType.META_SETBKCOLOR:var Ct=new p.ColorRef(l);b._records.push(function(dt){dt.setBkColor(Ct)});break;case n.Helper.GDI.RecordType.META_CREATEBRUSHINDIRECT:var Wt=v*2-(l.pos-i),Dt=new p.Brush(l,Wt,!1);b._records.push(function(dt){dt.createBrush(Dt)});break;case n.Helper.GDI.RecordType.META_DIBCREATEPATTERNBRUSH:var Wt=v*2-(l.pos-i),bt=new p.Brush(l,Wt,!0);b._records.push(function(dt){dt.createBrush(bt)});break;case n.Helper.GDI.RecordType.META_CREATEPENINDIRECT:var wt=new p.Pen(l);b._records.push(function(dt){dt.createPen(wt)});break;case n.Helper.GDI.RecordType.META_CREATEFONTINDIRECT:var Wt=v*2-(l.pos-i),jt=new p.Font(l,Wt);b._records.push(function(dt){dt.createFont(jt)});break;case n.Helper.GDI.RecordType.META_SELECTOBJECT:var ee=l.readUint16();b._records.push(function(dt){dt.selectObject(ee,null)});break;case n.Helper.GDI.RecordType.META_SELECTPALETTE:var Kt=l.readUint16();b._records.push(function(dt){dt.selectObject(Kt,"palette")});break;case n.Helper.GDI.RecordType.META_SELECTCLIPREGION:var re=l.readUint16();b._records.push(function(dt){dt.selectObject(re,"region")});break;case n.Helper.GDI.RecordType.META_DELETEOBJECT:var Vt=l.readUint16();b._records.push(function(dt){dt.deleteObject(Vt)});break;case n.Helper.GDI.RecordType.META_RECTANGLE:var ne=new e.Rect(l);b._records.push(function(dt){dt.rectangle(ne,0,0)});break;case n.Helper.GDI.RecordType.META_ROUNDRECT:var Pt=l.readInt16(),Ot=l.readInt16(),kt=new e.Rect(l);b._records.push(function(dt){dt.rectangle(kt,Ot,Pt)});break;case n.Helper.GDI.RecordType.META_LINETO:var Gt=l.readInt16(),pt=l.readInt16();b._records.push(function(dt){dt.lineTo(pt,Gt)});break;case n.Helper.GDI.RecordType.META_MOVETO:var fn=l.readInt16(),zl=l.readInt16();b._records.push(function(dt){dt.moveTo(zl,fn)});break;case n.Helper.GDI.RecordType.META_TEXTOUT:var Ht=l.readInt16();if(Ht>0){var $l=l.readString(Ht);l.skip(Ht%2);var Vl=l.readInt16(),Xl=l.readInt16();b._records.push(function(dt){dt.textOut(Xl,Vl,$l)})}break;case n.Helper.GDI.RecordType.META_EXTTEXTOUT:var Yl=l.readInt16(),Kl=l.readInt16(),Ht=l.readInt16(),Jl=l.readUint16(),Ue=null,je=null;v*2===14+Ht+Ht%2&&(Ue=!1,je=!1),v*2===22+Ht+Ht%2&&(Ue=!0,je=!1),v*2===14+Ht+Ht%2+Ht*2&&(Ue=!1,je=!0),v*2===22+Ht+Ht%2+Ht*2&&(Ue=!0,je=!0);var Zl=Ue?new e.Rect(l):null;if(Ht>0){var _o=l.readString(Ht);l.skip(Ht%2);var To=[];if(je)for(var se=0;se<_o.length;se++)To.push(l.readInt16());b._records.push(function(dt){dt.extTextOut(Kl,Yl,_o,Jl,Zl,To)})}break;case n.Helper.GDI.RecordType.META_EXCLUDECLIPRECT:var ql=new e.Rect(l);b._records.push(function(dt){dt.excludeClipRect(ql)});break;case n.Helper.GDI.RecordType.META_INTERSECTCLIPRECT:var Ql=new e.Rect(l);b._records.push(function(dt){dt.intersectClipRect(Ql)});break;case n.Helper.GDI.RecordType.META_POLYGON:for(var he=l.readInt16(),xo=[];he>0;)xo.push(new e.PointS(l)),he--;b._records.push(function(dt){dt.polygon(xo,!0)});break;case n.Helper.GDI.RecordType.META_SETPOLYFILLMODE:var tc=l.readUint16();b._records.push(function(dt){dt.setPolyFillMode(tc)});break;case n.Helper.GDI.RecordType.META_POLYPOLYGON:for(var he=l.readUint16(),So=[],se=0;se<he;se++)So.push(l.readUint16());for(var Po=[],se=0;se<he;se++){for(var ec=So[se],Do=[],Ro=0;Ro<ec;Ro++)Do.push(new e.PointS(l));Po.push(Do)}b._records.push(function(dt){dt.polyPolygon(Po)});break;case n.Helper.GDI.RecordType.META_POLYLINE:for(var he=l.readInt16(),ko=[];he>0;)ko.push(new e.PointS(l)),he--;b._records.push(function(dt){dt.polyline(ko)});break;case n.Helper.GDI.RecordType.META_ELLIPSE:var rc=new e.Rect(l);b._records.push(function(dt){dt.ellipse(rc)});break;case n.Helper.GDI.RecordType.META_CREATEPALETTE:var nc=new p.Palette(l);b._records.push(function(dt){dt.createPalette(nc)});break;case n.Helper.GDI.RecordType.META_CREATEREGION:var ic=new t.Region(l);b._records.push(function(dt){dt.createRegion(ic)});break;case n.Helper.GDI.RecordType.META_CREATEPATTERNBRUSH:var Wt=v*2-(l.pos-i),oc=new A.PatternBitmap16(l,Wt),ac=new p.Brush(l,Wt,oc);b._records.push(function(dt){dt.createPatternBrush(ac)});break;case n.Helper.GDI.RecordType.META_OFFSETCLIPRGN:var sc=l.readInt16(),lc=l.readInt16();b._records.push(function(dt){dt.offsetClipRgn(lc,sc)});break;case n.Helper.GDI.RecordType.META_REALIZEPALETTE:case n.Helper.GDI.RecordType.META_SETPALENTRIES:case n.Helper.GDI.RecordType.META_SETROP2:case n.Helper.GDI.RecordType.META_SETRELABS:case n.Helper.GDI.RecordType.META_SETTEXTCHAREXTRA:case n.Helper.GDI.RecordType.META_RESIZEPALETTE:case n.Helper.GDI.RecordType.META_SETLAYOUT:case n.Helper.GDI.RecordType.META_FILLREGION:case n.Helper.GDI.RecordType.META_SETMAPPERFLAGS:case n.Helper.GDI.RecordType.META_SETTEXTJUSTIFICATION:case n.Helper.GDI.RecordType.META_SCALEWINDOWEXT:case n.Helper.GDI.RecordType.META_SCALEVIEWPORTEXT:case n.Helper.GDI.RecordType.META_FLOODFILL:case n.Helper.GDI.RecordType.META_FRAMEREGION:case n.Helper.GDI.RecordType.META_ANIMATEPALETTE:case n.Helper.GDI.RecordType.META_EXTFLOODFILL:case n.Helper.GDI.RecordType.META_SETPIXEL:case n.Helper.GDI.RecordType.META_PATBLT:case n.Helper.GDI.RecordType.META_PIE:case n.Helper.GDI.RecordType.META_STRETCHBLT:case n.Helper.GDI.RecordType.META_INVERTREGION:case n.Helper.GDI.RecordType.META_PAINTREGION:case n.Helper.GDI.RecordType.META_ARC:case n.Helper.GDI.RecordType.META_CHORD:case n.Helper.GDI.RecordType.META_BITBLT:case n.Helper.GDI.RecordType.META_SETDIBTODEV:default:var Io="UNKNOWN";for(var Mo in n.Helper.GDI.RecordType)if(n.Helper.GDI.RecordType[Mo]===_){Io=Mo;break}n.Helper.log("[WMF] "+Io+" record (0x"+_.toString(16)+") at offset 0x"+i.toString(16)+" with "+v*2+" bytes");break}i+=v*2},b=this;t:for(;!o;)switch(a()){case"break-main_loop":break t}if(!o)throw new n.WMFJSError("Could not read all records")}return s.prototype.play=function(l){for(var u=this._records.length,o=0;o<u;o++)this._records[o](l)},s})()})},f={};function g(E){var h=f[E];if(h!==void 0)return h.exports;var w=f[E]={exports:{}};return d[E](w,w.exports,g),w.exports}g.d=(E,h)=>{for(var w in h)g.o(h,w)&&!g.o(E,w)&&Object.defineProperty(E,w,{enumerable:!0,get:h[w]})},g.o=(E,h)=>Object.prototype.hasOwnProperty.call(E,h),g.r=E=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(E,"__esModule",{value:!0})};var y={};return(()=>{g.r(y),g.d(y,{Error:()=>h.WMFJSError,Renderer:()=>E.Renderer,loggingEnabled:()=>h.loggingEnabled});var E=g("./src/wmfjs/Renderer.ts"),h=g("./src/wmfjs/Helper.ts")})(),y})())})),Nl=We(((m,C)=>{(function(f,g){typeof m=="object"&&typeof C=="object"?C.exports=g(fo(),po()):typeof define=="function"&&define.amd?define(["./EMFJS.bundle.js","./WMFJS.bundle.js"],g):typeof m=="object"?m.RTFJS=g(fo(),po()):f.RTFJS=g(f.EMFJS,f.WMFJS)})(m,(d,f)=>(()=>{var g={"./node_modules/codepage/cptable.js":(w=>{var A={version:"1.15.0"};A[37]=(function(){for(var r=`\0œ †—Ž\v\f\r…\b‡’€‚ƒ„
304
+ `,uo=m=>m.ownerDocument.defaultView})),go=We(((m,C)=>{(function(f,g){typeof m=="object"&&typeof C=="object"?C.exports=g():typeof define=="function"&&define.amd?define([],g):typeof m=="object"?m.EMFJS=g():f.EMFJS=g()})(m,()=>(()=>{"use strict";var d={"./src/emfjs/Bitmap.ts":((E,h,w)=>{w.r(h),w.d(h,{BitmapInfo:()=>e,DIBitmap:()=>t});var A=w("./src/emfjs/Helper.ts"),r=(function(){function p(c,s){s&&c.skip(4),this.width=c.readUint16(),this.height=c.readUint16(),this.planes=c.readUint16(),this.bitcount=c.readUint16()}return p.prototype.colors=function(){return this.bitcount<=8?1<<this.bitcount:0},p})(),n=(function(){function p(c,s){s&&c.skip(4),this.width=c.readInt32(),this.height=c.readInt32(),this.planes=c.readUint16(),this.bitcount=c.readUint16(),this.compression=c.readUint32(),this.sizeimage=c.readUint32(),this.xpelspermeter=c.readInt32(),this.ypelspermeter=c.readInt32(),this.clrused=c.readUint32(),this.clrimportant=c.readUint32()}return p.prototype.colors=function(){return this.clrused!==0?this.clrused<256?this.clrused:256:this.bitcount>8?0:1<<this.bitcount},p})(),e=(function(){function p(c,s){this._usergb=s;var l=c.readUint32();if(this._infosize=l,l===A.Helper.GDI.BITMAPCOREHEADER_SIZE)this._header=new r(c,!1),this._infosize+=this._header.colors()*(s?3:2);else{this._header=new n(c,!1);var u=this._header.compression===A.Helper.GDI.BitmapCompression.BI_BITFIELDS?3:0;l<=A.Helper.GDI.BITMAPINFOHEADER_SIZE+u*4&&(this._infosize=A.Helper.GDI.BITMAPINFOHEADER_SIZE+u*4),this._infosize+=this._header.colors()*(s?4:2)}}return p.prototype.getWidth=function(){return this._header.width},p.prototype.getHeight=function(){return Math.abs(this._header.height)},p.prototype.infosize=function(){return this._infosize},p.prototype.header=function(){return this._header},p})(),t=(function(){function p(c,s){this._reader=c,this._offset=c.pos,this._location=s,this._info=new e(c,!0)}return p.prototype.getWidth=function(){return this._info.getWidth()},p.prototype.getHeight=function(){return this._info.getHeight()},p.prototype.totalSize=function(){return this._location.header.size+this._location.data.size},p.prototype.makeBitmapFileHeader=function(){var c=new Uint8Array(new ArrayBuffer(14));return c[0]=66,c[1]=77,A.Helper._writeUint32Val(c,2,this.totalSize()+14),A.Helper._writeUint32Val(c,10,this._info.infosize()+14),A.Helper._blobToBinary(c)},p.prototype.base64ref=function(){var c=this._reader.pos;this._reader.seek(this._offset);var s="image/bmp",l=this._info.header(),u;if(l instanceof n&&l.compression!=null)switch(l.compression){case A.Helper.GDI.BitmapCompression.BI_JPEG:s="data:image/jpeg";break;case A.Helper.GDI.BitmapCompression.BI_PNG:s="data:image/png";break;default:u=this.makeBitmapFileHeader();break}else u=this.makeBitmapFileHeader();this._reader.seek(this._location.header.offset),u!=null?u+=this._reader.readBinary(this._location.header.size):u=this._reader.readBinary(this._location.header.size),this._reader.seek(this._location.data.offset),u+=this._reader.readBinary(this._location.data.size);var o="data:"+s+";base64,"+btoa(u);return this._reader.seek(c),o},p})()}),"./src/emfjs/Blob.ts":((E,h,w)=>{w.r(h),w.d(h,{Blob:()=>r});var A=w("./src/emfjs/Helper.ts"),r=(function(){function n(e,t){e instanceof n?(this.blob=e.blob,this.data=e.data,this.pos=t||e.pos):(this.blob=e,this.data=new Uint8Array(e),this.pos=t||0)}return n.prototype.eof=function(){return this.pos>=this.data.length},n.prototype.seek=function(e){if(e<0||e>this.data.length)throw new A.EMFJSError("Invalid seek position");this.pos=e},n.prototype.skip=function(e){var t=this.pos+e;if(t>this.data.length)throw new A.EMFJSError("Unexpected end of file");this.pos=t},n.prototype.readBinary=function(e){if(this.pos+e>this.data.length)throw new A.EMFJSError("Unexpected end of file");for(var t="";e-- >0;)t+=String.fromCharCode(this.data[this.pos++]);return t},n.prototype.readInt8=function(){if(this.pos+1>this.data.length)throw new A.EMFJSError("Unexpected end of file");return this.data[this.pos++]},n.prototype.readUint8=function(){return this.readInt8()>>>0},n.prototype.readInt32=function(){if(this.pos+4>this.data.length)throw new A.EMFJSError("Unexpected end of file");var e=this.data[this.pos++];return e|=this.data[this.pos++]<<8,e|=this.data[this.pos++]<<16,e|=this.data[this.pos++]<<24,e},n.prototype.readUint32=function(){return this.readInt32()>>>0},n.prototype.readUint16=function(){if(this.pos+2>this.data.length)throw new A.EMFJSError("Unexpected end of file");var e=this.data[this.pos++];return e|=this.data[this.pos++]<<8,e},n.prototype.readInt16=function(){var e=this.readUint16();return e>32767&&(e-=65536),e},n.prototype.readString=function(e){if(this.pos+e>this.data.length)throw new A.EMFJSError("Unexpected end of file");for(var t="",p=0;p<e;p++)t+=String.fromCharCode(this.data[this.pos++]>>>0);return t},n.prototype.readNullTermString=function(e){var t="";if(e>0){e--;for(var p=0;p<e;p++){if(this.pos+p+1>this.data.length)throw new A.EMFJSError("Unexpected end of file");var c=this.data[this.pos+p]>>>0;if(c===0)break;t+=String.fromCharCode(c)}}return t},n.prototype.readFixedSizeUnicodeString=function(e){for(var t="",p=0;p<e;p++){var c=this.readUint16();if(c===0){++p<e&&this.skip((e-p)*2);break}t+=String.fromCharCode(c)}return t},n})()}),"./src/emfjs/EMFRecords.ts":((E,h,w)=>{w.r(h),w.d(h,{EMFRecords:()=>p});var A=w("./src/emfjs/Helper.ts"),r=w("./src/emfjs/Primitives.ts"),n=w("./src/emfjs/Region.ts"),e=w("./src/emfjs/Style.ts"),t=(function(){function c(s,l){var u=s.pos-8;if(this.size=l,this.bounds=new r.RectL(s),this.frame=new r.RectL(s),s.readUint32()!==A.Helper.GDI.FormatSignature.ENHMETA_SIGNATURE)throw new A.EMFJSError("Invalid header signature");s.skip(4),s.skip(4),s.skip(4),s.skip(2),s.skip(2);var o=s.readUint32(),i=s.readUint32();this.nPalEntries=s.readUint32(),this.refDevCx=s.readUint32(),this.refDevCy=s.readUint32(),this.refDevCxMm=s.readUint32(),this.refDevCyMm=s.readUint32();var a=l;if(o>0){if(i<88)throw new A.EMFJSError("Invalid header description offset");if(a=i+o*2,a>l)throw new A.EMFJSError("Invalid header description length");var b=s.pos;s.seek(u+i),this.description=s.readFixedSizeUnicodeString(o),s.seek(b)}else this.description="";if(a>=100){var v=s.readUint32(),_=s.readUint32();if(s.readUint32()!==0)throw new A.EMFJSError("OpenGL records are not yet supported");if(_!==0){if(_<100||_<a)throw new A.EMFJSError("Invalid pixel format offset");if(a=_+v,a>l)throw new A.EMFJSError("Invalid pixel format size")}a>=108&&(this.displayDevCxUm=s.readUint32(),this.displayDevCyUm=s.readUint32())}}return c.prototype.toString=function(){return"{bounds: "+this.bounds.toString()+", frame: "+this.frame.toString()+", description: "+this.description+"}"},c})(),p=(function(){function c(s,l){this._records=[],this._header=new t(s,l);var u=!1,o=l,i=function(){s.seek(o);var b=s.readUint32(),v=s.readUint32();if(v<8)throw new A.EMFJSError("Invalid record size");switch(b){case A.Helper.GDI.RecordType.EMR_EOF:return u=!0,"break-main_loop";case A.Helper.GDI.RecordType.EMR_SETMAPMODE:var _=s.readInt32();a._records.push(function(pt){pt.setMapMode(_)});break;case A.Helper.GDI.RecordType.EMR_SETWINDOWORGEX:var T=s.readInt32(),k=s.readInt32();a._records.push(function(pt){pt.setWindowOrgEx(T,k)});break;case A.Helper.GDI.RecordType.EMR_SETWINDOWEXTEX:var M=s.readUint32(),R=s.readUint32();a._records.push(function(pt){pt.setWindowExtEx(M,R)});break;case A.Helper.GDI.RecordType.EMR_SETVIEWPORTORGEX:var O=s.readInt32(),P=s.readInt32();a._records.push(function(pt){pt.setViewportOrgEx(O,P)});break;case A.Helper.GDI.RecordType.EMR_SETVIEWPORTEXTEX:var N=s.readUint32(),it=s.readUint32();a._records.push(function(pt){pt.setViewportExtEx(N,it)});break;case A.Helper.GDI.RecordType.EMR_SAVEDC:a._records.push(function(pt){pt.saveDC()});break;case A.Helper.GDI.RecordType.EMR_RESTOREDC:var J=s.readInt32();a._records.push(function(pt){pt.restoreDC(J)});break;case A.Helper.GDI.RecordType.EMR_SETBKMODE:var ot=s.readUint32();a._records.push(function(pt){pt.setBkMode(ot)});break;case A.Helper.GDI.RecordType.EMR_SETBKCOLOR:var tt=new e.ColorRef(s);a._records.push(function(pt){pt.setBkColor(tt)});break;case A.Helper.GDI.RecordType.EMR_CREATEBRUSHINDIRECT:var ht=s.readUint32(),W=new e.Brush(s);a._records.push(function(pt){pt.createBrush(ht,W)});break;case A.Helper.GDI.RecordType.EMR_CREATEPEN:var G=s.readUint32(),gt=new e.Pen(s,null);a._records.push(function(pt){pt.createPen(G,gt)});break;case A.Helper.GDI.RecordType.EMR_EXTCREATEPEN:var nt=s.readUint32(),j=s.readUint32(),U=s.readUint32(),at=s.readUint32(),rt=s.readUint32(),V=new e.Pen(s,{header:{off:j,size:U},data:{off:at,size:rt}});a._records.push(function(pt){pt.createPen(nt,V)});break;case A.Helper.GDI.RecordType.EMR_SELECTOBJECT:var et=s.readUint32();a._records.push(function(pt){pt.selectObject(et,null)});break;case A.Helper.GDI.RecordType.EMR_DELETEOBJECT:var q=s.readUint32();a._records.push(function(pt){pt.deleteObject(q)});break;case A.Helper.GDI.RecordType.EMR_RECTANGLE:var F=new r.RectL(s);a._records.push(function(pt){pt.rectangle(F,0,0)});break;case A.Helper.GDI.RecordType.EMR_ROUNDRECT:var ut=new r.RectL(s),S=new r.SizeL(s);a._records.push(function(pt){pt.rectangle(ut,S.cx,S.cy)});break;case A.Helper.GDI.RecordType.EMR_LINETO:var $=s.readInt32(),z=s.readInt32();a._records.push(function(pt){pt.lineTo($,z)});break;case A.Helper.GDI.RecordType.EMR_MOVETOEX:var x=s.readInt32(),D=s.readInt32();a._records.push(function(pt){pt.moveToEx(x,D)});break;case A.Helper.GDI.RecordType.EMR_POLYGON:case A.Helper.GDI.RecordType.EMR_POLYGON16:for(var L=b===A.Helper.GDI.RecordType.EMR_POLYGON16,I=new r.RectL(s),Ct=s.readUint32(),H=[];Ct>0;)H.push(L?new r.PointS(s):new r.PointL(s)),Ct--;a._records.push(function(pt){pt.polygon(H,I,!0)});break;case A.Helper.GDI.RecordType.EMR_POLYPOLYGON:case A.Helper.GDI.RecordType.EMR_POLYPOLYGON16:var L=b===A.Helper.GDI.RecordType.EMR_POLYPOLYGON16,B=new r.RectL(s),Y=s.readUint32();s.skip(4);for(var Q=[],K=0;K<Y;K++)Q.push(s.readUint32());for(var lt=[],K=0;K<Y;K++){for(var ft=Q[K],X=[],mt=0;mt<ft;mt++)X.push(L?new r.PointS(s):new r.PointL(s));lt.push(X)}a._records.push(function(pt){pt.polyPolygon(lt,B)});break;case A.Helper.GDI.RecordType.EMR_SETPOLYFILLMODE:var At=s.readUint32();a._records.push(function(pt){pt.setPolyFillMode(At)});break;case A.Helper.GDI.RecordType.EMR_POLYLINE16:case A.Helper.GDI.RecordType.EMR_POLYLINETO16:for(var Et=b===A.Helper.GDI.RecordType.EMR_POLYLINETO16,ct=new r.RectL(s),Ct=s.readUint32(),yt=[];Ct>0;)yt.push(new r.PointS(s)),Ct--;a._records.push(function(pt){pt.polyline(Et,yt,ct)});break;case A.Helper.GDI.RecordType.EMR_POLYBEZIER:case A.Helper.GDI.RecordType.EMR_POLYBEZIERTO:for(var Rt=b===A.Helper.GDI.RecordType.EMR_POLYBEZIERTO,St=new r.RectL(s),Ct=s.readUint32(),It=[];Ct>0;)It.push(new r.PointL(s)),Ct--;a._records.push(function(pt){pt.polybezier(Rt,It,St)});break;case A.Helper.GDI.RecordType.EMR_POLYBEZIER16:for(var Lt=new r.RectL(s),Ft=new r.PointL(s),Ct=s.readUint32(),_t=[Ft];Ct>0;)_t.push(new r.PointS(s)),Ct--;a._records.push(function(pt){pt.polybezier(!1,_t,Lt)});break;case A.Helper.GDI.RecordType.EMR_POLYBEZIERTO16:for(var Mt=new r.RectL(s),Ct=s.readUint32(),Dt=[];Ct>0;)Dt.push(new r.PointS(s)),Ct--;a._records.push(function(pt){pt.polybezier(!0,Dt,Mt)});break;case A.Helper.GDI.RecordType.EMR_SETTEXTALIGN:var bt=s.readUint32();a._records.push(function(pt){pt.setTextAlign(bt)});break;case A.Helper.GDI.RecordType.EMR_SETSTRETCHBLTMODE:var wt=s.readUint32();a._records.push(function(pt){pt.setStretchBltMode(wt)});break;case A.Helper.GDI.RecordType.EMR_SETBRUSHORGEX:var jt=new r.PointL(s);a._records.push(function(pt){pt.setBrushOrgEx(jt)});break;case A.Helper.GDI.RecordType.EMR_BEGINPATH:a._records.push(function(pt){pt.beginPath()});break;case A.Helper.GDI.RecordType.EMR_ENDPATH:a._records.push(function(pt){pt.endPath()});break;case A.Helper.GDI.RecordType.EMR_ABORTPATH:a._records.push(function(pt){pt.abortPath()});break;case A.Helper.GDI.RecordType.EMR_CLOSEFIGURE:a._records.push(function(pt){pt.closeFigure()});break;case A.Helper.GDI.RecordType.EMR_FILLPATH:var ee=new r.RectL(s);a._records.push(function(pt){pt.fillPath(ee)});break;case A.Helper.GDI.RecordType.EMR_STROKEPATH:var Kt=new r.RectL(s);a._records.push(function(pt){pt.strokePath(Kt)});break;case A.Helper.GDI.RecordType.EMR_SELECTCLIPPATH:var re=s.readUint32();a._records.push(function(pt){pt.selectClipPath(re)});break;case A.Helper.GDI.RecordType.EMR_EXTSELECTCLIPRGN:s.skip(4);var Vt=s.readUint32(),ne=Vt!==A.Helper.GDI.RegionMode.RGN_COPY?new n.Region(s):null;a._records.push(function(pt){pt.selectClipRgn(Vt,ne)});break;case A.Helper.GDI.RecordType.EMR_OFFSETCLIPRGN:var Pt=new r.PointL(s);a._records.push(function(pt){pt.offsetClipRgn(Pt)});break;case A.Helper.GDI.RecordType.EMR_SETMITERLIMIT:var Ot=s.readUint32();a._records.push(function(pt){pt.setMiterLimit(Ot)});break;case A.Helper.GDI.RecordType.EMR_POLYLINE:case A.Helper.GDI.RecordType.EMR_POLYLINETO:case A.Helper.GDI.RecordType.EMR_POLYPOLYLINE:case A.Helper.GDI.RecordType.EMR_SETPIXELV:case A.Helper.GDI.RecordType.EMR_SETMAPPERFLAGS:case A.Helper.GDI.RecordType.EMR_SETROP2:case A.Helper.GDI.RecordType.EMR_SETCOLORADJUSTMENT:case A.Helper.GDI.RecordType.EMR_SETTEXTCOLOR:case A.Helper.GDI.RecordType.EMR_SETMETARGN:case A.Helper.GDI.RecordType.EMR_EXCLUDECLIPRECT:case A.Helper.GDI.RecordType.EMR_INTERSECTCLIPRECT:case A.Helper.GDI.RecordType.EMR_SCALEVIEWPORTEXTEX:case A.Helper.GDI.RecordType.EMR_SCALEWINDOWEXTEX:case A.Helper.GDI.RecordType.EMR_SETWORLDTRANSFORM:case A.Helper.GDI.RecordType.EMR_MODIFYWORLDTRANSFORM:case A.Helper.GDI.RecordType.EMR_ANGLEARC:case A.Helper.GDI.RecordType.EMR_ELLIPSE:case A.Helper.GDI.RecordType.EMR_ARC:case A.Helper.GDI.RecordType.EMR_CHORD:case A.Helper.GDI.RecordType.EMR_PIE:case A.Helper.GDI.RecordType.EMR_SELECTPALETTE:case A.Helper.GDI.RecordType.EMR_CREATEPALETTE:case A.Helper.GDI.RecordType.EMR_SETPALETTEENTRIES:case A.Helper.GDI.RecordType.EMR_RESIZEPALETTE:case A.Helper.GDI.RecordType.EMR_REALIZEPALETTE:case A.Helper.GDI.RecordType.EMR_EXTFLOODFILL:case A.Helper.GDI.RecordType.EMR_ARCTO:case A.Helper.GDI.RecordType.EMR_POLYDRAW:case A.Helper.GDI.RecordType.EMR_SETARCDIRECTION:case A.Helper.GDI.RecordType.EMR_STROKEANDFILLPATH:case A.Helper.GDI.RecordType.EMR_FLATTENPATH:case A.Helper.GDI.RecordType.EMR_WIDENPATH:case A.Helper.GDI.RecordType.EMR_COMMENT:case A.Helper.GDI.RecordType.EMR_FILLRGN:case A.Helper.GDI.RecordType.EMR_FRAMERGN:case A.Helper.GDI.RecordType.EMR_INVERTRGN:case A.Helper.GDI.RecordType.EMR_PAINTRGN:case A.Helper.GDI.RecordType.EMR_BITBLT:case A.Helper.GDI.RecordType.EMR_STRETCHBLT:case A.Helper.GDI.RecordType.EMR_MASKBLT:case A.Helper.GDI.RecordType.EMR_PLGBLT:case A.Helper.GDI.RecordType.EMR_SETDIBITSTODEVICE:case A.Helper.GDI.RecordType.EMR_STRETCHDIBITS:case A.Helper.GDI.RecordType.EMR_EXTCREATEFONTINDIRECTW:case A.Helper.GDI.RecordType.EMR_EXTTEXTOUTA:case A.Helper.GDI.RecordType.EMR_EXTTEXTOUTW:case A.Helper.GDI.RecordType.EMR_POLYPOLYLINE16:case A.Helper.GDI.RecordType.EMR_POLYDRAW16:case A.Helper.GDI.RecordType.EMR_CREATEMONOBRUSH:case A.Helper.GDI.RecordType.EMR_CREATEDIBPATTERNBRUSHPT:case A.Helper.GDI.RecordType.EMR_POLYTEXTOUTA:case A.Helper.GDI.RecordType.EMR_POLYTEXTOUTW:case A.Helper.GDI.RecordType.EMR_SETICMMODE:case A.Helper.GDI.RecordType.EMR_CREATECOLORSPACE:case A.Helper.GDI.RecordType.EMR_SETCOLORSPACE:case A.Helper.GDI.RecordType.EMR_DELETECOLORSPACE:case A.Helper.GDI.RecordType.EMR_GLSRECORD:case A.Helper.GDI.RecordType.EMR_GLSBOUNDEDRECORD:case A.Helper.GDI.RecordType.EMR_PIXELFORMAT:case A.Helper.GDI.RecordType.EMR_DRAWESCAPE:case A.Helper.GDI.RecordType.EMR_EXTESCAPE:case A.Helper.GDI.RecordType.EMR_SMALLTEXTOUT:case A.Helper.GDI.RecordType.EMR_FORCEUFIMAPPING:case A.Helper.GDI.RecordType.EMR_NAMEDESCAPE:case A.Helper.GDI.RecordType.EMR_COLORCORRECTPALETTE:case A.Helper.GDI.RecordType.EMR_SETICMPROFILEA:case A.Helper.GDI.RecordType.EMR_SETICMPROFILEW:case A.Helper.GDI.RecordType.EMR_ALPHABLEND:case A.Helper.GDI.RecordType.EMR_SETLAYOUT:case A.Helper.GDI.RecordType.EMR_TRANSPARENTBLT:case A.Helper.GDI.RecordType.EMR_GRADIENTFILL:case A.Helper.GDI.RecordType.EMR_SETLINKEDUFIS:case A.Helper.GDI.RecordType.EMR_SETTEXTJUSTIFICATION:case A.Helper.GDI.RecordType.EMR_COLORMATCHTOTARGETW:case A.Helper.GDI.RecordType.EMR_CREATECOLORSPACEW:default:var kt="UNKNOWN";for(var Gt in A.Helper.GDI.RecordType)if(A.Helper.GDI.RecordType[Gt]===b){kt=Gt;break}A.Helper.log("[EMF] "+kt+" record (0x"+b.toString(16)+") at offset 0x"+o.toString(16)+" with "+v+" bytes");break}o+=v},a=this;t:for(;!u;)switch(i()){case"break-main_loop":break t}if(!u)throw new A.EMFJSError("Could not read all records")}return c.prototype.play=function(s){for(var l=this._records.length,u=0;u<l;u++)this._records[u](s)},c})()}),"./src/emfjs/GDIContext.ts":((E,h,w)=>{w.r(h),w.d(h,{GDIContext:()=>u});var A=w("./src/emfjs/Helper.ts"),r=w("./src/emfjs/Primitives.ts"),n=w("./src/emfjs/Region.ts"),e=w("./src/emfjs/Style.ts"),t=(function(){var o=function(i,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,v){b.__proto__=v}||function(b,v){for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(b[_]=v[_])},o(i,a)};return function(i,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(i,a);function b(){this.constructor=i}i.prototype=a===null?Object.create(a):(b.prototype=a.prototype,new b)}})(),p=(function(o){t(i,o);function i(a,b){var v=o.call(this,"path")||this;return a!=null?v.svgPath=a:v.svgPath=b.svgPath,v}return i.prototype.clone=function(){return new i(null,this)},i.prototype.toString=function(){return"{[path]}"},i})(r.Obj);function c(){var o=function(T,k,M){return new e.Brush(null,{style:A.Helper.GDI.BrushStyle.BS_SOLID,color:new e.ColorRef(null,T,k,M)})},i=function(T,k,M){return new e.Pen(null,A.Helper.GDI.PenStyle.PS_SOLID,1,new e.ColorRef(null,T,k,M),null)},a={WHITE_BRUSH:o(255,255,255),LTGRAY_BRUSH:o(212,208,200),GRAY_BRUSH:o(128,128,128),DKGRAY_BRUSH:o(64,64,64),BLACK_BRUSH:o(0,0,0),NULL_BRUSH:new e.Brush(null,{style:A.Helper.GDI.BrushStyle.BS_NULL}),WHITE_PEN:i(255,255,255),BLACK_PEN:i(0,0,0),NULL_PEN:new e.Pen(null,A.Helper.GDI.PenStyle.PS_NULL,0,null,null),OEM_FIXED_FONT:null,ANSI_FIXED_FONT:null,ANSI_VAR_FONT:null,SYSTEM_FONT:null,DEVICE_DEFAULT_FONT:null,DEFAULT_PALETTE:null,SYSTEM_FIXED_FONT:null,DEFAULT_GUI_FONT:null},b={};for(var v in a){var _=A.Helper.GDI.StockObject[v]-2147483648;b[_.toString()]=a[v]}return b}var s=c(),l=(function(){function o(i,a){if(i!=null){this._svggroup=i._svggroup,this._svgclipChanged=i._svgclipChanged,this._svgtextbkfilter=i._svgtextbkfilter,this.mapmode=i.mapmode,this.stretchmode=i.stretchmode,this.textalign=i.textalign,this.bkmode=i.bkmode,this.textcolor=i.textcolor.clone(),this.bkcolor=i.bkcolor.clone(),this.polyfillmode=i.polyfillmode,this.miterlimit=i.miterlimit,this.wx=i.wx,this.wy=i.wy,this.ww=i.ww,this.wh=i.wh,this.vx=i.vx,this.vy=i.vy,this.vw=i.vw,this.vh=i.vh,this.x=i.x,this.y=i.y,this.nextbrx=i.nextbrx,this.nextbry=i.nextbry,this.brx=i.brx,this.bry=i.bry,this.clip=i.clip,this.ownclip=!1,this.selected={};for(var b in i.selected)this.selected[b]=i.selected[b]}else{this._svggroup=null,this._svgclipChanged=!1,this._svgtextbkfilter=null,this.mapmode=A.Helper.GDI.MapMode.MM_ANISOTROPIC,this.stretchmode=A.Helper.GDI.StretchMode.COLORONCOLOR,this.textalign=0,this.bkmode=A.Helper.GDI.MixMode.OPAQUE,this.textcolor=new e.ColorRef(null,0,0,0),this.bkcolor=new e.ColorRef(null,255,255,255),this.polyfillmode=A.Helper.GDI.PolygonFillMode.ALTERNATE,this.miterlimit=10,this.wx=0,this.wy=0,this.ww=0,this.wh=0,this.vx=0,this.vy=0,this.vw=0,this.vh=0,this.x=0,this.y=0,this.nextbrx=0,this.nextbry=0,this.brx=0,this.bry=0,this.clip=null,this.ownclip=!1,this.selected={};for(var b in a){var v=a[b];this.selected[b]=v!=null?v.clone():null}}}return o})(),u=(function(){function o(i){this._svg=i,this._svgdefs=null,this._svgPatterns={},this._svgClipPaths={},this._svgPath=null,this.defObjects={brush:new e.Brush(null,{style:A.Helper.GDI.BrushStyle.BS_SOLID,color:new e.ColorRef(null,0,0,0)}),pen:new e.Pen(null,A.Helper.GDI.PenStyle.PS_SOLID,1,new e.ColorRef(null,0,0,0),null),font:new e.Font(null,null),palette:null,region:null},this.state=new l(null,this.defObjects),this.statestack=[this.state],this.objects={}}return o.prototype.setMapMode=function(i){A.Helper.log("[gdi] setMapMode: mode="+i),this.state.mapmode=i,this.state._svggroup=null},o.prototype.setWindowOrgEx=function(i,a){A.Helper.log("[gdi] setWindowOrgEx: x="+i+" y="+a),this.state.wx=i,this.state.wy=a,this.state._svggroup=null},o.prototype.setWindowExtEx=function(i,a){A.Helper.log("[gdi] setWindowExtEx: x="+i+" y="+a),this.state.ww=i,this.state.wh=a,this.state._svggroup=null},o.prototype.setViewportOrgEx=function(i,a){A.Helper.log("[gdi] setViewportOrgEx: x="+i+" y="+a),this.state.vx=i,this.state.vy=a,this.state._svggroup=null},o.prototype.setViewportExtEx=function(i,a){A.Helper.log("[gdi] setViewportExtEx: x="+i+" y="+a),this.state.vw=i,this.state.vh=a,this.state._svggroup=null},o.prototype.setBrushOrgEx=function(i){A.Helper.log("[gdi] setBrushOrgEx: x="+i.x+" y="+i.y),this.state.nextbrx=i.x,this.state.nextbry=i.y},o.prototype.saveDC=function(){A.Helper.log("[gdi] saveDC");var i=this.state;this.state=new l(this.state),this.statestack.push(i),this.state._svggroup=null},o.prototype.restoreDC=function(i){if(A.Helper.log("[gdi] restoreDC: saved="+i),this.statestack.length>1)if(i===-1)this.state=this.statestack.pop();else{if(i<-1)throw new A.EMFJSError("restoreDC: relative restore not implemented");if(i>1)throw new A.EMFJSError("restoreDC: absolute restore not implemented")}else throw new A.EMFJSError("No saved contexts");this.state._svggroup=null},o.prototype.setStretchBltMode=function(i){A.Helper.log("[gdi] setStretchBltMode: stretchMode="+i)},o.prototype.rectangle=function(i,a,b){A.Helper.log("[gdi] rectangle: rect="+i.toString()+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());var v=this._todevY(i.bottom),_=this._todevX(i.right),T=this._todevY(i.top),k=this._todevX(i.left);a=this._todevH(a),b=this._todevH(b),A.Helper.log("[gdi] rectangle: TRANSLATED: bottom="+v+" right="+_+" top="+T+" left="+k+" rh="+b+" rw="+a),this._pushGroup();var M=this._applyOpts(null,!0,!0,!1);this._svg.rect(this.state._svggroup,k,T,_-k,v-T,a/2,b/2,M)},o.prototype.lineTo=function(i,a){A.Helper.log("[gdi] lineTo: x="+i+" y="+a+" with pen "+this.state.selected.pen.toString());var b=this._todevX(i),v=this._todevY(a),_=this._todevX(this.state.x),T=this._todevY(this.state.y);this.state.x=i,this.state.y=a,A.Helper.log("[gdi] lineTo: TRANSLATED: toX="+b+" toY="+v+" fromX="+_+" fromY="+T),this._pushGroup();var k=this._applyOpts(null,!0,!1,!1);this._svg.line(this.state._svggroup,_,T,b,v,k)},o.prototype.moveToEx=function(i,a){A.Helper.log("[gdi] moveToEx: x="+i+" y="+a),this.state.x=i,this.state.y=a,this._svgPath!=null&&(this._svgPath.move(this.state.x,this.state.y),A.Helper.log("[gdi] new path: "+this._svgPath.path()))},o.prototype.polygon=function(i,a,b){A.Helper.log("[gdi] polygon: points="+i+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());for(var v=[],_=0;_<i.length;_++){var T=i[_];v.push([this._todevX(T.x),this._todevY(T.y)])}b&&this._pushGroup();var k={"fill-rule":this.state.polyfillmode===A.Helper.GDI.PolygonFillMode.ALTERNATE?"evenodd":"nonzero"};this._applyOpts(k,!0,!0,!1),this._svg.polygon(this.state._svggroup,v,k)},o.prototype.polyPolygon=function(i,a){A.Helper.log("[gdi] polyPolygon: polygons.length="+i.length+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());for(var b=i.length,v=0;v<b;v++)this.polygon(i[v],a,v===0)},o.prototype.polyline=function(i,a,b){A.Helper.log("[gdi] polyline: isLineTo="+i.toString()+", points="+a+", bounds="+b.toString()+" with pen "+this.state.selected.pen.toString());for(var v=[],_=0;_<a.length;_++){var T=a[_];v.push([this._todevX(T.x),this._todevY(T.y)])}if(this._svgPath!=null){if(!i||v.length===0)this._svgPath.move(this._todevX(this.state.x),this._todevY(this.state.y));else{var k=v[0];this._svgPath.move(k[0],k[1])}this._svgPath.line(v),A.Helper.log("[gdi] new path: "+this._svgPath.path())}else{this._pushGroup();var M=this._applyOpts(null,!0,!1,!1);if(i&&a.length>0){var R=a[0];(R.x!==this.state.x||R.y!==this.state.y)&&v.unshift([this._todevX(this.state.x),this._todevY(this.state.y)])}this._svg.polyline(this.state._svggroup,v,M)}if(a.length>0){var O=a[a.length-1];this.state.x=O.x,this.state.y=O.y}},o.prototype.polybezier=function(i,a,b){A.Helper.log("[gdi] polybezier: isPolyBezierTo="+i.toString()+", points="+a+", bounds="+b.toString()+" with pen "+this.state.selected.pen.toString());for(var v=[],_=0;_<a.length;_++){var T=a[_];v.push({x:this._todevX(T.x),y:this._todevY(T.y)})}if(this._svgPath!=null){if(i&&v.length>0){var k=v[0];this._svgPath.move(k.x,k.y)}else this._svgPath.move(this._todevX(this.state.x),this._todevY(this.state.y));if(v.length<(i?3:4))throw new A.EMFJSError("Not enough points to draw bezier");for(var _=i?1:0;_+3<=v.length;_+=3){var M=v[_],R=v[_+1],O=v[_+2];this._svgPath.curveC(M.x,M.y,R.x,R.y,O.x,O.y)}A.Helper.log("[gdi] new path: "+this._svgPath.path())}else throw new A.EMFJSError("polybezier not implemented (not a path)");if(a.length>0){var P=a[a.length-1];this.state.x=P.x,this.state.y=P.y}},o.prototype.selectClipPath=function(i){A.Helper.log("[gdi] selectClipPath: rgnMode=0x"+i.toString(16))},o.prototype.selectClipRgn=function(i,a){if(A.Helper.log("[gdi] selectClipRgn: rgnMode=0x"+i.toString(16)),i===A.Helper.GDI.RegionMode.RGN_COPY)this.state.selected.region=a,this.state.clip=null,this.state.ownclip=!1;else throw a==null?new A.EMFJSError("No clip region to select"):new A.EMFJSError("Not implemented: rgnMode=0x"+i.toString(16));this.state._svgclipChanged=!0},o.prototype.offsetClipRgn=function(i){A.Helper.log("[gdi] offsetClipRgn: offset="+i.toString()),this._getClipRgn().offset(i.x,i.y)},o.prototype.setTextAlign=function(i){A.Helper.log("[gdi] setTextAlign: textAlignmentMode=0x"+i.toString(16)),this.state.textalign=i},o.prototype.setMiterLimit=function(i){A.Helper.log("[gdi] setMiterLimit: miterLimit="+i),this.state.miterlimit=i},o.prototype.setBkMode=function(i){A.Helper.log("[gdi] setBkMode: bkMode=0x"+i.toString(16)),this.state.bkmode=i},o.prototype.setBkColor=function(i){A.Helper.log("[gdi] setBkColor: bkColor="+i.toString()),this.state.bkcolor=i,this.state._svgtextbkfilter=null},o.prototype.setPolyFillMode=function(i){A.Helper.log("[gdi] setPolyFillMode: polyFillMode="+i),this.state.polyfillmode=i},o.prototype.createBrush=function(i,a){var b=this._storeObject(a,i);A.Helper.log("[gdi] createBrush: brush="+a.toString()+" with handle "+b)},o.prototype.createPen=function(i,a){var b=this._storeObject(a,i);A.Helper.log("[gdi] createPen: pen="+a.toString()+" width handle "+b)},o.prototype.createPenEx=function(i,a){var b=this._storeObject(a,i);A.Helper.log("[gdi] createPenEx: pen="+a.toString()+" width handle "+b)},o.prototype.selectObject=function(i,a){var b=this._getObject(i);b!=null&&(a==null||b.type===a)?(this._selectObject(b),A.Helper.log("[gdi] selectObject: objIdx="+i+(b?" selected "+b.type+": "+b.toString():"[invalid index]"))):A.Helper.log("[gdi] selectObject: objIdx="+i+(b?" invalid object type: "+b.type:"[invalid index]"))},o.prototype.abortPath=function(){A.Helper.log("[gdi] abortPath"),this._svgPath!=null&&(this._svgPath=null)},o.prototype.beginPath=function(){A.Helper.log("[gdi] beginPath"),this._svgPath!=null&&(this._svgPath=null),this._svgPath=this._svg.createPath()},o.prototype.closeFigure=function(){if(A.Helper.log("[gdi] closeFigure"),this._svgPath==null)throw new A.EMFJSError("No path bracket: cannot close figure");this._svgPath.close()},o.prototype.fillPath=function(i){if(A.Helper.log("[gdi] fillPath"),this.state.selected.path==null)throw new A.EMFJSError("No path selected");var a=this.state.selected.path,b=this._applyOpts(null,!0,!0,!1);this._svg.path(this.state._svggroup,a.svgPath,b),this._pushGroup(),this.state.selected.path=null},o.prototype.strokePath=function(i){if(A.Helper.log("[gdi] strokePath"),this.state.selected.path==null)throw new A.EMFJSError("No path selected");var a=this.state.selected.path,b=this._applyOpts({fill:"none"},!0,!1,!1);this._svg.path(this.state._svggroup,a.svgPath,b),this._pushGroup(),this.state.selected.path=null},o.prototype.endPath=function(){if(A.Helper.log("[gdi] endPath"),this._svgPath==null)throw new A.EMFJSError("No path bracket: cannot end path");this._pushGroup(),this._selectObject(new p(this._svgPath)),this._svgPath=null},o.prototype.deleteObject=function(i){var a=this._deleteObject(i);A.Helper.log("[gdi] deleteObject: objIdx="+i+(a?" deleted object":"[invalid index]"))},o.prototype._pushGroup=function(){if(this.state._svggroup==null||this.state._svgclipChanged){this.state._svgclipChanged=!1,this.state._svgtextbkfilter=null;var i={viewBox:[this.state.vx,this.state.vy,this.state.vw,this.state.vh].join(" "),preserveAspectRatio:"none"};this.state.clip!=null?(A.Helper.log("[gdi] new svg x="+this.state.vx+" y="+this.state.vy+" width="+this.state.vw+" height="+this.state.vh+" with clipping"),i["clip-path"]="url(#"+this._getSvgClipPathForRegion(this.state.clip)+")"):A.Helper.log("[gdi] new svg x="+this.state.vx+" y="+this.state.vy+" width="+this.state.vw+" height="+this.state.vh+" without clipping"),this.state._svggroup=this._svg.svg(this.state._svggroup,this.state.vx,this.state.vy,this.state.vw,this.state.vh,i)}},o.prototype._getStockObject=function(i){return i>=2147483648&&i<=2147483665?s[(i-2147483648).toString()]:i===A.Helper.GDI.StockObject.DC_BRUSH?this.state.selected.brush:i===A.Helper.GDI.StockObject.DC_PEN?this.state.selected.pen:null},o.prototype._storeObject=function(i,a){if(!a){for(a=0;this.objects[a.toString()]!=null&&a<=65535;)a++;if(a>65535)return A.Helper.log("[gdi] Too many objects!"),-1}return this.objects[a.toString()]=i,a},o.prototype._getObject=function(i){var a=this.objects[i.toString()];return a==null&&(a=this._getStockObject(i),a==null&&A.Helper.log("[gdi] No object with handle "+i)),a},o.prototype._getSvgDef=function(){return this._svgdefs==null&&(this._svgdefs=this._svg.defs()),this._svgdefs},o.prototype._getSvgClipPathForRegion=function(i){for(var a in this._svgClipPaths)if(this._svgClipPaths[a]===i)return a;var b=A.Helper._makeUniqueId("c"),v=this._svg.clipPath(this._getSvgDef(),b,"userSpaceOnUse");switch(i.complexity){case 1:this._svg.rect(v,this._todevX(i.bounds.left),this._todevY(i.bounds.top),this._todevW(i.bounds.right-i.bounds.left),this._todevH(i.bounds.bottom-i.bounds.top),{fill:"black","stroke-width":0});break;case 2:for(var _=0;_<i.scans.length;_++)for(var T=i.scans[_],k=0;k<T.scanlines.length;k++){var M=T.scanlines[k];this._svg.rect(v,this._todevX(M.left),this._todevY(T.top),this._todevW(M.right-M.left),this._todevH(T.bottom-T.top),{fill:"black","stroke-width":0})}break}return this._svgClipPaths[b]=i,b},o.prototype._getSvgPatternForBrush=function(i){for(var a in this._svgPatterns)if(this._svgPatterns[a]===i)return a;var b,v,_;switch(i.style){case A.Helper.GDI.BrushStyle.BS_PATTERN:b=i.pattern.getWidth(),v=i.pattern.getHeight();break;case A.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:b=i.dibpatternpt.getWidth(),v=i.dibpatternpt.getHeight(),_=i.dibpatternpt.base64ref();break;default:throw new A.EMFJSError("Invalid brush style")}var T=A.Helper._makeUniqueId("p"),k=this._svg.pattern(this._getSvgDef(),T,this.state.brx,this.state.bry,b,v,{patternUnits:"userSpaceOnUse"});return this._svg.image(k,0,0,b,v,_),this._svgPatterns[T]=i,T},o.prototype._selectObject=function(i){switch(this.state.selected[i.type]=i,i.type){case"region":this.state._svgclipChanged=!0;break;case"brush":this.state.brx=this.state.nextbrx,this.state.bry=this.state.nextbry;break}},o.prototype._deleteObject=function(i){var a=this.objects[i.toString()];if(a!=null){for(var b=0;b<this.statestack.length;b++){var v=this.statestack[b];v.selected[a.type]===a&&(v.selected[a.type]=this.defObjects[a.type].clone())}return delete this.objects[i.toString()],!0}return A.Helper.log("[gdi] Cannot delete object with invalid handle "+i),!1},o.prototype._getClipRgn=function(){return this.state.clip!=null?this.state.ownclip||(this.state.clip=this.state.clip.clone()):this.state.selected.region!=null?this.state.clip=this.state.selected.region.clone():this.state.clip=(0,n.CreateSimpleRegion)(this.state.wx,this.state.wy,this.state.wx+this.state.ww,this.state.wy+this.state.wh),this.state.ownclip=!0,this.state.clip},o.prototype._todevX=function(i){return Math.floor((i-this.state.wx)*(this.state.vw/this.state.ww))+this.state.vx},o.prototype._todevY=function(i){return Math.floor((i-this.state.wy)*(this.state.vh/this.state.wh))+this.state.vy},o.prototype._todevW=function(i){return Math.floor(i*(this.state.vw/this.state.ww))+this.state.vx},o.prototype._todevH=function(i){return Math.floor(i*(this.state.vh/this.state.wh))+this.state.vy},o.prototype._tologicalX=function(i){return Math.floor((i-this.state.vx)/(this.state.vw/this.state.ww))+this.state.wx},o.prototype._tologicalY=function(i){return Math.floor((i-this.state.vy)/(this.state.vh/this.state.wh))+this.state.wy},o.prototype._tologicalW=function(i){return Math.floor(i/(this.state.vw/this.state.ww))+this.state.wx},o.prototype._tologicalH=function(i){return Math.floor(i/(this.state.vh/this.state.wh))+this.state.wy},o.prototype._applyOpts=function(i,a,b,v){if(i==null&&(i={}),a){var _=this.state.selected.pen;if(_.style!==A.Helper.GDI.PenStyle.PS_NULL){i.stroke="#"+_.color.toHex(),i["stroke-width"]=_.width,i["stroke-miterlimit"]=this.state.miterlimit,i["stroke-linecap"]="round";var T=1;i["stroke-linejoin"]="round";var k=i["stroke-width"]*4,M=i["stroke-width"]*2;switch(_.style){case A.Helper.GDI.PenStyle.PS_DASH:i["stroke-dasharray"]=[k,M].toString();break;case A.Helper.GDI.PenStyle.PS_DOT:i["stroke-dasharray"]=[T,M].toString();break;case A.Helper.GDI.PenStyle.PS_DASHDOT:i["stroke-dasharray"]=[k,M,T,M].toString();break;case A.Helper.GDI.PenStyle.PS_DASHDOTDOT:i["stroke-dasharray"]=[k,M,T,M,T,M].toString();break}}}if(b){var R=this.state.selected.brush;switch(R.style){case A.Helper.GDI.BrushStyle.BS_SOLID:i.fill="#"+R.color.toHex();break;case A.Helper.GDI.BrushStyle.BS_PATTERN:case A.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:i.fill="url(#"+this._getSvgPatternForBrush(R)+")";break;case A.Helper.GDI.BrushStyle.BS_NULL:i.fill="none";break;default:A.Helper.log("[gdi] unsupported brush style: "+R.style),i.fill="none";break}}if(v){var O=this.state.selected.font;i["font-family"]=O.facename,i["font-size"]=Math.abs(O.height),i.fill="#"+this.state.textcolor.toHex()}return i},o})()}),"./src/emfjs/Helper.ts":((E,h,w)=>{w.r(h),w.d(h,{EMFJSError:()=>r,Helper:()=>t,loggingEnabled:()=>e});var A=(function(){var p=function(c,s){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&(l[o]=u[o])},p(c,s)};return function(c,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");p(c,s);function l(){this.constructor=c}c.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}})(),r=(function(p){A(c,p);function c(s){var l=this.constructor,u=p.call(this,s)||this;return Object.setPrototypeOf(u,l.prototype),u}return c})(Error),n=!0;function e(p){n=p}var t=(function(){function p(){}return p.log=function(c){n&&console.log(c)},p._makeUniqueId=function(c){return"EMFJS_"+c+this._uniqueId++},p._writeUint32Val=function(c,s,l){c[s++]=l&255,c[s++]=l>>>8&255,c[s++]=l>>>16&255,c[s++]=l>>>24&255},p._blobToBinary=function(c){for(var s="",l=c.length,u=0;u<l;u++)s+=String.fromCharCode(c[u]);return s},p.GDI={FormatSignature:{ENHMETA_SIGNATURE:1179469088,EPS_SIGNATURE:1179865157},BITMAPINFOHEADER_SIZE:40,BITMAPCOREHEADER_SIZE:12,RecordType:{EMR_POLYBEZIER:2,EMR_POLYGON:3,EMR_POLYLINE:4,EMR_POLYBEZIERTO:5,EMR_POLYLINETO:6,EMR_POLYPOLYLINE:7,EMR_POLYPOLYGON:8,EMR_SETWINDOWEXTEX:9,EMR_SETWINDOWORGEX:10,EMR_SETVIEWPORTEXTEX:11,EMR_SETVIEWPORTORGEX:12,EMR_SETBRUSHORGEX:13,EMR_EOF:14,EMR_SETPIXELV:15,EMR_SETMAPPERFLAGS:16,EMR_SETMAPMODE:17,EMR_SETBKMODE:18,EMR_SETPOLYFILLMODE:19,EMR_SETROP2:20,EMR_SETSTRETCHBLTMODE:21,EMR_SETTEXTALIGN:22,EMR_SETCOLORADJUSTMENT:23,EMR_SETTEXTCOLOR:24,EMR_SETBKCOLOR:25,EMR_OFFSETCLIPRGN:26,EMR_MOVETOEX:27,EMR_SETMETARGN:28,EMR_EXCLUDECLIPRECT:29,EMR_INTERSECTCLIPRECT:30,EMR_SCALEVIEWPORTEXTEX:31,EMR_SCALEWINDOWEXTEX:32,EMR_SAVEDC:33,EMR_RESTOREDC:34,EMR_SETWORLDTRANSFORM:35,EMR_MODIFYWORLDTRANSFORM:36,EMR_SELECTOBJECT:37,EMR_CREATEPEN:38,EMR_CREATEBRUSHINDIRECT:39,EMR_DELETEOBJECT:40,EMR_ANGLEARC:41,EMR_ELLIPSE:42,EMR_RECTANGLE:43,EMR_ROUNDRECT:44,EMR_ARC:45,EMR_CHORD:46,EMR_PIE:47,EMR_SELECTPALETTE:48,EMR_CREATEPALETTE:49,EMR_SETPALETTEENTRIES:50,EMR_RESIZEPALETTE:51,EMR_REALIZEPALETTE:52,EMR_EXTFLOODFILL:53,EMR_LINETO:54,EMR_ARCTO:55,EMR_POLYDRAW:56,EMR_SETARCDIRECTION:57,EMR_SETMITERLIMIT:58,EMR_BEGINPATH:59,EMR_ENDPATH:60,EMR_CLOSEFIGURE:61,EMR_FILLPATH:62,EMR_STROKEANDFILLPATH:63,EMR_STROKEPATH:64,EMR_FLATTENPATH:65,EMR_WIDENPATH:66,EMR_SELECTCLIPPATH:67,EMR_ABORTPATH:68,EMR_COMMENT:70,EMR_FILLRGN:71,EMR_FRAMERGN:72,EMR_INVERTRGN:73,EMR_PAINTRGN:74,EMR_EXTSELECTCLIPRGN:75,EMR_BITBLT:76,EMR_STRETCHBLT:77,EMR_MASKBLT:78,EMR_PLGBLT:79,EMR_SETDIBITSTODEVICE:80,EMR_STRETCHDIBITS:81,EMR_EXTCREATEFONTINDIRECTW:82,EMR_EXTTEXTOUTA:83,EMR_EXTTEXTOUTW:84,EMR_POLYBEZIER16:85,EMR_POLYGON16:86,EMR_POLYLINE16:87,EMR_POLYBEZIERTO16:88,EMR_POLYLINETO16:89,EMR_POLYPOLYLINE16:90,EMR_POLYPOLYGON16:91,EMR_POLYDRAW16:92,EMR_CREATEMONOBRUSH:93,EMR_CREATEDIBPATTERNBRUSHPT:94,EMR_EXTCREATEPEN:95,EMR_POLYTEXTOUTA:96,EMR_POLYTEXTOUTW:97,EMR_SETICMMODE:98,EMR_CREATECOLORSPACE:99,EMR_SETCOLORSPACE:100,EMR_DELETECOLORSPACE:101,EMR_GLSRECORD:102,EMR_GLSBOUNDEDRECORD:103,EMR_PIXELFORMAT:104,EMR_DRAWESCAPE:105,EMR_EXTESCAPE:106,EMR_SMALLTEXTOUT:108,EMR_FORCEUFIMAPPING:109,EMR_NAMEDESCAPE:110,EMR_COLORCORRECTPALETTE:111,EMR_SETICMPROFILEA:112,EMR_SETICMPROFILEW:113,EMR_ALPHABLEND:114,EMR_SETLAYOUT:115,EMR_TRANSPARENTBLT:116,EMR_GRADIENTFILL:118,EMR_SETLINKEDUFIS:119,EMR_SETTEXTJUSTIFICATION:120,EMR_COLORMATCHTOTARGETW:121,EMR_CREATECOLORSPACEW:122},MetafileEscapes:{NEWFRAME:1,ABORTDOC:2,NEXTBAND:3,SETCOLORTABLE:4,GETCOLORTABLE:5,FLUSHOUT:6,DRAFTMODE:7,QUERYESCSUPPORT:8,SETABORTPROC:9,STARTDOC:10,ENDDOC:11,GETPHYSPAGESIZE:12,GETPRINTINGOFFSET:13,GETSCALINGFACTOR:14,META_ESCAPE_ENHANCED_METAFILE:15,SETPENWIDTH:16,SETCOPYCOUNT:17,SETPAPERSOURCE:18,PASSTHROUGH:19,GETTECHNOLOGY:20,SETLINECAP:21,SETLINEJOIN:22,SETMITERLIMIT:23,BANDINFO:24,DRAWPATTERNRECT:25,GETVECTORPENSIZE:26,GETVECTORBRUSHSIZE:27,ENABLEDUPLEX:28,GETSETPAPERBINS:29,GETSETPRINTORIENT:30,ENUMPAPERBINS:31,SETDIBSCALING:32,EPSPRINTING:33,ENUMPAPERMETRICS:34,GETSETPAPERMETRICS:35,POSTSCRIPT_DATA:37,POSTSCRIPT_IGNORE:38,GETDEVICEUNITS:42,GETEXTENDEDTEXTMETRICS:256,GETPAIRKERNTABLE:258,EXTTEXTOUT:512,GETFACENAME:513,DOWNLOADFACE:514,METAFILE_DRIVER:2049,QUERYDIBSUPPORT:3073,BEGIN_PATH:4096,CLIP_TO_PATH:4097,END_PATH:4098,OPEN_CHANNEL:4110,DOWNLOADHEADER:4111,CLOSE_CHANNEL:4112,POSTSCRIPT_PASSTHROUGH:4115,ENCAPSULATED_POSTSCRIPT:4116,POSTSCRIPT_IDENTIFY:4117,POSTSCRIPT_INJECTION:4118,CHECKJPEGFORMAT:4119,CHECKPNGFORMAT:4120,GET_PS_FEATURESETTING:4121,MXDC_ESCAPE:4122,SPCLPASSTHROUGH2:4568},MapMode:{MM_TEXT:1,MM_LOMETRIC:2,MM_HIMETRIC:3,MM_LOENGLISH:4,MM_HIENGLISH:5,MM_TWIPS:6,MM_ISOTROPIC:7,MM_ANISOTROPIC:8},StretchMode:{BLACKONWHITE:1,WHITEONBLACK:2,COLORONCOLOR:3,HALFTONE:4},MixMode:{TRANSPARENT:1,OPAQUE:2},BrushStyle:{BS_SOLID:0,BS_NULL:1,BS_HATCHED:2,BS_PATTERN:3,BS_INDEXED:4,BS_DIBPATTERN:5,BS_DIBPATTERNPT:6,BS_PATTERN8X8:7,BS_DIBPATTERN8X8:8,BS_MONOPATTERN:9},PenStyle:{PS_COSMETIC:0,PS_ENDCAP_ROUND:0,PS_JOIN_ROUND:0,PS_SOLID:0,PS_DASH:1,PS_DOT:2,PS_DASHDOT:3,PS_DASHDOTDOT:4,PS_NULL:5,PS_INSIDEFRAME:6,PS_USERSTYLE:7,PS_ALTERNATE:8,PS_ENDCAP_SQUARE:256,PS_ENDCAP_FLAT:512,PS_JOIN_BEVEL:4096,PS_JOIN_MITER:8192,PS_GEOMETRIC:65536},PolygonFillMode:{ALTERNATE:1,WINDING:2},BitmapCompression:{BI_RGB:0,BI_RLE8:1,BI_RLE4:2,BI_BITFIELDS:3,BI_JPEG:4,BI_PNG:5},RegionMode:{RGN_AND:1,RGN_OR:2,RGN_XOR:3,RGN_DIFF:4,RGN_COPY:5},StockObject:{WHITE_BRUSH:2147483648,LTGRAY_BRUSH:2147483649,GRAY_BRUSH:2147483650,DKGRAY_BRUSH:2147483651,BLACK_BRUSH:2147483652,NULL_BRUSH:2147483653,WHITE_PEN:2147483654,BLACK_PEN:2147483655,NULL_PEN:2147483656,OEM_FIXED_FONT:2147483658,ANSI_FIXED_FONT:2147483659,ANSI_VAR_FONT:2147483660,SYSTEM_FONT:2147483661,DEVICE_DEFAULT_FONT:2147483662,DEFAULT_PALETTE:2147483663,SYSTEM_FIXED_FONT:2147483664,DEFAULT_GUI_FONT:2147483665,DC_BRUSH:2147483666,DC_PEN:2147483667}},p._uniqueId=0,p})()}),"./src/emfjs/Primitives.ts":((E,h,w)=>{w.r(h),w.d(h,{Obj:()=>p,PointL:()=>n,PointS:()=>r,RectL:()=>e,SizeL:()=>t});var A=w("./src/emfjs/Helper.ts"),r=(function(){function c(s,l,u){s!=null?(this.x=s.readInt16(),this.y=s.readInt16()):(this.x=l,this.y=u)}return c.prototype.clone=function(){return new c(null,this.x,this.y)},c.prototype.toString=function(){return"{x: "+this.x+", y: "+this.y+"}"},c})(),n=(function(){function c(s,l,u){s!=null?(this.x=s.readInt32(),this.y=s.readInt32()):(this.x=l,this.y=u)}return c.prototype.clone=function(){return new c(null,this.x,this.y)},c.prototype.toString=function(){return"{x: "+this.x+", y: "+this.y+"}"},c})(),e=(function(){function c(s,l,u,o,i){s!=null?(this.left=s.readInt32(),this.top=s.readInt32(),this.right=s.readInt32(),this.bottom=s.readInt32()):(this.bottom=i,this.right=o,this.top=u,this.left=l)}return c.prototype.clone=function(){return new c(null,this.left,this.top,this.right,this.bottom)},c.prototype.toString=function(){return"{left: "+this.left+", top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+"}"},c.prototype.empty=function(){return this.left>=this.right||this.top>=this.bottom},c.prototype.intersect=function(s){return this.empty()||s.empty()||this.left>=s.right||this.top>=s.bottom||this.right<=s.left||this.bottom<=s.top?null:new c(null,Math.max(this.left,s.left),Math.max(this.top,s.top),Math.min(this.right,s.right),Math.min(this.bottom,s.bottom))},c})(),t=(function(){function c(s,l,u){s!=null?(this.cx=s.readUint32(),this.cy=s.readUint32()):(this.cx=l,this.cy=u)}return c.prototype.clone=function(){return new c(null,this.cx,this.cy)},c.prototype.toString=function(){return"{cx: "+this.cx+", cy: "+this.cy+"}"},c})(),p=(function(){function c(s){this.type=s}return c.prototype.clone=function(){throw new A.EMFJSError("clone not implemented")},c.prototype.toString=function(){throw new A.EMFJSError("toString not implemented")},c})()}),"./src/emfjs/Region.ts":((E,h,w)=>{w.r(h),w.d(h,{CreateSimpleRegion:()=>t,Region:()=>e,Scan:()=>p});var A=w("./src/emfjs/Helper.ts"),r=w("./src/emfjs/Primitives.ts"),n=(function(){var c=function(s,l){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,o){u.__proto__=o}||function(u,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(u[i]=o[i])},c(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");c(s,l);function u(){this.constructor=s}s.prototype=l===null?Object.create(l):(u.prototype=l.prototype,new u)}})(),e=(function(c){n(s,c);function s(l,u){var o=c.call(this,"region")||this;if(l!=null){if(l.readUint32()!==32)throw new A.EMFJSError("Invalid region header");l.skip(4);var i=l.readUint32(),a=l.readUint32();if(i*16!==a)throw new A.EMFJSError("Invalid region data");o.bounds=new r.RectL(l),o.scans=[];for(var b=void 0,v=0;v<i;v++){var _=new r.RectL(l);b||b.top!==_.top||b.bottom!==_.bottom?(b=new p(_),o.scans.push(b)):b.append(_)}o._updateComplexity()}else if(u!=null){if(o.bounds=u.bounds!=null?u.bounds.clone():null,u.scans!=null){o.scans=[];for(var v=0;v<u.scans.length;v++)o.scans.push(u.scans[v].clone())}else o.scans=null;o.complexity=u.complexity}else o.bounds=null,o.scans=null,o.complexity=0;return o}return s.prototype.clone=function(){return new s(null,this)},s.prototype.toString=function(){return"{complexity: "+["null","simple","complex"][this.complexity]+" bounds: "+(this.bounds!=null?this.bounds.toString():"[none]")+" #scans: "+(this.scans!=null?this.scans.length:"[none]")+"}"},s.prototype._updateComplexity=function(){if(this.bounds==null)this.complexity=0,this.scans=null;else if(this.bounds.empty())this.complexity=0,this.scans=null,this.bounds=null;else if(this.scans==null)this.complexity=1;else if(this.complexity=2,this.scans.length===1){var l=this.scans[0];if(l.top===this.bounds.top&&l.bottom===this.bounds.bottom&&l.scanlines.length===1){var u=l.scanlines[0];u.left===this.bounds.left&&u.right===this.bounds.right&&(this.scans=null,this.complexity=1)}}},s.prototype.subtract=function(l){if(A.Helper.log("[emf] Region "+this.toString()+" subtract "+l.toString()),this.bounds!=null&&this.bounds.intersect(l)!=null){this.scans==null&&(this.scans=[],this.scans.push(new p(new r.RectL(null,this.bounds.left,this.bounds.top,this.bounds.right,this.bounds.bottom))),this.complexity=2);for(var u=0;u<this.scans.length;){var o=this.scans[u];if(o.bottom>=l.top){var i=o.clone();o.bottom=l.top-1,i.top=l.top,o.top>=o.bottom?this.scans[u]=i:(A.Helper.log("[emf] Region split top scan "+u+" for substraction"),this.scans.splice(++u,0,i));break}u++}for(var a=u;u<this.scans.length;){var o=this.scans[u];if(o.top>l.bottom)break;if(o.bottom>l.bottom){var i=o.clone();o.bottom=l.bottom,i.top=l.bottom+1,o.top>=o.bottom?this.scans[u]=i:(A.Helper.log("[emf] Region split bottom scan "+u+" for substraction"),this.scans.splice(++u,0,i));break}u++}if(a<this.scans.length){var b=u;for(u=a;u<b;){var o=this.scans[u];if(!o.subtract(l.left,l.right)){A.Helper.log("[emf] Region remove now empty scan "+u+" due to subtraction"),this.scans.splice(u,1),b--;continue}u++}}if(this.scans!=null){for(var v=void 0,_,T=void 0,k=void 0,M=this.scans.length,R=0;R<M;R++){var o=this.scans[R];R===0&&(_=o.top),R===M-1&&(k=o.bottom);var O=o.scanlines.length;if(O>0){var P=o.scanlines[0];(v==null||P.left<v)&&(v=P.left),P=o.scanlines[O-1],(T==null||P.right>T)&&(T=P.right)}}v!=null&&_!=null&&T!=null&&k!=null?(this.bounds=new r.RectL(null,v,_,T,k),this._updateComplexity()):(this.bounds=null,this.scans=null,this.complexity=0)}else this._updateComplexity()}A.Helper.log("[emf] Region subtraction -> "+this.toString())},s.prototype.intersect=function(l){if(A.Helper.log("[emf] Region "+this.toString()+" intersect with "+l.toString()),this.bounds!=null)if(this.bounds=this.bounds.intersect(l),this.bounds!=null){if(this.scans!=null){for(var u=0;u<this.scans.length;){var o=this.scans[u];if(o.bottom<this.bounds.top)u++;else break}for(u>0&&(A.Helper.log("[emf] Region remove "+u+" scans from top"),this.scans.splice(0,u),this.scans.length>0&&(this.scans[0].top=this.bounds.top)),u=0;u<this.scans.length;){var o=this.scans[u];if(o.top>this.bounds.bottom){A.Helper.log("[emf] Region remove "+(this.scans.length-u)+" scans from bottom"),this.scans.splice(u,this.scans.length-u);break}if(!o.intersect(this.bounds.left,this.bounds.right)){A.Helper.log("[emf] Region remove now empty scan "+u+" due to intersection"),this.scans.splice(u,1);continue}u++}this.scans.length>0&&(this.scans[this.scans.length-1].bottom=this.bounds.bottom),this._updateComplexity()}}else this.scans=null,this.complexity=0;A.Helper.log("[emf] Region intersection -> "+this.toString())},s.prototype.offset=function(l,u){if(this.bounds!=null&&(this.bounds.left+=l,this.bounds.top+=u,this.bounds.right+=l,this.bounds.bottom+=u),this.scans!=null)for(var o=this.scans.length,i=0;i<o;i++){var a=this.scans[i];a.top+=u,a.bottom+=u;for(var b=a.scanlines.length,v=0;v<b;v++){var _=a.scanlines[v];_.left+=l,_.right+=l}}},s})(r.Obj);function t(c,s,l,u){var o=new e(null,null);return o.bounds=new r.RectL(null,c,s,l,u),o._updateComplexity(),o}var p=(function(){function c(s,l){if(s!=null)this.top=s.top,this.bottom=s.bottom,this.scanlines=[{left:s.left,right:s.right}];else if(l!=null){this.top=l.top,this.bottom=l.bottom,this.scanlines=[];for(var u=0;u<l.scanlines.length;u++){var o=l.scanlines[u];this.scanlines.push({left:o.left,right:o.right})}}}return c.prototype.clone=function(){return new c(null,this)},c.prototype.append=function(s){this.scanlines.push({left:s.left,right:s.right})},c.prototype.subtract=function(s,l){for(var u=0;u<this.scanlines.length;){var o=this.scanlines[u];if(o.left<=s){if(o.right>=s&&(o.right=s-1,o.left>=o.right)){this.scanlines.splice(u,1);continue}u++}else break}for(var i=u,a=0;u<this.scanlines.length;){var o=this.scanlines[u];if(o.right>l){o.left=l,a=u-i,o.left>=o.right&&a++;break}u++}return a>0&&i<this.scanlines.length&&this.scanlines.splice(i,a),this.scanlines.length>0},c.prototype.intersect=function(s,l){for(var u=0;u<this.scanlines.length;u++){var o=this.scanlines[u];if(o.left>=s||o.right>=s){u>0&&this.scanlines.splice(0,u);break}}if(this.scanlines.length>0){var o=this.scanlines[0];o.left<s&&(o.left=s);for(var u=0;u<this.scanlines.length;u++)if(o=this.scanlines[u],o.left>l){this.scanlines.splice(u,this.scanlines.length-u);break}this.scanlines.length>0&&(o=this.scanlines[this.scanlines.length-1],o.right>l&&(o.right=l))}return this.scanlines.length>0},c})()}),"./src/emfjs/Renderer.ts":((E,h,w)=>{w.r(h),w.d(h,{Renderer:()=>p});var A=w("./src/util/index.ts"),r=w("./src/emfjs/Blob.ts"),n=w("./src/emfjs/EMFRecords.ts"),e=w("./src/emfjs/GDIContext.ts"),t=w("./src/emfjs/Helper.ts"),p=(function(){function s(l){this.parse(l),t.Helper.log("EMFJS.Renderer instantiated")}return s.prototype.render=function(l){var u=document.createElementNS("http://www.w3.org/2000/svg","svg");return this._render(new A.SVG(u),l.mapMode,l.wExt,l.hExt,l.xExt,l.yExt),u.setAttribute("viewBox",[0,0,l.xExt,l.yExt].join(" ")),u.setAttribute("preserveAspectRatio","none"),u.setAttribute("width",l.width),u.setAttribute("height",l.height),u},s.prototype.parse=function(l){this._img=null;var u=new r.Blob(l);if(u.readUint32()!==1)throw new t.EMFJSError("Not an EMF file");var o=u.readUint32();if(o%4!==0)throw new t.EMFJSError("Not an EMF file");if(this._img=new c(u,o),this._img==null)throw new t.EMFJSError("Format not recognized")},s.prototype._render=function(l,u,o,i,a,b){var v=new e.GDIContext(l);v.setWindowExtEx(o,i),v.setViewportExtEx(a,b),v.setMapMode(u),t.Helper.log("[EMF] BEGIN RENDERING --->"),this._img.render(v),t.Helper.log("[EMF] <--- DONE RENDERING")},s})(),c=(function(){function s(l,u){this._hdrsize=u,this._records=new n.EMFRecords(l,this._hdrsize)}return s.prototype.render=function(l){this._records.play(l)},s})()}),"./src/emfjs/Style.ts":((E,h,w)=>{w.r(h),w.d(h,{Brush:()=>c,ColorRef:()=>t,Font:()=>p,Pen:()=>s});var A=w("./src/emfjs/Bitmap.ts"),r=w("./src/emfjs/Helper.ts"),n=w("./src/emfjs/Primitives.ts"),e=(function(){var l=function(u,o){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&(i[b]=a[b])},l(u,o)};return function(u,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");l(u,o);function i(){this.constructor=u}u.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)}})(),t=(function(){function l(u,o,i,a){u!=null?(this.r=u.readUint8(),this.g=u.readUint8(),this.b=u.readUint8(),u.skip(1)):(this.r=o,this.g=i,this.b=a)}return l.prototype.clone=function(){return new l(null,this.r,this.g,this.b)},l.prototype.toHex=function(){return(16777216+(this.r<<16|this.g<<8|this.b)).toString(16).slice(1)},l.prototype.toString=function(){return"{r: "+this.r+", g: "+this.g+", b: "+this.b+"}"},l})(),p=(function(l){e(u,l);function u(o,i){var a=l.call(this,"font")||this;if(o!=null){a.height=o.readInt32(),a.width=o.readInt32(),a.escapement=o.readInt32(),a.orientation=o.readInt32(),a.weight=o.readInt32(),a.italic=o.readUint8(),a.underline=o.readUint8(),a.strikeout=o.readUint8(),a.charset=o.readUint8(),a.outprecision=o.readUint8(),a.clipprecision=o.readUint8(),a.quality=o.readUint8();var b=o.readUint8();a.pitch=b&15,a.family=b>>6&3;var v=i,_=o.pos;a.facename=o.readFixedSizeUnicodeString(Math.min(v-(o.pos-_),32))}else i!=null?(i=i,a.height=i.height,a.width=i.width,a.escapement=i.escapement,a.orientation=i.orientation,a.weight=i.weight,a.italic=i.italic,a.underline=i.underline,a.strikeout=i.strikeout,a.charset=i.charset,a.outprecision=i.outprecision,a.clipprecision=i.clipprecision,a.quality=i.quality,a.pitch=i.pitch,a.family=i.family,a.facename=i.facename):(a.height=-80,a.width=0,a.escapement=0,a.orientation=0,a.weight=400,a.italic=0,a.underline=0,a.strikeout=0,a.charset=0,a.outprecision=0,a.clipprecision=0,a.quality=0,a.pitch=0,a.family=0,a.facename="Helvetica");return a}return u.prototype.clone=function(){return new u(null,this)},u.prototype.toString=function(){return JSON.stringify(this)},u})(n.Obj),c=(function(l){e(u,l);function u(o,i){var a=l.call(this,"brush")||this;if(o!=null){var b=o.pos;switch(a.style=o.readUint32(),a.style){case r.Helper.GDI.BrushStyle.BS_SOLID:a.color=new t(o);break;case r.Helper.GDI.BrushStyle.BS_PATTERN:a.pattern=new A.DIBitmap(o);break;case r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:a.dibpatternpt=new A.DIBitmap(o);break;case r.Helper.GDI.BrushStyle.BS_HATCHED:a.color=new t(o),a.hatchstyle=o.readUint32();break}o.seek(b+12)}else switch(a.style=i.style,a.style){case r.Helper.GDI.BrushStyle.BS_SOLID:a.color=i.color.clone();break;case r.Helper.GDI.BrushStyle.BS_PATTERN:a.pattern=i.pattern;break;case r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:a.dibpatternpt=i.dibpatternpt;break;case r.Helper.GDI.BrushStyle.BS_HATCHED:a.color=i.color.clone(),a.hatchstyle=i.hatchstyle;break}return a}return u.prototype.clone=function(){return new u(null,this)},u.prototype.toString=function(){var o="{style: "+this.style;switch(this.style){case r.Helper.GDI.BrushStyle.BS_SOLID:o+=", color: "+this.color.toString();break;case r.Helper.GDI.BrushStyle.BS_HATCHED:o+=", color: "+this.color.toString()+", hatchstyle: "+this.hatchstyle;break}return o+"}"},u})(n.Obj),s=(function(l){e(u,l);function u(o,i,a,b,v){var _=l.call(this,"pen")||this;return o!=null?i!=null?(_.style=o.readUint32()&255,_.width=o.readUint32(),_.brush=new c(o),_.color=_.brush.color!=null?_.brush.color.clone():new t(null,0,0,0)):(_.style=o.readUint32()&255,_.width=new n.PointL(o).x,_.color=new t(o)):(_.style=i,_.width=a,b!=null&&(_.color=b),v!=null&&(_.brush=v)),_}return u.prototype.clone=function(){return new u(null,this.style,this.width,this.color!=null?this.color.clone():null,this.brush!=null?this.brush.clone():null)},u.prototype.toString=function(){return"{style: "+this.style+", width: "+this.width+", color: "+(this.color!=null?this.color.toString():"none")+"}"},u})(n.Obj)}),"./src/util/SVG.ts":((E,h,w)=>{w.r(h),w.d(h,{SVG:()=>n,SVGFilters:()=>A,SVGPathBuilder:()=>r});var A=(function(){function e(){}return e.prototype.flood=function(t,p,c,s,l){var u=document.createElementNS("http://www.w3.org/2000/svg","feFlood");p&&u.setAttribute("id",p),u.setAttribute("flood-color",c),u.setAttribute("flood-opacity",s.toString()),t.appendChild(u)},e.prototype.composite=function(t,p,c,s,l,u,o,i,a){var b=document.createElementNS("http://www.w3.org/2000/svg","feComposite");p&&b.setAttribute("id",p),b.setAttribute("in",c),b.setAttribute("in2",s),t.appendChild(b)},e})(),r=(function(){function e(){this._path=""}return e.prototype.move=function(t,p){this._path+=" M ".concat(t," ").concat(p)},e.prototype.path=function(){return this._path.substr(1)},e.prototype.line=function(t){var p=this;t.forEach(function(c){p._path+=" L ".concat(c[0]," ").concat(c[1])})},e.prototype.curveC=function(t,p,c,s,l,u){this._path+=" C ".concat(t," ").concat(p,", ").concat(c," ").concat(s,", ").concat(l," ").concat(u)},e.prototype.close=function(){this._path+=" Z"},e})(),n=(function(){function e(t){this.filters=new A,this._defs=void 0,this._svg=t}return e.prototype.svg=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");return o.setAttribute("x",p.toString()),o.setAttribute("y",c.toString()),o.setAttribute("width",s.toString()),o.setAttribute("height",l.toString()),this._appendSettings(u,o),t!=null?t.appendChild(o):this._svg.appendChild(o),o},e.prototype.image=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.setAttribute("x",p.toString()),i.setAttribute("y",c.toString()),i.setAttribute("width",s.toString()),i.setAttribute("height",l.toString()),i.setAttributeNS("http://www.w3.org/1999/xlink","href",u),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.rect=function(t,p,c,s,l,u,o,i){var a=document.createElementNS("http://www.w3.org/2000/svg","rect");return a.setAttribute("x",p.toString()),a.setAttribute("y",c.toString()),a.setAttribute("width",s.toString()),a.setAttribute("height",l.toString()),u!==void 0&&(u instanceof Number?a.setAttribute("rx",u.toString()):u instanceof Object&&this._appendSettings(u,a)),o!==void 0&&a.setAttribute("ry",o.toString()),this._appendSettings(i,a),t.appendChild(a),a},e.prototype.line=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","line");return o.setAttribute("x1",p.toString()),o.setAttribute("y1",c.toString()),o.setAttribute("x2",s.toString()),o.setAttribute("y2",l.toString()),this._appendSettings(u,o),t.appendChild(o),o},e.prototype.polygon=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","polygon");return s.setAttribute("points",p.map(function(l){return l.join(",")}).join(" ")),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.polyline=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","polyline");return s.setAttribute("points",p.map(function(l){return l.join(",")}).join(" ")),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.ellipse=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return o.setAttribute("cx",p.toString()),o.setAttribute("cy",c.toString()),o.setAttribute("rx",s.toString()),o.setAttribute("ry",l.toString()),this._appendSettings(u,o),t.appendChild(o),o},e.prototype.path=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",p.path()),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.text=function(t,p,c,s,l){var u=document.createElementNS("http://www.w3.org/2000/svg","text");u.setAttribute("x",p.toString()),u.setAttribute("y",c.toString()),this._appendSettings(l,u);var o=document.createTextNode(s);return u.appendChild(o),t.appendChild(u),u},e.prototype.filter=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","filter");return i.setAttribute("x",c.toString()),i.setAttribute("y",s.toString()),i.setAttribute("width",l.toString()),i.setAttribute("height",u.toString()),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.pattern=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","pattern");return p&&i.setAttribute("id",p),i.setAttribute("x",c.toString()),i.setAttribute("y",s.toString()),i.setAttribute("width",l.toString()),i.setAttribute("height",u.toString()),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.defs=function(){if(this._defs===void 0){var t=document.createElementNS("http://www.w3.org/2000/svg","defs");this._svg.appendChild(t),this._defs=t}return this._defs},e.prototype.clipPath=function(t,p,c,s){var l=document.createElementNS("http://www.w3.org/2000/svg","clipPath");return p&&l.setAttribute("id",p),c===void 0&&(c="userSpaceOnUse"),l.setAttribute("clipPathUnits",c),this._appendSettings(s,l),t.appendChild(l),l},e.prototype.createPath=function(){return new r},e.prototype._appendSettings=function(t,p){t!==void 0&&Object.keys(t).forEach(function(c){p.setAttribute(c,t[c])})},e})()}),"./src/util/index.ts":((E,h,w)=>{w.r(h),w.d(h,{SVG:()=>A.SVG});var A=w("./src/util/SVG.ts")})},f={};function g(E){var h=f[E];if(h!==void 0)return h.exports;var w=f[E]={exports:{}};return d[E](w,w.exports,g),w.exports}g.d=(E,h)=>{for(var w in h)g.o(h,w)&&!g.o(E,w)&&Object.defineProperty(E,w,{enumerable:!0,get:h[w]})},g.o=(E,h)=>Object.prototype.hasOwnProperty.call(E,h),g.r=E=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(E,"__esModule",{value:!0})};var y={};return(()=>{g.r(y),g.d(y,{Error:()=>h.EMFJSError,Renderer:()=>E.Renderer,loggingEnabled:()=>h.loggingEnabled});var E=g("./src/emfjs/Renderer.ts"),h=g("./src/emfjs/Helper.ts")})(),y})())})),mo=We(((m,C)=>{(function(f,g){typeof m=="object"&&typeof C=="object"?C.exports=g():typeof define=="function"&&define.amd?define([],g):typeof m=="object"?m.WMFJS=g():f.WMFJS=g()})(m,()=>(()=>{"use strict";var d={"./src/util/SVG.ts":((E,h,w)=>{w.r(h),w.d(h,{SVG:()=>n,SVGFilters:()=>A,SVGPathBuilder:()=>r});var A=(function(){function e(){}return e.prototype.flood=function(t,p,c,s,l){var u=document.createElementNS("http://www.w3.org/2000/svg","feFlood");p&&u.setAttribute("id",p),u.setAttribute("flood-color",c),u.setAttribute("flood-opacity",s.toString()),t.appendChild(u)},e.prototype.composite=function(t,p,c,s,l,u,o,i,a){var b=document.createElementNS("http://www.w3.org/2000/svg","feComposite");p&&b.setAttribute("id",p),b.setAttribute("in",c),b.setAttribute("in2",s),t.appendChild(b)},e})(),r=(function(){function e(){this._path=""}return e.prototype.move=function(t,p){this._path+=" M ".concat(t," ").concat(p)},e.prototype.path=function(){return this._path.substr(1)},e.prototype.line=function(t){var p=this;t.forEach(function(c){p._path+=" L ".concat(c[0]," ").concat(c[1])})},e.prototype.curveC=function(t,p,c,s,l,u){this._path+=" C ".concat(t," ").concat(p,", ").concat(c," ").concat(s,", ").concat(l," ").concat(u)},e.prototype.close=function(){this._path+=" Z"},e})(),n=(function(){function e(t){this.filters=new A,this._defs=void 0,this._svg=t}return e.prototype.svg=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","svg");return o.setAttribute("x",p.toString()),o.setAttribute("y",c.toString()),o.setAttribute("width",s.toString()),o.setAttribute("height",l.toString()),this._appendSettings(u,o),t!=null?t.appendChild(o):this._svg.appendChild(o),o},e.prototype.image=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","image");return i.setAttribute("x",p.toString()),i.setAttribute("y",c.toString()),i.setAttribute("width",s.toString()),i.setAttribute("height",l.toString()),i.setAttributeNS("http://www.w3.org/1999/xlink","href",u),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.rect=function(t,p,c,s,l,u,o,i){var a=document.createElementNS("http://www.w3.org/2000/svg","rect");return a.setAttribute("x",p.toString()),a.setAttribute("y",c.toString()),a.setAttribute("width",s.toString()),a.setAttribute("height",l.toString()),u!==void 0&&(u instanceof Number?a.setAttribute("rx",u.toString()):u instanceof Object&&this._appendSettings(u,a)),o!==void 0&&a.setAttribute("ry",o.toString()),this._appendSettings(i,a),t.appendChild(a),a},e.prototype.line=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","line");return o.setAttribute("x1",p.toString()),o.setAttribute("y1",c.toString()),o.setAttribute("x2",s.toString()),o.setAttribute("y2",l.toString()),this._appendSettings(u,o),t.appendChild(o),o},e.prototype.polygon=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","polygon");return s.setAttribute("points",p.map(function(l){return l.join(",")}).join(" ")),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.polyline=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","polyline");return s.setAttribute("points",p.map(function(l){return l.join(",")}).join(" ")),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.ellipse=function(t,p,c,s,l,u){var o=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return o.setAttribute("cx",p.toString()),o.setAttribute("cy",c.toString()),o.setAttribute("rx",s.toString()),o.setAttribute("ry",l.toString()),this._appendSettings(u,o),t.appendChild(o),o},e.prototype.path=function(t,p,c){var s=document.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",p.path()),this._appendSettings(c,s),t.appendChild(s),s},e.prototype.text=function(t,p,c,s,l){var u=document.createElementNS("http://www.w3.org/2000/svg","text");u.setAttribute("x",p.toString()),u.setAttribute("y",c.toString()),this._appendSettings(l,u);var o=document.createTextNode(s);return u.appendChild(o),t.appendChild(u),u},e.prototype.filter=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","filter");return i.setAttribute("x",c.toString()),i.setAttribute("y",s.toString()),i.setAttribute("width",l.toString()),i.setAttribute("height",u.toString()),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.pattern=function(t,p,c,s,l,u,o){var i=document.createElementNS("http://www.w3.org/2000/svg","pattern");return p&&i.setAttribute("id",p),i.setAttribute("x",c.toString()),i.setAttribute("y",s.toString()),i.setAttribute("width",l.toString()),i.setAttribute("height",u.toString()),this._appendSettings(o,i),t.appendChild(i),i},e.prototype.defs=function(){if(this._defs===void 0){var t=document.createElementNS("http://www.w3.org/2000/svg","defs");this._svg.appendChild(t),this._defs=t}return this._defs},e.prototype.clipPath=function(t,p,c,s){var l=document.createElementNS("http://www.w3.org/2000/svg","clipPath");return p&&l.setAttribute("id",p),c===void 0&&(c="userSpaceOnUse"),l.setAttribute("clipPathUnits",c),this._appendSettings(s,l),t.appendChild(l),l},e.prototype.createPath=function(){return new r},e.prototype._appendSettings=function(t,p){t!==void 0&&Object.keys(t).forEach(function(c){p.setAttribute(c,t[c])})},e})()}),"./src/util/index.ts":((E,h,w)=>{w.r(h),w.d(h,{SVG:()=>A.SVG});var A=w("./src/util/SVG.ts")}),"./src/wmfjs/Bitmap.ts":((E,h,w)=>{w.r(h),w.d(h,{Bitmap16:()=>c,BitmapInfo:()=>t,DIBitmap:()=>p,PatternBitmap16:()=>s});var A=w("./src/wmfjs/Helper.ts"),r=(function(){var l=function(u,o){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&(i[b]=a[b])},l(u,o)};return function(u,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");l(u,o);function i(){this.constructor=u}u.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)}})(),n=(function(){function l(u,o){o&&u.skip(4),this.width=u.readUint16(),this.height=u.readUint16(),this.planes=u.readUint16(),this.bitcount=u.readUint16()}return l.prototype.colors=function(){return this.bitcount<=8?1<<this.bitcount:0},l})(),e=(function(){function l(u,o){o&&u.skip(4),this.width=u.readInt32(),this.height=u.readInt32(),this.planes=u.readUint16(),this.bitcount=u.readUint16(),this.compression=u.readUint32(),this.sizeimage=u.readUint32(),this.xpelspermeter=u.readInt32(),this.ypelspermeter=u.readInt32(),this.clrused=u.readUint32(),this.clrimportant=u.readUint32()}return l.prototype.colors=function(){return this.clrused!==0?this.clrused<256?this.clrused:256:this.bitcount>8?0:1<<this.bitcount},l})(),t=(function(){function l(u,o){this._reader=u,this._offset=u.pos,this._usergb=o;var i=u.readUint32();if(this._infosize=i,i===A.Helper.GDI.BITMAPCOREHEADER_SIZE)this._header=new n(u,!1),this._infosize+=this._header.colors()*(o?3:2);else{this._header=new e(u,!1);var a=this._header.compression===A.Helper.GDI.BitmapCompression.BI_BITFIELDS?3:0;i<=A.Helper.GDI.BITMAPINFOHEADER_SIZE+a*4&&(this._infosize=A.Helper.GDI.BITMAPINFOHEADER_SIZE+a*4),this._infosize+=this._header.colors()*(o?4:2)}}return l.prototype.getWidth=function(){return this._header.width},l.prototype.getHeight=function(){return Math.abs(this._header.height)},l.prototype.infosize=function(){return this._infosize},l.prototype.header=function(){return this._header},l})(),p=(function(){function l(u,o){this._reader=u,this._offset=u.pos,this._size=o,this._info=new t(u,!0)}return l.prototype.getWidth=function(){return this._info.getWidth()},l.prototype.getHeight=function(){return this._info.getHeight()},l.prototype.base64ref=function(){var u=this._reader.pos;this._reader.seek(this._offset);var o="image/bmp",i=this._info.header(),a;if(i instanceof e&&i.compression!=null)switch(i.compression){case A.Helper.GDI.BitmapCompression.BI_JPEG:o="data:image/jpeg";break;case A.Helper.GDI.BitmapCompression.BI_PNG:o="data:image/png";break;default:a=this.makeBitmapFileHeader();break}else a=this.makeBitmapFileHeader();a!=null?a+=this._reader.readBinary(this._size):a=this._reader.readBinary(this._size);var b="data:"+o+";base64,"+btoa(a);return this._reader.seek(u),b},l.prototype.makeBitmapFileHeader=function(){var u=new Uint8Array(new ArrayBuffer(14));return u[0]=66,u[1]=77,A.Helper._writeUint32Val(u,2,this._size+14),A.Helper._writeUint32Val(u,10,this._info.infosize()+14),A.Helper._blobToBinary(u)},l})(),c=(function(){function l(u,o){if(u!=null){if(o=o,this._reader=u,this._offset=u.pos,this._size=o,this.type=u.readInt16(),this.width=u.readInt16(),this.height=u.readInt16(),this.widthBytes=u.readInt16(),this.planes=u.readUint8(),this.bitsPixel=u.readUint8(),this.bitsOffset=u.pos,this.bitsSize=(this.width*this.bitsPixel+15>>4<<1)*this.height,this.bitsSize>o-10)throw new A.WMFJSError("Bitmap should have "+this.bitsSize+" bytes, but has "+(o-10))}else{var i=o;this._reader=i._reader,this._offset=i._offset,this._size=i._size,this.type=i.type,this.width=i.width,this.height=i.height,this.widthBytes=i.widthBytes,this.planes=i.planes,this.bitsPixel=i.bitsPixel,this.bitsOffset=i.bitsOffset,this.bitsSize=i.bitsSize}}return l.prototype.getWidth=function(){return this.width},l.prototype.getHeight=function(){return this.height},l.prototype.clone=function(){return new l(null,this)},l})(),s=(function(l){r(u,l);function u(o,i){var a=l.call(this,o,i)||this;return o!=null&&(a.bitsOffset+=22),a}return u.prototype.clone=function(){return new u(null,this)},u})(c)}),"./src/wmfjs/Blob.ts":((E,h,w)=>{w.r(h),w.d(h,{Blob:()=>r});var A=w("./src/wmfjs/Helper.ts"),r=(function(){function n(e,t){e instanceof n?(this.blob=e.blob,this.data=e.data,this.pos=t||e.pos):(this.blob=e,this.data=new Uint8Array(e),this.pos=t||0)}return n.prototype.eof=function(){return this.pos>=this.data.length},n.prototype.seek=function(e){if(e<0||e>this.data.length)throw new A.WMFJSError("Invalid seek position");this.pos=e},n.prototype.skip=function(e){var t=this.pos+e;if(t>this.data.length)throw new A.WMFJSError("Unexpected end of file");this.pos=t},n.prototype.readBinary=function(e){if(this.pos+e>this.data.length)throw new A.WMFJSError("Unexpected end of file");for(var t="";e-- >0;)t+=String.fromCharCode(this.data[this.pos++]);return t},n.prototype.readInt8=function(){if(this.pos+1>this.data.length)throw new A.WMFJSError("Unexpected end of file");return this.data[this.pos++]},n.prototype.readUint8=function(){return this.readInt8()>>>0},n.prototype.readInt32=function(){if(this.pos+4>this.data.length)throw new A.WMFJSError("Unexpected end of file");var e=this.data[this.pos++];return e|=this.data[this.pos++]<<8,e|=this.data[this.pos++]<<16,e|=this.data[this.pos++]<<24,e},n.prototype.readUint32=function(){return this.readInt32()>>>0},n.prototype.readUint16=function(){if(this.pos+2>this.data.length)throw new A.WMFJSError("Unexpected end of file");var e=this.data[this.pos++];return e|=this.data[this.pos++]<<8,e},n.prototype.readInt16=function(){var e=this.readUint16();return e>32767&&(e-=65536),e},n.prototype.readString=function(e){if(this.pos+e>this.data.length)throw new A.WMFJSError("Unexpected end of file");for(var t="",p=0;p<e;p++)t+=String.fromCharCode(this.data[this.pos++]>>>0);return t},n.prototype.readNullTermString=function(e){var t="";if(e>0){e--;for(var p=0;p<e;p++){if(this.pos+p+1>this.data.length)throw new A.WMFJSError("Unexpected end of file");var c=this.data[this.pos+p]>>>0;if(c===0)break;t+=String.fromCharCode(c)}}return t},n})()}),"./src/wmfjs/GDIContext.ts":((E,h,w)=>{w.r(h),w.d(h,{GDIContext:()=>p});var A=w("./src/wmfjs/Helper.ts"),r=w("./src/wmfjs/Primitives.ts"),n=w("./src/wmfjs/Region.ts"),e=w("./src/wmfjs/Style.ts"),t=(function(){function c(s,l){if(s!=null){this._svggroup=s._svggroup,this._svgclipChanged=s._svgclipChanged,this._svgtextbkfilter=s._svgtextbkfilter,this.mapmode=s.mapmode,this.stretchmode=s.stretchmode,this.textalign=s.textalign,this.bkmode=s.bkmode,this.textcolor=s.textcolor.clone(),this.bkcolor=s.bkcolor.clone(),this.polyfillmode=s.polyfillmode,this.wx=s.wx,this.wy=s.wy,this.ww=s.ww,this.wh=s.wh,this.vx=s.vx,this.vy=s.vy,this.vw=s.vw,this.vh=s.vh,this.x=s.x,this.y=s.y,this.clip=s.clip,this.ownclip=!1,this.selected={};for(var u in s.selected)this.selected[u]=s.selected[u]}else{this._svggroup=null,this._svgclipChanged=!1,this._svgtextbkfilter=null,this.mapmode=A.Helper.GDI.MapMode.MM_ANISOTROPIC,this.stretchmode=A.Helper.GDI.StretchMode.COLORONCOLOR,this.textalign=0,this.bkmode=A.Helper.GDI.MixMode.OPAQUE,this.textcolor=new e.ColorRef(null,0,0,0),this.bkcolor=new e.ColorRef(null,255,255,255),this.polyfillmode=A.Helper.GDI.PolyFillMode.ALTERNATE,this.wx=0,this.wy=0,this.ww=0,this.wh=0,this.vx=0,this.vy=0,this.vw=0,this.vh=0,this.x=0,this.y=0,this.clip=null,this.ownclip=!1,this.selected={};for(var u in l){var o=l[u];this.selected[u]=o!=null?o.clone():null}}}return c})(),p=(function(){function c(s){this._svg=s,this._svgdefs=null,this._svgPatterns={},this._svgClipPaths={},this.defObjects={brush:new e.Brush(null,null),pen:new e.Pen(null,A.Helper.GDI.PenStyle.PS_SOLID,new r.PointS(null,1,1),new e.ColorRef(null,0,0,0),0,0),font:new e.Font(null,null),palette:null,region:null},this.state=new t(null,this.defObjects),this.statestack=[this.state],this.objects={}}return c.prototype.setMapMode=function(s){A.Helper.log("[gdi] setMapMode: mode="+s),this.state.mapmode=s,this.state._svggroup=null},c.prototype.setWindowOrg=function(s,l){A.Helper.log("[gdi] setWindowOrg: x="+s+" y="+l),this.state.wx=s,this.state.wy=l,this.state._svggroup=null},c.prototype.setWindowExt=function(s,l){A.Helper.log("[gdi] setWindowExt: x="+s+" y="+l),this.state.ww=s,this.state.wh=l,this.state._svggroup=null},c.prototype.offsetWindowOrg=function(s,l){A.Helper.log("[gdi] offsetWindowOrg: offX="+s+" offY="+l),this.state.wx+=s,this.state.wy+=l,this.state._svggroup=null},c.prototype.setViewportOrg=function(s,l){A.Helper.log("[gdi] setViewportOrg: x="+s+" y="+l),this.state.vx=s,this.state.vy=l,this.state._svggroup=null},c.prototype.setViewportExt=function(s,l){A.Helper.log("[gdi] setViewportExt: x="+s+" y="+l),this.state.vw=s,this.state.vh=l,this.state._svggroup=null},c.prototype.offsetViewportOrg=function(s,l){A.Helper.log("[gdi] offsetViewportOrg: offX="+s+" offY="+l),this.state.vx+=s,this.state.vy+=l,this.state._svggroup=null},c.prototype.saveDC=function(){A.Helper.log("[gdi] saveDC");var s=this.state;this.state=new t(this.state),this.statestack.push(s),this.state._svggroup=null},c.prototype.restoreDC=function(s){if(A.Helper.log("[gdi] restoreDC: saved="+s),this.statestack.length>1)if(s===-1)this.state=this.statestack.pop();else{if(s<-1)throw new A.WMFJSError("restoreDC: relative restore not implemented");if(s>1)throw new A.WMFJSError("restoreDC: absolute restore not implemented")}else throw new A.WMFJSError("No saved contexts");this.state._svggroup=null},c.prototype.escape=function(s,l,u,o){A.Helper.log("[gdi] escape: func="+s+" offset="+u+" count="+o)},c.prototype.setStretchBltMode=function(s){A.Helper.log("[gdi] setStretchBltMode: stretchMode="+s)},c.prototype.stretchDib=function(s,l,u,o,i,a,b,v,_,T,k){A.Helper.log("[gdi] stretchDib: srcX="+s+" srcY="+l+" srcW="+u+" srcH="+o+" dstX="+i+" dstY="+a+" dstW="+b+" dstH="+v+" rasterOp=0x"+_.toString(16)),s=this._todevX(s),l=this._todevY(l),u=this._todevW(u),o=this._todevH(o),i=this._todevX(i),a=this._todevY(a),b=this._todevW(b),v=this._todevH(v),A.Helper.log("[gdi] stretchDib: TRANSLATED: srcX="+s+" srcY="+l+" srcW="+u+" srcH="+o+" dstX="+i+" dstY="+a+" dstW="+b+" dstH="+v+" rasterOp=0x"+_.toString(16)+" colorUsage=0x"+T.toString(16)),this._pushGroup(),this._svg.image(this.state._svggroup,i,a,b,v,k.base64ref())},c.prototype.dibBits=function(s,l,u,o,i,a,b,v){A.Helper.log("[gdi] stretchDibBits: srcX="+s+" srcY="+l+" dstX="+u+" dstY="+o+" width="+i+" height="+a+" rasterOp=0x"+b.toString(16)),s=this._todevX(s),l=this._todevY(l),u=this._todevX(u),o=this._todevY(o),i=this._todevW(i),a=this._todevH(a),A.Helper.log("[gdi] dibBits: TRANSLATED: srcX="+s+" srcY="+l+NaN+u+" dstY="+o+" width="+i+" height="+a+" rasterOp=0x"+b.toString(16)),this._pushGroup(),this._svg.image(this.state._svggroup,u,o,i,a,v.base64ref())},c.prototype.stretchDibBits=function(s,l,u,o,i,a,b,v,_,T){A.Helper.log("[gdi] stretchDibBits: srcX="+s+" srcY="+l+" srcW="+u+" srcH="+o+" dstX="+i+" dstY="+a+" dstW="+b+" dstH="+v+" rasterOp=0x"+_.toString(16)),s=this._todevX(s),l=this._todevY(l),u=this._todevW(u),o=this._todevH(o),i=this._todevX(i),a=this._todevY(a),b=this._todevW(b),v=this._todevH(v),A.Helper.log("[gdi] stretchDibBits: TRANSLATED: srcX="+s+" srcY="+l+" srcW="+u+" srcH="+o+" dstX="+i+" dstY="+a+" dstW="+b+" dstH="+v+" rasterOp=0x"+_.toString(16)),this._pushGroup(),this._svg.image(this.state._svggroup,i,a,b,v,T.base64ref())},c.prototype.rectangle=function(s,l,u){A.Helper.log("[gdi] rectangle: rect="+s.toString()+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());var o=this._todevY(s.bottom),i=this._todevX(s.right),a=this._todevY(s.top),b=this._todevX(s.left);l=this._todevH(l),u=this._todevH(u),A.Helper.log("[gdi] rectangle: TRANSLATED: bottom="+o+" right="+i+" top="+a+" left="+b+" rh="+u+" rw="+l),this._pushGroup();var v=this._applyOpts(null,!0,!0,!1);this._svg.rect(this.state._svggroup,b,a,i-b,o-a,l/2,u/2,v)},c.prototype.textOut=function(s,l,u){A.Helper.log("[gdi] textOut: x="+s+" y="+l+" text="+u+" with font "+this.state.selected.font.toString()),s=this._todevX(s),l=this._todevY(l),A.Helper.log("[gdi] textOut: TRANSLATED: x="+s+" y="+l),this._pushGroup();var o=this._applyOpts(null,!1,!1,!0);if(this.state.selected.font.escapement!==0&&(o.transform="rotate("+[-this.state.selected.font.escapement/10,s,l]+")",o.style="dominant-baseline: middle; text-anchor: start;"),this.state.bkmode===A.Helper.GDI.MixMode.OPAQUE){if(this.state._svgtextbkfilter==null){var i=A.Helper._makeUniqueId("f"),a=this._svg.filter(this._getSvgDef(),i,0,0,1,1);this._svg.filters.flood(a,null,"#"+this.state.bkcolor.toHex(),1),this._svg.filters.composite(a,null,null,"SourceGraphic"),this.state._svgtextbkfilter=a}o.filter="url(#"+this.state._svgtextbkfilter.id+")"}this._svg.text(this.state._svggroup,s,l,u,o)},c.prototype.extTextOut=function(s,l,u,o,i,a){A.Helper.log("[gdi] extTextOut: x="+s+" y="+l+" text="+u+" with font "+this.state.selected.font.toString()),s=this._todevX(s),l=this._todevY(l),A.Helper.log("[gdi] extTextOut: TRANSLATED: x="+s+" y="+l),this._pushGroup();var b=this._applyOpts(null,!1,!1,!0);if(this.state.selected.font.escapement!==0&&(b.transform="rotate("+[-this.state.selected.font.escapement/10,s,l]+")",b.style="dominant-baseline: middle; text-anchor: start;"),this.state.bkmode===A.Helper.GDI.MixMode.OPAQUE){if(this.state._svgtextbkfilter==null){var v=A.Helper._makeUniqueId("f"),_=this._svg.filter(this._getSvgDef(),v,0,0,1,1);this._svg.filters.flood(_,null,"#"+this.state.bkcolor.toHex(),1),this._svg.filters.composite(_,null,null,"SourceGraphic"),this.state._svgtextbkfilter=_}b.filter="url(#"+this.state._svgtextbkfilter.id+")"}this._svg.text(this.state._svggroup,s,l,u,b)},c.prototype.lineTo=function(s,l){A.Helper.log("[gdi] lineTo: x="+s+" y="+l+" with pen "+this.state.selected.pen.toString());var u=this._todevX(s),o=this._todevY(l),i=this._todevX(this.state.x),a=this._todevY(this.state.y);this.state.x=s,this.state.y=l,A.Helper.log("[gdi] lineTo: TRANSLATED: toX="+u+" toY="+o+" fromX="+i+" fromY="+a),this._pushGroup();var b=this._applyOpts(null,!0,!1,!1);this._svg.line(this.state._svggroup,i,a,u,o,b)},c.prototype.moveTo=function(s,l){A.Helper.log("[gdi] moveTo: x="+s+" y="+l),this.state.x=s,this.state.y=l},c.prototype.polygon=function(s,l){A.Helper.log("[gdi] polygon: points="+s+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());for(var u=[],o=0;o<s.length;o++){var i=s[o];u.push([this._todevX(i.x),this._todevY(i.y)])}A.Helper.log("[gdi] polygon: TRANSLATED: pts="+u),l&&this._pushGroup();var a={"fill-rule":this.state.polyfillmode===A.Helper.GDI.PolyFillMode.ALTERNATE?"evenodd":"nonzero"};this._applyOpts(a,!0,!0,!1),this._svg.polygon(this.state._svggroup,u,a)},c.prototype.polyPolygon=function(s){A.Helper.log("[gdi] polyPolygon: polygons.length="+s.length+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());for(var l=s.length,u=0;u<l;u++)this.polygon(s[u],u===0)},c.prototype.polyline=function(s){A.Helper.log("[gdi] polyline: points="+s+" with pen "+this.state.selected.pen.toString());for(var l=[],u=0;u<s.length;u++){var o=s[u];l.push([this._todevX(o.x),this._todevY(o.y)])}A.Helper.log("[gdi] polyline: TRANSLATED: pts="+l),this._pushGroup();var i=this._applyOpts({fill:"none"},!0,!1,!1);this._svg.polyline(this.state._svggroup,l,i)},c.prototype.ellipse=function(s){A.Helper.log("[gdi] ellipse: rect="+s.toString()+" with pen "+this.state.selected.pen.toString()+" and brush "+this.state.selected.brush.toString());var l=this._todevY(s.bottom),u=this._todevX(s.right),o=this._todevY(s.top),i=this._todevX(s.left);A.Helper.log("[gdi] ellipse: TRANSLATED: bottom="+l+" right="+u+" top="+o+" left="+i),this._pushGroup();var a=(u-i)/2,b=(l-o)/2,v=this._applyOpts(null,!0,!0,!1);this._svg.ellipse(this.state._svggroup,i+a,o+b,a,b,v)},c.prototype.excludeClipRect=function(s){A.Helper.log("[gdi] excludeClipRect: rect="+s.toString()),this._getClipRgn().subtract(s)},c.prototype.intersectClipRect=function(s){A.Helper.log("[gdi] intersectClipRect: rect="+s.toString()),this._getClipRgn().intersect(s)},c.prototype.offsetClipRgn=function(s,l){A.Helper.log("[gdi] offsetClipRgn: offX="+s+" offY="+l),this._getClipRgn().offset(s,l)},c.prototype.setTextAlign=function(s){A.Helper.log("[gdi] setTextAlign: textAlignmentMode=0x"+s.toString(16)),this.state.textalign=s},c.prototype.setBkMode=function(s){A.Helper.log("[gdi] setBkMode: bkMode=0x"+s.toString(16)),this.state.bkmode=s},c.prototype.setTextColor=function(s){A.Helper.log("[gdi] setTextColor: textColor="+s.toString()),this.state.textcolor=s},c.prototype.setBkColor=function(s){A.Helper.log("[gdi] setBkColor: bkColor="+s.toString()),this.state.bkcolor=s,this.state._svgtextbkfilter=null},c.prototype.setPolyFillMode=function(s){A.Helper.log("[gdi] setPolyFillMode: polyFillMode="+s),this.state.polyfillmode=s},c.prototype.createBrush=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createBrush: brush="+s.toString()+" with handle "+l)},c.prototype.createFont=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createFont: font="+s.toString()+" with handle "+l)},c.prototype.createPen=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createPen: pen="+s.toString()+" width handle "+l)},c.prototype.createPalette=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createPalette: palette="+s.toString()+" width handle "+l)},c.prototype.createRegion=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createRegion: region="+s.toString()+" width handle "+l)},c.prototype.createPatternBrush=function(s){var l=this._storeObject(s);A.Helper.log("[gdi] createRegion: region="+s.toString()+" width handle "+l)},c.prototype.selectObject=function(s,l){var u=this._getObject(s);u!=null&&(l==null||u.type===l)?(this._selectObject(u),A.Helper.log("[gdi] selectObject: objIdx="+s+(u?" selected "+u.type+": "+u.toString():"[invalid index]"))):A.Helper.log("[gdi] selectObject: objIdx="+s+(u?" invalid object type: "+u.type:"[invalid index]"))},c.prototype.deleteObject=function(s){var l=this._deleteObject(s);A.Helper.log("[gdi] deleteObject: objIdx="+s+(l?" deleted object":"[invalid index]"))},c.prototype._pushGroup=function(){if(this.state._svggroup==null||this.state._svgclipChanged){this.state._svgclipChanged=!1,this.state._svgtextbkfilter=null;var s={viewBox:[this.state.vx,this.state.vy,this.state.vw,this.state.vh].join(" "),preserveAspectRatio:"none"};this.state.clip!=null?(A.Helper.log("[gdi] new svg x="+this.state.vx+" y="+this.state.vy+" width="+this.state.vw+" height="+this.state.vh+" with clipping"),s["clip-path"]="url(#"+this._getSvgClipPathForRegion(this.state.clip)+")"):A.Helper.log("[gdi] new svg x="+this.state.vx+" y="+this.state.vy+" width="+this.state.vw+" height="+this.state.vh+" without clipping"),this.state._svggroup=this._svg.svg(this.state._svggroup,this.state.vx,this.state.vy,this.state.vw,this.state.vh,s)}},c.prototype._storeObject=function(s){for(var l=0;this.objects[l.toString()]!=null&&l<=65535;)l++;return l>65535?(A.Helper.log("[gdi] Too many objects!"),-1):(this.objects[l.toString()]=s,l)},c.prototype._getObject=function(s){var l=this.objects[s.toString()];return l==null&&A.Helper.log("[gdi] No object with handle "+s),l},c.prototype._getSvgDef=function(){return this._svgdefs==null&&(this._svgdefs=this._svg.defs()),this._svgdefs},c.prototype._getSvgClipPathForRegion=function(s){for(var l in this._svgClipPaths)if(this._svgClipPaths[l]===s)return l;var u=A.Helper._makeUniqueId("c"),o=this._svg.clipPath(this._getSvgDef(),u,"userSpaceOnUse");switch(s.complexity){case 1:this._svg.rect(o,this._todevX(s.bounds.left),this._todevY(s.bounds.top),this._todevW(s.bounds.right-s.bounds.left),this._todevH(s.bounds.bottom-s.bounds.top),{fill:"black","stroke-width":0});break;case 2:for(var i=0;i<s.scans.length;i++)for(var a=s.scans[i],b=0;b<a.scanlines.length;b++){var v=a.scanlines[b];this._svg.rect(o,this._todevX(v.left),this._todevY(a.top),this._todevW(v.right-v.left),this._todevH(a.bottom-a.top),{fill:"black","stroke-width":0})}break}return this._svgClipPaths[u]=s,u},c.prototype._getSvgPatternForBrush=function(s){for(var l in this._svgPatterns)if(this._svgPatterns[l]===s)return l;var u,o,i;switch(s.style){case A.Helper.GDI.BrushStyle.BS_PATTERN:u=s.pattern.getWidth(),o=s.pattern.getHeight();break;case A.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:u=s.dibpatternpt.getWidth(),o=s.dibpatternpt.getHeight(),i=s.dibpatternpt.base64ref();break;default:throw new A.WMFJSError("Invalid brush style")}var a=A.Helper._makeUniqueId("p"),b=this._svg.pattern(this._getSvgDef(),a,0,0,u,o,{patternUnits:"userSpaceOnUse"});return this._svg.image(b,0,0,u,o,i),this._svgPatterns[a]=s,a},c.prototype._selectObject=function(s){this.state.selected[s.type]=s,s.type==="region"&&(this.state._svgclipChanged=!0)},c.prototype._deleteObject=function(s){var l=this.objects[s.toString()];if(l!=null){for(var u=0;u<this.statestack.length;u++){var o=this.statestack[u];o.selected[l.type]===l&&(o.selected[l.type]=this.defObjects[l.type].clone())}return delete this.objects[s.toString()],!0}return A.Helper.log("[gdi] Cannot delete object with invalid handle "+s),!1},c.prototype._getClipRgn=function(){return this.state.clip!=null?this.state.ownclip||(this.state.clip=this.state.clip.clone()):this.state.selected.region!=null?this.state.clip=this.state.selected.region.clone():this.state.clip=(0,n.CreateSimpleRegion)(this.state.wx,this.state.wy,this.state.wx+this.state.ww,this.state.wy+this.state.wh),this.state.ownclip=!0,this.state.clip},c.prototype._todevX=function(s){return Math.floor((s-this.state.wx)*(this.state.vw/this.state.ww))+this.state.vx},c.prototype._todevY=function(s){return Math.floor((s-this.state.wy)*(this.state.vh/this.state.wh))+this.state.vy},c.prototype._todevW=function(s){return Math.floor(s*(this.state.vw/this.state.ww))+this.state.vx},c.prototype._todevH=function(s){return Math.floor(s*(this.state.vh/this.state.wh))+this.state.vy},c.prototype._tologicalX=function(s){return Math.floor((s-this.state.vx)/(this.state.vw/this.state.ww))+this.state.wx},c.prototype._tologicalY=function(s){return Math.floor((s-this.state.vy)/(this.state.vh/this.state.wh))+this.state.wy},c.prototype._tologicalW=function(s){return Math.floor(s/(this.state.vw/this.state.ww))+this.state.wx},c.prototype._tologicalH=function(s){return Math.floor(s/(this.state.vh/this.state.wh))+this.state.wy},c.prototype._applyOpts=function(s,l,u,o){if(s==null&&(s={}),l){var i=this.state.selected.pen;if(i.style!==A.Helper.GDI.PenStyle.PS_NULL){s.stroke="#"+i.color.toHex(),s["stroke-width"]=this._todevW(i.width.x);var a=void 0;(i.linecap&A.Helper.GDI.PenStyle.PS_ENDCAP_SQUARE)!==0?(s["stroke-linecap"]="square",a=1):(i.linecap&A.Helper.GDI.PenStyle.PS_ENDCAP_FLAT)!==0?(s["stroke-linecap"]="butt",a=s["stroke-width"]):(s["stroke-linecap"]="round",a=1),(i.join&A.Helper.GDI.PenStyle.PS_JOIN_BEVEL)!==0?s["stroke-linejoin"]="bevel":(i.join&A.Helper.GDI.PenStyle.PS_JOIN_MITER)!==0?s["stroke-linejoin"]="miter":s["stroke-linejoin"]="round";var b=s["stroke-width"]*4,v=s["stroke-width"]*2;switch(i.style){case A.Helper.GDI.PenStyle.PS_DASH:s["stroke-dasharray"]=[b,v].toString();break;case A.Helper.GDI.PenStyle.PS_DOT:s["stroke-dasharray"]=[a,v].toString();break;case A.Helper.GDI.PenStyle.PS_DASHDOT:s["stroke-dasharray"]=[b,v,a,v].toString();break;case A.Helper.GDI.PenStyle.PS_DASHDOTDOT:s["stroke-dasharray"]=[b,v,a,v,a,v].toString();break}}}if(u){var _=this.state.selected.brush;switch(_.style){case A.Helper.GDI.BrushStyle.BS_SOLID:s.fill="#"+_.color.toHex();break;case A.Helper.GDI.BrushStyle.BS_PATTERN:case A.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:s.fill="url(#"+this._getSvgPatternForBrush(_)+")";break;case A.Helper.GDI.BrushStyle.BS_NULL:s.fill="none";break;default:A.Helper.log("[gdi] unsupported brush style: "+_.style),s.fill="none";break}}if(o){var T=this.state.selected.font;s["font-family"]=T.facename,s["font-size"]=this._todevH(Math.abs(T.height)),s.fill="#"+this.state.textcolor.toHex()}return s},c})()}),"./src/wmfjs/Helper.ts":((E,h,w)=>{w.r(h),w.d(h,{Helper:()=>t,WMFJSError:()=>r,loggingEnabled:()=>e});var A=(function(){var p=function(c,s){return p=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,u){l.__proto__=u}||function(l,u){for(var o in u)Object.prototype.hasOwnProperty.call(u,o)&&(l[o]=u[o])},p(c,s)};return function(c,s){if(typeof s!="function"&&s!==null)throw new TypeError("Class extends value "+String(s)+" is not a constructor or null");p(c,s);function l(){this.constructor=c}c.prototype=s===null?Object.create(s):(l.prototype=s.prototype,new l)}})(),r=(function(p){A(c,p);function c(s){var l=this.constructor,u=p.call(this,s)||this;return Object.setPrototypeOf(u,l.prototype),u}return c})(Error),n=!0;function e(p){n=p}var t=(function(){function p(){}return p.log=function(c){n&&console.log(c)},p._makeUniqueId=function(c){return"wmfjs_"+c+this._uniqueId++},p._writeUint32Val=function(c,s,l){c[s++]=l&255,c[s++]=l>>>8&255,c[s++]=l>>>16&255,c[s++]=l>>>24&255},p._blobToBinary=function(c){for(var s="",l=c.length,u=0;u<l;u++)s+=String.fromCharCode(c[u]);return s},p.GDI={METAHEADER_SIZE:18,BITMAPINFOHEADER_SIZE:40,BITMAPCOREHEADER_SIZE:12,MetafileType:{MEMORYMETAFILE:1,DISKMETAFILE:2},MetafileVersion:{METAVERSION100:256,METAVERSION300:768},RecordType:{META_EOF:0,META_REALIZEPALETTE:53,META_SETPALENTRIES:55,META_SETBKMODE:258,META_SETMAPMODE:259,META_SETROP2:260,META_SETRELABS:261,META_SETPOLYFILLMODE:262,META_SETSTRETCHBLTMODE:263,META_SETTEXTCHAREXTRA:264,META_RESTOREDC:295,META_RESIZEPALETTE:313,META_DIBCREATEPATTERNBRUSH:322,META_SETLAYOUT:329,META_SETBKCOLOR:513,META_SETTEXTCOLOR:521,META_OFFSETVIEWPORTORG:529,META_LINETO:531,META_MOVETO:532,META_OFFSETCLIPRGN:544,META_FILLREGION:552,META_SETMAPPERFLAGS:561,META_SELECTPALETTE:564,META_POLYGON:804,META_POLYLINE:805,META_SETTEXTJUSTIFICATION:522,META_SETWINDOWORG:523,META_SETWINDOWEXT:524,META_SETVIEWPORTORG:525,META_SETVIEWPORTEXT:526,META_OFFSETWINDOWORG:527,META_SCALEWINDOWEXT:1040,META_SCALEVIEWPORTEXT:1042,META_EXCLUDECLIPRECT:1045,META_INTERSECTCLIPRECT:1046,META_ELLIPSE:1048,META_FLOODFILL:1049,META_FRAMEREGION:1065,META_ANIMATEPALETTE:1078,META_TEXTOUT:1313,META_POLYPOLYGON:1336,META_EXTFLOODFILL:1352,META_RECTANGLE:1051,META_SETPIXEL:1055,META_ROUNDRECT:1564,META_PATBLT:1565,META_SAVEDC:30,META_PIE:2074,META_STRETCHBLT:2851,META_ESCAPE:1574,META_INVERTREGION:298,META_PAINTREGION:299,META_SELECTCLIPREGION:300,META_SELECTOBJECT:301,META_SETTEXTALIGN:302,META_ARC:2071,META_CHORD:2096,META_BITBLT:2338,META_EXTTEXTOUT:2610,META_SETDIBTODEV:3379,META_DIBBITBLT:2368,META_DIBSTRETCHBLT:2881,META_STRETCHDIB:3907,META_DELETEOBJECT:496,META_CREATEPALETTE:247,META_CREATEPATTERNBRUSH:505,META_CREATEPENINDIRECT:762,META_CREATEFONTINDIRECT:763,META_CREATEBRUSHINDIRECT:764,META_CREATEREGION:1791},MetafileEscapes:{NEWFRAME:1,ABORTDOC:2,NEXTBAND:3,SETCOLORTABLE:4,GETCOLORTABLE:5,FLUSHOUT:6,DRAFTMODE:7,QUERYESCSUPPORT:8,SETABORTPROC:9,STARTDOC:10,ENDDOC:11,GETPHYSPAGESIZE:12,GETPRINTINGOFFSET:13,GETSCALINGFACTOR:14,META_ESCAPE_ENHANCED_METAFILE:15,SETPENWIDTH:16,SETCOPYCOUNT:17,SETPAPERSOURCE:18,PASSTHROUGH:19,GETTECHNOLOGY:20,SETLINECAP:21,SETLINEJOIN:22,SETMITERLIMIT:23,BANDINFO:24,DRAWPATTERNRECT:25,GETVECTORPENSIZE:26,GETVECTORBRUSHSIZE:27,ENABLEDUPLEX:28,GETSETPAPERBINS:29,GETSETPRINTORIENT:30,ENUMPAPERBINS:31,SETDIBSCALING:32,EPSPRINTING:33,ENUMPAPERMETRICS:34,GETSETPAPERMETRICS:35,POSTSCRIPT_DATA:37,POSTSCRIPT_IGNORE:38,GETDEVICEUNITS:42,GETEXTENDEDTEXTMETRICS:256,GETPAIRKERNTABLE:258,EXTTEXTOUT:512,GETFACENAME:513,DOWNLOADFACE:514,METAFILE_DRIVER:2049,QUERYDIBSUPPORT:3073,BEGIN_PATH:4096,CLIP_TO_PATH:4097,END_PATH:4098,OPEN_CHANNEL:4110,DOWNLOADHEADER:4111,CLOSE_CHANNEL:4112,POSTSCRIPT_PASSTHROUGH:4115,ENCAPSULATED_POSTSCRIPT:4116,POSTSCRIPT_IDENTIFY:4117,POSTSCRIPT_INJECTION:4118,CHECKJPEGFORMAT:4119,CHECKPNGFORMAT:4120,GET_PS_FEATURESETTING:4121,MXDC_ESCAPE:4122,SPCLPASSTHROUGH2:4568},MapMode:{MM_TEXT:1,MM_LOMETRIC:2,MM_HIMETRIC:3,MM_LOENGLISH:4,MM_HIENGLISH:5,MM_TWIPS:6,MM_ISOTROPIC:7,MM_ANISOTROPIC:8},StretchMode:{BLACKONWHITE:1,WHITEONBLACK:2,COLORONCOLOR:3,HALFTONE:4},TextAlignmentMode:{TA_UPDATECP:1,TA_RIGHT:2,TA_CENTER:6,TA_BOTTOM:8,TA_BASELINE:24,TA_RTLREADING:256},MixMode:{TRANSPARENT:1,OPAQUE:2},VerticalTextAlignmentMode:{VTA_BOTTOM:2,VTA_CENTER:6,VTA_LEFT:8,VTA_BASELINE:24},BrushStyle:{BS_SOLID:0,BS_NULL:1,BS_HATCHED:2,BS_PATTERN:3,BS_INDEXED:4,BS_DIBPATTERN:5,BS_DIBPATTERNPT:6,BS_PATTERN8X8:7,BS_DIBPATTERN8X8:8,BS_MONOPATTERN:9},PenStyle:{PS_SOLID:0,PS_DASH:1,PS_DOT:2,PS_DASHDOT:3,PS_DASHDOTDOT:4,PS_NULL:5,PS_INSIDEFRAME:6,PS_USERSTYLE:7,PS_ALTERNATE:8,PS_ENDCAP_SQUARE:256,PS_ENDCAP_FLAT:512,PS_JOIN_BEVEL:4096,PS_JOIN_MITER:8192},PolyFillMode:{ALTERNATE:1,WINDING:2},ColorUsage:{DIB_RGB_COLORS:0,DIB_PAL_COLORS:1,DIB_PAL_INDICES:2},PaletteEntryFlag:{PC_RESERVED:1,PC_EXPLICIT:2,PC_NOCOLLAPSE:4},BitmapCompression:{BI_RGB:0,BI_RLE8:1,BI_RLE4:2,BI_BITFIELDS:3,BI_JPEG:4,BI_PNG:5}},p._uniqueId=0,p})()}),"./src/wmfjs/Primitives.ts":((E,h,w)=>{w.r(h),w.d(h,{Obj:()=>e,PointS:()=>r,Rect:()=>n});var A=w("./src/wmfjs/Helper.ts"),r=(function(){function t(p,c,s){p!=null?(this.x=p.readInt16(),this.y=p.readInt16()):(this.x=c,this.y=s)}return t.prototype.clone=function(){return new t(null,this.x,this.y)},t.prototype.toString=function(){return"{x: "+this.x+", y: "+this.y+"}"},t})(),n=(function(){function t(p,c,s,l,u){p!=null?(this.bottom=p.readInt16(),this.right=p.readInt16(),this.top=p.readInt16(),this.left=p.readInt16()):(this.bottom=u,this.right=l,this.top=s,this.left=c)}return t.prototype.clone=function(){return new t(null,this.left,this.top,this.right,this.bottom)},t.prototype.toString=function(){return"{left: "+this.left+", top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+"}"},t.prototype.empty=function(){return this.left>=this.right||this.top>=this.bottom},t.prototype.intersect=function(p){return this.empty()||p.empty()||this.left>=p.right||this.top>=p.bottom||this.right<=p.left||this.bottom<=p.top?null:new t(null,Math.max(this.left,p.left),Math.max(this.top,p.top),Math.min(this.right,p.right),Math.min(this.bottom,p.bottom))},t})(),e=(function(){function t(p){this.type=p}return t.prototype.clone=function(){throw new A.WMFJSError("clone not implemented")},t.prototype.toString=function(){throw new A.WMFJSError("toString not implemented")},t})()}),"./src/wmfjs/Region.ts":((E,h,w)=>{w.r(h),w.d(h,{CreateSimpleRegion:()=>t,Region:()=>e,Scan:()=>p});var A=w("./src/wmfjs/Helper.ts"),r=w("./src/wmfjs/Primitives.ts"),n=(function(){var c=function(s,l){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,o){u.__proto__=o}||function(u,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(u[i]=o[i])},c(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");c(s,l);function u(){this.constructor=s}s.prototype=l===null?Object.create(l):(u.prototype=l.prototype,new u)}})(),e=(function(c){n(s,c);function s(l,u){var o=c.call(this,"region")||this;if(l!=null){if(l.skip(2),l.readInt16()!==6)throw new A.WMFJSError("Invalid region identifier");l.skip(2),l.readInt16();var i=l.readInt16();l.skip(2);var a=l.readInt16(),b=l.readInt16(),v=l.readInt16(),_=l.readInt16();o.bounds=new r.Rect(null,a,b,v,_),o.scans=[];for(var T=0;T<i;T++)o.scans.push(new p(l));o._updateComplexity()}else if(u!=null){if(o.bounds=u.bounds!=null?u.bounds.clone():null,u.scans!=null){o.scans=[];for(var T=0;T<u.scans.length;T++)o.scans.push(u.scans[T].clone())}else o.scans=null;o.complexity=u.complexity}else o.bounds=null,o.scans=null,o.complexity=0;return o}return s.prototype.clone=function(){return new s(null,this)},s.prototype.toString=function(){return"{complexity: "+["null","simple","complex"][this.complexity]+" bounds: "+(this.bounds!=null?this.bounds.toString():"[none]")+" #scans: "+(this.scans!=null?this.scans.length:"[none]")+"}"},s.prototype._updateComplexity=function(){if(this.bounds==null)this.complexity=0,this.scans=null;else if(this.bounds.empty())this.complexity=0,this.scans=null,this.bounds=null;else if(this.scans==null)this.complexity=1;else if(this.complexity=2,this.scans.length===1){var l=this.scans[0];if(l.top===this.bounds.top&&l.bottom===this.bounds.bottom&&l.scanlines.length===1){var u=l.scanlines[0];u.left===this.bounds.left&&u.right===this.bounds.right&&(this.scans=null,this.complexity=1)}}},s.prototype.subtract=function(l){if(A.Helper.log("[wmf] Region "+this.toString()+" subtract "+l.toString()),this.bounds!=null&&this.bounds.intersect(l)!=null){this.scans==null&&(this.scans=[],this.scans.push(new p(null,null,this.bounds.top,this.bounds.bottom,[{left:this.bounds.left,right:this.bounds.right}])),this.complexity=2);for(var u=0;u<this.scans.length;){var o=this.scans[u];if(o.bottom>=l.top){var i=o.clone();o.bottom=l.top-1,i.top=l.top,o.top>=o.bottom?this.scans[u]=i:(A.Helper.log("[wmf] Region split top scan "+u+" for substraction"),this.scans.splice(++u,0,i));break}u++}for(var a=u;u<this.scans.length;){var o=this.scans[u];if(o.top>l.bottom)break;if(o.bottom>l.bottom){var i=o.clone();o.bottom=l.bottom,i.top=l.bottom+1,o.top>=o.bottom?this.scans[u]=i:(A.Helper.log("[wmf] Region split bottom scan "+u+" for substraction"),this.scans.splice(++u,0,i));break}u++}if(a<this.scans.length){var b=u;for(u=a;u<b;){var o=this.scans[u];if(!o.subtract(l.left,l.right)){A.Helper.log("[wmf] Region remove now empty scan "+u+" due to subtraction"),this.scans.splice(u,1),b--;continue}u++}}if(this.scans!=null){for(var v=void 0,_,T=void 0,k=void 0,M=this.scans.length,R=0;R<M;R++){var o=this.scans[R];R===0&&(_=o.top),R===M-1&&(k=o.bottom);var O=o.scanlines.length;if(O>0){var P=o.scanlines[0];(v==null||P.left<v)&&(v=P.left),P=o.scanlines[O-1],(T==null||P.right>T)&&(T=P.right)}}v!=null&&_!=null&&T!=null&&k!=null?(this.bounds=new r.Rect(null,v,_,T,k),this._updateComplexity()):(this.bounds=null,this.scans=null,this.complexity=0)}else this._updateComplexity()}A.Helper.log("[wmf] Region subtraction -> "+this.toString())},s.prototype.intersect=function(l){if(A.Helper.log("[wmf] Region "+this.toString()+" intersect with "+l.toString()),this.bounds!=null)if(this.bounds=this.bounds.intersect(l),this.bounds!=null){if(this.scans!=null){for(var u=0;u<this.scans.length;){var o=this.scans[u];if(o.bottom<this.bounds.top)u++;else break}for(u>0&&(A.Helper.log("[wmf] Region remove "+u+" scans from top"),this.scans.splice(0,u),this.scans.length>0&&(this.scans[0].top=this.bounds.top)),u=0;u<this.scans.length;){var o=this.scans[u];if(o.top>this.bounds.bottom){A.Helper.log("[wmf] Region remove "+(this.scans.length-u)+" scans from bottom"),this.scans.splice(u,this.scans.length-u);break}if(!o.intersect(this.bounds.left,this.bounds.right)){A.Helper.log("[wmf] Region remove now empty scan "+u+" due to intersection"),this.scans.splice(u,1);continue}u++}this.scans.length>0&&(this.scans[this.scans.length-1].bottom=this.bounds.bottom),this._updateComplexity()}}else this.scans=null,this.complexity=0;A.Helper.log("[wmf] Region intersection -> "+this.toString())},s.prototype.offset=function(l,u){if(this.bounds!=null&&(this.bounds.left+=l,this.bounds.top+=u,this.bounds.right+=l,this.bounds.bottom+=u),this.scans!=null)for(var o=this.scans.length,i=0;i<o;i++){var a=this.scans[i];a.top+=u,a.bottom+=u;for(var b=a.scanlines.length,v=0;v<b;v++){var _=a.scanlines[v];_.left+=l,_.right+=l}}},s})(r.Obj);function t(c,s,l,u){var o=new e(null,null);return o.bounds=new r.Rect(null,c,s,l,u),o._updateComplexity(),o}var p=(function(){function c(s,l,u,o,i){if(s!=null){var a=s.readUint16();this.top=s.readUint16(),this.bottom=s.readUint16(),this.scanlines=[];for(var b=0;b<a;b++){var v=s.readUint16(),_=s.readUint16();this.scanlines.push({left:v,right:_})}s.skip(2)}else if(l!=null){this.top=l.top,this.bottom=l.bottom,this.scanlines=[];for(var b=0;b<l.scanlines.length;b++){var T=l.scanlines[b];this.scanlines.push({left:T.left,right:T.right})}}else this.top=u,this.bottom=o,this.scanlines=i}return c.prototype.clone=function(){return new c(null,this)},c.prototype.subtract=function(s,l){for(var u=0;u<this.scanlines.length;){var o=this.scanlines[u];if(o.left<=s){if(o.right>=s&&(o.right=s-1,o.left>=o.right)){this.scanlines.splice(u,1);continue}u++}else break}for(var i=u,a=0;u<this.scanlines.length;){var o=this.scanlines[u];if(o.right>l){o.left=l,a=u-i,o.left>=o.right&&a++;break}u++}return a>0&&i<this.scanlines.length&&this.scanlines.splice(i,a),this.scanlines.length>0},c.prototype.intersect=function(s,l){for(var u=0;u<this.scanlines.length;u++){var o=this.scanlines[u];if(o.left>=s||o.right>=s){u>0&&this.scanlines.splice(0,u);break}}if(this.scanlines.length>0){var o=this.scanlines[0];o.left<s&&(o.left=s);for(var u=0;u<this.scanlines.length;u++)if(o=this.scanlines[u],o.left>l){this.scanlines.splice(u,this.scanlines.length-u);break}this.scanlines.length>0&&(o=this.scanlines[this.scanlines.length-1],o.right>l&&(o.right=l))}return this.scanlines.length>0},c.prototype.toString=function(){return"{ #scanlines: "+this.scanlines.length+"}"},c})()}),"./src/wmfjs/Renderer.ts":((E,h,w)=>{w.r(h),w.d(h,{Renderer:()=>p});var A=w("./src/util/index.ts"),r=w("./src/wmfjs/Blob.ts"),n=w("./src/wmfjs/GDIContext.ts"),e=w("./src/wmfjs/Helper.ts"),t=w("./src/wmfjs/WMFRecords.ts"),p=(function(){function u(o){this.parse(o),e.Helper.log("WMFJS.Renderer instantiated")}return u.prototype.render=function(o){var i=document.createElementNS("http://www.w3.org/2000/svg","svg");return this._render(new A.SVG(i),o.mapMode,o.xExt,o.yExt),i.setAttribute("viewBox",[0,0,o.xExt,o.yExt].join(" ")),i.setAttribute("preserveAspectRatio","none"),i.setAttribute("width",o.width),i.setAttribute("height",o.height),i},u.prototype.parse=function(o){this._img=null;var i=new r.Blob(o),a,b,v,_,T=i.readUint32();switch(T===2596720087?(v=new s(i),_=i.pos,a=i.readUint16(),b=i.readUint16()):(_=0,a=T&65535,b=T>>>16&65535),a){case e.Helper.GDI.MetafileType.MEMORYMETAFILE:case e.Helper.GDI.MetafileType.DISKMETAFILE:if(b===e.Helper.GDI.METAHEADER_SIZE/2){var k=i.readUint16();switch(k){case e.Helper.GDI.MetafileVersion.METAVERSION100:case e.Helper.GDI.MetafileVersion.METAVERSION300:this._img=new l(i,v,k,_+b*2);break}}break}if(this._img==null)throw new e.WMFJSError("Format not recognized")},u.prototype._render=function(o,i,a,b){var v=new n.GDIContext(o);v.setViewportExt(a,b),v.setMapMode(i),e.Helper.log("[WMF] BEGIN RENDERING --->"),this._img.render(v),e.Helper.log("[WMF] <--- DONE RENDERING")},u})(),c=(function(){function u(o){this.left=o.readInt16(),this.top=o.readInt16(),this.right=o.readInt16(),this.bottom=o.readInt16()}return u.prototype.toString=function(){return"{left: "+this.left+", top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+"}"},u})(),s=(function(){function u(o){o.skip(2),this.boundingBox=new c(o),this.unitsPerInch=o.readInt16(),o.skip(4),o.skip(2),e.Helper.log("Got bounding box "+this.boundingBox+" and "+this.unitsPerInch+" units/inch")}return u})(),l=(function(){function u(o,i,a,b){this._version=a,this._hdrsize=b,this._placable=i,this._records=new t.WMFRecords(o,this._hdrsize)}return u.prototype.render=function(o){this._records.play(o)},u})()}),"./src/wmfjs/Style.ts":((E,h,w)=>{w.r(h),w.d(h,{Brush:()=>c,ColorRef:()=>t,Font:()=>p,Palette:()=>u,PaletteEntry:()=>l,Pen:()=>s});var A=w("./src/wmfjs/Bitmap.ts"),r=w("./src/wmfjs/Helper.ts"),n=w("./src/wmfjs/Primitives.ts"),e=(function(){var o=function(i,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,v){b.__proto__=v}||function(b,v){for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(b[_]=v[_])},o(i,a)};return function(i,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(i,a);function b(){this.constructor=i}i.prototype=a===null?Object.create(a):(b.prototype=a.prototype,new b)}})(),t=(function(){function o(i,a,b,v){i!=null?(this.r=i.readUint8(),this.g=i.readUint8(),this.b=i.readUint8(),i.skip(1)):(this.r=a,this.g=b,this.b=v)}return o.prototype.clone=function(){return new o(null,this.r,this.g,this.b)},o.prototype.toHex=function(){return(16777216+(this.r<<16|this.g<<8|this.b)).toString(16).slice(1)},o.prototype.toString=function(){return"{r: "+this.r+", g: "+this.g+", b: "+this.b+"}"},o})(),p=(function(o){e(i,o);function i(a,b){var v=o.call(this,"font")||this;if(a!=null){v.height=a.readInt16(),v.width=a.readInt16(),v.escapement=a.readInt16(),v.orientation=a.readInt16(),v.weight=a.readInt16(),v.italic=a.readUint8(),v.underline=a.readUint8(),v.strikeout=a.readUint8(),v.charset=a.readUint8(),v.outprecision=a.readUint8(),v.clipprecision=a.readUint8(),v.quality=a.readUint8();var _=a.readUint8();v.pitch=_&15,v.family=_>>6&3;var T=b,k=a.pos;v.facename=a.readNullTermString(Math.min(T-(a.pos-k),32))}else b!=null?(b=b,v.height=b.height,v.width=b.width,v.escapement=b.escapement,v.orientation=b.orientation,v.weight=b.weight,v.italic=b.italic,v.underline=b.underline,v.strikeout=b.strikeout,v.charset=b.charset,v.outprecision=b.outprecision,v.clipprecision=b.clipprecision,v.quality=b.quality,v.pitch=b.pitch,v.family=b.family,v.facename=b.facename):(v.height=-80,v.width=0,v.escapement=0,v.orientation=0,v.weight=400,v.italic=0,v.underline=0,v.strikeout=0,v.charset=0,v.outprecision=0,v.clipprecision=0,v.quality=0,v.pitch=0,v.family=0,v.facename="Helvetica");return v}return i.prototype.clone=function(){return new i(null,this)},i.prototype.toString=function(){return JSON.stringify(this)},i})(n.Obj),c=(function(o){e(i,o);function i(a,b,v){var _=o.call(this,"brush")||this;if(a!=null){var T=b,k=a.pos;if(v===!0||v===!1)switch(_.style=a.readUint16(),v&&_.style!==r.Helper.GDI.BrushStyle.BS_PATTERN&&(_.style=r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT),_.style){case r.Helper.GDI.BrushStyle.BS_SOLID:_.color=new t(a);break;case r.Helper.GDI.BrushStyle.BS_PATTERN:a.skip(v?2:6),_.pattern=new A.Bitmap16(a,T-(a.pos-k));break;case r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:_.colorusage=v?a.readUint16():a.readUint32(),v||a.skip(2),_.dibpatternpt=new A.DIBitmap(a,T-(a.pos-k));break;case r.Helper.GDI.BrushStyle.BS_HATCHED:_.color=new t(a),_.hatchstyle=a.readUint16();break}else v instanceof A.PatternBitmap16&&(_.style=r.Helper.GDI.BrushStyle.BS_PATTERN,_.pattern=v)}else if(b!=null)switch(b=b,_.style=b.style,_.style){case r.Helper.GDI.BrushStyle.BS_SOLID:_.color=b.color.clone();break;case r.Helper.GDI.BrushStyle.BS_PATTERN:_.pattern=b.pattern.clone();break;case r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:_.colorusage=b.colorusage,_.dibpatternpt=b.dibpatternpt;break;case r.Helper.GDI.BrushStyle.BS_HATCHED:_.color=b.color.clone(),_.hatchstyle=b.hatchstyle;break}return _}return i.prototype.clone=function(){return new i(null,this)},i.prototype.toString=function(){var a="{style: "+this.style;switch(this.style){case r.Helper.GDI.BrushStyle.BS_SOLID:a+=", color: "+this.color.toString();break;case r.Helper.GDI.BrushStyle.BS_DIBPATTERNPT:a+=", colorusage: "+this.colorusage;break;case r.Helper.GDI.BrushStyle.BS_HATCHED:a+=", color: "+this.color.toString()+", hatchstyle: "+this.hatchstyle;break}return a+"}"},i})(n.Obj),s=(function(o){e(i,o);function i(a,b,v,_,T,k){var M=o.call(this,"pen")||this;return a!=null?(b=a.readUint16(),M.style=b&255,M.width=new n.PointS(a),M.color=new t(a),M.linecap=b&(r.Helper.GDI.PenStyle.PS_ENDCAP_SQUARE|r.Helper.GDI.PenStyle.PS_ENDCAP_FLAT),M.join=b&(r.Helper.GDI.PenStyle.PS_JOIN_BEVEL|r.Helper.GDI.PenStyle.PS_JOIN_MITER)):(M.style=b,M.width=v,M.color=_,M.linecap=T,M.join=k),M}return i.prototype.clone=function(){return new i(null,this.style,this.width.clone(),this.color.clone(),this.linecap,this.join)},i.prototype.toString=function(){return"{style: "+this.style+", width: "+this.width.toString()+", color: "+this.color.toString()+", linecap: "+this.linecap+", join: "+this.join+"}"},i})(n.Obj),l=(function(){function o(i,a){i!=null?(this.flag=i.readUint8(),this.b=i.readUint8(),this.g=i.readUint8(),this.r=i.readUint8()):(this.flag=a.flag,this.b=a.b,this.g=a.g,this.r=a.r)}return o.prototype.clone=function(){return new o(null,this)},o})(),u=(function(o){e(i,o);function i(a,b){var v=o.call(this,"palette")||this;if(a!=null){v.start=a.readUint16();var _=a.readUint16();for(v.entries=[];_>0;)v.entries.push(new l(a)),_--}else{v.start=b.start,v.entries=[];for(var T=b.entries.length,k=0;k<T;k++)v.entries.push(b.entries[k])}return v}return i.prototype.clone=function(){return new i(null,this)},i.prototype.toString=function(){return"{ #entries: "+this.entries.length+"}"},i})(n.Obj)}),"./src/wmfjs/WMFRecords.ts":((E,h,w)=>{w.r(h),w.d(h,{WMFRecords:()=>c});var A=w("./src/wmfjs/Bitmap.ts"),r=w("./src/wmfjs/Blob.ts"),n=w("./src/wmfjs/Helper.ts"),e=w("./src/wmfjs/Primitives.ts"),t=w("./src/wmfjs/Region.ts"),p=w("./src/wmfjs/Style.ts"),c=(function(){function s(l,u){this._records=[];var o=!1,i=u,a=function(){l.seek(i);var v=l.readUint32();if(v<3)throw new n.WMFJSError("Invalid record size");var _=l.readUint16();switch(_){case n.Helper.GDI.RecordType.META_EOF:return o=!0,"break-main_loop";case n.Helper.GDI.RecordType.META_SETMAPMODE:var T=l.readUint16();b._records.push(function(dt){dt.setMapMode(T)});break;case n.Helper.GDI.RecordType.META_SETWINDOWORG:var k=l.readInt16(),M=l.readInt16();b._records.push(function(dt){dt.setWindowOrg(M,k)});break;case n.Helper.GDI.RecordType.META_SETWINDOWEXT:var R=l.readInt16(),O=l.readInt16();b._records.push(function(dt){dt.setWindowExt(O,R)});break;case n.Helper.GDI.RecordType.META_OFFSETWINDOWORG:var P=l.readInt16(),N=l.readInt16();b._records.push(function(dt){dt.offsetWindowOrg(N,P)});break;case n.Helper.GDI.RecordType.META_SETVIEWPORTORG:var it=l.readInt16(),J=l.readInt16();b._records.push(function(dt){dt.setViewportOrg(J,it)});break;case n.Helper.GDI.RecordType.META_SETVIEWPORTEXT:var ot=l.readInt16(),tt=l.readInt16();b._records.push(function(dt){dt.setViewportExt(tt,ot)});break;case n.Helper.GDI.RecordType.META_OFFSETVIEWPORTORG:var ht=l.readInt16(),W=l.readInt16();b._records.push(function(dt){dt.offsetViewportOrg(W,ht)});break;case n.Helper.GDI.RecordType.META_SAVEDC:b._records.push(function(dt){dt.saveDC()});break;case n.Helper.GDI.RecordType.META_RESTOREDC:var G=l.readInt16();b._records.push(function(dt){dt.restoreDC(G)});break;case n.Helper.GDI.RecordType.META_SETSTRETCHBLTMODE:var gt=l.readUint16();b._records.push(function(dt){dt.setStretchBltMode(gt)});break;case n.Helper.GDI.RecordType.META_DIBBITBLT:var F=(_>>8)+3!==v,nt=l.readUint16()|l.readUint16()<<16,j=l.readInt16(),U=l.readInt16();F||l.skip(2);var at=l.readInt16(),rt=l.readInt16(),V=l.readInt16(),et=l.readInt16();if(F){var Wt=v*2-(l.pos-i),q=new A.DIBitmap(l,Wt);b._records.push(function(dc){dc.dibBits(U,j,et,V,rt,at,nt,q)})}break;case n.Helper.GDI.RecordType.META_DIBSTRETCHBLT:var F=(_>>8)+3!==v,ut=l.readUint16()|l.readUint16()<<16,S=l.readInt16(),$=l.readInt16(),z=l.readInt16(),x=l.readInt16(),D=l.readInt16(),I=l.readInt16(),H=l.readInt16(),L=l.readInt16(),Wt=v*2-(l.pos-i),B=new A.DIBitmap(l,Wt);b._records.push(function(dt){dt.stretchDibBits(x,z,$,S,L,H,I,D,ut,B)});break;case n.Helper.GDI.RecordType.META_STRETCHDIB:var Y=l.readUint16()|l.readUint16()<<16,Q=l.readInt16(),K=l.readInt16(),lt=l.readInt16(),ft=l.readInt16(),X=l.readInt16(),mt=l.readInt16(),At=l.readInt16(),Et=l.readInt16(),ct=l.readInt16(),Wt=v*2-(l.pos-i),yt=new A.DIBitmap(l,Wt);b._records.push(function(dt){dt.stretchDib(X,ft,lt,K,ct,Et,At,mt,Y,Q,yt)});break;case n.Helper.GDI.RecordType.META_ESCAPE:var Rt=l.readUint16(),St=l.readUint16(),It=l.pos,Lt=new r.Blob(l,It);b._records.push(function(dt){dt.escape(Rt,Lt,It,St)});break;case n.Helper.GDI.RecordType.META_SETTEXTALIGN:var Ft=l.readUint16();b._records.push(function(dt){dt.setTextAlign(Ft)});break;case n.Helper.GDI.RecordType.META_SETBKMODE:var _t=l.readUint16();b._records.push(function(dt){dt.setBkMode(_t)});break;case n.Helper.GDI.RecordType.META_SETTEXTCOLOR:var Mt=new p.ColorRef(l);b._records.push(function(dt){dt.setTextColor(Mt)});break;case n.Helper.GDI.RecordType.META_SETBKCOLOR:var Ct=new p.ColorRef(l);b._records.push(function(dt){dt.setBkColor(Ct)});break;case n.Helper.GDI.RecordType.META_CREATEBRUSHINDIRECT:var Wt=v*2-(l.pos-i),Dt=new p.Brush(l,Wt,!1);b._records.push(function(dt){dt.createBrush(Dt)});break;case n.Helper.GDI.RecordType.META_DIBCREATEPATTERNBRUSH:var Wt=v*2-(l.pos-i),bt=new p.Brush(l,Wt,!0);b._records.push(function(dt){dt.createBrush(bt)});break;case n.Helper.GDI.RecordType.META_CREATEPENINDIRECT:var wt=new p.Pen(l);b._records.push(function(dt){dt.createPen(wt)});break;case n.Helper.GDI.RecordType.META_CREATEFONTINDIRECT:var Wt=v*2-(l.pos-i),jt=new p.Font(l,Wt);b._records.push(function(dt){dt.createFont(jt)});break;case n.Helper.GDI.RecordType.META_SELECTOBJECT:var ee=l.readUint16();b._records.push(function(dt){dt.selectObject(ee,null)});break;case n.Helper.GDI.RecordType.META_SELECTPALETTE:var Kt=l.readUint16();b._records.push(function(dt){dt.selectObject(Kt,"palette")});break;case n.Helper.GDI.RecordType.META_SELECTCLIPREGION:var re=l.readUint16();b._records.push(function(dt){dt.selectObject(re,"region")});break;case n.Helper.GDI.RecordType.META_DELETEOBJECT:var Vt=l.readUint16();b._records.push(function(dt){dt.deleteObject(Vt)});break;case n.Helper.GDI.RecordType.META_RECTANGLE:var ne=new e.Rect(l);b._records.push(function(dt){dt.rectangle(ne,0,0)});break;case n.Helper.GDI.RecordType.META_ROUNDRECT:var Pt=l.readInt16(),Ot=l.readInt16(),kt=new e.Rect(l);b._records.push(function(dt){dt.rectangle(kt,Ot,Pt)});break;case n.Helper.GDI.RecordType.META_LINETO:var Gt=l.readInt16(),pt=l.readInt16();b._records.push(function(dt){dt.lineTo(pt,Gt)});break;case n.Helper.GDI.RecordType.META_MOVETO:var fn=l.readInt16(),Xl=l.readInt16();b._records.push(function(dt){dt.moveTo(Xl,fn)});break;case n.Helper.GDI.RecordType.META_TEXTOUT:var Ht=l.readInt16();if(Ht>0){var Yl=l.readString(Ht);l.skip(Ht%2);var Kl=l.readInt16(),Jl=l.readInt16();b._records.push(function(dt){dt.textOut(Jl,Kl,Yl)})}break;case n.Helper.GDI.RecordType.META_EXTTEXTOUT:var Zl=l.readInt16(),ql=l.readInt16(),Ht=l.readInt16(),Ql=l.readUint16(),Ue=null,je=null;v*2===14+Ht+Ht%2&&(Ue=!1,je=!1),v*2===22+Ht+Ht%2&&(Ue=!0,je=!1),v*2===14+Ht+Ht%2+Ht*2&&(Ue=!1,je=!0),v*2===22+Ht+Ht%2+Ht*2&&(Ue=!0,je=!0);var tc=Ue?new e.Rect(l):null;if(Ht>0){var So=l.readString(Ht);l.skip(Ht%2);var Po=[];if(je)for(var se=0;se<So.length;se++)Po.push(l.readInt16());b._records.push(function(dt){dt.extTextOut(ql,Zl,So,Ql,tc,Po)})}break;case n.Helper.GDI.RecordType.META_EXCLUDECLIPRECT:var ec=new e.Rect(l);b._records.push(function(dt){dt.excludeClipRect(ec)});break;case n.Helper.GDI.RecordType.META_INTERSECTCLIPRECT:var rc=new e.Rect(l);b._records.push(function(dt){dt.intersectClipRect(rc)});break;case n.Helper.GDI.RecordType.META_POLYGON:for(var he=l.readInt16(),Do=[];he>0;)Do.push(new e.PointS(l)),he--;b._records.push(function(dt){dt.polygon(Do,!0)});break;case n.Helper.GDI.RecordType.META_SETPOLYFILLMODE:var nc=l.readUint16();b._records.push(function(dt){dt.setPolyFillMode(nc)});break;case n.Helper.GDI.RecordType.META_POLYPOLYGON:for(var he=l.readUint16(),Ro=[],se=0;se<he;se++)Ro.push(l.readUint16());for(var ko=[],se=0;se<he;se++){for(var ic=Ro[se],Io=[],Mo=0;Mo<ic;Mo++)Io.push(new e.PointS(l));ko.push(Io)}b._records.push(function(dt){dt.polyPolygon(ko)});break;case n.Helper.GDI.RecordType.META_POLYLINE:for(var he=l.readInt16(),Oo=[];he>0;)Oo.push(new e.PointS(l)),he--;b._records.push(function(dt){dt.polyline(Oo)});break;case n.Helper.GDI.RecordType.META_ELLIPSE:var oc=new e.Rect(l);b._records.push(function(dt){dt.ellipse(oc)});break;case n.Helper.GDI.RecordType.META_CREATEPALETTE:var ac=new p.Palette(l);b._records.push(function(dt){dt.createPalette(ac)});break;case n.Helper.GDI.RecordType.META_CREATEREGION:var sc=new t.Region(l);b._records.push(function(dt){dt.createRegion(sc)});break;case n.Helper.GDI.RecordType.META_CREATEPATTERNBRUSH:var Wt=v*2-(l.pos-i),lc=new A.PatternBitmap16(l,Wt),cc=new p.Brush(l,Wt,lc);b._records.push(function(dt){dt.createPatternBrush(cc)});break;case n.Helper.GDI.RecordType.META_OFFSETCLIPRGN:var hc=l.readInt16(),fc=l.readInt16();b._records.push(function(dt){dt.offsetClipRgn(fc,hc)});break;case n.Helper.GDI.RecordType.META_REALIZEPALETTE:case n.Helper.GDI.RecordType.META_SETPALENTRIES:case n.Helper.GDI.RecordType.META_SETROP2:case n.Helper.GDI.RecordType.META_SETRELABS:case n.Helper.GDI.RecordType.META_SETTEXTCHAREXTRA:case n.Helper.GDI.RecordType.META_RESIZEPALETTE:case n.Helper.GDI.RecordType.META_SETLAYOUT:case n.Helper.GDI.RecordType.META_FILLREGION:case n.Helper.GDI.RecordType.META_SETMAPPERFLAGS:case n.Helper.GDI.RecordType.META_SETTEXTJUSTIFICATION:case n.Helper.GDI.RecordType.META_SCALEWINDOWEXT:case n.Helper.GDI.RecordType.META_SCALEVIEWPORTEXT:case n.Helper.GDI.RecordType.META_FLOODFILL:case n.Helper.GDI.RecordType.META_FRAMEREGION:case n.Helper.GDI.RecordType.META_ANIMATEPALETTE:case n.Helper.GDI.RecordType.META_EXTFLOODFILL:case n.Helper.GDI.RecordType.META_SETPIXEL:case n.Helper.GDI.RecordType.META_PATBLT:case n.Helper.GDI.RecordType.META_PIE:case n.Helper.GDI.RecordType.META_STRETCHBLT:case n.Helper.GDI.RecordType.META_INVERTREGION:case n.Helper.GDI.RecordType.META_PAINTREGION:case n.Helper.GDI.RecordType.META_ARC:case n.Helper.GDI.RecordType.META_CHORD:case n.Helper.GDI.RecordType.META_BITBLT:case n.Helper.GDI.RecordType.META_SETDIBTODEV:default:var Bo="UNKNOWN";for(var No in n.Helper.GDI.RecordType)if(n.Helper.GDI.RecordType[No]===_){Bo=No;break}n.Helper.log("[WMF] "+Bo+" record (0x"+_.toString(16)+") at offset 0x"+i.toString(16)+" with "+v*2+" bytes");break}i+=v*2},b=this;t:for(;!o;)switch(a()){case"break-main_loop":break t}if(!o)throw new n.WMFJSError("Could not read all records")}return s.prototype.play=function(l){for(var u=this._records.length,o=0;o<u;o++)this._records[o](l)},s})()})},f={};function g(E){var h=f[E];if(h!==void 0)return h.exports;var w=f[E]={exports:{}};return d[E](w,w.exports,g),w.exports}g.d=(E,h)=>{for(var w in h)g.o(h,w)&&!g.o(E,w)&&Object.defineProperty(E,w,{enumerable:!0,get:h[w]})},g.o=(E,h)=>Object.prototype.hasOwnProperty.call(E,h),g.r=E=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(E,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(E,"__esModule",{value:!0})};var y={};return(()=>{g.r(y),g.d(y,{Error:()=>h.WMFJSError,Renderer:()=>E.Renderer,loggingEnabled:()=>h.loggingEnabled});var E=g("./src/wmfjs/Renderer.ts"),h=g("./src/wmfjs/Helper.ts")})(),y})())})),Hl=We(((m,C)=>{(function(f,g){typeof m=="object"&&typeof C=="object"?C.exports=g(go(),mo()):typeof define=="function"&&define.amd?define(["./EMFJS.bundle.js","./WMFJS.bundle.js"],g):typeof m=="object"?m.RTFJS=g(go(),mo()):f.RTFJS=g(f.EMFJS,f.WMFJS)})(m,(d,f)=>(()=>{var g={"./node_modules/codepage/cptable.js":(w=>{var A={version:"1.15.0"};A[37]=(function(){for(var r=`\0œ †—Ž\v\f\r…\b‡’€‚ƒ„
305
305
  \x1Bˆ‰Š‹Œ\x07‘“”•–˜™š›ž  âäàáãåçñ¢.<(+|&éêëèíîïìß!$*);¬-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ\`:#@'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®^£¥·©§¶¼½¾[]¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ`,n=[],e={},t=0;t!=r.length;++t)r.charCodeAt(t)!==65533&&(e[r.charAt(t)]=t),n[t]=r.charAt(t);return{enc:e,dec:n}})(),A[437]=(function(){for(var r=`\0\x07\b
306
306
  \v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ `,n=[],e={},t=0;t!=r.length;++t)r.charCodeAt(t)!==65533&&(e[r.charAt(t)]=t),n[t]=r.charAt(t);return{enc:e,dec:n}})(),A[500]=(function(){for(var r=`\0œ †—Ž\v\f\r…\b‡’€‚ƒ„
307
307
  \x1Bˆ‰Š‹Œ\x07‘“”•–˜™š›ž  âäàáãåçñ[.<(+!&éêëèíîïìß]$*);^-/ÂÄÀÁÃÅÇѦ,%_>?øÉÊËÈÍÎÏÌ\`:#@'="Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ¤µ~stuvwxyz¡¿ÐÝÞ®¢£¥·©§¶¼½¾¬|¯¨´×{ABCDEFGHI­ôöòóõ}JKLMNOPQR¹ûüùúÿ\\÷STUVWXYZ²ÔÖÒÓÕ0123456789³ÛÜÙڟ`,n=[],e={},t=0;t!=r.length;++t)r.charCodeAt(t)!==65533&&(e[r.charAt(t)]=t),n[t]=r.charAt(t);return{enc:e,dec:n}})(),A[737]=(function(){for(var r=`\0\x07\b
@@ -442,7 +442,7 @@ ${lo}`}});C.innerHTML=`<style data-msdoc>${g.css}</style>${Rl(g.html)}`;const y=
442
442
  \v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàąçêëèïîćÄĄĘęłôöĆûùŚÖܢ٥śƒŹŻóÓńŃźż¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ `,n=[],e={},t=0;t!=r.length;++t)r.charCodeAt(t)!==65533&&(e[r.charAt(t)]=t),n[t]=r.charAt(t);return{enc:e,dec:n}})(),A[895]=(function(){for(var r=`\0\x07\b
443
443
  \v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~ČüéďäĎŤčěĚĹÍľǪÄÁÉžŽôöÓůÚýÖÜŠĽÝŘťáíóúňŇŮÔšřŕŔ¼§«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ `,n=[],e={},t=0;t!=r.length;++t)r.charCodeAt(t)!==65533&&(e[r.charAt(t)]=t),n[t]=r.charAt(t);return{enc:e,dec:n}})(),w.exports&&typeof DO_NOT_EXPORT_CODEPAGE>"u"&&(w.exports=A)}),"./node_modules/codepage/cputils.js":(function(w,A,r){(function(n,e){"use strict";if(typeof cptable>"u"){var t=r("./node_modules/codepage/cptable.js");w.exports&&typeof DO_NOT_EXPORT_CODEPAGE>"u"?w.exports=e(t):n.cptable=e(t)}else cptable=e(cptable)})(this,function(n){"use strict";var e={1200:"utf16le",1201:"utf16be",12e3:"utf32le",12001:"utf32be",16969:"utf64le",20127:"ascii",65e3:"utf7",65001:"utf8"},t=[874,1250,1251,1252,1253,1254,1255,1256,1e4],p=[932,936,949,950],c=[65001],s={},l={},u={},o={},i=function(j){return String.fromCharCode(j)},a=function(j){return j.charCodeAt(0)},b=typeof Buffer<"u",v=function(){};if(b){var _=!Buffer.from;if(!_)try{Buffer.from("foo","utf8")}catch{_=!0}v=_?function(nt,j){return j?new Buffer(nt,j):new Buffer(nt)}:Buffer.from.bind(Buffer),Buffer.allocUnsafe||(Buffer.allocUnsafe=function(nt){return new Buffer(nt)});var T=1024,k=Buffer.allocUnsafe(T),M=function(j){for(var U=Buffer.allocUnsafe(65536),at=0;at<65536;++at)U[at]=0;for(var rt=Object.keys(j),V=rt.length,et=0,q=rt[et];et<V;++et)(q=rt[et])&&(U[q.charCodeAt(0)]=j[q]);return U},R=function(j){var U=M(n[j].enc);return function(rt,V){var et=rt.length,q,F=0,ut=0,S=0,$=0;if(typeof rt=="string")for(q=Buffer.allocUnsafe(et),F=0;F<et;++F)q[F]=U[rt.charCodeAt(F)];else if(Buffer.isBuffer(rt)){for(q=Buffer.allocUnsafe(2*et),ut=0,F=0;F<et;++F)S=rt[F],S<128?q[ut++]=U[S]:S<224?(q[ut++]=U[((S&31)<<6)+(rt[F+1]&63)],++F):S<240?(q[ut++]=U[((S&15)<<12)+((rt[F+1]&63)<<6)+(rt[F+2]&63)],F+=2):($=((S&7)<<18)+((rt[F+1]&63)<<12)+((rt[F+2]&63)<<6)+(rt[F+3]&63),F+=3,$<65536?q[ut++]=U[$]:($-=65536,q[ut++]=U[55296+($>>10&1023)],q[ut++]=U[56320+($&1023)]));q=q.slice(0,ut)}else for(q=Buffer.allocUnsafe(et),F=0;F<et;++F)q[F]=U[rt[F].charCodeAt(0)];return!V||V==="buf"?q:V!=="arr"?q.toString("binary"):[].slice.call(q)}},O=function(j){var U=n[j].dec,at=Buffer.allocUnsafe(131072),rt=0,V="";for(rt=0;rt<U.length;++rt)if(V=U[rt]){var et=V.charCodeAt(0);at[2*rt]=et&255,at[2*rt+1]=et>>8}return function(F){var ut=F.length,S=0,$=0;if(2*ut>T&&(T=2*ut,k=Buffer.allocUnsafe(T)),Buffer.isBuffer(F))for(S=0;S<ut;S++)$=2*F[S],k[2*S]=at[$],k[2*S+1]=at[$+1];else if(typeof F=="string")for(S=0;S<ut;S++)$=2*F.charCodeAt(S),k[2*S]=at[$],k[2*S+1]=at[$+1];else for(S=0;S<ut;S++)$=2*F[S],k[2*S]=at[$],k[2*S+1]=at[$+1];return k.slice(0,2*ut).toString("ucs2")}},P=function(j){for(var U=n[j].enc,at=Buffer.allocUnsafe(131072),rt=0;rt<131072;++rt)at[rt]=0;for(var V=Object.keys(U),et=0,q=V[et];et<V.length;++et)if(q=V[et]){var F=q.charCodeAt(0);at[2*F]=U[q]&255,at[2*F+1]=U[q]>>8}return function(S,$){var z=S.length,x=Buffer.allocUnsafe(2*z),D=0,I=0,H=0,L=0,B=0;if(typeof S=="string"){for(D=L=0;D<z;++D)I=S.charCodeAt(D)*2,x[L++]=at[I+1]||at[I],at[I+1]>0&&(x[L++]=at[I]);x=x.slice(0,L)}else if(Buffer.isBuffer(S)){for(D=L=0;D<z;++D)B=S[D],B<128?I=B:B<224?(I=((B&31)<<6)+(S[D+1]&63),++D):B<240?(I=((B&15)<<12)+((S[D+1]&63)<<6)+(S[D+2]&63),D+=2):(I=((B&7)<<18)+((S[D+1]&63)<<12)+((S[D+2]&63)<<6)+(S[D+3]&63),D+=3),I<65536?(I*=2,x[L++]=at[I+1]||at[I],at[I+1]>0&&(x[L++]=at[I])):(H=I-65536,I=2*(55296+(H>>10&1023)),x[L++]=at[I+1]||at[I],at[I+1]>0&&(x[L++]=at[I]),I=2*(56320+(H&1023)),x[L++]=at[I+1]||at[I],at[I+1]>0&&(x[L++]=at[I]));x=x.slice(0,L)}else for(D=L=0;D<z;D++)I=S[D].charCodeAt(0)*2,x[L++]=at[I+1]||at[I],at[I+1]>0&&(x[L++]=at[I]);return!$||$==="buf"?x:$!=="arr"?x.toString("binary"):[].slice.call(x)}},N=function(j){var U=n[j].dec,at=Buffer.allocUnsafe(131072),rt=0,V,et=0,q=0,F=0;for(F=0;F<65536;++F)at[2*F]=255,at[2*F+1]=253;for(rt=0;rt<U.length;++rt)(V=U[rt])&&(et=V.charCodeAt(0),q=2*rt,at[q]=et&255,at[q+1]=et>>8);return function(S){var $=S.length,z=Buffer.allocUnsafe(2*$),x=0,D=0,I=0;if(Buffer.isBuffer(S))for(x=0;x<$;x++)D=2*S[x],at[D]===255&&at[D+1]===253&&(D=2*((S[x]<<8)+S[x+1]),++x),z[I++]=at[D],z[I++]=at[D+1];else if(typeof S=="string")for(x=0;x<$;x++)D=2*S.charCodeAt(x),at[D]===255&&at[D+1]===253&&(D=2*((S.charCodeAt(x)<<8)+S.charCodeAt(x+1)),++x),z[I++]=at[D],z[I++]=at[D+1];else for(x=0;x<$;x++)D=2*S[x],at[D]===255&&at[D+1]===253&&(D=2*((S[x]<<8)+S[x+1]),++x),z[I++]=at[D],z[I++]=at[D+1];return z.slice(0,I).toString("ucs2")}};s[65001]=function nt(j){if(typeof j=="string")return nt(j.split("").map(a));var U=j.length,at=0,rt=0;4*U>T&&(T=4*U,k=Buffer.allocUnsafe(T));var V=0;U>=3&&j[0]==239&&j[1]==187&&j[2]==191&&(V=3);for(var et=1,q=0,F=0;V<U;V+=et)et=1,F=j[V],F<128?at=F:F<224?(at=(F&31)*64+(j[V+1]&63),et=2):F<240?(at=((F&15)<<12)+(j[V+1]&63)*64+(j[V+2]&63),et=3):(at=(F&7)*262144+((j[V+1]&63)<<12)+(j[V+2]&63)*64+(j[V+3]&63),et=4),at<65536?(k[q++]=at&255,k[q++]=at>>8):(at-=65536,rt=55296+(at>>10&1023),at=56320+(at&1023),k[q++]=rt&255,k[q++]=rt>>>8,k[q++]=at&255,k[q++]=at>>>8&255);return k.slice(0,q).toString("ucs2")},l[65001]=function(j,U){if(b&&Buffer.isBuffer(j))return!U||U==="buf"?j:U!=="arr"?j.toString("binary"):[].slice.call(j);var at=j.length,rt=0,V=0,et=0,q=typeof j=="string";4*at>T&&(T=4*at,k=Buffer.allocUnsafe(T));for(var F=0;F<at;++F)rt=q?j.charCodeAt(F):j[F].charCodeAt(0),rt<=127?k[et++]=rt:rt<=2047?(k[et++]=192+(rt>>6),k[et++]=128+(rt&63)):rt>=55296&&rt<=57343?(rt-=55296,++F,V=(q?j.charCodeAt(F):j[F].charCodeAt(0))-56320+(rt<<10),k[et++]=240+(V>>>18&7),k[et++]=144+(V>>>12&63),k[et++]=128+(V>>>6&63),k[et++]=128+(V&63)):(k[et++]=224+(rt>>12),k[et++]=128+(rt>>6&63),k[et++]=128+(rt&63));return!U||U==="buf"?k.slice(0,et):U!=="arr"?k.slice(0,et).toString("binary"):[].slice.call(k,0,et)}}var it=function(){if(b){if(u[t[0]])return;var j=0,U=0;for(j=0;j<t.length;++j)U=t[j],n[U]&&(u[U]=O(U),o[U]=R(U));for(j=0;j<p.length;++j)U=p[j],n[U]&&(u[U]=N(U),o[U]=P(U));for(j=0;j<c.length;++j)U=c[j],s[U]&&(u[U]=s[U]),l[U]&&(o[U]=l[U])}},J=function(nt,j){return""},ot=function(j){delete u[j],delete o[j]},tt={encache:it,decache:function(){if(b){if(!u[t[0]])return;t.forEach(ot),p.forEach(ot),c.forEach(ot)}G=J,gt=0},sbcs:t,dbcs:p};it();var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",W="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'(),-./:?",G=J,gt=0;return n.utils={decode:function nt(j,U){var at;if(at=u[j])return at(U);if(typeof U=="string")return nt(j,U.split("").map(a));var rt=U.length,V=new Array(rt),et="",q=0,F=0,ut=1,S=0,$=0,z=n[j],x,D="";if(z&&(x=z.dec))for(F=0;F<rt;F+=ut){if(ut=2,et=x[(U[F]<<8)+U[F+1]],et||(ut=1,et=x[U[F]]),!et)throw new Error("Unrecognized code: "+U[F]+" "+U[F+ut-1]+" "+F+" "+ut+" "+x[U[F]]);V[S++]=et}else if(D=e[j])switch(D){case"utf8":for(rt>=3&&U[0]==239&&U[1]==187&&U[2]==191&&(F=3);F<rt;F+=ut)ut=1,U[F]<128?q=U[F]:U[F]<224?(q=(U[F]&31)*64+(U[F+1]&63),ut=2):U[F]<240?(q=((U[F]&15)<<12)+(U[F+1]&63)*64+(U[F+2]&63),ut=3):(q=(U[F]&7)*262144+((U[F+1]&63)<<12)+(U[F+2]&63)*64+(U[F+3]&63),ut=4),q<65536||(q-=65536,$=55296+(q>>10&1023),q=56320+(q&1023),V[S++]=String.fromCharCode($)),V[S++]=String.fromCharCode(q);break;case"ascii":if(b&&Buffer.isBuffer(U))return U.toString(D);for(F=0;F<rt;F++)V[F]=String.fromCharCode(U[F]);S=rt;break;case"utf16le":if(rt>=2&&U[0]==255&&U[1]==254&&(F=2),b&&Buffer.isBuffer(U))return U.toString(D);for(ut=2;F+1<rt;F+=ut)V[S++]=String.fromCharCode((U[F+1]<<8)+U[F]);break;case"utf16be":for(rt>=2&&U[0]==254&&U[1]==255&&(F=2),ut=2;F+1<rt;F+=ut)V[S++]=String.fromCharCode((U[F]<<8)+U[F+1]);break;case"utf32le":for(rt>=4&&U[0]==255&&U[1]==254&&U[2]===0&&U[3]===0&&(F=4),ut=4;F<rt;F+=ut)q=(U[F+3]<<24)+(U[F+2]<<16)+(U[F+1]<<8)+U[F],q>65535?(q-=65536,V[S++]=String.fromCharCode(55296+(q>>10&1023)),V[S++]=String.fromCharCode(56320+(q&1023))):V[S++]=String.fromCharCode(q);break;case"utf32be":for(rt>=4&&U[3]==255&&U[2]==254&&U[1]===0&&U[0]===0&&(F=4),ut=4;F<rt;F+=ut)q=(U[F]<<24)+(U[F+1]<<16)+(U[F+2]<<8)+U[F+3],q>65535?(q-=65536,V[S++]=String.fromCharCode(55296+(q>>10&1023)),V[S++]=String.fromCharCode(56320+(q&1023))):V[S++]=String.fromCharCode(q);break;case"utf7":for(rt>=4&&U[0]==43&&U[1]==47&&U[2]==118&&(rt>=5&&U[3]==56&&U[4]==45?F=5:(U[3]==56||U[3]==57||U[3]==43||U[3]==47)&&(F=4));F<rt;F+=ut){if(U[F]!==43){ut=1,V[S++]=String.fromCharCode(U[F]);continue}if(ut=1,U[F+1]===45){ut=2,V[S++]="+";continue}for(;String.fromCharCode(U[F+ut]).match(/[A-Za-z0-9+\/]/);)ut++;var I=0;U[F+ut]===45&&(++ut,I=1);for(var H=[],L="",B=0,Y=0,Q=0,K=0,lt=0,ft=0,X=0,mt=1;mt<ut-I&&(K=ht.indexOf(String.fromCharCode(U[F+mt++])),lt=ht.indexOf(String.fromCharCode(U[F+mt++])),B=K<<2|lt>>4,H.push(B),ft=ht.indexOf(String.fromCharCode(U[F+mt++])),!(ft===-1||(Y=(lt&15)<<4|ft>>2,H.push(Y),X=ht.indexOf(String.fromCharCode(U[F+mt++])),X===-1)));)Q=(ft&3)<<6|X,X<64&&H.push(Q);for(L=nt(1201,H),mt=0;mt<L.length;++mt)V[S++]=L.charAt(mt)}break;default:throw new Error("Unsupported magic: "+j+" "+e[j])}else throw new Error("Unrecognized CP: "+j);return V.slice(0,S).join("")},encode:function nt(j,U,at){if(j===gt&&G)return G(U,at);if(o[j])return G=o[gt=j],G(U,at);b&&Buffer.isBuffer(U)&&(U=U.toString("utf8"));var rt=U.length,V=b?Buffer.allocUnsafe(4*rt):[],et=0,q=0,F=0,ut=0,S=n[j],$,z="",x=typeof U=="string";if(S&&($=S.enc))for(q=0;q<rt;++q,++F)et=$[x?U.charAt(q):U[q]],et>255?(V[F]=et>>8,V[++F]=et&255):V[F]=et&255;else if(z=e[j])switch(z){case"utf8":if(b&&x){V=v(U,z),F=V.length;break}for(q=0;q<rt;++q,++F)et=x?U.charCodeAt(q):U[q].charCodeAt(0),et<=127?V[F]=et:et<=2047?(V[F]=192+(et>>6),V[++F]=128+(et&63)):et>=55296&&et<=57343?(et-=55296,ut=(x?U.charCodeAt(++q):U[++q].charCodeAt(0))-56320+(et<<10),V[F]=240+(ut>>>18&7),V[++F]=144+(ut>>>12&63),V[++F]=128+(ut>>>6&63),V[++F]=128+(ut&63)):(V[F]=224+(et>>12),V[++F]=128+(et>>6&63),V[++F]=128+(et&63));break;case"ascii":if(b&&typeof U=="string"){V=v(U,z),F=V.length;break}for(q=0;q<rt;++q,++F)if(et=x?U.charCodeAt(q):U[q].charCodeAt(0),et<=127)V[F]=et;else throw new Error("bad ascii "+et);break;case"utf16le":if(b&&typeof U=="string"){V=v(U,z),F=V.length;break}for(q=0;q<rt;++q)et=x?U.charCodeAt(q):U[q].charCodeAt(0),V[F++]=et&255,V[F++]=et>>8;break;case"utf16be":for(q=0;q<rt;++q)et=x?U.charCodeAt(q):U[q].charCodeAt(0),V[F++]=et>>8,V[F++]=et&255;break;case"utf32le":for(q=0;q<rt;++q)et=x?U.charCodeAt(q):U[q].charCodeAt(0),et>=55296&&et<=57343&&(et=65536+(et-55296<<10)+(U[++q].charCodeAt(0)-56320)),V[F++]=et&255,et>>=8,V[F++]=et&255,et>>=8,V[F++]=et&255,et>>=8,V[F++]=et&255;break;case"utf32be":for(q=0;q<rt;++q)et=x?U.charCodeAt(q):U[q].charCodeAt(0),et>=55296&&et<=57343&&(et=65536+(et-55296<<10)+(U[++q].charCodeAt(0)-56320)),V[F+3]=et&255,et>>=8,V[F+2]=et&255,et>>=8,V[F+1]=et&255,et>>=8,V[F]=et&255,F+=4;break;case"utf7":for(q=0;q<rt;q++){var D=x?U.charAt(q):U[q].charAt(0);if(D==="+"){V[F++]=43,V[F++]=45;continue}if(W.indexOf(D)>-1){V[F++]=D.charCodeAt(0);continue}var I=nt(1201,D);V[F++]=43,V[F++]=ht.charCodeAt(I[0]>>2),V[F++]=ht.charCodeAt(((I[0]&3)<<4)+((I[1]||0)>>4)),V[F++]=ht.charCodeAt(((I[1]&15)<<2)+((I[2]||0)>>6)),V[F++]=45}break;default:throw new Error("Unsupported magic: "+j+" "+e[j])}else throw new Error("Unrecognized CP: "+j);return V=V.slice(0,F),b?!at||at==="buf"?V:at!=="arr"?V.toString("binary"):[].slice.call(V):at=="str"?V.map(i).join(""):V},hascp:function(j){return!!(n[j]||e[j])},magic:e,cache:tt},n})}),"./src/rtfjs/Document.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{Document:()=>e});var n=r("./src/rtfjs/Helper.ts"),e=(function(){function t(p){this._settings=p||{},this._meta={},this._fonts=[],this._colors=[],this._autoColor=null,this._stylesheets=[],this._ins=[]}return t.prototype._lookupColor=function(p){if(p===0)return this._autoColor==null?null:this._colors[this._autoColor];if(p<0||p>=this._colors.length)throw new n.RTFJSError("Invalid color index");return this._colors[p]},t.prototype.addIns=function(p){this._ins.push(p)},t})()}),"./src/rtfjs/DocumentFacade.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{DocumentFacade:()=>c});var n=r("./src/rtfjs/Document.ts"),e=r("./src/rtfjs/Helper.ts"),t=r("./src/rtfjs/parser/Parser.ts"),p=r("./src/rtfjs/renderer/Renderer.ts"),c=(function(){function s(l,u){this._document=new n.Document(u),this._renderer=new p.Renderer(this._document);var o=new t.Parser(this._document,l,this._renderer);this._parsed=o.parse()}return s.prototype.metadata=function(){return this._document._meta},s.prototype.render=function(){var l=this;return this._parsed.then(function(){return l._renderer.buildDom()}).catch(function(u){throw new e.RTFJSError(u)})},s})()}),"./src/rtfjs/Helper.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{Helper:()=>c,RTFJSError:()=>e,loggingEnabled:()=>p});var n=(function(){var s=function(l,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a])},s(l,u)};return function(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");s(l,u);function o(){this.constructor=l}l.prototype=u===null?Object.create(u):(o.prototype=u.prototype,new o)}})(),e=(function(s){n(l,s);function l(u){var o=this.constructor,i=s.call(this,u)||this;return Object.setPrototypeOf(i,o.prototype),i}return l})(Error),t=!0;function p(s){t=s}var c=(function(){function s(){}return s.log=function(l){t&&console.log(l)},s._isalpha=function(l){for(var u=l.length,o=0;o<u;o++){var i=l.charCodeAt(o);if(!(i>=this._A&&i<=this._Z||i>=this._a&&i<=this._z))return!1}return u>0},s._isdigit=function(l){for(var u=l.length,o=0;o<u;o++){var i=l.charCodeAt(o);if(i<this._0||i>this._9)return!1}return u>0},s._parseHex=function(l){for(var u=l.length,o=0;o<u;o++){var i=l.charCodeAt(o);if(!(i>=this._0&&i<=this._9||i>=this._a&&i<=this._f||i>=this._A&&i<=this._F))return NaN}return u>0?parseInt(l,16):NaN},s._blobToBinary=function(l){for(var u=new Uint8Array(l),o="",i=u.length,a=0;a<i;a++)o+=String.fromCharCode(u[a]);return o},s._hexToBlob=function(l){for(var u=l.length,o=new ArrayBuffer(Math.floor(u--/2)),i=new Uint8Array(o),a=0,b=0;b<u;b+=2){var v=this._parseHex(l.substr(b,2));if(isNaN(v))return null;i[a++]=v}return o},s._hexToBinary=function(l){for(var u="",o=l.length-1,i=0;i<o;i+=2){var a=this._parseHex(l.substr(i,2));if(isNaN(a))return null;u+=String.fromCharCode(a)}return u},s._mapCharset=function(l){return this._charsetMap[l.toString()]},s._mapColorTheme=function(l){return this._colorThemeMap[l]},s._colorToStr=function(l){return"rgb("+l.r+","+l.g+","+l.b+")"},s._twipsToPt=function(l){return Math.floor(l/20)},s._twipsToPx=function(l){return Math.floor(l/20*96/72)},s._pxToTwips=function(l){return Math.floor(l*20*72/96)},s.JUSTIFICATION={LEFT:"left",CENTER:"center",RIGHT:"right",JUSTIFY:"justify"},s.BREAKTYPE={NONE:"none",COL:"col",EVEN:"even",ODD:"odd",PAGE:"page"},s.PAGENUMBER={DECIMAL:"decimal",UROM:"urom",LROM:"lrom",ULTR:"ultr",LLTR:"lltr"},s.UNDERLINE={NONE:"none",CONTINUOUS:"continuous",DOTTED:"dotted",DASHED:"dashed",DASHDOTTED:"dashdotted",DASHDOTDOTTED:" dashdotdotted",DOUBLE:"double",HEAVYWAVE:"heavywave",LONGDASHED:"longdashed",THICK:"thick",THICKDOTTED:"thickdotted",THICKDASHED:"thickdashed",THICKDASHDOTTED:"thickdashdotted",THICKDASHDOTDOTTED:"thickdashdotdotted",THICKLONGDASH:"thicklongdash",DOUBLEWAVE:"doublewave",WORD:"word",WAVE:"wave"},s.FONTPITCH={DEFAULT:0,FIXED:1,VARIABLE:2},s.CHARACTER_TYPE={LOWANSI:"loch",HIGHANSI:"hich",DOUBLE:"dbch"},s.SUPERSUBSCRIPT={SUPERSCRIPT:1,NONE:0,SUBSCRIPT:-1},s._A=65,s._a=97,s._F=70,s._f=102,s._Z=90,s._z=122,s._0=48,s._9=57,s._charsetMap={0:1252,2:42,77:1e4,78:10001,79:10003,80:10008,81:10002,83:10005,84:10004,85:10006,86:10081,87:10021,88:10029,89:10007,128:932,129:949,130:1361,134:936,136:950,161:1253,162:1254,163:1258,177:1255,178:1256,186:1257,204:1251,222:874,238:1250,254:437,255:850},s._colorThemeMap={maindarkone:null,mainlightone:null,maindarktwo:null,mainlighttwo:null,accentone:null,accenttwo:null,accentthree:null,accentfour:null,accentfive:null,accentsix:null,hyperlink:null,followedhyperlink:null,backgroundone:null,textone:null,backgroundtwo:null,texttwo:null},s})()}),"./src/rtfjs/parser/Containers.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{Chp:()=>e,Dop:()=>c,GlobalState:()=>l,HexText:()=>o,Pap:()=>t,PlainText:()=>u,Sep:()=>p,State:()=>s});var n=r("./src/rtfjs/Helper.ts"),e=(function(){function i(a){a!=null?(this.bold=a.bold,this.underline=a.underline,this.italic=a.italic,this.strikethrough=a.strikethrough,this.dblstrikethrough=a.dblstrikethrough,this.colorindex=a.colorindex,this.highlightindex=a.highlightindex,this.fontsize=a.fontsize,this.fontfamily=a.fontfamily,this.supersubscript=a.supersubscript):(this.bold=!1,this.underline=n.Helper.UNDERLINE.NONE,this.italic=!1,this.strikethrough=!1,this.dblstrikethrough=!1,this.colorindex=0,this.highlightindex=0,this.fontsize=24,this.supersubscript=n.Helper.SUPERSUBSCRIPT.NONE)}return i})(),t=(function(){function i(a){a!=null?(this.indent={left:a.indent.left,right:a.indent.right,firstline:a.indent.firstline},this.justification=a.justification,this.spacebefore=a.spacebefore,this.spaceafter=a.spaceafter,this.charactertype=a.charactertype):(this.indent={left:0,right:0,firstline:0},this.justification=n.Helper.JUSTIFICATION.LEFT,this.spacebefore=0,this.spaceafter=0,this.charactertype=null)}return i})(),p=(function(){function i(a){a!=null?(this.columns=a.columns,this.breaktype=a.breaktype,this.pagenumber={x:a.pagenumber.x,y:a.pagenumber.y},this.pagenumberformat=a.pagenumberformat):(this.columns=0,this.breaktype=n.Helper.BREAKTYPE.NONE,this.pagenumber={x:0,y:0},this.pagenumberformat=n.Helper.PAGENUMBER.DECIMAL)}return i})(),c=(function(){function i(a){a!=null?(this.width=a.width,this.height=a.height,this.margin={left:a.margin.left,top:a.margin.top,right:a.margin.right,bottom:a.margin.bottom},this.pagenumberstart=a.pagenumberstart,this.facingpages=a.facingpages,this.landscape=a.landscape):(this.width=0,this.height=0,this.margin={left:0,top:0,right:0,bottom:0},this.pagenumberstart=0,this.facingpages=!1,this.landscape=!1)}return i})(),s=(function(){function i(a){this.parent=a,this.first=!0,this.skipchars=0,this.bindata=0,a!=null?(this.chp=new e(a.chp),this.pap=new t(a.pap),this.sep=new p(a.sep),this.dop=new c(a.dop),this.destination=a.destination,this.skipunknowndestination=a.skipunknowndestination,this.skipdestination=a.skipdestination,this.ucn=a.ucn):(this.chp=new e(null),this.pap=new t(null),this.sep=new p(null),this.dop=new c(null),this.destination=null,this.skipunknowndestination=!1,this.skipdestination=!1,this.ucn=1)}return i})(),l=(function(){function i(a,b){this.data=new Uint8Array(a),this.pos=0,this.line=1,this.column=0,this.state=null,this.version=null,this.text=[],this.codepage=1252,this._asyncTasks=[],this.renderer=b}return i})(),u=(function(){function i(a){this.text=a}return i})(),o=(function(){function i(a,b){this.hex=a,this.chp=b}return i})()}),"./src/rtfjs/parser/Parser.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{Parser:()=>o});var n=r("./node_modules/codepage/cputils.js"),e=r.n(n),t=r("./src/rtfjs/Helper.ts"),p=r("./src/rtfjs/renderer/RenderChp.ts"),c=r("./src/rtfjs/renderer/RenderPap.ts"),s=r("./src/rtfjs/parser/Containers.ts"),l=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),u=r("./src/rtfjs/parser/destinations/Destinations.ts"),o=(function(){function i(a,b,v){this.inst=a,this.parser=new s.GlobalState(b,v)}return i.prototype.parse=function(){if(this.parser.data.length>1&&String.fromCharCode(this.parser.data[0])==="{")return this.parseLoop(!1,!0),Promise.all(this.parser._asyncTasks).then(function(){});if(this.parser.version==null)throw new t.RTFJSError("Not a valid rtf document");if(this.parser.state!=null)throw new t.RTFJSError("File truncated")},i.prototype.eof=function(){return this.parser.pos>=this.parser.data.length},i.prototype.readChar=function(){if(this.parser.pos<this.parser.data.length)return this.parser.column++,String.fromCharCode(this.parser.data[this.parser.pos++]);throw new t.RTFJSError("Unexpected end of file")},i.prototype.unreadChar=function(){if(this.parser.pos>0)this.parser.column--,this.parser.pos--;else throw new t.RTFJSError("Already at beginning of file")},i.prototype.readBlob=function(a){if(this.parser.pos+a>this.parser.data.length)throw new t.RTFJSError("Cannot read binary data: too long");for(var b=new ArrayBuffer(a),v=new Uint8Array(b),_=0;_<a;_++)v[_]=this.parser.data[this.parser.pos+_];return b},i.prototype.applyDestination=function(a){var b=this.parser.state.destination;b!=null&&(a||this.parser.state.parent==null||this.parser.state.parent.destination!==this.parser.state.destination)&&(b.apply!=null&&b.apply(),this.parser.state.destination=null)},i.prototype.applyText=function(){if(this.parser.text.length>0){var a=this.parser.state.destination;if(a==null)throw new t.RTFJSError("Cannot route text to destination");if(a.appendText!=null&&!this.parser.state.skipdestination){var b=this.summarizeText(this.parser.text);a.appendText(b)}this.parser.text=[]}},i.prototype.summarizeText=function(a){for(var b="",v=0;v<a.length;v++){var _=a[v];if(_ instanceof s.PlainText)b+=_.text;else if(_ instanceof s.HexText){var T=this.parser.codepage;if(Object.prototype.hasOwnProperty.call(_.chp,"fontfamily")){var k=_.chp.fontfamily;this.inst._fonts!==void 0&&this.inst._fonts[k]!=null&&this.inst._fonts[k].charset&&this.inst._fonts[k].charset!==42&&(T=this.inst._fonts[k].charset)}var M=_.hex;if((this.parser.state.pap.charactertype===t.Helper.CHARACTER_TYPE.DOUBLE||this.parser.state.pap.charactertype==null&&M>=128)&&v+1<a.length&&a[v+1]instanceof s.HexText&&a[v+1].chp===_.chp){var R=M*256+a[v+1].hex;e()[T].dec[R]!==void 0&&(M=R,v++)}b+=e()[T].dec[M]}}return b},i.prototype.pushState=function(a){this.parser.state=new s.State(this.parser.state),a&&(this.parser.state.skipdestination=!0);var b=this.parser.state.destination;if(b!=null&&!this.parser.state.skipdestination&&b.sub!=null){var v=b.sub();v!=null&&(this.parser.state.destination=v)}},i.prototype.popState=function(){var a=this.parser.state;if(a==null)throw new t.RTFJSError("Unexpected end of state");if(this.applyText(),(a.parent==null||a.destination!==a.parent.destination)&&this.applyDestination(!0),this.parser.state=a.parent,this.parser.state!==null){var b=this.parser.state;this.inst._ins.push(function(v){v.setChp(new p.RenderChp(b.chp))}),this.inst._ins.push(function(v){v.setPap(new c.RenderPap(b.pap))})}return this.parser.state},i.prototype.changeDestination=function(a,b){this.applyText();var v=u.Destinations[a];return v!=null?(this.applyDestination(!1),v instanceof l.DestinationFactory?this.parser.state.destination=v.newDestination(this.parser,this.inst,a,b):this.parser.state.destination=new v(this.parser,this.inst,a,b),!0):!1},i.prototype.processKeyword=function(a,b){var v=this.parser.state.first;if(v){if(a==="*"){this.parser.state.skipunknowndestination=!0;return}this.parser.state.first=!1}if(this.parser.state.bindata>0)throw new t.RTFJSError("Keyword encountered within binary data");switch(this.parser.state.skipchars=0,a){case"tab":return" ";case"emdash":return"—";case"endash":return"–";case"emspace":return" ";case"enspace":return" ";case"qmspace":return" ";case"bullet":return"•";case"lquote":return"‘";case"rquote":return"’";case"ldblquote":return"“";case"rdblquote":return"”";case"~":return" ";case"_":return"‑";case"{":case"}":case"\\":return a;case"uc":b!=null&&b>=0&&(this.parser.state.ucn=b);break;case"u":if(b!=null){if(b<0&&(b+=65536),b<0||b>65535)throw new t.RTFJSError("Invalid unicode character encountered");var _=this.parser.state.chp.fontfamily;_&&this.inst._fonts&&this.inst._fonts[_].charset&&this.inst._fonts[_].charset===42&&b>=61472&&b<=61695?this.appendText(new s.PlainText(String.fromCharCode(b-61440))):this.appendText(new s.PlainText(String.fromCharCode(b))),this.parser.state.skipchars=this.parser.state.ucn}return;case"bin":if(b==null)throw new t.RTFJSError("Binary data is missing length");if(b<0)throw new t.RTFJSError("Binary data with invalid length");this.parser.state.bindata=b;return;case"upr":this.parseLoop(!0,!1);return;case"ud":case"ltrch":case"rtlch":return;case`
444
444
  `:case"\r":this.parser.line++,this.parser.column=0,a="par";default:if(!this.parser.state.skipdestination)if(v){if(!this.changeDestination(a,b)){var T=!1,k=this.parser.state.destination;k!=null&&k.handleKeyword!=null&&(T=k.handleKeyword(a,b)||!1),!T&&this.parser.state.skipunknowndestination&&(this.parser.state.skipdestination=!0)}}else{this.applyText();var k=this.parser.state.destination;k!=null?k.handleKeyword!=null&&k.handleKeyword(a,b):t.Helper.log("Unhandled keyword: "+a+" param: "+b)}return}this.parser.state.skipdestination=!1},i.prototype.appendText=function(a){if(this.parser.state.first=!1,this.parser.state.skipchars>0){if(a instanceof s.PlainText){var b=a.text.length;if(this.parser.state.skipchars>=b){this.parser.state.skipchars-=b;return}(this.parser.state.destination==null||!this.parser.state.skipdestination)&&this.parser.text.push(new s.PlainText(a.text.slice(this.parser.state.skipchars)))}else{if(this.parser.state.skipchars>=1){this.parser.state.skipchars-=1;return}(this.parser.state.destination==null||!this.parser.state.skipdestination)&&this.parser.text.push(a)}this.parser.state.skipchars=0}else(this.parser.state.destination==null||!this.parser.state.skipdestination)&&this.parser.text.push(a)},i.prototype.applyBlob=function(a){if(this.parser.state.first=!1,this.applyText(),this.parser.state.skipchars>0)this.parser.state.skipchars--;else{var b=this.parser.state.destination;if(b==null)throw new t.RTFJSError("Cannot route binary to destination");b.handleBlob!=null&&!this.parser.state.skipdestination&&b.handleBlob(a)}},i.prototype.parseKeyword=function(a){if(this.parser.state==null)throw new t.RTFJSError("No state");var b,v=this.readChar();if(t.Helper._isalpha(v)){var k=v;for(v=this.readChar();k.length<30&&t.Helper._isalpha(v);)k+=v,v=this.readChar();var M=void 0;if(v==="-"?(M="-",v=this.readChar()):M="",t.Helper._isdigit(v)){do M+=v,v=this.readChar();while(M.length<20&&t.Helper._isdigit(v));if(M.length>=20)throw new t.RTFJSError("Param for keyword "+k+" too long");if(b=parseInt(M,10),isNaN(b))throw new t.RTFJSError("Invalid keyword "+k+" param")}if(v!==" "&&this.unreadChar(),a){var T=this.processKeyword(k,b);T!=null&&this.appendText(new s.PlainText(T))}}else if(v==="'"){var _=this.readChar()+this.readChar();if(b=t.Helper._parseHex(_),isNaN(b))throw new t.RTFJSError("Could not parse hexadecimal number");a&&this.appendText(new s.HexText(b,this.parser.state.chp))}else if(a){var T=this.processKeyword(v,null);T!=null&&this.appendText(new s.PlainText(T))}},i.prototype.parseLoop=function(a,b){try{var v=this.parser.state;t:for(;!this.eof();)if(this.parser.state!=null&&this.parser.state.bindata>0){var _=this.readBlob(this.parser.state.bindata);this.parser.state.bindata=0,this.applyBlob(_)}else{var T=this.readChar();switch(T){case"\r":continue;case`
445
- `:this.parser.line++,this.parser.column=0;continue;case"{":this.pushState(a);break;case"}":if(v===this.parser.state){this.unreadChar();break t}else if(this.popState()===v)break t;break;case"\\":this.parseKeyword(a?null:b);break;default:a||this.appendText(new s.PlainText(T));break}}}catch(k){throw k instanceof t.RTFJSError&&(k.message+=" (line: "+this.parser.line+"; column: "+this.parser.column+")"),k}},i})()}),"./src/rtfjs/parser/destinations/ColortblDestinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{ColortblDestination:()=>p});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=(function(){var c=function(s,l){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,o){u.__proto__=o}||function(u,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(u[i]=o[i])},c(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");c(s,l);function u(){this.constructor=s}s.prototype=l===null?Object.create(l):(u.prototype=l.prototype,new u)}})(),p=(function(c){t(s,c);function s(l,u){var o=c.call(this,"colortbl")||this;return o._colors=[],o._current=null,o._autoIndex=null,o.inst=u,o}return s.prototype.appendText=function(l){if(l.trim()!==";")throw new n.RTFJSError("Error parsing colortbl destination");if(this._current==null){if(this._autoIndex!=null)throw new n.RTFJSError("colortbl cannot define more than one auto color");this._autoIndex=this._colors.length,this._startNewColor()}else if(this._current.tint<255&&this._current.shade<255)throw new n.RTFJSError("colortbl cannot define shade and tint at the same time");this._colors.push(this._current),this._current=null},s.prototype.handleKeyword=function(l,u){switch(this._current==null&&this._startNewColor(),l){case"red":return this._current.r=this._validateColorValueRange(l,u),!0;case"green":return this._current.g=this._validateColorValueRange(l,u),!0;case"blue":return this._current.b=this._validateColorValueRange(l,u),!0;case"ctint":return this._current.tint=this._validateColorValueRange(l,u),!0;case"cshade":return this._current.shade=this._validateColorValueRange(l,u),!0;default:if(l[0]==="c")return this._current.theme=n.Helper._mapColorTheme(l.slice(1)),!0;break}return n.Helper.log("[colortbl] handleKeyword(): unhandled keyword: "+l),!1},s.prototype.apply=function(){if(n.Helper.log("[colortbl] apply()"),this._autoIndex==null&&(this._autoIndex=0),this._autoIndex>=this._colors.length)throw new n.RTFJSError("colortbl doesn't define auto color");for(var l in this._colors)n.Helper.log("[colortbl] ["+l+"] = "+this._colors[l].r+","+this._colors[l].g+","+this._colors[l].b+" theme: "+this._colors[l].theme);this.inst._colors=this._colors,this.inst._autoColor=this._autoIndex,delete this._colors},s.prototype._startNewColor=function(){return this._current={r:0,g:0,b:0,tint:255,shade:255,theme:null},this._current},s.prototype._validateColorValueRange=function(l,u){if(u==null)throw new n.RTFJSError(l+" has no param");if(u<0||u>255)throw new n.RTFJSError(l+" has invalid param value");return u},s})(e.DestinationBase)}),"./src/rtfjs/parser/destinations/DestinationBase.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{DestinationBase:()=>c,DestinationFactory:()=>t,DestinationFormattedTextBase:()=>l,DestinationTextBase:()=>s,GenericPropertyDestinationFactory:()=>u,GenericSubTextPropertyDestinationFactory:()=>o,RequiredDestinationFactory:()=>i,findParentDestination:()=>p});var n=r("./src/rtfjs/Helper.ts"),e=(function(){var a=function(b,v){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,T){_.__proto__=T}||function(_,T){for(var k in T)Object.prototype.hasOwnProperty.call(T,k)&&(_[k]=T[k])},a(b,v)};return function(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");a(b,v);function _(){this.constructor=b}b.prototype=v===null?Object.create(v):(_.prototype=v.prototype,new _)}})(),t=(function(){function a(){}return a.prototype.newDestination=function(b,v,_,T){return new this.class(b,v,_,T)},a})(),p=function(a,b){for(var v=a.state;v!=null&&v.destination!=null;){if(v.destination._name===b)return v.destination;v=v.parent}n.Helper.log("findParentDestination() did not find destination "+b)},c=(function(){function a(b){this._name=b}return a})(),s=(function(){function a(b){this._name=b,this.text=""}return a.prototype.appendText=function(b){this.text+=b},a})(),l=(function(){function a(b,v){this.parser=b,this._name=v,this._records=[]}return a.prototype.appendText=function(b){this._records.push(function(v){v.appendText(b)})},a.prototype.handleKeyword=function(b,v){this._records.push(function(_){return _.handleKeyword(b,v)})},a.prototype.apply=function(){var b=p(this.parser,"rtf");if(b==null)throw new n.RTFJSError("IDestination "+this._name+" is not child of rtf destination");var v=this._records.length,_=!0;if(this.renderBegin!=null&&(_=this.renderBegin(b,v)),_){for(var T=0;T<v;T++)this._records[T](b);this.renderEnd!=null&&this.renderEnd(b,v)}delete this._records},a})(),u=(function(a){e(b,a);function b(v,_){var T=a.call(this)||this;return T.class=(function(k){e(M,k);function M(R,O,P){var N=k.call(this,P)||this;return N.parser=R,N}return M.prototype.apply=function(){var R=p(this.parser,v);if(R==null)throw new n.RTFJSError("IDestination "+this._name+" must be within "+v+" destination");if(R.setMetadata==null)throw new n.RTFJSError("IDestination "+v+" does not accept meta data");R.setMetadata(_,this.text)},M})(s),T}return b})(t),o=(function(a){e(b,a);function b(v,_,T){var k=a.call(this)||this;return k.class=(function(M){e(R,M);function R(O){var P=M.call(this,v)||this;return P.parser=O,P}return R.prototype.apply=function(){var O=p(this.parser,_);if(O==null)throw new n.RTFJSError(this._name+" destination must be child of "+_+" destination");if(O[T]==null)throw new n.RTFJSError(this._name+" destination cannot find member + "+T+" in "+_+" destination");O[T]instanceof Function?O[T](this.text):O[T]=this.text},R})(s),k}return b})(t),i=(function(a){e(b,a);function b(v){var _=a.call(this)||this;return _.class=(function(T){e(k,T);function k(){return T.call(this,v)||this}return k})(c),_}return b})(t)}),"./src/rtfjs/parser/destinations/Destinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{Destinations:()=>o});var n=r("./src/rtfjs/parser/destinations/ColortblDestinations.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=r("./src/rtfjs/parser/destinations/FieldDestinations.ts"),p=r("./src/rtfjs/parser/destinations/FonttblDestinations.ts"),c=r("./src/rtfjs/parser/destinations/MetaDestinations.ts"),s=r("./src/rtfjs/parser/destinations/PictDestinations.ts"),l=r("./src/rtfjs/parser/destinations/RtfDestination.ts"),u=r("./src/rtfjs/parser/destinations/StylesheetDestination.ts"),o={rtf:l.RtfDestination,info:c.InfoDestination,title:new c.MetaPropertyDestinationFactory("title"),subject:new c.MetaPropertyDestinationFactory("subject"),author:new c.MetaPropertyDestinationFactory("author"),manager:new c.MetaPropertyDestinationFactory("manager"),company:new c.MetaPropertyDestinationFactory("company"),operator:new c.MetaPropertyDestinationFactory("operator"),category:new c.MetaPropertyDestinationFactory("category"),keywords:new c.MetaPropertyDestinationFactory("keywords"),doccomm:new c.MetaPropertyDestinationFactory("doccomm"),hlinkbase:new c.MetaPropertyDestinationFactory("hlinkbase"),generator:new e.GenericPropertyDestinationFactory("rtf","generator"),creatim:new c.MetaPropertyTimeDestinationFactory("creatim"),revtim:new c.MetaPropertyTimeDestinationFactory("revtim"),printim:new c.MetaPropertyTimeDestinationFactory("printim"),buptim:new c.MetaPropertyTimeDestinationFactory("buptim"),fonttbl:p.FonttblDestination,falt:new e.GenericSubTextPropertyDestinationFactory("falt","fonttbl:sub","setAltFontName"),colortbl:n.ColortblDestination,stylesheet:u.StylesheetDestination,footer:new e.RequiredDestinationFactory("footer"),footerf:new e.RequiredDestinationFactory("footerf"),footerl:new e.RequiredDestinationFactory("footerl"),footerr:new e.RequiredDestinationFactory("footerr"),footnote:new e.RequiredDestinationFactory("footnote"),ftncn:new e.RequiredDestinationFactory("ftncn"),ftnsep:new e.RequiredDestinationFactory("ftnsep"),ftnsepc:new e.RequiredDestinationFactory("ftnsepc"),header:new e.RequiredDestinationFactory("header"),headerf:new e.RequiredDestinationFactory("headerf"),headerl:new e.RequiredDestinationFactory("headerl"),headerr:new e.RequiredDestinationFactory("headerr"),pict:s.PictDestination,shppict:new s.PictGroupDestinationFactory(!1),nonshppict:new s.PictGroupDestinationFactory(!0),private1:new e.RequiredDestinationFactory("private1"),rxe:new e.RequiredDestinationFactory("rxe"),tc:new e.RequiredDestinationFactory("tc"),txe:new e.RequiredDestinationFactory("txe"),xe:new e.RequiredDestinationFactory("xe"),field:t.FieldDestination,fldinst:t.FldinstDestination,fldrslt:t.FldrsltDestination}}),"./src/rtfjs/parser/destinations/FieldDestinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{FieldDestination:()=>c,FldinstDestination:()=>l,FldrsltDestination:()=>u});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=r("./src/rtfjs/parser/destinations/PictDestinations.ts"),p=(function(){var o=function(i,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,v){b.__proto__=v}||function(b,v){for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(b[_]=v[_])},o(i,a)};return function(i,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(i,a);function b(){this.constructor=i}i.prototype=a===null?Object.create(a):(b.prototype=a.prototype,new b)}})(),c=(function(o){p(i,o);function i(){var a=o.call(this,"field")||this;return a._haveInst=!1,a._parsedInst=null,a._result=null,a}return i.prototype.apply=function(){if(!this._haveInst)throw new n.RTFJSError("IField has no fldinst destination")},i.prototype.setInst=function(a){var b=this;if(this._haveInst=!0,this._parsedInst!=null)throw new n.RTFJSError("IField cannot have multiple fldinst destinations");a instanceof Promise?a.then(function(v){b._parsedInst=v}).catch(function(v){throw b._parsedInst=null,new n.RTFJSError(v.message)}):this._parsedInst=a},i.prototype.getInst=function(){return this._parsedInst},i.prototype.setResult=function(a){if(this._result!=null)throw new n.RTFJSError("IField cannot have multiple fldrslt destinations");this._result=a},i})(e.DestinationBase),s=(function(o){p(i,o);function i(a,b){var v=o.call(this,a)||this;return v._url=b,v}return i.prototype.url=function(){return this._url},i.prototype.renderFieldBegin=function(a,b,v){var _=this;return v>0?(b.addIns(function(T){var k=T._doc,M=function(){return T.buildHyperlinkElement(_._url)},R;if(k._settings.onHyperlink!=null)R=k._settings.onHyperlink(M,{url:function(){return _.url()}});else{var O=M();R={element:O,content:O}}T.pushContainer(R)}),!0):!1},i})((function(){function o(i){this._fldinst=i}return o.prototype.renderFieldEnd=function(i,a,b){b>0&&a.addIns(function(v){v.popContainer()})},o})()),l=(function(o){p(i,o);function i(a,b){var v=o.call(this,"fldinst")||this;return v.parser=a,v.inst=b,v}return i.prototype.apply=function(){var a=(0,e.findParentDestination)(this.parser,"field");if(a==null)throw new n.RTFJSError("fldinst destination must be child of field destination");a.setInst(this.parseType())},i.prototype.parseType=function(){var a=this;this.text=this.text.trim();var b=this.text.indexOf(" ");if(b>0){var v=this.text.substr(b+1);if(v.length>=2&&v[0]==='"'){var _=v.indexOf('"',1);_>=1&&(v=v.substring(1,_))}var T=this.text.substr(0,b).toUpperCase();switch(T){case"HYPERLINK":return new s(this,v);case"IMPORT":if(typeof this.inst._settings.onImport=="function"){var k;this.inst.addIns(function(R){var O=R._doc,P=O._settings.onPicture;O._settings.onPicture=null;var N=k.apply(!0),it=N.isLegacy,J=N.element;O._settings.onPicture=P,typeof P=="function"&&(J=P(it,function(){return J})),J!=null&&R.appendElement(J)});var M=new Promise(function(R,O){try{var P=function(N){var it=N.error,J=N.keyword,ot=N.blob,tt=N.width,ht=N.height;if(!it&&typeof J=="string"&&J&&ot){var W={w:n.Helper._pxToTwips(tt||window.document.body.clientWidth||window.innerWidth),h:n.Helper._pxToTwips(ht||300)};k=new t.PictDestination(a.parser,a.inst),k.handleBlob(ot),k.handleKeyword(J,8),k._displaysize.width=W.w,k._displaysize.height=W.h,k._size.width=W.w,k._size.height=W.h,R({renderFieldBegin:function(){return!0},renderFieldEnd:function(){return null}})}else n.Helper.log("[fldinst]: failed to IMPORT image file: "+v),it?(it=it instanceof Error?it:new Error(it),O(it)):R(null)};a.inst._settings.onImport(v,P)}catch(N){O(N)}});return this.parser._asyncTasks.push(M),M}break;default:n.Helper.log("[fldinst]: unknown field type: "+T);break}}},i})(e.DestinationTextBase),u=(function(o){p(i,o);function i(a,b){return o.call(this,a,"fldrslt")||this}return i.prototype.apply=function(){var a=(0,e.findParentDestination)(this.parser,"field");a?.setResult(this),o.prototype.apply.call(this)},i.prototype.renderBegin=function(a,b){var v=(0,e.findParentDestination)(this.parser,"field");if(v!=null){var _=v.getInst();if(_!=null)return _.renderFieldBegin(v,a,b)}return!1},i.prototype.renderEnd=function(a,b){var v=(0,e.findParentDestination)(this.parser,"field");if(v!=null){var _=v.getInst();_?.renderFieldEnd(v,a,b)}},i})(e.DestinationFormattedTextBase)}),"./src/rtfjs/parser/destinations/FonttblDestinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{FonttblDestination:()=>c,FonttblDestinationSub:()=>p});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=(function(){var s=function(l,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a])},s(l,u)};return function(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");s(l,u);function o(){this.constructor=l}l.prototype=u===null?Object.create(u):(o.prototype=u.prototype,new o)}})(),p=(function(s){t(l,s);function l(u){var o=s.call(this,"fonttbl:sub")||this;return o._fonttbl=u,o.index=null,o.fontname=null,o.altfontname=null,o.family=null,o.pitch=n.Helper.FONTPITCH.DEFAULT,o.bias=0,o.charset=null,o}return l.prototype.handleKeyword=function(u,o){switch(u){case"f":return this.index=o,!0;case"fnil":return!0;case"froman":case"fswiss":case"fmodern":case"fscript":case"fdecor":case"ftech":case"fbidi":case"flomajor":case"fhimajor":case"fdbmajor":case"fbimajor":case"flominor":case"fhiminor":case"fdbminor":case"fbiminor":return this.family=u.slice(1),!0;case"fprq":switch(o){case 0:this.pitch=n.Helper.FONTPITCH.DEFAULT;break;case 1:this.pitch=n.Helper.FONTPITCH.FIXED;break;case 2:this.pitch=n.Helper.FONTPITCH.VARIABLE;break}return!0;case"fbias":return o!=null&&(this.bias=o),!0;case"fcharset":return o!=null&&(this.charset=n.Helper._mapCharset(o),this.charset==null&&n.Helper.log("Unknown font charset: "+o)),!0;case"cpg":return o!=null&&(this.charset=o),!0}return!1},l.prototype.appendText=function(u){this.fontname==null?this.fontname=u:this.fontname+=u},l.prototype.apply=function(){if(this.index==null)throw new n.RTFJSError("No font index provided");if(this.fontname==null)throw new n.RTFJSError("No font name provided");this._fonttbl.addSub(this),delete this._fonttbl},l.prototype.setAltFontName=function(u){this.altfontname=u},l})(e.DestinationBase),c=(function(s){t(l,s);function l(u,o){var i=s.call(this,"fonttbl")||this;return i._fonts=[],i._sub=null,i.inst=o,i}return l.prototype.sub=function(){return new p(this)},l.prototype.apply=function(){n.Helper.log("[fonttbl] apply()");for(var u in this._fonts)n.Helper.log("[fonttbl]["+u+"] index = "+this._fonts[u].fontname+" alternative: "+this._fonts[u].altfontname);this.inst._fonts=this._fonts,delete this._fonts},l.prototype.appendText=function(u){this._sub.appendText(u),this._sub.apply()},l.prototype.handleKeyword=function(u,o){u==="f"&&(this._sub=this.sub()),this._sub.handleKeyword(u,o)},l.prototype.addSub=function(u){this._fonts[u.index]=u},l})(e.DestinationBase)}),"./src/rtfjs/parser/destinations/MetaDestinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{InfoDestination:()=>p,MetaPropertyDestinationFactory:()=>c,MetaPropertyTimeDestinationFactory:()=>s});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=(function(){var l=function(u,o){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&(i[b]=a[b])},l(u,o)};return function(u,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");l(u,o);function i(){this.constructor=u}u.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)}})(),p=(function(l){t(u,l);function u(o,i,a){var b=l.call(this,a)||this;return b._metadata={},b.inst=i,b}return u.prototype.apply=function(){for(var o in this._metadata)this.inst._meta[o]=this._metadata[o];delete this._metadata},u.prototype.setMetadata=function(o,i){this._metadata[o]=i},u})(e.DestinationBase),c=(function(l){t(u,l);function u(o){var i=l.call(this)||this;return i.class=(function(a){t(b,a);function b(v,_,T){var k=a.call(this,T)||this;return k.parser=v,k}return b.prototype.apply=function(){var v=(0,e.findParentDestination)(this.parser,"info");if(v==null)throw new n.RTFJSError("IDestination "+this._name+" must be within info destination");v.setMetadata(o,this.text)},b})(e.DestinationTextBase),i}return u})(e.DestinationFactory),s=(function(l){t(u,l);function u(o){var i=l.call(this)||this;return i.class=(function(a){t(b,a);function b(v,_,T){var k=a.call(this,T)||this;return k._yr=null,k._mo=null,k._dy=null,k._hr=null,k._min=null,k._sec=null,k.parser=v,k}return b.prototype.handleKeyword=function(v,_){switch(v){case"yr":this._yr=_;break;case"mo":this._mo=_;break;case"dy":this._dy=_;break;case"hr":this._hr=_;break;case"min":this._min=_;break;case"sec":this._sec=_;break;default:return!1}if(_==null)throw new n.RTFJSError("No param found for keyword "+v);return!0},b.prototype.apply=function(){var v=(0,e.findParentDestination)(this.parser,"info");if(v==null)throw new n.RTFJSError("IDestination "+this._name+" must be within info destination");var _=new Date(Date.UTC(this._yr!=null?this._yr:1970,this._mo!=null?this._mo:1,this._dy!=null?this._dy:1,this._hr!=null?this._hr:0,this._min!=null?this._min:0,this._sec!=null?this._sec:0,0));v.setMetadata(o,_)},b})(e.DestinationBase),i}return u})(e.DestinationFactory)}),"./src/rtfjs/parser/destinations/PictDestinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{PictDestination:()=>l,PictGroupDestinationFactory:()=>s});var n=r("EMFJS"),e=r("WMFJS"),t=r("./src/rtfjs/Helper.ts"),p=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),c=(function(){var u=function(o,i){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var v in b)Object.prototype.hasOwnProperty.call(b,v)&&(a[v]=b[v])},u(o,i)};return function(o,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");u(o,i);function a(){this.constructor=o}o.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}})(),s=(function(u){c(o,u);function o(i){var a=u.call(this)||this;return a.class=(function(b){c(v,b);function v(){var _=b.call(this,"pict-group")||this;return _._legacy=i,_}return v.prototype.isLegacy=function(){return this._legacy},v})(p.DestinationTextBase),a}return o})(p.DestinationFactory),l=(function(u){c(o,u);function o(i,a){var b=u.call(this,"pict")||this;return b._pictHandlers={picw:b._setPropValueRequired("_size","width"),pich:b._setPropValueRequired("_size","height"),picwgoal:b._setPropValueRequired("_displaysize","width"),pichgoal:b._setPropValueRequired("_displaysize","height")},b._pictTypeHandler={emfblip:(function(){return typeof n<"u"?function(){return{load:function(){try{return new n.Renderer(b._blob)}catch(v){if(v instanceof n.Error)return v.message;throw v}},render:function(v){return v.render({width:t.Helper._twipsToPt(b._displaysize.width)+"pt",height:t.Helper._twipsToPt(b._displaysize.height)+"pt",wExt:b._size.width,hExt:b._size.height,xExt:b._size.width,yExt:b._size.height,mapMode:8})}}}:""})(),pngblip:"image/png",jpegblip:"image/jpeg",macpict:"",pmmetafile:"",wmetafile:(function(){return typeof e<"u"?function(v){if(v==null||v<0||v>8)throw new t.RTFJSError("Insufficient metafile information");return{load:function(){try{return new e.Renderer(b._blob)}catch(_){if(_ instanceof e.Error)return _.message;throw _}},render:function(_){return _.render({width:t.Helper._twipsToPt(b._displaysize.width)+"pt",height:t.Helper._twipsToPt(b._displaysize.height)+"pt",xExt:b._size.width,yExt:b._size.height,mapMode:v})}}}:""})(),dibitmap:"",wbitmap:""},b._type=null,b._blob=null,b._displaysize={width:null,height:null},b._size={width:null,height:null},b.parser=i,b.inst=a,b}return o.prototype.handleKeyword=function(i,a){var b=this._pictHandlers[i];if(b!=null)return b(a),!0;var v=this._pictTypeHandler[i];if(v!=null){if(this._type==null)if(typeof v=="function"){var _=v(a);_!=null&&(this._type=function(){var T=_.load();if(T!=null)return typeof T=="string"?T:function(){return _.render(T)}})}else this._type=v;return!0}return!1},o.prototype.handleBlob=function(i){this._blob=i},o.prototype.apply=function(i){var a=this;if(i===void 0&&(i=!1),this._type==null)throw new t.RTFJSError("Picture type unknown or not specified");var b=(0,p.findParentDestination)(this.parser,"pict-group"),v=b!=null?b.isLegacy():null,_=this._type;if(typeof _=="function"){if(this._blob==null){if(this._blob=t.Helper._hexToBlob(this.text),this._blob==null)throw new t.RTFJSError("Could not parse picture data");delete this.text}var T=function(O,P){var N=O._doc,it=_();if(it!=null)if(typeof it=="string"){if(t.Helper.log("[pict] Could not load image: "+it),P)return O.buildPicture(it,null);N.addIns(function(J){J.picture(it,null)})}else{if(typeof it!="function")throw new t.RTFJSError("Expected a picture render function");if(P)return O.buildRenderedPicture(it());N.addIns(function(J){J.renderedPicture(it())})}};if(this.inst._settings.onPicture!=null)this.inst.addIns(function(O){var P=a.inst._settings.onPicture(v,function(){return T(O,!0)});P!=null&&O.appendElement(P)});else return{isLegacy:v,element:T(this.parser.renderer,i)}}else if(typeof _=="string"){var k=this.text,M=this._blob,R=function(O,P){var N=M!=null?t.Helper._blobToBinary(M):t.Helper._hexToBinary(k);if(_!==""){if(P)return O.buildPicture(_,N);O._doc.addIns(function(it){it.picture(_,N)})}else{if(P)return O.buildPicture("Unsupported image format",null);O._doc.addIns(function(it){it.picture("Unsupported image format",null)})}};if(this.inst._settings.onPicture!=null)this.inst.addIns(function(O){var P=a.inst._settings.onPicture(v,function(){return R(O,!0)});P!=null&&O.appendElement(P)});else return{isLegacy:v,element:R(this.parser.renderer,i)}}delete this.text},o.prototype._setPropValueRequired=function(i,a){var b=this;return function(v){if(v==null)throw new t.RTFJSError("Picture property has no value");t.Helper.log("[pict] set "+i+"."+a+" = "+v);var _=i!=null?b[i]:b;_[a]=v}},o})(p.DestinationTextBase)}),"./src/rtfjs/parser/destinations/RtfDestination.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{RtfDestination:()=>l});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/renderer/RenderChp.ts"),t=r("./src/rtfjs/renderer/RenderPap.ts"),p=r("./src/rtfjs/parser/Containers.ts"),c=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),s=(function(){var u=function(o,i){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var v in b)Object.prototype.hasOwnProperty.call(b,v)&&(a[v]=b[v])},u(o,i)};return function(o,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");u(o,i);function a(){this.constructor=o}o.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}})(),l=(function(u){s(o,u);function o(i,a,b,v){var _=u.call(this,b)||this;if(_._charFormatHandlers={ansicpg:function(T){T>0&&(n.Helper.log("[rtf] using charset: "+T),_.parser.codepage=T)},sectd:function(){n.Helper.log("[rtf] reset to section defaults"),_.parser.state.sep=new p.Sep(null)},plain:function(){n.Helper.log("[rtf] reset to character defaults"),_.parser.state.chp=new p.Chp(null)},pard:function(){n.Helper.log("[rtf] reset to paragraph defaults"),_.parser.state.pap=new p.Pap(null)},b:_._genericFormatOnOff("chp","bold"),i:_._genericFormatOnOff("chp","italic"),sub:_._genericFormatSetVal("chp","supersubscript",n.Helper.SUPERSUBSCRIPT.SUBSCRIPT),super:_._genericFormatSetVal("chp","supersubscript",n.Helper.SUPERSUBSCRIPT.SUPERSCRIPT),nosupersub:_._genericFormatSetVal("chp","supersubscript",n.Helper.SUPERSUBSCRIPT.NONE),cf:_._genericFormatSetValRequired("chp","colorindex"),highlight:_._genericFormatSetValRequired("chp","highlightindex"),fs:_._genericFormatSetValRequired("chp","fontsize"),f:_._genericFormatSetValRequired("chp","fontfamily"),loch:_._genericFormatSetNoParam("pap","charactertype",n.Helper.CHARACTER_TYPE.LOWANSI),hich:_._genericFormatSetNoParam("pap","charactertype",n.Helper.CHARACTER_TYPE.HIGHANSI),dbch:_._genericFormatSetNoParam("pap","charactertype",n.Helper.CHARACTER_TYPE.DOUBLE),strike:_._genericFormatOnOff("chp","strikethrough"),striked:_._genericFormatOnOff("chp","dblstrikethrough"),ul:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.CONTINUOUS,n.Helper.UNDERLINE.NONE),uld:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DOTTED,n.Helper.UNDERLINE.NONE),uldash:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DASHED,n.Helper.UNDERLINE.NONE),uldashd:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DASHDOTTED,n.Helper.UNDERLINE.NONE),uldashdd:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DASHDOTDOTTED,n.Helper.UNDERLINE.NONE),uldb:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DOUBLE,n.Helper.UNDERLINE.NONE),ulhwave:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.HEAVYWAVE,n.Helper.UNDERLINE.NONE),ulldash:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.LONGDASHED,n.Helper.UNDERLINE.NONE),ulnone:_._genericFormatSetNoParam("chp","underline",n.Helper.UNDERLINE.NONE),ulth:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.THICK,n.Helper.UNDERLINE.NONE),ulthd:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.THICKDOTTED,n.Helper.UNDERLINE.NONE),ulthdash:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.THICKDASHED,n.Helper.UNDERLINE.NONE),ulthdashd:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.THICKDASHDOTTED,n.Helper.UNDERLINE.NONE),ulthdashdd:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.THICKDASHDOTDOTTED,n.Helper.UNDERLINE.NONE),ululdbwave:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DOUBLEWAVE,n.Helper.UNDERLINE.NONE),ulw:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.WORD,n.Helper.UNDERLINE.NONE),ulwave:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.WAVE,n.Helper.UNDERLINE.NONE),li:_._genericFormatSetMemberVal("pap","indent","left",0),ri:_._genericFormatSetMemberVal("pap","indent","right",0),fi:_._genericFormatSetMemberVal("pap","indent","firstline",0),sa:_._genericFormatSetValRequired("pap","spaceafter"),sb:_._genericFormatSetValRequired("pap","spacebefore"),cols:_._genericFormatSetVal("sep","columns",0),sbknone:_._genericFormatSetNoParam("sep","breaktype",n.Helper.BREAKTYPE.NONE),sbkcol:_._genericFormatSetNoParam("sep","breaktype",n.Helper.BREAKTYPE.COL),sbkeven:_._genericFormatSetNoParam("sep","breaktype",n.Helper.BREAKTYPE.EVEN),sbkodd:_._genericFormatSetNoParam("sep","breaktype",n.Helper.BREAKTYPE.ODD),sbkpage:_._genericFormatSetNoParam("sep","breaktype",n.Helper.BREAKTYPE.PAGE),pgnx:_._genericFormatSetMemberVal("sep","pagenumber","x",0),pgny:_._genericFormatSetMemberVal("sep","pagenumber","y",0),pgndec:_._genericFormatSetNoParam("sep","pagenumberformat",n.Helper.PAGENUMBER.DECIMAL),pgnucrm:_._genericFormatSetNoParam("sep","pagenumberformat",n.Helper.PAGENUMBER.UROM),pgnlcrm:_._genericFormatSetNoParam("sep","pagenumberformat",n.Helper.PAGENUMBER.LROM),pgnucltr:_._genericFormatSetNoParam("sep","pagenumberformat",n.Helper.PAGENUMBER.ULTR),pgnlcltr:_._genericFormatSetNoParam("sep","pagenumberformat",n.Helper.PAGENUMBER.LLTR),qc:_._genericFormatSetNoParam("pap","justification",n.Helper.JUSTIFICATION.CENTER),ql:_._genericFormatSetNoParam("pap","justification",n.Helper.JUSTIFICATION.LEFT),qr:_._genericFormatSetNoParam("pap","justification",n.Helper.JUSTIFICATION.RIGHT),qj:_._genericFormatSetNoParam("pap","justification",n.Helper.JUSTIFICATION.JUSTIFY),paperw:_._genericFormatSetVal("dop","width",12240),paperh:_._genericFormatSetVal("dop","height",15480),margl:_._genericFormatSetMemberVal("dop","margin","left",1800),margr:_._genericFormatSetMemberVal("dop","margin","right",1800),margt:_._genericFormatSetMemberVal("dop","margin","top",1440),margb:_._genericFormatSetMemberVal("dop","margin","bottom",1440),pgnstart:_._genericFormatSetVal("dop","pagenumberstart",1),facingp:_._genericFormatSetNoParam("dop","facingpages",!0),landscape:_._genericFormatSetNoParam("dop","landscape",!0),par:_._addInsHandler(function(T){T.startPar()}),line:_._addInsHandler(function(T){T.lineBreak()})},i.version!=null)throw new n.RTFJSError("Unexpected rtf destination");if(v&&v!==1)throw new n.RTFJSError("Unsupported rtf version");return i.version=1,_._metadata={},_.parser=i,_.inst=a,_}return o.prototype.addIns=function(i){this.inst.addIns(i)},o.prototype.appendText=function(i){n.Helper.log("[rtf] output: "+i),this.inst.addIns(i)},o.prototype.sub=function(){n.Helper.log("[rtf].sub()")},o.prototype.handleKeyword=function(i,a){var b=this._charFormatHandlers[i];return b!=null?(b(a),!0):!1},o.prototype.apply=function(){n.Helper.log("[rtf] apply()");for(var i in this._metadata)this.inst._meta[i]=this._metadata[i];delete this._metadata},o.prototype.setMetadata=function(i,a){this._metadata[i]=a},o.prototype._addInsHandler=function(i){var a=this;return function(b){a.inst.addIns(i)}},o.prototype._addFormatIns=function(i,a){switch(n.Helper.log("[rtf] update "+i),i){case"chp":var b=new e.RenderChp(new p.Chp(a));this.inst.addIns(function(_){_.setChp(b)});break;case"pap":var v=new t.RenderPap(new p.Pap(a));this.inst.addIns(function(_){_.setPap(v)});break}},o.prototype._genericFormatSetNoParam=function(i,a,b){var v=this;return function(_){var T=v.parser.state[i];T[a]=b,n.Helper.log("[rtf] state."+i+"."+a+" = "+T[a].toString()),v._addFormatIns(i,T)}},o.prototype._genericFormatOnOff=function(i,a,b,v){var _=this;return function(T){var k=_.parser.state[i];k[a]=T==null||T!==0?b??!0:v??!1,n.Helper.log("[rtf] state."+i+"."+a+" = "+k[a].toString()),_._addFormatIns(i,k)}},o.prototype._genericFormatSetVal=function(i,a,b){var v=this;return function(_){var T=v.parser.state[i];T[a]=_??b,n.Helper.log("[rtf] state."+i+"."+a+" = "+T[a].toString()),v._addFormatIns(i,T)}},o.prototype._genericFormatSetValRequired=function(i,a){var b=this;return function(v){if(v==null)throw new n.RTFJSError("Keyword without required param");var _=b.parser.state[i];_[a]=v,n.Helper.log("[rtf] state."+i+"."+a+" = "+_[a].toString()),b._addFormatIns(i,_)}},o.prototype._genericFormatSetMemberVal=function(i,a,b,v){var _=this;return function(T){var k=_.parser.state[i],M=k[a];M[b]=T??v,n.Helper.log("[rtf] state."+i+"."+a+"."+b+" = "+M[b].toString()),_._addFormatIns(i,k)}},o})(c.DestinationBase)}),"./src/rtfjs/parser/destinations/StylesheetDestination.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{StylesheetDestination:()=>c,StylesheetDestinationSub:()=>p});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=(function(){var s=function(l,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a])},s(l,u)};return function(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");s(l,u);function o(){this.constructor=l}l.prototype=u===null?Object.create(u):(o.prototype=u.prototype,new o)}})(),p=(function(s){t(l,s);function l(u){var o=s.call(this,"stylesheet:sub")||this;return o._stylesheet=u,o.index=0,o.name=null,o.handler=o._handleKeywordCommon("paragraph"),o}return l.prototype.handleKeyword=function(u,o){switch(u){case"s":return this.index=o,!0;case"cs":return delete this.paragraph,this.handler=this._handleKeywordCommon("character"),this.index=o,!0;case"ds":return delete this.paragraph,this.handler=this._handleKeywordCommon("section"),this.index=o,!0;case"ts":return delete this.paragraph,this.handler=this._handleKeywordCommon("table"),this.index=o,!0}return this.handler(u,o)},l.prototype.appendText=function(u){this.name==null?this.name=u:this.name+=u},l.prototype.apply=function(){this._stylesheet.addSub({index:this.index,name:this.name}),delete this._stylesheet},l.prototype._handleKeywordCommon=function(u){return function(o,i){return n.Helper.log("[stylesheet:sub]."+u+": unhandled keyword: "+o+" param: "+i),!1}},l})(e.DestinationBase),c=(function(s){t(l,s);function l(u,o){var i=s.call(this,"stylesheet")||this;return i._stylesheets=[],i.inst=o,i}return l.prototype.sub=function(){return new p(this)},l.prototype.apply=function(){n.Helper.log("[stylesheet] apply()");for(var u in this._stylesheets)n.Helper.log("[stylesheet] ["+u+"] name: "+this._stylesheets[u].name);this.inst._stylesheets=this._stylesheets,delete this._stylesheets},l.prototype.addSub=function(u){this._stylesheets[u.index]=u},l})(e.DestinationBase)}),"./src/rtfjs/renderer/RenderChp.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{RenderChp:()=>e});var n=r("./src/rtfjs/Helper.ts"),e=(function(){function t(p){this._chp=p}return t.prototype.apply=function(p,c){if(n.Helper.log("[rtf] RenderChp: "+c.textContent),n.Helper.log("[rtf] RenderChp apply: "+JSON.stringify(this._chp)),this._chp.bold&&(c.style.fontWeight="bold"),this._chp.italic&&(c.style.fontStyle="italic"),Object.prototype.hasOwnProperty.call(this._chp,"fontfamily")&&p._fonts[this._chp.fontfamily]){var s=p._fonts[this._chp.fontfamily].fontname.replace(";","");s!=="Symbol"&&(c.style.fontFamily=s)}var l=[];if(this._chp.underline!==n.Helper.UNDERLINE.NONE&&l.push("underline"),(this._chp.strikethrough||this._chp.dblstrikethrough)&&l.push("line-through"),l.length>0&&(c.style.textDecoration=l.join(" ")),this._chp.colorindex!==0){var u=p._lookupColor(this._chp.colorindex);u!=null&&(c.style.color=n.Helper._colorToStr(u))}if(this._chp.highlightindex!==0){var u=p._lookupColor(this._chp.highlightindex);u!=null&&(c.style.backgroundColor=n.Helper._colorToStr(u))}c.style.fontSize=Math.floor(this._chp.fontsize/2)+"pt",this._chp.supersubscript===n.Helper.SUPERSUBSCRIPT.SUPERSCRIPT?c.style.verticalAlign="super":this._chp.supersubscript===n.Helper.SUPERSUBSCRIPT.SUBSCRIPT&&(c.style.verticalAlign="sub"),(this._chp.supersubscript===n.Helper.SUPERSUBSCRIPT.SUPERSCRIPT||this._chp.supersubscript===n.Helper.SUPERSUBSCRIPT.SUBSCRIPT)&&(c.style.fontSize=Math.floor(this._chp.fontsize/2-2)+"pt")},t})()}),"./src/rtfjs/renderer/RenderPap.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{RenderPap:()=>e});var n=r("./src/rtfjs/Helper.ts"),e=(function(){function t(p){this._pap=p}return t.prototype.apply=function(p,c,s,l){if(n.Helper.log("[rtf] RenderPap apply:"+(s!=null?" chp="+JSON.stringify(s._chp):"")+" pap="+JSON.stringify(this._pap)+" ismaindiv="+l),l)this._pap.spacebefore!==0?c.style.marginTop=n.Helper._twipsToPt(this._pap.spacebefore)+"pt":c.style.marginTop="",this._pap.spaceafter!==0?c.style.marginBottom=n.Helper._twipsToPt(this._pap.spaceafter)+"pt":c.style.marginBottom="",s!=null&&(c.style.minHeight=Math.floor(s._chp.fontsize/2)+"pt");else switch(this._pap.justification){case n.Helper.JUSTIFICATION.LEFT:c.style.textAlign="left";break;case n.Helper.JUSTIFICATION.RIGHT:c.style.textAlign="right";break;case n.Helper.JUSTIFICATION.CENTER:c.style.textAlign="center";break;case n.Helper.JUSTIFICATION.JUSTIFY:c.style.textAlign="justify";break}},t})()}),"./src/rtfjs/renderer/Renderer.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{Renderer:()=>e});var n=r("./src/rtfjs/Helper.ts"),e=(function(){function t(p){this._doc=p,this._dom=null,this._curRChp=null,this._curRPap=null,this._curpar=null,this._cursubpar=null,this._curcont=[]}return t.prototype.pushContainer=function(p){this._curpar==null&&this.startPar();var c=this._curcont.push(p);c>1?this._curcont[c-1].content.append(p.element):this._cursubpar!=null?this._cursubpar.append(p.element):this._curpar.append(p.element)},t.prototype.popContainer=function(){if(this._curcont.pop()==null)throw new n.RTFJSError("No container on rendering stack")},t.prototype.buildHyperlinkElement=function(p){var c=document.createElement("a");return c.href=p,c},t.prototype._appendToPar=function(p,c){if(this._curpar==null&&this.startPar(),c===!0){var s=document.createElement("div");this._cursubpar==null&&(s.append.apply(s,Array.from(this._curpar.childNodes)),this._curpar.append(s),s=document.createElement("div")),p&&s.append(p),this._curRPap!=null&&this._curRPap.apply(this._doc,s,this._curRChp,!1),this._cursubpar=s,this._curpar.append(s)}else if(p){var l=this._curcont.length;l>0?this._curcont[l-1].content.append(p):this._cursubpar!=null?this._cursubpar.append(p):this._curpar.append(p)}},t.prototype.startPar=function(){this._curpar=document.createElement("div"),this._curRPap!=null&&(this._curRPap.apply(this._doc,this._curpar,this._curRChp,!0),this._curRPap.apply(this._doc,this._curpar,this._curRChp,!1)),this._cursubpar=null,this._curcont=[],this._dom.push(this._curpar)},t.prototype.lineBreak=function(){this._appendToPar(null,!0)},t.prototype.setChp=function(p){this._curRChp=p},t.prototype.setPap=function(p){this._curRPap=p,this._cursubpar!=null?this._curRPap.apply(this._doc,this._cursubpar,null,!1):this._curpar!=null&&(this._curRPap.apply(this._doc,this._curpar,null,!0),this._curRPap.apply(this._doc,this._curpar,null,!1))},t.prototype.appendElement=function(p){this._appendToPar(p)},t.prototype.buildRenderedPicture=function(p){return p==null&&(p=document.createElement("span"),p.textContent="[failed to render image]"),p},t.prototype.renderedPicture=function(p){this._appendToPar(this.buildRenderedPicture(p))},t.prototype.buildPicture=function(p,c){if(c!=null){var s=document.createElement("img");return s.src="data:"+p+";base64,"+btoa(c),s}else{var l="image type not supported";typeof p=="string"&&p!==""&&(l=p);var u=document.createElement("span");return u.textContent="["+l+"]",u}},t.prototype.picture=function(p,c){this._appendToPar(this.buildPicture(p,c))},t.prototype.buildDom=function(){if(this._dom!=null)return this._dom;this._dom=[],this._curRChp=null,this._curRPap=null,this._curpar=null;for(var p=this._doc._ins.length,c=0;c<p;c++){var s=this._doc._ins[c];if(typeof s=="string"){var l=document.createElement("span");l.textContent=s,this._curRChp!=null&&this._curRChp.apply(this._doc,l),this._appendToPar(l)}else s(this)}return this._dom},t})()}),EMFJS:(w=>{"use strict";w.exports=d}),WMFJS:(w=>{"use strict";w.exports=f})},y={};function E(w){var A=y[w];if(A!==void 0)return A.exports;var r=y[w]={exports:{}};return g[w].call(r.exports,r,r.exports,E),r.exports}E.n=w=>{var A=w&&w.__esModule?()=>w.default:()=>w;return E.d(A,{a:A}),A},E.d=(w,A)=>{for(var r in A)E.o(A,r)&&!E.o(w,r)&&Object.defineProperty(w,r,{enumerable:!0,get:A[r]})},E.o=(w,A)=>Object.prototype.hasOwnProperty.call(w,A),E.r=w=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})};var h={};return(()=>{"use strict";E.r(h),E.d(h,{Document:()=>w.DocumentFacade,Error:()=>A.RTFJSError,loggingEnabled:()=>A.loggingEnabled});var w=E("./src/rtfjs/DocumentFacade.ts"),A=E("./src/rtfjs/Helper.ts")})(),h})())})),Fl=we({default:()=>Ll});async function Ll(m,C,d){const f=(d||"odt").toLowerCase();if(f==="rtf")return Co(m,C);const g=await mo(m,f),y=f==="odp"?"OpenDocument 演示文稿预览":"OpenDocument 文档预览";return C.replaceChildren(cn(),Ao(f,y,g)),{$el:C,unmount(){C.replaceChildren()}}}var uo,go,cn,Ae,gr,mo,Ao,bo,Co,Hl=vt((()=>{uo=ze(Hr(),1),go=`
445
+ `:this.parser.line++,this.parser.column=0;continue;case"{":this.pushState(a);break;case"}":if(v===this.parser.state){this.unreadChar();break t}else if(this.popState()===v)break t;break;case"\\":this.parseKeyword(a?null:b);break;default:a||this.appendText(new s.PlainText(T));break}}}catch(k){throw k instanceof t.RTFJSError&&(k.message+=" (line: "+this.parser.line+"; column: "+this.parser.column+")"),k}},i})()}),"./src/rtfjs/parser/destinations/ColortblDestinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{ColortblDestination:()=>p});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=(function(){var c=function(s,l){return c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,o){u.__proto__=o}||function(u,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(u[i]=o[i])},c(s,l)};return function(s,l){if(typeof l!="function"&&l!==null)throw new TypeError("Class extends value "+String(l)+" is not a constructor or null");c(s,l);function u(){this.constructor=s}s.prototype=l===null?Object.create(l):(u.prototype=l.prototype,new u)}})(),p=(function(c){t(s,c);function s(l,u){var o=c.call(this,"colortbl")||this;return o._colors=[],o._current=null,o._autoIndex=null,o.inst=u,o}return s.prototype.appendText=function(l){if(l.trim()!==";")throw new n.RTFJSError("Error parsing colortbl destination");if(this._current==null){if(this._autoIndex!=null)throw new n.RTFJSError("colortbl cannot define more than one auto color");this._autoIndex=this._colors.length,this._startNewColor()}else if(this._current.tint<255&&this._current.shade<255)throw new n.RTFJSError("colortbl cannot define shade and tint at the same time");this._colors.push(this._current),this._current=null},s.prototype.handleKeyword=function(l,u){switch(this._current==null&&this._startNewColor(),l){case"red":return this._current.r=this._validateColorValueRange(l,u),!0;case"green":return this._current.g=this._validateColorValueRange(l,u),!0;case"blue":return this._current.b=this._validateColorValueRange(l,u),!0;case"ctint":return this._current.tint=this._validateColorValueRange(l,u),!0;case"cshade":return this._current.shade=this._validateColorValueRange(l,u),!0;default:if(l[0]==="c")return this._current.theme=n.Helper._mapColorTheme(l.slice(1)),!0;break}return n.Helper.log("[colortbl] handleKeyword(): unhandled keyword: "+l),!1},s.prototype.apply=function(){if(n.Helper.log("[colortbl] apply()"),this._autoIndex==null&&(this._autoIndex=0),this._autoIndex>=this._colors.length)throw new n.RTFJSError("colortbl doesn't define auto color");for(var l in this._colors)n.Helper.log("[colortbl] ["+l+"] = "+this._colors[l].r+","+this._colors[l].g+","+this._colors[l].b+" theme: "+this._colors[l].theme);this.inst._colors=this._colors,this.inst._autoColor=this._autoIndex,delete this._colors},s.prototype._startNewColor=function(){return this._current={r:0,g:0,b:0,tint:255,shade:255,theme:null},this._current},s.prototype._validateColorValueRange=function(l,u){if(u==null)throw new n.RTFJSError(l+" has no param");if(u<0||u>255)throw new n.RTFJSError(l+" has invalid param value");return u},s})(e.DestinationBase)}),"./src/rtfjs/parser/destinations/DestinationBase.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{DestinationBase:()=>c,DestinationFactory:()=>t,DestinationFormattedTextBase:()=>l,DestinationTextBase:()=>s,GenericPropertyDestinationFactory:()=>u,GenericSubTextPropertyDestinationFactory:()=>o,RequiredDestinationFactory:()=>i,findParentDestination:()=>p});var n=r("./src/rtfjs/Helper.ts"),e=(function(){var a=function(b,v){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_,T){_.__proto__=T}||function(_,T){for(var k in T)Object.prototype.hasOwnProperty.call(T,k)&&(_[k]=T[k])},a(b,v)};return function(b,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");a(b,v);function _(){this.constructor=b}b.prototype=v===null?Object.create(v):(_.prototype=v.prototype,new _)}})(),t=(function(){function a(){}return a.prototype.newDestination=function(b,v,_,T){return new this.class(b,v,_,T)},a})(),p=function(a,b){for(var v=a.state;v!=null&&v.destination!=null;){if(v.destination._name===b)return v.destination;v=v.parent}n.Helper.log("findParentDestination() did not find destination "+b)},c=(function(){function a(b){this._name=b}return a})(),s=(function(){function a(b){this._name=b,this.text=""}return a.prototype.appendText=function(b){this.text+=b},a})(),l=(function(){function a(b,v){this.parser=b,this._name=v,this._records=[]}return a.prototype.appendText=function(b){this._records.push(function(v){v.appendText(b)})},a.prototype.handleKeyword=function(b,v){this._records.push(function(_){return _.handleKeyword(b,v)})},a.prototype.apply=function(){var b=p(this.parser,"rtf");if(b==null)throw new n.RTFJSError("IDestination "+this._name+" is not child of rtf destination");var v=this._records.length,_=!0;if(this.renderBegin!=null&&(_=this.renderBegin(b,v)),_){for(var T=0;T<v;T++)this._records[T](b);this.renderEnd!=null&&this.renderEnd(b,v)}delete this._records},a})(),u=(function(a){e(b,a);function b(v,_){var T=a.call(this)||this;return T.class=(function(k){e(M,k);function M(R,O,P){var N=k.call(this,P)||this;return N.parser=R,N}return M.prototype.apply=function(){var R=p(this.parser,v);if(R==null)throw new n.RTFJSError("IDestination "+this._name+" must be within "+v+" destination");if(R.setMetadata==null)throw new n.RTFJSError("IDestination "+v+" does not accept meta data");R.setMetadata(_,this.text)},M})(s),T}return b})(t),o=(function(a){e(b,a);function b(v,_,T){var k=a.call(this)||this;return k.class=(function(M){e(R,M);function R(O){var P=M.call(this,v)||this;return P.parser=O,P}return R.prototype.apply=function(){var O=p(this.parser,_);if(O==null)throw new n.RTFJSError(this._name+" destination must be child of "+_+" destination");if(O[T]==null)throw new n.RTFJSError(this._name+" destination cannot find member + "+T+" in "+_+" destination");O[T]instanceof Function?O[T](this.text):O[T]=this.text},R})(s),k}return b})(t),i=(function(a){e(b,a);function b(v){var _=a.call(this)||this;return _.class=(function(T){e(k,T);function k(){return T.call(this,v)||this}return k})(c),_}return b})(t)}),"./src/rtfjs/parser/destinations/Destinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{Destinations:()=>o});var n=r("./src/rtfjs/parser/destinations/ColortblDestinations.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=r("./src/rtfjs/parser/destinations/FieldDestinations.ts"),p=r("./src/rtfjs/parser/destinations/FonttblDestinations.ts"),c=r("./src/rtfjs/parser/destinations/MetaDestinations.ts"),s=r("./src/rtfjs/parser/destinations/PictDestinations.ts"),l=r("./src/rtfjs/parser/destinations/RtfDestination.ts"),u=r("./src/rtfjs/parser/destinations/StylesheetDestination.ts"),o={rtf:l.RtfDestination,info:c.InfoDestination,title:new c.MetaPropertyDestinationFactory("title"),subject:new c.MetaPropertyDestinationFactory("subject"),author:new c.MetaPropertyDestinationFactory("author"),manager:new c.MetaPropertyDestinationFactory("manager"),company:new c.MetaPropertyDestinationFactory("company"),operator:new c.MetaPropertyDestinationFactory("operator"),category:new c.MetaPropertyDestinationFactory("category"),keywords:new c.MetaPropertyDestinationFactory("keywords"),doccomm:new c.MetaPropertyDestinationFactory("doccomm"),hlinkbase:new c.MetaPropertyDestinationFactory("hlinkbase"),generator:new e.GenericPropertyDestinationFactory("rtf","generator"),creatim:new c.MetaPropertyTimeDestinationFactory("creatim"),revtim:new c.MetaPropertyTimeDestinationFactory("revtim"),printim:new c.MetaPropertyTimeDestinationFactory("printim"),buptim:new c.MetaPropertyTimeDestinationFactory("buptim"),fonttbl:p.FonttblDestination,falt:new e.GenericSubTextPropertyDestinationFactory("falt","fonttbl:sub","setAltFontName"),colortbl:n.ColortblDestination,stylesheet:u.StylesheetDestination,footer:new e.RequiredDestinationFactory("footer"),footerf:new e.RequiredDestinationFactory("footerf"),footerl:new e.RequiredDestinationFactory("footerl"),footerr:new e.RequiredDestinationFactory("footerr"),footnote:new e.RequiredDestinationFactory("footnote"),ftncn:new e.RequiredDestinationFactory("ftncn"),ftnsep:new e.RequiredDestinationFactory("ftnsep"),ftnsepc:new e.RequiredDestinationFactory("ftnsepc"),header:new e.RequiredDestinationFactory("header"),headerf:new e.RequiredDestinationFactory("headerf"),headerl:new e.RequiredDestinationFactory("headerl"),headerr:new e.RequiredDestinationFactory("headerr"),pict:s.PictDestination,shppict:new s.PictGroupDestinationFactory(!1),nonshppict:new s.PictGroupDestinationFactory(!0),private1:new e.RequiredDestinationFactory("private1"),rxe:new e.RequiredDestinationFactory("rxe"),tc:new e.RequiredDestinationFactory("tc"),txe:new e.RequiredDestinationFactory("txe"),xe:new e.RequiredDestinationFactory("xe"),field:t.FieldDestination,fldinst:t.FldinstDestination,fldrslt:t.FldrsltDestination}}),"./src/rtfjs/parser/destinations/FieldDestinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{FieldDestination:()=>c,FldinstDestination:()=>l,FldrsltDestination:()=>u});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=r("./src/rtfjs/parser/destinations/PictDestinations.ts"),p=(function(){var o=function(i,a){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,v){b.__proto__=v}||function(b,v){for(var _ in v)Object.prototype.hasOwnProperty.call(v,_)&&(b[_]=v[_])},o(i,a)};return function(i,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");o(i,a);function b(){this.constructor=i}i.prototype=a===null?Object.create(a):(b.prototype=a.prototype,new b)}})(),c=(function(o){p(i,o);function i(){var a=o.call(this,"field")||this;return a._haveInst=!1,a._parsedInst=null,a._result=null,a}return i.prototype.apply=function(){if(!this._haveInst)throw new n.RTFJSError("IField has no fldinst destination")},i.prototype.setInst=function(a){var b=this;if(this._haveInst=!0,this._parsedInst!=null)throw new n.RTFJSError("IField cannot have multiple fldinst destinations");a instanceof Promise?a.then(function(v){b._parsedInst=v}).catch(function(v){throw b._parsedInst=null,new n.RTFJSError(v.message)}):this._parsedInst=a},i.prototype.getInst=function(){return this._parsedInst},i.prototype.setResult=function(a){if(this._result!=null)throw new n.RTFJSError("IField cannot have multiple fldrslt destinations");this._result=a},i})(e.DestinationBase),s=(function(o){p(i,o);function i(a,b){var v=o.call(this,a)||this;return v._url=b,v}return i.prototype.url=function(){return this._url},i.prototype.renderFieldBegin=function(a,b,v){var _=this;return v>0?(b.addIns(function(T){var k=T._doc,M=function(){return T.buildHyperlinkElement(_._url)},R;if(k._settings.onHyperlink!=null)R=k._settings.onHyperlink(M,{url:function(){return _.url()}});else{var O=M();R={element:O,content:O}}T.pushContainer(R)}),!0):!1},i})((function(){function o(i){this._fldinst=i}return o.prototype.renderFieldEnd=function(i,a,b){b>0&&a.addIns(function(v){v.popContainer()})},o})()),l=(function(o){p(i,o);function i(a,b){var v=o.call(this,"fldinst")||this;return v.parser=a,v.inst=b,v}return i.prototype.apply=function(){var a=(0,e.findParentDestination)(this.parser,"field");if(a==null)throw new n.RTFJSError("fldinst destination must be child of field destination");a.setInst(this.parseType())},i.prototype.parseType=function(){var a=this;this.text=this.text.trim();var b=this.text.indexOf(" ");if(b>0){var v=this.text.substr(b+1);if(v.length>=2&&v[0]==='"'){var _=v.indexOf('"',1);_>=1&&(v=v.substring(1,_))}var T=this.text.substr(0,b).toUpperCase();switch(T){case"HYPERLINK":return new s(this,v);case"IMPORT":if(typeof this.inst._settings.onImport=="function"){var k;this.inst.addIns(function(R){var O=R._doc,P=O._settings.onPicture;O._settings.onPicture=null;var N=k.apply(!0),it=N.isLegacy,J=N.element;O._settings.onPicture=P,typeof P=="function"&&(J=P(it,function(){return J})),J!=null&&R.appendElement(J)});var M=new Promise(function(R,O){try{var P=function(N){var it=N.error,J=N.keyword,ot=N.blob,tt=N.width,ht=N.height;if(!it&&typeof J=="string"&&J&&ot){var W={w:n.Helper._pxToTwips(tt||window.document.body.clientWidth||window.innerWidth),h:n.Helper._pxToTwips(ht||300)};k=new t.PictDestination(a.parser,a.inst),k.handleBlob(ot),k.handleKeyword(J,8),k._displaysize.width=W.w,k._displaysize.height=W.h,k._size.width=W.w,k._size.height=W.h,R({renderFieldBegin:function(){return!0},renderFieldEnd:function(){return null}})}else n.Helper.log("[fldinst]: failed to IMPORT image file: "+v),it?(it=it instanceof Error?it:new Error(it),O(it)):R(null)};a.inst._settings.onImport(v,P)}catch(N){O(N)}});return this.parser._asyncTasks.push(M),M}break;default:n.Helper.log("[fldinst]: unknown field type: "+T);break}}},i})(e.DestinationTextBase),u=(function(o){p(i,o);function i(a,b){return o.call(this,a,"fldrslt")||this}return i.prototype.apply=function(){var a=(0,e.findParentDestination)(this.parser,"field");a?.setResult(this),o.prototype.apply.call(this)},i.prototype.renderBegin=function(a,b){var v=(0,e.findParentDestination)(this.parser,"field");if(v!=null){var _=v.getInst();if(_!=null)return _.renderFieldBegin(v,a,b)}return!1},i.prototype.renderEnd=function(a,b){var v=(0,e.findParentDestination)(this.parser,"field");if(v!=null){var _=v.getInst();_?.renderFieldEnd(v,a,b)}},i})(e.DestinationFormattedTextBase)}),"./src/rtfjs/parser/destinations/FonttblDestinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{FonttblDestination:()=>c,FonttblDestinationSub:()=>p});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=(function(){var s=function(l,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a])},s(l,u)};return function(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");s(l,u);function o(){this.constructor=l}l.prototype=u===null?Object.create(u):(o.prototype=u.prototype,new o)}})(),p=(function(s){t(l,s);function l(u){var o=s.call(this,"fonttbl:sub")||this;return o._fonttbl=u,o.index=null,o.fontname=null,o.altfontname=null,o.family=null,o.pitch=n.Helper.FONTPITCH.DEFAULT,o.bias=0,o.charset=null,o}return l.prototype.handleKeyword=function(u,o){switch(u){case"f":return this.index=o,!0;case"fnil":return!0;case"froman":case"fswiss":case"fmodern":case"fscript":case"fdecor":case"ftech":case"fbidi":case"flomajor":case"fhimajor":case"fdbmajor":case"fbimajor":case"flominor":case"fhiminor":case"fdbminor":case"fbiminor":return this.family=u.slice(1),!0;case"fprq":switch(o){case 0:this.pitch=n.Helper.FONTPITCH.DEFAULT;break;case 1:this.pitch=n.Helper.FONTPITCH.FIXED;break;case 2:this.pitch=n.Helper.FONTPITCH.VARIABLE;break}return!0;case"fbias":return o!=null&&(this.bias=o),!0;case"fcharset":return o!=null&&(this.charset=n.Helper._mapCharset(o),this.charset==null&&n.Helper.log("Unknown font charset: "+o)),!0;case"cpg":return o!=null&&(this.charset=o),!0}return!1},l.prototype.appendText=function(u){this.fontname==null?this.fontname=u:this.fontname+=u},l.prototype.apply=function(){if(this.index==null)throw new n.RTFJSError("No font index provided");if(this.fontname==null)throw new n.RTFJSError("No font name provided");this._fonttbl.addSub(this),delete this._fonttbl},l.prototype.setAltFontName=function(u){this.altfontname=u},l})(e.DestinationBase),c=(function(s){t(l,s);function l(u,o){var i=s.call(this,"fonttbl")||this;return i._fonts=[],i._sub=null,i.inst=o,i}return l.prototype.sub=function(){return new p(this)},l.prototype.apply=function(){n.Helper.log("[fonttbl] apply()");for(var u in this._fonts)n.Helper.log("[fonttbl]["+u+"] index = "+this._fonts[u].fontname+" alternative: "+this._fonts[u].altfontname);this.inst._fonts=this._fonts,delete this._fonts},l.prototype.appendText=function(u){this._sub.appendText(u),this._sub.apply()},l.prototype.handleKeyword=function(u,o){u==="f"&&(this._sub=this.sub()),this._sub.handleKeyword(u,o)},l.prototype.addSub=function(u){this._fonts[u.index]=u},l})(e.DestinationBase)}),"./src/rtfjs/parser/destinations/MetaDestinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{InfoDestination:()=>p,MetaPropertyDestinationFactory:()=>c,MetaPropertyTimeDestinationFactory:()=>s});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=(function(){var l=function(u,o){return l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&(i[b]=a[b])},l(u,o)};return function(u,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");l(u,o);function i(){this.constructor=u}u.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)}})(),p=(function(l){t(u,l);function u(o,i,a){var b=l.call(this,a)||this;return b._metadata={},b.inst=i,b}return u.prototype.apply=function(){for(var o in this._metadata)this.inst._meta[o]=this._metadata[o];delete this._metadata},u.prototype.setMetadata=function(o,i){this._metadata[o]=i},u})(e.DestinationBase),c=(function(l){t(u,l);function u(o){var i=l.call(this)||this;return i.class=(function(a){t(b,a);function b(v,_,T){var k=a.call(this,T)||this;return k.parser=v,k}return b.prototype.apply=function(){var v=(0,e.findParentDestination)(this.parser,"info");if(v==null)throw new n.RTFJSError("IDestination "+this._name+" must be within info destination");v.setMetadata(o,this.text)},b})(e.DestinationTextBase),i}return u})(e.DestinationFactory),s=(function(l){t(u,l);function u(o){var i=l.call(this)||this;return i.class=(function(a){t(b,a);function b(v,_,T){var k=a.call(this,T)||this;return k._yr=null,k._mo=null,k._dy=null,k._hr=null,k._min=null,k._sec=null,k.parser=v,k}return b.prototype.handleKeyword=function(v,_){switch(v){case"yr":this._yr=_;break;case"mo":this._mo=_;break;case"dy":this._dy=_;break;case"hr":this._hr=_;break;case"min":this._min=_;break;case"sec":this._sec=_;break;default:return!1}if(_==null)throw new n.RTFJSError("No param found for keyword "+v);return!0},b.prototype.apply=function(){var v=(0,e.findParentDestination)(this.parser,"info");if(v==null)throw new n.RTFJSError("IDestination "+this._name+" must be within info destination");var _=new Date(Date.UTC(this._yr!=null?this._yr:1970,this._mo!=null?this._mo:1,this._dy!=null?this._dy:1,this._hr!=null?this._hr:0,this._min!=null?this._min:0,this._sec!=null?this._sec:0,0));v.setMetadata(o,_)},b})(e.DestinationBase),i}return u})(e.DestinationFactory)}),"./src/rtfjs/parser/destinations/PictDestinations.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{PictDestination:()=>l,PictGroupDestinationFactory:()=>s});var n=r("EMFJS"),e=r("WMFJS"),t=r("./src/rtfjs/Helper.ts"),p=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),c=(function(){var u=function(o,i){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var v in b)Object.prototype.hasOwnProperty.call(b,v)&&(a[v]=b[v])},u(o,i)};return function(o,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");u(o,i);function a(){this.constructor=o}o.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}})(),s=(function(u){c(o,u);function o(i){var a=u.call(this)||this;return a.class=(function(b){c(v,b);function v(){var _=b.call(this,"pict-group")||this;return _._legacy=i,_}return v.prototype.isLegacy=function(){return this._legacy},v})(p.DestinationTextBase),a}return o})(p.DestinationFactory),l=(function(u){c(o,u);function o(i,a){var b=u.call(this,"pict")||this;return b._pictHandlers={picw:b._setPropValueRequired("_size","width"),pich:b._setPropValueRequired("_size","height"),picwgoal:b._setPropValueRequired("_displaysize","width"),pichgoal:b._setPropValueRequired("_displaysize","height")},b._pictTypeHandler={emfblip:(function(){return typeof n<"u"?function(){return{load:function(){try{return new n.Renderer(b._blob)}catch(v){if(v instanceof n.Error)return v.message;throw v}},render:function(v){return v.render({width:t.Helper._twipsToPt(b._displaysize.width)+"pt",height:t.Helper._twipsToPt(b._displaysize.height)+"pt",wExt:b._size.width,hExt:b._size.height,xExt:b._size.width,yExt:b._size.height,mapMode:8})}}}:""})(),pngblip:"image/png",jpegblip:"image/jpeg",macpict:"",pmmetafile:"",wmetafile:(function(){return typeof e<"u"?function(v){if(v==null||v<0||v>8)throw new t.RTFJSError("Insufficient metafile information");return{load:function(){try{return new e.Renderer(b._blob)}catch(_){if(_ instanceof e.Error)return _.message;throw _}},render:function(_){return _.render({width:t.Helper._twipsToPt(b._displaysize.width)+"pt",height:t.Helper._twipsToPt(b._displaysize.height)+"pt",xExt:b._size.width,yExt:b._size.height,mapMode:v})}}}:""})(),dibitmap:"",wbitmap:""},b._type=null,b._blob=null,b._displaysize={width:null,height:null},b._size={width:null,height:null},b.parser=i,b.inst=a,b}return o.prototype.handleKeyword=function(i,a){var b=this._pictHandlers[i];if(b!=null)return b(a),!0;var v=this._pictTypeHandler[i];if(v!=null){if(this._type==null)if(typeof v=="function"){var _=v(a);_!=null&&(this._type=function(){var T=_.load();if(T!=null)return typeof T=="string"?T:function(){return _.render(T)}})}else this._type=v;return!0}return!1},o.prototype.handleBlob=function(i){this._blob=i},o.prototype.apply=function(i){var a=this;if(i===void 0&&(i=!1),this._type==null)throw new t.RTFJSError("Picture type unknown or not specified");var b=(0,p.findParentDestination)(this.parser,"pict-group"),v=b!=null?b.isLegacy():null,_=this._type;if(typeof _=="function"){if(this._blob==null){if(this._blob=t.Helper._hexToBlob(this.text),this._blob==null)throw new t.RTFJSError("Could not parse picture data");delete this.text}var T=function(O,P){var N=O._doc,it=_();if(it!=null)if(typeof it=="string"){if(t.Helper.log("[pict] Could not load image: "+it),P)return O.buildPicture(it,null);N.addIns(function(J){J.picture(it,null)})}else{if(typeof it!="function")throw new t.RTFJSError("Expected a picture render function");if(P)return O.buildRenderedPicture(it());N.addIns(function(J){J.renderedPicture(it())})}};if(this.inst._settings.onPicture!=null)this.inst.addIns(function(O){var P=a.inst._settings.onPicture(v,function(){return T(O,!0)});P!=null&&O.appendElement(P)});else return{isLegacy:v,element:T(this.parser.renderer,i)}}else if(typeof _=="string"){var k=this.text,M=this._blob,R=function(O,P){var N=M!=null?t.Helper._blobToBinary(M):t.Helper._hexToBinary(k);if(_!==""){if(P)return O.buildPicture(_,N);O._doc.addIns(function(it){it.picture(_,N)})}else{if(P)return O.buildPicture("Unsupported image format",null);O._doc.addIns(function(it){it.picture("Unsupported image format",null)})}};if(this.inst._settings.onPicture!=null)this.inst.addIns(function(O){var P=a.inst._settings.onPicture(v,function(){return R(O,!0)});P!=null&&O.appendElement(P)});else return{isLegacy:v,element:R(this.parser.renderer,i)}}delete this.text},o.prototype._setPropValueRequired=function(i,a){var b=this;return function(v){if(v==null)throw new t.RTFJSError("Picture property has no value");t.Helper.log("[pict] set "+i+"."+a+" = "+v);var _=i!=null?b[i]:b;_[a]=v}},o})(p.DestinationTextBase)}),"./src/rtfjs/parser/destinations/RtfDestination.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{RtfDestination:()=>l});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/renderer/RenderChp.ts"),t=r("./src/rtfjs/renderer/RenderPap.ts"),p=r("./src/rtfjs/parser/Containers.ts"),c=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),s=(function(){var u=function(o,i){return u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var v in b)Object.prototype.hasOwnProperty.call(b,v)&&(a[v]=b[v])},u(o,i)};return function(o,i){if(typeof i!="function"&&i!==null)throw new TypeError("Class extends value "+String(i)+" is not a constructor or null");u(o,i);function a(){this.constructor=o}o.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}})(),l=(function(u){s(o,u);function o(i,a,b,v){var _=u.call(this,b)||this;if(_._charFormatHandlers={ansicpg:function(T){T>0&&(n.Helper.log("[rtf] using charset: "+T),_.parser.codepage=T)},sectd:function(){n.Helper.log("[rtf] reset to section defaults"),_.parser.state.sep=new p.Sep(null)},plain:function(){n.Helper.log("[rtf] reset to character defaults"),_.parser.state.chp=new p.Chp(null)},pard:function(){n.Helper.log("[rtf] reset to paragraph defaults"),_.parser.state.pap=new p.Pap(null)},b:_._genericFormatOnOff("chp","bold"),i:_._genericFormatOnOff("chp","italic"),sub:_._genericFormatSetVal("chp","supersubscript",n.Helper.SUPERSUBSCRIPT.SUBSCRIPT),super:_._genericFormatSetVal("chp","supersubscript",n.Helper.SUPERSUBSCRIPT.SUPERSCRIPT),nosupersub:_._genericFormatSetVal("chp","supersubscript",n.Helper.SUPERSUBSCRIPT.NONE),cf:_._genericFormatSetValRequired("chp","colorindex"),highlight:_._genericFormatSetValRequired("chp","highlightindex"),fs:_._genericFormatSetValRequired("chp","fontsize"),f:_._genericFormatSetValRequired("chp","fontfamily"),loch:_._genericFormatSetNoParam("pap","charactertype",n.Helper.CHARACTER_TYPE.LOWANSI),hich:_._genericFormatSetNoParam("pap","charactertype",n.Helper.CHARACTER_TYPE.HIGHANSI),dbch:_._genericFormatSetNoParam("pap","charactertype",n.Helper.CHARACTER_TYPE.DOUBLE),strike:_._genericFormatOnOff("chp","strikethrough"),striked:_._genericFormatOnOff("chp","dblstrikethrough"),ul:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.CONTINUOUS,n.Helper.UNDERLINE.NONE),uld:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DOTTED,n.Helper.UNDERLINE.NONE),uldash:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DASHED,n.Helper.UNDERLINE.NONE),uldashd:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DASHDOTTED,n.Helper.UNDERLINE.NONE),uldashdd:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DASHDOTDOTTED,n.Helper.UNDERLINE.NONE),uldb:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DOUBLE,n.Helper.UNDERLINE.NONE),ulhwave:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.HEAVYWAVE,n.Helper.UNDERLINE.NONE),ulldash:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.LONGDASHED,n.Helper.UNDERLINE.NONE),ulnone:_._genericFormatSetNoParam("chp","underline",n.Helper.UNDERLINE.NONE),ulth:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.THICK,n.Helper.UNDERLINE.NONE),ulthd:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.THICKDOTTED,n.Helper.UNDERLINE.NONE),ulthdash:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.THICKDASHED,n.Helper.UNDERLINE.NONE),ulthdashd:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.THICKDASHDOTTED,n.Helper.UNDERLINE.NONE),ulthdashdd:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.THICKDASHDOTDOTTED,n.Helper.UNDERLINE.NONE),ululdbwave:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.DOUBLEWAVE,n.Helper.UNDERLINE.NONE),ulw:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.WORD,n.Helper.UNDERLINE.NONE),ulwave:_._genericFormatOnOff("chp","underline",n.Helper.UNDERLINE.WAVE,n.Helper.UNDERLINE.NONE),li:_._genericFormatSetMemberVal("pap","indent","left",0),ri:_._genericFormatSetMemberVal("pap","indent","right",0),fi:_._genericFormatSetMemberVal("pap","indent","firstline",0),sa:_._genericFormatSetValRequired("pap","spaceafter"),sb:_._genericFormatSetValRequired("pap","spacebefore"),cols:_._genericFormatSetVal("sep","columns",0),sbknone:_._genericFormatSetNoParam("sep","breaktype",n.Helper.BREAKTYPE.NONE),sbkcol:_._genericFormatSetNoParam("sep","breaktype",n.Helper.BREAKTYPE.COL),sbkeven:_._genericFormatSetNoParam("sep","breaktype",n.Helper.BREAKTYPE.EVEN),sbkodd:_._genericFormatSetNoParam("sep","breaktype",n.Helper.BREAKTYPE.ODD),sbkpage:_._genericFormatSetNoParam("sep","breaktype",n.Helper.BREAKTYPE.PAGE),pgnx:_._genericFormatSetMemberVal("sep","pagenumber","x",0),pgny:_._genericFormatSetMemberVal("sep","pagenumber","y",0),pgndec:_._genericFormatSetNoParam("sep","pagenumberformat",n.Helper.PAGENUMBER.DECIMAL),pgnucrm:_._genericFormatSetNoParam("sep","pagenumberformat",n.Helper.PAGENUMBER.UROM),pgnlcrm:_._genericFormatSetNoParam("sep","pagenumberformat",n.Helper.PAGENUMBER.LROM),pgnucltr:_._genericFormatSetNoParam("sep","pagenumberformat",n.Helper.PAGENUMBER.ULTR),pgnlcltr:_._genericFormatSetNoParam("sep","pagenumberformat",n.Helper.PAGENUMBER.LLTR),qc:_._genericFormatSetNoParam("pap","justification",n.Helper.JUSTIFICATION.CENTER),ql:_._genericFormatSetNoParam("pap","justification",n.Helper.JUSTIFICATION.LEFT),qr:_._genericFormatSetNoParam("pap","justification",n.Helper.JUSTIFICATION.RIGHT),qj:_._genericFormatSetNoParam("pap","justification",n.Helper.JUSTIFICATION.JUSTIFY),paperw:_._genericFormatSetVal("dop","width",12240),paperh:_._genericFormatSetVal("dop","height",15480),margl:_._genericFormatSetMemberVal("dop","margin","left",1800),margr:_._genericFormatSetMemberVal("dop","margin","right",1800),margt:_._genericFormatSetMemberVal("dop","margin","top",1440),margb:_._genericFormatSetMemberVal("dop","margin","bottom",1440),pgnstart:_._genericFormatSetVal("dop","pagenumberstart",1),facingp:_._genericFormatSetNoParam("dop","facingpages",!0),landscape:_._genericFormatSetNoParam("dop","landscape",!0),par:_._addInsHandler(function(T){T.startPar()}),line:_._addInsHandler(function(T){T.lineBreak()})},i.version!=null)throw new n.RTFJSError("Unexpected rtf destination");if(v&&v!==1)throw new n.RTFJSError("Unsupported rtf version");return i.version=1,_._metadata={},_.parser=i,_.inst=a,_}return o.prototype.addIns=function(i){this.inst.addIns(i)},o.prototype.appendText=function(i){n.Helper.log("[rtf] output: "+i),this.inst.addIns(i)},o.prototype.sub=function(){n.Helper.log("[rtf].sub()")},o.prototype.handleKeyword=function(i,a){var b=this._charFormatHandlers[i];return b!=null?(b(a),!0):!1},o.prototype.apply=function(){n.Helper.log("[rtf] apply()");for(var i in this._metadata)this.inst._meta[i]=this._metadata[i];delete this._metadata},o.prototype.setMetadata=function(i,a){this._metadata[i]=a},o.prototype._addInsHandler=function(i){var a=this;return function(b){a.inst.addIns(i)}},o.prototype._addFormatIns=function(i,a){switch(n.Helper.log("[rtf] update "+i),i){case"chp":var b=new e.RenderChp(new p.Chp(a));this.inst.addIns(function(_){_.setChp(b)});break;case"pap":var v=new t.RenderPap(new p.Pap(a));this.inst.addIns(function(_){_.setPap(v)});break}},o.prototype._genericFormatSetNoParam=function(i,a,b){var v=this;return function(_){var T=v.parser.state[i];T[a]=b,n.Helper.log("[rtf] state."+i+"."+a+" = "+T[a].toString()),v._addFormatIns(i,T)}},o.prototype._genericFormatOnOff=function(i,a,b,v){var _=this;return function(T){var k=_.parser.state[i];k[a]=T==null||T!==0?b??!0:v??!1,n.Helper.log("[rtf] state."+i+"."+a+" = "+k[a].toString()),_._addFormatIns(i,k)}},o.prototype._genericFormatSetVal=function(i,a,b){var v=this;return function(_){var T=v.parser.state[i];T[a]=_??b,n.Helper.log("[rtf] state."+i+"."+a+" = "+T[a].toString()),v._addFormatIns(i,T)}},o.prototype._genericFormatSetValRequired=function(i,a){var b=this;return function(v){if(v==null)throw new n.RTFJSError("Keyword without required param");var _=b.parser.state[i];_[a]=v,n.Helper.log("[rtf] state."+i+"."+a+" = "+_[a].toString()),b._addFormatIns(i,_)}},o.prototype._genericFormatSetMemberVal=function(i,a,b,v){var _=this;return function(T){var k=_.parser.state[i],M=k[a];M[b]=T??v,n.Helper.log("[rtf] state."+i+"."+a+"."+b+" = "+M[b].toString()),_._addFormatIns(i,k)}},o})(c.DestinationBase)}),"./src/rtfjs/parser/destinations/StylesheetDestination.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{StylesheetDestination:()=>c,StylesheetDestinationSub:()=>p});var n=r("./src/rtfjs/Helper.ts"),e=r("./src/rtfjs/parser/destinations/DestinationBase.ts"),t=(function(){var s=function(l,u){return s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,i){o.__proto__=i}||function(o,i){for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(o[a]=i[a])},s(l,u)};return function(l,u){if(typeof u!="function"&&u!==null)throw new TypeError("Class extends value "+String(u)+" is not a constructor or null");s(l,u);function o(){this.constructor=l}l.prototype=u===null?Object.create(u):(o.prototype=u.prototype,new o)}})(),p=(function(s){t(l,s);function l(u){var o=s.call(this,"stylesheet:sub")||this;return o._stylesheet=u,o.index=0,o.name=null,o.handler=o._handleKeywordCommon("paragraph"),o}return l.prototype.handleKeyword=function(u,o){switch(u){case"s":return this.index=o,!0;case"cs":return delete this.paragraph,this.handler=this._handleKeywordCommon("character"),this.index=o,!0;case"ds":return delete this.paragraph,this.handler=this._handleKeywordCommon("section"),this.index=o,!0;case"ts":return delete this.paragraph,this.handler=this._handleKeywordCommon("table"),this.index=o,!0}return this.handler(u,o)},l.prototype.appendText=function(u){this.name==null?this.name=u:this.name+=u},l.prototype.apply=function(){this._stylesheet.addSub({index:this.index,name:this.name}),delete this._stylesheet},l.prototype._handleKeywordCommon=function(u){return function(o,i){return n.Helper.log("[stylesheet:sub]."+u+": unhandled keyword: "+o+" param: "+i),!1}},l})(e.DestinationBase),c=(function(s){t(l,s);function l(u,o){var i=s.call(this,"stylesheet")||this;return i._stylesheets=[],i.inst=o,i}return l.prototype.sub=function(){return new p(this)},l.prototype.apply=function(){n.Helper.log("[stylesheet] apply()");for(var u in this._stylesheets)n.Helper.log("[stylesheet] ["+u+"] name: "+this._stylesheets[u].name);this.inst._stylesheets=this._stylesheets,delete this._stylesheets},l.prototype.addSub=function(u){this._stylesheets[u.index]=u},l})(e.DestinationBase)}),"./src/rtfjs/renderer/RenderChp.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{RenderChp:()=>e});var n=r("./src/rtfjs/Helper.ts"),e=(function(){function t(p){this._chp=p}return t.prototype.apply=function(p,c){if(n.Helper.log("[rtf] RenderChp: "+c.textContent),n.Helper.log("[rtf] RenderChp apply: "+JSON.stringify(this._chp)),this._chp.bold&&(c.style.fontWeight="bold"),this._chp.italic&&(c.style.fontStyle="italic"),Object.prototype.hasOwnProperty.call(this._chp,"fontfamily")&&p._fonts[this._chp.fontfamily]){var s=p._fonts[this._chp.fontfamily].fontname.replace(";","");s!=="Symbol"&&(c.style.fontFamily=s)}var l=[];if(this._chp.underline!==n.Helper.UNDERLINE.NONE&&l.push("underline"),(this._chp.strikethrough||this._chp.dblstrikethrough)&&l.push("line-through"),l.length>0&&(c.style.textDecoration=l.join(" ")),this._chp.colorindex!==0){var u=p._lookupColor(this._chp.colorindex);u!=null&&(c.style.color=n.Helper._colorToStr(u))}if(this._chp.highlightindex!==0){var u=p._lookupColor(this._chp.highlightindex);u!=null&&(c.style.backgroundColor=n.Helper._colorToStr(u))}c.style.fontSize=Math.floor(this._chp.fontsize/2)+"pt",this._chp.supersubscript===n.Helper.SUPERSUBSCRIPT.SUPERSCRIPT?c.style.verticalAlign="super":this._chp.supersubscript===n.Helper.SUPERSUBSCRIPT.SUBSCRIPT&&(c.style.verticalAlign="sub"),(this._chp.supersubscript===n.Helper.SUPERSUBSCRIPT.SUPERSCRIPT||this._chp.supersubscript===n.Helper.SUPERSUBSCRIPT.SUBSCRIPT)&&(c.style.fontSize=Math.floor(this._chp.fontsize/2-2)+"pt")},t})()}),"./src/rtfjs/renderer/RenderPap.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{RenderPap:()=>e});var n=r("./src/rtfjs/Helper.ts"),e=(function(){function t(p){this._pap=p}return t.prototype.apply=function(p,c,s,l){if(n.Helper.log("[rtf] RenderPap apply:"+(s!=null?" chp="+JSON.stringify(s._chp):"")+" pap="+JSON.stringify(this._pap)+" ismaindiv="+l),l)this._pap.spacebefore!==0?c.style.marginTop=n.Helper._twipsToPt(this._pap.spacebefore)+"pt":c.style.marginTop="",this._pap.spaceafter!==0?c.style.marginBottom=n.Helper._twipsToPt(this._pap.spaceafter)+"pt":c.style.marginBottom="",s!=null&&(c.style.minHeight=Math.floor(s._chp.fontsize/2)+"pt");else switch(this._pap.justification){case n.Helper.JUSTIFICATION.LEFT:c.style.textAlign="left";break;case n.Helper.JUSTIFICATION.RIGHT:c.style.textAlign="right";break;case n.Helper.JUSTIFICATION.CENTER:c.style.textAlign="center";break;case n.Helper.JUSTIFICATION.JUSTIFY:c.style.textAlign="justify";break}},t})()}),"./src/rtfjs/renderer/Renderer.ts":((w,A,r)=>{"use strict";r.r(A),r.d(A,{Renderer:()=>e});var n=r("./src/rtfjs/Helper.ts"),e=(function(){function t(p){this._doc=p,this._dom=null,this._curRChp=null,this._curRPap=null,this._curpar=null,this._cursubpar=null,this._curcont=[]}return t.prototype.pushContainer=function(p){this._curpar==null&&this.startPar();var c=this._curcont.push(p);c>1?this._curcont[c-1].content.append(p.element):this._cursubpar!=null?this._cursubpar.append(p.element):this._curpar.append(p.element)},t.prototype.popContainer=function(){if(this._curcont.pop()==null)throw new n.RTFJSError("No container on rendering stack")},t.prototype.buildHyperlinkElement=function(p){var c=document.createElement("a");return c.href=p,c},t.prototype._appendToPar=function(p,c){if(this._curpar==null&&this.startPar(),c===!0){var s=document.createElement("div");this._cursubpar==null&&(s.append.apply(s,Array.from(this._curpar.childNodes)),this._curpar.append(s),s=document.createElement("div")),p&&s.append(p),this._curRPap!=null&&this._curRPap.apply(this._doc,s,this._curRChp,!1),this._cursubpar=s,this._curpar.append(s)}else if(p){var l=this._curcont.length;l>0?this._curcont[l-1].content.append(p):this._cursubpar!=null?this._cursubpar.append(p):this._curpar.append(p)}},t.prototype.startPar=function(){this._curpar=document.createElement("div"),this._curRPap!=null&&(this._curRPap.apply(this._doc,this._curpar,this._curRChp,!0),this._curRPap.apply(this._doc,this._curpar,this._curRChp,!1)),this._cursubpar=null,this._curcont=[],this._dom.push(this._curpar)},t.prototype.lineBreak=function(){this._appendToPar(null,!0)},t.prototype.setChp=function(p){this._curRChp=p},t.prototype.setPap=function(p){this._curRPap=p,this._cursubpar!=null?this._curRPap.apply(this._doc,this._cursubpar,null,!1):this._curpar!=null&&(this._curRPap.apply(this._doc,this._curpar,null,!0),this._curRPap.apply(this._doc,this._curpar,null,!1))},t.prototype.appendElement=function(p){this._appendToPar(p)},t.prototype.buildRenderedPicture=function(p){return p==null&&(p=document.createElement("span"),p.textContent="[failed to render image]"),p},t.prototype.renderedPicture=function(p){this._appendToPar(this.buildRenderedPicture(p))},t.prototype.buildPicture=function(p,c){if(c!=null){var s=document.createElement("img");return s.src="data:"+p+";base64,"+btoa(c),s}else{var l="image type not supported";typeof p=="string"&&p!==""&&(l=p);var u=document.createElement("span");return u.textContent="["+l+"]",u}},t.prototype.picture=function(p,c){this._appendToPar(this.buildPicture(p,c))},t.prototype.buildDom=function(){if(this._dom!=null)return this._dom;this._dom=[],this._curRChp=null,this._curRPap=null,this._curpar=null;for(var p=this._doc._ins.length,c=0;c<p;c++){var s=this._doc._ins[c];if(typeof s=="string"){var l=document.createElement("span");l.textContent=s,this._curRChp!=null&&this._curRChp.apply(this._doc,l),this._appendToPar(l)}else s(this)}return this._dom},t})()}),EMFJS:(w=>{"use strict";w.exports=d}),WMFJS:(w=>{"use strict";w.exports=f})},y={};function E(w){var A=y[w];if(A!==void 0)return A.exports;var r=y[w]={exports:{}};return g[w].call(r.exports,r,r.exports,E),r.exports}E.n=w=>{var A=w&&w.__esModule?()=>w.default:()=>w;return E.d(A,{a:A}),A},E.d=(w,A)=>{for(var r in A)E.o(A,r)&&!E.o(w,r)&&Object.defineProperty(w,r,{enumerable:!0,get:A[r]})},E.o=(w,A)=>Object.prototype.hasOwnProperty.call(w,A),E.r=w=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(w,"__esModule",{value:!0})};var h={};return(()=>{"use strict";E.r(h),E.d(h,{Document:()=>w.DocumentFacade,Error:()=>A.RTFJSError,loggingEnabled:()=>A.loggingEnabled});var w=E("./src/rtfjs/DocumentFacade.ts"),A=E("./src/rtfjs/Helper.ts")})(),h})())})),Ul=_e({default:()=>jl});async function jl(m,C,d){const f=(d||"odt").toLowerCase();if(f==="rtf")return Eo(m,C);const g=await Co(m,f),y=f==="odp"?"OpenDocument 演示文稿预览":"OpenDocument 文档预览";return C.replaceChildren(cn(),vo(f,y,g)),{$el:C,unmount(){C.replaceChildren()}}}var Ao,bo,cn,be,gr,Co,vo,yo,Eo,Gl=vt((()=>{Ao=ze(Hr(),1),bo=`
446
446
  .odf-viewer{min-height:100%;padding:28px;overflow:auto;background:#dfe5eb;box-sizing:border-box}
447
447
  .odf-shell{width:min(100%,980px);margin:0 auto}.odf-shell>header{margin-bottom:18px;padding:18px 22px;border-radius:8px;background:#fff;box-shadow:0 10px 26px rgba(15,23,42,.1);box-sizing:border-box}
448
448
  .odf-shell>header span{color:#0f766e;font-size:12px;font-weight:800}.odf-shell>header h2{margin:6px 0 0;color:#132235;font-size:24px}
@@ -455,4 +455,4 @@ ${lo}`}});C.innerHTML=`<style data-msdoc>${g.css}</style>${Rl(g.html)}`;const y=
455
455
  .file-viewer[data-viewer-theme='dark'] .odf-viewer,.file-viewer[data-viewer-theme='dark'] .flyfish-rtf-viewer{background:#111827}.file-viewer[data-viewer-theme='dark'] .odf-shell>header,.file-viewer[data-viewer-theme='dark'] .odf-page,.file-viewer[data-viewer-theme='dark'] .flyfish-rtf-header,.file-viewer[data-viewer-theme='dark'] .flyfish-rtf-paper{background:#f8fafc;color:#1f2937}
456
456
  @media (prefers-color-scheme:dark){.file-viewer[data-viewer-theme='system'] .odf-viewer,.file-viewer[data-viewer-theme='system'] .flyfish-rtf-viewer{background:#111827}.file-viewer[data-viewer-theme='system'] .odf-shell>header,.file-viewer[data-viewer-theme='system'] .odf-page,.file-viewer[data-viewer-theme='system'] .flyfish-rtf-header,.file-viewer[data-viewer-theme='system'] .flyfish-rtf-paper{background:#f8fafc;color:#1f2937}}
457
457
  @media (max-width:720px){.odf-viewer,.flyfish-rtf-viewer{padding:14px}.odf-page{padding:28px 24px}.flyfish-rtf-paper{padding:36px 28px}}
458
- `,cn=()=>{const m=document.createElement("style");return m.textContent=go,m},Ae=(m,C,d,f)=>{const g=document.createElement(C);return f&&(g.className=f),g.textContent=d,m.appendChild(g),g},gr=m=>(m.textContent||"").replace(/\s+/g," ").trim(),mo=async(m,C)=>{var d;const f=await((d=(await uo.default.loadAsync(m)).file("content.xml"))===null||d===void 0?void 0:d.async("text"));if(!f)throw new Error("ODF 文件缺少 content.xml");const g=new DOMParser().parseFromString(f,"application/xml"),y=g.querySelector("parsererror");if(y)throw new Error(y.textContent||"ODF XML 解析失败");if(C==="odp")return Array.from(g.getElementsByTagName("draw:page")).map((h,w)=>{const A=Array.from(h.getElementsByTagName("text:p")).map(gr).filter(Boolean);return{title:`第 ${w+1} 页`,blocks:A.length?A:["该页没有可提取文本"]}});const E=[...Array.from(g.getElementsByTagName("text:h")).map(gr),...Array.from(g.getElementsByTagName("text:p")).map(gr)].filter(Boolean);return[{title:"正文",blocks:E.length?E:["没有提取到可读文本"]}]},Ao=(m,C,d)=>{const f=document.createElement("div");f.className="odf-viewer";const g=document.createElement("section");g.className="odf-shell";const y=document.createElement("header");return Ae(y,"span",m.toUpperCase()),Ae(y,"h2",C),g.appendChild(y),d.forEach(E=>{const h=document.createElement("article");h.className="odf-page",Ae(h,"h3",E.title),E.blocks.forEach(w=>Ae(h,"p",w)),g.appendChild(h)}),f.appendChild(g),f},bo=async()=>{const m=await Promise.resolve().then(()=>ze(Nl(),1));return m.RTFJS||m.default||m},Co=async(m,C)=>{var d,f;const g=await bo();(d=g.loggingEnabled)===null||d===void 0||d.call(g,!1);const y=new g.Document(m,{}),E=((f=y.metadata)===null||f===void 0?void 0:f.call(y))||{},h=await y.render(),w=document.createElement("div");w.className="flyfish-rtf-viewer";const A=document.createElement("div");A.className="flyfish-rtf-header",Ae(A,"span","RTF"),Ae(A,"strong",E.title||"RTF 文档预览");const r=document.createElement("article");return r.className="flyfish-rtf-paper",h.forEach(n=>r.appendChild(n)),w.append(A,r),C.replaceChildren(cn(),w),{$el:C,unmount(){C.replaceChildren()}}}}));Lr();var vo=["office-word-openxml","office-word-binary","open-document"],yo=ie.filter(m=>vo.includes(m.id));if(yo.length!==vo.length)throw new Error("@file-viewer/renderer-word could not locate the shared Word renderer definitions.");var Ul=yo,jl=(m,C,d,f)=>Promise.resolve().then(()=>(Ua(),fa)).then(({default:g})=>g(m,C,f)),Gl=(m,C,d,f)=>Promise.resolve().then(()=>(Bl(),Pl)).then(({default:g})=>g(m,C,f)),Wl=(m,C,d)=>Promise.resolve().then(()=>(Hl(),Fl)).then(({default:f})=>f(m,C,d)),hn={id:"file-viewer-renderer-word",label:"Flyfish File Viewer Word renderer",definitions:Ul,handlers:[{rendererId:"office-word-openxml",handler:jl},{rendererId:"office-word-binary",handler:Gl},{rendererId:"open-document",handler:Wl}]},Eo=globalThis,wo=Eo.FlyfishFileViewerWebFullRenderers||(Eo.FlyfishFileViewerWebFullRenderers={});wo.word=hn,wo[hn.id]=hn})();
458
+ `,cn=()=>{const m=document.createElement("style");return m.textContent=bo,m},be=(m,C,d,f)=>{const g=document.createElement(C);return f&&(g.className=f),g.textContent=d,m.appendChild(g),g},gr=m=>(m.textContent||"").replace(/\s+/g," ").trim(),Co=async(m,C)=>{var d;const f=await((d=(await Ao.default.loadAsync(m)).file("content.xml"))===null||d===void 0?void 0:d.async("text"));if(!f)throw new Error("ODF 文件缺少 content.xml");const g=new DOMParser().parseFromString(f,"application/xml"),y=g.querySelector("parsererror");if(y)throw new Error(y.textContent||"ODF XML 解析失败");if(C==="odp")return Array.from(g.getElementsByTagName("draw:page")).map((h,w)=>{const A=Array.from(h.getElementsByTagName("text:p")).map(gr).filter(Boolean);return{title:`第 ${w+1} 页`,blocks:A.length?A:["该页没有可提取文本"]}});const E=[...Array.from(g.getElementsByTagName("text:h")).map(gr),...Array.from(g.getElementsByTagName("text:p")).map(gr)].filter(Boolean);return[{title:"正文",blocks:E.length?E:["没有提取到可读文本"]}]},vo=(m,C,d)=>{const f=document.createElement("div");f.className="odf-viewer";const g=document.createElement("section");g.className="odf-shell";const y=document.createElement("header");return be(y,"span",m.toUpperCase()),be(y,"h2",C),g.appendChild(y),d.forEach(E=>{const h=document.createElement("article");h.className="odf-page",be(h,"h3",E.title),E.blocks.forEach(w=>be(h,"p",w)),g.appendChild(h)}),f.appendChild(g),f},yo=async()=>{const m=await Promise.resolve().then(()=>ze(Hl(),1));return m.RTFJS||m.default||m},Eo=async(m,C)=>{var d,f;const g=await yo();(d=g.loggingEnabled)===null||d===void 0||d.call(g,!1);const y=new g.Document(m,{}),E=((f=y.metadata)===null||f===void 0?void 0:f.call(y))||{},h=await y.render(),w=document.createElement("div");w.className="flyfish-rtf-viewer";const A=document.createElement("div");A.className="flyfish-rtf-header",be(A,"span","RTF"),be(A,"strong",E.title||"RTF 文档预览");const r=document.createElement("article");return r.className="flyfish-rtf-paper",h.forEach(n=>r.appendChild(n)),w.append(A,r),C.replaceChildren(cn(),w),{$el:C,unmount(){C.replaceChildren()}}}}));Lr();var wo=["office-word-openxml","office-word-binary","open-document"],_o=ie.filter(m=>wo.includes(m.id));if(_o.length!==wo.length)throw new Error("@file-viewer/renderer-word could not locate the shared Word renderer definitions.");var Wl=_o,zl=(m,C,d,f)=>Promise.resolve().then(()=>(Wa(),ua)).then(({default:g})=>g(m,C,f)),$l=(m,C,d,f)=>Promise.resolve().then(()=>(Ll(),kl)).then(({default:g})=>g(m,C,f)),Vl=(m,C,d)=>Promise.resolve().then(()=>(Gl(),Ul)).then(({default:f})=>f(m,C,d)),hn={id:"file-viewer-renderer-word",label:"Flyfish File Viewer Word renderer",definitions:Wl,handlers:[{rendererId:"office-word-openxml",handler:zl},{rendererId:"office-word-binary",handler:$l},{rendererId:"open-document",handler:Vl}]},To=globalThis,xo=To.FlyfishFileViewerWebFullRenderers||(To.FlyfishFileViewerWebFullRenderers={});xo.word=hn,xo[hn.id]=hn})();