// @bun
var{defineProperty:U,getOwnPropertyNames:B,getOwnPropertyDescriptor:C}=Object,L=Object.prototype.hasOwnProperty;function O(j){return this[j]}var E=(j)=>{var k=(X??=new WeakMap).get(j),q;if(k)return k;if(k=U({},"__esModule",{value:!0}),j&&typeof j==="object"||typeof j==="function"){for(var w of B(j))if(!L.call(k,w))U(k,w,{get:O.bind(j,w),enumerable:!(q=C(j,w))||q.enumerable})}return X.set(j,k),k},X;var T=(j)=>j;function _(j,k){this[j]=T.bind(null,k)}var z=(j,k)=>{for(var q in k)U(j,q,{get:k[q],enumerable:!0,configurable:!0,set:_.bind(k,q)})};var F=(j,k)=>()=>(j&&(k=j(j=0)),k);var S=import.meta.require;import M from"fs";import Q from"path";function R(j){let k=0;for(let q=0;q<j.length;q++){let w=j[q];k=(k<<5)-k+w,k=k&k}return Math.abs(k).toString(16).padStart(8,"0")}function I(j,k){let q=Q.basename(j);for(let w of k)if(w.startsWith("*.")){let H=w.slice(1);if(q.endsWith(H))return!0}else if(w.includes("*")){let H=new RegExp(`^${w.replace(/\*/g,".*")}$`);if(H.test(q)||H.test(j))return!0}else if(q===w||j.includes(w))return!0;return!1}function N(j,k,q){let w=Q.extname(j).toLowerCase(),H=G[w],K=(q.maxFileSizeKB||500)*1024;if(k>K)return!1;if(q.exclude&&I(j,q.exclude))return!1;if(q.include&&q.include.length>0){for(let J of q.include)if(J.startsWith("*.")){if(j.endsWith(J.slice(1)))return!0}else if(j.includes(J))return!0}if(H&&q[H]===!0)return!0;if(!H)return!1;return!1}function Y(j,k,q,w){let H=M.readdirSync(j,{withFileTypes:!0});for(let K of H){let J=Q.join(j,K.name);if(K.isDirectory()){if(["node_modules",".git",".stx"].includes(K.name))continue;Y(J,k,q,w)}else if(K.isFile()){let V=M.statSync(J),W=Q.relative(k,J);if(N(W,V.size,q)){let Z=M.readFileSync(J),$=R(Z),A=`/${W.replace(/\\/g,"/")}`;w.push({url:A,revision:$,size:V.size})}}}}function y(j,k){let q=k.pwa?.precache,w=[];if(!q?.enabled)return{entries:[],totalSize:0,fileCount:0};if(!M.existsSync(j))return{entries:[],totalSize:0,fileCount:0};Y(j,j,q,w),w.sort((K,J)=>K.url.localeCompare(J.url));let H=w.reduce((K,J)=>K+J.size,0);return{entries:w,totalSize:H,fileCount:w.length}}function b(j){if(j.entries.length===0)return"[]";return`[
${j.entries.map((q)=>`  { url: '${q.url}', revision: '${q.revision}' }`).join(`,
`)}
]`}function m(j){if(j<1024)return`${j} B`;if(j<1048576)return`${(j/1024).toFixed(1)} KB`;return`${(j/1048576).toFixed(2)} MB`}var G;var v=F(()=>{G={".html":"includeHtml",".htm":"includeHtml",".js":"includeJs",".mjs":"includeJs",".css":"includeCss",".png":"includeImages",".jpg":"includeImages",".jpeg":"includeImages",".gif":"includeImages",".webp":"includeImages",".svg":"includeImages",".ico":"includeImages",".woff":"includeFonts",".woff2":"includeFonts",".ttf":"includeFonts",".eot":"includeFonts",".otf":"includeFonts"}});v();export{b as generatePrecacheManifestJs,y as generatePrecacheManifest,m as formatSize};
