gemi 0.4.35 → 0.4.36

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.
@@ -0,0 +1,5 @@
1
+ import{x as J,y as L} from"./chunk-a5c18c07abe8fd9c.js";import{fb as p} from"./chunk-bbd36ce62b950ee5.js";var xn=L((Dr,Pn)=>{var{defineProperty:l,getOwnPropertyDescriptor:Fi,getOwnPropertyNames:Ci}=Object,Ui=Object.prototype.hasOwnProperty,Y=(n,t)=>l(n,"name",{value:t,configurable:!0}),Ei=(n,t)=>{for(var c in t)l(n,c,{get:t[c],enumerable:!0})},Ii=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of Ci(t))if(!Ui.call(n,f)&&f!==c)l(n,f,{get:()=>t[f],enumerable:!(i=Fi(t,f))||i.enumerable})}return n},yi=(n)=>Ii(l({},"__esModule",{value:!0}),n),Hn={};Ei(Hn,{constructStack:()=>Tn});Pn.exports=yi(Hn);var A=Y((n,t)=>{const c=[];if(n)c.push(n);if(t)for(let i of t)c.push(i);return c},"getAllAliases"),G=Y((n,t)=>{return`${n||"anonymous"}${t&&t.length>0?` (a.k.a. ${t.join(",")})`:""}`},"getMiddlewareNameWithAliases"),Tn=Y(()=>{let n=[],t=[],c=!1;const i=new Set,f=Y(($)=>$.sort((o,T)=>jn[T.step]-jn[o.step]||Rn[T.priority||"normal"]-Rn[o.priority||"normal"]),"sort"),h=Y(($)=>{let o=!1;const T=Y((U)=>{const E=A(U.name,U.aliases);if(E.includes($)){o=!0;for(let F of E)i.delete(F);return!1}return!0},"filterCb");return n=n.filter(T),t=t.filter(T),o},"removeByName"),r=Y(($)=>{let o=!1;const T=Y((U)=>{if(U.middleware===$){o=!0;for(let E of A(U.name,U.aliases))i.delete(E);return!1}return!0},"filterCb");return n=n.filter(T),t=t.filter(T),o},"removeByReference"),s=Y(($)=>{var o;return n.forEach((T)=>{$.add(T.middleware,{...T})}),t.forEach((T)=>{$.addRelativeTo(T.middleware,{...T})}),(o=$.identifyOnResolve)==null||o.call($,C.identifyOnResolve()),$},"cloneTo"),u=Y(($)=>{const o=[];return $.before.forEach((T)=>{if(T.before.length===0&&T.after.length===0)o.push(T);else o.push(...u(T))}),o.push($),$.after.reverse().forEach((T)=>{if(T.before.length===0&&T.after.length===0)o.push(T);else o.push(...u(T))}),o},"expandRelativeMiddlewareList"),d=Y(($=!1)=>{const o=[],T=[],U={};return n.forEach((F)=>{const w={...F,before:[],after:[]};for(let x of A(w.name,w.aliases))U[x]=w;o.push(w)}),t.forEach((F)=>{const w={...F,before:[],after:[]};for(let x of A(w.name,w.aliases))U[x]=w;T.push(w)}),T.forEach((F)=>{if(F.toMiddleware){const w=U[F.toMiddleware];if(w===void 0){if($)return;throw new Error(`${F.toMiddleware} is not found when adding ${G(F.name,F.aliases)} middleware ${F.relation} ${F.toMiddleware}`)}if(F.relation==="after")w.after.push(F);if(F.relation==="before")w.before.push(F)}}),f(o).map(u).reduce((F,w)=>{return F.push(...w),F},[])},"getMiddlewareList"),C={add:($,o={})=>{const{name:T,override:U,aliases:E}=o,F={step:"initialize",priority:"normal",middleware:$,...o},w=A(T,E);if(w.length>0){if(w.some((x)=>i.has(x))){if(!U)throw new Error(`Duplicate middleware name '${G(T,E)}'`);for(let x of w){const I=n.findIndex((g)=>{var V;return g.name===x||((V=g.aliases)==null?void 0:V.some((M)=>M===x))});if(I===-1)continue;const y=n[I];if(y.step!==F.step||F.priority!==y.priority)throw new Error(`"${G(y.name,y.aliases)}" middleware with ${y.priority} priority in ${y.step} step cannot be overridden by "${G(T,E)}" middleware with ${F.priority} priority in ${F.step} step.`);n.splice(I,1)}}for(let x of w)i.add(x)}n.push(F)},addRelativeTo:($,o)=>{const{name:T,override:U,aliases:E}=o,F={middleware:$,...o},w=A(T,E);if(w.length>0){if(w.some((x)=>i.has(x))){if(!U)throw new Error(`Duplicate middleware name '${G(T,E)}'`);for(let x of w){const I=t.findIndex((g)=>{var V;return g.name===x||((V=g.aliases)==null?void 0:V.some((M)=>M===x))});if(I===-1)continue;const y=t[I];if(y.toMiddleware!==F.toMiddleware||y.relation!==F.relation)throw new Error(`"${G(y.name,y.aliases)}" middleware ${y.relation} "${y.toMiddleware}" middleware cannot be overridden by "${G(T,E)}" middleware ${F.relation} "${F.toMiddleware}" middleware.`);t.splice(I,1)}}for(let x of w)i.add(x)}t.push(F)},clone:()=>s(Tn()),use:($)=>{$.applyToStack(C)},remove:($)=>{if(typeof $==="string")return h($);else return r($)},removeByTag:($)=>{let o=!1;const T=Y((U)=>{const{tags:E,name:F,aliases:w}=U;if(E&&E.includes($)){const x=A(F,w);for(let I of x)i.delete(I);return o=!0,!1}return!0},"filterCb");return n=n.filter(T),t=t.filter(T),o},concat:($)=>{var o;const T=s(Tn());return T.use($),T.identifyOnResolve(c||T.identifyOnResolve()||(((o=$.identifyOnResolve)==null?void 0:o.call($))??!1)),T},applyToStack:s,identify:()=>{return d(!0).map(($)=>{const o=$.step??$.relation+" "+$.toMiddleware;return G($.name,$.aliases)+" - "+o})},identifyOnResolve($){if(typeof $==="boolean")c=$;return c},resolve:($,o)=>{for(let T of d().map((U)=>U.middleware).reverse())$=T($,o);if(c)console.log(C.identify());return $}};return C},"constructStack"),jn={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},Rn={high:3,normal:2,low:1}});var nt=L((Mr,_n)=>{var{defineProperty:v,getOwnPropertyDescriptor:Di,getOwnPropertyNames:gi}=Object,Ni=Object.prototype.hasOwnProperty,Yi=(n,t)=>v(n,"name",{value:t,configurable:!0}),Si=(n,t)=>{for(var c in t)v(n,c,{get:t[c],enumerable:!0})},zi=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of gi(t))if(!Ni.call(n,f)&&f!==c)v(n,f,{get:()=>t[f],enumerable:!(i=Di(t,f))||i.enumerable})}return n},Zi=(n)=>zi(v({},"__esModule",{value:!0}),n),mn={};Si(mn,{isArrayBuffer:()=>Vi});_n.exports=Zi(mn);var Vi=Yi((n)=>typeof ArrayBuffer==="function"&&n instanceof ArrayBuffer||Object.prototype.toString.call(n)==="[object ArrayBuffer]","isArrayBuffer")});var B=L((Ar,it)=>{var{defineProperty:q,getOwnPropertyDescriptor:Gi,getOwnPropertyNames:Qi}=Object,Mi=Object.prototype.hasOwnProperty,tt=(n,t)=>q(n,"name",{value:t,configurable:!0}),Ai=(n,t)=>{for(var c in t)q(n,c,{get:t[c],enumerable:!0})},Ki=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of Qi(t))if(!Mi.call(n,f)&&f!==c)q(n,f,{get:()=>t[f],enumerable:!(i=Gi(t,f))||i.enumerable})}return n},Xi=(n)=>Ki(q({},"__esModule",{value:!0}),n),ct={};Ai(ct,{fromArrayBuffer:()=>Wi,fromString:()=>bi});it.exports=Xi(ct);var Ji=nt(),dn=import.meta.require("buffer"),Wi=tt((n,t=0,c=n.byteLength-t)=>{if(!Ji.isArrayBuffer(n))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof n} (${n})`);return dn.Buffer.from(n,t,c)},"fromArrayBuffer"),bi=tt((n,t)=>{if(typeof n!=="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof n} (${n})`);return t?dn.Buffer.from(n,t):dn.Buffer.from(n)},"fromString")});var rt=L((ft)=>{Object.defineProperty(ft,"__esModule",{value:!0});ft.fromBase64=void 0;var Bi=B(),ji=/^[A-Za-z0-9+/]*={0,2}$/,Ri=(n)=>{if(n.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!ji.exec(n))throw new TypeError("Invalid base64 string.");const t=Bi.fromString(n,"base64");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)};ft.fromBase64=Ri});var m=L((Xr,$t)=>{var{defineProperty:a,getOwnPropertyDescriptor:Hi,getOwnPropertyNames:Pi}=Object,ki=Object.prototype.hasOwnProperty,on=(n,t)=>a(n,"name",{value:t,configurable:!0}),Oi=(n,t)=>{for(var c in t)a(n,c,{get:t[c],enumerable:!0})},li=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of Pi(t))if(!ki.call(n,f)&&f!==c)a(n,f,{get:()=>t[f],enumerable:!(i=Hi(t,f))||i.enumerable})}return n},pi=(n)=>li(a({},"__esModule",{value:!0}),n),st={};Oi(st,{fromUtf8:()=>wt,toUint8Array:()=>vi,toUtf8:()=>qi});$t.exports=pi(st);var ut=B(),wt=on((n)=>{const t=ut.fromString(n,"utf8");return new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),vi=on((n)=>{if(typeof n==="string")return wt(n);if(ArrayBuffer.isView(n))return new Uint8Array(n.buffer,n.byteOffset,n.byteLength/Uint8Array.BYTES_PER_ELEMENT);return new Uint8Array(n)},"toUint8Array"),qi=on((n)=>{if(typeof n==="string")return n;if(typeof n!=="object"||typeof n.byteOffset!=="number"||typeof n.byteLength!=="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return ut.fromArrayBuffer(n.buffer,n.byteOffset,n.byteLength).toString("utf8")},"toUtf8")});var dt=L((Tt)=>{Object.defineProperty(Tt,"__esModule",{value:!0});Tt.toBase64=void 0;var ai=B(),mi=m(),_i=(n)=>{let t;if(typeof n==="string")t=mi.fromUtf8(n);else t=n;if(typeof t!=="object"||typeof t.byteOffset!=="number"||typeof t.byteLength!=="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return ai.fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength).toString("base64")};Tt.toBase64=_i});var nn=L((Wr,_)=>{var{defineProperty:ot,getOwnPropertyDescriptor:nf,getOwnPropertyNames:tf}=Object,cf=Object.prototype.hasOwnProperty,Fn=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of tf(t))if(!cf.call(n,f)&&f!==c)ot(n,f,{get:()=>t[f],enumerable:!(i=nf(t,f))||i.enumerable})}return n},Ft=(n,t,c)=>(Fn(n,t,"default"),c&&Fn(c,t,"default")),ff=(n)=>Fn(ot({},"__esModule",{value:!0}),n),Cn={};_.exports=ff(Cn);Ft(Cn,rt(),_.exports);Ft(Cn,dt(),_.exports)});var Et=L((Ct)=>{Object.defineProperty(Ct,"__esModule",{value:!0});Ct.getAwsChunkedEncodingStream=void 0;var hf=import.meta.require("stream"),rf=(n,t)=>{const{base64Encoder:c,bodyLengthChecker:i,checksumAlgorithmFn:f,checksumLocationName:h,streamHasher:r}=t,s=c!==void 0&&f!==void 0&&h!==void 0&&r!==void 0,u=s?r(f,n):void 0,d=new hf.Readable({read:()=>{}});return n.on("data",(C)=>{const $=i(C)||0;d.push(`${$.toString(16)}\r\n`),d.push(C),d.push("\r\n")}),n.on("end",async()=>{if(d.push("0\r\n"),s){const C=c(await u);d.push(`${h}:${C}\r\n`),d.push("\r\n")}d.push(null)}),d};Ct.getAwsChunkedEncodingStream=rf});var Un=L((Br,St)=>{var gt=function(n){return Object.keys(n).reduce((t,c)=>{const i=n[c];return{...t,[c]:Array.isArray(i)?[...i]:i}},{})},Yt=function(n){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(n)},tn=Object.defineProperty,sf=Object.getOwnPropertyDescriptor,uf=Object.getOwnPropertyNames,wf=Object.prototype.hasOwnProperty,Q=(n,t)=>tn(n,"name",{value:t,configurable:!0}),$f=(n,t)=>{for(var c in t)tn(n,c,{get:t[c],enumerable:!0})},Tf=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of uf(t))if(!wf.call(n,f)&&f!==c)tn(n,f,{get:()=>t[f],enumerable:!(i=sf(t,f))||i.enumerable})}return n},xf=(n)=>Tf(tn({},"__esModule",{value:!0}),n),It={};$f(It,{Field:()=>Ff,Fields:()=>Cf,HttpRequest:()=>Uf,HttpResponse:()=>Ef,IHttpRequest:()=>yt.HttpRequest,getHttpHandlerExtensionConfiguration:()=>df,isValidHostname:()=>Yt,resolveHttpHandlerRuntimeConfig:()=>of});St.exports=xf(It);var df=Q((n)=>{let t=n.httpHandler;return{setHttpHandler(c){t=c},httpHandler(){return t},updateHttpClientConfig(c,i){t.updateHttpClientConfig(c,i)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},"getHttpHandlerExtensionConfiguration"),of=Q((n)=>{return{httpHandler:n.httpHandler()}},"resolveHttpHandlerRuntimeConfig"),yt=p(),et=class n{constructor({name:t,kind:c=yt.FieldPosition.HEADER,values:i=[]}){this.name=t,this.kind=c,this.values=i}add(t){this.values.push(t)}set(t){this.values=t}remove(t){this.values=this.values.filter((c)=>c!==t)}toString(){return this.values.map((t)=>t.includes(",")||t.includes(" ")?`"${t}"`:t).join(", ")}get(){return this.values}};Q(et,"Field");var Ff=et,Lt=class n{constructor({fields:t=[],encoding:c="utf-8"}){this.entries={},t.forEach(this.setField.bind(this)),this.encoding=c}setField(t){this.entries[t.name.toLowerCase()]=t}getField(t){return this.entries[t.toLowerCase()]}removeField(t){delete this.entries[t.toLowerCase()]}getByType(t){return Object.values(this.entries).filter((c)=>c.kind===t)}};Q(Lt,"Fields");var Cf=Lt,Dt=class n{constructor(t){this.method=t.method||"GET",this.hostname=t.hostname||"localhost",this.port=t.port,this.query=t.query||{},this.headers=t.headers||{},this.body=t.body,this.protocol=t.protocol?t.protocol.slice(-1)!==":"?`${t.protocol}:`:t.protocol:"https:",this.path=t.path?t.path.charAt(0)!=="/"?`/${t.path}`:t.path:"/",this.username=t.username,this.password=t.password,this.fragment=t.fragment}static clone(t){const c=new n({...t,headers:{...t.headers}});if(c.query)c.query=gt(c.query);return c}static isInstance(t){if(!t)return!1;const c=t;return"method"in c&&"protocol"in c&&"hostname"in c&&"path"in c&&typeof c.query==="object"&&typeof c.headers==="object"}clone(){return n.clone(this)}};Q(Dt,"HttpRequest");var Uf=Dt;Q(gt,"cloneQuery");var Nt=class n{constructor(t){this.statusCode=t.statusCode,this.reason=t.reason,this.headers=t.headers||{},this.body=t.body}static isInstance(t){if(!t)return!1;const c=t;return typeof c.statusCode==="number"&&typeof c.headers==="object"}};Q(Nt,"HttpResponse");var Ef=Nt;Q(Yt,"isValidHostname")});var Gt=L((jr,Vt)=>{var{defineProperty:cn,getOwnPropertyDescriptor:If,getOwnPropertyNames:yf}=Object,ef=Object.prototype.hasOwnProperty,En=(n,t)=>cn(n,"name",{value:t,configurable:!0}),Lf=(n,t)=>{for(var c in t)cn(n,c,{get:t[c],enumerable:!0})},Df=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of yf(t))if(!ef.call(n,f)&&f!==c)cn(n,f,{get:()=>t[f],enumerable:!(i=If(t,f))||i.enumerable})}return n},gf=(n)=>Df(cn({},"__esModule",{value:!0}),n),zt={};Lf(zt,{escapeUri:()=>Zt,escapeUriPath:()=>Yf});Vt.exports=gf(zt);var Zt=En((n)=>encodeURIComponent(n).replace(/[!'()*]/g,Nf),"escapeUri"),Nf=En((n)=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`,"hexEncode"),Yf=En((n)=>n.split("/").map(Zt).join("/"),"escapeUriPath")});var yn=L((Rr,At)=>{var Mt=function(n){const t=[];for(let c of Object.keys(n).sort()){const i=n[c];if(c=In.escapeUri(c),Array.isArray(i))for(let f=0,h=i.length;f<h;f++)t.push(`${c}=${In.escapeUri(i[f])}`);else{let f=c;if(i||typeof i==="string")f+=`=${In.escapeUri(i)}`;t.push(f)}}return t.join("&")},fn=Object.defineProperty,Sf=Object.getOwnPropertyDescriptor,zf=Object.getOwnPropertyNames,Zf=Object.prototype.hasOwnProperty,Vf=(n,t)=>fn(n,"name",{value:t,configurable:!0}),Gf=(n,t)=>{for(var c in t)fn(n,c,{get:t[c],enumerable:!0})},Qf=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of zf(t))if(!Zf.call(n,f)&&f!==c)fn(n,f,{get:()=>t[f],enumerable:!(i=Sf(t,f))||i.enumerable})}return n},Mf=(n)=>Qf(fn({},"__esModule",{value:!0}),n),Qt={};Gf(Qt,{buildQueryString:()=>Mt});At.exports=Mf(Qt);var In=Gt();Vf(Mt,"buildQueryString")});var at=L((Hr,qt)=>{async function Dn(n,t,c=Kt){const i=t.headers??{},f=i.Expect||i.expect;let h=-1,r=!1;if(f==="100-continue")await Promise.race([new Promise((s)=>{h=Number(setTimeout(s,Math.max(Kt,c)))}),new Promise((s)=>{n.on("continue",()=>{clearTimeout(h),s()}),n.on("error",()=>{r=!0,clearTimeout(h),s()})})]);if(!r)Ht(n,t.body)}var Ht=function(n,t){if(t instanceof Rt.Readable){t.pipe(n);return}if(t){if(Buffer.isBuffer(t)||typeof t==="string"){n.end(t);return}const c=t;if(typeof c==="object"&&c.buffer&&typeof c.byteOffset==="number"&&typeof c.byteLength==="number"){n.end(Buffer.from(c.buffer,c.byteOffset,c.byteLength));return}n.end(Buffer.from(t));return}n.end()};async function vt(n){const t=[],c=n.getReader();let i=!1,f=0;while(!i){const{done:s,value:u}=await c.read();if(u)t.push(u),f+=u.length;i=s}const h=new Uint8Array(f);let r=0;for(let s of t)h.set(s,r),r+=s.length;return h}var{create:Af,defineProperty:j,getOwnPropertyDescriptor:Kf,getOwnPropertyNames:Xf,getPrototypeOf:Jf}=Object,Wf=Object.prototype.hasOwnProperty,D=(n,t)=>j(n,"name",{value:t,configurable:!0}),bf=(n,t)=>{for(var c in t)j(n,c,{get:t[c],enumerable:!0})},Jt=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of Xf(t))if(!Wf.call(n,f)&&f!==c)j(n,f,{get:()=>t[f],enumerable:!(i=Kf(t,f))||i.enumerable})}return n},Bf=(n,t,c)=>(c=n!=null?Af(Jf(n)):{},Jt(t||!n||!n.__esModule?j(c,"default",{value:n,enumerable:!0}):c,n)),jf=(n)=>Jt(j({},"__esModule",{value:!0}),n),Wt={};bf(Wt,{DEFAULT_REQUEST_TIMEOUT:()=>Of,NodeHttp2Handler:()=>af,NodeHttpHandler:()=>lf,streamCollector:()=>_f});qt.exports=jf(Wt);var bt=Un(),Bt=yn(),en=import.meta.require("http"),Ln=import.meta.require("https"),Rf=["ECONNRESET","EPIPE","ETIMEDOUT"],jt=D((n)=>{const t={};for(let c of Object.keys(n)){const i=n[c];t[c]=Array.isArray(i)?i.join(","):i}return t},"getTransformedHeaders"),Hf=D((n,t,c=0)=>{if(!c)return;const i=setTimeout(()=>{n.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${c} ms`),{name:"TimeoutError"}))},c);n.on("socket",(f)=>{if(f.connecting)f.on("connect",()=>{clearTimeout(i)});else clearTimeout(i)})},"setConnectionTimeout"),Pf=D((n,{keepAlive:t,keepAliveMsecs:c})=>{if(t!==!0)return;n.on("socket",(i)=>{i.setKeepAlive(t,c||0)})},"setSocketKeepAlive"),kf=D((n,t,c=0)=>{n.setTimeout(c,()=>{n.destroy(),t(Object.assign(new Error(`Connection timed out after ${c} ms`),{name:"TimeoutError"}))})},"setSocketTimeout"),Rt=import.meta.require("stream"),Kt=1000;D(Dn,"writeRequestBody");D(Ht,"writeBody");var Of=0,Pt=class n{constructor(t){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((c,i)=>{if(typeof t==="function")t().then((f)=>{c(this.resolveDefaultConfig(f))}).catch(i);else c(this.resolveDefaultConfig(t))})}static create(t){if(typeof(t==null?void 0:t.handle)==="function")return t;return new n(t)}static checkSocketUsage(t,c,i=console){var f,h,r;const{sockets:s,requests:u,maxSockets:d}=t;if(typeof d!=="number"||d===Infinity)return c;const C=15000;if(Date.now()-C<c)return c;if(s&&u)for(let $ in s){const o=((f=s[$])==null?void 0:f.length)??0,T=((h=u[$])==null?void 0:h.length)??0;if(o>=d&&T>=2*d)return(r=i==null?void 0:i.warn)==null||r.call(i,`@smithy/node-http-handler:WARN - socket usage at capacity=${o} and ${T} additional requests are enqueued.
2
+ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
3
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return c}resolveDefaultConfig(t){const{requestTimeout:c,connectionTimeout:i,socketTimeout:f,httpAgent:h,httpsAgent:r}=t||{};return{connectionTimeout:i,requestTimeout:c??f,httpAgent:(()=>{if(h instanceof en.Agent||typeof(h==null?void 0:h.destroy)==="function")return h;return new en.Agent({keepAlive:!0,maxSockets:50,...h})})(),httpsAgent:(()=>{if(r instanceof Ln.Agent||typeof(r==null?void 0:r.destroy)==="function")return r;return new Ln.Agent({keepAlive:!0,maxSockets:50,...r})})(),logger:console}}destroy(){var t,c,i,f;(c=(t=this.config)==null?void 0:t.httpAgent)==null||c.destroy(),(f=(i=this.config)==null?void 0:i.httpsAgent)==null||f.destroy()}async handle(t,{abortSignal:c}={}){if(!this.config)this.config=await this.configProvider;let i;return new Promise((f,h)=>{let r=void 0;const s=D(async(x)=>{await r,clearTimeout(i),f(x)},"resolve"),u=D(async(x)=>{await r,clearTimeout(i),h(x)},"reject");if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(c==null?void 0:c.aborted){const x=new Error("Request aborted");x.name="AbortError",u(x);return}const d=t.protocol==="https:",C=d?this.config.httpsAgent:this.config.httpAgent;i=setTimeout(()=>{this.socketWarningTimestamp=n.checkSocketUsage(C,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const $=Bt.buildQueryString(t.query||{});let o=void 0;if(t.username!=null||t.password!=null){const x=t.username??"",I=t.password??"";o=`${x}:${I}`}let T=t.path;if($)T+=`?${$}`;if(t.fragment)T+=`#${t.fragment}`;const U={headers:t.headers,host:t.hostname,method:t.method,path:T,port:t.port,agent:C,auth:o},F=(d?Ln.request:en.request)(U,(x)=>{const I=new bt.HttpResponse({statusCode:x.statusCode||-1,reason:x.statusMessage,headers:jt(x.headers),body:x});s({response:I})});if(F.on("error",(x)=>{if(Rf.includes(x.code))u(Object.assign(x,{name:"TimeoutError"}));else u(x)}),Hf(F,u,this.config.connectionTimeout),kf(F,u,this.config.requestTimeout),c){const x=D(()=>{F.destroy();const I=new Error("Request aborted");I.name="AbortError",u(I)},"onAbort");if(typeof c.addEventListener==="function"){const I=c;I.addEventListener("abort",x,{once:!0}),F.once("close",()=>I.removeEventListener("abort",x))}else c.onabort=x}const w=U.agent;if(typeof w==="object"&&"keepAlive"in w)Pf(F,{keepAlive:w.keepAlive,keepAliveMsecs:w.keepAliveMsecs});r=Dn(F,t,this.config.requestTimeout).catch((x)=>{return clearTimeout(i),h(x)})})}updateHttpClientConfig(t,c){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return{...i,[t]:c}})}httpHandlerConfigs(){return this.config??{}}};D(Pt,"NodeHttpHandler");var lf=Pt,Xt=import.meta.require("http2"),pf=Bf(import.meta.require("http2")),kt=class n{constructor(t){this.sessions=[],this.sessions=t??[]}poll(){if(this.sessions.length>0)return this.sessions.shift()}offerLast(t){this.sessions.push(t)}contains(t){return this.sessions.includes(t)}remove(t){this.sessions=this.sessions.filter((c)=>c!==t)}[Symbol.iterator](){return this.sessions[Symbol.iterator]()}destroy(t){for(let c of this.sessions)if(c===t){if(!c.destroyed)c.destroy()}}};D(kt,"NodeHttp2ConnectionPool");var vf=kt,Ot=class n{constructor(t){if(this.sessionCache=new Map,this.config=t,this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrency must be greater than zero.")}lease(t,c){const i=this.getUrlString(t),f=this.sessionCache.get(i);if(f){const u=f.poll();if(u&&!this.config.disableConcurrency)return u}const h=pf.default.connect(i);if(this.config.maxConcurrency)h.settings({maxConcurrentStreams:this.config.maxConcurrency},(u)=>{if(u)throw new Error("Fail to set maxConcurrentStreams to "+this.config.maxConcurrency+"when creating new session for "+t.destination.toString())});h.unref();const r=D(()=>{h.destroy(),this.deleteSession(i,h)},"destroySessionCb");if(h.on("goaway",r),h.on("error",r),h.on("frameError",r),h.on("close",()=>this.deleteSession(i,h)),c.requestTimeout)h.setTimeout(c.requestTimeout,r);const s=this.sessionCache.get(i)||new vf;return s.offerLast(h),this.sessionCache.set(i,s),h}deleteSession(t,c){const i=this.sessionCache.get(t);if(!i)return;if(!i.contains(c))return;i.remove(c),this.sessionCache.set(t,i)}release(t,c){var i;const f=this.getUrlString(t);(i=this.sessionCache.get(f))==null||i.offerLast(c)}destroy(){for(let[t,c]of this.sessionCache){for(let i of c){if(!i.destroyed)i.destroy();c.remove(i)}this.sessionCache.delete(t)}}setMaxConcurrentStreams(t){if(this.config.maxConcurrency&&this.config.maxConcurrency<=0)throw new RangeError("maxConcurrentStreams must be greater than zero.");this.config.maxConcurrency=t}setDisableConcurrentStreams(t){this.config.disableConcurrency=t}getUrlString(t){return t.destination.toString()}};D(Ot,"NodeHttp2ConnectionManager");var qf=Ot,lt=class n{constructor(t){this.metadata={handlerProtocol:"h2"},this.connectionManager=new qf({}),this.configProvider=new Promise((c,i)=>{if(typeof t==="function")t().then((f)=>{c(f||{})}).catch(i);else c(t||{})})}static create(t){if(typeof(t==null?void 0:t.handle)==="function")return t;return new n(t)}destroy(){this.connectionManager.destroy()}async handle(t,{abortSignal:c}={}){if(!this.config){if(this.config=await this.configProvider,this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams||!1),this.config.maxConcurrentStreams)this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams)}const{requestTimeout:i,disableConcurrentStreams:f}=this.config;return new Promise((h,r)=>{var s;let u=!1,d=void 0;const C=D(async(e)=>{await d,h(e)},"resolve"),$=D(async(e)=>{await d,r(e)},"reject");if(c==null?void 0:c.aborted){u=!0;const e=new Error("Request aborted");e.name="AbortError",$(e);return}const{hostname:o,method:T,port:U,protocol:E,query:F}=t;let w="";if(t.username!=null||t.password!=null){const e=t.username??"",S=t.password??"";w=`${e}:${S}@`}const x=`${E}//${w}${o}${U?`:${U}`:""}`,I={destination:new URL(x)},y=this.connectionManager.lease(I,{requestTimeout:(s=this.config)==null?void 0:s.sessionTimeout,disableConcurrentStreams:f||!1}),g=D((e)=>{if(f)this.destroySession(y);u=!0,$(e)},"rejectWithDestroy"),V=Bt.buildQueryString(F||{});let M=t.path;if(V)M+=`?${V}`;if(t.fragment)M+=`#${t.fragment}`;const N=y.request({...t.headers,[Xt.constants.HTTP2_HEADER_PATH]:M,[Xt.constants.HTTP2_HEADER_METHOD]:T});if(y.ref(),N.on("response",(e)=>{const S=new bt.HttpResponse({statusCode:e[":status"]||-1,headers:jt(e),body:N});if(u=!0,C({response:S}),f)y.close(),this.connectionManager.deleteSession(x,y)}),i)N.setTimeout(i,()=>{N.close();const e=new Error(`Stream timed out because of no activity for ${i} ms`);e.name="TimeoutError",g(e)});if(c){const e=D(()=>{N.close();const S=new Error("Request aborted");S.name="AbortError",g(S)},"onAbort");if(typeof c.addEventListener==="function"){const S=c;S.addEventListener("abort",e,{once:!0}),N.once("close",()=>S.removeEventListener("abort",e))}else c.onabort=e}N.on("frameError",(e,S,oi)=>{g(new Error(`Frame type id ${e} in stream id ${oi} has failed with code ${S}.`))}),N.on("error",g),N.on("aborted",()=>{g(new Error(`HTTP/2 stream is abnormally aborted in mid-communication with result code ${N.rstCode}.`))}),N.on("close",()=>{if(y.unref(),f)y.destroy();if(!u)g(new Error("Unexpected error: http2 request did not get a response"))}),d=Dn(N,t,i)})}updateHttpClientConfig(t,c){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return{...i,[t]:c}})}httpHandlerConfigs(){return this.config??{}}destroySession(t){if(!t.destroyed)t.destroy()}};D(lt,"NodeHttp2Handler");var af=lt,pt=class n extends Rt.Writable{constructor(){super(...arguments);this.bufferedBytes=[]}_write(t,c,i){this.bufferedBytes.push(t),i()}};D(pt,"Collector");var mf=pt,_f=D((n)=>{if(nh(n))return vt(n);return new Promise((t,c)=>{const i=new mf;n.pipe(i),n.on("error",(f)=>{i.end(),c(f)}),i.on("error",c),i.on("finish",function(){const f=new Uint8Array(Buffer.concat(this.bufferedBytes));t(f)})})},"streamCollector"),nh=D((n)=>typeof ReadableStream==="function"&&n instanceof ReadableStream,"isReadableStreamInstance");D(vt,"collectReadableStream")});var rc=L((Pr,hc)=>{var nc=function(n=0){return new Promise((t,c)=>{if(n)setTimeout(()=>{const i=new Error(`Request did not complete within ${n} ms`);i.name="TimeoutError",c(i)},n)})};async function cc(n){const t=await fc(n),c=wh.fromBase64(t);return new Uint8Array(c)}async function ic(n){const t=[],c=n.getReader();let i=!1,f=0;while(!i){const{done:s,value:u}=await c.read();if(u)t.push(u),f+=u.length;i=s}const h=new Uint8Array(f);let r=0;for(let s of t)h.set(s,r),r+=s.length;return h}var fc=function(n){return new Promise((t,c)=>{const i=new FileReader;i.onloadend=()=>{if(i.readyState!==2)return c(new Error("Reader aborted too early"));const f=i.result??"",h=f.indexOf(","),r=h>-1?h+1:f.length;t(f.substring(r))},i.onabort=()=>c(new Error("Read aborted")),i.onerror=()=>c(i.error),i.readAsDataURL(n)})},rn=Object.defineProperty,th=Object.getOwnPropertyDescriptor,ch=Object.getOwnPropertyNames,ih=Object.prototype.hasOwnProperty,Z=(n,t)=>rn(n,"name",{value:t,configurable:!0}),fh=(n,t)=>{for(var c in t)rn(n,c,{get:t[c],enumerable:!0})},hh=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of ch(t))if(!ih.call(n,f)&&f!==c)rn(n,f,{get:()=>t[f],enumerable:!(i=th(t,f))||i.enumerable})}return n},rh=(n)=>hh(rn({},"__esModule",{value:!0}),n),_t={};fh(_t,{FetchHttpHandler:()=>uh,keepAliveSupport:()=>hn,streamCollector:()=>$h});hc.exports=rh(_t);var mt=Un(),sh=yn();Z(nc,"requestTimeout");var hn={supported:void 0},tc=class n{static create(t){if(typeof(t==null?void 0:t.handle)==="function")return t;return new n(t)}constructor(t){if(typeof t==="function")this.configProvider=t().then((c)=>c||{});else this.config=t??{},this.configProvider=Promise.resolve(this.config);if(hn.supported===void 0)hn.supported=Boolean(typeof Request!=="undefined"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(t,{abortSignal:c}={}){if(!this.config)this.config=await this.configProvider;const i=this.config.requestTimeout,f=this.config.keepAlive===!0,h=this.config.credentials;if(c==null?void 0:c.aborted){const w=new Error("Request aborted");return w.name="AbortError",Promise.reject(w)}let r=t.path;const s=sh.buildQueryString(t.query||{});if(s)r+=`?${s}`;if(t.fragment)r+=`#${t.fragment}`;let u="";if(t.username!=null||t.password!=null){const w=t.username??"",x=t.password??"";u=`${w}:${x}@`}const{port:d,method:C}=t,$=`${t.protocol}//${u}${t.hostname}${d?`:${d}`:""}${r}`,o=C==="GET"||C==="HEAD"?void 0:t.body,T={body:o,headers:new Headers(t.headers),method:C,credentials:h};if(o)T.duplex="half";if(typeof AbortController!=="undefined")T.signal=c;if(hn.supported)T.keepalive=f;let U=Z(()=>{},"removeSignalEventListener");const E=new Request($,T),F=[fetch(E).then((w)=>{const x=w.headers,I={};for(let g of x.entries())I[g[0]]=g[1];if(w.body==null)return w.blob().then((g)=>({response:new mt.HttpResponse({headers:I,reason:w.statusText,statusCode:w.status,body:g})}));return{response:new mt.HttpResponse({headers:I,reason:w.statusText,statusCode:w.status,body:w.body})}}),nc(i)];if(c)F.push(new Promise((w,x)=>{const I=Z(()=>{const y=new Error("Request aborted");y.name="AbortError",x(y)},"onAbort");if(typeof c.addEventListener==="function"){const y=c;y.addEventListener("abort",I,{once:!0}),U=Z(()=>y.removeEventListener("abort",I),"removeSignalEventListener")}else c.onabort=I}));return Promise.race(F).finally(U)}updateHttpClientConfig(t,c){this.config=void 0,this.configProvider=this.configProvider.then((i)=>{return i[t]=c,i})}httpHandlerConfigs(){return this.config??{}}};Z(tc,"FetchHttpHandler");var uh=tc,wh=nn(),$h=Z((n)=>{if(typeof Blob==="function"&&n instanceof Blob)return cc(n);return ic(n)},"streamCollector");Z(cc,"collectBlob");Z(ic,"collectStream");Z(fc,"readToBase64")});var dc=L((kr,xc)=>{var $c=function(n){if(n.length%2!==0)throw new Error("Hex encoded strings must have an even number length");const t=new Uint8Array(n.length/2);for(let c=0;c<n.length;c+=2){const i=n.slice(c,c+2).toLowerCase();if(i in gn)t[c/2]=gn[i];else throw new Error(`Cannot decode unrecognized sequence ${i} as hexadecimal`)}return t},Tc=function(n){let t="";for(let c=0;c<n.byteLength;c++)t+=wc[n[c]];return t},sn=Object.defineProperty,Th=Object.getOwnPropertyDescriptor,xh=Object.getOwnPropertyNames,dh=Object.prototype.hasOwnProperty,sc=(n,t)=>sn(n,"name",{value:t,configurable:!0}),oh=(n,t)=>{for(var c in t)sn(n,c,{get:t[c],enumerable:!0})},Fh=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of xh(t))if(!dh.call(n,f)&&f!==c)sn(n,f,{get:()=>t[f],enumerable:!(i=Th(t,f))||i.enumerable})}return n},Ch=(n)=>Fh(sn({},"__esModule",{value:!0}),n),uc={};oh(uc,{fromHex:()=>$c,toHex:()=>Tc});xc.exports=Ch(uc);var wc={},gn={};for(let n=0;n<256;n++){let t=n.toString(16).toLowerCase();if(t.length===1)t=`0${t}`;wc[n]=t,gn[t]=n}sc($c,"fromHex");sc(Tc,"toHex")});var R=L((oc)=>{Object.defineProperty(oc,"__esModule",{value:!0});oc.isReadableStream=void 0;var Uh=(n)=>{var t;return typeof ReadableStream==="function"&&(((t=n===null||n===void 0?void 0:n.constructor)===null||t===void 0?void 0:t.name)===ReadableStream.name||n instanceof ReadableStream)};oc.isReadableStream=Uh});var ec=L((Ic)=>{Object.defineProperty(Ic,"__esModule",{value:!0});Ic.sdkStreamMixin=void 0;var Eh=rc(),Ih=nn(),yh=dc(),eh=m(),Cc=R(),Uc="The stream has already been transformed.",Lh=(n)=>{var t,c;if(!Ec(n)&&!Cc.isReadableStream(n)){const r=((c=(t=n===null||n===void 0?void 0:n.__proto__)===null||t===void 0?void 0:t.constructor)===null||c===void 0?void 0:c.name)||n;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${r}`)}let i=!1;const f=async()=>{if(i)throw new Error(Uc);return i=!0,await Eh.streamCollector(n)},h=(r)=>{if(typeof r.stream!=="function")throw new Error("Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled.\nIf you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body");return r.stream()};return Object.assign(n,{transformToByteArray:f,transformToString:async(r)=>{const s=await f();if(r==="base64")return Ih.toBase64(s);else if(r==="hex")return yh.toHex(s);else if(r===void 0||r==="utf8"||r==="utf-8")return eh.toUtf8(s);else if(typeof TextDecoder==="function")return new TextDecoder(r).decode(s);else throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(i)throw new Error(Uc);if(i=!0,Ec(n))return h(n);else if(Cc.isReadableStream(n))return n;else throw new Error(`Cannot transform payload to web stream, got ${n}`)}})};Ic.sdkStreamMixin=Lh;var Ec=(n)=>typeof Blob==="function"&&n instanceof Blob});var Nc=L((Dc)=>{Object.defineProperty(Dc,"__esModule",{value:!0});Dc.sdkStreamMixin=void 0;var Dh=at(),gh=B(),Nn=import.meta.require("stream"),Nh=import.meta.require("util"),Yh=ec(),Lc="The stream has already been transformed.",Sh=(n)=>{var t,c;if(!(n instanceof Nn.Readable))try{return Yh.sdkStreamMixin(n)}catch(h){const r=((c=(t=n===null||n===void 0?void 0:n.__proto__)===null||t===void 0?void 0:t.constructor)===null||c===void 0?void 0:c.name)||n;throw new Error(`Unexpected stream implementation, expect Stream.Readable instance, got ${r}`)}let i=!1;const f=async()=>{if(i)throw new Error(Lc);return i=!0,await Dh.streamCollector(n)};return Object.assign(n,{transformToByteArray:f,transformToString:async(h)=>{const r=await f();if(h===void 0||Buffer.isEncoding(h))return gh.fromArrayBuffer(r.buffer,r.byteOffset,r.byteLength).toString(h);else return new Nh.TextDecoder(h).decode(r)},transformToWebStream:()=>{if(i)throw new Error(Lc);if(n.readableFlowing!==null)throw new Error("The stream has been consumed by other callbacks.");if(typeof Nn.Readable.toWeb!=="function")throw new Error("Readable.toWeb() is not supported. Please make sure you are using Node.js >= 17.0.0, or polyfill is available.");return i=!0,Nn.Readable.toWeb(n)}})};Dc.sdkStreamMixin=Sh});var zc=L((Yc)=>{async function zh(n){if(typeof n.stream==="function")n=n.stream();return n.tee()}Object.defineProperty(Yc,"__esModule",{value:!0});Yc.splitStream=void 0;Yc.splitStream=zh});var Qc=L((Vc)=>{async function Gh(n){if(Vh.isReadableStream(n))return Zh.splitStream(n);const t=new Zc.PassThrough,c=new Zc.PassThrough;return n.pipe(t),n.pipe(c),[t,c]}Object.defineProperty(Vc,"__esModule",{value:!0});Vc.splitStream=void 0;var Zc=import.meta.require("stream"),Zh=zc(),Vh=R();Vc.splitStream=Gh});var Kc=L((Mc)=>{async function Qh(n,t){var c;let i=0;const f=[],h=n.getReader();let r=!1;while(!r){const{done:d,value:C}=await h.read();if(C)f.push(C),i+=(c=C===null||C===void 0?void 0:C.byteLength)!==null&&c!==void 0?c:0;if(i>=t)break;r=d}h.releaseLock();const s=new Uint8Array(Math.min(t,i));let u=0;for(let d of f){if(d.byteLength>s.byteLength-u){s.set(d.subarray(0,s.byteLength-u),u);break}else s.set(d,u);u+=d.length}return s}Object.defineProperty(Mc,"__esModule",{value:!0});Mc.headStream=void 0;Mc.headStream=Qh});var bc=L((Jc)=>{Object.defineProperty(Jc,"__esModule",{value:!0});Jc.headStream=void 0;var Mh=import.meta.require("stream"),Ah=Kc(),Kh=R(),Xh=(n,t)=>{if(Kh.isReadableStream(n))return Ah.headStream(n,t);return new Promise((c,i)=>{const f=new Xc;f.limit=t,n.pipe(f),n.on("error",(h)=>{f.end(),i(h)}),f.on("error",i),f.on("finish",function(){const h=new Uint8Array(Buffer.concat(this.buffers));c(h)})})};Jc.headStream=Xh;class Xc extends Mh.Writable{constructor(){super(...arguments);this.buffers=[],this.limit=Infinity,this.bytesBuffered=0}_write(n,t,c){var i;if(this.buffers.push(n),this.bytesBuffered+=(i=n.byteLength)!==null&&i!==void 0?i:0,this.bytesBuffered>=this.limit){const f=this.bytesBuffered-this.limit,h=this.buffers[this.buffers.length-1];this.buffers[this.buffers.length-1]=h.subarray(0,h.byteLength-f),this.emit("finish")}c()}}});var kc=L((_r,X)=>{var Rc=function(n,t="utf-8"){if(t==="base64")return Bc.toBase64(n);return jc.toUtf8(n)},Hc=function(n,t){if(t==="base64")return Sn.mutate(Bc.fromBase64(n));return Sn.mutate(jc.fromUtf8(n))},un=Object.defineProperty,Jh=Object.getOwnPropertyDescriptor,Wh=Object.getOwnPropertyNames,bh=Object.prototype.hasOwnProperty,zn=(n,t)=>un(n,"name",{value:t,configurable:!0}),Bh=(n,t)=>{for(var c in t)un(n,c,{get:t[c],enumerable:!0})},Yn=(n,t,c,i)=>{if(t&&typeof t==="object"||typeof t==="function"){for(let f of Wh(t))if(!bh.call(n,f)&&f!==c)un(n,f,{get:()=>t[f],enumerable:!(i=Jh(t,f))||i.enumerable})}return n},H=(n,t,c)=>(Yn(n,t,"default"),c&&Yn(c,t,"default")),jh=(n)=>Yn(un({},"__esModule",{value:!0}),n),K={};Bh(K,{Uint8ArrayBlobAdapter:()=>Sn});X.exports=jh(K);var Bc=nn(),jc=m();zn(Rc,"transformToString");zn(Hc,"transformFromString");var Pc=class n extends Uint8Array{static fromString(t,c="utf-8"){switch(typeof t){case"string":return Hc(t,c);default:throw new Error(`Unsupported conversion from ${typeof t} to Uint8ArrayBlobAdapter.`)}}static mutate(t){return Object.setPrototypeOf(t,n.prototype),t}transformToString(t="utf-8"){return Rc(this,t)}};zn(Pc,"Uint8ArrayBlobAdapter");var Sn=Pc;H(K,Et(),X.exports);H(K,Nc(),X.exports);H(K,Qc(),X.exports);H(K,bc(),X.exports);H(K,R(),X.exports)});var kn=J(xn(),1);class ei{constructor(n){this.middlewareStack=kn.constructStack(),this.config=n}send(n,t,c){const i=typeof t!=="function"?t:void 0,f=typeof t==="function"?t:c,h=n.resolveMiddleware(this.middlewareStack,this.config,i);if(f)h(n).then((r)=>f(null,r.output),(r)=>f(r)).catch(()=>{});else return h(n).then((r)=>r.output)}destroy(){if(this.config.requestHandler.destroy)this.config.requestHandler.destroy()}}var On=J(xn(),1),ln=J(p(),1);class pn{constructor(){this.middlewareStack=On.constructStack()}static classBuilder(){return new vn}resolveMiddlewareWithContext(n,t,c,{middlewareFn:i,clientName:f,commandName:h,inputFilterSensitiveLog:r,outputFilterSensitiveLog:s,smithyContext:u,additionalContext:d,CommandCtor:C}){for(let E of i.bind(this)(C,n,t,c))this.middlewareStack.use(E);const $=n.concat(this.middlewareStack),{logger:o}=t,T={logger:o,clientName:f,commandName:h,inputFilterSensitiveLog:r,outputFilterSensitiveLog:s,[ln.SMITHY_CONTEXT_KEY]:{commandInstance:this,...u},...d},{requestHandler:U}=t;return $.resolve((E)=>U.handle(E.request,c||{}),T)}}class vn{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=(n)=>n,this._outputFilterSensitiveLog=(n)=>n,this._serializer=null,this._deserializer=null}init(n){this._init=n}ep(n){return this._ep=n,this}m(n){return this._middlewareFn=n,this}s(n,t,c={}){return this._smithyContext={service:n,operation:t,...c},this}c(n={}){return this._additionalContext=n,this}n(n,t){return this._clientName=n,this._commandName=t,this}f(n=(c)=>c,t=(c)=>c){return this._inputFilterSensitiveLog=n,this._outputFilterSensitiveLog=t,this}ser(n){return this._serializer=n,this}de(n){return this._deserializer=n,this}build(){const n=this;let t;return t=class extends pn{static getEndpointParameterInstructions(){return n._ep}constructor(...[c]){super();this.serialize=n._serializer,this.deserialize=n._deserializer,this.input=c??{},n._init(this)}resolveMiddleware(c,i,f){return this.resolveMiddlewareWithContext(c,i,f,{CommandCtor:t,middlewareFn:n._middlewareFn,clientName:n._clientName,commandName:n._commandName,inputFilterSensitiveLog:n._inputFilterSensitiveLog,outputFilterSensitiveLog:n._outputFilterSensitiveLog,smithyContext:n._smithyContext,additionalContext:n._additionalContext})}}}}var Sr="***SensitiveInformation***";var Zr=(n,t)=>{for(let c of Object.keys(n)){const i=n[c],f=async function(r,s,u){const d=new i(r);if(typeof s==="function")this.send(d,s);else if(typeof u==="function"){if(typeof s!=="object")throw new Error(`Expected http options but got ${typeof s}`);this.send(d,s||{},u)}else return this.send(d,s)},h=(c[0].toLowerCase()+c.slice(1)).replace(/Command$/,"");t.prototype[h]=f}};class qn extends Error{constructor(n){super(n.message);Object.setPrototypeOf(this,qn.prototype),this.name=n.name,this.$fault=n.$fault,this.$metadata=n.$metadata}}var an=(n,t={})=>{Object.entries(t).filter(([,i])=>i!==void 0).forEach(([i,f])=>{if(n[i]==null||n[i]==="")n[i]=f});const c=n.message||n.Message||"UnknownError";return n.message=c,delete n.Message,n};class Li{trace(){}debug(){}info(){}warn(){}error(){}}var wn=J(kc(),1),ns=async(n=new Uint8Array,t)=>{if(n instanceof Uint8Array)return wn.Uint8ArrayBlobAdapter.mutate(n);if(!n)return wn.Uint8ArrayBlobAdapter.mutate(new Uint8Array);const c=t.streamCollector(n);return wn.Uint8ArrayBlobAdapter.mutate(await c)};var cs=(n)=>{switch(n){case"true":return!0;case"false":return!1;default:throw new Error(`Unable to parse boolean value "${n}"`)}};var Rh=(n)=>{if(n===null||n===void 0)return;if(typeof n==="string"){const t=parseFloat(n);if(!Number.isNaN(t)){if(String(t)!==String(n))_c.warn(mc(`Expected number but observed string: ${n}`));return t}}if(typeof n==="number")return n;throw new TypeError(`Expected number, got ${typeof n}: ${n}`)},Hh=Math.ceil(340282346638528860000000000000000000000),Oc=(n)=>{const t=Rh(n);if(t!==void 0&&!Number.isNaN(t)&&t!==Infinity&&t!==(-Infinity)){if(Math.abs(t)>Hh)throw new TypeError(`Expected 32-bit float, got ${n}`)}return t},Zn=(n)=>{if(n===null||n===void 0)return;if(Number.isInteger(n)&&!Number.isNaN(n))return n;throw new TypeError(`Expected integer, got ${typeof n}: ${n}`)};var lc=(n)=>Vn(n,32),pc=(n)=>Vn(n,16),vc=(n)=>Vn(n,8),Vn=(n,t)=>{const c=Zn(n);if(c!==void 0&&Ph(c,t)!==c)throw new TypeError(`Expected ${t}-bit integer, got ${n}`);return c},Ph=(n,t)=>{switch(t){case 32:return Int32Array.of(n)[0];case 16:return Int16Array.of(n)[0];case 8:return Int8Array.of(n)[0]}},is=(n,t)=>{if(n===null||n===void 0){if(t)throw new TypeError(`Expected a non-null value for ${t}`);throw new TypeError("Expected a non-null value")}return n},fs=(n)=>{if(n===null||n===void 0)return;if(typeof n==="object"&&!Array.isArray(n))return n;const t=Array.isArray(n)?"array":typeof n;throw new TypeError(`Expected object, got ${t}: ${n}`)},hs=(n)=>{if(n===null||n===void 0)return;if(typeof n==="string")return n;if(["boolean","number","bigint"].includes(typeof n))return _c.warn(mc(`Expected string, got ${typeof n}: ${n}`)),String(n);throw new TypeError(`Expected string, got ${typeof n}: ${n}`)};var qc=(n)=>{if(typeof n=="string")return Oc(P(n));return Oc(n)},kh=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,P=(n)=>{const t=n.match(kh);if(t===null||t[0].length!==n.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(n)};var rs=(n)=>{if(typeof n==="string")return Zn(P(n));return Zn(n)};var ss=(n)=>{if(typeof n==="string")return lc(P(n));return lc(n)},W=(n)=>{if(typeof n==="string")return pc(P(n));return pc(n)},ac=(n)=>{if(typeof n==="string")return vc(P(n));return vc(n)},mc=(n)=>{return String(new TypeError(n).stack||n).split("\n").slice(0,5).filter((t)=>!t.includes("stackTraceWarning")).join("\n")},_c={warn:console.warn};function Ts(n){const t=n.getUTCFullYear(),c=n.getUTCMonth(),i=n.getUTCDay(),f=n.getUTCDate(),h=n.getUTCHours(),r=n.getUTCMinutes(),s=n.getUTCSeconds(),u=f<10?`0${f}`:`${f}`,d=h<10?`0${h}`:`${h}`,C=r<10?`0${r}`:`${r}`,$=s<10?`0${s}`:`${s}`;return`${Oh[i]}, ${u} ${Qn[c]} ${t} ${d}:${C}:${$} GMT`}var Oh=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Qn=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lh=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),xs=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=lh.exec(n);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[c,i,f,h,r,s,u,d]=t,C=W(b(i)),$=z(f,"month",1,12),o=z(h,"day",1,31);return k(C,$,o,{hours:r,minutes:s,seconds:u,fractionalMilliseconds:d})},ph=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),ds=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");const t=ph.exec(n);if(!t)throw new TypeError("Invalid RFC-3339 date-time value");const[c,i,f,h,r,s,u,d,C]=t,$=W(b(i)),o=z(f,"month",1,12),T=z(h,"day",1,31),U=k($,o,T,{hours:r,minutes:s,seconds:u,fractionalMilliseconds:d});if(C.toUpperCase()!="Z")U.setTime(U.getTime()-hr(C));return U},vh=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),qh=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),ah=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),os=(n)=>{if(n===null||n===void 0)return;if(typeof n!=="string")throw new TypeError("RFC-7231 date-times must be expressed as strings");let t=vh.exec(n);if(t){const[c,i,f,h,r,s,u,d]=t;return k(W(b(h)),Gn(f),z(i,"day",1,31),{hours:r,minutes:s,seconds:u,fractionalMilliseconds:d})}if(t=qh.exec(n),t){const[c,i,f,h,r,s,u,d]=t;return nr(k(mh(h),Gn(f),z(i,"day",1,31),{hours:r,minutes:s,seconds:u,fractionalMilliseconds:d}))}if(t=ah.exec(n),t){const[c,i,f,h,r,s,u,d]=t;return k(W(b(d)),Gn(i),z(f.trimLeft(),"day",1,31),{hours:h,minutes:r,seconds:s,fractionalMilliseconds:u})}throw new TypeError("Invalid RFC-7231 date-time value")};var k=(n,t,c,i)=>{const f=t-1;return cr(n,f,c),new Date(Date.UTC(n,f,c,z(i.hours,"hour",0,23),z(i.minutes,"minute",0,59),z(i.seconds,"seconds",0,60),fr(i.fractionalMilliseconds)))},mh=(n)=>{const t=(new Date()).getUTCFullYear(),c=Math.floor(t/100)*100+W(b(n));if(c<t)return c+100;return c},_h=1576800000000,nr=(n)=>{if(n.getTime()-(new Date()).getTime()>_h)return new Date(Date.UTC(n.getUTCFullYear()-100,n.getUTCMonth(),n.getUTCDate(),n.getUTCHours(),n.getUTCMinutes(),n.getUTCSeconds(),n.getUTCMilliseconds()));return n},Gn=(n)=>{const t=Qn.indexOf(n);if(t<0)throw new TypeError(`Invalid month: ${n}`);return t+1},tr=[31,28,31,30,31,30,31,31,30,31,30,31],cr=(n,t,c)=>{let i=tr[t];if(t===1&&ir(n))i=29;if(c>i)throw new TypeError(`Invalid day for ${Qn[t]} in ${n}: ${c}`)},ir=(n)=>{return n%4===0&&(n%100!==0||n%400===0)},z=(n,t,c,i)=>{const f=ac(b(n));if(f<c||f>i)throw new TypeError(`${t} must be between ${c} and ${i}, inclusive`);return f},fr=(n)=>{if(n===null||n===void 0)return 0;return qc("0."+n)*1000},hr=(n)=>{const t=n[0];let c=1;if(t=="+")c=1;else if(t=="-")c=-1;else throw new TypeError(`Offset direction, ${t}, must be "+" or "-"`);const i=Number(n.substring(1,3)),f=Number(n.substring(4,6));return c*(i*60+f)*60*1000},b=(n)=>{let t=0;while(t<n.length-1&&n.charAt(t)==="0")t++;if(t===0)return n;return n.slice(t)};var rr=({output:n,parsedBody:t,exceptionCtor:c,errorCode:i})=>{const f=sr(n),h=f.httpStatusCode?f.httpStatusCode+"":void 0,r=new c({name:t?.code||t?.Code||i||h||"UnknownError",$fault:"client",$metadata:f});throw an(r,t)},Us=(n)=>{return({output:t,parsedBody:c,errorCode:i})=>{rr({output:t,parsedBody:c,exceptionCtor:n,errorCode:i})}},sr=(n)=>({httpStatusCode:n.statusCode,requestId:n.headers["x-amzn-requestid"]??n.headers["x-amzn-request-id"]??n.headers["x-amz-request-id"],extendedRequestId:n.headers["x-amz-id-2"],cfId:n.headers["x-amz-cf-id"]});var Is=(n)=>{switch(n){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:30000};default:return{}}};var ni=!1,es=(n)=>{if(n&&!ni&&parseInt(n.substring(1,n.indexOf(".")))<16)ni=!0};var Mn=J(p(),1);var ti=(n)=>{const t=[];for(let c in Mn.AlgorithmId){const i=Mn.AlgorithmId[c];if(n[i]===void 0)continue;t.push({algorithmId:()=>i,checksumConstructor:()=>n[i]})}return{_checksumAlgorithms:t,addChecksumAlgorithm(c){this._checksumAlgorithms.push(c)},checksumAlgorithms(){return this._checksumAlgorithms}}},ci=(n)=>{const t={};return n.checksumAlgorithms().forEach((c)=>{t[c.algorithmId()]=c.checksumConstructor()}),t};var ii=(n)=>{let t=n.retryStrategy;return{setRetryStrategy(c){t=c},retryStrategy(){return t}}},fi=(n)=>{const t={};return t.retryStrategy=n.retryStrategy(),t};var Ss=(n)=>{return{...ti(n),...ii(n)}};var zs=(n)=>{return{...ci(n),...fi(n)}};function ur(n){return encodeURIComponent(n).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}var An=function(){const n=Object.getPrototypeOf(this).constructor,c=new(Function.bind.apply(String,[null,...arguments]));return Object.setPrototypeOf(c,n.prototype),c};An.prototype=Object.create(String.prototype,{constructor:{value:An,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(An,String);function wr(n,t,c){let i,f,h;if(typeof t==="undefined"&&typeof c==="undefined")i={},h=n;else if(i=n,typeof t==="function")return f=t,h=c,$r(i,f,h);else h=t;for(let r of Object.keys(h)){if(!Array.isArray(h[r])){i[r]=h[r];continue}hi(i,null,h,r)}return i}var Xs=(n,t)=>{const c={};for(let i in t)hi(c,n,t,i);return c},$r=(n,t,c)=>{return wr(n,Object.entries(c).reduce((i,[f,h])=>{if(Array.isArray(h))i[f]=h;else if(typeof h==="function")i[f]=[t,h()];else i[f]=[t,h];return i},{}))},hi=(n,t,c,i)=>{if(t!==null){let r=c[i];if(typeof r==="function")r=[,r];const[s=Tr,u=xr,d=i]=r;if(typeof s==="function"&&s(t[d])||typeof s!=="function"&&!!s)n[i]=u(t[d]);return}let[f,h]=c[i];if(typeof h==="function"){let r;const s=f===void 0&&(r=h())!=null,u=typeof f==="function"&&!!f(void 0)||typeof f!=="function"&&!!f;if(s)n[i]=r;else if(u)n[i]=h()}else{const r=f===void 0&&h!=null,s=typeof f==="function"&&!!f(h)||typeof f!=="function"&&!!f;if(r||s)n[i]=h}},Tr=(n)=>n!=null,xr=(n)=>n;var Bs=(n)=>n.toISOString().replace(".000Z","Z");var ri=(n)=>{if(n==null)return{};if(Array.isArray(n))return n.filter((t)=>t!=null).map(ri);if(typeof n==="object"){const t={};for(let c of Object.keys(n)){if(n[c]==null)continue;t[c]=ri(n[c])}return t}return n};var du=(n)=>{let t=n.httpHandler;return{setHttpHandler(c){t=c},httpHandler(){return t},updateHttpClientConfig(c,i){t.updateHttpClientConfig(c,i)},httpHandlerConfigs(){return t.httpHandlerConfigs()}}},ou=(n)=>{return{httpHandler:n.httpHandler()}};var dr=J(p(),1);var or=function(n){return Object.keys(n).reduce((t,c)=>{const i=n[c];return{...t,[c]:Array.isArray(i)?[...i]:i}},{})};class Kn{constructor(n){this.method=n.method||"GET",this.hostname=n.hostname||"localhost",this.port=n.port,this.query=n.query||{},this.headers=n.headers||{},this.body=n.body,this.protocol=n.protocol?n.protocol.slice(-1)!==":"?`${n.protocol}:`:n.protocol:"https:",this.path=n.path?n.path.charAt(0)!=="/"?`/${n.path}`:n.path:"/",this.username=n.username,this.password=n.password,this.fragment=n.fragment}static clone(n){const t=new Kn({...n,headers:{...n.headers}});if(t.query)t.query=or(t.query);return t}static isInstance(n){if(!n)return!1;const t=n;return"method"in t&&"protocol"in t&&"hostname"in t&&"path"in t&&typeof t.query==="object"&&typeof t.headers==="object"}clone(){return Kn.clone(this)}}class $n{constructor(n){this.statusCode=n.statusCode,this.reason=n.reason,this.headers=n.headers||{},this.body=n.body}static isInstance(n){if(!n)return!1;const t=n;return typeof t.statusCode==="number"&&typeof t.headers==="object"}}var O=(n)=>encodeURIComponent(n).replace(/[!'()*]/g,Fr),Fr=(n)=>`%${n.charCodeAt(0).toString(16).toUpperCase()}`;function Xn(n){const t=[];for(let c of Object.keys(n).sort()){const i=n[c];if(c=O(c),Array.isArray(i))for(let f=0,h=i.length;f<h;f++)t.push(`${c}=${O(i[f])}`);else{let f=c;if(i||typeof i==="string")f+=`=${O(i)}`;t.push(f)}}return t.join("&")}import{Agent as xi,request as Er} from"http";import{Agent as di,request as Ir} from"https";var si=["ECONNRESET","EPIPE","ETIMEDOUT"];var Jn=(n)=>{const t={};for(let c of Object.keys(n)){const i=n[c];t[c]=Array.isArray(i)?i.join(","):i}return t};var ui=(n,t,c=0)=>{if(!c)return;const i=setTimeout(()=>{n.destroy(),t(Object.assign(new Error(`Socket timed out without establishing a connection within ${c} ms`),{name:"TimeoutError"}))},c);n.on("socket",(f)=>{if(f.connecting)f.on("connect",()=>{clearTimeout(i)});else clearTimeout(i)})};var wi=(n,{keepAlive:t,keepAliveMsecs:c})=>{if(t!==!0)return;n.on("socket",(i)=>{i.setKeepAlive(t,c||0)})};var $i=(n,t,c=0)=>{n.setTimeout(c,()=>{n.destroy(),t(Object.assign(new Error(`Connection timed out after ${c} ms`),{name:"TimeoutError"}))})};import{Readable as Cr} from"stream";async function Wn(n,t,c=Ti){const i=t.headers??{},f=i.Expect||i.expect;let h=-1,r=!1;if(f==="100-continue")await Promise.race([new Promise((s)=>{h=Number(setTimeout(s,Math.max(Ti,c)))}),new Promise((s)=>{n.on("continue",()=>{clearTimeout(h),s()}),n.on("error",()=>{r=!0,clearTimeout(h),s()})})]);if(!r)Ur(n,t.body)}var Ur=function(n,t){if(t instanceof Cr){t.pipe(n);return}if(t){if(Buffer.isBuffer(t)||typeof t==="string"){n.end(t);return}const c=t;if(typeof c==="object"&&c.buffer&&typeof c.byteOffset==="number"&&typeof c.byteLength==="number"){n.end(Buffer.from(c.buffer,c.byteOffset,c.byteLength));return}n.end(Buffer.from(t));return}n.end()},Ti=1000;class bn{static create(n){if(typeof n?.handle==="function")return n;return new bn(n)}static checkSocketUsage(n,t,c=console){const{sockets:i,requests:f,maxSockets:h}=n;if(typeof h!=="number"||h===Infinity)return t;const r=15000;if(Date.now()-r<t)return t;if(i&&f)for(let s in i){const u=i[s]?.length??0,d=f[s]?.length??0;if(u>=h&&d>=2*h)return c?.warn?.(`@smithy/node-http-handler:WARN - socket usage at capacity=${u} and ${d} additional requests are enqueued.
4
+ See https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-configuring-maxsockets.html
5
+ or increase socketAcquisitionWarningTimeout=(millis) in the NodeHttpHandler config.`),Date.now()}return t}constructor(n){this.socketWarningTimestamp=0,this.metadata={handlerProtocol:"http/1.1"},this.configProvider=new Promise((t,c)=>{if(typeof n==="function")n().then((i)=>{t(this.resolveDefaultConfig(i))}).catch(c);else t(this.resolveDefaultConfig(n))})}resolveDefaultConfig(n){const{requestTimeout:t,connectionTimeout:c,socketTimeout:i,httpAgent:f,httpsAgent:h}=n||{};return{connectionTimeout:c,requestTimeout:t??i,httpAgent:(()=>{if(f instanceof xi||typeof f?.destroy==="function")return f;return new xi({keepAlive:!0,maxSockets:50,...f})})(),httpsAgent:(()=>{if(h instanceof di||typeof h?.destroy==="function")return h;return new di({keepAlive:!0,maxSockets:50,...h})})(),logger:console}}destroy(){this.config?.httpAgent?.destroy(),this.config?.httpsAgent?.destroy()}async handle(n,{abortSignal:t}={}){if(!this.config)this.config=await this.configProvider;let c;return new Promise((i,f)=>{let h=void 0;const r=async(w)=>{await h,clearTimeout(c),i(w)},s=async(w)=>{await h,clearTimeout(c),f(w)};if(!this.config)throw new Error("Node HTTP request handler config is not resolved");if(t?.aborted){const w=new Error("Request aborted");w.name="AbortError",s(w);return}const u=n.protocol==="https:",d=u?this.config.httpsAgent:this.config.httpAgent;c=setTimeout(()=>{this.socketWarningTimestamp=bn.checkSocketUsage(d,this.socketWarningTimestamp,this.config.logger)},this.config.socketAcquisitionWarningTimeout??(this.config.requestTimeout??2000)+(this.config.connectionTimeout??1000));const C=Xn(n.query||{});let $=void 0;if(n.username!=null||n.password!=null){const w=n.username??"",x=n.password??"";$=`${w}:${x}`}let o=n.path;if(C)o+=`?${C}`;if(n.fragment)o+=`#${n.fragment}`;const T={headers:n.headers,host:n.hostname,method:n.method,path:o,port:n.port,agent:d,auth:$},E=(u?Ir:Er)(T,(w)=>{const x=new $n({statusCode:w.statusCode||-1,reason:w.statusMessage,headers:Jn(w.headers),body:w});r({response:x})});if(E.on("error",(w)=>{if(si.includes(w.code))s(Object.assign(w,{name:"TimeoutError"}));else s(w)}),ui(E,s,this.config.connectionTimeout),$i(E,s,this.config.requestTimeout),t){const w=()=>{E.destroy();const x=new Error("Request aborted");x.name="AbortError",s(x)};if(typeof t.addEventListener==="function"){const x=t;x.addEventListener("abort",w,{once:!0}),E.once("close",()=>x.removeEventListener("abort",w))}else t.onabort=w}const F=T.agent;if(typeof F==="object"&&"keepAlive"in F)wi(E,{keepAlive:F.keepAlive,keepAliveMsecs:F.keepAliveMsecs});h=Wn(E,n,this.config.requestTimeout).catch((w)=>{return clearTimeout(c),f(w)})})}updateHttpClientConfig(n,t){this.config=void 0,this.configProvider=this.configProvider.then((c)=>{return{...c,[n]:t}})}httpHandlerConfigs(){return this.config??{}}}import{Writable as yr} from"stream";class Bn extends yr{constructor(){super(...arguments);this.bufferedBytes=[]}_write(n,t,c){this.bufferedBytes.push(n),c()}}async function Lr(n){const t=[],c=n.getReader();let i=!1,f=0;while(!i){const{done:s,value:u}=await c.read();if(u)t.push(u),f+=u.length;i=s}const h=new Uint8Array(f);let r=0;for(let s of t)h.set(s,r),r+=s.length;return h}var E0=(n)=>{if(er(n))return Lr(n);return new Promise((t,c)=>{const i=new Bn;n.pipe(i),n.on("error",(f)=>{i.end(),c(f)}),i.on("error",c),i.on("finish",function(){const f=new Uint8Array(Buffer.concat(this.bufferedBytes));t(f)})})},er=(n)=>typeof ReadableStream==="function"&&n instanceof ReadableStream;export{du as z,ou as A,Kn as B,$n as C,Li as D,xn as E,ei as F,nt as G,m as H,Un as I,Gt as J,dc as K,kc as L,ns as M,pn as N,Sr as O,Zr as P,cs as Q,Zn as R,lc as S,is as T,fs as U,hs as V,rs as W,ss as X,Ts as Y,xs as Z,ds as _,os as $,qn as aa,an as ba,Us as ca,Is as da,es as ea,Ss as fa,zs as ga,ur as ha,wr as ia,Xs as ja,Bs as ka,ri as la,O as ma,bn as na,E0 as oa};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{x as o} from"./chunk-a5c18c07abe8fd9c.js";import{A as Fe,D as g,F as We,N as ss,O as R,T as D,U as Ge,V as h,aa as Te,ba as u,ca as Ve,da as ce,ea as ie,fa as _e,ga as $e,ia as i,ja as y,la as Ne,na as be,oa as xe,z as Be} from"./chunk-088ed28ebed2b009.js";import{$a as Re,Ba as F,Ca as Ae,Da as G,Ea as V,Fa as N,Ga as Ke,Ha as le,Ia as pe,Ja as ye,Ka as me,La as Qe,Ma as Xe,Oa as ts,Pa as rs,Qa as Ye,Ra as he,Ta as ue,Ua as Ze,Va as we,Wa as je,Ya as x,Za as ve,_a as ke,ab as te,bb as re,cb as qe,db as Pe,eb as Je,qa as Ie,ra as Le,sa as Ce,ta as Me,ua as os,wa as ee,ya as se} from"./chunk-b07249c949a284d2.js";import"./chunk-bbd36ce62b950ee5.js";import{gb as ps,hb as l} from"./chunk-5c3681fb029d7588.js";import"./chunk-6943b50bd0a3ac84.js";import"./chunk-100b76ab0ca3e14d.js";var p=o(F(),1);var $=o(x(),1),v=o(os(),1),cs=function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"awsssoportal",region:e.region},propertiesExtractor:(s,t)=>({signingProperties:{config:s,context:t}})}},b=function(e){return{schemeId:"smithy.api#noAuth"}},P=async(e,s,t)=>{return{operation:v.getSmithyContext(s).operation,region:await v.normalizeProvider(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},J=(e)=>{const s=[];switch(e.operation){case"GetRoleCredentials":{s.push(b(e));break}case"ListAccountRoles":{s.push(b(e));break}case"ListAccounts":{s.push(b(e));break}case"Logout":{s.push(b(e));break}default:s.push(cs(e))}return s},U=(e)=>{return{...$.resolveAwsSdkSigV4Config(e)}};var I=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}},L={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var C={name:"@aws-sdk/client-sso",description:"AWS SDK for JavaScript Sso Client for Node.js, Browser and React Native",version:"3.629.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.629.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso"}};var Ee=o(x(),1);var ae=o(x(),1),ne=o(F(),1);var de=o(ps(),1);var M={["required"]:!1,type:"String"},W={["required"]:!0,default:!1,type:"Boolean"},A={["ref"]:"Endpoint"},j={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},d={},K={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},H={["ref"]:"PartitionResult"},Q={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[H,"supportsDualStack"]}]},X=[j],Y=[T],Z=[{["ref"]:"Region"}],ls={version:"1.0",parameters:{Region:M,UseDualStack:W,UseFIPS:W,Endpoint:M},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[A]}],rules:[{conditions:X,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:Y,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:A,properties:d,headers:d},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:Z}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:Z,assign:"PartitionResult"}],rules:[{conditions:[j,T],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,K]},Q],rules:[{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:X,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[K,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[H,"name"]},"aws-us-gov"]}],endpoint:{url:"https://portal.sso.{Region}.amazonaws.com",properties:d,headers:d},type:"endpoint"},{endpoint:{url:"https://portal.sso-fips.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:Y,rules:[{conditions:[Q],rules:[{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://portal.sso.{Region}.{PartitionResult#dnsSuffix}",properties:d,headers:d},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},O=ls;var f=(e,s={})=>{return V(O,{endpointParams:e,logger:s.logger})};G.aws=N;var oe=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??te,base64Encoder:e?.base64Encoder??re,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??f,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??J,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new ae.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ne.NoAuthSigner}],logger:e?.logger??new g,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??de.parseUrl,utf8Decoder:e?.utf8Decoder??ee,utf8Encoder:e?.utf8Encoder??se}};var Se=(e)=>{ie(process.version);const s=qe(e),t=()=>s().then(ce),r=oe(e);return Ee.emitWarningIfUnsupportedVersion(process.version),{...r,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??Re,defaultUserAgentProvider:e?.defaultUserAgentProvider??ve({serviceId:r.serviceId,clientVersion:C.version}),maxAttempts:e?.maxAttempts??l(ue),region:e?.region??l(ye,me),requestHandler:be.create(e?.requestHandler??t),retryMode:e?.retryMode??l({...we,default:async()=>(await t()).retryMode||he}),sha256:e?.sha256??ke.bind(null,"sha256"),streamCollector:e?.streamCollector??xe,useDualstackEndpoint:e?.useDualstackEndpoint??l(le),useFipsEndpoint:e?.useFipsEndpoint??l(pe)}};var ze=(e)=>{const s=e.httpAuthSchemes;let{httpAuthSchemeProvider:t,credentials:r}=e;return{setHttpAuthScheme(a){const n=s.findIndex((B)=>B.schemeId===a.schemeId);if(n===-1)s.push(a);else s.splice(n,1,a)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(a){t=a},httpAuthSchemeProvider(){return t},setCredentials(a){r=a},credentials(){return r}}},De=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var k=(e)=>e,Ue=(e,s)=>{const t={...k(Pe(e)),...k(_e(e)),...k(Be(e)),...k(ze(e))};return s.forEach((r)=>r.configure(t)),{...e,...Je(t),...$e(t),...Fe(t),...De(t)}};class ys extends We{constructor(...[e]){const s=Se(e||{}),t=I(s),r=Ae(t),a=Ze(r),n=Qe(a),B=Ie(n),as=Ye(B),ns=U(as),_=Ue(ns,e?.extensions||[]);super(_);this.config=_,this.middlewareStack.use(Ke(this.config)),this.middlewareStack.use(je(this.config)),this.middlewareStack.use(Xe(this.config)),this.middlewareStack.use(Le(this.config)),this.middlewareStack.use(Ce(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(p.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:P,identityProviderConfigProvider:async(ds)=>new p.DefaultIdentityProviderConfig({"aws.auth#sigv4":ds.credentials})})),this.middlewareStack.use(p.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class c extends Te{constructor(e){super(e);Object.setPrototypeOf(this,c.prototype)}}class q extends c{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,q.prototype)}}class E extends c{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,E.prototype)}}class S extends c{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e});this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,S.prototype)}}class z extends c{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e});this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,z.prototype)}}var He=(e)=>({...e,...e.accessToken&&{accessToken:R}}),ms=(e)=>({...e,...e.secretAccessKey&&{secretAccessKey:R},...e.sessionToken&&{sessionToken:R}}),Oe=(e)=>({...e,...e.roleCredentials&&{roleCredentials:ms(e.roleCredentials)}});var m=o(x(),1),fe=o(F(),1);var ge=async(e,s)=>{const t=fe.requestBuilder(e,s),r=i({},ks,{[Ds]:e[qs]});t.bp("/federation/credentials");const a=i({[zs]:[,D(e[Ss],"roleName")],[Es]:[,D(e[Rs],"accountId")]});let n;return t.m("GET").h(r).q(a).b(n),t.build()};var es=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return hs(e,s);const t=i({$metadata:w(e)}),r=D(Ge(await m.parseJsonBody(e.body,s)),"body"),a=y(r,{roleCredentials:Ne});return Object.assign(t,a),t};var hs=async(e,s)=>{const t={...e,body:await m.parseJsonErrorBody(e.body,s)},r=m.loadRestJsonErrorCode(e,t.body);switch(r){case"InvalidRequestException":case"com.amazonaws.sso#InvalidRequestException":throw await ws(t,s);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await bs(t,s);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await xs(t,s);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await vs(t,s);default:const a=t.body;return us({output:e,parsedBody:a,errorCode:r})}},us=Ve(c),ws=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new q({$metadata:w(e),...t});return u(n,e.body)},bs=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new E({$metadata:w(e),...t});return u(n,e.body)},xs=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new S({$metadata:w(e),...t});return u(n,e.body)},vs=async(e,s)=>{const t=i({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new z({$metadata:w(e),...t});return u(n,e.body)},w=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var ks=(e)=>e!==void 0&&e!==null&&e!==""&&(!Object.getOwnPropertyNames(e).includes("length")||e.length!=0)&&(!Object.getOwnPropertyNames(e).includes("size")||e.size!=0),Rs="accountId",qs="accessToken",Es="account_id";var Ss="roleName",zs="role_name",Ds="x-amz-sso_bearer_token";class Bs extends ss.classBuilder().ep({...L}).m(function(e,s,t,r){return[ts(t,this.serialize,this.deserialize),rs(t,e.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(He,Oe).ser(ge).de(es).build(){}export{ys as SSOClient,Bs as GetRoleCredentialsCommand};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-a5c18c07abe8fd9c.js";import"./chunk-bbd36ce62b950ee5.js";import{kb as l,qb as S} from"./chunk-6943b50bd0a3ac84.js";import{sb as c,ub as m} from"./chunk-100b76ab0ca3e14d.js";var w=(e,s,r)=>{const i={EcsContainer:async(t)=>{const{fromHttp:n}=await import("./chunk-fc165cee61f6efe8.js"),{fromContainerMetadata:d}=await import("./chunk-e3ef81776c8f2d28.js");return r?.debug("@aws-sdk/credential-provider-ini - credential_source is EcsContainer"),m(n(t??{}),d(t))},Ec2InstanceMetadata:async(t)=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Ec2InstanceMetadata");const{fromInstanceMetadata:n}=await import("./chunk-e3ef81776c8f2d28.js");return n(t)},Environment:async(t)=>{r?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");const{fromEnv:n}=await import("./chunk-70bb003c03f21dad.js");return n(t)}};if(e in i)return i[e];else throw new c(`Unsupported credential source in profile ${s}. Got ${e}, `+"expected EcsContainer or Ec2InstanceMetadata or Environment.",{logger:r})};var y=(e,{profile:s="default",logger:r}={})=>{return Boolean(e)&&typeof e==="object"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1&&["undefined","string"].indexOf(typeof e.external_id)>-1&&["undefined","string"].indexOf(typeof e.mfa_serial)>-1&&(h(e,{profile:s,logger:r})||D(e,{profile:s,logger:r}))},h=(e,{profile:s,logger:r})=>{const i=typeof e.source_profile==="string"&&typeof e.credential_source==="undefined";if(i)r?.debug?.(` ${s} isAssumeRoleWithSourceProfile source_profile=${e.source_profile}`);return i},D=(e,{profile:s,logger:r})=>{const i=typeof e.credential_source==="string"&&typeof e.source_profile==="undefined";if(i)r?.debug?.(` ${s} isCredentialSourceProfile credential_source=${e.credential_source}`);return i},C=async(e,s,r,i={})=>{r.logger?.debug("@aws-sdk/credential-provider-ini - resolveAssumeRoleCredentials (STS)");const t=s[e];if(!r.roleAssumer){const{getDefaultRoleAssumer:R}=await import("./chunk-ef1ebd10affe5726.js");r.roleAssumer=R({...r.clientConfig,credentialProviderLogger:r.logger,parentClientConfig:r?.parentClientConfig},r.clientPlugins)}const{source_profile:n}=t;if(n&&n in i)throw new c("Detected a cycle attempting to resolve credentials for profile"+` ${l(r)}. Profiles visited: `+Object.keys(i).join(", "),{logger:r.logger});r.logger?.debug(`@aws-sdk/credential-provider-ini - finding credential resolver using ${n?`source_profile=[${n}]`:`profile=[${e}]`}`);const d=n?o(n,{...s,[n]:{...s[n],role_arn:t.role_arn??s[n].role_arn}},r,{...i,[n]:!0}):(await w(t.credential_source,e,r.logger)(r))(),u={RoleArn:t.role_arn,RoleSessionName:t.role_session_name||`aws-sdk-js-${Date.now()}`,ExternalId:t.external_id,DurationSeconds:parseInt(t.duration_seconds||"3600",10)},{mfa_serial:f}=t;if(f){if(!r.mfaCodeProvider)throw new c(`Profile ${e} requires multi-factor authentication, but no MFA code callback was provided.`,{logger:r.logger,tryNextLink:!1});u.SerialNumber=f,u.TokenCode=await r.mfaCodeProvider(f)}const $=await d;return r.roleAssumer($,u)};var P=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.credential_process==="string",v=async(e,s)=>import("./chunk-9d2af1a704b857ee.js").then(({fromProcess:r})=>r({...e,profile:s})());var x=async(e,s={})=>{const{fromSSO:r}=await import("./chunk-682b01231754a121.js");return r({profile:e,logger:s.logger})()},b=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var _=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.aws_access_key_id==="string"&&typeof e.aws_secret_access_key==="string"&&["undefined","string"].indexOf(typeof e.aws_session_token)>-1&&["undefined","string"].indexOf(typeof e.aws_account_id)>-1,a=(e,s)=>{return s?.logger?.debug("@aws-sdk/credential-provider-ini - resolveStaticCredentials"),Promise.resolve({accessKeyId:e.aws_access_key_id,secretAccessKey:e.aws_secret_access_key,sessionToken:e.aws_session_token,...e.aws_credential_scope&&{credentialScope:e.aws_credential_scope},...e.aws_account_id&&{accountId:e.aws_account_id}})};var A=(e)=>Boolean(e)&&typeof e==="object"&&typeof e.web_identity_token_file==="string"&&typeof e.role_arn==="string"&&["undefined","string"].indexOf(typeof e.role_session_name)>-1,k=async(e,s)=>import("./chunk-c8b00b645df96ed5.js").then(({fromTokenFile:r})=>r({webIdentityTokenFile:e.web_identity_token_file,roleArn:e.role_arn,roleSessionName:e.role_session_name,roleAssumerWithWebIdentity:s.roleAssumerWithWebIdentity,logger:s.logger,parentClientConfig:s.parentClientConfig})());var o=async(e,s,r,i={})=>{const t=s[e];if(Object.keys(i).length>0&&_(t))return a(t,r);if(y(t,{profile:e,logger:r.logger}))return C(e,s,r,i);if(_(t))return a(t,r);if(A(t))return k(t,r);if(P(t))return v(r,e);if(b(t))return await x(e,r);throw new c(`Could not resolve credentials using profile: [${e}] in configuration/credentials file(s).`,{logger:r.logger})};var H=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-ini - fromIni");const s=await S(e);return o(l(e),s,e)};export{H as fromIni};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-70bb003c03f21dad.js";import{x as w} from"./chunk-a5c18c07abe8fd9c.js";import{A as ue,D as Te,F as yr,N as E,O as t,P as Jr,R as p,S as b,T as j,U as F,V as h,aa as Er,ba as a,ca as br,da as Ge,ea as Je,fa as er,ga as rr,ia as d,ja as o,la as I,na as Le,oa as Qe,z as Oe} from"./chunk-088ed28ebed2b009.js";import{$a as Ze,Ba as N,Ca as cr,Da as $e,Ea as Ie,Fa as Re,Ga as tr,Ha as Ve,Ia as We,Ja as fe,Ka as Ae,La as ar,Ma as mr,Oa as S,Pa as $,Qa as wr,Ra as Ke,Ta as Me,Ua as kr,Va as Be,Wa as vr,Ya as q,Za as Xe,_a as Ye,ab as Fe,bb as De,cb as He,db as sr,eb as ir,qa as hr,ra as nr,sa as or,ta as dr,ua as Kr,wa as be,ya as je} from"./chunk-b07249c949a284d2.js";import"./chunk-bbd36ce62b950ee5.js";import{gb as Qr,hb as R} from"./chunk-5c3681fb029d7588.js";import{ib as pe} from"./chunk-552bdaee8c03e091.js";import"./chunk-6943b50bd0a3ac84.js";import"./chunk-100b76ab0ca3e14d.js";var P=w(N(),1);var re=w(q(),1),U=w(Kr(),1),Mr=function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(s,r)=>({signingProperties:{config:s,context:r}})}},H=function(e){return{schemeId:"smithy.api#noAuth"}},se=async(e,s,r)=>{return{operation:U.getSmithyContext(s).operation,region:await U.normalizeProvider(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},ie=(e)=>{const s=[];switch(e.operation){case"CreateToken":{s.push(H(e));break}case"RegisterClient":{s.push(H(e));break}case"StartDeviceAuthorization":{s.push(H(e));break}default:s.push(Mr(e))}return s},le=(e)=>{return{...re.resolveAwsSdkSigV4Config(e)}};var he=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}},v={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var ne={name:"@aws-sdk/client-sso-oidc",description:"AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",version:"3.629.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sso-oidc","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sso-oidc"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/core":"3.629.0","@aws-sdk/credential-provider-node":"3.629.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.620.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.614.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.3.2","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.14","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.1.12","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.14","@smithy/util-defaults-mode-node":"^3.0.14","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",peerDependencies:{"@aws-sdk/client-sts":"^3.629.0"},browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sso-oidc",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sso-oidc"}};var Ne=w(q(),1);var qe=w(q(),1),Ue=w(N(),1);var xe=w(Qr(),1);var oe={["required"]:!1,type:"String"},de={["required"]:!0,default:!1,type:"Boolean"},ye={["ref"]:"Endpoint"},ke={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},ve={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},m={},ce={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Ee={["ref"]:"PartitionResult"},te={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[Ee,"supportsDualStack"]}]},ae=[ke],me=[ve],we=[{["ref"]:"Region"}],Lr={version:"1.0",parameters:{Region:oe,UseDualStack:de,UseFIPS:de,Endpoint:oe},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[ye]}],rules:[{conditions:ae,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:me,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:ye,properties:m,headers:m},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:we}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:we,assign:"PartitionResult"}],rules:[{conditions:[ke,ve],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,ce]},te],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:"error"}],type:"tree"},{conditions:ae,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[ce,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Ee,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:m,headers:m},type:"endpoint"},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",type:"error"}],type:"tree"},{conditions:me,rules:[{conditions:[te],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",type:"error"}],type:"tree"},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:m,headers:m},type:"endpoint"}],type:"tree"}],type:"tree"},{error:"Invalid Configuration: Missing Region",type:"error"}]},Se=Lr;var Pe=(e,s={})=>{return Ie(Se,{endpointParams:e,logger:s.logger})};$e.aws=Re;var ze=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??Fe,base64Encoder:e?.base64Encoder??De,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Pe,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??ie,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new qe.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new Ue.NoAuthSigner}],logger:e?.logger??new Te,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??xe.parseUrl,utf8Decoder:e?.utf8Decoder??be,utf8Encoder:e?.utf8Encoder??je}};var _e=(e)=>{Je(process.version);const s=He(e),r=()=>s().then(Ge),i=ze(e);return Ne.emitWarningIfUnsupportedVersion(process.version),{...i,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??Ze,credentialDefaultProvider:e?.credentialDefaultProvider??pe,defaultUserAgentProvider:e?.defaultUserAgentProvider??Xe({serviceId:i.serviceId,clientVersion:ne.version}),maxAttempts:e?.maxAttempts??R(Me),region:e?.region??R(fe,Ae),requestHandler:Le.create(e?.requestHandler??r),retryMode:e?.retryMode??R({...Be,default:async()=>(await r()).retryMode||Ke}),sha256:e?.sha256??Ye.bind(null,"sha256"),streamCollector:e?.streamCollector??Qe,useDualstackEndpoint:e?.useDualstackEndpoint??R(Ve),useFipsEndpoint:e?.useFipsEndpoint??R(We)}};var Ce=(e)=>{const s=e.httpAuthSchemes;let{httpAuthSchemeProvider:r,credentials:i}=e;return{setHttpAuthScheme(l){const n=s.findIndex((T)=>T.schemeId===l.schemeId);if(n===-1)s.push(l);else s.splice(n,1,l)},httpAuthSchemes(){return s},setHttpAuthSchemeProvider(l){r=l},httpAuthSchemeProvider(){return r},setCredentials(l){i=l},credentials(){return i}}},ge=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var x=(e)=>e,lr=(e,s)=>{const r={...x(sr(e)),...x(er(e)),...x(Oe(e)),...x(Ce(e))};return s.forEach((i)=>i.configure(r)),{...e,...ir(r),...rr(r),...ue(r),...ge(r)}};class _ extends yr{constructor(...[e]){const s=_e(e||{}),r=he(s),i=cr(r),l=kr(i),n=ar(l),T=hr(n),Wr=wr(T),fr=le(Wr),ee=lr(fr,e?.extensions||[]);super(ee);this.config=ee,this.middlewareStack.use(tr(this.config)),this.middlewareStack.use(vr(this.config)),this.middlewareStack.use(mr(this.config)),this.middlewareStack.use(nr(this.config)),this.middlewareStack.use(or(this.config)),this.middlewareStack.use(dr(this.config)),this.middlewareStack.use(P.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:se,identityProviderConfigProvider:async(Ar)=>new P.DefaultIdentityProviderConfig({"aws.auth#sigv4":Ar.credentials})})),this.middlewareStack.use(P.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class y extends Er{constructor(e){super(e);Object.setPrototypeOf(this,y.prototype)}}class z extends y{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,z.prototype),this.error=e.error,this.error_description=e.error_description}}class G extends y{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});this.name="AuthorizationPendingException",this.$fault="client",Object.setPrototypeOf(this,G.prototype),this.error=e.error,this.error_description=e.error_description}}class J extends y{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}class V extends y{constructor(e){super({name:"InternalServerException",$fault:"server",...e});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}class W extends y{constructor(e){super({name:"InvalidClientException",$fault:"client",...e});this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,W.prototype),this.error=e.error,this.error_description=e.error_description}}class f extends y{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});this.name="InvalidGrantException",this.$fault="client",Object.setPrototypeOf(this,f.prototype),this.error=e.error,this.error_description=e.error_description}}class A extends y{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,A.prototype),this.error=e.error,this.error_description=e.error_description}}class K extends y{constructor(e){super({name:"InvalidScopeException",$fault:"client",...e});this.name="InvalidScopeException",this.$fault="client",Object.setPrototypeOf(this,K.prototype),this.error=e.error,this.error_description=e.error_description}}class M extends y{constructor(e){super({name:"SlowDownException",$fault:"client",...e});this.name="SlowDownException",this.$fault="client",Object.setPrototypeOf(this,M.prototype),this.error=e.error,this.error_description=e.error_description}}class B extends y{constructor(e){super({name:"UnauthorizedClientException",$fault:"client",...e});this.name="UnauthorizedClientException",this.$fault="client",Object.setPrototypeOf(this,B.prototype),this.error=e.error,this.error_description=e.error_description}}class L extends y{constructor(e){super({name:"UnsupportedGrantTypeException",$fault:"client",...e});this.name="UnsupportedGrantTypeException",this.$fault="client",Object.setPrototypeOf(this,L.prototype),this.error=e.error,this.error_description=e.error_description}}class Q extends y{constructor(e){super({name:"InvalidRequestRegionException",$fault:"client",...e});this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description,this.endpoint=e.endpoint,this.region=e.region}}class X extends y{constructor(e){super({name:"InvalidClientMetadataException",$fault:"client",...e});this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description}}class Y extends y{constructor(e){super({name:"InvalidRedirectUriException",$fault:"client",...e});this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,Y.prototype),this.error=e.error,this.error_description=e.error_description}}var Sr=(e)=>({...e,...e.clientSecret&&{clientSecret:t},...e.refreshToken&&{refreshToken:t},...e.codeVerifier&&{codeVerifier:t}}),$r=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Ir=(e)=>({...e,...e.refreshToken&&{refreshToken:t},...e.assertion&&{assertion:t},...e.subjectToken&&{subjectToken:t},...e.codeVerifier&&{codeVerifier:t}}),Rr=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Pr=(e)=>({...e,...e.clientSecret&&{clientSecret:t}}),Tr=(e)=>({...e,...e.clientSecret&&{clientSecret:t}});var k=w(q(),1),D=w(N(),1);var jr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");let l;return l=JSON.stringify(o(e,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:(n)=>I(n)})),r.m("POST").h(i).b(l),r.build()},Fr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");const l=d({[ls]:[,"t"]});let n;return n=JSON.stringify(o(e,{assertion:[],clientId:[],code:[],codeVerifier:[],grantType:[],redirectUri:[],refreshToken:[],requestedTokenType:[],scope:(T)=>I(T),subjectToken:[],subjectTokenType:[]})),r.m("POST").h(i).q(l).b(n),r.build()},Dr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/client/register");let l;return l=JSON.stringify(o(e,{clientName:[],clientType:[],entitledApplicationArn:[],grantTypes:(n)=>I(n),issuerUrl:[],redirectUris:(n)=>I(n),scopes:(n)=>I(n)})),r.m("POST").h(i).b(l),r.build()},qr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/device_authorization");let l;return l=JSON.stringify(o(e,{clientId:[],clientSecret:[],startUrl:[]})),r.m("POST").h(i).b(l),r.build()},Ur=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Z(e,s);const r=d({$metadata:c(e)}),i=j(F(await k.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,refreshToken:h,tokenType:h});return Object.assign(r,l),r},xr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Z(e,s);const r=d({$metadata:c(e)}),i=j(F(await k.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,issuedTokenType:h,refreshToken:h,scope:I,tokenType:h});return Object.assign(r,l),r},zr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Z(e,s);const r=d({$metadata:c(e)}),i=j(F(await k.parseJsonBody(e.body,s)),"body"),l=o(i,{authorizationEndpoint:h,clientId:h,clientIdIssuedAt:p,clientSecret:h,clientSecretExpiresAt:p,tokenEndpoint:h});return Object.assign(r,l),r},Gr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Z(e,s);const r=d({$metadata:c(e)}),i=j(F(await k.parseJsonBody(e.body,s)),"body"),l=o(i,{deviceCode:h,expiresIn:b,interval:b,userCode:h,verificationUri:h,verificationUriComplete:h});return Object.assign(r,l),r},Z=async(e,s)=>{const r={...e,body:await k.parseJsonErrorBody(e.body,s)},i=k.loadRestJsonErrorCode(e,r.body);switch(i){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await Yr(r,s);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await Zr(r,s);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Hr(r,s);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await Nr(r,s);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await _r(r,s);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await Cr(r,s);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await Or(r,s);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await es(r,s);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await rs(r,s);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await ss(r,s);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await is(r,s);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await ur(r,s);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await pr(r,s);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await gr(r,s);default:const l=r.body;return Xr({output:e,parsedBody:l,errorCode:i})}},Xr=br(y),Yr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new z({$metadata:c(e),...r});return a(n,e.body)},Zr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new G({$metadata:c(e),...r});return a(n,e.body)},Hr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new J({$metadata:c(e),...r});return a(n,e.body)},Nr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new V({$metadata:c(e),...r});return a(n,e.body)},_r=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new W({$metadata:c(e),...r});return a(n,e.body)},pr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new X({$metadata:c(e),...r});return a(n,e.body)},Cr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new f({$metadata:c(e),...r});return a(n,e.body)},gr=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new Y({$metadata:c(e),...r});return a(n,e.body)},Or=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new A({$metadata:c(e),...r});return a(n,e.body)},ur=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{endpoint:h,error:h,error_description:h,region:h});Object.assign(r,l);const n=new Q({$metadata:c(e),...r});return a(n,e.body)},es=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new K({$metadata:c(e),...r});return a(n,e.body)},rs=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new M({$metadata:c(e),...r});return a(n,e.body)},ss=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new B({$metadata:c(e),...r});return a(n,e.body)},is=async(e,s)=>{const r=d({}),i=e.body,l=o(i,{error:h,error_description:h});Object.assign(r,l);const n=new L({$metadata:c(e),...r});return a(n,e.body)},c=(e)=>({httpStatusCode:e.statusCode,requestId:e.headers["x-amzn-requestid"]??e.headers["x-amzn-request-id"]??e.headers["x-amz-request-id"],extendedRequestId:e.headers["x-amz-id-2"],cfId:e.headers["x-amz-cf-id"]});var ls="aws_iam";class C extends E.classBuilder().ep({...v}).m(function(e,s,r,i){return[S(r,this.serialize,this.deserialize),$(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(Sr,$r).ser(jr).de(Ur).build(){}class g extends E.classBuilder().ep({...v}).m(function(e,s,r,i){return[S(r,this.serialize,this.deserialize),$(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateTokenWithIAM",{}).n("SSOOIDCClient","CreateTokenWithIAMCommand").f(Ir,Rr).ser(Fr).de(xr).build(){}class O extends E.classBuilder().ep({...v}).m(function(e,s,r,i){return[S(r,this.serialize,this.deserialize),$(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","RegisterClient",{}).n("SSOOIDCClient","RegisterClientCommand").f(void 0,Pr).ser(Dr).de(zr).build(){}class u extends E.classBuilder().ep({...v}).m(function(e,s,r,i){return[S(r,this.serialize,this.deserialize),$(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","StartDeviceAuthorization",{}).n("SSOOIDCClient","StartDeviceAuthorizationCommand").f(Tr,void 0).ser(qr).de(Gr).build(){}var hs={CreateTokenCommand:C,CreateTokenWithIAMCommand:g,RegisterClientCommand:O,StartDeviceAuthorizationCommand:u};class Vr extends _{}Jr(hs,Vr);export{yr as __Client,L as UnsupportedGrantTypeException,B as UnauthorizedClientException,Tr as StartDeviceAuthorizationRequestFilterSensitiveLog,u as StartDeviceAuthorizationCommand,M as SlowDownException,y as SSOOIDCServiceException,_ as SSOOIDCClient,Vr as SSOOIDC,Pr as RegisterClientResponseFilterSensitiveLog,O as RegisterClientCommand,K as InvalidScopeException,Q as InvalidRequestRegionException,A as InvalidRequestException,Y as InvalidRedirectUriException,f as InvalidGrantException,X as InvalidClientMetadataException,W as InvalidClientException,V as InternalServerException,J as ExpiredTokenException,Rr as CreateTokenWithIAMResponseFilterSensitiveLog,Ir as CreateTokenWithIAMRequestFilterSensitiveLog,g as CreateTokenWithIAMCommand,$r as CreateTokenResponseFilterSensitiveLog,Sr as CreateTokenRequestFilterSensitiveLog,C as CreateTokenCommand,G as AuthorizationPendingException,z as AccessDeniedException,E as $Command};
@@ -0,0 +1,2 @@
1
+ import{y as L} from"./chunk-a5c18c07abe8fd9c.js";var d=L((h8,p2)=>{var e2=function(q){return typeof q!=="undefined"&&q!==null},s0=function(q){return typeof q==="object"},t0=function(q){return Object.prototype.toString.call(q)==="[object Object]"},i0=function(q){return typeof q==="function"},o0=function(q){return typeof q==="boolean"},q5=function(q){return q instanceof Buffer},J5=function(q){if(e2(q))switch(q.constructor){case Uint8Array:case Uint8ClampedArray:case Int8Array:case Uint16Array:case Int16Array:case Uint32Array:case Int32Array:case Float32Array:case Float64Array:return!0}return!1},$5=function(q){return q instanceof ArrayBuffer},W5=function(q){return typeof q==="string"&&q.length>0},Z5=function(q){return typeof q==="number"&&!Number.isNaN(q)},Q5=function(q){return Number.isInteger(q)},Y5=function(q,J,$){return q>=J&&q<=$},K5=function(q,J){return J.includes(q)},U5=function(q,J,$){return new Error(`Expected ${J} for ${q} but received ${$} of type ${typeof $}`)},B5=function(q,J){return J.message=q.message,J};p2.exports={defined:e2,object:s0,plainObject:t0,fn:i0,bool:o0,buffer:q5,typedArray:J5,arrayBuffer:$5,string:W5,number:Z5,integer:Q5,inRange:Y5,inArray:K5,invalidParameterError:U5,nativeError:B5}});var t=L((g8,n2)=>{var G5=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...q)=>console.error("SEMVER",...q):()=>{};n2.exports=G5});var K2=L((m8,s2)=>{var H5=Number.MAX_SAFE_INTEGER||9007199254740991,I5=["major","premajor","minor","preminor","patch","prepatch","prerelease"];s2.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:H5,RELEASE_TYPES:I5,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var i=L((O,t2)=>{var{MAX_SAFE_COMPONENT_LENGTH:D2,MAX_SAFE_BUILD_LENGTH:F5,MAX_LENGTH:N5}=K2(),X5=t();O=t2.exports={};var V5=O.re=[],A5=O.safeRe=[],F=O.src=[],N=O.t={},P5=0,E2="[a-zA-Z0-9-]",L5=[["\\s",1],["\\d",N5],[E2,F5]],_5=(q)=>{for(let[J,$]of L5)q=q.split(`${J}*`).join(`${J}{0,${$}}`).split(`${J}+`).join(`${J}{1,${$}}`);return q},A=(q,J,$)=>{const W=_5(J),Z=P5++;X5(q,Z,J),N[q]=Z,F[Z]=J,V5[Z]=new RegExp(J,$?"g":void 0),A5[Z]=new RegExp(W,$?"g":void 0)};A("NUMERICIDENTIFIER","0|[1-9]\\d*");A("NUMERICIDENTIFIERLOOSE","\\d+");A("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${E2}*`);A("MAINVERSION",`(${F[N.NUMERICIDENTIFIER]})\\.`+`(${F[N.NUMERICIDENTIFIER]})\\.`+`(${F[N.NUMERICIDENTIFIER]})`);A("MAINVERSIONLOOSE",`(${F[N.NUMERICIDENTIFIERLOOSE]})\\.`+`(${F[N.NUMERICIDENTIFIERLOOSE]})\\.`+`(${F[N.NUMERICIDENTIFIERLOOSE]})`);A("PRERELEASEIDENTIFIER",`(?:${F[N.NUMERICIDENTIFIER]}|${F[N.NONNUMERICIDENTIFIER]})`);A("PRERELEASEIDENTIFIERLOOSE",`(?:${F[N.NUMERICIDENTIFIERLOOSE]}|${F[N.NONNUMERICIDENTIFIER]})`);A("PRERELEASE",`(?:-(${F[N.PRERELEASEIDENTIFIER]}(?:\\.${F[N.PRERELEASEIDENTIFIER]})*))`);A("PRERELEASELOOSE",`(?:-?(${F[N.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${F[N.PRERELEASEIDENTIFIERLOOSE]})*))`);A("BUILDIDENTIFIER",`${E2}+`);A("BUILD",`(?:\\+(${F[N.BUILDIDENTIFIER]}(?:\\.${F[N.BUILDIDENTIFIER]})*))`);A("FULLPLAIN",`v?${F[N.MAINVERSION]}${F[N.PRERELEASE]}?${F[N.BUILD]}?`);A("FULL",`^${F[N.FULLPLAIN]}\$`);A("LOOSEPLAIN",`[v=\\s]*${F[N.MAINVERSIONLOOSE]}${F[N.PRERELEASELOOSE]}?${F[N.BUILD]}?`);A("LOOSE",`^${F[N.LOOSEPLAIN]}\$`);A("GTLT","((?:<|>)?=?)");A("XRANGEIDENTIFIERLOOSE",`${F[N.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);A("XRANGEIDENTIFIER",`${F[N.NUMERICIDENTIFIER]}|x|X|\\*`);A("XRANGEPLAIN",`[v=\\s]*(${F[N.XRANGEIDENTIFIER]})`+`(?:\\.(${F[N.XRANGEIDENTIFIER]})`+`(?:\\.(${F[N.XRANGEIDENTIFIER]})`+`(?:${F[N.PRERELEASE]})?${F[N.BUILD]}?`+")?)?");A("XRANGEPLAINLOOSE",`[v=\\s]*(${F[N.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${F[N.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${F[N.XRANGEIDENTIFIERLOOSE]})`+`(?:${F[N.PRERELEASELOOSE]})?${F[N.BUILD]}?`+")?)?");A("XRANGE",`^${F[N.GTLT]}\\s*${F[N.XRANGEPLAIN]}\$`);A("XRANGELOOSE",`^${F[N.GTLT]}\\s*${F[N.XRANGEPLAINLOOSE]}\$`);A("COERCEPLAIN",`(^|[^\\d])(\\d{1,${D2}})`+`(?:\\.(\\d{1,${D2}}))?`+`(?:\\.(\\d{1,${D2}}))?`);A("COERCE",`${F[N.COERCEPLAIN]}(?:\$|[^\\d])`);A("COERCEFULL",F[N.COERCEPLAIN]+`(?:${F[N.PRERELEASE]})?`+`(?:${F[N.BUILD]})?`+"(?:$|[^\\d])");A("COERCERTL",F[N.COERCE],!0);A("COERCERTLFULL",F[N.COERCEFULL],!0);A("LONETILDE","(?:~>?)");A("TILDETRIM",`(\\s*)${F[N.LONETILDE]}\\s+`,!0);O.tildeTrimReplace="$1~";A("TILDE",`^${F[N.LONETILDE]}${F[N.XRANGEPLAIN]}\$`);A("TILDELOOSE",`^${F[N.LONETILDE]}${F[N.XRANGEPLAINLOOSE]}\$`);A("LONECARET","(?:\\^)");A("CARETTRIM",`(\\s*)${F[N.LONECARET]}\\s+`,!0);O.caretTrimReplace="$1^";A("CARET",`^${F[N.LONECARET]}${F[N.XRANGEPLAIN]}\$`);A("CARETLOOSE",`^${F[N.LONECARET]}${F[N.XRANGEPLAINLOOSE]}\$`);A("COMPARATORLOOSE",`^${F[N.GTLT]}\\s*(${F[N.LOOSEPLAIN]})\$|^\$`);A("COMPARATOR",`^${F[N.GTLT]}\\s*(${F[N.FULLPLAIN]})\$|^\$`);A("COMPARATORTRIM",`(\\s*)${F[N.GTLT]}\\s*(${F[N.LOOSEPLAIN]}|${F[N.XRANGEPLAIN]})`,!0);O.comparatorTrimReplace="$1$2$3";A("HYPHENRANGE",`^\\s*(${F[N.XRANGEPLAIN]})`+"\\s+-\\s+"+`(${F[N.XRANGEPLAIN]})`+"\\s*$");A("HYPHENRANGELOOSE",`^\\s*(${F[N.XRANGEPLAINLOOSE]})`+"\\s+-\\s+"+`(${F[N.XRANGEPLAINLOOSE]})`+"\\s*$");A("STAR","(<|>)?=?\\s*\\*");A("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");A("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var U2=L((u8,i2)=>{var R5=Object.freeze({loose:!0}),j5=Object.freeze({}),z5=(q)=>{if(!q)return j5;if(typeof q!=="object")return R5;return q};i2.exports=z5});var $1=L((l8,J1)=>{var o2=/^[0-9]+$/,q1=(q,J)=>{const $=o2.test(q),W=o2.test(J);if($&&W)q=+q,J=+J;return q===J?0:$&&!W?-1:W&&!$?1:q<J?-1:1},D5=(q,J)=>q1(J,q);J1.exports={compareIdentifiers:q1,rcompareIdentifiers:D5}});var r=L((c8,Y1)=>{var B2=t(),{MAX_LENGTH:W1,MAX_SAFE_INTEGER:G2}=K2(),{safeRe:Z1,t:Q1}=i(),E5=U2(),{compareIdentifiers:a}=$1();class x{constructor(q,J){if(J=E5(J),q instanceof x)if(q.loose===!!J.loose&&q.includePrerelease===!!J.includePrerelease)return q;else q=q.version;else if(typeof q!=="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof q}".`);if(q.length>W1)throw new TypeError(`version is longer than ${W1} characters`);B2("SemVer",q,J),this.options=J,this.loose=!!J.loose,this.includePrerelease=!!J.includePrerelease;const $=q.trim().match(J.loose?Z1[Q1.LOOSE]:Z1[Q1.FULL]);if(!$)throw new TypeError(`Invalid Version: ${q}`);if(this.raw=q,this.major=+$[1],this.minor=+$[2],this.patch=+$[3],this.major>G2||this.major<0)throw new TypeError("Invalid major version");if(this.minor>G2||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>G2||this.patch<0)throw new TypeError("Invalid patch version");if(!$[4])this.prerelease=[];else this.prerelease=$[4].split(".").map((W)=>{if(/^[0-9]+$/.test(W)){const Z=+W;if(Z>=0&&Z<G2)return Z}return W});this.build=$[5]?$[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(q){if(B2("SemVer.compare",this.version,this.options,q),!(q instanceof x)){if(typeof q==="string"&&q===this.version)return 0;q=new x(q,this.options)}if(q.version===this.version)return 0;return this.compareMain(q)||this.comparePre(q)}compareMain(q){if(!(q instanceof x))q=new x(q,this.options);return a(this.major,q.major)||a(this.minor,q.minor)||a(this.patch,q.patch)}comparePre(q){if(!(q instanceof x))q=new x(q,this.options);if(this.prerelease.length&&!q.prerelease.length)return-1;else if(!this.prerelease.length&&q.prerelease.length)return 1;else if(!this.prerelease.length&&!q.prerelease.length)return 0;let J=0;do{const $=this.prerelease[J],W=q.prerelease[J];if(B2("prerelease compare",J,$,W),$===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if($===void 0)return-1;else if($===W)continue;else return a($,W)}while(++J)}compareBuild(q){if(!(q instanceof x))q=new x(q,this.options);let J=0;do{const $=this.build[J],W=q.build[J];if(B2("build compare",J,$,W),$===void 0&&W===void 0)return 0;else if(W===void 0)return 1;else if($===void 0)return-1;else if($===W)continue;else return a($,W)}while(++J)}inc(q,J,$){switch(q){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",J,$);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",J,$);break;case"prepatch":this.prerelease.length=0,this.inc("patch",J,$),this.inc("pre",J,$);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",J,$);this.inc("pre",J,$);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{const W=Number($)?1:0;if(!J&&$===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[W];else{let Z=this.prerelease.length;while(--Z>=0)if(typeof this.prerelease[Z]==="number")this.prerelease[Z]++,Z=-2;if(Z===-1){if(J===this.prerelease.join(".")&&$===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(W)}}if(J){let Z=[J,W];if($===!1)Z=[J];if(a(this.prerelease[0],J)===0){if(isNaN(this.prerelease[1]))this.prerelease=Z}else this.prerelease=Z}break}default:throw new Error(`invalid increment argument: ${q}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}Y1.exports=x});var B1=L((a8,U1)=>{var K1=r(),T5=(q,J,$=!1)=>{if(q instanceof K1)return q;try{return new K1(q,J)}catch(W){if(!$)return null;throw W}};U1.exports=T5});var H1=L((r8,G1)=>{var y5=r(),w5=B1(),{safeRe:H2,t:I2}=i(),C5=(q,J)=>{if(q instanceof y5)return q;if(typeof q==="number")q=String(q);if(typeof q!=="string")return null;J=J||{};let $=null;if(!J.rtl)$=q.match(J.includePrerelease?H2[I2.COERCEFULL]:H2[I2.COERCE]);else{const H=J.includePrerelease?H2[I2.COERCERTLFULL]:H2[I2.COERCERTL];let I;while((I=H.exec(q))&&(!$||$.index+$[0].length!==q.length)){if(!$||I.index+I[0].length!==$.index+$[0].length)$=I;H.lastIndex=I.index+I[1].length+I[2].length}H.lastIndex=-1}if($===null)return null;const W=$[2],Z=$[3]||"0",Y=$[4]||"0",K=J.includePrerelease&&$[5]?`-${$[5]}`:"",B=J.includePrerelease&&$[6]?`+${$[6]}`:"";return w5(`${W}.${Z}.${Y}${K}${B}`,J)};G1.exports=C5});var u=L((e8,F1)=>{var I1=r(),S5=(q,J,$)=>new I1(q,$).compare(new I1(J,$));F1.exports=S5});var T2=L((p8,N1)=>{var k5=u(),M5=(q,J,$)=>k5(q,J,$)>=0;N1.exports=M5});var A1=L((n8,V1)=>{class X1{constructor(){this.max=1000,this.map=new Map}get(q){const J=this.map.get(q);if(J===void 0)return;else return this.map.delete(q),this.map.set(q,J),J}delete(q){return this.map.delete(q)}set(q,J){if(!this.delete(q)&&J!==void 0){if(this.map.size>=this.max){const W=this.map.keys().next().value;this.delete(W)}this.map.set(q,J)}return this}}V1.exports=X1});var L1=L((s8,P1)=>{var x5=u(),f5=(q,J,$)=>x5(q,J,$)===0;P1.exports=f5});var R1=L((t8,_1)=>{var d5=u(),v5=(q,J,$)=>d5(q,J,$)!==0;_1.exports=v5});var z1=L((i8,j1)=>{var O5=u(),b5=(q,J,$)=>O5(q,J,$)>0;j1.exports=b5});var E1=L((o8,D1)=>{var h5=u(),g5=(q,J,$)=>h5(q,J,$)<0;D1.exports=g5});var y1=L((q9,T1)=>{var m5=u(),u5=(q,J,$)=>m5(q,J,$)<=0;T1.exports=u5});var C1=L((J9,w1)=>{var l5=L1(),c5=R1(),a5=z1(),r5=T2(),e5=E1(),p5=y1(),n5=(q,J,$,W)=>{switch(J){case"===":if(typeof q==="object")q=q.version;if(typeof $==="object")$=$.version;return q===$;case"!==":if(typeof q==="object")q=q.version;if(typeof $==="object")$=$.version;return q!==$;case"":case"=":case"==":return l5(q,$,W);case"!=":return c5(q,$,W);case">":return a5(q,$,W);case">=":return r5(q,$,W);case"<":return e5(q,$,W);case"<=":return p5(q,$,W);default:throw new TypeError(`Invalid operator: ${J}`)}};w1.exports=n5});var v1=L(($9,d1)=>{var o=Symbol("SemVer ANY");class F2{static get ANY(){return o}constructor(q,J){if(J=S1(J),q instanceof F2)if(q.loose===!!J.loose)return q;else q=q.value;if(q=q.trim().split(/\s+/).join(" "),w2("comparator",q,J),this.options=J,this.loose=!!J.loose,this.parse(q),this.semver===o)this.value="";else this.value=this.operator+this.semver.version;w2("comp",this)}parse(q){const J=this.options.loose?k1[M1.COMPARATORLOOSE]:k1[M1.COMPARATOR],$=q.match(J);if(!$)throw new TypeError(`Invalid comparator: ${q}`);if(this.operator=$[1]!==void 0?$[1]:"",this.operator==="=")this.operator="";if(!$[2])this.semver=o;else this.semver=new x1($[2],this.options.loose)}toString(){return this.value}test(q){if(w2("Comparator.test",q,this.options.loose),this.semver===o||q===o)return!0;if(typeof q==="string")try{q=new x1(q,this.options)}catch(J){return!1}return y2(q,this.operator,this.semver,this.options)}intersects(q,J){if(!(q instanceof F2))throw new TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new f1(q.value,J).test(this.value)}else if(q.operator===""){if(q.value==="")return!0;return new f1(this.value,J).test(q.semver)}if(J=S1(J),J.includePrerelease&&(this.value==="<0.0.0-0"||q.value==="<0.0.0-0"))return!1;if(!J.includePrerelease&&(this.value.startsWith("<0.0.0")||q.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&q.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&q.operator.startsWith("<"))return!0;if(this.semver.version===q.semver.version&&this.operator.includes("=")&&q.operator.includes("="))return!0;if(y2(this.semver,"<",q.semver,J)&&this.operator.startsWith(">")&&q.operator.startsWith("<"))return!0;if(y2(this.semver,">",q.semver,J)&&this.operator.startsWith("<")&&q.operator.startsWith(">"))return!0;return!1}}d1.exports=F2;var S1=U2(),{safeRe:k1,t:M1}=i(),y2=C1(),w2=t(),x1=r(),f1=C2()});var C2=L((W9,g1)=>{class q2{constructor(q,J){if(J=t5(J),q instanceof q2)if(q.loose===!!J.loose&&q.includePrerelease===!!J.includePrerelease)return q;else return new q2(q.raw,J);if(q instanceof S2)return this.raw=q.value,this.set=[[q]],this.format(),this;if(this.options=J,this.loose=!!J.loose,this.includePrerelease=!!J.includePrerelease,this.raw=q.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(($)=>this.parseRange($.trim())).filter(($)=>$.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const $=this.set[0];if(this.set=this.set.filter((W)=>!b1(W[0])),this.set.length===0)this.set=[$];else if(this.set.length>1){for(let W of this.set)if(W.length===1&&Z4(W[0])){this.set=[W];break}}}this.format()}format(){return this.range=this.set.map((q)=>q.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(q){const $=((this.options.includePrerelease&&$4)|(this.options.loose&&W4))+":"+q,W=O1.get($);if(W)return W;const Z=this.options.loose,Y=Z?C[T.HYPHENRANGELOOSE]:C[T.HYPHENRANGE];q=q.replace(Y,N4(this.options.includePrerelease)),R("hyphen replace",q),q=q.replace(C[T.COMPARATORTRIM],o5),R("comparator trim",q),q=q.replace(C[T.TILDETRIM],q4),R("tilde trim",q),q=q.replace(C[T.CARETTRIM],J4),R("caret trim",q);let K=q.split(" ").map((P)=>Q4(P,this.options)).join(" ").split(/\s+/).map((P)=>F4(P,this.options));if(Z)K=K.filter((P)=>{return R("loose invalid filter",P,this.options),!!P.match(C[T.COMPARATORLOOSE])});R("range list",K);const B=new Map,H=K.map((P)=>new S2(P,this.options));for(let P of H){if(b1(P))return[P];B.set(P.value,P)}if(B.size>1&&B.has(""))B.delete("");const I=[...B.values()];return O1.set($,I),I}intersects(q,J){if(!(q instanceof q2))throw new TypeError("a Range is required");return this.set.some(($)=>{return h1($,J)&&q.set.some((W)=>{return h1(W,J)&&$.every((Z)=>{return W.every((Y)=>{return Z.intersects(Y,J)})})})})}test(q){if(!q)return!1;if(typeof q==="string")try{q=new i5(q,this.options)}catch(J){return!1}for(let J=0;J<this.set.length;J++)if(X4(this.set[J],q,this.options))return!0;return!1}}g1.exports=q2;var s5=A1(),O1=new s5,t5=U2(),S2=v1(),R=t(),i5=r(),{safeRe:C,t:T,comparatorTrimReplace:o5,tildeTrimReplace:q4,caretTrimReplace:J4}=i(),{FLAG_INCLUDE_PRERELEASE:$4,FLAG_LOOSE:W4}=K2(),b1=(q)=>q.value==="<0.0.0-0",Z4=(q)=>q.value==="",h1=(q,J)=>{let $=!0;const W=q.slice();let Z=W.pop();while($&&W.length)$=W.every((Y)=>{return Z.intersects(Y,J)}),Z=W.pop();return $},Q4=(q,J)=>{return R("comp",q,J),q=U4(q,J),R("caret",q),q=Y4(q,J),R("tildes",q),q=G4(q,J),R("xrange",q),q=I4(q,J),R("stars",q),q},y=(q)=>!q||q.toLowerCase()==="x"||q==="*",Y4=(q,J)=>{return q.trim().split(/\s+/).map(($)=>K4($,J)).join(" ")},K4=(q,J)=>{const $=J.loose?C[T.TILDELOOSE]:C[T.TILDE];return q.replace($,(W,Z,Y,K,B)=>{R("tilde",q,W,Z,Y,K,B);let H;if(y(Z))H="";else if(y(Y))H=`>=${Z}.0.0 <${+Z+1}.0.0-0`;else if(y(K))H=`>=${Z}.${Y}.0 <${Z}.${+Y+1}.0-0`;else if(B)R("replaceTilde pr",B),H=`>=${Z}.${Y}.${K}-${B} <${Z}.${+Y+1}.0-0`;else H=`>=${Z}.${Y}.${K} <${Z}.${+Y+1}.0-0`;return R("tilde return",H),H})},U4=(q,J)=>{return q.trim().split(/\s+/).map(($)=>B4($,J)).join(" ")},B4=(q,J)=>{R("caret",q,J);const $=J.loose?C[T.CARETLOOSE]:C[T.CARET],W=J.includePrerelease?"-0":"";return q.replace($,(Z,Y,K,B,H)=>{R("caret",q,Z,Y,K,B,H);let I;if(y(Y))I="";else if(y(K))I=`>=${Y}.0.0${W} <${+Y+1}.0.0-0`;else if(y(B))if(Y==="0")I=`>=${Y}.${K}.0${W} <${Y}.${+K+1}.0-0`;else I=`>=${Y}.${K}.0${W} <${+Y+1}.0.0-0`;else if(H)if(R("replaceCaret pr",H),Y==="0")if(K==="0")I=`>=${Y}.${K}.${B}-${H} <${Y}.${K}.${+B+1}-0`;else I=`>=${Y}.${K}.${B}-${H} <${Y}.${+K+1}.0-0`;else I=`>=${Y}.${K}.${B}-${H} <${+Y+1}.0.0-0`;else if(R("no pr"),Y==="0")if(K==="0")I=`>=${Y}.${K}.${B}${W} <${Y}.${K}.${+B+1}-0`;else I=`>=${Y}.${K}.${B}${W} <${Y}.${+K+1}.0-0`;else I=`>=${Y}.${K}.${B} <${+Y+1}.0.0-0`;return R("caret return",I),I})},G4=(q,J)=>{return R("replaceXRanges",q,J),q.split(/\s+/).map(($)=>H4($,J)).join(" ")},H4=(q,J)=>{q=q.trim();const $=J.loose?C[T.XRANGELOOSE]:C[T.XRANGE];return q.replace($,(W,Z,Y,K,B,H)=>{R("xRange",q,W,Z,Y,K,B,H);const I=y(Y),P=I||y(K),z=P||y(B),f=z;if(Z==="="&&f)Z="";if(H=J.includePrerelease?"-0":"",I)if(Z===">"||Z==="<")W="<0.0.0-0";else W="*";else if(Z&&f){if(P)K=0;if(B=0,Z===">")if(Z=">=",P)Y=+Y+1,K=0,B=0;else K=+K+1,B=0;else if(Z==="<=")if(Z="<",P)Y=+Y+1;else K=+K+1;if(Z==="<")H="-0";W=`${Z+Y}.${K}.${B}${H}`}else if(P)W=`>=${Y}.0.0${H} <${+Y+1}.0.0-0`;else if(z)W=`>=${Y}.${K}.0${H} <${Y}.${+K+1}.0-0`;return R("xRange return",W),W})},I4=(q,J)=>{return R("replaceStars",q,J),q.trim().replace(C[T.STAR],"")},F4=(q,J)=>{return R("replaceGTE0",q,J),q.trim().replace(C[J.includePrerelease?T.GTE0PRE:T.GTE0],"")},N4=(q)=>(J,$,W,Z,Y,K,B,H,I,P,z,f)=>{if(y(W))$="";else if(y(Z))$=`>=${W}.0.0${q?"-0":""}`;else if(y(Y))$=`>=${W}.${Z}.0${q?"-0":""}`;else if(K)$=`>=${$}`;else $=`>=${$}${q?"-0":""}`;if(y(I))H="";else if(y(P))H=`<${+I+1}.0.0-0`;else if(y(z))H=`<${I}.${+P+1}.0-0`;else if(f)H=`<=${I}.${P}.${z}-${f}`;else if(q)H=`<${I}.${P}.${+z+1}-0`;else H=`<=${H}`;return`${$} ${H}`.trim()},X4=(q,J,$)=>{for(let W=0;W<q.length;W++)if(!q[W].test(J))return!1;if(J.prerelease.length&&!$.includePrerelease){for(let W=0;W<q.length;W++){if(R(q[W].semver),q[W].semver===S2.ANY)continue;if(q[W].semver.prerelease.length>0){const Z=q[W].semver;if(Z.major===J.major&&Z.minor===J.minor&&Z.patch===J.patch)return!0}}return!1}return!0}});var u1=L((Z9,m1)=>{var V4=C2(),A4=(q,J,$)=>{try{J=new V4(J,$)}catch(W){return!1}return J.test(q)};m1.exports=A4});var k2=L((Q9,P4)=>{P4.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.33.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äck <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ünemann <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érémy 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ěšovec <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ño <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.me>","Michael Nutt <michael@nutt.im>","Brad Parham <baparham@gmail.com>","Taneli Vatanen <taneli.vatanen@gmail.com>","Joris Dugué <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 <me@rreverser.com>"],scripts:{install:"node install/check",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","package-from-github-release":"node npm/from-github-release","docs-build":"node docs/build && node docs/search-index/build","docs-serve":"cd docs && npx serve","docs-publish":"cd docs && 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:{color:"^4.2.3","detect-libc":"^2.0.3",semver:"^7.6.0"},optionalDependencies:{"@img/sharp-darwin-arm64":"0.33.4","@img/sharp-darwin-x64":"0.33.4","@img/sharp-libvips-darwin-arm64":"1.0.2","@img/sharp-libvips-darwin-x64":"1.0.2","@img/sharp-libvips-linux-arm":"1.0.2","@img/sharp-libvips-linux-arm64":"1.0.2","@img/sharp-libvips-linux-s390x":"1.0.2","@img/sharp-libvips-linux-x64":"1.0.2","@img/sharp-libvips-linuxmusl-arm64":"1.0.2","@img/sharp-libvips-linuxmusl-x64":"1.0.2","@img/sharp-linux-arm":"0.33.4","@img/sharp-linux-arm64":"0.33.4","@img/sharp-linux-s390x":"0.33.4","@img/sharp-linux-x64":"0.33.4","@img/sharp-linuxmusl-arm64":"0.33.4","@img/sharp-linuxmusl-x64":"0.33.4","@img/sharp-wasm32":"0.33.4","@img/sharp-win32-ia32":"0.33.4","@img/sharp-win32-x64":"0.33.4"},devDependencies:{"@emnapi/runtime":"^1.1.1","@img/sharp-libvips-dev":"1.0.2","@img/sharp-libvips-dev-wasm32":"1.0.3","@img/sharp-libvips-win32-ia32":"1.0.2","@img/sharp-libvips-win32-x64":"1.0.2","@types/node":"*",async:"^3.2.5",cc:"^3.0.1",emnapi:"^1.1.1","exif-reader":"^2.0.1","extract-zip":"^2.0.1",icc:"^3.0.0","jsdoc-to-markdown":"^8.0.1","license-checker":"^25.0.1",mocha:"^10.4.0","node-addon-api":"^8.0.0",nyc:"^15.1.0",prebuild:"^13.0.1",semistandard:"^17.0.0","tar-fs":"^3.0.6",tsd:"^0.31.0"},license:"Apache-2.0",engines:{node:"^18.17.0 || ^20.3.0 || >=21.0.0",libvips:">=8.15.2"},funding:{url:"https://opencollective.com/libvips"},binary:{napi_versions:[9]},semistandard:{env:["mocha"]},cc:{linelength:"120",filter:["build/include"]},nyc:{include:["lib"]},tsd:{directory:"test/types/"}}});var f2=L((Y9,i1)=>{var{spawnSync:N2}=import.meta.require("child_process"),{createHash:L4}=import.meta.require("crypto"),a1=H1(),_4=T2(),R4=u1(),l1=import.meta.require("detect-libc"),{engines:x2,optionalDependencies:j4}=k2(),z4=process.env.npm_package_config_libvips||x2.libvips,r1=a1(z4).version,D4=["darwin-arm64","darwin-x64","linux-arm","linux-arm64","linux-s390x","linux-x64","linuxmusl-arm64","linuxmusl-x64","win32-ia32","win32-x64"],X2={encoding:"utf8",shell:!0},e1=(q)=>{if(q instanceof Error)console.error(`sharp: Installation error: ${q.message}`);else console.log(`sharp: ${q}`)},p1=()=>l1.isNonGlibcLinuxSync()?l1.familySync():"",E4=()=>`${process.platform}${p1()}-${process.arch}`,e=()=>{if(n1())return"wasm32";const{npm_config_arch:q,npm_config_platform:J,npm_config_libc:$}=process.env,W=typeof $==="string"?$:p1();return`${J||process.platform}${W}-${q||process.arch}`},T4=()=>{try{return import.meta.require(`@img/sharp-libvips-dev-${e()}/include`)}catch{try{return (()=>{throw new Error(`Cannot require module "@img/sharp-libvips-dev/include"`);})()}catch{}}return""},y4=()=>{try{return (()=>{throw new Error(`Cannot require module "@img/sharp-libvips-dev/cplusplus"`);})()}catch{}return""},w4=()=>{try{return import.meta.require(`@img/sharp-libvips-dev-${e()}/lib`)}catch{try{return import.meta.require(`@img/sharp-libvips-${e()}/lib`)}catch{}}return""},C4=()=>{if(process.release?.name==="node"&&process.versions){if(!R4(process.versions.node,x2.node))return{found:process.versions.node,expected:x2.node}}},n1=()=>{const{CC:q}=process.env;return Boolean(q&&q.endsWith("/emcc"))},S4=()=>{if(process.platform==="darwin"&&process.arch==="x64")return(N2("sysctl sysctl.proc_translated",X2).stdout||"").trim()==="sysctl.proc_translated: 1";return!1},c1=(q)=>L4("sha512").update(q).digest("hex"),k4=()=>{try{const q=c1(`imgsharp-libvips-${e()}`),J=a1(j4[`@img/sharp-libvips-${e()}`]).version;return c1(`${q}npm:${J}`).slice(0,10)}catch{}return""},M4=()=>N2(`node-gyp rebuild --directory=src ${n1()?"--nodedir=emscripten":""}`,{...X2,stdio:"inherit"}).status,s1=()=>{if(process.platform!=="win32")return(N2("pkg-config --modversion vips-cpp",{...X2,env:{...process.env,PKG_CONFIG_PATH:t1()}}).stdout||"").trim();else return""},t1=()=>{if(process.platform!=="win32")return[(N2('which brew >/dev/null 2>&1 && brew environment --plain | grep PKG_CONFIG_LIBDIR | cut -d" " -f2',X2).stdout||"").trim(),process.env.PKG_CONFIG_PATH,"/usr/local/lib/pkgconfig","/usr/lib/pkgconfig","/usr/local/libdata/pkgconfig","/usr/libdata/pkgconfig"].filter(Boolean).join(":");else return""},M2=(q,J)=>{return e1(`Detected ${J}, skipping search for globally-installed libvips`),q},x4=()=>{if(Boolean(process.env.SHARP_IGNORE_GLOBAL_LIBVIPS)===!0)return M2(!1,"SHARP_IGNORE_GLOBAL_LIBVIPS");if(Boolean(process.env.SHARP_FORCE_GLOBAL_LIBVIPS)===!0)return M2(!0,"SHARP_FORCE_GLOBAL_LIBVIPS");if(S4())return M2(!1,"Rosetta");const q=s1();return!!q&&_4(q,r1)};i1.exports={minimumLibvipsVersion:r1,prebuiltPlatforms:D4,buildPlatformArch:e,buildSharpLibvipsIncludeDir:T4,buildSharpLibvipsCPlusPlusDir:y4,buildSharpLibvipsLibDir:w4,isUnsupportedNodeRuntime:C4,runtimePlatformArch:E4,log:e1,yarnLocator:k4,spawnRebuild:M4,globalLibvipsVersion:s1,pkgConfigPath:t1,useGlobalLibvips:x4}});var J2=L((K9,q0)=>{var{familySync:f4,versionSync:d4}=import.meta.require("detect-libc"),{runtimePlatformArch:v4,isUnsupportedNodeRuntime:o1,prebuiltPlatforms:O4,minimumLibvipsVersion:b4}=f2(),l=v4(),h4=[`../src/build/Release/sharp-${l}.node`,"../src/build/Release/sharp-wasm32.node",`@img/sharp-${l}/sharp.node`,"@img/sharp-wasm32/sharp.node"],d2,V2=[];for(let q of h4)try{d2=import.meta.require(q);break}catch(J){V2.push(J)}if(d2)q0.exports=d2;else{const[q,J,$]=["linux","darwin","win32"].map((Y)=>l.startsWith(Y)),W=[`Could not load the "sharp" module using the ${l} runtime`];V2.forEach((Y)=>{if(Y.code!=="MODULE_NOT_FOUND")W.push(`${Y.code}: ${Y.message}`)});const Z=V2.map((Y)=>Y.message).join(" ");if(W.push("Possible solutions:"),o1()){const{found:Y,expected:K}=o1();W.push("- Please upgrade Node.js:",` Found ${Y}`,` Requires ${K}`)}else if(O4.includes(l)){const[Y,K]=l.split("-"),B=Y.endsWith("musl")?" --libc=musl":"";W.push("- Ensure optional dependencies can be installed:"," npm install --include=optional sharp"," yarn add sharp --ignore-engines","- Ensure your package manager supports multi-platform installation:"," See https://sharp.pixelplumbing.com/install#cross-platform","- Add platform-specific dependencies:",` npm install --os=${Y.replace("musl","")}${B} --cpu=${K} sharp`)}else W.push(`- Manually install libvips >= ${b4}`,"- Add experimental WebAssembly-based dependencies:"," npm install --cpu=wasm32 sharp"," npm install @img/sharp-wasm32");if(q&&/(symbol not found|CXXABI_)/i.test(Z))try{const{engines:Y}=import.meta.require(`@img/sharp-libvips-${l}/package`),K=`${f4()} ${d4()}`,B=`${Y.musl?"musl":"glibc"} ${Y.musl||Y.glibc}`;W.push("- Update your OS:",` Found ${K}`,` Requires ${B}`)}catch(Y){}if(q&&/\/snap\/core[0-9]{2}/.test(Z))W.push("- Remove the Node.js Snap, which does not support native modules"," snap remove node");if(J&&/Incompatible library version/.test(Z))W.push("- Update Homebrew:"," brew update && brew upgrade vips");if(V2.some((Y)=>Y.code==="ERR_DLOPEN_DISABLED"))W.push("- Run Node.js without using the --no-addons flag");if($&&/The specified procedure could not be found/.test(Z))W.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");throw W.push("- Consult the installation documentation:"," See https://sharp.pixelplumbing.com/install"),new Error(W.join("\n"))}});var $0=L((U9,J0)=>{var l4=function(){const q=this.constructor.call(),{debuglog:J,queueListener:$,...W}=this.options;if(q.options=structuredClone(W),q.options.debuglog=J,q.options.queueListener=$,this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),q.options.input.buffer=this.options.input.buffer,q.emit("finish")});return q},g4=import.meta.require("util"),v2=import.meta.require("stream"),m4=d();J2();var u4=g4.debuglog("sharp"),c=function(q,J){if(arguments.length===1&&!m4.defined(q))throw new Error("Invalid input");if(!(this instanceof c))return new c(q,J);return v2.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],useExifOrientation:!1,angle:0,rotationAngle:0,rotationBackground:[0,0,0,255],rotateBeforePreExtract:!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,sharpenSigma:0,sharpenM1:1,sharpenM2:2,sharpenX1:2,sharpenY2:10,sharpenY3:20,threshold:0,thresholdGrayscale:!0,trimBackground:[],trimThreshold:-1,trimLineArt:!1,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,resolveWithObject:!1,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,webpPreset:"default",webpEffort:4,webpMinSize:!1,webpMixed:!1,gifBitdepth:8,gifEffort:7,gifDither:1,gifInterFrameMaxError:0,gifInterPaletteMaxError:3,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:[],debuglog:($)=>{this.emit("warning",$),u4($)},queueListener:function($){c.queue.emit("change",$)}},this.options.input=this._createInputDescriptor(q,J,{allowStream:!0}),this};Object.setPrototypeOf(c.prototype,v2.Duplex.prototype);Object.setPrototypeOf(c,v2.Duplex);Object.assign(c.prototype,{clone:l4});J0.exports=c});var O2=L((B9,W0)=>{W0.exports={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]}});var Q0=L((G9,Z0)=>{Z0.exports=function q(J){if(!J||typeof J==="string")return!1;return J instanceof Array||Array.isArray(J)||J.length>=0&&(J.splice instanceof Function||Object.getOwnPropertyDescriptor(J,J.length-1)&&J.constructor.name!=="String")}});var U0=L((H9,K0)=>{var c4=Q0(),a4=Array.prototype.concat,r4=Array.prototype.slice,Y0=K0.exports=function q(J){var $=[];for(var W=0,Z=J.length;W<Z;W++){var Y=J[W];if(c4(Y))$=a4.call($,r4.call(Y));else $.push(Y)}return $};Y0.wrap=function(q){return function(){return q(Y0(arguments))}}});var I0=L((I9,H0)=>{var g=function(q,J,$){return Math.min(Math.max(J,q),$)},P2=function(q){var J=Math.round(q).toString(16).toUpperCase();return J.length<2?"0"+J:J},$2=O2(),W2=U0(),B0=Object.hasOwnProperty,G0=Object.create(null);for(A2 in $2)if(B0.call($2,A2))G0[$2[A2]]=A2;var A2,S=H0.exports={to:{},get:{}};S.get=function(q){var J=q.substring(0,3).toLowerCase(),$,W;switch(J){case"hsl":$=S.get.hsl(q),W="hsl";break;case"hwb":$=S.get.hwb(q),W="hwb";break;default:$=S.get.rgb(q),W="rgb";break}if(!$)return null;return{model:W,value:$}};S.get.rgb=function(q){if(!q)return null;var J=/^#([a-f0-9]{3,4})$/i,$=/^#([a-f0-9]{6})([a-f0-9]{2})?$/i,W=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,Z=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/,Y=/^(\w+)$/,K=[0,0,0,1],B,H,I;if(B=q.match($)){I=B[2],B=B[1];for(H=0;H<3;H++){var P=H*2;K[H]=parseInt(B.slice(P,P+2),16)}if(I)K[3]=parseInt(I,16)/255}else if(B=q.match(J)){B=B[1],I=B[3];for(H=0;H<3;H++)K[H]=parseInt(B[H]+B[H],16);if(I)K[3]=parseInt(I+I,16)/255}else if(B=q.match(W)){for(H=0;H<3;H++)K[H]=parseInt(B[H+1],0);if(B[4])if(B[5])K[3]=parseFloat(B[4])*0.01;else K[3]=parseFloat(B[4])}else if(B=q.match(Z)){for(H=0;H<3;H++)K[H]=Math.round(parseFloat(B[H+1])*2.55);if(B[4])if(B[5])K[3]=parseFloat(B[4])*0.01;else K[3]=parseFloat(B[4])}else if(B=q.match(Y)){if(B[1]==="transparent")return[0,0,0,0];if(!B0.call($2,B[1]))return null;return K=$2[B[1]],K[3]=1,K}else return null;for(H=0;H<3;H++)K[H]=g(K[H],0,255);return K[3]=g(K[3],0,1),K};S.get.hsl=function(q){if(!q)return null;var J=/^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*)?\)$/,$=q.match(J);if($){var W=parseFloat($[4]),Z=(parseFloat($[1])%360+360)%360,Y=g(parseFloat($[2]),0,100),K=g(parseFloat($[3]),0,100),B=g(isNaN(W)?1:W,0,1);return[Z,Y,K,B]}return null};S.get.hwb=function(q){if(!q)return null;var J=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,$=q.match(J);if($){var W=parseFloat($[4]),Z=(parseFloat($[1])%360+360)%360,Y=g(parseFloat($[2]),0,100),K=g(parseFloat($[3]),0,100),B=g(isNaN(W)?1:W,0,1);return[Z,Y,K,B]}return null};S.to.hex=function(){var q=W2(arguments);return"#"+P2(q[0])+P2(q[1])+P2(q[2])+(q[3]<1?P2(Math.round(q[3]*255)):"")};S.to.rgb=function(){var q=W2(arguments);return q.length<4||q[3]===1?"rgb("+Math.round(q[0])+", "+Math.round(q[1])+", "+Math.round(q[2])+")":"rgba("+Math.round(q[0])+", "+Math.round(q[1])+", "+Math.round(q[2])+", "+q[3]+")"};S.to.rgb.percent=function(){var q=W2(arguments),J=Math.round(q[0]/255*100),$=Math.round(q[1]/255*100),W=Math.round(q[2]/255*100);return q.length<4||q[3]===1?"rgb("+J+"%, "+$+"%, "+W+"%)":"rgba("+J+"%, "+$+"%, "+W+"%, "+q[3]+")"};S.to.hsl=function(){var q=W2(arguments);return q.length<4||q[3]===1?"hsl("+q[0]+", "+q[1]+"%, "+q[2]+"%)":"hsla("+q[0]+", "+q[1]+"%, "+q[2]+"%, "+q[3]+")"};S.to.hwb=function(){var q=W2(arguments),J="";if(q.length>=4&&q[3]!==1)J=", "+q[3];return"hwb("+q[0]+", "+q[1]+"%, "+q[2]+"%"+J+")"};S.to.keyword=function(q){return G0[q.slice(0,3)]}});var b2=L((F9,N0)=>{var e4=function(q,J){return(q[0]-J[0])**2+(q[1]-J[1])**2+(q[2]-J[2])**2},Z2=O2(),F0={};for(let q of Object.keys(Z2))F0[Z2[q]]=q;var X={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"},lch:{channels:3,labels:"lch"},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"]}};N0.exports=X;for(let q of Object.keys(X)){if(!("channels"in X[q]))throw new Error("missing channels property: "+q);if(!("labels"in X[q]))throw new Error("missing channel labels property: "+q);if(X[q].labels.length!==X[q].channels)throw new Error("channel and label counts mismatch: "+q);const{channels:J,labels:$}=X[q];delete X[q].channels,delete X[q].labels,Object.defineProperty(X[q],"channels",{value:J}),Object.defineProperty(X[q],"labels",{value:$})}X.rgb.hsl=function(q){const J=q[0]/255,$=q[1]/255,W=q[2]/255,Z=Math.min(J,$,W),Y=Math.max(J,$,W),K=Y-Z;let B,H;if(Y===Z)B=0;else if(J===Y)B=($-W)/K;else if($===Y)B=2+(W-J)/K;else if(W===Y)B=4+(J-$)/K;if(B=Math.min(B*60,360),B<0)B+=360;const I=(Z+Y)/2;if(Y===Z)H=0;else if(I<=0.5)H=K/(Y+Z);else H=K/(2-Y-Z);return[B,H*100,I*100]};X.rgb.hsv=function(q){let J,$,W,Z,Y;const K=q[0]/255,B=q[1]/255,H=q[2]/255,I=Math.max(K,B,H),P=I-Math.min(K,B,H),z=function(f){return(I-f)/6/P+0.5};if(P===0)Z=0,Y=0;else{if(Y=P/I,J=z(K),$=z(B),W=z(H),K===I)Z=W-$;else if(B===I)Z=0.3333333333333333+J-W;else if(H===I)Z=0.6666666666666666+$-J;if(Z<0)Z+=1;else if(Z>1)Z-=1}return[Z*360,Y*100,I*100]};X.rgb.hwb=function(q){const J=q[0],$=q[1];let W=q[2];const Z=X.rgb.hsl(q)[0],Y=0.00392156862745098*Math.min(J,Math.min($,W));return W=1-0.00392156862745098*Math.max(J,Math.max($,W)),[Z,Y*100,W*100]};X.rgb.cmyk=function(q){const J=q[0]/255,$=q[1]/255,W=q[2]/255,Z=Math.min(1-J,1-$,1-W),Y=(1-J-Z)/(1-Z)||0,K=(1-$-Z)/(1-Z)||0,B=(1-W-Z)/(1-Z)||0;return[Y*100,K*100,B*100,Z*100]};X.rgb.keyword=function(q){const J=F0[q];if(J)return J;let $=Infinity,W;for(let Z of Object.keys(Z2)){const Y=Z2[Z],K=e4(q,Y);if(K<$)$=K,W=Z}return W};X.keyword.rgb=function(q){return Z2[q]};X.rgb.xyz=function(q){let J=q[0]/255,$=q[1]/255,W=q[2]/255;J=J>0.04045?((J+0.055)/1.055)**2.4:J/12.92,$=$>0.04045?(($+0.055)/1.055)**2.4:$/12.92,W=W>0.04045?((W+0.055)/1.055)**2.4:W/12.92;const Z=J*0.4124+$*0.3576+W*0.1805,Y=J*0.2126+$*0.7152+W*0.0722,K=J*0.0193+$*0.1192+W*0.9505;return[Z*100,Y*100,K*100]};X.rgb.lab=function(q){const J=X.rgb.xyz(q);let $=J[0],W=J[1],Z=J[2];$/=95.047,W/=100,Z/=108.883,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862,W=W>0.008856?W**0.3333333333333333:7.787*W+0.13793103448275862,Z=Z>0.008856?Z**0.3333333333333333:7.787*Z+0.13793103448275862;const Y=116*W-16,K=500*($-W),B=200*(W-Z);return[Y,K,B]};X.hsl.rgb=function(q){const J=q[0]/360,$=q[1]/100,W=q[2]/100;let Z,Y,K;if($===0)return K=W*255,[K,K,K];if(W<0.5)Z=W*(1+$);else Z=W+$-W*$;const B=2*W-Z,H=[0,0,0];for(let I=0;I<3;I++){if(Y=J+0.3333333333333333*-(I-1),Y<0)Y++;if(Y>1)Y--;if(6*Y<1)K=B+(Z-B)*6*Y;else if(2*Y<1)K=Z;else if(3*Y<2)K=B+(Z-B)*(0.6666666666666666-Y)*6;else K=B;H[I]=K*255}return H};X.hsl.hsv=function(q){const J=q[0];let $=q[1]/100,W=q[2]/100,Z=$;const Y=Math.max(W,0.01);W*=2,$*=W<=1?W:2-W,Z*=Y<=1?Y:2-Y;const K=(W+$)/2,B=W===0?2*Z/(Y+Z):2*$/(W+$);return[J,B*100,K*100]};X.hsv.rgb=function(q){const J=q[0]/60,$=q[1]/100;let W=q[2]/100;const Z=Math.floor(J)%6,Y=J-Math.floor(J),K=255*W*(1-$),B=255*W*(1-$*Y),H=255*W*(1-$*(1-Y));switch(W*=255,Z){case 0:return[W,H,K];case 1:return[B,W,K];case 2:return[K,W,H];case 3:return[K,B,W];case 4:return[H,K,W];case 5:return[W,K,B]}};X.hsv.hsl=function(q){const J=q[0],$=q[1]/100,W=q[2]/100,Z=Math.max(W,0.01);let Y,K;K=(2-$)*W;const B=(2-$)*Z;return Y=$*Z,Y/=B<=1?B:2-B,Y=Y||0,K/=2,[J,Y*100,K*100]};X.hwb.rgb=function(q){const J=q[0]/360;let $=q[1]/100,W=q[2]/100;const Z=$+W;let Y;if(Z>1)$/=Z,W/=Z;const K=Math.floor(6*J),B=1-W;if(Y=6*J-K,(K&1)!==0)Y=1-Y;const H=$+Y*(B-$);let I,P,z;switch(K){default:case 6:case 0:I=B,P=H,z=$;break;case 1:I=H,P=B,z=$;break;case 2:I=$,P=B,z=H;break;case 3:I=$,P=H,z=B;break;case 4:I=H,P=$,z=B;break;case 5:I=B,P=$,z=H;break}return[I*255,P*255,z*255]};X.cmyk.rgb=function(q){const J=q[0]/100,$=q[1]/100,W=q[2]/100,Z=q[3]/100,Y=1-Math.min(1,J*(1-Z)+Z),K=1-Math.min(1,$*(1-Z)+Z),B=1-Math.min(1,W*(1-Z)+Z);return[Y*255,K*255,B*255]};X.xyz.rgb=function(q){const J=q[0]/100,$=q[1]/100,W=q[2]/100;let Z,Y,K;return Z=J*3.2406+$*-1.5372+W*-0.4986,Y=J*-0.9689+$*1.8758+W*0.0415,K=J*0.0557+$*-0.204+W*1.057,Z=Z>0.0031308?1.055*Z**0.4166666666666667-0.055:Z*12.92,Y=Y>0.0031308?1.055*Y**0.4166666666666667-0.055:Y*12.92,K=K>0.0031308?1.055*K**0.4166666666666667-0.055:K*12.92,Z=Math.min(Math.max(0,Z),1),Y=Math.min(Math.max(0,Y),1),K=Math.min(Math.max(0,K),1),[Z*255,Y*255,K*255]};X.xyz.lab=function(q){let J=q[0],$=q[1],W=q[2];J/=95.047,$/=100,W/=108.883,J=J>0.008856?J**0.3333333333333333:7.787*J+0.13793103448275862,$=$>0.008856?$**0.3333333333333333:7.787*$+0.13793103448275862,W=W>0.008856?W**0.3333333333333333:7.787*W+0.13793103448275862;const Z=116*$-16,Y=500*(J-$),K=200*($-W);return[Z,Y,K]};X.lab.xyz=function(q){const J=q[0],$=q[1],W=q[2];let Z,Y,K;Y=(J+16)/116,Z=$/500+Y,K=Y-W/200;const B=Y**3,H=Z**3,I=K**3;return Y=B>0.008856?B:(Y-0.13793103448275862)/7.787,Z=H>0.008856?H:(Z-0.13793103448275862)/7.787,K=I>0.008856?I:(K-0.13793103448275862)/7.787,Z*=95.047,Y*=100,K*=108.883,[Z,Y,K]};X.lab.lch=function(q){const J=q[0],$=q[1],W=q[2];let Z;if(Z=Math.atan2(W,$)*360/2/Math.PI,Z<0)Z+=360;const K=Math.sqrt($*$+W*W);return[J,K,Z]};X.lch.lab=function(q){const J=q[0],$=q[1],Z=q[2]/360*2*Math.PI,Y=$*Math.cos(Z),K=$*Math.sin(Z);return[J,Y,K]};X.rgb.ansi16=function(q,J=null){const[$,W,Z]=q;let Y=J===null?X.rgb.hsv(q)[2]:J;if(Y=Math.round(Y/50),Y===0)return 30;let K=30+(Math.round(Z/255)<<2|Math.round(W/255)<<1|Math.round($/255));if(Y===2)K+=60;return K};X.hsv.ansi16=function(q){return X.rgb.ansi16(X.hsv.rgb(q),q[2])};X.rgb.ansi256=function(q){const J=q[0],$=q[1],W=q[2];if(J===$&&$===W){if(J<8)return 16;if(J>248)return 231;return Math.round((J-8)/247*24)+232}return 16+36*Math.round(J/255*5)+6*Math.round($/255*5)+Math.round(W/255*5)};X.ansi16.rgb=function(q){let J=q%10;if(J===0||J===7){if(q>50)J+=3.5;return J=J/10.5*255,[J,J,J]}const $=(~~(q>50)+1)*0.5,W=(J&1)*$*255,Z=(J>>1&1)*$*255,Y=(J>>2&1)*$*255;return[W,Z,Y]};X.ansi256.rgb=function(q){if(q>=232){const Y=(q-232)*10+8;return[Y,Y,Y]}q-=16;let J;const $=Math.floor(q/36)/5*255,W=Math.floor((J=q%36)/6)/5*255,Z=J%6/5*255;return[$,W,Z]};X.rgb.hex=function(q){const $=(((Math.round(q[0])&255)<<16)+((Math.round(q[1])&255)<<8)+(Math.round(q[2])&255)).toString(16).toUpperCase();return"000000".substring($.length)+$};X.hex.rgb=function(q){const J=q.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!J)return[0,0,0];let $=J[0];if(J[0].length===3)$=$.split("").map((B)=>{return B+B}).join("");const W=parseInt($,16),Z=W>>16&255,Y=W>>8&255,K=W&255;return[Z,Y,K]};X.rgb.hcg=function(q){const J=q[0]/255,$=q[1]/255,W=q[2]/255,Z=Math.max(Math.max(J,$),W),Y=Math.min(Math.min(J,$),W),K=Z-Y;let B,H;if(K<1)B=Y/(1-K);else B=0;if(K<=0)H=0;else if(Z===J)H=($-W)/K%6;else if(Z===$)H=2+(W-J)/K;else H=4+(J-$)/K;return H/=6,H%=1,[H*360,K*100,B*100]};X.hsl.hcg=function(q){const J=q[1]/100,$=q[2]/100,W=$<0.5?2*J*$:2*J*(1-$);let Z=0;if(W<1)Z=($-0.5*W)/(1-W);return[q[0],W*100,Z*100]};X.hsv.hcg=function(q){const J=q[1]/100,$=q[2]/100,W=J*$;let Z=0;if(W<1)Z=($-W)/(1-W);return[q[0],W*100,Z*100]};X.hcg.rgb=function(q){const J=q[0]/360,$=q[1]/100,W=q[2]/100;if($===0)return[W*255,W*255,W*255];const Z=[0,0,0],Y=J%1*6,K=Y%1,B=1-K;let H=0;switch(Math.floor(Y)){case 0:Z[0]=1,Z[1]=K,Z[2]=0;break;case 1:Z[0]=B,Z[1]=1,Z[2]=0;break;case 2:Z[0]=0,Z[1]=1,Z[2]=K;break;case 3:Z[0]=0,Z[1]=B,Z[2]=1;break;case 4:Z[0]=K,Z[1]=0,Z[2]=1;break;default:Z[0]=1,Z[1]=0,Z[2]=B}return H=(1-$)*W,[($*Z[0]+H)*255,($*Z[1]+H)*255,($*Z[2]+H)*255]};X.hcg.hsv=function(q){const J=q[1]/100,$=q[2]/100,W=J+$*(1-J);let Z=0;if(W>0)Z=J/W;return[q[0],Z*100,W*100]};X.hcg.hsl=function(q){const J=q[1]/100,W=q[2]/100*(1-J)+0.5*J;let Z=0;if(W>0&&W<0.5)Z=J/(2*W);else if(W>=0.5&&W<1)Z=J/(2*(1-W));return[q[0],Z*100,W*100]};X.hcg.hwb=function(q){const J=q[1]/100,$=q[2]/100,W=J+$*(1-J);return[q[0],(W-J)*100,(1-W)*100]};X.hwb.hcg=function(q){const J=q[1]/100,W=1-q[2]/100,Z=W-J;let Y=0;if(Z<1)Y=(W-Z)/(1-Z);return[q[0],Z*100,Y*100]};X.apple.rgb=function(q){return[q[0]/65535*255,q[1]/65535*255,q[2]/65535*255]};X.rgb.apple=function(q){return[q[0]/255*65535,q[1]/255*65535,q[2]/255*65535]};X.gray.rgb=function(q){return[q[0]/100*255,q[0]/100*255,q[0]/100*255]};X.gray.hsl=function(q){return[0,0,q[0]]};X.gray.hsv=X.gray.hsl;X.gray.hwb=function(q){return[0,100,q[0]]};X.gray.cmyk=function(q){return[0,0,0,q[0]]};X.gray.lab=function(q){return[q[0],0,0]};X.gray.hex=function(q){const J=Math.round(q[0]/100*255)&255,W=((J<<16)+(J<<8)+J).toString(16).toUpperCase();return"000000".substring(W.length)+W};X.rgb.gray=function(q){return[(q[0]+q[1]+q[2])/3/255*100]}});var V0=L((N9,X0)=>{var p4=function(){const q={},J=Object.keys(L2);for(let $=J.length,W=0;W<$;W++)q[J[W]]={distance:-1,parent:null};return q},n4=function(q){const J=p4(),$=[q];J[q].distance=0;while($.length){const W=$.pop(),Z=Object.keys(L2[W]);for(let Y=Z.length,K=0;K<Y;K++){const B=Z[K],H=J[B];if(H.distance===-1)H.distance=J[W].distance+1,H.parent=W,$.unshift(B)}}return J},s4=function(q,J){return function($){return J(q($))}},t4=function(q,J){const $=[J[q].parent,q];let W=L2[J[q].parent][q],Z=J[q].parent;while(J[Z].parent)$.unshift(J[Z].parent),W=s4(L2[J[Z].parent][Z],W),Z=J[Z].parent;return W.conversion=$,W},L2=b2();X0.exports=function(q){const J=n4(q),$={},W=Object.keys(J);for(let Z=W.length,Y=0;Y<Z;Y++){const K=W[Y];if(J[K].parent===null)continue;$[K]=t4(K,J)}return $}});var P0=L((X9,A0)=>{var q3=function(q){const J=function(...$){const W=$[0];if(W===void 0||W===null)return W;if(W.length>1)$=W;return q($)};if("conversion"in q)J.conversion=q.conversion;return J},J3=function(q){const J=function(...$){const W=$[0];if(W===void 0||W===null)return W;if(W.length>1)$=W;const Z=q($);if(typeof Z==="object")for(let Y=Z.length,K=0;K<Y;K++)Z[K]=Math.round(Z[K]);return Z};if("conversion"in q)J.conversion=q.conversion;return J},h2=b2(),i4=V0(),p={},o4=Object.keys(h2);o4.forEach((q)=>{p[q]={},Object.defineProperty(p[q],"channels",{value:h2[q].channels}),Object.defineProperty(p[q],"labels",{value:h2[q].labels});const J=i4(q);Object.keys(J).forEach((W)=>{const Z=J[W];p[q][W]=J3(Z),p[q][W].raw=q3(Z)})});A0.exports=p});var R2=L((V9,_0)=>{var E=function(q,J){if(!(this instanceof E))return new E(q,J);if(J&&J in L0)J=null;if(J&&!(J in k))throw new Error("Unknown model: "+J);let $,W;if(q==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(q instanceof E)this.model=q.model,this.color=[...q.color],this.valpha=q.valpha;else if(typeof q==="string"){const Z=n.get(q);if(Z===null)throw new Error("Unable to parse color from string: "+q);this.model=Z.model,W=k[this.model].channels,this.color=Z.value.slice(0,W),this.valpha=typeof Z.value[W]==="number"?Z.value[W]:1}else if(q.length>0){this.model=J||"rgb",W=k[this.model].channels;const Z=Array.prototype.slice.call(q,0,W);this.color=m2(Z,W),this.valpha=typeof q[W]==="number"?q[W]:1}else if(typeof q==="number")this.model="rgb",this.color=[q>>16&255,q>>8&255,q&255],this.valpha=1;else{this.valpha=1;const Z=Object.keys(q);if("alpha"in q)Z.splice(Z.indexOf("alpha"),1),this.valpha=typeof q.alpha==="number"?q.alpha:0;const Y=Z.sort().join("");if(!(Y in g2))throw new Error("Unable to parse color from object: "+JSON.stringify(q));this.model=g2[Y];const{labels:K}=k[this.model],B=[];for($=0;$<K.length;$++)B.push(q[K[$]]);this.color=m2(B)}if(_2[this.model]){W=k[this.model].channels;for($=0;$<W;$++){const Z=_2[this.model][$];if(Z)this.color[$]=Z(this.color[$])}}if(this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze)Object.freeze(this)},$3=function(q,J){return Number(q.toFixed(J))},W3=function(q){return function(J){return $3(J,q)}},j=function(q,J,$){q=Array.isArray(q)?q:[q];for(let W of q)(_2[W]||(_2[W]=[]))[J]=$;return q=q[0],function(W){let Z;if(W!==void 0){if($)W=$(W);return Z=this[q](),Z.color[J]=W,Z}if(Z=this[q]().color[J],$)Z=$(Z);return Z}},D=function(q){return function(J){return Math.max(0,Math.min(q,J))}},Z3=function(q){return Array.isArray(q)?q:[q]},m2=function(q,J){for(let $=0;$<J;$++)if(typeof q[$]!=="number")q[$]=0;return q},n=I0(),k=P0(),L0=["keyword","gray","hex"],g2={};for(let q of Object.keys(k))g2[[...k[q].labels].sort().join("")]=q;var _2={};E.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(q){let J=this.model in n.to?this:this.rgb();J=J.round(typeof q==="number"?q:1);const $=J.valpha===1?J.color:[...J.color,this.valpha];return n.to[J.model]($)},percentString(q){const J=this.rgb().round(typeof q==="number"?q:1),$=J.valpha===1?J.color:[...J.color,this.valpha];return n.to.rgb.percent($)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const q={},{channels:J}=k[this.model],{labels:$}=k[this.model];for(let W=0;W<J;W++)q[$[W]]=this.color[W];if(this.valpha!==1)q.alpha=this.valpha;return q},unitArray(){const q=this.rgb().color;if(q[0]/=255,q[1]/=255,q[2]/=255,this.valpha!==1)q.push(this.valpha);return q},unitObject(){const q=this.rgb().object();if(q.r/=255,q.g/=255,q.b/=255,this.valpha!==1)q.alpha=this.valpha;return q},round(q){return q=Math.max(q||0,0),new E([...this.color.map(W3(q)),this.valpha],this.model)},alpha(q){if(q!==void 0)return new E([...this.color,Math.max(0,Math.min(1,q))],this.model);return this.valpha},red:j("rgb",0,D(255)),green:j("rgb",1,D(255)),blue:j("rgb",2,D(255)),hue:j(["hsl","hsv","hsl","hwb","hcg"],0,(q)=>(q%360+360)%360),saturationl:j("hsl",1,D(100)),lightness:j("hsl",2,D(100)),saturationv:j("hsv",1,D(100)),value:j("hsv",2,D(100)),chroma:j("hcg",1,D(100)),gray:j("hcg",2,D(100)),white:j("hwb",1,D(100)),wblack:j("hwb",2,D(100)),cyan:j("cmyk",0,D(100)),magenta:j("cmyk",1,D(100)),yellow:j("cmyk",2,D(100)),black:j("cmyk",3,D(100)),x:j("xyz",0,D(95.047)),y:j("xyz",1,D(100)),z:j("xyz",2,D(108.833)),l:j("lab",0,D(100)),a:j("lab",1),b:j("lab",2),keyword(q){if(q!==void 0)return new E(q);return k[this.model].keyword(this.color)},hex(q){if(q!==void 0)return new E(q);return n.to.hex(this.rgb().round().color)},hexa(q){if(q!==void 0)return new E(q);const J=this.rgb().round().color;let $=Math.round(this.valpha*255).toString(16).toUpperCase();if($.length===1)$="0"+$;return n.to.hex(J)+$},rgbNumber(){const q=this.rgb().color;return(q[0]&255)<<16|(q[1]&255)<<8|q[2]&255},luminosity(){const q=this.rgb().color,J=[];for(let[$,W]of q.entries()){const Z=W/255;J[$]=Z<=0.04045?Z/12.92:((Z+0.055)/1.055)**2.4}return 0.2126*J[0]+0.7152*J[1]+0.0722*J[2]},contrast(q){const J=this.luminosity(),$=q.luminosity();if(J>$)return(J+0.05)/($+0.05);return($+0.05)/(J+0.05)},level(q){const J=this.contrast(q);if(J>=7)return"AAA";return J>=4.5?"AA":""},isDark(){const q=this.rgb().color;return(q[0]*2126+q[1]*7152+q[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const q=this.rgb();for(let J=0;J<3;J++)q.color[J]=255-q.color[J];return q},lighten(q){const J=this.hsl();return J.color[2]+=J.color[2]*q,J},darken(q){const J=this.hsl();return J.color[2]-=J.color[2]*q,J},saturate(q){const J=this.hsl();return J.color[1]+=J.color[1]*q,J},desaturate(q){const J=this.hsl();return J.color[1]-=J.color[1]*q,J},whiten(q){const J=this.hwb();return J.color[1]+=J.color[1]*q,J},blacken(q){const J=this.hwb();return J.color[2]+=J.color[2]*q,J},grayscale(){const q=this.rgb().color,J=q[0]*0.3+q[1]*0.59+q[2]*0.11;return E.rgb(J,J,J)},fade(q){return this.alpha(this.valpha-this.valpha*q)},opaquer(q){return this.alpha(this.valpha+this.valpha*q)},rotate(q){const J=this.hsl();let $=J.color[0];return $=($+q)%360,$=$<0?360+$:$,J.color[0]=$,J},mix(q,J){if(!q||!q.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof q);const $=q.rgb(),W=this.rgb(),Z=J===void 0?0.5:J,Y=2*Z-1,K=$.alpha()-W.alpha(),B=((Y*K===-1?Y:(Y+K)/(1+Y*K))+1)/2,H=1-B;return E.rgb(B*$.red()+H*W.red(),B*$.green()+H*W.green(),B*$.blue()+H*W.blue(),$.alpha()*Z+W.alpha()*(1-Z))}};for(let q of Object.keys(k)){if(L0.includes(q))continue;const{channels:J}=k[q];E.prototype[q]=function(...$){if(this.model===q)return new E(this);if($.length>0)return new E($,q);return new E([...Z3(k[this.model][q].raw(this.color)),this.valpha],q)},E[q]=function(...$){let W=$[0];if(typeof W==="number")W=m2($,J);return new E(W,q)}}_0.exports=E});var z0=L((A9,j0)=>{var R0=function(q){const{raw:J,density:$,limitInputPixels:W,ignoreIcc:Z,unlimited:Y,sequentialRead:K,failOn:B,failOnError:H,animated:I,page:P,pages:z,subifd:f}=q;return[J,$,W,Z,Y,K,B,H,I,P,z,f].some(G.defined)?{raw:J,density:$,limitInputPixels:W,ignoreIcc:Z,unlimited:Y,sequentialRead:K,failOn:B,failOnError:H,animated:I,page:P,pages:z,subifd:f}:void 0},K3=function(q,J,$){const W={failOn:"warning",limitInputPixels:Math.pow(16383,2),ignoreIcc:!1,unlimited:!1,sequentialRead:!0};if(G.string(q))W.file=q;else if(G.buffer(q)){if(q.length===0)throw Error("Input Buffer is empty");W.buffer=q}else if(G.arrayBuffer(q)){if(q.byteLength===0)throw Error("Input bit Array is empty");W.buffer=Buffer.from(q,0,q.byteLength)}else if(G.typedArray(q)){if(q.length===0)throw Error("Input Bit Array is empty");W.buffer=Buffer.from(q.buffer,q.byteOffset,q.byteLength)}else if(G.plainObject(q)&&!G.defined(J)){if(J=q,R0(J))W.buffer=[]}else if(!G.defined(q)&&!G.defined(J)&&G.object($)&&$.allowStream)W.buffer=[];else throw new Error(`Unsupported input '${q}' of type ${typeof q}${G.defined(J)?` when also providing options of type ${typeof J}`:""}`);if(G.object(J)){if(G.defined(J.failOnError))if(G.bool(J.failOnError))W.failOn=J.failOnError?"warning":"none";else throw G.invalidParameterError("failOnError","boolean",J.failOnError);if(G.defined(J.failOn))if(G.string(J.failOn)&&G.inArray(J.failOn,["none","truncated","error","warning"]))W.failOn=J.failOn;else throw G.invalidParameterError("failOn","one of: none, truncated, error, warning",J.failOn);if(G.defined(J.density))if(G.inRange(J.density,1,1e5))W.density=J.density;else throw G.invalidParameterError("density","number between 1 and 100000",J.density);if(G.defined(J.ignoreIcc))if(G.bool(J.ignoreIcc))W.ignoreIcc=J.ignoreIcc;else throw G.invalidParameterError("ignoreIcc","boolean",J.ignoreIcc);if(G.defined(J.limitInputPixels))if(G.bool(J.limitInputPixels))W.limitInputPixels=J.limitInputPixels?Math.pow(16383,2):0;else if(G.integer(J.limitInputPixels)&&G.inRange(J.limitInputPixels,0,Number.MAX_SAFE_INTEGER))W.limitInputPixels=J.limitInputPixels;else throw G.invalidParameterError("limitInputPixels","positive integer",J.limitInputPixels);if(G.defined(J.unlimited))if(G.bool(J.unlimited))W.unlimited=J.unlimited;else throw G.invalidParameterError("unlimited","boolean",J.unlimited);if(G.defined(J.sequentialRead))if(G.bool(J.sequentialRead))W.sequentialRead=J.sequentialRead;else throw G.invalidParameterError("sequentialRead","boolean",J.sequentialRead);if(G.defined(J.raw))if(G.object(J.raw)&&G.integer(J.raw.width)&&J.raw.width>0&&G.integer(J.raw.height)&&J.raw.height>0&&G.integer(J.raw.channels)&&G.inRange(J.raw.channels,1,4))switch(W.rawWidth=J.raw.width,W.rawHeight=J.raw.height,W.rawChannels=J.raw.channels,W.rawPremultiplied=!!J.raw.premultiplied,q.constructor){case Uint8Array:case Uint8ClampedArray:W.rawDepth="uchar";break;case Int8Array:W.rawDepth="char";break;case Uint16Array:W.rawDepth="ushort";break;case Int16Array:W.rawDepth="short";break;case Uint32Array:W.rawDepth="uint";break;case Int32Array:W.rawDepth="int";break;case Float32Array:W.rawDepth="float";break;case Float64Array:W.rawDepth="double";break;default:W.rawDepth="uchar";break}else throw new Error("Expected width, height and channels for raw pixel input");if(G.defined(J.animated))if(G.bool(J.animated))W.pages=J.animated?-1:1;else throw G.invalidParameterError("animated","boolean",J.animated);if(G.defined(J.pages))if(G.integer(J.pages)&&G.inRange(J.pages,-1,1e5))W.pages=J.pages;else throw G.invalidParameterError("pages","integer between -1 and 100000",J.pages);if(G.defined(J.page))if(G.integer(J.page)&&G.inRange(J.page,0,1e5))W.page=J.page;else throw G.invalidParameterError("page","integer between 0 and 100000",J.page);if(G.defined(J.level))if(G.integer(J.level)&&G.inRange(J.level,0,256))W.level=J.level;else throw G.invalidParameterError("level","integer between 0 and 256",J.level);if(G.defined(J.subifd))if(G.integer(J.subifd)&&G.inRange(J.subifd,-1,1e5))W.subifd=J.subifd;else throw G.invalidParameterError("subifd","integer between -1 and 100000",J.subifd);if(G.defined(J.create))if(G.object(J.create)&&G.integer(J.create.width)&&J.create.width>0&&G.integer(J.create.height)&&J.create.height>0&&G.integer(J.create.channels)){if(W.createWidth=J.create.width,W.createHeight=J.create.height,W.createChannels=J.create.channels,G.defined(J.create.noise)){if(!G.object(J.create.noise))throw new Error("Expected noise to be an object");if(!G.inArray(J.create.noise.type,["gaussian"]))throw new Error("Only gaussian noise is supported at the moment");if(!G.inRange(J.create.channels,1,4))throw G.invalidParameterError("create.channels","number between 1 and 4",J.create.channels);if(W.createNoiseType=J.create.noise.type,G.number(J.create.noise.mean)&&G.inRange(J.create.noise.mean,0,1e4))W.createNoiseMean=J.create.noise.mean;else throw G.invalidParameterError("create.noise.mean","number between 0 and 10000",J.create.noise.mean);if(G.number(J.create.noise.sigma)&&G.inRange(J.create.noise.sigma,0,1e4))W.createNoiseSigma=J.create.noise.sigma;else throw G.invalidParameterError("create.noise.sigma","number between 0 and 10000",J.create.noise.sigma)}else if(G.defined(J.create.background)){if(!G.inRange(J.create.channels,3,4))throw G.invalidParameterError("create.channels","number between 3 and 4",J.create.channels);const Z=Q3(J.create.background);W.createBackground=[Z.red(),Z.green(),Z.blue(),Math.round(Z.alpha()*255)]}else throw new Error("Expected valid noise or background to create a new input image");delete W.buffer}else throw new Error("Expected valid width, height and channels to create a new input image");if(G.defined(J.text))if(G.object(J.text)&&G.string(J.text.text)){if(W.textValue=J.text.text,G.defined(J.text.height)&&G.defined(J.text.dpi))throw new Error("Expected only one of dpi or height");if(G.defined(J.text.font))if(G.string(J.text.font))W.textFont=J.text.font;else throw G.invalidParameterError("text.font","string",J.text.font);if(G.defined(J.text.fontfile))if(G.string(J.text.fontfile))W.textFontfile=J.text.fontfile;else throw G.invalidParameterError("text.fontfile","string",J.text.fontfile);if(G.defined(J.text.width))if(G.integer(J.text.width)&&J.text.width>0)W.textWidth=J.text.width;else throw G.invalidParameterError("text.width","positive integer",J.text.width);if(G.defined(J.text.height))if(G.integer(J.text.height)&&J.text.height>0)W.textHeight=J.text.height;else throw G.invalidParameterError("text.height","positive integer",J.text.height);if(G.defined(J.text.align))if(G.string(J.text.align)&&G.string(this.constructor.align[J.text.align]))W.textAlign=this.constructor.align[J.text.align];else throw G.invalidParameterError("text.align","valid alignment",J.text.align);if(G.defined(J.text.justify))if(G.bool(J.text.justify))W.textJustify=J.text.justify;else throw G.invalidParameterError("text.justify","boolean",J.text.justify);if(G.defined(J.text.dpi))if(G.integer(J.text.dpi)&&G.inRange(J.text.dpi,1,1e6))W.textDpi=J.text.dpi;else throw G.invalidParameterError("text.dpi","integer between 1 and 1000000",J.text.dpi);if(G.defined(J.text.rgba))if(G.bool(J.text.rgba))W.textRgba=J.text.rgba;else throw G.invalidParameterError("text.rgba","bool",J.text.rgba);if(G.defined(J.text.spacing))if(G.integer(J.text.spacing)&&G.inRange(J.text.spacing,-1e6,1e6))W.textSpacing=J.text.spacing;else throw G.invalidParameterError("text.spacing","integer between -1000000 and 1000000",J.text.spacing);if(G.defined(J.text.wrap))if(G.string(J.text.wrap)&&G.inArray(J.text.wrap,["word","char","word-char","none"]))W.textWrap=J.text.wrap;else throw G.invalidParameterError("text.wrap","one of: word, char, word-char, none",J.text.wrap);delete W.buffer}else throw new Error("Expected a valid string to create an image with text.")}else if(G.defined(J))throw new Error("Invalid input options "+J);return W},U3=function(q,J,$){if(Array.isArray(this.options.input.buffer))if(G.buffer(q)){if(this.options.input.buffer.length===0)this.on("finish",()=>{this.streamInFinished=!0});this.options.input.buffer.push(q),$()}else $(new Error("Non-Buffer data on Writable Stream"));else $(new Error("Unexpected data on Writable Stream"))},B3=function(){if(this._isStreamInput())this.options.input.buffer=Buffer.concat(this.options.input.buffer)},G3=function(){return Array.isArray(this.options.input.buffer)},H3=function(q){const J=Error();if(G.fn(q)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),m.metadata(this.options,($,W)=>{if($)q(G.nativeError($,J));else q(null,W)})});else m.metadata(this.options,($,W)=>{if($)q(G.nativeError($,J));else q(null,W)});return this}else if(this._isStreamInput())return new Promise(($,W)=>{const Z=()=>{this._flattenBufferIn(),m.metadata(this.options,(Y,K)=>{if(Y)W(G.nativeError(Y,J));else $(K)})};if(this.writableFinished)Z();else this.once("finish",Z)});else return new Promise(($,W)=>{m.metadata(this.options,(Z,Y)=>{if(Z)W(G.nativeError(Z,J));else $(Y)})})},I3=function(q){const J=Error();if(G.fn(q)){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),m.stats(this.options,($,W)=>{if($)q(G.nativeError($,J));else q(null,W)})});else m.stats(this.options,($,W)=>{if($)q(G.nativeError($,J));else q(null,W)});return this}else if(this._isStreamInput())return new Promise(($,W)=>{this.on("finish",function(){this._flattenBufferIn(),m.stats(this.options,(Z,Y)=>{if(Z)W(G.nativeError(Z,J));else $(Y)})})});else return new Promise(($,W)=>{m.stats(this.options,(Z,Y)=>{if(Z)W(G.nativeError(Z,J));else $(Y)})})},Q3=R2(),G=d(),m=J2(),Y3={left:"low",center:"centre",centre:"centre",right:"high"};j0.exports=function(q){Object.assign(q.prototype,{_inputOptionsFromObject:R0,_createInputDescriptor:K3,_write:U3,_flattenBufferIn:B3,_isStreamInput:G3,metadata:H3,stats:I3}),q.align=Y3}});var C0=L((P9,w0)=>{var l2=function(q){return q.angle%360!==0||q.useExifOrientation===!0||q.rotationAngle!==0},j2=function(q){return q.width!==-1||q.height!==-1},X3=function(q,J,$){if(j2(this.options))this.options.debuglog("ignoring previous resize options");if(this.options.widthPost!==-1)this.options.debuglog("operation order will be: extract, resize, extract");if(V.defined(q))if(V.object(q)&&!V.defined($))$=q;else if(V.integer(q)&&q>0)this.options.width=q;else throw V.invalidParameterError("width","positive integer",q);else this.options.width=-1;if(V.defined(J))if(V.integer(J)&&J>0)this.options.height=J;else throw V.invalidParameterError("height","positive integer",J);else this.options.height=-1;if(V.object($)){if(V.defined($.width))if(V.integer($.width)&&$.width>0)this.options.width=$.width;else throw V.invalidParameterError("width","positive integer",$.width);if(V.defined($.height))if(V.integer($.height)&&$.height>0)this.options.height=$.height;else throw V.invalidParameterError("height","positive integer",$.height);if(V.defined($.fit)){const W=N3[$.fit];if(V.string(W))this.options.canvas=W;else throw V.invalidParameterError("fit","valid fit",$.fit)}if(V.defined($.position)){const W=V.integer($.position)?$.position:y0[$.position]||T0[$.position]||E0[$.position];if(V.integer(W)&&(V.inRange(W,0,8)||V.inRange(W,16,17)))this.options.position=W;else throw V.invalidParameterError("position","valid position/gravity/strategy",$.position)}if(this._setBackgroundColourOption("resizeBackground",$.background),V.defined($.kernel))if(V.string(u2[$.kernel]))this.options.kernel=u2[$.kernel];else throw V.invalidParameterError("kernel","valid kernel name",$.kernel);if(V.defined($.withoutEnlargement))this._setBooleanOption("withoutEnlargement",$.withoutEnlargement);if(V.defined($.withoutReduction))this._setBooleanOption("withoutReduction",$.withoutReduction);if(V.defined($.fastShrinkOnLoad))this._setBooleanOption("fastShrinkOnLoad",$.fastShrinkOnLoad)}if(l2(this.options)&&j2(this.options))this.options.rotateBeforePreExtract=!0;return this},V3=function(q){if(V.integer(q)&&q>0)this.options.extendTop=q,this.options.extendBottom=q,this.options.extendLeft=q,this.options.extendRight=q;else if(V.object(q)){if(V.defined(q.top))if(V.integer(q.top)&&q.top>=0)this.options.extendTop=q.top;else throw V.invalidParameterError("top","positive integer",q.top);if(V.defined(q.bottom))if(V.integer(q.bottom)&&q.bottom>=0)this.options.extendBottom=q.bottom;else throw V.invalidParameterError("bottom","positive integer",q.bottom);if(V.defined(q.left))if(V.integer(q.left)&&q.left>=0)this.options.extendLeft=q.left;else throw V.invalidParameterError("left","positive integer",q.left);if(V.defined(q.right))if(V.integer(q.right)&&q.right>=0)this.options.extendRight=q.right;else throw V.invalidParameterError("right","positive integer",q.right);if(this._setBackgroundColourOption("extendBackground",q.background),V.defined(q.extendWith))if(V.string(D0[q.extendWith]))this.options.extendWith=D0[q.extendWith];else throw V.invalidParameterError("extendWith","one of: background, copy, repeat, mirror",q.extendWith)}else throw V.invalidParameterError("extend","integer or object",q);return this},A3=function(q){const J=j2(this.options)||this.options.widthPre!==-1?"Post":"Pre";if(this.options[`width${J}`]!==-1)this.options.debuglog("ignoring previous extract options");if(["left","top","width","height"].forEach(function($){const W=q[$];if(V.integer(W)&&W>=0)this.options[$+($==="left"||$==="top"?"Offset":"")+J]=W;else throw V.invalidParameterError($,"integer",W)},this),l2(this.options)&&!j2(this.options)){if(this.options.widthPre===-1||this.options.widthPost===-1)this.options.rotateBeforePreExtract=!0}return this},P3=function(q){if(this.options.trimThreshold=10,V.defined(q))if(V.object(q)){if(V.defined(q.background))this._setBackgroundColourOption("trimBackground",q.background);if(V.defined(q.threshold))if(V.number(q.threshold)&&q.threshold>=0)this.options.trimThreshold=q.threshold;else throw V.invalidParameterError("threshold","positive number",q.threshold);if(V.defined(q.lineArt))this._setBooleanOption("trimLineArt",q.lineArt)}else throw V.invalidParameterError("trim","object",q);if(l2(this.options))this.options.rotateBeforePreExtract=!0;return this},V=d(),E0={center:0,centre:0,north:1,east:2,south:3,west:4,northeast:5,southeast:6,southwest:7,northwest:8},T0={top:1,right:2,bottom:3,left:4,"right top":5,"right bottom":6,"left bottom":7,"left top":8},D0={background:"background",copy:"copy",repeat:"repeat",mirror:"mirror"},y0={entropy:16,attention:17},u2={nearest:"nearest",linear:"linear",cubic:"cubic",mitchell:"mitchell",lanczos2:"lanczos2",lanczos3:"lanczos3"},F3={contain:"contain",cover:"cover",fill:"fill",inside:"inside",outside:"outside"},N3={contain:"embed",cover:"crop",fill:"ignore_aspect",inside:"max",outside:"min"};w0.exports=function(q){Object.assign(q.prototype,{resize:X3,extend:V3,extract:A3,trim:P3}),q.gravity=E0,q.strategy=y0,q.kernel=u2,q.fit=F3,q.position=T0}});var k0=L((L9,S0)=>{var L3=function(q){if(!Array.isArray(q))throw _.invalidParameterError("images to composite","array",q);return this.options.composite=q.map((J)=>{if(!_.object(J))throw _.invalidParameterError("image to composite","object",J);const $=this._inputOptionsFromObject(J),W={input:this._createInputDescriptor(J.input,$,{allowStream:!1}),blend:"over",tile:!1,left:0,top:0,hasOffset:!1,gravity:0,premultiplied:!1};if(_.defined(J.blend))if(_.string(c2[J.blend]))W.blend=c2[J.blend];else throw _.invalidParameterError("blend","valid blend name",J.blend);if(_.defined(J.tile))if(_.bool(J.tile))W.tile=J.tile;else throw _.invalidParameterError("tile","boolean",J.tile);if(_.defined(J.left))if(_.integer(J.left))W.left=J.left;else throw _.invalidParameterError("left","integer",J.left);if(_.defined(J.top))if(_.integer(J.top))W.top=J.top;else throw _.invalidParameterError("top","integer",J.top);if(_.defined(J.top)!==_.defined(J.left))throw new Error("Expected both left and top to be set");else W.hasOffset=_.integer(J.top)&&_.integer(J.left);if(_.defined(J.gravity))if(_.integer(J.gravity)&&_.inRange(J.gravity,0,8))W.gravity=J.gravity;else if(_.string(J.gravity)&&_.integer(this.constructor.gravity[J.gravity]))W.gravity=this.constructor.gravity[J.gravity];else throw _.invalidParameterError("gravity","valid gravity",J.gravity);if(_.defined(J.premultiplied))if(_.bool(J.premultiplied))W.premultiplied=J.premultiplied;else throw _.invalidParameterError("premultiplied","boolean",J.premultiplied);return W}),this},_=d(),c2={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"};S0.exports=function(q){q.prototype.composite=L3,q.blend=c2}});var x0=L((_9,M0)=>{var R3=function(q,J){if(this.options.useExifOrientation||this.options.angle||this.options.rotationAngle)this.options.debuglog("ignoring previous rotate options");if(!U.defined(q))this.options.useExifOrientation=!0;else if(U.integer(q)&&!(q%90))this.options.angle=q;else if(U.number(q)){if(this.options.rotationAngle=q,U.object(J)&&J.background){const $=_3(J.background);this.options.rotationBackground=[$.red(),$.green(),$.blue(),Math.round($.alpha()*255)]}}else throw U.invalidParameterError("angle","numeric",q);return this},j3=function(q){return this.options.flip=U.bool(q)?q:!0,this},z3=function(q){return this.options.flop=U.bool(q)?q:!0,this},D3=function(q,J){const $=[].concat(...q);if($.length===4&&$.every(U.number))this.options.affineMatrix=$;else throw U.invalidParameterError("matrix","1x4 or 2x2 array",q);if(U.defined(J))if(U.object(J)){if(this._setBackgroundColourOption("affineBackground",J.background),U.defined(J.idx))if(U.number(J.idx))this.options.affineIdx=J.idx;else throw U.invalidParameterError("options.idx","number",J.idx);if(U.defined(J.idy))if(U.number(J.idy))this.options.affineIdy=J.idy;else throw U.invalidParameterError("options.idy","number",J.idy);if(U.defined(J.odx))if(U.number(J.odx))this.options.affineOdx=J.odx;else throw U.invalidParameterError("options.odx","number",J.odx);if(U.defined(J.ody))if(U.number(J.ody))this.options.affineOdy=J.ody;else throw U.invalidParameterError("options.ody","number",J.ody);if(U.defined(J.interpolator))if(U.inArray(J.interpolator,Object.values(this.constructor.interpolators)))this.options.affineInterpolator=J.interpolator;else throw U.invalidParameterError("options.interpolator","valid interpolator name",J.interpolator)}else throw U.invalidParameterError("options","object",J);return this},E3=function(q,J,$){if(!U.defined(q))this.options.sharpenSigma=-1;else if(U.bool(q))this.options.sharpenSigma=q?-1:0;else if(U.number(q)&&U.inRange(q,0.01,1e4)){if(this.options.sharpenSigma=q,U.defined(J))if(U.number(J)&&U.inRange(J,0,1e4))this.options.sharpenM1=J;else throw U.invalidParameterError("flat","number between 0 and 10000",J);if(U.defined($))if(U.number($)&&U.inRange($,0,1e4))this.options.sharpenM2=$;else throw U.invalidParameterError("jagged","number between 0 and 10000",$)}else if(U.plainObject(q)){if(U.number(q.sigma)&&U.inRange(q.sigma,0.000001,10))this.options.sharpenSigma=q.sigma;else throw U.invalidParameterError("options.sigma","number between 0.000001 and 10",q.sigma);if(U.defined(q.m1))if(U.number(q.m1)&&U.inRange(q.m1,0,1e6))this.options.sharpenM1=q.m1;else throw U.invalidParameterError("options.m1","number between 0 and 1000000",q.m1);if(U.defined(q.m2))if(U.number(q.m2)&&U.inRange(q.m2,0,1e6))this.options.sharpenM2=q.m2;else throw U.invalidParameterError("options.m2","number between 0 and 1000000",q.m2);if(U.defined(q.x1))if(U.number(q.x1)&&U.inRange(q.x1,0,1e6))this.options.sharpenX1=q.x1;else throw U.invalidParameterError("options.x1","number between 0 and 1000000",q.x1);if(U.defined(q.y2))if(U.number(q.y2)&&U.inRange(q.y2,0,1e6))this.options.sharpenY2=q.y2;else throw U.invalidParameterError("options.y2","number between 0 and 1000000",q.y2);if(U.defined(q.y3))if(U.number(q.y3)&&U.inRange(q.y3,0,1e6))this.options.sharpenY3=q.y3;else throw U.invalidParameterError("options.y3","number between 0 and 1000000",q.y3)}else throw U.invalidParameterError("sigma","number between 0.01 and 10000",q);return this},T3=function(q){if(!U.defined(q))this.options.medianSize=3;else if(U.integer(q)&&U.inRange(q,1,1000))this.options.medianSize=q;else throw U.invalidParameterError("size","integer between 1 and 1000",q);return this},y3=function(q){if(!U.defined(q))this.options.blurSigma=-1;else if(U.bool(q))this.options.blurSigma=q?-1:0;else if(U.number(q)&&U.inRange(q,0.3,1000))this.options.blurSigma=q;else throw U.invalidParameterError("sigma","number between 0.3 and 1000",q);return this},w3=function(q){if(this.options.flatten=U.bool(q)?q:!0,U.object(q))this._setBackgroundColourOption("flattenBackground",q.background);return this},C3=function(){return this.options.unflatten=!0,this},S3=function(q,J){if(!U.defined(q))this.options.gamma=2.2;else if(U.number(q)&&U.inRange(q,1,3))this.options.gamma=q;else throw U.invalidParameterError("gamma","number between 1.0 and 3.0",q);if(!U.defined(J))this.options.gammaOut=this.options.gamma;else if(U.number(J)&&U.inRange(J,1,3))this.options.gammaOut=J;else throw U.invalidParameterError("gammaOut","number between 1.0 and 3.0",J);return this},k3=function(q){if(this.options.negate=U.bool(q)?q:!0,U.plainObject(q)&&"alpha"in q)if(!U.bool(q.alpha))throw U.invalidParameterError("alpha","should be boolean value",q.alpha);else this.options.negateAlpha=q.alpha;return this},M3=function(q){if(U.plainObject(q)){if(U.defined(q.lower))if(U.number(q.lower)&&U.inRange(q.lower,0,99))this.options.normaliseLower=q.lower;else throw U.invalidParameterError("lower","number between 0 and 99",q.lower);if(U.defined(q.upper))if(U.number(q.upper)&&U.inRange(q.upper,1,100))this.options.normaliseUpper=q.upper;else throw U.invalidParameterError("upper","number between 1 and 100",q.upper)}if(this.options.normaliseLower>=this.options.normaliseUpper)throw U.invalidParameterError("range","lower to be less than upper",`${this.options.normaliseLower} >= ${this.options.normaliseUpper}`);return this.options.normalise=!0,this},x3=function(q){return this.normalise(q)},f3=function(q){if(U.plainObject(q)){if(U.integer(q.width)&&q.width>0)this.options.claheWidth=q.width;else throw U.invalidParameterError("width","integer greater than zero",q.width);if(U.integer(q.height)&&q.height>0)this.options.claheHeight=q.height;else throw U.invalidParameterError("height","integer greater than zero",q.height);if(U.defined(q.maxSlope))if(U.integer(q.maxSlope)&&U.inRange(q.maxSlope,0,100))this.options.claheMaxSlope=q.maxSlope;else throw U.invalidParameterError("maxSlope","integer between 0 and 100",q.maxSlope)}else throw U.invalidParameterError("options","plain object",q);return this},d3=function(q){if(!U.object(q)||!Array.isArray(q.kernel)||!U.integer(q.width)||!U.integer(q.height)||!U.inRange(q.width,3,1001)||!U.inRange(q.height,3,1001)||q.height*q.width!==q.kernel.length)throw new Error("Invalid convolution kernel");if(!U.integer(q.scale))q.scale=q.kernel.reduce(function(J,$){return J+$},0);if(q.scale<1)q.scale=1;if(!U.integer(q.offset))q.offset=0;return this.options.convKernel=q,this},v3=function(q,J){if(!U.defined(q))this.options.threshold=128;else if(U.bool(q))this.options.threshold=q?128:0;else if(U.integer(q)&&U.inRange(q,0,255))this.options.threshold=q;else throw U.invalidParameterError("threshold","integer between 0 and 255",q);if(!U.object(J)||J.greyscale===!0||J.grayscale===!0)this.options.thresholdGrayscale=!0;else this.options.thresholdGrayscale=!1;return this},O3=function(q,J,$){if(this.options.boolean=this._createInputDescriptor(q,$),U.string(J)&&U.inArray(J,["and","or","eor"]))this.options.booleanOp=J;else throw U.invalidParameterError("operator","one of: and, or, eor",J);return this},b3=function(q,J){if(!U.defined(q)&&U.number(J))q=1;else if(U.number(q)&&!U.defined(J))J=0;if(!U.defined(q))this.options.linearA=[];else if(U.number(q))this.options.linearA=[q];else if(Array.isArray(q)&&q.length&&q.every(U.number))this.options.linearA=q;else throw U.invalidParameterError("a","number or array of numbers",q);if(!U.defined(J))this.options.linearB=[];else if(U.number(J))this.options.linearB=[J];else if(Array.isArray(J)&&J.length&&J.every(U.number))this.options.linearB=J;else throw U.invalidParameterError("b","number or array of numbers",J);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},h3=function(q){if(!Array.isArray(q)||q.length!==3||q[0].length!==3||q[1].length!==3||q[2].length!==3)throw new Error("Invalid recombination matrix");return this.options.recombMatrix=[q[0][0],q[0][1],q[0][2],q[1][0],q[1][1],q[1][2],q[2][0],q[2][1],q[2][2]].map(Number),this},g3=function(q){if(!U.plainObject(q))throw U.invalidParameterError("options","plain object",q);if("brightness"in q)if(U.number(q.brightness)&&q.brightness>=0)this.options.brightness=q.brightness;else throw U.invalidParameterError("brightness","number above zero",q.brightness);if("saturation"in q)if(U.number(q.saturation)&&q.saturation>=0)this.options.saturation=q.saturation;else throw U.invalidParameterError("saturation","number above zero",q.saturation);if("hue"in q)if(U.integer(q.hue))this.options.hue=q.hue%360;else throw U.invalidParameterError("hue","number",q.hue);if("lightness"in q)if(U.number(q.lightness))this.options.lightness=q.lightness;else throw U.invalidParameterError("lightness","number",q.lightness);return this},_3=R2(),U=d();M0.exports=function(q){Object.assign(q.prototype,{rotate:R3,flip:j3,flop:z3,affine:D3,sharpen:E3,median:T3,blur:y3,flatten:w3,unflatten:C3,gamma:S3,negate:k3,normalise:M3,normalize:x3,clahe:f3,convolve:d3,threshold:v3,boolean:O3,linear:b3,recomb:h3,modulate:g3})}});var v0=L((R9,d0)=>{var u3=function(q){return this._setBackgroundColourOption("tint",q),this},l3=function(q){return this.options.greyscale=b.bool(q)?q:!0,this},c3=function(q){return this.greyscale(q)},a3=function(q){if(!b.string(q))throw b.invalidParameterError("colourspace","string",q);return this.options.colourspacePipeline=q,this},r3=function(q){return this.pipelineColourspace(q)},e3=function(q){if(!b.string(q))throw b.invalidParameterError("colourspace","string",q);return this.options.colourspace=q,this},p3=function(q){return this.toColourspace(q)},n3=function(q,J){if(b.defined(J))if(b.object(J)||b.string(J)){const $=m3(J);this.options[q]=[$.red(),$.green(),$.blue(),Math.round($.alpha()*255)]}else throw b.invalidParameterError("background","object or string",J)},m3=R2(),b=d(),f0={multiband:"multiband","b-w":"b-w",bw:"b-w",cmyk:"cmyk",srgb:"srgb"};d0.exports=function(q){Object.assign(q.prototype,{tint:u3,greyscale:l3,grayscale:c3,pipelineColourspace:a3,pipelineColorspace:r3,toColourspace:e3,toColorspace:p3,_setBackgroundColourOption:n3}),q.colourspace=f0,q.colorspace=f0}});var b0=L((j9,O0)=>{var t3=function(){return this.options.removeAlpha=!0,this},i3=function(q){if(v.defined(q))if(v.number(q)&&v.inRange(q,0,1))this.options.ensureAlpha=q;else throw v.invalidParameterError("alpha","number between 0 and 1",q);else this.options.ensureAlpha=1;return this},o3=function(q){const J={red:0,green:1,blue:2,alpha:3};if(Object.keys(J).includes(q))q=J[q];if(v.integer(q)&&v.inRange(q,0,4))this.options.extractChannel=q;else throw v.invalidParameterError("channel","integer or one of: red, green, blue, alpha",q);return this},q8=function(q,J){if(Array.isArray(q))q.forEach(function($){this.options.joinChannelIn.push(this._createInputDescriptor($,J))},this);else this.options.joinChannelIn.push(this._createInputDescriptor(q,J));return this},J8=function(q){if(v.string(q)&&v.inArray(q,["and","or","eor"]))this.options.bandBoolOp=q;else throw v.invalidParameterError("boolOp","one of: and, or, eor",q);return this},v=d(),s3={and:"and",or:"or",eor:"eor"};O0.exports=function(q){Object.assign(q.prototype,{removeAlpha:t3,ensureAlpha:i3,extractChannel:o3,joinChannel:q8,bandbool:J8}),q.bool=s3}});var c0=L((z9,l0)=>{var W8=function(q,J){let $;if(!Q.string(q))$=new Error("Missing output file path");else if(Q.string(this.options.input.file)&&a2.resolve(this.options.input.file)===a2.resolve(q))$=new Error("Cannot use same file for input and output");else if($8.test(a2.extname(q))&&!this.constructor.format.jp2k.output.file)$=g0();if($)if(Q.fn(J))J($);else return Promise.reject($);else{this.options.fileOut=q;const W=Error();return this._pipeline(J,W)}return this},Z8=function(q,J){if(Q.object(q))this._setBooleanOption("resolveWithObject",q.resolveWithObject);else if(this.options.resolveWithObject)this.options.resolveWithObject=!1;this.options.fileOut="";const $=Error();return this._pipeline(Q.fn(q)?q:J,$)},Q8=function(){return this.options.keepMetadata|=1,this},Y8=function(q){if(Q.object(q))for(let[J,$]of Object.entries(q))if(Q.object($))for(let[W,Z]of Object.entries($))if(Q.string(Z))this.options.withExif[`exif-${J.toLowerCase()}-${W}`]=Z;else throw Q.invalidParameterError(`${J}.${W}`,"string",Z);else throw Q.invalidParameterError(J,"object",$);else throw Q.invalidParameterError("exif","object",q);return this.options.withExifMerge=!1,this.keepExif()},K8=function(q){return this.withExif(q),this.options.withExifMerge=!0,this},U8=function(){return this.options.keepMetadata|=8,this},B8=function(q,J){if(Q.string(q))this.options.withIccProfile=q;else throw Q.invalidParameterError("icc","string",q);if(this.keepIccProfile(),Q.object(J)){if(Q.defined(J.attach))if(Q.bool(J.attach)){if(!J.attach)this.options.keepMetadata&=~8}else throw Q.invalidParameterError("attach","boolean",J.attach)}return this},G8=function(){return this.options.keepMetadata=31,this},H8=function(q){if(this.keepMetadata(),this.withIccProfile("srgb"),Q.object(q)){if(Q.defined(q.orientation))if(Q.integer(q.orientation)&&Q.inRange(q.orientation,1,8))this.options.withMetadataOrientation=q.orientation;else throw Q.invalidParameterError("orientation","integer between 1 and 8",q.orientation);if(Q.defined(q.density))if(Q.number(q.density)&&q.density>0)this.options.withMetadataDensity=q.density;else throw Q.invalidParameterError("density","positive number",q.density);if(Q.defined(q.icc))this.withIccProfile(q.icc);if(Q.defined(q.exif))this.withExifMerge(q.exif)}return this},I8=function(q,J){const $=h0.get((Q.object(q)&&Q.string(q.id)?q.id:q).toLowerCase());if(!$)throw Q.invalidParameterError("format",`one of: ${[...h0.keys()].join(", ")}`,q);return this[$](J)},F8=function(q){if(Q.object(q)){if(Q.defined(q.quality))if(Q.integer(q.quality)&&Q.inRange(q.quality,1,100))this.options.jpegQuality=q.quality;else throw Q.invalidParameterError("quality","integer between 1 and 100",q.quality);if(Q.defined(q.progressive))this._setBooleanOption("jpegProgressive",q.progressive);if(Q.defined(q.chromaSubsampling))if(Q.string(q.chromaSubsampling)&&Q.inArray(q.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jpegChromaSubsampling=q.chromaSubsampling;else throw Q.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",q.chromaSubsampling);const J=Q.bool(q.optimizeCoding)?q.optimizeCoding:q.optimiseCoding;if(Q.defined(J))this._setBooleanOption("jpegOptimiseCoding",J);if(Q.defined(q.mozjpeg))if(Q.bool(q.mozjpeg)){if(q.mozjpeg)this.options.jpegTrellisQuantisation=!0,this.options.jpegOvershootDeringing=!0,this.options.jpegOptimiseScans=!0,this.options.jpegProgressive=!0,this.options.jpegQuantisationTable=3}else throw Q.invalidParameterError("mozjpeg","boolean",q.mozjpeg);const $=Q.bool(q.trellisQuantization)?q.trellisQuantization:q.trellisQuantisation;if(Q.defined($))this._setBooleanOption("jpegTrellisQuantisation",$);if(Q.defined(q.overshootDeringing))this._setBooleanOption("jpegOvershootDeringing",q.overshootDeringing);const W=Q.bool(q.optimizeScans)?q.optimizeScans:q.optimiseScans;if(Q.defined(W)){if(this._setBooleanOption("jpegOptimiseScans",W),W)this.options.jpegProgressive=!0}const Z=Q.number(q.quantizationTable)?q.quantizationTable:q.quantisationTable;if(Q.defined(Z))if(Q.integer(Z)&&Q.inRange(Z,0,8))this.options.jpegQuantisationTable=Z;else throw Q.invalidParameterError("quantisationTable","integer between 0 and 8",Z)}return this._updateFormatOut("jpeg",q)},N8=function(q){if(Q.object(q)){if(Q.defined(q.progressive))this._setBooleanOption("pngProgressive",q.progressive);if(Q.defined(q.compressionLevel))if(Q.integer(q.compressionLevel)&&Q.inRange(q.compressionLevel,0,9))this.options.pngCompressionLevel=q.compressionLevel;else throw Q.invalidParameterError("compressionLevel","integer between 0 and 9",q.compressionLevel);if(Q.defined(q.adaptiveFiltering))this._setBooleanOption("pngAdaptiveFiltering",q.adaptiveFiltering);const J=q.colours||q.colors;if(Q.defined(J))if(Q.integer(J)&&Q.inRange(J,2,256))this.options.pngBitdepth=m0(J);else throw Q.invalidParameterError("colours","integer between 2 and 256",J);if(Q.defined(q.palette))this._setBooleanOption("pngPalette",q.palette);else if([q.quality,q.effort,q.colours,q.colors,q.dither].some(Q.defined))this._setBooleanOption("pngPalette",!0);if(this.options.pngPalette){if(Q.defined(q.quality))if(Q.integer(q.quality)&&Q.inRange(q.quality,0,100))this.options.pngQuality=q.quality;else throw Q.invalidParameterError("quality","integer between 0 and 100",q.quality);if(Q.defined(q.effort))if(Q.integer(q.effort)&&Q.inRange(q.effort,1,10))this.options.pngEffort=q.effort;else throw Q.invalidParameterError("effort","integer between 1 and 10",q.effort);if(Q.defined(q.dither))if(Q.number(q.dither)&&Q.inRange(q.dither,0,1))this.options.pngDither=q.dither;else throw Q.invalidParameterError("dither","number between 0.0 and 1.0",q.dither)}}return this._updateFormatOut("png",q)},X8=function(q){if(Q.object(q)){if(Q.defined(q.quality))if(Q.integer(q.quality)&&Q.inRange(q.quality,1,100))this.options.webpQuality=q.quality;else throw Q.invalidParameterError("quality","integer between 1 and 100",q.quality);if(Q.defined(q.alphaQuality))if(Q.integer(q.alphaQuality)&&Q.inRange(q.alphaQuality,0,100))this.options.webpAlphaQuality=q.alphaQuality;else throw Q.invalidParameterError("alphaQuality","integer between 0 and 100",q.alphaQuality);if(Q.defined(q.lossless))this._setBooleanOption("webpLossless",q.lossless);if(Q.defined(q.nearLossless))this._setBooleanOption("webpNearLossless",q.nearLossless);if(Q.defined(q.smartSubsample))this._setBooleanOption("webpSmartSubsample",q.smartSubsample);if(Q.defined(q.preset))if(Q.string(q.preset)&&Q.inArray(q.preset,["default","photo","picture","drawing","icon","text"]))this.options.webpPreset=q.preset;else throw Q.invalidParameterError("preset","one of: default, photo, picture, drawing, icon, text",q.preset);if(Q.defined(q.effort))if(Q.integer(q.effort)&&Q.inRange(q.effort,0,6))this.options.webpEffort=q.effort;else throw Q.invalidParameterError("effort","integer between 0 and 6",q.effort);if(Q.defined(q.minSize))this._setBooleanOption("webpMinSize",q.minSize);if(Q.defined(q.mixed))this._setBooleanOption("webpMixed",q.mixed)}return u0(q,this.options),this._updateFormatOut("webp",q)},V8=function(q){if(Q.object(q)){if(Q.defined(q.reuse))this._setBooleanOption("gifReuse",q.reuse);if(Q.defined(q.progressive))this._setBooleanOption("gifProgressive",q.progressive);const J=q.colours||q.colors;if(Q.defined(J))if(Q.integer(J)&&Q.inRange(J,2,256))this.options.gifBitdepth=m0(J);else throw Q.invalidParameterError("colours","integer between 2 and 256",J);if(Q.defined(q.effort))if(Q.number(q.effort)&&Q.inRange(q.effort,1,10))this.options.gifEffort=q.effort;else throw Q.invalidParameterError("effort","integer between 1 and 10",q.effort);if(Q.defined(q.dither))if(Q.number(q.dither)&&Q.inRange(q.dither,0,1))this.options.gifDither=q.dither;else throw Q.invalidParameterError("dither","number between 0.0 and 1.0",q.dither);if(Q.defined(q.interFrameMaxError))if(Q.number(q.interFrameMaxError)&&Q.inRange(q.interFrameMaxError,0,32))this.options.gifInterFrameMaxError=q.interFrameMaxError;else throw Q.invalidParameterError("interFrameMaxError","number between 0.0 and 32.0",q.interFrameMaxError);if(Q.defined(q.interPaletteMaxError))if(Q.number(q.interPaletteMaxError)&&Q.inRange(q.interPaletteMaxError,0,256))this.options.gifInterPaletteMaxError=q.interPaletteMaxError;else throw Q.invalidParameterError("interPaletteMaxError","number between 0.0 and 256.0",q.interPaletteMaxError)}return u0(q,this.options),this._updateFormatOut("gif",q)},A8=function(q){if(!this.constructor.format.jp2k.output.buffer)throw g0();if(Q.object(q)){if(Q.defined(q.quality))if(Q.integer(q.quality)&&Q.inRange(q.quality,1,100))this.options.jp2Quality=q.quality;else throw Q.invalidParameterError("quality","integer between 1 and 100",q.quality);if(Q.defined(q.lossless))if(Q.bool(q.lossless))this.options.jp2Lossless=q.lossless;else throw Q.invalidParameterError("lossless","boolean",q.lossless);if(Q.defined(q.tileWidth))if(Q.integer(q.tileWidth)&&Q.inRange(q.tileWidth,1,32768))this.options.jp2TileWidth=q.tileWidth;else throw Q.invalidParameterError("tileWidth","integer between 1 and 32768",q.tileWidth);if(Q.defined(q.tileHeight))if(Q.integer(q.tileHeight)&&Q.inRange(q.tileHeight,1,32768))this.options.jp2TileHeight=q.tileHeight;else throw Q.invalidParameterError("tileHeight","integer between 1 and 32768",q.tileHeight);if(Q.defined(q.chromaSubsampling))if(Q.string(q.chromaSubsampling)&&Q.inArray(q.chromaSubsampling,["4:2:0","4:4:4"]))this.options.jp2ChromaSubsampling=q.chromaSubsampling;else throw Q.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",q.chromaSubsampling)}return this._updateFormatOut("jp2",q)},u0=function(q,J){if(Q.object(q)&&Q.defined(q.loop))if(Q.integer(q.loop)&&Q.inRange(q.loop,0,65535))J.loop=q.loop;else throw Q.invalidParameterError("loop","integer between 0 and 65535",q.loop);if(Q.object(q)&&Q.defined(q.delay))if(Q.integer(q.delay)&&Q.inRange(q.delay,0,65535))J.delay=[q.delay];else if(Array.isArray(q.delay)&&q.delay.every(Q.integer)&&q.delay.every(($)=>Q.inRange($,0,65535)))J.delay=q.delay;else throw Q.invalidParameterError("delay","integer or an array of integers between 0 and 65535",q.delay)},P8=function(q){if(Q.object(q)){if(Q.defined(q.quality))if(Q.integer(q.quality)&&Q.inRange(q.quality,1,100))this.options.tiffQuality=q.quality;else throw Q.invalidParameterError("quality","integer between 1 and 100",q.quality);if(Q.defined(q.bitdepth))if(Q.integer(q.bitdepth)&&Q.inArray(q.bitdepth,[1,2,4,8]))this.options.tiffBitdepth=q.bitdepth;else throw Q.invalidParameterError("bitdepth","1, 2, 4 or 8",q.bitdepth);if(Q.defined(q.tile))this._setBooleanOption("tiffTile",q.tile);if(Q.defined(q.tileWidth))if(Q.integer(q.tileWidth)&&q.tileWidth>0)this.options.tiffTileWidth=q.tileWidth;else throw Q.invalidParameterError("tileWidth","integer greater than zero",q.tileWidth);if(Q.defined(q.tileHeight))if(Q.integer(q.tileHeight)&&q.tileHeight>0)this.options.tiffTileHeight=q.tileHeight;else throw Q.invalidParameterError("tileHeight","integer greater than zero",q.tileHeight);if(Q.defined(q.miniswhite))this._setBooleanOption("tiffMiniswhite",q.miniswhite);if(Q.defined(q.pyramid))this._setBooleanOption("tiffPyramid",q.pyramid);if(Q.defined(q.xres))if(Q.number(q.xres)&&q.xres>0)this.options.tiffXres=q.xres;else throw Q.invalidParameterError("xres","number greater than zero",q.xres);if(Q.defined(q.yres))if(Q.number(q.yres)&&q.yres>0)this.options.tiffYres=q.yres;else throw Q.invalidParameterError("yres","number greater than zero",q.yres);if(Q.defined(q.compression))if(Q.string(q.compression)&&Q.inArray(q.compression,["none","jpeg","deflate","packbits","ccittfax4","lzw","webp","zstd","jp2k"]))this.options.tiffCompression=q.compression;else throw Q.invalidParameterError("compression","one of: none, jpeg, deflate, packbits, ccittfax4, lzw, webp, zstd, jp2k",q.compression);if(Q.defined(q.predictor))if(Q.string(q.predictor)&&Q.inArray(q.predictor,["none","horizontal","float"]))this.options.tiffPredictor=q.predictor;else throw Q.invalidParameterError("predictor","one of: none, horizontal, float",q.predictor);if(Q.defined(q.resolutionUnit))if(Q.string(q.resolutionUnit)&&Q.inArray(q.resolutionUnit,["inch","cm"]))this.options.tiffResolutionUnit=q.resolutionUnit;else throw Q.invalidParameterError("resolutionUnit","one of: inch, cm",q.resolutionUnit)}return this._updateFormatOut("tiff",q)},L8=function(q){return this.heif({...q,compression:"av1"})},_8=function(q){if(Q.object(q)){if(Q.string(q.compression)&&Q.inArray(q.compression,["av1","hevc"]))this.options.heifCompression=q.compression;else throw Q.invalidParameterError("compression","one of: av1, hevc",q.compression);if(Q.defined(q.quality))if(Q.integer(q.quality)&&Q.inRange(q.quality,1,100))this.options.heifQuality=q.quality;else throw Q.invalidParameterError("quality","integer between 1 and 100",q.quality);if(Q.defined(q.lossless))if(Q.bool(q.lossless))this.options.heifLossless=q.lossless;else throw Q.invalidParameterError("lossless","boolean",q.lossless);if(Q.defined(q.effort))if(Q.integer(q.effort)&&Q.inRange(q.effort,0,9))this.options.heifEffort=q.effort;else throw Q.invalidParameterError("effort","integer between 0 and 9",q.effort);if(Q.defined(q.chromaSubsampling))if(Q.string(q.chromaSubsampling)&&Q.inArray(q.chromaSubsampling,["4:2:0","4:4:4"]))this.options.heifChromaSubsampling=q.chromaSubsampling;else throw Q.invalidParameterError("chromaSubsampling","one of: 4:2:0, 4:4:4",q.chromaSubsampling);if(Q.defined(q.bitdepth))if(Q.integer(q.bitdepth)&&Q.inArray(q.bitdepth,[8,10,12])){if(q.bitdepth!==8&&this.constructor.versions.heif)throw Q.invalidParameterError("bitdepth when using prebuilt binaries",8,q.bitdepth);this.options.heifBitdepth=q.bitdepth}else throw Q.invalidParameterError("bitdepth","8, 10 or 12",q.bitdepth)}else throw Q.invalidParameterError("options","Object",q);return this._updateFormatOut("heif",q)},R8=function(q){if(Q.object(q)){if(Q.defined(q.quality))if(Q.integer(q.quality)&&Q.inRange(q.quality,1,100))this.options.jxlDistance=q.quality>=30?0.1+(100-q.quality)*0.09:0.017666666666666667*q.quality*q.quality-1.15*q.quality+25;else throw Q.invalidParameterError("quality","integer between 1 and 100",q.quality);else if(Q.defined(q.distance))if(Q.number(q.distance)&&Q.inRange(q.distance,0,15))this.options.jxlDistance=q.distance;else throw Q.invalidParameterError("distance","number between 0.0 and 15.0",q.distance);if(Q.defined(q.decodingTier))if(Q.integer(q.decodingTier)&&Q.inRange(q.decodingTier,0,4))this.options.jxlDecodingTier=q.decodingTier;else throw Q.invalidParameterError("decodingTier","integer between 0 and 4",q.decodingTier);if(Q.defined(q.lossless))if(Q.bool(q.lossless))this.options.jxlLossless=q.lossless;else throw Q.invalidParameterError("lossless","boolean",q.lossless);if(Q.defined(q.effort))if(Q.integer(q.effort)&&Q.inRange(q.effort,3,9))this.options.jxlEffort=q.effort;else throw Q.invalidParameterError("effort","integer between 3 and 9",q.effort)}return this._updateFormatOut("jxl",q)},j8=function(q){if(Q.object(q)){if(Q.defined(q.depth))if(Q.string(q.depth)&&Q.inArray(q.depth,["char","uchar","short","ushort","int","uint","float","complex","double","dpcomplex"]))this.options.rawDepth=q.depth;else throw Q.invalidParameterError("depth","one of: char, uchar, short, ushort, int, uint, float, complex, double, dpcomplex",q.depth)}return this._updateFormatOut("raw")},z8=function(q){if(Q.object(q)){if(Q.defined(q.size))if(Q.integer(q.size)&&Q.inRange(q.size,1,8192))this.options.tileSize=q.size;else throw Q.invalidParameterError("size","integer between 1 and 8192",q.size);if(Q.defined(q.overlap))if(Q.integer(q.overlap)&&Q.inRange(q.overlap,0,8192)){if(q.overlap>this.options.tileSize)throw Q.invalidParameterError("overlap",`<= size (${this.options.tileSize})`,q.overlap);this.options.tileOverlap=q.overlap}else throw Q.invalidParameterError("overlap","integer between 0 and 8192",q.overlap);if(Q.defined(q.container))if(Q.string(q.container)&&Q.inArray(q.container,["fs","zip"]))this.options.tileContainer=q.container;else throw Q.invalidParameterError("container","one of: fs, zip",q.container);if(Q.defined(q.layout))if(Q.string(q.layout)&&Q.inArray(q.layout,["dz","google","iiif","iiif3","zoomify"]))this.options.tileLayout=q.layout;else throw Q.invalidParameterError("layout","one of: dz, google, iiif, iiif3, zoomify",q.layout);if(Q.defined(q.angle))if(Q.integer(q.angle)&&!(q.angle%90))this.options.tileAngle=q.angle;else throw Q.invalidParameterError("angle","positive/negative multiple of 90",q.angle);if(this._setBackgroundColourOption("tileBackground",q.background),Q.defined(q.depth))if(Q.string(q.depth)&&Q.inArray(q.depth,["onepixel","onetile","one"]))this.options.tileDepth=q.depth;else throw Q.invalidParameterError("depth","one of: onepixel, onetile, one",q.depth);if(Q.defined(q.skipBlanks))if(Q.integer(q.skipBlanks)&&Q.inRange(q.skipBlanks,-1,65535))this.options.tileSkipBlanks=q.skipBlanks;else throw Q.invalidParameterError("skipBlanks","integer between -1 and 255/65535",q.skipBlanks);else if(Q.defined(q.layout)&&q.layout==="google")this.options.tileSkipBlanks=5;const J=Q.bool(q.center)?q.center:q.centre;if(Q.defined(J))this._setBooleanOption("tileCentre",J);if(Q.defined(q.id))if(Q.string(q.id))this.options.tileId=q.id;else throw Q.invalidParameterError("id","string",q.id);if(Q.defined(q.basename))if(Q.string(q.basename))this.options.tileBasename=q.basename;else throw Q.invalidParameterError("basename","string",q.basename)}if(Q.inArray(this.options.formatOut,["jpeg","png","webp"]))this.options.tileFormat=this.options.formatOut;else if(this.options.formatOut!=="input")throw Q.invalidParameterError("format","one of: jpeg, png, webp",this.options.formatOut);return this._updateFormatOut("dz")},D8=function(q){if(!Q.plainObject(q))throw Q.invalidParameterError("options","object",q);if(Q.integer(q.seconds)&&Q.inRange(q.seconds,0,3600))this.options.timeoutSeconds=q.seconds;else throw Q.invalidParameterError("seconds","integer between 0 and 3600",q.seconds);return this},E8=function(q,J){if(!(Q.object(J)&&J.force===!1))this.options.formatOut=q;return this},T8=function(q,J){if(Q.bool(J))this.options[q]=J;else throw Q.invalidParameterError(q,"boolean",J)},y8=function(){if(!this.options.streamOut){this.options.streamOut=!0;const q=Error();this._pipeline(void 0,q)}},w8=function(q,J){if(typeof q==="function"){if(this._isStreamInput())this.on("finish",()=>{this._flattenBufferIn(),s.pipeline(this.options,($,W,Z)=>{if($)q(Q.nativeError($,J));else q(null,W,Z)})});else s.pipeline(this.options,($,W,Z)=>{if($)q(Q.nativeError($,J));else q(null,W,Z)});return this}else if(this.options.streamOut){if(this._isStreamInput()){if(this.once("finish",()=>{this._flattenBufferIn(),s.pipeline(this.options,($,W,Z)=>{if($)this.emit("error",Q.nativeError($,J));else this.emit("info",Z),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))})}),this.streamInFinished)this.emit("finish")}else s.pipeline(this.options,($,W,Z)=>{if($)this.emit("error",Q.nativeError($,J));else this.emit("info",Z),this.push(W);this.push(null),this.on("end",()=>this.emit("close"))});return this}else if(this._isStreamInput())return new Promise(($,W)=>{this.once("finish",()=>{this._flattenBufferIn(),s.pipeline(this.options,(Z,Y,K)=>{if(Z)W(Q.nativeError(Z,J));else if(this.options.resolveWithObject)$({data:Y,info:K});else $(Y)})})});else return new Promise(($,W)=>{s.pipeline(this.options,(Z,Y,K)=>{if(Z)W(Q.nativeError(Z,J));else if(this.options.resolveWithObject)$({data:Y,info:K});else $(Y)})})},a2=import.meta.require("path"),Q=d(),s=J2(),h0=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"]]),$8=/\.(jp[2x]|j2[kc])$/i,g0=()=>new Error("JP2 output requires libvips with support for OpenJPEG"),m0=(q)=>1<<31-Math.clz32(Math.ceil(Math.log2(q)));l0.exports=function(q){Object.assign(q.prototype,{toFile:W8,toBuffer:Z8,keepExif:Q8,withExif:Y8,withExifMerge:K8,keepIccProfile:U8,withIccProfile:B8,keepMetadata:G8,withMetadata:H8,toFormat:I8,jpeg:F8,jp2:A8,png:N8,webp:X8,tiff:P8,avif:L8,heif:_8,jxl:R8,gif:V8,raw:j8,tile:z8,timeout:D8,_updateFormatOut:E8,_setBooleanOption:T8,_read:y8,_pipeline:w8})}});var p0=L((D9,e0)=>{var r0=function(q){if(M.bool(q))if(q)return w.cache(50,20,100);else return w.cache(0,0,0);else if(M.object(q))return w.cache(q.memory,q.files,q.items);else return w.cache()},M8=function(q){return w.concurrency(M.integer(q)?q:null)},f8=function(){return w.counters()},d8=function(q){return w.simd(M.bool(q)?q:null)},v8=function(q){if(M.object(q))if(Array.isArray(q.operation)&&q.operation.every(M.string))w.block(q.operation,!0);else throw M.invalidParameterError("operation","Array<string>",q.operation);else throw M.invalidParameterError("options","object",q)},O8=function(q){if(M.object(q))if(Array.isArray(q.operation)&&q.operation.every(M.string))w.block(q.operation,!1);else throw M.invalidParameterError("operation","Array<string>",q.operation);else throw M.invalidParameterError("options","object",q)},C8=import.meta.require("events"),z2=import.meta.require("detect-libc"),M=d(),{runtimePlatformArch:S8}=f2(),w=J2(),a0=S8(),r2=w.libvipsVersion(),Y2=w.format();Y2.heif.output.alias=["avif","heic"];Y2.jpeg.output.alias=["jpe","jpg"];Y2.tiff.output.alias=["tif"];Y2.jp2k.output.alias=["j2c","j2k","jp2","jpx"];var k8={nearest:"nearest",bilinear:"bilinear",bicubic:"bicubic",locallyBoundedBicubic:"lbb",nohalo:"nohalo",vertexSplitQuadraticBasisSpline:"vsqbs"},Q2={vips:r2.semver};if(!r2.isGlobal)if(!r2.isWasm)try{Q2=import.meta.require(`@img/sharp-${a0}/versions`)}catch(q){try{Q2=import.meta.require(`@img/sharp-libvips-${a0}/versions`)}catch(J){}}else try{Q2=(()=>{throw new Error(`Cannot require module "@img/sharp-wasm32/versions"`);})()}catch(q){}Q2.sharp=k2().version;r0(!0);if(z2.familySync()===z2.GLIBC&&!w._isUsingJemalloc())w.concurrency(1);else if(z2.familySync()===z2.MUSL&&w.concurrency()===1024)w.concurrency(import.meta.require("os").availableParallelism());var x8=new C8.EventEmitter;e0.exports=function(q){q.cache=r0,q.concurrency=M8,q.counters=f8,q.simd=d8,q.format=Y2,q.interpolators=k8,q.versions=Q2,q.queue=x8,q.block=v8,q.unblock=O8}});var b8=L((E9,n0)=>{var h=$0();z0()(h);C0()(h);k0()(h);x0()(h);v0()(h);b0()(h);c0()(h);p0()(h);n0.exports=h});
2
+ export{b8 as pa};