1
0
Fork 0
mirror of https://github.com/docker/setup-buildx-action.git synced 2024-12-22 23:02:30 +00:00
setup-buildx-action/dist/index.js

32 lines
2.2 MiB
JavaScript
Raw Normal View History

require('./sourcemap-register.js');(()=>{var e={7799:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable)){n={enumerable:true,get:function(){return t[r]}}}Object.defineProperty(e,i,n)}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);n(t,e);return t};var a=this&&this.__awaiter||function(e,t,r,i){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,n){function fulfilled(e){try{step(i.next(e))}catch(e){n(e)}}function rejected(e){try{step(i["throw"](e))}catch(e){n(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((i=i.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.saveCache=t.restoreCache=t.isFeatureAvailable=t.ReserveCacheError=t.ValidationError=void 0;const o=s(r(2186));const c=s(r(1017));const l=s(r(1518));const p=s(r(8245));const d=r(6490);class ValidationError extends Error{constructor(e){super(e);this.name="ValidationError";Object.setPrototypeOf(this,ValidationError.prototype)}}t.ValidationError=ValidationError;class ReserveCacheError extends Error{constructor(e){super(e);this.name="ReserveCacheError";Object.setPrototypeOf(this,ReserveCacheError.prototype)}}t.ReserveCacheError=ReserveCacheError;function checkPaths(e){if(!e||e.length===0){throw new ValidationError(`Path Validation Error: At least one directory or file path is required`)}}function checkKey(e){if(e.length>512){throw new ValidationError(`Key Validation Error: ${e} cannot be larger than 512 characters.`)}const t=/^[^,]*$/;if(!t.test(e)){throw new ValidationError(`Key Validation Error: ${e} cannot contain commas.`)}}function isFeatureAvailable(){return!!process.env["ACTIONS_CACHE_URL"]}t.isFeatureAvailable=isFeatureAvailable;function restoreCache(e,t,r,i,n=false){return a(this,void 0,void 0,(function*(){checkPaths(e);r=r||[];const s=[t,...r];o.debug("Resolved Keys:");o.debug(JSON.stringify(s));if(s.length>10){throw new ValidationError(`Key Validation Error: Keys are limited to a maximum of 10.`)}for(const e of s){checkKey(e)}const a=yield l.getCompressionMethod();let A="";try{const t=yield p.getCacheEntry(s,e,{compressionMethod:a,enableCrossOsArchive:n});if(!(t===null||t===void 0?void 0:t.archiveLocation)){return undefined}if(i===null||i===void 0?void 0:i.lookupOnly){o.info("Lookup only - skipping download");return t.cacheKey}A=c.join(yield l.createTempDirectory(),l.getCacheFileName(a));o.debug(`Archive Path: ${A}`);yield p.downloadCache(t.archiveLocation,A,i);if(o.isDebug()){yield(0,d.listTar)(A,a)}const r=l.getArchiveFileSizeInBytes(A);o.info(`Cache Size: ~${Math.round(r/(1024*1024))} MB (${r} B)`);yield(0,d.extractTar)(A,a);o.info("Cache restored successfully");return t.cacheKey}catch(e){const t=e;if(t.name===ValidationError.name){throw e}else{o.warning(`Failed to restore: ${e.message}`)}}finally{try{yield l.unlinkFile(A)}catch(e){o.debug(`Failed to delete archive: ${e}`)}}return undefined}))}t.restoreCache=restoreCache;function saveCache(e,t,r,i=false){var n,s,A,u,m;return a(this,void 0,void 0,(function*(){checkPaths(e);checkKey(t);const a=yield l.getCompressionMethod();let h=-1;const g=yield l.resolvePaths(e);o.debug("Cache Paths:");o.debug(`${JSON.stringify(g)}`);if(g.length===0){throw new Error(`Path Validation Error: Path(s) specified in the action for caching do(es) not exist, hence no cache is being saved.`)}const E=yield l.createTempDirectory();const y=c.join(E,l.getCacheFileName(a));o.debug(`Archive Path: ${y}`);try{yield(0,d.createTar)(E,g,a);if(o.isDebug()){yield(0,d.listTar)(y,a)}const c=10*1024*1024*1024;const C=l.getArchiveFi
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var t,r;if(isObject(e)===false)return false;t=e.constructor;if(t===undefined)return true;r=t.prototype;if(isObject(r)===false)return false;if(r.hasOwnProperty("isPrototypeOf")===false){return false}return true}t.isPlainObject=isPlainObject},1917:(e,t,r)=>{"use strict";var i=r(1161);var n=r(8866);function renamed(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. "+"Use yaml."+t+" instead, which is now safe by default.")}}e.exports.Type=r(6073);e.exports.Schema=r(1082);e.exports.FAILSAFE_SCHEMA=r(8562);e.exports.JSON_SCHEMA=r(1035);e.exports.CORE_SCHEMA=r(2011);e.exports.DEFAULT_SCHEMA=r(8759);e.exports.load=i.load;e.exports.loadAll=i.loadAll;e.exports.dump=n.dump;e.exports.YAMLException=r(8179);e.exports.types={binary:r(7900),float:r(2705),map:r(6150),null:r(721),pairs:r(6860),set:r(9548),timestamp:r(9212),bool:r(4993),int:r(1615),merge:r(6104),omap:r(9046),seq:r(7283),str:r(3619)};e.exports.safeLoad=renamed("safeLoad","load");e.exports.safeLoadAll=renamed("safeLoadAll","loadAll");e.exports.safeDump=renamed("safeDump","dump")},6829:e=>{"use strict";function isNothing(e){return typeof e==="undefined"||e===null}function isObject(e){return typeof e==="object"&&e!==null}function toArray(e){if(Array.isArray(e))return e;else if(isNothing(e))return[];return[e]}function extend(e,t){var r,i,n,s;if(t){s=Object.keys(t);for(r=0,i=s.length;r<i;r+=1){n=s[r];e[n]=t[n]}}return e}function repeat(e,t){var r="",i;for(i=0;i<t;i+=1){r+=e}return r}function isNegativeZero(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}e.exports.isNothing=isNothing;e.exports.isObject=isObject;e.exports.toArray=toArray;e.exports.repeat=repeat;e.exports.isNegativeZero=isNegativeZero;e.exports.extend=extend},8866:(e,t,r)=>{"use strict";var i=r(6829);var n=r(8179);var s=r(8759);var a=Object.prototype.toString;var o=Object.prototype.hasOwnProperty;var c=65279;var l=9;var p=10;var d=13;var A=32;var u=33;var m=34;var h=35;var g=37;var E=38;var y=39;var C=42;var b=44;var I=45;var v=58;var B=61;var w=62;var Q=63;var S=64;var x=91;var N=93;var R=96;var D=123;var T=124;var _=125;var k={};k[0]="\\0";k[7]="\\a";k[8]="\\b";k[9]="\\t";k[10]="\\n";k[11]="\\v";k[12]="\\f";k[13]="\\r";k[27]="\\e";k[34]='\\"';k[92]="\\\\";k[133]="\\N";k[160]="\\_";k[8232]="\\L";k[8233]="\\P";var O=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"];var P=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function compileStyleMap(e,t){var r,i,n,s,a,c,l;if(t===null)return{};r={};i=Object.keys(t);for(n=0,s=i.length;n<s;n+=1){a=i[n];c=String(t[a]);if(a.slice(0,2)==="!!"){a="tag:yaml.org,2002:"+a.slice(2)}l=e.compiledTypeMap["fallback"][a];if(l&&o.call(l.styleAliases,c)){c=l.styleAliases[c]}r[a]=c}return r}function encodeHex(e){var t,r,s;t=e.toString(16).toUpperCase();if(e<=255){r="x";s=2}else if(e<=65535){r="u";s=4}else if(e<=4294967295){r="U";s=8}else{throw new n("code point within a string may not be greater than 0xFFFFFFFF")}return"\\"+r+i.repeat("0",s-t.length)+t}var L=1,M=2;function State(e){this.schema=e["schema"]||s;this.indent=Math.max(1,e["indent"]||2);this.noArrayIndent=e["noArrayIndent"]||false;this.skipInvalid=e["skipInvalid"]||false;this.flowLevel=i.isNothing(e["flowLevel"])?-1:e["flowLevel"];this.styleMap=compileStyleMap(this.schema,e["styles"]||null);this.sortKeys=e["sortKeys"]||false;this.lineWidth=e["lineWidth"]||80;this.noRefs=e["noRefs"]||false;this.noCompatMode=e["noCompatMode"]||false;this.condenseFlow=e["condenseFlow"]||false;this.quotingType=e["quotingType"]==='"'?M:L;this.forceQuotes=e["forceQuotes"]||false;this.replacer=typeof e["replacer"]==="function"?e["replacer"]:null;this.implicitTypes=this.schema.compiledImplicit;this.explicitTypes=this.schema.compiledExplicit;this.tag=null;this.result="";this.duplicates=[];this.usedDuplicates=null}function indentString(e,t){var r=i.repeat(" ",t),n=0,s=-1,a="",o,c=e.length;while(n<c){s=e.indexOf("\n",n);if(s===-1){o=e.slice(n);n=c}else{o=e.slice(n,s+1);n=s+1}if(o.leng
/*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*/
e.exports=r(3765)},3583:(e,t,r)=>{"use strict";
/*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/var i=r(7426);var n=r(1017).extname;var s=/^\s*([^;\s]*)(?:;|\s|$)/;var a=/^text\//i;t.charset=charset;t.charsets={lookup:charset};t.contentType=contentType;t.extension=extension;t.extensions=Object.create(null);t.lookup=lookup;t.types=Object.create(null);populateMaps(t.extensions,t.types);function charset(e){if(!e||typeof e!=="string"){return false}var t=s.exec(e);var r=t&&i[t[1].toLowerCase()];if(r&&r.charset){return r.charset}if(t&&a.test(t[1])){return"UTF-8"}return false}function contentType(e){if(!e||typeof e!=="string"){return false}var r=e.indexOf("/")===-1?t.lookup(e):e;if(!r){return false}if(r.indexOf("charset")===-1){var i=t.charset(r);if(i)r+="; charset="+i.toLowerCase()}return r}function extension(e){if(!e||typeof e!=="string"){return false}var r=s.exec(e);var i=r&&t.extensions[r[1].toLowerCase()];if(!i||!i.length){return false}return i[0]}function lookup(e){if(!e||typeof e!=="string"){return false}var r=n("x."+e).toLowerCase().substr(1);if(!r){return false}return t.types[r]||false}function populateMaps(e,t){var r=["nginx","apache",undefined,"iana"];Object.keys(i).forEach((function forEachMimeType(n){var s=i[n];var a=s.extensions;if(!a||!a.length){return}e[n]=a;for(var o=0;o<a.length;o++){var c=a[o];if(t[c]){var l=r.indexOf(i[t[c]].source);var p=r.indexOf(s.source);if(t[c]!=="application/octet-stream"&&(l>p||l===p&&t[c].substr(0,12)==="application/")){continue}}t[c]=n}}))}},3973:(e,t,r)=>{e.exports=minimatch;minimatch.Minimatch=Minimatch;var i=function(){try{return r(1017)}catch(e){}}()||{sep:"/"};minimatch.sep=i.sep;var n=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var s=r(3717);var a={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var o="[^/]";var c=o+"*?";var l="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var p="(?:(?!(?:\\/|^)\\.).)*?";var d=charSet("().*{}+?[]^$\\!");function charSet(e){return e.split("").reduce((function(e,t){e[t]=true;return e}),{})}var A=/\/+/;minimatch.filter=filter;function filter(e,t){t=t||{};return function(r,i,n){return minimatch(r,e,t)}}function ext(e,t){t=t||{};var r={};Object.keys(e).forEach((function(t){r[t]=e[t]}));Object.keys(t).forEach((function(e){r[e]=t[e]}));return r}minimatch.defaults=function(e){if(!e||typeof e!=="object"||!Object.keys(e).length){return minimatch}var t=minimatch;var r=function minimatch(r,i,n){return t(r,i,ext(e,n))};r.Minimatch=function Minimatch(r,i){return new t.Minimatch(r,ext(e,i))};r.Minimatch.defaults=function defaults(r){return t.defaults(ext(e,r)).Minimatch};r.filter=function filter(r,i){return t.filter(r,ext(e,i))};r.defaults=function defaults(r){return t.defaults(ext(e,r))};r.makeRe=function makeRe(r,i){return t.makeRe(r,ext(e,i))};r.braceExpand=function braceExpand(r,i){return t.braceExpand(r,ext(e,i))};r.match=function(r,i,n){return t.match(r,i,ext(e,n))};return r};Minimatch.defaults=function(e){return minimatch.defaults(e).Minimatch};function minimatch(e,t,r){assertValidPattern(t);if(!r)r={};if(!r.nocomment&&t.charAt(0)==="#"){return false}return new Minimatch(t,r).match(e)}function Minimatch(e,t){if(!(this instanceof Minimatch)){return new Minimatch(e,t)}assertValidPattern(e);if(!t)t={};e=e.trim();if(!t.allowWindowsEscape&&i.sep!=="/"){e=e.split(i.sep).join("/")}this.options=t;this.set=[];this.pattern=e;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!t.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var e=this.pattern;var t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();var r=this.globSet=this.braceExpand();if(t.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,r);r=this.globParts=r.map((function(e){return e.split(A)}));this.debug(this.pattern,r);r=r.map((function(e,t,r){return e.map(this.parse,this)}),this);this.debug(this.pattern,r);r=r.filter((function(e){return e.indexOf(false)===-1}));this.debug(this.pattern,r);thi
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var e=String.fromCharCode;var t=Math.floor;var fromCodePoint=function(){var r=16384;var i=[];var n;var s;var a=-1;var o=arguments.length;if(!o){return""}var c="";while(++a<o){var l=Number(arguments[a]);if(!isFinite(l)||l<0||l>1114111||t(l)!==l){throw RangeError("Invalid code point: "+l)}if(l<=65535){i.push(l)}else{l-=65536;n=(l>>10)+55296;s=l%1024+56320;i.push(n,s)}if(a+1===o||i.length>r){c+=e.apply(null,i);i.length=0}}return c};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:t)},4758:(e,t,r)=>{const i=Symbol("SemVer ANY");class Comparator{static get ANY(){return i}constructor(e,t){t=n(t);if(e instanceof Comparator){if(e.loose===!!t.loose){return e}else{e=e.value}}e=e.trim().split(/\s+/).join(" ");c("comparator",e,t);this.options=t;this.loose=!!t.loose;this.parse(e);if(this.semver===i){this.value=""}else{this.value=this.operator+this.semver.version}c("comp",this)}parse(e){const t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR];const r=e.match(t);if(!r){throw new TypeError(`Invalid comparator: ${e}`)}this.operator=r[1]!==undefined?r[1]:"";if(this.operator==="="){this.operator=""}if(!r[2]){this.semver=i}else{this.semver=new l(r[2],this.options.loose)}}toString(){return this.value}test(e){c("Comparator.test",e,this.options.loose);if(this.semver===i||e===i){return true}if(typeof e==="string"){try{e=new l(e,this.options)}catch(e){return false}}return o(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Comparator)){throw new TypeError("a Comparator is required")}if(this.operator===""){if(this.value===""){return true}return new p(e.value,t).test(this.value)}else if(e.operator===""){if(e.value===""){return true}return new p(this.value,t).test(e.semver)}t=n(t);if(t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")){return false}if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))){return false}if(this.operator.startsWith(">")&&e.operator.startsWith(">")){return true}if(this.operator.startsWith("<")&&e.operator.startsWith("<")){return true}if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")){return true}if(o(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")){return true}if(o(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")){return true}return false}}e.exports=Comparator;const n=r(785);const{safeRe:s,t:a}=r(9523);const o=r(5098);const c=r(106);const l=r(8088);const p=r(9828)},9828:(e,t,r)=>{class Range{constructor(e,t){t=s(t);if(e instanceof Range){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease){return e}else{return new Range(e.raw,t)}}if(e instanceof a){this.raw=e.value;this.set=[[e]];this.format();return this}this.options=t;this.loose=!!t.loose;this.includePrerelease=!!t.includePrerelease;this.raw=e.trim().split(/\s+/).join(" ");this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length));if(!this.set.length){throw new TypeError(`Invalid SemVer Range: ${this.raw}`)}if(this.set.length>1){const e=this.set[0];this.set=this.set.filter((e=>!isNullSet(e[0])));if(this.set.length===0){this.set=[e]}else if(this.set.length>1){for(const e of this.set){if(e.length===1&&isAny(e[0])){this.set=[e];break}}}}this.format()}format(){this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim();return this.range}toString(){return this.range}parseRange(e){const t=(this.options.includePrerelease&&m)|(this.options.loose&&h);const r=t+":"+e;const i=n.get(r);if(i){return i}const s=this.options.loose;const c=s?l[p.HYPHENRANGELOOSE]:l[p.HYPHENRANGE];e=e.replace(c,hyphenReplace(this.options.includePrerelease));o("hyphen replace",e);e=e.replace(l[p.COMPARATORTRIM],d);o("comparator trim",e);e=e.replace(l[p.TILDETRIM],A);o("tilde trim",e);e=e.replace(l[p.CARETTRIM],u);o("caret trim"
/*!
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
*/
const i=r(7147);const n=r(2037);const s=r(1017);const a=r(6113);const o={fs:i.constants,os:n.constants};const c="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",l=/XXXXXX/,p=3,d=(o.O_CREAT||o.fs.O_CREAT)|(o.O_EXCL||o.fs.O_EXCL)|(o.O_RDWR||o.fs.O_RDWR),A=n.platform()==="win32",u=o.EBADF||o.os.errno.EBADF,m=o.ENOENT||o.os.errno.ENOENT,h=448,g=384,E="exit",y=[],C=i.rmdirSync.bind(i);let b=false;function rimraf(e,t){return i.rm(e,{recursive:true},t)}function FN_RIMRAF_SYNC(e){return i.rmSync(e,{recursive:true})}function tmpName(e,t){const r=_parseArguments(e,t),n=r[0],s=r[1];try{_assertAndSanitizeOptions(n)}catch(e){return s(e)}let a=n.tries;(function _getUniqueName(){try{const e=_generateTmpName(n);i.stat(e,(function(t){if(!t){if(a-- >0)return _getUniqueName();return s(new Error("Could not get a unique tmp filename, max tries reached "+e))}s(null,e)}))}catch(e){s(e)}})()}function tmpNameSync(e){const t=_parseArguments(e),r=t[0];_assertAndSanitizeOptions(r);let n=r.tries;do{const e=_generateTmpName(r);try{i.statSync(e)}catch(t){return e}}while(n-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(e,t){const r=_parseArguments(e,t),n=r[0],s=r[1];tmpName(n,(function _tmpNameCreated(e,t){if(e)return s(e);i.open(t,d,n.mode||g,(function _fileCreated(e,r){if(e)return s(e);if(n.discardDescriptor){return i.close(r,(function _discardCallback(e){return s(e,t,undefined,_prepareTmpFileRemoveCallback(t,-1,n,false))}))}else{const e=n.discardDescriptor||n.detachDescriptor;s(null,t,r,_prepareTmpFileRemoveCallback(t,e?-1:r,n,false))}}))}))}function fileSync(e){const t=_parseArguments(e),r=t[0];const n=r.discardDescriptor||r.detachDescriptor;const s=tmpNameSync(r);var a=i.openSync(s,d,r.mode||g);if(r.discardDescriptor){i.closeSync(a);a=undefined}return{name:s,fd:a,removeCallback:_prepareTmpFileRemoveCallback(s,n?-1:a,r,true)}}function dir(e,t){const r=_parseArguments(e,t),n=r[0],s=r[1];tmpName(n,(function _tmpNameCreated(e,t){if(e)return s(e);i.mkdir(t,n.mode||h,(function _dirCreated(e){if(e)return s(e);s(null,t,_prepareTmpDirRemoveCallback(t,n,false))}))}))}function dirSync(e){const t=_parseArguments(e),r=t[0];const n=tmpNameSync(r);i.mkdirSync(n,r.mode||h);return{name:n,removeCallback:_prepareTmpDirRemoveCallback(n,r,true)}}function _removeFileAsync(e,t){const _handler=function(e){if(e&&!_isENOENT(e)){return t(e)}t()};if(0<=e[0])i.close(e[0],(function(){i.unlink(e[1],_handler)}));else i.unlink(e[1],_handler)}function _removeFileSync(e){let t=null;try{if(0<=e[0])i.closeSync(e[0])}catch(e){if(!_isEBADF(e)&&!_isENOENT(e))throw e}finally{try{i.unlinkSync(e[1])}catch(e){if(!_isENOENT(e))t=e}}if(t!==null){throw t}}function _prepareTmpFileRemoveCallback(e,t,r,i){const n=_prepareRemoveCallback(_removeFileSync,[t,e],i);const s=_prepareRemoveCallback(_removeFileAsync,[t,e],i,n);if(!r.keep)y.unshift(n);return i?n:s}function _prepareTmpDirRemoveCallback(e,t,r){const n=t.unsafeCleanup?rimraf:i.rmdir.bind(i);const s=t.unsafeCleanup?FN_RIMRAF_SYNC:C;const a=_prepareRemoveCallback(s,e,r);const o=_prepareRemoveCallback(n,e,r,a);if(!t.keep)y.unshift(a);return r?a:o}function _prepareRemoveCallback(e,t,r,i){let n=false;return function _cleanupCallback(s){if(!n){const a=i||_cleanupCallback;const o=y.indexOf(a);if(o>=0)y.splice(o,1);n=true;if(r||e===C||e===FN_RIMRAF_SYNC){return e(t)}else{return e(t,s||function(){})}}}}function _garbageCollector(){if(!b)return;while(y.length){try{y[0]()}catch(e){}}}function _randomChars(e){let t=[],r=null;try{r=a.randomBytes(e)}catch(t){r=a.pseudoRandomBytes(e)}for(var i=0;i<e;i++){t.push(c[r[i]%c.length])}return t.join("")}function _isBlank(e){return e===null||_isUndefined(e)||!e.trim()}function _isUndefined(e){return typeof e==="undefined"}function _parseArguments(e,t){if(typeof e==="function"){return[{},e]}if(_isUndefined(e)){return[{},t]}const r={};for(const t of Object.getOwnPropertyNames(e)){r[t]=e[t]}return[r,t]}function _generateTmpName(e){const t=e.tmpdir;if(!_isUndefined(e.name))return s.join(t,e.dir,e.name);if(!_isUndefined(e.template))return s.join(t,e.dir,e.t
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=e=>e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=e=>e.replace(/\r?\n|\r/g,"\r\n");const i=[];const n=new Uint8Array([13,10]);d=0;let s=false;for(const[t,a]of e){if(typeof a==="string"){const e=N.encode(r+`; name="${escape(normalizeLinefeeds(t))}"`+`\r\n\r\n${normalizeLinefeeds(a)}\r\n`);i.push(e);d+=e.byteLength}else{const e=N.encode(`${r}; name="${escape(normalizeLinefeeds(t))}"`+(a.name?`; filename="${escape(a.name)}"`:"")+"\r\n"+`Content-Type: ${a.type||"application/octet-stream"}\r\n\r\n`);i.push(e,a,n);if(typeof a.size==="number"){d+=e.byteLength+a.size+n.byteLength}else{s=true}}}const a=N.encode(`--${t}--`);i.push(a);d+=a.byteLength;if(s){d=null}p=e;l=async function*(){for(const e of i){if(e.stream){yield*e.stream()}else{yield e}}};A="multipart/form-data; boundary="+t}else if(a(e)){p=e;d=e.size;if(e.type){A=e.type}}else if(typeof e[Symbol.asyncIterator]==="function"){if(t){throw new TypeError("keepalive")}if(n.isDisturbed(e)||e.locked){throw new TypeError("Response body object should not be disturbed or locked")}i=e instanceof S?e:s(e)}if(typeof p==="string"||n.isBuffer(p)){d=Buffer.byteLength(p)}if(l!=null){let t;i=new S({async start(){t=l(e)[Symbol.asyncIterator]()},async pull(e){const{value:r,done:n}=await t.next();if(n){queueMicrotask((()=>{e.close()}))}else{if(!b(i)){e.enqueue(new Uint8Array(r))}}return e.desiredSize>0},async cancel(e){await t.return()},type:undefined})}const u={stream:i,source:p,length:d};return[u,A]}function safelyExtractBody(e,t=false){if(!S){S=r(5356).ReadableStream}if(e instanceof S){C(!n.isDisturbed(e),"The body has already been consumed.");C(!e.locked,"The stream is locked.")}return extractBody(e,t)}function cloneBody(e){const[t,r]=e.stream.tee();const i=h(r,{transfer:[r]});const[,n]=i.tee();e.stream=t;return{stream:n,length:e.length,source:e.source}}async function*consumeBody(e){if(e){if(I(e)){yield e}else{const t=e.stream;if(n.isDisturbed(t)){throw new TypeError("The body has already been consumed.")}if(t.locked){throw new TypeError("The stream is locked.")}t[y]=true;yield*t}}}function throwIfAborted(e){if(e.aborted){throw new m("The operation was aborted.","AbortError")}}function bodyMixinMethods(e){const t={blob(){return specConsumeBody(this,(e=>{let t=bodyMimeType(this);if(t==="failure"){t=""}else if(t){t=Q(t)}return new g([e],{type:t})}),e)},arrayBuffer(){return specConsumeBody(this,(e=>new Uint8Array(e).buffer),e)},text(){return specConsumeBody(this,utf8DecodeBytes,e)},json(){return specConsumeBody(this,parseJSONFromBytes,e)},async formData(){u.brandCheck(this,e);throwIfAborted(this[A]);const t=this.headers.get("Content-Type");if(/multipart\/form-data/.test(t)){const e={};for(const[t,r]of this.headers)e[t.toLowerCase()]=r;const t=new d;let r;try{r=new i({headers:e,preservePath:true})}catch(e){throw new m(`${e}`,"AbortError")}r.on("field",((e,r)=>{t.append(e,r)}));r.on("file",((e,r,i,n,s)=>{const a=[];if(n==="base64"||n.toLowerCase()==="base64"){let n="";r.on("data",(e=>{n+=e.toString().replace(/[\r\n]/gm,"");const t=n.length-n.length%4;a.push(Buffer.from(n.slice(0,t),"base64"));n=n.slice(t)}));r.on("end",(()=>{a.push(Buffer.from(n,"base64"));t.append(e,new x(a,i,{type:s}))}))}else{r.on("data",(e=>{a.push(e)}));r.on("end",(()=>{t.append(e,new x(a,i,{type:s}))}))}}));const n=new Promise(((e,t)=>{r.on("finish",e);r.on("error",(e=>t(new TypeError(e))))}));if(this.body!==null)for await(const e of consumeBody(this[A].body))r.write(e);r.end();await n;return t}else if(/application\/x-www-form-urlencoded/.test(t)){let e;try{let t="";const r=new TextDecoder("utf-8",{ignoreBOM:true});for await(const e of consumeBody(this[A].body)){if(!I(e)){throw new TypeError("Expected Uint8Array chunk")}t+=r.decode(e,{stream:true})}t+=r.decode();e=new URLSearchParams(t)}catch(e){throw Object.assign(new TypeError,{cause:e})}const t=new d;for(const[r,i]of e){t.append(r,i)}return t}else{await Promise.resolve();throwIfAborted(this[A]);throw u.errors.exception({he
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */s[n-4]=this.maskKey[0];s[n-3]=this.maskKey[1];s[n-2]=this.maskKey[2];s[n-1]=this.maskKey[3];s[1]=r;if(r===126){s.writeUInt16BE(t,2)}else if(r===127){s[2]=s[3]=0;s.writeUIntBE(t,4,6)}s[1]|=128;for(let e=0;e<t;e++){s[n+e]=this.frameData[e]^this.maskKey[e%4]}return s}}e.exports={WebsocketFrameSend:WebsocketFrameSend}},1688:(e,t,r)=>{"use strict";const{Writable:i}=r(2781);const n=r(7643);const{parserStates:s,opcodes:a,states:o,emptyBuffer:c}=r(9188);const{kReadyState:l,kSentClose:p,kResponse:d,kReceivedClose:A}=r(7578);const{isValidStatusCode:u,failWebsocketConnection:m,websocketMessageReceived:h}=r(5515);const{WebsocketFrameSend:g}=r(5444);const E={};E.ping=n.channel("undici:websocket:ping");E.pong=n.channel("undici:websocket:pong");class ByteParser extends i{#a=[];#o=0;#c=s.INFO;#l={};#p=[];constructor(e){super();this.ws=e}_write(e,t,r){this.#a.push(e);this.#o+=e.length;this.run(r)}run(e){while(true){if(this.#c===s.INFO){if(this.#o<2){return e()}const t=this.consume(2);this.#l.fin=(t[0]&128)!==0;this.#l.opcode=t[0]&15;this.#l.originalOpcode??=this.#l.opcode;this.#l.fragmented=!this.#l.fin&&this.#l.opcode!==a.CONTINUATION;if(this.#l.fragmented&&this.#l.opcode!==a.BINARY&&this.#l.opcode!==a.TEXT){m(this.ws,"Invalid frame type was fragmented.");return}const r=t[1]&127;if(r<=125){this.#l.payloadLength=r;this.#c=s.READ_DATA}else if(r===126){this.#c=s.PAYLOADLENGTH_16}else if(r===127){this.#c=s.PAYLOADLENGTH_64}if(this.#l.fragmented&&r>125){m(this.ws,"Fragmented frame exceeded 125 bytes.");return}else if((this.#l.opcode===a.PING||this.#l.opcode===a.PONG||this.#l.opcode===a.CLOSE)&&r>125){m(this.ws,"Payload length for control frame exceeded 125 bytes.");return}else if(this.#l.opcode===a.CLOSE){if(r===1){m(this.ws,"Received close frame with a 1-byte body.");return}const e=this.consume(r);this.#l.closeInfo=this.parseCloseBody(false,e);if(!this.ws[p]){const e=Buffer.allocUnsafe(2);e.writeUInt16BE(this.#l.closeInfo.code,0);const t=new g(e);this.ws[d].socket.write(t.createFrame(a.CLOSE),(e=>{if(!e){this.ws[p]=true}}))}this.ws[l]=o.CLOSING;this.ws[A]=true;this.end();return}else if(this.#l.opcode===a.PING){const t=this.consume(r);if(!this.ws[A]){const e=new g(t);this.ws[d].socket.write(e.createFrame(a.PONG));if(E.ping.hasSubscribers){E.ping.publish({payload:t})}}this.#c=s.INFO;if(this.#o>0){continue}else{e();return}}else if(this.#l.opcode===a.PONG){const t=this.consume(r);if(E.pong.hasSubscribers){E.pong.publish({payload:t})}if(this.#o>0){continue}else{e();return}}}else if(this.#c===s.PAYLOADLENGTH_16){if(this.#o<2){return e()}const t=this.consume(2);this.#l.payloadLength=t.readUInt16BE(0);this.#c=s.READ_DATA}else if(this.#c===s.PAYLOADLENGTH_64){if(this.#o<8){return e()}const t=this.consume(8);const r=t.readUInt32BE(0);if(r>2**31-1){m(this.ws,"Received payload length > 2^31 bytes.");return}const i=t.readUInt32BE(4);this.#l.payloadLength=(r<<8)+i;this.#c=s.READ_DATA}else if(this.#c===s.READ_DATA){if(this.#o<this.#l.payloadLength){return e()}else if(this.#o>=this.#l.payloadLength){const e=this.consume(this.#l.payloadLength);this.#p.push(e);if(!this.#l.fragmented||this.#l.fin&&this.#l.opcode===a.CONTINUATION){const e=Buffer.concat(this.#p);h(this.ws,this.#l.originalOpcode,e);this.#l={};this.#p.length=0}this.#c=s.INFO}}if(this.#o>0){continue}else{e();break}}}consume(e){if(e>this.#o){return null}else if(e===0){return c}if(this.#a[0].length===e){this.#o-=this.#a[0].length;return this.#a.shift()}const t=Buffer.allocUnsafe(e);let r=0;while(r!==e){const i=this.#a[0];const{length:n}=i;if(n+r===e){t.set(this.#a.shift(),r);break}else if(n+r>e){t.set(i.subarray(0,e-r),r);this.#a[0]=i.subarray(e-r);break}else{t.set(this.#a.shift(),r);r+=i.length}}this.#o-=e;return t}parseCloseBody(e,t){let r;if(t.length>=2){r=t.readUInt16BE(0)}if(e){if(!u(r)){return null}return{code:r}}let i=t.subarray(2);if(i[0]===239&&i[1]===187&&i[2]===191){i=i.subarray(3)}if(r!==undefined&&!u(r)){return null}try{i=new TextDecoder("utf-8",{fatal:true}).decode(i)}catch{return null}return{code:r,reason:i}}get closingIn
//# sourceMappingURL=index.js.map