1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/js/docx-preview-CVYtKeut.js","assets/js/index-DICQ_NrC.js","assets/css/index-BRznYEg-.css","assets/js/jszip.min-SJNWACyq.js"])))=>i.map(i=>d[i]); 2import{A as I,Ar as S,Bi as O,Di as B,Jr as R,Ri as Z,Ti as k,U as L,Zi as g,ai as N,da as h,ia as T,ii as M,ki as F,kr as z,mi as q,n as X,t as V}from"./index-DICQ_NrC.js";function o(s){return new Error(`Office archive is not safe to preview: ${s}`)}function W(s){const c=s.byteLength-v,e=Math.max(0,c-D);for(let r=c;r>=e;r-=1)if(s.getUint32(r,!0)===E)return r;throw o("ZIP directory is missing")}function Y(s,c=x){if(s.byteLength<v)throw o("file is truncated");const e=new DataView(s),r=W(e),d=e.getUint16(r+4,!0),f=e.getUint16(r+6,!0),l=e.getUint16(r+8,!0),u=e.getUint16(r+10,!0),_=e.getUint32(r+12,!0),n=e.getUint32(r+16,!0),t=e.getUint16(r+20,!0);if(r+v+t>e.byteLength)throw o("ZIP comment is truncated");if(d!==0||f!==0||l!==u)throw o("multi-disk ZIP files are unsupported");if(u===65535||_===4294967295||n===4294967295)throw o("ZIP64 files are unsupported");if(u>c.maxEntries)throw o("too many archive entries");if(n+_>
2r)throw o("ZIP directory is invalid");let i=n,a=0;for(let m=0;m<u;m+=1){if(i+46>r||e.getUint32(i,!0)!==b)throw o("ZIP entry metadata is invalid");const p=e.getUint32(i+24,!0);if(p===4294967295)throw o("ZIP64 entries are unsupported");if(p>c.maxEntryUncompressedBytes)throw o("an archive entry is too large");if(a+=p,a>c.maxTotalUncompressedBytes)throw o("expanded archive is too large");const U=e.getUint16(i+28,!0),A=e.getUint16(i+30,!0),P=e.getUint16(i+32,!0);i+=46+U+A+P}if(i>n+_)throw o("ZIP directory size is invalid")}var x,E,b,v,D,G=h((()=>{x={maxEntries:1e4,maxEntryUncompressedBytes:64*1024*1024,maxTotalUncompressedBytes:128*1024*1024},E=101010256,b=33639248,v=22,D=65535})),y,C,w=h((()=>{R(),I(),G(),S(),y=5e4,C=q({__name:"DocxFilePreview",props:{data:{}},emits:["error"],setup(s,{emit:c}){const e=s,r=c,d=g(null),f=g(!0);let l=0;function u(n){n.querySelectorAll("script, iframe, frame, object, embed, applet, form").forEach(t=>t.remove()),n.querySelectorAll("style").forEach(t=>{t.textContent=(t.textContent||"").replace(/@import[\s\S]*?;
2/gi,"").replace(/url\(\s*(['"]?)(?!data:|blob:)[^)]+\)/gi,"none")}),n.querySelectorAll("*").forEach(t=>{for(const i of[...t.attributes]){const a=i.name.toLowerCase();a.startsWith("on")||["href","srcset","action","formaction","xlink:href"].includes(a)||a==="src"&&!/^(?:data:|blob:)/i.test(i.value.trim())?t.removeAttribute(i.name):a==="style"&&t.setAttribute("style",i.value.replace(/url\(\s*(['"]?)(?!data:|blob:)[^)]+\)/gi,"none"))}})}async function _(){const n=++l;f.value=!0;try{const t=d.value;if(!t)return;t.replaceChildren(),Y(e.data);const{renderAsync:i}=await z(async()=>{const{renderAsync:p}=await import("./docx-preview-CVYtKeut.js");return{renderAsync:p}},__vite__mapDeps([0,1,2,3]));if(n!==l)return;const a=document.createElement("div");if(await i(e.data.slice(0),a,a,{className:"generated-docx",inWrapper:!0,breakPages:!0,ignoreLastRenderedPageBreak:!1,useBase64URL:!0}),n!==l)return;if(a.querySelectorAll("*").length>y)throw new Error("Document exceeds the render element limit");u(a);const m=document.createDocumentFragment();for(;a.firstChild;)m.appendChild(a.firstChild);t.replaceChildren(m)}catch(t){n===l&&r("error",t instanceof Error?t:new Error(String(t)))}finally{n===l&&(f.value=!1)}}return Z(()=>e.data,_),B(_),k(()=>{l+=1,d.value?.replaceChildren()}),(n,t)=>(F(),N(T(L),{show:f.value,class:"docx-stage"},{default:O(()=>[M("div",{ref_key:"container",ref:d,class:"docx-container"},null,512)]),_:1},8,["show"]))}})})),j=h((()=>{})),J,$=h((()=>{w(),w(),j(),X(),J=V(C,[["__scopeId","data-v-9d09b2c4"]])}));$();export{J as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.