From 2c3bcc6164a28a54a3914195771c3229d05d9487 Mon Sep 17 00:00:00 2001 From: wss-git Date: Fri, 8 Oct 2021 16:08:18 +0800 Subject: [PATCH] build: run build --- .gitignore | 2 -- lib/common/help.d.ts | 44 ++++++++++++++++++++++++++++++++ lib/common/logger.d.ts | 10 ++++++++ lib/common/stdout-formatter.d.ts | 4 +++ lib/index.d.ts | 11 ++++++++ lib/index.js | 1 + lib/interface/entity.d.ts | 34 ++++++++++++++++++++++++ lib/lib/client.d.ts | 5 ++++ lib/lib/event.d.ts | 4 +++ lib/lib/handler-body.d.ts | 1 + lib/lib/remote-invoke.d.ts | 39 ++++++++++++++++++++++++++++ lib/lib/stdin.d.ts | 5 ++++ package.json | 2 ++ src/lib/handler-body.ts | 34 ++++++++++++++++++++++++ 14 files changed, 194 insertions(+), 2 deletions(-) create mode 100644 lib/common/help.d.ts create mode 100644 lib/common/logger.d.ts create mode 100644 lib/common/stdout-formatter.d.ts create mode 100644 lib/index.d.ts create mode 100644 lib/index.js create mode 100644 lib/interface/entity.d.ts create mode 100644 lib/lib/client.d.ts create mode 100644 lib/lib/event.d.ts create mode 100644 lib/lib/handler-body.d.ts create mode 100644 lib/lib/remote-invoke.d.ts create mode 100644 lib/lib/stdin.d.ts create mode 100644 src/lib/handler-body.ts diff --git a/.gitignore b/.gitignore index b7a4e00..247ff84 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,3 @@ node_modules package-lock.json .idea .vscode -lib - diff --git a/lib/common/help.d.ts b/lib/common/help.d.ts new file mode 100644 index 0000000..f5a0817 --- /dev/null +++ b/lib/common/help.d.ts @@ -0,0 +1,44 @@ +declare const _default: ({ + header: string; + content: string; + optionList?: undefined; +} | { + header: string; + optionList: ({ + name: string; + description: string; + type: StringConstructor; + alias?: undefined; + } | { + name: string; + description: string; + alias: string; + type: StringConstructor; + } | { + name: string; + description: string; + type: BooleanConstructor; + alias?: undefined; + })[]; + content?: undefined; +} | { + header: string; + optionList: { + name: string; + description: string; + alias: string; + type: BooleanConstructor; + }[]; + content?: undefined; +} | { + header: string; + content: string[]; + optionList?: undefined; +} | { + header: string; + content: { + example: string; + }[]; + optionList?: undefined; +})[]; +export default _default; diff --git a/lib/common/logger.d.ts b/lib/common/logger.d.ts new file mode 100644 index 0000000..bc1962b --- /dev/null +++ b/lib/common/logger.d.ts @@ -0,0 +1,10 @@ +export default class ComponentLogger { + static CONTENT: string; + static setContent(content: any): void; + static log(m: any, color?: 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'whiteBright' | 'gray'): void; + static info(m: any): void; + static debug(m: any): void; + static error(m: any): void; + static warning(m: any): void; + static success(m: any): void; +} diff --git a/lib/common/stdout-formatter.d.ts b/lib/common/stdout-formatter.d.ts new file mode 100644 index 0000000..5fa1786 --- /dev/null +++ b/lib/common/stdout-formatter.d.ts @@ -0,0 +1,4 @@ +export default class StdoutFormatter { + static stdoutFormatter: any; + static initStdout(): Promise; +} diff --git a/lib/index.d.ts b/lib/index.d.ts new file mode 100644 index 0000000..25233b0 --- /dev/null +++ b/lib/index.d.ts @@ -0,0 +1,11 @@ +import { InputProps } from './interface/entity'; +export default class FcRemoteInvoke { + /** + * event 函数本地调试 + * @param inputs + * @returns + */ + invoke(inputs: InputProps): Promise; + private report; + private handlerInputs; +} diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..7533c23 --- /dev/null +++ b/lib/index.js @@ -0,0 +1 @@ +module.exports=(()=>{var e={817:e=>{"use strict";e.exports=JSON.parse('{"_from":"@alicloud/fc2@^2.2.2","_id":"@alicloud/fc2@2.2.2","_inBundle":false,"_integrity":"sha1-q7UhhHnMH/KnGWuDwMxoy0ppJrU=","_location":"/@alicloud/fc2","_phantomChildren":{},"_requested":{"type":"range","registry":true,"raw":"@alicloud/fc2@^2.2.2","name":"@alicloud/fc2","escapedName":"@alicloud%2ffc2","scope":"@alicloud","rawSpec":"^2.2.2","saveSpec":null,"fetchSpec":"^2.2.2"},"_requiredBy":["/"],"_resolved":"https://registry.nlark.com/@alicloud/fc2/download/@alicloud/fc2-2.2.2.tgz","_shasum":"abb5218479cc1ff2a7196b83c0cc68cb4a6926b5","_spec":"@alicloud/fc2@^2.2.2","_where":"/Users/wb447188/Desktop/new-repo/fc-remote-invoke","author":{"name":"Jackson Tian"},"bugs":{"url":"https://github.com/aliyun/fc-nodejs-sdk/issues"},"bundleDependencies":false,"dependencies":{"babel-runtime":"^6.23.0","debug":"^2.6.4","httpx":"^2.1.1","kitx":"^1.2.0"},"deprecated":false,"description":"Aliyun Function Compute API SDK2","devDependencies":{"babel-cli":"^6.24.1","babel-plugin-transform-runtime":"^6.23.0","babel-preset-env":"^1.4.0","babel-register":"^6.24.1","coveralls":"^2.13.0","doxmate":"^0.3.1","eslint":"^3.19.0","expect.js":"^0.3.1","git-pre-hooks":"^1.2.0","mocha":"^3.3.0","nyc":"^10.2.0"},"directories":{"doc":"doc","lib":"lib","test":"test"},"files":["index.js","lib","es5"],"git-pre-hooks":{"pre-release":"npm run build-es5","post-release":"npm publish --access public"},"homepage":"https://github.com/aliyun/fc-nodejs-sdk#readme","license":"MIT","main":"index.js","name":"@alicloud/fc2","repository":{"type":"git","url":"git+https://github.com/aliyun/fc-nodejs-sdk.git"},"scripts":{"build-es5":"babel lib/ -d es5/","test":"make test"},"version":"2.2.2"}')},1619:(e,t,r)=>{"use strict";var n=r(1043);var i=_interopRequireDefault(n);var s=function(){function defineProperties(e,t){for(var r=0;r4&&arguments[4]!==undefined?arguments[4]:{};var a=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{};var f,h,d,p,y,m,g,v,b,w,_,S,E,C;return i.default.wrap(function _callee$(i){while(1){switch(i.prev=i.next){case 0:f=`${this.endpoint}/${this.version}${t}`;if(r&&Object.keys(r).length>0){f=`${f}?${o.stringify(r)}`}s=Object.assign(this.buildHeaders(),this.headers,s);if(n){l("request body: %s",n);d=null;if(Buffer.isBuffer(n)){d=n;s["content-type"]="application/octet-stream"}else if(typeof n==="string"){d=new Buffer(n,"utf8");s["content-type"]="application/octet-stream"}else if("function"===typeof n.pipe){d=n;s["content-type"]="application/octet-stream"}else{d=new Buffer(JSON.stringify(n),"utf8");s["content-type"]="application/json"}if("function"!==typeof n.pipe){p=u.md5(d,"hex");y=new Buffer(p,"utf8").toString("base64");s["content-length"]=d.length;s["content-md5"]=y}h=d}m=null;if(t.startsWith("/proxy/")){m=r||{}}g=Client.getSignature(this.accessKeyID,this.accessKeySecret,e,`/${this.version}${t}`,s,m);s["authorization"]=g;l("request headers: %j",s);i.next=11;return c.request(f,{method:e,timeout:this.timeout,headers:s,data:h});case 11:v=i.sent;l("response status: %s",v.statusCode);l("response headers: %j",v.headers);if(!(!a["rawBuf"]||v.headers["x-fc-error-type"])){i.next=20;break}i.next=17;return c.read(v,"utf8");case 17:b=i.sent;i.next=23;break;case 20:i.next=22;return c.read(v);case 22:b=i.sent;case 23:l("response body: %s",b);w=v.headers["content-type"]||"";if(!w.startsWith("application/json")){i.next=33;break}i.prev=26;b=JSON.parse(b);i.next=33;break;case 30:i.prev=30;i.t0=i["catch"](26);throw i.t0;case 33:if(!(v.statusCode<200||v.statusCode>=300)){i.next=41;break}_=v.statusCode;S=v.headers["x-fc-request-id"];if(b.ErrorMessage){E=b.ErrorMessage}else{E=b.errorMessage}C=new Error(`${e} ${t} failed with ${_}. requestid: ${S}, message: ${E}.`);C.name=`FC${b.ErrorCode}Error`;C.code=b.ErrorCode;throw C;case 41:return i.abrupt("return",{headers:v.headers,data:b});case 42:case"end":return i.stop()}}},_callee,this,[[26,30]])}));function request(t,r,n,i){return e.apply(this,arguments)}return request}()},{key:"get",value:function get(e,t,r){return this.request("GET",e,t,null,r)}},{key:"post",value:function post(e,t,r,n){var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};return this.request("POST",e,n,t,r,i)}},{key:"put",value:function put(e,t,r){return this.request("PUT",e,null,t,r)}},{key:"delete",value:function _delete(e,t,r){return this.request("DELETE",e,t,null,r)}},{key:"createService",value:function createService(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=arguments[2];return this.post("/services",Object.assign({serviceName:e},t),r)}},{key:"listServices",value:function listServices(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var t=arguments[1];if(e.tags!==undefined){for(var r in e.tags){if(e.tags.hasOwnProperty(r)){e[`tag_${r}`]=e.tags[r]}}delete e.tags}return this.get("/services",e,t)}},{key:"getService",value:function getService(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=arguments[2];return this.get(`/services/${getServiceName(e,r)}`,null,t)}},{key:"updateService",value:function updateService(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=arguments[2];return this.put(`/services/${e}`,t,r)}},{key:"deleteService",value:function deleteService(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=arguments[2];return this.delete(`/services/${e}`,null,t,r)}},{key:"createFunction",value:function createFunction(e,t,r){this.normalizeParams(t);return this.post(`/services/${e}/functions`,t,r)}},{key:"normalizeParams",value:function normalizeParams(e){if(e.functionName){e.functionName=String(e.functionName)}if(e.runtime){e.runtime=String(e.runtime)}if(e.handler){e.handler=String(e.handler)}if(e.initializer){e.initializer=String(e.initializer)}if(e.memorySize){e.memorySize=parseInt(e.memorySize,10)}if(e.timeout){e.timeout=parseInt(e.timeout,10)}if(e.initializationTimeout){e.initializationTimeout=parseInt(e.initializationTimeout,10)}}},{key:"listFunctions",value:function listFunctions(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=arguments[3];return this.get(`/services/${getServiceName(e,n)}/functions`,t,r)}},{key:"getFunction",value:function getFunction(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=arguments[3];return this.get(`/services/${getServiceName(e,n)}/functions/${t}`,null,r)}},{key:"getFunctionCode",value:function getFunctionCode(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=arguments[3];return this.get(`/services/${getServiceName(e,n)}/functions/${t}/code`,r)}},{key:"updateFunction",value:function updateFunction(e,t,r,n){this.normalizeParams(r);var i=`/services/${e}/functions/${t}`;return this.put(i,r,n)}},{key:"deleteFunction",value:function deleteFunction(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=arguments[3];var i=`/services/${e}/functions/${t}`;return this.delete(i,r,n)}},{key:"invokeFunction",value:function invokeFunction(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var i=arguments[4];var s=arguments.length>5&&arguments[5]!==undefined?arguments[5]:{};if(r&&typeof r!=="string"&&!Buffer.isBuffer(r)){throw new TypeError('"event" must be String or Buffer')}var o=`/services/${getServiceName(e,i)}/functions/${t}/invocations`;return this.post(o,r,n,null,s)}},{key:"createTrigger",value:function createTrigger(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var i=`/services/${e}/functions/${t}/triggers`;return this.post(i,r,n)}},{key:"listTriggers",value:function listTriggers(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=arguments[3];var i=`/services/${e}/functions/${t}/triggers`;return this.get(i,r,n)}},{key:"getTrigger",value:function getTrigger(e,t,r,n){var i=`/services/${e}/functions/${t}/triggers/${r}`;return this.get(i,null,n)}},{key:"updateTrigger",value:function updateTrigger(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};var s=`/services/${e}/functions/${t}/triggers/${r}`;return this.put(s,n,i)}},{key:"deleteTrigger",value:function deleteTrigger(e,t,r,n,i){var s=`/services/${e}/functions/${t}/triggers/${r}`;return this.delete(s,n,i)}},{key:"createCustomDomain",value:function createCustomDomain(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=arguments[2];return this.post("/custom-domains",Object.assign({domainName:e},t),r)}},{key:"listCustomDomains",value:function listCustomDomains(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var t=arguments[1];return this.get("/custom-domains",e,t)}},{key:"getCustomDomain",value:function getCustomDomain(e,t){return this.get(`/custom-domains/${e}`,null,t)}},{key:"updateCustomDomain",value:function updateCustomDomain(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=arguments[2];return this.put(`/custom-domains/${e}`,t,r)}},{key:"deleteCustomDomain",value:function deleteCustomDomain(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=arguments[2];return this.delete(`/custom-domains/${e}`,null,t,r)}},{key:"publishVersion",value:function publishVersion(e,t,r){var n={};if(t){n.description=t}return this.post(`/services/${e}/versions`,n,r||{})}},{key:"listVersions",value:function listVersions(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return this.get(`/services/${e}/versions`,null,r,t)}},{key:"deleteVersion",value:function deleteVersion(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return this.delete(`/services/${e}/versions/${t}`,null,r)}},{key:"createAlias",value:function createAlias(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};n.aliasName=t;n.versionId=r;return this.post(`/services/${e}/aliases`,n,i)}},{key:"deleteAlias",value:function deleteAlias(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return this.delete(`/services/${e}/aliases/${t}`,null,r)}},{key:"listAliases",value:function listAliases(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return this.get(`/services/${e}/aliases`,null,r,t)}},{key:"getAlias",value:function getAlias(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};return this.get(`/services/${e}/aliases/${t}`,null,r)}},{key:"updateAlias",value:function updateAlias(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};if(r){n.versionId=r}return this.put(`/services/${e}/aliases/${t}`,n,i)}},{key:"tagResource",value:function tagResource(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};r.resourceArn=e;r.tags=t;return this.post("/tag",r,n)}},{key:"untagResource",value:function untagResource(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};n.resourceArn=e;n.tagKeys=t;n.all=r;return this.request("DELETE","/tag",null,n,i)}},{key:"getResourceTags",value:function getResourceTags(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return this.get("/tag",e,t)}},{key:"listReservedCapacities",value:function listReservedCapacities(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var t=arguments[1];return this.get("/reservedCapacities",e,t)}},{key:"listProvisionConfigs",value:function listProvisionConfigs(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var t=arguments[1];return this.get("/provision-configs",e,t)}},{key:"getProvisionConfig",value:function getProvisionConfig(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};return this.get(`/services/${getServiceName(e,r)}/functions/${t}/provision-config`,null,n)}},{key:"putProvisionConfig",value:function putProvisionConfig(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};return this.put(`/services/${getServiceName(e,r)}/functions/${t}/provision-config`,n,i)}},{key:"deleteFunctionAsyncConfig",value:function deleteFunctionAsyncConfig(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};return this.delete(`/services/${getServiceName(e,r)}/functions/${t}/async-invoke-config`,null,n)}},{key:"listFunctionAsyncConfigs",value:function listFunctionAsyncConfigs(e,t){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};return this.get(`/services/${e}/functions/${t}/async-invoke-configs`,r,n)}},{key:"getFunctionAsyncConfig",value:function getFunctionAsyncConfig(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};return this.get(`/services/${getServiceName(e,r)}/functions/${t}/async-invoke-config`,null,n)}},{key:"putFunctionAsyncConfig",value:function putFunctionAsyncConfig(e,t,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:{};return this.put(`/services/${getServiceName(e,r)}/functions/${t}/async-invoke-config`,n,i)}}],[{key:"getSignature",value:function getSignature(e,t,r,n,i,s){var o=h.composeStringToSign(r,n,i,s);l("stringToSign: %s",o);var a=signString(o,t);return`FC ${e}:${a}`}}]);return Client}();e.exports=d},6743:(e,t,r)=>{"use strict";var n=r(8835);function buildCanonicalHeaders(e,t){var r=[];var n=Object.keys(e);var i={};for(var s=0;s{"use strict";function supportAsyncFunctions(){try{new Function("(async function () {})()");return true}catch(e){return false}}e.exports=supportAsyncFunctions()?r(8209):r(1619)},8209:(e,t,r)=>{"use strict";const n=r(1191);const i=r(6417);const s=r(9074);const o=r(8683);const a=r(8237)("lambda");const c=r(817);const u=r(767);function signString(e,t){const r=i.createHmac("sha256",t).update(e,"utf8").digest();return new Buffer(r,"binary").toString("base64")}function getServiceName(e,t){if(t){return`${e}.${t}`}return e}class Client{constructor(e,t){if(!e){throw new TypeError('"accountid" must be passed in')}this.accountid=e;if(!t){throw new TypeError('"config" must be passed in')}const r=t.accessKeyID;if(!r){throw new TypeError('"config.accessKeyID" must be passed in')}this.accessKeyID=r;if(this.accessKeyID.startsWith("STS")){this.securityToken=t.securityToken;if(!this.securityToken){throw new TypeError('"config.securityToken" must be passed in for STS')}}const n=t.accessKeySecret;if(!n){throw new TypeError('"config.accessKeySecret" must be passed in')}this.accessKeySecret=n;const i=t.region;if(!i){throw new TypeError('"config.region" must be passed in')}const s=t.secure?"https":"http";const o=t.internal?"-internal":"";this.endpoint=t.endpoint||`${s}://${e}.${i}${o}.fc.aliyuncs.com`;this.host=`${e}.${i}${o}.fc.aliyuncs.com`;this.version="2016-08-15";this.timeout=Number.isFinite(t.timeout)?t.timeout:6e4;this.headers=t.headers||{}}buildHeaders(){var e=new Date;const t={accept:"application/json",date:e.toUTCString(),host:this.host,"user-agent":`Node.js(${process.version}) OS(${process.platform}/${process.arch}) SDK(${c.name}@v${c.version})`,"x-fc-account-id":this.accountid};if(this.securityToken){t["x-fc-security-token"]=this.securityToken}return t}async request(e,t,r,i,c={},u={}){var l=`${this.endpoint}/${this.version}${t}`;if(r&&Object.keys(r).length>0){l=`${l}?${n.stringify(r)}`}c=Object.assign(this.buildHeaders(),this.headers,c);var f;if(i){a("request body: %s",i);var h=null;if(Buffer.isBuffer(i)){h=i;c["content-type"]="application/octet-stream"}else if(typeof i==="string"){h=new Buffer(i,"utf8");c["content-type"]="application/octet-stream"}else if("function"===typeof i.pipe){h=i;c["content-type"]="application/octet-stream"}else{h=new Buffer(JSON.stringify(i),"utf8");c["content-type"]="application/json"}if("function"!==typeof i.pipe){const e=o.md5(h,"hex");const t=new Buffer(e,"utf8").toString("base64");c["content-length"]=h.length;c["content-md5"]=t}f=h}var d=null;if(t.startsWith("/proxy/")){d=r||{}}var p=Client.getSignature(this.accessKeyID,this.accessKeySecret,e,`/${this.version}${t}`,c,d);c["authorization"]=p;a("request headers: %j",c);const y=await s.request(l,{method:e,timeout:this.timeout,headers:c,data:f});a("response status: %s",y.statusCode);a("response headers: %j",y.headers);var m;if(!u["rawBuf"]||y.headers["x-fc-error-type"]){m=await s.read(y,"utf8")}else{m=await s.read(y)}a("response body: %s",m);const g=y.headers["content-type"]||"";if(g.startsWith("application/json")){try{m=JSON.parse(m)}catch(e){throw e}}if(y.statusCode<200||y.statusCode>=300){const r=y.statusCode;const n=y.headers["x-fc-request-id"];var v;if(m.ErrorMessage){v=m.ErrorMessage}else{v=m.errorMessage}const i=new Error(`${e} ${t} failed with ${r}. requestid: ${n}, message: ${v}.`);i.name=`FC${m.ErrorCode}Error`;i.code=m.ErrorCode;throw i}return{headers:y.headers,data:m}}get(e,t,r){return this.request("GET",e,t,null,r)}post(e,t,r,n,i={}){return this.request("POST",e,n,t,r,i)}put(e,t,r){return this.request("PUT",e,null,t,r)}delete(e,t,r){return this.request("DELETE",e,t,null,r)}createService(e,t={},r){return this.post("/services",Object.assign({serviceName:e},t),r)}listServices(e={},t){if(e.tags!==undefined){for(var r in e.tags){if(e.tags.hasOwnProperty(r)){e[`tag_${r}`]=e.tags[r]}}delete e.tags}return this.get("/services",e,t)}getService(e,t={},r){return this.get(`/services/${getServiceName(e,r)}`,null,t)}updateService(e,t={},r){return this.put(`/services/${e}`,t,r)}deleteService(e,t={},r){return this.delete(`/services/${e}`,null,t,r)}createFunction(e,t,r){this.normalizeParams(t);return this.post(`/services/${e}/functions`,t,r)}normalizeParams(e){if(e.functionName){e.functionName=String(e.functionName)}if(e.runtime){e.runtime=String(e.runtime)}if(e.handler){e.handler=String(e.handler)}if(e.initializer){e.initializer=String(e.initializer)}if(e.memorySize){e.memorySize=parseInt(e.memorySize,10)}if(e.timeout){e.timeout=parseInt(e.timeout,10)}if(e.initializationTimeout){e.initializationTimeout=parseInt(e.initializationTimeout,10)}}listFunctions(e,t={},r={},n){return this.get(`/services/${getServiceName(e,n)}/functions`,t,r)}getFunction(e,t,r={},n){return this.get(`/services/${getServiceName(e,n)}/functions/${t}`,null,r)}getFunctionCode(e,t,r={},n){return this.get(`/services/${getServiceName(e,n)}/functions/${t}/code`,r)}updateFunction(e,t,r,n){this.normalizeParams(r);const i=`/services/${e}/functions/${t}`;return this.put(i,r,n)}deleteFunction(e,t,r={},n){const i=`/services/${e}/functions/${t}`;return this.delete(i,r,n)}invokeFunction(e,t,r,n={},i,s={}){if(r&&typeof r!=="string"&&!Buffer.isBuffer(r)){throw new TypeError('"event" must be String or Buffer')}const o=`/services/${getServiceName(e,i)}/functions/${t}/invocations`;return this.post(o,r,n,null,s)}createTrigger(e,t,r,n={}){const i=`/services/${e}/functions/${t}/triggers`;return this.post(i,r,n)}listTriggers(e,t,r={},n){const i=`/services/${e}/functions/${t}/triggers`;return this.get(i,r,n)}getTrigger(e,t,r,n){const i=`/services/${e}/functions/${t}/triggers/${r}`;return this.get(i,null,n)}updateTrigger(e,t,r,n={},i={}){const s=`/services/${e}/functions/${t}/triggers/${r}`;return this.put(s,n,i)}deleteTrigger(e,t,r,n,i){const s=`/services/${e}/functions/${t}/triggers/${r}`;return this.delete(s,n,i)}createCustomDomain(e,t={},r){return this.post("/custom-domains",Object.assign({domainName:e},t),r)}listCustomDomains(e={},t){return this.get("/custom-domains",e,t)}getCustomDomain(e,t){return this.get(`/custom-domains/${e}`,null,t)}updateCustomDomain(e,t={},r){return this.put(`/custom-domains/${e}`,t,r)}deleteCustomDomain(e,t={},r){return this.delete(`/custom-domains/${e}`,null,t,r)}publishVersion(e,t,r){var n={};if(t){n.description=t}return this.post(`/services/${e}/versions`,n,r||{})}listVersions(e,t={},r={}){return this.get(`/services/${e}/versions`,null,r,t)}deleteVersion(e,t,r={}){return this.delete(`/services/${e}/versions/${t}`,null,r)}createAlias(e,t,r,n={},i={}){n.aliasName=t;n.versionId=r;return this.post(`/services/${e}/aliases`,n,i)}deleteAlias(e,t,r={}){return this.delete(`/services/${e}/aliases/${t}`,null,r)}listAliases(e,t={},r={}){return this.get(`/services/${e}/aliases`,null,r,t)}getAlias(e,t,r={}){return this.get(`/services/${e}/aliases/${t}`,null,r)}updateAlias(e,t,r,n={},i={}){if(r){n.versionId=r}return this.put(`/services/${e}/aliases/${t}`,n,i)}tagResource(e,t,r={},n={}){r.resourceArn=e;r.tags=t;return this.post("/tag",r,n)}untagResource(e,t,r=false,n={},i={}){n.resourceArn=e;n.tagKeys=t;n.all=r;return this.request("DELETE","/tag",null,n,i)}getResourceTags(e={},t={}){return this.get("/tag",e,t)}listReservedCapacities(e={},t){return this.get("/reservedCapacities",e,t)}listProvisionConfigs(e={},t){return this.get("/provision-configs",e,t)}getProvisionConfig(e,t,r,n={}){return this.get(`/services/${getServiceName(e,r)}/functions/${t}/provision-config`,null,n)}putProvisionConfig(e,t,r,n={},i={}){return this.put(`/services/${getServiceName(e,r)}/functions/${t}/provision-config`,n,i)}deleteFunctionAsyncConfig(e,t,r,n={}){return this.delete(`/services/${getServiceName(e,r)}/functions/${t}/async-invoke-config`,null,n)}listFunctionAsyncConfigs(e,t,r={},n={}){return this.get(`/services/${e}/functions/${t}/async-invoke-configs`,r,n)}getFunctionAsyncConfig(e,t,r,n={}){return this.get(`/services/${getServiceName(e,r)}/functions/${t}/async-invoke-config`,null,n)}putFunctionAsyncConfig(e,t,r,n={},i={}){return this.put(`/services/${getServiceName(e,r)}/functions/${t}/async-invoke-config`,n,i)}static getSignature(e,t,r,n,i,s){var o=u.composeStringToSign(r,n,i,s);a("stringToSign: %s",o);var c=signString(o,t);return`FC ${e}:${c}`}}e.exports=Client},767:(e,t,r)=>{"use strict";const n=r(8835);function buildCanonicalHeaders(e,t){var r=[];var n=Object.keys(e);var i={};for(let o=0;o{"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function isTypedArrayName(e){return r.includes(e)}const n=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","FormData","URLSearchParams","HTMLElement",...r];function isObjectTypeName(e){return n.includes(e)}const i=["null","undefined","string","number","bigint","boolean","symbol"];function isPrimitiveTypeName(e){return i.includes(e)}function isOfType(e){return t=>typeof t===e}const{toString:s}=Object.prototype;const o=e=>{const t=s.call(e).slice(8,-1);if(/HTML\w+Element/.test(t)&&is.domElement(e)){return"HTMLElement"}if(isObjectTypeName(t)){return t}return undefined};const a=e=>t=>o(t)===e;function is(e){if(e===null){return"null"}switch(typeof e){case"undefined":return"undefined";case"string":return"string";case"number":return"number";case"boolean":return"boolean";case"function":return"Function";case"bigint":return"bigint";case"symbol":return"symbol";default:}if(is.observable(e)){return"Observable"}if(is.array(e)){return"Array"}if(is.buffer(e)){return"Buffer"}const t=o(e);if(t){return t}if(e instanceof String||e instanceof Boolean||e instanceof Number){throw new TypeError("Please don't use object wrappers for primitive types")}return"Object"}is.undefined=isOfType("undefined");is.string=isOfType("string");const c=isOfType("number");is.number=(e=>c(e)&&!is.nan(e));is.bigint=isOfType("bigint");is.function_=isOfType("function");is.null_=(e=>e===null);is.class_=(e=>is.function_(e)&&e.toString().startsWith("class "));is.boolean=(e=>e===true||e===false);is.symbol=isOfType("symbol");is.numericString=(e=>is.string(e)&&!is.emptyStringOrWhitespace(e)&&!Number.isNaN(Number(e)));is.array=((e,t)=>{if(!Array.isArray(e)){return false}if(!is.function_(t)){return true}return e.every(t)});is.buffer=(e=>{var t,r,n,i;return(i=(n=(r=(t=e)===null||t===void 0?void 0:t.constructor)===null||r===void 0?void 0:r.isBuffer)===null||n===void 0?void 0:n.call(r,e))!==null&&i!==void 0?i:false});is.nullOrUndefined=(e=>is.null_(e)||is.undefined(e));is.object=(e=>!is.null_(e)&&(typeof e==="object"||is.function_(e)));is.iterable=(e=>{var t;return is.function_((t=e)===null||t===void 0?void 0:t[Symbol.iterator])});is.asyncIterable=(e=>{var t;return is.function_((t=e)===null||t===void 0?void 0:t[Symbol.asyncIterator])});is.generator=(e=>is.iterable(e)&&is.function_(e.next)&&is.function_(e.throw));is.asyncGenerator=(e=>is.asyncIterable(e)&&is.function_(e.next)&&is.function_(e.throw));is.nativePromise=(e=>a("Promise")(e));const u=e=>{var t,r;return is.function_((t=e)===null||t===void 0?void 0:t.then)&&is.function_((r=e)===null||r===void 0?void 0:r.catch)};is.promise=(e=>is.nativePromise(e)||u(e));is.generatorFunction=a("GeneratorFunction");is.asyncGeneratorFunction=(e=>o(e)==="AsyncGeneratorFunction");is.asyncFunction=(e=>o(e)==="AsyncFunction");is.boundFunction=(e=>is.function_(e)&&!e.hasOwnProperty("prototype"));is.regExp=a("RegExp");is.date=a("Date");is.error=a("Error");is.map=(e=>a("Map")(e));is.set=(e=>a("Set")(e));is.weakMap=(e=>a("WeakMap")(e));is.weakSet=(e=>a("WeakSet")(e));is.int8Array=a("Int8Array");is.uint8Array=a("Uint8Array");is.uint8ClampedArray=a("Uint8ClampedArray");is.int16Array=a("Int16Array");is.uint16Array=a("Uint16Array");is.int32Array=a("Int32Array");is.uint32Array=a("Uint32Array");is.float32Array=a("Float32Array");is.float64Array=a("Float64Array");is.bigInt64Array=a("BigInt64Array");is.bigUint64Array=a("BigUint64Array");is.arrayBuffer=a("ArrayBuffer");is.sharedArrayBuffer=a("SharedArrayBuffer");is.dataView=a("DataView");is.directInstanceOf=((e,t)=>Object.getPrototypeOf(e)===t.prototype);is.urlInstance=(e=>a("URL")(e));is.urlString=(e=>{if(!is.string(e)){return false}try{new URL(e);return true}catch(e){return false}});is.truthy=(e=>Boolean(e));is.falsy=(e=>!e);is.nan=(e=>Number.isNaN(e));is.primitive=(e=>is.null_(e)||isPrimitiveTypeName(typeof e));is.integer=(e=>Number.isInteger(e));is.safeInteger=(e=>Number.isSafeInteger(e));is.plainObject=(e=>{if(s.call(e)!=="[object Object]"){return false}const t=Object.getPrototypeOf(e);return t===null||t===Object.getPrototypeOf({})});is.typedArray=(e=>isTypedArrayName(o(e)));const l=e=>is.safeInteger(e)&&e>=0;is.arrayLike=(e=>!is.nullOrUndefined(e)&&!is.function_(e)&&l(e.length));is.inRange=((e,t)=>{if(is.number(t)){return e>=Math.min(0,t)&&e<=Math.max(t,0)}if(is.array(t)&&t.length===2){return e>=Math.min(...t)&&e<=Math.max(...t)}throw new TypeError(`Invalid range: ${JSON.stringify(t)}`)});const f=1;const h=["innerHTML","ownerDocument","style","attributes","nodeValue"];is.domElement=(e=>{return is.object(e)&&e.nodeType===f&&is.string(e.nodeName)&&!is.plainObject(e)&&h.every(t=>t in e)});is.observable=(e=>{var t,r,n,i;if(!e){return false}if(e===((r=(t=e)[Symbol.observable])===null||r===void 0?void 0:r.call(t))){return true}if(e===((i=(n=e)["@@observable"])===null||i===void 0?void 0:i.call(n))){return true}return false});is.nodeStream=(e=>is.object(e)&&is.function_(e.pipe)&&!is.observable(e));is.infinite=(e=>e===Infinity||e===-Infinity);const d=e=>t=>is.integer(t)&&Math.abs(t%2)===e;is.evenInteger=d(0);is.oddInteger=d(1);is.emptyArray=(e=>is.array(e)&&e.length===0);is.nonEmptyArray=(e=>is.array(e)&&e.length>0);is.emptyString=(e=>is.string(e)&&e.length===0);is.nonEmptyString=(e=>is.string(e)&&e.length>0);const p=e=>is.string(e)&&!/\S/.test(e);is.emptyStringOrWhitespace=(e=>is.emptyString(e)||p(e));is.emptyObject=(e=>is.object(e)&&!is.map(e)&&!is.set(e)&&Object.keys(e).length===0);is.nonEmptyObject=(e=>is.object(e)&&!is.map(e)&&!is.set(e)&&Object.keys(e).length>0);is.emptySet=(e=>is.set(e)&&e.size===0);is.nonEmptySet=(e=>is.set(e)&&e.size>0);is.emptyMap=(e=>is.map(e)&&e.size===0);is.nonEmptyMap=(e=>is.map(e)&&e.size>0);is.propertyKey=(e=>is.any([is.string,is.number,is.symbol],e));is.formData=(e=>a("FormData")(e));is.urlSearchParams=(e=>a("URLSearchParams")(e));const y=(e,t,r)=>{if(!is.function_(t)){throw new TypeError(`Invalid predicate: ${JSON.stringify(t)}`)}if(r.length===0){throw new TypeError("Invalid number of values")}return e.call(r,t)};is.any=((e,...t)=>{const r=is.array(e)?e:[e];return r.some(e=>y(Array.prototype.some,e,t))});is.all=((e,...t)=>y(Array.prototype.every,e,t));const m=(e,t,r,n={})=>{if(!e){const{multipleValues:e}=n;const i=e?`received values of types ${[...new Set(r.map(e=>`\`${is(e)}\``))].join(", ")}`:`received value of type \`${is(r)}\``;throw new TypeError(`Expected value which is \`${t}\`, ${i}.`)}};t.assert={undefined:e=>m(is.undefined(e),"undefined",e),string:e=>m(is.string(e),"string",e),number:e=>m(is.number(e),"number",e),bigint:e=>m(is.bigint(e),"bigint",e),function_:e=>m(is.function_(e),"Function",e),null_:e=>m(is.null_(e),"null",e),class_:e=>m(is.class_(e),"Class",e),boolean:e=>m(is.boolean(e),"boolean",e),symbol:e=>m(is.symbol(e),"symbol",e),numericString:e=>m(is.numericString(e),"string with a number",e),array:(e,t)=>{const r=m;r(is.array(e),"Array",e);if(t){e.forEach(t)}},buffer:e=>m(is.buffer(e),"Buffer",e),nullOrUndefined:e=>m(is.nullOrUndefined(e),"null or undefined",e),object:e=>m(is.object(e),"Object",e),iterable:e=>m(is.iterable(e),"Iterable",e),asyncIterable:e=>m(is.asyncIterable(e),"AsyncIterable",e),generator:e=>m(is.generator(e),"Generator",e),asyncGenerator:e=>m(is.asyncGenerator(e),"AsyncGenerator",e),nativePromise:e=>m(is.nativePromise(e),"native Promise",e),promise:e=>m(is.promise(e),"Promise",e),generatorFunction:e=>m(is.generatorFunction(e),"GeneratorFunction",e),asyncGeneratorFunction:e=>m(is.asyncGeneratorFunction(e),"AsyncGeneratorFunction",e),asyncFunction:e=>m(is.asyncFunction(e),"AsyncFunction",e),boundFunction:e=>m(is.boundFunction(e),"Function",e),regExp:e=>m(is.regExp(e),"RegExp",e),date:e=>m(is.date(e),"Date",e),error:e=>m(is.error(e),"Error",e),map:e=>m(is.map(e),"Map",e),set:e=>m(is.set(e),"Set",e),weakMap:e=>m(is.weakMap(e),"WeakMap",e),weakSet:e=>m(is.weakSet(e),"WeakSet",e),int8Array:e=>m(is.int8Array(e),"Int8Array",e),uint8Array:e=>m(is.uint8Array(e),"Uint8Array",e),uint8ClampedArray:e=>m(is.uint8ClampedArray(e),"Uint8ClampedArray",e),int16Array:e=>m(is.int16Array(e),"Int16Array",e),uint16Array:e=>m(is.uint16Array(e),"Uint16Array",e),int32Array:e=>m(is.int32Array(e),"Int32Array",e),uint32Array:e=>m(is.uint32Array(e),"Uint32Array",e),float32Array:e=>m(is.float32Array(e),"Float32Array",e),float64Array:e=>m(is.float64Array(e),"Float64Array",e),bigInt64Array:e=>m(is.bigInt64Array(e),"BigInt64Array",e),bigUint64Array:e=>m(is.bigUint64Array(e),"BigUint64Array",e),arrayBuffer:e=>m(is.arrayBuffer(e),"ArrayBuffer",e),sharedArrayBuffer:e=>m(is.sharedArrayBuffer(e),"SharedArrayBuffer",e),dataView:e=>m(is.dataView(e),"DataView",e),urlInstance:e=>m(is.urlInstance(e),"URL",e),urlString:e=>m(is.urlString(e),"string with a URL",e),truthy:e=>m(is.truthy(e),"truthy",e),falsy:e=>m(is.falsy(e),"falsy",e),nan:e=>m(is.nan(e),"NaN",e),primitive:e=>m(is.primitive(e),"primitive",e),integer:e=>m(is.integer(e),"integer",e),safeInteger:e=>m(is.safeInteger(e),"integer",e),plainObject:e=>m(is.plainObject(e),"plain object",e),typedArray:e=>m(is.typedArray(e),"TypedArray",e),arrayLike:e=>m(is.arrayLike(e),"array-like",e),domElement:e=>m(is.domElement(e),"HTMLElement",e),observable:e=>m(is.observable(e),"Observable",e),nodeStream:e=>m(is.nodeStream(e),"Node.js Stream",e),infinite:e=>m(is.infinite(e),"infinite number",e),emptyArray:e=>m(is.emptyArray(e),"empty array",e),nonEmptyArray:e=>m(is.nonEmptyArray(e),"non-empty array",e),emptyString:e=>m(is.emptyString(e),"empty string",e),nonEmptyString:e=>m(is.nonEmptyString(e),"non-empty string",e),emptyStringOrWhitespace:e=>m(is.emptyStringOrWhitespace(e),"empty string or whitespace",e),emptyObject:e=>m(is.emptyObject(e),"empty object",e),nonEmptyObject:e=>m(is.nonEmptyObject(e),"non-empty object",e),emptySet:e=>m(is.emptySet(e),"empty set",e),nonEmptySet:e=>m(is.nonEmptySet(e),"non-empty set",e),emptyMap:e=>m(is.emptyMap(e),"empty map",e),nonEmptyMap:e=>m(is.nonEmptyMap(e),"non-empty map",e),propertyKey:e=>m(is.propertyKey(e),"PropertyKey",e),formData:e=>m(is.formData(e),"FormData",e),urlSearchParams:e=>m(is.urlSearchParams(e),"URLSearchParams",e),evenInteger:e=>m(is.evenInteger(e),"even integer",e),oddInteger:e=>m(is.oddInteger(e),"odd integer",e),directInstanceOf:(e,t)=>m(is.directInstanceOf(e,t),"T",e),inRange:(e,t)=>m(is.inRange(e,t),"in range",e),any:(e,...t)=>{return m(is.any(e,...t),"predicate returns truthy for any value",t,{multipleValues:true})},all:(e,...t)=>m(is.all(e,...t),"predicate returns truthy for all values",t,{multipleValues:true})};Object.defineProperties(is,{class:{value:is.class_},function:{value:is.function_},null:{value:is.null_}});Object.defineProperties(t.assert,{class:{value:t.assert.class_},function:{value:t.assert.function_},null:{value:t.assert.null_}});t.default=is;e.exports=is;e.exports.default=is;e.exports.assert=t.assert},8097:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(6214);const i=r(1669);const s=Number(process.versions.node.split(".")[0]);const o=e=>{if(e.timings){return e.timings}const t={start:Date.now(),socket:undefined,lookup:undefined,connect:undefined,secureConnect:undefined,upload:undefined,response:undefined,end:undefined,error:undefined,abort:undefined,phases:{wait:undefined,dns:undefined,tcp:undefined,tls:undefined,request:undefined,firstByte:undefined,download:undefined,total:undefined}};e.timings=t;const r=e=>{const r=e.emit.bind(e);e.emit=((n,...i)=>{if(n==="error"){t.error=Date.now();t.phases.total=t.error-t.start;e.emit=r}return r(n,...i)})};r(e);const o=()=>{t.abort=Date.now();if(!t.response||s>=13){t.phases.total=Date.now()-t.start}};e.prependOnceListener("abort",o);const a=e=>{t.socket=Date.now();t.phases.wait=t.socket-t.start;if(i.types.isProxy(e)){return}const r=()=>{t.lookup=Date.now();t.phases.dns=t.lookup-t.socket};e.prependOnceListener("lookup",r);n.default(e,{connect:()=>{t.connect=Date.now();if(t.lookup===undefined){e.removeListener("lookup",r);t.lookup=t.connect;t.phases.dns=t.lookup-t.socket}t.phases.tcp=t.connect-t.lookup},secureConnect:()=>{t.secureConnect=Date.now();t.phases.tls=t.secureConnect-t.connect}})};if(e.socket){a(e.socket)}else{e.prependOnceListener("socket",a)}const c=()=>{var e;t.upload=Date.now();t.phases.request=t.upload-((e=t.secureConnect)!==null&&e!==void 0?e:t.connect)};const u=()=>{if(typeof e.writableFinished==="boolean"){return e.writableFinished}return e.finished&&e.outputSize===0&&(!e.socket||e.socket.writableLength===0)};if(u()){c()}else{e.prependOnceListener("finish",c)}e.prependOnceListener("response",e=>{t.response=Date.now();t.phases.firstByte=t.response-t.upload;e.timings=t;r(e);e.prependOnceListener("end",()=>{t.end=Date.now();t.phases.download=t.end-t.response;t.phases.total=t.end-t.start});e.prependOnceListener("aborted",o)});return t};t.default=o;e.exports=o;e.exports.default=o},1043:(e,t,r)=>{e.exports=r(4518)},2286:(e,t,r)=>{"use strict";const{V4MAPPED:n,ADDRCONFIG:i,ALL:s,promises:{Resolver:o},lookup:a}=r(881);const{promisify:c}=r(1669);const u=r(2087);const l=Symbol("cacheableLookupCreateConnection");const f=Symbol("cacheableLookupInstance");const h=Symbol("expires");const d=typeof s==="number";const p=e=>{if(!(e&&typeof e.createConnection==="function")){throw new Error("Expected an Agent instance as the first argument")}};const y=e=>{for(const t of e){if(t.family===6){continue}t.address=`::ffff:${t.address}`;t.family=6}};const m=()=>{let e=false;let t=false;for(const r of Object.values(u.networkInterfaces())){for(const n of r){if(n.internal){continue}if(n.family==="IPv6"){t=true}else{e=true}if(e&&t){return{has4:e,has6:t}}}}return{has4:e,has6:t}};const g=e=>{return Symbol.iterator in e};const v={ttl:true};const b={all:true};class CacheableLookup{constructor({cache:e=new Map,maxTtl:t=Infinity,fallbackDuration:r=3600,errorTtl:n=.15,resolver:i=new o,lookup:s=a}={}){this.maxTtl=t;this.errorTtl=n;this._cache=e;this._resolver=i;this._dnsLookup=c(s);if(this._resolver instanceof o){this._resolve4=this._resolver.resolve4.bind(this._resolver);this._resolve6=this._resolver.resolve6.bind(this._resolver)}else{this._resolve4=c(this._resolver.resolve4.bind(this._resolver));this._resolve6=c(this._resolver.resolve6.bind(this._resolver))}this._iface=m();this._pending={};this._nextRemovalTime=false;this._hostnamesToFallback=new Set;if(r<1){this._fallback=false}else{this._fallback=true;const e=setInterval(()=>{this._hostnamesToFallback.clear()},r*1e3);if(e.unref){e.unref()}}this.lookup=this.lookup.bind(this);this.lookupAsync=this.lookupAsync.bind(this)}set servers(e){this.clear();this._resolver.setServers(e)}get servers(){return this._resolver.getServers()}lookup(e,t,r){if(typeof t==="function"){r=t;t={}}else if(typeof t==="number"){t={family:t}}if(!r){throw new Error("Callback must be a function.")}this.lookupAsync(e,t).then(e=>{if(t.all){r(null,e)}else{r(null,e.address,e.family,e.expires,e.ttl)}},r)}async lookupAsync(e,t={}){if(typeof t==="number"){t={family:t}}let r=await this.query(e);if(t.family===6){const e=r.filter(e=>e.family===6);if(t.hints&n){if(d&&t.hints&s||e.length===0){y(r)}else{r=e}}else{r=e}}else if(t.family===4){r=r.filter(e=>e.family===4)}if(t.hints&i){const{_iface:e}=this;r=r.filter(t=>t.family===6?e.has6:e.has4)}if(r.length===0){const t=new Error(`cacheableLookup ENOTFOUND ${e}`);t.code="ENOTFOUND";t.hostname=e;throw t}if(t.all){return r}return r[0]}async query(e){let t=await this._cache.get(e);if(!t){const r=this._pending[e];if(r){t=await r}else{const r=this.queryAndCache(e);this._pending[e]=r;try{t=await r}finally{delete this._pending[e]}}}t=t.map(e=>{return{...e}});return t}async _resolve(e){const t=async e=>{try{return await e}catch(e){if(e.code==="ENODATA"||e.code==="ENOTFOUND"){return[]}throw e}};const[r,n]=await Promise.all([this._resolve4(e,v),this._resolve6(e,v)].map(e=>t(e)));let i=0;let s=0;let o=0;const a=Date.now();for(const e of r){e.family=4;e.expires=a+e.ttl*1e3;i=Math.max(i,e.ttl)}for(const e of n){e.family=6;e.expires=a+e.ttl*1e3;s=Math.max(s,e.ttl)}if(r.length>0){if(n.length>0){o=Math.min(i,s)}else{o=i}}else{o=s}return{entries:[...r,...n],cacheTtl:o}}async _lookup(e){try{const t=await this._dnsLookup(e,{all:true});return{entries:t,cacheTtl:0}}catch(e){return{entries:[],cacheTtl:0}}}async _set(e,t,r){if(this.maxTtl>0&&r>0){r=Math.min(r,this.maxTtl)*1e3;t[h]=Date.now()+r;try{await this._cache.set(e,t,r)}catch(e){this.lookupAsync=(async()=>{const t=new Error("Cache Error. Please recreate the CacheableLookup instance.");t.cause=e;throw t})}if(g(this._cache)){this._tick(r)}}}async queryAndCache(e){if(this._hostnamesToFallback.has(e)){return this._dnsLookup(e,b)}let t=await this._resolve(e);if(t.entries.length===0&&this._fallback){t=await this._lookup(e);if(t.entries.length!==0){this._hostnamesToFallback.add(e)}}const r=t.entries.length===0?this.errorTtl:t.cacheTtl;await this._set(e,t.entries,r);return t.entries}_tick(e){const t=this._nextRemovalTime;if(!t||e{this._nextRemovalTime=false;let e=Infinity;const t=Date.now();for(const[r,n]of this._cache){const i=n[h];if(t>=i){this._cache.delete(r)}else if(i{if(!("lookup"in t)){t.lookup=this.lookup}return e[l](t,r)})}uninstall(e){p(e);if(e[l]){if(e[f]!==this){throw new Error("The agent is not owned by this CacheableLookup instance")}e.createConnection=e[l];delete e[l];delete e[f]}}updateInterfaceInfo(){const{_iface:e}=this;this._iface=m();if(e.has4&&!this._iface.has4||e.has6&&!this._iface.has6){this._cache.clear()}}clear(e){if(e){this._cache.delete(e);return}this._cache.clear()}}e.exports=CacheableLookup;e.exports.default=CacheableLookup},8116:(e,t,r)=>{"use strict";const n=r(8614);const i=r(8835);const s=r(7952);const o=r(1766);const a=r(1002);const c=r(9004);const u=r(9662);const l=r(1312);const f=r(1531);class CacheableRequest{constructor(e,t){if(typeof e!=="function"){throw new TypeError("Parameter `request` must be a function")}this.cache=new f({uri:typeof t==="string"&&t,store:typeof t!=="string"&&t,namespace:"cacheable-request"});return this.createCacheableRequest(e)}createCacheableRequest(e){return(t,r)=>{let f;if(typeof t==="string"){f=normalizeUrlObject(i.parse(t));t={}}else if(t instanceof i.URL){f=normalizeUrlObject(i.parse(t.toString()));t={}}else{const[e,...r]=(t.path||"").split("?");const n=r.length>0?`?${r.join("?")}`:"";f=normalizeUrlObject({...t,pathname:e,search:n})}t={headers:{},method:"GET",cache:true,strictTtl:false,automaticFailover:false,...t,...urlObjectToRequestOptions(f)};t.headers=u(t.headers);const h=new n;const d=s(i.format(f),{stripWWW:false,removeTrailingSlash:false,stripAuthentication:false});const p=`${t.method}:${d}`;let y=false;let m=false;const g=t=>{m=true;let n=false;let i;const s=new Promise(e=>{i=(()=>{if(!n){n=true;e()}})});const u=e=>{if(y&&!t.forceRefresh){e.status=e.statusCode;const r=a.fromObject(y.cachePolicy).revalidatedPolicy(t,e);if(!r.modified){const t=r.policy.responseHeaders();e=new c(y.statusCode,t,y.body,y.url);e.cachePolicy=r.policy;e.fromCache=true}}if(!e.fromCache){e.cachePolicy=new a(t,e,t);e.fromCache=false}let i;if(t.cache&&e.cachePolicy.storable()){i=l(e);(async()=>{try{const r=o.buffer(e);await Promise.race([s,new Promise(t=>e.once("end",t))]);if(n){return}const i=await r;const a={cachePolicy:e.cachePolicy.toObject(),url:e.url,statusCode:e.fromCache?y.statusCode:e.statusCode,body:i};let c=t.strictTtl?e.cachePolicy.timeToLive():undefined;if(t.maxTtl){c=c?Math.min(c,t.maxTtl):t.maxTtl}await this.cache.set(p,a,c)}catch(e){h.emit("error",new CacheableRequest.CacheError(e))}})()}else if(t.cache&&y){(async()=>{try{await this.cache.delete(p)}catch(e){h.emit("error",new CacheableRequest.CacheError(e))}})()}h.emit("response",i||e);if(typeof r==="function"){r(i||e)}};try{const r=e(t,u);r.once("error",i);r.once("abort",i);h.emit("request",r)}catch(e){h.emit("error",new CacheableRequest.RequestError(e))}};(async()=>{const e=async e=>{await Promise.resolve();const t=e.cache?await this.cache.get(p):undefined;if(typeof t==="undefined"){return g(e)}const n=a.fromObject(t.cachePolicy);if(n.satisfiesWithoutRevalidation(e)&&!e.forceRefresh){const e=n.responseHeaders();const i=new c(t.statusCode,e,t.body,t.url);i.cachePolicy=n;i.fromCache=true;h.emit("response",i);if(typeof r==="function"){r(i)}}else{y=t;e.headers=n.revalidationHeaders(e);g(e)}};const n=e=>h.emit("error",new CacheableRequest.CacheError(e));this.cache.once("error",n);h.on("response",()=>this.cache.removeListener("error",n));try{await e(t)}catch(e){if(t.automaticFailover&&!m){g(t)}h.emit("error",new CacheableRequest.CacheError(e))}})();return h}}}function urlObjectToRequestOptions(e){const t={...e};t.path=`${e.pathname||"/"}${e.search||""}`;delete t.pathname;delete t.search;return t}function normalizeUrlObject(e){return{protocol:e.protocol,auth:e.auth,hostname:e.hostname||e.host||"localhost",port:e.port,pathname:e.pathname,search:e.search}}CacheableRequest.RequestError=class extends Error{constructor(e){super(e.message);this.name="RequestError";Object.assign(this,e)}};CacheableRequest.CacheError=class extends Error{constructor(e){super(e.message);this.name="CacheError";Object.assign(this,e)}};e.exports=CacheableRequest},1312:(e,t,r)=>{"use strict";const n=r(2413).PassThrough;const i=r(2610);const s=e=>{if(!(e&&e.pipe)){throw new TypeError("Parameter `response` must be a response stream.")}const t=new n;i(e,t);return e.pipe(t)};e.exports=s},8222:(e,t,r)=>{t=e.exports=r(8564);t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:localstorage();t.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function useColors(){if(typeof window!=="undefined"&&window.process&&window.process.type==="renderer"){return true}return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}t.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}};function formatArgs(e){var r=this.useColors;e[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+e[0]+(r?"%c ":" ")+"+"+t.humanize(this.diff);if(!r)return;var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var i=0;var s=0;e[0].replace(/%[a-zA-Z%]/g,function(e){if("%%"===e)return;i++;if("%c"===e){s=i}});e.splice(s,0,n)}function log(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function save(e){try{if(null==e){t.storage.removeItem("debug")}else{t.storage.debug=e}}catch(e){}}function load(){var e;try{e=t.storage.debug}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}t.enable(load());function localstorage(){try{return window.localStorage}catch(e){}}},8564:(e,t,r)=>{t=e.exports=createDebug.debug=createDebug["default"]=createDebug;t.coerce=coerce;t.disable=disable;t.enable=enable;t.enabled=enabled;t.humanize=r(900);t.names=[];t.skips=[];t.formatters={};var n;function selectColor(e){var r=0,n;for(n in e){r=(r<<5)-r+e.charCodeAt(n);r|=0}return t.colors[Math.abs(r)%t.colors.length]}function createDebug(e){function debug(){if(!debug.enabled)return;var e=debug;var r=+new Date;var i=r-(n||r);e.diff=i;e.prev=n;e.curr=r;n=r;var s=new Array(arguments.length);for(var o=0;o{if(typeof process!=="undefined"&&process.type==="renderer"){e.exports=r(8222)}else{e.exports=r(5332)}},5332:(e,t,r)=>{var n=r(3867);var i=r(1669);t=e.exports=r(8564);t.init=init;t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.colors=[6,2,3,4,5,1];t.inspectOpts=Object.keys(process.env).filter(function(e){return/^debug_/i.test(e)}).reduce(function(e,t){var r=t.substring(6).toLowerCase().replace(/_([a-z])/g,function(e,t){return t.toUpperCase()});var n=process.env[t];if(/^(yes|on|true|enabled)$/i.test(n))n=true;else if(/^(no|off|false|disabled)$/i.test(n))n=false;else if(n==="null")n=null;else n=Number(n);e[r]=n;return e},{});var s=parseInt(process.env.DEBUG_FD,10)||2;if(1!==s&&2!==s){i.deprecate(function(){},"except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")()}var o=1===s?process.stdout:2===s?process.stderr:createWritableStdioStream(s);function useColors(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(s)}t.formatters.o=function(e){this.inspectOpts.colors=this.useColors;return i.inspect(e,this.inspectOpts).split("\n").map(function(e){return e.trim()}).join(" ")};t.formatters.O=function(e){this.inspectOpts.colors=this.useColors;return i.inspect(e,this.inspectOpts)};function formatArgs(e){var r=this.namespace;var n=this.useColors;if(n){var i=this.color;var s=" [3"+i+";1m"+r+" "+"";e[0]=s+e[0].split("\n").join("\n"+s);e.push("[3"+i+"m+"+t.humanize(this.diff)+"")}else{e[0]=(new Date).toUTCString()+" "+r+" "+e[0]}}function log(){return o.write(i.format.apply(i,arguments)+"\n")}function save(e){if(null==e){delete process.env.DEBUG}else{process.env.DEBUG=e}}function load(){return process.env.DEBUG}function createWritableStdioStream(e){var t;var i=process.binding("tty_wrap");switch(i.guessHandleType(e)){case"TTY":t=new n.WriteStream(e);t._type="tty";if(t._handle&&t._handle.unref){t._handle.unref()}break;case"FILE":var s=r(5747);t=new s.SyncWriteStream(e,{autoClose:false});t._type="fs";break;case"PIPE":case"TCP":var o=r(1631);t=new o.Socket({fd:e,readable:false,writable:true});t.readable=false;t.read=null;t._type="pipe";if(t._handle&&t._handle.unref){t._handle.unref()}break;default:throw new Error("Implement me. Unknown stream file type!")}t.fd=e;t._isStdio=true;return t}function init(e){e.inspectOpts={};var r=Object.keys(t.inspectOpts);for(var n=0;n{"use strict";const{Transform:n,PassThrough:i}=r(2413);const s=r(8761);const o=r(3877);e.exports=(e=>{const t=(e.headers["content-encoding"]||"").toLowerCase();if(!["gzip","deflate","br"].includes(t)){return e}const r=t==="br";if(r&&typeof s.createBrotliDecompress!=="function"){e.destroy(new Error("Brotli is not supported on Node.js < 12"));return e}let a=true;const c=new n({transform(e,t,r){a=false;r(null,e)},flush(e){e()}});const u=new i({autoDestroy:false,destroy(t,r){e.destroy();r(t)}});const l=r?s.createBrotliDecompress():s.createUnzip();l.once("error",t=>{if(a&&!e.readable){u.end();return}u.destroy(t)});o(e,u);e.pipe(c).pipe(l).pipe(u);return u})},3877:e=>{"use strict";const t=["aborted","complete","headers","httpVersion","httpVersionMinor","httpVersionMajor","method","rawHeaders","rawTrailers","setTimeout","socket","statusCode","statusMessage","trailers","url"];e.exports=((e,r)=>{if(r._readableState.autoDestroy){throw new Error("The second stream must have the `autoDestroy` option set to `false`")}const n=new Set(Object.keys(e).concat(t));const i={};for(const t of n){if(t in r){continue}i[t]={get(){const r=e[t];const n=typeof r==="function";return n?r.bind(e):r},set(r){e[t]=r},enumerable:true,configurable:false}}Object.defineProperties(r,i);e.once("aborted",()=>{r.destroy();r.emit("aborted")});e.once("close",()=>{if(e.complete){if(r.readable){r.once("end",()=>{r.emit("close")})}else{r.emit("close")}}else{r.emit("close")}});return r})},6214:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});function isTLSSocket(e){return e.encrypted}const r=(e,t)=>{let r;if(typeof t==="function"){const e=t;r={connect:e}}else{r=t}const n=typeof r.connect==="function";const i=typeof r.secureConnect==="function";const s=typeof r.close==="function";const o=()=>{if(n){r.connect()}if(isTLSSocket(e)&&i){if(e.authorized){r.secureConnect()}else if(!e.authorizationError){e.once("secureConnect",r.secureConnect)}}if(s){e.once("close",r.close)}};if(e.writable&&!e.connecting){o()}else if(e.connecting){e.once("connect",o)}else if(e.destroyed&&s){r.close(e._hadError)}};t.default=r;e.exports=r;e.exports.default=r},1205:(e,t,r)=>{var n=r(1223);var i=function(){};var s=function(e){return e.setHeader&&typeof e.abort==="function"};var o=function(e){return e.stdio&&Array.isArray(e.stdio)&&e.stdio.length===3};var a=function(e,t,r){if(typeof t==="function")return a(e,null,t);if(!t)t={};r=n(r||i);var c=e._writableState;var u=e._readableState;var l=t.readable||t.readable!==false&&e.readable;var f=t.writable||t.writable!==false&&e.writable;var h=false;var d=function(){if(!e.writable)p()};var p=function(){f=false;if(!l)r.call(e)};var y=function(){l=false;if(!f)r.call(e)};var m=function(t){r.call(e,t?new Error("exited with error code: "+t):null)};var g=function(t){r.call(e,t)};var v=function(){process.nextTick(b)};var b=function(){if(h)return;if(l&&!(u&&(u.ended&&!u.destroyed)))return r.call(e,new Error("premature close"));if(f&&!(c&&(c.ended&&!c.destroyed)))return r.call(e,new Error("premature close"))};var w=function(){e.req.on("finish",p)};if(s(e)){e.on("complete",p);e.on("abort",v);if(e.req)w();else e.on("request",w)}else if(f&&!c){e.on("end",d);e.on("close",d)}if(o(e))e.on("exit",m);e.on("end",y);e.on("finish",p);if(t.error!==false)e.on("error",g);e.on("close",v);return function(){h=true;e.removeListener("complete",p);e.removeListener("abort",v);e.removeListener("request",w);if(e.req)e.req.removeListener("finish",p);e.removeListener("end",d);e.removeListener("close",d);e.removeListener("finish",p);e.removeListener("exit",m);e.removeListener("end",y);e.removeListener("error",g);e.removeListener("close",v)}};e.exports=a},3338:(e,t,r)=>{"use strict";const n=r(7758);const i=r(5622);const s=r(2915).mkdirsSync;const o=r(2548).utimesMillisSync;const a=r(3901);function copySync(e,t,r){if(typeof r==="function"){r={filter:r}}r=r||{};r.clobber="clobber"in r?!!r.clobber:true;r.overwrite="overwrite"in r?!!r.overwrite:r.clobber;if(r.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}const{srcStat:n,destStat:i}=a.checkPathsSync(e,t,"copy",r);a.checkParentPathsSync(e,n,t,"copy");return handleFilterAndCopy(i,e,t,r)}function handleFilterAndCopy(e,t,r,o){if(o.filter&&!o.filter(t,r))return;const a=i.dirname(r);if(!n.existsSync(a))s(a);return getStats(e,t,r,o)}function startCopy(e,t,r,n){if(n.filter&&!n.filter(t,r))return;return getStats(e,t,r,n)}function getStats(e,t,r,i){const s=i.dereference?n.statSync:n.lstatSync;const o=s(t);if(o.isDirectory())return onDir(o,e,t,r,i);else if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return onFile(o,e,t,r,i);else if(o.isSymbolicLink())return onLink(e,t,r,i);else if(o.isSocket())throw new Error(`Cannot copy a socket file: ${t}`);else if(o.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${t}`);throw new Error(`Unknown file: ${t}`)}function onFile(e,t,r,n,i){if(!t)return copyFile(e,r,n,i);return mayCopyFile(e,r,n,i)}function mayCopyFile(e,t,r,i){if(i.overwrite){n.unlinkSync(r);return copyFile(e,t,r,i)}else if(i.errorOnExist){throw new Error(`'${r}' already exists`)}}function copyFile(e,t,r,i){n.copyFileSync(t,r);if(i.preserveTimestamps)handleTimestamps(e.mode,t,r);return setDestMode(r,e.mode)}function handleTimestamps(e,t,r){if(fileIsNotWritable(e))makeFileWritable(r,e);return setDestTimestamps(t,r)}function fileIsNotWritable(e){return(e&128)===0}function makeFileWritable(e,t){return setDestMode(e,t|128)}function setDestMode(e,t){return n.chmodSync(e,t)}function setDestTimestamps(e,t){const r=n.statSync(e);return o(t,r.atime,r.mtime)}function onDir(e,t,r,n,i){if(!t)return mkDirAndCopy(e.mode,r,n,i);return copyDir(r,n,i)}function mkDirAndCopy(e,t,r,i){n.mkdirSync(r);copyDir(t,r,i);return setDestMode(r,e)}function copyDir(e,t,r){n.readdirSync(e).forEach(n=>copyDirItem(n,e,t,r))}function copyDirItem(e,t,r,n){const s=i.join(t,e);const o=i.join(r,e);const{destStat:c}=a.checkPathsSync(s,o,"copy",n);return startCopy(c,s,o,n)}function onLink(e,t,r,s){let o=n.readlinkSync(t);if(s.dereference){o=i.resolve(process.cwd(),o)}if(!e){return n.symlinkSync(o,r)}else{let e;try{e=n.readlinkSync(r)}catch(e){if(e.code==="EINVAL"||e.code==="UNKNOWN")return n.symlinkSync(o,r);throw e}if(s.dereference){e=i.resolve(process.cwd(),e)}if(a.isSrcSubdir(o,e)){throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${e}'.`)}if(n.statSync(r).isDirectory()&&a.isSrcSubdir(e,o)){throw new Error(`Cannot overwrite '${e}' with '${o}'.`)}return copyLink(o,r)}}function copyLink(e,t){n.unlinkSync(t);return n.symlinkSync(e,t)}e.exports=copySync},1135:(e,t,r)=>{"use strict";e.exports={copySync:r(3338)}},8834:(e,t,r)=>{"use strict";const n=r(7758);const i=r(5622);const s=r(2915).mkdirs;const o=r(3835).pathExists;const a=r(2548).utimesMillis;const c=r(3901);function copy(e,t,r,n){if(typeof r==="function"&&!n){n=r;r={}}else if(typeof r==="function"){r={filter:r}}n=n||function(){};r=r||{};r.clobber="clobber"in r?!!r.clobber:true;r.overwrite="overwrite"in r?!!r.overwrite:r.clobber;if(r.preserveTimestamps&&process.arch==="ia32"){console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`)}c.checkPaths(e,t,"copy",r,(i,s)=>{if(i)return n(i);const{srcStat:o,destStat:a}=s;c.checkParentPaths(e,o,t,"copy",i=>{if(i)return n(i);if(r.filter)return handleFilter(checkParentDir,a,e,t,r,n);return checkParentDir(a,e,t,r,n)})})}function checkParentDir(e,t,r,n,a){const c=i.dirname(r);o(c,(i,o)=>{if(i)return a(i);if(o)return getStats(e,t,r,n,a);s(c,i=>{if(i)return a(i);return getStats(e,t,r,n,a)})})}function handleFilter(e,t,r,n,i,s){Promise.resolve(i.filter(r,n)).then(o=>{if(o)return e(t,r,n,i,s);return s()},e=>s(e))}function startCopy(e,t,r,n,i){if(n.filter)return handleFilter(getStats,e,t,r,n,i);return getStats(e,t,r,n,i)}function getStats(e,t,r,i,s){const o=i.dereference?n.stat:n.lstat;o(t,(n,o)=>{if(n)return s(n);if(o.isDirectory())return onDir(o,e,t,r,i,s);else if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return onFile(o,e,t,r,i,s);else if(o.isSymbolicLink())return onLink(e,t,r,i,s);else if(o.isSocket())return s(new Error(`Cannot copy a socket file: ${t}`));else if(o.isFIFO())return s(new Error(`Cannot copy a FIFO pipe: ${t}`));return s(new Error(`Unknown file: ${t}`))})}function onFile(e,t,r,n,i,s){if(!t)return copyFile(e,r,n,i,s);return mayCopyFile(e,r,n,i,s)}function mayCopyFile(e,t,r,i,s){if(i.overwrite){n.unlink(r,n=>{if(n)return s(n);return copyFile(e,t,r,i,s)})}else if(i.errorOnExist){return s(new Error(`'${r}' already exists`))}else return s()}function copyFile(e,t,r,i,s){n.copyFile(t,r,n=>{if(n)return s(n);if(i.preserveTimestamps)return handleTimestampsAndMode(e.mode,t,r,s);return setDestMode(r,e.mode,s)})}function handleTimestampsAndMode(e,t,r,n){if(fileIsNotWritable(e)){return makeFileWritable(r,e,i=>{if(i)return n(i);return setDestTimestampsAndMode(e,t,r,n)})}return setDestTimestampsAndMode(e,t,r,n)}function fileIsNotWritable(e){return(e&128)===0}function makeFileWritable(e,t,r){return setDestMode(e,t|128,r)}function setDestTimestampsAndMode(e,t,r,n){setDestTimestamps(t,r,t=>{if(t)return n(t);return setDestMode(r,e,n)})}function setDestMode(e,t,r){return n.chmod(e,t,r)}function setDestTimestamps(e,t,r){n.stat(e,(e,n)=>{if(e)return r(e);return a(t,n.atime,n.mtime,r)})}function onDir(e,t,r,n,i,s){if(!t)return mkDirAndCopy(e.mode,r,n,i,s);return copyDir(r,n,i,s)}function mkDirAndCopy(e,t,r,i,s){n.mkdir(r,n=>{if(n)return s(n);copyDir(t,r,i,t=>{if(t)return s(t);return setDestMode(r,e,s)})})}function copyDir(e,t,r,i){n.readdir(e,(n,s)=>{if(n)return i(n);return copyDirItems(s,e,t,r,i)})}function copyDirItems(e,t,r,n,i){const s=e.pop();if(!s)return i();return copyDirItem(e,s,t,r,n,i)}function copyDirItem(e,t,r,n,s,o){const a=i.join(r,t);const u=i.join(n,t);c.checkPaths(a,u,"copy",s,(t,i)=>{if(t)return o(t);const{destStat:c}=i;startCopy(c,a,u,s,t=>{if(t)return o(t);return copyDirItems(e,r,n,s,o)})})}function onLink(e,t,r,s,o){n.readlink(t,(t,a)=>{if(t)return o(t);if(s.dereference){a=i.resolve(process.cwd(),a)}if(!e){return n.symlink(a,r,o)}else{n.readlink(r,(t,u)=>{if(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return n.symlink(a,r,o);return o(t)}if(s.dereference){u=i.resolve(process.cwd(),u)}if(c.isSrcSubdir(a,u)){return o(new Error(`Cannot copy '${a}' to a subdirectory of itself, '${u}'.`))}if(e.isDirectory()&&c.isSrcSubdir(u,a)){return o(new Error(`Cannot overwrite '${u}' with '${a}'.`))}return copyLink(a,r,o)})}})}function copyLink(e,t,r){n.unlink(t,i=>{if(i)return r(i);return n.symlink(e,t,r)})}e.exports=copy},1335:(e,t,r)=>{"use strict";const n=r(9046).fromCallback;e.exports={copy:n(r(8834))}},6970:(e,t,r)=>{"use strict";const n=r(9046).fromPromise;const i=r(1176);const s=r(5622);const o=r(2915);const a=r(7357);const c=n(async function emptyDir(e){let t;try{t=await i.readdir(e)}catch{return o.mkdirs(e)}return Promise.all(t.map(t=>a.remove(s.join(e,t))))});function emptyDirSync(e){let t;try{t=i.readdirSync(e)}catch{return o.mkdirsSync(e)}t.forEach(t=>{t=s.join(e,t);a.removeSync(t)})}e.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:c,emptydir:c}},2164:(e,t,r)=>{"use strict";const n=r(9046).fromCallback;const i=r(5622);const s=r(7758);const o=r(2915);function createFile(e,t){function makeFile(){s.writeFile(e,"",e=>{if(e)return t(e);t()})}s.stat(e,(r,n)=>{if(!r&&n.isFile())return t();const a=i.dirname(e);s.stat(a,(e,r)=>{if(e){if(e.code==="ENOENT"){return o.mkdirs(a,e=>{if(e)return t(e);makeFile()})}return t(e)}if(r.isDirectory())makeFile();else{s.readdir(a,e=>{if(e)return t(e)})}})})}function createFileSync(e){let t;try{t=s.statSync(e)}catch{}if(t&&t.isFile())return;const r=i.dirname(e);try{if(!s.statSync(r).isDirectory()){s.readdirSync(r)}}catch(e){if(e&&e.code==="ENOENT")o.mkdirsSync(r);else throw e}s.writeFileSync(e,"")}e.exports={createFile:n(createFile),createFileSync:createFileSync}},55:(e,t,r)=>{"use strict";const n=r(2164);const i=r(3797);const s=r(2549);e.exports={createFile:n.createFile,createFileSync:n.createFileSync,ensureFile:n.createFile,ensureFileSync:n.createFileSync,createLink:i.createLink,createLinkSync:i.createLinkSync,ensureLink:i.createLink,ensureLinkSync:i.createLinkSync,createSymlink:s.createSymlink,createSymlinkSync:s.createSymlinkSync,ensureSymlink:s.createSymlink,ensureSymlinkSync:s.createSymlinkSync}},3797:(e,t,r)=>{"use strict";const n=r(9046).fromCallback;const i=r(5622);const s=r(7758);const o=r(2915);const a=r(3835).pathExists;const{areIdentical:c}=r(3901);function createLink(e,t,r){function makeLink(e,t){s.link(e,t,e=>{if(e)return r(e);r(null)})}s.lstat(t,(n,u)=>{s.lstat(e,(n,s)=>{if(n){n.message=n.message.replace("lstat","ensureLink");return r(n)}if(u&&c(s,u))return r(null);const l=i.dirname(t);a(l,(n,i)=>{if(n)return r(n);if(i)return makeLink(e,t);o.mkdirs(l,n=>{if(n)return r(n);makeLink(e,t)})})})})}function createLinkSync(e,t){let r;try{r=s.lstatSync(t)}catch{}try{const t=s.lstatSync(e);if(r&&c(t,r))return}catch(e){e.message=e.message.replace("lstat","ensureLink");throw e}const n=i.dirname(t);const a=s.existsSync(n);if(a)return s.linkSync(e,t);o.mkdirsSync(n);return s.linkSync(e,t)}e.exports={createLink:n(createLink),createLinkSync:createLinkSync}},3727:(e,t,r)=>{"use strict";const n=r(5622);const i=r(7758);const s=r(3835).pathExists;function symlinkPaths(e,t,r){if(n.isAbsolute(e)){return i.lstat(e,t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return r(t)}return r(null,{toCwd:e,toDst:e})})}else{const o=n.dirname(t);const a=n.join(o,e);return s(a,(t,s)=>{if(t)return r(t);if(s){return r(null,{toCwd:a,toDst:e})}else{return i.lstat(e,t=>{if(t){t.message=t.message.replace("lstat","ensureSymlink");return r(t)}return r(null,{toCwd:e,toDst:n.relative(o,e)})})}})}}function symlinkPathsSync(e,t){let r;if(n.isAbsolute(e)){r=i.existsSync(e);if(!r)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}else{const s=n.dirname(t);const o=n.join(s,e);r=i.existsSync(o);if(r){return{toCwd:o,toDst:e}}else{r=i.existsSync(e);if(!r)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:n.relative(s,e)}}}}e.exports={symlinkPaths:symlinkPaths,symlinkPathsSync:symlinkPathsSync}},8254:(e,t,r)=>{"use strict";const n=r(7758);function symlinkType(e,t,r){r=typeof t==="function"?t:r;t=typeof t==="function"?false:t;if(t)return r(null,t);n.lstat(e,(e,n)=>{if(e)return r(null,"file");t=n&&n.isDirectory()?"dir":"file";r(null,t)})}function symlinkTypeSync(e,t){let r;if(t)return t;try{r=n.lstatSync(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}e.exports={symlinkType:symlinkType,symlinkTypeSync:symlinkTypeSync}},2549:(e,t,r)=>{"use strict";const n=r(9046).fromCallback;const i=r(5622);const s=r(1176);const o=r(2915);const a=o.mkdirs;const c=o.mkdirsSync;const u=r(3727);const l=u.symlinkPaths;const f=u.symlinkPathsSync;const h=r(8254);const d=h.symlinkType;const p=h.symlinkTypeSync;const y=r(3835).pathExists;const{areIdentical:m}=r(3901);function createSymlink(e,t,r,n){n=typeof r==="function"?r:n;r=typeof r==="function"?false:r;s.lstat(t,(i,o)=>{if(!i&&o.isSymbolicLink()){Promise.all([s.stat(e),s.stat(t)]).then(([i,s])=>{if(m(i,s))return n(null);_createSymlink(e,t,r,n)})}else _createSymlink(e,t,r,n)})}function _createSymlink(e,t,r,n){l(e,t,(o,c)=>{if(o)return n(o);e=c.toDst;d(c.toCwd,r,(r,o)=>{if(r)return n(r);const c=i.dirname(t);y(c,(r,i)=>{if(r)return n(r);if(i)return s.symlink(e,t,o,n);a(c,r=>{if(r)return n(r);s.symlink(e,t,o,n)})})})})}function createSymlinkSync(e,t,r){let n;try{n=s.lstatSync(t)}catch{}if(n&&n.isSymbolicLink()){const r=s.statSync(e);const n=s.statSync(t);if(m(r,n))return}const o=f(e,t);e=o.toDst;r=p(o.toCwd,r);const a=i.dirname(t);const u=s.existsSync(a);if(u)return s.symlinkSync(e,t,r);c(a);return s.symlinkSync(e,t,r)}e.exports={createSymlink:n(createSymlink),createSymlinkSync:createSymlinkSync}},1176:(e,t,r)=>{"use strict";const n=r(9046).fromCallback;const i=r(7758);const s=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(e=>{return typeof i[e]==="function"});Object.assign(t,i);s.forEach(e=>{t[e]=n(i[e])});t.realpath.native=n(i.realpath.native);t.exists=function(e,t){if(typeof t==="function"){return i.exists(e,t)}return new Promise(t=>{return i.exists(e,t)})};t.read=function(e,t,r,n,s,o){if(typeof o==="function"){return i.read(e,t,r,n,s,o)}return new Promise((o,a)=>{i.read(e,t,r,n,s,(e,t,r)=>{if(e)return a(e);o({bytesRead:t,buffer:r})})})};t.write=function(e,t,...r){if(typeof r[r.length-1]==="function"){return i.write(e,t,...r)}return new Promise((n,s)=>{i.write(e,t,...r,(e,t,r)=>{if(e)return s(e);n({bytesWritten:t,buffer:r})})})};if(typeof i.writev==="function"){t.writev=function(e,t,...r){if(typeof r[r.length-1]==="function"){return i.writev(e,t,...r)}return new Promise((n,s)=>{i.writev(e,t,...r,(e,t,r)=>{if(e)return s(e);n({bytesWritten:t,buffers:r})})})}}},5630:(e,t,r)=>{"use strict";e.exports={...r(1176),...r(1135),...r(1335),...r(6970),...r(55),...r(213),...r(2915),...r(9665),...r(1497),...r(6570),...r(3835),...r(7357)}},213:(e,t,r)=>{"use strict";const n=r(9046).fromPromise;const i=r(8970);i.outputJson=n(r(531));i.outputJsonSync=r(9421);i.outputJSON=i.outputJson;i.outputJSONSync=i.outputJsonSync;i.writeJSON=i.writeJson;i.writeJSONSync=i.writeJsonSync;i.readJSON=i.readJson;i.readJSONSync=i.readJsonSync;e.exports=i},8970:(e,t,r)=>{"use strict";const n=r(6160);e.exports={readJson:n.readFile,readJsonSync:n.readFileSync,writeJson:n.writeFile,writeJsonSync:n.writeFileSync}},9421:(e,t,r)=>{"use strict";const{stringify:n}=r(5902);const{outputFileSync:i}=r(6570);function outputJsonSync(e,t,r){const s=n(t,r);i(e,s,r)}e.exports=outputJsonSync},531:(e,t,r)=>{"use strict";const{stringify:n}=r(5902);const{outputFile:i}=r(6570);async function outputJson(e,t,r={}){const s=n(t,r);await i(e,s,r)}e.exports=outputJson},2915:(e,t,r)=>{"use strict";const n=r(9046).fromPromise;const{makeDir:i,makeDirSync:s}=r(2751);const o=n(i);e.exports={mkdirs:o,mkdirsSync:s,mkdirp:o,mkdirpSync:s,ensureDir:o,ensureDirSync:s}},2751:(e,t,r)=>{"use strict";const n=r(1176);const{checkPath:i}=r(9907);const s=e=>{const t={mode:511};if(typeof e==="number")return e;return{...t,...e}.mode};e.exports.makeDir=(async(e,t)=>{i(e);return n.mkdir(e,{mode:s(t),recursive:true})});e.exports.makeDirSync=((e,t)=>{i(e);return n.mkdirSync(e,{mode:s(t),recursive:true})})},9907:(e,t,r)=>{"use strict";const n=r(5622);e.exports.checkPath=function checkPath(e){if(process.platform==="win32"){const t=/[<>:"|?*]/.test(e.replace(n.parse(e).root,""));if(t){const t=new Error(`Path contains invalid characters: ${e}`);t.code="EINVAL";throw t}}}},9665:(e,t,r)=>{"use strict";e.exports={moveSync:r(6445)}},6445:(e,t,r)=>{"use strict";const n=r(7758);const i=r(5622);const s=r(1135).copySync;const o=r(7357).removeSync;const a=r(2915).mkdirpSync;const c=r(3901);function moveSync(e,t,r){r=r||{};const n=r.overwrite||r.clobber||false;const{srcStat:s,isChangingCase:o=false}=c.checkPathsSync(e,t,"move",r);c.checkParentPathsSync(e,s,t,"move");if(!isParentRoot(t))a(i.dirname(t));return doRename(e,t,n,o)}function isParentRoot(e){const t=i.dirname(e);const r=i.parse(t);return r.root===t}function doRename(e,t,r,i){if(i)return rename(e,t,r);if(r){o(t);return rename(e,t,r)}if(n.existsSync(t))throw new Error("dest already exists.");return rename(e,t,r)}function rename(e,t,r){try{n.renameSync(e,t)}catch(n){if(n.code!=="EXDEV")throw n;return moveAcrossDevice(e,t,r)}}function moveAcrossDevice(e,t,r){const n={overwrite:r,errorOnExist:true};s(e,t,n);return o(e)}e.exports=moveSync},1497:(e,t,r)=>{"use strict";const n=r(9046).fromCallback;e.exports={move:n(r(2231))}},2231:(e,t,r)=>{"use strict";const n=r(7758);const i=r(5622);const s=r(1335).copy;const o=r(7357).remove;const a=r(2915).mkdirp;const c=r(3835).pathExists;const u=r(3901);function move(e,t,r,n){if(typeof r==="function"){n=r;r={}}const s=r.overwrite||r.clobber||false;u.checkPaths(e,t,"move",r,(r,o)=>{if(r)return n(r);const{srcStat:c,isChangingCase:l=false}=o;u.checkParentPaths(e,c,t,"move",r=>{if(r)return n(r);if(isParentRoot(t))return doRename(e,t,s,l,n);a(i.dirname(t),r=>{if(r)return n(r);return doRename(e,t,s,l,n)})})})}function isParentRoot(e){const t=i.dirname(e);const r=i.parse(t);return r.root===t}function doRename(e,t,r,n,i){if(n)return rename(e,t,r,i);if(r){return o(t,n=>{if(n)return i(n);return rename(e,t,r,i)})}c(t,(n,s)=>{if(n)return i(n);if(s)return i(new Error("dest already exists."));return rename(e,t,r,i)})}function rename(e,t,r,i){n.rename(e,t,n=>{if(!n)return i();if(n.code!=="EXDEV")return i(n);return moveAcrossDevice(e,t,r,i)})}function moveAcrossDevice(e,t,r,n){const i={overwrite:r,errorOnExist:true};s(e,t,i,t=>{if(t)return n(t);return o(e,n)})}e.exports=move},6570:(e,t,r)=>{"use strict";const n=r(9046).fromCallback;const i=r(7758);const s=r(5622);const o=r(2915);const a=r(3835).pathExists;function outputFile(e,t,r,n){if(typeof r==="function"){n=r;r="utf8"}const c=s.dirname(e);a(c,(s,a)=>{if(s)return n(s);if(a)return i.writeFile(e,t,r,n);o.mkdirs(c,s=>{if(s)return n(s);i.writeFile(e,t,r,n)})})}function outputFileSync(e,...t){const r=s.dirname(e);if(i.existsSync(r)){return i.writeFileSync(e,...t)}o.mkdirsSync(r);i.writeFileSync(e,...t)}e.exports={outputFile:n(outputFile),outputFileSync:outputFileSync}},3835:(e,t,r)=>{"use strict";const n=r(9046).fromPromise;const i=r(1176);function pathExists(e){return i.access(e).then(()=>true).catch(()=>false)}e.exports={pathExists:n(pathExists),pathExistsSync:i.existsSync}},7357:(e,t,r)=>{"use strict";const n=r(7758);const i=r(9046).fromCallback;const s=r(7247);function remove(e,t){if(n.rm)return n.rm(e,{recursive:true,force:true},t);s(e,t)}function removeSync(e){if(n.rmSync)return n.rmSync(e,{recursive:true,force:true});s.sync(e)}e.exports={remove:i(remove),removeSync:removeSync}},7247:(e,t,r)=>{"use strict";const n=r(7758);const i=r(5622);const s=r(2357);const o=process.platform==="win32";function defaults(e){const t=["unlink","chmod","stat","lstat","rmdir","readdir"];t.forEach(t=>{e[t]=e[t]||n[t];t=t+"Sync";e[t]=e[t]||n[t]});e.maxBusyTries=e.maxBusyTries||3}function rimraf(e,t,r){let n=0;if(typeof t==="function"){r=t;t={}}s(e,"rimraf: missing path");s.strictEqual(typeof e,"string","rimraf: path should be a string");s.strictEqual(typeof r,"function","rimraf: callback function required");s(t,"rimraf: invalid options argument provided");s.strictEqual(typeof t,"object","rimraf: options should be object");defaults(t);rimraf_(e,t,function CB(i){if(i){if((i.code==="EBUSY"||i.code==="ENOTEMPTY"||i.code==="EPERM")&&nrimraf_(e,t,CB),r)}if(i.code==="ENOENT")i=null}r(i)})}function rimraf_(e,t,r){s(e);s(t);s(typeof r==="function");t.lstat(e,(n,i)=>{if(n&&n.code==="ENOENT"){return r(null)}if(n&&n.code==="EPERM"&&o){return fixWinEPERM(e,t,n,r)}if(i&&i.isDirectory()){return rmdir(e,t,n,r)}t.unlink(e,n=>{if(n){if(n.code==="ENOENT"){return r(null)}if(n.code==="EPERM"){return o?fixWinEPERM(e,t,n,r):rmdir(e,t,n,r)}if(n.code==="EISDIR"){return rmdir(e,t,n,r)}}return r(n)})})}function fixWinEPERM(e,t,r,n){s(e);s(t);s(typeof n==="function");t.chmod(e,438,i=>{if(i){n(i.code==="ENOENT"?null:r)}else{t.stat(e,(i,s)=>{if(i){n(i.code==="ENOENT"?null:r)}else if(s.isDirectory()){rmdir(e,t,r,n)}else{t.unlink(e,n)}})}})}function fixWinEPERMSync(e,t,r){let n;s(e);s(t);try{t.chmodSync(e,438)}catch(e){if(e.code==="ENOENT"){return}else{throw r}}try{n=t.statSync(e)}catch(e){if(e.code==="ENOENT"){return}else{throw r}}if(n.isDirectory()){rmdirSync(e,t,r)}else{t.unlinkSync(e)}}function rmdir(e,t,r,n){s(e);s(t);s(typeof n==="function");t.rmdir(e,i=>{if(i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")){rmkids(e,t,n)}else if(i&&i.code==="ENOTDIR"){n(r)}else{n(i)}})}function rmkids(e,t,r){s(e);s(t);s(typeof r==="function");t.readdir(e,(n,s)=>{if(n)return r(n);let o=s.length;let a;if(o===0)return t.rmdir(e,r);s.forEach(n=>{rimraf(i.join(e,n),t,n=>{if(a){return}if(n)return r(a=n);if(--o===0){t.rmdir(e,r)}})})})}function rimrafSync(e,t){let r;t=t||{};defaults(t);s(e,"rimraf: missing path");s.strictEqual(typeof e,"string","rimraf: path should be a string");s(t,"rimraf: missing options");s.strictEqual(typeof t,"object","rimraf: options should be object");try{r=t.lstatSync(e)}catch(r){if(r.code==="ENOENT"){return}if(r.code==="EPERM"&&o){fixWinEPERMSync(e,t,r)}}try{if(r&&r.isDirectory()){rmdirSync(e,t,null)}else{t.unlinkSync(e)}}catch(r){if(r.code==="ENOENT"){return}else if(r.code==="EPERM"){return o?fixWinEPERMSync(e,t,r):rmdirSync(e,t,r)}else if(r.code!=="EISDIR"){throw r}rmdirSync(e,t,r)}}function rmdirSync(e,t,r){s(e);s(t);try{t.rmdirSync(e)}catch(n){if(n.code==="ENOTDIR"){throw r}else if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM"){rmkidsSync(e,t)}else if(n.code!=="ENOENT"){throw n}}}function rmkidsSync(e,t){s(e);s(t);t.readdirSync(e).forEach(r=>rimrafSync(i.join(e,r),t));if(o){const r=Date.now();do{try{const r=t.rmdirSync(e,t);return r}catch{}}while(Date.now()-r<500)}else{const r=t.rmdirSync(e,t);return r}}e.exports=rimraf;rimraf.sync=rimrafSync},3901:(e,t,r)=>{"use strict";const n=r(1176);const i=r(5622);const s=r(1669);function getStats(e,t,r){const i=r.dereference?e=>n.stat(e,{bigint:true}):e=>n.lstat(e,{bigint:true});return Promise.all([i(e),i(t).catch(e=>{if(e.code==="ENOENT")return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}function getStatsSync(e,t,r){let i;const s=r.dereference?e=>n.statSync(e,{bigint:true}):e=>n.lstatSync(e,{bigint:true});const o=s(e);try{i=s(t)}catch(e){if(e.code==="ENOENT")return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:i}}function checkPaths(e,t,r,n,o){s.callbackify(getStats)(e,t,n,(n,s)=>{if(n)return o(n);const{srcStat:a,destStat:c}=s;if(c){if(areIdentical(a,c)){const n=i.basename(e);const s=i.basename(t);if(r==="move"&&n!==s&&n.toLowerCase()===s.toLowerCase()){return o(null,{srcStat:a,destStat:c,isChangingCase:true})}return o(new Error("Source and destination must not be the same."))}if(a.isDirectory()&&!c.isDirectory()){return o(new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`))}if(!a.isDirectory()&&c.isDirectory()){return o(new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`))}}if(a.isDirectory()&&isSrcSubdir(e,t)){return o(new Error(errMsg(e,t,r)))}return o(null,{srcStat:a,destStat:c})})}function checkPathsSync(e,t,r,n){const{srcStat:s,destStat:o}=getStatsSync(e,t,n);if(o){if(areIdentical(s,o)){const n=i.basename(e);const a=i.basename(t);if(r==="move"&&n!==a&&n.toLowerCase()===a.toLowerCase()){return{srcStat:s,destStat:o,isChangingCase:true}}throw new Error("Source and destination must not be the same.")}if(s.isDirectory()&&!o.isDirectory()){throw new Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`)}if(!s.isDirectory()&&o.isDirectory()){throw new Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}}if(s.isDirectory()&&isSrcSubdir(e,t)){throw new Error(errMsg(e,t,r))}return{srcStat:s,destStat:o}}function checkParentPaths(e,t,r,s,o){const a=i.resolve(i.dirname(e));const c=i.resolve(i.dirname(r));if(c===a||c===i.parse(c).root)return o();n.stat(c,{bigint:true},(n,i)=>{if(n){if(n.code==="ENOENT")return o();return o(n)}if(areIdentical(t,i)){return o(new Error(errMsg(e,r,s)))}return checkParentPaths(e,t,c,s,o)})}function checkParentPathsSync(e,t,r,s){const o=i.resolve(i.dirname(e));const a=i.resolve(i.dirname(r));if(a===o||a===i.parse(a).root)return;let c;try{c=n.statSync(a,{bigint:true})}catch(e){if(e.code==="ENOENT")return;throw e}if(areIdentical(t,c)){throw new Error(errMsg(e,r,s))}return checkParentPathsSync(e,t,a,s)}function areIdentical(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function isSrcSubdir(e,t){const r=i.resolve(e).split(i.sep).filter(e=>e);const n=i.resolve(t).split(i.sep).filter(e=>e);return r.reduce((e,t,r)=>e&&n[r]===t,true)}function errMsg(e,t,r){return`Cannot ${r} '${e}' to a subdirectory of itself, '${t}'.`}e.exports={checkPaths:checkPaths,checkPathsSync:checkPathsSync,checkParentPaths:checkParentPaths,checkParentPathsSync:checkParentPathsSync,isSrcSubdir:isSrcSubdir,areIdentical:areIdentical}},2548:(e,t,r)=>{"use strict";const n=r(7758);function utimesMillis(e,t,r,i){n.open(e,"r+",(e,s)=>{if(e)return i(e);n.futimes(s,t,r,e=>{n.close(s,t=>{if(i)i(e||t)})})})}function utimesMillisSync(e,t,r){const i=n.openSync(e,"r+");n.futimesSync(i,t,r);return n.closeSync(i)}e.exports={utimesMillis:utimesMillis,utimesMillisSync:utimesMillisSync}},1585:(e,t,r)=>{"use strict";const{PassThrough:n}=r(2413);e.exports=(e=>{e={...e};const{array:t}=e;let{encoding:r}=e;const i=r==="buffer";let s=false;if(t){s=!(r||i)}else{r=r||"utf8"}if(i){r=null}const o=new n({objectMode:s});if(r){o.setEncoding(r)}let a=0;const c=[];o.on("data",e=>{c.push(e);if(s){a=c.length}else{a+=e.length}});o.getBufferedValue=(()=>{if(t){return c}return i?Buffer.concat(c,a):c.join("")});o.getBufferedLength=(()=>a);return o})},1766:(e,t,r)=>{"use strict";const{constants:n}=r(4293);const i=r(8341);const s=r(1585);class MaxBufferError extends Error{constructor(){super("maxBuffer exceeded");this.name="MaxBufferError"}}async function getStream(e,t){if(!e){return Promise.reject(new Error("Expected a stream"))}t={maxBuffer:Infinity,...t};const{maxBuffer:r}=t;let o;await new Promise((a,c)=>{const u=e=>{if(e&&o.getBufferedLength()<=n.MAX_LENGTH){e.bufferedData=o.getBufferedValue()}c(e)};o=i(e,s(t),e=>{if(e){u(e);return}a()});o.on("data",()=>{if(o.getBufferedLength()>r){u(new MaxBufferError)}})});return o.getBufferedValue()}e.exports=getStream;e.exports.default=getStream;e.exports.buffer=((e,t)=>getStream(e,{...t,encoding:"buffer"}));e.exports.array=((e,t)=>getStream(e,{...t,array:true}));e.exports.MaxBufferError=MaxBufferError},6457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(4597);function createRejection(e,...t){const r=(async()=>{if(e instanceof n.RequestError){try{for(const r of t){if(r){for(const t of r){e=await t(e)}}}}catch(t){e=t}}throw e})();const i=()=>r;r.json=i;r.text=i;r.buffer=i;r.on=i;return r}t.default=createRejection},6056:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});const s=r(8614);const o=r(7678);const a=r(9072);const c=r(4597);const u=r(8220);const l=r(94);const f=r(3021);const h=r(4500);const d=r(9298);const p=["request","response","redirect","uploadProgress","downloadProgress"];function asPromise(e){let t;let r;const n=new s.EventEmitter;const i=new a((s,a,y)=>{const m=g=>{const v=new l.default(undefined,e);v.retryCount=g;v._noPipe=true;y(()=>v.destroy());y.shouldReject=false;y(()=>a(new c.CancelError(v)));t=v;v.once("response",async e=>{var t;e.retryCount=g;if(e.request.aborted){return}let n;try{n=await h.default(v);e.rawBody=n}catch(e){return}if(v._isAboutToError){return}const i=((t=e.headers["content-encoding"])!==null&&t!==void 0?t:"").toLowerCase();const o=["gzip","deflate","br"].includes(i);const{options:a}=v;if(o&&!a.decompress){e.body=n}else{try{e.body=u.default(e,a.responseType,a.parseJson,a.encoding)}catch(t){e.body=n.toString();if(d.isResponseOk(e)){v._beforeError(t);return}}}try{for(const[t,r]of a.hooks.afterResponse.entries()){e=await r(e,async e=>{const r=l.default.normalizeArguments(undefined,{...e,retry:{calculateDelay:()=>0},throwHttpErrors:false,resolveBodyOnly:false},a);r.hooks.afterResponse=r.hooks.afterResponse.slice(0,t);for(const e of r.hooks.beforeRetry){await e(r)}const n=asPromise(r);y(()=>{n.catch(()=>{});n.cancel()});return n})}}catch(e){v._beforeError(new c.RequestError(e.message,e,v));return}if(!d.isResponseOk(e)){v._beforeError(new c.HTTPError(e));return}r=e;s(v.options.resolveBodyOnly?e.body:e)});const b=e=>{if(i.isCanceled){return}const{options:t}=v;if(e instanceof c.HTTPError&&!t.throwHttpErrors){const{response:t}=e;s(v.options.resolveBodyOnly?t.body:t);return}a(e)};v.once("error",b);const w=v.options.body;v.once("retry",(e,t)=>{var r,n;if(w===((r=t.request)===null||r===void 0?void 0:r.options.body)&&o.default.nodeStream((n=t.request)===null||n===void 0?void 0:n.options.body)){b(t);return}m(e)});f.default(v,n,p)};m(0)});i.on=((e,t)=>{n.on(e,t);return i});const y=e=>{const t=(async()=>{await i;const{options:t}=r.request;return u.default(r,e,t.parseJson,t.encoding)})();Object.defineProperties(t,Object.getOwnPropertyDescriptors(i));return t};i.json=(()=>{const{headers:e}=t.options;if(!t.writableFinished&&e.accept===undefined){e.accept="application/json"}return y("json")});i.buffer=(()=>y("buffer"));i.text=(()=>y("text"));return i}t.default=asPromise;i(r(4597),t)},1048:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(7678);const i=(e,t)=>{if(n.default.null_(e.encoding)){throw new TypeError("To get a Buffer, set `options.responseType` to `buffer` instead")}n.assert.any([n.default.string,n.default.undefined],e.encoding);n.assert.any([n.default.boolean,n.default.undefined],e.resolveBodyOnly);n.assert.any([n.default.boolean,n.default.undefined],e.methodRewriting);n.assert.any([n.default.boolean,n.default.undefined],e.isStream);n.assert.any([n.default.string,n.default.undefined],e.responseType);if(e.responseType===undefined){e.responseType="text"}const{retry:r}=e;if(t){e.retry={...t.retry}}else{e.retry={calculateDelay:e=>e.computedValue,limit:0,methods:[],statusCodes:[],errorCodes:[],maxRetryAfter:undefined}}if(n.default.object(r)){e.retry={...e.retry,...r};e.retry.methods=[...new Set(e.retry.methods.map(e=>e.toUpperCase()))];e.retry.statusCodes=[...new Set(e.retry.statusCodes)];e.retry.errorCodes=[...new Set(e.retry.errorCodes)]}else if(n.default.number(r)){e.retry.limit=r}if(n.default.undefined(e.retry.maxRetryAfter)){e.retry.maxRetryAfter=Math.min(...[e.timeout.request,e.timeout.connect].filter(n.default.number))}if(n.default.object(e.pagination)){if(t){e.pagination={...t.pagination,...e.pagination}}const{pagination:r}=e;if(!n.default.function_(r.transform)){throw new Error("`options.pagination.transform` must be implemented")}if(!n.default.function_(r.shouldContinue)){throw new Error("`options.pagination.shouldContinue` must be implemented")}if(!n.default.function_(r.filter)){throw new TypeError("`options.pagination.filter` must be implemented")}if(!n.default.function_(r.paginate)){throw new Error("`options.pagination.paginate` must be implemented")}}if(e.responseType==="json"&&e.headers.accept===undefined){e.headers.accept="application/json"}return e};t.default=i},8220:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(4597);const i=(e,t,r,i)=>{const{rawBody:s}=e;try{if(t==="text"){return s.toString(i)}if(t==="json"){return s.length===0?"":r(s.toString())}if(t==="buffer"){return s}throw new n.ParseError({message:`Unknown body type '${t}'`,name:"Error"},e)}catch(t){throw new n.ParseError(t,e)}};t.default=i},4597:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.CancelError=t.ParseError=void 0;const s=r(94);class ParseError extends s.RequestError{constructor(e,t){const{options:r}=t.request;super(`${e.message} in "${r.url.toString()}"`,e,t.request);this.name="ParseError"}}t.ParseError=ParseError;class CancelError extends s.RequestError{constructor(e){super("Promise was canceled",{},e);this.name="CancelError"}get isCanceled(){return true}}t.CancelError=CancelError;i(r(94),t)},3462:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.retryAfterStatusCodes=void 0;t.retryAfterStatusCodes=new Set([413,429,503]);const r=({attemptCount:e,retryOptions:t,error:r,retryAfter:n})=>{if(e>t.limit){return 0}const i=t.methods.includes(r.options.method);const s=t.errorCodes.includes(r.code);const o=r.response&&t.statusCodes.includes(r.response.statusCode);if(!i||!s&&!o){return 0}if(r.response){if(n){if(t.maxRetryAfter===undefined||n>t.maxRetryAfter){return 0}return n}if(r.response.statusCode===413){return 0}}const a=Math.random()*100;return 2**(e-1)*1e3+a};t.default=r},94:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.UnsupportedProtocolError=t.ReadError=t.TimeoutError=t.UploadError=t.CacheError=t.HTTPError=t.MaxRedirectsError=t.RequestError=t.setNonEnumerableProperties=t.knownHookEvents=t.withoutBody=t.kIsNormalizedAlready=void 0;const n=r(1669);const i=r(2413);const s=r(5747);const o=r(8835);const a=r(8605);const c=r(8605);const u=r(7211);const l=r(8097);const f=r(2286);const h=r(8116);const d=r(2391);const p=r(4645);const y=r(9662);const m=r(7678);const g=r(4564);const v=r(40);const b=r(3021);const w=r(2454);const _=r(8026);const S=r(9219);const E=r(7288);const C=r(4500);const k=r(4993);const x=r(9298);const O=r(397);const I=r(1048);const A=r(3462);let T;const P=Symbol("request");const R=Symbol("response");const j=Symbol("responseSize");const F=Symbol("downloadedSize");const L=Symbol("bodySize");const $=Symbol("uploadedSize");const D=Symbol("serverResponsesPiped");const N=Symbol("unproxyEvents");const M=Symbol("isFromCache");const q=Symbol("cancelTimeouts");const W=Symbol("startedReading");const U=Symbol("stopReading");const H=Symbol("triggerRead");const z=Symbol("body");const B=Symbol("jobs");const G=Symbol("originalResponse");const K=Symbol("retryTimeout");t.kIsNormalizedAlready=Symbol("isNormalizedAlready");const J=m.default.string(process.versions.brotli);t.withoutBody=new Set(["GET","HEAD"]);t.knownHookEvents=["init","beforeRequest","beforeRedirect","beforeError","beforeRetry","afterResponse"];function validateSearchParameters(e){for(const t in e){const r=e[t];if(!m.default.string(r)&&!m.default.number(r)&&!m.default.boolean(r)&&!m.default.null_(r)&&!m.default.undefined(r)){throw new TypeError(`The \`searchParams\` value '${String(r)}' must be a string, number, boolean or null`)}}}function isClientRequest(e){return m.default.object(e)&&!("statusCode"in e)}const Y=new E.default;const Z=async e=>new Promise((t,r)=>{const n=e=>{r(e)};if(!e.pending){t()}e.once("error",n);e.once("ready",()=>{e.off("error",n);t()})});const X=new Set([300,301,302,303,304,307,308]);const Q=["context","body","json","form"];t.setNonEnumerableProperties=((e,t)=>{const r={};for(const t of e){if(!t){continue}for(const e of Q){if(!(e in t)){continue}r[e]={writable:true,configurable:true,enumerable:false,value:t[e]}}}Object.defineProperties(t,r)});class RequestError extends Error{constructor(e,t,r){var n;super(e);Error.captureStackTrace(this,this.constructor);this.name="RequestError";this.code=t.code;if(r instanceof Request){Object.defineProperty(this,"request",{enumerable:false,value:r});Object.defineProperty(this,"response",{enumerable:false,value:r[R]});Object.defineProperty(this,"options",{enumerable:false,value:r.options})}else{Object.defineProperty(this,"options",{enumerable:false,value:r})}this.timings=(n=this.request)===null||n===void 0?void 0:n.timings;if(m.default.string(t.stack)&&m.default.string(this.stack)){const e=this.stack.indexOf(this.message)+this.message.length;const r=this.stack.slice(e).split("\n").reverse();const n=t.stack.slice(t.stack.indexOf(t.message)+t.message.length).split("\n").reverse();while(n.length!==0&&n[0]===r[0]){r.shift()}this.stack=`${this.stack.slice(0,e)}${r.reverse().join("\n")}${n.reverse().join("\n")}`}}}t.RequestError=RequestError;class MaxRedirectsError extends RequestError{constructor(e){super(`Redirected ${e.options.maxRedirects} times. Aborting.`,{},e);this.name="MaxRedirectsError"}}t.MaxRedirectsError=MaxRedirectsError;class HTTPError extends RequestError{constructor(e){super(`Response code ${e.statusCode} (${e.statusMessage})`,{},e.request);this.name="HTTPError"}}t.HTTPError=HTTPError;class CacheError extends RequestError{constructor(e,t){super(e.message,e,t);this.name="CacheError"}}t.CacheError=CacheError;class UploadError extends RequestError{constructor(e,t){super(e.message,e,t);this.name="UploadError"}}t.UploadError=UploadError;class TimeoutError extends RequestError{constructor(e,t,r){super(e.message,e,r);this.name="TimeoutError";this.event=e.event;this.timings=t}}t.TimeoutError=TimeoutError;class ReadError extends RequestError{constructor(e,t){super(e.message,e,t);this.name="ReadError"}}t.ReadError=ReadError;class UnsupportedProtocolError extends RequestError{constructor(e){super(`Unsupported protocol "${e.url.protocol}"`,{},e);this.name="UnsupportedProtocolError"}}t.UnsupportedProtocolError=UnsupportedProtocolError;const V=["socket","connect","continue","information","upgrade","timeout"];class Request extends i.Duplex{constructor(e,r={},n){super({autoDestroy:false,highWaterMark:0});this[F]=0;this[$]=0;this.requestInitialized=false;this[D]=new Set;this.redirects=[];this[U]=false;this[H]=false;this[B]=[];this.retryCount=0;this._progressCallbacks=[];const i=()=>this._unlockWrite();const o=()=>this._lockWrite();this.on("pipe",e=>{e.prependListener("data",i);e.on("data",o);e.prependListener("end",i);e.on("end",o)});this.on("unpipe",e=>{e.off("data",i);e.off("data",o);e.off("end",i);e.off("end",o)});this.on("pipe",e=>{if(e instanceof c.IncomingMessage){this.options.headers={...e.headers,...this.options.headers}}});const{json:a,body:u,form:l}=r;if(a||u||l){this._lockWrite()}if(t.kIsNormalizedAlready in r){this.options=r}else{try{this.options=this.constructor.normalizeArguments(e,r,n)}catch(e){if(m.default.nodeStream(r.body)){r.body.destroy()}this.destroy(e);return}}(async()=>{var e;try{if(this.options.body instanceof s.ReadStream){await Z(this.options.body)}const{url:t}=this.options;if(!t){throw new TypeError("Missing `url` property")}this.requestUrl=t.toString();decodeURI(this.requestUrl);await this._finalizeBody();await this._makeRequest();if(this.destroyed){(e=this[P])===null||e===void 0?void 0:e.destroy();return}for(const e of this[B]){e()}this[B].length=0;this.requestInitialized=true}catch(e){if(e instanceof RequestError){this._beforeError(e);return}if(!this.destroyed){this.destroy(e)}}})()}static normalizeArguments(e,r,i){var s,a,c,u,l;const d=r;if(m.default.object(e)&&!m.default.urlInstance(e)){r={...i,...e,...r}}else{if(e&&r&&r.url!==undefined){throw new TypeError("The `url` option is mutually exclusive with the `input` argument")}r={...i,...r};if(e!==undefined){r.url=e}if(m.default.urlInstance(r.url)){r.url=new o.URL(r.url.toString())}}if(r.cache===false){r.cache=undefined}if(r.dnsCache===false){r.dnsCache=undefined}m.assert.any([m.default.string,m.default.undefined],r.method);m.assert.any([m.default.object,m.default.undefined],r.headers);m.assert.any([m.default.string,m.default.urlInstance,m.default.undefined],r.prefixUrl);m.assert.any([m.default.object,m.default.undefined],r.cookieJar);m.assert.any([m.default.object,m.default.string,m.default.undefined],r.searchParams);m.assert.any([m.default.object,m.default.string,m.default.undefined],r.cache);m.assert.any([m.default.object,m.default.number,m.default.undefined],r.timeout);m.assert.any([m.default.object,m.default.undefined],r.context);m.assert.any([m.default.object,m.default.undefined],r.hooks);m.assert.any([m.default.boolean,m.default.undefined],r.decompress);m.assert.any([m.default.boolean,m.default.undefined],r.ignoreInvalidCookies);m.assert.any([m.default.boolean,m.default.undefined],r.followRedirect);m.assert.any([m.default.number,m.default.undefined],r.maxRedirects);m.assert.any([m.default.boolean,m.default.undefined],r.throwHttpErrors);m.assert.any([m.default.boolean,m.default.undefined],r.http2);m.assert.any([m.default.boolean,m.default.undefined],r.allowGetBody);m.assert.any([m.default.string,m.default.undefined],r.localAddress);m.assert.any([k.isDnsLookupIpVersion,m.default.undefined],r.dnsLookupIpVersion);m.assert.any([m.default.object,m.default.undefined],r.https);m.assert.any([m.default.boolean,m.default.undefined],r.rejectUnauthorized);if(r.https){m.assert.any([m.default.boolean,m.default.undefined],r.https.rejectUnauthorized);m.assert.any([m.default.function_,m.default.undefined],r.https.checkServerIdentity);m.assert.any([m.default.string,m.default.object,m.default.array,m.default.undefined],r.https.certificateAuthority);m.assert.any([m.default.string,m.default.object,m.default.array,m.default.undefined],r.https.key);m.assert.any([m.default.string,m.default.object,m.default.array,m.default.undefined],r.https.certificate);m.assert.any([m.default.string,m.default.undefined],r.https.passphrase);m.assert.any([m.default.string,m.default.buffer,m.default.array,m.default.undefined],r.https.pfx)}m.assert.any([m.default.object,m.default.undefined],r.cacheOptions);if(m.default.string(r.method)){r.method=r.method.toUpperCase()}else{r.method="GET"}if(r.headers===(i===null||i===void 0?void 0:i.headers)){r.headers={...r.headers}}else{r.headers=y({...i===null||i===void 0?void 0:i.headers,...r.headers})}if("slashes"in r){throw new TypeError("The legacy `url.Url` has been deprecated. Use `URL` instead.")}if("auth"in r){throw new TypeError("Parameter `auth` is deprecated. Use `username` / `password` instead.")}if("searchParams"in r){if(r.searchParams&&r.searchParams!==(i===null||i===void 0?void 0:i.searchParams)){let e;if(m.default.string(r.searchParams)||r.searchParams instanceof o.URLSearchParams){e=new o.URLSearchParams(r.searchParams)}else{validateSearchParameters(r.searchParams);e=new o.URLSearchParams;for(const t in r.searchParams){const n=r.searchParams[t];if(n===null){e.append(t,"")}else if(n!==undefined){e.append(t,n)}}}(s=i===null||i===void 0?void 0:i.searchParams)===null||s===void 0?void 0:s.forEach((t,r)=>{if(!e.has(r)){e.append(r,t)}});r.searchParams=e}}r.username=(a=r.username)!==null&&a!==void 0?a:"";r.password=(c=r.password)!==null&&c!==void 0?c:"";if(m.default.undefined(r.prefixUrl)){r.prefixUrl=(u=i===null||i===void 0?void 0:i.prefixUrl)!==null&&u!==void 0?u:""}else{r.prefixUrl=r.prefixUrl.toString();if(r.prefixUrl!==""&&!r.prefixUrl.endsWith("/")){r.prefixUrl+="/"}}if(m.default.string(r.url)){if(r.url.startsWith("/")){throw new Error("`input` must not start with a slash when using `prefixUrl`")}r.url=S.default(r.prefixUrl+r.url,r)}else if(m.default.undefined(r.url)&&r.prefixUrl!==""||r.protocol){r.url=S.default(r.prefixUrl,r)}if(r.url){if("port"in r){delete r.port}let{prefixUrl:e}=r;Object.defineProperty(r,"prefixUrl",{set:t=>{const n=r.url;if(!n.href.startsWith(t)){throw new Error(`Cannot change \`prefixUrl\` from ${e} to ${t}: ${n.href}`)}r.url=new o.URL(t+n.href.slice(e.length));e=t},get:()=>e});let{protocol:t}=r.url;if(t==="unix:"){t="http:";r.url=new o.URL(`http://unix${r.url.pathname}${r.url.search}`)}if(r.searchParams){r.url.search=r.searchParams.toString()}if(t!=="http:"&&t!=="https:"){throw new UnsupportedProtocolError(r)}if(r.username===""){r.username=r.url.username}else{r.url.username=r.username}if(r.password===""){r.password=r.url.password}else{r.url.password=r.password}}const{cookieJar:p}=r;if(p){let{setCookie:e,getCookieString:t}=p;m.assert.function_(e);m.assert.function_(t);if(e.length===4&&t.length===0){e=n.promisify(e.bind(r.cookieJar));t=n.promisify(t.bind(r.cookieJar));r.cookieJar={setCookie:e,getCookieString:t}}}const{cache:g}=r;if(g){if(!Y.has(g)){Y.set(g,new h((e,t)=>{const r=e[P](e,t);if(m.default.promise(r)){r.once=((e,t)=>{if(e==="error"){r.catch(t)}else if(e==="abort"){(async()=>{try{const e=await r;e.once("abort",t)}catch(e){}})()}else{throw new Error(`Unknown HTTP2 promise event: ${e}`)}return r})}return r},g))}}r.cacheOptions={...r.cacheOptions};if(r.dnsCache===true){if(!T){T=new f.default}r.dnsCache=T}else if(!m.default.undefined(r.dnsCache)&&!r.dnsCache.lookup){throw new TypeError(`Parameter \`dnsCache\` must be a CacheableLookup instance or a boolean, got ${m.default(r.dnsCache)}`)}if(m.default.number(r.timeout)){r.timeout={request:r.timeout}}else if(i&&r.timeout!==i.timeout){r.timeout={...i.timeout,...r.timeout}}else{r.timeout={...r.timeout}}if(!r.context){r.context={}}const v=r.hooks===(i===null||i===void 0?void 0:i.hooks);r.hooks={...r.hooks};for(const e of t.knownHookEvents){if(e in r.hooks){if(m.default.array(r.hooks[e])){r.hooks[e]=[...r.hooks[e]]}else{throw new TypeError(`Parameter \`${e}\` must be an Array, got ${m.default(r.hooks[e])}`)}}else{r.hooks[e]=[]}}if(i&&!v){for(const e of t.knownHookEvents){const t=i.hooks[e];if(t.length>0){r.hooks[e]=[...i.hooks[e],...r.hooks[e]]}}}if("family"in r){O.default('"options.family" was never documented, please use "options.dnsLookupIpVersion"')}if(i===null||i===void 0?void 0:i.https){r.https={...i.https,...r.https}}if("rejectUnauthorized"in r){O.default('"options.rejectUnauthorized" is now deprecated, please use "options.https.rejectUnauthorized"')}if("checkServerIdentity"in r){O.default('"options.checkServerIdentity" was never documented, please use "options.https.checkServerIdentity"')}if("ca"in r){O.default('"options.ca" was never documented, please use "options.https.certificateAuthority"')}if("key"in r){O.default('"options.key" was never documented, please use "options.https.key"')}if("cert"in r){O.default('"options.cert" was never documented, please use "options.https.certificate"')}if("passphrase"in r){O.default('"options.passphrase" was never documented, please use "options.https.passphrase"')}if("pfx"in r){O.default('"options.pfx" was never documented, please use "options.https.pfx"')}if("followRedirects"in r){throw new TypeError("The `followRedirects` option does not exist. Use `followRedirect` instead.")}if(r.agent){for(const e in r.agent){if(e!=="http"&&e!=="https"&&e!=="http2"){throw new TypeError(`Expected the \`options.agent\` properties to be \`http\`, \`https\` or \`http2\`, got \`${e}\``)}}}r.maxRedirects=(l=r.maxRedirects)!==null&&l!==void 0?l:0;t.setNonEnumerableProperties([i,d],r);return I.default(r,i)}_lockWrite(){const e=()=>{throw new TypeError("The payload has been already provided")};this.write=e;this.end=e}_unlockWrite(){this.write=super.write;this.end=super.end}async _finalizeBody(){const{options:e}=this;const{headers:r}=e;const n=!m.default.undefined(e.form);const s=!m.default.undefined(e.json);const a=!m.default.undefined(e.body);const c=n||s||a;const u=t.withoutBody.has(e.method)&&!(e.method==="GET"&&e.allowGetBody);this._cannotHaveBody=u;if(c){if(u){throw new TypeError(`The \`${e.method}\` method cannot be used with a body`)}if([a,n,s].filter(e=>e).length>1){throw new TypeError("The `body`, `json` and `form` options are mutually exclusive")}if(a&&!(e.body instanceof i.Readable)&&!m.default.string(e.body)&&!m.default.buffer(e.body)&&!v.default(e.body)){throw new TypeError("The `body` option must be a stream.Readable, string or Buffer")}if(n&&!m.default.object(e.form)){throw new TypeError("The `form` option must be an Object")}{const t=!m.default.string(r["content-type"]);if(a){if(v.default(e.body)&&t){r["content-type"]=`multipart/form-data; boundary=${e.body.getBoundary()}`}this[z]=e.body}else if(n){if(t){r["content-type"]="application/x-www-form-urlencoded"}this[z]=new o.URLSearchParams(e.form).toString()}else{if(t){r["content-type"]="application/json"}this[z]=e.stringifyJson(e.json)}const i=await g.default(this[z],e.headers);if(m.default.undefined(r["content-length"])&&m.default.undefined(r["transfer-encoding"])){if(!u&&!m.default.undefined(i)){r["content-length"]=String(i)}}}}else if(u){this._lockWrite()}else{this._unlockWrite()}this[L]=Number(r["content-length"])||undefined}async _onResponseBase(e){const{options:t}=this;const{url:r}=t;this[G]=e;if(t.decompress){e=d(e)}const n=e.statusCode;const i=e;i.statusMessage=i.statusMessage?i.statusMessage:a.STATUS_CODES[n];i.url=t.url.toString();i.requestUrl=this.requestUrl;i.redirectUrls=this.redirects;i.request=this;i.isFromCache=e.fromCache||false;i.ip=this.ip;i.retryCount=this.retryCount;this[M]=i.isFromCache;this[j]=Number(e.headers["content-length"])||undefined;this[R]=e;e.once("end",()=>{this[j]=this[F];this.emit("downloadProgress",this.downloadProgress)});e.once("error",t=>{e.destroy();this._beforeError(new ReadError(t,this))});e.once("aborted",()=>{this._beforeError(new ReadError({name:"Error",message:"The server aborted pending request",code:"ECONNRESET"},this))});this.emit("downloadProgress",this.downloadProgress);const s=e.headers["set-cookie"];if(m.default.object(t.cookieJar)&&s){let e=s.map(async e=>t.cookieJar.setCookie(e,r.toString()));if(t.ignoreInvalidCookies){e=e.map(async e=>e.catch(()=>{}))}try{await Promise.all(e)}catch(e){this._beforeError(e);return}}if(t.followRedirect&&e.headers.location&&X.has(n)){e.resume();if(this[P]){this[q]();delete this[P];this[N]()}const s=n===303&&t.method!=="GET"&&t.method!=="HEAD";if(s||!t.methodRewriting){t.method="GET";if("body"in t){delete t.body}if("json"in t){delete t.json}if("form"in t){delete t.form}this[z]=undefined;delete t.headers["content-length"]}if(this.redirects.length>=t.maxRedirects){this._beforeError(new MaxRedirectsError(this));return}try{const n=Buffer.from(e.headers.location,"binary").toString();const s=new o.URL(n,r);const a=s.toString();decodeURI(a);if(s.hostname!==r.hostname||s.port!==r.port){if("host"in t.headers){delete t.headers.host}if("cookie"in t.headers){delete t.headers.cookie}if("authorization"in t.headers){delete t.headers.authorization}if(t.username||t.password){t.username="";t.password=""}}else{s.username=t.username;s.password=t.password}this.redirects.push(a);t.url=s;for(const e of t.hooks.beforeRedirect){await e(t,i)}this.emit("redirect",i,t);await this._makeRequest()}catch(e){this._beforeError(e);return}return}if(t.isStream&&t.throwHttpErrors&&!x.isResponseOk(i)){this._beforeError(new HTTPError(i));return}e.on("readable",()=>{if(this[H]){this._read()}});this.on("resume",()=>{e.resume()});this.on("pause",()=>{e.pause()});e.once("end",()=>{this.push(null)});this.emit("response",e);for(const r of this[D]){if(r.headersSent){continue}for(const n in e.headers){const i=t.decompress?n!=="content-encoding":true;const s=e.headers[n];if(i){r.setHeader(n,s)}}r.statusCode=n}}async _onResponse(e){try{await this._onResponseBase(e)}catch(e){this._beforeError(e)}}_onRequest(e){const{options:t}=this;const{timeout:r,url:n}=t;l.default(e);this[q]=w.default(e,r,n);const i=t.cache?"cacheableResponse":"response";e.once(i,e=>{void this._onResponse(e)});e.once("error",t=>{var r;e.destroy();(r=e.res)===null||r===void 0?void 0:r.removeAllListeners("end");t=t instanceof w.TimeoutError?new TimeoutError(t,this.timings,this):new RequestError(t.message,t,this);this._beforeError(t)});this[N]=b.default(e,this,V);this[P]=e;this.emit("uploadProgress",this.uploadProgress);const s=this[z];const o=this.redirects.length===0?this:e;if(m.default.nodeStream(s)){s.pipe(o);s.once("error",e=>{this._beforeError(new UploadError(e,this))})}else{this._unlockWrite();if(!m.default.undefined(s)){this._writeRequest(s,undefined,()=>{});o.end();this._lockWrite()}else if(this._cannotHaveBody||this._noPipe){o.end();this._lockWrite()}}this.emit("request",e)}async _createCacheableRequest(e,t){return new Promise((r,n)=>{Object.assign(t,_.default(e));delete t.url;let i;const s=Y.get(t.cache)(t,async e=>{e._readableState.autoDestroy=false;if(i){(await i).emit("cacheableResponse",e)}r(e)});t.url=e;s.once("error",n);s.once("request",async e=>{i=e;r(i)})})}async _makeRequest(){var e,t,r,n,i;const{options:s}=this;const{headers:o}=s;for(const e in o){if(m.default.undefined(o[e])){delete o[e]}else if(m.default.null_(o[e])){throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${e}\` header`)}}if(s.decompress&&m.default.undefined(o["accept-encoding"])){o["accept-encoding"]=J?"gzip, deflate, br":"gzip, deflate"}if(s.cookieJar){const e=await s.cookieJar.getCookieString(s.url.toString());if(m.default.nonEmptyString(e)){s.headers.cookie=e}}for(const e of s.hooks.beforeRequest){const t=await e(s);if(!m.default.undefined(t)){s.request=(()=>t);break}}if(s.body&&this[z]!==s.body){this[z]=s.body}const{agent:c,request:l,timeout:f,url:d}=s;if(s.dnsCache&&!("lookup"in s)){s.lookup=s.dnsCache.lookup}if(d.hostname==="unix"){const e=/(?.+?):(?.+)/.exec(`${d.pathname}${d.search}`);if(e===null||e===void 0?void 0:e.groups){const{socketPath:t,path:r}=e.groups;Object.assign(s,{socketPath:t,path:r,host:""})}}const y=d.protocol==="https:";let g;if(s.http2){g=p.auto}else{g=y?u.request:a.request}const v=(e=s.request)!==null&&e!==void 0?e:g;const b=s.cache?this._createCacheableRequest:v;if(c&&!s.http2){s.agent=c[y?"https":"http"]}s[P]=v;delete s.request;delete s.timeout;const w=s;w.shared=(t=s.cacheOptions)===null||t===void 0?void 0:t.shared;w.cacheHeuristic=(r=s.cacheOptions)===null||r===void 0?void 0:r.cacheHeuristic;w.immutableMinTimeToLive=(n=s.cacheOptions)===null||n===void 0?void 0:n.immutableMinTimeToLive;w.ignoreCargoCult=(i=s.cacheOptions)===null||i===void 0?void 0:i.ignoreCargoCult;if(s.dnsLookupIpVersion!==undefined){try{w.family=k.dnsLookupIpVersionToFamily(s.dnsLookupIpVersion)}catch(e){throw new Error("Invalid `dnsLookupIpVersion` option value")}}if(s.https){if("rejectUnauthorized"in s.https){w.rejectUnauthorized=s.https.rejectUnauthorized}if(s.https.checkServerIdentity){w.checkServerIdentity=s.https.checkServerIdentity}if(s.https.certificateAuthority){w.ca=s.https.certificateAuthority}if(s.https.certificate){w.cert=s.https.certificate}if(s.https.key){w.key=s.https.key}if(s.https.passphrase){w.passphrase=s.https.passphrase}if(s.https.pfx){w.pfx=s.https.pfx}}try{let e=await b(d,w);if(m.default.undefined(e)){e=g(d,w)}s.request=l;s.timeout=f;s.agent=c;if(s.https){if("rejectUnauthorized"in s.https){delete w.rejectUnauthorized}if(s.https.checkServerIdentity){delete w.checkServerIdentity}if(s.https.certificateAuthority){delete w.ca}if(s.https.certificate){delete w.cert}if(s.https.key){delete w.key}if(s.https.passphrase){delete w.passphrase}if(s.https.pfx){delete w.pfx}}if(isClientRequest(e)){this._onRequest(e)}else if(this.writable){this.once("finish",()=>{void this._onResponse(e)});this._unlockWrite();this.end();this._lockWrite()}else{void this._onResponse(e)}}catch(e){if(e instanceof h.CacheError){throw new CacheError(e,this)}throw new RequestError(e.message,e,this)}}async _error(e){try{for(const t of this.options.hooks.beforeError){e=await t(e)}}catch(t){e=new RequestError(t.message,t,this)}this.destroy(e)}_beforeError(e){if(this[U]){return}const{options:t}=this;const r=this.retryCount+1;this[U]=true;if(!(e instanceof RequestError)){e=new RequestError(e.message,e,this)}const n=e;const{response:i}=n;void(async()=>{if(i&&!i.body){i.setEncoding(this._readableState.encoding);try{i.rawBody=await C.default(i);i.body=i.rawBody.toString()}catch(e){}}if(this.listenerCount("retry")!==0){let s;try{let e;if(i&&"retry-after"in i.headers){e=Number(i.headers["retry-after"]);if(Number.isNaN(e)){e=Date.parse(i.headers["retry-after"])-Date.now();if(e<=0){e=1}}else{e*=1e3}}s=await t.retry.calculateDelay({attemptCount:r,retryOptions:t.retry,error:n,retryAfter:e,computedValue:A.default({attemptCount:r,retryOptions:t.retry,error:n,retryAfter:e,computedValue:0})})}catch(e){void this._error(new RequestError(e.message,e,this));return}if(s){const t=async()=>{try{for(const e of this.options.hooks.beforeRetry){await e(this.options,n,r)}}catch(t){void this._error(new RequestError(t.message,e,this));return}if(this.destroyed){return}this.destroy();this.emit("retry",r,e)};this[K]=setTimeout(t,s);return}}void this._error(n)})()}_read(){this[H]=true;const e=this[R];if(e&&!this[U]){if(e.readableLength){this[H]=false}let t;while((t=e.read())!==null){this[F]+=t.length;this[W]=true;const e=this.downloadProgress;if(e.percent<1){this.emit("downloadProgress",e)}this.push(t)}}}_write(e,t,r){const n=()=>{this._writeRequest(e,t,r)};if(this.requestInitialized){n()}else{this[B].push(n)}}_writeRequest(e,t,r){if(this[P].destroyed){return}this._progressCallbacks.push(()=>{this[$]+=Buffer.byteLength(e,t);const r=this.uploadProgress;if(r.percent<1){this.emit("uploadProgress",r)}});this[P].write(e,t,e=>{if(!e&&this._progressCallbacks.length>0){this._progressCallbacks.shift()()}r(e)})}_final(e){const t=()=>{while(this._progressCallbacks.length!==0){this._progressCallbacks.shift()()}if(!(P in this)){e();return}if(this[P].destroyed){e();return}this[P].end(t=>{if(!t){this[L]=this[$];this.emit("uploadProgress",this.uploadProgress);this[P].emit("upload-complete")}e(t)})};if(this.requestInitialized){t()}else{this[B].push(t)}}_destroy(e,t){var r;this[U]=true;clearTimeout(this[K]);if(P in this){this[q]();if(!((r=this[R])===null||r===void 0?void 0:r.complete)){this[P].destroy()}}if(e!==null&&!m.default.undefined(e)&&!(e instanceof RequestError)){e=new RequestError(e.message,e,this)}t(e)}get _isAboutToError(){return this[U]}get ip(){var e;return(e=this.socket)===null||e===void 0?void 0:e.remoteAddress}get aborted(){var e,t,r;return((t=(e=this[P])===null||e===void 0?void 0:e.destroyed)!==null&&t!==void 0?t:this.destroyed)&&!((r=this[G])===null||r===void 0?void 0:r.complete)}get socket(){var e,t;return(t=(e=this[P])===null||e===void 0?void 0:e.socket)!==null&&t!==void 0?t:undefined}get downloadProgress(){let e;if(this[j]){e=this[F]/this[j]}else if(this[j]===this[F]){e=1}else{e=0}return{percent:e,transferred:this[F],total:this[j]}}get uploadProgress(){let e;if(this[L]){e=this[$]/this[L]}else if(this[L]===this[$]){e=1}else{e=0}return{percent:e,transferred:this[$],total:this[L]}}get timings(){var e;return(e=this[P])===null||e===void 0?void 0:e.timings}get isFromCache(){return this[M]}pipe(e,t){if(this[W]){throw new Error("Failed to pipe. The response has been emitted already.")}if(e instanceof c.ServerResponse){this[D].add(e)}return super.pipe(e,t)}unpipe(e){if(e instanceof c.ServerResponse){this[D].delete(e)}super.unpipe(e);return this}}t.default=Request},4993:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.dnsLookupIpVersionToFamily=t.isDnsLookupIpVersion=void 0;const r={auto:0,ipv4:4,ipv6:6};t.isDnsLookupIpVersion=(e=>{return e in r});t.dnsLookupIpVersionToFamily=(e=>{if(t.isDnsLookupIpVersion(e)){return r[e]}throw new Error("Invalid DNS lookup IP version")})},4564:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(5747);const i=r(1669);const s=r(7678);const o=r(40);const a=i.promisify(n.stat);t.default=(async(e,t)=>{if(t&&"content-length"in t){return Number(t["content-length"])}if(!e){return 0}if(s.default.string(e)){return Buffer.byteLength(e)}if(s.default.buffer(e)){return e.length}if(o.default(e)){return i.promisify(e.getLength.bind(e))()}if(e instanceof n.ReadStream){const{size:t}=await a(e.path);if(t===0){return undefined}return t}return undefined})},4500:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=async e=>{const t=[];let r=0;for await(const n of e){t.push(n);r+=Buffer.byteLength(n)}if(Buffer.isBuffer(t[0])){return Buffer.concat(t,r)}return Buffer.from(t.join(""))};t.default=r},40:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(7678);t.default=(e=>n.default.nodeStream(e)&&n.default.function_(e.getBoundary))},9298:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isResponseOk=void 0;t.isResponseOk=(e=>{const{statusCode:t}=e;const r=e.request.options.followRedirect?299:399;return t>=200&&t<=r||t===304})},9219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(8835);const i=["protocol","host","hostname","port","pathname","search"];t.default=((e,t)=>{var r,s;if(t.path){if(t.pathname){throw new TypeError("Parameters `path` and `pathname` are mutually exclusive.")}if(t.search){throw new TypeError("Parameters `path` and `search` are mutually exclusive.")}if(t.searchParams){throw new TypeError("Parameters `path` and `searchParams` are mutually exclusive.")}}if(t.search&&t.searchParams){throw new TypeError("Parameters `search` and `searchParams` are mutually exclusive.")}if(!e){if(!t.protocol){throw new TypeError("No URL protocol specified")}e=`${t.protocol}//${(s=(r=t.hostname)!==null&&r!==void 0?r:t.host)!==null&&s!==void 0?s:""}`}const o=new n.URL(e);if(t.path){const e=t.path.indexOf("?");if(e===-1){t.pathname=t.path}else{t.pathname=t.path.slice(0,e);t.search=t.path.slice(e+1)}delete t.path}for(const e of i){if(t[e]){o[e]=t[e].toString()}}return o})},3021:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});function default_1(e,t,r){const n={};for(const i of r){n[i]=((...e)=>{t.emit(i,...e)});e.on(i,n[i])}return()=>{for(const t of r){e.off(t,n[t])}}}t.default=default_1},2454:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TimeoutError=void 0;const n=r(1631);const i=r(1593);const s=Symbol("reentry");const o=()=>{};class TimeoutError extends Error{constructor(e,t){super(`Timeout awaiting '${t}' for ${e}ms`);this.event=t;this.name="TimeoutError";this.code="ETIMEDOUT"}}t.TimeoutError=TimeoutError;t.default=((e,t,r)=>{if(s in e){return o}e[s]=true;const a=[];const{once:c,unhandleAll:u}=i.default();const l=(e,t,r)=>{var n;const i=setTimeout(t,e,e,r);(n=i.unref)===null||n===void 0?void 0:n.call(i);const s=()=>{clearTimeout(i)};a.push(s);return s};const{host:f,hostname:h}=r;const d=(t,r)=>{e.destroy(new TimeoutError(t,r))};const p=()=>{for(const e of a){e()}u()};e.once("error",t=>{p();if(e.listenerCount("error")===0){throw t}});e.once("close",p);c(e,"response",e=>{c(e,"end",p)});if(typeof t.request!=="undefined"){l(t.request,d,"request")}if(typeof t.socket!=="undefined"){const r=()=>{d(t.socket,"socket")};e.setTimeout(t.socket,r);a.push(()=>{e.removeListener("timeout",r)})}c(e,"socket",i=>{var s;const{socketPath:o}=e;if(i.connecting){const e=Boolean(o!==null&&o!==void 0?o:n.isIP((s=h!==null&&h!==void 0?h:f)!==null&&s!==void 0?s:"")!==0);if(typeof t.lookup!=="undefined"&&!e&&typeof i.address().address==="undefined"){const e=l(t.lookup,d,"lookup");c(i,"lookup",e)}if(typeof t.connect!=="undefined"){const r=()=>l(t.connect,d,"connect");if(e){c(i,"connect",r())}else{c(i,"lookup",e=>{if(e===null){c(i,"connect",r())}})}}if(typeof t.secureConnect!=="undefined"&&r.protocol==="https:"){c(i,"connect",()=>{const e=l(t.secureConnect,d,"secureConnect");c(i,"secureConnect",e)})}}if(typeof t.send!=="undefined"){const r=()=>l(t.send,d,"send");if(i.connecting){c(i,"connect",()=>{c(e,"upload-complete",r())})}else{c(e,"upload-complete",r())}}});if(typeof t.response!=="undefined"){c(e,"upload-complete",()=>{const r=l(t.response,d,"response");c(e,"response",r)})}return p})},1593:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=(()=>{const e=[];return{once(t,r,n){t.once(r,n);e.push({origin:t,event:r,fn:n})},unhandleAll(){for(const t of e){const{origin:e,event:r,fn:n}=t;e.removeListener(r,n)}e.length=0}}})},8026:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(7678);t.default=(e=>{e=e;const t={protocol:e.protocol,hostname:n.default.string(e.hostname)&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,host:e.host,hash:e.hash,search:e.search,pathname:e.pathname,href:e.href,path:`${e.pathname||""}${e.search||""}`};if(n.default.string(e.port)&&e.port.length>0){t.port=Number(e.port)}if(e.username||e.password){t.auth=`${e.username||""}:${e.password||""}`}return t})},7288:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});class WeakableMap{constructor(){this.weakMap=new WeakMap;this.map=new Map}set(e,t){if(typeof e==="object"){this.weakMap.set(e,t)}else{this.map.set(e,t)}}get(e){if(typeof e==="object"){return this.weakMap.get(e)}return this.map.get(e)}has(e){if(typeof e==="object"){return this.weakMap.has(e)}return this.map.has(e)}}t.default=WeakableMap},4337:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});t.defaultHandler=void 0;const s=r(7678);const o=r(6056);const a=r(6457);const c=r(94);const u=r(285);const l={RequestError:o.RequestError,CacheError:o.CacheError,ReadError:o.ReadError,HTTPError:o.HTTPError,MaxRedirectsError:o.MaxRedirectsError,TimeoutError:o.TimeoutError,ParseError:o.ParseError,CancelError:o.CancelError,UnsupportedProtocolError:o.UnsupportedProtocolError,UploadError:o.UploadError};const f=async e=>new Promise(t=>{setTimeout(t,e)});const{normalizeArguments:h}=c.default;const d=(...e)=>{let t;for(const r of e){t=h(undefined,r,t)}return t};const p=e=>e.isStream?new c.default(undefined,e):o.default(e);const y=e=>"defaults"in e&&"options"in e.defaults;const m=["get","post","put","patch","head","delete"];t.defaultHandler=((e,t)=>t(e));const g=(e,t)=>{if(e){for(const r of e){r(t)}}};const v=e=>{e._rawHandlers=e.handlers;e.handlers=e.handlers.map(e=>(t,r)=>{let n;const i=e(t,e=>{n=r(e);return n});if(i!==n&&!t.isStream&&n){const e=i;const{then:t,catch:r,finally:s}=e;Object.setPrototypeOf(e,Object.getPrototypeOf(n));Object.defineProperties(e,Object.getOwnPropertyDescriptors(n));e.then=t;e.catch=r;e.finally=s}return i});const r=(t,r={},n)=>{var i,u;let l=0;const f=t=>{return e.handlers[l++](t,l===e.handlers.length?p:f)};if(s.default.plainObject(t)){const e={...t,...r};c.setNonEnumerableProperties([t,r],e);r=e;t=undefined}try{let s;try{g(e.options.hooks.init,r);g((i=r.hooks)===null||i===void 0?void 0:i.init,r)}catch(e){s=e}const l=h(t,r,n!==null&&n!==void 0?n:e.options);l[c.kIsNormalizedAlready]=true;if(s){throw new o.RequestError(s.message,s,l)}return f(l)}catch(t){if(r.isStream){throw t}else{return a.default(t,e.options.hooks.beforeError,(u=r.hooks)===null||u===void 0?void 0:u.beforeError)}}};r.extend=((...r)=>{const n=[e.options];let i=[...e._rawHandlers];let s;for(const e of r){if(y(e)){n.push(e.defaults.options);i.push(...e.defaults._rawHandlers);s=e.defaults.mutableDefaults}else{n.push(e);if("handlers"in e){i.push(...e.handlers)}s=e.mutableDefaults}}i=i.filter(e=>e!==t.defaultHandler);if(i.length===0){i.push(t.defaultHandler)}return v({options:d(...n),handlers:i,mutableDefaults:Boolean(s)})});const n=async function*(t,n){let i=h(t,n,e.options);i.resolveBodyOnly=false;const o=i.pagination;if(!s.default.object(o)){throw new TypeError("`options.pagination` must be implemented")}const a=[];let{countLimit:c}=o;let u=0;while(u{const r=[];for await(const i of n(e,t)){r.push(i)}return r});r.paginate.each=n;r.stream=((e,t)=>r(e,{...t,isStream:true}));for(const e of m){r[e]=((t,n)=>r(t,{...n,method:e}));r.stream[e]=((t,n)=>{return r(t,{...n,method:e,isStream:true})})}Object.assign(r,l);Object.defineProperty(r,"defaults",{value:e.mutableDefaults?e:u.default(e),writable:e.mutableDefaults,configurable:e.mutableDefaults,enumerable:true});r.mergeOptions=d;return r};t.default=v;i(r(2613),t)},3061:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=this&&this.__exportStar||function(e,t){for(var r in e)if(r!=="default"&&!Object.prototype.hasOwnProperty.call(t,r))n(t,e,r)};Object.defineProperty(t,"__esModule",{value:true});const s=r(8835);const o=r(4337);const a={options:{method:"GET",retry:{limit:2,methods:["GET","PUT","HEAD","DELETE","OPTIONS","TRACE"],statusCodes:[408,413,429,500,502,503,504,521,522,524],errorCodes:["ETIMEDOUT","ECONNRESET","EADDRINUSE","ECONNREFUSED","EPIPE","ENOTFOUND","ENETUNREACH","EAI_AGAIN"],maxRetryAfter:undefined,calculateDelay:({computedValue:e})=>e},timeout:{},headers:{"user-agent":"got (https://github.com/sindresorhus/got)"},hooks:{init:[],beforeRequest:[],beforeRedirect:[],beforeRetry:[],beforeError:[],afterResponse:[]},cache:undefined,dnsCache:undefined,decompress:true,throwHttpErrors:true,followRedirect:true,isStream:false,responseType:"text",resolveBodyOnly:false,maxRedirects:10,prefixUrl:"",methodRewriting:true,ignoreInvalidCookies:false,context:{},http2:false,allowGetBody:false,https:undefined,pagination:{transform:e=>{if(e.request.options.responseType==="json"){return e.body}return JSON.parse(e.body)},paginate:e=>{if(!Reflect.has(e.headers,"link")){return false}const t=e.headers.link.split(",");let r;for(const e of t){const t=e.split(";");if(t[1].includes("next")){r=t[0].trimStart().trim();r=r.slice(1,-1);break}}if(r){const e={url:new s.URL(r)};return e}return false},filter:()=>true,shouldContinue:()=>true,countLimit:Infinity,backoff:0,requestLimit:1e4,stackAllItems:true},parseJson:e=>JSON.parse(e),stringifyJson:e=>JSON.stringify(e),cacheOptions:{}},handlers:[o.defaultHandler],mutableDefaults:false};const c=o.default(a);t.default=c;e.exports=c;e.exports.default=c;e.exports.__esModule=true;i(r(4337),t);i(r(6056),t)},2613:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},285:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(7678);function deepFreeze(e){for(const t of Object.values(e)){if(n.default.plainObject(t)||n.default.array(t)){deepFreeze(t)}}return Object.freeze(e)}t.default=deepFreeze},397:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const r=new Set;t.default=(e=>{if(r.has(e)){return}r.add(e);process.emitWarning(`Got: ${e}`,{type:"DeprecationWarning"})})},7356:e=>{"use strict";e.exports=clone;var t=Object.getPrototypeOf||function(e){return e.__proto__};function clone(e){if(e===null||typeof e!=="object")return e;if(e instanceof Object)var r={__proto__:t(e)};else var r=Object.create(null);Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(e,t))});return r}},7758:(e,t,r)=>{var n=r(5747);var i=r(263);var s=r(3086);var o=r(7356);var a=r(1669);var c;var u;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){c=Symbol.for("graceful-fs.queue");u=Symbol.for("graceful-fs.previous")}else{c="___graceful-fs.queue";u="___graceful-fs.previous"}function noop(){}function publishQueue(e,t){Object.defineProperty(e,c,{get:function(){return t}})}var l=noop;if(a.debuglog)l=a.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))l=function(){var e=a.format.apply(a,arguments);e="GFS4: "+e.split(/\n/).join("\nGFS4: ");console.error(e)};if(!n[c]){var f=global[c]||[];publishQueue(n,f);n.close=function(e){function close(t,r){return e.call(n,t,function(e){if(!e){resetQueue()}if(typeof r==="function")r.apply(this,arguments)})}Object.defineProperty(close,u,{value:e});return close}(n.close);n.closeSync=function(e){function closeSync(t){e.apply(n,arguments);resetQueue()}Object.defineProperty(closeSync,u,{value:e});return closeSync}(n.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",function(){l(n[c]);r(2357).equal(n[c].length,0)})}}if(!global[c]){publishQueue(global,n[c])}e.exports=patch(o(n));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!n.__patched){e.exports=patch(n);n.__patched=true}function patch(e){i(e);e.gracefulify=patch;e.createReadStream=createReadStream;e.createWriteStream=createWriteStream;var t=e.readFile;e.readFile=readFile;function readFile(e,r,n){if(typeof r==="function")n=r,r=null;return go$readFile(e,r,n);function go$readFile(e,r,n,i){return t(e,r,function(t){if(t&&(t.code==="EMFILE"||t.code==="ENFILE"))enqueue([go$readFile,[e,r,n],t,i||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}})}}var r=e.writeFile;e.writeFile=writeFile;function writeFile(e,t,n,i){if(typeof n==="function")i=n,n=null;return go$writeFile(e,t,n,i);function go$writeFile(e,t,n,i,s){return r(e,t,n,function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$writeFile,[e,t,n,i],r,s||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}})}}var n=e.appendFile;if(n)e.appendFile=appendFile;function appendFile(e,t,r,i){if(typeof r==="function")i=r,r=null;return go$appendFile(e,t,r,i);function go$appendFile(e,t,r,i,s){return n(e,t,r,function(n){if(n&&(n.code==="EMFILE"||n.code==="ENFILE"))enqueue([go$appendFile,[e,t,r,i],n,s||Date.now(),Date.now()]);else{if(typeof i==="function")i.apply(this,arguments)}})}}var o=e.copyFile;if(o)e.copyFile=copyFile;function copyFile(e,t,r,n){if(typeof r==="function"){n=r;r=0}return go$copyFile(e,t,r,n);function go$copyFile(e,t,r,n,i){return o(e,t,r,function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$copyFile,[e,t,r,n],s,i||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}})}}var a=e.readdir;e.readdir=readdir;function readdir(e,t,r){if(typeof t==="function")r=t,t=null;return go$readdir(e,t,r);function go$readdir(e,t,r,n){return a(e,t,function(i,s){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$readdir,[e,t,r],i,n||Date.now(),Date.now()]);else{if(s&&s.sort)s.sort();if(typeof r==="function")r.call(this,i,s)}})}}if(process.version.substr(0,4)==="v0.8"){var c=s(e);ReadStream=c.ReadStream;WriteStream=c.WriteStream}var u=e.ReadStream;if(u){ReadStream.prototype=Object.create(u.prototype);ReadStream.prototype.open=ReadStream$open}var l=e.WriteStream;if(l){WriteStream.prototype=Object.create(l.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(e,"ReadStream",{get:function(){return ReadStream},set:function(e){ReadStream=e},enumerable:true,configurable:true});Object.defineProperty(e,"WriteStream",{get:function(){return WriteStream},set:function(e){WriteStream=e},enumerable:true,configurable:true});var f=ReadStream;Object.defineProperty(e,"FileReadStream",{get:function(){return f},set:function(e){f=e},enumerable:true,configurable:true});var h=WriteStream;Object.defineProperty(e,"FileWriteStream",{get:function(){return h},set:function(e){h=e},enumerable:true,configurable:true});function ReadStream(e,t){if(this instanceof ReadStream)return u.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var e=this;open(e.path,e.flags,e.mode,function(t,r){if(t){if(e.autoClose)e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r);e.read()}})}function WriteStream(e,t){if(this instanceof WriteStream)return l.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var e=this;open(e.path,e.flags,e.mode,function(t,r){if(t){e.destroy();e.emit("error",t)}else{e.fd=r;e.emit("open",r)}})}function createReadStream(t,r){return new e.ReadStream(t,r)}function createWriteStream(t,r){return new e.WriteStream(t,r)}var d=e.open;e.open=open;function open(e,t,r,n){if(typeof r==="function")n=r,r=null;return go$open(e,t,r,n);function go$open(e,t,r,n,i){return d(e,t,r,function(s,o){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$open,[e,t,r,n],s,i||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}})}}return e}function enqueue(e){l("ENQUEUE",e[0].name,e[1]);n[c].push(e);retry()}var h;function resetQueue(){var e=Date.now();for(var t=0;t2){n[c][t][3]=e;n[c][t][4]=e}}retry()}function retry(){clearTimeout(h);h=undefined;if(n[c].length===0)return;var e=n[c].shift();var t=e[0];var r=e[1];var i=e[2];var s=e[3];var o=e[4];if(s===undefined){l("RETRY",t.name,r);t.apply(null,r)}else if(Date.now()-s>=6e4){l("TIMEOUT",t.name,r);var a=r.pop();if(typeof a==="function")a.call(null,i)}else{var u=Date.now()-o;var f=Math.max(o-s,1);var d=Math.min(f*1.2,100);if(u>=d){l("RETRY",t.name,r);t.apply(null,r.concat([s]))}else{n[c].push(e)}}if(h===undefined){h=setTimeout(retry,0)}}},3086:(e,t,r)=>{var n=r(2413).Stream;e.exports=legacy;function legacy(e){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(t,r){if(!(this instanceof ReadStream))return new ReadStream(t,r);n.call(this);var i=this;this.path=t;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;r=r||{};var s=Object.keys(r);for(var o=0,a=s.length;othis.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick(function(){i._read()});return}e.open(this.path,this.flags,this.mode,function(e,t){if(e){i.emit("error",e);i.readable=false;return}i.fd=t;i.emit("open",t);i._read()})}function WriteStream(t,r){if(!(this instanceof WriteStream))return new WriteStream(t,r);n.call(this);this.path=t;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;r=r||{};var i=Object.keys(r);for(var s=0,o=i.length;s= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=e.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},263:(e,t,r)=>{var n=r(7619);var i=process.cwd;var s=null;var o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!s)s=i.call(process);return s};try{process.cwd()}catch(e){}if(typeof process.chdir==="function"){var a=process.chdir;process.chdir=function(e){s=null;a.call(process,e)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,a)}e.exports=patch;function patch(e){if(n.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(e)}if(!e.lutimes){patchLutimes(e)}e.chown=chownFix(e.chown);e.fchown=chownFix(e.fchown);e.lchown=chownFix(e.lchown);e.chmod=chmodFix(e.chmod);e.fchmod=chmodFix(e.fchmod);e.lchmod=chmodFix(e.lchmod);e.chownSync=chownFixSync(e.chownSync);e.fchownSync=chownFixSync(e.fchownSync);e.lchownSync=chownFixSync(e.lchownSync);e.chmodSync=chmodFixSync(e.chmodSync);e.fchmodSync=chmodFixSync(e.fchmodSync);e.lchmodSync=chmodFixSync(e.lchmodSync);e.stat=statFix(e.stat);e.fstat=statFix(e.fstat);e.lstat=statFix(e.lstat);e.statSync=statFixSync(e.statSync);e.fstatSync=statFixSync(e.fstatSync);e.lstatSync=statFixSync(e.lstatSync);if(!e.lchmod){e.lchmod=function(e,t,r){if(r)process.nextTick(r)};e.lchmodSync=function(){}}if(!e.lchown){e.lchown=function(e,t,r,n){if(n)process.nextTick(n)};e.lchownSync=function(){}}if(o==="win32"){e.rename=function(t){return function(r,n,i){var s=Date.now();var o=0;t(r,n,function CB(a){if(a&&(a.code==="EACCES"||a.code==="EPERM")&&Date.now()-s<6e4){setTimeout(function(){e.stat(n,function(e,s){if(e&&e.code==="ENOENT")t(r,n,CB);else i(a)})},o);if(o<100)o+=10;return}if(i)i(a)})}}(e.rename)}e.read=function(t){function read(r,n,i,s,o,a){var c;if(a&&typeof a==="function"){var u=0;c=function(l,f,h){if(l&&l.code==="EAGAIN"&&u<10){u++;return t.call(e,r,n,i,s,o,c)}a.apply(this,arguments)}}return t.call(e,r,n,i,s,o,c)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,t);return read}(e.read);e.readSync=function(t){return function(r,n,i,s,o){var a=0;while(true){try{return t.call(e,r,n,i,s,o)}catch(e){if(e.code==="EAGAIN"&&a<10){a++;continue}throw e}}}}(e.readSync);function patchLchmod(e){e.lchmod=function(t,r,i){e.open(t,n.O_WRONLY|n.O_SYMLINK,r,function(t,n){if(t){if(i)i(t);return}e.fchmod(n,r,function(t){e.close(n,function(e){if(i)i(t||e)})})})};e.lchmodSync=function(t,r){var i=e.openSync(t,n.O_WRONLY|n.O_SYMLINK,r);var s=true;var o;try{o=e.fchmodSync(i,r);s=false}finally{if(s){try{e.closeSync(i)}catch(e){}}else{e.closeSync(i)}}return o}}function patchLutimes(e){if(n.hasOwnProperty("O_SYMLINK")){e.lutimes=function(t,r,i,s){e.open(t,n.O_SYMLINK,function(t,n){if(t){if(s)s(t);return}e.futimes(n,r,i,function(t){e.close(n,function(e){if(s)s(t||e)})})})};e.lutimesSync=function(t,r,i){var s=e.openSync(t,n.O_SYMLINK);var o;var a=true;try{o=e.futimesSync(s,r,i);a=false}finally{if(a){try{e.closeSync(s)}catch(e){}}else{e.closeSync(s)}}return o}}else{e.lutimes=function(e,t,r,n){if(n)process.nextTick(n)};e.lutimesSync=function(){}}}function chmodFix(t){if(!t)return t;return function(r,n,i){return t.call(e,r,n,function(e){if(chownErOk(e))e=null;if(i)i.apply(this,arguments)})}}function chmodFixSync(t){if(!t)return t;return function(r,n){try{return t.call(e,r,n)}catch(e){if(!chownErOk(e))throw e}}}function chownFix(t){if(!t)return t;return function(r,n,i,s){return t.call(e,r,n,i,function(e){if(chownErOk(e))e=null;if(s)s.apply(this,arguments)})}}function chownFixSync(t){if(!t)return t;return function(r,n,i){try{return t.call(e,r,n,i)}catch(e){if(!chownErOk(e))throw e}}}function statFix(t){if(!t)return t;return function(r,n,i){if(typeof n==="function"){i=n;n=null}function callback(e,t){if(t){if(t.uid<0)t.uid+=4294967296;if(t.gid<0)t.gid+=4294967296}if(i)i.apply(this,arguments)}return n?t.call(e,r,n,callback):t.call(e,r,callback)}}function statFixSync(t){if(!t)return t;return function(r,n){var i=n?t.call(e,r,n):t.call(e,r);if(i.uid<0)i.uid+=4294967296;if(i.gid<0)i.gid+=4294967296;return i}}function chownErOk(e){if(!e)return true;if(e.code==="ENOSYS")return true;var t=!process.getuid||process.getuid()!==0;if(t){if(e.code==="EINVAL"||e.code==="EPERM")return true}return false}}},1621:e=>{"use strict";e.exports=((e,t)=>{t=t||process.argv;const r=e.startsWith("-")?"":e.length===1?"-":"--";const n=t.indexOf(r+e);const i=t.indexOf("--");return n!==-1&&(i===-1?true:n{"use strict";const t=new Set([200,203,204,206,300,301,404,405,410,414,501]);const r=new Set([200,203,204,300,301,302,303,307,308,404,405,410,414,501]);const n=new Set([500,502,503,504]);const i={date:true,connection:true,"keep-alive":true,"proxy-authenticate":true,"proxy-authorization":true,te:true,trailer:true,"transfer-encoding":true,upgrade:true};const s={"content-length":true,"content-encoding":true,"transfer-encoding":true,"content-range":true};function toNumberOrZero(e){const t=parseInt(e,10);return isFinite(t)?t:0}function isErrorResponse(e){if(!e){return true}return n.has(e.status)}function parseCacheControl(e){const t={};if(!e)return t;const r=e.trim().split(/\s*,\s*/);for(const e of r){const[r,n]=e.split(/\s*=\s*/,2);t[r]=n===undefined?true:n.replace(/^"|"$/g,"")}return t}function formatCacheControl(e){let t=[];for(const r in e){const n=e[r];t.push(n===true?r:r+"="+n)}if(!t.length){return undefined}return t.join(", ")}e.exports=class CachePolicy{constructor(e,t,{shared:r,cacheHeuristic:n,immutableMinTimeToLive:i,ignoreCargoCult:s,_fromObject:o}={}){if(o){this._fromObject(o);return}if(!t||!t.headers){throw Error("Response headers missing")}this._assertRequestHasHeaders(e);this._responseTime=this.now();this._isShared=r!==false;this._cacheHeuristic=undefined!==n?n:.1;this._immutableMinTtl=undefined!==i?i:24*3600*1e3;this._status="status"in t?t.status:200;this._resHeaders=t.headers;this._rescc=parseCacheControl(t.headers["cache-control"]);this._method="method"in e?e.method:"GET";this._url=e.url;this._host=e.headers.host;this._noAuthorization=!e.headers.authorization;this._reqHeaders=t.headers.vary?e.headers:null;this._reqcc=parseCacheControl(e.headers["cache-control"]);if(s&&"pre-check"in this._rescc&&"post-check"in this._rescc){delete this._rescc["pre-check"];delete this._rescc["post-check"];delete this._rescc["no-cache"];delete this._rescc["no-store"];delete this._rescc["must-revalidate"];this._resHeaders=Object.assign({},this._resHeaders,{"cache-control":formatCacheControl(this._rescc)});delete this._resHeaders.expires;delete this._resHeaders.pragma}if(t.headers["cache-control"]==null&&/no-cache/.test(t.headers.pragma)){this._rescc["no-cache"]=true}}now(){return Date.now()}storable(){return!!(!this._reqcc["no-store"]&&("GET"===this._method||"HEAD"===this._method||"POST"===this._method&&this._hasExplicitExpiration())&&r.has(this._status)&&!this._rescc["no-store"]&&(!this._isShared||!this._rescc.private)&&(!this._isShared||this._noAuthorization||this._allowsStoringAuthenticated())&&(this._resHeaders.expires||this._rescc["max-age"]||this._isShared&&this._rescc["s-maxage"]||this._rescc.public||t.has(this._status)))}_hasExplicitExpiration(){return this._isShared&&this._rescc["s-maxage"]||this._rescc["max-age"]||this._resHeaders.expires}_assertRequestHasHeaders(e){if(!e||!e.headers){throw Error("Request headers missing")}}satisfiesWithoutRevalidation(e){this._assertRequestHasHeaders(e);const t=parseCacheControl(e.headers["cache-control"]);if(t["no-cache"]||/no-cache/.test(e.headers.pragma)){return false}if(t["max-age"]&&this.age()>t["max-age"]){return false}if(t["min-fresh"]&&this.timeToLive()<1e3*t["min-fresh"]){return false}if(this.stale()){const e=t["max-stale"]&&!this._rescc["must-revalidate"]&&(true===t["max-stale"]||t["max-stale"]>this.age()-this.maxAge());if(!e){return false}}return this._requestMatches(e,false)}_requestMatches(e,t){return(!this._url||this._url===e.url)&&this._host===e.headers.host&&(!e.method||this._method===e.method||t&&"HEAD"===e.method)&&this._varyMatches(e)}_allowsStoringAuthenticated(){return this._rescc["must-revalidate"]||this._rescc.public||this._rescc["s-maxage"]}_varyMatches(e){if(!this._resHeaders.vary){return true}if(this._resHeaders.vary==="*"){return false}const t=this._resHeaders.vary.trim().toLowerCase().split(/\s*,\s*/);for(const r of t){if(e.headers[r]!==this._reqHeaders[r])return false}return true}_copyWithoutHopByHopHeaders(e){const t={};for(const r in e){if(i[r])continue;t[r]=e[r]}if(e.connection){const r=e.connection.trim().split(/\s*,\s*/);for(const e of r){delete t[e]}}if(t.warning){const e=t.warning.split(/,/).filter(e=>{return!/^\s*1[0-9][0-9]/.test(e)});if(!e.length){delete t.warning}else{t.warning=e.join(",").trim()}}return t}responseHeaders(){const e=this._copyWithoutHopByHopHeaders(this._resHeaders);const t=this.age();if(t>3600*24&&!this._hasExplicitExpiration()&&this.maxAge()>3600*24){e.warning=(e.warning?`${e.warning}, `:"")+'113 - "rfc7234 5.5.4"'}e.age=`${Math.round(t)}`;e.date=new Date(this.now()).toUTCString();return e}date(){const e=Date.parse(this._resHeaders.date);if(isFinite(e)){return e}return this._responseTime}age(){let e=this._ageValue();const t=(this.now()-this._responseTime)/1e3;return e+t}_ageValue(){return toNumberOrZero(this._resHeaders.age)}maxAge(){if(!this.storable()||this._rescc["no-cache"]){return 0}if(this._isShared&&(this._resHeaders["set-cookie"]&&!this._rescc.public&&!this._rescc.immutable)){return 0}if(this._resHeaders.vary==="*"){return 0}if(this._isShared){if(this._rescc["proxy-revalidate"]){return 0}if(this._rescc["s-maxage"]){return toNumberOrZero(this._rescc["s-maxage"])}}if(this._rescc["max-age"]){return toNumberOrZero(this._rescc["max-age"])}const e=this._rescc.immutable?this._immutableMinTtl:0;const t=this.date();if(this._resHeaders.expires){const r=Date.parse(this._resHeaders.expires);if(Number.isNaN(r)||rr){return Math.max(e,(t-r)/1e3*this._cacheHeuristic)}}return e}timeToLive(){const e=this.maxAge()-this.age();const t=e+toNumberOrZero(this._rescc["stale-if-error"]);const r=e+toNumberOrZero(this._rescc["stale-while-revalidate"]);return Math.max(0,e,t,r)*1e3}stale(){return this.maxAge()<=this.age()}_useStaleIfError(){return this.maxAge()+toNumberOrZero(this._rescc["stale-if-error"])>this.age()}useStaleWhileRevalidate(){return this.maxAge()+toNumberOrZero(this._rescc["stale-while-revalidate"])>this.age()}static fromObject(e){return new this(undefined,undefined,{_fromObject:e})}_fromObject(e){if(this._responseTime)throw Error("Reinitialized");if(!e||e.v!==1)throw Error("Invalid serialization");this._responseTime=e.t;this._isShared=e.sh;this._cacheHeuristic=e.ch;this._immutableMinTtl=e.imm!==undefined?e.imm:24*3600*1e3;this._status=e.st;this._resHeaders=e.resh;this._rescc=e.rescc;this._method=e.m;this._url=e.u;this._host=e.h;this._noAuthorization=e.a;this._reqHeaders=e.reqh;this._reqcc=e.reqcc}toObject(){return{v:1,t:this._responseTime,sh:this._isShared,ch:this._cacheHeuristic,imm:this._immutableMinTtl,st:this._status,resh:this._resHeaders,rescc:this._rescc,m:this._method,u:this._url,h:this._host,a:this._noAuthorization,reqh:this._reqHeaders,reqcc:this._reqcc}}revalidationHeaders(e){this._assertRequestHasHeaders(e);const t=this._copyWithoutHopByHopHeaders(e.headers);delete t["if-range"];if(!this._requestMatches(e,true)||!this.storable()){delete t["if-none-match"];delete t["if-modified-since"];return t}if(this._resHeaders.etag){t["if-none-match"]=t["if-none-match"]?`${t["if-none-match"]}, ${this._resHeaders.etag}`:this._resHeaders.etag}const r=t["accept-ranges"]||t["if-match"]||t["if-unmodified-since"]||this._method&&this._method!="GET";if(r){delete t["if-modified-since"];if(t["if-none-match"]){const e=t["if-none-match"].split(/,/).filter(e=>{return!/^\s*W\//.test(e)});if(!e.length){delete t["if-none-match"]}else{t["if-none-match"]=e.join(",").trim()}}}else if(this._resHeaders["last-modified"]&&!t["if-modified-since"]){t["if-modified-since"]=this._resHeaders["last-modified"]}return t}revalidatedPolicy(e,t){this._assertRequestHasHeaders(e);if(this._useStaleIfError()&&isErrorResponse(t)){return{modified:false,matches:false,policy:this}}if(!t||!t.headers){throw Error("Response headers missing")}let r=false;if(t.status!==undefined&&t.status!=304){r=false}else if(t.headers.etag&&!/^\s*W\//.test(t.headers.etag)){r=this._resHeaders.etag&&this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag}else if(this._resHeaders.etag&&t.headers.etag){r=this._resHeaders.etag.replace(/^\s*W\//,"")===t.headers.etag.replace(/^\s*W\//,"")}else if(this._resHeaders["last-modified"]){r=this._resHeaders["last-modified"]===t.headers["last-modified"]}else{if(!this._resHeaders.etag&&!this._resHeaders["last-modified"]&&!t.headers.etag&&!t.headers["last-modified"]){r=true}}if(!r){return{policy:new this.constructor(e,t),modified:t.status!=304,matches:false}}const n={};for(const e in this._resHeaders){n[e]=e in t.headers&&!s[e]?t.headers[e]:this._resHeaders[e]}const i=Object.assign({},t,{status:this._status,method:this._method,headers:n});return{policy:new this.constructor(e,i,{shared:this._isShared,cacheHeuristic:this._cacheHeuristic,immutableMinTimeToLive:this._immutableMinTtl}),modified:false,matches:true}}}},9898:(e,t,r)=>{"use strict";const n=r(8614);const i=r(4016);const s=r(7565);const o=r(9273);const a=Symbol("currentStreamsCount");const c=Symbol("request");const u=Symbol("cachedOriginSet");const l=Symbol("gracefullyClosing");const f=["maxDeflateDynamicTableSize","maxSessionMemory","maxHeaderListPairs","maxOutstandingPings","maxReservedRemoteStreams","maxSendHeaderBlockLength","paddingStrategy","localAddress","path","rejectUnauthorized","minDHSize","ca","cert","clientCertEngine","ciphers","key","pfx","servername","minVersion","maxVersion","secureProtocol","crl","honorCipherOrder","ecdhCurve","dhparam","secureOptions","sessionIdContext"];const h=(e,t,r)=>{let n=0;let i=e.length;while(n>>1;if(r(e[s],t)){n=s+1}else{i=s}}return n};const d=(e,t)=>{return e.remoteSettings.maxConcurrentStreams>t.remoteSettings.maxConcurrentStreams};const p=(e,t)=>{for(const r of e){if(r[u].lengtht[u].includes(e))&&r[a]+t[a]<=t.remoteSettings.maxConcurrentStreams){g(r)}}};const y=(e,t)=>{for(const r of e){if(t[u].lengthr[u].includes(e))&&t[a]+r[a]<=r.remoteSettings.maxConcurrentStreams){g(t)}}};const m=({agent:e,isFree:t})=>{const r={};for(const n in e.sessions){const i=e.sessions[n];const s=i.filter(e=>{const r=e[Agent.kCurrentStreamsCount]{e[l]=true;if(e[a]===0){e.close()}};class Agent extends n{constructor({timeout:e=6e4,maxSessions:t=Infinity,maxFreeSessions:r=10,maxCachedTlsSessions:n=100}={}){super();this.sessions={};this.queue={};this.timeout=e;this.maxSessions=t;this.maxFreeSessions=r;this._freeSessionsCount=0;this._sessionsCount=0;this.settings={enablePush:false};this.tlsSessionCache=new o({maxSize:n})}static normalizeOrigin(e,t){if(typeof e==="string"){e=new URL(e)}if(t&&e.hostname!==t){e.hostname=t}return e.origin}normalizeOptions(e){let t="";if(e){for(const r of f){if(e[r]){t+=`:${e[r]}`}}}return t}_tryToCreateNewSession(e,t){if(!(e in this.queue)||!(t in this.queue[e])){return}const r=this.queue[e][t];if(this._sessionsCount{if(Array.isArray(r)){r=[...r];n()}else{r=[{resolve:n,reject:i}]}const o=this.normalizeOptions(t);const f=Agent.normalizeOrigin(e,t&&t.servername);if(f===undefined){for(const{reject:e}of r){e(new TypeError("The `origin` argument needs to be a string or an URL object"))}return}if(o in this.sessions){const e=this.sessions[o];let t=-1;let n=-1;let i;for(const r of e){const e=r.remoteSettings.maxConcurrentStreams;if(e=e||r[l]||r.destroyed){continue}if(!i){t=e}if(s>n){i=r;n=s}}}if(i){if(r.length!==1){for(const{reject:e}of r){const t=new Error(`Expected the length of listeners to be 1, got ${r.length}.\n`+"Please report this to https://github.com/szmarczak/http2-wrapper/");e(t)}return}r[0].resolve(i);return}}if(o in this.queue){if(f in this.queue[o]){this.queue[o][f].listeners.push(...r);this._tryToCreateNewSession(o,f);return}}else{this.queue[o]={}}const m=()=>{if(o in this.queue&&this.queue[o][f]===g){delete this.queue[o][f];if(Object.keys(this.queue[o]).length===0){delete this.queue[o]}}};const g=()=>{const n=`${f}:${o}`;let i=false;try{const v=s.connect(e,{createConnection:this.createConnection,settings:this.settings,session:this.tlsSessionCache.get(n),...t});v[a]=0;v[l]=false;const b=()=>v[a]{this.tlsSessionCache.set(n,e)});v.once("error",e=>{for(const{reject:t}of r){t(e)}this.tlsSessionCache.delete(n)});v.setTimeout(this.timeout,()=>{v.destroy()});v.once("close",()=>{if(i){if(w){this._freeSessionsCount--}this._sessionsCount--;const e=this.sessions[o];e.splice(e.indexOf(v),1);if(e.length===0){delete this.sessions[o]}}else{const e=new Error("Session closed without receiving a SETTINGS frame");e.code="HTTP2WRAPPER_NOSETTINGS";for(const{reject:t}of r){t(e)}m()}this._tryToCreateNewSession(o,f)});const _=()=>{if(!(o in this.queue)||!b()){return}for(const e of v[u]){if(e in this.queue[o]){const{listeners:t}=this.queue[o][e];while(t.length!==0&&b()){t.shift().resolve(v)}const r=this.queue[o];if(r[e].listeners.length===0){delete r[e];if(Object.keys(r).length===0){delete this.queue[o];break}}if(!b()){break}}}};v.on("origin",()=>{v[u]=v.originSet;if(!b()){return}_();p(this.sessions[o],v)});v.once("remoteSettings",()=>{v.ref();v.unref();this._sessionsCount++;if(g.destroyed){const e=new Error("Agent has been destroyed");for(const t of r){t.reject(e)}v.destroy();return}v[u]=v.originSet;{const e=this.sessions;if(o in e){const t=e[o];t.splice(h(t,v,d),0,v)}else{e[o]=[v]}}this._freeSessionsCount+=1;i=true;this.emit("session",v);_();m();if(v[a]===0&&this._freeSessionsCount>this.maxFreeSessions){v.close()}if(r.length!==0){this.getSession(f,t,r);r.length=0}v.on("remoteSettings",()=>{_();p(this.sessions[o],v)})});v[c]=v.request;v.request=((e,t)=>{if(v[l]){throw new Error("The session is gracefully closing. No new streams are allowed.")}const r=v[c](e,t);v.ref();++v[a];if(v[a]===v.remoteSettings.maxConcurrentStreams){this._freeSessionsCount--}r.once("close",()=>{w=b();--v[a];if(!v.destroyed&&!v.closed){y(this.sessions[o],v);if(b()&&!v.closed){if(!w){this._freeSessionsCount++;w=true}const e=v[a]===0;if(e){v.unref()}if(e&&(this._freeSessionsCount>this.maxFreeSessions||v[l])){v.close()}else{p(this.sessions[o],v);_()}}}});return r})}catch(e){for(const t of r){t.reject(e)}m()}};g.listeners=r;g.completed=false;g.destroyed=false;this.queue[o][f]=g;this._tryToCreateNewSession(o,f)})}request(e,t,r,n){return new Promise((i,s)=>{this.getSession(e,t,[{reject:s,resolve:e=>{try{i(e.request(r,n))}catch(e){s(e)}}}])})}createConnection(e,t){return Agent.connect(e,t)}static connect(e,t){t.ALPNProtocols=["h2"];const r=e.port||443;const n=e.hostname||e.host;if(typeof t.servername==="undefined"){t.servername=n}return i.connect(r,n,t)}closeFreeSessions(){for(const e of Object.values(this.sessions)){for(const t of e){if(t[a]===0){t.close()}}}}destroy(e){for(const t of Object.values(this.sessions)){for(const r of t){r.destroy(e)}}for(const e of Object.values(this.queue)){for(const t of Object.values(e)){t.destroyed=true}}this.queue={}}get freeSessions(){return m({agent:this,isFree:true})}get busySessions(){return m({agent:this,isFree:false})}}Agent.kCurrentStreamsCount=a;Agent.kGracefullyClosing=l;e.exports={Agent:Agent,globalAgent:new Agent}},7167:(e,t,r)=>{"use strict";const n=r(8605);const i=r(7211);const s=r(6624);const o=r(9273);const a=r(9632);const c=r(1982);const u=r(2686);const l=new o({maxSize:100});const f=new Map;const h=(e,t,r)=>{t._httpMessage={shouldKeepAlive:true};const n=()=>{e.emit("free",t,r)};t.on("free",n);const i=()=>{e.removeSocket(t,r)};t.on("close",i);const s=()=>{e.removeSocket(t,r);t.off("close",i);t.off("free",n);t.off("agentRemove",s)};t.on("agentRemove",s);e.emit("free",t,r)};const d=async e=>{const t=`${e.host}:${e.port}:${e.ALPNProtocols.sort()}`;if(!l.has(t)){if(f.has(t)){const e=await f.get(t);return e.alpnProtocol}const{path:r,agent:n}=e;e.path=e.socketPath;const o=s(e);f.set(t,o);try{const{socket:s,alpnProtocol:a}=await o;l.set(t,a);e.path=r;if(a==="h2"){s.destroy()}else{const{globalAgent:t}=i;const r=i.Agent.prototype.createConnection;if(n){if(n.createConnection===r){h(n,s,e)}else{s.destroy()}}else if(t.createConnection===r){h(t,s,e)}else{s.destroy()}}f.delete(t);return a}catch(e){f.delete(t);throw e}}return l.get(t)};e.exports=(async(e,t,r)=>{if(typeof e==="string"||e instanceof URL){e=u(new URL(e))}if(typeof t==="function"){r=t;t=undefined}t={ALPNProtocols:["h2","http/1.1"],...e,...t,resolveSocket:true};if(!Array.isArray(t.ALPNProtocols)||t.ALPNProtocols.length===0){throw new Error("The `ALPNProtocols` option must be an Array with at least one entry")}t.protocol=t.protocol||"https:";const s=t.protocol==="https:";t.host=t.hostname||t.host||"localhost";t.session=t.tlsSession;t.servername=t.servername||c(t);t.port=t.port||(s?443:80);t._defaultAgent=s?i.globalAgent:n.globalAgent;const o=t.agent;if(o){if(o.addRequest){throw new Error("The `options.agent` object can contain only `http`, `https` or `http2` properties")}t.agent=o[s?"https":"http"]}if(s){const e=await d(t);if(e==="h2"){if(o){t.agent=o.http2}return new a(t,r)}}return n.request(t,r)});e.exports.protocolCache=l},9632:(e,t,r)=>{"use strict";const n=r(7565);const{Writable:i}=r(2413);const{Agent:s,globalAgent:o}=r(9898);const a=r(2575);const c=r(2686);const u=r(1818);const l=r(1199);const{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_PROTOCOL:h,ERR_HTTP_HEADERS_SENT:d,ERR_INVALID_HTTP_TOKEN:p,ERR_HTTP_INVALID_HEADER_VALUE:y,ERR_INVALID_CHAR:m}=r(7087);const{HTTP2_HEADER_STATUS:g,HTTP2_HEADER_METHOD:v,HTTP2_HEADER_PATH:b,HTTP2_METHOD_CONNECT:w}=n.constants;const _=Symbol("headers");const S=Symbol("origin");const E=Symbol("session");const C=Symbol("options");const k=Symbol("flushedHeaders");const x=Symbol("jobs");const O=/^[\^`\-\w!#$%&*+.|~]+$/;const I=/[^\t\u0020-\u007E\u0080-\u00FF]/;class ClientRequest extends i{constructor(e,t,r){super({autoDestroy:false});const n=typeof e==="string"||e instanceof URL;if(n){e=c(e instanceof URL?e:new URL(e))}if(typeof t==="function"||t===undefined){r=t;t=n?e:{...e}}else{t={...e,...t}}if(t.h2session){this[E]=t.h2session}else if(t.agent===false){this.agent=new s({maxFreeSessions:0})}else if(typeof t.agent==="undefined"||t.agent===null){if(typeof t.createConnection==="function"){this.agent=new s({maxFreeSessions:0});this.agent.createConnection=t.createConnection}else{this.agent=o}}else if(typeof t.agent.request==="function"){this.agent=t.agent}else{throw new f("options.agent",["Agent-like Object","undefined","false"],t.agent)}if(t.protocol&&t.protocol!=="https:"){throw new h(t.protocol,"https:")}const i=t.port||t.defaultPort||this.agent&&this.agent.defaultPort||443;const a=t.hostname||t.host||"localhost";delete t.hostname;delete t.host;delete t.port;const{timeout:u}=t;t.timeout=undefined;this[_]=Object.create(null);this[x]=[];this.socket=null;this.connection=null;this.method=t.method||"GET";this.path=t.path;this.res=null;this.aborted=false;this.reusedSocket=false;if(t.headers){for(const[e,r]of Object.entries(t.headers)){this.setHeader(e,r)}}if(t.auth&&!("authorization"in this[_])){this[_].authorization="Basic "+Buffer.from(t.auth).toString("base64")}t.session=t.tlsSession;t.path=t.socketPath;this[C]=t;if(i===443){this[S]=`https://${a}`;if(!(":authority"in this[_])){this[_][":authority"]=a}}else{this[S]=`https://${a}:${i}`;if(!(":authority"in this[_])){this[_][":authority"]=`${a}:${i}`}}if(u){this.setTimeout(u)}if(r){this.once("response",r)}this[k]=false}get method(){return this[_][v]}set method(e){if(e){this[_][v]=e.toUpperCase()}}get path(){return this[_][b]}set path(e){if(e){this[_][b]=e}}get _mustNotHaveABody(){return this.method==="GET"||this.method==="HEAD"||this.method==="DELETE"}_write(e,t,r){if(this._mustNotHaveABody){r(new Error("The GET, HEAD and DELETE methods must NOT have a body"));return}this.flushHeaders();const n=()=>this._request.write(e,t,r);if(this._request){n()}else{this[x].push(n)}}_final(e){if(this.destroyed){return}this.flushHeaders();const t=()=>{if(this._mustNotHaveABody){e();return}this._request.end(e)};if(this._request){t()}else{this[x].push(t)}}abort(){if(this.res&&this.res.complete){return}if(!this.aborted){process.nextTick(()=>this.emit("abort"))}this.aborted=true;this.destroy()}_destroy(e,t){if(this.res){this.res._dump()}if(this._request){this._request.destroy()}t(e)}async flushHeaders(){if(this[k]||this.destroyed){return}this[k]=true;const e=this.method===w;const t=t=>{this._request=t;if(this.destroyed){t.destroy();return}if(!e){u(t,this,["timeout","continue","close","error"])}const r=e=>{return(...t)=>{if(!this.writable&&!this.destroyed){e(...t)}else{this.once("finish",()=>{e(...t)})}}};t.once("response",r((r,n,i)=>{const s=new a(this.socket,t.readableHighWaterMark);this.res=s;s.req=this;s.statusCode=r[g];s.headers=r;s.rawHeaders=i;s.once("end",()=>{if(this.aborted){s.aborted=true;s.emit("aborted")}else{s.complete=true;s.socket=null;s.connection=null}});if(e){s.upgrade=true;if(this.emit("connect",s,t,Buffer.alloc(0))){this.emit("close")}else{t.destroy()}}else{t.on("data",e=>{if(!s._dumped&&!s.push(e)){t.pause()}});t.once("end",()=>{s.push(null)});if(!this.emit("response",s)){s._dump()}}}));t.once("headers",r(e=>this.emit("information",{statusCode:e[g]})));t.once("trailers",r((e,t,r)=>{const{res:n}=this;n.trailers=e;n.rawTrailers=r}));const{socket:n}=t.session;this.socket=n;this.connection=n;for(const e of this[x]){e()}this.emit("socket",this.socket)};if(this[E]){try{t(this[E].request(this[_]))}catch(e){this.emit("error",e)}}else{this.reusedSocket=true;try{t(await this.agent.request(this[S],this[C],this[_]))}catch(e){this.emit("error",e)}}}getHeader(e){if(typeof e!=="string"){throw new f("name","string",e)}return this[_][e.toLowerCase()]}get headersSent(){return this[k]}removeHeader(e){if(typeof e!=="string"){throw new f("name","string",e)}if(this.headersSent){throw new d("remove")}delete this[_][e.toLowerCase()]}setHeader(e,t){if(this.headersSent){throw new d("set")}if(typeof e!=="string"||!O.test(e)&&!l(e)){throw new p("Header name",e)}if(typeof t==="undefined"){throw new y(t,e)}if(I.test(t)){throw new m("header content",e)}this[_][e.toLowerCase()]=t}setNoDelay(){}setSocketKeepAlive(){}setTimeout(e,t){const r=()=>this._request.setTimeout(e,t);if(this._request){r()}else{this[x].push(r)}return this}get maxHeadersCount(){if(!this.destroyed&&this._request){return this._request.session.localSettings.maxHeaderListSize}return undefined}set maxHeadersCount(e){}}e.exports=ClientRequest},2575:(e,t,r)=>{"use strict";const{Readable:n}=r(2413);class IncomingMessage extends n{constructor(e,t){super({highWaterMark:t,autoDestroy:false});this.statusCode=null;this.statusMessage="";this.httpVersion="2.0";this.httpVersionMajor=2;this.httpVersionMinor=0;this.headers={};this.trailers={};this.req=null;this.aborted=false;this.complete=false;this.upgrade=null;this.rawHeaders=[];this.rawTrailers=[];this.socket=e;this.connection=e;this._dumped=false}_destroy(e){this.req._request.destroy(e)}setTimeout(e,t){this.req.setTimeout(e,t);return this}_dump(){if(!this._dumped){this._dumped=true;this.removeAllListeners("data");this.resume()}}_read(){if(this.req){this.req._request.resume()}}}e.exports=IncomingMessage},4645:(e,t,r)=>{"use strict";const n=r(7565);const i=r(9898);const s=r(9632);const o=r(2575);const a=r(7167);const c=(e,t,r)=>{return new s(e,t,r)};const u=(e,t,r)=>{const n=new s(e,t,r);n.end();return n};e.exports={...n,ClientRequest:s,IncomingMessage:o,...i,request:c,get:u,auto:a}},1982:(e,t,r)=>{"use strict";const n=r(1631);e.exports=(e=>{let t=e.host;const r=e.headers&&e.headers.host;if(r){if(r.startsWith("[")){const e=r.indexOf("]");if(e===-1){t=r}else{t=r.slice(1,-1)}}else{t=r.split(":",1)[0]}}if(n.isIP(t)){return""}return t})},7087:e=>{"use strict";const t=(t,r,n)=>{e.exports[r]=class NodeError extends t{constructor(...e){super(typeof n==="string"?n:n(e));this.name=`${super.name} [${r}]`;this.code=r}}};t(TypeError,"ERR_INVALID_ARG_TYPE",e=>{const t=e[0].includes(".")?"property":"argument";let r=e[1];const n=Array.isArray(r);if(n){r=`${r.slice(0,-1).join(", ")} or ${r.slice(-1)}`}return`The "${e[0]}" ${t} must be ${n?"one of":"of"} type ${r}. Received ${typeof e[2]}`});t(TypeError,"ERR_INVALID_PROTOCOL",e=>{return`Protocol "${e[0]}" not supported. Expected "${e[1]}"`});t(Error,"ERR_HTTP_HEADERS_SENT",e=>{return`Cannot ${e[0]} headers after they are sent to the client`});t(TypeError,"ERR_INVALID_HTTP_TOKEN",e=>{return`${e[0]} must be a valid HTTP token [${e[1]}]`});t(TypeError,"ERR_HTTP_INVALID_HEADER_VALUE",e=>{return`Invalid value "${e[0]} for header "${e[1]}"`});t(TypeError,"ERR_INVALID_CHAR",e=>{return`Invalid character in ${e[0]} [${e[1]}]`})},1199:e=>{"use strict";e.exports=(e=>{switch(e){case":method":case":scheme":case":authority":case":path":return true;default:return false}})},1818:e=>{"use strict";e.exports=((e,t,r)=>{for(const n of r){e.on(n,(...e)=>t.emit(n,...e))}})},2686:e=>{"use strict";e.exports=(e=>{const t={protocol:e.protocol,hostname:typeof e.hostname==="string"&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,host:e.host,hash:e.hash,search:e.search,pathname:e.pathname,href:e.href,path:`${e.pathname||""}${e.search||""}`};if(typeof e.port==="string"&&e.port.length!==0){t.port=Number(e.port)}if(e.username||e.password){t.auth=`${e.username||""}:${e.password||""}`}return t})},9074:(e,t,r)=>{"use strict";const n=r(8761);const i=r(8605);const s=r(7211);const o=r(8835).parse;const a=r(8835).format;const c=r(1948)("httpx:body");const u=r(1948)("httpx:header");const l=new i.Agent({keepAlive:true});const f=new s.Agent({keepAlive:true});const h=3e3;const d=Symbol("TIMER::READ_TIMER");const p=Symbol("TIMER::READ_TIME_OUT");const y=Symbol("TIMER::READ_TIMER_START_AT");var m=function(e,t,r){e.name=t+e.name;e.message=`${r}. ${e.message}`;return e};const g=function(e){return e!==null&&!isNaN(e)};t.request=function(e,t){t||(t={});const r=typeof e==="string"?o(e):e;let n,v;if(g(t.readTimeout)||g(t.connectTimeout)){n=g(t.readTimeout)?Number(t.readTimeout):h;v=g(t.connectTimeout)?Number(t.connectTimeout):h}else if(g(t.timeout)){n=v=Number(t.timeout)}else{n=v=h}const b=r.protocol==="https:";const w=(t.method||"GET").toUpperCase();const _=b?f:l;const S=t.agent||_;var E={host:r.hostname||"localhost",path:r.path||"/",method:w,port:r.port||(r.protocol==="https:"?443:80),agent:S,headers:t.headers||{},key:t.key||"",cert:t.cert||"",ca:t.ca||"",timeout:v};if(b&&typeof t.rejectUnauthorized!=="undefined"){E.rejectUnauthorized=t.rejectUnauthorized}if(t.compression){E.headers["accept-encoding"]="gzip,deflate"}const C=b?s:i;if(typeof t.beforeRequest==="function"){E=t.beforeRequest(E)}return new Promise((e,i)=>{const s=C.request(E);const o=t.data;var l=t=>{if(u.enabled){const e=t.req._header;e.split("\r\n").forEach(e=>{u("> %s",e)});u("< HTTP/%s %s %s",t.httpVersion,t.statusCode,t.statusMessage);Object.keys(t.headers).forEach(e=>{u("< %s: %s",e,t.headers[e])})}e(t)};var f=e=>{e.message+=`${w} ${a(r)} failed.`;if(s.socket&&s.socket[d]){clearTimeout(s.socket[d])}i(e)};var h=e=>{s.abort();f(e)};const g=function(e){const t=setTimeout(()=>{if(e[d]){clearTimeout(e[d]);e[d]=null}var t=new Error;var r=`ReadTimeout(${n})`;h(m(t,"RequestTimeout",r))},n);e[p]=n;e[d]=t;e[y]=Date.now()};if(!o||"string"===typeof o||o instanceof Buffer){if(c.enabled){if(!o){c("")}else if("string"===typeof o){c(o)}else{c(`Buffer , Buffer length: ${o.length}`)}}s.end(o)}else if("function"===typeof o.pipe){o.pipe(s);if(c.enabled){c("")}o.once("error",e=>{h(m(e,"HttpX","Stream occor error"))})}s.on("response",l);s.on("error",f);s.once("socket",function(e){if(e.readyState==="opening"){e.once("connect",function(){g(e)})}else{g(e)}})})};t.read=function(e,t){var r=e;switch(e.headers["content-encoding"]){case"gzip":r=e.pipe(n.createGunzip());break;case"deflate":r=e.pipe(n.createInflate());break;default:break}return new Promise((n,i)=>{const s=e.socket||e.client;const o=()=>{const t=e.req;var r=new Error;r.name="RequestTimeoutError";r.message=`ReadTimeout: ${s[p]}. ${t.method} ${t.path} failed.`;return r};let a;const u=s[d];if(!u){i(o());return}const l=s[p]-(Date.now()-s[y]);clearTimeout(u);if(l<=0){i(o());return}a=setTimeout(function(){i(o())},l);var f,h,m;var g=function(){r.removeListener("error",f);r.removeListener("data",h);r.removeListener("end",m);if(a){clearTimeout(a)}};const v=[];var b=0;h=function(e){v.push(e);b+=e.length};f=function(e){g();i(e)};m=function(){g();var e=Buffer.concat(v,b);c("");if(t){const r=e.toString(t);c(r);return n(r)}if(c.enabled){c(e.toString())}n(e)};r.on("error",f);r.on("data",h);r.on("end",m)})}},261:(e,t,r)=>{t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.storage=localstorage();t.destroy=(()=>{let e=false;return()=>{if(!e){e=true;console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}}})();t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function useColors(){if(typeof window!=="undefined"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)){return true}if(typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)){return false}return typeof document!=="undefined"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window!=="undefined"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator!=="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function formatArgs(t){t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff);if(!this.useColors){return}const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0;let i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{if(e==="%%"){return}n++;if(e==="%c"){i=n}});t.splice(i,0,r)}t.log=console.debug||console.log||(()=>{});function save(e){try{if(e){t.storage.setItem("debug",e)}else{t.storage.removeItem("debug")}}catch(e){}}function load(){let e;try{e=t.storage.getItem("debug")}catch(e){}if(!e&&typeof process!=="undefined"&&"env"in process){e=process.env.DEBUG}return e}function localstorage(){try{return localStorage}catch(e){}}e.exports=r(5538)(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},5538:(e,t,r)=>{function setup(e){createDebug.debug=createDebug;createDebug.default=createDebug;createDebug.coerce=coerce;createDebug.disable=disable;createDebug.enable=enable;createDebug.enabled=enabled;createDebug.humanize=r(2823);createDebug.destroy=destroy;Object.keys(e).forEach(t=>{createDebug[t]=e[t]});createDebug.names=[];createDebug.skips=[];createDebug.formatters={};function selectColor(e){let t=0;for(let r=0;r{if(t==="%%"){return"%"}s++;const i=createDebug.formatters[n];if(typeof i==="function"){const n=e[s];t=i.call(r,n);e.splice(s,1);s--}return t});createDebug.formatArgs.call(r,e);const o=r.log||createDebug.log;o.apply(r,e)}debug.namespace=e;debug.useColors=createDebug.useColors();debug.color=createDebug.selectColor(e);debug.extend=extend;debug.destroy=createDebug.destroy;Object.defineProperty(debug,"enabled",{enumerable:true,configurable:false,get:()=>{if(r!==null){return r}if(n!==createDebug.namespaces){n=createDebug.namespaces;i=createDebug.enabled(e)}return i},set:e=>{r=e}});if(typeof createDebug.init==="function"){createDebug.init(debug)}return debug}function extend(e,t){const r=createDebug(this.namespace+(typeof t==="undefined"?":":t)+e);r.log=this.log;return r}function enable(e){createDebug.save(e);createDebug.namespaces=e;createDebug.names=[];createDebug.skips=[];let t;const r=(typeof e==="string"?e:"").split(/[\s,]+/);const n=r.length;for(t=0;t"-"+e)].join(",");createDebug.enable("");return e}function enabled(e){if(e[e.length-1]==="*"){return true}let t;let r;for(t=0,r=createDebug.skips.length;t{if(typeof process==="undefined"||process.type==="renderer"||process.browser===true||process.__nwjs){e.exports=r(261)}else{e.exports=r(6072)}},6072:(e,t,r)=>{const n=r(3867);const i=r(1669);t.init=init;t.log=log;t.formatArgs=formatArgs;t.save=save;t.load=load;t.useColors=useColors;t.destroy=i.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");t.colors=[6,2,3,4,5,1];try{const e=r(9318);if(e&&(e.stderr||e).level>=2){t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221]}}catch(e){}t.inspectOpts=Object.keys(process.env).filter(e=>{return/^debug_/i.test(e)}).reduce((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>{return t.toUpperCase()});let n=process.env[t];if(/^(yes|on|true|enabled)$/i.test(n)){n=true}else if(/^(no|off|false|disabled)$/i.test(n)){n=false}else if(n==="null"){n=null}else{n=Number(n)}e[r]=n;return e},{});function useColors(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)}function formatArgs(t){const{namespace:r,useColors:n}=this;if(n){const n=this.color;const i="[3"+(n<8?n:"8;5;"+n);const s=` ${i};1m${r} `;t[0]=s+t[0].split("\n").join("\n"+s);t.push(i+"m+"+e.exports.humanize(this.diff)+"")}else{t[0]=getDate()+r+" "+t[0]}}function getDate(){if(t.inspectOpts.hideDate){return""}return(new Date).toISOString()+" "}function log(...e){return process.stderr.write(i.format(...e)+"\n")}function save(e){if(e){process.env.DEBUG=e}else{delete process.env.DEBUG}}function load(){return process.env.DEBUG}function init(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;ne.trim()).join(" ")};s.O=function(e){this.inspectOpts.colors=this.useColors;return i.inspect(e,this.inspectOpts)}},2823:e=>{var t=1e3;var r=t*60;var n=r*60;var i=n*24;var s=i*7;var o=i*365.25;e.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0){return parse(e)}else if(r==="number"&&isFinite(e)){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a){return}var c=parseFloat(a[1]);var u=(a[2]||"ms").toLowerCase();switch(u){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*s;case"days":case"day":case"d":return c*i;case"hours":case"hour":case"hrs":case"hr":case"h":return c*n;case"minutes":case"minute":case"mins":case"min":case"m":return c*r;case"seconds":case"second":case"secs":case"sec":case"s":return c*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return undefined}}function fmtShort(e){var s=Math.abs(e);if(s>=i){return Math.round(e/i)+"d"}if(s>=n){return Math.round(e/n)+"h"}if(s>=r){return Math.round(e/r)+"m"}if(s>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){var s=Math.abs(e);if(s>=i){return plural(e,s,i,"day")}if(s>=n){return plural(e,s,n,"hour")}if(s>=r){return plural(e,s,r,"minute")}if(s>=t){return plural(e,s,t,"second")}return e+" ms"}function plural(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}},2820:(e,t)=>{t.stringify=function stringify(e){if("undefined"==typeof e)return e;if(e&&Buffer.isBuffer(e))return JSON.stringify(":base64:"+e.toString("base64"));if(e&&e.toJSON)e=e.toJSON();if(e&&"object"===typeof e){var t="";var r=Array.isArray(e);t=r?"[":"{";var n=true;for(var i in e){var s="function"==typeof e[i]||!r&&"undefined"===typeof e[i];if(Object.hasOwnProperty.call(e,i)&&!s){if(!n)t+=",";n=false;if(r){if(e[i]==undefined)t+="null";else t+=stringify(e[i])}else if(e[i]!==void 0){t+=stringify(i)+":"+stringify(e[i])}}}t+=r?"]":"}";return t}else if("string"===typeof e){return JSON.stringify(/^:/.test(e)?":"+e:e)}else if("undefined"===typeof e){return"null"}else return JSON.stringify(e)};t.parse=function(e){return JSON.parse(e,function(e,t){if("string"===typeof t){if(/^:base64:/.test(t))return Buffer.from(t.substring(8),"base64");else return/^:/.test(t)?t.substring(1):t}return t})}},6160:(e,t,r)=>{let n;try{n=r(7758)}catch(e){n=r(5747)}const i=r(9046);const{stringify:s,stripBom:o}=r(5902);async function _readFile(e,t={}){if(typeof t==="string"){t={encoding:t}}const r=t.fs||n;const s="throws"in t?t.throws:true;let a=await i.fromCallback(r.readFile)(e,t);a=o(a);let c;try{c=JSON.parse(a,t?t.reviver:null)}catch(t){if(s){t.message=`${e}: ${t.message}`;throw t}else{return null}}return c}const a=i.fromPromise(_readFile);function readFileSync(e,t={}){if(typeof t==="string"){t={encoding:t}}const r=t.fs||n;const i="throws"in t?t.throws:true;try{let n=r.readFileSync(e,t);n=o(n);return JSON.parse(n,t.reviver)}catch(t){if(i){t.message=`${e}: ${t.message}`;throw t}else{return null}}}async function _writeFile(e,t,r={}){const o=r.fs||n;const a=s(t,r);await i.fromCallback(o.writeFile)(e,a,r)}const c=i.fromPromise(_writeFile);function writeFileSync(e,t,r={}){const i=r.fs||n;const o=s(t,r);return i.writeFileSync(e,o,r)}const u={readFile:a,readFileSync:readFileSync,writeFile:c,writeFileSync:writeFileSync};e.exports=u},5902:e=>{function stringify(e,{EOL:t="\n",finalEOL:r=true,replacer:n=null,spaces:i}={}){const s=r?t:"";const o=JSON.stringify(e,n,i);return o.replace(/\n/g,t)+s}function stripBom(e){if(Buffer.isBuffer(e))e=e.toString("utf8");return e.replace(/^\uFEFF/,"")}e.exports={stringify:stringify,stripBom:stripBom}},1531:(e,t,r)=>{"use strict";const n=r(8614);const i=r(2820);const s=e=>{const t={redis:"@keyv/redis",mongodb:"@keyv/mongo",mongo:"@keyv/mongo",sqlite:"@keyv/sqlite",postgresql:"@keyv/postgres",postgres:"@keyv/postgres",mysql:"@keyv/mysql"};if(e.adapter||e.uri){const r=e.adapter||/^[^:]*/.exec(e.uri)[0];return new(require(t[r]))(e)}return new Map};class Keyv extends n{constructor(e,t){super();this.opts=Object.assign({namespace:"keyv",serialize:i.stringify,deserialize:i.parse},typeof e==="string"?{uri:e}:e,t);if(!this.opts.store){const e=Object.assign({},this.opts);this.opts.store=s(e)}if(typeof this.opts.store.on==="function"){this.opts.store.on("error",e=>this.emit("error",e))}this.opts.store.namespace=this.opts.namespace}_getKeyPrefix(e){return`${this.opts.namespace}:${e}`}get(e,t){const r=this._getKeyPrefix(e);const{store:n}=this.opts;return Promise.resolve().then(()=>n.get(r)).then(e=>{return typeof e==="string"?this.opts.deserialize(e):e}).then(r=>{if(r===undefined){return undefined}if(typeof r.expires==="number"&&Date.now()>r.expires){this.delete(e);return undefined}return t&&t.raw?r:r.value})}set(e,t,r){const n=this._getKeyPrefix(e);if(typeof r==="undefined"){r=this.opts.ttl}if(r===0){r=undefined}const{store:i}=this.opts;return Promise.resolve().then(()=>{const e=typeof r==="number"?Date.now()+r:null;t={value:t,expires:e};return this.opts.serialize(t)}).then(e=>i.set(n,e,r)).then(()=>true)}delete(e){const t=this._getKeyPrefix(e);const{store:r}=this.opts;return Promise.resolve().then(()=>r.delete(t))}clear(){const{store:e}=this.opts;return Promise.resolve().then(()=>e.clear())}}e.exports=Keyv},8683:(e,t,r)=>{"use strict";const n=r(5747);const i=r(2087);const s=r(6417);t.loadJSONSync=function(e){var t=n.readFileSync(e,"utf8");if(t.charCodeAt(0)===65279){t=t.slice(1)}try{return JSON.parse(t)}catch(t){t.message=e+": "+t.message;throw t}};t.encode=function(e,t){if(typeof e!=="string"){e=""+e}return new Buffer(e,t)};t.makeHasher=function(e){return function(t,r){var n=s.createHash(e);n.update(t);return n.digest(r)}};t.createHash=t.makeHasher;t.md5=t.makeHasher("md5");t.createHmac=function(e){return function(t,r,n){return s.createHmac(e,r).update(t).digest(n)}};t.sha1=t.createHmac("sha1");t.random=function(e,t){return Math.floor(e+Math.random()*(t-e))};t.makeNonce=function(){var e=0;var r;const n=i.hostname();const s=process.pid;return function(){var i=Math.floor(Math.random()*1e12);if(i===r){e++}else{e=0}r=i;var o=`${n}${s}${i}${e}`;return t.md5(o,"hex")}}();t.pad2=function(e){if(e<10){return"0"+e}return""+e};t.pad3=function(e){if(e<10){return"00"+e}else if(e<100){return"0"+e}return""+e};t.getYYYYMMDD=function(e){var r=e.getFullYear();var n=t.pad2(e.getMonth()+1);var i=t.pad2(e.getDate());return""+r+n+i};t.sleep=function(e){return new Promise(t=>{setTimeout(t,e)})};t.getIPv4=function(){var e=i.networkInterfaces();var t=Object.keys(e);for(var r=0;r>>1;var q=[["ary",E],["bind",m],["bindKey",g],["curry",b],["curryRight",w],["flip",k],["partial",_],["partialRight",S],["rearg",C]];var W="[object Arguments]",U="[object Array]",H="[object AsyncFunction]",z="[object Boolean]",B="[object Date]",G="[object DOMException]",K="[object Error]",J="[object Function]",Y="[object GeneratorFunction]",Z="[object Map]",X="[object Number]",Q="[object Null]",V="[object Object]",ee="[object Promise]",te="[object Proxy]",re="[object RegExp]",ne="[object Set]",ie="[object String]",se="[object Symbol]",oe="[object Undefined]",ae="[object WeakMap]",ce="[object WeakSet]";var ue="[object ArrayBuffer]",le="[object DataView]",fe="[object Float32Array]",he="[object Float64Array]",de="[object Int8Array]",pe="[object Int16Array]",ye="[object Int32Array]",me="[object Uint8Array]",ge="[object Uint8ClampedArray]",ve="[object Uint16Array]",be="[object Uint32Array]";var we=/\b__p \+= '';/g,_e=/\b(__p \+=) '' \+/g,Se=/(__e\(.*?\)|\b__t\)) \+\n'';/g;var Ee=/&(?:amp|lt|gt|quot|#39);/g,Ce=/[&<>"']/g,ke=RegExp(Ee.source),xe=RegExp(Ce.source);var Oe=/<%-([\s\S]+?)%>/g,Ie=/<%([\s\S]+?)%>/g,Ae=/<%=([\s\S]+?)%>/g;var Te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pe=/^\w*$/,Re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;var je=/[\\^$.*+?()[\]{}|]/g,Fe=RegExp(je.source);var Le=/^\s+/;var $e=/\s/;var De=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ne=/\{\n\/\* \[wrapped with (.+)\] \*/,Me=/,? & /;var qe=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;var We=/[()=,{}\[\]\/\s]/;var Ue=/\\(\\)?/g;var He=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;var ze=/\w*$/;var Be=/^[-+]0x[0-9a-f]+$/i;var Ge=/^0b[01]+$/i;var Ke=/^\[object .+?Constructor\]$/;var Je=/^0o[0-7]+$/i;var Ye=/^(?:0|[1-9]\d*)$/;var Ze=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;var Xe=/($^)/;var Qe=/['\n\r\u2028\u2029\\]/g;var Ve="\\ud800-\\udfff",et="\\u0300-\\u036f",tt="\\ufe20-\\ufe2f",rt="\\u20d0-\\u20ff",nt=et+tt+rt,it="\\u2700-\\u27bf",st="a-z\\xdf-\\xf6\\xf8-\\xff",ot="\\xac\\xb1\\xd7\\xf7",at="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ct="\\u2000-\\u206f",ut=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",lt="A-Z\\xc0-\\xd6\\xd8-\\xde",ft="\\ufe0e\\ufe0f",ht=ot+at+ct+ut;var dt="['’]",pt="["+Ve+"]",yt="["+ht+"]",mt="["+nt+"]",gt="\\d+",vt="["+it+"]",bt="["+st+"]",wt="[^"+Ve+ht+gt+it+st+lt+"]",_t="\\ud83c[\\udffb-\\udfff]",St="(?:"+mt+"|"+_t+")",Et="[^"+Ve+"]",Ct="(?:\\ud83c[\\udde6-\\uddff]){2}",kt="[\\ud800-\\udbff][\\udc00-\\udfff]",xt="["+lt+"]",Ot="\\u200d";var It="(?:"+bt+"|"+wt+")",At="(?:"+xt+"|"+wt+")",Tt="(?:"+dt+"(?:d|ll|m|re|s|t|ve))?",Pt="(?:"+dt+"(?:D|LL|M|RE|S|T|VE))?",Rt=St+"?",jt="["+ft+"]?",Ft="(?:"+Ot+"(?:"+[Et,Ct,kt].join("|")+")"+jt+Rt+")*",Lt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",$t="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Dt=jt+Rt+Ft,Nt="(?:"+[vt,Ct,kt].join("|")+")"+Dt,Mt="(?:"+[Et+mt+"?",mt,Ct,kt,pt].join("|")+")";var qt=RegExp(dt,"g");var Wt=RegExp(mt,"g");var Ut=RegExp(_t+"(?="+_t+")|"+Mt+Dt,"g");var Ht=RegExp([xt+"?"+bt+"+"+Tt+"(?="+[yt,xt,"$"].join("|")+")",At+"+"+Pt+"(?="+[yt,xt+It,"$"].join("|")+")",xt+"?"+It+"+"+Tt,xt+"+"+Pt,$t,Lt,gt,Nt].join("|"),"g");var zt=RegExp("["+Ot+Ve+nt+ft+"]");var Bt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;var Gt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"];var Kt=-1;var Jt={};Jt[fe]=Jt[he]=Jt[de]=Jt[pe]=Jt[ye]=Jt[me]=Jt[ge]=Jt[ve]=Jt[be]=true;Jt[W]=Jt[U]=Jt[ue]=Jt[z]=Jt[le]=Jt[B]=Jt[K]=Jt[J]=Jt[Z]=Jt[X]=Jt[V]=Jt[re]=Jt[ne]=Jt[ie]=Jt[ae]=false;var Yt={};Yt[W]=Yt[U]=Yt[ue]=Yt[le]=Yt[z]=Yt[B]=Yt[fe]=Yt[he]=Yt[de]=Yt[pe]=Yt[ye]=Yt[Z]=Yt[X]=Yt[V]=Yt[re]=Yt[ne]=Yt[ie]=Yt[se]=Yt[me]=Yt[ge]=Yt[ve]=Yt[be]=true;Yt[K]=Yt[J]=Yt[ae]=false;var Zt={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"};var Xt={"&":"&","<":"<",">":">",'"':""","'":"'"};var Qt={"&":"&","<":"<",">":">",""":'"',"'":"'"};var Vt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};var er=parseFloat,tr=parseInt;var rr=typeof global=="object"&&global&&global.Object===Object&&global;var nr=typeof self=="object"&&self&&self.Object===Object&&self;var ir=rr||nr||Function("return this")();var sr=true&&t&&!t.nodeType&&t;var or=sr&&"object"=="object"&&e&&!e.nodeType&&e;var ar=or&&or.exports===sr;var cr=ar&&rr.process;var ur=function(){try{var e=or&&or.require&&or.require("util").types;if(e){return e}return cr&&cr.binding&&cr.binding("util")}catch(e){}}();var lr=ur&&ur.isArrayBuffer,fr=ur&&ur.isDate,hr=ur&&ur.isMap,dr=ur&&ur.isRegExp,pr=ur&&ur.isSet,yr=ur&&ur.isTypedArray;function apply(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function arrayAggregator(e,t,r,n){var i=-1,s=e==null?0:e.length;while(++i-1}function arrayIncludesWith(e,t,r){var n=-1,i=e==null?0:e.length;while(++n-1){}return r}function charsEndIndex(e,t){var r=e.length;while(r--&&baseIndexOf(t,e[r],0)>-1){}return r}function countHolders(e,t){var r=e.length,n=0;while(r--){if(e[r]===t){++n}}return n}var gr=basePropertyOf(Zt);var vr=basePropertyOf(Xt);function escapeStringChar(e){return"\\"+Vt[e]}function getValue(e,t){return e==null?r:e[t]}function hasUnicode(e){return zt.test(e)}function hasUnicodeWord(e){return Bt.test(e)}function iteratorToArray(e){var t,r=[];while(!(t=e.next()).done){r.push(t.value)}return r}function mapToArray(e){var t=-1,r=Array(e.size);e.forEach(function(e,n){r[++t]=[n,e]});return r}function overArg(e,t){return function(r){return e(t(r))}}function replaceHolders(e,t){var r=-1,n=e.length,i=0,s=[];while(++r-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);if(n<0){++this.size;r.push([e,t])}else{r[n][1]=t}return this}ListCache.prototype.clear=listCacheClear;ListCache.prototype["delete"]=listCacheDelete;ListCache.prototype.get=listCacheGet;ListCache.prototype.has=listCacheHas;ListCache.prototype.set=listCacheSet;function MapCache(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t=t?e:t}}return e}function baseClone(e,t,n,i,s,o){var a,c=t&f,u=t&h,l=t&d;if(n){a=s?n(e,i,s,o):n(e)}if(a!==r){return a}if(!isObject(e)){return e}var p=Pn(e);if(p){a=initCloneArray(e);if(!c){return copyArray(e,a)}}else{var y=qr(e),m=y==J||y==Y;if(jn(e)){return cloneBuffer(e,c)}if(y==V||y==W||m&&!s){a=u||m?{}:initCloneObject(e);if(!c){return u?copySymbolsIn(e,baseAssignIn(a,e)):copySymbols(e,baseAssign(a,e))}}else{if(!Yt[y]){return s?e:{}}a=initCloneByTag(e,y,c)}}o||(o=new Stack);var g=o.get(e);if(g){return g}o.set(e,a);if(Dn(e)){e.forEach(function(r){a.add(baseClone(r,t,n,r,e,o))})}else if(Ln(e)){e.forEach(function(r,i){a.set(i,baseClone(r,t,n,i,e,o))})}var v=l?u?getAllKeysIn:getAllKeys:u?keysIn:keys;var b=p?r:v(e);arrayEach(b||e,function(r,i){if(b){i=r;r=e[i]}assignValue(a,i,baseClone(r,t,n,i,e,o))});return a}function baseConforms(e){var t=keys(e);return function(r){return baseConformsTo(r,e,t)}}function baseConformsTo(e,t,n){var i=n.length;if(e==null){return!i}e=tt(e);while(i--){var s=n[i],o=t[s],a=e[s];if(a===r&&!(s in e)||!o(a)){return false}}return true}function baseDelay(e,t,n){if(typeof e!="function"){throw new it(o)}return Hr(function(){e.apply(r,n)},t)}function baseDifference(e,t,r,n){var s=-1,o=arrayIncludes,a=true,c=e.length,u=[],l=t.length;if(!c){return u}if(r){t=arrayMap(t,baseUnary(r))}if(n){o=arrayIncludesWith;a=false}else if(t.length>=i){o=cacheHas;a=false;t=new SetCache(t)}e:while(++ss?0:s+n}i=i===r||i>s?s:toInteger(i);if(i<0){i+=s}i=n>i?0:toLength(i);while(n0&&r(a)){if(t>1){baseFlatten(a,t-1,r,n,i)}else{arrayPush(i,a)}}else if(!n){i[i.length]=a}}return i}var Tr=createBaseFor();var Pr=createBaseFor(true);function baseForOwn(e,t){return e&&Tr(e,t,keys)}function baseForOwnRight(e,t){return e&&Pr(e,t,keys)}function baseFunctions(e,t){return arrayFilter(t,function(t){return isFunction(e[t])})}function baseGet(e,t){t=castPath(t,e);var n=0,i=t.length;while(e!=null&&nt}function baseHas(e,t){return e!=null&<.call(e,t)}function baseHasIn(e,t){return e!=null&&t in tt(e)}function baseInRange(e,t,r){return e>=Ut(t,r)&&e=120&&h.length>=120)?new SetCache(c&&h):r}h=e[0];var d=-1,p=u[0];e:while(++d-1){if(a!==e){Ct.call(a,c,1)}Ct.call(e,c,1)}}return e}function basePullAt(e,t){var r=e?t.length:0,n=r-1;while(r--){var i=t[r];if(r==n||i!==s){var s=i;if(isIndex(i)){Ct.call(e,i,1)}else{baseUnset(e,i)}}}return e}function baseRandom(e,t){return e+jt(Bt()*(t-e+1))}function baseRange(e,r,n,i){var s=-1,o=Mt(Rt((r-e)/(n||1)),0),a=t(o);while(o--){a[i?o:++s]=e;e+=n}return a}function baseRepeat(e,t){var r="";if(!e||t<1||t>F){return r}do{if(t%2){r+=e}t=jt(t/2);if(t){e+=e}}while(t);return r}function baseRest(e,t){return zr(overRest(e,t,identity),e+"")}function baseSample(e){return arraySample(values(e))}function baseSampleSize(e,t){var r=values(e);return shuffleSelf(r,baseClamp(t,0,r.length))}function baseSet(e,t,n,i){if(!isObject(e)){return e}t=castPath(t,e);var s=-1,o=t.length,a=o-1,c=e;while(c!=null&&++ss?0:s+r}n=n>s?s:n;if(n<0){n+=s}s=r>n?0:n-r>>>0;r>>>=0;var o=t(s);while(++i>>1,o=e[s];if(o!==null&&!isSymbol(o)&&(r?o<=t:o=i){var l=t?null:$r(e);if(l){return setToArray(l)}a=false;s=cacheHas;u=new SetCache}else{u=t?[]:c}e:while(++n=i?e:baseSlice(e,t,n)}var Lr=At||function(e){return ir.clearTimeout(e)};function cloneBuffer(e,t){if(t){return e.slice()}var r=e.length,n=wt?wt(r):new e.constructor(r);e.copy(n);return n}function cloneArrayBuffer(e){var t=new e.constructor(e.byteLength);new bt(t).set(new bt(e));return t}function cloneDataView(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function cloneRegExp(e){var t=new e.constructor(e.source,ze.exec(e));t.lastIndex=e.lastIndex;return t}function cloneSymbol(e){return kr?tt(kr.call(e)):{}}function cloneTypedArray(e,t){var r=t?cloneArrayBuffer(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function compareAscending(e,t){if(e!==t){var n=e!==r,i=e===null,s=e===e,o=isSymbol(e);var a=t!==r,c=t===null,u=t===t,l=isSymbol(t);if(!c&&!l&&!o&&e>t||o&&a&&u&&!c&&!l||i&&a&&u||!n&&u||!s){return 1}if(!i&&!o&&!l&&e=a){return c}var u=r[n];return c*(u=="desc"?-1:1)}}return e.index-t.index}function composeArgs(e,r,n,i){var s=-1,o=e.length,a=n.length,c=-1,u=r.length,l=Mt(o-a,0),f=t(u+l),h=!i;while(++c1?n[s-1]:r,a=s>2?n[2]:r;o=e.length>3&&typeof o=="function"?(s--,o):r;if(a&&isIterateeCall(n[0],n[1],a)){o=s<3?r:o;s=1}t=tt(t);while(++i-1?s[o?t[a]:a]:r}}function createFlow(e){return flatRest(function(t){var n=t.length,i=n,s=LodashWrapper.prototype.thru;if(e){t.reverse()}while(i--){var a=t[i];if(typeof a!="function"){throw new it(o)}if(s&&!c&&getFuncName(a)=="wrapper"){var c=new LodashWrapper([],true)}}i=c?i:n;while(++i1){m.reverse()}if(h&&lc)){return false}var l=o.get(e);var f=o.get(t);if(l&&f){return l==t&&f==e}var h=-1,d=true,m=n&y?new SetCache:r;o.set(e,t);o.set(t,e);while(++h1?"& ":"")+t[n];t=t.join(r>2?", ":" ");return e.replace(De,"{\n/* [wrapped with "+t+"] */\n")}function isFlattenable(e){return Pn(e)||Tn(e)||!!(kt&&e&&e[kt])}function isIndex(e,t){var r=typeof e;t=t==null?F:t;return!!t&&(r=="number"||r!="symbol"&&Ye.test(e))&&(e>-1&&e%1==0&&e0){if(++t>=I){return arguments[0]}}else{t=0}return e.apply(r,arguments)}}function shuffleSelf(e,t){var n=-1,i=e.length,s=i-1;t=t===r?i:t;while(++n1?e[t-1]:r;n=typeof n=="function"?(e.pop(),n):r;return unzipWith(e,n)});function chain(e){var t=lodash(e);t.__chain__=true;return t}function tap(e,t){t(e);return e}function thru(e,t){return t(e)}var ln=flatRest(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,s=function(t){return baseAt(t,e)};if(t>1||this.__actions__.length||!(i instanceof LazyWrapper)||!isIndex(n)){return this.thru(s)}i=i.slice(n,+n+(t?1:0));i.__actions__.push({func:thru,args:[s],thisArg:r});return new LodashWrapper(i,this.__chain__).thru(function(e){if(t&&!e.length){e.push(r)}return e})});function wrapperChain(){return chain(this)}function wrapperCommit(){return new LodashWrapper(this.value(),this.__chain__)}function wrapperNext(){if(this.__values__===r){this.__values__=toArray(this.value())}var e=this.__index__>=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}}function wrapperToIterator(){return this}function wrapperPlant(e){var t,n=this;while(n instanceof baseLodash){var i=wrapperClone(n);i.__index__=0;i.__values__=r;if(t){s.__wrapped__=i}else{t=i}var s=i;n=n.__wrapped__}s.__wrapped__=e;return t}function wrapperReverse(){var e=this.__wrapped__;if(e instanceof LazyWrapper){var t=e;if(this.__actions__.length){t=new LazyWrapper(this)}t=t.reverse();t.__actions__.push({func:thru,args:[reverse],thisArg:r});return new LodashWrapper(t,this.__chain__)}return this.thru(reverse)}function wrapperValue(){return baseWrapperValue(this.__wrapped__,this.__actions__)}var fn=createAggregator(function(e,t,r){if(lt.call(e,r)){++e[r]}else{baseAssignValue(e,r,1)}});function every(e,t,n){var i=Pn(e)?arrayEvery:baseEvery;if(n&&isIterateeCall(e,t,n)){t=r}return i(e,getIteratee(t,3))}function filter(e,t){var r=Pn(e)?arrayFilter:baseFilter;return r(e,getIteratee(t,3))}var hn=createFind(findIndex);var dn=createFind(findLastIndex);function flatMap(e,t){return baseFlatten(map(e,t),1)}function flatMapDeep(e,t){return baseFlatten(map(e,t),j)}function flatMapDepth(e,t,n){n=n===r?1:toInteger(n);return baseFlatten(map(e,t),n)}function forEach(e,t){var r=Pn(e)?arrayEach:Ir;return r(e,getIteratee(t,3))}function forEachRight(e,t){var r=Pn(e)?arrayEachRight:Ar;return r(e,getIteratee(t,3))}var pn=createAggregator(function(e,t,r){if(lt.call(e,r)){e[r].push(t)}else{baseAssignValue(e,r,[t])}});function includes(e,t,r,n){e=isArrayLike(e)?e:values(e);r=r&&!n?toInteger(r):0;var i=e.length;if(r<0){r=Mt(i+r,0)}return isString(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&baseIndexOf(e,t,r)>-1}var yn=baseRest(function(e,r,n){var i=-1,s=typeof r=="function",o=isArrayLike(e)?t(e.length):[];Ir(e,function(e){o[++i]=s?apply(r,e,n):baseInvoke(e,r,n)});return o});var mn=createAggregator(function(e,t,r){baseAssignValue(e,r,t)});function map(e,t){var r=Pn(e)?arrayMap:baseMap;return r(e,getIteratee(t,3))}function orderBy(e,t,n,i){if(e==null){return[]}if(!Pn(t)){t=t==null?[]:[t]}n=i?r:n;if(!Pn(n)){n=n==null?[]:[n]}return baseOrderBy(e,t,n)}var gn=createAggregator(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]});function reduce(e,t,r){var n=Pn(e)?arrayReduce:baseReduce,i=arguments.length<3;return n(e,getIteratee(t,4),r,i,Ir)}function reduceRight(e,t,r){var n=Pn(e)?arrayReduceRight:baseReduce,i=arguments.length<3;return n(e,getIteratee(t,4),r,i,Ar)}function reject(e,t){var r=Pn(e)?arrayFilter:baseFilter;return r(e,negate(getIteratee(t,3)))}function sample(e){var t=Pn(e)?arraySample:baseSample;return t(e)}function sampleSize(e,t,n){if(n?isIterateeCall(e,t,n):t===r){t=1}else{t=toInteger(t)}var i=Pn(e)?arraySampleSize:baseSampleSize;return i(e,t)}function shuffle(e){var t=Pn(e)?arrayShuffle:baseShuffle;return t(e)}function size(e){if(e==null){return 0}if(isArrayLike(e)){return isString(e)?stringSize(e):e.length}var t=qr(e);if(t==Z||t==ne){return e.size}return baseKeys(e).length}function some(e,t,n){var i=Pn(e)?arraySome:baseSome;if(n&&isIterateeCall(e,t,n)){t=r}return i(e,getIteratee(t,3))}var vn=baseRest(function(e,t){if(e==null){return[]}var r=t.length;if(r>1&&isIterateeCall(e,t[0],t[1])){t=[]}else if(r>2&&isIterateeCall(t[0],t[1],t[2])){t=[t[0]]}return baseOrderBy(e,baseFlatten(t,1),[])});var bn=Tt||function(){return ir.Date.now()};function after(e,t){if(typeof t!="function"){throw new it(o)}e=toInteger(e);return function(){if(--e<1){return t.apply(this,arguments)}}}function ary(e,t,n){t=n?r:t;t=e&&t==null?e.length:t;return createWrap(e,E,r,r,r,r,t)}function before(e,t){var n;if(typeof t!="function"){throw new it(o)}e=toInteger(e);return function(){if(--e>0){n=t.apply(this,arguments)}if(e<=1){t=r}return n}}var wn=baseRest(function(e,t,r){var n=m;if(r.length){var i=replaceHolders(r,getHolder(wn));n|=_}return createWrap(e,n,t,r,i)});var _n=baseRest(function(e,t,r){var n=m|g;if(r.length){var i=replaceHolders(r,getHolder(_n));n|=_}return createWrap(t,n,e,r,i)});function curry(e,t,n){t=n?r:t;var i=createWrap(e,b,r,r,r,r,r,t);i.placeholder=curry.placeholder;return i}function curryRight(e,t,n){t=n?r:t;var i=createWrap(e,w,r,r,r,r,r,t);i.placeholder=curryRight.placeholder;return i}function debounce(e,t,n){var i,s,a,c,u,l,f=0,h=false,d=false,p=true;if(typeof e!="function"){throw new it(o)}t=toNumber(t)||0;if(isObject(n)){h=!!n.leading;d="maxWait"in n;a=d?Mt(toNumber(n.maxWait)||0,t):a;p="trailing"in n?!!n.trailing:p}function invokeFunc(t){var n=i,o=s;i=s=r;f=t;c=e.apply(o,n);return c}function leadingEdge(e){f=e;u=Hr(timerExpired,t);return h?invokeFunc(e):c}function remainingWait(e){var r=e-l,n=e-f,i=t-r;return d?Ut(i,a-n):i}function shouldInvoke(e){var n=e-l,i=e-f;return l===r||n>=t||n<0||d&&i>=a}function timerExpired(){var e=bn();if(shouldInvoke(e)){return trailingEdge(e)}u=Hr(timerExpired,remainingWait(e))}function trailingEdge(e){u=r;if(p&&i){return invokeFunc(e)}i=s=r;return c}function cancel(){if(u!==r){Lr(u)}f=0;i=l=s=u=r}function flush(){return u===r?c:trailingEdge(bn())}function debounced(){var e=bn(),n=shouldInvoke(e);i=arguments;s=this;l=e;if(n){if(u===r){return leadingEdge(l)}if(d){Lr(u);u=Hr(timerExpired,t);return invokeFunc(l)}}if(u===r){u=Hr(timerExpired,t)}return c}debounced.cancel=cancel;debounced.flush=flush;return debounced}var Sn=baseRest(function(e,t){return baseDelay(e,1,t)});var En=baseRest(function(e,t,r){return baseDelay(e,toNumber(t)||0,r)});function flip(e){return createWrap(e,k)}function memoize(e,t){if(typeof e!="function"||t!=null&&typeof t!="function"){throw new it(o)}var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i)){return s.get(i)}var o=e.apply(this,n);r.cache=s.set(i,o)||s;return o};r.cache=new(memoize.Cache||MapCache);return r}memoize.Cache=MapCache;function negate(e){if(typeof e!="function"){throw new it(o)}return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function once(e){return before(2,e)}var Cn=Fr(function(e,t){t=t.length==1&&Pn(t[0])?arrayMap(t[0],baseUnary(getIteratee())):arrayMap(baseFlatten(t,1),baseUnary(getIteratee()));var r=t.length;return baseRest(function(n){var i=-1,s=Ut(n.length,r);while(++i=t});var Tn=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike(e)&<.call(e,"callee")&&!Et.call(e,"callee")};var Pn=t.isArray;var Rn=lr?baseUnary(lr):baseIsArrayBuffer;function isArrayLike(e){return e!=null&&isLength(e.length)&&!isFunction(e)}function isArrayLikeObject(e){return isObjectLike(e)&&isArrayLike(e)}function isBoolean(e){return e===true||e===false||isObjectLike(e)&&baseGetTag(e)==z}var jn=Lt||stubFalse;var Fn=fr?baseUnary(fr):baseIsDate;function isElement(e){return isObjectLike(e)&&e.nodeType===1&&!isPlainObject(e)}function isEmpty(e){if(e==null){return true}if(isArrayLike(e)&&(Pn(e)||typeof e=="string"||typeof e.splice=="function"||jn(e)||Nn(e)||Tn(e))){return!e.length}var t=qr(e);if(t==Z||t==ne){return!e.size}if(isPrototype(e)){return!baseKeys(e).length}for(var r in e){if(lt.call(e,r)){return false}}return true}function isEqual(e,t){return baseIsEqual(e,t)}function isEqualWith(e,t,n){n=typeof n=="function"?n:r;var i=n?n(e,t):r;return i===r?baseIsEqual(e,t,r,n):!!i}function isError(e){if(!isObjectLike(e)){return false}var t=baseGetTag(e);return t==K||t==G||typeof e.message=="string"&&typeof e.name=="string"&&!isPlainObject(e)}function isFinite(e){return typeof e=="number"&&$t(e)}function isFunction(e){if(!isObject(e)){return false}var t=baseGetTag(e);return t==J||t==Y||t==H||t==te}function isInteger(e){return typeof e=="number"&&e==toInteger(e)}function isLength(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=F}function isObject(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}function isObjectLike(e){return e!=null&&typeof e=="object"}var Ln=hr?baseUnary(hr):baseIsMap;function isMatch(e,t){return e===t||baseIsMatch(e,t,getMatchData(t))}function isMatchWith(e,t,n){n=typeof n=="function"?n:r;return baseIsMatch(e,t,getMatchData(t),n)}function isNaN(e){return isNumber(e)&&e!=+e}function isNative(e){if(Wr(e)){throw new qe(s)}return baseIsNative(e)}function isNull(e){return e===null}function isNil(e){return e==null}function isNumber(e){return typeof e=="number"||isObjectLike(e)&&baseGetTag(e)==X}function isPlainObject(e){if(!isObjectLike(e)||baseGetTag(e)!=V){return false}var t=_t(e);if(t===null){return true}var r=lt.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&ut.call(r)==pt}var $n=dr?baseUnary(dr):baseIsRegExp;function isSafeInteger(e){return isInteger(e)&&e>=-F&&e<=F}var Dn=pr?baseUnary(pr):baseIsSet;function isString(e){return typeof e=="string"||!Pn(e)&&isObjectLike(e)&&baseGetTag(e)==ie}function isSymbol(e){return typeof e=="symbol"||isObjectLike(e)&&baseGetTag(e)==se}var Nn=yr?baseUnary(yr):baseIsTypedArray;function isUndefined(e){return e===r}function isWeakMap(e){return isObjectLike(e)&&qr(e)==ae}function isWeakSet(e){return isObjectLike(e)&&baseGetTag(e)==ce}var Mn=createRelationalOperation(baseLt);var qn=createRelationalOperation(function(e,t){return e<=t});function toArray(e){if(!e){return[]}if(isArrayLike(e)){return isString(e)?stringToArray(e):copyArray(e)}if(xt&&e[xt]){return iteratorToArray(e[xt]())}var t=qr(e),r=t==Z?mapToArray:t==ne?setToArray:values;return r(e)}function toFinite(e){if(!e){return e===0?e:0}e=toNumber(e);if(e===j||e===-j){var t=e<0?-1:1;return t*L}return e===e?e:0}function toInteger(e){var t=toFinite(e),r=t%1;return t===t?r?t-r:t:0}function toLength(e){return e?baseClamp(toInteger(e),0,D):0}function toNumber(e){if(typeof e=="number"){return e}if(isSymbol(e)){return $}if(isObject(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=isObject(t)?t+"":t}if(typeof e!="string"){return e===0?e:+e}e=baseTrim(e);var r=Ge.test(e);return r||Je.test(e)?tr(e.slice(2),r?2:8):Be.test(e)?$:+e}function toPlainObject(e){return copyObject(e,keysIn(e))}function toSafeInteger(e){return e?baseClamp(toInteger(e),-F,F):e===0?e:0}function toString(e){return e==null?"":baseToString(e)}var Wn=createAssigner(function(e,t){if(isPrototype(t)||isArrayLike(t)){copyObject(t,keys(t),e);return}for(var r in t){if(lt.call(t,r)){assignValue(e,r,t[r])}}});var Un=createAssigner(function(e,t){copyObject(t,keysIn(t),e)});var Hn=createAssigner(function(e,t,r,n){copyObject(t,keysIn(t),e,n)});var zn=createAssigner(function(e,t,r,n){copyObject(t,keys(t),e,n)});var Bn=flatRest(baseAt);function create(e,t){var r=Or(e);return t==null?r:baseAssign(r,t)}var Gn=baseRest(function(e,t){e=tt(e);var n=-1;var i=t.length;var s=i>2?t[2]:r;if(s&&isIterateeCall(t[0],t[1],s)){i=1}while(++n1);return t});copyObject(e,getAllKeysIn(e),r);if(n){r=baseClone(r,f|h|d,customOmitClone)}var i=t.length;while(i--){baseUnset(r,t[i])}return r});function omitBy(e,t){return pickBy(e,negate(getIteratee(t)))}var ei=flatRest(function(e,t){return e==null?{}:basePick(e,t)});function pickBy(e,t){if(e==null){return{}}var r=arrayMap(getAllKeysIn(e),function(e){return[e]});t=getIteratee(t);return basePickBy(e,r,function(e,r){return t(e,r[0])})}function result(e,t,n){t=castPath(t,e);var i=-1,s=t.length;if(!s){s=1;e=r}while(++it){var i=e;e=t;t=i}if(n||e%1||t%1){var s=Bt();return Ut(e+s*(t-e+er("1e-"+((s+"").length-1))),t)}return baseRandom(e,t)}var ni=createCompounder(function(e,t,r){t=t.toLowerCase();return e+(r?capitalize(t):t)});function capitalize(e){return li(toString(e).toLowerCase())}function deburr(e){e=toString(e);return e&&e.replace(Ze,gr).replace(Wt,"")}function endsWith(e,t,n){e=toString(e);t=baseToString(t);var i=e.length;n=n===r?i:baseClamp(toInteger(n),0,i);var s=n;n-=t.length;return n>=0&&e.slice(n,s)==t}function escape(e){e=toString(e);return e&&xe.test(e)?e.replace(Ce,vr):e}function escapeRegExp(e){e=toString(e);return e&&Fe.test(e)?e.replace(je,"\\$&"):e}var ii=createCompounder(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()});var si=createCompounder(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()});var oi=createCaseFirst("toLowerCase");function pad(e,t,r){e=toString(e);t=toInteger(t);var n=t?stringSize(e):0;if(!t||n>=t){return e}var i=(t-n)/2;return createPadding(jt(i),r)+e+createPadding(Rt(i),r)}function padEnd(e,t,r){e=toString(e);t=toInteger(t);var n=t?stringSize(e):0;return t&&n>>0;if(!n){return[]}e=toString(e);if(e&&(typeof t=="string"||t!=null&&!$n(t))){t=baseToString(t);if(!t&&hasUnicode(e)){return castSlice(stringToArray(e),0,n)}}return e.split(t,n)}var ci=createCompounder(function(e,t,r){return e+(r?" ":"")+li(t)});function startsWith(e,t,r){e=toString(e);r=r==null?0:baseClamp(toInteger(r),0,e.length);t=baseToString(t);return e.slice(r,r+t.length)==t}function template(e,t,n){var i=lodash.templateSettings;if(n&&isIterateeCall(e,t,n)){t=r}e=toString(e);t=Hn({},t,i,customDefaultsAssignIn);var s=Hn({},t.imports,i.imports,customDefaultsAssignIn),o=keys(s),c=baseValues(s,o);var u,l,f=0,h=t.interpolate||Xe,d="__p += '";var p=rt((t.escape||Xe).source+"|"+h.source+"|"+(h===Ae?He:Xe).source+"|"+(t.evaluate||Xe).source+"|$","g");var y="//# sourceURL="+(lt.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Kt+"]")+"\n";e.replace(p,function(t,r,n,i,s,o){n||(n=i);d+=e.slice(f,o).replace(Qe,escapeStringChar);if(r){u=true;d+="' +\n__e("+r+") +\n'"}if(s){l=true;d+="';\n"+s+";\n__p += '"}if(n){d+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"}f=o+t.length;return t});d+="';\n";var m=lt.call(t,"variable")&&t.variable;if(!m){d="with (obj) {\n"+d+"\n}\n"}else if(We.test(m)){throw new qe(a)}d=(l?d.replace(we,""):d).replace(_e,"$1").replace(Se,"$1;");d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(u?", __e = _.escape":"")+(l?", __j = Array.prototype.join;\n"+"function print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var g=fi(function(){return Ve(o,y+"return "+d).apply(r,c)});g.source=d;if(isError(g)){throw g}return g}function toLower(e){return toString(e).toLowerCase()}function toUpper(e){return toString(e).toUpperCase()}function trim(e,t,n){e=toString(e);if(e&&(n||t===r)){return baseTrim(e)}if(!e||!(t=baseToString(t))){return e}var i=stringToArray(e),s=stringToArray(t),o=charsStartIndex(i,s),a=charsEndIndex(i,s)+1;return castSlice(i,o,a).join("")}function trimEnd(e,t,n){e=toString(e);if(e&&(n||t===r)){return e.slice(0,trimmedEndIndex(e)+1)}if(!e||!(t=baseToString(t))){return e}var i=stringToArray(e),s=charsEndIndex(i,stringToArray(t))+1;return castSlice(i,0,s).join("")}function trimStart(e,t,n){e=toString(e);if(e&&(n||t===r)){return e.replace(Le,"")}if(!e||!(t=baseToString(t))){return e}var i=stringToArray(e),s=charsStartIndex(i,stringToArray(t));return castSlice(i,s).join("")}function truncate(e,t){var n=x,i=O;if(isObject(t)){var s="separator"in t?t.separator:s;n="length"in t?toInteger(t.length):n;i="omission"in t?baseToString(t.omission):i}e=toString(e);var o=e.length;if(hasUnicode(e)){var a=stringToArray(e);o=a.length}if(n>=o){return e}var c=n-stringSize(i);if(c<1){return i}var u=a?castSlice(a,0,c).join(""):e.slice(0,c);if(s===r){return u+i}if(a){c+=u.length-c}if($n(s)){if(e.slice(c).search(s)){var l,f=u;if(!s.global){s=rt(s.source,toString(ze.exec(s))+"g")}s.lastIndex=0;while(l=s.exec(f)){var h=l.index}u=u.slice(0,h===r?c:h)}}else if(e.indexOf(baseToString(s),c)!=c){var d=u.lastIndexOf(s);if(d>-1){u=u.slice(0,d)}}return u+i}function unescape(e){e=toString(e);return e&&ke.test(e)?e.replace(Ee,br):e}var ui=createCompounder(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()});var li=createCaseFirst("toUpperCase");function words(e,t,n){e=toString(e);t=n?r:t;if(t===r){return hasUnicodeWord(e)?unicodeWords(e):asciiWords(e)}return e.match(t)||[]}var fi=baseRest(function(e,t){try{return apply(e,r,t)}catch(e){return isError(e)?e:new qe(e)}});var hi=flatRest(function(e,t){arrayEach(t,function(t){t=toKey(t);baseAssignValue(e,t,wn(e[t],e))});return e});function cond(e){var t=e==null?0:e.length,r=getIteratee();e=!t?[]:arrayMap(e,function(e){if(typeof e[1]!="function"){throw new it(o)}return[r(e[0]),e[1]]});return baseRest(function(r){var n=-1;while(++nF){return[]}var r=D,n=Ut(e,D);t=getIteratee(t);e-=D;var i=baseTimes(n,t);while(++r0||t<0)){return new LazyWrapper(n)}if(e<0){n=n.takeRight(-e)}else if(e){n=n.drop(e)}if(t!==r){t=toInteger(t);n=t<0?n.dropRight(-t):n.take(t-e)}return n};LazyWrapper.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()};LazyWrapper.prototype.toArray=function(){return this.take(D)};baseForOwn(LazyWrapper.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=lodash[i?"take"+(t=="last"?"Right":""):t],o=i||/^find/.test(t);if(!s){return}lodash.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,c=t instanceof LazyWrapper,u=a[0],l=c||Pn(t);var f=function(e){var t=s.apply(lodash,arrayPush([e],a));return i&&h?t[0]:t};if(l&&n&&typeof u=="function"&&u.length!=1){c=l=false}var h=this.__chain__,d=!!this.__actions__.length,p=o&&!h,y=c&&!d;if(!o&&l){t=y?t:new LazyWrapper(this);var m=e.apply(t,a);m.__actions__.push({func:thru,args:[f],thisArg:r});return new LodashWrapper(m,h)}if(p&&y){return e.apply(this,a)}m=this.thru(f);return p?i?m.value()[0]:m.value():m}});arrayEach(["pop","push","shift","sort","splice","unshift"],function(e){var t=st[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);lodash.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(Pn(i)?i:[],e)}return this[r](function(r){return t.apply(Pn(r)?r:[],e)})}});baseForOwn(LazyWrapper.prototype,function(e,t){var r=lodash[t];if(r){var n=r.name+"";if(!lt.call(cr,n)){cr[n]=[]}cr[n].push({name:t,func:r})}});cr[createHybrid(r,g).name]=[{name:"wrapper",func:r}];LazyWrapper.prototype.clone=lazyClone;LazyWrapper.prototype.reverse=lazyReverse;LazyWrapper.prototype.value=lazyValue;lodash.prototype.at=ln;lodash.prototype.chain=wrapperChain;lodash.prototype.commit=wrapperCommit;lodash.prototype.next=wrapperNext;lodash.prototype.plant=wrapperPlant;lodash.prototype.reverse=wrapperReverse;lodash.prototype.toJSON=lodash.prototype.valueOf=lodash.prototype.value=wrapperValue;lodash.prototype.first=lodash.prototype.head;if(xt){lodash.prototype[xt]=wrapperToIterator}return lodash};var _r=wr();if(typeof define=="function"&&typeof define.amd=="object"&&define.amd){ir._=_r;define(function(){return _r})}else if(or){(or.exports=_r)._=_r;sr._=_r}else{ir._=_r}}).call(this)},9662:e=>{"use strict";e.exports=(e=>{const t={};for(const[r,n]of Object.entries(e)){t[r.toLowerCase()]=n}return t})},2610:e=>{"use strict";const t=["destroy","setTimeout","socket","headers","trailers","rawHeaders","statusCode","httpVersion","httpVersionMinor","httpVersionMajor","rawTrailers","statusMessage"];e.exports=((e,r)=>{const n=new Set(Object.keys(e).concat(t));for(const t of n){if(t in r){continue}r[t]=typeof e[t]==="function"?e[t].bind(e):e[t]}})},900:e=>{var t=1e3;var r=t*60;var n=r*60;var i=n*24;var s=i*365.25;e.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0){return parse(e)}else if(r==="number"&&isNaN(e)===false){return t.long?fmtLong(e):fmtShort(e)}throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function parse(e){e=String(e);if(e.length>100){return}var o=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!o){return}var a=parseFloat(o[1]);var c=(o[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return undefined}}function fmtShort(e){if(e>=i){return Math.round(e/i)+"d"}if(e>=n){return Math.round(e/n)+"h"}if(e>=r){return Math.round(e/r)+"m"}if(e>=t){return Math.round(e/t)+"s"}return e+"ms"}function fmtLong(e){return plural(e,i,"day")||plural(e,n,"hour")||plural(e,r,"minute")||plural(e,t,"second")||e+" ms"}function plural(e,t,r){if(e{"use strict";const t="text/plain";const r="us-ascii";const n=(e,t)=>{return t.some(t=>t instanceof RegExp?t.test(e):t===e)};const i=(e,{stripHash:n})=>{const i=/^data:(?[^,]*?),(?[^#]*?)(?:#(?.*))?$/.exec(e);if(!i){throw new Error(`Invalid URL: ${e}`)}let{type:s,data:o,hash:a}=i.groups;const c=s.split(";");a=n?"":a;let u=false;if(c[c.length-1]==="base64"){c.pop();u=true}const l=(c.shift()||"").toLowerCase();const f=c.map(e=>{let[t,n=""]=e.split("=").map(e=>e.trim());if(t==="charset"){n=n.toLowerCase();if(n===r){return""}}return`${t}${n?`=${n}`:""}`}).filter(Boolean);const h=[...f];if(u){h.push("base64")}if(h.length!==0||l&&l!==t){h.unshift(l)}return`data:${h.join(";")},${u?o.trim():o}${a?`#${a}`:""}`};const s=(e,t)=>{t={defaultProtocol:"http:",normalizeProtocol:true,forceHttp:false,forceHttps:false,stripAuthentication:true,stripHash:false,stripTextFragment:true,stripWWW:true,removeQueryParameters:[/^utm_\w+/i],removeTrailingSlash:true,removeSingleSlash:true,removeDirectoryIndex:false,sortQueryParameters:true,...t};e=e.trim();if(/^data:/i.test(e)){return i(e,t)}if(/^view-source:/i.test(e)){throw new Error("`view-source:` is not supported as it is a non-standard protocol")}const r=e.startsWith("//");const s=!r&&/^\.*\//.test(e);if(!s){e=e.replace(/^(?!(?:\w+:)?\/\/)|^\/\//,t.defaultProtocol)}const o=new URL(e);if(t.forceHttp&&t.forceHttps){throw new Error("The `forceHttp` and `forceHttps` options cannot be used together")}if(t.forceHttp&&o.protocol==="https:"){o.protocol="http:"}if(t.forceHttps&&o.protocol==="http:"){o.protocol="https:"}if(t.stripAuthentication){o.username="";o.password=""}if(t.stripHash){o.hash=""}else if(t.stripTextFragment){o.hash=o.hash.replace(/#?:~:text.*?$/i,"")}if(o.pathname){o.pathname=o.pathname.replace(/(?0){let e=o.pathname.split("/");const r=e[e.length-1];if(n(r,t.removeDirectoryIndex)){e=e.slice(0,e.length-1);o.pathname=e.slice(1).join("/")+"/"}}if(o.hostname){o.hostname=o.hostname.replace(/\.$/,"");if(t.stripWWW&&/^www\.(?!www\.)(?:[a-z\-\d]{1,63})\.(?:[a-z.\-\d]{2,63})$/.test(o.hostname)){o.hostname=o.hostname.replace(/^www\./,"")}}if(Array.isArray(t.removeQueryParameters)){for(const e of[...o.searchParams.keys()]){if(n(e,t.removeQueryParameters)){o.searchParams.delete(e)}}}if(t.removeQueryParameters===true){o.search=""}if(t.sortQueryParameters){o.searchParams.sort()}if(t.removeTrailingSlash){o.pathname=o.pathname.replace(/\/$/,"")}const a=e;e=o.toString();if(!t.removeSingleSlash&&o.pathname==="/"&&!a.endsWith("/")&&o.hash===""){e=e.replace(/\/$/,"")}if((t.removeTrailingSlash||o.pathname==="/")&&o.hash===""&&t.removeSingleSlash){e=e.replace(/\/$/,"")}if(r&&!t.normalizeProtocol){e=e.replace(/^http:\/\//,"//")}if(t.stripProtocol){e=e.replace(/^(?:https?:)?\/\//,"")}return e};e.exports=s},1223:(e,t,r)=>{var n=r(2940);e.exports=n(once);e.exports.strict=n(onceStrict);once.proto=once(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return once(this)},configurable:true});Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return onceStrict(this)},configurable:true})});function once(e){var t=function(){if(t.called)return t.value;t.called=true;return t.value=e.apply(this,arguments)};t.called=false;return t}function onceStrict(e){var t=function(){if(t.called)throw new Error(t.onceError);t.called=true;return t.value=e.apply(this,arguments)};var r=e.name||"Function wrapped with `once`";t.onceError=r+" shouldn't be called more than once";t.called=false;return t}},9072:e=>{"use strict";class CancelError extends Error{constructor(e){super(e||"Promise was canceled");this.name="CancelError"}get isCanceled(){return true}}class PCancelable{static fn(e){return(...t)=>{return new PCancelable((r,n,i)=>{t.push(i);e(...t).then(r,n)})}}constructor(e){this._cancelHandlers=[];this._isPending=true;this._isCanceled=false;this._rejectOnCancel=true;this._promise=new Promise((t,r)=>{this._reject=r;const n=e=>{if(!this._isCanceled||!s.shouldReject){this._isPending=false;t(e)}};const i=e=>{this._isPending=false;r(e)};const s=e=>{if(!this._isPending){throw new Error("The `onCancel` handler was attached after the promise settled.")}this._cancelHandlers.push(e)};Object.defineProperties(s,{shouldReject:{get:()=>this._rejectOnCancel,set:e=>{this._rejectOnCancel=e}}});return e(n,i,s)})}then(e,t){return this._promise.then(e,t)}catch(e){return this._promise.catch(e)}finally(e){return this._promise.finally(e)}cancel(e){if(!this._isPending||this._isCanceled){return}this._isCanceled=true;if(this._cancelHandlers.length>0){try{for(const e of this._cancelHandlers){e()}}catch(e){this._reject(e);return}}if(this._rejectOnCancel){this._reject(new CancelError(e))}}get isCanceled(){return this._isCanceled}}Object.setPrototypeOf(PCancelable.prototype,Promise.prototype);e.exports=PCancelable;e.exports.CancelError=CancelError},8341:(e,t,r)=>{var n=r(1223);var i=r(1205);var s=r(5747);var o=function(){};var a=/^v?\.0/.test(process.version);var c=function(e){return typeof e==="function"};var u=function(e){if(!a)return false;if(!s)return false;return(e instanceof(s.ReadStream||o)||e instanceof(s.WriteStream||o))&&c(e.close)};var l=function(e){return e.setHeader&&c(e.abort)};var f=function(e,t,r,s){s=n(s);var a=false;e.on("close",function(){a=true});i(e,{readable:t,writable:r},function(e){if(e)return s(e);a=true;s()});var f=false;return function(t){if(a)return;if(f)return;f=true;if(u(e))return e.close(o);if(l(e))return e.abort();if(c(e.destroy))return e.destroy();s(t||new Error("stream was destroyed"))}};var h=function(e){e()};var d=function(e,t){return e.pipe(t)};var p=function(){var e=Array.prototype.slice.call(arguments);var t=c(e[e.length-1]||o)&&e.pop()||o;if(Array.isArray(e[0]))e=e[0];if(e.length<2)throw new Error("pump requires two streams per minimum");var r;var n=e.map(function(i,s){var o=s0;return f(i,o,a,function(e){if(!r)r=e;if(e)n.forEach(h);if(o)return;n.forEach(h);t(r)})});return e.reduce(d)};e.exports=p},9273:e=>{"use strict";class QuickLRU{constructor(e={}){if(!(e.maxSize&&e.maxSize>0)){throw new TypeError("`maxSize` must be a number greater than 0")}this.maxSize=e.maxSize;this.onEviction=e.onEviction;this.cache=new Map;this.oldCache=new Map;this._size=0}_set(e,t){this.cache.set(e,t);this._size++;if(this._size>=this.maxSize){this._size=0;if(typeof this.onEviction==="function"){for(const[e,t]of this.oldCache.entries()){this.onEviction(e,t)}}this.oldCache=this.cache;this.cache=new Map}}get(e){if(this.cache.has(e)){return this.cache.get(e)}if(this.oldCache.has(e)){const t=this.oldCache.get(e);this.oldCache.delete(e);this._set(e,t);return t}}set(e,t){if(this.cache.has(e)){this.cache.set(e,t)}else{this._set(e,t)}return this}has(e){return this.cache.has(e)||this.oldCache.has(e)}peek(e){if(this.cache.has(e)){return this.cache.get(e)}if(this.oldCache.has(e)){return this.oldCache.get(e)}}delete(e){const t=this.cache.delete(e);if(t){this._size--}return this.oldCache.delete(e)||t}clear(){this.cache.clear();this.oldCache.clear();this._size=0}*keys(){for(const[e]of this){yield e}}*values(){for(const[,e]of this){yield e}}*[Symbol.iterator](){for(const e of this.cache){yield e}for(const e of this.oldCache){const[t]=e;if(!this.cache.has(t)){yield e}}}get size(){let e=0;for(const t of this.oldCache.keys()){if(!this.cache.has(t)){e++}}return Math.min(this._size+e,this.maxSize)}}e.exports=QuickLRU},4518:(e,t,r)=>{var n=function(){return this}()||Function("return this")();var i=n.regeneratorRuntime&&Object.getOwnPropertyNames(n).indexOf("regeneratorRuntime")>=0;var s=i&&n.regeneratorRuntime;n.regeneratorRuntime=undefined;e.exports=r(4307);if(i){n.regeneratorRuntime=s}else{try{delete n.regeneratorRuntime}catch(e){n.regeneratorRuntime=undefined}}},4307:e=>{!function(t){"use strict";var r=Object.prototype;var n=r.hasOwnProperty;var i;var s=typeof Symbol==="function"?Symbol:{};var o=s.iterator||"@@iterator";var a=s.asyncIterator||"@@asyncIterator";var c=s.toStringTag||"@@toStringTag";var u="object"==="object";var l=t.regeneratorRuntime;if(l){if(u){e.exports=l}return}l=t.regeneratorRuntime=u?e.exports:{};function wrap(e,t,r,n){var i=t&&t.prototype instanceof Generator?t:Generator;var s=Object.create(i.prototype);var o=new Context(n||[]);s._invoke=makeInvokeMethod(e,r,o);return s}l.wrap=wrap;function tryCatch(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}var f="suspendedStart";var h="suspendedYield";var d="executing";var p="completed";var y={};function Generator(){}function GeneratorFunction(){}function GeneratorFunctionPrototype(){}var m={};m[o]=function(){return this};var g=Object.getPrototypeOf;var v=g&&g(g(values([])));if(v&&v!==r&&n.call(v,o)){m=v}var b=GeneratorFunctionPrototype.prototype=Generator.prototype=Object.create(m);GeneratorFunction.prototype=b.constructor=GeneratorFunctionPrototype;GeneratorFunctionPrototype.constructor=GeneratorFunction;GeneratorFunctionPrototype[c]=GeneratorFunction.displayName="GeneratorFunction";function defineIteratorMethods(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}l.isGeneratorFunction=function(e){var t=typeof e==="function"&&e.constructor;return t?t===GeneratorFunction||(t.displayName||t.name)==="GeneratorFunction":false};l.mark=function(e){if(Object.setPrototypeOf){Object.setPrototypeOf(e,GeneratorFunctionPrototype)}else{e.__proto__=GeneratorFunctionPrototype;if(!(c in e)){e[c]="GeneratorFunction"}}e.prototype=Object.create(b);return e};l.awrap=function(e){return{__await:e}};function AsyncIterator(e){function invoke(t,r,i,s){var o=tryCatch(e[t],e,r);if(o.type==="throw"){s(o.arg)}else{var a=o.arg;var c=a.value;if(c&&typeof c==="object"&&n.call(c,"__await")){return Promise.resolve(c.__await).then(function(e){invoke("next",e,i,s)},function(e){invoke("throw",e,i,s)})}return Promise.resolve(c).then(function(e){a.value=e;i(a)},s)}}var t;function enqueue(e,r){function callInvokeWithMethodAndArg(){return new Promise(function(t,n){invoke(e,r,t,n)})}return t=t?t.then(callInvokeWithMethodAndArg,callInvokeWithMethodAndArg):callInvokeWithMethodAndArg()}this._invoke=enqueue}defineIteratorMethods(AsyncIterator.prototype);AsyncIterator.prototype[a]=function(){return this};l.AsyncIterator=AsyncIterator;l.async=function(e,t,r,n){var i=new AsyncIterator(wrap(e,t,r,n));return l.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})};function makeInvokeMethod(e,t,r){var n=f;return function invoke(i,s){if(n===d){throw new Error("Generator is already running")}if(n===p){if(i==="throw"){throw s}return doneResult()}r.method=i;r.arg=s;while(true){var o=r.delegate;if(o){var a=maybeInvokeDelegate(o,r);if(a){if(a===y)continue;return a}}if(r.method==="next"){r.sent=r._sent=r.arg}else if(r.method==="throw"){if(n===f){n=p;throw r.arg}r.dispatchException(r.arg)}else if(r.method==="return"){r.abrupt("return",r.arg)}n=d;var c=tryCatch(e,t,r);if(c.type==="normal"){n=r.done?p:h;if(c.arg===y){continue}return{value:c.arg,done:r.done}}else if(c.type==="throw"){n=p;r.method="throw";r.arg=c.arg}}}}function maybeInvokeDelegate(e,t){var r=e.iterator[t.method];if(r===i){t.delegate=null;if(t.method==="throw"){if(e.iterator.return){t.method="return";t.arg=i;maybeInvokeDelegate(e,t);if(t.method==="throw"){return y}}t.method="throw";t.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var n=tryCatch(r,e.iterator,t.arg);if(n.type==="throw"){t.method="throw";t.arg=n.arg;t.delegate=null;return y}var s=n.arg;if(!s){t.method="throw";t.arg=new TypeError("iterator result is not an object");t.delegate=null;return y}if(s.done){t[e.resultName]=s.value;t.next=e.nextLoc;if(t.method!=="return"){t.method="next";t.arg=i}}else{return s}t.delegate=null;return y}defineIteratorMethods(b);b[c]="Generator";b[o]=function(){return this};b.toString=function(){return"[object Generator]"};function pushTryEntry(e){var t={tryLoc:e[0]};if(1 in e){t.catchLoc=e[1]}if(2 in e){t.finallyLoc=e[2];t.afterLoc=e[3]}this.tryEntries.push(t)}function resetTryEntry(e){var t=e.completion||{};t.type="normal";delete t.arg;e.completion=t}function Context(e){this.tryEntries=[{tryLoc:"root"}];e.forEach(pushTryEntry,this);this.reset(true)}l.keys=function(e){var t=[];for(var r in e){t.push(r)}t.reverse();return function next(){while(t.length){var r=t.pop();if(r in e){next.value=r;next.done=false;return next}}next.done=true;return next}};function values(e){if(e){var t=e[o];if(t){return t.call(e)}if(typeof e.next==="function"){return e}if(!isNaN(e.length)){var r=-1,s=function next(){while(++r=0;--r){var s=this.tryEntries[r];var o=s.completion;if(s.tryLoc==="root"){return handle("end")}if(s.tryLoc<=this.prev){var a=n.call(s,"catchLoc");var c=n.call(s,"finallyLoc");if(a&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e){this.complete(r.completion,r.afterLoc);resetTryEntry(r);return y}}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if(n.type==="throw"){var i=n.arg;resetTryEntry(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){this.delegate={iterator:values(e),resultName:t,nextLoc:r};if(this.method==="next"){this.arg=i}return y}}}(function(){return this}()||Function("return this")())},6624:(e,t,r)=>{"use strict";const n=r(4016);e.exports=((e={},t=n.connect)=>new Promise((r,n)=>{let i=false;let s;const o=async()=>{await c;s.off("timeout",a);s.off("error",n);if(e.resolveSocket){r({alpnProtocol:s.alpnProtocol,socket:s,timeout:i});if(i){await Promise.resolve();s.emit("timeout")}}else{s.destroy();r({alpnProtocol:s.alpnProtocol,timeout:i})}};const a=async()=>{i=true;o()};const c=(async()=>{try{s=await t(e,o);s.on("error",n);s.once("timeout",a)}catch(e){n(e)}})()}))},9004:(e,t,r)=>{"use strict";const n=r(2413).Readable;const i=r(9662);class Response extends n{constructor(e,t,r,n){if(typeof e!=="number"){throw new TypeError("Argument `statusCode` should be a number")}if(typeof t!=="object"){throw new TypeError("Argument `headers` should be an object")}if(!(r instanceof Buffer)){throw new TypeError("Argument `body` should be a buffer")}if(typeof n!=="string"){throw new TypeError("Argument `url` should be a string")}super();this.statusCode=e;this.headers=i(t);this.body=r;this.url=n}_read(){this.push(this.body);this.push(null)}}e.exports=Response},9318:(e,t,r)=>{"use strict";const n=r(2087);const i=r(1621);const s=process.env;let o;if(i("no-color")||i("no-colors")||i("color=false")){o=false}else if(i("color")||i("colors")||i("color=true")||i("color=always")){o=true}if("FORCE_COLOR"in s){o=s.FORCE_COLOR.length===0||parseInt(s.FORCE_COLOR,10)!==0}function translateLevel(e){if(e===0){return false}return{level:e,hasBasic:true,has256:e>=2,has16m:e>=3}}function supportsColor(e){if(o===false){return 0}if(i("color=16m")||i("color=full")||i("color=truecolor")){return 3}if(i("color=256")){return 2}if(e&&!e.isTTY&&o!==true){return 0}const t=o?1:0;if(process.platform==="win32"){const e=n.release().split(".");if(Number(process.versions.node.split(".")[0])>=8&&Number(e[0])>=10&&Number(e[2])>=10586){return Number(e[2])>=14931?3:2}return 1}if("CI"in s){if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI"].some(e=>e in s)||s.CI_NAME==="codeship"){return 1}return t}if("TEAMCITY_VERSION"in s){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(s.TEAMCITY_VERSION)?1:0}if(s.COLORTERM==="truecolor"){return 3}if("TERM_PROGRAM"in s){const e=parseInt((s.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(s.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}if(/-256(color)?$/i.test(s.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(s.TERM)){return 1}if("COLORTERM"in s){return 1}if(s.TERM==="dumb"){return t}return t}function getSupportLevel(e){const t=supportsColor(e);return translateLevel(t)}e.exports={supportsColor:getSupportLevel,stdout:getSupportLevel(process.stdout),stderr:getSupportLevel(process.stderr)}},9046:(e,t)=>{"use strict";t.fromCallback=function(e){return Object.defineProperty(function(...t){if(typeof t[t.length-1]==="function")e.apply(this,t);else{return new Promise((r,n)=>{e.call(this,...t,(e,t)=>e!=null?n(e):r(t))})}},"name",{value:e.name})};t.fromPromise=function(e){return Object.defineProperty(function(...t){const r=t[t.length-1];if(typeof r!=="function")return e.apply(this,t);else e.apply(this,t.slice(0,-1)).then(e=>r(null,e),r)},"name",{value:e.name})}},2940:e=>{e.exports=wrappy;function wrappy(e,t){if(e&&t)return wrappy(e)(t);if(typeof e!=="function")throw new TypeError("need wrapper function");Object.keys(e).forEach(function(t){wrapper[t]=e[t]});return wrapper;function wrapper(){var t=new Array(arguments.length);for(var r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.default=[{header:"Invoke",content:"Invoke/trigger online functions."},{header:"Usage",content:"$ s invoke "},{header:"Options",optionList:[{name:"invocation-type",description:'Invocation type: optional value "async"|"sync", default value "sync" (default: "sync")',type:String},{name:"event",description:'Event data (strings) passed to the function during invocation (default: "").Http function format refers to [https://github.com/devsapp/fc-remote-invoke#特别说明]',type:String},{name:"event-file",description:"Event funtion: A file containing event data passed to the function during invoke. Http function: A file containing http request options sent to http trigger. Format refers to [https://github.com/devsapp/fc-remote-invoke#特别说明]",alias:"f",type:String},{name:"event-stdin",description:"Read from standard input, to support script pipeline.Http function format refers to [https://github.com/devsapp/fc-remote-invoke#特别说明]",type:Boolean},{name:"region",description:"Specify region in cli mode",type:String},{name:"service-name",description:"Specify service name in cli mode",type:String},{name:"function-name",description:"Specify function name in cli mode",type:String},{name:"domain-name",description:"Specify custom domain name in cli mode",type:String}]},{header:"Global Options",optionList:[{name:"access",description:"Specify key alias.",alias:"a",type:Boolean},{name:"help",description:"fc-remote-invoke help for command.",alias:"h",type:Boolean}]},{header:"Examples with Yaml",content:["$ s invoke","$ s invoke","$ s exec -- invoke --invocation-type sync --event ","$ s exec -- invoke --event-file ","$ s exec -- invoke --event-stdin"]},{header:"Examples with CLI",content:[{example:"$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event "},{example:"$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event-file "},{example:"$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event-stdin"},{example:"\nYou also can refer to the usage of fc-api and execute [s cli fc-api -h] for help. $ s cli fc-api invokeFunction -h"}]}]},8989:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});const n=r(7782);class ComponentLogger{static setContent(e){ComponentLogger.CONTENT=e}static log(e,t){n.Logger.log(e,t)}static info(e){n.Logger.info(ComponentLogger.CONTENT,e)}static debug(e){n.Logger.debug(ComponentLogger.CONTENT,e)}static error(e){n.Logger.error(ComponentLogger.CONTENT,e)}static warning(e){n.Logger.warn(ComponentLogger.CONTENT,e)}static success(e){n.Logger.log(e,"green")}}t.default=ComponentLogger;ComponentLogger.CONTENT="FC-REMOTE-INVOKE"},6144:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=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.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const c=a(r(250));const u=s(r(7782));const l=a(r(8989));const f=a(r(465));const h=r(8107);const d=a(r(1093));const p=a(r(2522));class FcRemoteInvoke{invoke(e){return o(this,void 0,void 0,function*(){const{props:t,eventPayload:r,credentials:n,isHelp:i,invocationType:s}=yield this.handlerInputs(e);yield this.report("fc-remote-invoke","invoke",n===null||n===void 0?void 0:n.AccountID);if(i){u.help(f.default);return}let o;if(!t.domainName){o=yield p.default.buildFcClient(t.region,n)}const a=new d.default(o,n.AccountID);yield a.invoke(t,r,{invocationType:s})})}report(e,t,r){return o(this,void 0,void 0,function*(){u.reportComponent(e,{command:t,uid:r})})}handlerInputs(e){var t,r,n,i,s,a;return o(this,void 0,void 0,function*(){const o=((e===null||e===void 0?void 0:e.args)||"").replace(/(^\s*)|(\s*$)/g,"");l.default.debug(`input args: ${o}`);const f=u.commandParse(Object.assign(Object.assign({},e),{args:o}),{boolean:["help","event-stdin"],string:["invocation-type","event","event-file","region","domain-name","service-name","function-name","qualifier"],alias:{help:"h",event:"e","event-file":"f"}});const d=(f===null||f===void 0?void 0:f.data)||{};l.default.debug(`command parse: ${JSON.stringify(d)}`);if(d.help){return{credentials:e.credentials,isHelp:true}}const{e:p,f:y,"event-stdin":m,"invocation-type":g="sync","domain-name":v}=d;const b={event:p,eventFile:y,eventStdin:m};const w=!!p+!!y+!!m;if(w>1){throw new Error("event | event-file | event-stdin must choose one.")}else if(w===0){b.event=""}if(!["sync","async"].includes(g)){throw new Error("invocation-type enum value sync, async.")}if(!v&&!(e===null||e===void 0?void 0:e.credentials)){e.credentials=yield u.getCredential((t=e===null||e===void 0?void 0:e.project)===null||t===void 0?void 0:t.access)}l.default.debug(`input props: ${JSON.stringify(e.props)}`);const _={region:d.region||((r=e.props)===null||r===void 0?void 0:r.region),serviceName:d["service-name"]||((n=e.props)===null||n===void 0?void 0:n.serviceName),functionName:d["function-name"]||((i=e.props)===null||i===void 0?void 0:i.functionName),domainName:v||((s=e.props)===null||s===void 0?void 0:s.domainName),qualifier:d.qualifier||((a=e.props)===null||a===void 0?void 0:a.qualifier)};l.default.debug(`input args props: ${JSON.stringify(_)}`);if(!h.isProperties(_)){throw new Error("region/serviceName(service-name)/functionName(function-name) can not be empty.")}return{props:_,credentials:e.credentials,eventPayload:b,isHelp:false,invocationType:c.default.upperFirst(g)}})}}t.default=FcRemoteInvoke},8107:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isProperties=void 0;function isProperties(e){if(!e){return false}return e.domainName||e.region&&e.serviceName&&e.functionName}t.isProperties=isProperties},2522:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){if(n===undefined)n=r;Object.defineProperty(e,n,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,n){if(n===undefined)n=r;e[n]=t[r]});var i=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.hasOwnProperty.call(e,r))n(t,e,r);i(t,e);return t};var o=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const c=a(r(3495));const u=a(r(1191));const l=a(r(8683));const f=a(r(9074));const h=s(r(7782));c.default.prototype.costom_request=function(e,t,r,n,i={},s={}){return o(this,void 0,void 0,function*(){var o=`${this.endpoint}/${this.version}${t}`;if(r&&Object.keys(r).length>0){o=`${o}?${u.default.stringify(r)}`}i=Object.assign(this.buildHeaders(),this.headers,i);var a;if(n){var h=null;if(Buffer.isBuffer(n)){h=n;i["content-type"]="application/octet-stream"}else if(typeof n==="string"){h=new Buffer(n,"utf8");i["content-type"]="application/octet-stream"}else if("function"===typeof n.pipe){h=n;i["content-type"]="application/octet-stream"}else{h=new Buffer(JSON.stringify(n),"utf8");i["content-type"]="application/json"}if("function"!==typeof n.pipe){const e=l.default.md5(h,"hex");const t=new Buffer(e,"utf8").toString("base64");i["content-length"]=h.length;i["content-md5"]=t}a=h}var d=null;if(t.startsWith("/proxy/")){d=r||{}}var p=c.default.getSignature(this.accessKeyID,this.accessKeySecret,e,`/${this.version}${t}`,i,d);i["authorization"]=p;const y=yield f.default.request(o,{method:e,timeout:this.timeout,headers:i,data:a});var m;if(!s["rawBuf"]||y.headers["x-fc-error-type"]){m=yield f.default.read(y,"utf8")}else{m=yield f.default.read(y)}const g=y.headers["content-type"]||"";if(g.startsWith("application/json")){try{m=JSON.parse(m)}catch(e){}}let v;if(y.statusCode<200||y.statusCode>=300){const r=y.statusCode;const n=y.headers["x-fc-request-id"];var b;if(m.ErrorMessage){b=m.ErrorMessage}else{b=m.errorMessage}v=new Error(`${e} ${t} failed with ${r}. requestid: ${n}, message: ${b}.`);v.name=`FC${m.ErrorCode}Error`;v.code=m.ErrorCode}return{err:v,code:y.statusCode,headers:y.headers,data:m}})};class Client{static buildFcClient(e,t){return o(this,void 0,void 0,function*(){return new c.default(t.AccountID,{accessKeyID:t.AccessKeyID,accessKeySecret:t.AccessKeySecret,securityToken:t.SecurityToken,region:e,endpoint:yield this.getFcEndpoint(),timeout:6e6})})}static getFcEndpoint(){return o(this,void 0,void 0,function*(){const e=yield h.loadComponent("devsapp/fc-default");const t=yield e.get({args:"fc-endpoint"});if(!t){return undefined}const r=yield e.get({args:"enable-fc-endpoint"});return r===true||r==="true"?t:undefined})}}t.default=Client},9009:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const s=i(r(5622));const o=i(r(5630));const a=r(250);const c=i(r(1058));const u=i(r(8989));const l=r(7776);class File{static getEvent(e){return n(this,void 0,void 0,function*(){let t=yield l.getStdin();if(!e)return t;return yield new Promise((r,n)=>{let i;if(e==="-"){u.default.log("Reading event data from stdin, which can be ended with Enter then Ctrl+D");i=process.stdin}else{i=o.default.createReadStream(e,{encoding:"utf-8"})}const s=c.default.createInterface({input:i,output:process.stdout});t="";s.on("line",e=>{t+=e});s.on("close",()=>r(t));s.on("SIGINT",()=>n(new Error("^C")))})})}static eventPriority(e){return n(this,void 0,void 0,function*(){let t;if(a.isString(e.event)){return e.event}else if(e.eventStdin){t="-"}else if(e.eventFile){t=s.default.resolve(process.cwd(),e.eventFile)}return yield this.getEvent(t)})}}t.default=File},1093:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const s=i(r(250));const o=i(r(3061));const a=i(r(9009));const c=i(r(8989));class RemoteInvoke{constructor(e,t){this.fcClient=e;this.accountId=t}invoke(e,t,{invocationType:r}){return n(this,void 0,void 0,function*(){const n=yield a.default.eventPriority(t);c.default.debug(`event: ${n}`);const{region:i,serviceName:o,functionName:u,domainName:l,qualifier:f}=e;if(l){return this.requestDomain(l,n)}const h=yield this.getHttpTrigger(o,u);const d={event:n,serviceName:o,functionName:u,qualifier:f};if(s.default.isEmpty(h)){d.invocationType=r;d.event=n;yield this.eventInvoke(d)}else{d.region=i;d.event=this.getJsonEvent(n);yield this.httpInvoke(d)}})}requestDomain(e,t){return n(this,void 0,void 0,function*(){const r=this.getJsonEvent(t);if(s.default.isEmpty(r.headers)){r.headers={}}r.headers["X-Fc-Log-Type"]="Tail";const{body:n,headers:i}=yield o.default(e,r);this.showLog(i["x-fc-log-result"]);c.default.log("\nFC Invoke Result:","green");console.log(n);c.default.log("\n")})}getHttpTrigger(e,t){return n(this,void 0,void 0,function*(){const{data:r}=yield this.fcClient.listTriggers(e,t);c.default.debug(`get listTriggers: ${JSON.stringify(r)}`);if(s.default.isEmpty(r.triggers)){return[]}const n=r.triggers.filter(e=>e.triggerType==="http"||e.triggerType==="https");if(s.default.isEmpty(n)){return[]}return n})}eventInvoke({serviceName:e,functionName:t,event:r,qualifier:i="LATEST",invocationType:s}){return n(this,void 0,void 0,function*(){if(s==="Sync"){const n=yield this.fcClient.invokeFunction(e,t,r,{"X-Fc-Log-Type":"Tail","X-Fc-Invocation-Type":s},i);this.showLog(n.headers["x-fc-log-result"]);c.default.log("\nFC Invoke Result:","green");console.log(n.data);console.log("\n")}else{const{headers:n}=yield this.fcClient.invokeFunction(e,t,r,{"X-Fc-Invocation-Type":s},i);const o=n["x-fc-request-id"];c.default.log(`\n${e}/${t} async invoke success.\n${o?`request id: ${o}\n`:""}`,"green")}})}httpInvoke({region:e,serviceName:t,functionName:r,event:i,qualifier:s}){return n(this,void 0,void 0,function*(){const n=s?`.${s}`:"";i.path=`/proxy/${t}${n}/${r}/${i.path||""}`;c.default.log(`https://${this.accountId}.${e}.fc.aliyuncs.com/2016-08-15/proxy/${t}${n}/${r}/`);yield this.request(i)})}request(e){return n(this,void 0,void 0,function*(){const{headers:t,queries:r,method:n,path:i,body:s}=this.handlerHttpParmase(e);let o;try{const e=n.toLocaleUpperCase();c.default.debug(`method is ${e}.`);c.default.debug(`start invoke.`);if(e==="GET"){o=yield this.fcClient.costom_request("GET",i,r,null,t)}else if(e==="POST"){o=yield this.fcClient.costom_request("POST",i,r,s,t)}else if(e==="PUT"){o=yield this.fcClient.costom_request("PUT",i,null,s,t)}else if(e==="DELETE"){o=yield this.fcClient.costom_request("DELETE",i,r,null,t)}else if(n.toLocaleUpperCase()==="PATCH"){o=yield this.fcClient.costom_request("PATCH",i,r,s,t)}else if(n.toLocaleUpperCase()==="HEAD"){o=yield this.fcClient.costom_request("HEAD",i,r,s,t)}else{c.default.error(`Does not support ${n} requests temporarily.`)}}catch(e){c.default.debug(e);if(e.message==="Unexpected token r in JSON at position 0"&&e.stack.includes("/fc2/lib/client.js")&&e.stack.includes("at Client.request")){throw new Error("The body in http responss is not in json format, but the content-type in response header is application/json. We recommend that you make the format of the response body be consistent with the content-type in response header.")}throw e}c.default.debug(`end invoke.`);if(o===null||o===void 0?void 0:o.err){this.showLog(o.headers["x-fc-log-result"]);c.default.log(`\nFC Invoke Result[code: ${o.code}]:`,"red");console.log(o.data);console.log("\n")}else{if(o){this.showLog(o.headers["x-fc-log-result"]);c.default.log("\nFC Invoke Result[code: ${resp.code}]:","green");console.log(o.data);console.log("\n")}}})}handlerHttpParmase(e){const{body:t="",headers:r={},method:n="GET",queries:i="",path:s=""}=e;let o;if(t){let e=null;if(Buffer.isBuffer(t)){e=t;r["content-type"]="application/octet-stream"}else if(typeof t==="string"){e=Buffer.from(t,"utf8");r["content-type"]="application/octet-stream"}else if(typeof t.pipe==="function"){e=t;r["content-type"]="application/octet-stream"}else{e=Buffer.from(JSON.stringify(t),"utf8");r["content-type"]="application/json"}o=e}if(!r["X-Fc-Log-Type"]){r["X-Fc-Log-Type"]="Tail"}return{headers:r,queries:i,method:n,path:s,body:o}}showLog(e){if(e){c.default.log("========= FC invoke Logs begin =========","yellow");const t=Buffer.from(e,"base64");c.default.log(t.toString());c.default.log("========= FC invoke Logs end =========","yellow")}}getJsonEvent(e){try{return e?JSON.parse(e):{}}catch(e){c.default.debug(e);throw new Error("handler event error. Example: https://github.com/devsapp/fc-remote-invoke/blob/master/example/http.json")}}}t.default=RemoteInvoke},7776:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,i){function fulfilled(e){try{step(n.next(e))}catch(e){i(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){i(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var n=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof __values==="function"?__values(e):e[Symbol.iterator](),r={},verb("next"),verb("throw"),verb("return"),r[Symbol.asyncIterator]=function(){return this},r);function verb(t){r[t]=e[t]&&function(r){return new Promise(function(n,i){r=e[t](r),settle(n,i,r.done,r.value)})}}function settle(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}};Object.defineProperty(t,"__esModule",{value:true});t.getStdin=void 0;const{stdin:i}=process;function getStdin(){var e,t;return r(this,void 0,void 0,function*(){let r="";if(i.isTTY){return r}i.setEncoding("utf8");try{for(var s=n(i),o;o=yield s.next(),!o.done;){const e=o.value;r+=e}}catch(t){e={error:t}}finally{try{if(o&&!o.done&&(t=s.return))yield t.call(s)}finally{if(e)throw e.error}}return r})}t.getStdin=getStdin;getStdin.buffer=(()=>r(void 0,void 0,void 0,function*(){var e,t;const r=[];let s=0;if(i.isTTY){return Buffer.concat([])}try{for(var o=n(i),a;a=yield o.next(),!a.done;){const e=a.value;r.push(e);s+=e.length}}catch(t){e={error:t}}finally{try{if(a&&!a.done&&(t=o.return))yield t.call(o)}finally{if(e)throw e.error}}return Buffer.concat(r,s)}))},7782:e=>{"use strict";e.exports=require("@serverless-devs/core")},2357:e=>{"use strict";e.exports=require("assert")},4293:e=>{"use strict";e.exports=require("buffer")},7619:e=>{"use strict";e.exports=require("constants")},6417:e=>{"use strict";e.exports=require("crypto")},881:e=>{"use strict";e.exports=require("dns")},8614:e=>{"use strict";e.exports=require("events")},5747:e=>{"use strict";e.exports=require("fs")},8605:e=>{"use strict";e.exports=require("http")},7565:e=>{"use strict";e.exports=require("http2")},7211:e=>{"use strict";e.exports=require("https")},1631:e=>{"use strict";e.exports=require("net")},2087:e=>{"use strict";e.exports=require("os")},5622:e=>{"use strict";e.exports=require("path")},1191:e=>{"use strict";e.exports=require("querystring")},1058:e=>{"use strict";e.exports=require("readline")},2413:e=>{"use strict";e.exports=require("stream")},4016:e=>{"use strict";e.exports=require("tls")},3867:e=>{"use strict";e.exports=require("tty")},8835:e=>{"use strict";e.exports=require("url")},1669:e=>{"use strict";e.exports=require("util")},8761:e=>{"use strict";e.exports=require("zlib")}};var t={};function __webpack_require__(r){if(t[r]){return t[r].exports}var n=t[r]={id:r,loaded:false,exports:{}};var i=true;try{e[r].call(n.exports,n,n.exports,__webpack_require__);i=false}finally{if(i)delete t[r]}n.loaded=true;return n.exports}(()=>{__webpack_require__.nmd=(e=>{e.paths=[];if(!e.children)e.children=[];return e})})();__webpack_require__.ab=__dirname+"/";return __webpack_require__(6144)})(); \ No newline at end of file diff --git a/lib/interface/entity.d.ts b/lib/interface/entity.d.ts new file mode 100644 index 0000000..6c07118 --- /dev/null +++ b/lib/interface/entity.d.ts @@ -0,0 +1,34 @@ +export interface ICredentials { + AccountID?: string; + AccessKeyID?: string; + AccessKeySecret?: string; + SecurityToken?: string; +} +export interface InputProps { + props?: IProperties; + credentials: ICredentials; + appName: string; + project: { + component: string; + access: string; + projectName: string; + }; + command: string; + args: string; + path: { + configPath: string; + }; +} +export interface IProperties { + region: string; + serviceName: string; + functionName: string; + qualifier?: string; + domainName?: string; +} +export declare function isProperties(args: any): args is IProperties; +export interface IEventPayload { + event?: string; + eventFile?: string; + eventStdin?: boolean; +} diff --git a/lib/lib/client.d.ts b/lib/lib/client.d.ts new file mode 100644 index 0000000..1fb958e --- /dev/null +++ b/lib/lib/client.d.ts @@ -0,0 +1,5 @@ +import { ICredentials } from '../interface/entity'; +export default class Client { + static buildFcClient(region: string, credentials: ICredentials): Promise; + private static getFcEndpoint; +} diff --git a/lib/lib/event.d.ts b/lib/lib/event.d.ts new file mode 100644 index 0000000..26aa5f3 --- /dev/null +++ b/lib/lib/event.d.ts @@ -0,0 +1,4 @@ +export default class File { + static getEvent(eventFile: any): Promise; + static eventPriority(eventPriority: any): Promise; +} diff --git a/lib/lib/handler-body.d.ts b/lib/lib/handler-body.d.ts new file mode 100644 index 0000000..1510928 --- /dev/null +++ b/lib/lib/handler-body.d.ts @@ -0,0 +1 @@ +export default function handlerBody(contentType: string, body: any): any; diff --git a/lib/lib/remote-invoke.d.ts b/lib/lib/remote-invoke.d.ts new file mode 100644 index 0000000..8a06b58 --- /dev/null +++ b/lib/lib/remote-invoke.d.ts @@ -0,0 +1,39 @@ +import { IProperties, IEventPayload } from '../interface/entity'; +export default class RemoteInvoke { + fcClient: any; + accountId: string; + constructor(fcClient: any, accountId: string); + invoke(props: IProperties, eventPayload: IEventPayload, { invocationType }: { + invocationType: any; + }): Promise; + requestDomain(url: string, event: string): Promise; + getHttpTrigger(serviceName: any, functionName: any): Promise; + eventInvoke({ serviceName, functionName, event, qualifier, invocationType }: { + serviceName: any; + functionName: any; + event: any; + qualifier?: string; + invocationType: any; + }): Promise; + httpInvoke({ region, serviceName, functionName, event, qualifier }: { + region: any; + serviceName: any; + functionName: any; + event: any; + qualifier: any; + }): Promise; + /** + * @param event: { body, headers, method, queries, path } + * path 组装后的路径 /proxy/serviceName/functionName/path , + */ + request(event: any): Promise; + handlerHttpParmase(event: any): { + headers: any; + queries: any; + method: any; + path: any; + body: any; + }; + private showLog; + private getJsonEvent; +} diff --git a/lib/lib/stdin.d.ts b/lib/lib/stdin.d.ts new file mode 100644 index 0000000..ed45d22 --- /dev/null +++ b/lib/lib/stdin.d.ts @@ -0,0 +1,5 @@ +/// +export declare function getStdin(): Promise; +export declare namespace getStdin { + var buffer: () => Promise; +} diff --git a/package.json b/package.json index ce8ef7b..48bf67b 100644 --- a/package.json +++ b/package.json @@ -30,9 +30,11 @@ "dependencies": { "@alicloud/fc2": "^2.2.2", "@serverless-devs/core": "^0.0.*", + "form-data": "^4.0.0", "fs-extra": "^10.0.0", "got": "^11.8.2", "lodash": "^4.17.21", + "qs": "^6.10.1", "readline": "^1.3.0" }, "autoInstall": false, diff --git a/src/lib/handler-body.ts b/src/lib/handler-body.ts new file mode 100644 index 0000000..92ef2b7 --- /dev/null +++ b/src/lib/handler-body.ts @@ -0,0 +1,34 @@ +import _ from 'lodash'; +import qs from 'qs'; +import FormData from 'form-data'; + +export default function handlerBody(contentType: string, body: any) { + if (contentType.includes('text/') || contentType.includes('application/json') || contentType.includes('application/xml')) { + if (_.isString(body)) return body; + try { + return JSON.stringify(body); + } catch (_ex) { + return body.toString(); + } + } + + if (contentType.includes('application/x-www-form-urlencoded')) { + return qs.stringify(body, { indices: false }); + } + + if (contentType.includes('multipart/form-data')) { + const form = new FormData(); + try { + const newBody = _.isObject(body) ? body : JSON.parse(body); + for (const [key, value] of Object.entries(newBody)) { + form.append(key, value); + } + return form; + } catch (_ex) { + throw new Error(`Handler body error: The request header is ${contentType}, but the request body is not an object`); + } + + } + + return body; +}