gemi 0.4.66 → 0.4.67

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 @@
1
+ import{y as x} from"./chunk-7ce930fe69575c87.js";import{lb as S} from"./chunk-c7e2acfd5087fb30.js";var q="AWS_PROFILE";var B=(o)=>o.profile||process.env["AWS_PROFILE"]||"default";import{join as b} from"path";import{homedir as N} from"os";import{sep as L} from"path";var d={},w=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},f=()=>{const{HOME:o,USERPROFILE:e,HOMEPATH:t,HOMEDRIVE:r=`C:${L}`}=process.env;if(o)return o;if(e)return e;if(t)return`${r}${t}`;const i=w();if(!d[i])d[i]=N();return d[i]};var v="AWS_CONFIG_FILE",g=()=>process.env[v]||b(f(),".aws","config");var D=x(S(),1);import{join as I} from"path";var h=x(S(),1);var O=(o)=>Object.entries(o).filter(([e])=>{const t=e.indexOf(c);if(t===-1)return!1;return Object.values(h.IniSectionType).includes(e.substring(0,t))}).reduce((e,[t,r])=>{const i=t.indexOf(c),s=t.substring(0,i)===h.IniSectionType.PROFILE?t.substring(i+1):t;return e[s]=r,e},{...o.default&&{default:o.default}});import{join as j} from"path";var y="AWS_SHARED_CREDENTIALS_FILE",_=()=>process.env[y]||j(f(),".aws","credentials");var C=x(S(),1);var $=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,G=["__proto__","profile __proto__"],a=(o)=>{const e={};let t,r;for(let i of o.split(/\r?\n/)){const s=i.split(/(^|\s)[;#]/)[0].trim();if(s[0]==="["&&s[s.length-1]==="]"){t=void 0,r=void 0;const n=s.substring(1,s.length-1),m=$.exec(n);if(m){const[,p,,F]=m;if(Object.values(C.IniSectionType).includes(p))t=[p,F].join(c)}else t=n;if(G.includes(n))throw new Error(`Found invalid profile name "${n}"`)}else if(t){const n=s.indexOf("=");if(![0,-1].includes(n)){const[m,p]=[s.substring(0,n).trim(),s.substring(n+1).trim()];if(p==="")r=m;else{if(r&&i.trimStart()===i)r=void 0;e[t]=e[t]||{};const F=r?[r,m].join(c):m;e[t][F]=p}}}}return e};import{promises as W} from"fs";var{readFile:K}=W,E={},l=(o,e)=>{if(!E[o]||e?.ignoreCache)E[o]=K(o,"utf8");return E[o]};var P=()=>({}),c=".",R=async(o={})=>{const{filepath:e=_(),configFilepath:t=g()}=o,r=f();let s=e;if(e.startsWith("~/"))s=I(r,e.slice(2));let u=t;if(t.startsWith("~/"))u=I(r,t.slice(2));const n=await Promise.all([l(u,{ignoreCache:o.ignoreCache}).then(a).then(O).catch(P),l(s,{ignoreCache:o.ignoreCache}).then(a).catch(P)]);return{configFile:n[0],credentialsFile:n[1]}};var T=(o)=>Object.entries(o).filter(([e])=>e.startsWith(D.IniSectionType.SSO_SESSION+c)).reduce((e,[t,r])=>({...e,[t.substring(t.indexOf(c)+1)]:r}),{});var V=()=>({}),Pe=async(o={})=>l(o.configFilepath??g()).then(a).then(T).catch(V);var A=(...o)=>{const e={};for(let t of o)for(let[r,i]of Object.entries(t))if(e[r]!==void 0)Object.assign(e[r],i);else e[r]=i;return e};var He=async(o)=>{const e=await R(o);return A(e.configFile,e.credentialsFile)};import{createHash as U} from"crypto";import{join as X} from"path";var H=(o)=>{const t=U("sha1").update(o).digest("hex");return X(f(),".aws","sso","cache",`${t}.json`)};import{promises as k} from"fs";var{readFile:M}=k,$e=async(o)=>{const e=H(o),t=await M(e,"utf8");return JSON.parse(t)};export{q as qb,B as rb,H as sb,$e as tb,c as ub,R as vb,Pe as wb,He as xb};
@@ -0,0 +1,2 @@
1
+ import{z as L} from"./chunk-7ce930fe69575c87.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 Ba};
@@ -0,0 +1,6 @@
1
+ // @bun
2
+ import"./chunk-7ce930fe69575c87.js";import{H as i,V as I,Y as y,ma as C} from"./chunk-61fc22887a7be6f9.js";import"./chunk-c7e2acfd5087fb30.js";import{zb as n} from"./chunk-3abb49bba3da7231.js";import u from"fs/promises";var T="169.254.170.2",x="169.254.170.23",P="[fd00:ec2::23]",d=(e,c)=>{if(e.protocol==="https:")return;if(e.hostname===T||e.hostname===x||e.hostname===P)return;if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;const a=e.hostname.split("."),r=(t)=>{const s=parseInt(t,10);return 0<=s&&s<=255};if(a[0]==="127"&&r(a[1])&&r(a[2])&&r(a[3])&&a.length===4)return}throw new n(`URL not accepted. It must either be HTTPS or match one of the following:
3
+ - loopback CIDR 127.0.0.0/8 or [::1/128]
4
+ - ECS container host 169.254.170.2
5
+ - EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:c})};function S(e){return new i({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((c,[a,r])=>{return c[a]=r,c},{}),fragment:e.hash})}async function g(e,c){const r=await y(e.body).transformToString();if(e.statusCode===200){const t=JSON.parse(r);if(typeof t.AccessKeyId!=="string"||typeof t.SecretAccessKey!=="string"||typeof t.Token!=="string"||typeof t.Expiration!=="string")throw new n("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:c});return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:C(t.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let t={};try{t=JSON.parse(r)}catch(s){}throw Object.assign(new n(`Server responded with status: ${e.statusCode}`,{logger:c}),{Code:t.Code,Message:t.Message})}throw new n(`Server responded with status: ${e.statusCode}`,{logger:c})}var w=(e,c,a)=>{return async()=>{for(let r=0;r<c;++r)try{return await e()}catch(t){await new Promise((s)=>setTimeout(s,a))}return await e()}};var E="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",R="http://169.254.170.2",p="AWS_CONTAINER_CREDENTIALS_FULL_URI",A="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",O="AWS_CONTAINER_AUTHORIZATION_TOKEN",b=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let c;const a=e.awsContainerCredentialsRelativeUri??process.env[E],r=e.awsContainerCredentialsFullUri??process.env[p],t=e.awsContainerAuthorizationToken??process.env[O],s=e.awsContainerAuthorizationTokenFile??process.env[A],m=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console.warn:e.logger.warn;if(a&&r)m("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),m("awsContainerCredentialsFullUri will take precedence.");if(t&&s)m("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),m("awsContainerAuthorizationToken will take precedence.");if(r)c=r;else if(a)c=`${R}${a}`;else throw new n(`No HTTP credential provider host provided.
6
+ Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});const h=new URL(c);d(h,e.logger);const K=new I({requestTimeout:e.timeout??1000,connectionTimeout:e.timeout??1000});return w(async()=>{const o=S(h);if(t)o.headers.Authorization=t;else if(s)o.headers.Authorization=(await u.readFile(s)).toString();try{const f=await K.handle(o);return g(f.response)}catch(f){throw new n(String(f),{logger:e.logger})}},e.maxRetries??3,e.timeout??1000)};export{b as fromHttp};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-ccb551ce4fd177fe.js";import{y as b} from"./chunk-7ce930fe69575c87.js";import"./chunk-d7c78cd1ab7dc7ed.js";import{F as G0,G as I0,H as T0,J as Wl,K as B0,O as Tl,P as Al,R as Rl,S as Ll,V as _l,W as bl,aa as K,ba as Ih,ca as u0,ga as A0,ia as S,ka as u,na as R0,pa as U0,qa as T,ra as L0,sa as fl,ta as Cl,ua as H0,va as S0,wa as ch} from"./chunk-61fc22887a7be6f9.js";import{Ca as E0,Da as k0,Ea as K0,Fa as F0,Ga as dl,Ha as wl,Ka as yh,La as q0,Ma as vl,Na as Ml,Oa as zl,Pa as y0,Qa as Ol,Ra as gl,Sa as xl,Ta as il,Ua as Q0,Va as X0,Xa as F,Ya as B,Za as Y0,_a as cl,ab as el,bb as Z0,cb as pl,db as $0,eb as dh,fb as nl,gb as ol,hb as ul,ib as tl,jb as m0,kb as J0} from"./chunk-edfc3362e0d21dab.js";import"./chunk-c7e2acfd5087fb30.js";import{nb as f,ob as jl} from"./chunk-b558c43783464f1b.js";import{pb as Qh} from"./chunk-938fed005335132e.js";import"./chunk-069fcad61c8841dc.js";import"./chunk-3abb49bba3da7231.js";var C=b(yh(),1);var Gl=b(dh(),1);var md=function(h){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:h.region},propertiesExtractor:(d,l)=>({signingProperties:{config:d,context:l}})}},ll=function(h){return{schemeId:"smithy.api#noAuth"}},Il=async(h,d,l)=>{return{operation:dl(d).operation,region:await wl(h.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},Hl=(h)=>{const d=[];switch(h.operation){case"AssumeRoleWithSAML":{d.push(ll(h));break}case"AssumeRoleWithWebIdentity":{d.push(ll(h));break}default:d.push(md(h))}return d},Jd=(h)=>({...h,stsClientCtor:A}),Sl=(h)=>{const d=Jd(h);return{...Gl.resolveAwsSdkSigV4Config(d)}};var ml=(h)=>{return{...h,useDualstackEndpoint:h.useDualstackEndpoint??!1,useFipsEndpoint:h.useFipsEndpoint??!1,useGlobalEndpoint:h.useGlobalEndpoint??!1,defaultSigningName:"sts"}},D={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var Jl={name:"@aws-sdk/client-sts",description:"AWS SDK for JavaScript Sts 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-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && 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 sts",test:"yarn test:unit","test:unit":"jest"},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/client-sso-oidc":"3.629.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",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-sts",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sts"}};var wh=b(dh(),1);var h0=b(yh(),1);var al=b(dh(),1),rl=b(yh(),1);var Dl={["required"]:!1,["type"]:"String"},qh={["required"]:!0,default:!1,["type"]:"Boolean"},Xl={["ref"]:"Endpoint"},El={["fn"]:"isSet",["argv"]:[{["ref"]:"Region"}]},J={["ref"]:"Region"},kl={["fn"]:"aws.partition",["argv"]:[J],assign:"PartitionResult"},Yl={["ref"]:"UseFIPS"},Zl={["ref"]:"UseDualStack"},E={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"us-east-1"}]},headers:{}},X={},Kl={conditions:[{["fn"]:"stringEquals",["argv"]:[J,"aws-global"]}],["endpoint"]:E,["type"]:"endpoint"},$l={["fn"]:"booleanEquals",["argv"]:[Yl,!0]},Ul={["fn"]:"booleanEquals",["argv"]:[Zl,!0]},Fl={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Vl={["ref"]:"PartitionResult"},Bl={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[Vl,"supportsDualStack"]}]},ql=[{["fn"]:"isSet",["argv"]:[Xl]}],yl=[$l],Ql=[Ul],Ed={version:"1.0",parameters:{Region:Dl,UseDualStack:qh,UseFIPS:qh,Endpoint:Dl,UseGlobalEndpoint:qh},rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseGlobalEndpoint"},!0]},{["fn"]:"not",["argv"]:ql},El,kl,{["fn"]:"booleanEquals",["argv"]:[Yl,!1]},{["fn"]:"booleanEquals",["argv"]:[Zl,!1]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-northeast-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-south-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-southeast-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ap-southeast-2"]}],endpoint:E,["type"]:"endpoint"},Kl,{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"ca-central-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-central-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-north-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-2"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"eu-west-3"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"sa-east-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-east-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-east-2"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-west-1"]}],endpoint:E,["type"]:"endpoint"},{conditions:[{["fn"]:"stringEquals",["argv"]:[J,"us-west-2"]}],endpoint:E,["type"]:"endpoint"},{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:{authSchemes:[{name:"sigv4",signingName:"sts",signingRegion:"{Region}"}]},headers:X},["type"]:"endpoint"}],["type"]:"tree"},{conditions:ql,rules:[{conditions:yl,error:"Invalid Configuration: FIPS and custom endpoint are not supported",["type"]:"error"},{conditions:Ql,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",["type"]:"error"},{endpoint:{url:Xl,properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{conditions:[El],rules:[{conditions:[kl],rules:[{conditions:[$l,Ul],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,Fl]},Bl],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",["type"]:"error"}],["type"]:"tree"},{conditions:yl,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[Fl,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Vl,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:X,headers:X},["type"]:"endpoint"},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{error:"FIPS is enabled but this partition does not support FIPS",["type"]:"error"}],["type"]:"tree"},{conditions:Ql,rules:[{conditions:[Bl],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"},{error:"DualStack is enabled but this partition does not support DualStack",["type"]:"error"}],["type"]:"tree"},Kl,{endpoint:{url:"https://sts.{Region}.{PartitionResult#dnsSuffix}",properties:X,headers:X},["type"]:"endpoint"}],["type"]:"tree"}],["type"]:"tree"},{error:"Invalid Configuration: Missing Region",["type"]:"error"}]},Pl=Ed;var Nl=(h,d={})=>{return Ml(Pl,{endpointParams:h,logger:d.logger})};vl.aws=zl;var sl=(h)=>{return{apiVersion:"2011-06-15",base64Decoder:h?.base64Decoder??Tl,base64Encoder:h?.base64Encoder??Ll,disableHostPrefix:h?.disableHostPrefix??!1,endpointProvider:h?.endpointProvider??Nl,extensions:h?.extensions??[],httpAuthSchemeProvider:h?.httpAuthSchemeProvider??Hl,httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(d)=>d.getIdentityProvider("aws.auth#sigv4"),signer:new al.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(d)=>d.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new rl.NoAuthSigner}],logger:h?.logger??new Wl,serviceId:h?.serviceId??"STS",urlParser:h?.urlParser??jl,utf8Decoder:h?.utf8Decoder??Al,utf8Encoder:h?.utf8Encoder??Rl}};var l0=(h)=>{Cl(process.version);const d=tl(h),l=()=>d().then(fl),w=sl(h);return wh.emitWarningIfUnsupportedVersion(process.version),{...w,...h,runtime:"node",defaultsMode:d,bodyLengthChecker:h?.bodyLengthChecker??ul,credentialDefaultProvider:h?.credentialDefaultProvider??Qh,defaultUserAgentProvider:h?.defaultUserAgentProvider??nl({serviceId:w.serviceId,clientVersion:Jl.version}),httpAuthSchemes:h?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(G)=>G.getIdentityProvider("aws.auth#sigv4")||(async(H)=>await Qh(H?.__config||{})()),signer:new wh.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(G)=>G.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new h0.NoAuthSigner}],maxAttempts:h?.maxAttempts??f(el),region:h?.region??f(xl,il),requestHandler:_l.create(h?.requestHandler??l),retryMode:h?.retryMode??f({...pl,default:async()=>(await l()).retryMode||cl}),sha256:h?.sha256??ol.bind(null,"sha256"),streamCollector:h?.streamCollector??bl,useDualstackEndpoint:h?.useDualstackEndpoint??f(Ol),useFipsEndpoint:h?.useFipsEndpoint??f(gl)}};var d0=(h)=>{const d=h.httpAuthSchemes;let{httpAuthSchemeProvider:l,credentials:w}=h;return{setHttpAuthScheme(G){const H=d.findIndex((I)=>I.schemeId===G.schemeId);if(H===-1)d.push(G);else d.splice(H,1,G)},httpAuthSchemes(){return d},setHttpAuthSchemeProvider(G){l=G},httpAuthSchemeProvider(){return l},setCredentials(G){w=G},credentials(){return w}}},w0=(h)=>{return{httpAuthSchemes:h.httpAuthSchemes(),httpAuthSchemeProvider:h.httpAuthSchemeProvider(),credentials:h.credentials()}};var Gh=(h)=>h,D0=(h,d)=>{const l={...Gh(m0(h)),...Gh(H0(h)),...Gh(G0(h)),...Gh(d0(h))};return d.forEach((w)=>w.configure(l)),{...h,...J0(l),...S0(l),...I0(l),...w0(l)}};class A extends B0{constructor(...[h]){const d=l0(h||{}),l=ml(d),w=q0(l),G=Z0(w),H=Q0(G),I=E0(H),Q=Y0(I),v=Sl(Q),M=D0(v,h?.extensions||[]);super(M);this.config=M,this.middlewareStack.use(y0(this.config)),this.middlewareStack.use($0(this.config)),this.middlewareStack.use(X0(this.config)),this.middlewareStack.use(k0(this.config)),this.middlewareStack.use(K0(this.config)),this.middlewareStack.use(F0(this.config)),this.middlewareStack.use(C.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:Il,identityProviderConfigProvider:async(n)=>new C.DefaultIdentityProviderConfig({"aws.auth#sigv4":n.credentials})})),this.middlewareStack.use(C.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class Y extends U0{constructor(h){super(h);Object.setPrototypeOf(this,Y.prototype)}}class Hh extends Y{constructor(h){super({name:"ExpiredTokenException",$fault:"client",...h});this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,Hh.prototype)}}class Sh extends Y{constructor(h){super({name:"MalformedPolicyDocumentException",$fault:"client",...h});this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,Sh.prototype)}}class mh extends Y{constructor(h){super({name:"PackedPolicyTooLargeException",$fault:"client",...h});this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,mh.prototype)}}class Jh extends Y{constructor(h){super({name:"RegionDisabledException",$fault:"client",...h});this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,Jh.prototype)}}class Dh extends Y{constructor(h){super({name:"IDPRejectedClaimException",$fault:"client",...h});this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,Dh.prototype)}}class Eh extends Y{constructor(h){super({name:"InvalidIdentityTokenException",$fault:"client",...h});this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,Eh.prototype)}}class kh extends Y{constructor(h){super({name:"IDPCommunicationErrorException",$fault:"client",...h});this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,kh.prototype)}}class Kh extends Y{constructor(h){super({name:"InvalidAuthorizationMessageException",$fault:"client",...h});this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,Kh.prototype)}}var o=(h)=>({...h,...h.SecretAccessKey&&{SecretAccessKey:Ih}}),V0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),P0=(h)=>({...h,...h.SAMLAssertion&&{SAMLAssertion:Ih}}),v0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),M0=(h)=>({...h,...h.WebIdentityToken&&{WebIdentityToken:Ih}}),z0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),N0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}}),W0=(h)=>({...h,...h.Credentials&&{Credentials:o(h.Credentials)}});var P=b(dh(),1);var j0=async(h,d)=>{const l=j;let w;return w=_({...Yd(h,d),[r]:od,[s]:a}),L(d,l,"/",void 0,w)},a0=async(h,d)=>{const l=j;let w;return w=_({...Zd(h,d),[r]:ud,[s]:a}),L(d,l,"/",void 0,w)},r0=async(h,d)=>{const l=j;let w;return w=_({...$d(h,d),[r]:td,[s]:a}),L(d,l,"/",void 0,w)},s0=async(h,d)=>{const l=j;let w;return w=_({...Ud(h,d),[r]:hw,[s]:a}),L(d,l,"/",void 0,w)},_0=async(h,d)=>{const l=j;let w;return w=_({...Vd(h,d),[r]:lw,[s]:a}),L(d,l,"/",void 0,w)},b0=async(h,d)=>{const l=j;let w;return w=_({...Pd(h,d),[r]:dw,[s]:a}),L(d,l,"/",void 0,w)},f0=async(h,d)=>{const l=j;let w;return w=_({...vd(h,d),[r]:ww,[s]:a}),L(d,l,"/",void 0,w)},C0=async(h,d)=>{const l=j;let w;return w=_({...Md(h,d),[r]:Gw,[s]:a}),L(d,l,"/",void 0,w)},O0=async(h,d)=>{if(h.statusCode>=300)return R(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=Rd(l.AssumeRoleResult,d),{$metadata:k(h),...w}},g0=async(h,d)=>{if(h.statusCode>=300)return R(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=Ld(l.AssumeRoleWithSAMLResult,d),{$metadata:k(h),...w}},x0=async(h,d)=>{if(h.statusCode>=300)return R(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=jd(l.AssumeRoleWithWebIdentityResult,d),{$metadata:k(h),...w}},i0=async(h,d)=>{if(h.statusCode>=300)return R(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=ad(l.DecodeAuthorizationMessageResult,d),{$metadata:k(h),...w}},c0=async(h,d)=>{if(h.statusCode>=300)return R(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=_d(l.GetAccessKeyInfoResult,d),{$metadata:k(h),...w}},e0=async(h,d)=>{if(h.statusCode>=300)return R(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=bd(l.GetCallerIdentityResult,d),{$metadata:k(h),...w}},p0=async(h,d)=>{if(h.statusCode>=300)return R(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=fd(l.GetFederationTokenResult,d),{$metadata:k(h),...w}},n0=async(h,d)=>{if(h.statusCode>=300)return R(h,d);const l=await P.parseXmlBody(h.body,d);let w={};return w=Cd(l.GetSessionTokenResult,d),{$metadata:k(h),...w}},R=async(h,d)=>{const l={...h,body:await P.parseXmlErrorBody(h.body,d)},w=Iw(h,l.body);switch(w){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await kd(l,d);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await yd(l,d);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await Qd(l,d);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await Xd(l,d);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await Fd(l,d);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await qd(l,d);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await Kd(l,d);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await Bd(l,d);default:const G=l.body;return nd({output:h,parsedBody:G.Error,errorCode:w})}},kd=async(h,d)=>{const l=h.body,w=rd(l.Error,d),G=new Hh({$metadata:k(h),...w});return T(G,l)},Kd=async(h,d)=>{const l=h.body,w=Od(l.Error,d),G=new kh({$metadata:k(h),...w});return T(G,l)},Fd=async(h,d)=>{const l=h.body,w=gd(l.Error,d),G=new Dh({$metadata:k(h),...w});return T(G,l)},Bd=async(h,d)=>{const l=h.body,w=xd(l.Error,d),G=new Kh({$metadata:k(h),...w});return T(G,l)},qd=async(h,d)=>{const l=h.body,w=id(l.Error,d),G=new Eh({$metadata:k(h),...w});return T(G,l)},yd=async(h,d)=>{const l=h.body,w=cd(l.Error,d),G=new Sh({$metadata:k(h),...w});return T(G,l)},Qd=async(h,d)=>{const l=h.body,w=ed(l.Error,d),G=new mh({$metadata:k(h),...w});return T(G,l)},Xd=async(h,d)=>{const l=h.body,w=pd(l.Error,d),G=new Jh({$metadata:k(h),...w});return T(G,l)},Yd=(h,d)=>{const l={};if(h[W]!=null)l[W]=h[W];if(h[i]!=null)l[i]=h[i];if(h[$]!=null){const w=Fh(h[$],d);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(w).forEach(([G,H])=>{const I=`PolicyArns.${G}`;l[I]=H})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];if(h[e]!=null){const w=o0(h[e],d);if(h[e]?.length===0)l.Tags=[];Object.entries(w).forEach(([G,H])=>{const I=`Tags.${G}`;l[I]=H})}if(h[Ch]!=null){const w=Ad(h[Ch],d);if(h[Ch]?.length===0)l.TransitiveTagKeys=[];Object.entries(w).forEach(([G,H])=>{const I=`TransitiveTagKeys.${G}`;l[I]=H})}if(h[Uh]!=null)l[Uh]=h[Uh];if(h[c]!=null)l[c]=h[c];if(h[p]!=null)l[p]=h[p];if(h[V]!=null)l[V]=h[V];if(h[Rh]!=null){const w=Wd(h[Rh],d);if(h[Rh]?.length===0)l.ProvidedContexts=[];Object.entries(w).forEach(([G,H])=>{const I=`ProvidedContexts.${G}`;l[I]=H})}return l},Zd=(h,d)=>{const l={};if(h[W]!=null)l[W]=h[W];if(h[Th]!=null)l[Th]=h[Th];if(h[sh]!=null)l[sh]=h[sh];if(h[$]!=null){const w=Fh(h[$],d);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(w).forEach(([G,H])=>{const I=`PolicyArns.${G}`;l[I]=H})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];return l},$d=(h,d)=>{const l={};if(h[W]!=null)l[W]=h[W];if(h[i]!=null)l[i]=h[i];if(h[xh]!=null)l[xh]=h[xh];if(h[Lh]!=null)l[Lh]=h[Lh];if(h[$]!=null){const w=Fh(h[$],d);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(w).forEach(([G,H])=>{const I=`PolicyArns.${G}`;l[I]=H})}if(h[Z]!=null)l[Z]=h[Z];if(h[y]!=null)l[y]=h[y];return l},Ud=(h,d)=>{const l={};if(h[Vh]!=null)l[Vh]=h[Vh];return l},Vd=(h,d)=>{const l={};if(h[O]!=null)l[O]=h[O];return l},Pd=(h,d)=>{return{}},vd=(h,d)=>{const l={};if(h[Nh]!=null)l[Nh]=h[Nh];if(h[Z]!=null)l[Z]=h[Z];if(h[$]!=null){const w=Fh(h[$],d);if(h[$]?.length===0)l.PolicyArns=[];Object.entries(w).forEach(([G,H])=>{const I=`PolicyArns.${G}`;l[I]=H})}if(h[y]!=null)l[y]=h[y];if(h[e]!=null){const w=o0(h[e],d);if(h[e]?.length===0)l.Tags=[];Object.entries(w).forEach(([G,H])=>{const I=`Tags.${G}`;l[I]=H})}return l},Md=(h,d)=>{const l={};if(h[y]!=null)l[y]=h[y];if(h[c]!=null)l[c]=h[c];if(h[p]!=null)l[p]=h[p];return l},Fh=(h,d)=>{const l={};let w=1;for(let G of h){if(G===null)continue;const H=zd(G,d);Object.entries(H).forEach(([I,Q])=>{l[`member.${w}.${I}`]=Q}),w++}return l},zd=(h,d)=>{const l={};if(h[ih]!=null)l[ih]=h[ih];return l},Nd=(h,d)=>{const l={};if(h[Ah]!=null)l[Ah]=h[Ah];if(h[Yh]!=null)l[Yh]=h[Yh];return l},Wd=(h,d)=>{const l={};let w=1;for(let G of h){if(G===null)continue;const H=Nd(G,d);Object.entries(H).forEach(([I,Q])=>{l[`member.${w}.${I}`]=Q}),w++}return l},Td=(h,d)=>{const l={};if(h[zh]!=null)l[zh]=h[zh];if(h[gh]!=null)l[gh]=h[gh];return l},Ad=(h,d)=>{const l={};let w=1;for(let G of h){if(G===null)continue;l[`member.${w}`]=G,w++}return l},o0=(h,d)=>{const l={};let w=1;for(let G of h){if(G===null)continue;const H=Td(G,d);Object.entries(H).forEach(([I,Q])=>{l[`member.${w}.${I}`]=Q}),w++}return l},eh=(h,d)=>{const l={};if(h[Xh]!=null)l[Xh]=S(h[Xh]);if(h[N]!=null)l[N]=S(h[N]);return l},Rd=(h,d)=>{const l={};if(h[q]!=null)l[q]=t(h[q],d);if(h[z]!=null)l[z]=eh(h[z],d);if(h[U]!=null)l[U]=u(h[U]);if(h[V]!=null)l[V]=S(h[V]);return l},Ld=(h,d)=>{const l={};if(h[q]!=null)l[q]=t(h[q],d);if(h[z]!=null)l[z]=eh(h[z],d);if(h[U]!=null)l[U]=u(h[U]);if(h[ah]!=null)l[ah]=S(h[ah]);if(h[bh]!=null)l[bh]=S(h[bh]);if(h[Mh]!=null)l[Mh]=S(h[Mh]);if(h[x]!=null)l[x]=S(h[x]);if(h[Wh]!=null)l[Wh]=S(h[Wh]);if(h[V]!=null)l[V]=S(h[V]);return l},jd=(h,d)=>{const l={};if(h[q]!=null)l[q]=t(h[q],d);if(h[_h]!=null)l[_h]=S(h[_h]);if(h[z]!=null)l[z]=eh(h[z],d);if(h[U]!=null)l[U]=u(h[U]);if(h[jh]!=null)l[jh]=S(h[jh]);if(h[x]!=null)l[x]=S(h[x]);if(h[V]!=null)l[V]=S(h[V]);return l},t=(h,d)=>{const l={};if(h[O]!=null)l[O]=S(h[O]);if(h[rh]!=null)l[rh]=S(h[rh]);if(h[fh]!=null)l[fh]=S(h[fh]);if(h[$h]!=null)l[$h]=A0(R0(h[$h]));return l},ad=(h,d)=>{const l={};if(h[Zh]!=null)l[Zh]=S(h[Zh]);return l},rd=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},sd=(h,d)=>{const l={};if(h[vh]!=null)l[vh]=S(h[vh]);if(h[N]!=null)l[N]=S(h[N]);return l},_d=(h,d)=>{const l={};if(h[g]!=null)l[g]=S(h[g]);return l},bd=(h,d)=>{const l={};if(h[Oh]!=null)l[Oh]=S(h[Oh]);if(h[g]!=null)l[g]=S(h[g]);if(h[N]!=null)l[N]=S(h[N]);return l},fd=(h,d)=>{const l={};if(h[q]!=null)l[q]=t(h[q],d);if(h[Ph]!=null)l[Ph]=sd(h[Ph],d);if(h[U]!=null)l[U]=u(h[U]);return l},Cd=(h,d)=>{const l={};if(h[q]!=null)l[q]=t(h[q],d);return l},Od=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},gd=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},xd=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},id=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},cd=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},ed=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},pd=(h,d)=>{const l={};if(h[m]!=null)l[m]=S(h[m]);return l},k=(h)=>({httpStatusCode:h.statusCode,requestId:h.headers["x-amzn-requestid"]??h.headers["x-amzn-request-id"]??h.headers["x-amz-request-id"],extendedRequestId:h.headers["x-amz-id-2"],cfId:h.headers["x-amz-cf-id"]});var nd=L0(Y),L=async(h,d,l,w,G)=>{const{hostname:H,protocol:I="https",port:Q,path:v}=await h.endpoint(),M={protocol:I,hostname:H,port:Q,method:"POST",path:v.endsWith("/")?v.slice(0,-1)+l:v+l,headers:d};if(w!==void 0)M.hostname=w;if(G!==void 0)M.body=G;return new T0(M)},j={"content-type":"application/x-www-form-urlencoded"},a="2011-06-15",r="Action",O="AccessKeyId",od="AssumeRole",Xh="AssumedRoleId",z="AssumedRoleUser",ud="AssumeRoleWithSAML",td="AssumeRoleWithWebIdentity",g="Account",N="Arn",x="Audience",q="Credentials",Yh="ContextAssertion",hw="DecodeAuthorizationMessage",Zh="DecodedMessage",y="DurationSeconds",$h="Expiration",Uh="ExternalId",Vh="EncodedMessage",Ph="FederatedUser",vh="FederatedUserId",lw="GetAccessKeyInfo",dw="GetCallerIdentity",ww="GetFederationToken",Gw="GetSessionToken",Mh="Issuer",zh="Key",Nh="Name",Wh="NameQualifier",Z="Policy",$="PolicyArns",Th="PrincipalArn",Ah="ProviderArn",Rh="ProvidedContexts",Lh="ProviderId",U="PackedPolicySize",jh="Provider",W="RoleArn",i="RoleSessionName",ah="Subject",rh="SecretAccessKey",sh="SAMLAssertion",_h="SubjectFromWebIdentityToken",V="SourceIdentity",c="SerialNumber",bh="SubjectType",fh="SessionToken",e="Tags",p="TokenCode",Ch="TransitiveTagKeys",Oh="UserId",s="Version",gh="Value",xh="WebIdentityToken",ih="arn",m="message",_=(h)=>Object.entries(h).map(([d,l])=>ch(d)+"="+ch(l)).join("&"),Iw=(h,d)=>{if(d.Error?.Code!==void 0)return d.Error.Code;if(h.statusCode==404)return"NotFound"};class hh extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,V0).ser(j0).de(O0).build(){}class ph extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithSAML",{}).n("STSClient","AssumeRoleWithSAMLCommand").f(P0,v0).ser(a0).de(g0).build(){}class lh extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(M0,z0).ser(r0).de(x0).build(){}class nh extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","DecodeAuthorizationMessage",{}).n("STSClient","DecodeAuthorizationMessageCommand").f(void 0,void 0).ser(s0).de(i0).build(){}class oh extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetAccessKeyInfo",{}).n("STSClient","GetAccessKeyInfoCommand").f(void 0,void 0).ser(_0).de(c0).build(){}class uh extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetCallerIdentity",{}).n("STSClient","GetCallerIdentityCommand").f(void 0,void 0).ser(b0).de(e0).build(){}class th extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetFederationToken",{}).n("STSClient","GetFederationTokenCommand").f(void 0,N0).ser(f0).de(p0).build(){}class hl extends K.classBuilder().ep({...D}).m(function(h,d,l,w){return[F(l,this.serialize,this.deserialize),B(l,h.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetSessionToken",{}).n("STSClient","GetSessionTokenCommand").f(void 0,W0).ser(C0).de(n0).build(){}var Hw={AssumeRoleCommand:hh,AssumeRoleWithSAMLCommand:ph,AssumeRoleWithWebIdentityCommand:lh,DecodeAuthorizationMessageCommand:nh,GetAccessKeyInfoCommand:oh,GetCallerIdentityCommand:uh,GetFederationTokenCommand:th,GetSessionTokenCommand:hl};class t0 extends A{}u0(Hw,t0);var hd="us-east-1",ld=(h)=>{if(typeof h?.Arn==="string"){const d=h.Arn.split(":");if(d.length>4&&d[4]!=="")return d[4]}return},dd=async(h,d,l)=>{const w=typeof h==="function"?await h():h,G=typeof d==="function"?await d():d;return l?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${w} (provider)`,`${G} (parent client)`,`${hd} (STS default)`),w??G??hd},wd=(h,d)=>{let l,w;return async(G,H)=>{if(w=G,!l){const{logger:M=h?.parentClientConfig?.logger,region:n,requestHandler:Bh=h?.parentClientConfig?.requestHandler,credentialProviderLogger:Hd}=h,Sd=await dd(n,h?.parentClientConfig?.region,Hd);l=new d({credentialDefaultProvider:()=>async()=>w,region:Sd,requestHandler:Bh,logger:M})}const{Credentials:I,AssumedRoleUser:Q}=await l.send(new hh(H));if(!I||!I.AccessKeyId||!I.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${H.RoleArn}`);const v=ld(Q);return{accessKeyId:I.AccessKeyId,secretAccessKey:I.SecretAccessKey,sessionToken:I.SessionToken,expiration:I.Expiration,...I.CredentialScope&&{credentialScope:I.CredentialScope},...v&&{accountId:v}}}},Gd=(h,d)=>{let l;return async(w)=>{if(!l){const{logger:Q=h?.parentClientConfig?.logger,region:v,requestHandler:M=h?.parentClientConfig?.requestHandler,credentialProviderLogger:n}=h,Bh=await dd(v,h?.parentClientConfig?.region,n);l=new d({region:Bh,requestHandler:M,logger:Q})}const{Credentials:G,AssumedRoleUser:H}=await l.send(new lh(w));if(!G||!G.AccessKeyId||!G.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${w.RoleArn}`);const I=ld(H);return{accessKeyId:G.AccessKeyId,secretAccessKey:G.SecretAccessKey,sessionToken:G.SessionToken,expiration:G.Expiration,...G.CredentialScope&&{credentialScope:G.CredentialScope},...I&&{accountId:I}}}};var Id=(h,d)=>{if(!d)return h;else return class l extends h{constructor(w){super(w);for(let G of d)this.middlewareStack.use(G)}}},Sw=(h={},d)=>wd(h,Id(A,d)),mw=(h={},d)=>Gd(h,Id(A,d)),RG=(h)=>(d)=>h({roleAssumer:Sw(d),roleAssumerWithWebIdentity:mw(d),...d});export{mw as getDefaultRoleAssumerWithWebIdentity,Sw as getDefaultRoleAssumer,RG as decorateDefaultCredentialProvider,B0 as __Client,Y as STSServiceException,A as STSClient,t0 as STS,Jh as RegionDisabledException,mh as PackedPolicyTooLargeException,Sh as MalformedPolicyDocumentException,Eh as InvalidIdentityTokenException,Kh as InvalidAuthorizationMessageException,Dh as IDPRejectedClaimException,kh as IDPCommunicationErrorException,W0 as GetSessionTokenResponseFilterSensitiveLog,hl as GetSessionTokenCommand,N0 as GetFederationTokenResponseFilterSensitiveLog,th as GetFederationTokenCommand,uh as GetCallerIdentityCommand,oh as GetAccessKeyInfoCommand,Hh as ExpiredTokenException,nh as DecodeAuthorizationMessageCommand,o as CredentialsFilterSensitiveLog,z0 as AssumeRoleWithWebIdentityResponseFilterSensitiveLog,M0 as AssumeRoleWithWebIdentityRequestFilterSensitiveLog,lh as AssumeRoleWithWebIdentityCommand,v0 as AssumeRoleWithSAMLResponseFilterSensitiveLog,P0 as AssumeRoleWithSAMLRequestFilterSensitiveLog,ph as AssumeRoleWithSAMLCommand,V0 as AssumeRoleResponseFilterSensitiveLog,hh as AssumeRoleCommand,K as $Command};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-ccb551ce4fd177fe.js";import{y as $} from"./chunk-7ce930fe69575c87.js";import"./chunk-d7c78cd1ab7dc7ed.js";import{Aa as I,F as ue,G as er,J as be,K as cr,O as je,P as Fe,R as De,S as qe,V as Je,W as Ve,aa as v,ba as t,ca as Vr,ea as _,fa as b,ga as j,ha as F,ia as h,pa as Sr,qa as a,ra as jr,sa as We,ta as fe,ua as rr,va as sr,xa as d,ya as o} from"./chunk-61fc22887a7be6f9.js";import{Ca as nr,Da as or,Ea as dr,Fa as yr,Ga as ee,Ha as re,Ka as H,La as tr,Ma as Ie,Na as Re,Oa as Pe,Pa as ar,Qa as Ae,Ra as Ke,Sa as Me,Ta as Be,Ua as mr,Va as wr,Xa as E,Ya as S,Za as kr,_a as Le,ab as Qe,bb as vr,cb as Xe,db as Er,eb as q,fb as Ye,gb as Ze,hb as He,ib as Ne,jb as ir,kb as lr} from"./chunk-edfc3362e0d21dab.js";import"./chunk-c7e2acfd5087fb30.js";import{nb as R,ob as Ue} from"./chunk-b558c43783464f1b.js";import{pb as Ce} from"./chunk-938fed005335132e.js";import"./chunk-069fcad61c8841dc.js";import"./chunk-3abb49bba3da7231.js";var P=$(H(),1);var se=$(q(),1);var Mr=function(e){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:e.region},propertiesExtractor:(s,r)=>({signingProperties:{config:s,context:r}})}},Z=function(e){return{schemeId:"smithy.api#noAuth"}},ie=async(e,s,r)=>{return{operation:ee(s).operation,region:await re(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},le=(e)=>{const s=[];switch(e.operation){case"CreateToken":{s.push(Z(e));break}case"RegisterClient":{s.push(Z(e));break}case"StartDeviceAuthorization":{s.push(Z(e));break}default:s.push(Mr(e))}return s},he=(e)=>{return{...se.resolveAwsSdkSigV4Config(e)}};var ne=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}},k={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var oe={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 _e=$(q(),1);var xe=$(q(),1),ze=$(H(),1);var de={["required"]:!1,type:"String"},ye={["required"]:!0,default:!1,type:"Boolean"},ce={["ref"]:"Endpoint"},ve={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},Ee={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},m={},te={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},Se={["ref"]:"PartitionResult"},ae={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[Se,"supportsDualStack"]}]},me=[ve],we=[Ee],ke=[{["ref"]:"Region"}],Lr={version:"1.0",parameters:{Region:de,UseDualStack:ye,UseFIPS:ye,Endpoint:de},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[ce]}],rules:[{conditions:me,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:we,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:ce,properties:m,headers:m},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:ke}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:ke,assign:"PartitionResult"}],rules:[{conditions:[ve,Ee],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,te]},ae],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:me,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[te,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[Se,"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:we,rules:[{conditions:[ae],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"}]},$e=Lr;var Te=(e,s={})=>{return Re($e,{endpointParams:e,logger:s.logger})};Ie.aws=Pe;var Ge=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??je,base64Encoder:e?.base64Encoder??qe,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??Te,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??le,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new xe.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new ze.NoAuthSigner}],logger:e?.logger??new be,serviceId:e?.serviceId??"SSO OIDC",urlParser:e?.urlParser??Ue,utf8Decoder:e?.utf8Decoder??Fe,utf8Encoder:e?.utf8Encoder??De}};var pe=(e)=>{fe(process.version);const s=Ne(e),r=()=>s().then(We),i=Ge(e);return _e.emitWarningIfUnsupportedVersion(process.version),{...i,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??He,credentialDefaultProvider:e?.credentialDefaultProvider??Ce,defaultUserAgentProvider:e?.defaultUserAgentProvider??Ye({serviceId:i.serviceId,clientVersion:oe.version}),maxAttempts:e?.maxAttempts??R(Qe),region:e?.region??R(Me,Be),requestHandler:Je.create(e?.requestHandler??r),retryMode:e?.retryMode??R({...Xe,default:async()=>(await r()).retryMode||Le}),sha256:e?.sha256??Ze.bind(null,"sha256"),streamCollector:e?.streamCollector??Ve,useDualstackEndpoint:e?.useDualstackEndpoint??R(Ae),useFipsEndpoint:e?.useFipsEndpoint??R(Ke)}};var ge=(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}}},Oe=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var U=(e)=>e,hr=(e,s)=>{const r={...U(ir(e)),...U(rr(e)),...U(ue(e)),...U(ge(e))};return s.forEach((i)=>i.configure(r)),{...e,...lr(r),...sr(r),...er(r),...Oe(r)}};class N extends cr{constructor(...[e]){const s=pe(e||{}),r=ne(s),i=tr(r),l=vr(i),n=mr(l),T=nr(n),fr=kr(T),Ar=he(fr),u=hr(Ar,e?.extensions||[]);super(u);this.config=u,this.middlewareStack.use(ar(this.config)),this.middlewareStack.use(Er(this.config)),this.middlewareStack.use(wr(this.config)),this.middlewareStack.use(or(this.config)),this.middlewareStack.use(dr(this.config)),this.middlewareStack.use(yr(this.config)),this.middlewareStack.use(P.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:ie,identityProviderConfigProvider:async(Kr)=>new P.DefaultIdentityProviderConfig({"aws.auth#sigv4":Kr.credentials})})),this.middlewareStack.use(P.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class y extends Sr{constructor(e){super(e);Object.setPrototypeOf(this,y.prototype)}}class x extends y{constructor(e){super({name:"AccessDeniedException",$fault:"client",...e});this.name="AccessDeniedException",this.$fault="client",Object.setPrototypeOf(this,x.prototype),this.error=e.error,this.error_description=e.error_description}}class z extends y{constructor(e){super({name:"AuthorizationPendingException",$fault:"client",...e});this.name="AuthorizationPendingException",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:"ExpiredTokenException",$fault:"client",...e});this.name="ExpiredTokenException",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:"InternalServerException",$fault:"server",...e});this.name="InternalServerException",this.$fault="server",Object.setPrototypeOf(this,J.prototype),this.error=e.error,this.error_description=e.error_description}}class V extends y{constructor(e){super({name:"InvalidClientException",$fault:"client",...e});this.name="InvalidClientException",this.$fault="client",Object.setPrototypeOf(this,V.prototype),this.error=e.error,this.error_description=e.error_description}}class W extends y{constructor(e){super({name:"InvalidGrantException",$fault:"client",...e});this.name="InvalidGrantException",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:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",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:"InvalidScopeException",$fault:"client",...e});this.name="InvalidScopeException",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:"SlowDownException",$fault:"client",...e});this.name="SlowDownException",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:"UnauthorizedClientException",$fault:"client",...e});this.name="UnauthorizedClientException",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:"UnsupportedGrantTypeException",$fault:"client",...e});this.name="UnsupportedGrantTypeException",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:"InvalidRequestRegionException",$fault:"client",...e});this.name="InvalidRequestRegionException",this.$fault="client",Object.setPrototypeOf(this,L.prototype),this.error=e.error,this.error_description=e.error_description,this.endpoint=e.endpoint,this.region=e.region}}class Q extends y{constructor(e){super({name:"InvalidClientMetadataException",$fault:"client",...e});this.name="InvalidClientMetadataException",this.$fault="client",Object.setPrototypeOf(this,Q.prototype),this.error=e.error,this.error_description=e.error_description}}class X extends y{constructor(e){super({name:"InvalidRedirectUriException",$fault:"client",...e});this.name="InvalidRedirectUriException",this.$fault="client",Object.setPrototypeOf(this,X.prototype),this.error=e.error,this.error_description=e.error_description}}var $r=(e)=>({...e,...e.clientSecret&&{clientSecret:t},...e.refreshToken&&{refreshToken:t},...e.codeVerifier&&{codeVerifier:t}}),Ir=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Rr=(e)=>({...e,...e.refreshToken&&{refreshToken:t},...e.assertion&&{assertion:t},...e.subjectToken&&{subjectToken:t},...e.codeVerifier&&{codeVerifier:t}}),Pr=(e)=>({...e,...e.accessToken&&{accessToken:t},...e.refreshToken&&{refreshToken:t},...e.idToken&&{idToken:t}}),Tr=(e)=>({...e,...e.clientSecret&&{clientSecret:t}}),br=(e)=>({...e,...e.clientSecret&&{clientSecret:t}});var w=$(q(),1),D=$(H(),1);var Fr=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()},Dr=async(e,s)=>{const r=D.requestBuilder(e,s),i={"content-type":"application/json"};r.bp("/token");const l=d({[is]:[,"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()},qr=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()},Ur=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()},xr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:c(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{accessToken:h,expiresIn:b,idToken:h,refreshToken:h,tokenType:h});return Object.assign(r,l),r},zr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:c(e)}),i=j(F(await w.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},Gr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:c(e)}),i=j(F(await w.parseJsonBody(e.body,s)),"body"),l=o(i,{authorizationEndpoint:h,clientId:h,clientIdIssuedAt:_,clientSecret:h,clientSecretExpiresAt:_,tokenEndpoint:h});return Object.assign(r,l),r},Jr=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return Y(e,s);const r=d({$metadata:c(e)}),i=j(F(await w.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},Y=async(e,s)=>{const r={...e,body:await w.parseJsonErrorBody(e.body,s)},i=w.loadRestJsonErrorCode(e,r.body);switch(i){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await Xr(r,s);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await Yr(r,s);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await Zr(r,s);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await Hr(r,s);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await Nr(r,s);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await pr(r,s);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await gr(r,s);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await ur(r,s);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await es(r,s);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await rs(r,s);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await ss(r,s);case"InvalidRequestRegionException":case"com.amazonaws.ssooidc#InvalidRequestRegionException":throw await Or(r,s);case"InvalidClientMetadataException":case"com.amazonaws.ssooidc#InvalidClientMetadataException":throw await _r(r,s);case"InvalidRedirectUriException":case"com.amazonaws.ssooidc#InvalidRedirectUriException":throw await Cr(r,s);default:const l=r.body;return Qr({output:e,parsedBody:l,errorCode:i})}},Qr=jr(y),Xr=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)},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 Q({$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 W({$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 X({$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 f({$metadata:c(e),...r});return a(n,e.body)},Or=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 L({$metadata:c(e),...r});return a(n,e.body)},ur=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)},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)},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 is="aws_iam";class p extends v.classBuilder().ep({...k}).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f($r,Ir).ser(Fr).de(xr).build(){}class C extends v.classBuilder().ep({...k}).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateTokenWithIAM",{}).n("SSOOIDCClient","CreateTokenWithIAMCommand").f(Rr,Pr).ser(Dr).de(zr).build(){}class g extends v.classBuilder().ep({...k}).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","RegisterClient",{}).n("SSOOIDCClient","RegisterClientCommand").f(void 0,Tr).ser(qr).de(Gr).build(){}class O extends v.classBuilder().ep({...k}).m(function(e,s,r,i){return[E(r,this.serialize,this.deserialize),S(r,e.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","StartDeviceAuthorization",{}).n("SSOOIDCClient","StartDeviceAuthorizationCommand").f(br,void 0).ser(Ur).de(Jr).build(){}var ls={CreateTokenCommand:p,CreateTokenWithIAMCommand:C,RegisterClientCommand:g,StartDeviceAuthorizationCommand:O};class Wr extends N{}Vr(ls,Wr);export{cr as __Client,B as UnsupportedGrantTypeException,M as UnauthorizedClientException,br as StartDeviceAuthorizationRequestFilterSensitiveLog,O as StartDeviceAuthorizationCommand,K as SlowDownException,y as SSOOIDCServiceException,N as SSOOIDCClient,Wr as SSOOIDC,Tr as RegisterClientResponseFilterSensitiveLog,g as RegisterClientCommand,A as InvalidScopeException,L as InvalidRequestRegionException,f as InvalidRequestException,X as InvalidRedirectUriException,W as InvalidGrantException,Q as InvalidClientMetadataException,V as InvalidClientException,J as InternalServerException,G as ExpiredTokenException,Pr as CreateTokenWithIAMResponseFilterSensitiveLog,Rr as CreateTokenWithIAMRequestFilterSensitiveLog,C as CreateTokenWithIAMCommand,Ir as CreateTokenResponseFilterSensitiveLog,$r as CreateTokenRequestFilterSensitiveLog,p as CreateTokenCommand,z as AuthorizationPendingException,x as AccessDeniedException,v as $Command};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{y as i} from"./chunk-7ce930fe69575c87.js";import"./chunk-d7c78cd1ab7dc7ed.js";import{Aa as fe,F as Fe,G as _e,J as ee,K as Ae,O as se,P as te,R as re,S as ae,V as ie,W as le,aa as ts,ba as k,ga as z,ha as Ve,ia as h,pa as He,qa as u,ra as Ne,sa as pe,ta as ye,ua as $e,va as Pe,xa as c,ya as y} from"./chunk-61fc22887a7be6f9.js";import{Ca as Le,Da as Ce,Ea as Me,Fa as We,Ga as _,Ha as $,Ka as B,La as Ke,Ma as V,Na as N,Oa as f,Pa as Qe,Qa as me,Ra as he,Sa as ue,Ta as we,Ua as Xe,Va as Ye,Xa as rs,Ya as as,Za as Ze,_a as be,ab as xe,bb as je,cb as ve,db as Te,eb as x,fb as ke,gb as Re,hb as qe,ib as Ee,jb as Je,kb as Ue} from"./chunk-edfc3362e0d21dab.js";import"./chunk-c7e2acfd5087fb30.js";import{nb as l,ob as ne} from"./chunk-b558c43783464f1b.js";import"./chunk-069fcad61c8841dc.js";import"./chunk-3abb49bba3da7231.js";var p=i(B(),1);var P=i(x(),1);var 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"}},J=async(e,s,t)=>{return{operation:_(s).operation,region:await $(e.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}},U=(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},I=(e)=>{return{...P.resolveAwsSdkSigV4Config(e)}};var L=(e)=>{return{...e,useDualstackEndpoint:e.useDualstackEndpoint??!1,useFipsEndpoint:e.useFipsEndpoint??!1,defaultSigningName:"awsssoportal"}},C={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}};var M={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 Se=i(x(),1);var de=i(x(),1),oe=i(B(),1);var W={["required"]:!1,type:"String"},A={["required"]:!0,default:!1,type:"Boolean"},K={["ref"]:"Endpoint"},T={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseFIPS"},!0]},H={["fn"]:"booleanEquals",["argv"]:[{["ref"]:"UseDualStack"},!0]},d={},Q={["fn"]:"getAttr",["argv"]:[{["ref"]:"PartitionResult"},"supportsFIPS"]},O={["ref"]:"PartitionResult"},X={["fn"]:"booleanEquals",["argv"]:[!0,{["fn"]:"getAttr",["argv"]:[O,"supportsDualStack"]}]},Y=[T],Z=[H],j=[{["ref"]:"Region"}],ls={version:"1.0",parameters:{Region:W,UseDualStack:A,UseFIPS:A,Endpoint:W},rules:[{conditions:[{["fn"]:"isSet",["argv"]:[K]}],rules:[{conditions:Y,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:"error"},{conditions:Z,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:"error"},{endpoint:{url:K,properties:d,headers:d},type:"endpoint"}],type:"tree"},{conditions:[{["fn"]:"isSet",["argv"]:j}],rules:[{conditions:[{["fn"]:"aws.partition",["argv"]:j,assign:"PartitionResult"}],rules:[{conditions:[T,H],rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[!0,Q]},X],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:Y,rules:[{conditions:[{["fn"]:"booleanEquals",["argv"]:[Q,!0]}],rules:[{conditions:[{["fn"]:"stringEquals",["argv"]:[{["fn"]:"getAttr",["argv"]:[O,"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:Z,rules:[{conditions:[X],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"}]},G=ls;var g=(e,s={})=>{return N(G,{endpointParams:e,logger:s.logger})};V.aws=f;var ce=(e)=>{return{apiVersion:"2019-06-10",base64Decoder:e?.base64Decoder??se,base64Encoder:e?.base64Encoder??ae,disableHostPrefix:e?.disableHostPrefix??!1,endpointProvider:e?.endpointProvider??g,extensions:e?.extensions??[],httpAuthSchemeProvider:e?.httpAuthSchemeProvider??U,httpAuthSchemes:e?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:(s)=>s.getIdentityProvider("aws.auth#sigv4"),signer:new de.AwsSdkSigV4Signer},{schemeId:"smithy.api#noAuth",identityProvider:(s)=>s.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new oe.NoAuthSigner}],logger:e?.logger??new ee,serviceId:e?.serviceId??"SSO",urlParser:e?.urlParser??ne,utf8Decoder:e?.utf8Decoder??te,utf8Encoder:e?.utf8Encoder??re}};var ze=(e)=>{ye(process.version);const s=Ee(e),t=()=>s().then(pe),r=ce(e);return Se.emitWarningIfUnsupportedVersion(process.version),{...r,...e,runtime:"node",defaultsMode:s,bodyLengthChecker:e?.bodyLengthChecker??qe,defaultUserAgentProvider:e?.defaultUserAgentProvider??ke({serviceId:r.serviceId,clientVersion:M.version}),maxAttempts:e?.maxAttempts??l(xe),region:e?.region??l(ue,we),requestHandler:ie.create(e?.requestHandler??t),retryMode:e?.retryMode??l({...ve,default:async()=>(await t()).retryMode||be}),sha256:e?.sha256??Re.bind(null,"sha256"),streamCollector:e?.streamCollector??le,useDualstackEndpoint:e?.useDualstackEndpoint??l(me),useFipsEndpoint:e?.useFipsEndpoint??l(he)}};var De=(e)=>{const s=e.httpAuthSchemes;let{httpAuthSchemeProvider:t,credentials:r}=e;return{setHttpAuthScheme(a){const n=s.findIndex((D)=>D.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}}},Be=(e)=>{return{httpAuthSchemes:e.httpAuthSchemes(),httpAuthSchemeProvider:e.httpAuthSchemeProvider(),credentials:e.credentials()}};var v=(e)=>e,Ie=(e,s)=>{const t={...v(Je(e)),...v($e(e)),...v(Fe(e)),...v(De(e))};return s.forEach((r)=>r.configure(t)),{...e,...Ue(t),...Pe(t),..._e(t),...Be(t)}};class ps extends Ae{constructor(...[e]){const s=ze(e||{}),t=L(s),r=Ke(t),a=je(r),n=Xe(a),D=Le(n),ns=Ze(D),ds=I(ns),F=Ie(ds,e?.extensions||[]);super(F);this.config=F,this.middlewareStack.use(Qe(this.config)),this.middlewareStack.use(Te(this.config)),this.middlewareStack.use(Ye(this.config)),this.middlewareStack.use(Ce(this.config)),this.middlewareStack.use(Me(this.config)),this.middlewareStack.use(We(this.config)),this.middlewareStack.use(p.getHttpAuthSchemeEndpointRuleSetPlugin(this.config,{httpAuthSchemeParametersProvider:J,identityProviderConfigProvider:async(os)=>new p.DefaultIdentityProviderConfig({"aws.auth#sigv4":os.credentials})})),this.middlewareStack.use(p.getHttpSigningPlugin(this.config))}destroy(){super.destroy()}}class o extends He{constructor(e){super(e);Object.setPrototypeOf(this,o.prototype)}}class R extends o{constructor(e){super({name:"InvalidRequestException",$fault:"client",...e});this.name="InvalidRequestException",this.$fault="client",Object.setPrototypeOf(this,R.prototype)}}class q extends o{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e});this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,q.prototype)}}class E extends o{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e});this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,E.prototype)}}class S extends o{constructor(e){super({name:"UnauthorizedException",$fault:"client",...e});this.name="UnauthorizedException",this.$fault="client",Object.setPrototypeOf(this,S.prototype)}}var Oe=(e)=>({...e,...e.accessToken&&{accessToken:k}}),ys=(e)=>({...e,...e.secretAccessKey&&{secretAccessKey:k},...e.sessionToken&&{sessionToken:k}}),Ge=(e)=>({...e,...e.roleCredentials&&{roleCredentials:ys(e.roleCredentials)}});var m=i(x(),1),ge=i(B(),1);var es=async(e,s)=>{const t=ge.requestBuilder(e,s),r=c({},vs,{[zs]:e[Rs]});t.bp("/federation/credentials");const a=c({[Ss]:[,z(e[Es],"roleName")],[qs]:[,z(e[ks],"accountId")]});let n;return t.m("GET").h(r).q(a).b(n),t.build()};var ss=async(e,s)=>{if(e.statusCode!==200&&e.statusCode>=300)return ms(e,s);const t=c({$metadata:w(e)}),r=z(Ve(await m.parseJsonBody(e.body,s)),"body"),a=y(r,{roleCredentials:fe});return Object.assign(t,a),t};var ms=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 us(t,s);case"ResourceNotFoundException":case"com.amazonaws.sso#ResourceNotFoundException":throw await ws(t,s);case"TooManyRequestsException":case"com.amazonaws.sso#TooManyRequestsException":throw await bs(t,s);case"UnauthorizedException":case"com.amazonaws.sso#UnauthorizedException":throw await xs(t,s);default:const a=t.body;return hs({output:e,parsedBody:a,errorCode:r})}},hs=Ne(o),us=async(e,s)=>{const t=c({}),r=e.body,a=y(r,{message:h});Object.assign(t,a);const n=new R({$metadata:w(e),...t});return u(n,e.body)},ws=async(e,s)=>{const t=c({}),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=c({}),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=c({}),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)},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 vs=(e)=>e!==void 0&&e!==null&&e!==""&&(!Object.getOwnPropertyNames(e).includes("length")||e.length!=0)&&(!Object.getOwnPropertyNames(e).includes("size")||e.size!=0),ks="accountId",Rs="accessToken",qs="account_id";var Es="roleName",Ss="role_name",zs="x-amz-sso_bearer_token";class Ds extends ts.classBuilder().ep({...C}).m(function(e,s,t,r){return[rs(t,this.serialize,this.deserialize),as(t,e.getEndpointParameterInstructions())]}).s("SWBPortalService","GetRoleCredentials",{}).n("SSOClient","GetRoleCredentialsCommand").f(Oe,Ge).ser(es).de(ss).build(){}export{ps as SSOClient,Ds as GetRoleCredentialsCommand};
@@ -0,0 +1 @@
1
+ class n extends Error{constructor(t,e=!0){let o,r=!0;if(typeof e==="boolean")o=void 0,r=e;else if(e!=null&&typeof e==="object")o=e.logger,r=e.tryNextLink??!0;super(t);this.name="ProviderError",this.tryNextLink=r,Object.setPrototypeOf(this,n.prototype),o?.debug?.(`@smithy/property-provider ${r?"->":"(!)"} ${t}`)}static from(t,e=!0){return Object.assign(new this(t.message,e),t)}}class u extends n{constructor(t,e=!0){super(t,e);this.name="CredentialsProviderError",Object.setPrototypeOf(this,u.prototype)}}class l extends n{constructor(t,e=!0){super(t,e);this.name="TokenProviderError",Object.setPrototypeOf(this,l.prototype)}}var v=(...t)=>async()=>{if(t.length===0)throw new n("No providers in chain");let e;for(let o of t)try{return await o()}catch(r){if(e=r,r?.tryNextLink)continue;throw r}throw e};var w=(t)=>()=>Promise.resolve(t);var b=(t,e,o)=>{let r,i,s,f=!1;const a=async()=>{if(!i)i=t();try{r=await i,s=!0,f=!1}finally{i=void 0}return r};if(e===void 0)return async(c)=>{if(!s||c?.forceRefresh)r=await a();return r};return async(c)=>{if(!s||c?.forceRefresh)r=await a();if(f)return r;if(o&&!o(r))return f=!0,r;if(e(r))return await a(),r;return r}};export{n as yb,u as zb,l as Ab,v as Bb,w as Cb,b as Db};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import"./chunk-7ce930fe69575c87.js";import{zb as E} from"./chunk-3abb49bba3da7231.js";import{readFileSync as l} from"fs";var t=(e)=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:o,roleSessionName:r,webIdentityToken:n,providerId:c,policyArns:i,policy:_,durationSeconds:N}=e;let{roleAssumerWithWebIdentity:s}=e;if(!s){const{getDefaultRoleAssumerWithWebIdentity:d}=await import("./chunk-210fc3731e7d2299.js");s=d({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:e.parentClientConfig},e.clientPlugins)}return s({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:c,PolicyArns:i,Policy:_,DurationSeconds:N})};var m="AWS_WEB_IDENTITY_TOKEN_FILE",S="AWS_ROLE_ARN",p="AWS_ROLE_SESSION_NAME",A=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const o=e?.webIdentityTokenFile??process.env[m],r=e?.roleArn??process.env[S],n=e?.roleSessionName??process.env[p];if(!o||!r)throw new E("Web identity configuration not specified",{logger:e.logger});return t({...e,webIdentityToken:l(o,{encoding:"ascii"}),roleArn:r,roleSessionName:n})()};export{t as fromWebToken,A as fromTokenFile};