diff --git a/dist/index.js b/dist/index.js index 888f795..1a216b5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -29,4 +29,4 @@ if(!globalThis.DOMException){try{const{MessageChannel:t}=n(1267),r=(new t).port1 */ (function(r){"use strict";if(typeof bootstrap==="function"){bootstrap("promise",r)}else if(true){t.exports=r()}else{var n,o}})((function(){"use strict";var t=false;try{throw new Error}catch(r){t=!!r.stack}var r=captureLine();var n;var noop=function(){};var o=function(){var t={task:void 0,next:null};var r=t;var n=false;var i=void 0;var a=false;var s=[];function flush(){var r,o;while(t.next){t=t.next;r=t.task;t.task=void 0;o=t.domain;if(o){t.domain=void 0;o.enter()}runSingle(r,o)}while(s.length){r=s.pop();runSingle(r)}n=false}function runSingle(t,r){try{t()}catch(t){if(a){if(r){r.exit()}setTimeout(flush,0);if(r){r.enter()}throw t}else{setTimeout((function(){throw t}),0)}}if(r){r.exit()}}o=function(t){r=r.next={task:t,domain:a&&process.domain,next:null};if(!n){n=true;i()}};if(typeof process==="object"&&process.toString()==="[object process]"&&process.nextTick){a=true;i=function(){process.nextTick(flush)}}else if(typeof setImmediate==="function"){if(typeof window!=="undefined"){i=setImmediate.bind(window,flush)}else{i=function(){setImmediate(flush)}}}else if(typeof MessageChannel!=="undefined"){var l=new MessageChannel;l.port1.onmessage=function(){i=requestPortTick;l.port1.onmessage=flush;flush()};var requestPortTick=function(){l.port2.postMessage(0)};i=function(){setTimeout(flush,0);requestPortTick()}}else{i=function(){setTimeout(flush,0)}}o.runAfter=function(t){s.push(t);if(!n){n=true;i()}};return o}();var i=Function.call;function uncurryThis(t){return function(){return i.apply(t,arguments)}}var a=uncurryThis(Array.prototype.slice);var s=uncurryThis(Array.prototype.reduce||function(t,r){var n=0,o=this.length;if(arguments.length===1){do{if(n in this){r=this[n++];break}if(++n>=o){throw new TypeError}}while(1)}for(;ni.stackCounter)){d(r,"__minimumStackCounter__",{value:i.stackCounter,configurable:true});o.unshift(i.stack)}}o.unshift(r.stack);var a=o.join("\n"+y+"\n");var s=filterStackString(a);d(r,"stack",{value:s,configurable:true})}}function filterStackString(t){var r=t.split("\n");var n=[];for(var o=0;o=r&&a<=w}function captureLine(){if(!t){return}try{throw new Error}catch(t){var r=t.stack.split("\n");var o=r[0].indexOf("@")>0?r[1]:r[2];var i=getFileNameAndLineNumber(o);if(!i){return}n=i[0];return i[1]}}function deprecate(t,r,n){return function(){if(typeof console!=="undefined"&&typeof console.warn==="function"){console.warn(r+" is deprecated, use "+n+" instead.",new Error("").stack)}return t.apply(t,arguments)}}function Q(t){if(t instanceof Promise){return t}if(isPromiseAlike(t)){return coerce(t)}else{return fulfill(t)}}Q.resolve=Q;Q.nextTick=o;Q.longStackSupport=false;var g=1;if(typeof process==="object"&&process&&process.env&&process.env.Q_DEBUG){Q.longStackSupport=true}Q.defer=defer;function defer(){var r=[],n=[],o;var i=c(defer.prototype);var l=c(Promise.prototype);l.promiseDispatch=function(t,i,s){var l=a(arguments);if(r){r.push(l);if(i==="when"&&s[1]){n.push(s[1])}}else{Q.nextTick((function(){o.promiseDispatch.apply(o,l)}))}};l.valueOf=function(){if(r){return l}var t=nearer(o);if(isPromise(t)){o=t}return t};l.inspect=function(){if(!o){return{state:"pending"}}return o.inspect()};if(Q.longStackSupport&&t){try{throw new Error}catch(t){l.stack=t.stack.substring(t.stack.indexOf("\n")+1);l.stackCounter=g++}}function become(i){o=i;if(Q.longStackSupport&&t){l.source=i}s(r,(function(t,r){Q.nextTick((function(){i.promiseDispatch.apply(i,r)}))}),void 0);r=void 0;n=void 0}i.promise=l;i.resolve=function(t){if(o){return}become(Q(t))};i.fulfill=function(t){if(o){return}become(fulfill(t))};i.reject=function(t){if(o){return}become(reject(t))};i.notify=function(t){if(o){return}s(n,(function(r,n){Q.nextTick((function(){n(t)}))}),void 0)};return i}defer.prototype.makeNodeResolver=function(){var t=this;return function(r,n){if(r){t.reject(r)}else if(arguments.length>2){t.resolve(a(arguments,1))}else{t.resolve(n)}}};Q.Promise=promise;Q.promise=promise;function promise(t){if(typeof t!=="function"){throw new TypeError("resolver must be a function.")}var r=defer();try{t(r.resolve,r.reject,r.notify)}catch(t){r.reject(t)}return r.promise}promise.race=race;promise.all=all;promise.reject=reject;promise.resolve=Q;Q.passByCopy=function(t){return t};Promise.prototype.passByCopy=function(){return this};Q.join=function(t,r){return Q(t).join(r)};Promise.prototype.join=function(t){return Q([this,t]).spread((function(t,r){if(t===r){return t}else{throw new Error("Q can't join: not the same: "+t+" "+r)}}))};Q.race=race;function race(t){return promise((function(r,n){for(var o=0,i=t.length;o{const o=Symbol("SemVer ANY");class Comparator{static get ANY(){return o}constructor(t,r){r=i(r);if(t instanceof Comparator){if(t.loose===!!r.loose){return t}else{t=t.value}}u("comparator",t,r);this.options=r;this.loose=!!r.loose;this.parse(t);if(this.semver===o){this.value=""}else{this.value=this.operator+this.semver.version}u("comp",this)}parse(t){const r=this.options.loose?a[s.COMPARATORLOOSE]:a[s.COMPARATOR];const n=t.match(r);if(!n){throw new TypeError(`Invalid comparator: ${t}`)}this.operator=n[1]!==undefined?n[1]:"";if(this.operator==="="){this.operator=""}if(!n[2]){this.semver=o}else{this.semver=new c(n[2],this.options.loose)}}toString(){return this.value}test(t){u("Comparator.test",t,this.options.loose);if(this.semver===o||t===o){return true}if(typeof t==="string"){try{t=new c(t,this.options)}catch(t){return false}}return l(t,this.operator,this.semver,this.options)}intersects(t,r){if(!(t instanceof Comparator)){throw new TypeError("a Comparator is required")}if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}if(this.operator===""){if(this.value===""){return true}return new d(t.value,r).test(this.value)}else if(t.operator===""){if(t.value===""){return true}return new d(this.value,r).test(t.semver)}const n=(this.operator===">="||this.operator===">")&&(t.operator===">="||t.operator===">");const o=(this.operator==="<="||this.operator==="<")&&(t.operator==="<="||t.operator==="<");const i=this.semver.version===t.semver.version;const a=(this.operator===">="||this.operator==="<=")&&(t.operator===">="||t.operator==="<=");const s=l(this.semver,"<",t.semver,r)&&(this.operator===">="||this.operator===">")&&(t.operator==="<="||t.operator==="<");const u=l(this.semver,">",t.semver,r)&&(this.operator==="<="||this.operator==="<")&&(t.operator===">="||t.operator===">");return n||o||i&&a||s||u}}t.exports=Comparator;const i=n(785);const{re:a,t:s}=n(9523);const l=n(5098);const u=n(427);const c=n(8088);const d=n(9828)},9828:(t,r,n)=>{class Range{constructor(t,r){r=a(r);if(t instanceof Range){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease){return t}else{return new Range(t.raw,r)}}if(t instanceof s){this.raw=t.value;this.set=[[t]];this.format();return this}this.options=r;this.loose=!!r.loose;this.includePrerelease=!!r.includePrerelease;this.raw=t;this.set=t.split("||").map((t=>this.parseRange(t.trim()))).filter((t=>t.length));if(!this.set.length){throw new TypeError(`Invalid SemVer Range: ${t}`)}if(this.set.length>1){const t=this.set[0];this.set=this.set.filter((t=>!isNullSet(t[0])));if(this.set.length===0){this.set=[t]}else if(this.set.length>1){for(const t of this.set){if(t.length===1&&isAny(t[0])){this.set=[t];break}}}}this.format()}format(){this.range=this.set.map((t=>t.join(" ").trim())).join("||").trim();return this.range}toString(){return this.range}parseRange(t){t=t.trim();const r=Object.keys(this.options).join(",");const n=`parseRange:${r}:${t}`;const o=i.get(n);if(o){return o}const a=this.options.loose;const u=a?c[d.HYPHENRANGELOOSE]:c[d.HYPHENRANGE];t=t.replace(u,hyphenReplace(this.options.includePrerelease));l("hyphen replace",t);t=t.replace(c[d.COMPARATORTRIM],p);l("comparator trim",t);t=t.replace(c[d.TILDETRIM],h);t=t.replace(c[d.CARETTRIM],m);t=t.split(/\s+/).join(" ");let b=t.split(" ").map((t=>parseComparator(t,this.options))).join(" ").split(/\s+/).map((t=>replaceGTE0(t,this.options)));if(a){b=b.filter((t=>{l("loose invalid filter",t,this.options);return!!t.match(c[d.COMPARATORLOOSE])}))}l("range list",b);const y=new Map;const g=b.map((t=>new s(t,this.options)));for(const t of g){if(isNullSet(t)){return[t]}y.set(t.value,t)}if(y.size>1&&y.has("")){y.delete("")}const R=[...y.values()];i.set(n,R);return R}intersects(t,r){if(!(t instanceof Range)){throw new TypeError("a Range is required")}return this.set.some((n=>isSatisfiable(n,r)&&t.set.some((t=>isSatisfiable(t,r)&&n.every((n=>t.every((t=>n.intersects(t,r)))))))))}test(t){if(!t){return false}if(typeof t==="string"){try{t=new u(t,this.options)}catch(t){return false}}for(let r=0;rt.value==="<0.0.0-0";const isAny=t=>t.value==="";const isSatisfiable=(t,r)=>{let n=true;const o=t.slice();let i=o.pop();while(n&&o.length){n=o.every((t=>i.intersects(t,r)));i=o.pop()}return n};const parseComparator=(t,r)=>{l("comp",t,r);t=replaceCarets(t,r);l("caret",t);t=replaceTildes(t,r);l("tildes",t);t=replaceXRanges(t,r);l("xrange",t);t=replaceStars(t,r);l("stars",t);return t};const isX=t=>!t||t.toLowerCase()==="x"||t==="*";const replaceTildes=(t,r)=>t.trim().split(/\s+/).map((t=>replaceTilde(t,r))).join(" ");const replaceTilde=(t,r)=>{const n=r.loose?c[d.TILDELOOSE]:c[d.TILDE];return t.replace(n,((r,n,o,i,a)=>{l("tilde",t,r,n,o,i,a);let s;if(isX(n)){s=""}else if(isX(o)){s=`>=${n}.0.0 <${+n+1}.0.0-0`}else if(isX(i)){s=`>=${n}.${o}.0 <${n}.${+o+1}.0-0`}else if(a){l("replaceTilde pr",a);s=`>=${n}.${o}.${i}-${a} <${n}.${+o+1}.0-0`}else{s=`>=${n}.${o}.${i} <${n}.${+o+1}.0-0`}l("tilde return",s);return s}))};const replaceCarets=(t,r)=>t.trim().split(/\s+/).map((t=>replaceCaret(t,r))).join(" ");const replaceCaret=(t,r)=>{l("caret",t,r);const n=r.loose?c[d.CARETLOOSE]:c[d.CARET];const o=r.includePrerelease?"-0":"";return t.replace(n,((r,n,i,a,s)=>{l("caret",t,r,n,i,a,s);let u;if(isX(n)){u=""}else if(isX(i)){u=`>=${n}.0.0${o} <${+n+1}.0.0-0`}else if(isX(a)){if(n==="0"){u=`>=${n}.${i}.0${o} <${n}.${+i+1}.0-0`}else{u=`>=${n}.${i}.0${o} <${+n+1}.0.0-0`}}else if(s){l("replaceCaret pr",s);if(n==="0"){if(i==="0"){u=`>=${n}.${i}.${a}-${s} <${n}.${i}.${+a+1}-0`}else{u=`>=${n}.${i}.${a}-${s} <${n}.${+i+1}.0-0`}}else{u=`>=${n}.${i}.${a}-${s} <${+n+1}.0.0-0`}}else{l("no pr");if(n==="0"){if(i==="0"){u=`>=${n}.${i}.${a}${o} <${n}.${i}.${+a+1}-0`}else{u=`>=${n}.${i}.${a}${o} <${n}.${+i+1}.0-0`}}else{u=`>=${n}.${i}.${a} <${+n+1}.0.0-0`}}l("caret return",u);return u}))};const replaceXRanges=(t,r)=>{l("replaceXRanges",t,r);return t.split(/\s+/).map((t=>replaceXRange(t,r))).join(" ")};const replaceXRange=(t,r)=>{t=t.trim();const n=r.loose?c[d.XRANGELOOSE]:c[d.XRANGE];return t.replace(n,((n,o,i,a,s,u)=>{l("xRange",t,n,o,i,a,s,u);const c=isX(i);const d=c||isX(a);const p=d||isX(s);const h=p;if(o==="="&&h){o=""}u=r.includePrerelease?"-0":"";if(c){if(o===">"||o==="<"){n="<0.0.0-0"}else{n="*"}}else if(o&&h){if(d){a=0}s=0;if(o===">"){o=">=";if(d){i=+i+1;a=0;s=0}else{a=+a+1;s=0}}else if(o==="<="){o="<";if(d){i=+i+1}else{a=+a+1}}if(o==="<"){u="-0"}n=`${o+i}.${a}.${s}${u}`}else if(d){n=`>=${i}.0.0${u} <${+i+1}.0.0-0`}else if(p){n=`>=${i}.${a}.0${u} <${i}.${+a+1}.0-0`}l("xRange return",n);return n}))};const replaceStars=(t,r)=>{l("replaceStars",t,r);return t.trim().replace(c[d.STAR],"")};const replaceGTE0=(t,r)=>{l("replaceGTE0",t,r);return t.trim().replace(c[r.includePrerelease?d.GTE0PRE:d.GTE0],"")};const hyphenReplace=t=>(r,n,o,i,a,s,l,u,c,d,p,h,m)=>{if(isX(o)){n=""}else if(isX(i)){n=`>=${o}.0.0${t?"-0":""}`}else if(isX(a)){n=`>=${o}.${i}.0${t?"-0":""}`}else if(s){n=`>=${n}`}else{n=`>=${n}${t?"-0":""}`}if(isX(c)){u=""}else if(isX(d)){u=`<${+c+1}.0.0-0`}else if(isX(p)){u=`<${c}.${+d+1}.0-0`}else if(h){u=`<=${c}.${d}.${p}-${h}`}else if(t){u=`<${c}.${d}.${+p+1}-0`}else{u=`<=${u}`}return`${n} ${u}`.trim()};const testSet=(t,r,n)=>{for(let n=0;n0){const o=t[n].semver;if(o.major===r.major&&o.minor===r.minor&&o.patch===r.patch){return true}}}return false}return true}},8088:(t,r,n)=>{const o=n(427);const{MAX_LENGTH:i,MAX_SAFE_INTEGER:a}=n(2293);const{re:s,t:l}=n(9523);const u=n(785);const{compareIdentifiers:c}=n(2463);class SemVer{constructor(t,r){r=u(r);if(t instanceof SemVer){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease){return t}else{t=t.version}}else if(typeof t!=="string"){throw new TypeError(`Invalid Version: ${t}`)}if(t.length>i){throw new TypeError(`version is longer than ${i} characters`)}o("SemVer",t,r);this.options=r;this.loose=!!r.loose;this.includePrerelease=!!r.includePrerelease;const n=t.trim().match(r.loose?s[l.LOOSE]:s[l.FULL]);if(!n){throw new TypeError(`Invalid Version: ${t}`)}this.raw=t;this.major=+n[1];this.minor=+n[2];this.patch=+n[3];if(this.major>a||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>a||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>a||this.patch<0){throw new TypeError("Invalid patch version")}if(!n[4]){this.prerelease=[]}else{this.prerelease=n[4].split(".").map((t=>{if(/^[0-9]+$/.test(t)){const r=+t;if(r>=0&&r=0){if(typeof this.prerelease[t]==="number"){this.prerelease[t]++;t=-2}}if(t===-1){this.prerelease.push(0)}}if(r){if(c(this.prerelease[0],r)===0){if(isNaN(this.prerelease[1])){this.prerelease=[r,0]}}else{this.prerelease=[r,0]}}break;default:throw new Error(`invalid increment argument: ${t}`)}this.format();this.raw=this.version;return this}}t.exports=SemVer},8848:(t,r,n)=>{const o=n(5925);const clean=(t,r)=>{const n=o(t.trim().replace(/^[=v]+/,""),r);return n?n.version:null};t.exports=clean},5098:(t,r,n)=>{const o=n(1898);const i=n(6017);const a=n(4123);const s=n(5522);const l=n(194);const u=n(7520);const cmp=(t,r,n,c)=>{switch(r){case"===":if(typeof t==="object"){t=t.version}if(typeof n==="object"){n=n.version}return t===n;case"!==":if(typeof t==="object"){t=t.version}if(typeof n==="object"){n=n.version}return t!==n;case"":case"=":case"==":return o(t,n,c);case"!=":return i(t,n,c);case">":return a(t,n,c);case">=":return s(t,n,c);case"<":return l(t,n,c);case"<=":return u(t,n,c);default:throw new TypeError(`Invalid operator: ${r}`)}};t.exports=cmp},3466:(t,r,n)=>{const o=n(8088);const i=n(5925);const{re:a,t:s}=n(9523);const coerce=(t,r)=>{if(t instanceof o){return t}if(typeof t==="number"){t=String(t)}if(typeof t!=="string"){return null}r=r||{};let n=null;if(!r.rtl){n=t.match(a[s.COERCE])}else{let r;while((r=a[s.COERCERTL].exec(t))&&(!n||n.index+n[0].length!==t.length)){if(!n||r.index+r[0].length!==n.index+n[0].length){n=r}a[s.COERCERTL].lastIndex=r.index+r[1].length+r[2].length}a[s.COERCERTL].lastIndex=-1}if(n===null){return null}return i(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,r)};t.exports=coerce},2156:(t,r,n)=>{const o=n(8088);const compareBuild=(t,r,n)=>{const i=new o(t,n);const a=new o(r,n);return i.compare(a)||i.compareBuild(a)};t.exports=compareBuild},2804:(t,r,n)=>{const o=n(4309);const compareLoose=(t,r)=>o(t,r,true);t.exports=compareLoose},4309:(t,r,n)=>{const o=n(8088);const compare=(t,r,n)=>new o(t,n).compare(new o(r,n));t.exports=compare},4297:(t,r,n)=>{const o=n(5925);const i=n(1898);const diff=(t,r)=>{if(i(t,r)){return null}else{const n=o(t);const i=o(r);const a=n.prerelease.length||i.prerelease.length;const s=a?"pre":"";const l=a?"prerelease":"";for(const t in n){if(t==="major"||t==="minor"||t==="patch"){if(n[t]!==i[t]){return s+t}}}return l}};t.exports=diff},1898:(t,r,n)=>{const o=n(4309);const eq=(t,r,n)=>o(t,r,n)===0;t.exports=eq},4123:(t,r,n)=>{const o=n(4309);const gt=(t,r,n)=>o(t,r,n)>0;t.exports=gt},5522:(t,r,n)=>{const o=n(4309);const gte=(t,r,n)=>o(t,r,n)>=0;t.exports=gte},900:(t,r,n)=>{const o=n(8088);const inc=(t,r,n,i)=>{if(typeof n==="string"){i=n;n=undefined}try{return new o(t instanceof o?t.version:t,n).inc(r,i).version}catch(t){return null}};t.exports=inc},194:(t,r,n)=>{const o=n(4309);const lt=(t,r,n)=>o(t,r,n)<0;t.exports=lt},7520:(t,r,n)=>{const o=n(4309);const lte=(t,r,n)=>o(t,r,n)<=0;t.exports=lte},6688:(t,r,n)=>{const o=n(8088);const major=(t,r)=>new o(t,r).major;t.exports=major},8447:(t,r,n)=>{const o=n(8088);const minor=(t,r)=>new o(t,r).minor;t.exports=minor},6017:(t,r,n)=>{const o=n(4309);const neq=(t,r,n)=>o(t,r,n)!==0;t.exports=neq},5925:(t,r,n)=>{const{MAX_LENGTH:o}=n(2293);const{re:i,t:a}=n(9523);const s=n(8088);const l=n(785);const parse=(t,r)=>{r=l(r);if(t instanceof s){return t}if(typeof t!=="string"){return null}if(t.length>o){return null}const n=r.loose?i[a.LOOSE]:i[a.FULL];if(!n.test(t)){return null}try{return new s(t,r)}catch(t){return null}};t.exports=parse},2866:(t,r,n)=>{const o=n(8088);const patch=(t,r)=>new o(t,r).patch;t.exports=patch},4016:(t,r,n)=>{const o=n(5925);const prerelease=(t,r)=>{const n=o(t,r);return n&&n.prerelease.length?n.prerelease:null};t.exports=prerelease},6417:(t,r,n)=>{const o=n(4309);const rcompare=(t,r,n)=>o(r,t,n);t.exports=rcompare},8701:(t,r,n)=>{const o=n(2156);const rsort=(t,r)=>t.sort(((t,n)=>o(n,t,r)));t.exports=rsort},6055:(t,r,n)=>{const o=n(9828);const satisfies=(t,r,n)=>{try{r=new o(r,n)}catch(t){return false}return r.test(t)};t.exports=satisfies},1426:(t,r,n)=>{const o=n(2156);const sort=(t,r)=>t.sort(((t,n)=>o(t,n,r)));t.exports=sort},9601:(t,r,n)=>{const o=n(5925);const valid=(t,r)=>{const n=o(t,r);return n?n.version:null};t.exports=valid},1383:(t,r,n)=>{const o=n(9523);const i=n(2293);const a=n(8088);const s=n(2463);const l=n(5925);const u=n(9601);const c=n(8848);const d=n(900);const p=n(4297);const h=n(6688);const m=n(8447);const b=n(2866);const y=n(4016);const g=n(4309);const R=n(6417);const S=n(2804);const v=n(2156);const _=n(1426);const w=n(8701);const C=n(4123);const E=n(194);const P=n(1898);const T=n(6017);const I=n(5522);const O=n(7520);const A=n(5098);const k=n(3466);const B=n(1532);const W=n(9828);const D=n(6055);const j=n(2706);const q=n(579);const $=n(832);const L=n(4179);const N=n(2098);const F=n(420);const U=n(9380);const M=n(3323);const z=n(7008);const H=n(5297);const G=n(7863);t.exports={parse:l,valid:u,clean:c,inc:d,diff:p,major:h,minor:m,patch:b,prerelease:y,compare:g,rcompare:R,compareLoose:S,compareBuild:v,sort:_,rsort:w,gt:C,lt:E,eq:P,neq:T,gte:I,lte:O,cmp:A,coerce:k,Comparator:B,Range:W,satisfies:D,toComparators:j,maxSatisfying:q,minSatisfying:$,minVersion:L,validRange:N,outside:F,gtr:U,ltr:M,intersects:z,simplifyRange:H,subset:G,SemVer:a,re:o.re,src:o.src,tokens:o.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},2293:t=>{const r="2.0.0";const n=256;const o=Number.MAX_SAFE_INTEGER||9007199254740991;const i=16;t.exports={SEMVER_SPEC_VERSION:r,MAX_LENGTH:n,MAX_SAFE_INTEGER:o,MAX_SAFE_COMPONENT_LENGTH:i}},427:t=>{const r=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};t.exports=r},2463:t=>{const r=/^[0-9]+$/;const compareIdentifiers=(t,n)=>{const o=r.test(t);const i=r.test(n);if(o&&i){t=+t;n=+n}return t===n?0:o&&!i?-1:i&&!o?1:tcompareIdentifiers(r,t);t.exports={compareIdentifiers:compareIdentifiers,rcompareIdentifiers:rcompareIdentifiers}},785:t=>{const r=["includePrerelease","loose","rtl"];const parseOptions=t=>!t?{}:typeof t!=="object"?{loose:true}:r.filter((r=>t[r])).reduce(((t,r)=>{t[r]=true;return t}),{});t.exports=parseOptions},9523:(t,r,n)=>{const{MAX_SAFE_COMPONENT_LENGTH:o}=n(2293);const i=n(427);r=t.exports={};const a=r.re=[];const s=r.src=[];const l=r.t={};let u=0;const createToken=(t,r,n)=>{const o=u++;i(t,o,r);l[t]=o;s[o]=r;a[o]=new RegExp(r,n?"g":undefined)};createToken("NUMERICIDENTIFIER","0|[1-9]\\d*");createToken("NUMERICIDENTIFIERLOOSE","[0-9]+");createToken("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");createToken("MAINVERSION",`(${s[l.NUMERICIDENTIFIER]})\\.`+`(${s[l.NUMERICIDENTIFIER]})\\.`+`(${s[l.NUMERICIDENTIFIER]})`);createToken("MAINVERSIONLOOSE",`(${s[l.NUMERICIDENTIFIERLOOSE]})\\.`+`(${s[l.NUMERICIDENTIFIERLOOSE]})\\.`+`(${s[l.NUMERICIDENTIFIERLOOSE]})`);createToken("PRERELEASEIDENTIFIER",`(?:${s[l.NUMERICIDENTIFIER]}|${s[l.NONNUMERICIDENTIFIER]})`);createToken("PRERELEASEIDENTIFIERLOOSE",`(?:${s[l.NUMERICIDENTIFIERLOOSE]}|${s[l.NONNUMERICIDENTIFIER]})`);createToken("PRERELEASE",`(?:-(${s[l.PRERELEASEIDENTIFIER]}(?:\\.${s[l.PRERELEASEIDENTIFIER]})*))`);createToken("PRERELEASELOOSE",`(?:-?(${s[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[l.PRERELEASEIDENTIFIERLOOSE]})*))`);createToken("BUILDIDENTIFIER","[0-9A-Za-z-]+");createToken("BUILD",`(?:\\+(${s[l.BUILDIDENTIFIER]}(?:\\.${s[l.BUILDIDENTIFIER]})*))`);createToken("FULLPLAIN",`v?${s[l.MAINVERSION]}${s[l.PRERELEASE]}?${s[l.BUILD]}?`);createToken("FULL",`^${s[l.FULLPLAIN]}$`);createToken("LOOSEPLAIN",`[v=\\s]*${s[l.MAINVERSIONLOOSE]}${s[l.PRERELEASELOOSE]}?${s[l.BUILD]}?`);createToken("LOOSE",`^${s[l.LOOSEPLAIN]}$`);createToken("GTLT","((?:<|>)?=?)");createToken("XRANGEIDENTIFIERLOOSE",`${s[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);createToken("XRANGEIDENTIFIER",`${s[l.NUMERICIDENTIFIER]}|x|X|\\*`);createToken("XRANGEPLAIN",`[v=\\s]*(${s[l.XRANGEIDENTIFIER]})`+`(?:\\.(${s[l.XRANGEIDENTIFIER]})`+`(?:\\.(${s[l.XRANGEIDENTIFIER]})`+`(?:${s[l.PRERELEASE]})?${s[l.BUILD]}?`+`)?)?`);createToken("XRANGEPLAINLOOSE",`[v=\\s]*(${s[l.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${s[l.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${s[l.XRANGEIDENTIFIERLOOSE]})`+`(?:${s[l.PRERELEASELOOSE]})?${s[l.BUILD]}?`+`)?)?`);createToken("XRANGE",`^${s[l.GTLT]}\\s*${s[l.XRANGEPLAIN]}$`);createToken("XRANGELOOSE",`^${s[l.GTLT]}\\s*${s[l.XRANGEPLAINLOOSE]}$`);createToken("COERCE",`${"(^|[^\\d])"+"(\\d{1,"}${o}})`+`(?:\\.(\\d{1,${o}}))?`+`(?:\\.(\\d{1,${o}}))?`+`(?:$|[^\\d])`);createToken("COERCERTL",s[l.COERCE],true);createToken("LONETILDE","(?:~>?)");createToken("TILDETRIM",`(\\s*)${s[l.LONETILDE]}\\s+`,true);r.tildeTrimReplace="$1~";createToken("TILDE",`^${s[l.LONETILDE]}${s[l.XRANGEPLAIN]}$`);createToken("TILDELOOSE",`^${s[l.LONETILDE]}${s[l.XRANGEPLAINLOOSE]}$`);createToken("LONECARET","(?:\\^)");createToken("CARETTRIM",`(\\s*)${s[l.LONECARET]}\\s+`,true);r.caretTrimReplace="$1^";createToken("CARET",`^${s[l.LONECARET]}${s[l.XRANGEPLAIN]}$`);createToken("CARETLOOSE",`^${s[l.LONECARET]}${s[l.XRANGEPLAINLOOSE]}$`);createToken("COMPARATORLOOSE",`^${s[l.GTLT]}\\s*(${s[l.LOOSEPLAIN]})$|^$`);createToken("COMPARATOR",`^${s[l.GTLT]}\\s*(${s[l.FULLPLAIN]})$|^$`);createToken("COMPARATORTRIM",`(\\s*)${s[l.GTLT]}\\s*(${s[l.LOOSEPLAIN]}|${s[l.XRANGEPLAIN]})`,true);r.comparatorTrimReplace="$1$2$3";createToken("HYPHENRANGE",`^\\s*(${s[l.XRANGEPLAIN]})`+`\\s+-\\s+`+`(${s[l.XRANGEPLAIN]})`+`\\s*$`);createToken("HYPHENRANGELOOSE",`^\\s*(${s[l.XRANGEPLAINLOOSE]})`+`\\s+-\\s+`+`(${s[l.XRANGEPLAINLOOSE]})`+`\\s*$`);createToken("STAR","(<|>)?=?\\s*\\*");createToken("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");createToken("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},1196:(t,r,n)=>{"use strict";const o=n(665);const i=Symbol("max");const a=Symbol("length");const s=Symbol("lengthCalculator");const l=Symbol("allowStale");const u=Symbol("maxAge");const c=Symbol("dispose");const d=Symbol("noDisposeOnSet");const p=Symbol("lruList");const h=Symbol("cache");const m=Symbol("updateAgeOnGet");const naiveLength=()=>1;class LRUCache{constructor(t){if(typeof t==="number")t={max:t};if(!t)t={};if(t.max&&(typeof t.max!=="number"||t.max<0))throw new TypeError("max must be a non-negative number");const r=this[i]=t.max||Infinity;const n=t.length||naiveLength;this[s]=typeof n!=="function"?naiveLength:n;this[l]=t.stale||false;if(t.maxAge&&typeof t.maxAge!=="number")throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0;this[c]=t.dispose;this[d]=t.noDisposeOnSet||false;this[m]=t.updateAgeOnGet||false;this.reset()}set max(t){if(typeof t!=="number"||t<0)throw new TypeError("max must be a non-negative number");this[i]=t||Infinity;trim(this)}get max(){return this[i]}set allowStale(t){this[l]=!!t}get allowStale(){return this[l]}set maxAge(t){if(typeof t!=="number")throw new TypeError("maxAge must be a non-negative number");this[u]=t;trim(this)}get maxAge(){return this[u]}set lengthCalculator(t){if(typeof t!=="function")t=naiveLength;if(t!==this[s]){this[s]=t;this[a]=0;this[p].forEach((t=>{t.length=this[s](t.value,t.key);this[a]+=t.length}))}trim(this)}get lengthCalculator(){return this[s]}get length(){return this[a]}get itemCount(){return this[p].length}rforEach(t,r){r=r||this;for(let n=this[p].tail;n!==null;){const o=n.prev;forEachStep(this,t,n,r);n=o}}forEach(t,r){r=r||this;for(let n=this[p].head;n!==null;){const o=n.next;forEachStep(this,t,n,r);n=o}}keys(){return this[p].toArray().map((t=>t.key))}values(){return this[p].toArray().map((t=>t.value))}reset(){if(this[c]&&this[p]&&this[p].length){this[p].forEach((t=>this[c](t.key,t.value)))}this[h]=new Map;this[p]=new o;this[a]=0}dump(){return this[p].map((t=>isStale(this,t)?false:{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[p]}set(t,r,n){n=n||this[u];if(n&&typeof n!=="number")throw new TypeError("maxAge must be a number");const o=n?Date.now():0;const l=this[s](r,t);if(this[h].has(t)){if(l>this[i]){del(this,this[h].get(t));return false}const s=this[h].get(t);const u=s.value;if(this[c]){if(!this[d])this[c](t,u.value)}u.now=o;u.maxAge=n;u.value=r;this[a]+=l-u.length;u.length=l;this.get(t);trim(this);return true}const m=new Entry(t,r,l,o,n);if(m.length>this[i]){if(this[c])this[c](t,r);return false}this[a]+=m.length;this[p].unshift(m);this[h].set(t,this[p].head);trim(this);return true}has(t){if(!this[h].has(t))return false;const r=this[h].get(t).value;return!isStale(this,r)}get(t){return get(this,t,true)}peek(t){return get(this,t,false)}pop(){const t=this[p].tail;if(!t)return null;del(this,t);return t.value}del(t){del(this,this[h].get(t))}load(t){this.reset();const r=Date.now();for(let n=t.length-1;n>=0;n--){const o=t[n];const i=o.e||0;if(i===0)this.set(o.k,o.v);else{const t=i-r;if(t>0){this.set(o.k,o.v,t)}}}}prune(){this[h].forEach(((t,r)=>get(this,r,false)))}}const get=(t,r,n)=>{const o=t[h].get(r);if(o){const r=o.value;if(isStale(t,r)){del(t,o);if(!t[l])return undefined}else{if(n){if(t[m])o.value.now=Date.now();t[p].unshiftNode(o)}}return r.value}};const isStale=(t,r)=>{if(!r||!r.maxAge&&!t[u])return false;const n=Date.now()-r.now;return r.maxAge?n>r.maxAge:t[u]&&n>t[u]};const trim=t=>{if(t[a]>t[i]){for(let r=t[p].tail;t[a]>t[i]&&r!==null;){const n=r.prev;del(t,r);r=n}}};const del=(t,r)=>{if(r){const n=r.value;if(t[c])t[c](n.key,n.value);t[a]-=n.length;t[h].delete(n.key);t[p].removeNode(r)}};class Entry{constructor(t,r,n,o,i){this.key=t;this.value=r;this.length=n;this.now=o;this.maxAge=i||0}}const forEachStep=(t,r,n,o)=>{let i=n.value;if(isStale(t,i)){del(t,n);if(!t[l])i=undefined}if(i)r.call(o,i.value,i.key,t)};t.exports=LRUCache},9380:(t,r,n)=>{const o=n(420);const gtr=(t,r,n)=>o(t,r,">",n);t.exports=gtr},7008:(t,r,n)=>{const o=n(9828);const intersects=(t,r,n)=>{t=new o(t,n);r=new o(r,n);return t.intersects(r)};t.exports=intersects},3323:(t,r,n)=>{const o=n(420);const ltr=(t,r,n)=>o(t,r,"<",n);t.exports=ltr},579:(t,r,n)=>{const o=n(8088);const i=n(9828);const maxSatisfying=(t,r,n)=>{let a=null;let s=null;let l=null;try{l=new i(r,n)}catch(t){return null}t.forEach((t=>{if(l.test(t)){if(!a||s.compare(t)===-1){a=t;s=new o(a,n)}}}));return a};t.exports=maxSatisfying},832:(t,r,n)=>{const o=n(8088);const i=n(9828);const minSatisfying=(t,r,n)=>{let a=null;let s=null;let l=null;try{l=new i(r,n)}catch(t){return null}t.forEach((t=>{if(l.test(t)){if(!a||s.compare(t)===1){a=t;s=new o(a,n)}}}));return a};t.exports=minSatisfying},4179:(t,r,n)=>{const o=n(8088);const i=n(9828);const a=n(4123);const minVersion=(t,r)=>{t=new i(t,r);let n=new o("0.0.0");if(t.test(n)){return n}n=new o("0.0.0-0");if(t.test(n)){return n}n=null;for(let r=0;r{const r=new o(t.semver.version);switch(t.operator){case">":if(r.prerelease.length===0){r.patch++}else{r.prerelease.push(0)}r.raw=r.format();case"":case">=":if(!s||a(r,s)){s=r}break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${t.operator}`)}}));if(s&&(!n||a(n,s))){n=s}}if(n&&t.test(n)){return n}return null};t.exports=minVersion},420:(t,r,n)=>{const o=n(8088);const i=n(1532);const{ANY:a}=i;const s=n(9828);const l=n(6055);const u=n(4123);const c=n(194);const d=n(7520);const p=n(5522);const outside=(t,r,n,h)=>{t=new o(t,h);r=new s(r,h);let m,b,y,g,R;switch(n){case">":m=u;b=d;y=c;g=">";R=">=";break;case"<":m=c;b=p;y=u;g="<";R="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(l(t,r,h)){return false}for(let n=0;n{if(t.semver===a){t=new i(">=0.0.0")}s=s||t;l=l||t;if(m(t.semver,s.semver,h)){s=t}else if(y(t.semver,l.semver,h)){l=t}}));if(s.operator===g||s.operator===R){return false}if((!l.operator||l.operator===g)&&b(t,l.semver)){return false}else if(l.operator===R&&y(t,l.semver)){return false}}return true};t.exports=outside},5297:(t,r,n)=>{const o=n(6055);const i=n(4309);t.exports=(t,r,n)=>{const a=[];let s=null;let l=null;const u=t.sort(((t,r)=>i(t,r,n)));for(const t of u){const i=o(t,r,n);if(i){l=t;if(!s){s=t}}else{if(l){a.push([s,l])}l=null;s=null}}if(s){a.push([s,null])}const c=[];for(const[t,r]of a){if(t===r){c.push(t)}else if(!r&&t===u[0]){c.push("*")}else if(!r){c.push(`>=${t}`)}else if(t===u[0]){c.push(`<=${r}`)}else{c.push(`${t} - ${r}`)}}const d=c.join(" || ");const p=typeof r.raw==="string"?r.raw:String(r);return d.length{const o=n(9828);const i=n(1532);const{ANY:a}=i;const s=n(6055);const l=n(4309);const subset=(t,r,n={})=>{if(t===r){return true}t=new o(t,n);r=new o(r,n);let i=false;e:for(const o of t.set){for(const t of r.set){const r=simpleSubset(o,t,n);i=i||r!==null;if(r){continue e}}if(i){return false}}return true};const simpleSubset=(t,r,n)=>{if(t===r){return true}if(t.length===1&&t[0].semver===a){if(r.length===1&&r[0].semver===a){return true}else if(n.includePrerelease){t=[new i(">=0.0.0-0")]}else{t=[new i(">=0.0.0")]}}if(r.length===1&&r[0].semver===a){if(n.includePrerelease){return true}else{r=[new i(">=0.0.0")]}}const o=new Set;let u,c;for(const r of t){if(r.operator===">"||r.operator===">="){u=higherGT(u,r,n)}else if(r.operator==="<"||r.operator==="<="){c=lowerLT(c,r,n)}else{o.add(r.semver)}}if(o.size>1){return null}let d;if(u&&c){d=l(u.semver,c.semver,n);if(d>0){return null}else if(d===0&&(u.operator!==">="||c.operator!=="<=")){return null}}for(const t of o){if(u&&!s(t,String(u),n)){return null}if(c&&!s(t,String(c),n)){return null}for(const o of r){if(!s(t,String(o),n)){return false}}return true}let p,h;let m,b;let y=c&&!n.includePrerelease&&c.semver.prerelease.length?c.semver:false;let g=u&&!n.includePrerelease&&u.semver.prerelease.length?u.semver:false;if(y&&y.prerelease.length===1&&c.operator==="<"&&y.prerelease[0]===0){y=false}for(const t of r){b=b||t.operator===">"||t.operator===">=";m=m||t.operator==="<"||t.operator==="<=";if(u){if(g){if(t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===g.major&&t.semver.minor===g.minor&&t.semver.patch===g.patch){g=false}}if(t.operator===">"||t.operator===">="){p=higherGT(u,t,n);if(p===t&&p!==u){return false}}else if(u.operator===">="&&!s(u.semver,String(t),n)){return false}}if(c){if(y){if(t.semver.prerelease&&t.semver.prerelease.length&&t.semver.major===y.major&&t.semver.minor===y.minor&&t.semver.patch===y.patch){y=false}}if(t.operator==="<"||t.operator==="<="){h=lowerLT(c,t,n);if(h===t&&h!==c){return false}}else if(c.operator==="<="&&!s(c.semver,String(t),n)){return false}}if(!t.operator&&(c||u)&&d!==0){return false}}if(u&&m&&!c&&d!==0){return false}if(c&&b&&!u&&d!==0){return false}if(g||y){return false}return true};const higherGT=(t,r,n)=>{if(!t){return r}const o=l(t.semver,r.semver,n);return o>0?t:o<0?r:r.operator===">"&&t.operator===">="?r:t};const lowerLT=(t,r,n)=>{if(!t){return r}const o=l(t.semver,r.semver,n);return o<0?t:o>0?r:r.operator==="<"&&t.operator==="<="?r:t};t.exports=subset},2706:(t,r,n)=>{const o=n(9828);const toComparators=(t,r)=>new o(t,r).set.map((t=>t.map((t=>t.value)).join(" ").trim().split(" ")));t.exports=toComparators},2098:(t,r,n)=>{const o=n(9828);const validRange=(t,r)=>{try{return new o(t,r).range||"*"}catch(t){return null}};t.exports=validRange},7093:t=>{t.exports=function(){var t=new Chain;return t.__init.apply(t,arguments)};function Chain(){this.queue=[];this.onend=function(t){};this.pass=true}Chain.prototype.__init=function(){this.queue=[].slice.call(arguments);return this};Chain.prototype.add=function(){var t=[].slice.call(arguments);t.forEach(function(t){this.queue.push.apply(this.queue,Array.isArray(t)?t:[t])}.bind(this));return this};Chain.prototype.next=function(){if(!this.pass)return this;if(this.queue.length){this.queue.shift().call()}else{this.onend()}return this};Chain.prototype.stop=function(){this.pass=false;this.onend.apply(this,arguments);return this};Chain.prototype.traverse=function(t){t&&t.call&&t.apply&&(this.onend=t);this.next();return this}},4294:(t,r,n)=>{t.exports=n(4219)},4219:(t,r,n)=>{"use strict";var o=n(1808);var i=n(4404);var a=n(3685);var s=n(5687);var l=n(2361);var u=n(9491);var c=n(3837);r.httpOverHttp=httpOverHttp;r.httpsOverHttp=httpsOverHttp;r.httpOverHttps=httpOverHttps;r.httpsOverHttps=httpsOverHttps;function httpOverHttp(t){var r=new TunnelingAgent(t);r.request=a.request;return r}function httpsOverHttp(t){var r=new TunnelingAgent(t);r.request=a.request;r.createSocket=createSecureSocket;r.defaultPort=443;return r}function httpOverHttps(t){var r=new TunnelingAgent(t);r.request=s.request;return r}function httpsOverHttps(t){var r=new TunnelingAgent(t);r.request=s.request;r.createSocket=createSecureSocket;r.defaultPort=443;return r}function TunnelingAgent(t){var r=this;r.options=t||{};r.proxyOptions=r.options.proxy||{};r.maxSockets=r.options.maxSockets||a.Agent.defaultMaxSockets;r.requests=[];r.sockets=[];r.on("free",(function onFree(t,n,o,i){var a=toOptions(n,o,i);for(var s=0,l=r.requests.length;s=this.maxSockets){i.requests.push(a);return}i.createSocket(a,(function(r){r.on("free",onFree);r.on("close",onCloseOrRemove);r.on("agentRemove",onCloseOrRemove);t.onSocket(r);function onFree(){i.emit("free",r,a)}function onCloseOrRemove(t){i.removeSocket(r);r.removeListener("free",onFree);r.removeListener("close",onCloseOrRemove);r.removeListener("agentRemove",onCloseOrRemove)}}))};TunnelingAgent.prototype.createSocket=function createSocket(t,r){var n=this;var o={};n.sockets.push(o);var i=mergeOptions({},n.proxyOptions,{method:"CONNECT",path:t.host+":"+t.port,agent:false,headers:{host:t.host+":"+t.port}});if(t.localAddress){i.localAddress=t.localAddress}if(i.proxyAuth){i.headers=i.headers||{};i.headers["Proxy-Authorization"]="Basic "+new Buffer(i.proxyAuth).toString("base64")}d("making CONNECT request");var a=n.request(i);a.useChunkedEncodingByDefault=false;a.once("response",onResponse);a.once("upgrade",onUpgrade);a.once("connect",onConnect);a.once("error",onError);a.end();function onResponse(t){t.upgrade=true}function onUpgrade(t,r,n){process.nextTick((function(){onConnect(t,r,n)}))}function onConnect(i,s,l){a.removeAllListeners();s.removeAllListeners();if(i.statusCode!==200){d("tunneling socket could not be established, statusCode=%d",i.statusCode);s.destroy();var u=new Error("tunneling socket could not be established, "+"statusCode="+i.statusCode);u.code="ECONNRESET";t.request.emit("error",u);n.removeSocket(o);return}if(l.length>0){d("got illegal response body from proxy");s.destroy();var u=new Error("got illegal response body from proxy");u.code="ECONNRESET";t.request.emit("error",u);n.removeSocket(o);return}d("tunneling connection has established");n.sockets[n.sockets.indexOf(o)]=s;return r(s)}function onError(r){a.removeAllListeners();d("tunneling socket could not be established, cause=%s\n",r.message,r.stack);var i=new Error("tunneling socket could not be established, "+"cause="+r.message);i.code="ECONNRESET";t.request.emit("error",i);n.removeSocket(o)}};TunnelingAgent.prototype.removeSocket=function removeSocket(t){var r=this.sockets.indexOf(t);if(r===-1){return}this.sockets.splice(r,1);var n=this.requests.shift();if(n){this.createSocket(n,(function(t){n.request.onSocket(t)}))}};function createSecureSocket(t,r){var n=this;TunnelingAgent.prototype.createSocket.call(n,t,(function(o){var a=t.request.getHeader("host");var s=mergeOptions({},n.options,{socket:o,servername:a?a.replace(/:.*$/,""):t.host});var l=i.connect(0,s);n.sockets[n.sockets.indexOf(o)]=l;r(l)}))}function toOptions(t,r,n){if(typeof t==="string"){return{host:t,port:r,localAddress:n}}return t}function mergeOptions(t){for(var r=1,n=arguments.length;r{"use strict";Object.defineProperty(r,"__esModule",{value:true});Object.defineProperty(r,"v1",{enumerable:true,get:function(){return o.default}});Object.defineProperty(r,"v3",{enumerable:true,get:function(){return i.default}});Object.defineProperty(r,"v4",{enumerable:true,get:function(){return a.default}});Object.defineProperty(r,"v5",{enumerable:true,get:function(){return s.default}});Object.defineProperty(r,"NIL",{enumerable:true,get:function(){return l.default}});Object.defineProperty(r,"version",{enumerable:true,get:function(){return u.default}});Object.defineProperty(r,"validate",{enumerable:true,get:function(){return c.default}});Object.defineProperty(r,"stringify",{enumerable:true,get:function(){return d.default}});Object.defineProperty(r,"parse",{enumerable:true,get:function(){return p.default}});var o=_interopRequireDefault(n(8628));var i=_interopRequireDefault(n(6409));var a=_interopRequireDefault(n(5122));var s=_interopRequireDefault(n(9120));var l=_interopRequireDefault(n(5332));var u=_interopRequireDefault(n(1595));var c=_interopRequireDefault(n(6900));var d=_interopRequireDefault(n(8950));var p=_interopRequireDefault(n(2746));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}},4569:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(6113));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function md5(t){if(Array.isArray(t)){t=Buffer.from(t)}else if(typeof t==="string"){t=Buffer.from(t,"utf8")}return o.default.createHash("md5").update(t).digest()}var i=md5;r["default"]=i},5332:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var n="00000000-0000-0000-0000-000000000000";r["default"]=n},2746:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(6900));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function parse(t){if(!(0,o.default)(t)){throw TypeError("Invalid UUID")}let r;const n=new Uint8Array(16);n[0]=(r=parseInt(t.slice(0,8),16))>>>24;n[1]=r>>>16&255;n[2]=r>>>8&255;n[3]=r&255;n[4]=(r=parseInt(t.slice(9,13),16))>>>8;n[5]=r&255;n[6]=(r=parseInt(t.slice(14,18),16))>>>8;n[7]=r&255;n[8]=(r=parseInt(t.slice(19,23),16))>>>8;n[9]=r&255;n[10]=(r=parseInt(t.slice(24,36),16))/1099511627776&255;n[11]=r/4294967296&255;n[12]=r>>>24&255;n[13]=r>>>16&255;n[14]=r>>>8&255;n[15]=r&255;return n}var i=parse;r["default"]=i},814:(t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;r["default"]=n},807:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=rng;var o=_interopRequireDefault(n(6113));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}const i=new Uint8Array(256);let a=i.length;function rng(){if(a>i.length-16){o.default.randomFillSync(i);a=0}return i.slice(a,a+=16)}},5274:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(6113));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function sha1(t){if(Array.isArray(t)){t=Buffer.from(t)}else if(typeof t==="string"){t=Buffer.from(t,"utf8")}return o.default.createHash("sha1").update(t).digest()}var i=sha1;r["default"]=i},8950:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(6900));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}const i=[];for(let t=0;t<256;++t){i.push((t+256).toString(16).substr(1))}function stringify(t,r=0){const n=(i[t[r+0]]+i[t[r+1]]+i[t[r+2]]+i[t[r+3]]+"-"+i[t[r+4]]+i[t[r+5]]+"-"+i[t[r+6]]+i[t[r+7]]+"-"+i[t[r+8]]+i[t[r+9]]+"-"+i[t[r+10]]+i[t[r+11]]+i[t[r+12]]+i[t[r+13]]+i[t[r+14]]+i[t[r+15]]).toLowerCase();if(!(0,o.default)(n)){throw TypeError("Stringified UUID is invalid")}return n}var a=stringify;r["default"]=a},8628:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(807));var i=_interopRequireDefault(n(8950));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}let a;let s;let l=0;let u=0;function v1(t,r,n){let c=r&&n||0;const d=r||new Array(16);t=t||{};let p=t.node||a;let h=t.clockseq!==undefined?t.clockseq:s;if(p==null||h==null){const r=t.random||(t.rng||o.default)();if(p==null){p=a=[r[0]|1,r[1],r[2],r[3],r[4],r[5]]}if(h==null){h=s=(r[6]<<8|r[7])&16383}}let m=t.msecs!==undefined?t.msecs:Date.now();let b=t.nsecs!==undefined?t.nsecs:u+1;const y=m-l+(b-u)/1e4;if(y<0&&t.clockseq===undefined){h=h+1&16383}if((y<0||m>l)&&t.nsecs===undefined){b=0}if(b>=1e4){throw new Error("uuid.v1(): Can't create more than 10M uuids/sec")}l=m;u=b;s=h;m+=122192928e5;const g=((m&268435455)*1e4+b)%4294967296;d[c++]=g>>>24&255;d[c++]=g>>>16&255;d[c++]=g>>>8&255;d[c++]=g&255;const R=m/4294967296*1e4&268435455;d[c++]=R>>>8&255;d[c++]=R&255;d[c++]=R>>>24&15|16;d[c++]=R>>>16&255;d[c++]=h>>>8|128;d[c++]=h&255;for(let t=0;t<6;++t){d[c+t]=p[t]}return r||(0,i.default)(d)}var c=v1;r["default"]=c},6409:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(5998));var i=_interopRequireDefault(n(4569));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}const a=(0,o.default)("v3",48,i.default);var s=a;r["default"]=s},5998:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=_default;r.URL=r.DNS=void 0;var o=_interopRequireDefault(n(8950));var i=_interopRequireDefault(n(2746));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function stringToBytes(t){t=unescape(encodeURIComponent(t));const r=[];for(let n=0;n{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(807));var i=_interopRequireDefault(n(8950));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function v4(t,r,n){t=t||{};const a=t.random||(t.rng||o.default)();a[6]=a[6]&15|64;a[8]=a[8]&63|128;if(r){n=n||0;for(let t=0;t<16;++t){r[n+t]=a[t]}return r}return(0,i.default)(a)}var a=v4;r["default"]=a},9120:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(5998));var i=_interopRequireDefault(n(5274));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}const a=(0,o.default)("v5",80,i.default);var s=a;r["default"]=s},6900:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(814));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function validate(t){return typeof t==="string"&&o.default.test(t)}var i=validate;r["default"]=i},1595:(t,r,n)=>{"use strict";Object.defineProperty(r,"__esModule",{value:true});r["default"]=void 0;var o=_interopRequireDefault(n(6900));function _interopRequireDefault(t){return t&&t.__esModule?t:{default:t}}function version(t){if(!(0,o.default)(t)){throw TypeError("Invalid UUID")}return parseInt(t.substr(14,1),16)}var i=version;r["default"]=i},1452:function(t,r){(function(t,n){true?n(r):0})(this,(function(t){"use strict";const r=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?Symbol:t=>`Symbol(${t})`;function noop(){return undefined}function getGlobals(){if(typeof self!=="undefined"){return self}else if(typeof window!=="undefined"){return window}else if(typeof global!=="undefined"){return global}return undefined}const n=getGlobals();function typeIsObject(t){return typeof t==="object"&&t!==null||typeof t==="function"}const o=noop;const i=Promise;const a=Promise.prototype.then;const s=Promise.resolve.bind(i);const l=Promise.reject.bind(i);function newPromise(t){return new i(t)}function promiseResolvedWith(t){return s(t)}function promiseRejectedWith(t){return l(t)}function PerformPromiseThen(t,r,n){return a.call(t,r,n)}function uponPromise(t,r,n){PerformPromiseThen(PerformPromiseThen(t,r,n),undefined,o)}function uponFulfillment(t,r){uponPromise(t,r)}function uponRejection(t,r){uponPromise(t,undefined,r)}function transformPromiseWith(t,r,n){return PerformPromiseThen(t,r,n)}function setPromiseIsHandledToTrue(t){PerformPromiseThen(t,undefined,o)}const u=(()=>{const t=n&&n.queueMicrotask;if(typeof t==="function"){return t}const r=promiseResolvedWith(undefined);return t=>PerformPromiseThen(r,t)})();function reflectCall(t,r,n){if(typeof t!=="function"){throw new TypeError("Argument is not a function")}return Function.prototype.apply.call(t,r,n)}function promiseCall(t,r,n){try{return promiseResolvedWith(reflectCall(t,r,n))}catch(t){return promiseRejectedWith(t)}}const c=16384;class SimpleQueue{constructor(){this._cursor=0;this._size=0;this._front={_elements:[],_next:undefined};this._back=this._front;this._cursor=0;this._size=0}get length(){return this._size}push(t){const r=this._back;let n=r;if(r._elements.length===c-1){n={_elements:[],_next:undefined}}r._elements.push(t);if(n!==r){this._back=n;r._next=n}++this._size}shift(){const t=this._front;let r=t;const n=this._cursor;let o=n+1;const i=t._elements;const a=i[n];if(o===c){r=t._next;o=0}--this._size;this._cursor=o;if(t!==r){this._front=r}i[n]=undefined;return a}forEach(t){let r=this._cursor;let n=this._front;let o=n._elements;while(r!==o.length||n._next!==undefined){if(r===o.length){n=n._next;o=n._elements;r=0;if(o.length===0){break}}t(o[r]);++r}}peek(){const t=this._front;const r=this._cursor;return t._elements[r]}}function ReadableStreamReaderGenericInitialize(t,r){t._ownerReadableStream=r;r._reader=t;if(r._state==="readable"){defaultReaderClosedPromiseInitialize(t)}else if(r._state==="closed"){defaultReaderClosedPromiseInitializeAsResolved(t)}else{defaultReaderClosedPromiseInitializeAsRejected(t,r._storedError)}}function ReadableStreamReaderGenericCancel(t,r){const n=t._ownerReadableStream;return ReadableStreamCancel(n,r)}function ReadableStreamReaderGenericRelease(t){if(t._ownerReadableStream._state==="readable"){defaultReaderClosedPromiseReject(t,new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`))}else{defaultReaderClosedPromiseResetToRejected(t,new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`))}t._ownerReadableStream._reader=undefined;t._ownerReadableStream=undefined}function readerLockException(t){return new TypeError("Cannot "+t+" a stream using a released reader")}function defaultReaderClosedPromiseInitialize(t){t._closedPromise=newPromise(((r,n)=>{t._closedPromise_resolve=r;t._closedPromise_reject=n}))}function defaultReaderClosedPromiseInitializeAsRejected(t,r){defaultReaderClosedPromiseInitialize(t);defaultReaderClosedPromiseReject(t,r)}function defaultReaderClosedPromiseInitializeAsResolved(t){defaultReaderClosedPromiseInitialize(t);defaultReaderClosedPromiseResolve(t)}function defaultReaderClosedPromiseReject(t,r){if(t._closedPromise_reject===undefined){return}setPromiseIsHandledToTrue(t._closedPromise);t._closedPromise_reject(r);t._closedPromise_resolve=undefined;t._closedPromise_reject=undefined}function defaultReaderClosedPromiseResetToRejected(t,r){defaultReaderClosedPromiseInitializeAsRejected(t,r)}function defaultReaderClosedPromiseResolve(t){if(t._closedPromise_resolve===undefined){return}t._closedPromise_resolve(undefined);t._closedPromise_resolve=undefined;t._closedPromise_reject=undefined}const d=r("[[AbortSteps]]");const p=r("[[ErrorSteps]]");const h=r("[[CancelSteps]]");const m=r("[[PullSteps]]");const b=Number.isFinite||function(t){return typeof t==="number"&&isFinite(t)};const y=Math.trunc||function(t){return t<0?Math.ceil(t):Math.floor(t)};function isDictionary(t){return typeof t==="object"||typeof t==="function"}function assertDictionary(t,r){if(t!==undefined&&!isDictionary(t)){throw new TypeError(`${r} is not an object.`)}}function assertFunction(t,r){if(typeof t!=="function"){throw new TypeError(`${r} is not a function.`)}}function isObject(t){return typeof t==="object"&&t!==null||typeof t==="function"}function assertObject(t,r){if(!isObject(t)){throw new TypeError(`${r} is not an object.`)}}function assertRequiredArgument(t,r,n){if(t===undefined){throw new TypeError(`Parameter ${r} is required in '${n}'.`)}}function assertRequiredField(t,r,n){if(t===undefined){throw new TypeError(`${r} is required in '${n}'.`)}}function convertUnrestrictedDouble(t){return Number(t)}function censorNegativeZero(t){return t===0?0:t}function integerPart(t){return censorNegativeZero(y(t))}function convertUnsignedLongLongWithEnforceRange(t,r){const n=0;const o=Number.MAX_SAFE_INTEGER;let i=Number(t);i=censorNegativeZero(i);if(!b(i)){throw new TypeError(`${r} is not a finite number`)}i=integerPart(i);if(io){throw new TypeError(`${r} is outside the accepted range of ${n} to ${o}, inclusive`)}if(!b(i)||i===0){return 0}return i}function assertReadableStream(t,r){if(!IsReadableStream(t)){throw new TypeError(`${r} is not a ReadableStream.`)}}function AcquireReadableStreamDefaultReader(t){return new ReadableStreamDefaultReader(t)}function ReadableStreamAddReadRequest(t,r){t._reader._readRequests.push(r)}function ReadableStreamFulfillReadRequest(t,r,n){const o=t._reader;const i=o._readRequests.shift();if(n){i._closeSteps()}else{i._chunkSteps(r)}}function ReadableStreamGetNumReadRequests(t){return t._reader._readRequests.length}function ReadableStreamHasDefaultReader(t){const r=t._reader;if(r===undefined){return false}if(!IsReadableStreamDefaultReader(r)){return false}return true}class ReadableStreamDefaultReader{constructor(t){assertRequiredArgument(t,1,"ReadableStreamDefaultReader");assertReadableStream(t,"First parameter");if(IsReadableStreamLocked(t)){throw new TypeError("This stream has already been locked for exclusive reading by another reader")}ReadableStreamReaderGenericInitialize(this,t);this._readRequests=new SimpleQueue}get closed(){if(!IsReadableStreamDefaultReader(this)){return promiseRejectedWith(defaultReaderBrandCheckException("closed"))}return this._closedPromise}cancel(t=undefined){if(!IsReadableStreamDefaultReader(this)){return promiseRejectedWith(defaultReaderBrandCheckException("cancel"))}if(this._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("cancel"))}return ReadableStreamReaderGenericCancel(this,t)}read(){if(!IsReadableStreamDefaultReader(this)){return promiseRejectedWith(defaultReaderBrandCheckException("read"))}if(this._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("read from"))}let t;let r;const n=newPromise(((n,o)=>{t=n;r=o}));const o={_chunkSteps:r=>t({value:r,done:false}),_closeSteps:()=>t({value:undefined,done:true}),_errorSteps:t=>r(t)};ReadableStreamDefaultReaderRead(this,o);return n}releaseLock(){if(!IsReadableStreamDefaultReader(this)){throw defaultReaderBrandCheckException("releaseLock")}if(this._ownerReadableStream===undefined){return}if(this._readRequests.length>0){throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled")}ReadableStreamReaderGenericRelease(this)}}Object.defineProperties(ReadableStreamDefaultReader.prototype,{cancel:{enumerable:true},read:{enumerable:true},releaseLock:{enumerable:true},closed:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableStreamDefaultReader.prototype,r.toStringTag,{value:"ReadableStreamDefaultReader",configurable:true})}function IsReadableStreamDefaultReader(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_readRequests")){return false}return t instanceof ReadableStreamDefaultReader}function ReadableStreamDefaultReaderRead(t,r){const n=t._ownerReadableStream;n._disturbed=true;if(n._state==="closed"){r._closeSteps()}else if(n._state==="errored"){r._errorSteps(n._storedError)}else{n._readableStreamController[m](r)}}function defaultReaderBrandCheckException(t){return new TypeError(`ReadableStreamDefaultReader.prototype.${t} can only be used on a ReadableStreamDefaultReader`)}const g=Object.getPrototypeOf(Object.getPrototypeOf((async function*(){})).prototype);class ReadableStreamAsyncIteratorImpl{constructor(t,r){this._ongoingPromise=undefined;this._isFinished=false;this._reader=t;this._preventCancel=r}next(){const nextSteps=()=>this._nextSteps();this._ongoingPromise=this._ongoingPromise?transformPromiseWith(this._ongoingPromise,nextSteps,nextSteps):nextSteps();return this._ongoingPromise}return(t){const returnSteps=()=>this._returnSteps(t);return this._ongoingPromise?transformPromiseWith(this._ongoingPromise,returnSteps,returnSteps):returnSteps()}_nextSteps(){if(this._isFinished){return Promise.resolve({value:undefined,done:true})}const t=this._reader;if(t._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("iterate"))}let r;let n;const o=newPromise(((t,o)=>{r=t;n=o}));const i={_chunkSteps:t=>{this._ongoingPromise=undefined;u((()=>r({value:t,done:false})))},_closeSteps:()=>{this._ongoingPromise=undefined;this._isFinished=true;ReadableStreamReaderGenericRelease(t);r({value:undefined,done:true})},_errorSteps:r=>{this._ongoingPromise=undefined;this._isFinished=true;ReadableStreamReaderGenericRelease(t);n(r)}};ReadableStreamDefaultReaderRead(t,i);return o}_returnSteps(t){if(this._isFinished){return Promise.resolve({value:t,done:true})}this._isFinished=true;const r=this._reader;if(r._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("finish iterating"))}if(!this._preventCancel){const n=ReadableStreamReaderGenericCancel(r,t);ReadableStreamReaderGenericRelease(r);return transformPromiseWith(n,(()=>({value:t,done:true})))}ReadableStreamReaderGenericRelease(r);return promiseResolvedWith({value:t,done:true})}}const R={next(){if(!IsReadableStreamAsyncIterator(this)){return promiseRejectedWith(streamAsyncIteratorBrandCheckException("next"))}return this._asyncIteratorImpl.next()},return(t){if(!IsReadableStreamAsyncIterator(this)){return promiseRejectedWith(streamAsyncIteratorBrandCheckException("return"))}return this._asyncIteratorImpl.return(t)}};if(g!==undefined){Object.setPrototypeOf(R,g)}function AcquireReadableStreamAsyncIterator(t,r){const n=AcquireReadableStreamDefaultReader(t);const o=new ReadableStreamAsyncIteratorImpl(n,r);const i=Object.create(R);i._asyncIteratorImpl=o;return i}function IsReadableStreamAsyncIterator(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_asyncIteratorImpl")){return false}try{return t._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl}catch(t){return false}}function streamAsyncIteratorBrandCheckException(t){return new TypeError(`ReadableStreamAsyncIterator.${t} can only be used on a ReadableSteamAsyncIterator`)}const S=Number.isNaN||function(t){return t!==t};function CreateArrayFromList(t){return t.slice()}function CopyDataBlockBytes(t,r,n,o,i){new Uint8Array(t).set(new Uint8Array(n,o,i),r)}function TransferArrayBuffer(t){return t}function IsDetachedBuffer(t){return false}function ArrayBufferSlice(t,r,n){if(t.slice){return t.slice(r,n)}const o=n-r;const i=new ArrayBuffer(o);CopyDataBlockBytes(i,0,t,r,o);return i}function IsNonNegativeNumber(t){if(typeof t!=="number"){return false}if(S(t)){return false}if(t<0){return false}return true}function CloneAsUint8Array(t){const r=ArrayBufferSlice(t.buffer,t.byteOffset,t.byteOffset+t.byteLength);return new Uint8Array(r)}function DequeueValue(t){const r=t._queue.shift();t._queueTotalSize-=r.size;if(t._queueTotalSize<0){t._queueTotalSize=0}return r.value}function EnqueueValueWithSize(t,r,n){if(!IsNonNegativeNumber(n)||n===Infinity){throw new RangeError("Size must be a finite, non-NaN, non-negative number.")}t._queue.push({value:r,size:n});t._queueTotalSize+=n}function PeekQueueValue(t){const r=t._queue.peek();return r.value}function ResetQueue(t){t._queue=new SimpleQueue;t._queueTotalSize=0}class ReadableStreamBYOBRequest{constructor(){throw new TypeError("Illegal constructor")}get view(){if(!IsReadableStreamBYOBRequest(this)){throw byobRequestBrandCheckException("view")}return this._view}respond(t){if(!IsReadableStreamBYOBRequest(this)){throw byobRequestBrandCheckException("respond")}assertRequiredArgument(t,1,"respond");t=convertUnsignedLongLongWithEnforceRange(t,"First parameter");if(this._associatedReadableByteStreamController===undefined){throw new TypeError("This BYOB request has been invalidated")}if(IsDetachedBuffer(this._view.buffer));ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController,t)}respondWithNewView(t){if(!IsReadableStreamBYOBRequest(this)){throw byobRequestBrandCheckException("respondWithNewView")}assertRequiredArgument(t,1,"respondWithNewView");if(!ArrayBuffer.isView(t)){throw new TypeError("You can only respond with array buffer views")}if(this._associatedReadableByteStreamController===undefined){throw new TypeError("This BYOB request has been invalidated")}if(IsDetachedBuffer(t.buffer));ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController,t)}}Object.defineProperties(ReadableStreamBYOBRequest.prototype,{respond:{enumerable:true},respondWithNewView:{enumerable:true},view:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableStreamBYOBRequest.prototype,r.toStringTag,{value:"ReadableStreamBYOBRequest",configurable:true})}class ReadableByteStreamController{constructor(){throw new TypeError("Illegal constructor")}get byobRequest(){if(!IsReadableByteStreamController(this)){throw byteStreamControllerBrandCheckException("byobRequest")}return ReadableByteStreamControllerGetBYOBRequest(this)}get desiredSize(){if(!IsReadableByteStreamController(this)){throw byteStreamControllerBrandCheckException("desiredSize")}return ReadableByteStreamControllerGetDesiredSize(this)}close(){if(!IsReadableByteStreamController(this)){throw byteStreamControllerBrandCheckException("close")}if(this._closeRequested){throw new TypeError("The stream has already been closed; do not close it again!")}const t=this._controlledReadableByteStream._state;if(t!=="readable"){throw new TypeError(`The stream (in ${t} state) is not in the readable state and cannot be closed`)}ReadableByteStreamControllerClose(this)}enqueue(t){if(!IsReadableByteStreamController(this)){throw byteStreamControllerBrandCheckException("enqueue")}assertRequiredArgument(t,1,"enqueue");if(!ArrayBuffer.isView(t)){throw new TypeError("chunk must be an array buffer view")}if(t.byteLength===0){throw new TypeError("chunk must have non-zero byteLength")}if(t.buffer.byteLength===0){throw new TypeError(`chunk's buffer must have non-zero byteLength`)}if(this._closeRequested){throw new TypeError("stream is closed or draining")}const r=this._controlledReadableByteStream._state;if(r!=="readable"){throw new TypeError(`The stream (in ${r} state) is not in the readable state and cannot be enqueued to`)}ReadableByteStreamControllerEnqueue(this,t)}error(t=undefined){if(!IsReadableByteStreamController(this)){throw byteStreamControllerBrandCheckException("error")}ReadableByteStreamControllerError(this,t)}[h](t){ReadableByteStreamControllerClearPendingPullIntos(this);ResetQueue(this);const r=this._cancelAlgorithm(t);ReadableByteStreamControllerClearAlgorithms(this);return r}[m](t){const r=this._controlledReadableByteStream;if(this._queueTotalSize>0){const r=this._queue.shift();this._queueTotalSize-=r.byteLength;ReadableByteStreamControllerHandleQueueDrain(this);const n=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);t._chunkSteps(n);return}const n=this._autoAllocateChunkSize;if(n!==undefined){let r;try{r=new ArrayBuffer(n)}catch(r){t._errorSteps(r);return}const o={buffer:r,bufferByteLength:n,byteOffset:0,byteLength:n,bytesFilled:0,elementSize:1,viewConstructor:Uint8Array,readerType:"default"};this._pendingPullIntos.push(o)}ReadableStreamAddReadRequest(r,t);ReadableByteStreamControllerCallPullIfNeeded(this)}}Object.defineProperties(ReadableByteStreamController.prototype,{close:{enumerable:true},enqueue:{enumerable:true},error:{enumerable:true},byobRequest:{enumerable:true},desiredSize:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableByteStreamController.prototype,r.toStringTag,{value:"ReadableByteStreamController",configurable:true})}function IsReadableByteStreamController(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_controlledReadableByteStream")){return false}return t instanceof ReadableByteStreamController}function IsReadableStreamBYOBRequest(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_associatedReadableByteStreamController")){return false}return t instanceof ReadableStreamBYOBRequest}function ReadableByteStreamControllerCallPullIfNeeded(t){const r=ReadableByteStreamControllerShouldCallPull(t);if(!r){return}if(t._pulling){t._pullAgain=true;return}t._pulling=true;const n=t._pullAlgorithm();uponPromise(n,(()=>{t._pulling=false;if(t._pullAgain){t._pullAgain=false;ReadableByteStreamControllerCallPullIfNeeded(t)}}),(r=>{ReadableByteStreamControllerError(t,r)}))}function ReadableByteStreamControllerClearPendingPullIntos(t){ReadableByteStreamControllerInvalidateBYOBRequest(t);t._pendingPullIntos=new SimpleQueue}function ReadableByteStreamControllerCommitPullIntoDescriptor(t,r){let n=false;if(t._state==="closed"){n=true}const o=ReadableByteStreamControllerConvertPullIntoDescriptor(r);if(r.readerType==="default"){ReadableStreamFulfillReadRequest(t,o,n)}else{ReadableStreamFulfillReadIntoRequest(t,o,n)}}function ReadableByteStreamControllerConvertPullIntoDescriptor(t){const r=t.bytesFilled;const n=t.elementSize;return new t.viewConstructor(t.buffer,t.byteOffset,r/n)}function ReadableByteStreamControllerEnqueueChunkToQueue(t,r,n,o){t._queue.push({buffer:r,byteOffset:n,byteLength:o});t._queueTotalSize+=o}function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(t,r){const n=r.elementSize;const o=r.bytesFilled-r.bytesFilled%n;const i=Math.min(t._queueTotalSize,r.byteLength-r.bytesFilled);const a=r.bytesFilled+i;const s=a-a%n;let l=i;let u=false;if(s>o){l=s-r.bytesFilled;u=true}const c=t._queue;while(l>0){const n=c.peek();const o=Math.min(l,n.byteLength);const i=r.byteOffset+r.bytesFilled;CopyDataBlockBytes(r.buffer,i,n.buffer,n.byteOffset,o);if(n.byteLength===o){c.shift()}else{n.byteOffset+=o;n.byteLength-=o}t._queueTotalSize-=o;ReadableByteStreamControllerFillHeadPullIntoDescriptor(t,o,r);l-=o}return u}function ReadableByteStreamControllerFillHeadPullIntoDescriptor(t,r,n){n.bytesFilled+=r}function ReadableByteStreamControllerHandleQueueDrain(t){if(t._queueTotalSize===0&&t._closeRequested){ReadableByteStreamControllerClearAlgorithms(t);ReadableStreamClose(t._controlledReadableByteStream)}else{ReadableByteStreamControllerCallPullIfNeeded(t)}}function ReadableByteStreamControllerInvalidateBYOBRequest(t){if(t._byobRequest===null){return}t._byobRequest._associatedReadableByteStreamController=undefined;t._byobRequest._view=null;t._byobRequest=null}function ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t){while(t._pendingPullIntos.length>0){if(t._queueTotalSize===0){return}const r=t._pendingPullIntos.peek();if(ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(t,r)){ReadableByteStreamControllerShiftPendingPullInto(t);ReadableByteStreamControllerCommitPullIntoDescriptor(t._controlledReadableByteStream,r)}}}function ReadableByteStreamControllerPullInto(t,r,n){const o=t._controlledReadableByteStream;let i=1;if(r.constructor!==DataView){i=r.constructor.BYTES_PER_ELEMENT}const a=r.constructor;const s=TransferArrayBuffer(r.buffer);const l={buffer:s,bufferByteLength:s.byteLength,byteOffset:r.byteOffset,byteLength:r.byteLength,bytesFilled:0,elementSize:i,viewConstructor:a,readerType:"byob"};if(t._pendingPullIntos.length>0){t._pendingPullIntos.push(l);ReadableStreamAddReadIntoRequest(o,n);return}if(o._state==="closed"){const t=new a(l.buffer,l.byteOffset,0);n._closeSteps(t);return}if(t._queueTotalSize>0){if(ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(t,l)){const r=ReadableByteStreamControllerConvertPullIntoDescriptor(l);ReadableByteStreamControllerHandleQueueDrain(t);n._chunkSteps(r);return}if(t._closeRequested){const r=new TypeError("Insufficient bytes to fill elements in the given buffer");ReadableByteStreamControllerError(t,r);n._errorSteps(r);return}}t._pendingPullIntos.push(l);ReadableStreamAddReadIntoRequest(o,n);ReadableByteStreamControllerCallPullIfNeeded(t)}function ReadableByteStreamControllerRespondInClosedState(t,r){const n=t._controlledReadableByteStream;if(ReadableStreamHasBYOBReader(n)){while(ReadableStreamGetNumReadIntoRequests(n)>0){const r=ReadableByteStreamControllerShiftPendingPullInto(t);ReadableByteStreamControllerCommitPullIntoDescriptor(n,r)}}}function ReadableByteStreamControllerRespondInReadableState(t,r,n){ReadableByteStreamControllerFillHeadPullIntoDescriptor(t,r,n);if(n.bytesFilled0){const r=n.byteOffset+n.bytesFilled;const i=ArrayBufferSlice(n.buffer,r-o,r);ReadableByteStreamControllerEnqueueChunkToQueue(t,i,0,i.byteLength)}n.bytesFilled-=o;ReadableByteStreamControllerCommitPullIntoDescriptor(t._controlledReadableByteStream,n);ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t)}function ReadableByteStreamControllerRespondInternal(t,r){const n=t._pendingPullIntos.peek();ReadableByteStreamControllerInvalidateBYOBRequest(t);const o=t._controlledReadableByteStream._state;if(o==="closed"){ReadableByteStreamControllerRespondInClosedState(t)}else{ReadableByteStreamControllerRespondInReadableState(t,r,n)}ReadableByteStreamControllerCallPullIfNeeded(t)}function ReadableByteStreamControllerShiftPendingPullInto(t){const r=t._pendingPullIntos.shift();return r}function ReadableByteStreamControllerShouldCallPull(t){const r=t._controlledReadableByteStream;if(r._state!=="readable"){return false}if(t._closeRequested){return false}if(!t._started){return false}if(ReadableStreamHasDefaultReader(r)&&ReadableStreamGetNumReadRequests(r)>0){return true}if(ReadableStreamHasBYOBReader(r)&&ReadableStreamGetNumReadIntoRequests(r)>0){return true}const n=ReadableByteStreamControllerGetDesiredSize(t);if(n>0){return true}return false}function ReadableByteStreamControllerClearAlgorithms(t){t._pullAlgorithm=undefined;t._cancelAlgorithm=undefined}function ReadableByteStreamControllerClose(t){const r=t._controlledReadableByteStream;if(t._closeRequested||r._state!=="readable"){return}if(t._queueTotalSize>0){t._closeRequested=true;return}if(t._pendingPullIntos.length>0){const r=t._pendingPullIntos.peek();if(r.bytesFilled>0){const r=new TypeError("Insufficient bytes to fill elements in the given buffer");ReadableByteStreamControllerError(t,r);throw r}}ReadableByteStreamControllerClearAlgorithms(t);ReadableStreamClose(r)}function ReadableByteStreamControllerEnqueue(t,r){const n=t._controlledReadableByteStream;if(t._closeRequested||n._state!=="readable"){return}const o=r.buffer;const i=r.byteOffset;const a=r.byteLength;const s=TransferArrayBuffer(o);if(t._pendingPullIntos.length>0){const r=t._pendingPullIntos.peek();if(IsDetachedBuffer(r.buffer));r.buffer=TransferArrayBuffer(r.buffer)}ReadableByteStreamControllerInvalidateBYOBRequest(t);if(ReadableStreamHasDefaultReader(n)){if(ReadableStreamGetNumReadRequests(n)===0){ReadableByteStreamControllerEnqueueChunkToQueue(t,s,i,a)}else{if(t._pendingPullIntos.length>0){ReadableByteStreamControllerShiftPendingPullInto(t)}const r=new Uint8Array(s,i,a);ReadableStreamFulfillReadRequest(n,r,false)}}else if(ReadableStreamHasBYOBReader(n)){ReadableByteStreamControllerEnqueueChunkToQueue(t,s,i,a);ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(t)}else{ReadableByteStreamControllerEnqueueChunkToQueue(t,s,i,a)}ReadableByteStreamControllerCallPullIfNeeded(t)}function ReadableByteStreamControllerError(t,r){const n=t._controlledReadableByteStream;if(n._state!=="readable"){return}ReadableByteStreamControllerClearPendingPullIntos(t);ResetQueue(t);ReadableByteStreamControllerClearAlgorithms(t);ReadableStreamError(n,r)}function ReadableByteStreamControllerGetBYOBRequest(t){if(t._byobRequest===null&&t._pendingPullIntos.length>0){const r=t._pendingPullIntos.peek();const n=new Uint8Array(r.buffer,r.byteOffset+r.bytesFilled,r.byteLength-r.bytesFilled);const o=Object.create(ReadableStreamBYOBRequest.prototype);SetUpReadableStreamBYOBRequest(o,t,n);t._byobRequest=o}return t._byobRequest}function ReadableByteStreamControllerGetDesiredSize(t){const r=t._controlledReadableByteStream._state;if(r==="errored"){return null}if(r==="closed"){return 0}return t._strategyHWM-t._queueTotalSize}function ReadableByteStreamControllerRespond(t,r){const n=t._pendingPullIntos.peek();const o=t._controlledReadableByteStream._state;if(o==="closed"){if(r!==0){throw new TypeError("bytesWritten must be 0 when calling respond() on a closed stream")}}else{if(r===0){throw new TypeError("bytesWritten must be greater than 0 when calling respond() on a readable stream")}if(n.bytesFilled+r>n.byteLength){throw new RangeError("bytesWritten out of range")}}n.buffer=TransferArrayBuffer(n.buffer);ReadableByteStreamControllerRespondInternal(t,r)}function ReadableByteStreamControllerRespondWithNewView(t,r){const n=t._pendingPullIntos.peek();const o=t._controlledReadableByteStream._state;if(o==="closed"){if(r.byteLength!==0){throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream")}}else{if(r.byteLength===0){throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream")}}if(n.byteOffset+n.bytesFilled!==r.byteOffset){throw new RangeError("The region specified by view does not match byobRequest")}if(n.bufferByteLength!==r.buffer.byteLength){throw new RangeError("The buffer of view has different capacity than byobRequest")}if(n.bytesFilled+r.byteLength>n.byteLength){throw new RangeError("The region specified by view is larger than byobRequest")}const i=r.byteLength;n.buffer=TransferArrayBuffer(r.buffer);ReadableByteStreamControllerRespondInternal(t,i)}function SetUpReadableByteStreamController(t,r,n,o,i,a,s){r._controlledReadableByteStream=t;r._pullAgain=false;r._pulling=false;r._byobRequest=null;r._queue=r._queueTotalSize=undefined;ResetQueue(r);r._closeRequested=false;r._started=false;r._strategyHWM=a;r._pullAlgorithm=o;r._cancelAlgorithm=i;r._autoAllocateChunkSize=s;r._pendingPullIntos=new SimpleQueue;t._readableStreamController=r;const l=n();uponPromise(promiseResolvedWith(l),(()=>{r._started=true;ReadableByteStreamControllerCallPullIfNeeded(r)}),(t=>{ReadableByteStreamControllerError(r,t)}))}function SetUpReadableByteStreamControllerFromUnderlyingSource(t,r,n){const o=Object.create(ReadableByteStreamController.prototype);let startAlgorithm=()=>undefined;let pullAlgorithm=()=>promiseResolvedWith(undefined);let cancelAlgorithm=()=>promiseResolvedWith(undefined);if(r.start!==undefined){startAlgorithm=()=>r.start(o)}if(r.pull!==undefined){pullAlgorithm=()=>r.pull(o)}if(r.cancel!==undefined){cancelAlgorithm=t=>r.cancel(t)}const i=r.autoAllocateChunkSize;if(i===0){throw new TypeError("autoAllocateChunkSize must be greater than 0")}SetUpReadableByteStreamController(t,o,startAlgorithm,pullAlgorithm,cancelAlgorithm,n,i)}function SetUpReadableStreamBYOBRequest(t,r,n){t._associatedReadableByteStreamController=r;t._view=n}function byobRequestBrandCheckException(t){return new TypeError(`ReadableStreamBYOBRequest.prototype.${t} can only be used on a ReadableStreamBYOBRequest`)}function byteStreamControllerBrandCheckException(t){return new TypeError(`ReadableByteStreamController.prototype.${t} can only be used on a ReadableByteStreamController`)}function AcquireReadableStreamBYOBReader(t){return new ReadableStreamBYOBReader(t)}function ReadableStreamAddReadIntoRequest(t,r){t._reader._readIntoRequests.push(r)}function ReadableStreamFulfillReadIntoRequest(t,r,n){const o=t._reader;const i=o._readIntoRequests.shift();if(n){i._closeSteps(r)}else{i._chunkSteps(r)}}function ReadableStreamGetNumReadIntoRequests(t){return t._reader._readIntoRequests.length}function ReadableStreamHasBYOBReader(t){const r=t._reader;if(r===undefined){return false}if(!IsReadableStreamBYOBReader(r)){return false}return true}class ReadableStreamBYOBReader{constructor(t){assertRequiredArgument(t,1,"ReadableStreamBYOBReader");assertReadableStream(t,"First parameter");if(IsReadableStreamLocked(t)){throw new TypeError("This stream has already been locked for exclusive reading by another reader")}if(!IsReadableByteStreamController(t._readableStreamController)){throw new TypeError("Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte "+"source")}ReadableStreamReaderGenericInitialize(this,t);this._readIntoRequests=new SimpleQueue}get closed(){if(!IsReadableStreamBYOBReader(this)){return promiseRejectedWith(byobReaderBrandCheckException("closed"))}return this._closedPromise}cancel(t=undefined){if(!IsReadableStreamBYOBReader(this)){return promiseRejectedWith(byobReaderBrandCheckException("cancel"))}if(this._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("cancel"))}return ReadableStreamReaderGenericCancel(this,t)}read(t){if(!IsReadableStreamBYOBReader(this)){return promiseRejectedWith(byobReaderBrandCheckException("read"))}if(!ArrayBuffer.isView(t)){return promiseRejectedWith(new TypeError("view must be an array buffer view"))}if(t.byteLength===0){return promiseRejectedWith(new TypeError("view must have non-zero byteLength"))}if(t.buffer.byteLength===0){return promiseRejectedWith(new TypeError(`view's buffer must have non-zero byteLength`))}if(IsDetachedBuffer(t.buffer));if(this._ownerReadableStream===undefined){return promiseRejectedWith(readerLockException("read from"))}let r;let n;const o=newPromise(((t,o)=>{r=t;n=o}));const i={_chunkSteps:t=>r({value:t,done:false}),_closeSteps:t=>r({value:t,done:true}),_errorSteps:t=>n(t)};ReadableStreamBYOBReaderRead(this,t,i);return o}releaseLock(){if(!IsReadableStreamBYOBReader(this)){throw byobReaderBrandCheckException("releaseLock")}if(this._ownerReadableStream===undefined){return}if(this._readIntoRequests.length>0){throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled")}ReadableStreamReaderGenericRelease(this)}}Object.defineProperties(ReadableStreamBYOBReader.prototype,{cancel:{enumerable:true},read:{enumerable:true},releaseLock:{enumerable:true},closed:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableStreamBYOBReader.prototype,r.toStringTag,{value:"ReadableStreamBYOBReader",configurable:true})}function IsReadableStreamBYOBReader(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_readIntoRequests")){return false}return t instanceof ReadableStreamBYOBReader}function ReadableStreamBYOBReaderRead(t,r,n){const o=t._ownerReadableStream;o._disturbed=true;if(o._state==="errored"){n._errorSteps(o._storedError)}else{ReadableByteStreamControllerPullInto(o._readableStreamController,r,n)}}function byobReaderBrandCheckException(t){return new TypeError(`ReadableStreamBYOBReader.prototype.${t} can only be used on a ReadableStreamBYOBReader`)}function ExtractHighWaterMark(t,r){const{highWaterMark:n}=t;if(n===undefined){return r}if(S(n)||n<0){throw new RangeError("Invalid highWaterMark")}return n}function ExtractSizeAlgorithm(t){const{size:r}=t;if(!r){return()=>1}return r}function convertQueuingStrategy(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.highWaterMark;const o=t===null||t===void 0?void 0:t.size;return{highWaterMark:n===undefined?undefined:convertUnrestrictedDouble(n),size:o===undefined?undefined:convertQueuingStrategySize(o,`${r} has member 'size' that`)}}function convertQueuingStrategySize(t,r){assertFunction(t,r);return r=>convertUnrestrictedDouble(t(r))}function convertUnderlyingSink(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.abort;const o=t===null||t===void 0?void 0:t.close;const i=t===null||t===void 0?void 0:t.start;const a=t===null||t===void 0?void 0:t.type;const s=t===null||t===void 0?void 0:t.write;return{abort:n===undefined?undefined:convertUnderlyingSinkAbortCallback(n,t,`${r} has member 'abort' that`),close:o===undefined?undefined:convertUnderlyingSinkCloseCallback(o,t,`${r} has member 'close' that`),start:i===undefined?undefined:convertUnderlyingSinkStartCallback(i,t,`${r} has member 'start' that`),write:s===undefined?undefined:convertUnderlyingSinkWriteCallback(s,t,`${r} has member 'write' that`),type:a}}function convertUnderlyingSinkAbortCallback(t,r,n){assertFunction(t,n);return n=>promiseCall(t,r,[n])}function convertUnderlyingSinkCloseCallback(t,r,n){assertFunction(t,n);return()=>promiseCall(t,r,[])}function convertUnderlyingSinkStartCallback(t,r,n){assertFunction(t,n);return n=>reflectCall(t,r,[n])}function convertUnderlyingSinkWriteCallback(t,r,n){assertFunction(t,n);return(n,o)=>promiseCall(t,r,[n,o])}function assertWritableStream(t,r){if(!IsWritableStream(t)){throw new TypeError(`${r} is not a WritableStream.`)}}function isAbortSignal(t){if(typeof t!=="object"||t===null){return false}try{return typeof t.aborted==="boolean"}catch(t){return false}}const v=typeof AbortController==="function";function createAbortController(){if(v){return new AbortController}return undefined}class WritableStream{constructor(t={},r={}){if(t===undefined){t=null}else{assertObject(t,"First parameter")}const n=convertQueuingStrategy(r,"Second parameter");const o=convertUnderlyingSink(t,"First parameter");InitializeWritableStream(this);const i=o.type;if(i!==undefined){throw new RangeError("Invalid type is specified")}const a=ExtractSizeAlgorithm(n);const s=ExtractHighWaterMark(n,1);SetUpWritableStreamDefaultControllerFromUnderlyingSink(this,o,s,a)}get locked(){if(!IsWritableStream(this)){throw streamBrandCheckException$2("locked")}return IsWritableStreamLocked(this)}abort(t=undefined){if(!IsWritableStream(this)){return promiseRejectedWith(streamBrandCheckException$2("abort"))}if(IsWritableStreamLocked(this)){return promiseRejectedWith(new TypeError("Cannot abort a stream that already has a writer"))}return WritableStreamAbort(this,t)}close(){if(!IsWritableStream(this)){return promiseRejectedWith(streamBrandCheckException$2("close"))}if(IsWritableStreamLocked(this)){return promiseRejectedWith(new TypeError("Cannot close a stream that already has a writer"))}if(WritableStreamCloseQueuedOrInFlight(this)){return promiseRejectedWith(new TypeError("Cannot close an already-closing stream"))}return WritableStreamClose(this)}getWriter(){if(!IsWritableStream(this)){throw streamBrandCheckException$2("getWriter")}return AcquireWritableStreamDefaultWriter(this)}}Object.defineProperties(WritableStream.prototype,{abort:{enumerable:true},close:{enumerable:true},getWriter:{enumerable:true},locked:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(WritableStream.prototype,r.toStringTag,{value:"WritableStream",configurable:true})}function AcquireWritableStreamDefaultWriter(t){return new WritableStreamDefaultWriter(t)}function CreateWritableStream(t,r,n,o,i=1,a=(()=>1)){const s=Object.create(WritableStream.prototype);InitializeWritableStream(s);const l=Object.create(WritableStreamDefaultController.prototype);SetUpWritableStreamDefaultController(s,l,t,r,n,o,i,a);return s}function InitializeWritableStream(t){t._state="writable";t._storedError=undefined;t._writer=undefined;t._writableStreamController=undefined;t._writeRequests=new SimpleQueue;t._inFlightWriteRequest=undefined;t._closeRequest=undefined;t._inFlightCloseRequest=undefined;t._pendingAbortRequest=undefined;t._backpressure=false}function IsWritableStream(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_writableStreamController")){return false}return t instanceof WritableStream}function IsWritableStreamLocked(t){if(t._writer===undefined){return false}return true}function WritableStreamAbort(t,r){var n;if(t._state==="closed"||t._state==="errored"){return promiseResolvedWith(undefined)}t._writableStreamController._abortReason=r;(n=t._writableStreamController._abortController)===null||n===void 0?void 0:n.abort();const o=t._state;if(o==="closed"||o==="errored"){return promiseResolvedWith(undefined)}if(t._pendingAbortRequest!==undefined){return t._pendingAbortRequest._promise}let i=false;if(o==="erroring"){i=true;r=undefined}const a=newPromise(((n,o)=>{t._pendingAbortRequest={_promise:undefined,_resolve:n,_reject:o,_reason:r,_wasAlreadyErroring:i}}));t._pendingAbortRequest._promise=a;if(!i){WritableStreamStartErroring(t,r)}return a}function WritableStreamClose(t){const r=t._state;if(r==="closed"||r==="errored"){return promiseRejectedWith(new TypeError(`The stream (in ${r} state) is not in the writable state and cannot be closed`))}const n=newPromise(((r,n)=>{const o={_resolve:r,_reject:n};t._closeRequest=o}));const o=t._writer;if(o!==undefined&&t._backpressure&&r==="writable"){defaultWriterReadyPromiseResolve(o)}WritableStreamDefaultControllerClose(t._writableStreamController);return n}function WritableStreamAddWriteRequest(t){const r=newPromise(((r,n)=>{const o={_resolve:r,_reject:n};t._writeRequests.push(o)}));return r}function WritableStreamDealWithRejection(t,r){const n=t._state;if(n==="writable"){WritableStreamStartErroring(t,r);return}WritableStreamFinishErroring(t)}function WritableStreamStartErroring(t,r){const n=t._writableStreamController;t._state="erroring";t._storedError=r;const o=t._writer;if(o!==undefined){WritableStreamDefaultWriterEnsureReadyPromiseRejected(o,r)}if(!WritableStreamHasOperationMarkedInFlight(t)&&n._started){WritableStreamFinishErroring(t)}}function WritableStreamFinishErroring(t){t._state="errored";t._writableStreamController[p]();const r=t._storedError;t._writeRequests.forEach((t=>{t._reject(r)}));t._writeRequests=new SimpleQueue;if(t._pendingAbortRequest===undefined){WritableStreamRejectCloseAndClosedPromiseIfNeeded(t);return}const n=t._pendingAbortRequest;t._pendingAbortRequest=undefined;if(n._wasAlreadyErroring){n._reject(r);WritableStreamRejectCloseAndClosedPromiseIfNeeded(t);return}const o=t._writableStreamController[d](n._reason);uponPromise(o,(()=>{n._resolve();WritableStreamRejectCloseAndClosedPromiseIfNeeded(t)}),(r=>{n._reject(r);WritableStreamRejectCloseAndClosedPromiseIfNeeded(t)}))}function WritableStreamFinishInFlightWrite(t){t._inFlightWriteRequest._resolve(undefined);t._inFlightWriteRequest=undefined}function WritableStreamFinishInFlightWriteWithError(t,r){t._inFlightWriteRequest._reject(r);t._inFlightWriteRequest=undefined;WritableStreamDealWithRejection(t,r)}function WritableStreamFinishInFlightClose(t){t._inFlightCloseRequest._resolve(undefined);t._inFlightCloseRequest=undefined;const r=t._state;if(r==="erroring"){t._storedError=undefined;if(t._pendingAbortRequest!==undefined){t._pendingAbortRequest._resolve();t._pendingAbortRequest=undefined}}t._state="closed";const n=t._writer;if(n!==undefined){defaultWriterClosedPromiseResolve(n)}}function WritableStreamFinishInFlightCloseWithError(t,r){t._inFlightCloseRequest._reject(r);t._inFlightCloseRequest=undefined;if(t._pendingAbortRequest!==undefined){t._pendingAbortRequest._reject(r);t._pendingAbortRequest=undefined}WritableStreamDealWithRejection(t,r)}function WritableStreamCloseQueuedOrInFlight(t){if(t._closeRequest===undefined&&t._inFlightCloseRequest===undefined){return false}return true}function WritableStreamHasOperationMarkedInFlight(t){if(t._inFlightWriteRequest===undefined&&t._inFlightCloseRequest===undefined){return false}return true}function WritableStreamMarkCloseRequestInFlight(t){t._inFlightCloseRequest=t._closeRequest;t._closeRequest=undefined}function WritableStreamMarkFirstWriteRequestInFlight(t){t._inFlightWriteRequest=t._writeRequests.shift()}function WritableStreamRejectCloseAndClosedPromiseIfNeeded(t){if(t._closeRequest!==undefined){t._closeRequest._reject(t._storedError);t._closeRequest=undefined}const r=t._writer;if(r!==undefined){defaultWriterClosedPromiseReject(r,t._storedError)}}function WritableStreamUpdateBackpressure(t,r){const n=t._writer;if(n!==undefined&&r!==t._backpressure){if(r){defaultWriterReadyPromiseReset(n)}else{defaultWriterReadyPromiseResolve(n)}}t._backpressure=r}class WritableStreamDefaultWriter{constructor(t){assertRequiredArgument(t,1,"WritableStreamDefaultWriter");assertWritableStream(t,"First parameter");if(IsWritableStreamLocked(t)){throw new TypeError("This stream has already been locked for exclusive writing by another writer")}this._ownerWritableStream=t;t._writer=this;const r=t._state;if(r==="writable"){if(!WritableStreamCloseQueuedOrInFlight(t)&&t._backpressure){defaultWriterReadyPromiseInitialize(this)}else{defaultWriterReadyPromiseInitializeAsResolved(this)}defaultWriterClosedPromiseInitialize(this)}else if(r==="erroring"){defaultWriterReadyPromiseInitializeAsRejected(this,t._storedError);defaultWriterClosedPromiseInitialize(this)}else if(r==="closed"){defaultWriterReadyPromiseInitializeAsResolved(this);defaultWriterClosedPromiseInitializeAsResolved(this)}else{const r=t._storedError;defaultWriterReadyPromiseInitializeAsRejected(this,r);defaultWriterClosedPromiseInitializeAsRejected(this,r)}}get closed(){if(!IsWritableStreamDefaultWriter(this)){return promiseRejectedWith(defaultWriterBrandCheckException("closed"))}return this._closedPromise}get desiredSize(){if(!IsWritableStreamDefaultWriter(this)){throw defaultWriterBrandCheckException("desiredSize")}if(this._ownerWritableStream===undefined){throw defaultWriterLockException("desiredSize")}return WritableStreamDefaultWriterGetDesiredSize(this)}get ready(){if(!IsWritableStreamDefaultWriter(this)){return promiseRejectedWith(defaultWriterBrandCheckException("ready"))}return this._readyPromise}abort(t=undefined){if(!IsWritableStreamDefaultWriter(this)){return promiseRejectedWith(defaultWriterBrandCheckException("abort"))}if(this._ownerWritableStream===undefined){return promiseRejectedWith(defaultWriterLockException("abort"))}return WritableStreamDefaultWriterAbort(this,t)}close(){if(!IsWritableStreamDefaultWriter(this)){return promiseRejectedWith(defaultWriterBrandCheckException("close"))}const t=this._ownerWritableStream;if(t===undefined){return promiseRejectedWith(defaultWriterLockException("close"))}if(WritableStreamCloseQueuedOrInFlight(t)){return promiseRejectedWith(new TypeError("Cannot close an already-closing stream"))}return WritableStreamDefaultWriterClose(this)}releaseLock(){if(!IsWritableStreamDefaultWriter(this)){throw defaultWriterBrandCheckException("releaseLock")}const t=this._ownerWritableStream;if(t===undefined){return}WritableStreamDefaultWriterRelease(this)}write(t=undefined){if(!IsWritableStreamDefaultWriter(this)){return promiseRejectedWith(defaultWriterBrandCheckException("write"))}if(this._ownerWritableStream===undefined){return promiseRejectedWith(defaultWriterLockException("write to"))}return WritableStreamDefaultWriterWrite(this,t)}}Object.defineProperties(WritableStreamDefaultWriter.prototype,{abort:{enumerable:true},close:{enumerable:true},releaseLock:{enumerable:true},write:{enumerable:true},closed:{enumerable:true},desiredSize:{enumerable:true},ready:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(WritableStreamDefaultWriter.prototype,r.toStringTag,{value:"WritableStreamDefaultWriter",configurable:true})}function IsWritableStreamDefaultWriter(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_ownerWritableStream")){return false}return t instanceof WritableStreamDefaultWriter}function WritableStreamDefaultWriterAbort(t,r){const n=t._ownerWritableStream;return WritableStreamAbort(n,r)}function WritableStreamDefaultWriterClose(t){const r=t._ownerWritableStream;return WritableStreamClose(r)}function WritableStreamDefaultWriterCloseWithErrorPropagation(t){const r=t._ownerWritableStream;const n=r._state;if(WritableStreamCloseQueuedOrInFlight(r)||n==="closed"){return promiseResolvedWith(undefined)}if(n==="errored"){return promiseRejectedWith(r._storedError)}return WritableStreamDefaultWriterClose(t)}function WritableStreamDefaultWriterEnsureClosedPromiseRejected(t,r){if(t._closedPromiseState==="pending"){defaultWriterClosedPromiseReject(t,r)}else{defaultWriterClosedPromiseResetToRejected(t,r)}}function WritableStreamDefaultWriterEnsureReadyPromiseRejected(t,r){if(t._readyPromiseState==="pending"){defaultWriterReadyPromiseReject(t,r)}else{defaultWriterReadyPromiseResetToRejected(t,r)}}function WritableStreamDefaultWriterGetDesiredSize(t){const r=t._ownerWritableStream;const n=r._state;if(n==="errored"||n==="erroring"){return null}if(n==="closed"){return 0}return WritableStreamDefaultControllerGetDesiredSize(r._writableStreamController)}function WritableStreamDefaultWriterRelease(t){const r=t._ownerWritableStream;const n=new TypeError(`Writer was released and can no longer be used to monitor the stream's closedness`);WritableStreamDefaultWriterEnsureReadyPromiseRejected(t,n);WritableStreamDefaultWriterEnsureClosedPromiseRejected(t,n);r._writer=undefined;t._ownerWritableStream=undefined}function WritableStreamDefaultWriterWrite(t,r){const n=t._ownerWritableStream;const o=n._writableStreamController;const i=WritableStreamDefaultControllerGetChunkSize(o,r);if(n!==t._ownerWritableStream){return promiseRejectedWith(defaultWriterLockException("write to"))}const a=n._state;if(a==="errored"){return promiseRejectedWith(n._storedError)}if(WritableStreamCloseQueuedOrInFlight(n)||a==="closed"){return promiseRejectedWith(new TypeError("The stream is closing or closed and cannot be written to"))}if(a==="erroring"){return promiseRejectedWith(n._storedError)}const s=WritableStreamAddWriteRequest(n);WritableStreamDefaultControllerWrite(o,r,i);return s}const _={};class WritableStreamDefaultController{constructor(){throw new TypeError("Illegal constructor")}get abortReason(){if(!IsWritableStreamDefaultController(this)){throw defaultControllerBrandCheckException$2("abortReason")}return this._abortReason}get signal(){if(!IsWritableStreamDefaultController(this)){throw defaultControllerBrandCheckException$2("signal")}if(this._abortController===undefined){throw new TypeError("WritableStreamDefaultController.prototype.signal is not supported")}return this._abortController.signal}error(t=undefined){if(!IsWritableStreamDefaultController(this)){throw defaultControllerBrandCheckException$2("error")}const r=this._controlledWritableStream._state;if(r!=="writable"){return}WritableStreamDefaultControllerError(this,t)}[d](t){const r=this._abortAlgorithm(t);WritableStreamDefaultControllerClearAlgorithms(this);return r}[p](){ResetQueue(this)}}Object.defineProperties(WritableStreamDefaultController.prototype,{abortReason:{enumerable:true},signal:{enumerable:true},error:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(WritableStreamDefaultController.prototype,r.toStringTag,{value:"WritableStreamDefaultController",configurable:true})}function IsWritableStreamDefaultController(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_controlledWritableStream")){return false}return t instanceof WritableStreamDefaultController}function SetUpWritableStreamDefaultController(t,r,n,o,i,a,s,l){r._controlledWritableStream=t;t._writableStreamController=r;r._queue=undefined;r._queueTotalSize=undefined;ResetQueue(r);r._abortReason=undefined;r._abortController=createAbortController();r._started=false;r._strategySizeAlgorithm=l;r._strategyHWM=s;r._writeAlgorithm=o;r._closeAlgorithm=i;r._abortAlgorithm=a;const u=WritableStreamDefaultControllerGetBackpressure(r);WritableStreamUpdateBackpressure(t,u);const c=n();const d=promiseResolvedWith(c);uponPromise(d,(()=>{r._started=true;WritableStreamDefaultControllerAdvanceQueueIfNeeded(r)}),(n=>{r._started=true;WritableStreamDealWithRejection(t,n)}))}function SetUpWritableStreamDefaultControllerFromUnderlyingSink(t,r,n,o){const i=Object.create(WritableStreamDefaultController.prototype);let startAlgorithm=()=>undefined;let writeAlgorithm=()=>promiseResolvedWith(undefined);let closeAlgorithm=()=>promiseResolvedWith(undefined);let abortAlgorithm=()=>promiseResolvedWith(undefined);if(r.start!==undefined){startAlgorithm=()=>r.start(i)}if(r.write!==undefined){writeAlgorithm=t=>r.write(t,i)}if(r.close!==undefined){closeAlgorithm=()=>r.close()}if(r.abort!==undefined){abortAlgorithm=t=>r.abort(t)}SetUpWritableStreamDefaultController(t,i,startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,n,o)}function WritableStreamDefaultControllerClearAlgorithms(t){t._writeAlgorithm=undefined;t._closeAlgorithm=undefined;t._abortAlgorithm=undefined;t._strategySizeAlgorithm=undefined}function WritableStreamDefaultControllerClose(t){EnqueueValueWithSize(t,_,0);WritableStreamDefaultControllerAdvanceQueueIfNeeded(t)}function WritableStreamDefaultControllerGetChunkSize(t,r){try{return t._strategySizeAlgorithm(r)}catch(r){WritableStreamDefaultControllerErrorIfNeeded(t,r);return 1}}function WritableStreamDefaultControllerGetDesiredSize(t){return t._strategyHWM-t._queueTotalSize}function WritableStreamDefaultControllerWrite(t,r,n){try{EnqueueValueWithSize(t,r,n)}catch(r){WritableStreamDefaultControllerErrorIfNeeded(t,r);return}const o=t._controlledWritableStream;if(!WritableStreamCloseQueuedOrInFlight(o)&&o._state==="writable"){const r=WritableStreamDefaultControllerGetBackpressure(t);WritableStreamUpdateBackpressure(o,r)}WritableStreamDefaultControllerAdvanceQueueIfNeeded(t)}function WritableStreamDefaultControllerAdvanceQueueIfNeeded(t){const r=t._controlledWritableStream;if(!t._started){return}if(r._inFlightWriteRequest!==undefined){return}const n=r._state;if(n==="erroring"){WritableStreamFinishErroring(r);return}if(t._queue.length===0){return}const o=PeekQueueValue(t);if(o===_){WritableStreamDefaultControllerProcessClose(t)}else{WritableStreamDefaultControllerProcessWrite(t,o)}}function WritableStreamDefaultControllerErrorIfNeeded(t,r){if(t._controlledWritableStream._state==="writable"){WritableStreamDefaultControllerError(t,r)}}function WritableStreamDefaultControllerProcessClose(t){const r=t._controlledWritableStream;WritableStreamMarkCloseRequestInFlight(r);DequeueValue(t);const n=t._closeAlgorithm();WritableStreamDefaultControllerClearAlgorithms(t);uponPromise(n,(()=>{WritableStreamFinishInFlightClose(r)}),(t=>{WritableStreamFinishInFlightCloseWithError(r,t)}))}function WritableStreamDefaultControllerProcessWrite(t,r){const n=t._controlledWritableStream;WritableStreamMarkFirstWriteRequestInFlight(n);const o=t._writeAlgorithm(r);uponPromise(o,(()=>{WritableStreamFinishInFlightWrite(n);const r=n._state;DequeueValue(t);if(!WritableStreamCloseQueuedOrInFlight(n)&&r==="writable"){const r=WritableStreamDefaultControllerGetBackpressure(t);WritableStreamUpdateBackpressure(n,r)}WritableStreamDefaultControllerAdvanceQueueIfNeeded(t)}),(r=>{if(n._state==="writable"){WritableStreamDefaultControllerClearAlgorithms(t)}WritableStreamFinishInFlightWriteWithError(n,r)}))}function WritableStreamDefaultControllerGetBackpressure(t){const r=WritableStreamDefaultControllerGetDesiredSize(t);return r<=0}function WritableStreamDefaultControllerError(t,r){const n=t._controlledWritableStream;WritableStreamDefaultControllerClearAlgorithms(t);WritableStreamStartErroring(n,r)}function streamBrandCheckException$2(t){return new TypeError(`WritableStream.prototype.${t} can only be used on a WritableStream`)}function defaultControllerBrandCheckException$2(t){return new TypeError(`WritableStreamDefaultController.prototype.${t} can only be used on a WritableStreamDefaultController`)}function defaultWriterBrandCheckException(t){return new TypeError(`WritableStreamDefaultWriter.prototype.${t} can only be used on a WritableStreamDefaultWriter`)}function defaultWriterLockException(t){return new TypeError("Cannot "+t+" a stream using a released writer")}function defaultWriterClosedPromiseInitialize(t){t._closedPromise=newPromise(((r,n)=>{t._closedPromise_resolve=r;t._closedPromise_reject=n;t._closedPromiseState="pending"}))}function defaultWriterClosedPromiseInitializeAsRejected(t,r){defaultWriterClosedPromiseInitialize(t);defaultWriterClosedPromiseReject(t,r)}function defaultWriterClosedPromiseInitializeAsResolved(t){defaultWriterClosedPromiseInitialize(t);defaultWriterClosedPromiseResolve(t)}function defaultWriterClosedPromiseReject(t,r){if(t._closedPromise_reject===undefined){return}setPromiseIsHandledToTrue(t._closedPromise);t._closedPromise_reject(r);t._closedPromise_resolve=undefined;t._closedPromise_reject=undefined;t._closedPromiseState="rejected"}function defaultWriterClosedPromiseResetToRejected(t,r){defaultWriterClosedPromiseInitializeAsRejected(t,r)}function defaultWriterClosedPromiseResolve(t){if(t._closedPromise_resolve===undefined){return}t._closedPromise_resolve(undefined);t._closedPromise_resolve=undefined;t._closedPromise_reject=undefined;t._closedPromiseState="resolved"}function defaultWriterReadyPromiseInitialize(t){t._readyPromise=newPromise(((r,n)=>{t._readyPromise_resolve=r;t._readyPromise_reject=n}));t._readyPromiseState="pending"}function defaultWriterReadyPromiseInitializeAsRejected(t,r){defaultWriterReadyPromiseInitialize(t);defaultWriterReadyPromiseReject(t,r)}function defaultWriterReadyPromiseInitializeAsResolved(t){defaultWriterReadyPromiseInitialize(t);defaultWriterReadyPromiseResolve(t)}function defaultWriterReadyPromiseReject(t,r){if(t._readyPromise_reject===undefined){return}setPromiseIsHandledToTrue(t._readyPromise);t._readyPromise_reject(r);t._readyPromise_resolve=undefined;t._readyPromise_reject=undefined;t._readyPromiseState="rejected"}function defaultWriterReadyPromiseReset(t){defaultWriterReadyPromiseInitialize(t)}function defaultWriterReadyPromiseResetToRejected(t,r){defaultWriterReadyPromiseInitializeAsRejected(t,r)}function defaultWriterReadyPromiseResolve(t){if(t._readyPromise_resolve===undefined){return}t._readyPromise_resolve(undefined);t._readyPromise_resolve=undefined;t._readyPromise_reject=undefined;t._readyPromiseState="fulfilled"}const w=typeof DOMException!=="undefined"?DOMException:undefined;function isDOMExceptionConstructor(t){if(!(typeof t==="function"||typeof t==="object")){return false}try{new t;return true}catch(t){return false}}function createDOMExceptionPolyfill(){const t=function DOMException(t,r){this.message=t||"";this.name=r||"Error";if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}};t.prototype=Object.create(Error.prototype);Object.defineProperty(t.prototype,"constructor",{value:t,writable:true,configurable:true});return t}const C=isDOMExceptionConstructor(w)?w:createDOMExceptionPolyfill();function ReadableStreamPipeTo(t,r,n,o,i,a){const s=AcquireReadableStreamDefaultReader(t);const l=AcquireWritableStreamDefaultWriter(r);t._disturbed=true;let u=false;let c=promiseResolvedWith(undefined);return newPromise(((d,p)=>{let h;if(a!==undefined){h=()=>{const n=new C("Aborted","AbortError");const a=[];if(!o){a.push((()=>{if(r._state==="writable"){return WritableStreamAbort(r,n)}return promiseResolvedWith(undefined)}))}if(!i){a.push((()=>{if(t._state==="readable"){return ReadableStreamCancel(t,n)}return promiseResolvedWith(undefined)}))}shutdownWithAction((()=>Promise.all(a.map((t=>t())))),true,n)};if(a.aborted){h();return}a.addEventListener("abort",h)}function pipeLoop(){return newPromise(((t,r)=>{function next(n){if(n){t()}else{PerformPromiseThen(pipeStep(),next,r)}}next(false)}))}function pipeStep(){if(u){return promiseResolvedWith(true)}return PerformPromiseThen(l._readyPromise,(()=>newPromise(((t,r)=>{ReadableStreamDefaultReaderRead(s,{_chunkSteps:r=>{c=PerformPromiseThen(WritableStreamDefaultWriterWrite(l,r),undefined,noop);t(false)},_closeSteps:()=>t(true),_errorSteps:r})}))))}isOrBecomesErrored(t,s._closedPromise,(t=>{if(!o){shutdownWithAction((()=>WritableStreamAbort(r,t)),true,t)}else{shutdown(true,t)}}));isOrBecomesErrored(r,l._closedPromise,(r=>{if(!i){shutdownWithAction((()=>ReadableStreamCancel(t,r)),true,r)}else{shutdown(true,r)}}));isOrBecomesClosed(t,s._closedPromise,(()=>{if(!n){shutdownWithAction((()=>WritableStreamDefaultWriterCloseWithErrorPropagation(l)))}else{shutdown()}}));if(WritableStreamCloseQueuedOrInFlight(r)||r._state==="closed"){const r=new TypeError("the destination writable stream closed before all data could be piped to it");if(!i){shutdownWithAction((()=>ReadableStreamCancel(t,r)),true,r)}else{shutdown(true,r)}}setPromiseIsHandledToTrue(pipeLoop());function waitForWritesToFinish(){const t=c;return PerformPromiseThen(c,(()=>t!==c?waitForWritesToFinish():undefined))}function isOrBecomesErrored(t,r,n){if(t._state==="errored"){n(t._storedError)}else{uponRejection(r,n)}}function isOrBecomesClosed(t,r,n){if(t._state==="closed"){n()}else{uponFulfillment(r,n)}}function shutdownWithAction(t,n,o){if(u){return}u=true;if(r._state==="writable"&&!WritableStreamCloseQueuedOrInFlight(r)){uponFulfillment(waitForWritesToFinish(),doTheRest)}else{doTheRest()}function doTheRest(){uponPromise(t(),(()=>finalize(n,o)),(t=>finalize(true,t)))}}function shutdown(t,n){if(u){return}u=true;if(r._state==="writable"&&!WritableStreamCloseQueuedOrInFlight(r)){uponFulfillment(waitForWritesToFinish(),(()=>finalize(t,n)))}else{finalize(t,n)}}function finalize(t,r){WritableStreamDefaultWriterRelease(l);ReadableStreamReaderGenericRelease(s);if(a!==undefined){a.removeEventListener("abort",h)}if(t){p(r)}else{d(undefined)}}}))}class ReadableStreamDefaultController{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!IsReadableStreamDefaultController(this)){throw defaultControllerBrandCheckException$1("desiredSize")}return ReadableStreamDefaultControllerGetDesiredSize(this)}close(){if(!IsReadableStreamDefaultController(this)){throw defaultControllerBrandCheckException$1("close")}if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)){throw new TypeError("The stream is not in a state that permits close")}ReadableStreamDefaultControllerClose(this)}enqueue(t=undefined){if(!IsReadableStreamDefaultController(this)){throw defaultControllerBrandCheckException$1("enqueue")}if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(this)){throw new TypeError("The stream is not in a state that permits enqueue")}return ReadableStreamDefaultControllerEnqueue(this,t)}error(t=undefined){if(!IsReadableStreamDefaultController(this)){throw defaultControllerBrandCheckException$1("error")}ReadableStreamDefaultControllerError(this,t)}[h](t){ResetQueue(this);const r=this._cancelAlgorithm(t);ReadableStreamDefaultControllerClearAlgorithms(this);return r}[m](t){const r=this._controlledReadableStream;if(this._queue.length>0){const n=DequeueValue(this);if(this._closeRequested&&this._queue.length===0){ReadableStreamDefaultControllerClearAlgorithms(this);ReadableStreamClose(r)}else{ReadableStreamDefaultControllerCallPullIfNeeded(this)}t._chunkSteps(n)}else{ReadableStreamAddReadRequest(r,t);ReadableStreamDefaultControllerCallPullIfNeeded(this)}}}Object.defineProperties(ReadableStreamDefaultController.prototype,{close:{enumerable:true},enqueue:{enumerable:true},error:{enumerable:true},desiredSize:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableStreamDefaultController.prototype,r.toStringTag,{value:"ReadableStreamDefaultController",configurable:true})}function IsReadableStreamDefaultController(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_controlledReadableStream")){return false}return t instanceof ReadableStreamDefaultController}function ReadableStreamDefaultControllerCallPullIfNeeded(t){const r=ReadableStreamDefaultControllerShouldCallPull(t);if(!r){return}if(t._pulling){t._pullAgain=true;return}t._pulling=true;const n=t._pullAlgorithm();uponPromise(n,(()=>{t._pulling=false;if(t._pullAgain){t._pullAgain=false;ReadableStreamDefaultControllerCallPullIfNeeded(t)}}),(r=>{ReadableStreamDefaultControllerError(t,r)}))}function ReadableStreamDefaultControllerShouldCallPull(t){const r=t._controlledReadableStream;if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(t)){return false}if(!t._started){return false}if(IsReadableStreamLocked(r)&&ReadableStreamGetNumReadRequests(r)>0){return true}const n=ReadableStreamDefaultControllerGetDesiredSize(t);if(n>0){return true}return false}function ReadableStreamDefaultControllerClearAlgorithms(t){t._pullAlgorithm=undefined;t._cancelAlgorithm=undefined;t._strategySizeAlgorithm=undefined}function ReadableStreamDefaultControllerClose(t){if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(t)){return}const r=t._controlledReadableStream;t._closeRequested=true;if(t._queue.length===0){ReadableStreamDefaultControllerClearAlgorithms(t);ReadableStreamClose(r)}}function ReadableStreamDefaultControllerEnqueue(t,r){if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(t)){return}const n=t._controlledReadableStream;if(IsReadableStreamLocked(n)&&ReadableStreamGetNumReadRequests(n)>0){ReadableStreamFulfillReadRequest(n,r,false)}else{let n;try{n=t._strategySizeAlgorithm(r)}catch(r){ReadableStreamDefaultControllerError(t,r);throw r}try{EnqueueValueWithSize(t,r,n)}catch(r){ReadableStreamDefaultControllerError(t,r);throw r}}ReadableStreamDefaultControllerCallPullIfNeeded(t)}function ReadableStreamDefaultControllerError(t,r){const n=t._controlledReadableStream;if(n._state!=="readable"){return}ResetQueue(t);ReadableStreamDefaultControllerClearAlgorithms(t);ReadableStreamError(n,r)}function ReadableStreamDefaultControllerGetDesiredSize(t){const r=t._controlledReadableStream._state;if(r==="errored"){return null}if(r==="closed"){return 0}return t._strategyHWM-t._queueTotalSize}function ReadableStreamDefaultControllerHasBackpressure(t){if(ReadableStreamDefaultControllerShouldCallPull(t)){return false}return true}function ReadableStreamDefaultControllerCanCloseOrEnqueue(t){const r=t._controlledReadableStream._state;if(!t._closeRequested&&r==="readable"){return true}return false}function SetUpReadableStreamDefaultController(t,r,n,o,i,a,s){r._controlledReadableStream=t;r._queue=undefined;r._queueTotalSize=undefined;ResetQueue(r);r._started=false;r._closeRequested=false;r._pullAgain=false;r._pulling=false;r._strategySizeAlgorithm=s;r._strategyHWM=a;r._pullAlgorithm=o;r._cancelAlgorithm=i;t._readableStreamController=r;const l=n();uponPromise(promiseResolvedWith(l),(()=>{r._started=true;ReadableStreamDefaultControllerCallPullIfNeeded(r)}),(t=>{ReadableStreamDefaultControllerError(r,t)}))}function SetUpReadableStreamDefaultControllerFromUnderlyingSource(t,r,n,o){const i=Object.create(ReadableStreamDefaultController.prototype);let startAlgorithm=()=>undefined;let pullAlgorithm=()=>promiseResolvedWith(undefined);let cancelAlgorithm=()=>promiseResolvedWith(undefined);if(r.start!==undefined){startAlgorithm=()=>r.start(i)}if(r.pull!==undefined){pullAlgorithm=()=>r.pull(i)}if(r.cancel!==undefined){cancelAlgorithm=t=>r.cancel(t)}SetUpReadableStreamDefaultController(t,i,startAlgorithm,pullAlgorithm,cancelAlgorithm,n,o)}function defaultControllerBrandCheckException$1(t){return new TypeError(`ReadableStreamDefaultController.prototype.${t} can only be used on a ReadableStreamDefaultController`)}function ReadableStreamTee(t,r){if(IsReadableByteStreamController(t._readableStreamController)){return ReadableByteStreamTee(t)}return ReadableStreamDefaultTee(t)}function ReadableStreamDefaultTee(t,r){const n=AcquireReadableStreamDefaultReader(t);let o=false;let i=false;let a=false;let s=false;let l;let c;let d;let p;let h;const m=newPromise((t=>{h=t}));function pullAlgorithm(){if(o){i=true;return promiseResolvedWith(undefined)}o=true;const t={_chunkSteps:t=>{u((()=>{i=false;const r=t;const n=t;if(!a){ReadableStreamDefaultControllerEnqueue(d._readableStreamController,r)}if(!s){ReadableStreamDefaultControllerEnqueue(p._readableStreamController,n)}o=false;if(i){pullAlgorithm()}}))},_closeSteps:()=>{o=false;if(!a){ReadableStreamDefaultControllerClose(d._readableStreamController)}if(!s){ReadableStreamDefaultControllerClose(p._readableStreamController)}if(!a||!s){h(undefined)}},_errorSteps:()=>{o=false}};ReadableStreamDefaultReaderRead(n,t);return promiseResolvedWith(undefined)}function cancel1Algorithm(r){a=true;l=r;if(s){const r=CreateArrayFromList([l,c]);const n=ReadableStreamCancel(t,r);h(n)}return m}function cancel2Algorithm(r){s=true;c=r;if(a){const r=CreateArrayFromList([l,c]);const n=ReadableStreamCancel(t,r);h(n)}return m}function startAlgorithm(){}d=CreateReadableStream(startAlgorithm,pullAlgorithm,cancel1Algorithm);p=CreateReadableStream(startAlgorithm,pullAlgorithm,cancel2Algorithm);uponRejection(n._closedPromise,(t=>{ReadableStreamDefaultControllerError(d._readableStreamController,t);ReadableStreamDefaultControllerError(p._readableStreamController,t);if(!a||!s){h(undefined)}}));return[d,p]}function ReadableByteStreamTee(t){let r=AcquireReadableStreamDefaultReader(t);let n=false;let o=false;let i=false;let a=false;let s=false;let l;let c;let d;let p;let h;const m=newPromise((t=>{h=t}));function forwardReaderError(t){uponRejection(t._closedPromise,(n=>{if(t!==r){return}ReadableByteStreamControllerError(d._readableStreamController,n);ReadableByteStreamControllerError(p._readableStreamController,n);if(!a||!s){h(undefined)}}))}function pullWithDefaultReader(){if(IsReadableStreamBYOBReader(r)){ReadableStreamReaderGenericRelease(r);r=AcquireReadableStreamDefaultReader(t);forwardReaderError(r)}const l={_chunkSteps:r=>{u((()=>{o=false;i=false;const l=r;let u=r;if(!a&&!s){try{u=CloneAsUint8Array(r)}catch(r){ReadableByteStreamControllerError(d._readableStreamController,r);ReadableByteStreamControllerError(p._readableStreamController,r);h(ReadableStreamCancel(t,r));return}}if(!a){ReadableByteStreamControllerEnqueue(d._readableStreamController,l)}if(!s){ReadableByteStreamControllerEnqueue(p._readableStreamController,u)}n=false;if(o){pull1Algorithm()}else if(i){pull2Algorithm()}}))},_closeSteps:()=>{n=false;if(!a){ReadableByteStreamControllerClose(d._readableStreamController)}if(!s){ReadableByteStreamControllerClose(p._readableStreamController)}if(d._readableStreamController._pendingPullIntos.length>0){ReadableByteStreamControllerRespond(d._readableStreamController,0)}if(p._readableStreamController._pendingPullIntos.length>0){ReadableByteStreamControllerRespond(p._readableStreamController,0)}if(!a||!s){h(undefined)}},_errorSteps:()=>{n=false}};ReadableStreamDefaultReaderRead(r,l)}function pullWithBYOBReader(l,c){if(IsReadableStreamDefaultReader(r)){ReadableStreamReaderGenericRelease(r);r=AcquireReadableStreamBYOBReader(t);forwardReaderError(r)}const m=c?p:d;const b=c?d:p;const y={_chunkSteps:r=>{u((()=>{o=false;i=false;const l=c?s:a;const u=c?a:s;if(!u){let n;try{n=CloneAsUint8Array(r)}catch(r){ReadableByteStreamControllerError(m._readableStreamController,r);ReadableByteStreamControllerError(b._readableStreamController,r);h(ReadableStreamCancel(t,r));return}if(!l){ReadableByteStreamControllerRespondWithNewView(m._readableStreamController,r)}ReadableByteStreamControllerEnqueue(b._readableStreamController,n)}else if(!l){ReadableByteStreamControllerRespondWithNewView(m._readableStreamController,r)}n=false;if(o){pull1Algorithm()}else if(i){pull2Algorithm()}}))},_closeSteps:t=>{n=false;const r=c?s:a;const o=c?a:s;if(!r){ReadableByteStreamControllerClose(m._readableStreamController)}if(!o){ReadableByteStreamControllerClose(b._readableStreamController)}if(t!==undefined){if(!r){ReadableByteStreamControllerRespondWithNewView(m._readableStreamController,t)}if(!o&&b._readableStreamController._pendingPullIntos.length>0){ReadableByteStreamControllerRespond(b._readableStreamController,0)}}if(!r||!o){h(undefined)}},_errorSteps:()=>{n=false}};ReadableStreamBYOBReaderRead(r,l,y)}function pull1Algorithm(){if(n){o=true;return promiseResolvedWith(undefined)}n=true;const t=ReadableByteStreamControllerGetBYOBRequest(d._readableStreamController);if(t===null){pullWithDefaultReader()}else{pullWithBYOBReader(t._view,false)}return promiseResolvedWith(undefined)}function pull2Algorithm(){if(n){i=true;return promiseResolvedWith(undefined)}n=true;const t=ReadableByteStreamControllerGetBYOBRequest(p._readableStreamController);if(t===null){pullWithDefaultReader()}else{pullWithBYOBReader(t._view,true)}return promiseResolvedWith(undefined)}function cancel1Algorithm(r){a=true;l=r;if(s){const r=CreateArrayFromList([l,c]);const n=ReadableStreamCancel(t,r);h(n)}return m}function cancel2Algorithm(r){s=true;c=r;if(a){const r=CreateArrayFromList([l,c]);const n=ReadableStreamCancel(t,r);h(n)}return m}function startAlgorithm(){return}d=CreateReadableByteStream(startAlgorithm,pull1Algorithm,cancel1Algorithm);p=CreateReadableByteStream(startAlgorithm,pull2Algorithm,cancel2Algorithm);forwardReaderError(r);return[d,p]}function convertUnderlyingDefaultOrByteSource(t,r){assertDictionary(t,r);const n=t;const o=n===null||n===void 0?void 0:n.autoAllocateChunkSize;const i=n===null||n===void 0?void 0:n.cancel;const a=n===null||n===void 0?void 0:n.pull;const s=n===null||n===void 0?void 0:n.start;const l=n===null||n===void 0?void 0:n.type;return{autoAllocateChunkSize:o===undefined?undefined:convertUnsignedLongLongWithEnforceRange(o,`${r} has member 'autoAllocateChunkSize' that`),cancel:i===undefined?undefined:convertUnderlyingSourceCancelCallback(i,n,`${r} has member 'cancel' that`),pull:a===undefined?undefined:convertUnderlyingSourcePullCallback(a,n,`${r} has member 'pull' that`),start:s===undefined?undefined:convertUnderlyingSourceStartCallback(s,n,`${r} has member 'start' that`),type:l===undefined?undefined:convertReadableStreamType(l,`${r} has member 'type' that`)}}function convertUnderlyingSourceCancelCallback(t,r,n){assertFunction(t,n);return n=>promiseCall(t,r,[n])}function convertUnderlyingSourcePullCallback(t,r,n){assertFunction(t,n);return n=>promiseCall(t,r,[n])}function convertUnderlyingSourceStartCallback(t,r,n){assertFunction(t,n);return n=>reflectCall(t,r,[n])}function convertReadableStreamType(t,r){t=`${t}`;if(t!=="bytes"){throw new TypeError(`${r} '${t}' is not a valid enumeration value for ReadableStreamType`)}return t}function convertReaderOptions(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.mode;return{mode:n===undefined?undefined:convertReadableStreamReaderMode(n,`${r} has member 'mode' that`)}}function convertReadableStreamReaderMode(t,r){t=`${t}`;if(t!=="byob"){throw new TypeError(`${r} '${t}' is not a valid enumeration value for ReadableStreamReaderMode`)}return t}function convertIteratorOptions(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.preventCancel;return{preventCancel:Boolean(n)}}function convertPipeOptions(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.preventAbort;const o=t===null||t===void 0?void 0:t.preventCancel;const i=t===null||t===void 0?void 0:t.preventClose;const a=t===null||t===void 0?void 0:t.signal;if(a!==undefined){assertAbortSignal(a,`${r} has member 'signal' that`)}return{preventAbort:Boolean(n),preventCancel:Boolean(o),preventClose:Boolean(i),signal:a}}function assertAbortSignal(t,r){if(!isAbortSignal(t)){throw new TypeError(`${r} is not an AbortSignal.`)}}function convertReadableWritablePair(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.readable;assertRequiredField(n,"readable","ReadableWritablePair");assertReadableStream(n,`${r} has member 'readable' that`);const o=t===null||t===void 0?void 0:t.writable;assertRequiredField(o,"writable","ReadableWritablePair");assertWritableStream(o,`${r} has member 'writable' that`);return{readable:n,writable:o}}class ReadableStream{constructor(t={},r={}){if(t===undefined){t=null}else{assertObject(t,"First parameter")}const n=convertQueuingStrategy(r,"Second parameter");const o=convertUnderlyingDefaultOrByteSource(t,"First parameter");InitializeReadableStream(this);if(o.type==="bytes"){if(n.size!==undefined){throw new RangeError("The strategy for a byte stream cannot have a size function")}const t=ExtractHighWaterMark(n,0);SetUpReadableByteStreamControllerFromUnderlyingSource(this,o,t)}else{const t=ExtractSizeAlgorithm(n);const r=ExtractHighWaterMark(n,1);SetUpReadableStreamDefaultControllerFromUnderlyingSource(this,o,r,t)}}get locked(){if(!IsReadableStream(this)){throw streamBrandCheckException$1("locked")}return IsReadableStreamLocked(this)}cancel(t=undefined){if(!IsReadableStream(this)){return promiseRejectedWith(streamBrandCheckException$1("cancel"))}if(IsReadableStreamLocked(this)){return promiseRejectedWith(new TypeError("Cannot cancel a stream that already has a reader"))}return ReadableStreamCancel(this,t)}getReader(t=undefined){if(!IsReadableStream(this)){throw streamBrandCheckException$1("getReader")}const r=convertReaderOptions(t,"First parameter");if(r.mode===undefined){return AcquireReadableStreamDefaultReader(this)}return AcquireReadableStreamBYOBReader(this)}pipeThrough(t,r={}){if(!IsReadableStream(this)){throw streamBrandCheckException$1("pipeThrough")}assertRequiredArgument(t,1,"pipeThrough");const n=convertReadableWritablePair(t,"First parameter");const o=convertPipeOptions(r,"Second parameter");if(IsReadableStreamLocked(this)){throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream")}if(IsWritableStreamLocked(n.writable)){throw new TypeError("ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream")}const i=ReadableStreamPipeTo(this,n.writable,o.preventClose,o.preventAbort,o.preventCancel,o.signal);setPromiseIsHandledToTrue(i);return n.readable}pipeTo(t,r={}){if(!IsReadableStream(this)){return promiseRejectedWith(streamBrandCheckException$1("pipeTo"))}if(t===undefined){return promiseRejectedWith(`Parameter 1 is required in 'pipeTo'.`)}if(!IsWritableStream(t)){return promiseRejectedWith(new TypeError(`ReadableStream.prototype.pipeTo's first argument must be a WritableStream`))}let n;try{n=convertPipeOptions(r,"Second parameter")}catch(t){return promiseRejectedWith(t)}if(IsReadableStreamLocked(this)){return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream"))}if(IsWritableStreamLocked(t)){return promiseRejectedWith(new TypeError("ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream"))}return ReadableStreamPipeTo(this,t,n.preventClose,n.preventAbort,n.preventCancel,n.signal)}tee(){if(!IsReadableStream(this)){throw streamBrandCheckException$1("tee")}const t=ReadableStreamTee(this);return CreateArrayFromList(t)}values(t=undefined){if(!IsReadableStream(this)){throw streamBrandCheckException$1("values")}const r=convertIteratorOptions(t,"First parameter");return AcquireReadableStreamAsyncIterator(this,r.preventCancel)}}Object.defineProperties(ReadableStream.prototype,{cancel:{enumerable:true},getReader:{enumerable:true},pipeThrough:{enumerable:true},pipeTo:{enumerable:true},tee:{enumerable:true},values:{enumerable:true},locked:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ReadableStream.prototype,r.toStringTag,{value:"ReadableStream",configurable:true})}if(typeof r.asyncIterator==="symbol"){Object.defineProperty(ReadableStream.prototype,r.asyncIterator,{value:ReadableStream.prototype.values,writable:true,configurable:true})}function CreateReadableStream(t,r,n,o=1,i=(()=>1)){const a=Object.create(ReadableStream.prototype);InitializeReadableStream(a);const s=Object.create(ReadableStreamDefaultController.prototype);SetUpReadableStreamDefaultController(a,s,t,r,n,o,i);return a}function CreateReadableByteStream(t,r,n){const o=Object.create(ReadableStream.prototype);InitializeReadableStream(o);const i=Object.create(ReadableByteStreamController.prototype);SetUpReadableByteStreamController(o,i,t,r,n,0,undefined);return o}function InitializeReadableStream(t){t._state="readable";t._reader=undefined;t._storedError=undefined;t._disturbed=false}function IsReadableStream(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_readableStreamController")){return false}return t instanceof ReadableStream}function IsReadableStreamLocked(t){if(t._reader===undefined){return false}return true}function ReadableStreamCancel(t,r){t._disturbed=true;if(t._state==="closed"){return promiseResolvedWith(undefined)}if(t._state==="errored"){return promiseRejectedWith(t._storedError)}ReadableStreamClose(t);const n=t._reader;if(n!==undefined&&IsReadableStreamBYOBReader(n)){n._readIntoRequests.forEach((t=>{t._closeSteps(undefined)}));n._readIntoRequests=new SimpleQueue}const o=t._readableStreamController[h](r);return transformPromiseWith(o,noop)}function ReadableStreamClose(t){t._state="closed";const r=t._reader;if(r===undefined){return}defaultReaderClosedPromiseResolve(r);if(IsReadableStreamDefaultReader(r)){r._readRequests.forEach((t=>{t._closeSteps()}));r._readRequests=new SimpleQueue}}function ReadableStreamError(t,r){t._state="errored";t._storedError=r;const n=t._reader;if(n===undefined){return}defaultReaderClosedPromiseReject(n,r);if(IsReadableStreamDefaultReader(n)){n._readRequests.forEach((t=>{t._errorSteps(r)}));n._readRequests=new SimpleQueue}else{n._readIntoRequests.forEach((t=>{t._errorSteps(r)}));n._readIntoRequests=new SimpleQueue}}function streamBrandCheckException$1(t){return new TypeError(`ReadableStream.prototype.${t} can only be used on a ReadableStream`)}function convertQueuingStrategyInit(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.highWaterMark;assertRequiredField(n,"highWaterMark","QueuingStrategyInit");return{highWaterMark:convertUnrestrictedDouble(n)}}const byteLengthSizeFunction=t=>t.byteLength;try{Object.defineProperty(byteLengthSizeFunction,"name",{value:"size",configurable:true})}catch(t){}class ByteLengthQueuingStrategy{constructor(t){assertRequiredArgument(t,1,"ByteLengthQueuingStrategy");t=convertQueuingStrategyInit(t,"First parameter");this._byteLengthQueuingStrategyHighWaterMark=t.highWaterMark}get highWaterMark(){if(!IsByteLengthQueuingStrategy(this)){throw byteLengthBrandCheckException("highWaterMark")}return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!IsByteLengthQueuingStrategy(this)){throw byteLengthBrandCheckException("size")}return byteLengthSizeFunction}}Object.defineProperties(ByteLengthQueuingStrategy.prototype,{highWaterMark:{enumerable:true},size:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(ByteLengthQueuingStrategy.prototype,r.toStringTag,{value:"ByteLengthQueuingStrategy",configurable:true})}function byteLengthBrandCheckException(t){return new TypeError(`ByteLengthQueuingStrategy.prototype.${t} can only be used on a ByteLengthQueuingStrategy`)}function IsByteLengthQueuingStrategy(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_byteLengthQueuingStrategyHighWaterMark")){return false}return t instanceof ByteLengthQueuingStrategy}const countSizeFunction=()=>1;try{Object.defineProperty(countSizeFunction,"name",{value:"size",configurable:true})}catch(t){}class CountQueuingStrategy{constructor(t){assertRequiredArgument(t,1,"CountQueuingStrategy");t=convertQueuingStrategyInit(t,"First parameter");this._countQueuingStrategyHighWaterMark=t.highWaterMark}get highWaterMark(){if(!IsCountQueuingStrategy(this)){throw countBrandCheckException("highWaterMark")}return this._countQueuingStrategyHighWaterMark}get size(){if(!IsCountQueuingStrategy(this)){throw countBrandCheckException("size")}return countSizeFunction}}Object.defineProperties(CountQueuingStrategy.prototype,{highWaterMark:{enumerable:true},size:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(CountQueuingStrategy.prototype,r.toStringTag,{value:"CountQueuingStrategy",configurable:true})}function countBrandCheckException(t){return new TypeError(`CountQueuingStrategy.prototype.${t} can only be used on a CountQueuingStrategy`)}function IsCountQueuingStrategy(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_countQueuingStrategyHighWaterMark")){return false}return t instanceof CountQueuingStrategy}function convertTransformer(t,r){assertDictionary(t,r);const n=t===null||t===void 0?void 0:t.flush;const o=t===null||t===void 0?void 0:t.readableType;const i=t===null||t===void 0?void 0:t.start;const a=t===null||t===void 0?void 0:t.transform;const s=t===null||t===void 0?void 0:t.writableType;return{flush:n===undefined?undefined:convertTransformerFlushCallback(n,t,`${r} has member 'flush' that`),readableType:o,start:i===undefined?undefined:convertTransformerStartCallback(i,t,`${r} has member 'start' that`),transform:a===undefined?undefined:convertTransformerTransformCallback(a,t,`${r} has member 'transform' that`),writableType:s}}function convertTransformerFlushCallback(t,r,n){assertFunction(t,n);return n=>promiseCall(t,r,[n])}function convertTransformerStartCallback(t,r,n){assertFunction(t,n);return n=>reflectCall(t,r,[n])}function convertTransformerTransformCallback(t,r,n){assertFunction(t,n);return(n,o)=>promiseCall(t,r,[n,o])}class TransformStream{constructor(t={},r={},n={}){if(t===undefined){t=null}const o=convertQueuingStrategy(r,"Second parameter");const i=convertQueuingStrategy(n,"Third parameter");const a=convertTransformer(t,"First parameter");if(a.readableType!==undefined){throw new RangeError("Invalid readableType specified")}if(a.writableType!==undefined){throw new RangeError("Invalid writableType specified")}const s=ExtractHighWaterMark(i,0);const l=ExtractSizeAlgorithm(i);const u=ExtractHighWaterMark(o,1);const c=ExtractSizeAlgorithm(o);let d;const p=newPromise((t=>{d=t}));InitializeTransformStream(this,p,u,c,s,l);SetUpTransformStreamDefaultControllerFromTransformer(this,a);if(a.start!==undefined){d(a.start(this._transformStreamController))}else{d(undefined)}}get readable(){if(!IsTransformStream(this)){throw streamBrandCheckException("readable")}return this._readable}get writable(){if(!IsTransformStream(this)){throw streamBrandCheckException("writable")}return this._writable}}Object.defineProperties(TransformStream.prototype,{readable:{enumerable:true},writable:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(TransformStream.prototype,r.toStringTag,{value:"TransformStream",configurable:true})}function InitializeTransformStream(t,r,n,o,i,a){function startAlgorithm(){return r}function writeAlgorithm(r){return TransformStreamDefaultSinkWriteAlgorithm(t,r)}function abortAlgorithm(r){return TransformStreamDefaultSinkAbortAlgorithm(t,r)}function closeAlgorithm(){return TransformStreamDefaultSinkCloseAlgorithm(t)}t._writable=CreateWritableStream(startAlgorithm,writeAlgorithm,closeAlgorithm,abortAlgorithm,n,o);function pullAlgorithm(){return TransformStreamDefaultSourcePullAlgorithm(t)}function cancelAlgorithm(r){TransformStreamErrorWritableAndUnblockWrite(t,r);return promiseResolvedWith(undefined)}t._readable=CreateReadableStream(startAlgorithm,pullAlgorithm,cancelAlgorithm,i,a);t._backpressure=undefined;t._backpressureChangePromise=undefined;t._backpressureChangePromise_resolve=undefined;TransformStreamSetBackpressure(t,true);t._transformStreamController=undefined}function IsTransformStream(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_transformStreamController")){return false}return t instanceof TransformStream}function TransformStreamError(t,r){ReadableStreamDefaultControllerError(t._readable._readableStreamController,r);TransformStreamErrorWritableAndUnblockWrite(t,r)}function TransformStreamErrorWritableAndUnblockWrite(t,r){TransformStreamDefaultControllerClearAlgorithms(t._transformStreamController);WritableStreamDefaultControllerErrorIfNeeded(t._writable._writableStreamController,r);if(t._backpressure){TransformStreamSetBackpressure(t,false)}}function TransformStreamSetBackpressure(t,r){if(t._backpressureChangePromise!==undefined){t._backpressureChangePromise_resolve()}t._backpressureChangePromise=newPromise((r=>{t._backpressureChangePromise_resolve=r}));t._backpressure=r}class TransformStreamDefaultController{constructor(){throw new TypeError("Illegal constructor")}get desiredSize(){if(!IsTransformStreamDefaultController(this)){throw defaultControllerBrandCheckException("desiredSize")}const t=this._controlledTransformStream._readable._readableStreamController;return ReadableStreamDefaultControllerGetDesiredSize(t)}enqueue(t=undefined){if(!IsTransformStreamDefaultController(this)){throw defaultControllerBrandCheckException("enqueue")}TransformStreamDefaultControllerEnqueue(this,t)}error(t=undefined){if(!IsTransformStreamDefaultController(this)){throw defaultControllerBrandCheckException("error")}TransformStreamDefaultControllerError(this,t)}terminate(){if(!IsTransformStreamDefaultController(this)){throw defaultControllerBrandCheckException("terminate")}TransformStreamDefaultControllerTerminate(this)}}Object.defineProperties(TransformStreamDefaultController.prototype,{enqueue:{enumerable:true},error:{enumerable:true},terminate:{enumerable:true},desiredSize:{enumerable:true}});if(typeof r.toStringTag==="symbol"){Object.defineProperty(TransformStreamDefaultController.prototype,r.toStringTag,{value:"TransformStreamDefaultController",configurable:true})}function IsTransformStreamDefaultController(t){if(!typeIsObject(t)){return false}if(!Object.prototype.hasOwnProperty.call(t,"_controlledTransformStream")){return false}return t instanceof TransformStreamDefaultController}function SetUpTransformStreamDefaultController(t,r,n,o){r._controlledTransformStream=t;t._transformStreamController=r;r._transformAlgorithm=n;r._flushAlgorithm=o}function SetUpTransformStreamDefaultControllerFromTransformer(t,r){const n=Object.create(TransformStreamDefaultController.prototype);let transformAlgorithm=t=>{try{TransformStreamDefaultControllerEnqueue(n,t);return promiseResolvedWith(undefined)}catch(t){return promiseRejectedWith(t)}};let flushAlgorithm=()=>promiseResolvedWith(undefined);if(r.transform!==undefined){transformAlgorithm=t=>r.transform(t,n)}if(r.flush!==undefined){flushAlgorithm=()=>r.flush(n)}SetUpTransformStreamDefaultController(t,n,transformAlgorithm,flushAlgorithm)}function TransformStreamDefaultControllerClearAlgorithms(t){t._transformAlgorithm=undefined;t._flushAlgorithm=undefined}function TransformStreamDefaultControllerEnqueue(t,r){const n=t._controlledTransformStream;const o=n._readable._readableStreamController;if(!ReadableStreamDefaultControllerCanCloseOrEnqueue(o)){throw new TypeError("Readable side is not in a state that permits enqueue")}try{ReadableStreamDefaultControllerEnqueue(o,r)}catch(t){TransformStreamErrorWritableAndUnblockWrite(n,t);throw n._readable._storedError}const i=ReadableStreamDefaultControllerHasBackpressure(o);if(i!==n._backpressure){TransformStreamSetBackpressure(n,true)}}function TransformStreamDefaultControllerError(t,r){TransformStreamError(t._controlledTransformStream,r)}function TransformStreamDefaultControllerPerformTransform(t,r){const n=t._transformAlgorithm(r);return transformPromiseWith(n,undefined,(r=>{TransformStreamError(t._controlledTransformStream,r);throw r}))}function TransformStreamDefaultControllerTerminate(t){const r=t._controlledTransformStream;const n=r._readable._readableStreamController;ReadableStreamDefaultControllerClose(n);const o=new TypeError("TransformStream terminated");TransformStreamErrorWritableAndUnblockWrite(r,o)}function TransformStreamDefaultSinkWriteAlgorithm(t,r){const n=t._transformStreamController;if(t._backpressure){const o=t._backpressureChangePromise;return transformPromiseWith(o,(()=>{const o=t._writable;const i=o._state;if(i==="erroring"){throw o._storedError}return TransformStreamDefaultControllerPerformTransform(n,r)}))}return TransformStreamDefaultControllerPerformTransform(n,r)}function TransformStreamDefaultSinkAbortAlgorithm(t,r){TransformStreamError(t,r);return promiseResolvedWith(undefined)}function TransformStreamDefaultSinkCloseAlgorithm(t){const r=t._readable;const n=t._transformStreamController;const o=n._flushAlgorithm();TransformStreamDefaultControllerClearAlgorithms(n);return transformPromiseWith(o,(()=>{if(r._state==="errored"){throw r._storedError}ReadableStreamDefaultControllerClose(r._readableStreamController)}),(n=>{TransformStreamError(t,n);throw r._storedError}))}function TransformStreamDefaultSourcePullAlgorithm(t){TransformStreamSetBackpressure(t,false);return t._backpressureChangePromise}function defaultControllerBrandCheckException(t){return new TypeError(`TransformStreamDefaultController.prototype.${t} can only be used on a TransformStreamDefaultController`)}function streamBrandCheckException(t){return new TypeError(`TransformStream.prototype.${t} can only be used on a TransformStream`)}t.ByteLengthQueuingStrategy=ByteLengthQueuingStrategy;t.CountQueuingStrategy=CountQueuingStrategy;t.ReadableByteStreamController=ReadableByteStreamController;t.ReadableStream=ReadableStream;t.ReadableStreamBYOBReader=ReadableStreamBYOBReader;t.ReadableStreamBYOBRequest=ReadableStreamBYOBRequest;t.ReadableStreamDefaultController=ReadableStreamDefaultController;t.ReadableStreamDefaultReader=ReadableStreamDefaultReader;t.TransformStream=TransformStream;t.TransformStreamDefaultController=TransformStreamDefaultController;t.WritableStream=WritableStream;t.WritableStreamDefaultController=WritableStreamDefaultController;t.WritableStreamDefaultWriter=WritableStreamDefaultWriter;Object.defineProperty(t,"__esModule",{value:true})}))},4091:t=>{"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next){yield t.value}}}},665:(t,r,n)=>{"use strict";t.exports=Yallist;Yallist.Node=Node;Yallist.create=Yallist;function Yallist(t){var r=this;if(!(r instanceof Yallist)){r=new Yallist}r.tail=null;r.head=null;r.length=0;if(t&&typeof t.forEach==="function"){t.forEach((function(t){r.push(t)}))}else if(arguments.length>0){for(var n=0,o=arguments.length;n1){n=r}else if(this.head){o=this.head.next;n=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=0;o!==null;i++){n=t(n,o.value,i);o=o.next}return n};Yallist.prototype.reduceReverse=function(t,r){var n;var o=this.tail;if(arguments.length>1){n=r}else if(this.tail){o=this.tail.prev;n=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=this.length-1;o!==null;i--){n=t(n,o.value,i);o=o.prev}return n};Yallist.prototype.toArray=function(){var t=new Array(this.length);for(var r=0,n=this.head;n!==null;r++){t[r]=n.value;n=n.next}return t};Yallist.prototype.toArrayReverse=function(){var t=new Array(this.length);for(var r=0,n=this.tail;n!==null;r++){t[r]=n.value;n=n.prev}return t};Yallist.prototype.slice=function(t,r){r=r||this.length;if(r<0){r+=this.length}t=t||0;if(t<0){t+=this.length}var n=new Yallist;if(rthis.length){r=this.length}for(var o=0,i=this.head;i!==null&&othis.length){r=this.length}for(var o=this.length,i=this.tail;i!==null&&o>r;o--){i=i.prev}for(;i!==null&&o>t;o--,i=i.prev){n.push(i.value)}return n};Yallist.prototype.splice=function(t,r,...n){if(t>this.length){t=this.length-1}if(t<0){t=this.length+t}for(var o=0,i=this.head;i!==null&&o{"use strict";t.exports=require("assert")},4300:t=>{"use strict";t.exports=require("buffer")},6113:t=>{"use strict";t.exports=require("crypto")},2361:t=>{"use strict";t.exports=require("events")},7147:t=>{"use strict";t.exports=require("fs")},3685:t=>{"use strict";t.exports=require("http")},5687:t=>{"use strict";t.exports=require("https")},1808:t=>{"use strict";t.exports=require("net")},7742:t=>{"use strict";t.exports=require("node:process")},2477:t=>{"use strict";t.exports=require("node:stream/web")},2037:t=>{"use strict";t.exports=require("os")},1017:t=>{"use strict";t.exports=require("path")},4404:t=>{"use strict";t.exports=require("tls")},3837:t=>{"use strict";t.exports=require("util")},1267:t=>{"use strict";t.exports=require("worker_threads")},8572:(t,r,n)=>{const o=65536;if(!globalThis.ReadableStream){try{const t=n(7742);const{emitWarning:r}=t;try{t.emitWarning=()=>{};Object.assign(globalThis,n(2477));t.emitWarning=r}catch(n){t.emitWarning=r;throw n}}catch(t){Object.assign(globalThis,n(1452))}}try{const{Blob:t}=n(4300);if(t&&!t.prototype.stream){t.prototype.stream=function name(t){let r=0;const n=this;return new ReadableStream({type:"bytes",async pull(t){const i=n.slice(r,Math.min(n.size,r+o));const a=await i.arrayBuffer();r+=a.byteLength;t.enqueue(new Uint8Array(a));if(r===n.size){t.close()}}})}}}catch(t){}},3213:(t,r,n)=>{"use strict";n.d(r,{Z:()=>s});var o=n(1410);const i=class File extends o.Z{#e=0;#t="";constructor(t,r,n={}){if(arguments.length<2){throw new TypeError(`Failed to construct 'File': 2 arguments required, but only ${arguments.length} present.`)}super(t,n);if(n===null)n={};const o=n.lastModified===undefined?Date.now():Number(n.lastModified);if(!Number.isNaN(o)){this.#e=o}this.#t=String(r)}get name(){return this.#t}get lastModified(){return this.#e}get[Symbol.toStringTag](){return"File"}static[Symbol.hasInstance](t){return!!t&&t instanceof o.Z&&/^(File)$/.test(t[Symbol.toStringTag])}};const a=i;const s=a},2777:(t,r,n)=>{"use strict";n.d(r,{$B:()=>s.Z});const o=require("node:fs");const i=require("node:path");var a=n(7760);var s=n(3213);var l=n(1410);const{stat:u}=o.promises;const blobFromSync=(t,r)=>fromBlob(statSync(t),t,r);const blobFrom=(t,r)=>u(t).then((n=>fromBlob(n,t,r)));const fileFrom=(t,r)=>u(t).then((n=>fromFile(n,t,r)));const fileFromSync=(t,r)=>fromFile(statSync(t),t,r);const fromBlob=(t,r,n="")=>new Blob([new BlobDataItem({path:r,size:t.size,lastModified:t.mtimeMs,start:0})],{type:n});const fromFile=(t,r,n="")=>new File([new BlobDataItem({path:r,size:t.size,lastModified:t.mtimeMs,start:0})],basename(r),{type:n,lastModified:t.mtimeMs});class BlobDataItem{#r;#n;constructor(t){this.#r=t.path;this.#n=t.start;this.size=t.size;this.lastModified=t.lastModified}slice(t,r){return new BlobDataItem({path:this.#r,lastModified:this.lastModified,size:r-t,start:this.#n+t})}async*stream(){const{mtimeMs:t}=await u(this.#r);if(t>this.lastModified){throw new DOMException("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.","NotReadableError")}yield*createReadStream(this.#r,{start:this.#n,end:this.#n+this.size-1})}get[Symbol.toStringTag](){return"Blob"}}const c=null&&blobFromSync},1410:(t,r,n)=>{"use strict";n.d(r,{Z:()=>l});var o=n(8572); /*! fetch-blob. MIT License. Jimmy Wärting */const i=65536;async function*toIterator(t,r=true){for(const n of t){if("stream"in n){yield*n.stream()}else if(ArrayBuffer.isView(n)){if(r){let t=n.byteOffset;const r=n.byteOffset+n.byteLength;while(t!==r){const o=Math.min(r-t,i);const a=n.buffer.slice(t,t+o);t+=a.byteLength;yield new Uint8Array(a)}}else{yield n}}else{let t=0,r=n;while(t!==r.size){const n=r.slice(t,Math.min(r.size,t+i));const o=await n.arrayBuffer();t+=o.byteLength;yield new Uint8Array(o)}}}}const a=class Blob{#o=[];#i="";#a=0;#s="transparent";constructor(t=[],r={}){if(typeof t!=="object"||t===null){throw new TypeError("Failed to construct 'Blob': The provided value cannot be converted to a sequence.")}if(typeof t[Symbol.iterator]!=="function"){throw new TypeError("Failed to construct 'Blob': The object must have a callable @@iterator property.")}if(typeof r!=="object"&&typeof r!=="function"){throw new TypeError("Failed to construct 'Blob': parameter 2 cannot convert to dictionary.")}if(r===null)r={};const n=new TextEncoder;for(const r of t){let t;if(ArrayBuffer.isView(r)){t=new Uint8Array(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength))}else if(r instanceof ArrayBuffer){t=new Uint8Array(r.slice(0))}else if(r instanceof Blob){t=r}else{t=n.encode(`${r}`)}this.#a+=ArrayBuffer.isView(t)?t.byteLength:t.size;this.#o.push(t)}this.#s=`${r.endings===undefined?"transparent":r.endings}`;const o=r.type===undefined?"":String(r.type);this.#i=/^[\x20-\x7E]*$/.test(o)?o:""}get size(){return this.#a}get type(){return this.#i}async text(){const t=new TextDecoder;let r="";for await(const n of toIterator(this.#o,false)){r+=t.decode(n,{stream:true})}r+=t.decode();return r}async arrayBuffer(){const t=new Uint8Array(this.size);let r=0;for await(const n of toIterator(this.#o,false)){t.set(n,r);r+=n.length}return t.buffer}stream(){const t=toIterator(this.#o,true);return new globalThis.ReadableStream({type:"bytes",async pull(r){const n=await t.next();n.done?r.close():r.enqueue(n.value)},async cancel(){await t.return()}})}slice(t=0,r=this.size,n=""){const{size:o}=this;let i=t<0?Math.max(o+t,0):Math.min(t,o);let a=r<0?Math.max(o+r,0):Math.min(r,o);const s=Math.max(a-i,0);const l=this.#o;const u=[];let c=0;for(const t of l){if(c>=s){break}const r=ArrayBuffer.isView(t)?t.byteLength:t.size;if(i&&r<=i){i-=r;a-=r}else{let n;if(ArrayBuffer.isView(t)){n=t.subarray(i,Math.min(r,a));c+=n.byteLength}else{n=t.slice(i,Math.min(r,a));c+=n.size}a-=r;u.push(n);i=0}}const d=new Blob([],{type:String(n).toLowerCase()});d.#a=s;d.#o=u;return d}get[Symbol.toStringTag](){return"Blob"}static[Symbol.hasInstance](t){return t&&typeof t==="object"&&typeof t.constructor==="function"&&(typeof t.stream==="function"||typeof t.arrayBuffer==="function")&&/^(Blob|File)$/.test(t[Symbol.toStringTag])}};Object.defineProperties(a.prototype,{size:{enumerable:true},type:{enumerable:true},slice:{enumerable:true}});const s=a;const l=s},8010:(t,r,n)=>{"use strict";n.d(r,{Ct:()=>p,au:()=>formDataToBlob});var o=n(1410);var i=n(3213); -/*! formdata-polyfill. MIT License. Jimmy Wärting */var{toStringTag:a,iterator:s,hasInstance:l}=Symbol,u=Math.random,c="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),f=(t,r,n)=>(t+="",/^(Blob|File)$/.test(r&&r[a])?[(n=n!==void 0?n+"":r[a]=="File"?r.name:"blob",t),r.name!==n||r[a]=="blob"?new i.Z([r],n,r):r]:[t,r+""]),e=(t,r)=>(r?t:t.replace(/\r?\n|\r/g,"\r\n")).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),x=(t,r,n)=>{if(r.lengthtypeof t[r]!="function"))}append(...t){x("append",arguments,2);this.#l.push(f(...t))}delete(t){x("delete",arguments,1);t+="";this.#l=this.#l.filter((([r])=>r!==t))}get(t){x("get",arguments,1);t+="";for(var r=this.#l,n=r.length,o=0;on[0]===t&&r.push(n[1])));return r}has(t){x("has",arguments,1);t+="";return this.#l.some((r=>r[0]===t))}forEach(t,r){x("forEach",arguments,1);for(var[n,o]of this)t.call(r,o,n,this)}set(...t){x("set",arguments,2);var r=[],n=!0;t=f(...t);this.#l.forEach((o=>{o[0]===t[0]?n&&(n=!r.push(t)):r.push(o)}));n&&r.push(t);this.#l=r}*entries(){yield*this.#l}*keys(){for(var[t]of this)yield t}*values(){for(var[,t]of this)yield t}};function formDataToBlob(t,r=o.Z){var n=`${u()}${u()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),i=[],a=`--${n}\r\nContent-Disposition: form-data; name="`;t.forEach(((t,r)=>typeof t=="string"?i.push(a+e(r)+`"\r\n\r\n${t.replace(/\r(?!\n)|(?{__nccwpck_require__.d=(t,r)=>{for(var n in r){if(__nccwpck_require__.o(r,n)&&!__nccwpck_require__.o(t,n)){Object.defineProperty(t,n,{enumerable:true,get:r[n]})}}}})();(()=>{__nccwpck_require__.f={};__nccwpck_require__.e=t=>Promise.all(Object.keys(__nccwpck_require__.f).reduce(((r,n)=>{__nccwpck_require__.f[n](t,r);return r}),[]))})();(()=>{__nccwpck_require__.u=t=>""+t+".index.js"})();(()=>{__nccwpck_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";(()=>{var t={179:1};var installChunk=r=>{var n=r.modules,o=r.ids,i=r.runtime;for(var a in n){if(__nccwpck_require__.o(n,a)){__nccwpck_require__.m[a]=n[a]}}if(i)i(__nccwpck_require__);for(var s=0;s{if(!t[r]){if(true){installChunk(require("./"+__nccwpck_require__.u(r)))}else t[r]=1}}})();var n={};(()=>{"use strict";__nccwpck_require__.r(n);var t=__nccwpck_require__(4777);const r=/(?<=(required_version.=.)).*/;const o=/^(versions|providers).tf$/;async function versionConstraintSearch(n){const i=await t.s("required_versions*s*",n,".tf$");const a=Object.keys(i).filter((t=>!o.test(t)))[0];const s=i[a].line;if(s){const t=r.exec(s);const n=t?t[0]:"";return n}return""}const i=require("node:http");const a=require("node:https");const s=require("node:zlib");const l=require("node:stream");const u=require("node:buffer");function dataUriToBuffer(t){if(!/^data:/i.test(t)){throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")')}t=t.replace(/\r?\n/g,"");const r=t.indexOf(",");if(r===-1||r<=4){throw new TypeError("malformed data: URI")}const n=t.substring(5,r).split(";");let o="";let i=false;const a=n[0]||"text/plain";let s=a;for(let t=1;ttypeof t==="object"&&typeof t.append==="function"&&typeof t.delete==="function"&&typeof t.get==="function"&&typeof t.getAll==="function"&&typeof t.has==="function"&&typeof t.set==="function"&&typeof t.sort==="function"&&t[m]==="URLSearchParams";const isBlob=t=>t&&typeof t==="object"&&typeof t.arrayBuffer==="function"&&typeof t.type==="string"&&typeof t.stream==="function"&&typeof t.constructor==="function"&&/^(Blob|File)$/.test(t[m]);const isAbortSignal=t=>typeof t==="object"&&(t[m]==="AbortSignal"||t[m]==="EventTarget");const isDomainOrSubdomain=(t,r)=>{const n=new URL(r).hostname;const o=new URL(t).hostname;return n===o||n.endsWith(`.${o}`)};const isSameProtocol=(t,r)=>{const n=new URL(r).protocol;const o=new URL(t).protocol;return n===o};const b=(0,d.promisify)(l.pipeline);const y=Symbol("Body internals");class Body{constructor(t,{size:r=0}={}){let n=null;if(t===null){t=null}else if(isURLSearchParameters(t)){t=u.Buffer.from(t.toString())}else if(isBlob(t)){}else if(u.Buffer.isBuffer(t)){}else if(d.types.isAnyArrayBuffer(t)){t=u.Buffer.from(t)}else if(ArrayBuffer.isView(t)){t=u.Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(t instanceof l){}else if(t instanceof h.Ct){t=(0,h.au)(t);n=t.type.split("=")[1]}else{t=u.Buffer.from(String(t))}let o=t;if(u.Buffer.isBuffer(t)){o=l.Readable.from(t)}else if(isBlob(t)){o=l.Readable.from(t.stream())}this[y]={body:t,stream:o,boundary:n,disturbed:false,error:null};this.size=r;if(t instanceof l){t.on("error",(t=>{const r=t instanceof FetchBaseError?t:new FetchError(`Invalid response body while trying to fetch ${this.url}: ${t.message}`,"system",t);this[y].error=r}))}}get body(){return this[y].stream}get bodyUsed(){return this[y].disturbed}async arrayBuffer(){const{buffer:t,byteOffset:r,byteLength:n}=await consumeBody(this);return t.slice(r,r+n)}async formData(){const t=this.headers.get("content-type");if(t.startsWith("application/x-www-form-urlencoded")){const t=new h.Ct;const r=new URLSearchParams(await this.text());for(const[n,o]of r){t.append(n,o)}return t}const{toFormData:r}=await __nccwpck_require__.e(37).then(__nccwpck_require__.bind(__nccwpck_require__,4037));return r(this.body,t)}async blob(){const t=this.headers&&this.headers.get("content-type")||this[y].body&&this[y].body.type||"";const r=await this.arrayBuffer();return new p.Z([r],{type:t})}async json(){const t=await this.text();return JSON.parse(t)}async text(){const t=await consumeBody(this);return(new TextDecoder).decode(t)}buffer(){return consumeBody(this)}}Body.prototype.buffer=(0,d.deprecate)(Body.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Body.prototype,{body:{enumerable:true},bodyUsed:{enumerable:true},arrayBuffer:{enumerable:true},blob:{enumerable:true},json:{enumerable:true},text:{enumerable:true},data:{get:(0,d.deprecate)((()=>{}),"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function consumeBody(t){if(t[y].disturbed){throw new TypeError(`body used already for: ${t.url}`)}t[y].disturbed=true;if(t[y].error){throw t[y].error}const{body:r}=t;if(r===null){return u.Buffer.alloc(0)}if(!(r instanceof l)){return u.Buffer.alloc(0)}const n=[];let o=0;try{for await(const i of r){if(t.size>0&&o+i.length>t.size){const n=new FetchError(`content size at ${t.url} over limit: ${t.size}`,"max-size");r.destroy(n);throw n}o+=i.length;n.push(i)}}catch(r){const n=r instanceof FetchBaseError?r:new FetchError(`Invalid response body while trying to fetch ${t.url}: ${r.message}`,"system",r);throw n}if(r.readableEnded===true||r._readableState.ended===true){try{if(n.every((t=>typeof t==="string"))){return u.Buffer.from(n.join(""))}return u.Buffer.concat(n,o)}catch(r){throw new FetchError(`Could not create Buffer from response body for ${t.url}: ${r.message}`,"system",r)}}else{throw new FetchError(`Premature close of server response while trying to fetch ${t.url}`)}}const clone=(t,r)=>{let n;let o;let{body:i}=t[y];if(t.bodyUsed){throw new Error("cannot clone body after it is used")}if(i instanceof l&&typeof i.getBoundary!=="function"){n=new l.PassThrough({highWaterMark:r});o=new l.PassThrough({highWaterMark:r});i.pipe(n);i.pipe(o);t[y].stream=n;i=o}return i};const g=(0,d.deprecate)((t=>t.getBoundary()),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167");const extractContentType=(t,r)=>{if(t===null){return null}if(typeof t==="string"){return"text/plain;charset=UTF-8"}if(isURLSearchParameters(t)){return"application/x-www-form-urlencoded;charset=UTF-8"}if(isBlob(t)){return t.type||null}if(u.Buffer.isBuffer(t)||d.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)){return null}if(t instanceof h.Ct){return`multipart/form-data; boundary=${r[y].boundary}`}if(t&&typeof t.getBoundary==="function"){return`multipart/form-data;boundary=${g(t)}`}if(t instanceof l){return null}return"text/plain;charset=UTF-8"};const getTotalBytes=t=>{const{body:r}=t[y];if(r===null){return 0}if(isBlob(r)){return r.size}if(u.Buffer.isBuffer(r)){return r.length}if(r&&typeof r.getLengthSync==="function"){return r.hasKnownLength&&r.hasKnownLength()?r.getLengthSync():null}return null};const writeToStream=async(t,{body:r})=>{if(r===null){t.end()}else{await b(r,t)}};const R=typeof i.validateHeaderName==="function"?i.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){const r=new TypeError(`Header name must be a valid HTTP token [${t}]`);Object.defineProperty(r,"code",{value:"ERR_INVALID_HTTP_TOKEN"});throw r}};const S=typeof i.validateHeaderValue==="function"?i.validateHeaderValue:(t,r)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(r)){const r=new TypeError(`Invalid character in header content ["${t}"]`);Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"});throw r}};class Headers extends URLSearchParams{constructor(t){let r=[];if(t instanceof Headers){const n=t.raw();for(const[t,o]of Object.entries(n)){r.push(...o.map((r=>[t,r])))}}else if(t==null){}else if(typeof t==="object"&&!d.types.isBoxedPrimitive(t)){const n=t[Symbol.iterator];if(n==null){r.push(...Object.entries(t))}else{if(typeof n!=="function"){throw new TypeError("Header pairs must be iterable")}r=[...t].map((t=>{if(typeof t!=="object"||d.types.isBoxedPrimitive(t)){throw new TypeError("Each header pair must be an iterable object")}return[...t]})).map((t=>{if(t.length!==2){throw new TypeError("Each header pair must be a name/value tuple")}return[...t]}))}}else{throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence> or record)")}r=r.length>0?r.map((([t,r])=>{R(t);S(t,String(r));return[String(t).toLowerCase(),String(r)]})):undefined;super(r);return new Proxy(this,{get(t,r,n){switch(r){case"append":case"set":return(n,o)=>{R(n);S(n,String(o));return URLSearchParams.prototype[r].call(t,String(n).toLowerCase(),String(o))};case"delete":case"has":case"getAll":return n=>{R(n);return URLSearchParams.prototype[r].call(t,String(n).toLowerCase())};case"keys":return()=>{t.sort();return new Set(URLSearchParams.prototype.keys.call(t)).keys()};default:return Reflect.get(t,r,n)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(t){const r=this.getAll(t);if(r.length===0){return null}let n=r.join(", ");if(/^content-encoding$/i.test(t)){n=n.toLowerCase()}return n}forEach(t,r=undefined){for(const n of this.keys()){Reflect.apply(t,r,[this.get(n),n,this])}}*values(){for(const t of this.keys()){yield this.get(t)}}*entries(){for(const t of this.keys()){yield[t,this.get(t)]}}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce(((t,r)=>{t[r]=this.getAll(r);return t}),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce(((t,r)=>{const n=this.getAll(r);if(r==="host"){t[r]=n[0]}else{t[r]=n.length>1?n:n[0]}return t}),{})}}Object.defineProperties(Headers.prototype,["get","entries","forEach","values"].reduce(((t,r)=>{t[r]={enumerable:true};return t}),{}));function fromRawHeaders(t=[]){return new Headers(t.reduce(((t,r,n,o)=>{if(n%2===0){t.push(o.slice(n,n+2))}return t}),[]).filter((([t,r])=>{try{R(t);S(t,String(r));return true}catch{return false}})))}const v=new Set([301,302,303,307,308]);const isRedirect=t=>v.has(t);const _=Symbol("Response internals");class Response extends Body{constructor(t=null,r={}){super(t,r);const n=r.status!=null?r.status:200;const o=new Headers(r.headers);if(t!==null&&!o.has("Content-Type")){const r=extractContentType(t,this);if(r){o.append("Content-Type",r)}}this[_]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:o,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[_].type}get url(){return this[_].url||""}get status(){return this[_].status}get ok(){return this[_].status>=200&&this[_].status<300}get redirected(){return this[_].counter>0}get statusText(){return this[_].statusText}get headers(){return this[_].headers}get highWaterMark(){return this[_].highWaterMark}clone(){return new Response(clone(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(t,r=302){if(!isRedirect(r)){throw new RangeError('Failed to execute "redirect" on "response": Invalid status code')}return new Response(null,{headers:{location:new URL(t).toString()},status:r})}static error(){const t=new Response(null,{status:0,statusText:""});t[_].type="error";return t}get[Symbol.toStringTag](){return"Response"}}Object.defineProperties(Response.prototype,{type:{enumerable:true},url:{enumerable:true},status:{enumerable:true},ok:{enumerable:true},redirected:{enumerable:true},statusText:{enumerable:true},headers:{enumerable:true},clone:{enumerable:true}});const w=require("node:url");const getSearch=t=>{if(t.search){return t.search}const r=t.href.length-1;const n=t.hash||(t.href[r]==="#"?"#":"");return t.href[r-n.length]==="?"?"?":""};const C=require("node:net");function stripURLForUseAsAReferrer(t,r=false){if(t==null){return"no-referrer"}t=new URL(t);if(/^(about|blob|data):$/.test(t.protocol)){return"no-referrer"}t.username="";t.password="";t.hash="";if(r){t.pathname="";t.search=""}return t}const E=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]);const P="strict-origin-when-cross-origin";function validateReferrerPolicy(t){if(!E.has(t)){throw new TypeError(`Invalid referrerPolicy: ${t}`)}return t}function isOriginPotentiallyTrustworthy(t){if(/^(http|ws)s:$/.test(t.protocol)){return true}const r=t.host.replace(/(^\[)|(]$)/g,"");const n=(0,C.isIP)(r);if(n===4&&/^127\./.test(r)){return true}if(n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(r)){return true}if(t.host==="localhost"||t.host.endsWith(".localhost")){return false}if(t.protocol==="file:"){return true}return false}function isUrlPotentiallyTrustworthy(t){if(/^about:(blank|srcdoc)$/.test(t)){return true}if(t.protocol==="data:"){return true}if(/^(blob|filesystem):$/.test(t.protocol)){return true}return isOriginPotentiallyTrustworthy(t)}function determineRequestsReferrer(t,{referrerURLCallback:r,referrerOriginCallback:n}={}){if(t.referrer==="no-referrer"||t.referrerPolicy===""){return null}const o=t.referrerPolicy;if(t.referrer==="about:client"){return"no-referrer"}const i=t.referrer;let a=stripURLForUseAsAReferrer(i);let s=stripURLForUseAsAReferrer(i,true);if(a.toString().length>4096){a=s}if(r){a=r(a)}if(n){s=n(s)}const l=new URL(t.url);switch(o){case"no-referrer":return"no-referrer";case"origin":return s;case"unsafe-url":return a;case"strict-origin":if(isUrlPotentiallyTrustworthy(a)&&!isUrlPotentiallyTrustworthy(l)){return"no-referrer"}return s.toString();case"strict-origin-when-cross-origin":if(a.origin===l.origin){return a}if(isUrlPotentiallyTrustworthy(a)&&!isUrlPotentiallyTrustworthy(l)){return"no-referrer"}return s;case"same-origin":if(a.origin===l.origin){return a}return"no-referrer";case"origin-when-cross-origin":if(a.origin===l.origin){return a}return s;case"no-referrer-when-downgrade":if(isUrlPotentiallyTrustworthy(a)&&!isUrlPotentiallyTrustworthy(l)){return"no-referrer"}return a;default:throw new TypeError(`Invalid referrerPolicy: ${o}`)}}function parseReferrerPolicyFromHeader(t){const r=(t.get("referrer-policy")||"").split(/[,\s]+/);let n="";for(const t of r){if(t&&E.has(t)){n=t}}return n}const T=Symbol("Request internals");const isRequest=t=>typeof t==="object"&&typeof t[T]==="object";const I=(0,d.deprecate)((()=>{}),".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)");class Request extends Body{constructor(t,r={}){let n;if(isRequest(t)){n=new URL(t.url)}else{n=new URL(t);t={}}if(n.username!==""||n.password!==""){throw new TypeError(`${n} is an url with embedded credentials.`)}let o=r.method||t.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)){o=o.toUpperCase()}if(!isRequest(r)&&"data"in r){I()}if((r.body!=null||isRequest(t)&&t.body!==null)&&(o==="GET"||o==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body")}const i=r.body?r.body:isRequest(t)&&t.body!==null?clone(t):null;super(i,{size:r.size||t.size||0});const a=new Headers(r.headers||t.headers||{});if(i!==null&&!a.has("Content-Type")){const t=extractContentType(i,this);if(t){a.set("Content-Type",t)}}let s=isRequest(t)?t.signal:null;if("signal"in r){s=r.signal}if(s!=null&&!isAbortSignal(s)){throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget")}let l=r.referrer==null?t.referrer:r.referrer;if(l===""){l="no-referrer"}else if(l){const t=new URL(l);l=/^about:(\/\/)?client$/.test(t)?"client":t}else{l=undefined}this[T]={method:o,redirect:r.redirect||t.redirect||"follow",headers:a,parsedURL:n,signal:s,referrer:l};this.follow=r.follow===undefined?t.follow===undefined?20:t.follow:r.follow;this.compress=r.compress===undefined?t.compress===undefined?true:t.compress:r.compress;this.counter=r.counter||t.counter||0;this.agent=r.agent||t.agent;this.highWaterMark=r.highWaterMark||t.highWaterMark||16384;this.insecureHTTPParser=r.insecureHTTPParser||t.insecureHTTPParser||false;this.referrerPolicy=r.referrerPolicy||t.referrerPolicy||""}get method(){return this[T].method}get url(){return(0,w.format)(this[T].parsedURL)}get headers(){return this[T].headers}get redirect(){return this[T].redirect}get signal(){return this[T].signal}get referrer(){if(this[T].referrer==="no-referrer"){return""}if(this[T].referrer==="client"){return"about:client"}if(this[T].referrer){return this[T].referrer.toString()}return undefined}get referrerPolicy(){return this[T].referrerPolicy}set referrerPolicy(t){this[T].referrerPolicy=validateReferrerPolicy(t)}clone(){return new Request(this)}get[Symbol.toStringTag](){return"Request"}}Object.defineProperties(Request.prototype,{method:{enumerable:true},url:{enumerable:true},headers:{enumerable:true},redirect:{enumerable:true},clone:{enumerable:true},signal:{enumerable:true},referrer:{enumerable:true},referrerPolicy:{enumerable:true}});const getNodeRequestOptions=t=>{const{parsedURL:r}=t[T];const n=new Headers(t[T].headers);if(!n.has("Accept")){n.set("Accept","*/*")}let o=null;if(t.body===null&&/^(post|put)$/i.test(t.method)){o="0"}if(t.body!==null){const r=getTotalBytes(t);if(typeof r==="number"&&!Number.isNaN(r)){o=String(r)}}if(o){n.set("Content-Length",o)}if(t.referrerPolicy===""){t.referrerPolicy=P}if(t.referrer&&t.referrer!=="no-referrer"){t[T].referrer=determineRequestsReferrer(t)}else{t[T].referrer="no-referrer"}if(t[T].referrer instanceof URL){n.set("Referer",t.referrer)}if(!n.has("User-Agent")){n.set("User-Agent","node-fetch")}if(t.compress&&!n.has("Accept-Encoding")){n.set("Accept-Encoding","gzip, deflate, br")}let{agent:i}=t;if(typeof i==="function"){i=i(r)}if(!n.has("Connection")&&!i){n.set("Connection","close")}const a=getSearch(r);const s={path:r.pathname+a,method:t.method,headers:n[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:r,options:s}};class AbortError extends FetchBaseError{constructor(t,r="aborted"){super(t,r)}}var O=__nccwpck_require__(2777);const A=new Set(["data:","http:","https:"]);async function fetch(t,r){return new Promise(((n,o)=>{const u=new Request(t,r);const{parsedURL:d,options:p}=getNodeRequestOptions(u);if(!A.has(d.protocol)){throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${d.protocol.replace(/:$/,"")}" is not supported.`)}if(d.protocol==="data:"){const t=c(u.url);const r=new Response(t,{headers:{"Content-Type":t.typeFull}});n(r);return}const h=(d.protocol==="https:"?a:i).request;const{signal:m}=u;let b=null;const abort=()=>{const t=new AbortError("The operation was aborted.");o(t);if(u.body&&u.body instanceof l.Readable){u.body.destroy(t)}if(!b||!b.body){return}b.body.emit("error",t)};if(m&&m.aborted){abort();return}const abortAndFinalize=()=>{abort();finalize()};const y=h(d.toString(),p);if(m){m.addEventListener("abort",abortAndFinalize)}const finalize=()=>{y.abort();if(m){m.removeEventListener("abort",abortAndFinalize)}};y.on("error",(t=>{o(new FetchError(`request to ${u.url} failed, reason: ${t.message}`,"system",t));finalize()}));fixResponseChunkedTransferBadEnding(y,(t=>{if(b&&b.body){b.body.destroy(t)}}));if(process.version<"v14"){y.on("socket",(t=>{let r;t.prependListener("end",(()=>{r=t._eventsCount}));t.prependListener("close",(n=>{if(b&&r{y.setTimeout(0);const i=fromRawHeaders(t.rawHeaders);if(isRedirect(t.statusCode)){const a=i.get("Location");let s=null;try{s=a===null?null:new URL(a,u.url)}catch{if(u.redirect!=="manual"){o(new FetchError(`uri requested responds with an invalid redirect URL: ${a}`,"invalid-redirect"));finalize();return}}switch(u.redirect){case"error":o(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${u.url}`,"no-redirect"));finalize();return;case"manual":break;case"follow":{if(s===null){break}if(u.counter>=u.follow){o(new FetchError(`maximum redirect reached at: ${u.url}`,"max-redirect"));finalize();return}const a={headers:new Headers(u.headers),follow:u.follow,counter:u.counter+1,agent:u.agent,compress:u.compress,method:u.method,body:clone(u),signal:u.signal,size:u.size,referrer:u.referrer,referrerPolicy:u.referrerPolicy};if(!isDomainOrSubdomain(u.url,s)||!isSameProtocol(u.url,s)){for(const t of["authorization","www-authenticate","cookie","cookie2"]){a.headers.delete(t)}}if(t.statusCode!==303&&u.body&&r.body instanceof l.Readable){o(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect"));finalize();return}if(t.statusCode===303||(t.statusCode===301||t.statusCode===302)&&u.method==="POST"){a.method="GET";a.body=undefined;a.headers.delete("content-length")}const c=parseReferrerPolicyFromHeader(i);if(c){a.referrerPolicy=c}n(fetch(new Request(s,a)));finalize();return}default:return o(new TypeError(`Redirect option '${u.redirect}' is not a valid value of RequestRedirect`))}}if(m){t.once("end",(()=>{m.removeEventListener("abort",abortAndFinalize)}))}let a=(0,l.pipeline)(t,new l.PassThrough,(t=>{if(t){o(t)}}));if(process.version<"v12.10"){t.on("aborted",abortAndFinalize)}const c={url:u.url,status:t.statusCode,statusText:t.statusMessage,headers:i,size:u.size,counter:u.counter,highWaterMark:u.highWaterMark};const d=i.get("Content-Encoding");if(!u.compress||u.method==="HEAD"||d===null||t.statusCode===204||t.statusCode===304){b=new Response(a,c);n(b);return}const p={flush:s.Z_SYNC_FLUSH,finishFlush:s.Z_SYNC_FLUSH};if(d==="gzip"||d==="x-gzip"){a=(0,l.pipeline)(a,s.createGunzip(p),(t=>{if(t){o(t)}}));b=new Response(a,c);n(b);return}if(d==="deflate"||d==="x-deflate"){const r=(0,l.pipeline)(t,new l.PassThrough,(t=>{if(t){o(t)}}));r.once("data",(t=>{if((t[0]&15)===8){a=(0,l.pipeline)(a,s.createInflate(),(t=>{if(t){o(t)}}))}else{a=(0,l.pipeline)(a,s.createInflateRaw(),(t=>{if(t){o(t)}}))}b=new Response(a,c);n(b)}));r.once("end",(()=>{if(!b){b=new Response(a,c);n(b)}}));return}if(d==="br"){a=(0,l.pipeline)(a,s.createBrotliDecompress(),(t=>{if(t){o(t)}}));b=new Response(a,c);n(b);return}b=new Response(a,c);n(b)}));writeToStream(y,u).catch(o)}))}function fixResponseChunkedTransferBadEnding(t,r){const n=u.Buffer.from("0\r\n\r\n");let o=false;let i=false;let a;t.on("response",(t=>{const{headers:r}=t;o=r["transfer-encoding"]==="chunked"&&!r["content-length"]}));t.on("socket",(s=>{const onSocketClose=()=>{if(o&&!i){const t=new Error("Premature close");t.code="ERR_STREAM_PREMATURE_CLOSE";r(t)}};const onData=t=>{i=u.Buffer.compare(t.slice(-5),n)===0;if(!i&&a){i=u.Buffer.compare(a.slice(-3),n.slice(0,3))===0&&u.Buffer.compare(t.slice(-2),n.slice(3))===0}a=t};s.prependListener("close",onSocketClose);s.on("data",onData);t.on("close",(()=>{s.removeListener("close",onSocketClose);s.removeListener("data",onData)}))}))}var k=__nccwpck_require__(1383);var B;(function(t){t["arm"]="arm";t["x64"]="amd64";t["x32"]="386"})(B||(B={}));var W;(function(t){t["darwin"]="darwin";t["freebsd"]="freebsd";t["linux"]="linux";t["openbsd"]="openbsd";t["solaris"]="solaris";t["windows"]="windows"})(W||(W={}));async function getMetadata(){const t=await fetch("https://releases.hashicorp.com/terraform/index.json");const r=t.json();return r}async function getMinMaxVersions(t,r={}){const n=new k.Range(t.replace(/,/g,""),r);const o=await getMetadata();const i=Object.keys(o.versions);const a=k.minSatisfying(i,n);const s=k.maxSatisfying(i,n);if(a===s||t==="*"){return[s]}return[a,s]}var D=__nccwpck_require__(2186);async function run(){const t=D.getInput("directory");const r=await versionConstraintSearch(t);try{const t=r.replace(/,|"/g,"");const[n,o]=await getMinMaxVersions(t);D.setOutput("minVersion",n);if(o){D.setOutput("maxVersion",o)}else{D.setOutput("maxVersion",n)}}catch(t){console.error(t)}}run().catch((t=>{D.setFailed(t)}))})();module.exports=n})(); \ No newline at end of file +/*! formdata-polyfill. MIT License. Jimmy Wärting */var{toStringTag:a,iterator:s,hasInstance:l}=Symbol,u=Math.random,c="append,set,get,getAll,delete,keys,values,entries,forEach,constructor".split(","),f=(t,r,n)=>(t+="",/^(Blob|File)$/.test(r&&r[a])?[(n=n!==void 0?n+"":r[a]=="File"?r.name:"blob",t),r.name!==n||r[a]=="blob"?new i.Z([r],n,r):r]:[t,r+""]),e=(t,r)=>(r?t:t.replace(/\r?\n|\r/g,"\r\n")).replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),x=(t,r,n)=>{if(r.lengthtypeof t[r]!="function"))}append(...t){x("append",arguments,2);this.#l.push(f(...t))}delete(t){x("delete",arguments,1);t+="";this.#l=this.#l.filter((([r])=>r!==t))}get(t){x("get",arguments,1);t+="";for(var r=this.#l,n=r.length,o=0;on[0]===t&&r.push(n[1])));return r}has(t){x("has",arguments,1);t+="";return this.#l.some((r=>r[0]===t))}forEach(t,r){x("forEach",arguments,1);for(var[n,o]of this)t.call(r,o,n,this)}set(...t){x("set",arguments,2);var r=[],n=!0;t=f(...t);this.#l.forEach((o=>{o[0]===t[0]?n&&(n=!r.push(t)):r.push(o)}));n&&r.push(t);this.#l=r}*entries(){yield*this.#l}*keys(){for(var[t]of this)yield t}*values(){for(var[,t]of this)yield t}};function formDataToBlob(t,r=o.Z){var n=`${u()}${u()}`.replace(/\./g,"").slice(-28).padStart(32,"-"),i=[],a=`--${n}\r\nContent-Disposition: form-data; name="`;t.forEach(((t,r)=>typeof t=="string"?i.push(a+e(r)+`"\r\n\r\n${t.replace(/\r(?!\n)|(?{__nccwpck_require__.d=(t,r)=>{for(var n in r){if(__nccwpck_require__.o(r,n)&&!__nccwpck_require__.o(t,n)){Object.defineProperty(t,n,{enumerable:true,get:r[n]})}}}})();(()=>{__nccwpck_require__.f={};__nccwpck_require__.e=t=>Promise.all(Object.keys(__nccwpck_require__.f).reduce(((r,n)=>{__nccwpck_require__.f[n](t,r);return r}),[]))})();(()=>{__nccwpck_require__.u=t=>""+t+".index.js"})();(()=>{__nccwpck_require__.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";(()=>{var t={179:1};var installChunk=r=>{var n=r.modules,o=r.ids,i=r.runtime;for(var a in n){if(__nccwpck_require__.o(n,a)){__nccwpck_require__.m[a]=n[a]}}if(i)i(__nccwpck_require__);for(var s=0;s{if(!t[r]){if(true){installChunk(require("./"+__nccwpck_require__.u(r)))}else t[r]=1}}})();var n={};(()=>{"use strict";__nccwpck_require__.r(n);var t=__nccwpck_require__(4777);const r=/(?<=(required_version.=.)).*/;const o=/(wrappers|examples|modules)/;async function versionConstraintSearch(n){const i=await t.s("required_versions*s*",n,".tf$");const a=Object.keys(i).filter((t=>!o.test(t)))[0];const s=i[a].line;if(s){const t=r.exec(s);const n=t?t[0]:"";return n}return""}const i=require("node:http");const a=require("node:https");const s=require("node:zlib");const l=require("node:stream");const u=require("node:buffer");function dataUriToBuffer(t){if(!/^data:/i.test(t)){throw new TypeError('`uri` does not appear to be a Data URI (must begin with "data:")')}t=t.replace(/\r?\n/g,"");const r=t.indexOf(",");if(r===-1||r<=4){throw new TypeError("malformed data: URI")}const n=t.substring(5,r).split(";");let o="";let i=false;const a=n[0]||"text/plain";let s=a;for(let t=1;ttypeof t==="object"&&typeof t.append==="function"&&typeof t.delete==="function"&&typeof t.get==="function"&&typeof t.getAll==="function"&&typeof t.has==="function"&&typeof t.set==="function"&&typeof t.sort==="function"&&t[m]==="URLSearchParams";const isBlob=t=>t&&typeof t==="object"&&typeof t.arrayBuffer==="function"&&typeof t.type==="string"&&typeof t.stream==="function"&&typeof t.constructor==="function"&&/^(Blob|File)$/.test(t[m]);const isAbortSignal=t=>typeof t==="object"&&(t[m]==="AbortSignal"||t[m]==="EventTarget");const isDomainOrSubdomain=(t,r)=>{const n=new URL(r).hostname;const o=new URL(t).hostname;return n===o||n.endsWith(`.${o}`)};const isSameProtocol=(t,r)=>{const n=new URL(r).protocol;const o=new URL(t).protocol;return n===o};const b=(0,d.promisify)(l.pipeline);const y=Symbol("Body internals");class Body{constructor(t,{size:r=0}={}){let n=null;if(t===null){t=null}else if(isURLSearchParameters(t)){t=u.Buffer.from(t.toString())}else if(isBlob(t)){}else if(u.Buffer.isBuffer(t)){}else if(d.types.isAnyArrayBuffer(t)){t=u.Buffer.from(t)}else if(ArrayBuffer.isView(t)){t=u.Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(t instanceof l){}else if(t instanceof h.Ct){t=(0,h.au)(t);n=t.type.split("=")[1]}else{t=u.Buffer.from(String(t))}let o=t;if(u.Buffer.isBuffer(t)){o=l.Readable.from(t)}else if(isBlob(t)){o=l.Readable.from(t.stream())}this[y]={body:t,stream:o,boundary:n,disturbed:false,error:null};this.size=r;if(t instanceof l){t.on("error",(t=>{const r=t instanceof FetchBaseError?t:new FetchError(`Invalid response body while trying to fetch ${this.url}: ${t.message}`,"system",t);this[y].error=r}))}}get body(){return this[y].stream}get bodyUsed(){return this[y].disturbed}async arrayBuffer(){const{buffer:t,byteOffset:r,byteLength:n}=await consumeBody(this);return t.slice(r,r+n)}async formData(){const t=this.headers.get("content-type");if(t.startsWith("application/x-www-form-urlencoded")){const t=new h.Ct;const r=new URLSearchParams(await this.text());for(const[n,o]of r){t.append(n,o)}return t}const{toFormData:r}=await __nccwpck_require__.e(37).then(__nccwpck_require__.bind(__nccwpck_require__,4037));return r(this.body,t)}async blob(){const t=this.headers&&this.headers.get("content-type")||this[y].body&&this[y].body.type||"";const r=await this.arrayBuffer();return new p.Z([r],{type:t})}async json(){const t=await this.text();return JSON.parse(t)}async text(){const t=await consumeBody(this);return(new TextDecoder).decode(t)}buffer(){return consumeBody(this)}}Body.prototype.buffer=(0,d.deprecate)(Body.prototype.buffer,"Please use 'response.arrayBuffer()' instead of 'response.buffer()'","node-fetch#buffer");Object.defineProperties(Body.prototype,{body:{enumerable:true},bodyUsed:{enumerable:true},arrayBuffer:{enumerable:true},blob:{enumerable:true},json:{enumerable:true},text:{enumerable:true},data:{get:(0,d.deprecate)((()=>{}),"data doesn't exist, use json(), text(), arrayBuffer(), or body instead","https://github.com/node-fetch/node-fetch/issues/1000 (response)")}});async function consumeBody(t){if(t[y].disturbed){throw new TypeError(`body used already for: ${t.url}`)}t[y].disturbed=true;if(t[y].error){throw t[y].error}const{body:r}=t;if(r===null){return u.Buffer.alloc(0)}if(!(r instanceof l)){return u.Buffer.alloc(0)}const n=[];let o=0;try{for await(const i of r){if(t.size>0&&o+i.length>t.size){const n=new FetchError(`content size at ${t.url} over limit: ${t.size}`,"max-size");r.destroy(n);throw n}o+=i.length;n.push(i)}}catch(r){const n=r instanceof FetchBaseError?r:new FetchError(`Invalid response body while trying to fetch ${t.url}: ${r.message}`,"system",r);throw n}if(r.readableEnded===true||r._readableState.ended===true){try{if(n.every((t=>typeof t==="string"))){return u.Buffer.from(n.join(""))}return u.Buffer.concat(n,o)}catch(r){throw new FetchError(`Could not create Buffer from response body for ${t.url}: ${r.message}`,"system",r)}}else{throw new FetchError(`Premature close of server response while trying to fetch ${t.url}`)}}const clone=(t,r)=>{let n;let o;let{body:i}=t[y];if(t.bodyUsed){throw new Error("cannot clone body after it is used")}if(i instanceof l&&typeof i.getBoundary!=="function"){n=new l.PassThrough({highWaterMark:r});o=new l.PassThrough({highWaterMark:r});i.pipe(n);i.pipe(o);t[y].stream=n;i=o}return i};const g=(0,d.deprecate)((t=>t.getBoundary()),"form-data doesn't follow the spec and requires special treatment. Use alternative package","https://github.com/node-fetch/node-fetch/issues/1167");const extractContentType=(t,r)=>{if(t===null){return null}if(typeof t==="string"){return"text/plain;charset=UTF-8"}if(isURLSearchParameters(t)){return"application/x-www-form-urlencoded;charset=UTF-8"}if(isBlob(t)){return t.type||null}if(u.Buffer.isBuffer(t)||d.types.isAnyArrayBuffer(t)||ArrayBuffer.isView(t)){return null}if(t instanceof h.Ct){return`multipart/form-data; boundary=${r[y].boundary}`}if(t&&typeof t.getBoundary==="function"){return`multipart/form-data;boundary=${g(t)}`}if(t instanceof l){return null}return"text/plain;charset=UTF-8"};const getTotalBytes=t=>{const{body:r}=t[y];if(r===null){return 0}if(isBlob(r)){return r.size}if(u.Buffer.isBuffer(r)){return r.length}if(r&&typeof r.getLengthSync==="function"){return r.hasKnownLength&&r.hasKnownLength()?r.getLengthSync():null}return null};const writeToStream=async(t,{body:r})=>{if(r===null){t.end()}else{await b(r,t)}};const R=typeof i.validateHeaderName==="function"?i.validateHeaderName:t=>{if(!/^[\^`\-\w!#$%&'*+.|~]+$/.test(t)){const r=new TypeError(`Header name must be a valid HTTP token [${t}]`);Object.defineProperty(r,"code",{value:"ERR_INVALID_HTTP_TOKEN"});throw r}};const S=typeof i.validateHeaderValue==="function"?i.validateHeaderValue:(t,r)=>{if(/[^\t\u0020-\u007E\u0080-\u00FF]/.test(r)){const r=new TypeError(`Invalid character in header content ["${t}"]`);Object.defineProperty(r,"code",{value:"ERR_INVALID_CHAR"});throw r}};class Headers extends URLSearchParams{constructor(t){let r=[];if(t instanceof Headers){const n=t.raw();for(const[t,o]of Object.entries(n)){r.push(...o.map((r=>[t,r])))}}else if(t==null){}else if(typeof t==="object"&&!d.types.isBoxedPrimitive(t)){const n=t[Symbol.iterator];if(n==null){r.push(...Object.entries(t))}else{if(typeof n!=="function"){throw new TypeError("Header pairs must be iterable")}r=[...t].map((t=>{if(typeof t!=="object"||d.types.isBoxedPrimitive(t)){throw new TypeError("Each header pair must be an iterable object")}return[...t]})).map((t=>{if(t.length!==2){throw new TypeError("Each header pair must be a name/value tuple")}return[...t]}))}}else{throw new TypeError("Failed to construct 'Headers': The provided value is not of type '(sequence> or record)")}r=r.length>0?r.map((([t,r])=>{R(t);S(t,String(r));return[String(t).toLowerCase(),String(r)]})):undefined;super(r);return new Proxy(this,{get(t,r,n){switch(r){case"append":case"set":return(n,o)=>{R(n);S(n,String(o));return URLSearchParams.prototype[r].call(t,String(n).toLowerCase(),String(o))};case"delete":case"has":case"getAll":return n=>{R(n);return URLSearchParams.prototype[r].call(t,String(n).toLowerCase())};case"keys":return()=>{t.sort();return new Set(URLSearchParams.prototype.keys.call(t)).keys()};default:return Reflect.get(t,r,n)}}})}get[Symbol.toStringTag](){return this.constructor.name}toString(){return Object.prototype.toString.call(this)}get(t){const r=this.getAll(t);if(r.length===0){return null}let n=r.join(", ");if(/^content-encoding$/i.test(t)){n=n.toLowerCase()}return n}forEach(t,r=undefined){for(const n of this.keys()){Reflect.apply(t,r,[this.get(n),n,this])}}*values(){for(const t of this.keys()){yield this.get(t)}}*entries(){for(const t of this.keys()){yield[t,this.get(t)]}}[Symbol.iterator](){return this.entries()}raw(){return[...this.keys()].reduce(((t,r)=>{t[r]=this.getAll(r);return t}),{})}[Symbol.for("nodejs.util.inspect.custom")](){return[...this.keys()].reduce(((t,r)=>{const n=this.getAll(r);if(r==="host"){t[r]=n[0]}else{t[r]=n.length>1?n:n[0]}return t}),{})}}Object.defineProperties(Headers.prototype,["get","entries","forEach","values"].reduce(((t,r)=>{t[r]={enumerable:true};return t}),{}));function fromRawHeaders(t=[]){return new Headers(t.reduce(((t,r,n,o)=>{if(n%2===0){t.push(o.slice(n,n+2))}return t}),[]).filter((([t,r])=>{try{R(t);S(t,String(r));return true}catch{return false}})))}const v=new Set([301,302,303,307,308]);const isRedirect=t=>v.has(t);const _=Symbol("Response internals");class Response extends Body{constructor(t=null,r={}){super(t,r);const n=r.status!=null?r.status:200;const o=new Headers(r.headers);if(t!==null&&!o.has("Content-Type")){const r=extractContentType(t,this);if(r){o.append("Content-Type",r)}}this[_]={type:"default",url:r.url,status:n,statusText:r.statusText||"",headers:o,counter:r.counter,highWaterMark:r.highWaterMark}}get type(){return this[_].type}get url(){return this[_].url||""}get status(){return this[_].status}get ok(){return this[_].status>=200&&this[_].status<300}get redirected(){return this[_].counter>0}get statusText(){return this[_].statusText}get headers(){return this[_].headers}get highWaterMark(){return this[_].highWaterMark}clone(){return new Response(clone(this,this.highWaterMark),{type:this.type,url:this.url,status:this.status,statusText:this.statusText,headers:this.headers,ok:this.ok,redirected:this.redirected,size:this.size,highWaterMark:this.highWaterMark})}static redirect(t,r=302){if(!isRedirect(r)){throw new RangeError('Failed to execute "redirect" on "response": Invalid status code')}return new Response(null,{headers:{location:new URL(t).toString()},status:r})}static error(){const t=new Response(null,{status:0,statusText:""});t[_].type="error";return t}static json(t=undefined,r={}){const n=JSON.stringify(t);if(n===undefined){throw new TypeError("data is not JSON serializable")}const o=new Headers(r&&r.headers);if(!o.has("content-type")){o.set("content-type","application/json")}return new Response(n,{...r,headers:o})}get[Symbol.toStringTag](){return"Response"}}Object.defineProperties(Response.prototype,{type:{enumerable:true},url:{enumerable:true},status:{enumerable:true},ok:{enumerable:true},redirected:{enumerable:true},statusText:{enumerable:true},headers:{enumerable:true},clone:{enumerable:true}});const w=require("node:url");const getSearch=t=>{if(t.search){return t.search}const r=t.href.length-1;const n=t.hash||(t.href[r]==="#"?"#":"");return t.href[r-n.length]==="?"?"?":""};const C=require("node:net");function stripURLForUseAsAReferrer(t,r=false){if(t==null){return"no-referrer"}t=new URL(t);if(/^(about|blob|data):$/.test(t.protocol)){return"no-referrer"}t.username="";t.password="";t.hash="";if(r){t.pathname="";t.search=""}return t}const E=new Set(["","no-referrer","no-referrer-when-downgrade","same-origin","origin","strict-origin","origin-when-cross-origin","strict-origin-when-cross-origin","unsafe-url"]);const P="strict-origin-when-cross-origin";function validateReferrerPolicy(t){if(!E.has(t)){throw new TypeError(`Invalid referrerPolicy: ${t}`)}return t}function isOriginPotentiallyTrustworthy(t){if(/^(http|ws)s:$/.test(t.protocol)){return true}const r=t.host.replace(/(^\[)|(]$)/g,"");const n=(0,C.isIP)(r);if(n===4&&/^127\./.test(r)){return true}if(n===6&&/^(((0+:){7})|(::(0+:){0,6}))0*1$/.test(r)){return true}if(t.host==="localhost"||t.host.endsWith(".localhost")){return false}if(t.protocol==="file:"){return true}return false}function isUrlPotentiallyTrustworthy(t){if(/^about:(blank|srcdoc)$/.test(t)){return true}if(t.protocol==="data:"){return true}if(/^(blob|filesystem):$/.test(t.protocol)){return true}return isOriginPotentiallyTrustworthy(t)}function determineRequestsReferrer(t,{referrerURLCallback:r,referrerOriginCallback:n}={}){if(t.referrer==="no-referrer"||t.referrerPolicy===""){return null}const o=t.referrerPolicy;if(t.referrer==="about:client"){return"no-referrer"}const i=t.referrer;let a=stripURLForUseAsAReferrer(i);let s=stripURLForUseAsAReferrer(i,true);if(a.toString().length>4096){a=s}if(r){a=r(a)}if(n){s=n(s)}const l=new URL(t.url);switch(o){case"no-referrer":return"no-referrer";case"origin":return s;case"unsafe-url":return a;case"strict-origin":if(isUrlPotentiallyTrustworthy(a)&&!isUrlPotentiallyTrustworthy(l)){return"no-referrer"}return s.toString();case"strict-origin-when-cross-origin":if(a.origin===l.origin){return a}if(isUrlPotentiallyTrustworthy(a)&&!isUrlPotentiallyTrustworthy(l)){return"no-referrer"}return s;case"same-origin":if(a.origin===l.origin){return a}return"no-referrer";case"origin-when-cross-origin":if(a.origin===l.origin){return a}return s;case"no-referrer-when-downgrade":if(isUrlPotentiallyTrustworthy(a)&&!isUrlPotentiallyTrustworthy(l)){return"no-referrer"}return a;default:throw new TypeError(`Invalid referrerPolicy: ${o}`)}}function parseReferrerPolicyFromHeader(t){const r=(t.get("referrer-policy")||"").split(/[,\s]+/);let n="";for(const t of r){if(t&&E.has(t)){n=t}}return n}const T=Symbol("Request internals");const isRequest=t=>typeof t==="object"&&typeof t[T]==="object";const I=(0,d.deprecate)((()=>{}),".data is not a valid RequestInit property, use .body instead","https://github.com/node-fetch/node-fetch/issues/1000 (request)");class Request extends Body{constructor(t,r={}){let n;if(isRequest(t)){n=new URL(t.url)}else{n=new URL(t);t={}}if(n.username!==""||n.password!==""){throw new TypeError(`${n} is an url with embedded credentials.`)}let o=r.method||t.method||"GET";if(/^(delete|get|head|options|post|put)$/i.test(o)){o=o.toUpperCase()}if(!isRequest(r)&&"data"in r){I()}if((r.body!=null||isRequest(t)&&t.body!==null)&&(o==="GET"||o==="HEAD")){throw new TypeError("Request with GET/HEAD method cannot have body")}const i=r.body?r.body:isRequest(t)&&t.body!==null?clone(t):null;super(i,{size:r.size||t.size||0});const a=new Headers(r.headers||t.headers||{});if(i!==null&&!a.has("Content-Type")){const t=extractContentType(i,this);if(t){a.set("Content-Type",t)}}let s=isRequest(t)?t.signal:null;if("signal"in r){s=r.signal}if(s!=null&&!isAbortSignal(s)){throw new TypeError("Expected signal to be an instanceof AbortSignal or EventTarget")}let l=r.referrer==null?t.referrer:r.referrer;if(l===""){l="no-referrer"}else if(l){const t=new URL(l);l=/^about:(\/\/)?client$/.test(t)?"client":t}else{l=undefined}this[T]={method:o,redirect:r.redirect||t.redirect||"follow",headers:a,parsedURL:n,signal:s,referrer:l};this.follow=r.follow===undefined?t.follow===undefined?20:t.follow:r.follow;this.compress=r.compress===undefined?t.compress===undefined?true:t.compress:r.compress;this.counter=r.counter||t.counter||0;this.agent=r.agent||t.agent;this.highWaterMark=r.highWaterMark||t.highWaterMark||16384;this.insecureHTTPParser=r.insecureHTTPParser||t.insecureHTTPParser||false;this.referrerPolicy=r.referrerPolicy||t.referrerPolicy||""}get method(){return this[T].method}get url(){return(0,w.format)(this[T].parsedURL)}get headers(){return this[T].headers}get redirect(){return this[T].redirect}get signal(){return this[T].signal}get referrer(){if(this[T].referrer==="no-referrer"){return""}if(this[T].referrer==="client"){return"about:client"}if(this[T].referrer){return this[T].referrer.toString()}return undefined}get referrerPolicy(){return this[T].referrerPolicy}set referrerPolicy(t){this[T].referrerPolicy=validateReferrerPolicy(t)}clone(){return new Request(this)}get[Symbol.toStringTag](){return"Request"}}Object.defineProperties(Request.prototype,{method:{enumerable:true},url:{enumerable:true},headers:{enumerable:true},redirect:{enumerable:true},clone:{enumerable:true},signal:{enumerable:true},referrer:{enumerable:true},referrerPolicy:{enumerable:true}});const getNodeRequestOptions=t=>{const{parsedURL:r}=t[T];const n=new Headers(t[T].headers);if(!n.has("Accept")){n.set("Accept","*/*")}let o=null;if(t.body===null&&/^(post|put)$/i.test(t.method)){o="0"}if(t.body!==null){const r=getTotalBytes(t);if(typeof r==="number"&&!Number.isNaN(r)){o=String(r)}}if(o){n.set("Content-Length",o)}if(t.referrerPolicy===""){t.referrerPolicy=P}if(t.referrer&&t.referrer!=="no-referrer"){t[T].referrer=determineRequestsReferrer(t)}else{t[T].referrer="no-referrer"}if(t[T].referrer instanceof URL){n.set("Referer",t.referrer)}if(!n.has("User-Agent")){n.set("User-Agent","node-fetch")}if(t.compress&&!n.has("Accept-Encoding")){n.set("Accept-Encoding","gzip, deflate, br")}let{agent:i}=t;if(typeof i==="function"){i=i(r)}if(!n.has("Connection")&&!i){n.set("Connection","close")}const a=getSearch(r);const s={path:r.pathname+a,method:t.method,headers:n[Symbol.for("nodejs.util.inspect.custom")](),insecureHTTPParser:t.insecureHTTPParser,agent:i};return{parsedURL:r,options:s}};class AbortError extends FetchBaseError{constructor(t,r="aborted"){super(t,r)}}var O=__nccwpck_require__(2777);const A=new Set(["data:","http:","https:"]);async function fetch(t,r){return new Promise(((n,o)=>{const u=new Request(t,r);const{parsedURL:d,options:p}=getNodeRequestOptions(u);if(!A.has(d.protocol)){throw new TypeError(`node-fetch cannot load ${t}. URL scheme "${d.protocol.replace(/:$/,"")}" is not supported.`)}if(d.protocol==="data:"){const t=c(u.url);const r=new Response(t,{headers:{"Content-Type":t.typeFull}});n(r);return}const h=(d.protocol==="https:"?a:i).request;const{signal:m}=u;let b=null;const abort=()=>{const t=new AbortError("The operation was aborted.");o(t);if(u.body&&u.body instanceof l.Readable){u.body.destroy(t)}if(!b||!b.body){return}b.body.emit("error",t)};if(m&&m.aborted){abort();return}const abortAndFinalize=()=>{abort();finalize()};const y=h(d.toString(),p);if(m){m.addEventListener("abort",abortAndFinalize)}const finalize=()=>{y.abort();if(m){m.removeEventListener("abort",abortAndFinalize)}};y.on("error",(t=>{o(new FetchError(`request to ${u.url} failed, reason: ${t.message}`,"system",t));finalize()}));fixResponseChunkedTransferBadEnding(y,(t=>{if(b&&b.body){b.body.destroy(t)}}));if(process.version<"v14"){y.on("socket",(t=>{let r;t.prependListener("end",(()=>{r=t._eventsCount}));t.prependListener("close",(n=>{if(b&&r{y.setTimeout(0);const i=fromRawHeaders(t.rawHeaders);if(isRedirect(t.statusCode)){const a=i.get("Location");let s=null;try{s=a===null?null:new URL(a,u.url)}catch{if(u.redirect!=="manual"){o(new FetchError(`uri requested responds with an invalid redirect URL: ${a}`,"invalid-redirect"));finalize();return}}switch(u.redirect){case"error":o(new FetchError(`uri requested responds with a redirect, redirect mode is set to error: ${u.url}`,"no-redirect"));finalize();return;case"manual":break;case"follow":{if(s===null){break}if(u.counter>=u.follow){o(new FetchError(`maximum redirect reached at: ${u.url}`,"max-redirect"));finalize();return}const a={headers:new Headers(u.headers),follow:u.follow,counter:u.counter+1,agent:u.agent,compress:u.compress,method:u.method,body:clone(u),signal:u.signal,size:u.size,referrer:u.referrer,referrerPolicy:u.referrerPolicy};if(!isDomainOrSubdomain(u.url,s)||!isSameProtocol(u.url,s)){for(const t of["authorization","www-authenticate","cookie","cookie2"]){a.headers.delete(t)}}if(t.statusCode!==303&&u.body&&r.body instanceof l.Readable){o(new FetchError("Cannot follow redirect with body being a readable stream","unsupported-redirect"));finalize();return}if(t.statusCode===303||(t.statusCode===301||t.statusCode===302)&&u.method==="POST"){a.method="GET";a.body=undefined;a.headers.delete("content-length")}const c=parseReferrerPolicyFromHeader(i);if(c){a.referrerPolicy=c}n(fetch(new Request(s,a)));finalize();return}default:return o(new TypeError(`Redirect option '${u.redirect}' is not a valid value of RequestRedirect`))}}if(m){t.once("end",(()=>{m.removeEventListener("abort",abortAndFinalize)}))}let a=(0,l.pipeline)(t,new l.PassThrough,(t=>{if(t){o(t)}}));if(process.version<"v12.10"){t.on("aborted",abortAndFinalize)}const c={url:u.url,status:t.statusCode,statusText:t.statusMessage,headers:i,size:u.size,counter:u.counter,highWaterMark:u.highWaterMark};const d=i.get("Content-Encoding");if(!u.compress||u.method==="HEAD"||d===null||t.statusCode===204||t.statusCode===304){b=new Response(a,c);n(b);return}const p={flush:s.Z_SYNC_FLUSH,finishFlush:s.Z_SYNC_FLUSH};if(d==="gzip"||d==="x-gzip"){a=(0,l.pipeline)(a,s.createGunzip(p),(t=>{if(t){o(t)}}));b=new Response(a,c);n(b);return}if(d==="deflate"||d==="x-deflate"){const r=(0,l.pipeline)(t,new l.PassThrough,(t=>{if(t){o(t)}}));r.once("data",(t=>{if((t[0]&15)===8){a=(0,l.pipeline)(a,s.createInflate(),(t=>{if(t){o(t)}}))}else{a=(0,l.pipeline)(a,s.createInflateRaw(),(t=>{if(t){o(t)}}))}b=new Response(a,c);n(b)}));r.once("end",(()=>{if(!b){b=new Response(a,c);n(b)}}));return}if(d==="br"){a=(0,l.pipeline)(a,s.createBrotliDecompress(),(t=>{if(t){o(t)}}));b=new Response(a,c);n(b);return}b=new Response(a,c);n(b)}));writeToStream(y,u).catch(o)}))}function fixResponseChunkedTransferBadEnding(t,r){const n=u.Buffer.from("0\r\n\r\n");let o=false;let i=false;let a;t.on("response",(t=>{const{headers:r}=t;o=r["transfer-encoding"]==="chunked"&&!r["content-length"]}));t.on("socket",(s=>{const onSocketClose=()=>{if(o&&!i){const t=new Error("Premature close");t.code="ERR_STREAM_PREMATURE_CLOSE";r(t)}};const onData=t=>{i=u.Buffer.compare(t.slice(-5),n)===0;if(!i&&a){i=u.Buffer.compare(a.slice(-3),n.slice(0,3))===0&&u.Buffer.compare(t.slice(-2),n.slice(3))===0}a=t};s.prependListener("close",onSocketClose);s.on("data",onData);t.on("close",(()=>{s.removeListener("close",onSocketClose);s.removeListener("data",onData)}))}))}var k=__nccwpck_require__(1383);var B;(function(t){t["arm"]="arm";t["x64"]="amd64";t["x32"]="386"})(B||(B={}));var W;(function(t){t["darwin"]="darwin";t["freebsd"]="freebsd";t["linux"]="linux";t["openbsd"]="openbsd";t["solaris"]="solaris";t["windows"]="windows"})(W||(W={}));async function getMetadata(){const t=await fetch("https://releases.hashicorp.com/terraform/index.json");const r=t.json();return r}async function getMinMaxVersions(t,r={}){const n=new k.Range(t.replace(/,/g,""),r);const o=await getMetadata();const i=Object.keys(o.versions);const a=k.minSatisfying(i,n);const s=k.maxSatisfying(i,n);if(a===s||t==="*"){return[s]}return[a,s]}var D=__nccwpck_require__(2186);async function run(){const t=D.getInput("directory");const r=await versionConstraintSearch(t);try{const t=r.replace(/,|"/g,"");const[n,o]=await getMinMaxVersions(t);D.setOutput("minVersion",n);if(o){D.setOutput("maxVersion",o)}else{D.setOutput("maxVersion",n)}}catch(t){console.error(t)}}run().catch((t=>{D.setFailed(t)}))})();module.exports=n})(); \ No newline at end of file diff --git a/src/search.ts b/src/search.ts index afad3bd..a25635a 100644 --- a/src/search.ts +++ b/src/search.ts @@ -1,11 +1,11 @@ import * as findInFiles from 'find-in-files'; const regExprRequiredVersion = /(?<=(required_version.=.)).*/; -const regExprFilename = /^(versions|providers).tf$/; +const regExprSubDirectory = /(wrappers|examples|modules)/; export async function versionConstraintSearch(dir: string): Promise { const files = await findInFiles.find('required_versions*s*', dir, '.tf$'); - const key = Object.keys(files).filter(word => !regExprFilename.test(word))[0]; + const key = Object.keys(files).filter(word => !regExprSubDirectory.test(word))[0]; const line = files[key].line; if (line) {