1import{c as g}from"./pdf-engine-DB2KmPOe.js";import"./index-DbFRh42P.js";import"./vendor-react-C_xdI0Ng.js";const b=async({inputIds:r,fs:i,options:s,emitProgress:o})=>{if(r.length===0)throw new Error("Delete Pages requires at least one input file");const p=await g(),u=(s==null?void 0:s.pages)||"",c=[],f=u.split(",").map(t=>t.trim());for(const t of f)if(t.includes("-")){const[e,n]=t.split("-").map(a=>parseInt(a.trim(),10));if(!isNaN(e)&&!isNaN(n))for(let a=Math.min(e,n);a<=Math.max(e,n);a++)c.push(a-1)}else{const e=parseInt(t,10);isNaN(e)||c.push(e-1)}const h=Array.from(new Set(c)),l=[];for(let t=0;t<r.length;t++){const n=await(await i.read(r[t])).getBlob(),a=await p.deletePages(n,h),w=await i.write(a);l.push(w.id);const d=Math.round((t+1)/r.length*100);o==null||o(d)}return{outputIds:l}};export{b as run};
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.