mdast2docx 1.5.0 → 1.6.0
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.
- package/dist/{chunk-CWUY2JLF.mjs → chunk-LO72SAXR.mjs} +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/plugins/index.mjs +1 -1
- package/dist/plugins/node/index.js +1 -1
- package/dist/plugins/node/index.mjs +1 -1
- package/dist/plugins/node/node-image.js +1 -1
- package/dist/plugins/node/node-image.mjs +1 -1
- package/package.json +55 -10
- package/dist/chunk-Q7NIFVCS.mjs +0 -1
|
@@ -9,7 +9,7 @@ Content-Type: ${l.type||"application/octet-stream"}\r
|
|
|
9
9
|
`,l,`\r
|
|
10
10
|
`)),a.push(`--${n}--`),new t(a,{type:"multipart/form-data; boundary="+n})}var Ir,Oc,Mc,Go,Wc,Vo,Di,It,Se,Qo,kt,Sn=Rr(()=>{"use strict";Tr();Fi();({toStringTag:Ir,iterator:Oc,hasInstance:Mc}=Symbol),Go=Math.random,Wc="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),Vo=(e,t,n)=>(e+="",/^(Blob|File)$/.test(t&&t[Ir])?[(n=n!==void 0?n+"":t[Ir]=="File"?t.name:"blob",e),t.name!==n||t[Ir]=="blob"?new Kt([t],n,t):t]:[e,t+""]),Di=(e,t)=>(t?e:e.replace(/\r?\n|\r/g,`\r
|
|
11
11
|
`)).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),It=(e,t,n)=>{if(t.length<n)throw new TypeError(`Failed to execute '${e}' on 'FormData': ${n} arguments required, but only ${t.length} present.`)},kt=(Qo=class{constructor(...t){Ce(this,Se,[]);if(t.length)throw new TypeError("Failed to construct 'FormData': parameter 1 is not of type 'HTMLFormElement'.")}get[Ir](){return"FormData"}[Oc](){return this.entries()}static[Mc](t){return t&&typeof t=="object"&&t[Ir]==="FormData"&&!Wc.some(n=>typeof t[n]!="function")}append(...t){It("append",arguments,2),J(this,Se).push(Vo(...t))}delete(t){It("delete",arguments,1),t+="",he(this,Se,J(this,Se).filter(([n])=>n!==t))}get(t){It("get",arguments,1),t+="";for(var n=J(this,Se),a=n.length,o=0;o<a;o++)if(n[o][0]===t)return n[o][1];return null}getAll(t,n){return It("getAll",arguments,1),n=[],t+="",J(this,Se).forEach(a=>a[0]===t&&n.push(a[1])),n}has(t){return It("has",arguments,1),t+="",J(this,Se).some(n=>n[0]===t)}forEach(t,n){It("forEach",arguments,1);for(var[a,o]of this)t.call(n,o,a,this)}set(...t){It("set",arguments,2);var n=[],a=!0;t=Vo(...t),J(this,Se).forEach(o=>{o[0]===t[0]?a&&(a=!n.push(t)):n.push(o)}),a&&n.push(t),he(this,Se,n)}*entries(){yield*J(this,Se)}*keys(){for(var[t]of this)yield t}*values(){for(var[,t]of this)yield t}},Se=new WeakMap,Qo)});var es=j((Yg,Zo)=>{"use strict";if(!globalThis.DOMException)try{let{MessageChannel:e}=require("worker_threads"),t=new e().port1,n=new ArrayBuffer;t.postMessage(n,[n,n])}catch(e){e.constructor.name==="DOMException"&&(globalThis.DOMException=e.constructor)}Zo.exports=globalThis.DOMException});var vn,zc,Uc,Kg,Oi=Rr(()=>{"use strict";vn=require("fs"),zc=require("path"),Uc=Ye(es(),1);Fi();Tr();({stat:Kg}=vn.promises)});var rs={};qo(rs,{toFormData:()=>Jc});function Xc(e){let t=e.match(/\bfilename=("(.*?)"|([^()<>@,;:\\"/[\]?={}\s\t]+))($|;\s)/i);if(!t)return;let n=t[2]||t[3]||"",a=n.slice(n.lastIndexOf("\\")+1);return a=a.replace(/%22/g,'"'),a=a.replace(/&#(\d{4});/g,(o,l)=>String.fromCharCode(l)),a}async function Jc(e,t){if(!/multipart/i.test(t))throw new TypeError("Failed to fetch");let n=t.match(/boundary=(?:"([^"]+)"|([^;]+))/i);if(!n)throw new TypeError("no or bad content-type header, no multipart boundary");let a=new Mi(n[1]||n[2]),o,l,f,h,d,g,w=[],T=new kt,k=F=>{f+=q.decode(F,{stream:!0})},W=F=>{w.push(F)},S=()=>{let F=new Kt(w,g,{type:d});T.append(h,F)},N=()=>{T.append(h,f)},q=new TextDecoder("utf-8");q.decode(),a.onPartBegin=function(){a.onPartData=k,a.onPartEnd=N,o="",l="",f="",h="",d="",g=null,w.length=0},a.onHeaderField=function(F){o+=q.decode(F,{stream:!0})},a.onHeaderValue=function(F){l+=q.decode(F,{stream:!0})},a.onHeaderEnd=function(){if(l+=q.decode(),o=o.toLowerCase(),o==="content-disposition"){let F=l.match(/\bname=("([^"]*)"|([^()<>@,;:\\"/[\]?={}\s\t]+))/i);F&&(h=F[2]||F[3]||""),g=Xc(l),g&&(a.onPartData=W,a.onPartEnd=S)}else o==="content-type"&&(d=l);l="",o=""};for await(let F of e)a.write(F);return a.end(),T}var Le,V,ts,bt,Rn,Pn,Hc,xr,Gc,Vc,Qc,Yc,xt,Mi,ns=Rr(()=>{"use strict";Oi();Sn();Le=0,V={START_BOUNDARY:Le++,HEADER_FIELD_START:Le++,HEADER_FIELD:Le++,HEADER_VALUE_START:Le++,HEADER_VALUE:Le++,HEADER_VALUE_ALMOST_DONE:Le++,HEADERS_ALMOST_DONE:Le++,PART_DATA_START:Le++,PART_DATA:Le++,END:Le++},ts=1,bt={PART_BOUNDARY:ts,LAST_BOUNDARY:ts*=2},Rn=10,Pn=13,Hc=32,xr=45,Gc=58,Vc=97,Qc=122,Yc=e=>e|32,xt=()=>{},Mi=class{constructor(t){this.index=0,this.flags=0,this.onHeaderEnd=xt,this.onHeaderField=xt,this.onHeadersEnd=xt,this.onHeaderValue=xt,this.onPartBegin=xt,this.onPartData=xt,this.onPartEnd=xt,this.boundaryChars={},t=`\r
|
|
12
|
-
--`+t;let n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a),this.boundaryChars[n[a]]=!0;this.boundary=n,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=V.START_BOUNDARY}write(t){let n=0,a=t.length,o=this.index,{lookbehind:l,boundary:f,boundaryChars:h,index:d,state:g,flags:w}=this,T=this.boundary.length,k=T-1,W=t.length,S,N,q=O=>{this[O+"Mark"]=n},F=O=>{delete this[O+"Mark"]},U=(O,M,Y,it)=>{(M===void 0||M!==Y)&&this[O](it&&it.subarray(M,Y))},te=(O,M)=>{let Y=O+"Mark";Y in this&&(M?(U(O,this[Y],n,t),delete this[Y]):(U(O,this[Y],t.length,t),this[Y]=0))};for(n=0;n<a;n++)switch(S=t[n],g){case V.START_BOUNDARY:if(d===f.length-2){if(S===xr)w|=bt.LAST_BOUNDARY;else if(S!==Pn)return;d++;break}else if(d-1===f.length-2){if(w&bt.LAST_BOUNDARY&&S===xr)g=V.END,w=0;else if(!(w&bt.LAST_BOUNDARY)&&S===Rn)d=0,U("onPartBegin"),g=V.HEADER_FIELD_START;else return;break}S!==f[d+2]&&(d=-2),S===f[d+2]&&d++;break;case V.HEADER_FIELD_START:g=V.HEADER_FIELD,q("onHeaderField"),d=0;case V.HEADER_FIELD:if(S===Pn){F("onHeaderField"),g=V.HEADERS_ALMOST_DONE;break}if(d++,S===xr)break;if(S===Gc){if(d===1)return;te("onHeaderField",!0),g=V.HEADER_VALUE_START;break}if(N=Yc(S),N<Vc||N>Qc)return;break;case V.HEADER_VALUE_START:if(S===Hc)break;q("onHeaderValue"),g=V.HEADER_VALUE;case V.HEADER_VALUE:S===Pn&&(te("onHeaderValue",!0),U("onHeaderEnd"),g=V.HEADER_VALUE_ALMOST_DONE);break;case V.HEADER_VALUE_ALMOST_DONE:if(S!==Rn)return;g=V.HEADER_FIELD_START;break;case V.HEADERS_ALMOST_DONE:if(S!==Rn)return;U("onHeadersEnd"),g=V.PART_DATA_START;break;case V.PART_DATA_START:g=V.PART_DATA,q("onPartData");case V.PART_DATA:if(o=d,d===0){for(n+=k;n<W&&!(t[n]in h);)n+=T;n-=k,S=t[n]}if(d<f.length)f[d]===S?(d===0&&te("onPartData",!0),d++):d=0;else if(d===f.length)d++,S===Pn?w|=bt.PART_BOUNDARY:S===xr?w|=bt.LAST_BOUNDARY:d=0;else if(d-1===f.length)if(w&bt.PART_BOUNDARY){if(d=0,S===Rn){w&=~bt.PART_BOUNDARY,U("onPartEnd"),U("onPartBegin"),g=V.HEADER_FIELD_START;break}}else w&bt.LAST_BOUNDARY&&S===xr?(U("onPartEnd"),g=V.END,w=0):d=0;if(d>0)l[d-1]=S;else if(o>0){let O=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);U("onPartData",0,o,O),o=0,q("onPartData"),n--}break;case V.END:break;default:throw new Error(`Unexpected state entered: ${g}`)}te("onHeaderField"),te("onHeaderValue"),te("onPartData"),this.index=d,this.state=g,this.flags=w}end(){if(this.state===V.HEADER_FIELD_START&&this.index===0||this.state===V.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==V.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});var Be=j((Wp,Ss)=>{"use strict";var Es=function(e){return typeof e!="undefined"&&e!==null},ad=function(e){return typeof e=="object"},od=function(e){return Object.prototype.toString.call(e)==="[object Object]"},sd=function(e){return typeof e=="function"},ld=function(e){return typeof e=="boolean"},ud=function(e){return e instanceof Buffer},fd=function(e){if(Es(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},cd=function(e){return e instanceof ArrayBuffer},dd=function(e){return typeof e=="string"&&e.length>0},hd=function(e){return typeof e=="number"&&!Number.isNaN(e)},md=function(e){return Number.isInteger(e)},bd=function(e,t,n){return e>=t&&e<=n},gd=function(e,t){return t.includes(e)},pd=function(e,t,n){return new Error(`Expected ${t} for ${e} but received ${n} of type ${typeof n}`)},yd=function(e,t){return t.message=e.message,t};Ss.exports={defined:Es,object:ad,plainObject:od,fn:sd,bool:ld,buffer:ud,typedArray:fd,arrayBuffer:cd,string:dd,number:hd,integer:md,inRange:bd,inArray:gd,invalidParameterError:pd,nativeError:yd}});var Rs=j((zp,vs)=>{"use strict";var _s=()=>process.platform==="linux",xn=null,wd=()=>{if(!xn)if(_s()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,xn=process.report.getReport(),process.report.excludeNetwork=e}else xn={};return xn};vs.exports={isLinux:_s,getReport:wd}});var Ts=j((Up,Ps)=>{"use strict";var tr=require("fs"),Ed="/usr/bin/ldd",Sd="/proc/self/exe",Ln=2048,_d=e=>{let t=tr.openSync(e,"r"),n=Buffer.alloc(Ln),a=tr.readSync(t,n,0,Ln,0);return tr.close(t),n.subarray(0,a)},vd=e=>new Promise((t,n)=>{tr.open(e,"r",(a,o)=>{if(a)n(a);else{let l=Buffer.alloc(Ln);tr.read(o,l,0,Ln,0,(f,h)=>{t(l.subarray(0,h)),tr.close(o)})}})});Ps.exports={LDD_PATH:Ed,SELF_PATH:Sd,readFileSync:_d,readFile:vd}});var Cs=j((Hp,As)=>{"use strict";var Rd=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),n=e.readUInt16LE(54),a=e.readUInt16LE(56);for(let o=0;o<a;o++){let l=t+o*n;if(e.readUInt32LE(l)===3){let h=e.readUInt32LE(l+8),d=e.readUInt32LE(l+32);return e.subarray(h,h+d).toString().replace(/\0.*$/g,"")}}return null};As.exports={interpreterPath:Rd}});var Bn=j((Gp,Gs)=>{"use strict";var ks=require("child_process"),{isLinux:rr,getReport:xs}=Rs(),{LDD_PATH:jn,SELF_PATH:Ls,readFile:Hi,readFileSync:Gi}=Ts(),{interpreterPath:js}=Cs(),$e,qe,Fe,Bs="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",gt="",$s=()=>gt||new Promise(e=>{ks.exec(Bs,(t,n)=>{gt=t?" ":n,e(gt)})}),qs=()=>{if(!gt)try{gt=ks.execSync(Bs,{encoding:"utf8"})}catch{gt=" "}return gt},et="glibc",Fs=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Bt="musl",Pd=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),Ds=()=>{let e=xs();return e.header&&e.header.glibcVersionRuntime?et:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(Pd)?Bt:null},Ns=e=>{let[t,n]=e.split(/[\r\n]+/);return t&&t.includes(et)?et:n&&n.includes(Bt)?Bt:null},Os=e=>{if(e){if(e.includes("/ld-musl-"))return Bt;if(e.includes("/ld-linux-"))return et}return null},Ms=e=>(e=e.toString(),e.includes("musl")?Bt:e.includes("GNU C Library")?et:null),Td=async()=>{if(qe!==void 0)return qe;qe=null;try{let e=await Hi(jn);qe=Ms(e)}catch{}return qe},Ad=()=>{if(qe!==void 0)return qe;qe=null;try{let e=Gi(jn);qe=Ms(e)}catch{}return qe},Cd=async()=>{if($e!==void 0)return $e;$e=null;try{let e=await Hi(Ls),t=js(e);$e=Os(t)}catch{}return $e},Id=()=>{if($e!==void 0)return $e;$e=null;try{let e=Gi(Ls),t=js(e);$e=Os(t)}catch{}return $e},Ws=async()=>{let e=null;if(rr()&&(e=await Cd(),!e&&(e=await Td(),e||(e=Ds()),!e))){let t=await $s();e=Ns(t)}return e},zs=()=>{let e=null;if(rr()&&(e=Id(),!e&&(e=Ad(),e||(e=Ds()),!e))){let t=qs();e=Ns(t)}return e},kd=async()=>rr()&&await Ws()!==et,xd=()=>rr()&&zs()!==et,Ld=async()=>{if(Fe!==void 0)return Fe;Fe=null;try{let t=(await Hi(jn)).match(Fs);t&&(Fe=t[1])}catch{}return Fe},jd=()=>{if(Fe!==void 0)return Fe;Fe=null;try{let t=Gi(jn).match(Fs);t&&(Fe=t[1])}catch{}return Fe},Us=()=>{let e=xs();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},Is=e=>e.trim().split(/\s+/)[1],Hs=e=>{let[t,n,a]=e.split(/[\r\n]+/);return t&&t.includes(et)?Is(t):n&&a&&n.includes(Bt)?Is(a):null},Bd=async()=>{let e=null;if(rr()&&(e=await Ld(),e||(e=Us()),!e)){let t=await $s();e=Hs(t)}return e},$d=()=>{let e=null;if(rr()&&(e=jd(),e||(e=Us()),!e)){let t=qs();e=Hs(t)}return e};Gs.exports={GLIBC:et,MUSL:Bt,family:Ws,familySync:zs,isNonGlibcLinux:kd,isNonGlibcLinuxSync:xd,version:Bd,versionSync:$d}});var $r=j((Vp,Vs)=>{"use strict";var qd=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Vs.exports=qd});var $n=j((Qp,Qs)=>{"use strict";var Fd="2.0.0",Dd=Number.MAX_SAFE_INTEGER||9007199254740991,Nd=16,Od=250,Md=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Qs.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Nd,MAX_SAFE_BUILD_LENGTH:Od,MAX_SAFE_INTEGER:Dd,RELEASE_TYPES:Md,SEMVER_SPEC_VERSION:Fd,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var qr=j((De,Ys)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Vi,MAX_SAFE_BUILD_LENGTH:Wd,MAX_LENGTH:zd}=$n(),Ud=$r();De=Ys.exports={};var Hd=De.re=[],Gd=De.safeRe=[],R=De.src=[],Vd=De.safeSrc=[],P=De.t={},Qd=0,Qi="[a-zA-Z0-9-]",Yd=[["\\s",1],["\\d",zd],[Qi,Wd]],Xd=e=>{for(let[t,n]of Yd)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},B=(e,t,n)=>{let a=Xd(t),o=Qd++;Ud(e,o,t),P[e]=o,R[o]=t,Vd[o]=a,Hd[o]=new RegExp(t,n?"g":void 0),Gd[o]=new RegExp(a,n?"g":void 0)};B("NUMERICIDENTIFIER","0|[1-9]\\d*");B("NUMERICIDENTIFIERLOOSE","\\d+");B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Qi}*`);B("MAINVERSION",`(${R[P.NUMERICIDENTIFIER]})\\.(${R[P.NUMERICIDENTIFIER]})\\.(${R[P.NUMERICIDENTIFIER]})`);B("MAINVERSIONLOOSE",`(${R[P.NUMERICIDENTIFIERLOOSE]})\\.(${R[P.NUMERICIDENTIFIERLOOSE]})\\.(${R[P.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASEIDENTIFIER",`(?:${R[P.NONNUMERICIDENTIFIER]}|${R[P.NUMERICIDENTIFIER]})`);B("PRERELEASEIDENTIFIERLOOSE",`(?:${R[P.NONNUMERICIDENTIFIER]}|${R[P.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASE",`(?:-(${R[P.PRERELEASEIDENTIFIER]}(?:\\.${R[P.PRERELEASEIDENTIFIER]})*))`);B("PRERELEASELOOSE",`(?:-?(${R[P.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${R[P.PRERELEASEIDENTIFIERLOOSE]})*))`);B("BUILDIDENTIFIER",`${Qi}+`);B("BUILD",`(?:\\+(${R[P.BUILDIDENTIFIER]}(?:\\.${R[P.BUILDIDENTIFIER]})*))`);B("FULLPLAIN",`v?${R[P.MAINVERSION]}${R[P.PRERELEASE]}?${R[P.BUILD]}?`);B("FULL",`^${R[P.FULLPLAIN]}$`);B("LOOSEPLAIN",`[v=\\s]*${R[P.MAINVERSIONLOOSE]}${R[P.PRERELEASELOOSE]}?${R[P.BUILD]}?`);B("LOOSE",`^${R[P.LOOSEPLAIN]}$`);B("GTLT","((?:<|>)?=?)");B("XRANGEIDENTIFIERLOOSE",`${R[P.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);B("XRANGEIDENTIFIER",`${R[P.NUMERICIDENTIFIER]}|x|X|\\*`);B("XRANGEPLAIN",`[v=\\s]*(${R[P.XRANGEIDENTIFIER]})(?:\\.(${R[P.XRANGEIDENTIFIER]})(?:\\.(${R[P.XRANGEIDENTIFIER]})(?:${R[P.PRERELEASE]})?${R[P.BUILD]}?)?)?`);B("XRANGEPLAINLOOSE",`[v=\\s]*(${R[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[P.XRANGEIDENTIFIERLOOSE]})(?:${R[P.PRERELEASELOOSE]})?${R[P.BUILD]}?)?)?`);B("XRANGE",`^${R[P.GTLT]}\\s*${R[P.XRANGEPLAIN]}$`);B("XRANGELOOSE",`^${R[P.GTLT]}\\s*${R[P.XRANGEPLAINLOOSE]}$`);B("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Vi}})(?:\\.(\\d{1,${Vi}}))?(?:\\.(\\d{1,${Vi}}))?`);B("COERCE",`${R[P.COERCEPLAIN]}(?:$|[^\\d])`);B("COERCEFULL",R[P.COERCEPLAIN]+`(?:${R[P.PRERELEASE]})?(?:${R[P.BUILD]})?(?:$|[^\\d])`);B("COERCERTL",R[P.COERCE],!0);B("COERCERTLFULL",R[P.COERCEFULL],!0);B("LONETILDE","(?:~>?)");B("TILDETRIM",`(\\s*)${R[P.LONETILDE]}\\s+`,!0);De.tildeTrimReplace="$1~";B("TILDE",`^${R[P.LONETILDE]}${R[P.XRANGEPLAIN]}$`);B("TILDELOOSE",`^${R[P.LONETILDE]}${R[P.XRANGEPLAINLOOSE]}$`);B("LONECARET","(?:\\^)");B("CARETTRIM",`(\\s*)${R[P.LONECARET]}\\s+`,!0);De.caretTrimReplace="$1^";B("CARET",`^${R[P.LONECARET]}${R[P.XRANGEPLAIN]}$`);B("CARETLOOSE",`^${R[P.LONECARET]}${R[P.XRANGEPLAINLOOSE]}$`);B("COMPARATORLOOSE",`^${R[P.GTLT]}\\s*(${R[P.LOOSEPLAIN]})$|^$`);B("COMPARATOR",`^${R[P.GTLT]}\\s*(${R[P.FULLPLAIN]})$|^$`);B("COMPARATORTRIM",`(\\s*)${R[P.GTLT]}\\s*(${R[P.LOOSEPLAIN]}|${R[P.XRANGEPLAIN]})`,!0);De.comparatorTrimReplace="$1$2$3";B("HYPHENRANGE",`^\\s*(${R[P.XRANGEPLAIN]})\\s+-\\s+(${R[P.XRANGEPLAIN]})\\s*$`);B("HYPHENRANGELOOSE",`^\\s*(${R[P.XRANGEPLAINLOOSE]})\\s+-\\s+(${R[P.XRANGEPLAINLOOSE]})\\s*$`);B("STAR","(<|>)?=?\\s*\\*");B("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");B("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var qn=j((Yp,Xs)=>{"use strict";var Jd=Object.freeze({loose:!0}),Kd=Object.freeze({}),Zd=e=>e?typeof e!="object"?Jd:e:Kd;Xs.exports=Zd});var el=j((Xp,Zs)=>{"use strict";var Js=/^[0-9]+$/,Ks=(e,t)=>{let n=Js.test(e),a=Js.test(t);return n&&a&&(e=+e,t=+t),e===t?0:n&&!a?-1:a&&!n?1:e<t?-1:1},eh=(e,t)=>Ks(t,e);Zs.exports={compareIdentifiers:Ks,rcompareIdentifiers:eh}});var ir=j((Jp,rl)=>{"use strict";var Fn=$r(),{MAX_LENGTH:tl,MAX_SAFE_INTEGER:Dn}=$n(),{safeRe:Nn,t:On}=qr(),th=qn(),{compareIdentifiers:nr}=el(),Yi=class e{constructor(t,n){if(n=th(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>tl)throw new TypeError(`version is longer than ${tl} characters`);Fn("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let a=t.trim().match(n.loose?Nn[On.LOOSE]:Nn[On.FULL]);if(!a)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>Dn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Dn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Dn||this.patch<0)throw new TypeError("Invalid patch version");a[4]?this.prerelease=a[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let l=+o;if(l>=0&&l<Dn)return l}return o}):this.prerelease=[],this.build=a[5]?a[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Fn("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),nr(this.major,t.major)||nr(this.minor,t.minor)||nr(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let a=this.prerelease[n],o=t.prerelease[n];if(Fn("prerelease compare",n,a,o),a===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(a===void 0)return-1;if(a===o)continue;return nr(a,o)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let a=this.build[n],o=t.build[n];if(Fn("build compare",n,a,o),a===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(a===void 0)return-1;if(a===o)continue;return nr(a,o)}while(++n)}inc(t,n,a){if(t.startsWith("pre")){if(!n&&a===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let o=`-${n}`.match(this.options.loose?Nn[On.PRERELEASELOOSE]:Nn[On.PRERELEASE]);if(!o||o[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,a);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,a);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,a),this.inc("pre",n,a);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,a),this.inc("pre",n,a);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(a)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let l=this.prerelease.length;for(;--l>=0;)typeof this.prerelease[l]=="number"&&(this.prerelease[l]++,l=-2);if(l===-1){if(n===this.prerelease.join(".")&&a===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(n){let l=[n,o];a===!1&&(l=[n]),nr(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=l):this.prerelease=l}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};rl.exports=Yi});var al=j((Kp,il)=>{"use strict";var nl=ir(),rh=(e,t,n=!1)=>{if(e instanceof nl)return e;try{return new nl(e,t)}catch(a){if(!n)return null;throw a}};il.exports=rh});var sl=j((Zp,ol)=>{"use strict";var nh=ir(),ih=al(),{safeRe:Mn,t:Wn}=qr(),ah=(e,t)=>{if(e instanceof nh)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?Mn[Wn.COERCEFULL]:Mn[Wn.COERCE]);else{let d=t.includePrerelease?Mn[Wn.COERCERTLFULL]:Mn[Wn.COERCERTL],g;for(;(g=d.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||g.index+g[0].length!==n.index+n[0].length)&&(n=g),d.lastIndex=g.index+g[1].length+g[2].length;d.lastIndex=-1}if(n===null)return null;let a=n[2],o=n[3]||"0",l=n[4]||"0",f=t.includePrerelease&&n[5]?`-${n[5]}`:"",h=t.includePrerelease&&n[6]?`+${n[6]}`:"";return ih(`${a}.${o}.${l}${f}${h}`,t)};ol.exports=ah});var $t=j((e0,ul)=>{"use strict";var ll=ir(),oh=(e,t,n)=>new ll(e,n).compare(new ll(t,n));ul.exports=oh});var Xi=j((t0,fl)=>{"use strict";var sh=$t(),lh=(e,t,n)=>sh(e,t,n)>=0;fl.exports=lh});var dl=j((r0,cl)=>{"use strict";var Ji=class{constructor(){this.max=1e3,this.map=new Map}get(t){let n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(t,n)}return this}};cl.exports=Ji});var ml=j((n0,hl)=>{"use strict";var uh=$t(),fh=(e,t,n)=>uh(e,t,n)===0;hl.exports=fh});var gl=j((i0,bl)=>{"use strict";var ch=$t(),dh=(e,t,n)=>ch(e,t,n)!==0;bl.exports=dh});var yl=j((a0,pl)=>{"use strict";var hh=$t(),mh=(e,t,n)=>hh(e,t,n)>0;pl.exports=mh});var El=j((o0,wl)=>{"use strict";var bh=$t(),gh=(e,t,n)=>bh(e,t,n)<0;wl.exports=gh});var _l=j((s0,Sl)=>{"use strict";var ph=$t(),yh=(e,t,n)=>ph(e,t,n)<=0;Sl.exports=yh});var Rl=j((l0,vl)=>{"use strict";var wh=ml(),Eh=gl(),Sh=yl(),_h=Xi(),vh=El(),Rh=_l(),Ph=(e,t,n,a)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return wh(e,n,a);case"!=":return Eh(e,n,a);case">":return Sh(e,n,a);case">=":return _h(e,n,a);case"<":return vh(e,n,a);case"<=":return Rh(e,n,a);default:throw new TypeError(`Invalid operator: ${t}`)}};vl.exports=Ph});var xl=j((u0,kl)=>{"use strict";var Fr=Symbol("SemVer ANY"),ea=class e{static get ANY(){return Fr}constructor(t,n){if(n=Pl(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),Zi("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===Fr?this.value="":this.value=this.operator+this.semver.version,Zi("comp",this)}parse(t){let n=this.options.loose?Tl[Al.COMPARATORLOOSE]:Tl[Al.COMPARATOR],a=t.match(n);if(!a)throw new TypeError(`Invalid comparator: ${t}`);this.operator=a[1]!==void 0?a[1]:"",this.operator==="="&&(this.operator=""),a[2]?this.semver=new Cl(a[2],this.options.loose):this.semver=Fr}toString(){return this.value}test(t){if(Zi("Comparator.test",t,this.options.loose),this.semver===Fr||t===Fr)return!0;if(typeof t=="string")try{t=new Cl(t,this.options)}catch{return!1}return Ki(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Il(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new Il(this.value,n).test(t.semver):(n=Pl(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||Ki(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Ki(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};kl.exports=ea;var Pl=qn(),{safeRe:Tl,t:Al}=qr(),Ki=Rl(),Zi=$r(),Cl=ir(),Il=ta()});var ta=j((f0,$l)=>{"use strict";var Th=/\s+/g,ra=class e{constructor(t,n){if(n=Ch(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof na)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(Th," "),this.set=this.raw.split("||").map(a=>this.parseRange(a.trim())).filter(a=>a.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let a=this.set[0];if(this.set=this.set.filter(o=>!jl(o[0])),this.set.length===0)this.set=[a];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&$h(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let n=this.set[t];for(let a=0;a<n.length;a++)a>0&&(this.formatted+=" "),this.formatted+=n[a].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let a=((this.options.includePrerelease&&jh)|(this.options.loose&&Bh))+":"+t,o=Ll.get(a);if(o)return o;let l=this.options.loose,f=l?fe[ie.HYPHENRANGELOOSE]:fe[ie.HYPHENRANGE];t=t.replace(f,Hh(this.options.includePrerelease)),Q("hyphen replace",t),t=t.replace(fe[ie.COMPARATORTRIM],kh),Q("comparator trim",t),t=t.replace(fe[ie.TILDETRIM],xh),Q("tilde trim",t),t=t.replace(fe[ie.CARETTRIM],Lh),Q("caret trim",t);let h=t.split(" ").map(T=>qh(T,this.options)).join(" ").split(/\s+/).map(T=>Uh(T,this.options));l&&(h=h.filter(T=>(Q("loose invalid filter",T,this.options),!!T.match(fe[ie.COMPARATORLOOSE])))),Q("range list",h);let d=new Map,g=h.map(T=>new na(T,this.options));for(let T of g){if(jl(T))return[T];d.set(T.value,T)}d.size>1&&d.has("")&&d.delete("");let w=[...d.values()];return Ll.set(a,w),w}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(a=>Bl(a,n)&&t.set.some(o=>Bl(o,n)&&a.every(l=>o.every(f=>l.intersects(f,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Ih(t,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(Gh(this.set[n],t,this.options))return!0;return!1}};$l.exports=ra;var Ah=dl(),Ll=new Ah,Ch=qn(),na=xl(),Q=$r(),Ih=ir(),{safeRe:fe,t:ie,comparatorTrimReplace:kh,tildeTrimReplace:xh,caretTrimReplace:Lh}=qr(),{FLAG_INCLUDE_PRERELEASE:jh,FLAG_LOOSE:Bh}=$n(),jl=e=>e.value==="<0.0.0-0",$h=e=>e.value==="",Bl=(e,t)=>{let n=!0,a=e.slice(),o=a.pop();for(;n&&a.length;)n=a.every(l=>o.intersects(l,t)),o=a.pop();return n},qh=(e,t)=>(Q("comp",e,t),e=Nh(e,t),Q("caret",e),e=Fh(e,t),Q("tildes",e),e=Mh(e,t),Q("xrange",e),e=zh(e,t),Q("stars",e),e),ae=e=>!e||e.toLowerCase()==="x"||e==="*",Fh=(e,t)=>e.trim().split(/\s+/).map(n=>Dh(n,t)).join(" "),Dh=(e,t)=>{let n=t.loose?fe[ie.TILDELOOSE]:fe[ie.TILDE];return e.replace(n,(a,o,l,f,h)=>{Q("tilde",e,a,o,l,f,h);let d;return ae(o)?d="":ae(l)?d=`>=${o}.0.0 <${+o+1}.0.0-0`:ae(f)?d=`>=${o}.${l}.0 <${o}.${+l+1}.0-0`:h?(Q("replaceTilde pr",h),d=`>=${o}.${l}.${f}-${h} <${o}.${+l+1}.0-0`):d=`>=${o}.${l}.${f} <${o}.${+l+1}.0-0`,Q("tilde return",d),d})},Nh=(e,t)=>e.trim().split(/\s+/).map(n=>Oh(n,t)).join(" "),Oh=(e,t)=>{Q("caret",e,t);let n=t.loose?fe[ie.CARETLOOSE]:fe[ie.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,(o,l,f,h,d)=>{Q("caret",e,o,l,f,h,d);let g;return ae(l)?g="":ae(f)?g=`>=${l}.0.0${a} <${+l+1}.0.0-0`:ae(h)?l==="0"?g=`>=${l}.${f}.0${a} <${l}.${+f+1}.0-0`:g=`>=${l}.${f}.0${a} <${+l+1}.0.0-0`:d?(Q("replaceCaret pr",d),l==="0"?f==="0"?g=`>=${l}.${f}.${h}-${d} <${l}.${f}.${+h+1}-0`:g=`>=${l}.${f}.${h}-${d} <${l}.${+f+1}.0-0`:g=`>=${l}.${f}.${h}-${d} <${+l+1}.0.0-0`):(Q("no pr"),l==="0"?f==="0"?g=`>=${l}.${f}.${h}${a} <${l}.${f}.${+h+1}-0`:g=`>=${l}.${f}.${h}${a} <${l}.${+f+1}.0-0`:g=`>=${l}.${f}.${h} <${+l+1}.0.0-0`),Q("caret return",g),g})},Mh=(e,t)=>(Q("replaceXRanges",e,t),e.split(/\s+/).map(n=>Wh(n,t)).join(" ")),Wh=(e,t)=>{e=e.trim();let n=t.loose?fe[ie.XRANGELOOSE]:fe[ie.XRANGE];return e.replace(n,(a,o,l,f,h,d)=>{Q("xRange",e,a,o,l,f,h,d);let g=ae(l),w=g||ae(f),T=w||ae(h),k=T;return o==="="&&k&&(o=""),d=t.includePrerelease?"-0":"",g?o===">"||o==="<"?a="<0.0.0-0":a="*":o&&k?(w&&(f=0),h=0,o===">"?(o=">=",w?(l=+l+1,f=0,h=0):(f=+f+1,h=0)):o==="<="&&(o="<",w?l=+l+1:f=+f+1),o==="<"&&(d="-0"),a=`${o+l}.${f}.${h}${d}`):w?a=`>=${l}.0.0${d} <${+l+1}.0.0-0`:T&&(a=`>=${l}.${f}.0${d} <${l}.${+f+1}.0-0`),Q("xRange return",a),a})},zh=(e,t)=>(Q("replaceStars",e,t),e.trim().replace(fe[ie.STAR],"")),Uh=(e,t)=>(Q("replaceGTE0",e,t),e.trim().replace(fe[t.includePrerelease?ie.GTE0PRE:ie.GTE0],"")),Hh=e=>(t,n,a,o,l,f,h,d,g,w,T,k)=>(ae(a)?n="":ae(o)?n=`>=${a}.0.0${e?"-0":""}`:ae(l)?n=`>=${a}.${o}.0${e?"-0":""}`:f?n=`>=${n}`:n=`>=${n}${e?"-0":""}`,ae(g)?d="":ae(w)?d=`<${+g+1}.0.0-0`:ae(T)?d=`<${g}.${+w+1}.0-0`:k?d=`<=${g}.${w}.${T}-${k}`:e?d=`<${g}.${w}.${+T+1}-0`:d=`<=${d}`,`${n} ${d}`.trim()),Gh=(e,t,n)=>{for(let a=0;a<e.length;a++)if(!e[a].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let a=0;a<e.length;a++)if(Q(e[a].semver),e[a].semver!==na.ANY&&e[a].semver.prerelease.length>0){let o=e[a].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}});var Fl=j((c0,ql)=>{"use strict";var Vh=ta(),Qh=(e,t,n)=>{try{t=new Vh(t,n)}catch{return!1}return t.test(e)};ql.exports=Qh});var ia=j((d0,Yh)=>{Yh.exports={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.34.4",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unneb\xE4ck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix B\xFCnemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","J\xE9r\xE9my Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kot\u011B\u0161ovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouci\xF1o <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.Br>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugu\xE9 <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <Br@rreverser.com>","Don Denton <don@happycollision.com>"],scripts:{install:"node install/check.js",clean:"rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",test:"npm run test-lint && npm run test-unit && npm run test-licensing && npm run test-types","test-lint":"semistandard && cpplint","test-unit":"nyc --reporter=lcov --reporter=text --check-coverage --branches=100 mocha","test-licensing":'license-checker --production --summary --onlyAllow="Apache-2.0;BSD;ISC;LGPL-3.0-or-later;MIT"',"test-leak":"./test/leak/leak.sh","test-types":"tsd","package-from-local-build":"node npm/from-local-build.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",main:"lib/index.js",types:"lib/index.d.ts",files:["install","lib","src/*.{cc,h,gyp}"],repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.0.0","detect-libc":"^2.1.0",semver:"^7.7.2"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.34.4","@img/sharp-darwin-x64":"0.34.4","@img/sharp-libvips-darwin-arm64":"1.2.3","@img/sharp-libvips-darwin-x64":"1.2.3","@img/sharp-libvips-linux-arm":"1.2.3","@img/sharp-libvips-linux-arm64":"1.2.3","@img/sharp-libvips-linux-ppc64":"1.2.3","@img/sharp-libvips-linux-s390x":"1.2.3","@img/sharp-libvips-linux-x64":"1.2.3","@img/sharp-libvips-linuxmusl-arm64":"1.2.3","@img/sharp-libvips-linuxmusl-x64":"1.2.3","@img/sharp-linux-arm":"0.34.4","@img/sharp-linux-arm64":"0.34.4","@img/sharp-linux-ppc64":"0.34.4","@img/sharp-linux-s390x":"0.34.4","@img/sharp-linux-x64":"0.34.4","@img/sharp-linuxmusl-arm64":"0.34.4","@img/sharp-linuxmusl-x64":"0.34.4","@img/sharp-wasm32":"0.34.4","@img/sharp-win32-arm64":"0.34.4","@img/sharp-win32-ia32":"0.34.4","@img/sharp-win32-x64":"0.34.4"},devDependencies:{"@emnapi/runtime":"^1.5.0","@img/sharp-libvips-dev":"1.2.3","@img/sharp-libvips-dev-wasm32":"1.2.3","@img/sharp-libvips-win32-arm64":"1.2.3","@img/sharp-libvips-win32-ia32":"1.2.3","@img/sharp-libvips-win32-x64":"1.2.3","@types/node":"*",cc:"^3.0.1",emnapi:"^1.5.0","exif-reader":"^2.0.2","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^9.1.2","license-checker":"^25.0.1",mocha:"^11.7.2","node-addon-api":"^8.5.0","node-gyp":"^11.4.2",nyc:"^17.1.0",semistandard:"^17.0.0","tar-fs":"^3.1.1",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.17.2"},funding:{url:"https://opencollective.com/libvips"},semistandard:{env:["mocha"]},cc:{linelength:"120",filter:["build/include"]},nyc:{include:["lib"]},tsd:{directory:"test/types/"}}});var oa=j((h0,Vl)=>{"use strict";var{spawnSync:zn}=require("child_process"),{createHash:Xh}=require("crypto"),Ml=sl(),Jh=Xi(),Kh=Fl(),Dl=Bn(),{config:Zh,engines:Nl,optionalDependencies:em}=ia(),tm=process.env.npm_package_config_libvips||Zh.libvips,Wl=Ml(tm).version,rm=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-ppc64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],Un={encoding:"utf8",shell:!0},nm=e=>{e instanceof Error?console.error(`sharp: Installation error: ${e.message}`):console.log(`sharp: ${e}`)},zl=()=>Dl.isNonGlibcLinuxSync()?Dl.familySync():"",im=()=>`${process.platform}${zl()}-${process.arch}`,ar=()=>{if(Ul())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:n}=process.env,a=typeof n=="string"?n:zl();return`${t||process.platform}${a}-${e||process.arch}`},am=()=>{try{return require(`@img/sharp-libvips-dev-${ar()}/include`)}catch{try{return require("@img/sharp-libvips-dev/include")}catch{}}return""},om=()=>{try{return require("@img/sharp-libvips-dev/cplusplus")}catch{}return""},sm=()=>{try{return require(`@img/sharp-libvips-dev-${ar()}/lib`)}catch{try{return require(`@img/sharp-libvips-${ar()}/lib`)}catch{}}return""},lm=()=>{var e;if(((e=process.release)==null?void 0:e.name)==="node"&&process.versions&&!Kh(process.versions.node,Nl.node))return{found:process.versions.node,expected:Nl.node}},Ul=()=>{let{CC:e}=process.env;return!!(e&&e.endsWith("/emcc"))},um=()=>process.platform==="darwin"&&process.arch==="x64"?(zn("sysctl sysctl.proc_translated",Un).stdout||"").trim()==="sysctl.proc_translated: 1":!1,Ol=e=>Xh("sha512").update(e).digest("hex"),fm=()=>{try{let e=Ol(`imgsharp-libvips-${ar()}`),t=Ml(em[`@img/sharp-libvips-${ar()}`],{includePrerelease:!0}).version;return Ol(`${e}npm:${t}`).slice(0,10)}catch{}return""},cm=()=>zn(`node-gyp rebuild --directory=src ${Ul()?"--nodedir=emscripten":""}`,{...Un,stdio:"inherit"}).status,Hl=()=>process.platform!=="win32"?(zn("pkg-config --modversion vips-cpp",{...Un,env:{...process.env,PKG_CONFIG_PATH:Gl()}}).stdout||"").trim():"",Gl=()=>process.platform!=="win32"?[(zn('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',Un).stdout||"").trim(),process.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":"):"",aa=(e,t,n)=>(n&&n(`Detected ${t}, skipping search for globally-installed libvips`),e),dm=e=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return aa(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return aa(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(um())return aa(!1,"Rosetta",e);let t=Hl();return!!t&&Jh(t,Wl)};Vl.exports={minimumLibvipsVersion:Wl,prebuiltPlatforms:rm,buildPlatformArch:ar,buildSharpLibvipsIncludeDir:am,buildSharpLibvipsCPlusPlusDir:om,buildSharpLibvipsLibDir:sm,isUnsupportedNodeRuntime:lm,runtimePlatformArch:im,log:nm,yarnLocator:fm,spawnRebuild:cm,globalLibvipsVersion:Hl,pkgConfigPath:Gl,useGlobalLibvips:dm}});var Nr=j((m0,Yl)=>{"use strict";var{familySync:hm,versionSync:mm}=Bn(),{runtimePlatformArch:bm,isUnsupportedNodeRuntime:Ql,prebuiltPlatforms:gm,minimumLibvipsVersion:pm}=oa(),qt=bm(),ym=[`../src/build/Release/sharp-${qt}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${qt}/sharp.node`,"@img/sharp-wasm32/sharp.node"],sa,or,Dr=[];for(sa of ym)try{or=require(sa);break}catch(e){Dr.push(e)}if(or&&sa.startsWith("@img/sharp-linux-x64")&&!or._isUsingX64V2()){let e=new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");e.code="Unsupported CPU",Dr.push(e),or=null}if(or)Yl.exports=or;else{let[e,t,n]=["linux","darwin","win32"].map(l=>qt.startsWith(l)),a=[`Could not load the "sharp" module using the ${qt} runtime`];Dr.forEach(l=>{l.code!=="MODULE_NOT_FOUND"&&a.push(`${l.code}: ${l.message}`)});let o=Dr.map(l=>l.message).join(" ");if(a.push("Possible solutions:"),Ql()){let{found:l,expected:f}=Ql();a.push("- Please upgrade Node.js:",` Found ${l}`,` Requires ${f}`)}else if(gm.includes(qt)){let[l,f]=qt.split("-"),h=l.endsWith("musl")?" --libc=musl":"";a.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${l.replace("musl","")}${h} --cpu=${f} sharp`)}else a.push(`- Manually install libvips >= ${pm}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(o))try{let{config:l}=require(`@img/sharp-libvips-${qt}/package`),f=`${hm()} ${mm()}`,h=`${l.musl?"musl":"glibc"} ${l.musl||l.glibc}`;a.push("- Update your OS:",` Found ${f}`,` Requires ${h}`)}catch{}throw e&&/\/snap\/core[0-9]{2}/.test(o)&&a.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(o)&&a.push("- Update Homebrew:"," brew update && brew upgrade vips"),Dr.some(l=>l.code==="ERR_DLOPEN_DISABLED")&&a.push("- Run Node.js without using the --no-addons flag"),n&&/The specified procedure could not be found/.test(o)&&a.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),a.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(a.join(`
|
|
12
|
+
--`+t;let n=new Uint8Array(t.length);for(let a=0;a<t.length;a++)n[a]=t.charCodeAt(a),this.boundaryChars[n[a]]=!0;this.boundary=n,this.lookbehind=new Uint8Array(this.boundary.length+8),this.state=V.START_BOUNDARY}write(t){let n=0,a=t.length,o=this.index,{lookbehind:l,boundary:f,boundaryChars:h,index:d,state:g,flags:w}=this,T=this.boundary.length,k=T-1,W=t.length,S,N,q=O=>{this[O+"Mark"]=n},F=O=>{delete this[O+"Mark"]},U=(O,M,Y,it)=>{(M===void 0||M!==Y)&&this[O](it&&it.subarray(M,Y))},te=(O,M)=>{let Y=O+"Mark";Y in this&&(M?(U(O,this[Y],n,t),delete this[Y]):(U(O,this[Y],t.length,t),this[Y]=0))};for(n=0;n<a;n++)switch(S=t[n],g){case V.START_BOUNDARY:if(d===f.length-2){if(S===xr)w|=bt.LAST_BOUNDARY;else if(S!==Pn)return;d++;break}else if(d-1===f.length-2){if(w&bt.LAST_BOUNDARY&&S===xr)g=V.END,w=0;else if(!(w&bt.LAST_BOUNDARY)&&S===Rn)d=0,U("onPartBegin"),g=V.HEADER_FIELD_START;else return;break}S!==f[d+2]&&(d=-2),S===f[d+2]&&d++;break;case V.HEADER_FIELD_START:g=V.HEADER_FIELD,q("onHeaderField"),d=0;case V.HEADER_FIELD:if(S===Pn){F("onHeaderField"),g=V.HEADERS_ALMOST_DONE;break}if(d++,S===xr)break;if(S===Gc){if(d===1)return;te("onHeaderField",!0),g=V.HEADER_VALUE_START;break}if(N=Yc(S),N<Vc||N>Qc)return;break;case V.HEADER_VALUE_START:if(S===Hc)break;q("onHeaderValue"),g=V.HEADER_VALUE;case V.HEADER_VALUE:S===Pn&&(te("onHeaderValue",!0),U("onHeaderEnd"),g=V.HEADER_VALUE_ALMOST_DONE);break;case V.HEADER_VALUE_ALMOST_DONE:if(S!==Rn)return;g=V.HEADER_FIELD_START;break;case V.HEADERS_ALMOST_DONE:if(S!==Rn)return;U("onHeadersEnd"),g=V.PART_DATA_START;break;case V.PART_DATA_START:g=V.PART_DATA,q("onPartData");case V.PART_DATA:if(o=d,d===0){for(n+=k;n<W&&!(t[n]in h);)n+=T;n-=k,S=t[n]}if(d<f.length)f[d]===S?(d===0&&te("onPartData",!0),d++):d=0;else if(d===f.length)d++,S===Pn?w|=bt.PART_BOUNDARY:S===xr?w|=bt.LAST_BOUNDARY:d=0;else if(d-1===f.length)if(w&bt.PART_BOUNDARY){if(d=0,S===Rn){w&=~bt.PART_BOUNDARY,U("onPartEnd"),U("onPartBegin"),g=V.HEADER_FIELD_START;break}}else w&bt.LAST_BOUNDARY&&S===xr?(U("onPartEnd"),g=V.END,w=0):d=0;if(d>0)l[d-1]=S;else if(o>0){let O=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);U("onPartData",0,o,O),o=0,q("onPartData"),n--}break;case V.END:break;default:throw new Error(`Unexpected state entered: ${g}`)}te("onHeaderField"),te("onHeaderValue"),te("onPartData"),this.index=d,this.state=g,this.flags=w}end(){if(this.state===V.HEADER_FIELD_START&&this.index===0||this.state===V.PART_DATA&&this.index===this.boundary.length)this.onPartEnd();else if(this.state!==V.END)throw new Error("MultipartParser.end(): stream ended unexpectedly")}}});var Be=j((Wp,Ss)=>{"use strict";var Es=function(e){return typeof e!="undefined"&&e!==null},ad=function(e){return typeof e=="object"},od=function(e){return Object.prototype.toString.call(e)==="[object Object]"},sd=function(e){return typeof e=="function"},ld=function(e){return typeof e=="boolean"},ud=function(e){return e instanceof Buffer},fd=function(e){if(Es(e))switch(e.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},cd=function(e){return e instanceof ArrayBuffer},dd=function(e){return typeof e=="string"&&e.length>0},hd=function(e){return typeof e=="number"&&!Number.isNaN(e)},md=function(e){return Number.isInteger(e)},bd=function(e,t,n){return e>=t&&e<=n},gd=function(e,t){return t.includes(e)},pd=function(e,t,n){return new Error(`Expected ${t} for ${e} but received ${n} of type ${typeof n}`)},yd=function(e,t){return t.message=e.message,t};Ss.exports={defined:Es,object:ad,plainObject:od,fn:sd,bool:ld,buffer:ud,typedArray:fd,arrayBuffer:cd,string:dd,number:hd,integer:md,inRange:bd,inArray:gd,invalidParameterError:pd,nativeError:yd}});var Rs=j((zp,vs)=>{"use strict";var _s=()=>process.platform==="linux",xn=null,wd=()=>{if(!xn)if(_s()&&process.report){let e=process.report.excludeNetwork;process.report.excludeNetwork=!0,xn=process.report.getReport(),process.report.excludeNetwork=e}else xn={};return xn};vs.exports={isLinux:_s,getReport:wd}});var Ts=j((Up,Ps)=>{"use strict";var tr=require("fs"),Ed="/usr/bin/ldd",Sd="/proc/self/exe",Ln=2048,_d=e=>{let t=tr.openSync(e,"r"),n=Buffer.alloc(Ln),a=tr.readSync(t,n,0,Ln,0);return tr.close(t),n.subarray(0,a)},vd=e=>new Promise((t,n)=>{tr.open(e,"r",(a,o)=>{if(a)n(a);else{let l=Buffer.alloc(Ln);tr.read(o,l,0,Ln,0,(f,h)=>{t(l.subarray(0,h)),tr.close(o,()=>{})})}})});Ps.exports={LDD_PATH:Ed,SELF_PATH:Sd,readFileSync:_d,readFile:vd}});var Cs=j((Hp,As)=>{"use strict";var Rd=e=>{if(e.length<64||e.readUInt32BE(0)!==2135247942||e.readUInt8(4)!==2||e.readUInt8(5)!==1)return null;let t=e.readUInt32LE(32),n=e.readUInt16LE(54),a=e.readUInt16LE(56);for(let o=0;o<a;o++){let l=t+o*n;if(e.readUInt32LE(l)===3){let h=e.readUInt32LE(l+8),d=e.readUInt32LE(l+32);return e.subarray(h,h+d).toString().replace(/\0.*$/g,"")}}return null};As.exports={interpreterPath:Rd}});var Bn=j((Gp,Gs)=>{"use strict";var ks=require("child_process"),{isLinux:rr,getReport:xs}=Rs(),{LDD_PATH:jn,SELF_PATH:Ls,readFile:Hi,readFileSync:Gi}=Ts(),{interpreterPath:js}=Cs(),$e,qe,Fe,Bs="getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",gt="",$s=()=>gt||new Promise(e=>{ks.exec(Bs,(t,n)=>{gt=t?" ":n,e(gt)})}),qs=()=>{if(!gt)try{gt=ks.execSync(Bs,{encoding:"utf8"})}catch{gt=" "}return gt},et="glibc",Fs=/LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i,Bt="musl",Pd=e=>e.includes("libc.musl-")||e.includes("ld-musl-"),Ds=()=>{let e=xs();return e.header&&e.header.glibcVersionRuntime?et:Array.isArray(e.sharedObjects)&&e.sharedObjects.some(Pd)?Bt:null},Ns=e=>{let[t,n]=e.split(/[\r\n]+/);return t&&t.includes(et)?et:n&&n.includes(Bt)?Bt:null},Os=e=>{if(e){if(e.includes("/ld-musl-"))return Bt;if(e.includes("/ld-linux-"))return et}return null},Ms=e=>(e=e.toString(),e.includes("musl")?Bt:e.includes("GNU C Library")?et:null),Td=async()=>{if(qe!==void 0)return qe;qe=null;try{let e=await Hi(jn);qe=Ms(e)}catch{}return qe},Ad=()=>{if(qe!==void 0)return qe;qe=null;try{let e=Gi(jn);qe=Ms(e)}catch{}return qe},Cd=async()=>{if($e!==void 0)return $e;$e=null;try{let e=await Hi(Ls),t=js(e);$e=Os(t)}catch{}return $e},Id=()=>{if($e!==void 0)return $e;$e=null;try{let e=Gi(Ls),t=js(e);$e=Os(t)}catch{}return $e},Ws=async()=>{let e=null;if(rr()&&(e=await Cd(),!e&&(e=await Td(),e||(e=Ds()),!e))){let t=await $s();e=Ns(t)}return e},zs=()=>{let e=null;if(rr()&&(e=Id(),!e&&(e=Ad(),e||(e=Ds()),!e))){let t=qs();e=Ns(t)}return e},kd=async()=>rr()&&await Ws()!==et,xd=()=>rr()&&zs()!==et,Ld=async()=>{if(Fe!==void 0)return Fe;Fe=null;try{let t=(await Hi(jn)).match(Fs);t&&(Fe=t[1])}catch{}return Fe},jd=()=>{if(Fe!==void 0)return Fe;Fe=null;try{let t=Gi(jn).match(Fs);t&&(Fe=t[1])}catch{}return Fe},Us=()=>{let e=xs();return e.header&&e.header.glibcVersionRuntime?e.header.glibcVersionRuntime:null},Is=e=>e.trim().split(/\s+/)[1],Hs=e=>{let[t,n,a]=e.split(/[\r\n]+/);return t&&t.includes(et)?Is(t):n&&a&&n.includes(Bt)?Is(a):null},Bd=async()=>{let e=null;if(rr()&&(e=await Ld(),e||(e=Us()),!e)){let t=await $s();e=Hs(t)}return e},$d=()=>{let e=null;if(rr()&&(e=jd(),e||(e=Us()),!e)){let t=qs();e=Hs(t)}return e};Gs.exports={GLIBC:et,MUSL:Bt,family:Ws,familySync:zs,isNonGlibcLinux:kd,isNonGlibcLinuxSync:xd,version:Bd,versionSync:$d}});var $r=j((Vp,Vs)=>{"use strict";var qd=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Vs.exports=qd});var $n=j((Qp,Qs)=>{"use strict";var Fd="2.0.0",Dd=Number.MAX_SAFE_INTEGER||9007199254740991,Nd=16,Od=250,Md=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Qs.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Nd,MAX_SAFE_BUILD_LENGTH:Od,MAX_SAFE_INTEGER:Dd,RELEASE_TYPES:Md,SEMVER_SPEC_VERSION:Fd,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var qr=j((De,Ys)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Vi,MAX_SAFE_BUILD_LENGTH:Wd,MAX_LENGTH:zd}=$n(),Ud=$r();De=Ys.exports={};var Hd=De.re=[],Gd=De.safeRe=[],R=De.src=[],Vd=De.safeSrc=[],P=De.t={},Qd=0,Qi="[a-zA-Z0-9-]",Yd=[["\\s",1],["\\d",zd],[Qi,Wd]],Xd=e=>{for(let[t,n]of Yd)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e},B=(e,t,n)=>{let a=Xd(t),o=Qd++;Ud(e,o,t),P[e]=o,R[o]=t,Vd[o]=a,Hd[o]=new RegExp(t,n?"g":void 0),Gd[o]=new RegExp(a,n?"g":void 0)};B("NUMERICIDENTIFIER","0|[1-9]\\d*");B("NUMERICIDENTIFIERLOOSE","\\d+");B("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${Qi}*`);B("MAINVERSION",`(${R[P.NUMERICIDENTIFIER]})\\.(${R[P.NUMERICIDENTIFIER]})\\.(${R[P.NUMERICIDENTIFIER]})`);B("MAINVERSIONLOOSE",`(${R[P.NUMERICIDENTIFIERLOOSE]})\\.(${R[P.NUMERICIDENTIFIERLOOSE]})\\.(${R[P.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASEIDENTIFIER",`(?:${R[P.NONNUMERICIDENTIFIER]}|${R[P.NUMERICIDENTIFIER]})`);B("PRERELEASEIDENTIFIERLOOSE",`(?:${R[P.NONNUMERICIDENTIFIER]}|${R[P.NUMERICIDENTIFIERLOOSE]})`);B("PRERELEASE",`(?:-(${R[P.PRERELEASEIDENTIFIER]}(?:\\.${R[P.PRERELEASEIDENTIFIER]})*))`);B("PRERELEASELOOSE",`(?:-?(${R[P.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${R[P.PRERELEASEIDENTIFIERLOOSE]})*))`);B("BUILDIDENTIFIER",`${Qi}+`);B("BUILD",`(?:\\+(${R[P.BUILDIDENTIFIER]}(?:\\.${R[P.BUILDIDENTIFIER]})*))`);B("FULLPLAIN",`v?${R[P.MAINVERSION]}${R[P.PRERELEASE]}?${R[P.BUILD]}?`);B("FULL",`^${R[P.FULLPLAIN]}$`);B("LOOSEPLAIN",`[v=\\s]*${R[P.MAINVERSIONLOOSE]}${R[P.PRERELEASELOOSE]}?${R[P.BUILD]}?`);B("LOOSE",`^${R[P.LOOSEPLAIN]}$`);B("GTLT","((?:<|>)?=?)");B("XRANGEIDENTIFIERLOOSE",`${R[P.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);B("XRANGEIDENTIFIER",`${R[P.NUMERICIDENTIFIER]}|x|X|\\*`);B("XRANGEPLAIN",`[v=\\s]*(${R[P.XRANGEIDENTIFIER]})(?:\\.(${R[P.XRANGEIDENTIFIER]})(?:\\.(${R[P.XRANGEIDENTIFIER]})(?:${R[P.PRERELEASE]})?${R[P.BUILD]}?)?)?`);B("XRANGEPLAINLOOSE",`[v=\\s]*(${R[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[P.XRANGEIDENTIFIERLOOSE]})(?:\\.(${R[P.XRANGEIDENTIFIERLOOSE]})(?:${R[P.PRERELEASELOOSE]})?${R[P.BUILD]}?)?)?`);B("XRANGE",`^${R[P.GTLT]}\\s*${R[P.XRANGEPLAIN]}$`);B("XRANGELOOSE",`^${R[P.GTLT]}\\s*${R[P.XRANGEPLAINLOOSE]}$`);B("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Vi}})(?:\\.(\\d{1,${Vi}}))?(?:\\.(\\d{1,${Vi}}))?`);B("COERCE",`${R[P.COERCEPLAIN]}(?:$|[^\\d])`);B("COERCEFULL",R[P.COERCEPLAIN]+`(?:${R[P.PRERELEASE]})?(?:${R[P.BUILD]})?(?:$|[^\\d])`);B("COERCERTL",R[P.COERCE],!0);B("COERCERTLFULL",R[P.COERCEFULL],!0);B("LONETILDE","(?:~>?)");B("TILDETRIM",`(\\s*)${R[P.LONETILDE]}\\s+`,!0);De.tildeTrimReplace="$1~";B("TILDE",`^${R[P.LONETILDE]}${R[P.XRANGEPLAIN]}$`);B("TILDELOOSE",`^${R[P.LONETILDE]}${R[P.XRANGEPLAINLOOSE]}$`);B("LONECARET","(?:\\^)");B("CARETTRIM",`(\\s*)${R[P.LONECARET]}\\s+`,!0);De.caretTrimReplace="$1^";B("CARET",`^${R[P.LONECARET]}${R[P.XRANGEPLAIN]}$`);B("CARETLOOSE",`^${R[P.LONECARET]}${R[P.XRANGEPLAINLOOSE]}$`);B("COMPARATORLOOSE",`^${R[P.GTLT]}\\s*(${R[P.LOOSEPLAIN]})$|^$`);B("COMPARATOR",`^${R[P.GTLT]}\\s*(${R[P.FULLPLAIN]})$|^$`);B("COMPARATORTRIM",`(\\s*)${R[P.GTLT]}\\s*(${R[P.LOOSEPLAIN]}|${R[P.XRANGEPLAIN]})`,!0);De.comparatorTrimReplace="$1$2$3";B("HYPHENRANGE",`^\\s*(${R[P.XRANGEPLAIN]})\\s+-\\s+(${R[P.XRANGEPLAIN]})\\s*$`);B("HYPHENRANGELOOSE",`^\\s*(${R[P.XRANGEPLAINLOOSE]})\\s+-\\s+(${R[P.XRANGEPLAINLOOSE]})\\s*$`);B("STAR","(<|>)?=?\\s*\\*");B("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");B("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var qn=j((Yp,Xs)=>{"use strict";var Jd=Object.freeze({loose:!0}),Kd=Object.freeze({}),Zd=e=>e?typeof e!="object"?Jd:e:Kd;Xs.exports=Zd});var el=j((Xp,Zs)=>{"use strict";var Js=/^[0-9]+$/,Ks=(e,t)=>{let n=Js.test(e),a=Js.test(t);return n&&a&&(e=+e,t=+t),e===t?0:n&&!a?-1:a&&!n?1:e<t?-1:1},eh=(e,t)=>Ks(t,e);Zs.exports={compareIdentifiers:Ks,rcompareIdentifiers:eh}});var ir=j((Jp,rl)=>{"use strict";var Fn=$r(),{MAX_LENGTH:tl,MAX_SAFE_INTEGER:Dn}=$n(),{safeRe:Nn,t:On}=qr(),th=qn(),{compareIdentifiers:nr}=el(),Yi=class e{constructor(t,n){if(n=th(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>tl)throw new TypeError(`version is longer than ${tl} characters`);Fn("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let a=t.trim().match(n.loose?Nn[On.LOOSE]:Nn[On.FULL]);if(!a)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+a[1],this.minor=+a[2],this.patch=+a[3],this.major>Dn||this.major<0)throw new TypeError("Invalid major version");if(this.minor>Dn||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>Dn||this.patch<0)throw new TypeError("Invalid patch version");a[4]?this.prerelease=a[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let l=+o;if(l>=0&&l<Dn)return l}return o}):this.prerelease=[],this.build=a[5]?a[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(t){if(Fn("SemVer.compare",this.version,this.options,t),!(t instanceof e)){if(typeof t=="string"&&t===this.version)return 0;t=new e(t,this.options)}return t.version===this.version?0:this.compareMain(t)||this.comparePre(t)}compareMain(t){return t instanceof e||(t=new e(t,this.options)),nr(this.major,t.major)||nr(this.minor,t.minor)||nr(this.patch,t.patch)}comparePre(t){if(t instanceof e||(t=new e(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let n=0;do{let a=this.prerelease[n],o=t.prerelease[n];if(Fn("prerelease compare",n,a,o),a===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(a===void 0)return-1;if(a===o)continue;return nr(a,o)}while(++n)}compareBuild(t){t instanceof e||(t=new e(t,this.options));let n=0;do{let a=this.build[n],o=t.build[n];if(Fn("build compare",n,a,o),a===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(a===void 0)return-1;if(a===o)continue;return nr(a,o)}while(++n)}inc(t,n,a){if(t.startsWith("pre")){if(!n&&a===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let o=`-${n}`.match(this.options.loose?Nn[On.PRERELEASELOOSE]:Nn[On.PRERELEASE]);if(!o||o[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,a);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,a);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,a),this.inc("pre",n,a);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,a),this.inc("pre",n,a);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(a)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let l=this.prerelease.length;for(;--l>=0;)typeof this.prerelease[l]=="number"&&(this.prerelease[l]++,l=-2);if(l===-1){if(n===this.prerelease.join(".")&&a===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(n){let l=[n,o];a===!1&&(l=[n]),nr(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=l):this.prerelease=l}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};rl.exports=Yi});var al=j((Kp,il)=>{"use strict";var nl=ir(),rh=(e,t,n=!1)=>{if(e instanceof nl)return e;try{return new nl(e,t)}catch(a){if(!n)return null;throw a}};il.exports=rh});var sl=j((Zp,ol)=>{"use strict";var nh=ir(),ih=al(),{safeRe:Mn,t:Wn}=qr(),ah=(e,t)=>{if(e instanceof nh)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;t=t||{};let n=null;if(!t.rtl)n=e.match(t.includePrerelease?Mn[Wn.COERCEFULL]:Mn[Wn.COERCE]);else{let d=t.includePrerelease?Mn[Wn.COERCERTLFULL]:Mn[Wn.COERCERTL],g;for(;(g=d.exec(e))&&(!n||n.index+n[0].length!==e.length);)(!n||g.index+g[0].length!==n.index+n[0].length)&&(n=g),d.lastIndex=g.index+g[1].length+g[2].length;d.lastIndex=-1}if(n===null)return null;let a=n[2],o=n[3]||"0",l=n[4]||"0",f=t.includePrerelease&&n[5]?`-${n[5]}`:"",h=t.includePrerelease&&n[6]?`+${n[6]}`:"";return ih(`${a}.${o}.${l}${f}${h}`,t)};ol.exports=ah});var $t=j((e0,ul)=>{"use strict";var ll=ir(),oh=(e,t,n)=>new ll(e,n).compare(new ll(t,n));ul.exports=oh});var Xi=j((t0,fl)=>{"use strict";var sh=$t(),lh=(e,t,n)=>sh(e,t,n)>=0;fl.exports=lh});var dl=j((r0,cl)=>{"use strict";var Ji=class{constructor(){this.max=1e3,this.map=new Map}get(t){let n=this.map.get(t);if(n!==void 0)return this.map.delete(t),this.map.set(t,n),n}delete(t){return this.map.delete(t)}set(t,n){if(!this.delete(t)&&n!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(t,n)}return this}};cl.exports=Ji});var ml=j((n0,hl)=>{"use strict";var uh=$t(),fh=(e,t,n)=>uh(e,t,n)===0;hl.exports=fh});var gl=j((i0,bl)=>{"use strict";var ch=$t(),dh=(e,t,n)=>ch(e,t,n)!==0;bl.exports=dh});var yl=j((a0,pl)=>{"use strict";var hh=$t(),mh=(e,t,n)=>hh(e,t,n)>0;pl.exports=mh});var El=j((o0,wl)=>{"use strict";var bh=$t(),gh=(e,t,n)=>bh(e,t,n)<0;wl.exports=gh});var _l=j((s0,Sl)=>{"use strict";var ph=$t(),yh=(e,t,n)=>ph(e,t,n)<=0;Sl.exports=yh});var Rl=j((l0,vl)=>{"use strict";var wh=ml(),Eh=gl(),Sh=yl(),_h=Xi(),vh=El(),Rh=_l(),Ph=(e,t,n,a)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e===n;case"!==":return typeof e=="object"&&(e=e.version),typeof n=="object"&&(n=n.version),e!==n;case"":case"=":case"==":return wh(e,n,a);case"!=":return Eh(e,n,a);case">":return Sh(e,n,a);case">=":return _h(e,n,a);case"<":return vh(e,n,a);case"<=":return Rh(e,n,a);default:throw new TypeError(`Invalid operator: ${t}`)}};vl.exports=Ph});var xl=j((u0,kl)=>{"use strict";var Fr=Symbol("SemVer ANY"),ea=class e{static get ANY(){return Fr}constructor(t,n){if(n=Pl(n),t instanceof e){if(t.loose===!!n.loose)return t;t=t.value}t=t.trim().split(/\s+/).join(" "),Zi("comparator",t,n),this.options=n,this.loose=!!n.loose,this.parse(t),this.semver===Fr?this.value="":this.value=this.operator+this.semver.version,Zi("comp",this)}parse(t){let n=this.options.loose?Tl[Al.COMPARATORLOOSE]:Tl[Al.COMPARATOR],a=t.match(n);if(!a)throw new TypeError(`Invalid comparator: ${t}`);this.operator=a[1]!==void 0?a[1]:"",this.operator==="="&&(this.operator=""),a[2]?this.semver=new Cl(a[2],this.options.loose):this.semver=Fr}toString(){return this.value}test(t){if(Zi("Comparator.test",t,this.options.loose),this.semver===Fr||t===Fr)return!0;if(typeof t=="string")try{t=new Cl(t,this.options)}catch{return!1}return Ki(t,this.operator,this.semver,this.options)}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new Il(t.value,n).test(this.value):t.operator===""?t.value===""?!0:new Il(this.value,n).test(t.semver):(n=Pl(n),n.includePrerelease&&(this.value==="<0.0.0-0"||t.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||t.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&t.operator.startsWith(">")||this.operator.startsWith("<")&&t.operator.startsWith("<")||this.semver.version===t.semver.version&&this.operator.includes("=")&&t.operator.includes("=")||Ki(this.semver,"<",t.semver,n)&&this.operator.startsWith(">")&&t.operator.startsWith("<")||Ki(this.semver,">",t.semver,n)&&this.operator.startsWith("<")&&t.operator.startsWith(">")))}};kl.exports=ea;var Pl=qn(),{safeRe:Tl,t:Al}=qr(),Ki=Rl(),Zi=$r(),Cl=ir(),Il=ta()});var ta=j((f0,$l)=>{"use strict";var Th=/\s+/g,ra=class e{constructor(t,n){if(n=Ch(n),t instanceof e)return t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease?t:new e(t.raw,n);if(t instanceof na)return this.raw=t.value,this.set=[[t]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=t.trim().replace(Th," "),this.set=this.raw.split("||").map(a=>this.parseRange(a.trim())).filter(a=>a.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let a=this.set[0];if(this.set=this.set.filter(o=>!jl(o[0])),this.set.length===0)this.set=[a];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&$h(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let t=0;t<this.set.length;t++){t>0&&(this.formatted+="||");let n=this.set[t];for(let a=0;a<n.length;a++)a>0&&(this.formatted+=" "),this.formatted+=n[a].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(t){let a=((this.options.includePrerelease&&jh)|(this.options.loose&&Bh))+":"+t,o=Ll.get(a);if(o)return o;let l=this.options.loose,f=l?fe[ie.HYPHENRANGELOOSE]:fe[ie.HYPHENRANGE];t=t.replace(f,Hh(this.options.includePrerelease)),Q("hyphen replace",t),t=t.replace(fe[ie.COMPARATORTRIM],kh),Q("comparator trim",t),t=t.replace(fe[ie.TILDETRIM],xh),Q("tilde trim",t),t=t.replace(fe[ie.CARETTRIM],Lh),Q("caret trim",t);let h=t.split(" ").map(T=>qh(T,this.options)).join(" ").split(/\s+/).map(T=>Uh(T,this.options));l&&(h=h.filter(T=>(Q("loose invalid filter",T,this.options),!!T.match(fe[ie.COMPARATORLOOSE])))),Q("range list",h);let d=new Map,g=h.map(T=>new na(T,this.options));for(let T of g){if(jl(T))return[T];d.set(T.value,T)}d.size>1&&d.has("")&&d.delete("");let w=[...d.values()];return Ll.set(a,w),w}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some(a=>Bl(a,n)&&t.set.some(o=>Bl(o,n)&&a.every(l=>o.every(f=>l.intersects(f,n)))))}test(t){if(!t)return!1;if(typeof t=="string")try{t=new Ih(t,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(Gh(this.set[n],t,this.options))return!0;return!1}};$l.exports=ra;var Ah=dl(),Ll=new Ah,Ch=qn(),na=xl(),Q=$r(),Ih=ir(),{safeRe:fe,t:ie,comparatorTrimReplace:kh,tildeTrimReplace:xh,caretTrimReplace:Lh}=qr(),{FLAG_INCLUDE_PRERELEASE:jh,FLAG_LOOSE:Bh}=$n(),jl=e=>e.value==="<0.0.0-0",$h=e=>e.value==="",Bl=(e,t)=>{let n=!0,a=e.slice(),o=a.pop();for(;n&&a.length;)n=a.every(l=>o.intersects(l,t)),o=a.pop();return n},qh=(e,t)=>(Q("comp",e,t),e=Nh(e,t),Q("caret",e),e=Fh(e,t),Q("tildes",e),e=Mh(e,t),Q("xrange",e),e=zh(e,t),Q("stars",e),e),ae=e=>!e||e.toLowerCase()==="x"||e==="*",Fh=(e,t)=>e.trim().split(/\s+/).map(n=>Dh(n,t)).join(" "),Dh=(e,t)=>{let n=t.loose?fe[ie.TILDELOOSE]:fe[ie.TILDE];return e.replace(n,(a,o,l,f,h)=>{Q("tilde",e,a,o,l,f,h);let d;return ae(o)?d="":ae(l)?d=`>=${o}.0.0 <${+o+1}.0.0-0`:ae(f)?d=`>=${o}.${l}.0 <${o}.${+l+1}.0-0`:h?(Q("replaceTilde pr",h),d=`>=${o}.${l}.${f}-${h} <${o}.${+l+1}.0-0`):d=`>=${o}.${l}.${f} <${o}.${+l+1}.0-0`,Q("tilde return",d),d})},Nh=(e,t)=>e.trim().split(/\s+/).map(n=>Oh(n,t)).join(" "),Oh=(e,t)=>{Q("caret",e,t);let n=t.loose?fe[ie.CARETLOOSE]:fe[ie.CARET],a=t.includePrerelease?"-0":"";return e.replace(n,(o,l,f,h,d)=>{Q("caret",e,o,l,f,h,d);let g;return ae(l)?g="":ae(f)?g=`>=${l}.0.0${a} <${+l+1}.0.0-0`:ae(h)?l==="0"?g=`>=${l}.${f}.0${a} <${l}.${+f+1}.0-0`:g=`>=${l}.${f}.0${a} <${+l+1}.0.0-0`:d?(Q("replaceCaret pr",d),l==="0"?f==="0"?g=`>=${l}.${f}.${h}-${d} <${l}.${f}.${+h+1}-0`:g=`>=${l}.${f}.${h}-${d} <${l}.${+f+1}.0-0`:g=`>=${l}.${f}.${h}-${d} <${+l+1}.0.0-0`):(Q("no pr"),l==="0"?f==="0"?g=`>=${l}.${f}.${h}${a} <${l}.${f}.${+h+1}-0`:g=`>=${l}.${f}.${h}${a} <${l}.${+f+1}.0-0`:g=`>=${l}.${f}.${h} <${+l+1}.0.0-0`),Q("caret return",g),g})},Mh=(e,t)=>(Q("replaceXRanges",e,t),e.split(/\s+/).map(n=>Wh(n,t)).join(" ")),Wh=(e,t)=>{e=e.trim();let n=t.loose?fe[ie.XRANGELOOSE]:fe[ie.XRANGE];return e.replace(n,(a,o,l,f,h,d)=>{Q("xRange",e,a,o,l,f,h,d);let g=ae(l),w=g||ae(f),T=w||ae(h),k=T;return o==="="&&k&&(o=""),d=t.includePrerelease?"-0":"",g?o===">"||o==="<"?a="<0.0.0-0":a="*":o&&k?(w&&(f=0),h=0,o===">"?(o=">=",w?(l=+l+1,f=0,h=0):(f=+f+1,h=0)):o==="<="&&(o="<",w?l=+l+1:f=+f+1),o==="<"&&(d="-0"),a=`${o+l}.${f}.${h}${d}`):w?a=`>=${l}.0.0${d} <${+l+1}.0.0-0`:T&&(a=`>=${l}.${f}.0${d} <${l}.${+f+1}.0-0`),Q("xRange return",a),a})},zh=(e,t)=>(Q("replaceStars",e,t),e.trim().replace(fe[ie.STAR],"")),Uh=(e,t)=>(Q("replaceGTE0",e,t),e.trim().replace(fe[t.includePrerelease?ie.GTE0PRE:ie.GTE0],"")),Hh=e=>(t,n,a,o,l,f,h,d,g,w,T,k)=>(ae(a)?n="":ae(o)?n=`>=${a}.0.0${e?"-0":""}`:ae(l)?n=`>=${a}.${o}.0${e?"-0":""}`:f?n=`>=${n}`:n=`>=${n}${e?"-0":""}`,ae(g)?d="":ae(w)?d=`<${+g+1}.0.0-0`:ae(T)?d=`<${g}.${+w+1}.0-0`:k?d=`<=${g}.${w}.${T}-${k}`:e?d=`<${g}.${w}.${+T+1}-0`:d=`<=${d}`,`${n} ${d}`.trim()),Gh=(e,t,n)=>{for(let a=0;a<e.length;a++)if(!e[a].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let a=0;a<e.length;a++)if(Q(e[a].semver),e[a].semver!==na.ANY&&e[a].semver.prerelease.length>0){let o=e[a].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}return!1}return!0}});var Fl=j((c0,ql)=>{"use strict";var Vh=ta(),Qh=(e,t,n)=>{try{t=new Vh(t,n)}catch{return!1}return t.test(e)};ql.exports=Qh});var ia=j((d0,Yh)=>{Yh.exports={name:"sharp",description:"High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",version:"0.34.4",author:"Lovell Fuller <npm@lovell.info>",homepage:"https://sharp.pixelplumbing.com",contributors:["Pierre Inglebert <pierre.inglebert@gmail.com>","Jonathan Ong <jonathanrichardong@gmail.com>","Chanon Sajjamanochai <chanon.s@gmail.com>","Juliano Julio <julianojulio@gmail.com>","Daniel Gasienica <daniel@gasienica.ch>","Julian Walker <julian@fiftythree.com>","Amit Pitaru <pitaru.amit@gmail.com>","Brandon Aaron <hello.brandon@aaron.sh>","Andreas Lind <andreas@one.com>","Maurus Cuelenaere <mcuelenaere@gmail.com>","Linus Unneb\xE4ck <linus@folkdatorn.se>","Victor Mateevitsi <mvictoras@gmail.com>","Alaric Holloway <alaric.holloway@gmail.com>","Bernhard K. Weisshuhn <bkw@codingforce.com>","Chris Riley <criley@primedia.com>","David Carley <dacarley@gmail.com>","John Tobin <john@limelightmobileinc.com>","Kenton Gray <kentongray@gmail.com>","Felix B\xFCnemann <Felix.Buenemann@gmail.com>","Samy Al Zahrani <samyalzahrany@gmail.com>","Chintan Thakkar <lemnisk8@gmail.com>","F. Orlando Galashan <frulo@gmx.de>","Kleis Auke Wolthuizen <info@kleisauke.nl>","Matt Hirsch <mhirsch@media.mit.edu>","Matthias Thoemmes <thoemmes@gmail.com>","Patrick Paskaris <patrick@paskaris.gr>","J\xE9r\xE9my Lal <kapouer@melix.org>","Rahul Nanwani <r.nanwani@gmail.com>","Alice Monday <alice0meta@gmail.com>","Kristo Jorgenson <kristo.jorgenson@gmail.com>","YvesBos <yves_bos@outlook.com>","Guy Maliar <guy@tailorbrands.com>","Nicolas Coden <nicolas@ncoden.fr>","Matt Parrish <matt.r.parrish@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Matthew McEachen <matthew+github@mceachen.org>","Jarda Kot\u011B\u0161ovec <jarda.kotesovec@gmail.com>","Kenric D'Souza <kenric.dsouza@gmail.com>","Oleh Aleinyk <oleg.aleynik@gmail.com>","Marcel Bretschneider <marcel.bretschneider@gmail.com>","Andrea Bianco <andrea.bianco@unibas.ch>","Rik Heywood <rik@rik.org>","Thomas Parisot <hi@oncletom.io>","Nathan Graves <nathanrgraves+github@gmail.com>","Tom Lokhorst <tom@lokhorst.eu>","Espen Hovlandsdal <espen@hovlandsdal.com>","Sylvain Dumont <sylvain.dumont35@gmail.com>","Alun Davies <alun.owain.davies@googlemail.com>","Aidan Hoolachan <ajhoolachan21@gmail.com>","Axel Eirola <axel.eirola@iki.fi>","Freezy <freezy@xbmc.org>","Daiz <taneli.vatanen@gmail.com>","Julian Aubourg <j@ubourg.net>","Keith Belovay <keith@picthrive.com>","Michael B. Klein <mbklein@gmail.com>","Jordan Prudhomme <jordan@raboland.fr>","Ilya Ovdin <iovdin@gmail.com>","Andargor <andargor@yahoo.com>","Paul Neave <paul.neave@gmail.com>","Brendan Kennedy <brenwken@gmail.com>","Brychan Bennett-Odlum <git@brychan.io>","Edward Silverton <e.silverton@gmail.com>","Roman Malieiev <aromaleev@gmail.com>","Tomas Szabo <tomas.szabo@deftomat.com>","Robert O'Rourke <robert@o-rourke.org>","Guillermo Alfonso Varela Chouci\xF1o <guillevch@gmail.com>","Christian Flintrup <chr@gigahost.dk>","Manan Jadhav <manan@motionden.com>","Leon Radley <leon@radley.se>","alza54 <alza54@thiocod.in>","Jacob Smith <jacob@frende.Br>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugu\xE9 <zaruike10@gmail.com>","Chris Banks <christopher.bradley.banks@gmail.com>","Ompal Singh <ompal.hitm09@gmail.com>","Brodan <christopher.hranj@gmail.com>","Ankur Parihar <ankur.github@gmail.com>","Brahim Ait elhaj <brahima@gmail.com>","Mart Jansink <m.jansink@gmail.com>","Lachlan Newman <lachnewman007@gmail.com>","Dennis Beatty <dennis@dcbeatty.com>","Ingvar Stepanyan <Br@rreverser.com>","Don Denton <don@happycollision.com>"],scripts:{install:"node install/check.js",clean:"rm -rf src/build/ .nyc_output/ coverage/ test/fixtures/output.*",test:"npm run test-lint && npm run test-unit && npm run test-licensing && npm run test-types","test-lint":"semistandard && cpplint","test-unit":"nyc --reporter=lcov --reporter=text --check-coverage --branches=100 mocha","test-licensing":'license-checker --production --summary --onlyAllow="Apache-2.0;BSD;ISC;LGPL-3.0-or-later;MIT"',"test-leak":"./test/leak/leak.sh","test-types":"tsd","package-from-local-build":"node npm/from-local-build.js","package-release-notes":"node npm/release-notes.js","docs-build":"node docs/build.mjs","docs-serve":"cd docs && npm start","docs-publish":"cd docs && npm run build && npx firebase-tools deploy --project pixelplumbing --only hosting:pixelplumbing-sharp"},type:"commonjs",main:"lib/index.js",types:"lib/index.d.ts",files:["install","lib","src/*.{cc,h,gyp}"],repository:{type:"git",url:"git://github.com/lovell/sharp.git"},keywords:["jpeg","png","webp","avif","tiff","gif","svg","jp2","dzi","image","resize","thumbnail","crop","embed","libvips","vips"],dependencies:{"@img/colour":"^1.0.0","detect-libc":"^2.1.0",semver:"^7.7.2"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.34.4","@img/sharp-darwin-x64":"0.34.4","@img/sharp-libvips-darwin-arm64":"1.2.3","@img/sharp-libvips-darwin-x64":"1.2.3","@img/sharp-libvips-linux-arm":"1.2.3","@img/sharp-libvips-linux-arm64":"1.2.3","@img/sharp-libvips-linux-ppc64":"1.2.3","@img/sharp-libvips-linux-s390x":"1.2.3","@img/sharp-libvips-linux-x64":"1.2.3","@img/sharp-libvips-linuxmusl-arm64":"1.2.3","@img/sharp-libvips-linuxmusl-x64":"1.2.3","@img/sharp-linux-arm":"0.34.4","@img/sharp-linux-arm64":"0.34.4","@img/sharp-linux-ppc64":"0.34.4","@img/sharp-linux-s390x":"0.34.4","@img/sharp-linux-x64":"0.34.4","@img/sharp-linuxmusl-arm64":"0.34.4","@img/sharp-linuxmusl-x64":"0.34.4","@img/sharp-wasm32":"0.34.4","@img/sharp-win32-arm64":"0.34.4","@img/sharp-win32-ia32":"0.34.4","@img/sharp-win32-x64":"0.34.4"},devDependencies:{"@emnapi/runtime":"^1.5.0","@img/sharp-libvips-dev":"1.2.3","@img/sharp-libvips-dev-wasm32":"1.2.3","@img/sharp-libvips-win32-arm64":"1.2.3","@img/sharp-libvips-win32-ia32":"1.2.3","@img/sharp-libvips-win32-x64":"1.2.3","@types/node":"*",cc:"^3.0.1",emnapi:"^1.5.0","exif-reader":"^2.0.2","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^9.1.2","license-checker":"^25.0.1",mocha:"^11.7.2","node-addon-api":"^8.5.0","node-gyp":"^11.4.2",nyc:"^17.1.0",semistandard:"^17.0.0","tar-fs":"^3.1.1",tsd:"^0.33.0"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0"},config:{libvips:">=8.17.2"},funding:{url:"https://opencollective.com/libvips"},semistandard:{env:["mocha"]},cc:{linelength:"120",filter:["build/include"]},nyc:{include:["lib"]},tsd:{directory:"test/types/"}}});var oa=j((h0,Vl)=>{"use strict";var{spawnSync:zn}=require("child_process"),{createHash:Xh}=require("crypto"),Ml=sl(),Jh=Xi(),Kh=Fl(),Dl=Bn(),{config:Zh,engines:Nl,optionalDependencies:em}=ia(),tm=process.env.npm_package_config_libvips||Zh.libvips,Wl=Ml(tm).version,rm=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-ppc64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-arm64","win32-ia32","win32-x64"],Un={encoding:"utf8",shell:!0},nm=e=>{e instanceof Error?console.error(`sharp: Installation error: ${e.message}`):console.log(`sharp: ${e}`)},zl=()=>Dl.isNonGlibcLinuxSync()?Dl.familySync():"",im=()=>`${process.platform}${zl()}-${process.arch}`,ar=()=>{if(Ul())return"wasm32";let{npm_config_arch:e,npm_config_platform:t,npm_config_libc:n}=process.env,a=typeof n=="string"?n:zl();return`${t||process.platform}${a}-${e||process.arch}`},am=()=>{try{return require(`@img/sharp-libvips-dev-${ar()}/include`)}catch{try{return require("@img/sharp-libvips-dev/include")}catch{}}return""},om=()=>{try{return require("@img/sharp-libvips-dev/cplusplus")}catch{}return""},sm=()=>{try{return require(`@img/sharp-libvips-dev-${ar()}/lib`)}catch{try{return require(`@img/sharp-libvips-${ar()}/lib`)}catch{}}return""},lm=()=>{var e;if(((e=process.release)==null?void 0:e.name)==="node"&&process.versions&&!Kh(process.versions.node,Nl.node))return{found:process.versions.node,expected:Nl.node}},Ul=()=>{let{CC:e}=process.env;return!!(e&&e.endsWith("/emcc"))},um=()=>process.platform==="darwin"&&process.arch==="x64"?(zn("sysctl sysctl.proc_translated",Un).stdout||"").trim()==="sysctl.proc_translated: 1":!1,Ol=e=>Xh("sha512").update(e).digest("hex"),fm=()=>{try{let e=Ol(`imgsharp-libvips-${ar()}`),t=Ml(em[`@img/sharp-libvips-${ar()}`],{includePrerelease:!0}).version;return Ol(`${e}npm:${t}`).slice(0,10)}catch{}return""},cm=()=>zn(`node-gyp rebuild --directory=src ${Ul()?"--nodedir=emscripten":""}`,{...Un,stdio:"inherit"}).status,Hl=()=>process.platform!=="win32"?(zn("pkg-config --modversion vips-cpp",{...Un,env:{...process.env,PKG_CONFIG_PATH:Gl()}}).stdout||"").trim():"",Gl=()=>process.platform!=="win32"?[(zn('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',Un).stdout||"").trim(),process.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":"):"",aa=(e,t,n)=>(n&&n(`Detected ${t}, skipping search for globally-installed libvips`),e),dm=e=>{if(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)return aa(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS",e);if(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)return aa(!0,"SHARP_FORCE_GLOBAL_LIBVIPS",e);if(um())return aa(!1,"Rosetta",e);let t=Hl();return!!t&&Jh(t,Wl)};Vl.exports={minimumLibvipsVersion:Wl,prebuiltPlatforms:rm,buildPlatformArch:ar,buildSharpLibvipsIncludeDir:am,buildSharpLibvipsCPlusPlusDir:om,buildSharpLibvipsLibDir:sm,isUnsupportedNodeRuntime:lm,runtimePlatformArch:im,log:nm,yarnLocator:fm,spawnRebuild:cm,globalLibvipsVersion:Hl,pkgConfigPath:Gl,useGlobalLibvips:dm}});var Nr=j((m0,Yl)=>{"use strict";var{familySync:hm,versionSync:mm}=Bn(),{runtimePlatformArch:bm,isUnsupportedNodeRuntime:Ql,prebuiltPlatforms:gm,minimumLibvipsVersion:pm}=oa(),qt=bm(),ym=[`../src/build/Release/sharp-${qt}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${qt}/sharp.node`,"@img/sharp-wasm32/sharp.node"],sa,or,Dr=[];for(sa of ym)try{or=require(sa);break}catch(e){Dr.push(e)}if(or&&sa.startsWith("@img/sharp-linux-x64")&&!or._isUsingX64V2()){let e=new Error("Prebuilt binaries for linux-x64 require v2 microarchitecture");e.code="Unsupported CPU",Dr.push(e),or=null}if(or)Yl.exports=or;else{let[e,t,n]=["linux","darwin","win32"].map(l=>qt.startsWith(l)),a=[`Could not load the "sharp" module using the ${qt} runtime`];Dr.forEach(l=>{l.code!=="MODULE_NOT_FOUND"&&a.push(`${l.code}: ${l.message}`)});let o=Dr.map(l=>l.message).join(" ");if(a.push("Possible solutions:"),Ql()){let{found:l,expected:f}=Ql();a.push("- Please upgrade Node.js:",` Found ${l}`,` Requires ${f}`)}else if(gm.includes(qt)){let[l,f]=qt.split("-"),h=l.endsWith("musl")?" --libc=musl":"";a.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${l.replace("musl","")}${h} --cpu=${f} sharp`)}else a.push(`- Manually install libvips >= ${pm}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(e&&/(symbol not found|CXXABI_)/i.test(o))try{let{config:l}=require(`@img/sharp-libvips-${qt}/package`),f=`${hm()} ${mm()}`,h=`${l.musl?"musl":"glibc"} ${l.musl||l.glibc}`;a.push("- Update your OS:",` Found ${f}`,` Requires ${h}`)}catch{}throw e&&/\/snap\/core[0-9]{2}/.test(o)&&a.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node"),t&&/Incompatible library version/.test(o)&&a.push("- Update Homebrew:"," brew update && brew upgrade vips"),Dr.some(l=>l.code==="ERR_DLOPEN_DISABLED")&&a.push("- Run Node.js without using the --no-addons flag"),n&&/The specified procedure could not be found/.test(o)&&a.push("- Using the canvas package on Windows?"," See https://sharp.pixelplumbing.com/install#canvas-and-windows","- Check for outdated versions of sharp in the dependency tree:"," npm ls sharp"),a.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(a.join(`
|
|
13
13
|
`))}});var Jl=j((b0,Xl)=>{"use strict";var wm=require("util"),la=require("stream"),Em=Be();Nr();var Sm=wm.debuglog("sharp"),Ft=function(e,t){if(arguments.length===1&&!Em.defined(e))throw new Error("Invalid input");return this instanceof Ft?(la.Duplex.call(this),this.options={topOffsetPre:-1,leftOffsetPre:-1,widthPre:-1,heightPre:-1,topOffsetPost:-1,leftOffsetPost:-1,widthPost:-1,heightPost:-1,width:-1,height:-1,canvas:"crop",position:0,resizeBackground:[0,0,0,255],angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBefore:!1,orientBefore:!1,flip:!1,flop:!1,extendTop:0,extendBottom:0,extendLeft:0,extendRight:0,extendBackground:[0,0,0,255],extendWith:"background",withoutEnlargement:!1,withoutReduction:!1,affineMatrix:[],affineBackground:[0,0,0,255],affineIdx:0,affineIdy:0,affineOdx:0,affineOdy:0,affineInterpolator:this.constructor.interpolators.bilinear,kernel:"lanczos3",fastShrinkOnLoad:!0,tint:[-1,0,0,0],flatten:!1,flattenBackground:[0,0,0],unflatten:!1,negate:!1,negateAlpha:!0,medianSize:0,blurSigma:0,precision:"integer",minAmpl:.2,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,dilateWidth:0,erodeWidth:0,gamma:0,gammaOut:0,greyscale:!1,normalise:!1,normaliseLower:1,normaliseUpper:99,claheWidth:0,claheHeight:0,claheMaxSlope:3,brightness:1,saturation:1,hue:0,lightness:0,booleanBufferIn:null,booleanFileIn:"",joinChannelIn:[],extractChannel:-1,removeAlpha:!1,ensureAlpha:-1,colourspace:"srgb",colourspacePipeline:"last",composite:[],fileOut:"",formatOut:"input",streamOut:!1,keepMetadata:0,withMetadataOrientation:-1,withMetadataDensity:0,withIccProfile:"",withExif:{},withExifMerge:!0,withXmp:"",resolveWithObject:!1,loop:-1,delay:[],jpegQuality:80,jpegProgressive:!1,jpegChromaSubsampling:"4:2:0",jpegTrellisQuantisation:!1,jpegOvershootDeringing:!1,jpegOptimiseScans:!1,jpegOptimiseCoding:!0,jpegQuantisationTable:0,pngProgressive:!1,pngCompressionLevel:6,pngAdaptiveFiltering:!1,pngPalette:!1,pngQuality:100,pngEffort:7,pngBitdepth:8,pngDither:1,jp2Quality:80,jp2TileHeight:512,jp2TileWidth:512,jp2Lossless:!1,jp2ChromaSubsampling:"4:4:4",webpQuality:80,webpAlphaQuality:100,webpLossless:!1,webpNearLossless:!1,webpSmartSubsample:!1,webpSmartDeblock:!1,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,gifKeepDuplicateFrames:!1,gifReuse:!0,gifProgressive:!1,tiffQuality:80,tiffCompression:"jpeg",tiffPredictor:"horizontal",tiffPyramid:!1,tiffMiniswhite:!1,tiffBitdepth:8,tiffTile:!1,tiffTileHeight:256,tiffTileWidth:256,tiffXres:1,tiffYres:1,tiffResolutionUnit:"inch",heifQuality:50,heifLossless:!1,heifCompression:"av1",heifEffort:4,heifChromaSubsampling:"4:4:4",heifBitdepth:8,jxlDistance:1,jxlDecodingTier:0,jxlEffort:7,jxlLossless:!1,rawDepth:"uchar",tileSize:256,tileOverlap:0,tileContainer:"fs",tileLayout:"dz",tileFormat:"last",tileDepth:"last",tileAngle:0,tileSkipBlanks:-1,tileBackground:[255,255,255,255],tileCentre:!1,tileId:"https://example.com/iiif",tileBasename:"",timeoutSeconds:0,linearA:[],linearB:[],pdfBackground:[255,255,255,255],debuglog:n=>{this.emit("warning",n),Sm(n)},queueListener:function(n){Ft.queue.emit("change",n)}},this.options.input=this._createInputDescriptor(e,t,{allowStream:!0}),this):new Ft(e,t)};Object.setPrototypeOf(Ft.prototype,la.Duplex.prototype);Object.setPrototypeOf(Ft,la.Duplex);function _m(){let e=this.constructor.call(),{debuglog:t,queueListener:n,...a}=this.options;return e.options=structuredClone(a),e.options.debuglog=t,e.options.queueListener=n,this._isStreamInput()&&this.on("finish",()=>{this._flattenBufferIn(),e.options.input.buffer=this.options.input.buffer,e.emit("finish")}),e}Object.assign(Ft.prototype,{clone:_m});Xl.exports=Ft});var eu=j((g0,Zl)=>{"use strict";var b=Be(),pt=Nr(),vm={left:"low",top:"low",low:"low",center:"centre",centre:"centre",right:"high",bottom:"high",high:"high"},Rm=["failOn","limitInputPixels","unlimited","animated","autoOrient","density","ignoreIcc","page","pages","sequentialRead","jp2","openSlide","pdf","raw","svg","tiff","failOnError","openSlideLevel","pdfBackground","tiffSubifd"];function Kl(e){let t=Rm.filter(n=>b.defined(e[n])).map(n=>[n,e[n]]);return t.length?Object.fromEntries(t):void 0}function Pm(e,t,n){let a={autoOrient:!1,failOn:"warning",limitInputPixels:Math.pow(16383,2),ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(b.string(e))a.file=e;else if(b.buffer(e)){if(e.length===0)throw Error("Input Buffer is empty");a.buffer=e}else if(b.arrayBuffer(e)){if(e.byteLength===0)throw Error("Input bit Array is empty");a.buffer=Buffer.from(e,0,e.byteLength)}else if(b.typedArray(e)){if(e.length===0)throw Error("Input Bit Array is empty");a.buffer=Buffer.from(e.buffer,e.byteOffset,e.byteLength)}else if(b.plainObject(e)&&!b.defined(t))t=e,Kl(t)&&(a.buffer=[]);else if(!b.defined(e)&&!b.defined(t)&&b.object(n)&&n.allowStream)a.buffer=[];else if(Array.isArray(e))if(e.length>1)if(!this.options.joining)this.options.joining=!0,this.options.join=e.map(o=>this._createInputDescriptor(o));else throw new Error("Recursive join is unsupported");else throw new Error("Expected at least two images to join");else throw new Error(`Unsupported input '${e}' of type ${typeof e}${b.defined(t)?` when also providing options of type ${typeof t}`:""}`);if(b.object(t)){if(b.defined(t.failOnError))if(b.bool(t.failOnError))a.failOn=t.failOnError?"warning":"none";else throw b.invalidParameterError("failOnError","boolean",t.failOnError);if(b.defined(t.failOn))if(b.string(t.failOn)&&b.inArray(t.failOn,["none","truncated","error","warning"]))a.failOn=t.failOn;else throw b.invalidParameterError("failOn","one of: none, truncated, error, warning",t.failOn);if(b.defined(t.autoOrient))if(b.bool(t.autoOrient))a.autoOrient=t.autoOrient;else throw b.invalidParameterError("autoOrient","boolean",t.autoOrient);if(b.defined(t.density))if(b.inRange(t.density,1,1e5))a.density=t.density;else throw b.invalidParameterError("density","number between 1 and 100000",t.density);if(b.defined(t.ignoreIcc))if(b.bool(t.ignoreIcc))a.ignoreIcc=t.ignoreIcc;else throw b.invalidParameterError("ignoreIcc","boolean",t.ignoreIcc);if(b.defined(t.limitInputPixels))if(b.bool(t.limitInputPixels))a.limitInputPixels=t.limitInputPixels?Math.pow(16383,2):0;else if(b.integer(t.limitInputPixels)&&b.inRange(t.limitInputPixels,0,Number.MAX_SAFE_INTEGER))a.limitInputPixels=t.limitInputPixels;else throw b.invalidParameterError("limitInputPixels","positive integer",t.limitInputPixels);if(b.defined(t.unlimited))if(b.bool(t.unlimited))a.unlimited=t.unlimited;else throw b.invalidParameterError("unlimited","boolean",t.unlimited);if(b.defined(t.sequentialRead))if(b.bool(t.sequentialRead))a.sequentialRead=t.sequentialRead;else throw b.invalidParameterError("sequentialRead","boolean",t.sequentialRead);if(b.defined(t.raw)){if(b.object(t.raw)&&b.integer(t.raw.width)&&t.raw.width>0&&b.integer(t.raw.height)&&t.raw.height>0&&b.integer(t.raw.channels)&&b.inRange(t.raw.channels,1,4))switch(a.rawWidth=t.raw.width,a.rawHeight=t.raw.height,a.rawChannels=t.raw.channels,e.constructor){case Uint8Array:case Uint8ClampedArray:a.rawDepth="uchar";break;case Int8Array:a.rawDepth="char";break;case Uint16Array:a.rawDepth="ushort";break;case Int16Array:a.rawDepth="short";break;case Uint32Array:a.rawDepth="uint";break;case Int32Array:a.rawDepth="int";break;case Float32Array:a.rawDepth="float";break;case Float64Array:a.rawDepth="double";break;default:a.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(a.rawPremultiplied=!1,b.defined(t.raw.premultiplied))if(b.bool(t.raw.premultiplied))a.rawPremultiplied=t.raw.premultiplied;else throw b.invalidParameterError("raw.premultiplied","boolean",t.raw.premultiplied);if(a.rawPageHeight=0,b.defined(t.raw.pageHeight))if(b.integer(t.raw.pageHeight)&&t.raw.pageHeight>0&&t.raw.pageHeight<=t.raw.height){if(t.raw.height%t.raw.pageHeight!==0)throw new Error(`Expected raw.height ${t.raw.height} to be a multiple of raw.pageHeight ${t.raw.pageHeight}`);a.rawPageHeight=t.raw.pageHeight}else throw b.invalidParameterError("raw.pageHeight","positive integer",t.raw.pageHeight)}if(b.defined(t.animated))if(b.bool(t.animated))a.pages=t.animated?-1:1;else throw b.invalidParameterError("animated","boolean",t.animated);if(b.defined(t.pages))if(b.integer(t.pages)&&b.inRange(t.pages,-1,1e5))a.pages=t.pages;else throw b.invalidParameterError("pages","integer between -1 and 100000",t.pages);if(b.defined(t.page))if(b.integer(t.page)&&b.inRange(t.page,0,1e5))a.page=t.page;else throw b.invalidParameterError("page","integer between 0 and 100000",t.page);if(b.object(t.openSlide)&&b.defined(t.openSlide.level))if(b.integer(t.openSlide.level)&&b.inRange(t.openSlide.level,0,256))a.openSlideLevel=t.openSlide.level;else throw b.invalidParameterError("openSlide.level","integer between 0 and 256",t.openSlide.level);else if(b.defined(t.level))if(b.integer(t.level)&&b.inRange(t.level,0,256))a.openSlideLevel=t.level;else throw b.invalidParameterError("level","integer between 0 and 256",t.level);if(b.object(t.tiff)&&b.defined(t.tiff.subifd))if(b.integer(t.tiff.subifd)&&b.inRange(t.tiff.subifd,-1,1e5))a.tiffSubifd=t.tiff.subifd;else throw b.invalidParameterError("tiff.subifd","integer between -1 and 100000",t.tiff.subifd);else if(b.defined(t.subifd))if(b.integer(t.subifd)&&b.inRange(t.subifd,-1,1e5))a.tiffSubifd=t.subifd;else throw b.invalidParameterError("subifd","integer between -1 and 100000",t.subifd);if(b.object(t.svg)){if(b.defined(t.svg.stylesheet))if(b.string(t.svg.stylesheet))a.svgStylesheet=t.svg.stylesheet;else throw b.invalidParameterError("svg.stylesheet","string",t.svg.stylesheet);if(b.defined(t.svg.highBitdepth))if(b.bool(t.svg.highBitdepth))a.svgHighBitdepth=t.svg.highBitdepth;else throw b.invalidParameterError("svg.highBitdepth","boolean",t.svg.highBitdepth)}if(b.object(t.pdf)&&b.defined(t.pdf.background)?a.pdfBackground=this._getBackgroundColourOption(t.pdf.background):b.defined(t.pdfBackground)&&(a.pdfBackground=this._getBackgroundColourOption(t.pdfBackground)),b.object(t.jp2)&&b.defined(t.jp2.oneshot))if(b.bool(t.jp2.oneshot))a.jp2Oneshot=t.jp2.oneshot;else throw b.invalidParameterError("jp2.oneshot","boolean",t.jp2.oneshot);if(b.defined(t.create))if(b.object(t.create)&&b.integer(t.create.width)&&t.create.width>0&&b.integer(t.create.height)&&t.create.height>0&&b.integer(t.create.channels)){if(a.createWidth=t.create.width,a.createHeight=t.create.height,a.createChannels=t.create.channels,a.createPageHeight=0,b.defined(t.create.pageHeight))if(b.integer(t.create.pageHeight)&&t.create.pageHeight>0&&t.create.pageHeight<=t.create.height){if(t.create.height%t.create.pageHeight!==0)throw new Error(`Expected create.height ${t.create.height} to be a multiple of create.pageHeight ${t.create.pageHeight}`);a.createPageHeight=t.create.pageHeight}else throw b.invalidParameterError("create.pageHeight","positive integer",t.create.pageHeight);if(b.defined(t.create.noise)){if(!b.object(t.create.noise))throw new Error("Expected noise to be an object");if(t.create.noise.type!=="gaussian")throw new Error("Only gaussian noise is supported at the moment");if(a.createNoiseType=t.create.noise.type,!b.inRange(t.create.channels,1,4))throw b.invalidParameterError("create.channels","number between 1 and 4",t.create.channels);if(a.createNoiseMean=128,b.defined(t.create.noise.mean))if(b.number(t.create.noise.mean)&&b.inRange(t.create.noise.mean,0,1e4))a.createNoiseMean=t.create.noise.mean;else throw b.invalidParameterError("create.noise.mean","number between 0 and 10000",t.create.noise.mean);if(a.createNoiseSigma=30,b.defined(t.create.noise.sigma))if(b.number(t.create.noise.sigma)&&b.inRange(t.create.noise.sigma,0,1e4))a.createNoiseSigma=t.create.noise.sigma;else throw b.invalidParameterError("create.noise.sigma","number between 0 and 10000",t.create.noise.sigma)}else if(b.defined(t.create.background)){if(!b.inRange(t.create.channels,3,4))throw b.invalidParameterError("create.channels","number between 3 and 4",t.create.channels);a.createBackground=this._getBackgroundColourOption(t.create.background)}else throw new Error("Expected valid noise or background to create a new input image");delete a.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(b.defined(t.text))if(b.object(t.text)&&b.string(t.text.text)){if(a.textValue=t.text.text,b.defined(t.text.height)&&b.defined(t.text.dpi))throw new Error("Expected only one of dpi or height");if(b.defined(t.text.font))if(b.string(t.text.font))a.textFont=t.text.font;else throw b.invalidParameterError("text.font","string",t.text.font);if(b.defined(t.text.fontfile))if(b.string(t.text.fontfile))a.textFontfile=t.text.fontfile;else throw b.invalidParameterError("text.fontfile","string",t.text.fontfile);if(b.defined(t.text.width))if(b.integer(t.text.width)&&t.text.width>0)a.textWidth=t.text.width;else throw b.invalidParameterError("text.width","positive integer",t.text.width);if(b.defined(t.text.height))if(b.integer(t.text.height)&&t.text.height>0)a.textHeight=t.text.height;else throw b.invalidParameterError("text.height","positive integer",t.text.height);if(b.defined(t.text.align))if(b.string(t.text.align)&&b.string(this.constructor.align[t.text.align]))a.textAlign=this.constructor.align[t.text.align];else throw b.invalidParameterError("text.align","valid alignment",t.text.align);if(b.defined(t.text.justify))if(b.bool(t.text.justify))a.textJustify=t.text.justify;else throw b.invalidParameterError("text.justify","boolean",t.text.justify);if(b.defined(t.text.dpi))if(b.integer(t.text.dpi)&&b.inRange(t.text.dpi,1,1e6))a.textDpi=t.text.dpi;else throw b.invalidParameterError("text.dpi","integer between 1 and 1000000",t.text.dpi);if(b.defined(t.text.rgba))if(b.bool(t.text.rgba))a.textRgba=t.text.rgba;else throw b.invalidParameterError("text.rgba","bool",t.text.rgba);if(b.defined(t.text.spacing))if(b.integer(t.text.spacing)&&b.inRange(t.text.spacing,-1e6,1e6))a.textSpacing=t.text.spacing;else throw b.invalidParameterError("text.spacing","integer between -1000000 and 1000000",t.text.spacing);if(b.defined(t.text.wrap))if(b.string(t.text.wrap)&&b.inArray(t.text.wrap,["word","char","word-char","none"]))a.textWrap=t.text.wrap;else throw b.invalidParameterError("text.wrap","one of: word, char, word-char, none",t.text.wrap);delete a.buffer}else throw new Error("Expected a valid string to create an image with text.");if(b.defined(t.join))if(b.defined(this.options.join)){if(b.defined(t.join.animated))if(b.bool(t.join.animated))a.joinAnimated=t.join.animated;else throw b.invalidParameterError("join.animated","boolean",t.join.animated);if(b.defined(t.join.across))if(b.integer(t.join.across)&&b.inRange(t.join.across,1,1e6))a.joinAcross=t.join.across;else throw b.invalidParameterError("join.across","integer between 1 and 100000",t.join.across);if(b.defined(t.join.shim))if(b.integer(t.join.shim)&&b.inRange(t.join.shim,0,1e6))a.joinShim=t.join.shim;else throw b.invalidParameterError("join.shim","integer between 0 and 100000",t.join.shim);if(b.defined(t.join.background)&&(a.joinBackground=this._getBackgroundColourOption(t.join.background)),b.defined(t.join.halign))if(b.string(t.join.halign)&&b.string(this.constructor.align[t.join.halign]))a.joinHalign=this.constructor.align[t.join.halign];else throw b.invalidParameterError("join.halign","valid alignment",t.join.halign);if(b.defined(t.join.valign))if(b.string(t.join.valign)&&b.string(this.constructor.align[t.join.valign]))a.joinValign=this.constructor.align[t.join.valign];else throw b.invalidParameterError("join.valign","valid alignment",t.join.valign)}else throw new Error("Expected input to be an array of images to join")}else if(b.defined(t))throw new Error("Invalid input options "+t);return a}function Tm(e,t,n){Array.isArray(this.options.input.buffer)?b.buffer(e)?(this.options.input.buffer.length===0&&this.on("finish",()=>{this.streamInFinished=!0}),this.options.input.buffer.push(e),n()):n(new Error("Non-Buffer data on Writable Stream")):n(new Error("Unexpected data on Writable Stream"))}function Am(){this._isStreamInput()&&(this.options.input.buffer=Buffer.concat(this.options.input.buffer))}function Cm(){return Array.isArray(this.options.input.buffer)}function Im(e){let t=Error();return b.fn(e)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),pt.metadata(this.options,(n,a)=>{n?e(b.nativeError(n,t)):e(null,a)})}):pt.metadata(this.options,(n,a)=>{n?e(b.nativeError(n,t)):e(null,a)}),this):this._isStreamInput()?new Promise((n,a)=>{let o=()=>{this._flattenBufferIn(),pt.metadata(this.options,(l,f)=>{l?a(b.nativeError(l,t)):n(f)})};this.writableFinished?o():this.once("finish",o)}):new Promise((n,a)=>{pt.metadata(this.options,(o,l)=>{o?a(b.nativeError(o,t)):n(l)})})}function km(e){let t=Error();return b.fn(e)?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),pt.stats(this.options,(n,a)=>{n?e(b.nativeError(n,t)):e(null,a)})}):pt.stats(this.options,(n,a)=>{n?e(b.nativeError(n,t)):e(null,a)}),this):this._isStreamInput()?new Promise((n,a)=>{this.on("finish",function(){this._flattenBufferIn(),pt.stats(this.options,(o,l)=>{o?a(b.nativeError(o,t)):n(l)})})}):new Promise((n,a)=>{pt.stats(this.options,(o,l)=>{o?a(b.nativeError(o,t)):n(l)})})}Zl.exports=function(e){Object.assign(e.prototype,{_inputOptionsFromObject:Kl,_createInputDescriptor:Pm,_write:Tm,_flattenBufferIn:Am,_isStreamInput:Cm,metadata:Im,stats:km}),e.align=vm}});var ou=j((p0,au)=>{"use strict";var A=Be(),ru={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},nu={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},tu={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},iu={entropy:16,attention:17},ua={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3",mks2013:"mks2013",mks2021:"mks2021"},xm={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},Lm={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};function fa(e){return e.angle%360!==0||e.rotationAngle!==0}function Hn(e){return e.width!==-1||e.height!==-1}function jm(e,t,n){if(Hn(this.options)&&this.options.debuglog("ignoring previous resize options"),this.options.widthPost!==-1&&this.options.debuglog("operation order will be: extract, resize, extract"),A.defined(e))if(A.object(e)&&!A.defined(n))n=e;else if(A.integer(e)&&e>0)this.options.width=e;else throw A.invalidParameterError("width","positive integer",e);else this.options.width=-1;if(A.defined(t))if(A.integer(t)&&t>0)this.options.height=t;else throw A.invalidParameterError("height","positive integer",t);else this.options.height=-1;if(A.object(n)){if(A.defined(n.width))if(A.integer(n.width)&&n.width>0)this.options.width=n.width;else throw A.invalidParameterError("width","positive integer",n.width);if(A.defined(n.height))if(A.integer(n.height)&&n.height>0)this.options.height=n.height;else throw A.invalidParameterError("height","positive integer",n.height);if(A.defined(n.fit)){let a=Lm[n.fit];if(A.string(a))this.options.canvas=a;else throw A.invalidParameterError("fit","valid fit",n.fit)}if(A.defined(n.position)){let a=A.integer(n.position)?n.position:iu[n.position]||nu[n.position]||ru[n.position];if(A.integer(a)&&(A.inRange(a,0,8)||A.inRange(a,16,17)))this.options.position=a;else throw A.invalidParameterError("position","valid position/gravity/strategy",n.position)}if(this._setBackgroundColourOption("resizeBackground",n.background),A.defined(n.kernel))if(A.string(ua[n.kernel]))this.options.kernel=ua[n.kernel];else throw A.invalidParameterError("kernel","valid kernel name",n.kernel);A.defined(n.withoutEnlargement)&&this._setBooleanOption("withoutEnlargement",n.withoutEnlargement),A.defined(n.withoutReduction)&&this._setBooleanOption("withoutReduction",n.withoutReduction),A.defined(n.fastShrinkOnLoad)&&this._setBooleanOption("fastShrinkOnLoad",n.fastShrinkOnLoad)}return fa(this.options)&&Hn(this.options)&&(this.options.rotateBefore=!0),this}function Bm(e){if(A.integer(e)&&e>0)this.options.extendTop=e,this.options.extendBottom=e,this.options.extendLeft=e,this.options.extendRight=e;else if(A.object(e)){if(A.defined(e.top))if(A.integer(e.top)&&e.top>=0)this.options.extendTop=e.top;else throw A.invalidParameterError("top","positive integer",e.top);if(A.defined(e.bottom))if(A.integer(e.bottom)&&e.bottom>=0)this.options.extendBottom=e.bottom;else throw A.invalidParameterError("bottom","positive integer",e.bottom);if(A.defined(e.left))if(A.integer(e.left)&&e.left>=0)this.options.extendLeft=e.left;else throw A.invalidParameterError("left","positive integer",e.left);if(A.defined(e.right))if(A.integer(e.right)&&e.right>=0)this.options.extendRight=e.right;else throw A.invalidParameterError("right","positive integer",e.right);if(this._setBackgroundColourOption("extendBackground",e.background),A.defined(e.extendWith))if(A.string(tu[e.extendWith]))this.options.extendWith=tu[e.extendWith];else throw A.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",e.extendWith)}else throw A.invalidParameterError("extend","integer or object",e);return this}function $m(e){let t=Hn(this.options)||this.options.widthPre!==-1?"Post":"Pre";return this.options[`width${t}`]!==-1&&this.options.debuglog("ignoring previous extract options"),["left","top","width","height"].forEach(function(n){let a=e[n];if(A.integer(a)&&a>=0)this.options[n+(n==="left"||n==="top"?"Offset":"")+t]=a;else throw A.invalidParameterError(n,"integer",a)},this),fa(this.options)&&!Hn(this.options)&&(this.options.widthPre===-1||this.options.widthPost===-1)&&(this.options.rotateBefore=!0),this.options.input.autoOrient&&(this.options.orientBefore=!0),this}function qm(e){if(this.options.trimThreshold=10,A.defined(e))if(A.object(e)){if(A.defined(e.background)&&this._setBackgroundColourOption("trimBackground",e.background),A.defined(e.threshold))if(A.number(e.threshold)&&e.threshold>=0)this.options.trimThreshold=e.threshold;else throw A.invalidParameterError("threshold","positive number",e.threshold);A.defined(e.lineArt)&&this._setBooleanOption("trimLineArt",e.lineArt)}else throw A.invalidParameterError("trim","object",e);return fa(this.options)&&(this.options.rotateBefore=!0),this}au.exports=function(e){Object.assign(e.prototype,{resize:jm,extend:Bm,extract:$m,trim:qm}),e.gravity=ru,e.strategy=iu,e.kernel=ua,e.fit=xm,e.position=nu}});var lu=j((y0,su)=>{"use strict";var z=Be(),ca={clear:"clear",source:"source",over:"over",in:"in",out:"out",atop:"atop",dest:"dest","dest-over":"dest-over","dest-in":"dest-in","dest-out":"dest-out","dest-atop":"dest-atop",xor:"xor",add:"add",saturate:"saturate",multiply:"multiply",screen:"screen",overlay:"overlay",darken:"darken",lighten:"lighten","colour-dodge":"colour-dodge","color-dodge":"colour-dodge","colour-burn":"colour-burn","color-burn":"colour-burn","hard-light":"hard-light","soft-light":"soft-light",difference:"difference",exclusion:"exclusion"};function Fm(e){if(!Array.isArray(e))throw z.invalidParameterError("images to composite","array",e);return this.options.composite=e.map(t=>{if(!z.object(t))throw z.invalidParameterError("image to composite","object",t);let n=this._inputOptionsFromObject(t),a={input:this._createInputDescriptor(t.input,n,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(z.defined(t.blend))if(z.string(ca[t.blend]))a.blend=ca[t.blend];else throw z.invalidParameterError("blend","valid blend name",t.blend);if(z.defined(t.tile))if(z.bool(t.tile))a.tile=t.tile;else throw z.invalidParameterError("tile","boolean",t.tile);if(z.defined(t.left))if(z.integer(t.left))a.left=t.left;else throw z.invalidParameterError("left","integer",t.left);if(z.defined(t.top))if(z.integer(t.top))a.top=t.top;else throw z.invalidParameterError("top","integer",t.top);if(z.defined(t.top)!==z.defined(t.left))throw new Error("Expected both left and top to be set");if(a.hasOffset=z.integer(t.top)&&z.integer(t.left),z.defined(t.gravity))if(z.integer(t.gravity)&&z.inRange(t.gravity,0,8))a.gravity=t.gravity;else if(z.string(t.gravity)&&z.integer(this.constructor.gravity[t.gravity]))a.gravity=this.constructor.gravity[t.gravity];else throw z.invalidParameterError("gravity","valid gravity",t.gravity);if(z.defined(t.premultiplied))if(z.bool(t.premultiplied))a.premultiplied=t.premultiplied;else throw z.invalidParameterError("premultiplied","boolean",t.premultiplied);return a}),this}su.exports=function(e){e.prototype.composite=Fm,e.blend=ca}});var hu=j((w0,du)=>{"use strict";var p=Be(),uu={integer:"integer",float:"float",approximate:"approximate"};function Dm(e,t){if(!p.defined(e))return this.autoOrient();if((this.options.angle||this.options.rotationAngle)&&(this.options.debuglog("ignoring previous rotate options"),this.options.angle=0,this.options.rotationAngle=0),p.integer(e)&&!(e%90))this.options.angle=e;else if(p.number(e))this.options.rotationAngle=e,p.object(t)&&t.background&&this._setBackgroundColourOption("rotationBackground",t.background);else throw p.invalidParameterError("angle","numeric",e);return this}function Nm(){return this.options.input.autoOrient=!0,this}function Om(e){return this.options.flip=p.bool(e)?e:!0,this}function Mm(e){return this.options.flop=p.bool(e)?e:!0,this}function Wm(e,t){let n=[].concat(...e);if(n.length===4&&n.every(p.number))this.options.affineMatrix=n;else throw p.invalidParameterError("matrix","1x4 or 2x2 array",e);if(p.defined(t))if(p.object(t)){if(this._setBackgroundColourOption("affineBackground",t.background),p.defined(t.idx))if(p.number(t.idx))this.options.affineIdx=t.idx;else throw p.invalidParameterError("options.idx","number",t.idx);if(p.defined(t.idy))if(p.number(t.idy))this.options.affineIdy=t.idy;else throw p.invalidParameterError("options.idy","number",t.idy);if(p.defined(t.odx))if(p.number(t.odx))this.options.affineOdx=t.odx;else throw p.invalidParameterError("options.odx","number",t.odx);if(p.defined(t.ody))if(p.number(t.ody))this.options.affineOdy=t.ody;else throw p.invalidParameterError("options.ody","number",t.ody);if(p.defined(t.interpolator))if(p.inArray(t.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=t.interpolator;else throw p.invalidParameterError("options.interpolator","valid interpolator name",t.interpolator)}else throw p.invalidParameterError("options","object",t);return this}function zm(e,t,n){if(!p.defined(e))this.options.sharpenSigma=-1;else if(p.bool(e))this.options.sharpenSigma=e?-1:0;else if(p.number(e)&&p.inRange(e,.01,1e4)){if(this.options.sharpenSigma=e,p.defined(t))if(p.number(t)&&p.inRange(t,0,1e4))this.options.sharpenM1=t;else throw p.invalidParameterError("flat","number between 0 and 10000",t);if(p.defined(n))if(p.number(n)&&p.inRange(n,0,1e4))this.options.sharpenM2=n;else throw p.invalidParameterError("jagged","number between 0 and 10000",n)}else if(p.plainObject(e)){if(p.number(e.sigma)&&p.inRange(e.sigma,1e-6,10))this.options.sharpenSigma=e.sigma;else throw p.invalidParameterError("options.sigma","number between 0.000001 and 10",e.sigma);if(p.defined(e.m1))if(p.number(e.m1)&&p.inRange(e.m1,0,1e6))this.options.sharpenM1=e.m1;else throw p.invalidParameterError("options.m1","number between 0 and 1000000",e.m1);if(p.defined(e.m2))if(p.number(e.m2)&&p.inRange(e.m2,0,1e6))this.options.sharpenM2=e.m2;else throw p.invalidParameterError("options.m2","number between 0 and 1000000",e.m2);if(p.defined(e.x1))if(p.number(e.x1)&&p.inRange(e.x1,0,1e6))this.options.sharpenX1=e.x1;else throw p.invalidParameterError("options.x1","number between 0 and 1000000",e.x1);if(p.defined(e.y2))if(p.number(e.y2)&&p.inRange(e.y2,0,1e6))this.options.sharpenY2=e.y2;else throw p.invalidParameterError("options.y2","number between 0 and 1000000",e.y2);if(p.defined(e.y3))if(p.number(e.y3)&&p.inRange(e.y3,0,1e6))this.options.sharpenY3=e.y3;else throw p.invalidParameterError("options.y3","number between 0 and 1000000",e.y3)}else throw p.invalidParameterError("sigma","number between 0.01 and 10000",e);return this}function Um(e){if(!p.defined(e))this.options.medianSize=3;else if(p.integer(e)&&p.inRange(e,1,1e3))this.options.medianSize=e;else throw p.invalidParameterError("size","integer between 1 and 1000",e);return this}function Hm(e){let t;if(p.number(e))t=e;else if(p.plainObject(e)){if(!p.number(e.sigma))throw p.invalidParameterError("options.sigma","number between 0.3 and 1000",t);if(t=e.sigma,"precision"in e)if(p.string(uu[e.precision]))this.options.precision=uu[e.precision];else throw p.invalidParameterError("precision","one of: integer, float, approximate",e.precision);if("minAmplitude"in e)if(p.number(e.minAmplitude)&&p.inRange(e.minAmplitude,.001,1))this.options.minAmpl=e.minAmplitude;else throw p.invalidParameterError("minAmplitude","number between 0.001 and 1",e.minAmplitude)}if(!p.defined(e))this.options.blurSigma=-1;else if(p.bool(e))this.options.blurSigma=e?-1:0;else if(p.number(t)&&p.inRange(t,.3,1e3))this.options.blurSigma=t;else throw p.invalidParameterError("sigma","number between 0.3 and 1000",t);return this}function fu(e){if(!p.defined(e))this.options.dilateWidth=1;else if(p.integer(e)&&e>0)this.options.dilateWidth=e;else throw p.invalidParameterError("dilate","positive integer",fu);return this}function cu(e){if(!p.defined(e))this.options.erodeWidth=1;else if(p.integer(e)&&e>0)this.options.erodeWidth=e;else throw p.invalidParameterError("erode","positive integer",cu);return this}function Gm(e){return this.options.flatten=p.bool(e)?e:!0,p.object(e)&&this._setBackgroundColourOption("flattenBackground",e.background),this}function Vm(){return this.options.unflatten=!0,this}function Qm(e,t){if(!p.defined(e))this.options.gamma=2.2;else if(p.number(e)&&p.inRange(e,1,3))this.options.gamma=e;else throw p.invalidParameterError("gamma","number between 1.0 and 3.0",e);if(!p.defined(t))this.options.gammaOut=this.options.gamma;else if(p.number(t)&&p.inRange(t,1,3))this.options.gammaOut=t;else throw p.invalidParameterError("gammaOut","number between 1.0 and 3.0",t);return this}function Ym(e){if(this.options.negate=p.bool(e)?e:!0,p.plainObject(e)&&"alpha"in e)if(p.bool(e.alpha))this.options.negateAlpha=e.alpha;else throw p.invalidParameterError("alpha","should be boolean value",e.alpha);return this}function Xm(e){if(p.plainObject(e)){if(p.defined(e.lower))if(p.number(e.lower)&&p.inRange(e.lower,0,99))this.options.normaliseLower=e.lower;else throw p.invalidParameterError("lower","number between 0 and 99",e.lower);if(p.defined(e.upper))if(p.number(e.upper)&&p.inRange(e.upper,1,100))this.options.normaliseUpper=e.upper;else throw p.invalidParameterError("upper","number between 1 and 100",e.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw p.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this}function Jm(e){return this.normalise(e)}function Km(e){if(p.plainObject(e)){if(p.integer(e.width)&&e.width>0)this.options.claheWidth=e.width;else throw p.invalidParameterError("width","integer greater than zero",e.width);if(p.integer(e.height)&&e.height>0)this.options.claheHeight=e.height;else throw p.invalidParameterError("height","integer greater than zero",e.height);if(p.defined(e.maxSlope))if(p.integer(e.maxSlope)&&p.inRange(e.maxSlope,0,100))this.options.claheMaxSlope=e.maxSlope;else throw p.invalidParameterError("maxSlope","integer between 0 and 100",e.maxSlope)}else throw p.invalidParameterError("options","plain object",e);return this}function Zm(e){if(!p.object(e)||!Array.isArray(e.kernel)||!p.integer(e.width)||!p.integer(e.height)||!p.inRange(e.width,3,1001)||!p.inRange(e.height,3,1001)||e.height*e.width!==e.kernel.length)throw new Error("Invalid convolution kernel");return p.integer(e.scale)||(e.scale=e.kernel.reduce(function(t,n){return t+n},0)),e.scale<1&&(e.scale=1),p.integer(e.offset)||(e.offset=0),this.options.convKernel=e,this}function eb(e,t){if(!p.defined(e))this.options.threshold=128;else if(p.bool(e))this.options.threshold=e?128:0;else if(p.integer(e)&&p.inRange(e,0,255))this.options.threshold=e;else throw p.invalidParameterError("threshold","integer between 0 and 255",e);return!p.object(t)||t.greyscale===!0||t.grayscale===!0?this.options.thresholdGrayscale=!0:this.options.thresholdGrayscale=!1,this}function tb(e,t,n){if(this.options.boolean=this._createInputDescriptor(e,n),p.string(t)&&p.inArray(t,["and","or","eor"]))this.options.booleanOp=t;else throw p.invalidParameterError("operator","one of: and, or, eor",t);return this}function rb(e,t){if(!p.defined(e)&&p.number(t)?e=1:p.number(e)&&!p.defined(t)&&(t=0),!p.defined(e))this.options.linearA=[];else if(p.number(e))this.options.linearA=[e];else if(Array.isArray(e)&&e.length&&e.every(p.number))this.options.linearA=e;else throw p.invalidParameterError("a","number or array of numbers",e);if(!p.defined(t))this.options.linearB=[];else if(p.number(t))this.options.linearB=[t];else if(Array.isArray(t)&&t.length&&t.every(p.number))this.options.linearB=t;else throw p.invalidParameterError("b","number or array of numbers",t);if(this.options.linearA.length!==this.options.linearB.length)throw new Error("Expected a and b to be arrays of the same length");return this}function nb(e){if(!Array.isArray(e))throw p.invalidParameterError("inputMatrix","array",e);if(e.length!==3&&e.length!==4)throw p.invalidParameterError("inputMatrix","3x3 or 4x4 array",e.length);let t=e.flat().map(Number);if(t.length!==9&&t.length!==16)throw p.invalidParameterError("inputMatrix","cardinality of 9 or 16",t.length);return this.options.recombMatrix=t,this}function ib(e){if(!p.plainObject(e))throw p.invalidParameterError("options","plain object",e);if("brightness"in e)if(p.number(e.brightness)&&e.brightness>=0)this.options.brightness=e.brightness;else throw p.invalidParameterError("brightness","number above zero",e.brightness);if("saturation"in e)if(p.number(e.saturation)&&e.saturation>=0)this.options.saturation=e.saturation;else throw p.invalidParameterError("saturation","number above zero",e.saturation);if("hue"in e)if(p.integer(e.hue))this.options.hue=e.hue%360;else throw p.invalidParameterError("hue","number",e.hue);if("lightness"in e)if(p.number(e.lightness))this.options.lightness=e.lightness;else throw p.invalidParameterError("lightness","number",e.lightness);return this}du.exports=function(e){Object.assign(e.prototype,{autoOrient:Nm,rotate:Dm,flip:Om,flop:Mm,affine:Wm,sharpen:zm,erode:cu,dilate:fu,median:Um,blur:Hm,flatten:Gm,unflatten:Vm,gamma:Qm,negate:Ym,normalise:Xm,normalize:Jm,clahe:Km,convolve:Zm,threshold:eb,boolean:tb,linear:rb,recomb:nb,modulate:ib})}});var wu=j((E0,yu)=>{"use strict";var ma=Object.defineProperty,ab=Object.getOwnPropertyDescriptor,ob=Object.getOwnPropertyNames,sb=Object.prototype.hasOwnProperty,lb=(e,t)=>{for(var n in t)ma(e,n,{get:t[n],enumerable:!0})},ub=(e,t,n,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of ob(t))!sb.call(e,o)&&o!==n&&ma(e,o,{get:()=>t[o],enumerable:!(a=ab(t,o))||a.enumerable});return e},fb=e=>ub(ma({},"__esModule",{value:!0}),e),mu={};lb(mu,{default:()=>Rb});yu.exports=fb(mu);var Ne={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},bu=Object.create(null);for(let e in Ne)Object.hasOwn(Ne,e)&&(bu[Ne[e]]=e);var ce={to:{},get:{}};ce.get=function(e){let t=e.slice(0,3).toLowerCase(),n,a;switch(t){case"hsl":{n=ce.get.hsl(e),a="hsl";break}case"hwb":{n=ce.get.hwb(e),a="hwb";break}default:{n=ce.get.rgb(e),a="rgb";break}}return n?{model:a,value:n}:null};ce.get.rgb=function(e){if(!e)return null;let t=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,a=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,l=/^(\w+)$/,f=[0,0,0,1],h,d,g;if(h=e.match(n)){for(g=h[2],h=h[1],d=0;d<3;d++){let w=d*2;f[d]=Number.parseInt(h.slice(w,w+2),16)}g&&(f[3]=Number.parseInt(g,16)/255)}else if(h=e.match(t)){for(h=h[1],g=h[3],d=0;d<3;d++)f[d]=Number.parseInt(h[d]+h[d],16);g&&(f[3]=Number.parseInt(g+g,16)/255)}else if(h=e.match(a)){for(d=0;d<3;d++)f[d]=Number.parseInt(h[d+1],10);h[4]&&(f[3]=h[5]?Number.parseFloat(h[4])*.01:Number.parseFloat(h[4]))}else if(h=e.match(o)){for(d=0;d<3;d++)f[d]=Math.round(Number.parseFloat(h[d+1])*2.55);h[4]&&(f[3]=h[5]?Number.parseFloat(h[4])*.01:Number.parseFloat(h[4]))}else return(h=e.match(l))?h[1]==="transparent"?[0,0,0,0]:Object.hasOwn(Ne,h[1])?(f=Ne[h[1]],f[3]=1,f):null:null;for(d=0;d<3;d++)f[d]=yt(f[d],0,255);return f[3]=yt(f[3],0,1),f};ce.get.hsl=function(e){if(!e)return null;let t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){let a=Number.parseFloat(n[4]),o=(Number.parseFloat(n[1])%360+360)%360,l=yt(Number.parseFloat(n[2]),0,100),f=yt(Number.parseFloat(n[3]),0,100),h=yt(Number.isNaN(a)?1:a,0,1);return[o,l,f,h]}return null};ce.get.hwb=function(e){if(!e)return null;let t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){let a=Number.parseFloat(n[4]),o=(Number.parseFloat(n[1])%360+360)%360,l=yt(Number.parseFloat(n[2]),0,100),f=yt(Number.parseFloat(n[3]),0,100),h=yt(Number.isNaN(a)?1:a,0,1);return[o,l,f,h]}return null};ce.to.hex=function(...e){return"#"+Gn(e[0])+Gn(e[1])+Gn(e[2])+(e[3]<1?Gn(Math.round(e[3]*255)):"")};ce.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};ce.to.rgb.percent=function(...e){let t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),a=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+a+"%)":"rgba("+t+"%, "+n+"%, "+a+"%, "+e[3]+")"};ce.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};ce.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};ce.to.keyword=function(...e){return bu[e.slice(0,3)]};function yt(e,t,n){return Math.min(Math.max(t,e),n)}function Gn(e){let t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}var sr=ce,gu={};for(let e of Object.keys(Ne))gu[Ne[e]]=e;var v={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},Dt=v,tt=(6/29)**3;function ur(e){let t=e>.0031308?1.055*e**.4166666666666667-.055:e*12.92;return Math.min(Math.max(0,t),1)}function fr(e){return e>.04045?((e+.055)/1.055)**2.4:e/12.92}for(let e of Object.keys(v)){if(!("channels"in v[e]))throw new Error("missing channels property: "+e);if(!("labels"in v[e]))throw new Error("missing channel labels property: "+e);if(v[e].labels.length!==v[e].channels)throw new Error("channel and label counts mismatch: "+e);let{channels:t,labels:n}=v[e];delete v[e].channels,delete v[e].labels,Object.defineProperty(v[e],"channels",{value:t}),Object.defineProperty(v[e],"labels",{value:n})}v.rgb.hsl=function(e){let t=e[0]/255,n=e[1]/255,a=e[2]/255,o=Math.min(t,n,a),l=Math.max(t,n,a),f=l-o,h,d;switch(l){case o:{h=0;break}case t:{h=(n-a)/f;break}case n:{h=2+(a-t)/f;break}case a:{h=4+(t-n)/f;break}}h=Math.min(h*60,360),h<0&&(h+=360);let g=(o+l)/2;return l===o?d=0:g<=.5?d=f/(l+o):d=f/(2-l-o),[h,d*100,g*100]};v.rgb.hsv=function(e){let t,n,a,o,l,f=e[0]/255,h=e[1]/255,d=e[2]/255,g=Math.max(f,h,d),w=g-Math.min(f,h,d),T=function(k){return(g-k)/6/w+1/2};if(w===0)o=0,l=0;else{switch(l=w/g,t=T(f),n=T(h),a=T(d),g){case f:{o=a-n;break}case h:{o=1/3+t-a;break}case d:{o=2/3+n-t;break}}o<0?o+=1:o>1&&(o-=1)}return[o*360,l*100,g*100]};v.rgb.hwb=function(e){let t=e[0],n=e[1],a=e[2],o=v.rgb.hsl(e)[0],l=1/255*Math.min(t,Math.min(n,a));return a=1-1/255*Math.max(t,Math.max(n,a)),[o,l*100,a*100]};v.rgb.oklab=function(e){let t=fr(e[0]/255),n=fr(e[1]/255),a=fr(e[2]/255),o=Math.cbrt(.4122214708*t+.5363325363*n+.0514459929*a),l=Math.cbrt(.2119034982*t+.6806995451*n+.1073969566*a),f=Math.cbrt(.0883024619*t+.2817188376*n+.6299787005*a),h=.2104542553*o+.793617785*l-.0040720468*f,d=1.9779984951*o-2.428592205*l+.4505937099*f,g=.0259040371*o+.7827717662*l-.808675766*f;return[h*100,d*100,g*100]};v.rgb.cmyk=function(e){let t=e[0]/255,n=e[1]/255,a=e[2]/255,o=Math.min(1-t,1-n,1-a),l=(1-t-o)/(1-o)||0,f=(1-n-o)/(1-o)||0,h=(1-a-o)/(1-o)||0;return[l*100,f*100,h*100,o*100]};function cb(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}v.rgb.keyword=function(e){let t=gu[e];if(t)return t;let n=Number.POSITIVE_INFINITY,a;for(let o of Object.keys(Ne)){let l=Ne[o],f=cb(e,l);f<n&&(n=f,a=o)}return a};v.keyword.rgb=function(e){return Ne[e]};v.rgb.xyz=function(e){let t=fr(e[0]/255),n=fr(e[1]/255),a=fr(e[2]/255),o=t*.4124564+n*.3575761+a*.1804375,l=t*.2126729+n*.7151522+a*.072175,f=t*.0193339+n*.119192+a*.9503041;return[o*100,l*100,f*100]};v.rgb.lab=function(e){let t=v.rgb.xyz(e),n=t[0],a=t[1],o=t[2];n/=95.047,a/=100,o/=108.883,n=n>tt?n**(1/3):7.787*n+16/116,a=a>tt?a**(1/3):7.787*a+16/116,o=o>tt?o**(1/3):7.787*o+16/116;let l=116*a-16,f=500*(n-a),h=200*(a-o);return[l,f,h]};v.hsl.rgb=function(e){let t=e[0]/360,n=e[1]/100,a=e[2]/100,o,l;if(n===0)return l=a*255,[l,l,l];let f=a<.5?a*(1+n):a+n-a*n,h=2*a-f,d=[0,0,0];for(let g=0;g<3;g++)o=t+1/3*-(g-1),o<0&&o++,o>1&&o--,6*o<1?l=h+(f-h)*6*o:2*o<1?l=f:3*o<2?l=h+(f-h)*(2/3-o)*6:l=h,d[g]=l*255;return d};v.hsl.hsv=function(e){let t=e[0],n=e[1]/100,a=e[2]/100,o=n,l=Math.max(a,.01);a*=2,n*=a<=1?a:2-a,o*=l<=1?l:2-l;let f=(a+n)/2,h=a===0?2*o/(l+o):2*n/(a+n);return[t,h*100,f*100]};v.hsv.rgb=function(e){let t=e[0]/60,n=e[1]/100,a=e[2]/100,o=Math.floor(t)%6,l=t-Math.floor(t),f=255*a*(1-n),h=255*a*(1-n*l),d=255*a*(1-n*(1-l));switch(a*=255,o){case 0:return[a,d,f];case 1:return[h,a,f];case 2:return[f,a,d];case 3:return[f,h,a];case 4:return[d,f,a];case 5:return[a,f,h]}};v.hsv.hsl=function(e){let t=e[0],n=e[1]/100,a=e[2]/100,o=Math.max(a,.01),l,f;f=(2-n)*a;let h=(2-n)*o;return l=n*o,l/=h<=1?h:2-h,l=l||0,f/=2,[t,l*100,f*100]};v.hwb.rgb=function(e){let t=e[0]/360,n=e[1]/100,a=e[2]/100,o=n+a,l;o>1&&(n/=o,a/=o);let f=Math.floor(6*t),h=1-a;l=6*t-f,(f&1)!==0&&(l=1-l);let d=n+l*(h-n),g,w,T;switch(f){default:case 6:case 0:{g=h,w=d,T=n;break}case 1:{g=d,w=h,T=n;break}case 2:{g=n,w=h,T=d;break}case 3:{g=n,w=d,T=h;break}case 4:{g=d,w=n,T=h;break}case 5:{g=h,w=n,T=d;break}}return[g*255,w*255,T*255]};v.cmyk.rgb=function(e){let t=e[0]/100,n=e[1]/100,a=e[2]/100,o=e[3]/100,l=1-Math.min(1,t*(1-o)+o),f=1-Math.min(1,n*(1-o)+o),h=1-Math.min(1,a*(1-o)+o);return[l*255,f*255,h*255]};v.xyz.rgb=function(e){let t=e[0]/100,n=e[1]/100,a=e[2]/100,o,l,f;return o=t*3.2404542+n*-1.5371385+a*-.4985314,l=t*-.969266+n*1.8760108+a*.041556,f=t*.0556434+n*-.2040259+a*1.0572252,o=ur(o),l=ur(l),f=ur(f),[o*255,l*255,f*255]};v.xyz.lab=function(e){let t=e[0],n=e[1],a=e[2];t/=95.047,n/=100,a/=108.883,t=t>tt?t**(1/3):7.787*t+16/116,n=n>tt?n**(1/3):7.787*n+16/116,a=a>tt?a**(1/3):7.787*a+16/116;let o=116*n-16,l=500*(t-n),f=200*(n-a);return[o,l,f]};v.xyz.oklab=function(e){let t=e[0]/100,n=e[1]/100,a=e[2]/100,o=Math.cbrt(.8189330101*t+.3618667424*n-.1288597137*a),l=Math.cbrt(.0329845436*t+.9293118715*n+.0361456387*a),f=Math.cbrt(.0482003018*t+.2643662691*n+.633851707*a),h=.2104542553*o+.793617785*l-.0040720468*f,d=1.9779984951*o-2.428592205*l+.4505937099*f,g=.0259040371*o+.7827717662*l-.808675766*f;return[h*100,d*100,g*100]};v.oklab.oklch=function(e){return v.lab.lch(e)};v.oklab.xyz=function(e){let t=e[0]/100,n=e[1]/100,a=e[2]/100,o=(.999999998*t+.396337792*n+.215803758*a)**3,l=(1.000000008*t-.105561342*n-.063854175*a)**3,f=(1.000000055*t-.089484182*n-1.291485538*a)**3,h=1.227013851*o-.55779998*l+.281256149*f,d=-.040580178*o+1.11225687*l-.071676679*f,g=-.076381285*o-.421481978*l+1.58616322*f;return[h*100,d*100,g*100]};v.oklab.rgb=function(e){let t=e[0]/100,n=e[1]/100,a=e[2]/100,o=(t+.3963377774*n+.2158037573*a)**3,l=(t-.1055613458*n-.0638541728*a)**3,f=(t-.0894841775*n-1.291485548*a)**3,h=ur(4.0767416621*o-3.3077115913*l+.2309699292*f),d=ur(-1.2684380046*o+2.6097574011*l-.3413193965*f),g=ur(-.0041960863*o-.7034186147*l+1.707614701*f);return[h*255,d*255,g*255]};v.oklch.oklab=function(e){return v.lch.lab(e)};v.lab.xyz=function(e){let t=e[0],n=e[1],a=e[2],o,l,f;l=(t+16)/116,o=n/500+l,f=l-a/200;let h=l**3,d=o**3,g=f**3;return l=h>tt?h:(l-16/116)/7.787,o=d>tt?d:(o-16/116)/7.787,f=g>tt?g:(f-16/116)/7.787,o*=95.047,l*=100,f*=108.883,[o,l,f]};v.lab.lch=function(e){let t=e[0],n=e[1],a=e[2],o;o=Math.atan2(a,n)*360/2/Math.PI,o<0&&(o+=360);let f=Math.sqrt(n*n+a*a);return[t,f,o]};v.lch.lab=function(e){let t=e[0],n=e[1],o=e[2]/360*2*Math.PI,l=n*Math.cos(o),f=n*Math.sin(o);return[t,l,f]};v.rgb.ansi16=function(e,t=null){let[n,a,o]=e,l=t===null?v.rgb.hsv(e)[2]:t;if(l=Math.round(l/50),l===0)return 30;let f=30+(Math.round(o/255)<<2|Math.round(a/255)<<1|Math.round(n/255));return l===2&&(f+=60),f};v.hsv.ansi16=function(e){return v.rgb.ansi16(v.hsv.rgb(e),e[2])};v.rgb.ansi256=function(e){let t=e[0],n=e[1],a=e[2];return t>>4===n>>4&&n>>4===a>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(a/255*5)};v.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];let n=(Math.trunc(e>50)+1)*.5,a=(t&1)*n*255,o=(t>>1&1)*n*255,l=(t>>2&1)*n*255;return[a,o,l]};v.ansi256.rgb=function(e){if(e=e[0],e>=232){let l=(e-232)*10+8;return[l,l,l]}e-=16;let t,n=Math.floor(e/36)/5*255,a=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,a,o]};v.rgb.hex=function(e){let n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(n.length)+n};v.hex.rgb=function(e){let t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=[...n].map(h=>h+h).join(""));let a=Number.parseInt(n,16),o=a>>16&255,l=a>>8&255,f=a&255;return[o,l,f]};v.rgb.hcg=function(e){let t=e[0]/255,n=e[1]/255,a=e[2]/255,o=Math.max(Math.max(t,n),a),l=Math.min(Math.min(t,n),a),f=o-l,h,d=f<1?l/(1-f):0;return f<=0?h=0:o===t?h=(n-a)/f%6:o===n?h=2+(a-t)/f:h=4+(t-n)/f,h/=6,h%=1,[h*360,f*100,d*100]};v.hsl.hcg=function(e){let t=e[1]/100,n=e[2]/100,a=n<.5?2*t*n:2*t*(1-n),o=0;return a<1&&(o=(n-.5*a)/(1-a)),[e[0],a*100,o*100]};v.hsv.hcg=function(e){let t=e[1]/100,n=e[2]/100,a=t*n,o=0;return a<1&&(o=(n-a)/(1-a)),[e[0],a*100,o*100]};v.hcg.rgb=function(e){let t=e[0]/360,n=e[1]/100,a=e[2]/100;if(n===0)return[a*255,a*255,a*255];let o=[0,0,0],l=t%1*6,f=l%1,h=1-f,d=0;switch(Math.floor(l)){case 0:{o[0]=1,o[1]=f,o[2]=0;break}case 1:{o[0]=h,o[1]=1,o[2]=0;break}case 2:{o[0]=0,o[1]=1,o[2]=f;break}case 3:{o[0]=0,o[1]=h,o[2]=1;break}case 4:{o[0]=f,o[1]=0,o[2]=1;break}default:o[0]=1,o[1]=0,o[2]=h}return d=(1-n)*a,[(n*o[0]+d)*255,(n*o[1]+d)*255,(n*o[2]+d)*255]};v.hcg.hsv=function(e){let t=e[1]/100,n=e[2]/100,a=t+n*(1-t),o=0;return a>0&&(o=t/a),[e[0],o*100,a*100]};v.hcg.hsl=function(e){let t=e[1]/100,a=e[2]/100*(1-t)+.5*t,o=0;return a>0&&a<.5?o=t/(2*a):a>=.5&&a<1&&(o=t/(2*(1-a))),[e[0],o*100,a*100]};v.hcg.hwb=function(e){let t=e[1]/100,n=e[2]/100,a=t+n*(1-t);return[e[0],(a-t)*100,(1-a)*100]};v.hwb.hcg=function(e){let t=e[1]/100,a=1-e[2]/100,o=a-t,l=0;return o<1&&(l=(a-o)/(1-o)),[e[0],o*100,l*100]};v.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};v.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};v.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};v.gray.hsl=function(e){return[0,0,e[0]]};v.gray.hsv=v.gray.hsl;v.gray.hwb=function(e){return[0,100,e[0]]};v.gray.cmyk=function(e){return[0,0,0,e[0]]};v.gray.lab=function(e){return[e[0],0,0]};v.gray.hex=function(e){let t=Math.round(e[0]/100*255)&255,a=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(a.length)+a};v.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function db(){let e={},t=Object.keys(Dt);for(let{length:n}=t,a=0;a<n;a++)e[t[a]]={distance:-1,parent:null};return e}function hb(e){let t=db(),n=[e];for(t[e].distance=0;n.length>0;){let a=n.pop(),o=Object.keys(Dt[a]);for(let{length:l}=o,f=0;f<l;f++){let h=o[f],d=t[h];d.distance===-1&&(d.distance=t[a].distance+1,d.parent=a,n.unshift(h))}}return t}function mb(e,t){return function(n){return t(e(n))}}function bb(e,t){let n=[t[e].parent,e],a=Dt[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)n.unshift(t[o].parent),a=mb(Dt[t[o].parent][o],a),o=t[o].parent;return a.conversion=n,a}function gb(e){let t=hb(e),n={},a=Object.keys(t);for(let{length:o}=a,l=0;l<o;l++){let f=a[l];t[f].parent!==null&&(n[f]=bb(f,t))}return n}var pb=gb,lr={},yb=Object.keys(Dt);function wb(e){let t=function(...n){let a=n[0];return a==null?a:(a.length>1&&(n=a),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function Eb(e){let t=function(...n){let a=n[0];if(a==null)return a;a.length>1&&(n=a);let o=e(n);if(typeof o=="object")for(let{length:l}=o,f=0;f<l;f++)o[f]=Math.round(o[f]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}for(let e of yb){lr[e]={},Object.defineProperty(lr[e],"channels",{value:Dt[e].channels}),Object.defineProperty(lr[e],"labels",{value:Dt[e].labels});let t=pb(e),n=Object.keys(t);for(let a of n){let o=t[a];lr[e][a]=Eb(o),lr[e][a].raw=wb(o)}}var pe=lr,pu=["keyword","gray","hex"],da={};for(let e of Object.keys(pe))da[[...pe[e].labels].sort().join("")]=e;var Or={};function ee(e,t){if(!(this instanceof ee))return new ee(e,t);if(t&&t in pu&&(t=null),t&&!(t in pe))throw new Error("Unknown model: "+t);let n,a;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof ee)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){let o=sr.get(e);if(o===null)throw new Error("Unable to parse color from string: "+e);this.model=o.model,a=pe[this.model].channels,this.color=o.value.slice(0,a),this.valpha=typeof o.value[a]=="number"?o.value[a]:1}else if(e.length>0){this.model=t||"rgb",a=pe[this.model].channels;let o=Array.prototype.slice.call(e,0,a);this.color=ha(o,a),this.valpha=typeof e[a]=="number"?e[a]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;let o=Object.keys(e);"alpha"in e&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);let l=o.sort().join("");if(!(l in da))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=da[l];let{labels:f}=pe[this.model],h=[];for(n=0;n<f.length;n++)h.push(e[f[n]]);this.color=ha(h)}if(Or[this.model])for(a=pe[this.model].channels,n=0;n<a;n++){let o=Or[this.model][n];o&&(this.color[n]=o(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}ee.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in sr.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);let n=t.valpha===1?t.color:[...t.color,this.valpha];return sr.to[t.model](...n)},percentString(e){let t=this.rgb().round(typeof e=="number"?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return sr.to.rgb.percent(...n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){let e={},{channels:t}=pe[this.model],{labels:n}=pe[this.model];for(let a=0;a<t;a++)e[n[a]]=this.color[a];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){let e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){let e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new ee([...this.color.map(_b(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new ee([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:X("rgb",0,K(255)),green:X("rgb",1,K(255)),blue:X("rgb",2,K(255)),hue:X(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:X("hsl",1,K(100)),lightness:X("hsl",2,K(100)),saturationv:X("hsv",1,K(100)),value:X("hsv",2,K(100)),chroma:X("hcg",1,K(100)),gray:X("hcg",2,K(100)),white:X("hwb",1,K(100)),wblack:X("hwb",2,K(100)),cyan:X("cmyk",0,K(100)),magenta:X("cmyk",1,K(100)),yellow:X("cmyk",2,K(100)),black:X("cmyk",3,K(100)),x:X("xyz",0,K(95.047)),y:X("xyz",1,K(100)),z:X("xyz",2,K(108.833)),l:X("lab",0,K(100)),a:X("lab",1),b:X("lab",2),keyword(e){return e!==void 0?new ee(e):pe[this.model].keyword(this.color)},hex(e){return e!==void 0?new ee(e):sr.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new ee(e);let t=this.rgb().round().color,n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n="0"+n),sr.to.hex(...t)+n},rgbNumber(){let e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){let e=this.rgb().color,t=[];for(let[n,a]of e.entries()){let o=a/255;t[n]=o<=.04045?o/12.92:((o+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){let t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){let t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){let e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){let e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){let t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){let t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){let t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){let t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){let t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){let t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){let e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return ee.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){let t=this.hsl(),n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);let n=e.rgb(),a=this.rgb(),o=t===void 0?.5:t,l=2*o-1,f=n.alpha()-a.alpha(),h=((l*f===-1?l:(l+f)/(1+l*f))+1)/2,d=1-h;return ee.rgb(h*n.red()+d*a.red(),h*n.green()+d*a.green(),h*n.blue()+d*a.blue(),n.alpha()*o+a.alpha()*(1-o))}};for(let e of Object.keys(pe)){if(pu.includes(e))continue;let{channels:t}=pe[e];ee.prototype[e]=function(...n){return this.model===e?new ee(this):n.length>0?new ee(n,e):new ee([...vb(pe[this.model][e].raw(this.color)),this.valpha],e)},ee[e]=function(...n){let a=n[0];return typeof a=="number"&&(a=ha(n,t)),new ee(a,e)}}function Sb(e,t){return Number(e.toFixed(t))}function _b(e){return function(t){return Sb(t,e)}}function X(e,t,n){e=Array.isArray(e)?e:[e];for(let a of e)(Or[a]||(Or[a]=[]))[t]=n;return e=e[0],function(a){let o;return a!==void 0?(n&&(a=n(a)),o=this[e](),o.color[t]=a,o):(o=this[e]().color[t],n&&(o=n(o)),o)}}function K(e){return function(t){return Math.max(0,Math.min(e,t))}}function vb(e){return Array.isArray(e)?e:[e]}function ha(e,t){for(let n=0;n<t;n++)typeof e[n]!="number"&&(e[n]=0);return e}var Rb=ee});var Su=j((S0,Eu)=>{"use strict";Eu.exports=wu().default});var Pu=j((_0,Ru)=>{"use strict";var Pb=Su(),rt=Be(),_u={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};function Tb(e){return this._setBackgroundColourOption("tint",e),this}function Ab(e){return this.options.greyscale=rt.bool(e)?e:!0,this}function Cb(e){return this.greyscale(e)}function Ib(e){if(!rt.string(e))throw rt.invalidParameterError("colourspace","string",e);return this.options.colourspacePipeline=e,this}function kb(e){return this.pipelineColourspace(e)}function xb(e){if(!rt.string(e))throw rt.invalidParameterError("colourspace","string",e);return this.options.colourspace=e,this}function Lb(e){return this.toColourspace(e)}function vu(e){if(rt.object(e)||rt.string(e)){let t=Pb(e);return[t.red(),t.green(),t.blue(),Math.round(t.alpha()*255)]}else throw rt.invalidParameterError("background","object or string",e)}function jb(e,t){rt.defined(t)&&(this.options[e]=vu(t))}Ru.exports=function(e){Object.assign(e.prototype,{tint:Tb,greyscale:Ab,grayscale:Cb,pipelineColourspace:Ib,pipelineColorspace:kb,toColourspace:xb,toColorspace:Lb,_getBackgroundColourOption:vu,_setBackgroundColourOption:jb}),e.colourspace=_u,e.colorspace=_u}});var Au=j((v0,Tu)=>{"use strict";var Oe=Be(),Bb={and:"and",or:"or",eor:"eor"};function $b(){return this.options.removeAlpha=!0,this}function qb(e){if(Oe.defined(e))if(Oe.number(e)&&Oe.inRange(e,0,1))this.options.ensureAlpha=e;else throw Oe.invalidParameterError("alpha","number between 0 and 1",e);else this.options.ensureAlpha=1;return this}function Fb(e){let t={red:0,green:1,blue:2,alpha:3};if(Object.keys(t).includes(e)&&(e=t[e]),Oe.integer(e)&&Oe.inRange(e,0,4))this.options.extractChannel=e;else throw Oe.invalidParameterError("channel","integer or one of: red, green, blue, alpha",e);return this}function Db(e,t){return Array.isArray(e)?e.forEach(function(n){this.options.joinChannelIn.push(this._createInputDescriptor(n,t))},this):this.options.joinChannelIn.push(this._createInputDescriptor(e,t)),this}function Nb(e){if(Oe.string(e)&&Oe.inArray(e,["and","or","eor"]))this.options.bandBoolOp=e;else throw Oe.invalidParameterError("boolOp","one of: and, or, eor",e);return this}Tu.exports=function(e){Object.assign(e.prototype,{removeAlpha:$b,ensureAlpha:qb,extractChannel:Fb,joinChannel:Db,bandbool:Nb}),e.bool=Bb}});var Lu=j((R0,xu)=>{"use strict";var u=Be(),cr=Nr(),Cu=new Map([["heic","heif"],["heif","heif"],["avif","avif"],["jpeg","jpeg"],["jpg","jpeg"],["jpe","jpeg"],["tile","tile"],["dz","tile"],["png","png"],["raw","raw"],["tiff","tiff"],["tif","tiff"],["webp","webp"],["gif","gif"],["jp2","jp2"],["jpx","jp2"],["j2k","jp2"],["j2c","jp2"],["jxl","jxl"]]),Ob=/\.(jp[2x]|j2[kc])$/i,Iu=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),ku=e=>1<<31-Math.clz32(Math.ceil(Math.log2(e)));function Mb(e,t){let n;if(u.string(e)?u.string(this.options.input.file)&&zc.resolve(this.options.input.file)===zc.resolve(e)?n=new Error("Cannot use same file for input and output"):Ob.test(zc.extname(e))&&!this.constructor.format.jp2k.output.file&&(n=Iu()):n=new Error("Missing output file path"),n)if(u.fn(t))t(n);else return Promise.reject(n);else{this.options.fileOut=e;let a=Error();return this._pipeline(t,a)}return this}function Wb(e,t){u.object(e)?this._setBooleanOption("resolveWithObject",e.resolveWithObject):this.options.resolveWithObject&&(this.options.resolveWithObject=!1),this.options.fileOut="";let n=Error();return this._pipeline(u.fn(e)?e:t,n)}function zb(){return this.options.keepMetadata|=1,this}function Ub(e){if(u.object(e))for(let[t,n]of Object.entries(e))if(u.object(n))for(let[a,o]of Object.entries(n))if(u.string(o))this.options.withExif[`exif-${t.toLowerCase()}-${a}`]=o;else throw u.invalidParameterError(`${t}.${a}`,"string",o);else throw u.invalidParameterError(t,"object",n);else throw u.invalidParameterError("exif","object",e);return this.options.withExifMerge=!1,this.keepExif()}function Hb(e){return this.withExif(e),this.options.withExifMerge=!0,this}function Gb(){return this.options.keepMetadata|=8,this}function Vb(e,t){if(u.string(e))this.options.withIccProfile=e;else throw u.invalidParameterError("icc","string",e);if(this.keepIccProfile(),u.object(t)&&u.defined(t.attach))if(u.bool(t.attach))t.attach||(this.options.keepMetadata&=-9);else throw u.invalidParameterError("attach","boolean",t.attach);return this}function Qb(){return this.options.keepMetadata|=2,this}function Yb(e){if(u.string(e)&&e.length>0)this.options.withXmp=e,this.options.keepMetadata|=2;else throw u.invalidParameterError("xmp","non-empty string",e);return this}function Xb(){return this.options.keepMetadata=31,this}function Jb(e){if(this.keepMetadata(),this.withIccProfile("srgb"),u.object(e)){if(u.defined(e.orientation))if(u.integer(e.orientation)&&u.inRange(e.orientation,1,8))this.options.withMetadataOrientation=e.orientation;else throw u.invalidParameterError("orientation","integer between 1 and 8",e.orientation);if(u.defined(e.density))if(u.number(e.density)&&e.density>0)this.options.withMetadataDensity=e.density;else throw u.invalidParameterError("density","positive number",e.density);u.defined(e.icc)&&this.withIccProfile(e.icc),u.defined(e.exif)&&this.withExifMerge(e.exif)}return this}function Kb(e,t){let n=Cu.get((u.object(e)&&u.string(e.id)?e.id:e).toLowerCase());if(!n)throw u.invalidParameterError("format",`one of: ${[...Cu.keys()].join(", ")}`,e);return this[n](t)}function Zb(e){if(u.object(e)){if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,1,100))this.options.jpegQuality=e.quality;else throw u.invalidParameterError("quality","integer between 1 and 100",e.quality);if(u.defined(e.progressive)&&this._setBooleanOption("jpegProgressive",e.progressive),u.defined(e.chromaSubsampling))if(u.string(e.chromaSubsampling)&&u.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=e.chromaSubsampling;else throw u.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);let t=u.bool(e.optimizeCoding)?e.optimizeCoding:e.optimiseCoding;if(u.defined(t)&&this._setBooleanOption("jpegOptimiseCoding",t),u.defined(e.mozjpeg))if(u.bool(e.mozjpeg))e.mozjpeg&&(this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3);else throw u.invalidParameterError("mozjpeg","boolean",e.mozjpeg);let n=u.bool(e.trellisQuantization)?e.trellisQuantization:e.trellisQuantisation;u.defined(n)&&this._setBooleanOption("jpegTrellisQuantisation",n),u.defined(e.overshootDeringing)&&this._setBooleanOption("jpegOvershootDeringing",e.overshootDeringing);let a=u.bool(e.optimizeScans)?e.optimizeScans:e.optimiseScans;u.defined(a)&&(this._setBooleanOption("jpegOptimiseScans",a),a&&(this.options.jpegProgressive=!0));let o=u.number(e.quantizationTable)?e.quantizationTable:e.quantisationTable;if(u.defined(o))if(u.integer(o)&&u.inRange(o,0,8))this.options.jpegQuantisationTable=o;else throw u.invalidParameterError("quantisationTable","integer between 0 and 8",o)}return this._updateFormatOut("jpeg",e)}function eg(e){if(u.object(e)){if(u.defined(e.progressive)&&this._setBooleanOption("pngProgressive",e.progressive),u.defined(e.compressionLevel))if(u.integer(e.compressionLevel)&&u.inRange(e.compressionLevel,0,9))this.options.pngCompressionLevel=e.compressionLevel;else throw u.invalidParameterError("compressionLevel","integer between 0 and 9",e.compressionLevel);u.defined(e.adaptiveFiltering)&&this._setBooleanOption("pngAdaptiveFiltering",e.adaptiveFiltering);let t=e.colours||e.colors;if(u.defined(t))if(u.integer(t)&&u.inRange(t,2,256))this.options.pngBitdepth=ku(t);else throw u.invalidParameterError("colours","integer between 2 and 256",t);if(u.defined(e.palette)?this._setBooleanOption("pngPalette",e.palette):[e.quality,e.effort,e.colours,e.colors,e.dither].some(u.defined)&&this._setBooleanOption("pngPalette",!0),this.options.pngPalette){if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,0,100))this.options.pngQuality=e.quality;else throw u.invalidParameterError("quality","integer between 0 and 100",e.quality);if(u.defined(e.effort))if(u.integer(e.effort)&&u.inRange(e.effort,1,10))this.options.pngEffort=e.effort;else throw u.invalidParameterError("effort","integer between 1 and 10",e.effort);if(u.defined(e.dither))if(u.number(e.dither)&&u.inRange(e.dither,0,1))this.options.pngDither=e.dither;else throw u.invalidParameterError("dither","number between 0.0 and 1.0",e.dither)}}return this._updateFormatOut("png",e)}function tg(e){if(u.object(e)){if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,1,100))this.options.webpQuality=e.quality;else throw u.invalidParameterError("quality","integer between 1 and 100",e.quality);if(u.defined(e.alphaQuality))if(u.integer(e.alphaQuality)&&u.inRange(e.alphaQuality,0,100))this.options.webpAlphaQuality=e.alphaQuality;else throw u.invalidParameterError("alphaQuality","integer between 0 and 100",e.alphaQuality);if(u.defined(e.lossless)&&this._setBooleanOption("webpLossless",e.lossless),u.defined(e.nearLossless)&&this._setBooleanOption("webpNearLossless",e.nearLossless),u.defined(e.smartSubsample)&&this._setBooleanOption("webpSmartSubsample",e.smartSubsample),u.defined(e.smartDeblock)&&this._setBooleanOption("webpSmartDeblock",e.smartDeblock),u.defined(e.preset))if(u.string(e.preset)&&u.inArray(e.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=e.preset;else throw u.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",e.preset);if(u.defined(e.effort))if(u.integer(e.effort)&&u.inRange(e.effort,0,6))this.options.webpEffort=e.effort;else throw u.invalidParameterError("effort","integer between 0 and 6",e.effort);u.defined(e.minSize)&&this._setBooleanOption("webpMinSize",e.minSize),u.defined(e.mixed)&&this._setBooleanOption("webpMixed",e.mixed)}return ga(e,this.options),this._updateFormatOut("webp",e)}function rg(e){if(u.object(e)){u.defined(e.reuse)&&this._setBooleanOption("gifReuse",e.reuse),u.defined(e.progressive)&&this._setBooleanOption("gifProgressive",e.progressive);let t=e.colours||e.colors;if(u.defined(t))if(u.integer(t)&&u.inRange(t,2,256))this.options.gifBitdepth=ku(t);else throw u.invalidParameterError("colours","integer between 2 and 256",t);if(u.defined(e.effort))if(u.number(e.effort)&&u.inRange(e.effort,1,10))this.options.gifEffort=e.effort;else throw u.invalidParameterError("effort","integer between 1 and 10",e.effort);if(u.defined(e.dither))if(u.number(e.dither)&&u.inRange(e.dither,0,1))this.options.gifDither=e.dither;else throw u.invalidParameterError("dither","number between 0.0 and 1.0",e.dither);if(u.defined(e.interFrameMaxError))if(u.number(e.interFrameMaxError)&&u.inRange(e.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=e.interFrameMaxError;else throw u.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",e.interFrameMaxError);if(u.defined(e.interPaletteMaxError))if(u.number(e.interPaletteMaxError)&&u.inRange(e.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=e.interPaletteMaxError;else throw u.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",e.interPaletteMaxError);if(u.defined(e.keepDuplicateFrames))if(u.bool(e.keepDuplicateFrames))this._setBooleanOption("gifKeepDuplicateFrames",e.keepDuplicateFrames);else throw u.invalidParameterError("keepDuplicateFrames","boolean",e.keepDuplicateFrames)}return ga(e,this.options),this._updateFormatOut("gif",e)}function ng(e){if(!this.constructor.format.jp2k.output.buffer)throw Iu();if(u.object(e)){if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,1,100))this.options.jp2Quality=e.quality;else throw u.invalidParameterError("quality","integer between 1 and 100",e.quality);if(u.defined(e.lossless))if(u.bool(e.lossless))this.options.jp2Lossless=e.lossless;else throw u.invalidParameterError("lossless","boolean",e.lossless);if(u.defined(e.tileWidth))if(u.integer(e.tileWidth)&&u.inRange(e.tileWidth,1,32768))this.options.jp2TileWidth=e.tileWidth;else throw u.invalidParameterError("tileWidth","integer between 1 and 32768",e.tileWidth);if(u.defined(e.tileHeight))if(u.integer(e.tileHeight)&&u.inRange(e.tileHeight,1,32768))this.options.jp2TileHeight=e.tileHeight;else throw u.invalidParameterError("tileHeight","integer between 1 and 32768",e.tileHeight);if(u.defined(e.chromaSubsampling))if(u.string(e.chromaSubsampling)&&u.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=e.chromaSubsampling;else throw u.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling)}return this._updateFormatOut("jp2",e)}function ga(e,t){if(u.object(e)&&u.defined(e.loop))if(u.integer(e.loop)&&u.inRange(e.loop,0,65535))t.loop=e.loop;else throw u.invalidParameterError("loop","integer between 0 and 65535",e.loop);if(u.object(e)&&u.defined(e.delay))if(u.integer(e.delay)&&u.inRange(e.delay,0,65535))t.delay=[e.delay];else if(Array.isArray(e.delay)&&e.delay.every(u.integer)&&e.delay.every(n=>u.inRange(n,0,65535)))t.delay=e.delay;else throw u.invalidParameterError("delay","integer or an array of integers between 0 and 65535",e.delay)}function ig(e){if(u.object(e)){if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,1,100))this.options.tiffQuality=e.quality;else throw u.invalidParameterError("quality","integer between 1 and 100",e.quality);if(u.defined(e.bitdepth))if(u.integer(e.bitdepth)&&u.inArray(e.bitdepth,[1,2,4,8]))this.options.tiffBitdepth=e.bitdepth;else throw u.invalidParameterError("bitdepth","1, 2, 4 or 8",e.bitdepth);if(u.defined(e.tile)&&this._setBooleanOption("tiffTile",e.tile),u.defined(e.tileWidth))if(u.integer(e.tileWidth)&&e.tileWidth>0)this.options.tiffTileWidth=e.tileWidth;else throw u.invalidParameterError("tileWidth","integer greater than zero",e.tileWidth);if(u.defined(e.tileHeight))if(u.integer(e.tileHeight)&&e.tileHeight>0)this.options.tiffTileHeight=e.tileHeight;else throw u.invalidParameterError("tileHeight","integer greater than zero",e.tileHeight);if(u.defined(e.miniswhite)&&this._setBooleanOption("tiffMiniswhite",e.miniswhite),u.defined(e.pyramid)&&this._setBooleanOption("tiffPyramid",e.pyramid),u.defined(e.xres))if(u.number(e.xres)&&e.xres>0)this.options.tiffXres=e.xres;else throw u.invalidParameterError("xres","number greater than zero",e.xres);if(u.defined(e.yres))if(u.number(e.yres)&&e.yres>0)this.options.tiffYres=e.yres;else throw u.invalidParameterError("yres","number greater than zero",e.yres);if(u.defined(e.compression))if(u.string(e.compression)&&u.inArray(e.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=e.compression;else throw u.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",e.compression);if(u.defined(e.predictor))if(u.string(e.predictor)&&u.inArray(e.predictor,["none","horizontal","float"]))this.options.tiffPredictor=e.predictor;else throw u.invalidParameterError("predictor","one of: none, horizontal, float",e.predictor);if(u.defined(e.resolutionUnit))if(u.string(e.resolutionUnit)&&u.inArray(e.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=e.resolutionUnit;else throw u.invalidParameterError("resolutionUnit","one of: inch, cm",e.resolutionUnit)}return this._updateFormatOut("tiff",e)}function ag(e){return this.heif({...e,compression:"av1"})}function og(e){if(u.object(e)){if(u.string(e.compression)&&u.inArray(e.compression,["av1","hevc"]))this.options.heifCompression=e.compression;else throw u.invalidParameterError("compression","one of: av1, hevc",e.compression);if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,1,100))this.options.heifQuality=e.quality;else throw u.invalidParameterError("quality","integer between 1 and 100",e.quality);if(u.defined(e.lossless))if(u.bool(e.lossless))this.options.heifLossless=e.lossless;else throw u.invalidParameterError("lossless","boolean",e.lossless);if(u.defined(e.effort))if(u.integer(e.effort)&&u.inRange(e.effort,0,9))this.options.heifEffort=e.effort;else throw u.invalidParameterError("effort","integer between 0 and 9",e.effort);if(u.defined(e.chromaSubsampling))if(u.string(e.chromaSubsampling)&&u.inArray(e.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=e.chromaSubsampling;else throw u.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",e.chromaSubsampling);if(u.defined(e.bitdepth))if(u.integer(e.bitdepth)&&u.inArray(e.bitdepth,[8,10,12])){if(e.bitdepth!==8&&this.constructor.versions.heif)throw u.invalidParameterError("bitdepth when using prebuilt binaries",8,e.bitdepth);this.options.heifBitdepth=e.bitdepth}else throw u.invalidParameterError("bitdepth","8, 10 or 12",e.bitdepth)}else throw u.invalidParameterError("options","Object",e);return this._updateFormatOut("heif",e)}function sg(e){if(u.object(e)){if(u.defined(e.quality))if(u.integer(e.quality)&&u.inRange(e.quality,1,100))this.options.jxlDistance=e.quality>=30?.1+(100-e.quality)*.09:53/3e3*e.quality*e.quality-23/20*e.quality+25;else throw u.invalidParameterError("quality","integer between 1 and 100",e.quality);else if(u.defined(e.distance))if(u.number(e.distance)&&u.inRange(e.distance,0,15))this.options.jxlDistance=e.distance;else throw u.invalidParameterError("distance","number between 0.0 and 15.0",e.distance);if(u.defined(e.decodingTier))if(u.integer(e.decodingTier)&&u.inRange(e.decodingTier,0,4))this.options.jxlDecodingTier=e.decodingTier;else throw u.invalidParameterError("decodingTier","integer between 0 and 4",e.decodingTier);if(u.defined(e.lossless))if(u.bool(e.lossless))this.options.jxlLossless=e.lossless;else throw u.invalidParameterError("lossless","boolean",e.lossless);if(u.defined(e.effort))if(u.integer(e.effort)&&u.inRange(e.effort,1,9))this.options.jxlEffort=e.effort;else throw u.invalidParameterError("effort","integer between 1 and 9",e.effort)}return ga(e,this.options),this._updateFormatOut("jxl",e)}function lg(e){if(u.object(e)&&u.defined(e.depth))if(u.string(e.depth)&&u.inArray(e.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=e.depth;else throw u.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",e.depth);return this._updateFormatOut("raw")}function ug(e){if(u.object(e)){if(u.defined(e.size))if(u.integer(e.size)&&u.inRange(e.size,1,8192))this.options.tileSize=e.size;else throw u.invalidParameterError("size","integer between 1 and 8192",e.size);if(u.defined(e.overlap))if(u.integer(e.overlap)&&u.inRange(e.overlap,0,8192)){if(e.overlap>this.options.tileSize)throw u.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,e.overlap);this.options.tileOverlap=e.overlap}else throw u.invalidParameterError("overlap","integer between 0 and 8192",e.overlap);if(u.defined(e.container))if(u.string(e.container)&&u.inArray(e.container,["fs","zip"]))this.options.tileContainer=e.container;else throw u.invalidParameterError("container","one of: fs, zip",e.container);if(u.defined(e.layout))if(u.string(e.layout)&&u.inArray(e.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=e.layout;else throw u.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",e.layout);if(u.defined(e.angle))if(u.integer(e.angle)&&!(e.angle%90))this.options.tileAngle=e.angle;else throw u.invalidParameterError("angle","positive/negative multiple of 90",e.angle);if(this._setBackgroundColourOption("tileBackground",e.background),u.defined(e.depth))if(u.string(e.depth)&&u.inArray(e.depth,["onepixel","onetile","one"]))this.options.tileDepth=e.depth;else throw u.invalidParameterError("depth","one of: onepixel, onetile, one",e.depth);if(u.defined(e.skipBlanks))if(u.integer(e.skipBlanks)&&u.inRange(e.skipBlanks,-1,65535))this.options.tileSkipBlanks=e.skipBlanks;else throw u.invalidParameterError("skipBlanks","integer between -1 and 255/65535",e.skipBlanks);else u.defined(e.layout)&&e.layout==="google"&&(this.options.tileSkipBlanks=5);let t=u.bool(e.center)?e.center:e.centre;if(u.defined(t)&&this._setBooleanOption("tileCentre",t),u.defined(e.id))if(u.string(e.id))this.options.tileId=e.id;else throw u.invalidParameterError("id","string",e.id);if(u.defined(e.basename))if(u.string(e.basename))this.options.tileBasename=e.basename;else throw u.invalidParameterError("basename","string",e.basename)}if(u.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw u.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")}function fg(e){if(!u.plainObject(e))throw u.invalidParameterError("options","object",e);if(u.integer(e.seconds)&&u.inRange(e.seconds,0,3600))this.options.timeoutSeconds=e.seconds;else throw u.invalidParameterError("seconds","integer between 0 and 3600",e.seconds);return this}function cg(e,t){return u.object(t)&&t.force===!1||(this.options.formatOut=e),this}function dg(e,t){if(u.bool(t))this.options[e]=t;else throw u.invalidParameterError(e,"boolean",t)}function hg(){if(!this.options.streamOut){this.options.streamOut=!0;let e=Error();this._pipeline(void 0,e)}}function mg(e,t){return typeof e=="function"?(this._isStreamInput()?this.on("finish",()=>{this._flattenBufferIn(),cr.pipeline(this.options,(n,a,o)=>{n?e(u.nativeError(n,t)):e(null,a,o)})}):cr.pipeline(this.options,(n,a,o)=>{n?e(u.nativeError(n,t)):e(null,a,o)}),this):this.options.streamOut?(this._isStreamInput()?(this.once("finish",()=>{this._flattenBufferIn(),cr.pipeline(this.options,(n,a,o)=>{n?this.emit("error",u.nativeError(n,t)):(this.emit("info",o),this.push(a)),this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished&&this.emit("finish")):cr.pipeline(this.options,(n,a,o)=>{n?this.emit("error",u.nativeError(n,t)):(this.emit("info",o),this.push(a)),this.push(null),this.on("end",()=>this.emit("close"))}),this):this._isStreamInput()?new Promise((n,a)=>{this.once("finish",()=>{this._flattenBufferIn(),cr.pipeline(this.options,(o,l,f)=>{o?a(u.nativeError(o,t)):this.options.resolveWithObject?n({data:l,info:f}):n(l)})})}):new Promise((n,a)=>{cr.pipeline(this.options,(o,l,f)=>{o?a(u.nativeError(o,t)):this.options.resolveWithObject?n({data:l,info:f}):n(l)})})}xu.exports=function(e){Object.assign(e.prototype,{toFile:Mb,toBuffer:Wb,keepExif:zb,withExif:Ub,withExifMerge:Hb,keepIccProfile:Gb,withIccProfile:Vb,keepXmp:Qb,withXmp:Yb,keepMetadata:Xb,withMetadata:Jb,toFormat:Kb,jpeg:Zb,jp2:ng,png:eg,webp:tg,tiff:ig,avif:ag,heif:og,jxl:sg,gif:rg,raw:lg,tile:ug,timeout:fg,_updateFormatOut:cg,_setBooleanOption:dg,_read:hg,_pipeline:mg})}});var qu=j((P0,$u)=>{"use strict";var bg=require("events"),Vn=Bn(),Re=Be(),{runtimePlatformArch:gg}=oa(),oe=Nr(),ju=gg(),pa=oe.libvipsVersion(),wt=oe.format();wt.heif.output.alias=["avif","heic"];wt.jpeg.output.alias=["jpe","jpg"];wt.tiff.output.alias=["tif"];wt.jp2k.output.alias=["j2c","j2k","jp2","jpx"];var pg={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},dr={vips:pa.semver};if(!pa.isGlobal)if(pa.isWasm)try{dr=require("@img/sharp-wasm32/versions")}catch{}else try{dr=require(`@img/sharp-${ju}/versions`)}catch{try{dr=require(`@img/sharp-libvips-${ju}/versions`)}catch{}}dr.sharp=ia().version;dr.heif&&wt.heif&&(wt.heif.input.fileSuffix=[".avif"],wt.heif.output.alias=["avif"]);function Bu(e){return Re.bool(e)?e?oe.cache(50,20,100):oe.cache(0,0,0):Re.object(e)?oe.cache(e.memory,e.files,e.items):oe.cache()}Bu(!0);function yg(e){return oe.concurrency(Re.integer(e)?e:null)}Vn.familySync()===Vn.GLIBC&&!oe._isUsingJemalloc()?oe.concurrency(1):Vn.familySync()===Vn.MUSL&&oe.concurrency()===1024&&oe.concurrency(require("os").availableParallelism());var wg=new bg.EventEmitter;function Eg(){return oe.counters()}function Sg(e){return oe.simd(Re.bool(e)?e:null)}function _g(e){if(Re.object(e))if(Array.isArray(e.operation)&&e.operation.every(Re.string))oe.block(e.operation,!0);else throw Re.invalidParameterError("operation","Array<string>",e.operation);else throw Re.invalidParameterError("options","object",e)}function vg(e){if(Re.object(e))if(Array.isArray(e.operation)&&e.operation.every(Re.string))oe.block(e.operation,!1);else throw Re.invalidParameterError("operation","Array<string>",e.operation);else throw Re.invalidParameterError("options","object",e)}$u.exports=function(e){e.cache=Bu,e.concurrency=yg,e.counters=Eg,e.simd=Sg,e.format=wt,e.interpolators=pg,e.versions=dr,e.queue=wg,e.block=_g,e.unblock=vg}});var Du=j((T0,Fu)=>{"use strict";var nt=Jl();eu()(nt);ou()(nt);lu()(nt);hu()(nt);Pu()(nt);Au()(nt);Lu()(nt);qu()(nt);Fu.exports=nt});var Cg={};qo(Cg,{SUPPORTED_IMAGE_TYPES:()=>Yn,nodeImagePlugin:()=>Ag});module.exports=$c(Cg);var ys=Ye(require("http"),1),ws=Ye(require("https"),1),jt=Ye(require("zlib"),1),ge=Ye(require("stream"),1),Br=require("buffer");function qc(e){if(!/^data:/i.test(e))throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")');e=e.replace(/\r?\n/g,"");let t=e.indexOf(",");if(t===-1||t<=4)throw new TypeError("malformed data: URI");let n=e.substring(5,t).split(";"),a="",o=!1,l=n[0]||"text/plain",f=l;for(let w=1;w<n.length;w++)n[w]==="base64"?o=!0:n[w]&&(f+=`;${n[w]}`,n[w].indexOf("charset=")===0&&(a=n[w].substring(8)));!n[0]&&!a.length&&(f+=";charset=US-ASCII",a="US-ASCII");let h=o?"base64":"ascii",d=unescape(e.substring(t+1)),g=Buffer.from(d,h);return g.type=l,g.typeFull=f,g.charset=a,g}var No=qc;var _e=Ye(require("stream"),1);Tr();Sn();var Ke=class extends Error{constructor(t,n){super(t),Error.captureStackTrace(this,this.constructor),this.type=n}get name(){return this.constructor.name}get[Symbol.toStringTag](){return this.constructor.name}};var le=class extends Ke{constructor(t,n,a){super(t,n),a&&(this.code=this.errno=a.code,this.erroredSysCall=a.syscall)}};var _n=Symbol.toStringTag,Ni=e=>typeof e=="object"&&typeof e.append=="function"&&typeof e.delete=="function"&&typeof e.get=="function"&&typeof e.getAll=="function"&&typeof e.has=="function"&&typeof e.set=="function"&&typeof e.sort=="function"&&e[_n]==="URLSearchParams",kr=e=>e&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&typeof e.constructor=="function"&&/^(Blob|File)$/.test(e[_n]),Xo=e=>typeof e=="object"&&(e[_n]==="AbortSignal"||e[_n]==="EventTarget"),Jo=(e,t)=>{let n=new URL(t).hostname,a=new URL(e).hostname;return n===a||n.endsWith(`.${a}`)},Ko=(e,t)=>{let n=new URL(t).protocol,a=new URL(e).protocol;return n===a};var Kc=(0,wm.promisify)(_e.default.pipeline),ue=Symbol("Body internals"),je=class{constructor(t,{size:n=0}={}){let a=null;t===null?t=null:Ni(t)?t=Br.Buffer.from(t.toString()):kr(t)||Br.Buffer.isBuffer(t)||(wm.types.isAnyArrayBuffer(t)?t=Br.Buffer.from(t):ArrayBuffer.isView(t)?t=Br.Buffer.from(t.buffer,t.byteOffset,t.byteLength):t instanceof _e.default||(t instanceof kt?(t=Yo(t),a=t.type.split("=")[1]):t=Br.Buffer.from(String(t))));let o=t;Br.Buffer.isBuffer(t)?o=_e.default.Readable.from(t):kr(t)&&(o=_e.default.Readable.from(t.stream())),this[ue]={body:t,stream:o,boundary:a,disturbed:!1,error:null},this.size=n,t instanceof _e.default&&t.on("error",l=>{let f=l instanceof Ke?l:new le(`Invalid response body while trying to fetch ${this.url}: ${l.message}`,"system",l);this[ue].error=f})}get body(){return this[ue].stream}get bodyUsed(){return this[ue].disturbed}async arrayBuffer(){let{buffer:t,byteOffset:n,byteLength:a}=await Wi(this);return t.slice(n,n+a)}async formData(){let t=this.headers.get("content-type");if(t.startsWith("application/x-www-form-urlencoded")){let a=new kt,o=new URLSearchParams(await this.text());for(let[l,f]of o)a.append(l,f);return a}let{toFormData:n}=await Promise.resolve().then(()=>(ns(),rs));return n(this.body,t)}async blob(){let t=this.headers&&this.headers.get("content-type")||this[ue].body&&this[ue].body.type||"",n=await this.arrayBuffer();return new Je([n],{type:t})}async json(){let t=await this.text();return JSON.parse(t)}async text(){let t=await Wi(this);return new TextDecoder().decode(t)}buffer(){return Wi(this)}};je.prototype.buffer=(0,wm.deprecate)(je.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(je.prototype,{body:{enumerable:!0},bodyUsed:{enumerable:!0},arrayBuffer:{enumerable:!0},blob:{enumerable:!0},json:{enumerable:!0},text:{enumerable:!0},data:{get:(0,wm.deprecate)(()=>{},"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function Wi(e){if(e[ue].disturbed)throw new TypeError(`body used already for: ${e.url}`);if(e[ue].disturbed=!0,e[ue].error)throw e[ue].error;let{body:t}=e;if(t===null)return Br.Buffer.alloc(0);if(!(t instanceof _e.default))return Br.Buffer.alloc(0);let n=[],a=0;try{for await(let o of t){if(e.size>0&&a+o.length>e.size){let l=new le(`content size at ${e.url} over limit: ${e.size}`,"max-size");throw t.destroy(l),l}a+=o.length,n.push(o)}}catch(o){throw o instanceof Ke?o:new le(`Invalid response body while trying to fetch ${e.url}: ${o.message}`,"system",o)}if(t.readableEnded===!0||t._readableState.ended===!0)try{return n.every(o=>typeof o=="string")?Br.Buffer.from(n.join("")):Br.Buffer.concat(n,a)}catch(o){throw new le(`Could not create Buffer from response body for ${e.url}: ${o.message}`,"system",o)}else throw new le(`Premature close of server response while trying to fetch ${e.url}`)}var Zt=(e,t)=>{let n,a,{body:o}=e[ue];if(e.bodyUsed)throw new Error("cannot clone body after it is used");return o instanceof _e.default&&typeof o.getBoundary!="function"&&(n=new _e.PassThrough({highWaterMark:t}),a=new _e.PassThrough({highWaterMark:t}),o.pipe(n),o.pipe(a),e[ue].stream=n,o=a),o},Zc=(0,wm.deprecate)(e=>e.getBoundary(),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167"),Tn=(e,t)=>e===null?null:typeof e=="string"?"text/plain;charset=UTF-8":Ni(e)?"application/x-www-form-urlencoded;charset=UTF-8":kr(e)?e.type||null:Br.Buffer.isBuffer(e)||wm.types.isAnyArrayBuffer(e)||ArrayBuffer.isView(e)?null:e instanceof kt?`multipart/form-data; boundary=${t[ue].boundary}`:e&&typeof e.getBoundary=="function"?`multipart/form-data;boundary=${Zc(e)}`:e instanceof _e.default?null:"text/plain;charset=UTF-8",is=e=>{let{body:t}=e[ue];return t===null?0:kr(t)?t.size:Br.Buffer.isBuffer(t)?t.length:t&&typeof t.getLengthSync=="function"&&t.hasKnownLength&&t.hasKnownLength()?t.getLengthSync():null},as=async(e,{body:t})=>{t===null?e.end():await Kc(t,e)};var Lr=Ye(require("http"),1),An=typeof Lr.default.validateHeaderName=="function"?Lr.default.validateHeaderName:e=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(e)){let t=new TypeError(`Header name must be a valid HTTP token [${e}]`);throw Object.defineProperty(t,"code",{value:"ERR_INVALID_HTTP_TOKEN"}),t}},Ui=typeof Lr.default.validateHeaderValue=="function"?Lr.default.validateHeaderValue:(e,t)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(t)){let n=new TypeError(`Invalid character in header content ["${e}"]`);throw Object.defineProperty(n,"code",{value:"ERR_INVALID_CHAR"}),n}},be=class e extends URLSearchParams{constructor(t){let n=[];if(t instanceof e){let a=t.raw();for(let[o,l]of Object.entries(a))n.push(...l.map(f=>[o,f]))}else if(t!=null)if(typeof t=="object"&&!wm.types.isBoxedPrimitive(t)){let a=t[Symbol.iterator];if(a==null)n.push(...Object.entries(t));else{if(typeof a!="function")throw new TypeError("Header pairs must be iterable");n=[...t].map(o=>{if(typeof o!="object"||wm.types.isBoxedPrimitive(o))throw new TypeError("Each header pair must be an iterable object");return[...o]}).map(o=>{if(o.length!==2)throw new TypeError("Each header pair must be a name/value tuple");return[...o]})}}else throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence<sequence<ByteString>> or record<ByteString, ByteString>)");return n=n.length>0?n.map(([a,o])=>(An(a),Ui(a,String(o)),[String(a).toLowerCase(),String(o)])):void 0,super(n),new Proxy(this,{get(a,o,l){switch(o){case"append":case"set":return(f,h)=>(An(f),Ui(f,String(h)),URLSearchParams.prototype[o].call(a,String(f).toLowerCase(),String(h)));case"delete":case"has":case"getAll":return f=>(An(f),URLSearchParams.prototype[o].call(a,String(f).toLowerCase()));case"keys":return()=>(a.sort(),new Set(URLSearchParams.prototype.keys.call(a)).keys());default:return Reflect.get(a,o,l)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(t){let n=this.getAll(t);if(n.length===0)return null;let a=n.join(", ");return/^content-encoding$/i.test(t)&&(a=a.toLowerCase()),a}forEach(t,n=void 0){for(let a of this.keys())Reflect.apply(t,n,[this.get(a),a,this])}*values(){for(let t of this.keys())yield this.get(t)}*entries(){for(let t of this.keys())yield[t,this.get(t)]}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce((t,n)=>(t[n]=this.getAll(n),t),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce((t,n)=>{let a=this.getAll(n);return n==="host"?t[n]=a[0]:t[n]=a.length>1?a:a[0],t},{})}};Object.defineProperties(be.prototype,["get","entries","forEach","values"].reduce((e,t)=>(e[t]={enumerable:!0},e),{}));function os(e=[]){return new be(e.reduce((t,n,a,o)=>(a%2===0&&t.push(o.slice(a,a+2)),t),[]).filter(([t,n])=>{try{return An(t),Ui(t,String(n)),!0}catch{return!1}}))}var ed=new Set([301,302,303,307,308]),Cn=e=>ed.has(e);var Ie=Symbol("Response internals"),ve=class e extends je{constructor(t=null,n={}){super(t,n);let a=n.status!=null?n.status:200,o=new be(n.headers);if(t!==null&&!o.has("Content-Type")){let l=Tn(t,this);l&&o.append("Content-Type",l)}this[Ie]={type:"default",url:n.url,status:a,statusText:n.statusText||"",headers:o,counter:n.counter,highWaterMark:n.highWaterMark}}get type(){return this[Ie].type}get url(){return this[Ie].url||""}get status(){return this[Ie].status}get ok(){return this[Ie].status>=200&&this[Ie].status<300}get redirected(){return this[Ie].counter>0}get statusText(){return this[Ie].statusText}get headers(){return this[Ie].headers}get highWaterMark(){return this[Ie].highWaterMark}clone(){return new e(Zt(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(t,n=302){if(!Cn(n))throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');return new e(null,{headers:{location:new URL(t).toString()},status:n})}static error(){let t=new e(null,{status:0,statusText:""});return t[Ie].type="error",t}static json(t=void 0,n={}){let a=JSON.stringify(t);if(a===void 0)throw new TypeError("data is not JSON serializable");let o=new be(n&&n.headers);return o.has("content-type")||o.set("content-type","application/json"),new e(a,{...n,headers:o})}get[Symbol.toStringTag](){return"Response"}};Object.defineProperties(ve.prototype,{type:{enumerable:!0},url:{enumerable:!0},status:{enumerable:!0},ok:{enumerable:!0},redirected:{enumerable:!0},statusText:{enumerable:!0},headers:{enumerable:!0},clone:{enumerable:!0}});var bs=require("url");var ss=e=>{if(e.search)return e.search;let t=e.href.length-1,n=e.hash||(e.href[t]==="#"?"#":"");return e.href[t-n.length]==="?"?"?":""};var us=require("net");function ls(e,t=!1){return e==null||(e=new URL(e),/^(about|blob|data):$/.test(e.protocol))?"no-referrer":(e.username="",e.password="",e.hash="",t&&(e.pathname="",e.search=""),e)}var fs=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]),cs="strict-origin-when-cross-origin";function ds(e){if(!fs.has(e))throw new TypeError(`Invalid referrerPolicy: ${e}`);return e}function td(e){if(/^(http|ws)s:$/.test(e.protocol))return!0;let t=e.host.replace(/(^\[)|(]$)/g,""),n=(0,us.isIP)(t);return n===4&&/^127\./.test(t)||n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(t)?!0:e.host==="localhost"||e.host.endsWith(".localhost")?!1:e.protocol==="file:"}function er(e){return/^about:(blank|srcdoc)$/.test(e)||e.protocol==="data:"||/^(blob|filesystem):$/.test(e.protocol)?!0:td(e)}function hs(e,{referrerURLCallback:t,referrerOriginCallback:n}={}){if(e.referrer==="no-referrer"||e.referrerPolicy==="")return null;let a=e.referrerPolicy;if(e.referrer==="about:client")return"no-referrer";let o=e.referrer,l=ls(o),f=ls(o,!0);l.toString().length>4096&&(l=f),t&&(l=t(l)),n&&(f=n(f));let h=new URL(e.url);switch(a){case"no-referrer":return"no-referrer";case"origin":return f;case"unsafe-url":return l;case"strict-origin":return er(l)&&!er(h)?"no-referrer":f.toString();case"strict-origin-when-cross-origin":return l.origin===h.origin?l:er(l)&&!er(h)?"no-referrer":f;case"same-origin":return l.origin===h.origin?l:"no-referrer";case"origin-when-cross-origin":return l.origin===h.origin?l:f;case"no-referrer-when-downgrade":return er(l)&&!er(h)?"no-referrer":l;default:throw new TypeError(`Invalid referrerPolicy: ${a}`)}}function ms(e){let t=(e.get("referrer-policy")||"").split(/[,\s]+/),n="";for(let a of t)a&&fs.has(a)&&(n=a);return n}var Z=Symbol("Request internals"),jr=e=>typeof e=="object"&&typeof e[Z]=="object",rd=(0,wm.deprecate)(()=>{},".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)"),Lt=class e extends je{constructor(t,n={}){let a;if(jr(t)?a=new URL(t.url):(a=new URL(t),t={}),a.username!==""||a.password!=="")throw new TypeError(`${a} is an url with embedded credentials.`);let o=n.method||t.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)&&(o=o.toUpperCase()),!jr(n)&&"data"in n&&rd(),(n.body!=null||jr(t)&&t.body!==null)&&(o==="GET"||o==="HEAD"))throw new TypeError("Request with GET/HEAD method cannot have body");let l=n.body?n.body:jr(t)&&t.body!==null?Zt(t):null;super(l,{size:n.size||t.size||0});let f=new be(n.headers||t.headers||{});if(l!==null&&!f.has("Content-Type")){let g=Tn(l,this);g&&f.set("Content-Type",g)}let h=jr(t)?t.signal:null;if("signal"in n&&(h=n.signal),h!=null&&!Xo(h))throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget");let d=n.referrer==null?t.referrer:n.referrer;if(d==="")d="no-referrer";else if(d){let g=new URL(d);d=/^about:(\/\/)?client$/.test(g)?"client":g}else d=void 0;this[Z]={method:o,redirect:n.redirect||t.redirect||"follow",headers:f,parsedURL:a,signal:h,referrer:d},this.follow=n.follow===void 0?t.follow===void 0?20:t.follow:n.follow,this.compress=n.compress===void 0?t.compress===void 0?!0:t.compress:n.compress,this.counter=n.counter||t.counter||0,this.agent=n.agent||t.agent,this.highWaterMark=n.highWaterMark||t.highWaterMark||16384,this.insecureHTTPParser=n.insecureHTTPParser||t.insecureHTTPParser||!1,this.referrerPolicy=n.referrerPolicy||t.referrerPolicy||""}get method(){return this[Z].method}get url(){return(0,bs.format)(this[Z].parsedURL)}get headers(){return this[Z].headers}get redirect(){return this[Z].redirect}get signal(){return this[Z].signal}get referrer(){if(this[Z].referrer==="no-referrer")return"";if(this[Z].referrer==="client")return"about:client";if(this[Z].referrer)return this[Z].referrer.toString()}get referrerPolicy(){return this[Z].referrerPolicy}set referrerPolicy(t){this[Z].referrerPolicy=ds(t)}clone(){return new e(this)}get[Symbol.toStringTag](){return"Request"}};Object.defineProperties(Lt.prototype,{method:{enumerable:!0},url:{enumerable:!0},headers:{enumerable:!0},redirect:{enumerable:!0},clone:{enumerable:!0},signal:{enumerable:!0},referrer:{enumerable:!0},referrerPolicy:{enumerable:!0}});var ps=e=>{let{parsedURL:t}=e[Z],n=new be(e[Z].headers);n.has("Accept")||n.set("Accept","*/*");let a=null;if(e.body===null&&/^(post|put)$/i.test(e.method)&&(a="0"),e.body!==null){let h=is(e);typeof h=="number"&&!Number.isNaN(h)&&(a=String(h))}a&&n.set("Content-Length",a),e.referrerPolicy===""&&(e.referrerPolicy=cs),e.referrer&&e.referrer!=="no-referrer"?e[Z].referrer=hs(e):e[Z].referrer="no-referrer",e[Z].referrer instanceof URL&&n.set("Referer",e.referrer),n.has("User-Agent")||n.set("User-Agent","node-fetch"),e.compress&&!n.has("Accept-Encoding")&&n.set("Accept-Encoding","gzip, deflate, br");let{agent:o}=e;typeof o=="function"&&(o=o(t));let l=ss(t),f={path:t.pathname+l,method:e.method,headers:n[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:e.insecureHTTPParser,agent:o};return{parsedURL:t,options:f}};var In=class extends Ke{constructor(t,n="aborted"){super(t,n)}};Sn();Oi();var nd=new Set(["data:","http:","https:"]);async function kn(e,t){return new Promise((n,a)=>{let o=new Lt(e,t),{parsedURL:l,options:f}=ps(o);if(!nd.has(l.protocol))throw new TypeError(`node-fetch cannot load ${e}. URL scheme "${l.protocol.replace(/:$/,"")}" is not supported.`);if(l.protocol==="data:"){let S=No(o.url),N=new ve(S,{headers:{"Content-Type":S.typeFull}});n(N);return}let h=(l.protocol==="https:"?ws.default:ys.default).request,{signal:d}=o,g=null,w=()=>{let S=new In("The operation was aborted.");a(S),o.body&&o.body instanceof ge.default.Readable&&o.body.destroy(S),!(!g||!g.body)&&g.body.emit("error",S)};if(d&&d.aborted){w();return}let T=()=>{w(),W()},k=h(l.toString(),f);d&&d.addEventListener("abort",T);let W=()=>{k.abort(),d&&d.removeEventListener("abort",T)};k.on("error",S=>{a(new le(`request to ${o.url} failed, reason: ${S.message}`,"system",S)),W()}),id(k,S=>{g&&g.body&&g.body.destroy(S)}),process.version<"v14"&&k.on("socket",S=>{let N;S.prependListener("end",()=>{N=S._eventsCount}),S.prependListener("close",q=>{if(g&&N<S._eventsCount&&!q){let F=new Error("Premature close");F.code="ERR_STREAM_PREMATURE_CLOSE",g.body.emit("error",F)}})}),k.on("response",S=>{k.setTimeout(0);let N=os(S.rawHeaders);if(Cn(S.statusCode)){let O=N.get("Location"),M=null;try{M=O===null?null:new URL(O,o.url)}catch{if(o.redirect!=="manual"){a(new le(`uri requested responds with an invalid redirect URL: ${O}`,"invalid-redirect")),W();return}}switch(o.redirect){case"error":a(new le(`uri requested responds with a redirect, redirect mode is set to error: ${o.url}`,"no-redirect")),W();return;case"manual":break;case"follow":{if(M===null)break;if(o.counter>=o.follow){a(new le(`maximum redirect reached at: ${o.url}`,"max-redirect")),W();return}let Y={headers:new be(o.headers),follow:o.follow,counter:o.counter+1,agent:o.agent,compress:o.compress,method:o.method,body:Zt(o),signal:o.signal,size:o.size,referrer:o.referrer,referrerPolicy:o.referrerPolicy};if(!Jo(o.url,M)||!Ko(o.url,M))for(let hr of["authorization","www-authenticate","cookie","cookie2"])Y.headers.delete(hr);if(S.statusCode!==303&&o.body&&t.body instanceof ge.default.Readable){a(new le("Cannot follow redirect with body being a readable stream","unsupported-redirect")),W();return}(S.statusCode===303||(S.statusCode===301||S.statusCode===302)&&o.method==="POST")&&(Y.method="GET",Y.body=void 0,Y.headers.delete("content-length"));let it=ms(N);it&&(Y.referrerPolicy=it),n(kn(new Lt(M,Y))),W();return}default:return a(new TypeError(`Redirect option '${o.redirect}' is not a valid value of RequestRedirect`))}}d&&S.once("end",()=>{d.removeEventListener("abort",T)});let q=(0,ge.pipeline)(S,new ge.PassThrough,O=>{O&&a(O)});process.version<"v12.10"&&S.on("aborted",T);let F={url:o.url,status:S.statusCode,statusText:S.statusMessage,headers:N,size:o.size,counter:o.counter,highWaterMark:o.highWaterMark},U=N.get("Content-Encoding");if(!o.compress||o.method==="HEAD"||U===null||S.statusCode===204||S.statusCode===304){g=new ve(q,F),n(g);return}let te={flush:jt.default.Z_SYNC_FLUSH,finishFlush:jt.default.Z_SYNC_FLUSH};if(U==="gzip"||U==="x-gzip"){q=(0,ge.pipeline)(q,jt.default.createGunzip(te),O=>{O&&a(O)}),g=new ve(q,F),n(g);return}if(U==="deflate"||U==="x-deflate"){let O=(0,ge.pipeline)(S,new ge.PassThrough,M=>{M&&a(M)});O.once("data",M=>{(M[0]&15)===8?q=(0,ge.pipeline)(q,jt.default.createInflate(),Y=>{Y&&a(Y)}):q=(0,ge.pipeline)(q,jt.default.createInflateRaw(),Y=>{Y&&a(Y)}),g=new ve(q,F),n(g)}),O.once("end",()=>{g||(g=new ve(q,F),n(g))});return}if(U==="br"){q=(0,ge.pipeline)(q,jt.default.createBrotliDecompress(),O=>{O&&a(O)}),g=new ve(q,F),n(g);return}g=new ve(q,F),n(g)}),as(k,o).catch(a)})}function id(e,t){let n=Br.Buffer.from(`0\r
|
|
14
14
|
\r
|
|
15
15
|
`),a=!1,o=!1,l;e.on("response",f=>{let{headers:h}=f;a=h["transfer-encoding"]==="chunked"&&!h["content-length"]}),e.on("socket",f=>{let h=()=>{if(a&&!o){let g=new Error("Premature close");g.code="ERR_STREAM_PREMATURE_CLOSE",t(g)}},d=g=>{o=Br.Buffer.compare(g.slice(-5),n)===0,!o&&l&&(o=Br.Buffer.compare(l.slice(-3),n.slice(0,3))===0&&Br.Buffer.compare(g.slice(-2),n.slice(3))===0),l=g};f.prependListener("close",h),f.on("data",d),e.on("close",()=>{f.removeListener("close",h),f.removeListener("data",d)})})}var Qn=Ye(Du()),Yn=["jpg","gif","png"],Rg=async(e,t)=>{var g,w,T;let n=(0,Qn.default)(e),a=await n.metadata(),o=(g=a.width)!=null?g:100,l=(w=a.height)!=null?w:100,f=e.split(";")[0].split("/")[1];if(Yn.includes(f))return{type:f,data:e,transformation:{width:o,height:l}};let h=(T=t==null?void 0:t.fallbackImageType)!=null?T:"png",d={data:await n.toFormat(h).toBuffer(),type:h,transformation:{width:o,height:l}};return e.includes("svg")?{...d,type:"svg",data:e,fallback:{type:h,data:d.data}}:d},Pg=async(e,t)=>{var f,h,d,g,w,T,k,W;let n,a,o;if(e.startsWith("http")){let S=await kn(e),N=await S.arrayBuffer(),F=((h=(f=S.headers.get("content-type"))==null?void 0:f.split(";")[0])!=null?h:"image/png").split("/")[1];n=(0,Qn.default)(N);let U=await n.metadata();if(a=(d=U.width)!=null?d:100,o=(g=U.height)!=null?g:100,Yn.includes(F))return{type:F,data:N,transformation:{width:a,height:o}}}else{let S=(w=t==null?void 0:t.pathPrefix)!=null?w:"";n=(0,Qn.default)(S+e);let N=await n.metadata();a=(T=N.width)!=null?T:100,o=(k=N.height)!=null?k:100;let q=e.split(".").pop();if(Yn.includes(q))return{type:q,data:await n.toBuffer(),transformation:{width:a,height:o}}}let l=(W=t==null?void 0:t.fallbackImageType)!=null?W:"png";return{data:await n.toFormat(l).toBuffer(),type:l,transformation:{width:a,height:o}}},Tg=async(e,t)=>{try{return e.startsWith("data:")?await Rg(e,t):await Pg(e,t)}catch(n){return console.error(`Error resolving image: ${e}`,n),{type:"png",data:Buffer.from([]),transformation:{width:100,height:100}}}},Ag=e=>({preprocess:async(n,a)=>{let o=[],l=f=>{var h;(h=f.children)==null||h.forEach(l),/^image/.test(f.type)&&o.push((async()=>{var w,T,k,W;let d=(T=f.url)!=null?T:a[(w=f.identifier)==null?void 0:w.toUpperCase()],g=(k=f.alt)!=null?k:d==null?void 0:d.split("/").pop();f.data={...await((W=e==null?void 0:e.imageResolver)!=null?W:Tg)(d,e),altText:{description:g,name:g,title:g},...f.data}})())};l(n)},inline:(n,a,o)=>/^(image|svg)/.test(a.type)?[new n.ImageRun({...data,...o})]:[]});0&&(module.exports={SUPPORTED_IMAGE_TYPES,nodeImagePlugin});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,b}from"../../chunk-
|
|
1
|
+
import{a,b}from"../../chunk-LO72SAXR.mjs";import"../../chunk-3B7PIKIS.mjs";export{a as SUPPORTED_IMAGE_TYPES,b as nodeImagePlugin};
|