@webiny/project-aws 6.6.0-alpha.11 → 6.6.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_templates/appTemplates/api/graphql/package.json +2 -2
- package/_templates/appTemplates/api/graphql/src/index.ts +2 -2
- package/_templates/appTemplates/api/graphql/src/web.ts +15 -0
- package/_templates/appTemplates/api/graphql/webiny.config.ts +6 -1
- package/_templates/extensions/OpenSearch/api/graphql/src/index.ts +2 -2
- package/_templates/extensions/OpenSearch/api/graphql/src/web.ts +15 -0
- package/_templates/extensions/Postgres/api/graphql/src/index.ts +17 -0
- package/_templates/extensions/Postgres/api/graphql/src/web.ts +15 -0
- package/api.d.ts +6 -6
- package/api.js +3 -2
- package/api.js.map +1 -1
- package/apps/createApiApp.d.ts +18 -1
- package/apps/createCoreApp.d.ts +1 -1
- package/decorators/GetPulumiServiceWithDownloadInfo.d.ts +1 -3
- package/decorators/GetPulumiServiceWithDownloadInfo.js +15 -11
- package/decorators/GetPulumiServiceWithDownloadInfo.js.map +1 -1
- package/extensions/ApiRoute.d.ts +2 -1
- package/extensions/ApiRoute.js.map +1 -1
- package/extensions/AuroraPostgresCluster.d.ts +12 -0
- package/extensions/AuroraPostgresCluster.js +30 -0
- package/extensions/AuroraPostgresCluster.js.map +1 -0
- package/extensions/Postgres/AddCorePostgres.d.ts +27 -0
- package/extensions/Postgres/AddCorePostgres.js +52 -0
- package/extensions/Postgres/AddCorePostgres.js.map +1 -0
- package/extensions/Postgres/CopyPgModulesAfterApiBuild.d.ts +16 -0
- package/extensions/Postgres/CopyPgModulesAfterApiBuild.js +42 -0
- package/extensions/Postgres/CopyPgModulesAfterApiBuild.js.map +1 -0
- package/extensions/Postgres/ReplaceApiLambdaFnHandlers.d.ts +17 -0
- package/extensions/Postgres/ReplaceApiLambdaFnHandlers.js +33 -0
- package/extensions/Postgres/ReplaceApiLambdaFnHandlers.js.map +1 -0
- package/extensions/Postgres/ValidatePostgresBeforeCoreDeploy.d.ts +23 -0
- package/extensions/Postgres/ValidatePostgresBeforeCoreDeploy.js +41 -0
- package/extensions/Postgres/ValidatePostgresBeforeCoreDeploy.js.map +1 -0
- package/extensions/Postgres/copyPgRuntimeModules.d.ts +27 -0
- package/extensions/Postgres/copyPgRuntimeModules.js +124 -0
- package/extensions/Postgres/copyPgRuntimeModules.js.map +1 -0
- package/extensions/Postgres/rds-ca-bundle.pem +2888 -0
- package/extensions/Postgres/rdsCaBundle.d.ts +13 -0
- package/extensions/Postgres/rdsCaBundle.js +7 -0
- package/extensions/Postgres/rdsCaBundle.js.map +1 -0
- package/extensions/ProjectAws/EnsurePostgresSetupUnchanged.d.ts +20 -0
- package/extensions/ProjectAws/EnsurePostgresSetupUnchanged.js +34 -0
- package/extensions/ProjectAws/EnsurePostgresSetupUnchanged.js.map +1 -0
- package/extensions/ProjectAws/RefuseApiWatchWithPostgres.d.ts +20 -0
- package/extensions/ProjectAws/RefuseApiWatchWithPostgres.js +27 -0
- package/extensions/ProjectAws/RefuseApiWatchWithPostgres.js.map +1 -0
- package/extensions/ProjectAws.js +4 -0
- package/extensions/ProjectAws.js.map +1 -1
- package/extensions/definitions.js +3 -1
- package/extensions/definitions.js.map +1 -1
- package/extensions/index.d.ts +4 -1
- package/extensions/index.js +3 -2
- package/extensions/registerExtensionImplementations.js +3 -1
- package/extensions/registerExtensionImplementations.js.map +1 -1
- package/extensions/toCloudFrontPathPattern.d.ts +5 -0
- package/extensions/toCloudFrontPathPattern.js +8 -0
- package/extensions/toCloudFrontPathPattern.js.map +1 -0
- package/features/Watch/AwsWatch.js +1 -0
- package/features/Watch/AwsWatch.js.map +1 -1
- package/features/Watch/forwarder/createForwarderZip.d.ts +8 -0
- package/features/Watch/forwarder/createForwarderZip.js +19 -0
- package/features/Watch/forwarder/createForwarderZip.js.map +1 -0
- package/features/Watch/forwarder/lambdaHandler.cjs +124 -0
- package/features/Watch/forwarder/lambdaHandler.d.cts +1 -0
- package/features/Watch/forwarder/mqtt.cjs +4 -0
- package/features/Watch/forwarder/mqtt.d.cts +1 -0
- package/features/Watch/forwarder/webHandler.d.mts +1 -0
- package/features/Watch/forwarder/webHandler.mjs +298 -0
- package/features/Watch/replaceLambdaFunctions.d.ts +2 -0
- package/features/Watch/replaceLambdaFunctions.js +44 -3
- package/features/Watch/replaceLambdaFunctions.js.map +1 -1
- package/features/Watch/replaceWebFunction.d.ts +44 -0
- package/features/Watch/replaceWebFunction.js +119 -0
- package/features/Watch/replaceWebFunction.js.map +1 -0
- package/infra.d.ts +13 -0
- package/infra.js +8 -6
- package/infra.js.map +1 -1
- package/package.json +21 -17
- package/project.d.ts +1 -0
- package/pulumi/apps/admin/createAdminPulumiApp.js +1 -2
- package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
- package/pulumi/apps/api/ApiCloudfront.d.ts +5 -0
- package/pulumi/apps/api/ApiCloudfront.js +71 -198
- package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
- package/pulumi/apps/api/ApiFileManager.d.ts +8 -1
- package/pulumi/apps/api/ApiFileManager.js +11 -1
- package/pulumi/apps/api/ApiFileManager.js.map +1 -1
- package/pulumi/apps/api/ApiGraphql.d.ts +1 -1
- package/pulumi/apps/api/ApiGraphql.js +78 -69
- package/pulumi/apps/api/ApiGraphql.js.map +1 -1
- package/pulumi/apps/api/ApiGraphqlWeb.d.ts +45 -0
- package/pulumi/apps/api/ApiGraphqlWeb.js +280 -0
- package/pulumi/apps/api/ApiGraphqlWeb.js.map +1 -0
- package/pulumi/apps/api/ApiOutput.d.ts +1 -0
- package/pulumi/apps/api/ApiOutput.js +2 -1
- package/pulumi/apps/api/ApiOutput.js.map +1 -1
- package/pulumi/apps/api/ApiSchemaSetup.d.ts +86 -0
- package/pulumi/apps/api/ApiSchemaSetup.js +139 -0
- package/pulumi/apps/api/ApiSchemaSetup.js.map +1 -0
- package/pulumi/apps/api/apiDynamoDb.d.ts +6 -0
- package/pulumi/apps/api/apiDynamoDb.js +20 -0
- package/pulumi/apps/api/apiDynamoDb.js.map +1 -0
- package/pulumi/apps/api/apiServiceManifests.d.ts +24 -0
- package/pulumi/apps/api/apiServiceManifests.js +27 -0
- package/pulumi/apps/api/apiServiceManifests.js.map +1 -0
- package/pulumi/apps/api/backgroundTask/types.js.map +1 -1
- package/pulumi/apps/api/cloudfront/addWebRouteBehavior.d.ts +8 -0
- package/pulumi/apps/api/cloudfront/addWebRouteBehavior.js +26 -0
- package/pulumi/apps/api/cloudfront/addWebRouteBehavior.js.map +1 -0
- package/pulumi/apps/api/cloudfront/allowFunctionUrlInvoke.d.ts +17 -0
- package/pulumi/apps/api/cloudfront/allowFunctionUrlInvoke.js +27 -0
- package/pulumi/apps/api/cloudfront/allowFunctionUrlInvoke.js.map +1 -0
- package/pulumi/apps/api/cloudfront/allowWebFunctionInvoke.d.ts +8 -0
- package/pulumi/apps/api/cloudfront/allowWebFunctionInvoke.js +31 -0
- package/pulumi/apps/api/cloudfront/allowWebFunctionInvoke.js.map +1 -0
- package/pulumi/apps/api/cloudfront/constants.d.ts +24 -0
- package/pulumi/apps/api/cloudfront/constants.js +43 -0
- package/pulumi/apps/api/cloudfront/constants.js.map +1 -0
- package/pulumi/apps/api/cloudfront/createFilesRouting.d.ts +10 -0
- package/pulumi/apps/api/cloudfront/createFilesRouting.js +35 -0
- package/pulumi/apps/api/cloudfront/createFilesRouting.js.map +1 -0
- package/pulumi/apps/api/cloudfront/createGatewayRouting.d.ts +10 -0
- package/pulumi/apps/api/cloudfront/createGatewayRouting.js +48 -0
- package/pulumi/apps/api/cloudfront/createGatewayRouting.js.map +1 -0
- package/pulumi/apps/api/cloudfront/createStreamRouting.d.ts +10 -0
- package/pulumi/apps/api/cloudfront/createStreamRouting.js +87 -0
- package/pulumi/apps/api/cloudfront/createStreamRouting.js.map +1 -0
- package/pulumi/apps/api/cloudfront/createWebRouting.d.ts +13 -0
- package/pulumi/apps/api/cloudfront/createWebRouting.js +140 -0
- package/pulumi/apps/api/cloudfront/createWebRouting.js.map +1 -0
- package/pulumi/apps/api/createApiPulumiApp.d.ts +22 -4
- package/pulumi/apps/api/createApiPulumiApp.js +122 -81
- package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
- package/pulumi/apps/api/index.d.ts +2 -0
- package/pulumi/apps/api/index.js +2 -0
- package/pulumi/apps/api/isRouteNameAllowed.d.ts +7 -0
- package/pulumi/apps/api/isRouteNameAllowed.js +6 -0
- package/pulumi/apps/api/isRouteNameAllowed.js.map +1 -0
- package/pulumi/apps/common/CoreOutput.d.ts +13 -0
- package/pulumi/apps/common/CoreOutput.js +17 -2
- package/pulumi/apps/common/CoreOutput.js.map +1 -1
- package/pulumi/apps/core/CoreCognito.d.ts +14 -0
- package/pulumi/apps/core/CoreCognito.js +34 -1
- package/pulumi/apps/core/CoreCognito.js.map +1 -1
- package/pulumi/apps/core/CoreOpenSearch.js +12 -6
- package/pulumi/apps/core/CoreOpenSearch.js.map +1 -1
- package/pulumi/apps/core/CorePostgres.d.ts +48 -0
- package/pulumi/apps/core/CorePostgres.js +262 -0
- package/pulumi/apps/core/CorePostgres.js.map +1 -0
- package/pulumi/apps/core/cognitoIdentityProviders/configure.js +11 -0
- package/pulumi/apps/core/cognitoIdentityProviders/configure.js.map +1 -1
- package/pulumi/apps/core/coreDynamoDb.d.ts +19 -0
- package/pulumi/apps/core/coreDynamoDb.js +34 -0
- package/pulumi/apps/core/coreDynamoDb.js.map +1 -0
- package/pulumi/apps/core/coreServiceManifests.d.ts +31 -0
- package/pulumi/apps/core/coreServiceManifests.js +31 -0
- package/pulumi/apps/core/coreServiceManifests.js.map +1 -0
- package/pulumi/apps/core/coreVpcEndpoints.d.ts +14 -0
- package/pulumi/apps/core/coreVpcEndpoints.js +55 -0
- package/pulumi/apps/core/coreVpcEndpoints.js.map +1 -0
- package/pulumi/apps/core/createCorePulumiApp.d.ts +1 -1
- package/pulumi/apps/core/createCorePulumiApp.js +18 -78
- package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
- package/pulumi/apps/core/index.d.ts +1 -0
- package/pulumi/apps/core/index.js +1 -0
- package/pulumi/apps/extensions/getPostgresConfigFromExtension.d.ts +15 -0
- package/pulumi/apps/extensions/getPostgresConfigFromExtension.js +16 -0
- package/pulumi/apps/extensions/getPostgresConfigFromExtension.js.map +1 -0
- package/pulumi/apps/extensions/getVpcConfigFromExtension.d.ts +4 -0
- package/pulumi/apps/extensions/isWebFunctionEnabled.d.ts +5 -0
- package/pulumi/apps/extensions/isWebFunctionEnabled.js +9 -0
- package/pulumi/apps/extensions/isWebFunctionEnabled.js.map +1 -0
- package/pulumi/apps/extensions/projectUsesPostgres.d.ts +2 -0
- package/pulumi/apps/extensions/projectUsesPostgres.js +10 -0
- package/pulumi/apps/extensions/projectUsesPostgres.js.map +1 -0
- package/pulumi/apps/react/adminSettingsItem.d.ts +17 -0
- package/pulumi/apps/react/adminSettingsItem.js +28 -0
- package/pulumi/apps/react/adminSettingsItem.js.map +1 -0
- package/pulumi/apps/react/createReactPulumiApp.js +6 -19
- package/pulumi/apps/react/createReactPulumiApp.js.map +1 -1
- package/pulumi/extensions/index.d.ts +12 -45
- package/pulumi/extensions/index.js +2 -1
- package/pulumi/extensions/index.js.map +1 -1
- package/pulumi/types.d.ts +5 -0
- package/pulumi/utils/lambdaEnvVariables.js +2 -2
- package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
- package/pulumi/utils/tagResources.js +2 -0
- package/pulumi/utils/tagResources.js.map +1 -1
- package/pulumi/utils/withServiceManifest.d.ts +35 -1
- package/pulumi/utils/withServiceManifest.js +53 -9
- package/pulumi/utils/withServiceManifest.js.map +1 -1
- package/services/PulumiGetStackOutputService/mapStackOutput.js +1 -1
- package/services/PulumiGetStackOutputService/mapStackOutput.js.map +1 -1
- package/features/Watch/handler/handler.zip +0 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/* eslint-disable */(()=>{var t={1506(t,r,i){"use strict";i.d(r,{z1:()=>_,h8:()=>w});let n=new WeakMap,o=new WeakMap;function s(t){let r=n.get(t);return console.assert(null!=r,"'this' is expected an Event object, but got",t),r}function a(t){null==t.passiveListener?t.event.cancelable&&(t.canceled=!0,"function"==typeof t.event.preventDefault&&t.event.preventDefault()):"undefined"!=typeof console&&"function"==typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",t.passiveListener)}function l(t,r){n.set(this,{eventTarget:t,event:r,eventPhase:2,currentTarget:t,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:r.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let i=Object.keys(r);for(let o=0;o<i.length;++o){let s=i[o];s in this||Object.defineProperty(this,s,u(s))}}function u(t){return{get(){return s(this).event[t]},set(r){s(this).event[t]=r},configurable:!0,enumerable:!0}}function c(t){return{value(){let r=s(this).event;return r[t].apply(r,arguments)},configurable:!0,enumerable:!0}}function d(t){return s(t).immediateStopped}function h(t,r){s(t).passiveListener=r}l.prototype={get type(){return s(this).event.type},get target(){return s(this).eventTarget},get currentTarget(){return s(this).currentTarget},composedPath(){let t=s(this).currentTarget;return null==t?[]:[t]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return s(this).eventPhase},stopPropagation(){let t=s(this);t.stopped=!0,"function"==typeof t.event.stopPropagation&&t.event.stopPropagation()},stopImmediatePropagation(){let t=s(this);t.stopped=!0,t.immediateStopped=!0,"function"==typeof t.event.stopImmediatePropagation&&t.event.stopImmediatePropagation()},get bubbles(){return Boolean(s(this).event.bubbles)},get cancelable(){return Boolean(s(this).event.cancelable)},preventDefault(){a(s(this))},get defaultPrevented(){return s(this).canceled},get composed(){return Boolean(s(this).event.composed)},get timeStamp(){return s(this).timeStamp},get srcElement(){return s(this).eventTarget},get cancelBubble(){return s(this).stopped},set cancelBubble(e){if(!e)return;let f=s(this);f.stopped=!0,"boolean"==typeof f.event.cancelBubble&&(f.event.cancelBubble=!0)},get returnValue(){return!s(this).canceled},set returnValue(e){e||a(s(this))},initEvent(){}},Object.defineProperty(l.prototype,"constructor",{value:l,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.Event&&(Object.setPrototypeOf(l.prototype,window.Event.prototype),o.set(window.Event.prototype,l));let p=new WeakMap;function g(t){return null!==t&&"object"==typeof t}function b(t){let r=p.get(t);if(null==r)throw TypeError("'this' is expected an EventTarget object, but got another value.");return r}function m(t,r){var i;Object.defineProperty(t,`on${r}`,(i=r,{get(){let t=b(this).get(i);for(;null!=t;){if(3===t.listenerType)return t.listener;t=t.next}return null},set(t){"function"==typeof t||g(t)||(t=null);let r=b(this),n=null,o=r.get(i);for(;null!=o;)3===o.listenerType?null!==n?n.next=o.next:null!==o.next?r.set(i,o.next):r.delete(i):n=o,o=o.next;if(null!==t){let s={listener:t,listenerType:3,passive:!1,once:!1,next:null};null===n?r.set(i,s):n.next=s}},configurable:!0,enumerable:!0}))}function y(t){function r(){$.call(this)}r.prototype=Object.create($.prototype,{constructor:{value:r,configurable:!0,writable:!0}});for(let i=0;i<t.length;++i)m(r.prototype,t[i]);return r}function $(){if(!(this instanceof $)){if(1===arguments.length&&Array.isArray(arguments[0]))return y(arguments[0]);if(arguments.length>0){let t=Array(arguments.length);for(let r=0;r<arguments.length;++r)t[r]=arguments[r];return y(t)}throw TypeError("Cannot call a class as a function")}p.set(this,new Map)}$.prototype={addEventListener(t,r,i){if(null==r)return;if("function"!=typeof r&&!g(r))throw TypeError("'listener' should be a function or an object.");let n=b(this),o=g(i),s=(o?Boolean(i.capture):Boolean(i))?1:2,a={listener:r,listenerType:s,passive:o&&Boolean(i.passive),once:o&&Boolean(i.once),next:null},l=n.get(t);if(void 0===l)return void n.set(t,a);let u=null;for(;null!=l;){if(l.listener===r&&l.listenerType===s)return;u=l,l=l.next}u.next=a},removeEventListener(t,r,i){if(null==r)return;let n=b(this),o=(g(i)?Boolean(i.capture):Boolean(i))?1:2,s=null,a=n.get(t);for(;null!=a;){if(a.listener===r&&a.listenerType===o)return void(null!==s?s.next=a.next:null!==a.next?n.set(t,a.next):n.delete(t));s=a,a=a.next}},dispatchEvent(t){var r,i,n,a;if(null==t||"string"!=typeof t.type)throw TypeError('"event.type" should be a string.');let f=b(this),p=t.type,g=f.get(p);if(null==g)return!0;let m=(r=this,new(function t(r){if(null==r||r===Object.prototype)return l;let i=o.get(r);return null==i&&(i=function(t,r){let i=Object.keys(r);if(0===i.length)return t;function n(r,i){t.call(this,r,i)}n.prototype=Object.create(t.prototype,{constructor:{value:n,configurable:!0,writable:!0}});for(let o=0;o<i.length;++o){let s=i[o];if(!(s in t.prototype)){let a="function"==typeof Object.getOwnPropertyDescriptor(r,s).value;Object.defineProperty(n.prototype,s,a?c(s):u(s))}}return n}(t(Object.getPrototypeOf(r)),r),o.set(r,i)),i}(Object.getPrototypeOf(i=t)))(r,i)),y=null;for(;null!=g;){if(g.once?null!==y?y.next=g.next:null!==g.next?f.set(p,g.next):f.delete(p):y=g,h(m,g.passive?g.listener:null),"function"==typeof g.listener)try{g.listener.call(this,m)}catch($){"undefined"!=typeof console&&"function"==typeof console.error&&console.error($)}else 3!==g.listenerType&&"function"==typeof g.listener.handleEvent&&g.listener.handleEvent(m);if(d(m))break;g=g.next}return h(m,null),n=m,s(n).eventPhase=0,a=m,s(a).currentTarget=null,!m.defaultPrevented}},Object.defineProperty($.prototype,"constructor",{value:$,configurable:!0,writable:!0}),"undefined"!=typeof window&&void 0!==window.EventTarget&&Object.setPrototypeOf($.prototype,window.EventTarget.prototype);class w extends ${constructor(){throw super(),TypeError("AbortSignal cannot be constructed directly")}get aborted(){let t=v.get(this);if("boolean"!=typeof t)throw TypeError("Expected 'this' to be an 'AbortSignal' object, but got "+(null===this?"null":typeof this));return t}}m(w.prototype,"abort");let v=new WeakMap;Object.defineProperties(w.prototype,{aborted:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(w.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class _{constructor(){S.set(this,function(){let t=Object.create(w.prototype);return $.call(t),v.set(t,!1),t}())}get signal(){return E(this)}abort(){var t;t=E(this),!1===v.get(t)&&(v.set(t,!0),t.dispatchEvent({type:"abort"}))}}let S=new WeakMap;function E(t){let r=S.get(t);if(null==r)throw TypeError("Expected 'this' to be an 'AbortController' object, but got "+(null===t?"null":typeof t));return r}Object.defineProperties(_.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(_.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"})},3432(t){var r=Object.prototype.toString,i="undefined"!=typeof Buffer&&"function"==typeof Buffer.alloc&&"function"==typeof Buffer.allocUnsafe&&"function"==typeof Buffer.from;t.exports=function(t,n,o){var s;if("number"==typeof t)throw TypeError('"value" argument must not be a number');return s=t,"ArrayBuffer"===r.call(s).slice(8,-1)?function(t,r,n){r>>>=0;var o=t.byteLength-r;if(o<0)throw RangeError("'offset' is out of bounds");if(void 0===n)n=o;else if((n>>>=0)>o)throw RangeError("'length' is out of bounds");return i?Buffer.from(t.slice(r,r+n)):new Buffer(new Uint8Array(t.slice(r,r+n)))}(t,n,o):"string"==typeof t?function(t,r){if("string"==typeof r&&""!==r||(r="utf8"),!Buffer.isEncoding(r))throw TypeError('"encoding" must be a valid string encoding');return i?Buffer.from(t,r):new Buffer(t,r)}(t,n):i?Buffer.from(t):new Buffer(t)}},6386(t){var r=36e5,i=24*r,n=7*i;function o(t,r,i,n){return Math.round(t/i)+" "+n+(r>=1.5*i?"s":"")}t.exports=function(t,s){s=s||{};var a,l,u,c,d=typeof t;if("string"===d&&t.length>0)return function(t){if(!((t=String(t)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(o){var s=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*s;case"weeks":case"week":case"w":return s*n;case"days":case"day":case"d":return s*i;case"hours":case"hour":case"hrs":case"hr":case"h":return s*r;case"minutes":case"minute":case"mins":case"min":case"m":return 6e4*s;case"seconds":case"second":case"secs":case"sec":case"s":return 1e3*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return s;default:return}}}}(t);if("number"===d&&isFinite(t))return s.long?(c=Math.abs(u=t))>=i?o(u,c,i,"day"):c>=r?o(u,c,r,"hour"):c>=6e4?o(u,c,6e4,"minute"):c>=1e3?o(u,c,1e3,"second"):u+" ms":(l=Math.abs(a=t))>=i?Math.round(a/i)+"d":l>=r?Math.round(a/r)+"h":l>=6e4?Math.round(a/6e4)+"m":l>=1e3?Math.round(a/1e3)+"s":a+"ms";throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},7159(t,r,i){let n;r.formatArgs=function(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let i="color: "+this.color;r.splice(1,0,i,"color: inherit");let n=0,o=0;r[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(n++,"%c"===t&&(o=n))}),r.splice(o,0,i)},r.save=function(t){try{t?r.storage.setItem("debug",t):r.storage.removeItem("debug")}catch(i){}},r.load=function(){let t;try{t=r.storage.getItem("debug")}catch(i){}return!t&&"undefined"!=typeof process&&"env"in process&&(t=process.env.DEBUG),t},r.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},r.storage=function(){try{return localStorage}catch(t){}}(),r.destroy=(n=!1,()=>{n||(n=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}),r.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"],r.log=console.debug||console.log||(()=>{}),t.exports=i(5946)(r);let{formatters:o}=t.exports;o.j=function(t){try{return JSON.stringify(t)}catch(r){return"[UnexpectedJSONParseError]: "+r.message}}},5946(t,r,i){t.exports=function(t){function r(t){let i,o,s,a=null;function l(...t){if(!l.enabled)return;let n=l,o=Number(new Date),s=o-(i||o);n.diff=s,n.prev=i,n.curr=o,i=o,t[0]=r.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let a=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(i,o)=>{if("%%"===i)return"%";a++;let s=r.formatters[o];if("function"==typeof s){let l=t[a];i=s.call(n,l),t.splice(a,1),a--}return i}),r.formatArgs.call(n,t),(n.log||r.log).apply(n,t)}return l.namespace=t,l.useColors=r.useColors(),l.color=r.selectColor(t),l.extend=n,l.destroy=r.destroy,Object.defineProperty(l,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(o!==r.namespaces&&(o=r.namespaces,s=r.enabled(t)),s),set(t){a=t}}),"function"==typeof r.init&&r.init(l),l}function n(t,i){let n=r(this.namespace+(void 0===i?":":i)+t);return n.log=this.log,n}function o(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return r.debug=r,r.default=r,r.coerce=function(t){return t instanceof Error?t.stack||t.message:t},r.disable=function(){let t=[...r.names.map(o),...r.skips.map(o).map(t=>"-"+t)].join(",");return r.enable(""),t},r.enable=function(t){let i;r.save(t),r.namespaces=t,r.names=[],r.skips=[];let n=("string"==typeof t?t:"").split(/[\s,]+/),o=n.length;for(i=0;i<o;i++)n[i]&&("-"===(t=n[i].replace(/\*/g,".*?"))[0]?r.skips.push(RegExp("^"+t.slice(1)+"$")):r.names.push(RegExp("^"+t+"$")))},r.enabled=function(t){if("*"===t[t.length-1])return!0;let i,n;for(i=0,n=r.skips.length;i<n;i++)if(r.skips[i].test(t))return!1;for(i=0,n=r.names.length;i<n;i++)if(r.names[i].test(t))return!0;return!1},r.humanize=i(6386),r.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(i=>{r[i]=t[i]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=function(t){let i=0;for(let n=0;n<t.length;n++)i=(i<<5)-i+t.charCodeAt(n),i|=0;return r.colors[Math.abs(i)%r.colors.length]},r.enable(r.load()),r}},9171(t,r,i){"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?t.exports=i(7159):t.exports=i(1043)},1043(t,r,i){let n=i(2018),o=i(9023);r.init=function(t){t.inspectOpts={};let i=Object.keys(r.inspectOpts);for(let n=0;n<i.length;n++)t.inspectOpts[i[n]]=r.inspectOpts[i[n]]},r.log=function(...t){return process.stderr.write(o.format(...t)+"\n")},r.formatArgs=function(i){let{namespace:n,useColors:o}=this;if(o){let s=this.color,a="\x1b[3"+(s<8?s:"8;5;"+s),l=` ${a};1m${n} [0m`;i[0]=l+i[0].split("\n").join("\n"+l),i.push(a+"m+"+t.exports.humanize(this.diff)+"\x1b[0m")}else i[0]=(r.inspectOpts.hideDate?"":new Date().toISOString()+" ")+n+" "+i[0]},r.save=function(t){t?process.env.DEBUG=t:delete process.env.DEBUG},r.load=function(){return process.env.DEBUG},r.useColors=function(){return"colors"in r.inspectOpts?Boolean(r.inspectOpts.colors):n.isatty(process.stderr.fd)},r.destroy=o.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),r.colors=[6,2,3,4,5,1];try{let s=i(3533);s&&(s.stderr||s).level>=2&&(r.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(a){}r.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,r)=>{let i=r.substring(6).toLowerCase().replace(/_([a-z])/g,(t,r)=>r.toUpperCase()),n=process.env[r];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),t[i]=n,t},{}),t.exports=i(5946)(r);let{formatters:l}=t.exports;l.o=function(t){return this.inspectOpts.colors=this.useColors,o.inspect(t,this.inspectOpts).split("\n").map(t=>t.trim()).join(" ")},l.O=function(t){return this.inspectOpts.colors=this.useColors,o.inspect(t,this.inspectOpts)}},9614(t){"use strict";t.exports=(t,r=process.argv)=>{let i=t.startsWith("-")?"":1===t.length?"-":"--",n=r.indexOf(i+t),o=r.indexOf("--");return -1!==n&&(-1===o||n<o)}},5023(t,r,i){try{var n=i(9023);if("function"!=typeof n.inherits)throw"";t.exports=n.inherits}catch(o){t.exports=i(820)}},820(t){"function"==typeof Object.create?t.exports=function(t,r){r&&(t.super_=r,t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,r){if(r){t.super_=r;var i=function(){};i.prototype=r.prototype,t.prototype=new i,t.prototype.constructor=t}}},6085(t,r,i){"use strict";i.d(r,{CD:()=>A});var n,o,s=(o=function(t,r){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}o(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}),a=function(){function t(t,r){this.ee=1,this.u=void 0,this.p=void 0,this.K=void 0,this.N=void 0,this.rr=void 0,this.u=t,this.p=r}return t.prototype.L=function(){var t=this;if(1===t.ee&&t.rr.rr===t)t=t.N;else if(t.K)for(t=t.K;t.N;)t=t.N;else{for(var r=t.rr;r.K===t;)r=(t=r).rr;t=r}return t},t.prototype.m=function(){var t=this;if(t.N){for(t=t.N;t.K;)t=t.K;return t}for(var r=t.rr;r.N===t;)r=(t=r).rr;return t.N!==r?r:t},t.prototype.ne=function(){var t=this.rr,r=this.N,i=r.K;return t.rr===this?t.rr=r:t.K===this?t.K=r:t.N=r,r.rr=t,r.K=this,this.rr=r,this.N=i,i&&(i.rr=this),r},t.prototype.te=function(){var t=this.rr,r=this.K,i=r.N;return t.rr===this?t.rr=r:t.K===this?t.K=r:t.N=r,r.rr=t,r.N=this,this.rr=r,this.K=i,i&&(i.rr=this),r},t}(),l=function(t){function r(){var r=null!==t&&t.apply(this,arguments)||this;return r.tr=1,r}return s(r,t),r.prototype.ne=function(){var r=t.prototype.ne.call(this);return this.ie(),r.ie(),r},r.prototype.te=function(){var r=t.prototype.te.call(this);return this.ie(),r.ie(),r},r.prototype.ie=function(){this.tr=1,this.K&&(this.tr+=this.K.tr),this.N&&(this.tr+=this.N.tr)},r}(a),u=(n=function(t,r){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}n(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}),c=function(){function t(t){void 0===t&&(t=0),this.iteratorType=t}return t.prototype.equals=function(t){return this.o===t.o},t}(),d=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return u(r,t),r}(function(){function t(){this.M=0}return Object.defineProperty(t.prototype,"length",{get:function(){return this.M},enumerable:!1,configurable:!0}),t.prototype.size=function(){return this.M},t.prototype.empty=function(){return 0===this.M},t}());function h(){throw RangeError("Iterator access denied!")}var f,p,g,b=(f=function(t,r){return(f=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}f(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}),m=function(t,r){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,o,s=i.call(t),a=[];try{for(;(void 0===r||r-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(l){o={error:l}}finally{try{n&&!n.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}return a},y=function(t){var r="function"==typeof Symbol&&Symbol.iterator,i=r&&t[r],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},$=function(t){function r(r,i){void 0===r&&(r=function(t,r){return t<r?-1:t>r?1:0}),void 0===i&&(i=!1);var n=t.call(this)||this;return n.W=void 0,n.$=r,i?(n.re=l,n.v=function(t,r,i){var n=this.se(t,r,i);if(n){for(var o=n.rr;o!==this.h;)o.tr+=1,o=o.rr;var s=this.fe(n);if(s){var a=s,l=a.parentNode,u=a.grandParent,c=a.curNode;l.ie(),u.ie(),c.ie()}}return this.M},n.G=function(t){for(var r=this.he(t);r!==this.h;)r.tr-=1,r=r.rr}):(n.re=a,n.v=function(t,r,i){var n=this.se(t,r,i);return n&&this.fe(n),this.M},n.G=n.he),n.h=new n.re,n}return b(r,t),r.prototype.U=function(t,r){for(var i=this.h;t;){var n=this.$(t.u,r);if(n<0)t=t.N;else{if(!(n>0))return t;i=t,t=t.K}}return i},r.prototype.X=function(t,r){for(var i=this.h;t;)0>=this.$(t.u,r)?t=t.N:(i=t,t=t.K);return i},r.prototype.Y=function(t,r){for(var i=this.h;t;){var n=this.$(t.u,r);if(n<0)i=t,t=t.N;else{if(!(n>0))return t;t=t.K}}return i},r.prototype.Z=function(t,r){for(var i=this.h;t;)0>this.$(t.u,r)?(i=t,t=t.N):t=t.K;return i},r.prototype.ue=function(t){for(;;){var r,i=t.rr;if(i===this.h)return;if(1===t.ee)return void(t.ee=0);if(t===i.K){if(1===(r=i.N).ee)r.ee=0,i.ee=1,i===this.W?this.W=i.ne():i.ne();else{if(r.N&&1===r.N.ee)return r.ee=i.ee,i.ee=0,r.N.ee=0,void(i===this.W?this.W=i.ne():i.ne());r.K&&1===r.K.ee?(r.ee=1,r.K.ee=0,r.te()):(r.ee=1,t=i)}}else if(1===(r=i.K).ee)r.ee=0,i.ee=1,i===this.W?this.W=i.te():i.te();else{if(r.K&&1===r.K.ee)return r.ee=i.ee,i.ee=0,r.K.ee=0,void(i===this.W?this.W=i.te():i.te());r.N&&1===r.N.ee?(r.ee=1,r.N.ee=0,r.ne()):(r.ee=1,t=i)}}},r.prototype.he=function(t){if(1===this.M)return this.clear(),this.h;for(var r,i,n=t;n.K||n.N;){if(n.N)for(n=n.N;n.K;)n=n.K;else n=n.K;r=m([n.u,t.u],2),t.u=r[0],n.u=r[1],i=m([n.p,t.p],2),t.p=i[0],n.p=i[1],t=n}this.h.K===n?this.h.K=n.rr:this.h.N===n&&(this.h.N=n.rr),this.ue(n);var o=n.rr;return n===o.K?o.K=void 0:o.N=void 0,this.M-=1,this.W.ee=0,o},r.prototype.ae=function(t,r){return void 0!==t&&(!!this.ae(t.K,r)||!!r(t)||this.ae(t.N,r))},r.prototype.fe=function(t){for(;;){var r,i,n=t.rr;if(0===n.ee)return;var o=n.rr;if(n===o.K){if((r=o.N)&&1===r.ee){if(r.ee=n.ee=0,o===this.W)return;o.ee=1,t=o;continue}if(t===n.N)return t.ee=0,t.K&&(t.K.rr=n),t.N&&(t.N.rr=o),n.N=t.K,o.K=t.N,t.K=n,t.N=o,o===this.W?(this.W=t,this.h.rr=t):(i=o.rr).K===o?i.K=t:i.N=t,t.rr=o.rr,n.rr=t,o.rr=t,o.ee=1,{parentNode:n,grandParent:o,curNode:t};n.ee=0,o===this.W?this.W=o.te():o.te(),o.ee=1}else{if((r=o.K)&&1===r.ee){if(r.ee=n.ee=0,o===this.W)return;o.ee=1,t=o;continue}if(t===n.K)return t.ee=0,t.K&&(t.K.rr=o),t.N&&(t.N.rr=n),o.N=t.K,n.K=t.N,t.K=o,t.N=n,o===this.W?(this.W=t,this.h.rr=t):(i=o.rr).K===o?i.K=t:i.N=t,t.rr=o.rr,n.rr=t,o.rr=t,o.ee=1,{parentNode:n,grandParent:o,curNode:t};n.ee=0,o===this.W?this.W=o.ne():o.ne(),o.ee=1}return}},r.prototype.se=function(t,r,i){if(void 0===this.W)return this.M+=1,this.W=new this.re(t,r),this.W.ee=0,this.W.rr=this.h,this.h.rr=this.W,this.h.K=this.W,void(this.h.N=this.W);var n,o=this.h.K,s=this.$(o.u,t);if(0!==s){if(s>0)o.K=new this.re(t,r),o.K.rr=o,n=o.K,this.h.K=n;else{var a=this.h.N,l=this.$(a.u,t);if(0===l)return void(a.p=r);if(l<0)a.N=new this.re(t,r),a.N.rr=a,n=a.N,this.h.N=n;else{if(void 0!==i){var u=i.o;if(u!==this.h){var c=this.$(u.u,t);if(0===c)return void(u.p=r);if(c>0){var d=u.L(),h=this.$(d.u,t);if(0===h)return void(d.p=r);h<0&&(n=new this.re(t,r),void 0===d.N?(d.N=n,n.rr=d):(u.K=n,n.rr=u))}}}if(void 0===n)for(n=this.W;;){var f=this.$(n.u,t);if(f>0){if(void 0===n.K){n.K=new this.re(t,r),n.K.rr=n,n=n.K;break}n=n.K}else{if(!(f<0))return void(n.p=r);if(void 0===n.N){n.N=new this.re(t,r),n.N.rr=n,n=n.N;break}n=n.N}}}}return this.M+=1,n}o.p=r},r.prototype.g=function(t,r){for(;t;){var i=this.$(t.u,r);if(i<0)t=t.N;else{if(!(i>0))return t;t=t.K}}return t||this.h},r.prototype.clear=function(){this.M=0,this.W=void 0,this.h.rr=void 0,this.h.K=this.h.N=void 0},r.prototype.updateKeyByIterator=function(t,r){var i=t.o;if(i===this.h&&h(),1===this.M)return i.u=r,!0;if(i===this.h.K)return this.$(i.m().u,r)>0&&(i.u=r,!0);if(i===this.h.N)return 0>this.$(i.L().u,r)&&(i.u=r,!0);var n=i.L().u;if(this.$(n,r)>=0)return!1;var o=i.m().u;return!(0>=this.$(o,r)||(i.u=r,0))},r.prototype.eraseElementByPos=function(t){if(t<0||t>this.M-1)throw RangeError();var r=0,i=this;return this.ae(this.W,function(n){return t===r?(i.G(n),!0):(r+=1,!1)}),this.M},r.prototype.eraseElementByKey=function(t){if(0===this.M)return!1;var r=this.g(this.W,t);return r!==this.h&&(this.G(r),!0)},r.prototype.eraseElementByIterator=function(t){var r=t.o;r===this.h&&h();var i=void 0===r.N;return 0===t.iteratorType?i&&t.next():i&&void 0!==r.K||t.next(),this.G(r),t},r.prototype.forEach=function(t){var r,i,n=0;try{for(var o=y(this),s=o.next();!s.done;s=o.next())t(s.value,n++,this)}catch(a){r={error:a}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}},r.prototype.getElementByPos=function(t){if(t<0||t>this.M-1)throw RangeError();var r,i,n,o=0;try{for(var s=y(this),a=s.next();!a.done;a=s.next()){var l=a.value;if(o===t){n=l;break}o+=1}}catch(u){r={error:u}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return n},r.prototype.getHeight=function(){if(0===this.M)return 0;var t=function(r){return r?Math.max(t(r.K),t(r.N))+1:0};return t(this.W)},r}(d),w=(p=function(t,r){return(p=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}p(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}),v=function(t){function r(r,i,n){var o=t.call(this,n)||this;return o.o=r,o.h=i,0===o.iteratorType?(o.pre=function(){return this.o===this.h.K&&h(),this.o=this.o.L(),this},o.next=function(){return this.o===this.h&&h(),this.o=this.o.m(),this}):(o.pre=function(){return this.o===this.h.N&&h(),this.o=this.o.m(),this},o.next=function(){return this.o===this.h&&h(),this.o=this.o.L(),this}),o}return w(r,t),Object.defineProperty(r.prototype,"index",{get:function(){var t=this.o,r=this.h.rr;if(t===this.h)return r?r.tr-1:0;var i=0;for(t.K&&(i+=t.K.tr);t!==r;){var n=t.rr;t===n.N&&(i+=1,n.K&&(i+=n.K.tr)),t=n}return i},enumerable:!1,configurable:!0}),r}(c),_=(g=function(t,r){return(g=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])})(t,r)},function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}g(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}),S=function(t){var r="function"==typeof Symbol&&Symbol.iterator,i=r&&t[r],n=0;if(i)return i.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")},E=function(t){function r(r,i,n,o){var s=t.call(this,r,i,o)||this;return s.container=n,s}return _(r,t),Object.defineProperty(r.prototype,"pointer",{get:function(){return this.o===this.h&&h(),this.o.u},enumerable:!1,configurable:!0}),r.prototype.copy=function(){return new r(this.o,this.h,this.container,this.iteratorType)},r}(v),k=function(t){function r(r,i,n){void 0===r&&(r=[]);var o=t.call(this,i,n)||this,s=o;return r.forEach(function(t){s.insert(t)}),o}return _(r,t),r.prototype.P=function(t){return function(t,r){var i,n,o,s,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function l(s){return function(l){return function s(l){if(i)throw TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!((o=(o=a.trys).length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=r.call(t,a)}catch(u){l=[6,u],n=0}finally{i=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([s,l])}}}(this,function(r){switch(r.label){case 0:return void 0===t?[2]:[5,S(this.P(t.K))];case 1:return r.sent(),[4,t.u];case 2:return r.sent(),[5,S(this.P(t.N))];case 3:return r.sent(),[2]}})},r.prototype.begin=function(){return new E(this.h.K||this.h,this.h,this)},r.prototype.end=function(){return new E(this.h,this.h,this)},r.prototype.rBegin=function(){return new E(this.h.N||this.h,this.h,this,1)},r.prototype.rEnd=function(){return new E(this.h,this.h,this,1)},r.prototype.front=function(){return this.h.K?this.h.K.u:void 0},r.prototype.back=function(){return this.h.N?this.h.N.u:void 0},r.prototype.insert=function(t,r){return this.v(t,void 0,r)},r.prototype.find=function(t){var r=this.g(this.W,t);return new E(r,this.h,this)},r.prototype.lowerBound=function(t){var r=this.U(this.W,t);return new E(r,this.h,this)},r.prototype.upperBound=function(t){var r=this.X(this.W,t);return new E(r,this.h,this)},r.prototype.reverseLowerBound=function(t){var r=this.Y(this.W,t);return new E(r,this.h,this)},r.prototype.reverseUpperBound=function(t){var r=this.Z(this.W,t);return new E(r,this.h,this)},r.prototype.union=function(t){var r=this;return t.forEach(function(t){r.insert(t)}),this.M},r.prototype[Symbol.iterator]=function(){return this.P(this.W)},r}($);let A=k},3541(t,r,i){let n=t.exports,{Buffer:o}=i(181);for(let s in n.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},n.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},n.requiredHeaderFlagsErrors={},n.requiredHeaderFlags){let a=n.requiredHeaderFlags[s];n.requiredHeaderFlagsErrors[s]="Invalid header flag bits, must be 0x"+a.toString(16)+" for "+n.types[s]+" packet"}for(let l in n.codes={},n.types){let u=n.types[l];n.codes[u]=l}for(let c in n.CMD_SHIFT=4,n.CMD_MASK=240,n.DUP_MASK=8,n.QOS_MASK=3,n.QOS_SHIFT=1,n.RETAIN_MASK=1,n.VARBYTEINT_MASK=127,n.VARBYTEINT_FIN_MASK=128,n.VARBYTEINT_MAX=268435455,n.SESSIONPRESENT_MASK=1,n.SESSIONPRESENT_HEADER=o.from([n.SESSIONPRESENT_MASK]),n.CONNACK_HEADER=o.from([n.codes.connack<<n.CMD_SHIFT]),n.USERNAME_MASK=128,n.PASSWORD_MASK=64,n.WILL_RETAIN_MASK=32,n.WILL_QOS_MASK=24,n.WILL_QOS_SHIFT=3,n.WILL_FLAG_MASK=4,n.CLEAN_SESSION_MASK=2,n.CONNECT_HEADER=o.from([n.codes.connect<<n.CMD_SHIFT]),n.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},n.propertiesCodes={},n.properties){let d=n.properties[c];n.propertiesCodes[d]=c}function h(t){return[0,1,2].map(r=>[0,1].map(i=>[0,1].map(s=>{let a=o.alloc(1);return a.writeUInt8(n.codes[t]<<n.CMD_SHIFT|(i?n.DUP_MASK:0)|r<<n.QOS_SHIFT|s,0,!0),a})))}n.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},n.PUBLISH_HEADER=h("publish"),n.SUBSCRIBE_HEADER=h("subscribe"),n.SUBSCRIBE_OPTIONS_QOS_MASK=3,n.SUBSCRIBE_OPTIONS_NL_MASK=1,n.SUBSCRIBE_OPTIONS_NL_SHIFT=2,n.SUBSCRIBE_OPTIONS_RAP_MASK=1,n.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,n.SUBSCRIBE_OPTIONS_RH_MASK=3,n.SUBSCRIBE_OPTIONS_RH_SHIFT=4,n.SUBSCRIBE_OPTIONS_RH=[0,16,32],n.SUBSCRIBE_OPTIONS_NL=4,n.SUBSCRIBE_OPTIONS_RAP=8,n.SUBSCRIBE_OPTIONS_QOS=[0,1,2],n.UNSUBSCRIBE_HEADER=h("unsubscribe"),n.ACKS={unsuback:h("unsuback"),puback:h("puback"),pubcomp:h("pubcomp"),pubrel:h("pubrel"),pubrec:h("pubrec")},n.SUBACK_HEADER=o.from([n.codes.suback<<n.CMD_SHIFT]),n.VERSION3=o.from([3]),n.VERSION4=o.from([4]),n.VERSION5=o.from([5]),n.VERSION131=o.from([131]),n.VERSION132=o.from([132]),n.QOS=[0,1,2].map(t=>o.from([t])),n.EMPTY={pingreq:o.from([n.codes.pingreq<<4,0]),pingresp:o.from([n.codes.pingresp<<4,0]),disconnect:o.from([n.codes.disconnect<<4,0])},n.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},n.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},n.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},n.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},n.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},n.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}},2533(t,r,i){let n=i(6158),{EventEmitter:o}=i(4434),{Buffer:s}=i(181);class a extends o{constructor(){super(),this._array=Array(20),this._i=0}write(t){return this._array[this._i++]=t,!0}concat(){let t=0,r=Array(this._array.length),i=this._array,n,o=0;for(n=0;n<i.length&&void 0!==i[n];n++)"string"!=typeof i[n]?r[n]=i[n].length:r[n]=s.byteLength(i[n]),t+=r[n];let a=s.allocUnsafe(t);for(n=0;n<i.length&&void 0!==i[n];n++)"string"!=typeof i[n]?(i[n].copy(a,o),o+=r[n]):(a.write(i[n],o),o+=r[n]);return a}destroy(t){t&&this.emit("error",t)}}t.exports=function(t,r){let i=new a;return n(t,i,r),i.concat()}},9880(t,r,i){r.parser=i(9829).parser,r.generate=i(2533),r.writeToStream=i(6158)},4282(t,r,i){"use strict";let{Buffer:n}=i(181),o=Symbol.for("BufferList");function s(t){if(!(this instanceof s))return new s(t);s._init.call(this,t)}s._init=function(t){Object.defineProperty(this,o,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)},s.prototype._new=function(t){return new s(t)},s.prototype._offset=function(t){if(0===t)return[0,0];let r=0;for(let i=0;i<this._bufs.length;i++){let n=r+this._bufs[i].length;if(t<n||i===this._bufs.length-1)return[i,t-r];r=n}},s.prototype._reverseOffset=function(t){let r=t[0],i=t[1];for(let n=0;n<r;n++)i+=this._bufs[n].length;return i},s.prototype.get=function(t){if(t>this.length||t<0)return;let r=this._offset(t);return this._bufs[r[0]][r[1]]},s.prototype.slice=function(t,r){return"number"==typeof t&&t<0&&(t+=this.length),"number"==typeof r&&r<0&&(r+=this.length),this.copy(null,0,t,r)},s.prototype.copy=function(t,r,i,o){if(("number"!=typeof i||i<0)&&(i=0),("number"!=typeof o||o>this.length)&&(o=this.length),i>=this.length||o<=0)return t||n.alloc(0);let s=!!t,a=this._offset(i),l=o-i,u=l,c=s&&r||0,d=a[1];if(0===i&&o===this.length){if(!s)return 1===this._bufs.length?this._bufs[0]:n.concat(this._bufs,this.length);for(let h=0;h<this._bufs.length;h++)this._bufs[h].copy(t,c),c+=this._bufs[h].length;return t}if(u<=this._bufs[a[0]].length-d)return s?this._bufs[a[0]].copy(t,r,d,d+u):this._bufs[a[0]].slice(d,d+u);s||(t=n.allocUnsafe(l));for(let f=a[0];f<this._bufs.length;f++){let p=this._bufs[f].length-d;if(!(u>p)){this._bufs[f].copy(t,c,d,d+u),c+=p;break}this._bufs[f].copy(t,c,d),c+=p,u-=p,d&&(d=0)}return t.length>c?t.slice(0,c):t},s.prototype.shallowSlice=function(t,r){if(t=t||0,r="number"!=typeof r?this.length:r,t<0&&(t+=this.length),r<0&&(r+=this.length),t===r)return this._new();let i=this._offset(t),n=this._offset(r),o=this._bufs.slice(i[0],n[0]+1);return 0===n[1]?o.pop():o[o.length-1]=o[o.length-1].slice(0,n[1]),0!==i[1]&&(o[0]=o[0].slice(i[1])),this._new(o)},s.prototype.toString=function(t,r,i){return this.slice(r,i).toString(t)},s.prototype.consume=function(t){if(Number.isNaN(t=Math.trunc(t))||t<=0)return this;for(;this._bufs.length;){if(!(t>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},s.prototype.duplicate=function(){let t=this._new();for(let r=0;r<this._bufs.length;r++)t.append(this._bufs[r]);return t},s.prototype.append=function(t){if(null==t)return this;if(t.buffer)this._appendBuffer(n.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t))for(let r=0;r<t.length;r++)this.append(t[r]);else if(this._isBufferList(t))for(let i=0;i<t._bufs.length;i++)this.append(t._bufs[i]);else"number"==typeof t&&(t=t.toString()),this._appendBuffer(n.from(t));return this},s.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length},s.prototype.indexOf=function(t,r,i){if(void 0===i&&"string"==typeof r&&(i=r,r=void 0),"function"==typeof t||Array.isArray(t))throw TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof t?t=n.from([t]):"string"==typeof t?t=n.from(t,i):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=n.from(t.buffer,t.byteOffset,t.byteLength):n.isBuffer(t)||(t=n.from(t)),isNaN(r=Number(r||0))&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),0===t.length)return r>this.length?this.length:r;let o=this._offset(r),s=o[0],a=o[1];for(;s<this._bufs.length;s++){let l=this._bufs[s];for(;a<l.length;)if(l.length-a>=t.length){let u=l.indexOf(t,a);if(-1!==u)return this._reverseOffset([s,u]);a=l.length-t.length+1}else{let c=this._reverseOffset([s,a]);if(this._match(c,t))return c;a++}a=0}return -1},s.prototype._match=function(t,r){if(this.length-t<r.length)return!1;for(let i=0;i<r.length;i++)if(this.get(t+i)!==r[i])return!1;return!0},function(){let t={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let r in t)!function(r){s.prototype[r]=null===t[r]?function(t,i){return this.slice(t,t+i)[r](0,i)}:function(i=0){return this.slice(i,i+t[r])[r](0)}}(r)}(),s.prototype._isBufferList=function(t){return t instanceof s||s.isBufferList(t)},s.isBufferList=function(t){return null!=t&&t[o]},t.exports=s},3090(t,r,i){"use strict";let n=i(5955).Duplex,o=i(5023),s=i(4282);function a(t){if(!(this instanceof a))return new a(t);if("function"==typeof t){this._callback=t;let r=(function(t){this._callback&&(this._callback(t),this._callback=null)}).bind(this);this.on("pipe",function(t){t.on("error",r)}),this.on("unpipe",function(t){t.removeListener("error",r)}),t=null}s._init.call(this,t),n.call(this)}o(a,n),Object.assign(a.prototype,s.prototype),a.prototype._new=function(t){return new a(t)},a.prototype._write=function(t,r,i){this._appendBuffer(t),"function"==typeof i&&i()},a.prototype._read=function(t){if(!this.length)return this.push(null);t=Math.min(t,this.length),this.push(this.slice(0,t)),this.consume(t)},a.prototype.end=function(t){n.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)},a.prototype._destroy=function(t,r){this._bufs.length=0,this.length=0,r(t)},a.prototype._isBufferList=function(t){return t instanceof a||t instanceof s||a.isBufferList(t)},a.isBufferList=s.isBufferList,t.exports=a,t.exports.BufferListStream=a,t.exports.BufferList=s},996(t,r,i){"use strict";let{SymbolDispose:n}=i(1807),{AbortError:o,codes:s}=i(5596),{isNodeStream:a,isWebStream:l,kControllerErrorFunction:u}=i(3338),c=i(6567),{ERR_INVALID_ARG_TYPE:d}=s,h;t.exports.addAbortSignal=function(r,i){if(((t,r)=>{if("object"!=typeof t||!("aborted"in t))throw new d("signal","AbortSignal",t)})(r),!a(i)&&!l(i))throw new d("stream",["ReadableStream","WritableStream","Stream"],i);return t.exports.addAbortSignalNoValidate(r,i)},t.exports.addAbortSignalNoValidate=function(t,r){if("object"!=typeof t||!("aborted"in t))return r;let s=a(r)?()=>{r.destroy(new o(void 0,{cause:t.reason}))}:()=>{r[u](new o(void 0,{cause:t.reason}))};if(t.aborted)s();else{h=h||i(8619).addAbortListener;let l=h(t,s);c(r,l[n])}return r}},6608(t,r,i){"use strict";let{StringPrototypeSlice:n,SymbolIterator:o,TypedArrayPrototypeSet:s,Uint8Array:a}=i(1807),{Buffer:l}=i(181),{inspect:u}=i(8619);t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};0===this.length&&(this.tail=r),this.head=r,++this.length}shift(){if(0===this.length)return;let t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(0===this.length)return"";let r=this.head,i=""+r.data;for(;null!==(r=r.next);)i+=t+r.data;return i}concat(t){if(0===this.length)return l.alloc(0);let r=l.allocUnsafe(t>>>0),i=this.head,n=0;for(;i;)s(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(t,r){let i=this.head.data;if(t<i.length){let n=i.slice(0,t);return this.head.data=i.slice(t),n}return t===i.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[o](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",i=this.head,o=0;do{let s=i.data;if(!(t>s.length)){t===s.length?(r+=s,++o,i.next?this.head=i.next:this.head=this.tail=null):(r+=n(s,0,t),this.head=i,i.data=n(s,t));break}r+=s,t-=s.length,++o}while(null!==(i=i.next));return this.length-=o,r}_getBuffer(t){let r=l.allocUnsafe(t),i=t,n=this.head,o=0;do{let u=n.data;if(!(t>u.length)){t===u.length?(s(r,u,i-t),++o,n.next?this.head=n.next:this.head=this.tail=null):(s(r,new a(u.buffer,u.byteOffset,t),i-t),this.head=n,n.data=u.slice(t));break}s(r,u,i-t),t-=u.length,++o}while(null!==(n=n.next));return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return u(this,{...r,depth:0,customInspect:!1})}}},4511(t,r,i){"use strict";let{pipeline:n}=i(6213),o=i(5737),{destroyer:s}=i(5417),{isNodeStream:a,isReadable:l,isWritable:u,isWebStream:c,isTransformStream:d,isWritableStream:h,isReadableStream:f}=i(3338),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:g,ERR_MISSING_ARGS:b}}=i(5596),m=i(6567);t.exports=function(...t){if(0===t.length)throw new b("streams");if(1===t.length)return o.from(t[0]);let r=[...t];if("function"==typeof t[0]&&(t[0]=o.from(t[0])),"function"==typeof t[t.length-1]){let i=t.length-1;t[i]=o.from(t[i])}for(let y=0;y<t.length;++y)if(a(t[y])||c(t[y])){if(y<t.length-1&&!(l(t[y])||f(t[y])||d(t[y])))throw new g(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(u(t[y])||h(t[y])||d(t[y])))throw new g(`streams[${y}]`,r[y],"must be writable")}let $,w,v,_,S,E=t[0],k=n(t,function(t){let r=_;_=null,r?r(t):t?S.destroy(t):R||A||S.destroy()}),A=!!(u(E)||h(E)||d(E)),R=!!(l(k)||f(k)||d(k));if(S=new o({writableObjectMode:!(null==E||!E.writableObjectMode),readableObjectMode:!(null==k||!k.readableObjectMode),writable:A,readable:R}),A){if(a(E))S._write=function(t,r,i){E.write(t,r)?i():$=i},S._final=function(t){E.end(),w=t},E.on("drain",function(){if($){let t=$;$=null,t()}});else if(c(E)){let T=(d(E)?E.writable:E).getWriter();S._write=async function(t,r,i){try{await T.ready,T.write(t).catch(()=>{}),i()}catch(n){i(n)}},S._final=async function(t){try{await T.ready,T.close().catch(()=>{}),w=t}catch(r){t(r)}}}let I=d(k)?k.readable:k;m(I,()=>{if(w){let t=w;w=null,t()}})}if(R){if(a(k))k.on("readable",function(){if(v){let t=v;v=null,t()}}),k.on("end",function(){S.push(null)}),S._read=function(){for(;;){let t=k.read();if(null===t)return void(v=S._read);if(!S.push(t))return}};else if(c(k)){let C=(d(k)?k.readable:k).getReader();S._read=async function(){for(;;)try{let{value:t,done:r}=await C.read();if(!S.push(t))return;if(r)return void S.push(null)}catch{return}}}}return S._destroy=function(t,r){t||null===_||(t=new p),v=null,$=null,w=null,null===_?r(t):(_=r,a(k)&&s(k,t))},S}},5417(t,r,i){"use strict";let n=i(6308),{aggregateTwoErrors:o,codes:{ERR_MULTIPLE_CALLBACK:s},AbortError:a}=i(5596),{Symbol:l}=i(1807),{kIsDestroyed:u,isDestroyed:c,isFinished:d,isServerRequest:h}=i(3338),f=l("kDestroy"),p=l("kConstruct");function g(t,r,i){t&&(t.stack,r&&!r.errored&&(r.errored=t),i&&!i.errored&&(i.errored=t))}function b(t,r,i){let o=!1;function s(r){if(o)return;o=!0;let s=t._readableState,a=t._writableState;g(r,a,s),a&&(a.closed=!0),s&&(s.closed=!0),"function"==typeof i&&i(r),r?n.nextTick(m,t,r):n.nextTick(y,t)}try{t._destroy(r||null,s)}catch(a){s(a)}}function m(t,r){$(t,r),y(t)}function y(t){let r=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),r&&(r.closeEmitted=!0),(null!=i&&i.emitClose||null!=r&&r.emitClose)&&t.emit("close")}function $(t,r){let i=t._readableState,n=t._writableState;null!=n&&n.errorEmitted||null!=i&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",r))}function w(t,r,i){let o=t._readableState,s=t._writableState;if(null!=s&&s.destroyed||null!=o&&o.destroyed)return this;null!=o&&o.autoDestroy||null!=s&&s.autoDestroy?t.destroy(r):r&&(r.stack,s&&!s.errored&&(s.errored=r),o&&!o.errored&&(o.errored=r),i?n.nextTick($,t,r):$(t,r))}function v(t){let r=!1;function i(i){if(r)return void w(t,null!=i?i:new s);r=!0;let o=t._readableState,a=t._writableState,l=a||o;o&&(o.constructed=!0),a&&(a.constructed=!0),l.destroyed?t.emit(f,i):i?w(t,i,!0):n.nextTick(_,t)}try{t._construct(t=>{n.nextTick(i,t)})}catch(o){n.nextTick(i,o)}}function _(t){t.emit(p)}function S(t){return(null==t?void 0:t.setHeader)&&"function"==typeof t.abort}function E(t){t.emit("close")}function k(t,r){t.emit("error",r),n.nextTick(E,t)}t.exports={construct:function(t,r){if("function"!=typeof t._construct)return;let i=t._readableState,o=t._writableState;i&&(i.constructed=!1),o&&(o.constructed=!1),t.once(p,r),t.listenerCount(p)>1||n.nextTick(v,t)},destroyer:function(t,r){t&&!c(t)&&(r||d(t)||(r=new a),h(t)?(t.socket=null,t.destroy(r)):S(t)?t.abort():S(t.req)?t.req.abort():"function"==typeof t.destroy?t.destroy(r):"function"==typeof t.close?t.close():r?n.nextTick(k,t,r):n.nextTick(E,t),t.destroyed||(t[u]=!0))},destroy:function(t,r){let i=this._readableState,n=this._writableState,s=n||i;return null!=n&&n.destroyed||null!=i&&i.destroyed?("function"==typeof r&&r(),this):(g(t,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),s.constructed?b(this,t,r):this.once(f,function(i){b(this,o(i,t),r)}),this)},undestroy:function(){let t=this._readableState,r=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=!1===t.readable,t.endEmitted=!1===t.readable),r&&(r.constructed=!0,r.destroyed=!1,r.closed=!1,r.closeEmitted=!1,r.errored=null,r.errorEmitted=!1,r.finalCalled=!1,r.prefinished=!1,r.ended=!1===r.writable,r.ending=!1===r.writable,r.finished=!1===r.writable)},errorOrDestroy:w}},5737(t,r,i){"use strict";let{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:o,ObjectKeys:s,ObjectSetPrototypeOf:a}=i(1807);t.exports=f;let l=i(943),u=i(4851);a(f.prototype,l.prototype),a(f,l);{let c=s(u.prototype);for(let d=0;d<c.length;d++){let h=c[d];f.prototype[h]||(f.prototype[h]=u.prototype[h])}}function f(t){if(!(this instanceof f))return new f(t);l.call(this,t),u.call(this,t),t?(this.allowHalfOpen=!1!==t.allowHalfOpen,!1===t.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===t.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let p,g;function b(){return void 0===p&&(p={}),p}n(f.prototype,{writable:{__proto__:null,...o(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...o(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...o(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...o(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...o(u.prototype,"writableLength")},writableFinished:{__proto__:null,...o(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...o(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...o(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...o(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}}),f.fromWeb=function(t,r){return b().newStreamDuplexFromReadableWritablePair(t,r)},f.toWeb=function(t){return b().newReadableWritablePairFromDuplex(t)},f.from=function(t){return g||(g=i(4959)),g(t,"body")}},4959(t,r,i){let n=i(6308),o=i(181),{isReadable:s,isWritable:a,isIterable:l,isNodeStream:u,isReadableNodeStream:c,isWritableNodeStream:d,isDuplexNodeStream:h,isReadableStream:f,isWritableStream:p}=i(3338),g=i(6567),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:y}}=i(5596),{destroyer:$}=i(5417),w=i(5737),v=i(943),_=i(4851),{createDeferredPromise:S}=i(8619),E=i(7035),k=globalThis.Blob||o.Blob,A=void 0!==k?function(t){return t instanceof k}:function(t){return!1},R=globalThis.AbortController||i(1506).z1,{FunctionPrototypeCall:T}=i(1807);class I extends w{constructor(t){super(t),!1===(null==t?void 0:t.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==t?void 0:t.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function C(t){let r=t.readable&&"function"!=typeof t.readable.read?v.wrap(t.readable):t.readable,i=t.writable,n,o,l,u,c,d=!!s(r),h=!!a(i);function f(t){let r=u;u=null,r?r(t):t&&c.destroy(t)}return c=new I({readableObjectMode:!(null==r||!r.readableObjectMode),writableObjectMode:!(null==i||!i.writableObjectMode),readable:d,writable:h}),h&&(g(i,t=>{h=!1,t&&$(r,t),f(t)}),c._write=function(t,r,o){i.write(t,r)?o():n=o},c._final=function(t){i.end(),o=t},i.on("drain",function(){if(n){let t=n;n=null,t()}}),i.on("finish",function(){if(o){let t=o;o=null,t()}})),d&&(g(r,t=>{d=!1,t&&$(r,t),f(t)}),r.on("readable",function(){if(l){let t=l;l=null,t()}}),r.on("end",function(){c.push(null)}),c._read=function(){for(;;){let t=r.read();if(null===t)return void(l=c._read);if(!c.push(t))return}}),c._destroy=function(t,s){t||null===u||(t=new b),l=null,n=null,o=null,null===u?s(t):(u=s,$(i,t),$(r,t))},c}t.exports=function t(r,i){if(h(r))return r;if(c(r))return C({readable:r});if(d(r))return C({writable:r});if(u(r))return C({writable:!1,readable:!1});if(f(r))return C({readable:v.fromWeb(r)});if(p(r))return C({writable:_.fromWeb(r)});if("function"==typeof r){let{value:o,write:s,final:a,destroy:g}=function(t){let{promise:r,resolve:i}=S(),o=new R,s=o.signal;return{value:t(async function*(){for(;;){let t=r;r=null;let{chunk:o,done:a,cb:l}=await t;if(n.nextTick(l),a)return;if(s.aborted)throw new b(void 0,{cause:s.reason});({promise:r,resolve:i}=S()),yield o}}(),{signal:s}),write(t,r,n){let o=i;i=null,o({chunk:t,done:!1,cb:n})},final(t){let r=i;i=null,r({done:!0,cb:t})},destroy(t,r){o.abort(),r(t)}}}(r);if(l(o))return E(I,o,{objectMode:!0,write:s,final:a,destroy:g});let w=null==o?void 0:o.then;if("function"==typeof w){let k,P=T(w,o,t=>{if(null!=t)throw new y("nully","body",t)},t=>{$(k,t)});return k=new I({objectMode:!0,readable:!1,write:s,final(t){a(async()=>{try{await P,n.nextTick(t,null)}catch(r){n.nextTick(t,r)}})},destroy:g})}throw new y("Iterable, AsyncIterable or AsyncFunction",i,o)}if(A(r))return t(r.arrayBuffer());if(l(r))return E(I,r,{objectMode:!0,writable:!1});if(f(null==r?void 0:r.readable)&&p(null==r?void 0:r.writable))return I.fromWeb(r);if("object"==typeof(null==r?void 0:r.writable)||"object"==typeof(null==r?void 0:r.readable))return C({readable:null!=r&&r.readable?c(null==r?void 0:r.readable)?null==r?void 0:r.readable:t(r.readable):void 0,writable:null!=r&&r.writable?d(null==r?void 0:r.writable)?null==r?void 0:r.writable:t(r.writable):void 0});let x=null==r?void 0:r.then;if("function"==typeof x){let M;return T(x,r,t=>{null!=t&&M.push(t),M.push(null)},t=>{$(M,t)}),M=new I({objectMode:!0,writable:!1,read(){}})}throw new m(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],r)}},6567(t,r,i){let n=i(6308),{AbortError:o,codes:s}=i(5596),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:l}=s,{kEmptyObject:u,once:c}=i(8619),{validateAbortSignal:d,validateFunction:h,validateObject:f,validateBoolean:p}=i(570),{Promise:g,PromisePrototypeThen:b,SymbolDispose:m}=i(1807),{isClosed:y,isReadable:$,isReadableNodeStream:w,isReadableStream:v,isReadableFinished:_,isReadableErrored:S,isWritable:E,isWritableNodeStream:k,isWritableStream:A,isWritableFinished:R,isWritableErrored:T,isNodeStream:I,willEmitClose:C,kIsClosedPromise:P}=i(3338),x,M=()=>{};function O(t,r,s){var p,g,O;if(2===arguments.length?(s=r,r=u):null==r?r=u:f(r,"options"),h(s,"callback"),d(r.signal,"options.signal"),s=c(s),v(t)||A(t))return function(t,r,s){let a=!1,l=M;if(r.signal){if(l=()=>{a=!0,s.call(t,new o(void 0,{cause:r.signal.reason}))},r.signal.aborted)n.nextTick(l);else{x=x||i(8619).addAbortListener;let u=x(r.signal,l),d=s;s=c((...r)=>{u[m](),d.apply(t,r)})}}let h=(...r)=>{a||n.nextTick(()=>s.apply(t,r))};return b(t[P].promise,h,h),M}(t,r,s);if(!I(t))throw new a("stream",["ReadableStream","WritableStream","Stream"],t);let N=null!==(p=r.readable)&&void 0!==p?p:w(t),L=null!==(g=r.writable)&&void 0!==g?g:k(t),D=t._writableState,W=t._readableState,U=()=>{t.writable||j()},B=C(t)&&w(t)===N&&k(t)===L,F=R(t,!1),j=()=>{F=!0,t.destroyed&&(B=!1),B&&(!t.readable||N)||N&&!V||s.call(t)},V=_(t,!1),G=()=>{V=!0,t.destroyed&&(B=!1),B&&(!t.writable||L)||L&&!F||s.call(t)},q=r=>{s.call(t,r)},K=y(t),H=()=>{K=!0;let r=T(t)||S(t);return r&&"boolean"!=typeof r?s.call(t,r):N&&!V&&w(t,!0)&&!_(t,!1)?s.call(t,new l):!L||F||R(t,!1)?void s.call(t):s.call(t,new l)},z=()=>{K=!0;let r=T(t)||S(t);if(r&&"boolean"!=typeof r)return s.call(t,r);s.call(t)},Q=()=>{t.req.on("finish",j)};(O=t).setHeader&&"function"==typeof O.abort?(t.on("complete",j),B||t.on("abort",H),t.req?Q():t.on("request",Q)):L&&!D&&(t.on("end",U),t.on("close",U)),B||"boolean"!=typeof t.aborted||t.on("aborted",H),t.on("end",G),t.on("finish",j),!1!==r.error&&t.on("error",q),t.on("close",H),K?n.nextTick(H):null!=D&&D.errorEmitted||null!=W&&W.errorEmitted?B||n.nextTick(z):(N||B&&!$(t)||!F&&!1!==E(t))&&(L||B&&!E(t)||!V&&!1!==$(t))?W&&t.req&&t.aborted&&n.nextTick(z):n.nextTick(z);let Y=()=>{s=M,t.removeListener("aborted",H),t.removeListener("complete",j),t.removeListener("abort",H),t.removeListener("request",Q),t.req&&t.req.removeListener("finish",j),t.removeListener("end",U),t.removeListener("close",U),t.removeListener("finish",j),t.removeListener("end",G),t.removeListener("error",q),t.removeListener("close",H)};if(r.signal&&!K){let X=()=>{let i=s;Y(),i.call(t,new o(void 0,{cause:r.signal.reason}))};if(r.signal.aborted)n.nextTick(X);else{x=x||i(8619).addAbortListener;let Z=x(r.signal,X),J=s;s=c((...r)=>{Z[m](),J.apply(t,r)})}}return Y}t.exports=O,t.exports.finished=function(t,r){var i;let n=!1;return null===r&&(r=u),null!==(i=r)&&void 0!==i&&i.cleanup&&(p(r.cleanup,"cleanup"),n=r.cleanup),new g((i,o)=>{let s=O(t,r,t=>{n&&s(),t?o(t):i()})})}},7035(t,r,i){"use strict";let n=i(6308),{PromisePrototypeThen:o,SymbolAsyncIterator:s,SymbolIterator:a}=i(1807),{Buffer:l}=i(181),{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:c}=i(5596).codes;t.exports=function(t,r,i){let d,h;if("string"==typeof r||r instanceof l)return new t({objectMode:!0,...i,read(){this.push(r),this.push(null)}});if(r&&r[s])h=!0,d=r[s]();else{if(!r||!r[a])throw new u("iterable",["Iterable"],r);h=!1,d=r[a]()}let f=new t({objectMode:!0,highWaterMark:1,...i}),p=!1;return f._read=function(){p||(p=!0,async function(){for(;;){try{let{value:t,done:r}=h?await d.next():d.next();if(r)f.push(null);else{let i=t&&"function"==typeof t.then?await t:t;if(null===i)throw p=!1,new c;if(f.push(i))continue;p=!1}}catch(n){f.destroy(n)}break}}())},f._destroy=function(t,r){o(async function(t){let r="function"==typeof d.throw;if(null!=t&&r){let{value:i,done:n}=await d.throw(t);if(await i,n)return}if("function"==typeof d.return){let{value:o}=await d.return();await o}}(t),()=>n.nextTick(r,t),i=>n.nextTick(r,i||t))},f}},4952(t,r,i){"use strict";let{ArrayIsArray:n,ObjectSetPrototypeOf:o}=i(1807),{EventEmitter:s}=i(4434);function a(t){s.call(this,t)}function l(t,r,i){if("function"==typeof t.prependListener)return t.prependListener(r,i);t._events&&t._events[r]?n(t._events[r])?t._events[r].unshift(i):t._events[r]=[i,t._events[r]]:t.on(r,i)}o(a.prototype,s.prototype),o(a,s),a.prototype.pipe=function(t,r){let i=this;function n(r){t.writable&&!1===t.write(r)&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}i.on("data",n),t.on("drain",o),t._isStdio||r&&!1===r.end||(i.on("end",u),i.on("close",c));let a=!1;function u(){a||(a=!0,t.end())}function c(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function d(t){h(),0===s.listenerCount(this,"error")&&this.emit("error",t)}function h(){i.removeListener("data",n),t.removeListener("drain",o),i.removeListener("end",u),i.removeListener("close",c),i.removeListener("error",d),t.removeListener("error",d),i.removeListener("end",h),i.removeListener("close",h),t.removeListener("close",h)}return l(i,"error",d),l(t,"error",d),i.on("end",h),i.on("close",h),t.on("close",h),t.emit("pipe",i),t},t.exports={Stream:a,prependListener:l}},7614(t,r,i){"use strict";let n=globalThis.AbortController||i(1506).z1,{codes:{ERR_INVALID_ARG_VALUE:o,ERR_INVALID_ARG_TYPE:s,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:l},AbortError:u}=i(5596),{validateAbortSignal:c,validateInteger:d,validateObject:h}=i(570),f=i(1807).Symbol("kWeak"),p=i(1807).Symbol("kResistStopPropagation"),{finished:g}=i(6567),b=i(4511),{addAbortSignalNoValidate:m}=i(996),{isWritable:y,isNodeStream:$}=i(3338),{deprecate:w}=i(8619),{ArrayPrototypePush:v,Boolean:_,MathFloor:S,Number:E,NumberIsNaN:k,Promise:A,PromiseReject:R,PromiseResolve:T,PromisePrototypeThen:I,Symbol:C}=i(1807),P=C("kEmpty"),x=C("kEof");function M(t,r){if("function"!=typeof t)throw new s("fn",["Function","AsyncFunction"],t);null!=r&&h(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let n=1;null!=(null==r?void 0:r.concurrency)&&(n=S(r.concurrency));let o=n-1;return null!=(null==r?void 0:r.highWaterMark)&&(o=S(r.highWaterMark)),d(n,"options.concurrency",1),d(o,"options.highWaterMark",0),o+=n,(async function*(){let s=i(8619).AbortSignalAny([null==r?void 0:r.signal].filter(_)),a=this,l=[],c={signal:s},d,h,f=!1,p=0;function g(){f=!0,b()}function b(){p-=1,m()}function m(){h&&!f&&p<n&&l.length<o&&(h(),h=null)}!async function(){try{for await(let r of a){if(f)return;if(s.aborted)throw new u;try{if((r=t(r,c))===P)continue;r=T(r)}catch(i){r=R(i)}p+=1,I(r,b,g),l.push(r),d&&(d(),d=null),!f&&(l.length>=o||p>=n)&&await new A(t=>{h=t})}l.push(x)}catch(m){let y=R(m);I(y,b,g),l.push(y)}finally{f=!0,d&&(d(),d=null)}}();try{for(;;){for(;l.length>0;){let y=await l[0];if(y===x)return;if(s.aborted)throw new u;y!==P&&(yield y),l.shift(),m()}await new A(t=>{d=t})}}finally{f=!0,h&&(h(),h=null)}}).call(this)}async function O(t,r){for await(let i of N.call(this,t,r))return!0;return!1}function N(t,r){if("function"!=typeof t)throw new s("fn",["Function","AsyncFunction"],t);return M.call(this,async function(r,i){return await t(r,i)?r:P},r)}class L extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function D(t){if(k(t=E(t)))return 0;if(t<0)throw new l("number",">= 0",t);return t}t.exports.streamReturningOperators={asIndexedPairs:w(function(t){return null!=t&&h(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),(async function*(){let r=0;for await(let i of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new u({cause:t.signal.reason});yield[r++,i]}}).call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(t,r){return null!=r&&h(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal"),t=D(t),(async function*(){var i,n;if(null!=r&&null!==(i=r.signal)&&void 0!==i&&i.aborted)throw new u;for await(let o of this){if(null!=r&&null!==(n=r.signal)&&void 0!==n&&n.aborted)throw new u;t--<=0&&(yield o)}}).call(this)},filter:N,flatMap:function(t,r){let i=M.call(this,t,r);return(async function*(){for await(let t of i)yield*t}).call(this)},map:M,take:function(t,r){return null!=r&&h(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal"),t=D(t),(async function*(){var i,n;if(null!=r&&null!==(i=r.signal)&&void 0!==i&&i.aborted)throw new u;for await(let o of this){if(null!=r&&null!==(n=r.signal)&&void 0!==n&&n.aborted)throw new u;if(t-- >0&&(yield o),t<=0)return}}).call(this)},compose:function(t,r){if(null!=r&&h(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal"),$(t)&&!y(t))throw new o("stream",t,"must be writable");let i=b(this,t);return null!=r&&r.signal&&m(r.signal,i),i}},t.exports.promiseReturningOperators={every:async function(t,r){if("function"!=typeof t)throw new s("fn",["Function","AsyncFunction"],t);return!await O.call(this,async(...r)=>!await t(...r),r)},forEach:async function(t,r){if("function"!=typeof t)throw new s("fn",["Function","AsyncFunction"],t);for await(let i of M.call(this,async function(r,i){return await t(r,i),P},r));},reduce:async function(t,r,i){var o,a;if("function"!=typeof t)throw new s("reducer",["Function","AsyncFunction"],t);null!=i&&h(i,"options"),null!=(null==i?void 0:i.signal)&&c(i.signal,"options.signal");let l=arguments.length>1;if(null!=i&&null!==(o=i.signal)&&void 0!==o&&o.aborted){let d=new u(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await g(this.destroy(d)),d}let b=new n,m=b.signal;null!=i&&i.signal&&i.signal.addEventListener("abort",()=>b.abort(),{once:!0,[f]:this,[p]:!0});let y=!1;try{for await(let $ of this){if(y=!0,null!=i&&null!==(a=i.signal)&&void 0!==a&&a.aborted)throw new u;l?r=await t(r,$,{signal:m}):(r=$,l=!0)}if(!y&&!l)throw new L}finally{b.abort()}return r},toArray:async function(t){null!=t&&h(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let r=[];for await(let i of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new u(void 0,{cause:t.signal.reason});v(r,i)}return r},some:O,find:async function(t,r){for await(let i of N.call(this,t,r))return i}}},6141(t,r,i){"use strict";let{ObjectSetPrototypeOf:n}=i(1807);t.exports=s;let o=i(3823);function s(t){if(!(this instanceof s))return new s(t);o.call(this,t)}n(s.prototype,o.prototype),n(s,o),s.prototype._transform=function(t,r,i){i(null,t)}},6213(t,r,i){let n=i(6308),{ArrayIsArray:o,Promise:s,SymbolAsyncIterator:a,SymbolDispose:l}=i(1807),u=i(6567),{once:c}=i(8619),d=i(5417),h=i(5737),{aggregateTwoErrors:f,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:b,ERR_STREAM_DESTROYED:m,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:$}=i(5596),{validateFunction:w,validateAbortSignal:v}=i(570),{isIterable:_,isReadable:S,isReadableNodeStream:E,isNodeStream:k,isTransformStream:A,isWebStream:R,isReadableStream:T,isReadableFinished:I}=i(3338),C=globalThis.AbortController||i(1506).z1,P,x,M;function O(t,r,i){let n=!1;return t.on("close",()=>{n=!0}),{destroy(r){n||(n=!0,d.destroyer(t,r||new m("pipe")))},cleanup:u(t,{readable:r,writable:i},t=>{n=!t})}}function N(t){if(_(t))return t;if(E(t))return async function*(t){x||(x=i(943)),yield*x.prototype[a].call(t)}(t);throw new p("val",["Readable","Iterable","AsyncIterable"],t)}async function L(t,r,i,{end:n}){let o,a=null,l=t=>{if(t&&(o=t),a){let r=a;a=null,r()}},c=()=>new s((t,r)=>{o?r(o):a=()=>{o?r(o):t()}});r.on("drain",l);let d=u(r,{readable:!1},l);try{for await(let h of(r.writableNeedDrain&&await c(),t))r.write(h)||await c();n&&(r.end(),await c()),i()}catch(p){i(o!==p?f(o,p):p)}finally{d(),r.off("drain",l)}}async function D(t,r,i,{end:n}){A(r)&&(r=r.writable);let o=r.getWriter();try{for await(let s of t)await o.ready,o.write(s).catch(()=>{});await o.ready,n&&await o.close(),i()}catch(a){try{await o.abort(a),i(a)}catch(l){i(l)}}}function W(t,r,s){if(1===t.length&&o(t[0])&&(t=t[0]),t.length<2)throw new b("streams");let a=new C,u=a.signal,c=null==s?void 0:s.signal,d=[];function f(){F(new $)}let m,y,w;v(c,"options.signal"),M=M||i(8619).addAbortListener,c&&(m=M(c,f));let I=[],x,W=0;function B(t){F(t,0==--W)}function F(t,i){var o;if(!t||y&&"ERR_STREAM_PREMATURE_CLOSE"!==y.code||(y=t),y||i){for(;I.length;)I.shift()(y);null===(o=m)||void 0===o||o[l](),a.abort(),i&&(y||d.forEach(t=>t()),n.nextTick(r,y,w))}}for(let j=0;j<t.length;j++){let V=t[j],G=j<t.length-1,q=j>0,K=G||!1!==(null==s?void 0:s.end),H=j===t.length-1;if(k(V)){if(K){let{destroy:z,cleanup:Q}=O(V,G,q);I.push(z),S(V)&&H&&d.push(Q)}function Y(t){t&&"AbortError"!==t.name&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code&&B(t)}V.on("error",Y),S(V)&&H&&d.push(()=>{V.removeListener("error",Y)})}if(0===j){if("function"==typeof V){if(!_(x=V({signal:u})))throw new g("Iterable, AsyncIterable or Stream","source",x)}else x=_(V)||E(V)||A(V)?V:h.from(V)}else if("function"==typeof V){var X,Z;if(x=A(x)?N(null===(X=x)||void 0===X?void 0:X.readable):N(x),x=V(x,{signal:u}),G){if(!_(x,!0))throw new g("AsyncIterable",`transform[${j-1}]`,x)}else{P||(P=i(6141));let J=new P({objectMode:!0}),ee=null===(Z=x)||void 0===Z?void 0:Z.then;if("function"==typeof ee)W++,ee.call(x,t=>{w=t,null!=t&&J.write(t),K&&J.end(),n.nextTick(B)},t=>{J.destroy(t),n.nextTick(B,t)});else if(_(x,!0))W++,L(x,J,B,{end:K});else{if(!T(x)&&!A(x))throw new g("AsyncIterable or Promise","destination",x);{let et=x.readable||x;W++,L(et,J,B,{end:K})}}x=J;let{destroy:er,cleanup:ei}=O(x,!1,!0);I.push(er),H&&d.push(ei)}}else if(k(V)){if(E(x)){W+=2;let en=U(x,V,B,{end:K});S(V)&&H&&d.push(en)}else if(A(x)||T(x)){let eo=x.readable||x;W++,L(eo,V,B,{end:K})}else{if(!_(x))throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],x);W++,L(x,V,B,{end:K})}x=V}else if(R(V)){if(E(x))W++,D(N(x),V,B,{end:K});else if(T(x)||_(x))W++,D(x,V,B,{end:K});else{if(!A(x))throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],x);W++,D(x.readable,V,B,{end:K})}x=V}else x=h.from(V)}return(null!=u&&u.aborted||null!=c&&c.aborted)&&n.nextTick(f),x}function U(t,r,i,{end:o}){let s=!1;if(r.on("close",()=>{s||i(new y)}),t.pipe(r,{end:!1}),o){function a(){s=!0,r.end()}I(t)?n.nextTick(a):t.once("end",a)}else i();return u(t,{readable:!0,writable:!1},r=>{let n=t._readableState;r&&"ERR_STREAM_PREMATURE_CLOSE"===r.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?t.once("end",i).once("error",i):i(r)}),u(r,{readable:!1,writable:!0},i)}t.exports={pipelineImpl:W,pipeline:function(...t){var r;return W(t,c((w((r=t)[r.length-1],"streams[stream.length - 1]"),r.pop())))}}},943(t,r,i){let n=i(6308),{ArrayPrototypeIndexOf:o,NumberIsInteger:s,NumberIsNaN:a,NumberParseInt:l,ObjectDefineProperties:u,ObjectKeys:c,ObjectSetPrototypeOf:d,Promise:h,SafeSet:f,SymbolAsyncDispose:p,SymbolAsyncIterator:g,Symbol:b}=i(1807);t.exports=V,V.ReadableState=j;let{EventEmitter:m}=i(4434),{Stream:y,prependListener:$}=i(4952),{Buffer:w}=i(181),{addAbortSignal:v}=i(996),_=i(6567),S=i(8619).debuglog("stream",t=>{S=t}),E=i(6608),k=i(5417),{getHighWaterMark:A,getDefaultHighWaterMark:R}=i(2066),{aggregateTwoErrors:T,codes:{ERR_INVALID_ARG_TYPE:I,ERR_METHOD_NOT_IMPLEMENTED:C,ERR_OUT_OF_RANGE:P,ERR_STREAM_PUSH_AFTER_EOF:x,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:M},AbortError:O}=i(5596),{validateObject:N}=i(570),L=b("kPaused"),{StringDecoder:D}=i(3193),W=i(7035);d(V.prototype,y.prototype),d(V,y);let U=()=>{},{errorOrDestroy:B}=k;function F(t){return{enumerable:!1,get(){return!!(this.state&t)},set(r){r?this.state|=t:this.state&=~t}}}function j(t,r,n){"boolean"!=typeof n&&(n=r instanceof i(5737)),this.state=6192,t&&t.objectMode&&(this.state|=1),n&&t&&t.readableObjectMode&&(this.state|=1),this.highWaterMark=t?A(this,t,"readableHighWaterMark",n):R(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this[L]=null,t&&!1===t.emitClose&&(this.state&=-2049),t&&!1===t.autoDestroy&&(this.state&=-4097),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new D(t.encoding),this.encoding=t.encoding)}function V(t){if(!(this instanceof V))return new V(t);let r=this instanceof i(5737);this._readableState=new j(t,this,r),t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.construct&&(this._construct=t.construct),t.signal&&!r&&v(t.signal,this)),y.call(this,t),k.construct(this,()=>{this._readableState.needReadable&&Q(this,this._readableState)})}function G(t,r,i,n){S("readableAddChunk",r);let o=t._readableState,s;if(1&o.state||("string"==typeof r?(i=i||o.defaultEncoding,o.encoding!==i&&(n&&o.encoding?r=w.from(r,i).toString(o.encoding):(r=w.from(r,i),i=""))):r instanceof w?i="":y._isUint8Array(r)?(r=y._uint8ArrayToBuffer(r),i=""):null!=r&&(s=new I("chunk",["string","Buffer","Uint8Array"],r))),s)B(t,s);else if(null===r)o.state&=-9,function(t,r){if(S("onEofChunk"),!r.ended){if(r.decoder){let i=r.decoder.end();i&&i.length&&(r.buffer.push(i),r.length+=r.objectMode?1:i.length)}r.ended=!0,r.sync?H(t):(r.needReadable=!1,r.emittedReadable=!0,z(t))}}(t,o);else if(1&o.state||r&&r.length>0){if(n){if(4&o.state)B(t,new M);else{if(o.destroyed||o.errored)return!1;q(t,o,r,!0)}}else if(o.ended)B(t,new x);else{if(o.destroyed||o.errored)return!1;o.state&=-9,o.decoder&&!i?(r=o.decoder.write(r),o.objectMode||0!==r.length?q(t,o,r,!1):Q(t,o)):q(t,o,r,!1)}}else n||(o.state&=-9,Q(t,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function q(t,r,i,n){r.flowing&&0===r.length&&!r.sync&&t.listenerCount("data")>0?(65536&r.state?r.awaitDrainWriters.clear():r.awaitDrainWriters=null,r.dataEmitted=!0,t.emit("data",i)):(r.length+=r.objectMode?1:i.length,n?r.buffer.unshift(i):r.buffer.push(i),64&r.state&&H(t)),Q(t,r)}function K(t,r){return t<=0||0===r.length&&r.ended?0:1&r.state?1:a(t)?r.flowing&&r.length?r.buffer.first().length:r.length:t<=r.length?t:r.ended?r.length:0}function H(t){let r=t._readableState;S("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(S("emitReadable",r.flowing),r.emittedReadable=!0,n.nextTick(z,t))}function z(t){let r=t._readableState;S("emitReadable_",r.destroyed,r.length,r.ended),r.destroyed||r.errored||!r.length&&!r.ended||(t.emit("readable"),r.emittedReadable=!1),r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark,ee(t)}function Q(t,r){!r.readingMore&&r.constructed&&(r.readingMore=!0,n.nextTick(Y,t,r))}function Y(t,r){for(;!r.reading&&!r.ended&&(r.length<r.highWaterMark||r.flowing&&0===r.length);){let i=r.length;if(S("maybeReadMore read 0"),t.read(0),i===r.length)break}r.readingMore=!1}function X(t){let r=t._readableState;r.readableListening=t.listenerCount("readable")>0,r.resumeScheduled&&!1===r[L]?r.flowing=!0:t.listenerCount("data")>0?t.resume():r.readableListening||(r.flowing=null)}function Z(t){S("readable nexttick read 0"),t.read(0)}function J(t,r){S("resume",r.reading),r.reading||t.read(0),r.resumeScheduled=!1,t.emit("resume"),ee(t),r.flowing&&!r.reading&&t.read(0)}function ee(t){let r=t._readableState;for(S("flow",r.flowing);r.flowing&&null!==t.read(););}function et(t,r){"function"!=typeof t.read&&(t=V.wrap(t,{objectMode:!0}));let i=async function*(t,r){let i,n=U;function o(r){this===t?(n(),n=U):n=r}t.on("readable",o);let s=_(t,{writable:!1},t=>{i=t?T(i,t):null,n(),n=U});try{for(;;){let a=t.destroyed?null:t.read();if(null!==a)yield a;else{if(i)throw i;if(null===i)return;await new h(o)}}}catch(l){throw i=T(i,l)}finally{(i||!1!==(null==r?void 0:r.destroyOnReturn))&&(void 0===i||t._readableState.autoDestroy)?k.destroyer(t,null):(t.off("readable",o),s())}}(t,r);return i.stream=t,i}function er(t,r){if(0===r.length)return null;let i;return r.objectMode?i=r.buffer.shift():!t||t>=r.length?(i=r.decoder?r.buffer.join(""):1===r.buffer.length?r.buffer.first():r.buffer.concat(r.length),r.buffer.clear()):i=r.buffer.consume(t,r.decoder),i}function ei(t){let r=t._readableState;S("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,n.nextTick(en,r,t))}function en(t,r){if(S("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&0===t.length){if(t.endEmitted=!0,r.emit("end"),r.writable&&!1===r.allowHalfOpen)n.nextTick(eo,r);else if(t.autoDestroy){let i=r._writableState;(!i||i.autoDestroy&&(i.finished||!1===i.writable))&&r.destroy()}}}function eo(t){!t.writable||t.writableEnded||t.destroyed||t.end()}let es;function ea(){return void 0===es&&(es={}),es}u(j.prototype,{objectMode:F(1),ended:F(2),endEmitted:F(4),reading:F(8),constructed:F(16),sync:F(32),needReadable:F(64),emittedReadable:F(128),readableListening:F(256),resumeScheduled:F(512),errorEmitted:F(1024),emitClose:F(2048),autoDestroy:F(4096),destroyed:F(8192),closed:F(16384),closeEmitted:F(32768),multiAwaitDrain:F(65536),readingMore:F(131072),dataEmitted:F(262144)}),V.prototype.destroy=k.destroy,V.prototype._undestroy=k.undestroy,V.prototype._destroy=function(t,r){r(t)},V.prototype[m.captureRejectionSymbol]=function(t){this.destroy(t)},V.prototype[p]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new O,this.destroy(t)),new h((r,i)=>_(this,n=>n&&n!==t?i(n):r(null)))},V.prototype.push=function(t,r){return G(this,t,r,!1)},V.prototype.unshift=function(t,r){return G(this,t,r,!0)},V.prototype.isPaused=function(){let t=this._readableState;return!0===t[L]||!1===t.flowing},V.prototype.setEncoding=function(t){let r=new D(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let o of i)n+=r.write(o);return i.clear(),""!==n&&i.push(n),this._readableState.length=n.length,this},V.prototype.read=function(t){S("read",t),void 0===t?t=NaN:s(t)||(t=l(t,10));let r=this._readableState,i=t;if(t>r.highWaterMark&&(r.highWaterMark=function(t){if(t>1073741824)throw new P("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,++t}(t)),0!==t&&(r.state&=-129),0===t&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return S("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?ei(this):H(this),null;if(0===(t=K(t,r))&&r.ended)return 0===r.length&&ei(this),null;let n,o=!!(64&r.state);if(S("need readable",o),(0===r.length||r.length-t<r.highWaterMark)&&S("length less than watermark",o=!0),r.ended||r.reading||r.destroyed||r.errored||!r.constructed)S("reading, ended or constructing",o=!1);else if(o){S("do read"),r.state|=40,0===r.length&&(r.state|=64);try{this._read(r.highWaterMark)}catch(a){B(this,a)}r.state&=-33,r.reading||(t=K(i,r))}return null===(n=t>0?er(t,r):null)?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.multiAwaitDrain?r.awaitDrainWriters.clear():r.awaitDrainWriters=null),0===r.length&&(r.ended||(r.needReadable=!0),i!==t&&r.ended&&ei(this)),null===n||r.errorEmitted||r.closeEmitted||(r.dataEmitted=!0,this.emit("data",n)),n},V.prototype._read=function(t){throw new C("_read()")},V.prototype.pipe=function(t,r){let i=this,o=this._readableState;1===o.pipes.length&&(o.multiAwaitDrain||(o.multiAwaitDrain=!0,o.awaitDrainWriters=new f(o.awaitDrainWriters?[o.awaitDrainWriters]:[]))),o.pipes.push(t),S("pipe count=%d opts=%j",o.pipes.length,r);let s=r&&!1===r.end||t===n.stdout||t===n.stderr?b:a;function a(){S("onend"),t.end()}let l;o.endEmitted?n.nextTick(s):i.once("end",s),t.on("unpipe",function r(n,s){S("onunpipe"),n===i&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,S("cleanup"),t.removeListener("close",p),t.removeListener("finish",g),l&&t.removeListener("drain",l),t.removeListener("error",h),t.removeListener("unpipe",r),i.removeListener("end",a),i.removeListener("end",b),i.removeListener("data",d),u=!0,l&&o.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l())});let u=!1;function c(){var r,n;u||(1===o.pipes.length&&o.pipes[0]===t?(S("false write response, pause",0),o.awaitDrainWriters=t,o.multiAwaitDrain=!1):o.pipes.length>1&&o.pipes.includes(t)&&(S("false write response, pause",o.awaitDrainWriters.size),o.awaitDrainWriters.add(t)),i.pause()),l||(l=(r=i,n=t,function(){let t=r._readableState;t.awaitDrainWriters===n?(S("pipeOnDrain",1),t.awaitDrainWriters=null):t.multiAwaitDrain&&(S("pipeOnDrain",t.awaitDrainWriters.size),t.awaitDrainWriters.delete(n)),t.awaitDrainWriters&&0!==t.awaitDrainWriters.size||!r.listenerCount("data")||r.resume()}),t.on("drain",l))}function d(r){S("ondata");let i=t.write(r);S("dest.write",i),!1===i&&c()}function h(r){if(S("onerror",r),b(),t.removeListener("error",h),0===t.listenerCount("error")){let i=t._writableState||t._readableState;i&&!i.errorEmitted?B(t,r):t.emit("error",r)}}function p(){t.removeListener("finish",g),b()}function g(){S("onfinish"),t.removeListener("close",p),b()}function b(){S("unpipe"),i.unpipe(t)}return i.on("data",d),$(t,"error",h),t.once("close",p),t.once("finish",g),t.emit("pipe",i),!0===t.writableNeedDrain?c():o.flowing||(S("pipe resume"),i.resume()),t},V.prototype.unpipe=function(t){let r=this._readableState;if(0===r.pipes.length)return this;if(!t){let i=r.pipes;r.pipes=[],this.pause();for(let n=0;n<i.length;n++)i[n].emit("unpipe",this,{hasUnpiped:!1});return this}let s=o(r.pipes,t);return -1===s||(r.pipes.splice(s,1),0===r.pipes.length&&this.pause(),t.emit("unpipe",this,{hasUnpiped:!1})),this},V.prototype.on=function(t,r){let i=y.prototype.on.call(this,t,r),o=this._readableState;return"data"===t?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===t&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,S("on readable",o.length,o.reading),o.length?H(this):o.reading||n.nextTick(Z,this))),i},V.prototype.addListener=V.prototype.on,V.prototype.removeListener=function(t,r){let i=y.prototype.removeListener.call(this,t,r);return"readable"===t&&n.nextTick(X,this),i},V.prototype.off=V.prototype.removeListener,V.prototype.removeAllListeners=function(t){let r=y.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(X,this),r},V.prototype.resume=function(){var t,r;let i=this._readableState;return i.flowing||(S("resume"),i.flowing=!i.readableListening,t=this,(r=i).resumeScheduled||(r.resumeScheduled=!0,n.nextTick(J,t,r))),i[L]=!1,this},V.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[L]=!0,this},V.prototype.wrap=function(t){let r=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(r=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",t=>{B(this,t)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{r&&t.resume&&(r=!1,t.resume())};let i=c(t);for(let n=1;n<i.length;n++){let o=i[n];void 0===this[o]&&"function"==typeof t[o]&&(this[o]=t[o].bind(t))}return this},V.prototype[g]=function(){return et(this)},V.prototype.iterator=function(t){return void 0!==t&&N(t,"options"),et(this,t)},u(V.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!(!t||!1===t.readable||t.destroyed||t.errorEmitted||t.endEmitted)},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),u(j.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[L]},set(t){this[L]=!!t}}}),V._fromList=er,V.from=function(t,r){return W(V,t,r)},V.fromWeb=function(t,r){return ea().newStreamReadableFromReadableStream(t,r)},V.toWeb=function(t,r){return ea().newReadableStreamFromStreamReadable(t,r)},V.wrap=function(t,r){var i,n;return new V({objectMode:null===(i=null!==(n=t.readableObjectMode)&&void 0!==n?n:t.objectMode)||void 0===i||i,...r,destroy(r,i){k.destroyer(t,r),i(r)}}).wrap(t)}},2066(t,r,i){"use strict";let{MathFloor:n,NumberIsInteger:o}=i(1807),{validateInteger:s}=i(570),{ERR_INVALID_ARG_VALUE:a}=i(5596).codes,l=16384,u=16;function c(t){return t?u:l}t.exports={getHighWaterMark:function(t,r,i,s){var l,u,d;let h=(l=r,u=s,d=i,null!=l.highWaterMark?l.highWaterMark:u?l[d]:null);if(null!=h){if(!o(h)||h<0)throw new a(s?`options.${i}`:"options.highWaterMark",h);return n(h)}return c(t.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(t,r){s(r,"value",0),t?u=r:l=r}}},3823(t,r,i){"use strict";let{ObjectSetPrototypeOf:n,Symbol:o}=i(1807);t.exports=c;let{ERR_METHOD_NOT_IMPLEMENTED:s}=i(5596).codes,a=i(5737),{getHighWaterMark:l}=i(2066);n(c.prototype,a.prototype),n(c,a);let u=o("kCallback");function c(t){if(!(this instanceof c))return new c(t);let r=t?l(this,t,"readableHighWaterMark",!0):null;0===r&&(t={...t,highWaterMark:null,readableHighWaterMark:r,writableHighWaterMark:t.writableHighWaterMark||0}),a.call(this,t),this._readableState.sync=!1,this[u]=null,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function d(t){"function"!=typeof this._flush||this.destroyed?(this.push(null),t&&t()):this._flush((r,i)=>{r?t?t(r):this.destroy(r):(null!=i&&this.push(i),this.push(null),t&&t())})}function h(){this._final!==d&&d.call(this)}c.prototype._final=d,c.prototype._transform=function(t,r,i){throw new s("_transform()")},c.prototype._write=function(t,r,i){let n=this._readableState,o=this._writableState,s=n.length;this._transform(t,r,(t,r)=>{t?i(t):(null!=r&&this.push(r),o.ended||s===n.length||n.length<n.highWaterMark?i():this[u]=i)})},c.prototype._read=function(){if(this[u]){let t=this[u];this[u]=null,t()}}},3338(t,r,i){"use strict";let{SymbolAsyncIterator:n,SymbolIterator:o,SymbolFor:s}=i(1807),a=s("nodejs.stream.destroyed"),l=s("nodejs.stream.errored"),u=s("nodejs.stream.readable"),c=s("nodejs.stream.writable"),d=s("nodejs.stream.disturbed"),h=s("nodejs.webstream.isClosedPromise"),f=s("nodejs.webstream.controllerErrorFunction");function p(t,r=!1){var i;return!(!t||"function"!=typeof t.pipe||"function"!=typeof t.on||r&&("function"!=typeof t.pause||"function"!=typeof t.resume)||t._writableState&&!1===(null===(i=t._readableState)||void 0===i?void 0:i.readable)||t._writableState&&!t._readableState)}function g(t){var r;return!(!t||"function"!=typeof t.write||"function"!=typeof t.on||t._readableState&&!1===(null===(r=t._writableState)||void 0===r?void 0:r.writable))}function b(t){return t&&(t._readableState||t._writableState||"function"==typeof t.write&&"function"==typeof t.on||"function"==typeof t.pipe&&"function"==typeof t.on)}function m(t){return!(!t||b(t)||"function"!=typeof t.pipeThrough||"function"!=typeof t.getReader||"function"!=typeof t.cancel)}function y(t){return!(!t||b(t)||"function"!=typeof t.getWriter||"function"!=typeof t.abort)}function $(t){return!(!t||b(t)||"object"!=typeof t.readable||"object"!=typeof t.writable)}function w(t){if(!b(t))return null;let r=t._writableState,i=t._readableState,n=r||i;return!!(t.destroyed||t[a]||null!=n&&n.destroyed)}function v(t){if(!g(t))return null;if(!0===t.writableEnded)return!0;let r=t._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.ended)?null:r.ended)}function _(t,r){if(!p(t))return null;let i=t._readableState;return(null==i||!i.errored)&&("boolean"!=typeof(null==i?void 0:i.endEmitted)?null:!!(i.endEmitted||!1===r&&!0===i.ended&&0===i.length))}function S(t){return t&&null!=t[u]?t[u]:"boolean"!=typeof(null==t?void 0:t.readable)?null:!w(t)&&p(t)&&t.readable&&!_(t)}function E(t){return t&&null!=t[c]?t[c]:"boolean"!=typeof(null==t?void 0:t.writable)?null:!w(t)&&g(t)&&t.writable&&!v(t)}function k(t){return"boolean"==typeof t._closed&&"boolean"==typeof t._defaultKeepAlive&&"boolean"==typeof t._removedConnection&&"boolean"==typeof t._removedContLen}function A(t){return"boolean"==typeof t._sent100&&k(t)}t.exports={isDestroyed:w,kIsDestroyed:a,isDisturbed:function(t){var r;return!(!t||!(null!==(r=t[d])&&void 0!==r?r:t.readableDidRead||t.readableAborted))},kIsDisturbed:d,isErrored:function(t){var r,i,n,o,s,a,u,c,d,h;return!(!t||!(null!==(r=null!==(i=null!==(n=null!==(o=null!==(s=null!==(a=t[l])&&void 0!==a?a:t.readableErrored)&&void 0!==s?s:t.writableErrored)&&void 0!==o?o:null===(u=t._readableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==n?n:null===(c=t._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==i?i:null===(d=t._readableState)||void 0===d?void 0:d.errored)&&void 0!==r?r:null===(h=t._writableState)||void 0===h?void 0:h.errored))},kIsErrored:l,isReadable:S,kIsReadable:u,kIsClosedPromise:h,kControllerErrorFunction:f,kIsWritable:c,isClosed:function(t){if(!b(t))return null;if("boolean"==typeof t.closed)return t.closed;let r=t._writableState,i=t._readableState;return"boolean"==typeof(null==r?void 0:r.closed)||"boolean"==typeof(null==i?void 0:i.closed)?(null==r?void 0:r.closed)||(null==i?void 0:i.closed):"boolean"==typeof t._closed&&k(t)?t._closed:null},isDuplexNodeStream:function(t){return!(!t||"function"!=typeof t.pipe||!t._readableState||"function"!=typeof t.on||"function"!=typeof t.write)},isFinished:function(t,r){return b(t)?!(!w(t)&&(!1!==(null==r?void 0:r.readable)&&S(t)||!1!==(null==r?void 0:r.writable)&&E(t))):null},isIterable:function(t,r){return null!=t&&(!0===r?"function"==typeof t[n]:!1===r?"function"==typeof t[o]:"function"==typeof t[n]||"function"==typeof t[o])},isReadableNodeStream:p,isReadableStream:m,isReadableEnded:function(t){if(!p(t))return null;if(!0===t.readableEnded)return!0;let r=t._readableState;return!(!r||r.errored)&&("boolean"!=typeof(null==r?void 0:r.ended)?null:r.ended)},isReadableFinished:_,isReadableErrored:function(t){var r,i;return b(t)?t.readableErrored?t.readableErrored:null!==(r=null===(i=t._readableState)||void 0===i?void 0:i.errored)&&void 0!==r?r:null:null},isNodeStream:b,isWebStream:function(t){return m(t)||y(t)||$(t)},isWritable:E,isWritableNodeStream:g,isWritableStream:y,isWritableEnded:v,isWritableFinished:function(t,r){if(!g(t))return null;if(!0===t.writableFinished)return!0;let i=t._writableState;return(null==i||!i.errored)&&("boolean"!=typeof(null==i?void 0:i.finished)?null:!!(i.finished||!1===r&&!0===i.ended&&0===i.length))},isWritableErrored:function(t){var r,i;return b(t)?t.writableErrored?t.writableErrored:null!==(r=null===(i=t._writableState)||void 0===i?void 0:i.errored)&&void 0!==r?r:null:null},isServerRequest:function(t){var r;return"boolean"==typeof t._consuming&&"boolean"==typeof t._dumped&&void 0===(null===(r=t.req)||void 0===r?void 0:r.upgradeOrConnect)},isServerResponse:A,willEmitClose:function(t){if(!b(t))return null;let r=t._writableState,i=t._readableState,n=r||i;return!n&&A(t)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:$}},4851(t,r,i){let n=i(6308),{ArrayPrototypeSlice:o,Error:s,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:l,ObjectDefineProperties:u,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:d,Symbol:h,SymbolHasInstance:f}=i(1807);t.exports=N,N.WritableState=M;let{EventEmitter:p}=i(4434),g=i(4952).Stream,{Buffer:b}=i(181),m=i(5417),{addAbortSignal:y}=i(996),{getHighWaterMark:$,getDefaultHighWaterMark:w}=i(2066),{ERR_INVALID_ARG_TYPE:v,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:k,ERR_STREAM_ALREADY_FINISHED:A,ERR_STREAM_NULL_VALUES:R,ERR_STREAM_WRITE_AFTER_END:T,ERR_UNKNOWN_ENCODING:I}=i(5596).codes,{errorOrDestroy:C}=m;function P(){}c(N.prototype,g.prototype),c(N,g);let x=h("kOnFinished");function M(t,r,n){"boolean"!=typeof n&&(n=r instanceof i(5737)),this.objectMode=!(!t||!t.objectMode),n&&(this.objectMode=this.objectMode||!(!t||!t.writableObjectMode)),this.highWaterMark=t?$(this,t,"writableHighWaterMark",n):w(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let o=!(!t||!1!==t.decodeStrings);this.decodeStrings=!o,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=U.bind(void 0,r),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,O(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||!1!==t.emitClose,this.autoDestroy=!t||!1!==t.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[x]=[]}function O(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}function N(t){let r=this instanceof i(5737);if(!r&&!a(N,this))return new N(t);this._writableState=new M(t,this,r),t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final),"function"==typeof t.construct&&(this._construct=t.construct),t.signal&&y(t.signal,this)),g.call(this,t),m.construct(this,()=>{let t=this._writableState;t.writing||V(this,t),q(this,t)})}function L(t,r,i,o){let s=t._writableState;if("function"==typeof i)o=i,i=s.defaultEncoding;else{if(i){if("buffer"!==i&&!b.isEncoding(i))throw new I(i)}else i=s.defaultEncoding;"function"!=typeof o&&(o=P)}if(null===r)throw new R;if(!s.objectMode){if("string"==typeof r)!1!==s.decodeStrings&&(r=b.from(r,i),i="buffer");else if(r instanceof b)i="buffer";else{if(!g._isUint8Array(r))throw new v("chunk",["string","Buffer","Uint8Array"],r);r=g._uint8ArrayToBuffer(r),i="buffer"}}let a;return s.ending?a=new T:s.destroyed&&(a=new k("write")),a?(n.nextTick(o,a),C(t,a,!0),a):(s.pendingcb++,function(t,r,i,n,o){let s=r.objectMode?1:i.length;r.length+=s;let a=r.length<r.highWaterMark;return a||(r.needDrain=!0),r.writing||r.corked||r.errored||!r.constructed?(r.buffered.push({chunk:i,encoding:n,callback:o}),r.allBuffers&&"buffer"!==n&&(r.allBuffers=!1),r.allNoop&&o!==P&&(r.allNoop=!1)):(r.writelen=s,r.writecb=o,r.writing=!0,r.sync=!0,t._write(i,n,r.onwrite),r.sync=!1),a&&!r.errored&&!r.destroyed}(t,s,r,i,o))}function D(t,r,i,n,o,s,a){r.writelen=n,r.writecb=a,r.writing=!0,r.sync=!0,r.destroyed?r.onwrite(new k("write")):i?t._writev(o,r.onwrite):t._write(o,s,r.onwrite),r.sync=!1}function W(t,r,i,n){--r.pendingcb,n(i),j(r),C(t,i)}function U(t,r){let i=t._writableState,o=i.sync,s=i.writecb;"function"==typeof s?(i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,r?(r.stack,i.errored||(i.errored=r),t._readableState&&!t._readableState.errored&&(t._readableState.errored=r),o?n.nextTick(W,t,i,r,s):W(t,i,r,s)):(i.buffered.length>i.bufferedIndex&&V(t,i),o?null!==i.afterWriteTickInfo&&i.afterWriteTickInfo.cb===s?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:s,stream:t,state:i},n.nextTick(B,i.afterWriteTickInfo)):F(t,i,1,s))):C(t,new S)}function B({stream:t,state:r,count:i,cb:n}){return r.afterWriteTickInfo=null,F(t,r,i,n)}function F(t,r,i,n){for(r.ending||t.destroyed||0!==r.length||!r.needDrain||(r.needDrain=!1,t.emit("drain"));i-- >0;)r.pendingcb--,n();r.destroyed&&j(r),q(t,r)}function j(t){var r,i;if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){let{chunk:o,callback:s}=t.buffered[n],a=t.objectMode?1:o.length;t.length-=a,s(null!==(r=t.errored)&&void 0!==r?r:new k("write"))}let l=t[x].splice(0);for(let u=0;u<l.length;u++)l[u](null!==(i=t.errored)&&void 0!==i?i:new k("end"));O(t)}function V(t,r){if(r.corked||r.bufferProcessing||r.destroyed||!r.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:s}=r,a=i.length-n;if(!a)return;let l=n;if(r.bufferProcessing=!0,a>1&&t._writev){r.pendingcb-=a-1;let u=r.allNoop?P:t=>{for(let r=l;r<i.length;++r)i[r].callback(t)},c=r.allNoop&&0===l?i:o(i,l);c.allBuffers=r.allBuffers,D(t,r,!0,r.length,c,"",u),O(r)}else{do{let{chunk:d,encoding:h,callback:f}=i[l];i[l++]=null,D(t,r,!1,s?1:d.length,d,h,f)}while(l<i.length&&!r.writing);l===i.length?O(r):l>256?(i.splice(0,l),r.bufferedIndex=0):r.bufferedIndex=l}r.bufferProcessing=!1}function G(t){return t.ending&&!t.destroyed&&t.constructed&&0===t.length&&!t.errored&&0===t.buffered.length&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function q(t,r,i){var o,s;G(r)&&(o=t,(s=r).prefinished||s.finalCalled||("function"!=typeof o._final||s.destroyed?(s.prefinished=!0,o.emit("prefinish")):(s.finalCalled=!0,function(t,r){let i=!1;function o(o){if(i)C(t,null!=o?o:S());else if(i=!0,r.pendingcb--,o){let s=r[x].splice(0);for(let a=0;a<s.length;a++)s[a](o);C(t,o,r.sync)}else G(r)&&(r.prefinished=!0,t.emit("prefinish"),r.pendingcb++,n.nextTick(K,t,r))}r.sync=!0,r.pendingcb++;try{t._final(o)}catch(s){o(s)}r.sync=!1}(o,s))),0===r.pendingcb&&(i?(r.pendingcb++,n.nextTick((t,r)=>{G(r)?K(t,r):r.pendingcb--},t,r)):G(r)&&(r.pendingcb++,K(t,r))))}function K(t,r){r.pendingcb--,r.finished=!0;let i=r[x].splice(0);for(let n=0;n<i.length;n++)i[n]();if(t.emit("finish"),r.autoDestroy){let o=t._readableState;(!o||o.autoDestroy&&(o.endEmitted||!1===o.readable))&&t.destroy()}}M.prototype.getBuffer=function(){return o(this.buffered,this.bufferedIndex)},l(M.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),l(N,f,{__proto__:null,value:function(t){return!!a(this,t)||this===N&&t&&t._writableState instanceof M}}),N.prototype.pipe=function(){C(this,new E)},N.prototype.write=function(t,r,i){return!0===L(this,t,r,i)},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||V(this,t))},N.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=d(t)),!b.isEncoding(t))throw new I(t);return this._writableState.defaultEncoding=t,this},N.prototype._write=function(t,r,i){if(!this._writev)throw new _("_write()");this._writev([{chunk:t,encoding:r}],i)},N.prototype._writev=null,N.prototype.end=function(t,r,i){let o=this._writableState,a;if("function"==typeof t?(i=t,t=null,r=null):"function"==typeof r&&(i=r,r=null),null!=t){let l=L(this,t,r);l instanceof s&&(a=l)}return o.corked&&(o.corked=1,this.uncork()),a||(o.errored||o.ending?o.finished?a=new A("end"):o.destroyed&&(a=new k("end")):(o.ending=!0,q(this,o,!0),o.ended=!0)),"function"==typeof i&&(a||o.finished?n.nextTick(i,a):o[x].push(i)),this},u(N.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!(!t||!1===t.writable||t.destroyed||t.errored||t.ending||t.ended)},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return!!t&&!t.destroyed&&!t.ending&&t.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});let H=m.destroy,z;function Q(){return void 0===z&&(z={}),z}N.prototype.destroy=function(t,r){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[x].length)&&n.nextTick(j,i),H.call(this,t,r),this},N.prototype._undestroy=m.undestroy,N.prototype._destroy=function(t,r){r(t)},N.prototype[p.captureRejectionSymbol]=function(t){this.destroy(t)},N.fromWeb=function(t,r){return Q().newStreamWritableFromWritableStream(t,r)},N.toWeb=function(t){return Q().newWritableStreamFromStreamWritable(t)}},570(t,r,i){"use strict";let{ArrayIsArray:n,ArrayPrototypeIncludes:o,ArrayPrototypeJoin:s,ArrayPrototypeMap:a,NumberIsInteger:l,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:d,NumberParseInt:h,ObjectPrototypeHasOwnProperty:f,RegExpPrototypeExec:p,String:g,StringPrototypeToUpperCase:b,StringPrototypeTrim:m}=i(1807),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:$,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:v,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:S}}=i(5596),{normalizeEncoding:E}=i(8619),{isAsyncFunction:k,isArrayBufferView:A}=i(8619).types,R={},T=/^[0-7]+$/,I=y((t,r,i=d,n=c)=>{if("number"!=typeof t)throw new w(r,"number",t);if(!l(t))throw new _(r,"an integer",t);if(t<i||t>n)throw new _(r,`>= ${i} && <= ${n}`,t)}),C=y((t,r,i=-2147483648,n=2147483647)=>{if("number"!=typeof t)throw new w(r,"number",t);if(!l(t))throw new _(r,"an integer",t);if(t<i||t>n)throw new _(r,`>= ${i} && <= ${n}`,t)}),P=y((t,r,i=!1)=>{if("number"!=typeof t)throw new w(r,"number",t);if(!l(t))throw new _(r,"an integer",t);let n=i?1:0;if(t<n||t>4294967295)throw new _(r,`>= ${n} && <= 4294967295`,t)});function x(t,r){if("string"!=typeof t)throw new w(r,"string",t)}let M=y((t,r,i)=>{if(!o(i,t)){let n=s(a(i,t=>"string"==typeof t?`'${t}'`:g(t)),", ");throw new v(r,t,"must be one of: "+n)}});function O(t,r){if("boolean"!=typeof t)throw new w(r,"boolean",t)}function N(t,r,i){return null!=t&&f(t,r)?t[r]:i}let L=y((t,r,i=null)=>{let o=N(i,"allowArray",!1),s=N(i,"allowFunction",!1);if(!N(i,"nullable",!1)&&null===t||!o&&n(t)||"object"!=typeof t&&(!s||"function"!=typeof t))throw new w(r,"Object",t)}),D=y((t,r)=>{if(null!=t&&"object"!=typeof t&&"function"!=typeof t)throw new w(r,"a dictionary",t)}),W=y((t,r,i=0)=>{if(!n(t))throw new w(r,"Array",t);if(t.length<i)throw new v(r,t,`must be longer than ${i}`)}),U=y((t,r="buffer")=>{if(!A(t))throw new w(r,["Buffer","TypedArray","DataView"],t)}),B=y((t,r)=>{if(void 0!==t&&(null===t||"object"!=typeof t||!("aborted"in t)))throw new w(r,"AbortSignal",t)}),F=y((t,r)=>{if("function"!=typeof t)throw new w(r,"Function",t)}),j=y((t,r)=>{if("function"!=typeof t||k(t))throw new w(r,"Function",t)}),V=y((t,r)=>{if(void 0!==t)throw new w(r,"undefined",t)}),G=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function q(t,r){if(void 0===t||!p(G,t))throw new v(r,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:function(t){return t===(0|t)},isUint32:function(t){return t===t>>>0},parseFileMode:function(t,r,i){if(void 0===t&&(t=i),"string"==typeof t){if(null===p(T,t))throw new v(r,t,"must be a 32-bit unsigned integer or an octal string");t=h(t,8)}return P(t,r),t},validateArray:W,validateStringArray:function(t,r){W(t,r);for(let i=0;i<t.length;i++)x(t[i],`${r}[${i}]`)},validateBooleanArray:function(t,r){W(t,r);for(let i=0;i<t.length;i++)O(t[i],`${r}[${i}]`)},validateAbortSignalArray:function(t,r){W(t,r);for(let i=0;i<t.length;i++){let n=t[i],o=`${r}[${i}]`;if(null==n)throw new w(o,"AbortSignal",n);B(n,o)}},validateBoolean:O,validateBuffer:U,validateDictionary:D,validateEncoding:function(t,r){let i=E(r),n=t.length;if("hex"===i&&n%2!=0)throw new v("encoding",r,`is invalid for data of length ${n}`)},validateFunction:F,validateInt32:C,validateInteger:I,validateNumber:function(t,r,i,n){if("number"!=typeof t)throw new w(r,"number",t);if(null!=i&&t<i||null!=n&&t>n||(null!=i||null!=n)&&u(t))throw new _(r,`${null!=i?`>= ${i}`:""}${null!=i&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,t)},validateObject:L,validateOneOf:M,validatePlainFunction:j,validatePort:function(t,r="Port",i=!0){if("number"!=typeof t&&"string"!=typeof t||"string"==typeof t&&0===m(t).length||+t!=+t>>>0||t>65535||0===t&&!i)throw new $(r,t,i);return 0|t},validateSignalName:function(t,r="signal"){if(x(t,r),void 0===R[t]){if(void 0!==R[b(t)])throw new S(t+" (signals must use all capital letters)");throw new S(t)}},validateString:x,validateUint32:P,validateUndefined:V,validateUnion:function(t,r,i){if(!o(i,t))throw new w(r,`('${s(i,"|")}')`,t)},validateAbortSignal:B,validateLinkHeaderValue:function(t){if("string"==typeof t)return q(t,"hints"),t;if(n(t)){let r=t.length,i="";if(0===r)return i;for(let o=0;o<r;o++){let s=t[o];q(s,"hints"),i+=s,o!==r-1&&(i+=", ")}return i}throw new v("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},5596(t,r,i){"use strict";let{format:n,inspect:o,AggregateError:s}=i(8619),a=globalThis.AggregateError||s,l=Symbol("kIsNodeError"),u=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,d={};function h(t,r){if(!t)throw new d.ERR_INTERNAL_ASSERTION(r)}function f(t){let r="",i=t.length,n="-"===t[0]?1:0;for(;i>=n+4;i-=3)r=`_${t.slice(i-3,i)}${r}`;return`${t.slice(0,i)}${r}`}function p(t,r,i){i||(i=Error);class o extends i{constructor(...i){super(function(t,r,i){if("function"==typeof r)return h(r.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r.length}).`),r(...i);let o=(r.match(/%[dfijoOs]/g)||[]).length;return h(o===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${o}).`),0===i.length?r:n(r,...i)}(t,r,i))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=t,o.prototype[l]=!0,d[t]=o}function g(t){let r="__node_internal_"+t.name;return Object.defineProperty(t,"name",{value:r}),t}p("ERR_ASSERTION","%s",Error),p("ERR_INVALID_ARG_TYPE",(t,r,i)=>{h("string"==typeof t,"'name' must be a string"),Array.isArray(r)||(r=[r]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let s=[],a=[],l=[];for(let d of r)h("string"==typeof d,"All expected entries have to be of type string"),u.includes(d)?s.push(d.toLowerCase()):c.test(d)?a.push(d):(h("object"!==d,'The value "object" should be written as "Object"'),l.push(d));if(a.length>0){let f=s.indexOf("object");-1!==f&&(s.splice(s,f,1),a.push("Object"))}if(s.length>0){switch(s.length){case 1:n+=`of type ${s[0]}`;break;case 2:n+=`one of type ${s[0]} or ${s[1]}`;break;default:{let p=s.pop();n+=`one of type ${s.join(", ")}, or ${p}`}}(a.length>0||l.length>0)&&(n+=" or ")}if(a.length>0){switch(a.length){case 1:n+=`an instance of ${a[0]}`;break;case 2:n+=`an instance of ${a[0]} or ${a[1]}`;break;default:{let g=a.pop();n+=`an instance of ${a.join(", ")}, or ${g}`}}l.length>0&&(n+=" or ")}switch(l.length){case 0:break;case 1:l[0].toLowerCase()!==l[0]&&(n+="an "),n+=`${l[0]}`;break;case 2:n+=`one of ${l[0]} or ${l[1]}`;break;default:{let b=l.pop();n+=`one of ${l.join(", ")}, or ${b}`}}if(null==i)n+=`. Received ${i}`;else if("function"==typeof i&&i.name)n+=`. Received function ${i.name}`;else if("object"==typeof i){var m;null!==(m=i.constructor)&&void 0!==m&&m.name?n+=`. Received an instance of ${i.constructor.name}`:n+=`. Received ${o(i,{depth:-1})}`}else{let y=o(i,{colors:!1});y.length>25&&(y=`${y.slice(0,25)}...`),n+=`. Received type ${typeof i} (${y})`}return n},TypeError),p("ERR_INVALID_ARG_VALUE",(t,r,i="is invalid")=>{let n=o(r);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${n}`},TypeError),p("ERR_INVALID_RETURN_VALUE",(t,r,i)=>{var n;return`Expected ${t} to be returned from the "${r}" function but got ${null!=i&&null!==(n=i.constructor)&&void 0!==n&&n.name?`instance of ${i.constructor.name}`:"type "+typeof i}.`},TypeError),p("ERR_MISSING_ARGS",(...t)=>{let r;h(t.length>0,"At least one arg needs to be specified");let i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(t=>`"${t}"`).join(" or "),i){case 1:r+=`The ${t[0]} argument`;break;case 2:r+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();r+=`The ${t.join(", ")}, and ${n} arguments`}}return`${r} must be specified`},TypeError),p("ERR_OUT_OF_RANGE",(t,r,i)=>{let n;return h(r,'Missing "range" argument'),Number.isInteger(i)&&Math.abs(i)>4294967296?n=f(String(i)):"bigint"==typeof i?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=f(n)),n+="n"):n=o(i),`The value of "${t}" is out of range. It must be ${r}. Received ${n}`},RangeError),p("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),p("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),p("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),p("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),p("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),p("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),p("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),p("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),p("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),p("ERR_STREAM_WRITE_AFTER_END","write after end",Error),p("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:class t extends Error{constructor(t="The operation was aborted",r){if(void 0!==r&&"object"!=typeof r)throw new d.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}},aggregateTwoErrors:g(function(t,r){if(t&&r&&t!==r){if(Array.isArray(r.errors))return r.errors.push(t),r;let i=new a([r,t],r.message);return i.code=r.code,i}return t||r}),hideStackFrames:g,codes:d}},5955(t,r,i){"use strict";let n=i(2203);if(n&&"disable"===process.env.READABLE_STREAM){let o=n.promises;t.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,t.exports._isUint8Array=n._isUint8Array,t.exports.isDisturbed=n.isDisturbed,t.exports.isErrored=n.isErrored,t.exports.isReadable=n.isReadable,t.exports.Readable=n.Readable,t.exports.Writable=n.Writable,t.exports.Duplex=n.Duplex,t.exports.Transform=n.Transform,t.exports.PassThrough=n.PassThrough,t.exports.addAbortSignal=n.addAbortSignal,t.exports.finished=n.finished,t.exports.destroy=n.destroy,t.exports.pipeline=n.pipeline,t.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>o}),t.exports.Stream=n.Stream}else{let s=i(3423),a=i(6312),l=s.Readable.destroy;t.exports=s.Readable,t.exports._uint8ArrayToBuffer=s._uint8ArrayToBuffer,t.exports._isUint8Array=s._isUint8Array,t.exports.isDisturbed=s.isDisturbed,t.exports.isErrored=s.isErrored,t.exports.isReadable=s.isReadable,t.exports.Readable=s.Readable,t.exports.Writable=s.Writable,t.exports.Duplex=s.Duplex,t.exports.Transform=s.Transform,t.exports.PassThrough=s.PassThrough,t.exports.addAbortSignal=s.addAbortSignal,t.exports.finished=s.finished,t.exports.destroy=s.destroy,t.exports.destroy=l,t.exports.pipeline=s.pipeline,t.exports.compose=s.compose,Object.defineProperty(s,"promises",{configurable:!0,enumerable:!0,get:()=>a}),t.exports.Stream=s.Stream}t.exports.default=t.exports},1807(t){"use strict";t.exports={ArrayIsArray:t=>Array.isArray(t),ArrayPrototypeIncludes:(t,r)=>t.includes(r),ArrayPrototypeIndexOf:(t,r)=>t.indexOf(r),ArrayPrototypeJoin:(t,r)=>t.join(r),ArrayPrototypeMap:(t,r)=>t.map(r),ArrayPrototypePop:(t,r)=>t.pop(r),ArrayPrototypePush:(t,r)=>t.push(r),ArrayPrototypeSlice:(t,r,i)=>t.slice(r,i),Error,FunctionPrototypeCall:(t,r,...i)=>t.call(r,...i),FunctionPrototypeSymbolHasInstance:(t,r)=>Function.prototype[Symbol.hasInstance].call(t,r),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(t,r)=>Object.defineProperties(t,r),ObjectDefineProperty:(t,r,i)=>Object.defineProperty(t,r,i),ObjectGetOwnPropertyDescriptor:(t,r)=>Object.getOwnPropertyDescriptor(t,r),ObjectKeys:t=>Object.keys(t),ObjectSetPrototypeOf:(t,r)=>Object.setPrototypeOf(t,r),Promise,PromisePrototypeCatch:(t,r)=>t.catch(r),PromisePrototypeThen:(t,r,i)=>t.then(r,i),PromiseReject:t=>Promise.reject(t),PromiseResolve:t=>Promise.resolve(t),ReflectApply:Reflect.apply,RegExpPrototypeTest:(t,r)=>t.test(r),SafeSet:Set,String,StringPrototypeSlice:(t,r,i)=>t.slice(r,i),StringPrototypeToLowerCase:t=>t.toLowerCase(),StringPrototypeToUpperCase:t=>t.toUpperCase(),StringPrototypeTrim:t=>t.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(t,r,i)=>t.set(r,i),Boolean,Uint8Array}},8619(t,r,i){"use strict";let n=i(181),{kResistStopPropagation:o,SymbolDispose:s}=i(1807),a=globalThis.AbortSignal||i(1506).h8,l=globalThis.AbortController||i(1506).z1,u=Object.getPrototypeOf(async function(){}).constructor,c=globalThis.Blob||n.Blob,d=(t,r)=>{if(void 0!==t&&(null===t||"object"!=typeof t||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(r,"AbortSignal",t)};t.exports={AggregateError:class t extends Error{constructor(t){if(!Array.isArray(t))throw TypeError("Expected input to be an Array, got "+typeof t);let r="";for(let i=0;i<t.length;i++)r+=` ${t[i].stack}
|
|
2
|
+
`;super(r),this.name="AggregateError",this.errors=t}},kEmptyObject:Object.freeze({}),once(t){let r=!1;return function(...i){r||(r=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,r;return{promise:new Promise((i,n)=>{t=i,r=n}),resolve:t,reject:r}},promisify:t=>new Promise((r,i)=>{t((t,...n)=>t?i(t):r(...n))}),debuglog:()=>function(){},format:(t,...r)=>t.replace(/%([sdifj])/g,function(...[t,i]){let n=r.shift();return"f"===i?n.toFixed(6):"j"===i?JSON.stringify(n):"s"===i&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()}),inspect(t){switch(typeof t){case"string":if(t.includes("'")){if(!t.includes('"'))return`"${t}"`;if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction:t=>t instanceof u,isArrayBufferView:t=>ArrayBuffer.isView(t)},isBlob:void 0!==c?function(t){return t instanceof c}:function(t){return!1},deprecate:(t,r)=>t,addAbortListener:i(4434).addAbortListener||function(t,r){if(void 0===t)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);let i;return d(t,"signal"),((t,r)=>{if("function"!=typeof t)throw new ERR_INVALID_ARG_TYPE("listener","Function",t)})(r),t.aborted?queueMicrotask(()=>r()):(t.addEventListener("abort",r,{__proto__:null,once:!0,[o]:!0}),i=()=>{t.removeEventListener("abort",r)}),{__proto__:null,[s](){var t;null===(t=i)||void 0===t||t()}}},AbortSignalAny:a.any||function(t){if(1===t.length)return t[0];let r=new l,i=()=>r.abort();return t.forEach(t=>{d(t,"signals"),t.addEventListener("abort",i,{once:!0})}),r.signal.addEventListener("abort",()=>{t.forEach(t=>t.removeEventListener("abort",i))},{once:!0}),r.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},3423(t,r,i){let{Buffer:n}=i(181),{ObjectDefineProperty:o,ObjectKeys:s,ReflectApply:a}=i(1807),{promisify:{custom:l}}=i(8619),{streamReturningOperators:u,promiseReturningOperators:c}=i(7614),{codes:{ERR_ILLEGAL_CONSTRUCTOR:d}}=i(5596),h=i(4511),{setDefaultHighWaterMark:f,getDefaultHighWaterMark:p}=i(2066),{pipeline:g}=i(6213),{destroyer:b}=i(5417),m=i(6567),y=i(6312),$=i(3338),w=t.exports=i(4952).Stream;for(let v of(w.isDestroyed=$.isDestroyed,w.isDisturbed=$.isDisturbed,w.isErrored=$.isErrored,w.isReadable=$.isReadable,w.isWritable=$.isWritable,w.Readable=i(943),s(u))){let _=u[v];function S(...t){if(new.target)throw d();return w.Readable.from(a(_,this,t))}o(S,"name",{__proto__:null,value:_.name}),o(S,"length",{__proto__:null,value:_.length}),o(w.Readable.prototype,v,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}for(let E of s(c)){let k=c[E];function S(...t){if(new.target)throw d();return a(k,this,t)}o(S,"name",{__proto__:null,value:k.name}),o(S,"length",{__proto__:null,value:k.length}),o(w.Readable.prototype,E,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}w.Writable=i(4851),w.Duplex=i(5737),w.Transform=i(3823),w.PassThrough=i(6141),w.pipeline=g;let{addAbortSignal:A}=i(996);w.addAbortSignal=A,w.finished=m,w.destroy=b,w.compose=h,w.setDefaultHighWaterMark=f,w.getDefaultHighWaterMark=p,o(w,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),o(g,l,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),o(m,l,{__proto__:null,enumerable:!0,get:()=>y.finished}),w.Stream=w,w._isUint8Array=function(t){return t instanceof Uint8Array},w._uint8ArrayToBuffer=function(t){return n.from(t.buffer,t.byteOffset,t.byteLength)}},6312(t,r,i){"use strict";let{ArrayPrototypePop:n,Promise:o}=i(1807),{isIterable:s,isNodeStream:a,isWebStream:l}=i(3338),{pipelineImpl:u}=i(6213),{finished:c}=i(6567);i(3423),t.exports={finished:c,pipeline:function(...t){return new o((r,i)=>{let o,c,d=t[t.length-1];if(d&&"object"==typeof d&&!a(d)&&!s(d)&&!l(d)){let h=n(t);o=h.signal,c=h.end}u(t,(t,n)=>{t?i(t):r(n)},{signal:o,end:c})})}}},4650(t,r,i){let{Buffer:n}=i(181),o={},s=n.isBuffer(n.from([1,2]).subarray(0,1));function a(t){let r=n.allocUnsafe(2);return r.writeUInt8(t>>8,0),r.writeUInt8(255&t,1),r}t.exports={cache:o,generateCache:function(){for(let t=0;t<65536;t++)o[t]=a(t)},generateNumber:a,genBufVariableByteInt:function(t){let r=0,i=0,o=n.allocUnsafe(4);do r=t%128|0,(t=t/128|0)>0&&(r|=128),o.writeUInt8(r,i++);while(t>0&&i<4);return t>0&&(i=0),s?o.subarray(0,i):o.slice(0,i)},generate4ByteBuffer:function(t){let r=n.allocUnsafe(4);return r.writeUInt32BE(t,0),r}}},9210(t){t.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}},9829(t,r,i){let n=i(3090),{EventEmitter:o}=i(4434),s=i(9210),a=i(3541),l=i(9171)("mqtt-packet:parser");class u extends o{constructor(){super(),this.parser=this.constructor.parser}static parser(t){return this instanceof u?(this.settings=t||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new u().parser(t)}_resetState(){l("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new s,this.error=null,this._list=n(),this._stateCounter=0}parse(t){for(this.error&&this._resetState(),this._list.append(t),l("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,l("parse: state complete. _stateCounter is now: %d",this._stateCounter),l("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return l("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let t=this._list.readUInt8(0),r=t>>a.CMD_SHIFT;this.packet.cmd=a.types[r];let i=a.requiredHeaderFlags[r];return null!=i&&(15&t)!==i?this._emitError(Error(a.requiredHeaderFlagsErrors[r])):(this.packet.retain=!!(t&a.RETAIN_MASK),this.packet.qos=t>>a.QOS_SHIFT&a.QOS_MASK,this.packet.qos>2?this._emitError(Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=!!(t&a.DUP_MASK),l("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let t=this._parseVarByteNum(!0);return t&&(this.packet.length=t.value,this._list.consume(t.bytes)),l("_parseLength %d",t.value),!!t}_parsePayload(){l("_parsePayload: payload %O",this._list);let t=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(Error("Not supported"))}t=!0}return l("_parsePayload complete result: %s",t),t}_parseConnect(){let t,r,i,n;l("_parseConnect");let o={},s=this.packet,u=this._parseString();if(null===u)return this._emitError(Error("Cannot parse protocolId"));if("MQTT"!==u&&"MQIsdp"!==u)return this._emitError(Error("Invalid protocolId"));if(s.protocolId=u,this._pos>=this._list.length)return this._emitError(Error("Packet too short"));if(s.protocolVersion=this._list.readUInt8(this._pos),s.protocolVersion>=128&&(s.bridgeMode=!0,s.protocolVersion=s.protocolVersion-128),3!==s.protocolVersion&&4!==s.protocolVersion&&5!==s.protocolVersion)return this._emitError(Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(Error("Packet too short"));if(1&this._list.readUInt8(this._pos))return this._emitError(Error("Connect flag bit 0 must be 0, but got 1"));o.username=this._list.readUInt8(this._pos)&a.USERNAME_MASK,o.password=this._list.readUInt8(this._pos)&a.PASSWORD_MASK,o.will=this._list.readUInt8(this._pos)&a.WILL_FLAG_MASK;let c=!!(this._list.readUInt8(this._pos)&a.WILL_RETAIN_MASK),d=(this._list.readUInt8(this._pos)&a.WILL_QOS_MASK)>>a.WILL_QOS_SHIFT;if(o.will)s.will={},s.will.retain=c,s.will.qos=d;else{if(c)return this._emitError(Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(d)return this._emitError(Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(s.clean=!!(this._list.readUInt8(this._pos)&a.CLEAN_SESSION_MASK),this._pos++,s.keepalive=this._parseNum(),-1===s.keepalive)return this._emitError(Error("Packet too short"));if(5===s.protocolVersion){let h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(s.properties=h)}let f=this._parseString();if(null===f)return this._emitError(Error("Packet too short"));if(s.clientId=f,l("_parseConnect: packet.clientId: %s",s.clientId),o.will){if(5===s.protocolVersion){let p=this._parseProperties();Object.getOwnPropertyNames(p).length&&(s.will.properties=p)}if(null===(t=this._parseString()))return this._emitError(Error("Cannot parse will topic"));if(s.will.topic=t,l("_parseConnect: packet.will.topic: %s",s.will.topic),null===(r=this._parseBuffer()))return this._emitError(Error("Cannot parse will payload"));s.will.payload=r,l("_parseConnect: packet.will.paylaod: %s",s.will.payload)}if(o.username){if(null===(n=this._parseString()))return this._emitError(Error("Cannot parse username"));s.username=n,l("_parseConnect: packet.username: %s",s.username)}if(o.password){if(null===(i=this._parseBuffer()))return this._emitError(Error("Cannot parse password"));s.password=i}return this.settings=s,l("_parseConnect: complete"),s}_parseConnack(){l("_parseConnack");let t=this.packet;if(this._list.length<1)return null;let r=this._list.readUInt8(this._pos++);if(r>1)return this._emitError(Error("Invalid connack flags, bits 7-1 must be set to 0"));if(t.sessionPresent=!!(r&a.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?t.reasonCode=this._list.readUInt8(this._pos++):t.reasonCode=0;else{if(this._list.length<2)return null;t.returnCode=this._list.readUInt8(this._pos++)}if(-1===t.returnCode||-1===t.reasonCode)return this._emitError(Error("Cannot parse return code"));if(5===this.settings.protocolVersion){let i=this._parseProperties();Object.getOwnPropertyNames(i).length&&(t.properties=i)}l("_parseConnack: complete")}_parsePublish(){l("_parsePublish");let t=this.packet;if(t.topic=this._parseString(),null===t.topic)return this._emitError(Error("Cannot parse topic"));if(!(t.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(t.properties=r)}t.payload=this._list.slice(this._pos,t.length),l("_parsePublish: payload from buffer list: %o",t.payload)}}_parseSubscribe(){l("_parseSubscribe");let t=this.packet,r,i,n,o,s,u,c;if(t.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let d=this._parseProperties();Object.getOwnPropertyNames(d).length&&(t.properties=d)}if(t.length<=0)return this._emitError(Error("Malformed subscribe, no payload specified"));for(;this._pos<t.length;){if(null===(r=this._parseString()))return this._emitError(Error("Cannot parse topic"));if(this._pos>=t.length)return this._emitError(Error("Malformed Subscribe Payload"));if(i=this._parseByte(),5===this.settings.protocolVersion){if(192&i)return this._emitError(Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&i)return this._emitError(Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if((n=i&a.SUBSCRIBE_OPTIONS_QOS_MASK)>2)return this._emitError(Error("Invalid subscribe QoS, must be <= 2"));if(u=!!(i>>a.SUBSCRIBE_OPTIONS_NL_SHIFT&a.SUBSCRIBE_OPTIONS_NL_MASK),s=!!(i>>a.SUBSCRIBE_OPTIONS_RAP_SHIFT&a.SUBSCRIBE_OPTIONS_RAP_MASK),(o=i>>a.SUBSCRIBE_OPTIONS_RH_SHIFT&a.SUBSCRIBE_OPTIONS_RH_MASK)>2)return this._emitError(Error("Invalid retain handling, must be <= 2"));c={topic:r,qos:n},5===this.settings.protocolVersion?(c.nl=u,c.rap=s,c.rh=o):this.settings.bridgeMode&&(c.rh=0,c.rap=!0,c.nl=!0),l("_parseSubscribe: push subscription `%s` to subscription",c),t.subscriptions.push(c)}}}_parseSuback(){l("_parseSuback");let t=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(t.properties=r)}if(t.length<=0)return this._emitError(Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let i=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!a.MQTT5_SUBACK_CODES[i])return this._emitError(Error("Invalid suback code"))}else if(i>2&&128!==i)return this._emitError(Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(i)}}}_parseUnsubscribe(){l("_parseUnsubscribe");let t=this.packet;if(t.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(t.properties=r)}if(t.length<=0)return this._emitError(Error("Malformed unsubscribe, no payload specified"));for(;this._pos<t.length;){let i=this._parseString();if(null===i)return this._emitError(Error("Cannot parse topic"));l("_parseUnsubscribe: push topic `%s` to unsubscriptions",i),t.unsubscriptions.push(i)}}}_parseUnsuback(){l("_parseUnsuback");let t=this.packet;if(!this._parseMessageId())return this._emitError(Error("Cannot parse messageId"));if((3===this.settings.protocolVersion||4===this.settings.protocolVersion)&&2!==t.length)return this._emitError(Error("Malformed unsuback, payload length must be 2"));if(t.length<=0)return this._emitError(Error("Malformed unsuback, no payload specified"));if(5===this.settings.protocolVersion){let r=this._parseProperties();for(Object.getOwnPropertyNames(r).length&&(t.properties=r),t.granted=[];this._pos<this.packet.length;){let i=this._list.readUInt8(this._pos++);if(!a.MQTT5_UNSUBACK_CODES[i])return this._emitError(Error("Invalid unsuback code"));this.packet.granted.push(i)}}}_parseConfirmation(){l("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let t=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion){if(t.length>2){switch(t.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!a.MQTT5_PUBACK_PUBREC_CODES[t.reasonCode])return this._emitError(Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!a.MQTT5_PUBREL_PUBCOMP_CODES[t.reasonCode])return this._emitError(Error("Invalid "+this.packet.cmd+" reason code"))}l("_parseConfirmation: packet.reasonCode `%d`",t.reasonCode)}else t.reasonCode=0;if(t.length>3){let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(t.properties=r)}}return!0}_parseDisconnect(){let t=this.packet;if(l("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(t.reasonCode=this._parseByte(),a.MQTT5_DISCONNECT_CODES[t.reasonCode]||this._emitError(Error("Invalid disconnect reason code"))):t.reasonCode=0;let r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(t.properties=r)}return l("_parseDisconnect result: true"),!0}_parseAuth(){l("_parseAuth");let t=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(Error("Not supported auth packet for this version MQTT"));if(t.reasonCode=this._parseByte(),!a.MQTT5_AUTH_CODES[t.reasonCode])return this._emitError(Error("Invalid auth reason code"));let r=this._parseProperties();return Object.getOwnPropertyNames(r).length&&(t.properties=r),l("_parseAuth: result: true"),!0}_parseMessageId(){let t=this.packet;return t.messageId=this._parseNum(),null===t.messageId?(this._emitError(Error("Cannot parse messageId")),!1):(l("_parseMessageId: packet.messageId %d",t.messageId),!0)}_parseString(t){let r=this._parseNum(),i=r+this._pos;if(-1===r||i>this._list.length||i>this.packet.length)return null;let n=this._list.toString("utf8",this._pos,i);return this._pos+=r,l("_parseString: result: %s",n),n}_parseStringPair(){return l("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;let i=this._list.slice(this._pos,r);return this._pos+=t,l("_parseBuffer: result: %o",i),i}_parseNum(){if(this._list.length-this._pos<2)return -1;let t=this._list.readUInt16BE(this._pos);return this._pos+=2,l("_parseNum: result: %s",t),t}_parse4ByteNum(){if(this._list.length-this._pos<4)return -1;let t=this._list.readUInt32BE(this._pos);return this._pos+=4,l("_parse4ByteNum: result: %s",t),t}_parseVarByteNum(t){l("_parseVarByteNum");let r,i=0,n=1,o=0,s=!1,u=this._pos?this._pos:0;for(;i<4&&u+i<this._list.length;){if(o+=n*((r=this._list.readUInt8(u+i++))&a.VARBYTEINT_MASK),n*=128,!(r&a.VARBYTEINT_FIN_MASK)){s=!0;break}if(this._list.length<=i)break}return!s&&4===i&&this._list.length>=i&&this._emitError(Error("Invalid variable byte integer")),u&&(this._pos+=i),l("_parseVarByteNum: result: %o",s=!!s&&(t?{bytes:i,value:o}:o)),s}_parseByte(){let t;return this._pos<this._list.length&&(t=this._list.readUInt8(this._pos),this._pos++),l("_parseByte: result: %o",t),t}_parseByType(t){switch(l("_parseByType: type: %s",t),t){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){l("_parseProperties");let t=this._parseVarByteNum(),r=this._pos+t,i={};for(;this._pos<r;){let n=this._parseByte();if(!n)return this._emitError(Error("Cannot parse property code type")),!1;let o=a.propertiesCodes[n];if(!o)return this._emitError(Error("Unknown property")),!1;if("userProperties"!==o)i[o]?(Array.isArray(i[o])||(i[o]=[i[o]]),i[o].push(this._parseByType(a.propertiesTypes[o]))):i[o]=this._parseByType(a.propertiesTypes[o]);else{i[o]||(i[o]=Object.create(null));let s=this._parseByType(a.propertiesTypes[o]);if(i[o][s.name]){if(Array.isArray(i[o][s.name]))i[o][s.name].push(s.value);else{let u=i[o][s.name];i[o][s.name]=[u],i[o][s.name].push(s.value)}}else i[o][s.name]=s.value}}return i}_newPacket(){return l("_newPacket"),this.packet&&(this._list.consume(this.packet.length),l("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),l("_newPacket: new packet"),this.packet=new s,this._pos=0,!0}_emitError(t){l("_emitError",t),this.error=t,this.emit("error",t)}}t.exports=u},6158(t,r,i){let n=i(3541),{Buffer:o}=i(181),s=o.allocUnsafe(0),a=o.from([0]),l=i(4650),u=i(6739).nextTick,c=i(9171)("mqtt-packet:writeToStream"),d=l.cache,h=l.generateNumber,f=l.generateCache,p=l.genBufVariableByteInt,g=l.generate4ByteBuffer,b=E,m=!0;function y(t,r,i){switch(c("generate called"),r.cork&&(r.cork(),u($,r)),m&&(m=!1,f()),c("generate: packet.cmd: %s",t.cmd),t.cmd){case"connect":return function(t,r,i){let s=t||{},a=s.protocolId||"MQTT",l=s.protocolVersion||4,u=s.will,c=s.clean,d=s.keepalive||0,h=s.clientId||"",f=s.username,p=s.password,g=s.properties;void 0===c&&(c=!0);let m,y,$=0;if(!a||"string"!=typeof a&&!o.isBuffer(a))return r.destroy(Error("Invalid protocolId")),!1;if($+=a.length+2,3!==l&&4!==l&&5!==l)return r.destroy(Error("Invalid protocol version")),!1;if($+=1,("string"==typeof h||o.isBuffer(h))&&(h||l>=4)&&(h||c))$+=o.byteLength(h)+2;else{if(l<4)return r.destroy(Error("clientId must be supplied before 3.1.1")),!1;if(1*c==0)return r.destroy(Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof d||d<0||d>65535||d%1!=0)return r.destroy(Error("Invalid keepalive")),!1;if($+=2,$+=1,5===l){if(!(m=R(r,g)))return!1;$+=m.length}if(u){if("object"!=typeof u)return r.destroy(Error("Invalid will")),!1;if(!u.topic||"string"!=typeof u.topic)return r.destroy(Error("Invalid will topic")),!1;if($+=o.byteLength(u.topic)+2,$+=2,u.payload){if(!(u.payload.length>=0))return r.destroy(Error("Invalid will payload")),!1;"string"==typeof u.payload?$+=o.byteLength(u.payload):$+=u.payload.length}if(y={},5===l){if(!(y=R(r,u.properties)))return!1;$+=y.length}}let w=!1;if(null!=f){if(!x(f))return r.destroy(Error("Invalid username")),!1;w=!0,$+=o.byteLength(f)+2}if(null!=p){if(!w)return r.destroy(Error("Username is required to use password")),!1;if(!x(p))return r.destroy(Error("Invalid password")),!1;$+=P(p)+2}r.write(n.CONNECT_HEADER),v(r,$),A(r,a),s.bridgeMode&&(l+=128),r.write(131===l?n.VERSION131:132===l?n.VERSION132:4===l?n.VERSION4:5===l?n.VERSION5:n.VERSION3);let S=0;return S|=null!=f?n.USERNAME_MASK:0,S|=null!=p?n.PASSWORD_MASK:0,S|=u&&u.retain?n.WILL_RETAIN_MASK:0,S|=u&&u.qos?u.qos<<n.WILL_QOS_SHIFT:0,S|=u?n.WILL_FLAG_MASK:0,S|=c?n.CLEAN_SESSION_MASK:0,r.write(o.from([S])),b(r,d),5===l&&m.write(),A(r,h),u&&(5===l&&y.write(),_(r,u.topic),A(r,u.payload)),null!=f&&A(r,f),null!=p&&A(r,p),!0}(t,r);case"connack":return function(t,r,i){let s=i?i.protocolVersion:4,l=t||{},u=5===s?l.reasonCode:l.returnCode,c=l.properties,d=2;if("number"!=typeof u)return r.destroy(Error("Invalid return code")),!1;let h=null;if(5===s){if(!(h=R(r,c)))return!1;d+=h.length}return r.write(n.CONNACK_HEADER),v(r,d),r.write(l.sessionPresent?n.SESSIONPRESENT_HEADER:a),r.write(o.from([u])),null!=h&&h.write(),!0}(t,r,i);case"publish":return function(t,r,i){c("publish: packet: %o",t);let a=i?i.protocolVersion:4,l=t||{},u=l.qos||0,d=l.retain?n.RETAIN_MASK:0,h=l.topic,f=l.payload||s,p=l.messageId,g=l.properties,m=0;if("string"==typeof h)m+=o.byteLength(h)+2;else{if(!o.isBuffer(h))return r.destroy(Error("Invalid topic")),!1;m+=h.length+2}if(o.isBuffer(f)?m+=f.length:m+=o.byteLength(f),u&&"number"!=typeof p)return r.destroy(Error("Invalid messageId")),!1;u&&(m+=2);let y=null;if(5===a){if(!(y=R(r,g)))return!1;m+=y.length}return r.write(n.PUBLISH_HEADER[u][l.dup?1:0][d?1:0]),v(r,m),b(r,P(h)),r.write(h),u>0&&b(r,p),null!=y&&y.write(),c("publish: payload: %o",f),r.write(f)}(t,r,i);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(t,r,i){let s=i?i.protocolVersion:4,a=t||{},l=a.cmd||"puback",u=a.messageId,c=a.dup&&"pubrel"===l?n.DUP_MASK:0,d=0,h=a.reasonCode,f=a.properties,p=5===s?3:2;if("pubrel"===l&&(d=1),"number"!=typeof u)return r.destroy(Error("Invalid messageId")),!1;let g=null;if(5===s&&"object"==typeof f){if(!(g=T(r,f,i,p)))return!1;p+=g.length}return r.write(n.ACKS[l][d][c][0]),3===p&&(p+=0!==h?1:-1),v(r,p),b(r,u),5===s&&2!==p&&r.write(o.from([h])),null!==g?g.write():4===p&&r.write(o.from([0])),!0}(t,r,i);case"subscribe":return function(t,r,i){c("subscribe: packet: ");let s=i?i.protocolVersion:4,a=t||{},l=a.dup?n.DUP_MASK:0,u=a.messageId,d=a.subscriptions,h=a.properties,f=0;if("number"!=typeof u)return r.destroy(Error("Invalid messageId")),!1;f+=2;let p=null;if(5===s){if(!(p=R(r,h)))return!1;f+=p.length}if("object"!=typeof d||!d.length)return r.destroy(Error("Invalid subscriptions")),!1;for(let g=0;g<d.length;g+=1){let m=d[g].topic,y=d[g].qos;if("string"!=typeof m)return r.destroy(Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof y)return r.destroy(Error("Invalid subscriptions - invalid qos")),!1;if(5===s){if("boolean"!=typeof(d[g].nl||!1))return r.destroy(Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(d[g].rap||!1))return r.destroy(Error("Invalid subscriptions - invalid Retain as Published")),!1;let $=d[g].rh||0;if("number"!=typeof $||$>2)return r.destroy(Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=o.byteLength(m)+2+1}c("subscribe: writing to stream: %o",n.SUBSCRIBE_HEADER),r.write(n.SUBSCRIBE_HEADER[1][l?1:0][0]),v(r,f),b(r,u),null!==p&&p.write();let w=!0;for(let S of d){let E=S.topic,k=S.qos,A=+S.nl,T=+S.rap,I=S.rh,C;_(r,E),C=n.SUBSCRIBE_OPTIONS_QOS[k],5===s&&(C|=A?n.SUBSCRIBE_OPTIONS_NL:0,C|=T?n.SUBSCRIBE_OPTIONS_RAP:0,C|=I?n.SUBSCRIBE_OPTIONS_RH[I]:0),w=r.write(o.from([C]))}return w}(t,r,i);case"suback":return function(t,r,i){let s=i?i.protocolVersion:4,a=t||{},l=a.messageId,u=a.granted,c=a.properties,d=0;if("number"!=typeof l)return r.destroy(Error("Invalid messageId")),!1;if(d+=2,"object"!=typeof u||!u.length)return r.destroy(Error("Invalid qos vector")),!1;for(let h=0;h<u.length;h+=1){if("number"!=typeof u[h])return r.destroy(Error("Invalid qos vector")),!1;d+=1}let f=null;if(5===s){if(!(f=T(r,c,i,d)))return!1;d+=f.length}return r.write(n.SUBACK_HEADER),v(r,d),b(r,l),null!==f&&f.write(),r.write(o.from(u))}(t,r,i);case"unsubscribe":return function(t,r,i){let s=i?i.protocolVersion:4,a=t||{},l=a.messageId,u=a.dup?n.DUP_MASK:0,c=a.unsubscriptions,d=a.properties,h=0;if("number"!=typeof l)return r.destroy(Error("Invalid messageId")),!1;if(h+=2,"object"!=typeof c||!c.length)return r.destroy(Error("Invalid unsubscriptions")),!1;for(let f=0;f<c.length;f+=1){if("string"!=typeof c[f])return r.destroy(Error("Invalid unsubscriptions")),!1;h+=o.byteLength(c[f])+2}let p=null;if(5===s){if(!(p=R(r,d)))return!1;h+=p.length}r.write(n.UNSUBSCRIBE_HEADER[1][u?1:0][0]),v(r,h),b(r,l),null!==p&&p.write();let g=!0;for(let m=0;m<c.length;m++)g=_(r,c[m]);return g}(t,r,i);case"unsuback":return function(t,r,i){let s=i?i.protocolVersion:4,a=t||{},l=a.messageId,u=a.dup?n.DUP_MASK:0,c=a.granted,d=a.properties,h=a.cmd,f=2;if("number"!=typeof l)return r.destroy(Error("Invalid messageId")),!1;if(5===s){if("object"!=typeof c||!c.length)return r.destroy(Error("Invalid qos vector")),!1;for(let p=0;p<c.length;p+=1){if("number"!=typeof c[p])return r.destroy(Error("Invalid qos vector")),!1;f+=1}}let g=null;if(5===s){if(!(g=T(r,d,i,f)))return!1;f+=g.length}return r.write(n.ACKS[h][0][u][0]),v(r,f),b(r,l),null!==g&&g.write(),5===s&&r.write(o.from(c)),!0}(t,r,i);case"pingreq":case"pingresp":var l,d;return l=t,(d=r).write(n.EMPTY[l.cmd]);case"disconnect":return function(t,r,i){let s=i?i.protocolVersion:4,a=t||{},l=a.reasonCode,u=a.properties,c=5===s?1:0,d=null;if(5===s){if(!(d=T(r,u,i,c)))return!1;c+=d.length}return r.write(o.from([n.codes.disconnect<<4])),v(r,c),5===s&&r.write(o.from([l])),null!==d&&d.write(),!0}(t,r,i);case"auth":return function(t,r,i){let s=i?i.protocolVersion:4,a=t||{},l=a.reasonCode,u=a.properties,c=5===s?1:0;5!==s&&r.destroy(Error("Invalid mqtt version for auth packet"));let d=T(r,u,i,c);return!!d&&(c+=d.length,r.write(o.from([n.codes.auth<<4])),v(r,c),r.write(o.from([l])),null!==d&&d.write(),!0)}(t,r,i);default:return r.destroy(Error("Unknown command")),!1}}function $(t){t.uncork()}Object.defineProperty(y,"cacheNumbers",{get:()=>b===E,set(t){t?(d&&0!==Object.keys(d).length||(m=!0),b=E):(m=!1,b=k)}});let w={};function v(t,r){if(r>n.VARBYTEINT_MAX)return t.destroy(Error(`Invalid variable byte integer: ${r}`)),!1;let i=w[r];return i||(i=p(r),r<16384&&(w[r]=i)),c("writeVarByteInt: writing to stream: %o",i),t.write(i)}function _(t,r){let i=o.byteLength(r);return b(t,i),c("writeString: %s",r),t.write(r,"utf8")}function S(t,r,i){_(t,r),_(t,i)}function E(t,r){return c("writeNumberCached: number: %d",r),c("writeNumberCached: %o",d[r]),t.write(d[r])}function k(t,r){let i=h(r);return c("writeNumberGenerated: %o",i),t.write(i)}function A(t,r){"string"==typeof r?_(t,r):r?(b(t,r.length),t.write(r)):b(t,0)}function R(t,r){if("object"!=typeof r||null!=r.length)return{length:1,write(){C(t,{},0)}};let i=0;function s(r,i){let s=0;switch(n.propertiesTypes[r]){case"byte":if("boolean"!=typeof i)return t.destroy(Error(`Invalid ${r}: ${i}`)),!1;s+=2;break;case"int8":if("number"!=typeof i||i<0||i>255)return t.destroy(Error(`Invalid ${r}: ${i}`)),!1;s+=2;break;case"binary":if(i&&null===i)return t.destroy(Error(`Invalid ${r}: ${i}`)),!1;s+=1+o.byteLength(i)+2;break;case"int16":if("number"!=typeof i||i<0||i>65535)return t.destroy(Error(`Invalid ${r}: ${i}`)),!1;s+=3;break;case"int32":if("number"!=typeof i||i<0||i>4294967295)return t.destroy(Error(`Invalid ${r}: ${i}`)),!1;s+=5;break;case"var":if("number"!=typeof i||i<0||i>268435455)return t.destroy(Error(`Invalid ${r}: ${i}`)),!1;s+=1+o.byteLength(p(i));break;case"string":if("string"!=typeof i)return t.destroy(Error(`Invalid ${r}: ${i}`)),!1;s+=3+o.byteLength(i.toString());break;case"pair":if("object"!=typeof i)return t.destroy(Error(`Invalid ${r}: ${i}`)),!1;s+=Object.getOwnPropertyNames(i).reduce((t,r)=>{let n=i[r];return Array.isArray(n)?t+=n.reduce((t,i)=>t+(3+o.byteLength(r.toString())+2+o.byteLength(i.toString())),0):t+=3+o.byteLength(r.toString())+2+o.byteLength(i[r].toString()),t},0);break;default:return t.destroy(Error(`Invalid property ${r}: ${i}`)),!1}return s}if(r)for(let a in r){let l=0,u=0,c=r[a];if(Array.isArray(c))for(let d=0;d<c.length;d++){if(!(u=s(a,c[d])))return!1;l+=u}else{if(!(u=s(a,c)))return!1;l=u}if(!l)return!1;i+=l}return{length:o.byteLength(p(i))+i,write(){C(t,r,i)}}}function T(t,r,i,n){let o=["reasonString","userProperties"],s=i&&i.properties&&i.properties.maximumPacketSize?i.properties.maximumPacketSize:0,a=R(t,r);if(s)for(;n+a.length>s;){let l=o.shift();if(!l||!r[l])return!1;delete r[l],a=R(t,r)}return a}function I(t,r,i){switch(n.propertiesTypes[r]){case"byte":t.write(o.from([n.properties[r]])),t.write(o.from([+i]));break;case"int8":t.write(o.from([n.properties[r]])),t.write(o.from([i]));break;case"binary":t.write(o.from([n.properties[r]])),A(t,i);break;case"int16":t.write(o.from([n.properties[r]])),b(t,i);break;case"int32":t.write(o.from([n.properties[r]])),function(t,r){let i=g(r);c("write4ByteNumber: %o",i),t.write(i)}(t,i);break;case"var":t.write(o.from([n.properties[r]])),v(t,i);break;case"string":t.write(o.from([n.properties[r]])),_(t,i);break;case"pair":Object.getOwnPropertyNames(i).forEach(s=>{let a=i[s];Array.isArray(a)?a.forEach(i=>{t.write(o.from([n.properties[r]])),S(t,s.toString(),i.toString())}):(t.write(o.from([n.properties[r]])),S(t,s.toString(),a.toString()))});break;default:return t.destroy(Error(`Invalid property ${r} value: ${i}`)),!1}}function C(t,r,i){for(let n in v(t,i),r)if(Object.prototype.hasOwnProperty.call(r,n)&&null!==r[n]){let o=r[n];if(Array.isArray(o))for(let s=0;s<o.length;s++)I(t,n,o[s]);else I(t,n,o)}}function P(t){return t?t instanceof o?t.length:o.byteLength(t):0}function x(t){return"string"==typeof t||t instanceof o}t.exports=y},738:function(t,r,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,r,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(r,i);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(t,n,o)}:function(t,r,i,n){void 0===n&&(n=i),t[n]=r[i]}),o=this&&this.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&n(r,t,i);return o(r,t),r},a=this&&this.__exportStar||function(t,r){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||n(r,t,i)};Object.defineProperty(r,"__esModule",{value:!0});let l=s(i(226));r.default=l,a(i(226),r)},6497(t,r,i){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.BufferedDuplex=r.writev=void 0;let n=i(6070),o=i(181);function s(t,r){let i=Array(t.length);for(let n=0;n<t.length;n++)"string"==typeof t[n].chunk?i[n]=o.Buffer.from(t[n].chunk,"utf8"):i[n]=t[n].chunk;this._write(o.Buffer.concat(i),"binary",r)}r.writev=s;class a extends n.Duplex{constructor(t,r,i){super({objectMode:!0}),this.proxy=r,this.socket=i,this.writeQueue=[],t.objectMode||(this._writev=s.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",t=>{this.push(t)})}_read(t){this.proxy.read(t)}_write(t,r,i){this.isSocketOpen?this.writeToProxy(t,r,i):this.writeQueue.push({chunk:t,encoding:r,cb:i})}_final(t){this.writeQueue=[],this.proxy.end(t)}_destroy(t,r){this.writeQueue=[],this.proxy.destroy(),r(t)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(t,r,i){!1===this.proxy.write(t,r)?this.proxy.once("drain",i):i()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:t,encoding:r,cb:i}=this.writeQueue.shift();this.writeToProxy(t,r,i)}}}r.BufferedDuplex=a},6183:function(t,r,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});let o=n(i(7838));r.default=class{constructor(t,r,i){this.keepalive=1e3*t,this.checkPing=r,this.timer=(0,o.default)(i),this.reschedule()}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}reschedule(){this.clear(),this.timerId=this.timer.set(()=>{this.checkPing(),this.timerId&&this.reschedule()},this.keepalive)}}},5642:function(t,r,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.TypedEventEmitter=void 0;let o=n(i(4434)),s=i(305);class a{}r.TypedEventEmitter=a,(0,s.applyMixin)(a,o.default)},3183:function(t,r,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,r,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(r,i);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(t,n,o)}:function(t,r,i,n){void 0===n&&(n=i),t[n]=r[i]}),o=this&&this.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&n(r,t,i);return o(r,t),r},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});let l=a(i(3413)),u=a(i(9880)),c=a(i(4349)),d=i(6070),h=a(i(7319)),f=s(i(5962)),p=a(i(9171)),g=a(i(6487)),b=a(i(8466)),m=i(305),y=i(5642),$=a(i(6183)),w=s(i(5193)),v=globalThis.setImmediate||((...t)=>{let r=t.shift();(0,m.nextTick)(()=>{r(...t)})}),_={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,writeCache:!0,timerVariant:"auto"};class S extends y.TypedEventEmitter{static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(t,r){for(let i in super(),this.options=r||{},_)void 0===this.options[i]?this.options[i]=_[i]:this.options[i]=r[i];this.log=this.options.log||(0,p.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",S.VERSION),w.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",w.default?"browser":"node"),this.log("MqttClient :: options.protocol",r.protocol),this.log("MqttClient :: options.protocolVersion",r.protocolVersion),this.log("MqttClient :: options.username",r.username),this.log("MqttClient :: options.keepalive",r.keepalive),this.log("MqttClient :: options.reconnectPeriod",r.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",r.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",r.properties?r.properties.topicAliasMaximum:void 0),this.options.clientId="string"==typeof r.clientId?r.clientId:S.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===r.protocolVersion&&r.customHandleAcks?r.customHandleAcks:(...t)=>{t[3](null,0)},this.options.writeCache||(u.default.writeToStream.cacheNumbers=!1),this.streamBuilder=t,this.messageIdProvider=void 0===this.options.messageIdProvider?new c.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new g.default,this.incomingStore=r.incomingStore||new g.default,this.queueQoSZero=void 0===r.queueQoSZero||r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new l.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:t}=this,r=()=>{let i=t.shift();this.log("deliver :: entry %o",i);let n=null;if(!i)return void this._resubscribe();n=i.packet,this.log("deliver :: call _sendPacket for %o",n);let o=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(o=!1)),o?this._sendPacket(n,t=>{i.cb&&i.cb(t),r()}):(this.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),r())};this.log("connect :: sending queued packets"),r()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this.log("close :: clearing ping timer"),this.pingTimer&&(this.pingTimer.clear(),this.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(t,r){r()}handleMessage(t,r){r()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var t;let r=new d.Writable,i=u.default.parser(this.options),n=null,o=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),i.on("packet",t=>{this.log("parser :: on packet push to packets array."),o.push(t)});let s=()=>{this.log("work :: getting next packet in queue");let t=o.shift();if(t)this.log("work :: packet pulled from queue"),(0,b.default)(this,t,a);else{this.log("work :: no packets in queue");let r=n;n=null,this.log("work :: done flag is %s",!!r),r&&r()}},a=()=>{if(o.length)(0,m.nextTick)(s);else{let t=n;n=null,t()}};r._write=(t,r,o)=>{n=o,this.log("writable stream :: parsing buffer"),i.parse(t),s()},this.log("connect :: pipe stream to writable stream"),this.stream.pipe(r),this.stream.on("error",t=>{this.log("streamErrorHandler :: error",t.message),t.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",t)):this.noop(t)}),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");let l={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(l.will=Object.assign(Object.assign({},this.options.will),{payload:null===(t=this.options.will)||void 0===t?void 0:t.payload})),this.topicAliasRecv&&(l.properties||(l.properties={}),this.topicAliasRecv&&(l.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(l),i.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){let c=Object.assign({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(c)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(t,r,i,n){this.log("publish :: message `%s` to topic `%s`",r,t);let{options:o}=this;"function"==typeof i&&(n=i,i=null),i=i||{},i=Object.assign(Object.assign({},{qos:0,retain:!1,dup:!1}),i);let{qos:s,retain:a,dup:l,properties:u,cbStorePut:c}=i;if(this._checkDisconnecting(n))return this;let d=()=>{let i=0;if((1===s||2===s)&&null===(i=this._nextId()))return this.log("No messageId left"),!1;let d={cmd:"publish",topic:t,payload:r,qos:s,retain:a,messageId:i,dup:l};switch(5===o.protocolVersion&&(d.properties=u),this.log("publish :: qos",s),s){case 1:case 2:this.outgoing[d.messageId]={volatile:!1,cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",d.cmd),this._sendPacket(d,void 0,c);break;default:this.log("MqttClient:publish: packet cmd: %s",d.cmd),this._sendPacket(d,n,c)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!d())&&this._storeProcessingQueue.push({invoke:d,cbStorePut:i.cbStorePut,callback:n}),this}publishAsync(t,r,i){return new Promise((n,o)=>{this.publish(t,r,i,(t,r)=>{t?o(t):n(r)})})}subscribe(t,r,i){let n=this.options.protocolVersion;"function"==typeof r&&(i=r),i=i||this.noop;let o=!1,s=[];"string"==typeof t?s=t=[t]:Array.isArray(t)?s=t:"object"==typeof t&&(o=t.resubscribe,delete t.resubscribe,s=Object.keys(t));let a=f.validateTopics(s);if(null!==a)return v(i,Error(`Invalid topic ${a}`)),this;if(this._checkDisconnecting(i))return this.log("subscribe: discconecting true"),this;let l={qos:0};5===n&&(l.nl=!1,l.rap=!1,l.rh=0);let u=(r=Object.assign(Object.assign({},l),r)).properties,c=[],d=(t,i)=>{if(i=i||r,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,t)||this._resubscribeTopics[t].qos<i.qos||o){let s={topic:t,qos:i.qos};5===n&&(s.nl=i.nl,s.rap=i.rap,s.rh=i.rh,s.properties=u),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",s.topic,s.qos),c.push(s)}};if(Array.isArray(t)?t.forEach(t=>{this.log("subscribe: array topic %s",t),d(t)}):Object.keys(t).forEach(r=>{this.log("subscribe: object topic %s, %o",r,t[r]),d(r,t[r])}),!c.length)return i(null,[]),this;let h=()=>{let t=this._nextId();if(null===t)return this.log("No messageId left"),!1;let r={cmd:"subscribe",subscriptions:c,messageId:t};if(u&&(r.properties=u),this.options.resubscribe){this.log("subscribe :: resubscribe true");let o=[];c.forEach(t=>{if(this.options.reconnectPeriod>0){let r={qos:t.qos};5===n&&(r.nl=t.nl||!1,r.rap=t.rap||!1,r.rh=t.rh||0,r.properties=t.properties),this._resubscribeTopics[t.topic]=r,o.push(t.topic)}}),this.messageIdToTopic[r.messageId]=o}return this.outgoing[r.messageId]={volatile:!0,cb(t,r){if(!t){let{granted:n}=r;for(let o=0;o<n.length;o+=1)c[o].qos=n[o]}i(t,c)}},this.log("subscribe :: call _sendPacket"),this._sendPacket(r),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!h())&&this._storeProcessingQueue.push({invoke:h,callback:i}),this}subscribeAsync(t,r){return new Promise((i,n)=>{this.subscribe(t,r,(t,r)=>{t?n(t):i(r)})})}unsubscribe(t,r,i){"string"==typeof t&&(t=[t]),"function"==typeof r&&(i=r),i=i||this.noop;let n=f.validateTopics(t);if(null!==n)return v(i,Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(i))return this;let o=()=>{let n=this._nextId();if(null===n)return this.log("No messageId left"),!1;let o={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof t?o.unsubscriptions=[t]:Array.isArray(t)&&(o.unsubscriptions=t),this.options.resubscribe&&o.unsubscriptions.forEach(t=>{delete this._resubscribeTopics[t]}),"object"==typeof r&&r.properties&&(o.properties=r.properties),this.outgoing[o.messageId]={volatile:!0,cb:i},this.log("unsubscribe: call _sendPacket"),this._sendPacket(o),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!o())&&this._storeProcessingQueue.push({invoke:o,callback:i}),this}unsubscribeAsync(t,r){return new Promise((i,n)=>{this.unsubscribe(t,r,(t,r)=>{t?n(t):i(r)})})}end(t,r,i){this.log("end :: (%s)",this.options.clientId),null!=t&&"boolean"==typeof t||(i=i||r,r=t,t=!1),"object"!=typeof r&&(i=i||r,r=null),this.log("end :: cb? %s",!!i),i&&"function"==typeof i||(i=this.noop);let n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(t=>{this.outgoingStore.close(r=>{this.log("end :: closeStores: emitting end"),this.emit("end"),i&&(this.log("end :: closeStores: invoking callback with args"),i(t||r))})}),this._deferredReconnect&&this._deferredReconnect()},o=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,t),this._cleanUp(t,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,m.nextTick)(n)},r)};return this.disconnecting?(i(),this):(this._clearReconnect(),this.disconnecting=!0,!t&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,o,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),o()),this)}endAsync(t,r){return new Promise((i,n)=>{this.end(t,r,t=>{t?n(t):i()})})}removeOutgoingMessage(t){if(this.outgoing[t]){let{cb:r}=this.outgoing[t];this._removeOutgoingAndStoreMessage(t,()=>{r(Error("Message removed"))})}return this}reconnect(t){this.log("client reconnect");let r=()=>{t?(this.options.incomingStore=t.incomingStore,this.options.outgoingStore=t.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new g.default,this.outgoingStore=this.options.outgoingStore||new g.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(t=>{this.outgoing[t].volatile&&"function"==typeof this.outgoing[t].cb&&(this.outgoing[t].cb(Error("Connection closed")),delete this.outgoing[t])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(t=>{"function"==typeof this.outgoing[t].cb&&(this.outgoing[t].cb(Error("Connection closed")),delete this.outgoing[t])}))}_removeTopicAliasAndRecoverTopicName(t){let r;t.properties&&(r=t.properties.topicAlias);let i=t.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",r,i),0===i.length){if(void 0===r||void 0===(i=this.topicAliasSend.getTopicByAlias(r)))return Error("Unregistered Topic Alias");t.topic=i}r&&delete t.properties.topicAlias}_checkDisconnecting(t){return this.disconnecting&&(t&&t!==this.noop?t(Error("client disconnecting")):this.emit("error",Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){this.disconnecting||this.reconnectTimer||!(this.options.reconnectPeriod>0)?this.log("_setupReconnect :: doing nothing..."):(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod))}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(t,r,i={}){if(r&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",r)),this.log("_cleanUp :: forced? %s",t),t)0===this.options.reconnectPeriod&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let n=Object.assign({cmd:"disconnect"},i);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(n,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),v(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}this.disconnecting||this.reconnecting||(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer&&(this.log("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),r&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",r),r())}_storeAndSend(t,r,i){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",t.cmd);let n,o=t;if("publish"===o.cmd&&(o=(0,h.default)(t),n=this._removeTopicAliasAndRecoverTopicName(o)))return r&&r(n);this.outgoingStore.put(o,n=>{if(n)return r&&r(n);i(),this._writePacket(t,r)})}_applyTopicAlias(t){if(5===this.options.protocolVersion&&"publish"===t.cmd){let r;t.properties&&(r=t.properties.topicAlias);let i=t.topic.toString();if(this.topicAliasSend){if(r){if(0!==i.length&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",i,r),!this.topicAliasSend.put(i,r)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",i,r),Error("Sending Topic Alias out of range")}else 0!==i.length&&(this.options.autoAssignTopicAlias?(r=this.topicAliasSend.getAliasByTopic(i))?(t.topic="",t.properties=Object.assign(Object.assign({},t.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",i,r)):(r=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(i,r),t.properties=Object.assign(Object.assign({},t.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",i,r)):this.options.autoUseTopicAlias&&(r=this.topicAliasSend.getAliasByTopic(i))&&(t.topic="",t.properties=Object.assign(Object.assign({},t.properties),{topicAlias:r}),this.log("applyTopicAlias :: auto use topic: %s - alias: %d",i,r)))}else if(r)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",i,r),Error("Sending Topic Alias out of range")}}_noop(t){this.log("noop ::",t)}_writePacket(t,r){this.log("_writePacket :: packet: %O",t),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",t),this._shiftPingInterval(),this.log("_writePacket :: writing to stream");let i=u.default.writeToStream(t,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",i),!i&&r&&r!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",r)):r&&(this.log("_writePacket :: invoking cb"),r())}_sendPacket(t,r,i,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),i=i||this.noop,r=r||this.noop;let o=this._applyTopicAlias(t);if(o)r(o);else{if(!this.connected)return"auth"===t.cmd?void this._writePacket(t,r):(this.log("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(t,r,i));if(n)this._writePacket(t,r);else{switch(t.cmd){case"publish":break;case"pubrel":return void this._storeAndSend(t,r,i);default:return void this._writePacket(t,r)}switch(t.qos){case 2:case 1:this._storeAndSend(t,r,i);break;default:this._writePacket(t,r)}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}}}_storePacket(t,r,i){this.log("_storePacket :: packet: %o",t),this.log("_storePacket :: cb? %s",!!r),i=i||this.noop;let n=t;if("publish"===n.cmd){n=(0,h.default)(t);let o=this._removeTopicAliasAndRecoverTopicName(n);if(o)return r&&r(o)}let s=n.qos||0;0===s&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:r}):s>0?(r=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,t=>{if(t)return r&&r(t);i()})):r&&r(Error("No connection to broker"))}_setupPingTimer(){this.log("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive),!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=new $.default(this.options.keepalive,()=>{this._checkPing()},this.options.timerVariant))}_shiftPingInterval(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule()}_checkPing(){this.log("_checkPing :: checking ping..."),this.pingResp?(this.log("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(this.emit("error",Error("Keepalive timeout")),this.log("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))}_resubscribe(){this.log("_resubscribe");let t=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&t.length>0){if(this.options.resubscribe){if(5===this.options.protocolVersion){this.log("_resubscribe: protocolVersion 5");for(let r=0;r<t.length;r++){let i={};i[t[r]]=this._resubscribeTopics[t[r]],i.resubscribe=!0,this.subscribe(i,{properties:i[t[r]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics)}else this._resubscribeTopics={}}this._firstConnection=!1}_onConnect(t){if(this.disconnected)return void this.emit("connect",t);this.connackPacket=t,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0;let r=()=>{let i=this.outgoingStore.createStream(),n=()=>{i.destroy(),i=null,this._flushStoreProcessingQueue(),o()},o=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),i.on("error",t=>{o(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",t)});let s=()=>{if(!i)return;let t=i.read(1),r;t?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[t.messageId]?s():this.disconnecting||this.reconnectTimer?i.destroy&&i.destroy():(r=this.outgoing[t.messageId]?this.outgoing[t.messageId].cb:null,this.outgoing[t.messageId]={volatile:!1,cb(t,i){r&&r(t,i),s()}},this._packetIdsDuringStoreProcessing[t.messageId]=!0,this.messageIdProvider.register(t.messageId)?this._sendPacket(t,void 0,void 0,!0):this.log("messageId: %d has already used.",t.messageId))):i.once("readable",s)};i.on("end",()=>{let i=!0;for(let s in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[s]){i=!1;break}this.removeListener("close",n),i?(o(),this._invokeAllStoreProcessingQueue(),this.emit("connect",t)):r()}),s()};r()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let t=this._storeProcessingQueue[0];if(t&&t.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let t of this._storeProcessingQueue)t.cbStorePut&&t.cbStorePut(Error("Connection closed")),t.callback&&t.callback(Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(t,r){delete this.outgoing[t],this.outgoingStore.del({messageId:t},(i,n)=>{r(i,n),this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue()})}}S.VERSION=process.env.npm_package_version,r.default=S},8015(t,r,i){"use strict";let n=i(181),o=i(6070),s=i(6497),a,l,u,c=!1;r.A=(t,r)=>{var i;if(r.hostname=r.hostname||r.host,!r.hostname)throw Error("Could not determine host. Specify host manually.");let d="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";(i=r).hostname||(i.hostname="localhost"),i.path||(i.path="/"),i.wsOptions||(i.wsOptions={});let h=function(t,r){let i="alis"===t.protocol?"wss":"ws",n=`${i}://${t.hostname}${t.path}`;return t.port&&80!==t.port&&443!==t.port&&(n=`${i}://${t.hostname}:${t.port}${t.path}`),"function"==typeof t.transformWsUrl&&(n=t.transformWsUrl(n,t,r)),n}(r,t);return(a=r.my).connectSocket({url:h,protocols:d}),l=function(){let t=new o.Transform;return t._write=(t,r,i)=>{a.sendSocketMessage({data:t.buffer,success(){i()},fail(){i(Error())}})},t._flush=t=>{a.closeSocket({success(){t()}})},t}(),u=new s.BufferedDuplex(r,l,a),c||(c=!0,a.onSocketOpen(()=>{u.socketReady()}),a.onSocketMessage(t=>{if("string"==typeof t.data){let r=n.Buffer.from(t.data,"base64");l.push(r)}else{let i=new FileReader;i.addEventListener("load",()=>{let t=i.result;t=t instanceof ArrayBuffer?n.Buffer.from(t):n.Buffer.from(t,"utf8"),l.push(t)}),i.readAsArrayBuffer(t.data)}}),a.onSocketClose(()=>{u.end(),u.destroy()}),a.onSocketError(t=>{u.destroy(t)})),u}},1087:function(t,r,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.connectAsync=void 0;let o=n(i(9171)),s=n(i(7016)),a=n(i(3183)),l=n(i(5193)),u=(0,o.default)("mqttjs"),c={};function d(t,r){var i;if(u("connecting to an MQTT broker..."),"object"!=typeof t||r||(r=t,t=""),r=r||{},t&&"string"==typeof t){let n=s.default.parse(t,!0);if(null!=n.port&&(n.port=Number(n.port)),null===(r=Object.assign(Object.assign({},n),r)).protocol)throw Error("Missing protocol");r.protocol=r.protocol.replace(/:$/,"")}let o;if((i=r).auth&&((o=i.auth.match(/^(.+):(.+)$/))?(i.username=o[1],i.password=o[2]):i.username=i.auth),r.query&&"string"==typeof r.query.clientId&&(r.clientId=r.query.clientId),r.cert&&r.key){if(!r.protocol)throw Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(r.protocol))switch(r.protocol){case"mqtt":r.protocol="mqtts";break;case"ws":r.protocol="wss";break;case"wx":r.protocol="wxs";break;case"ali":r.protocol="alis";break;default:throw Error(`Unknown protocol for secure connection: "${r.protocol}"!`)}}if(!c[r.protocol]){let l=-1!==["mqtts","wss"].indexOf(r.protocol);r.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((t,r)=>(!l||r%2!=0)&&"function"==typeof c[t])[0]}if(!1===r.clean&&!r.clientId)throw Error("Missing clientId for unclean clients");r.protocol&&(r.defaultProtocol=r.protocol);let d=new a.default(function(t){return r.servers&&(t._reconnectCount&&t._reconnectCount!==r.servers.length||(t._reconnectCount=0),r.host=r.servers[t._reconnectCount].host,r.port=r.servers[t._reconnectCount].port,r.protocol=r.servers[t._reconnectCount].protocol?r.servers[t._reconnectCount].protocol:r.defaultProtocol,r.hostname=r.host,t._reconnectCount++),u("calling streambuilder for",r.protocol),c[r.protocol](t,r)},r);return d.on("error",()=>{}),d}l.default?(c.wx=i(8384).A,c.wxs=i(8384).A,c.ali=i(8015).A,c.alis=i(8015).A):(c.mqtt=i(4432).default,c.tcp=i(4432).default,c.ssl=i(3134).default,c.tls=c.ssl,c.mqtts=i(3134).default),c.ws=i(1505).default,c.wss=i(1505).default,r.connectAsync=function(t,r,i=!0){return new Promise((n,o)=>{let s=d(t,r),a={connect(t){l(),n(s)},end(){l(),n(s)},error(t){l(),s.end(),o(t)}};function l(){Object.keys(a).forEach(t=>{s.off(t,a[t])})}!1===i&&(a.close=()=>{a.error(Error("Couldn't connect to server"))}),Object.keys(a).forEach(t=>{s.on(t,a[t])})})},r.default=d},4432:function(t,r,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});let o=n(i(9278)),s=(0,n(i(9171)).default)("mqttjs:tcp");r.default=(t,r)=>{r.port=r.port||1883,r.hostname=r.hostname||r.host||"localhost";let{port:i}=r,n=r.hostname;return s("port %d and host %s",i,n),o.default.createConnection(i,n)}},3134:function(t,r,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});let o=n(i(4756)),s=n(i(9278)),a=(0,n(i(9171)).default)("mqttjs:tls");r.default=(t,r)=>{r.port=r.port||8883,r.host=r.hostname||r.host||"localhost",0===s.default.isIP(r.host)&&(r.servername=r.host),r.rejectUnauthorized=!1!==r.rejectUnauthorized,delete r.path,a("port %d host %s rejectUnauthorized %b",r.port,r.host,r.rejectUnauthorized);let i=o.default.connect(r);function n(n){r.rejectUnauthorized&&t.emit("error",n),i.end()}return i.on("secureConnect",()=>{r.rejectUnauthorized&&!i.authorized?i.emit("error",Error("TLS not authorized")):i.removeListener("error",n)}),i.on("error",n),i}},1505:function(t,r,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});let o=i(181),s=n(i(2641)),a=n(i(9171)),l=i(6070),u=n(i(5193)),c=i(6497),d=(0,a.default)("mqttjs:ws"),h=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function f(t,r){let i=`${t.protocol}://${t.hostname}:${t.port}${t.path}`;return"function"==typeof t.transformWsUrl&&(i=t.transformWsUrl(i,t,r)),i}function p(t){let r=t;return t.hostname||(r.hostname="localhost"),t.port||("wss"===t.protocol?r.port=443:r.port=80),t.path||(r.path="/"),t.wsOptions||(r.wsOptions={}),u.default||"wss"!==t.protocol||h.forEach(i=>{Object.prototype.hasOwnProperty.call(t,i)&&!Object.prototype.hasOwnProperty.call(t.wsOptions,i)&&(r.wsOptions[i]=t[i])}),r}r.default=u.default?(t,r)=>{let i;d("browserStreamBuilder");let n=function(t){let r=p(t);if(r.hostname||(r.hostname=r.host),!r.hostname){if("undefined"==typeof document)throw Error("Could not determine host. Specify host manually.");let i=new URL(document.URL);r.hostname=i.hostname,r.port||(r.port=Number(i.port))}return void 0===r.objectMode&&(r.objectMode=!(!0===r.binary||void 0===r.binary)),r}(r),s=n.browserBufferSize||524288,a=r.browserBufferTimeout||1e3,u=!r.objectMode,h=function(t,r){let i="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt",n=f(r,t),o;return(o=r.createWebsocket?r.createWebsocket(n,[i],r):new WebSocket(n,[i])).binaryType="arraybuffer",o}(t,r),g=function(t,r,i){let n=new l.Transform({objectMode:t.objectMode});return n._write=function t(r,i,n){if(h.bufferedAmount>s)return void setTimeout(t,a,r,i,n);u&&"string"==typeof r&&(r=o.Buffer.from(r,"utf8"));try{h.send(r)}catch(l){return n(l)}n()},n._flush=function(t){h.close(),t()},n}(r);r.objectMode||(g._writev=c.writev.bind(g)),g.on("close",()=>{h.close()});let b=void 0!==h.addEventListener;function m(){d("WebSocket onOpen"),i instanceof c.BufferedDuplex&&i.socketReady()}function y(t){d("WebSocket onClose",t),i.end(),i.destroy()}function $(t){d("WebSocket onError",t);let r=Error("WebSocket error");r.event=t,i.destroy(r)}function w(t){let{data:r}=t;r=r instanceof ArrayBuffer?o.Buffer.from(r):o.Buffer.from(r,"utf8"),g.push(r)}return h.readyState===h.OPEN?(i=g).socket=h:(i=new c.BufferedDuplex(r,g,h),b?h.addEventListener("open",m):h.onopen=m),b?(h.addEventListener("close",y),h.addEventListener("error",$),h.addEventListener("message",w)):(h.onclose=y,h.onerror=$,h.onmessage=w),i}:(t,r)=>{d("streamBuilder");let i=p(r),n=f(i,t),o=function(t,r,i){d("createWebSocket"),d(`protocol: ${i.protocolId} ${i.protocolVersion}`);let n="MQIsdp"===i.protocolId&&3===i.protocolVersion?"mqttv3.1":"mqtt",o;return d(`creating new Websocket for url: ${r} and protocol: ${n}`),o=i.createWebsocket?i.createWebsocket(r,[n],i):new s.default(r,[n],i.wsOptions)}(0,n,i),a=s.default.createWebSocketStream(o,i.wsOptions);return a.url=n,o.on("close",()=>{a.destroy()}),a}},8384(t,r,i){"use strict";let n=i(181),o=i(6070),s=i(6497),a,l,u;r.A=(t,r)=>{var i;if(r.hostname=r.hostname||r.host,!r.hostname)throw Error("Could not determine host. Specify host manually.");let c="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";(i=r).hostname||(i.hostname="localhost"),i.path||(i.path="/"),i.wsOptions||(i.wsOptions={});let d=function(t,r){let i="wxs"===t.protocol?"wss":"ws",n=`${i}://${t.hostname}${t.path}`;return t.port&&80!==t.port&&443!==t.port&&(n=`${i}://${t.hostname}:${t.port}${t.path}`),"function"==typeof t.transformWsUrl&&(n=t.transformWsUrl(n,t,r)),n}(r,t);a=wx.connectSocket({url:d,protocols:[c]}),l=function(){let t=new o.Transform;return t._write=(t,r,i)=>{a.send({data:t.buffer,success(){i()},fail(t){i(Error(t))}})},t._flush=t=>{a.close({success(){t()}})},t}(),(u=new s.BufferedDuplex(r,l,a))._destroy=(t,r)=>{a.close({success(){r&&r(t)}})};let h=u.destroy;return u.destroy=(t,r)=>(u.destroy=h,setTimeout(()=>{a.close({fail(){u._destroy(t,r)}})},0),u),a.onOpen(()=>{u.socketReady()}),a.onMessage(t=>{let{data:r}=t;r=r instanceof ArrayBuffer?n.Buffer.from(r):n.Buffer.from(r,"utf8"),l.push(r)}),a.onClose(()=>{u.emit("close"),u.end(),u.destroy()}),a.onError(t=>{let r=Error(t.errMsg);u.destroy(r)}),u}},4349(t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=class{constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){let t=this.nextId++;return 65536===this.nextId&&(this.nextId=1),t}getLastAllocated(){return 1===this.nextId?65535:this.nextId-1}register(t){return!0}deallocate(t){}clear(){}}},7838:function(t,r,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,r,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(r,i);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(t,n,o)}:function(t,r,i,n){void 0===n&&(n=i),t[n]=r[i]}),o=this&&this.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&n(r,t,i);return o(r,t),r};Object.defineProperty(r,"__esModule",{value:!0});let a=s(i(5193)),l=i(9830),u={set:l.setTimeout,clear:l.clearTimeout},c={set:(t,r)=>setTimeout(t,r),clear:t=>clearTimeout(t)};r.default=t=>{switch(t){case"native":return c;case"worker":return u;default:return!a.default||a.isWebWorker||a.isReactNativeBrowser?c:u}}},9771(t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ReasonCodes=void 0,r.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.default=(t,i)=>{let{messageId:n}=i,o=i.cmd,s=null,a=t.outgoing[n]?t.outgoing[n].cb:null,l;if(a){switch(t.log("_handleAck :: packet type",o),o){case"pubcomp":case"puback":{let u=i.reasonCode;u&&u>0&&16!==u?((l=Error(`Publish error: ${r.ReasonCodes[u]}`)).code=u,t._removeOutgoingAndStoreMessage(n,()=>{a(l,i)})):t._removeOutgoingAndStoreMessage(n,a);break}case"pubrec":{s={cmd:"pubrel",qos:2,messageId:n};let c=i.reasonCode;c&&c>0&&16!==c?((l=Error(`Publish error: ${r.ReasonCodes[c]}`)).code=c,t._removeOutgoingAndStoreMessage(n,()=>{a(l,i)})):t._sendPacket(s);break}case"suback":{delete t.outgoing[n],t.messageIdProvider.deallocate(n);let d=i.granted;for(let h=0;h<d.length;h++)if(128&d[h]){let f=t.messageIdToTopic[n];f&&f.forEach(r=>{delete t._resubscribeTopics[r]})}delete t.messageIdToTopic[n],t._invokeStoreProcessingQueue(),a(null,i);break}case"unsuback":delete t.outgoing[n],t.messageIdProvider.deallocate(n),t._invokeStoreProcessingQueue(),a(null);break;default:t.emit("error",Error("unrecognized packet type"))}t.disconnecting&&0===Object.keys(t.outgoing).length&&t.emit("outgoingEmpty")}else t.log("_handleAck :: Server sent an ack in error. Ignoring.")}},9582(t,r,i){"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=i(305),o=i(9771);r.default=(t,r)=>{let{options:i}=t,s=i.protocolVersion,a=5===s?r.reasonCode:r.returnCode;if(5===s)t.handleAuth(r,(r,i)=>{if(r)t.emit("error",r);else if(24===a)t.reconnecting=!1,t._sendPacket(i);else{let s=new n.ErrorWithReasonCode(`Connection refused: ${o.ReasonCodes[a]}`,a);t.emit("error",s)}});else{let l=new n.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${s}`,a);t.emit("error",l)}}},9381:function(t,r,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});let o=i(9771),s=n(i(9683)),a=i(305);r.default=(t,r)=>{t.log("_handleConnack");let{options:i}=t,n=5===i.protocolVersion?r.reasonCode:r.returnCode;if(clearTimeout(t.connackTimer),delete t.topicAliasSend,r.properties){if(r.properties.topicAliasMaximum){if(r.properties.topicAliasMaximum>65535)return void t.emit("error",Error("topicAliasMaximum from broker is out of range"));r.properties.topicAliasMaximum>0&&(t.topicAliasSend=new s.default(r.properties.topicAliasMaximum))}r.properties.serverKeepAlive&&i.keepalive&&(i.keepalive=r.properties.serverKeepAlive,t._shiftPingInterval()),r.properties.maximumPacketSize&&(i.properties||(i.properties={}),i.properties.maximumPacketSize=r.properties.maximumPacketSize)}if(0===n)t.reconnecting=!1,t._onConnect(r);else if(n>0){let l=new a.ErrorWithReasonCode(`Connection refused: ${o.ReasonCodes[n]}`,n);t.emit("error",l)}}},8466:function(t,r,i){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0});let o=n(i(5293)),s=n(i(9582)),a=n(i(9381)),l=n(i(9771)),u=n(i(3210));r.default=(t,r,i)=>{let{options:n}=t;if(5===n.protocolVersion&&n.properties&&n.properties.maximumPacketSize&&n.properties.maximumPacketSize<r.length)return t.emit("error",Error(`exceeding packets size ${r.cmd}`)),t.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),t;switch(t.log("_handlePacket :: emitting packetreceive"),t.emit("packetreceive",r),r.cmd){case"publish":(0,o.default)(t,r,i);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":(0,l.default)(t,r),i();break;case"pubrel":(0,u.default)(t,r,i);break;case"connack":(0,a.default)(t,r),i();break;case"auth":(0,s.default)(t,r),i();break;case"pingresp":t.pingResp=!0,i();break;case"disconnect":t.emit("disconnect",r),i();break;default:t.log("_handlePacket :: unknown command"),i()}}},5293(t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});let i=[0,16,128,131,135,144,145,151,153];r.default=(t,r,n)=>{t.log("handlePublish: packet %o",r),n=void 0!==n?n:t.noop;let o=r.topic.toString(),s=r.payload,{qos:a}=r,{messageId:l}=r,{options:u}=t;if(5===t.options.protocolVersion){let c;if(r.properties&&(c=r.properties.topicAlias),void 0!==c){if(0===o.length){if(!(c>0&&c<=65535))return t.log("handlePublish :: topic alias out of range. alias: %d",c),void t.emit("error",Error("Received Topic Alias is out of range"));{let d=t.topicAliasRecv.getTopicByAlias(c);if(!d)return t.log("handlePublish :: unregistered topic alias. alias: %d",c),void t.emit("error",Error("Received unregistered Topic Alias"));o=d,t.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",o,c)}}else{if(!t.topicAliasRecv.put(o,c))return t.log("handlePublish :: topic alias out of range. alias: %d",c),void t.emit("error",Error("Received Topic Alias is out of range"));t.log("handlePublish :: registered topic: %s - alias: %d",o,c)}}}switch(t.log("handlePublish: qos %d",a),a){case 2:u.customHandleAcks(o,s,r,(o,s)=>("number"==typeof o&&(s=o,o=null),o?t.emit("error",o):-1===i.indexOf(s)?t.emit("error",Error("Wrong reason code for pubrec")):void(s?t._sendPacket({cmd:"pubrec",messageId:l,reasonCode:s},n):t.incomingStore.put(r,()=>{t._sendPacket({cmd:"pubrec",messageId:l},n)}))));break;case 1:u.customHandleAcks(o,s,r,(a,u)=>("number"==typeof a&&(u=a,a=null),a?t.emit("error",a):-1===i.indexOf(u)?t.emit("error",Error("Wrong reason code for puback")):(u||t.emit("message",o,s,r),void t.handleMessage(r,r=>{if(r)return n&&n(r);t._sendPacket({cmd:"puback",messageId:l,reasonCode:u},n)}))));break;case 0:t.emit("message",o,s,r),t.handleMessage(r,n);break;default:t.log("handlePublish: unknown QoS. Doing nothing.")}}},3210(t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=(t,r,i)=>{t.log("handling pubrel packet");let n=void 0!==i?i:t.noop,{messageId:o}=r,s={cmd:"pubcomp",messageId:o};t.incomingStore.get(r,(r,i)=>{r?t._sendPacket(s,n):(t.emit("message",i.topic,i.payload,i),t.handleMessage(i,r=>{if(r)return n(r);t.incomingStore.del(i,t.noop),t._sendPacket(s,n)}))})}},5193(t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.isReactNativeBrowser=r.isWebWorker=void 0;let i=()=>{var t,r;return Boolean("object"==typeof self&&(null===(r=null===(t=null==self?void 0:self.constructor)||void 0===t?void 0:t.name)||void 0===r?void 0:r.includes("WorkerGlobalScope")))},n="undefined"!=typeof window&&void 0!==window.document||i()||"undefined"!=typeof navigator&&"ReactNative"===navigator.product;r.isWebWorker=i(),r.isReactNativeBrowser="undefined"!=typeof navigator&&"ReactNative"===navigator.product,r.default=n},305(t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.nextTick=r.applyMixin=r.ErrorWithReasonCode=void 0;class i extends Error{constructor(t,r){super(t),this.code=r,Object.setPrototypeOf(this,i.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}}r.ErrorWithReasonCode=i,r.applyMixin=function(t,r,i=!1){var n;let o=[r];for(;;){let s=o[0],a=Object.getPrototypeOf(s);if(!(null==a?void 0:a.prototype))break;o.unshift(a)}for(let l of o)for(let u of Object.getOwnPropertyNames(l.prototype))(i||"constructor"!==u)&&Object.defineProperty(t.prototype,u,null!==(n=Object.getOwnPropertyDescriptor(l.prototype,u))&&void 0!==n?n:Object.create(null))},r.nextTick="function"==typeof(null==process?void 0:process.nextTick)?process.nextTick:t=>{setTimeout(t,0)}},6487(t,r,i){"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=i(6070),o={objectMode:!0};r.default=class{constructor(t){this.options=t||{},this.options=Object.assign(Object.assign({},{clean:!0}),t),this._inflights=new Map}put(t,r){return this._inflights.set(t.messageId,t),r&&r(),this}createStream(){let t=new n.Readable(o),r=[],i=!1,s=0;return this._inflights.forEach((t,i)=>{r.push(t)}),t._read=()=>{!i&&s<r.length?t.push(r[s++]):t.push(null)},t.destroy=r=>{if(!i)return i=!0,setTimeout(()=>{t.emit("close")},0),t},t}del(t,r){let i=this._inflights.get(t.messageId);return i?(this._inflights.delete(t.messageId),r(null,i)):r&&r(Error("missing packet")),this}get(t,r){let i=this._inflights.get(t.messageId);return i?r(null,i):r&&r(Error("missing packet")),this}close(t){this.options.clean&&(this._inflights=null),t&&t()}}},3413(t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=class{constructor(t){this.aliasToTopic={},this.max=t}put(t,r){return!(0===r||r>this.max||(this.aliasToTopic[r]=t,this.length=Object.keys(this.aliasToTopic).length,0))}getTopicByAlias(t){return this.aliasToTopic[t]}clear(){this.aliasToTopic={}}}},9683(t,r,i){"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=i(6660),o=i(6490);r.default=class{constructor(t){t>0&&(this.aliasToTopic=new n.LRUCache({max:t}),this.topicToAlias={},this.numberAllocator=new o.NumberAllocator(1,t),this.max=t,this.length=0)}put(t,r){if(0===r||r>this.max)return!1;let i=this.aliasToTopic.get(r);return i&&delete this.topicToAlias[i],this.aliasToTopic.set(r,t),this.topicToAlias[t]=r,this.numberAllocator.use(r),this.length=this.aliasToTopic.size,!0}getTopicByAlias(t){return this.aliasToTopic.get(t)}getAliasByTopic(t){let r=this.topicToAlias[t];return void 0!==r&&this.aliasToTopic.get(r),r}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}},513(t,r,i){"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=i(6490);r.default=class{constructor(){this.numberAllocator=new n.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(t){return this.numberAllocator.use(t)}deallocate(t){this.numberAllocator.free(t)}clear(){this.numberAllocator.clear()}}},5962(t,r){"use strict";function i(t){let r=t.split("/");for(let i=0;i<r.length;i++)if("+"!==r[i]){if("#"===r[i])return i===r.length-1;if(-1!==r[i].indexOf("+")||-1!==r[i].indexOf("#"))return!1}return!0}Object.defineProperty(r,"__esModule",{value:!0}),r.validateTopics=r.validateTopic=void 0,r.validateTopic=i,r.validateTopics=function(t){if(0===t.length)return"empty_topic_list";for(let r=0;r<t.length;r++)if(!i(t[r]))return t[r];return null}},226:function(t,r,i){"use strict";var n=this&&this.__createBinding||(Object.create?function(t,r,i,n){void 0===n&&(n=i);var o=Object.getOwnPropertyDescriptor(r,i);o&&!("get"in o?!r.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(t,n,o)}:function(t,r,i,n){void 0===n&&(n=i),t[n]=r[i]}),o=this&&this.__setModuleDefault||(Object.create?function(t,r){Object.defineProperty(t,"default",{enumerable:!0,value:r})}:function(t,r){t.default=r}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var i in t)"default"!==i&&Object.prototype.hasOwnProperty.call(t,i)&&n(r,t,i);return o(r,t),r},a=this&&this.__exportStar||function(t,r){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(r,i)||n(r,t,i)},l=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(r,"__esModule",{value:!0}),r.ReasonCodes=r.PingTimer=r.UniqueMessageIdProvider=r.DefaultMessageIdProvider=r.Store=r.MqttClient=r.connectAsync=r.connect=r.Client=void 0;let u=l(i(3183));r.MqttClient=u.default;let c=l(i(4349));r.DefaultMessageIdProvider=c.default;let d=l(i(513));r.UniqueMessageIdProvider=d.default;let h=l(i(6487));r.Store=h.default;let f=s(i(1087));r.connect=f.default,Object.defineProperty(r,"connectAsync",{enumerable:!0,get:function(){return f.connectAsync}});let p=l(i(6183));r.PingTimer=p.default,r.Client=u.default,a(i(3183),r),a(i(305),r);var g=i(9771);Object.defineProperty(r,"ReasonCodes",{enumerable:!0,get:function(){return g.ReasonCodes}})},3483(t,r,i){"use strict";let{SymbolDispose:n}=i(8622),{AbortError:o,codes:s}=i(7115),{isNodeStream:a,isWebStream:l,kControllerErrorFunction:u}=i(3003),c=i(9398),{ERR_INVALID_ARG_TYPE:d}=s,h;t.exports.addAbortSignal=function(r,i){if(((t,r)=>{if("object"!=typeof t||!("aborted"in t))throw new d("signal","AbortSignal",t)})(r),!a(i)&&!l(i))throw new d("stream",["ReadableStream","WritableStream","Stream"],i);return t.exports.addAbortSignalNoValidate(r,i)},t.exports.addAbortSignalNoValidate=function(t,r){if("object"!=typeof t||!("aborted"in t))return r;let s=a(r)?()=>{r.destroy(new o(void 0,{cause:t.reason}))}:()=>{r[u](new o(void 0,{cause:t.reason}))};if(t.aborted)s();else{h=h||i(8104).addAbortListener;let l=h(t,s);c(r,l[n])}return r}},1793(t,r,i){"use strict";let{StringPrototypeSlice:n,SymbolIterator:o,TypedArrayPrototypeSet:s,Uint8Array:a}=i(8622),{Buffer:l}=i(181),{inspect:u}=i(8104);t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let r={data:t,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(t){let r={data:t,next:this.head};0===this.length&&(this.tail=r),this.head=r,++this.length}shift(){if(0===this.length)return;let t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(0===this.length)return"";let r=this.head,i=""+r.data;for(;null!==(r=r.next);)i+=t+r.data;return i}concat(t){if(0===this.length)return l.alloc(0);let r=l.allocUnsafe(t>>>0),i=this.head,n=0;for(;i;)s(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(t,r){let i=this.head.data;if(t<i.length){let n=i.slice(0,t);return this.head.data=i.slice(t),n}return t===i.length?this.shift():r?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[o](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let r="",i=this.head,o=0;do{let s=i.data;if(!(t>s.length)){t===s.length?(r+=s,++o,i.next?this.head=i.next:this.head=this.tail=null):(r+=n(s,0,t),this.head=i,i.data=n(s,t));break}r+=s,t-=s.length,++o}while(null!==(i=i.next));return this.length-=o,r}_getBuffer(t){let r=l.allocUnsafe(t),i=t,n=this.head,o=0;do{let u=n.data;if(!(t>u.length)){t===u.length?(s(r,u,i-t),++o,n.next?this.head=n.next:this.head=this.tail=null):(s(r,new a(u.buffer,u.byteOffset,t),i-t),this.head=n,n.data=u.slice(t));break}s(r,u,i-t),t-=u.length,++o}while(null!==(n=n.next));return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](t,r){return u(this,{...r,depth:0,customInspect:!1})}}},8062(t,r,i){"use strict";let{pipeline:n}=i(678),o=i(722),{destroyer:s}=i(8816),{isNodeStream:a,isReadable:l,isWritable:u,isWebStream:c,isTransformStream:d,isWritableStream:h,isReadableStream:f}=i(3003),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:g,ERR_MISSING_ARGS:b}}=i(7115),m=i(9398);t.exports=function(...t){if(0===t.length)throw new b("streams");if(1===t.length)return o.from(t[0]);let r=[...t];if("function"==typeof t[0]&&(t[0]=o.from(t[0])),"function"==typeof t[t.length-1]){let i=t.length-1;t[i]=o.from(t[i])}for(let y=0;y<t.length;++y)if(a(t[y])||c(t[y])){if(y<t.length-1&&!(l(t[y])||f(t[y])||d(t[y])))throw new g(`streams[${y}]`,r[y],"must be readable");if(y>0&&!(u(t[y])||h(t[y])||d(t[y])))throw new g(`streams[${y}]`,r[y],"must be writable")}let $,w,v,_,S,E=t[0],k=n(t,function(t){let r=_;_=null,r?r(t):t?S.destroy(t):R||A||S.destroy()}),A=!!(u(E)||h(E)||d(E)),R=!!(l(k)||f(k)||d(k));if(S=new o({writableObjectMode:!(null==E||!E.writableObjectMode),readableObjectMode:!(null==k||!k.readableObjectMode),writable:A,readable:R}),A){if(a(E))S._write=function(t,r,i){E.write(t,r)?i():$=i},S._final=function(t){E.end(),w=t},E.on("drain",function(){if($){let t=$;$=null,t()}});else if(c(E)){let T=(d(E)?E.writable:E).getWriter();S._write=async function(t,r,i){try{await T.ready,T.write(t).catch(()=>{}),i()}catch(n){i(n)}},S._final=async function(t){try{await T.ready,T.close().catch(()=>{}),w=t}catch(r){t(r)}}}let I=d(k)?k.readable:k;m(I,()=>{if(w){let t=w;w=null,t()}})}if(R){if(a(k))k.on("readable",function(){if(v){let t=v;v=null,t()}}),k.on("end",function(){S.push(null)}),S._read=function(){for(;;){let t=k.read();if(null===t)return void(v=S._read);if(!S.push(t))return}};else if(c(k)){let C=(d(k)?k.readable:k).getReader();S._read=async function(){for(;;)try{let{value:t,done:r}=await C.read();if(!S.push(t))return;if(r)return void S.push(null)}catch{return}}}}return S._destroy=function(t,r){t||null===_||(t=new p),v=null,$=null,w=null,null===_?r(t):(_=r,a(k)&&s(k,t))},S}},8816(t,r,i){"use strict";let n=i(6308),{aggregateTwoErrors:o,codes:{ERR_MULTIPLE_CALLBACK:s},AbortError:a}=i(7115),{Symbol:l}=i(8622),{kIsDestroyed:u,isDestroyed:c,isFinished:d,isServerRequest:h}=i(3003),f=l("kDestroy"),p=l("kConstruct");function g(t,r,i){t&&(t.stack,r&&!r.errored&&(r.errored=t),i&&!i.errored&&(i.errored=t))}function b(t,r,i){let o=!1;function s(r){if(o)return;o=!0;let s=t._readableState,a=t._writableState;g(r,a,s),a&&(a.closed=!0),s&&(s.closed=!0),"function"==typeof i&&i(r),r?n.nextTick(m,t,r):n.nextTick(y,t)}try{t._destroy(r||null,s)}catch(a){s(a)}}function m(t,r){$(t,r),y(t)}function y(t){let r=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),r&&(r.closeEmitted=!0),(null!=i&&i.emitClose||null!=r&&r.emitClose)&&t.emit("close")}function $(t,r){let i=t._readableState,n=t._writableState;null!=n&&n.errorEmitted||null!=i&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",r))}function w(t,r,i){let o=t._readableState,s=t._writableState;if(null!=s&&s.destroyed||null!=o&&o.destroyed)return this;null!=o&&o.autoDestroy||null!=s&&s.autoDestroy?t.destroy(r):r&&(r.stack,s&&!s.errored&&(s.errored=r),o&&!o.errored&&(o.errored=r),i?n.nextTick($,t,r):$(t,r))}function v(t){let r=!1;function i(i){if(r)return void w(t,null!=i?i:new s);r=!0;let o=t._readableState,a=t._writableState,l=a||o;o&&(o.constructed=!0),a&&(a.constructed=!0),l.destroyed?t.emit(f,i):i?w(t,i,!0):n.nextTick(_,t)}try{t._construct(t=>{n.nextTick(i,t)})}catch(o){n.nextTick(i,o)}}function _(t){t.emit(p)}function S(t){return(null==t?void 0:t.setHeader)&&"function"==typeof t.abort}function E(t){t.emit("close")}function k(t,r){t.emit("error",r),n.nextTick(E,t)}t.exports={construct:function(t,r){if("function"!=typeof t._construct)return;let i=t._readableState,o=t._writableState;i&&(i.constructed=!1),o&&(o.constructed=!1),t.once(p,r),t.listenerCount(p)>1||n.nextTick(v,t)},destroyer:function(t,r){t&&!c(t)&&(r||d(t)||(r=new a),h(t)?(t.socket=null,t.destroy(r)):S(t)?t.abort():S(t.req)?t.req.abort():"function"==typeof t.destroy?t.destroy(r):"function"==typeof t.close?t.close():r?n.nextTick(k,t,r):n.nextTick(E,t),t.destroyed||(t[u]=!0))},destroy:function(t,r){let i=this._readableState,n=this._writableState,s=n||i;return null!=n&&n.destroyed||null!=i&&i.destroyed?("function"==typeof r&&r(),this):(g(t,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),s.constructed?b(this,t,r):this.once(f,function(i){b(this,o(i,t),r)}),this)},undestroy:function(){let t=this._readableState,r=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=!1===t.readable,t.endEmitted=!1===t.readable),r&&(r.constructed=!0,r.destroyed=!1,r.closed=!1,r.closeEmitted=!1,r.errored=null,r.errorEmitted=!1,r.finalCalled=!1,r.prefinished=!1,r.ended=!1===r.writable,r.ending=!1===r.writable,r.finished=!1===r.writable)},errorOrDestroy:w}},722(t,r,i){"use strict";let{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:o,ObjectKeys:s,ObjectSetPrototypeOf:a}=i(8622);t.exports=f;let l=i(7360),u=i(9040);a(f.prototype,l.prototype),a(f,l);{let c=s(u.prototype);for(let d=0;d<c.length;d++){let h=c[d];f.prototype[h]||(f.prototype[h]=u.prototype[h])}}function f(t){if(!(this instanceof f))return new f(t);l.call(this,t),u.call(this,t),t?(this.allowHalfOpen=!1!==t.allowHalfOpen,!1===t.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===t.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let p,g;function b(){return void 0===p&&(p={}),p}n(f.prototype,{writable:{__proto__:null,...o(u.prototype,"writable")},writableHighWaterMark:{__proto__:null,...o(u.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...o(u.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...o(u.prototype,"writableBuffer")},writableLength:{__proto__:null,...o(u.prototype,"writableLength")},writableFinished:{__proto__:null,...o(u.prototype,"writableFinished")},writableCorked:{__proto__:null,...o(u.prototype,"writableCorked")},writableEnded:{__proto__:null,...o(u.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...o(u.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}}),f.fromWeb=function(t,r){return b().newStreamDuplexFromReadableWritablePair(t,r)},f.toWeb=function(t){return b().newReadableWritablePairFromDuplex(t)},f.from=function(t){return g||(g=i(9914)),g(t,"body")}},9914(t,r,i){let n=i(6308),o=i(181),{isReadable:s,isWritable:a,isIterable:l,isNodeStream:u,isReadableNodeStream:c,isWritableNodeStream:d,isDuplexNodeStream:h,isReadableStream:f,isWritableStream:p}=i(3003),g=i(9398),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:y}}=i(7115),{destroyer:$}=i(8816),w=i(722),v=i(7360),_=i(9040),{createDeferredPromise:S}=i(8104),E=i(1868),k=globalThis.Blob||o.Blob,A=void 0!==k?function(t){return t instanceof k}:function(t){return!1},R=globalThis.AbortController||i(1506).z1,{FunctionPrototypeCall:T}=i(8622);class I extends w{constructor(t){super(t),!1===(null==t?void 0:t.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==t?void 0:t.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function C(t){let r=t.readable&&"function"!=typeof t.readable.read?v.wrap(t.readable):t.readable,i=t.writable,n,o,l,u,c,d=!!s(r),h=!!a(i);function f(t){let r=u;u=null,r?r(t):t&&c.destroy(t)}return c=new I({readableObjectMode:!(null==r||!r.readableObjectMode),writableObjectMode:!(null==i||!i.writableObjectMode),readable:d,writable:h}),h&&(g(i,t=>{h=!1,t&&$(r,t),f(t)}),c._write=function(t,r,o){i.write(t,r)?o():n=o},c._final=function(t){i.end(),o=t},i.on("drain",function(){if(n){let t=n;n=null,t()}}),i.on("finish",function(){if(o){let t=o;o=null,t()}})),d&&(g(r,t=>{d=!1,t&&$(r,t),f(t)}),r.on("readable",function(){if(l){let t=l;l=null,t()}}),r.on("end",function(){c.push(null)}),c._read=function(){for(;;){let t=r.read();if(null===t)return void(l=c._read);if(!c.push(t))return}}),c._destroy=function(t,s){t||null===u||(t=new b),l=null,n=null,o=null,null===u?s(t):(u=s,$(i,t),$(r,t))},c}t.exports=function t(r,i){if(h(r))return r;if(c(r))return C({readable:r});if(d(r))return C({writable:r});if(u(r))return C({writable:!1,readable:!1});if(f(r))return C({readable:v.fromWeb(r)});if(p(r))return C({writable:_.fromWeb(r)});if("function"==typeof r){let{value:o,write:s,final:a,destroy:g}=function(t){let{promise:r,resolve:i}=S(),o=new R,s=o.signal;return{value:t(async function*(){for(;;){let t=r;r=null;let{chunk:o,done:a,cb:l}=await t;if(n.nextTick(l),a)return;if(s.aborted)throw new b(void 0,{cause:s.reason});({promise:r,resolve:i}=S()),yield o}}(),{signal:s}),write(t,r,n){let o=i;i=null,o({chunk:t,done:!1,cb:n})},final(t){let r=i;i=null,r({done:!0,cb:t})},destroy(t,r){o.abort(),r(t)}}}(r);if(l(o))return E(I,o,{objectMode:!0,write:s,final:a,destroy:g});let w=null==o?void 0:o.then;if("function"==typeof w){let k,P=T(w,o,t=>{if(null!=t)throw new y("nully","body",t)},t=>{$(k,t)});return k=new I({objectMode:!0,readable:!1,write:s,final(t){a(async()=>{try{await P,n.nextTick(t,null)}catch(r){n.nextTick(t,r)}})},destroy:g})}throw new y("Iterable, AsyncIterable or AsyncFunction",i,o)}if(A(r))return t(r.arrayBuffer());if(l(r))return E(I,r,{objectMode:!0,writable:!1});if(f(null==r?void 0:r.readable)&&p(null==r?void 0:r.writable))return I.fromWeb(r);if("object"==typeof(null==r?void 0:r.writable)||"object"==typeof(null==r?void 0:r.readable))return C({readable:null!=r&&r.readable?c(null==r?void 0:r.readable)?null==r?void 0:r.readable:t(r.readable):void 0,writable:null!=r&&r.writable?d(null==r?void 0:r.writable)?null==r?void 0:r.writable:t(r.writable):void 0});let x=null==r?void 0:r.then;if("function"==typeof x){let M;return T(x,r,t=>{null!=t&&M.push(t),M.push(null)},t=>{$(M,t)}),M=new I({objectMode:!0,writable:!1,read(){}})}throw new m(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],r)}},9398(t,r,i){let n=i(6308),{AbortError:o,codes:s}=i(7115),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:l}=s,{kEmptyObject:u,once:c}=i(8104),{validateAbortSignal:d,validateFunction:h,validateObject:f,validateBoolean:p}=i(6317),{Promise:g,PromisePrototypeThen:b,SymbolDispose:m}=i(8622),{isClosed:y,isReadable:$,isReadableNodeStream:w,isReadableStream:v,isReadableFinished:_,isReadableErrored:S,isWritable:E,isWritableNodeStream:k,isWritableStream:A,isWritableFinished:R,isWritableErrored:T,isNodeStream:I,willEmitClose:C,kIsClosedPromise:P}=i(3003),x,M=()=>{};function O(t,r,s){var p,g,O;if(2===arguments.length?(s=r,r=u):null==r?r=u:f(r,"options"),h(s,"callback"),d(r.signal,"options.signal"),s=c(s),v(t)||A(t))return function(t,r,s){let a=!1,l=M;if(r.signal){if(l=()=>{a=!0,s.call(t,new o(void 0,{cause:r.signal.reason}))},r.signal.aborted)n.nextTick(l);else{x=x||i(8104).addAbortListener;let u=x(r.signal,l),d=s;s=c((...r)=>{u[m](),d.apply(t,r)})}}let h=(...r)=>{a||n.nextTick(()=>s.apply(t,r))};return b(t[P].promise,h,h),M}(t,r,s);if(!I(t))throw new a("stream",["ReadableStream","WritableStream","Stream"],t);let N=null!==(p=r.readable)&&void 0!==p?p:w(t),L=null!==(g=r.writable)&&void 0!==g?g:k(t),D=t._writableState,W=t._readableState,U=()=>{t.writable||j()},B=C(t)&&w(t)===N&&k(t)===L,F=R(t,!1),j=()=>{F=!0,t.destroyed&&(B=!1),B&&(!t.readable||N)||N&&!V||s.call(t)},V=_(t,!1),G=()=>{V=!0,t.destroyed&&(B=!1),B&&(!t.writable||L)||L&&!F||s.call(t)},q=r=>{s.call(t,r)},K=y(t),H=()=>{K=!0;let r=T(t)||S(t);return r&&"boolean"!=typeof r?s.call(t,r):N&&!V&&w(t,!0)&&!_(t,!1)?s.call(t,new l):!L||F||R(t,!1)?void s.call(t):s.call(t,new l)},z=()=>{K=!0;let r=T(t)||S(t);if(r&&"boolean"!=typeof r)return s.call(t,r);s.call(t)},Q=()=>{t.req.on("finish",j)};(O=t).setHeader&&"function"==typeof O.abort?(t.on("complete",j),B||t.on("abort",H),t.req?Q():t.on("request",Q)):L&&!D&&(t.on("end",U),t.on("close",U)),B||"boolean"!=typeof t.aborted||t.on("aborted",H),t.on("end",G),t.on("finish",j),!1!==r.error&&t.on("error",q),t.on("close",H),K?n.nextTick(H):null!=D&&D.errorEmitted||null!=W&&W.errorEmitted?B||n.nextTick(z):(N||B&&!$(t)||!F&&!1!==E(t))&&(L||B&&!E(t)||!V&&!1!==$(t))?W&&t.req&&t.aborted&&n.nextTick(z):n.nextTick(z);let Y=()=>{s=M,t.removeListener("aborted",H),t.removeListener("complete",j),t.removeListener("abort",H),t.removeListener("request",Q),t.req&&t.req.removeListener("finish",j),t.removeListener("end",U),t.removeListener("close",U),t.removeListener("finish",j),t.removeListener("end",G),t.removeListener("error",q),t.removeListener("close",H)};if(r.signal&&!K){let X=()=>{let i=s;Y(),i.call(t,new o(void 0,{cause:r.signal.reason}))};if(r.signal.aborted)n.nextTick(X);else{x=x||i(8104).addAbortListener;let Z=x(r.signal,X),J=s;s=c((...r)=>{Z[m](),J.apply(t,r)})}}return Y}t.exports=O,t.exports.finished=function(t,r){var i;let n=!1;return null===r&&(r=u),null!==(i=r)&&void 0!==i&&i.cleanup&&(p(r.cleanup,"cleanup"),n=r.cleanup),new g((i,o)=>{let s=O(t,r,t=>{n&&s(),t?o(t):i()})})}},1868(t,r,i){"use strict";let n=i(6308),{PromisePrototypeThen:o,SymbolAsyncIterator:s,SymbolIterator:a}=i(8622),{Buffer:l}=i(181),{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:c}=i(7115).codes;t.exports=function(t,r,i){let d,h;if("string"==typeof r||r instanceof l)return new t({objectMode:!0,...i,read(){this.push(r),this.push(null)}});if(r&&r[s])h=!0,d=r[s]();else{if(!r||!r[a])throw new u("iterable",["Iterable"],r);h=!1,d=r[a]()}let f=new t({objectMode:!0,highWaterMark:1,...i}),p=!1;return f._read=function(){p||(p=!0,async function(){for(;;){try{let{value:t,done:r}=h?await d.next():d.next();if(r)f.push(null);else{let i=t&&"function"==typeof t.then?await t:t;if(null===i)throw p=!1,new c;if(f.push(i))continue;p=!1}}catch(n){f.destroy(n)}break}}())},f._destroy=function(t,r){o(async function(t){let r="function"==typeof d.throw;if(null!=t&&r){let{value:i,done:n}=await d.throw(t);if(await i,n)return}if("function"==typeof d.return){let{value:o}=await d.return();await o}}(t),()=>n.nextTick(r,t),i=>n.nextTick(r,i||t))},f}},6795(t,r,i){"use strict";let{ArrayIsArray:n,ObjectSetPrototypeOf:o}=i(8622),{EventEmitter:s}=i(4434);function a(t){s.call(this,t)}function l(t,r,i){if("function"==typeof t.prependListener)return t.prependListener(r,i);t._events&&t._events[r]?n(t._events[r])?t._events[r].unshift(i):t._events[r]=[i,t._events[r]]:t.on(r,i)}o(a.prototype,s.prototype),o(a,s),a.prototype.pipe=function(t,r){let i=this;function n(r){t.writable&&!1===t.write(r)&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}i.on("data",n),t.on("drain",o),t._isStdio||r&&!1===r.end||(i.on("end",u),i.on("close",c));let a=!1;function u(){a||(a=!0,t.end())}function c(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function d(t){h(),0===s.listenerCount(this,"error")&&this.emit("error",t)}function h(){i.removeListener("data",n),t.removeListener("drain",o),i.removeListener("end",u),i.removeListener("close",c),i.removeListener("error",d),t.removeListener("error",d),i.removeListener("end",h),i.removeListener("close",h),t.removeListener("close",h)}return l(i,"error",d),l(t,"error",d),i.on("end",h),i.on("close",h),t.on("close",h),t.emit("pipe",i),t},t.exports={Stream:a,prependListener:l}},5583(t,r,i){"use strict";let n=globalThis.AbortController||i(1506).z1,{codes:{ERR_INVALID_ARG_VALUE:o,ERR_INVALID_ARG_TYPE:s,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:l},AbortError:u}=i(7115),{validateAbortSignal:c,validateInteger:d,validateObject:h}=i(6317),f=i(8622).Symbol("kWeak"),p=i(8622).Symbol("kResistStopPropagation"),{finished:g}=i(9398),b=i(8062),{addAbortSignalNoValidate:m}=i(3483),{isWritable:y,isNodeStream:$}=i(3003),{deprecate:w}=i(8104),{ArrayPrototypePush:v,Boolean:_,MathFloor:S,Number:E,NumberIsNaN:k,Promise:A,PromiseReject:R,PromiseResolve:T,PromisePrototypeThen:I,Symbol:C}=i(8622),P=C("kEmpty"),x=C("kEof");function M(t,r){if("function"!=typeof t)throw new s("fn",["Function","AsyncFunction"],t);null!=r&&h(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let n=1;null!=(null==r?void 0:r.concurrency)&&(n=S(r.concurrency));let o=n-1;return null!=(null==r?void 0:r.highWaterMark)&&(o=S(r.highWaterMark)),d(n,"options.concurrency",1),d(o,"options.highWaterMark",0),o+=n,(async function*(){let s=i(8104).AbortSignalAny([null==r?void 0:r.signal].filter(_)),a=this,l=[],c={signal:s},d,h,f=!1,p=0;function g(){f=!0,b()}function b(){p-=1,m()}function m(){h&&!f&&p<n&&l.length<o&&(h(),h=null)}!async function(){try{for await(let r of a){if(f)return;if(s.aborted)throw new u;try{if((r=t(r,c))===P)continue;r=T(r)}catch(i){r=R(i)}p+=1,I(r,b,g),l.push(r),d&&(d(),d=null),!f&&(l.length>=o||p>=n)&&await new A(t=>{h=t})}l.push(x)}catch(m){let y=R(m);I(y,b,g),l.push(y)}finally{f=!0,d&&(d(),d=null)}}();try{for(;;){for(;l.length>0;){let y=await l[0];if(y===x)return;if(s.aborted)throw new u;y!==P&&(yield y),l.shift(),m()}await new A(t=>{d=t})}}finally{f=!0,h&&(h(),h=null)}}).call(this)}async function O(t,r){for await(let i of N.call(this,t,r))return!0;return!1}function N(t,r){if("function"!=typeof t)throw new s("fn",["Function","AsyncFunction"],t);return M.call(this,async function(r,i){return await t(r,i)?r:P},r)}class L extends a{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function D(t){if(k(t=E(t)))return 0;if(t<0)throw new l("number",">= 0",t);return t}t.exports.streamReturningOperators={asIndexedPairs:w(function(t){return null!=t&&h(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),(async function*(){let r=0;for await(let i of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new u({cause:t.signal.reason});yield[r++,i]}}).call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(t,r){return null!=r&&h(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal"),t=D(t),(async function*(){var i,n;if(null!=r&&null!==(i=r.signal)&&void 0!==i&&i.aborted)throw new u;for await(let o of this){if(null!=r&&null!==(n=r.signal)&&void 0!==n&&n.aborted)throw new u;t--<=0&&(yield o)}}).call(this)},filter:N,flatMap:function(t,r){let i=M.call(this,t,r);return(async function*(){for await(let t of i)yield*t}).call(this)},map:M,take:function(t,r){return null!=r&&h(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal"),t=D(t),(async function*(){var i,n;if(null!=r&&null!==(i=r.signal)&&void 0!==i&&i.aborted)throw new u;for await(let o of this){if(null!=r&&null!==(n=r.signal)&&void 0!==n&&n.aborted)throw new u;if(t-- >0&&(yield o),t<=0)return}}).call(this)},compose:function(t,r){if(null!=r&&h(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal"),$(t)&&!y(t))throw new o("stream",t,"must be writable");let i=b(this,t);return null!=r&&r.signal&&m(r.signal,i),i}},t.exports.promiseReturningOperators={every:async function(t,r){if("function"!=typeof t)throw new s("fn",["Function","AsyncFunction"],t);return!await O.call(this,async(...r)=>!await t(...r),r)},forEach:async function(t,r){if("function"!=typeof t)throw new s("fn",["Function","AsyncFunction"],t);for await(let i of M.call(this,async function(r,i){return await t(r,i),P},r));},reduce:async function(t,r,i){var o,a;if("function"!=typeof t)throw new s("reducer",["Function","AsyncFunction"],t);null!=i&&h(i,"options"),null!=(null==i?void 0:i.signal)&&c(i.signal,"options.signal");let l=arguments.length>1;if(null!=i&&null!==(o=i.signal)&&void 0!==o&&o.aborted){let d=new u(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await g(this.destroy(d)),d}let b=new n,m=b.signal;null!=i&&i.signal&&i.signal.addEventListener("abort",()=>b.abort(),{once:!0,[f]:this,[p]:!0});let y=!1;try{for await(let $ of this){if(y=!0,null!=i&&null!==(a=i.signal)&&void 0!==a&&a.aborted)throw new u;l?r=await t(r,$,{signal:m}):(r=$,l=!0)}if(!y&&!l)throw new L}finally{b.abort()}return r},toArray:async function(t){null!=t&&h(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let r=[];for await(let i of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new u(void 0,{cause:t.signal.reason});v(r,i)}return r},some:O,find:async function(t,r){for await(let i of N.call(this,t,r))return i}}},8676(t,r,i){"use strict";let{ObjectSetPrototypeOf:n}=i(8622);t.exports=s;let o=i(334);function s(t){if(!(this instanceof s))return new s(t);o.call(this,t)}n(s.prototype,o.prototype),n(s,o),s.prototype._transform=function(t,r,i){i(null,t)}},678(t,r,i){let n=i(6308),{ArrayIsArray:o,Promise:s,SymbolAsyncIterator:a,SymbolDispose:l}=i(8622),u=i(9398),{once:c}=i(8104),d=i(8816),h=i(722),{aggregateTwoErrors:f,codes:{ERR_INVALID_ARG_TYPE:p,ERR_INVALID_RETURN_VALUE:g,ERR_MISSING_ARGS:b,ERR_STREAM_DESTROYED:m,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:$}=i(7115),{validateFunction:w,validateAbortSignal:v}=i(6317),{isIterable:_,isReadable:S,isReadableNodeStream:E,isNodeStream:k,isTransformStream:A,isWebStream:R,isReadableStream:T,isReadableFinished:I}=i(3003),C=globalThis.AbortController||i(1506).z1,P,x,M;function O(t,r,i){let n=!1;return t.on("close",()=>{n=!0}),{destroy(r){n||(n=!0,d.destroyer(t,r||new m("pipe")))},cleanup:u(t,{readable:r,writable:i},t=>{n=!t})}}function N(t){if(_(t))return t;if(E(t))return async function*(t){x||(x=i(7360)),yield*x.prototype[a].call(t)}(t);throw new p("val",["Readable","Iterable","AsyncIterable"],t)}async function L(t,r,i,{end:n}){let o,a=null,l=t=>{if(t&&(o=t),a){let r=a;a=null,r()}},c=()=>new s((t,r)=>{o?r(o):a=()=>{o?r(o):t()}});r.on("drain",l);let d=u(r,{readable:!1},l);try{for await(let h of(r.writableNeedDrain&&await c(),t))r.write(h)||await c();n&&(r.end(),await c()),i()}catch(p){i(o!==p?f(o,p):p)}finally{d(),r.off("drain",l)}}async function D(t,r,i,{end:n}){A(r)&&(r=r.writable);let o=r.getWriter();try{for await(let s of t)await o.ready,o.write(s).catch(()=>{});await o.ready,n&&await o.close(),i()}catch(a){try{await o.abort(a),i(a)}catch(l){i(l)}}}function W(t,r,s){if(1===t.length&&o(t[0])&&(t=t[0]),t.length<2)throw new b("streams");let a=new C,u=a.signal,c=null==s?void 0:s.signal,d=[];function f(){F(new $)}let m,y,w;v(c,"options.signal"),M=M||i(8104).addAbortListener,c&&(m=M(c,f));let I=[],x,W=0;function B(t){F(t,0==--W)}function F(t,i){var o;if(!t||y&&"ERR_STREAM_PREMATURE_CLOSE"!==y.code||(y=t),y||i){for(;I.length;)I.shift()(y);null===(o=m)||void 0===o||o[l](),a.abort(),i&&(y||d.forEach(t=>t()),n.nextTick(r,y,w))}}for(let j=0;j<t.length;j++){let V=t[j],G=j<t.length-1,q=j>0,K=G||!1!==(null==s?void 0:s.end),H=j===t.length-1;if(k(V)){if(K){let{destroy:z,cleanup:Q}=O(V,G,q);I.push(z),S(V)&&H&&d.push(Q)}function Y(t){t&&"AbortError"!==t.name&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code&&B(t)}V.on("error",Y),S(V)&&H&&d.push(()=>{V.removeListener("error",Y)})}if(0===j){if("function"==typeof V){if(!_(x=V({signal:u})))throw new g("Iterable, AsyncIterable or Stream","source",x)}else x=_(V)||E(V)||A(V)?V:h.from(V)}else if("function"==typeof V){var X,Z;if(x=A(x)?N(null===(X=x)||void 0===X?void 0:X.readable):N(x),x=V(x,{signal:u}),G){if(!_(x,!0))throw new g("AsyncIterable",`transform[${j-1}]`,x)}else{P||(P=i(8676));let J=new P({objectMode:!0}),ee=null===(Z=x)||void 0===Z?void 0:Z.then;if("function"==typeof ee)W++,ee.call(x,t=>{w=t,null!=t&&J.write(t),K&&J.end(),n.nextTick(B)},t=>{J.destroy(t),n.nextTick(B,t)});else if(_(x,!0))W++,L(x,J,B,{end:K});else{if(!T(x)&&!A(x))throw new g("AsyncIterable or Promise","destination",x);{let et=x.readable||x;W++,L(et,J,B,{end:K})}}x=J;let{destroy:er,cleanup:ei}=O(x,!1,!0);I.push(er),H&&d.push(ei)}}else if(k(V)){if(E(x)){W+=2;let en=U(x,V,B,{end:K});S(V)&&H&&d.push(en)}else if(A(x)||T(x)){let eo=x.readable||x;W++,L(eo,V,B,{end:K})}else{if(!_(x))throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],x);W++,L(x,V,B,{end:K})}x=V}else if(R(V)){if(E(x))W++,D(N(x),V,B,{end:K});else if(T(x)||_(x))W++,D(x,V,B,{end:K});else{if(!A(x))throw new p("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],x);W++,D(x.readable,V,B,{end:K})}x=V}else x=h.from(V)}return(null!=u&&u.aborted||null!=c&&c.aborted)&&n.nextTick(f),x}function U(t,r,i,{end:o}){let s=!1;if(r.on("close",()=>{s||i(new y)}),t.pipe(r,{end:!1}),o){function a(){s=!0,r.end()}I(t)?n.nextTick(a):t.once("end",a)}else i();return u(t,{readable:!0,writable:!1},r=>{let n=t._readableState;r&&"ERR_STREAM_PREMATURE_CLOSE"===r.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?t.once("end",i).once("error",i):i(r)}),u(r,{readable:!1,writable:!0},i)}t.exports={pipelineImpl:W,pipeline:function(...t){var r;return W(t,c((w((r=t)[r.length-1],"streams[stream.length - 1]"),r.pop())))}}},7360(t,r,i){let n=i(6308),{ArrayPrototypeIndexOf:o,NumberIsInteger:s,NumberIsNaN:a,NumberParseInt:l,ObjectDefineProperties:u,ObjectKeys:c,ObjectSetPrototypeOf:d,Promise:h,SafeSet:f,SymbolAsyncDispose:p,SymbolAsyncIterator:g,Symbol:b}=i(8622);t.exports=V,V.ReadableState=j;let{EventEmitter:m}=i(4434),{Stream:y,prependListener:$}=i(6795),{Buffer:w}=i(181),{addAbortSignal:v}=i(3483),_=i(9398),S=i(8104).debuglog("stream",t=>{S=t}),E=i(1793),k=i(8816),{getHighWaterMark:A,getDefaultHighWaterMark:R}=i(8851),{aggregateTwoErrors:T,codes:{ERR_INVALID_ARG_TYPE:I,ERR_METHOD_NOT_IMPLEMENTED:C,ERR_OUT_OF_RANGE:P,ERR_STREAM_PUSH_AFTER_EOF:x,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:M},AbortError:O}=i(7115),{validateObject:N}=i(6317),L=b("kPaused"),{StringDecoder:D}=i(3193),W=i(1868);d(V.prototype,y.prototype),d(V,y);let U=()=>{},{errorOrDestroy:B}=k;function F(t){return{enumerable:!1,get(){return!!(this.state&t)},set(r){r?this.state|=t:this.state&=~t}}}function j(t,r,n){"boolean"!=typeof n&&(n=r instanceof i(722)),this.state=6192,t&&t.objectMode&&(this.state|=1),n&&t&&t.readableObjectMode&&(this.state|=1),this.highWaterMark=t?A(this,t,"readableHighWaterMark",n):R(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this[L]=null,t&&!1===t.emitClose&&(this.state&=-2049),t&&!1===t.autoDestroy&&(this.state&=-4097),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new D(t.encoding),this.encoding=t.encoding)}function V(t){if(!(this instanceof V))return new V(t);let r=this instanceof i(722);this._readableState=new j(t,this,r),t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.construct&&(this._construct=t.construct),t.signal&&!r&&v(t.signal,this)),y.call(this,t),k.construct(this,()=>{this._readableState.needReadable&&Q(this,this._readableState)})}function G(t,r,i,n){S("readableAddChunk",r);let o=t._readableState,s;if(1&o.state||("string"==typeof r?(i=i||o.defaultEncoding,o.encoding!==i&&(n&&o.encoding?r=w.from(r,i).toString(o.encoding):(r=w.from(r,i),i=""))):r instanceof w?i="":y._isUint8Array(r)?(r=y._uint8ArrayToBuffer(r),i=""):null!=r&&(s=new I("chunk",["string","Buffer","Uint8Array"],r))),s)B(t,s);else if(null===r)o.state&=-9,function(t,r){if(S("onEofChunk"),!r.ended){if(r.decoder){let i=r.decoder.end();i&&i.length&&(r.buffer.push(i),r.length+=r.objectMode?1:i.length)}r.ended=!0,r.sync?H(t):(r.needReadable=!1,r.emittedReadable=!0,z(t))}}(t,o);else if(1&o.state||r&&r.length>0){if(n){if(4&o.state)B(t,new M);else{if(o.destroyed||o.errored)return!1;q(t,o,r,!0)}}else if(o.ended)B(t,new x);else{if(o.destroyed||o.errored)return!1;o.state&=-9,o.decoder&&!i?(r=o.decoder.write(r),o.objectMode||0!==r.length?q(t,o,r,!1):Q(t,o)):q(t,o,r,!1)}}else n||(o.state&=-9,Q(t,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function q(t,r,i,n){r.flowing&&0===r.length&&!r.sync&&t.listenerCount("data")>0?(65536&r.state?r.awaitDrainWriters.clear():r.awaitDrainWriters=null,r.dataEmitted=!0,t.emit("data",i)):(r.length+=r.objectMode?1:i.length,n?r.buffer.unshift(i):r.buffer.push(i),64&r.state&&H(t)),Q(t,r)}function K(t,r){return t<=0||0===r.length&&r.ended?0:1&r.state?1:a(t)?r.flowing&&r.length?r.buffer.first().length:r.length:t<=r.length?t:r.ended?r.length:0}function H(t){let r=t._readableState;S("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(S("emitReadable",r.flowing),r.emittedReadable=!0,n.nextTick(z,t))}function z(t){let r=t._readableState;S("emitReadable_",r.destroyed,r.length,r.ended),r.destroyed||r.errored||!r.length&&!r.ended||(t.emit("readable"),r.emittedReadable=!1),r.needReadable=!r.flowing&&!r.ended&&r.length<=r.highWaterMark,ee(t)}function Q(t,r){!r.readingMore&&r.constructed&&(r.readingMore=!0,n.nextTick(Y,t,r))}function Y(t,r){for(;!r.reading&&!r.ended&&(r.length<r.highWaterMark||r.flowing&&0===r.length);){let i=r.length;if(S("maybeReadMore read 0"),t.read(0),i===r.length)break}r.readingMore=!1}function X(t){let r=t._readableState;r.readableListening=t.listenerCount("readable")>0,r.resumeScheduled&&!1===r[L]?r.flowing=!0:t.listenerCount("data")>0?t.resume():r.readableListening||(r.flowing=null)}function Z(t){S("readable nexttick read 0"),t.read(0)}function J(t,r){S("resume",r.reading),r.reading||t.read(0),r.resumeScheduled=!1,t.emit("resume"),ee(t),r.flowing&&!r.reading&&t.read(0)}function ee(t){let r=t._readableState;for(S("flow",r.flowing);r.flowing&&null!==t.read(););}function et(t,r){"function"!=typeof t.read&&(t=V.wrap(t,{objectMode:!0}));let i=async function*(t,r){let i,n=U;function o(r){this===t?(n(),n=U):n=r}t.on("readable",o);let s=_(t,{writable:!1},t=>{i=t?T(i,t):null,n(),n=U});try{for(;;){let a=t.destroyed?null:t.read();if(null!==a)yield a;else{if(i)throw i;if(null===i)return;await new h(o)}}}catch(l){throw i=T(i,l)}finally{(i||!1!==(null==r?void 0:r.destroyOnReturn))&&(void 0===i||t._readableState.autoDestroy)?k.destroyer(t,null):(t.off("readable",o),s())}}(t,r);return i.stream=t,i}function er(t,r){if(0===r.length)return null;let i;return r.objectMode?i=r.buffer.shift():!t||t>=r.length?(i=r.decoder?r.buffer.join(""):1===r.buffer.length?r.buffer.first():r.buffer.concat(r.length),r.buffer.clear()):i=r.buffer.consume(t,r.decoder),i}function ei(t){let r=t._readableState;S("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,n.nextTick(en,r,t))}function en(t,r){if(S("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&0===t.length){if(t.endEmitted=!0,r.emit("end"),r.writable&&!1===r.allowHalfOpen)n.nextTick(eo,r);else if(t.autoDestroy){let i=r._writableState;(!i||i.autoDestroy&&(i.finished||!1===i.writable))&&r.destroy()}}}function eo(t){!t.writable||t.writableEnded||t.destroyed||t.end()}let es;function ea(){return void 0===es&&(es={}),es}u(j.prototype,{objectMode:F(1),ended:F(2),endEmitted:F(4),reading:F(8),constructed:F(16),sync:F(32),needReadable:F(64),emittedReadable:F(128),readableListening:F(256),resumeScheduled:F(512),errorEmitted:F(1024),emitClose:F(2048),autoDestroy:F(4096),destroyed:F(8192),closed:F(16384),closeEmitted:F(32768),multiAwaitDrain:F(65536),readingMore:F(131072),dataEmitted:F(262144)}),V.prototype.destroy=k.destroy,V.prototype._undestroy=k.undestroy,V.prototype._destroy=function(t,r){r(t)},V.prototype[m.captureRejectionSymbol]=function(t){this.destroy(t)},V.prototype[p]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new O,this.destroy(t)),new h((r,i)=>_(this,n=>n&&n!==t?i(n):r(null)))},V.prototype.push=function(t,r){return G(this,t,r,!1)},V.prototype.unshift=function(t,r){return G(this,t,r,!0)},V.prototype.isPaused=function(){let t=this._readableState;return!0===t[L]||!1===t.flowing},V.prototype.setEncoding=function(t){let r=new D(t);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let o of i)n+=r.write(o);return i.clear(),""!==n&&i.push(n),this._readableState.length=n.length,this},V.prototype.read=function(t){S("read",t),void 0===t?t=NaN:s(t)||(t=l(t,10));let r=this._readableState,i=t;if(t>r.highWaterMark&&(r.highWaterMark=function(t){if(t>1073741824)throw new P("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,++t}(t)),0!==t&&(r.state&=-129),0===t&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return S("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?ei(this):H(this),null;if(0===(t=K(t,r))&&r.ended)return 0===r.length&&ei(this),null;let n,o=!!(64&r.state);if(S("need readable",o),(0===r.length||r.length-t<r.highWaterMark)&&S("length less than watermark",o=!0),r.ended||r.reading||r.destroyed||r.errored||!r.constructed)S("reading, ended or constructing",o=!1);else if(o){S("do read"),r.state|=40,0===r.length&&(r.state|=64);try{this._read(r.highWaterMark)}catch(a){B(this,a)}r.state&=-33,r.reading||(t=K(i,r))}return null===(n=t>0?er(t,r):null)?(r.needReadable=r.length<=r.highWaterMark,t=0):(r.length-=t,r.multiAwaitDrain?r.awaitDrainWriters.clear():r.awaitDrainWriters=null),0===r.length&&(r.ended||(r.needReadable=!0),i!==t&&r.ended&&ei(this)),null===n||r.errorEmitted||r.closeEmitted||(r.dataEmitted=!0,this.emit("data",n)),n},V.prototype._read=function(t){throw new C("_read()")},V.prototype.pipe=function(t,r){let i=this,o=this._readableState;1===o.pipes.length&&(o.multiAwaitDrain||(o.multiAwaitDrain=!0,o.awaitDrainWriters=new f(o.awaitDrainWriters?[o.awaitDrainWriters]:[]))),o.pipes.push(t),S("pipe count=%d opts=%j",o.pipes.length,r);let s=r&&!1===r.end||t===n.stdout||t===n.stderr?b:a;function a(){S("onend"),t.end()}let l;o.endEmitted?n.nextTick(s):i.once("end",s),t.on("unpipe",function r(n,s){S("onunpipe"),n===i&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,S("cleanup"),t.removeListener("close",p),t.removeListener("finish",g),l&&t.removeListener("drain",l),t.removeListener("error",h),t.removeListener("unpipe",r),i.removeListener("end",a),i.removeListener("end",b),i.removeListener("data",d),u=!0,l&&o.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l())});let u=!1;function c(){var r,n;u||(1===o.pipes.length&&o.pipes[0]===t?(S("false write response, pause",0),o.awaitDrainWriters=t,o.multiAwaitDrain=!1):o.pipes.length>1&&o.pipes.includes(t)&&(S("false write response, pause",o.awaitDrainWriters.size),o.awaitDrainWriters.add(t)),i.pause()),l||(l=(r=i,n=t,function(){let t=r._readableState;t.awaitDrainWriters===n?(S("pipeOnDrain",1),t.awaitDrainWriters=null):t.multiAwaitDrain&&(S("pipeOnDrain",t.awaitDrainWriters.size),t.awaitDrainWriters.delete(n)),t.awaitDrainWriters&&0!==t.awaitDrainWriters.size||!r.listenerCount("data")||r.resume()}),t.on("drain",l))}function d(r){S("ondata");let i=t.write(r);S("dest.write",i),!1===i&&c()}function h(r){if(S("onerror",r),b(),t.removeListener("error",h),0===t.listenerCount("error")){let i=t._writableState||t._readableState;i&&!i.errorEmitted?B(t,r):t.emit("error",r)}}function p(){t.removeListener("finish",g),b()}function g(){S("onfinish"),t.removeListener("close",p),b()}function b(){S("unpipe"),i.unpipe(t)}return i.on("data",d),$(t,"error",h),t.once("close",p),t.once("finish",g),t.emit("pipe",i),!0===t.writableNeedDrain?c():o.flowing||(S("pipe resume"),i.resume()),t},V.prototype.unpipe=function(t){let r=this._readableState;if(0===r.pipes.length)return this;if(!t){let i=r.pipes;r.pipes=[],this.pause();for(let n=0;n<i.length;n++)i[n].emit("unpipe",this,{hasUnpiped:!1});return this}let s=o(r.pipes,t);return -1===s||(r.pipes.splice(s,1),0===r.pipes.length&&this.pause(),t.emit("unpipe",this,{hasUnpiped:!1})),this},V.prototype.on=function(t,r){let i=y.prototype.on.call(this,t,r),o=this._readableState;return"data"===t?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===t&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,S("on readable",o.length,o.reading),o.length?H(this):o.reading||n.nextTick(Z,this))),i},V.prototype.addListener=V.prototype.on,V.prototype.removeListener=function(t,r){let i=y.prototype.removeListener.call(this,t,r);return"readable"===t&&n.nextTick(X,this),i},V.prototype.off=V.prototype.removeListener,V.prototype.removeAllListeners=function(t){let r=y.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||n.nextTick(X,this),r},V.prototype.resume=function(){var t,r;let i=this._readableState;return i.flowing||(S("resume"),i.flowing=!i.readableListening,t=this,(r=i).resumeScheduled||(r.resumeScheduled=!0,n.nextTick(J,t,r))),i[L]=!1,this},V.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[L]=!0,this},V.prototype.wrap=function(t){let r=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(r=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",t=>{B(this,t)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{r&&t.resume&&(r=!1,t.resume())};let i=c(t);for(let n=1;n<i.length;n++){let o=i[n];void 0===this[o]&&"function"==typeof t[o]&&(this[o]=t[o].bind(t))}return this},V.prototype[g]=function(){return et(this)},V.prototype.iterator=function(t){return void 0!==t&&N(t,"options"),et(this,t)},u(V.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!(!t||!1===t.readable||t.destroyed||t.errorEmitted||t.endEmitted)},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),u(j.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[L]},set(t){this[L]=!!t}}}),V._fromList=er,V.from=function(t,r){return W(V,t,r)},V.fromWeb=function(t,r){return ea().newStreamReadableFromReadableStream(t,r)},V.toWeb=function(t,r){return ea().newReadableStreamFromStreamReadable(t,r)},V.wrap=function(t,r){var i,n;return new V({objectMode:null===(i=null!==(n=t.readableObjectMode)&&void 0!==n?n:t.objectMode)||void 0===i||i,...r,destroy(r,i){k.destroyer(t,r),i(r)}}).wrap(t)}},8851(t,r,i){"use strict";let{MathFloor:n,NumberIsInteger:o}=i(8622),{validateInteger:s}=i(6317),{ERR_INVALID_ARG_VALUE:a}=i(7115).codes,l=16384,u=16;function c(t){return t?u:l}t.exports={getHighWaterMark:function(t,r,i,s){var l,u,d;let h=(l=r,u=s,d=i,null!=l.highWaterMark?l.highWaterMark:u?l[d]:null);if(null!=h){if(!o(h)||h<0)throw new a(s?`options.${i}`:"options.highWaterMark",h);return n(h)}return c(t.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(t,r){s(r,"value",0),t?u=r:l=r}}},334(t,r,i){"use strict";let{ObjectSetPrototypeOf:n,Symbol:o}=i(8622);t.exports=c;let{ERR_METHOD_NOT_IMPLEMENTED:s}=i(7115).codes,a=i(722),{getHighWaterMark:l}=i(8851);n(c.prototype,a.prototype),n(c,a);let u=o("kCallback");function c(t){if(!(this instanceof c))return new c(t);let r=t?l(this,t,"readableHighWaterMark",!0):null;0===r&&(t={...t,highWaterMark:null,readableHighWaterMark:r,writableHighWaterMark:t.writableHighWaterMark||0}),a.call(this,t),this._readableState.sync=!1,this[u]=null,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function d(t){"function"!=typeof this._flush||this.destroyed?(this.push(null),t&&t()):this._flush((r,i)=>{r?t?t(r):this.destroy(r):(null!=i&&this.push(i),this.push(null),t&&t())})}function h(){this._final!==d&&d.call(this)}c.prototype._final=d,c.prototype._transform=function(t,r,i){throw new s("_transform()")},c.prototype._write=function(t,r,i){let n=this._readableState,o=this._writableState,s=n.length;this._transform(t,r,(t,r)=>{t?i(t):(null!=r&&this.push(r),o.ended||s===n.length||n.length<n.highWaterMark?i():this[u]=i)})},c.prototype._read=function(){if(this[u]){let t=this[u];this[u]=null,t()}}},3003(t,r,i){"use strict";let{SymbolAsyncIterator:n,SymbolIterator:o,SymbolFor:s}=i(8622),a=s("nodejs.stream.destroyed"),l=s("nodejs.stream.errored"),u=s("nodejs.stream.readable"),c=s("nodejs.stream.writable"),d=s("nodejs.stream.disturbed"),h=s("nodejs.webstream.isClosedPromise"),f=s("nodejs.webstream.controllerErrorFunction");function p(t,r=!1){var i;return!(!t||"function"!=typeof t.pipe||"function"!=typeof t.on||r&&("function"!=typeof t.pause||"function"!=typeof t.resume)||t._writableState&&!1===(null===(i=t._readableState)||void 0===i?void 0:i.readable)||t._writableState&&!t._readableState)}function g(t){var r;return!(!t||"function"!=typeof t.write||"function"!=typeof t.on||t._readableState&&!1===(null===(r=t._writableState)||void 0===r?void 0:r.writable))}function b(t){return t&&(t._readableState||t._writableState||"function"==typeof t.write&&"function"==typeof t.on||"function"==typeof t.pipe&&"function"==typeof t.on)}function m(t){return!(!t||b(t)||"function"!=typeof t.pipeThrough||"function"!=typeof t.getReader||"function"!=typeof t.cancel)}function y(t){return!(!t||b(t)||"function"!=typeof t.getWriter||"function"!=typeof t.abort)}function $(t){return!(!t||b(t)||"object"!=typeof t.readable||"object"!=typeof t.writable)}function w(t){if(!b(t))return null;let r=t._writableState,i=t._readableState,n=r||i;return!!(t.destroyed||t[a]||null!=n&&n.destroyed)}function v(t){if(!g(t))return null;if(!0===t.writableEnded)return!0;let r=t._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.ended)?null:r.ended)}function _(t,r){if(!p(t))return null;let i=t._readableState;return(null==i||!i.errored)&&("boolean"!=typeof(null==i?void 0:i.endEmitted)?null:!!(i.endEmitted||!1===r&&!0===i.ended&&0===i.length))}function S(t){return t&&null!=t[u]?t[u]:"boolean"!=typeof(null==t?void 0:t.readable)?null:!w(t)&&p(t)&&t.readable&&!_(t)}function E(t){return t&&null!=t[c]?t[c]:"boolean"!=typeof(null==t?void 0:t.writable)?null:!w(t)&&g(t)&&t.writable&&!v(t)}function k(t){return"boolean"==typeof t._closed&&"boolean"==typeof t._defaultKeepAlive&&"boolean"==typeof t._removedConnection&&"boolean"==typeof t._removedContLen}function A(t){return"boolean"==typeof t._sent100&&k(t)}t.exports={isDestroyed:w,kIsDestroyed:a,isDisturbed:function(t){var r;return!(!t||!(null!==(r=t[d])&&void 0!==r?r:t.readableDidRead||t.readableAborted))},kIsDisturbed:d,isErrored:function(t){var r,i,n,o,s,a,u,c,d,h;return!(!t||!(null!==(r=null!==(i=null!==(n=null!==(o=null!==(s=null!==(a=t[l])&&void 0!==a?a:t.readableErrored)&&void 0!==s?s:t.writableErrored)&&void 0!==o?o:null===(u=t._readableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==n?n:null===(c=t._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==i?i:null===(d=t._readableState)||void 0===d?void 0:d.errored)&&void 0!==r?r:null===(h=t._writableState)||void 0===h?void 0:h.errored))},kIsErrored:l,isReadable:S,kIsReadable:u,kIsClosedPromise:h,kControllerErrorFunction:f,kIsWritable:c,isClosed:function(t){if(!b(t))return null;if("boolean"==typeof t.closed)return t.closed;let r=t._writableState,i=t._readableState;return"boolean"==typeof(null==r?void 0:r.closed)||"boolean"==typeof(null==i?void 0:i.closed)?(null==r?void 0:r.closed)||(null==i?void 0:i.closed):"boolean"==typeof t._closed&&k(t)?t._closed:null},isDuplexNodeStream:function(t){return!(!t||"function"!=typeof t.pipe||!t._readableState||"function"!=typeof t.on||"function"!=typeof t.write)},isFinished:function(t,r){return b(t)?!(!w(t)&&(!1!==(null==r?void 0:r.readable)&&S(t)||!1!==(null==r?void 0:r.writable)&&E(t))):null},isIterable:function(t,r){return null!=t&&(!0===r?"function"==typeof t[n]:!1===r?"function"==typeof t[o]:"function"==typeof t[n]||"function"==typeof t[o])},isReadableNodeStream:p,isReadableStream:m,isReadableEnded:function(t){if(!p(t))return null;if(!0===t.readableEnded)return!0;let r=t._readableState;return!(!r||r.errored)&&("boolean"!=typeof(null==r?void 0:r.ended)?null:r.ended)},isReadableFinished:_,isReadableErrored:function(t){var r,i;return b(t)?t.readableErrored?t.readableErrored:null!==(r=null===(i=t._readableState)||void 0===i?void 0:i.errored)&&void 0!==r?r:null:null},isNodeStream:b,isWebStream:function(t){return m(t)||y(t)||$(t)},isWritable:E,isWritableNodeStream:g,isWritableStream:y,isWritableEnded:v,isWritableFinished:function(t,r){if(!g(t))return null;if(!0===t.writableFinished)return!0;let i=t._writableState;return(null==i||!i.errored)&&("boolean"!=typeof(null==i?void 0:i.finished)?null:!!(i.finished||!1===r&&!0===i.ended&&0===i.length))},isWritableErrored:function(t){var r,i;return b(t)?t.writableErrored?t.writableErrored:null!==(r=null===(i=t._writableState)||void 0===i?void 0:i.errored)&&void 0!==r?r:null:null},isServerRequest:function(t){var r;return"boolean"==typeof t._consuming&&"boolean"==typeof t._dumped&&void 0===(null===(r=t.req)||void 0===r?void 0:r.upgradeOrConnect)},isServerResponse:A,willEmitClose:function(t){if(!b(t))return null;let r=t._writableState,i=t._readableState,n=r||i;return!n&&A(t)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:$}},9040(t,r,i){let n=i(6308),{ArrayPrototypeSlice:o,Error:s,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:l,ObjectDefineProperties:u,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:d,Symbol:h,SymbolHasInstance:f}=i(8622);t.exports=N,N.WritableState=M;let{EventEmitter:p}=i(4434),g=i(6795).Stream,{Buffer:b}=i(181),m=i(8816),{addAbortSignal:y}=i(3483),{getHighWaterMark:$,getDefaultHighWaterMark:w}=i(8851),{ERR_INVALID_ARG_TYPE:v,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:k,ERR_STREAM_ALREADY_FINISHED:A,ERR_STREAM_NULL_VALUES:R,ERR_STREAM_WRITE_AFTER_END:T,ERR_UNKNOWN_ENCODING:I}=i(7115).codes,{errorOrDestroy:C}=m;function P(){}c(N.prototype,g.prototype),c(N,g);let x=h("kOnFinished");function M(t,r,n){"boolean"!=typeof n&&(n=r instanceof i(722)),this.objectMode=!(!t||!t.objectMode),n&&(this.objectMode=this.objectMode||!(!t||!t.writableObjectMode)),this.highWaterMark=t?$(this,t,"writableHighWaterMark",n):w(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let o=!(!t||!1!==t.decodeStrings);this.decodeStrings=!o,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=U.bind(void 0,r),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,O(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||!1!==t.emitClose,this.autoDestroy=!t||!1!==t.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[x]=[]}function O(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}function N(t){let r=this instanceof i(722);if(!r&&!a(N,this))return new N(t);this._writableState=new M(t,this,r),t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final),"function"==typeof t.construct&&(this._construct=t.construct),t.signal&&y(t.signal,this)),g.call(this,t),m.construct(this,()=>{let t=this._writableState;t.writing||V(this,t),q(this,t)})}function L(t,r,i,o){let s=t._writableState;if("function"==typeof i)o=i,i=s.defaultEncoding;else{if(i){if("buffer"!==i&&!b.isEncoding(i))throw new I(i)}else i=s.defaultEncoding;"function"!=typeof o&&(o=P)}if(null===r)throw new R;if(!s.objectMode){if("string"==typeof r)!1!==s.decodeStrings&&(r=b.from(r,i),i="buffer");else if(r instanceof b)i="buffer";else{if(!g._isUint8Array(r))throw new v("chunk",["string","Buffer","Uint8Array"],r);r=g._uint8ArrayToBuffer(r),i="buffer"}}let a;return s.ending?a=new T:s.destroyed&&(a=new k("write")),a?(n.nextTick(o,a),C(t,a,!0),a):(s.pendingcb++,function(t,r,i,n,o){let s=r.objectMode?1:i.length;r.length+=s;let a=r.length<r.highWaterMark;return a||(r.needDrain=!0),r.writing||r.corked||r.errored||!r.constructed?(r.buffered.push({chunk:i,encoding:n,callback:o}),r.allBuffers&&"buffer"!==n&&(r.allBuffers=!1),r.allNoop&&o!==P&&(r.allNoop=!1)):(r.writelen=s,r.writecb=o,r.writing=!0,r.sync=!0,t._write(i,n,r.onwrite),r.sync=!1),a&&!r.errored&&!r.destroyed}(t,s,r,i,o))}function D(t,r,i,n,o,s,a){r.writelen=n,r.writecb=a,r.writing=!0,r.sync=!0,r.destroyed?r.onwrite(new k("write")):i?t._writev(o,r.onwrite):t._write(o,s,r.onwrite),r.sync=!1}function W(t,r,i,n){--r.pendingcb,n(i),j(r),C(t,i)}function U(t,r){let i=t._writableState,o=i.sync,s=i.writecb;"function"==typeof s?(i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,r?(r.stack,i.errored||(i.errored=r),t._readableState&&!t._readableState.errored&&(t._readableState.errored=r),o?n.nextTick(W,t,i,r,s):W(t,i,r,s)):(i.buffered.length>i.bufferedIndex&&V(t,i),o?null!==i.afterWriteTickInfo&&i.afterWriteTickInfo.cb===s?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:s,stream:t,state:i},n.nextTick(B,i.afterWriteTickInfo)):F(t,i,1,s))):C(t,new S)}function B({stream:t,state:r,count:i,cb:n}){return r.afterWriteTickInfo=null,F(t,r,i,n)}function F(t,r,i,n){for(r.ending||t.destroyed||0!==r.length||!r.needDrain||(r.needDrain=!1,t.emit("drain"));i-- >0;)r.pendingcb--,n();r.destroyed&&j(r),q(t,r)}function j(t){var r,i;if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){let{chunk:o,callback:s}=t.buffered[n],a=t.objectMode?1:o.length;t.length-=a,s(null!==(r=t.errored)&&void 0!==r?r:new k("write"))}let l=t[x].splice(0);for(let u=0;u<l.length;u++)l[u](null!==(i=t.errored)&&void 0!==i?i:new k("end"));O(t)}function V(t,r){if(r.corked||r.bufferProcessing||r.destroyed||!r.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:s}=r,a=i.length-n;if(!a)return;let l=n;if(r.bufferProcessing=!0,a>1&&t._writev){r.pendingcb-=a-1;let u=r.allNoop?P:t=>{for(let r=l;r<i.length;++r)i[r].callback(t)},c=r.allNoop&&0===l?i:o(i,l);c.allBuffers=r.allBuffers,D(t,r,!0,r.length,c,"",u),O(r)}else{do{let{chunk:d,encoding:h,callback:f}=i[l];i[l++]=null,D(t,r,!1,s?1:d.length,d,h,f)}while(l<i.length&&!r.writing);l===i.length?O(r):l>256?(i.splice(0,l),r.bufferedIndex=0):r.bufferedIndex=l}r.bufferProcessing=!1}function G(t){return t.ending&&!t.destroyed&&t.constructed&&0===t.length&&!t.errored&&0===t.buffered.length&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function q(t,r,i){var o,s;G(r)&&(o=t,(s=r).prefinished||s.finalCalled||("function"!=typeof o._final||s.destroyed?(s.prefinished=!0,o.emit("prefinish")):(s.finalCalled=!0,function(t,r){let i=!1;function o(o){if(i)C(t,null!=o?o:S());else if(i=!0,r.pendingcb--,o){let s=r[x].splice(0);for(let a=0;a<s.length;a++)s[a](o);C(t,o,r.sync)}else G(r)&&(r.prefinished=!0,t.emit("prefinish"),r.pendingcb++,n.nextTick(K,t,r))}r.sync=!0,r.pendingcb++;try{t._final(o)}catch(s){o(s)}r.sync=!1}(o,s))),0===r.pendingcb&&(i?(r.pendingcb++,n.nextTick((t,r)=>{G(r)?K(t,r):r.pendingcb--},t,r)):G(r)&&(r.pendingcb++,K(t,r))))}function K(t,r){r.pendingcb--,r.finished=!0;let i=r[x].splice(0);for(let n=0;n<i.length;n++)i[n]();if(t.emit("finish"),r.autoDestroy){let o=t._readableState;(!o||o.autoDestroy&&(o.endEmitted||!1===o.readable))&&t.destroy()}}M.prototype.getBuffer=function(){return o(this.buffered,this.bufferedIndex)},l(M.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),l(N,f,{__proto__:null,value:function(t){return!!a(this,t)||this===N&&t&&t._writableState instanceof M}}),N.prototype.pipe=function(){C(this,new E)},N.prototype.write=function(t,r,i){return!0===L(this,t,r,i)},N.prototype.cork=function(){this._writableState.corked++},N.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||V(this,t))},N.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=d(t)),!b.isEncoding(t))throw new I(t);return this._writableState.defaultEncoding=t,this},N.prototype._write=function(t,r,i){if(!this._writev)throw new _("_write()");this._writev([{chunk:t,encoding:r}],i)},N.prototype._writev=null,N.prototype.end=function(t,r,i){let o=this._writableState,a;if("function"==typeof t?(i=t,t=null,r=null):"function"==typeof r&&(i=r,r=null),null!=t){let l=L(this,t,r);l instanceof s&&(a=l)}return o.corked&&(o.corked=1,this.uncork()),a||(o.errored||o.ending?o.finished?a=new A("end"):o.destroyed&&(a=new k("end")):(o.ending=!0,q(this,o,!0),o.ended=!0)),"function"==typeof i&&(a||o.finished?n.nextTick(i,a):o[x].push(i)),this},u(N.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!(!t||!1===t.writable||t.destroyed||t.errored||t.ending||t.ended)},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return!!t&&!t.destroyed&&!t.ending&&t.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});let H=m.destroy,z;function Q(){return void 0===z&&(z={}),z}N.prototype.destroy=function(t,r){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[x].length)&&n.nextTick(j,i),H.call(this,t,r),this},N.prototype._undestroy=m.undestroy,N.prototype._destroy=function(t,r){r(t)},N.prototype[p.captureRejectionSymbol]=function(t){this.destroy(t)},N.fromWeb=function(t,r){return Q().newStreamWritableFromWritableStream(t,r)},N.toWeb=function(t){return Q().newWritableStreamFromStreamWritable(t)}},6317(t,r,i){"use strict";let{ArrayIsArray:n,ArrayPrototypeIncludes:o,ArrayPrototypeJoin:s,ArrayPrototypeMap:a,NumberIsInteger:l,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:d,NumberParseInt:h,ObjectPrototypeHasOwnProperty:f,RegExpPrototypeExec:p,String:g,StringPrototypeToUpperCase:b,StringPrototypeTrim:m}=i(8622),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:$,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:v,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:S}}=i(7115),{normalizeEncoding:E}=i(8104),{isAsyncFunction:k,isArrayBufferView:A}=i(8104).types,R={},T=/^[0-7]+$/,I=y((t,r,i=d,n=c)=>{if("number"!=typeof t)throw new w(r,"number",t);if(!l(t))throw new _(r,"an integer",t);if(t<i||t>n)throw new _(r,`>= ${i} && <= ${n}`,t)}),C=y((t,r,i=-2147483648,n=2147483647)=>{if("number"!=typeof t)throw new w(r,"number",t);if(!l(t))throw new _(r,"an integer",t);if(t<i||t>n)throw new _(r,`>= ${i} && <= ${n}`,t)}),P=y((t,r,i=!1)=>{if("number"!=typeof t)throw new w(r,"number",t);if(!l(t))throw new _(r,"an integer",t);let n=i?1:0;if(t<n||t>4294967295)throw new _(r,`>= ${n} && <= 4294967295`,t)});function x(t,r){if("string"!=typeof t)throw new w(r,"string",t)}let M=y((t,r,i)=>{if(!o(i,t)){let n=s(a(i,t=>"string"==typeof t?`'${t}'`:g(t)),", ");throw new v(r,t,"must be one of: "+n)}});function O(t,r){if("boolean"!=typeof t)throw new w(r,"boolean",t)}function N(t,r,i){return null!=t&&f(t,r)?t[r]:i}let L=y((t,r,i=null)=>{let o=N(i,"allowArray",!1),s=N(i,"allowFunction",!1);if(!N(i,"nullable",!1)&&null===t||!o&&n(t)||"object"!=typeof t&&(!s||"function"!=typeof t))throw new w(r,"Object",t)}),D=y((t,r)=>{if(null!=t&&"object"!=typeof t&&"function"!=typeof t)throw new w(r,"a dictionary",t)}),W=y((t,r,i=0)=>{if(!n(t))throw new w(r,"Array",t);if(t.length<i)throw new v(r,t,`must be longer than ${i}`)}),U=y((t,r="buffer")=>{if(!A(t))throw new w(r,["Buffer","TypedArray","DataView"],t)}),B=y((t,r)=>{if(void 0!==t&&(null===t||"object"!=typeof t||!("aborted"in t)))throw new w(r,"AbortSignal",t)}),F=y((t,r)=>{if("function"!=typeof t)throw new w(r,"Function",t)}),j=y((t,r)=>{if("function"!=typeof t||k(t))throw new w(r,"Function",t)}),V=y((t,r)=>{if(void 0!==t)throw new w(r,"undefined",t)}),G=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function q(t,r){if(void 0===t||!p(G,t))throw new v(r,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:function(t){return t===(0|t)},isUint32:function(t){return t===t>>>0},parseFileMode:function(t,r,i){if(void 0===t&&(t=i),"string"==typeof t){if(null===p(T,t))throw new v(r,t,"must be a 32-bit unsigned integer or an octal string");t=h(t,8)}return P(t,r),t},validateArray:W,validateStringArray:function(t,r){W(t,r);for(let i=0;i<t.length;i++)x(t[i],`${r}[${i}]`)},validateBooleanArray:function(t,r){W(t,r);for(let i=0;i<t.length;i++)O(t[i],`${r}[${i}]`)},validateAbortSignalArray:function(t,r){W(t,r);for(let i=0;i<t.length;i++){let n=t[i],o=`${r}[${i}]`;if(null==n)throw new w(o,"AbortSignal",n);B(n,o)}},validateBoolean:O,validateBuffer:U,validateDictionary:D,validateEncoding:function(t,r){let i=E(r),n=t.length;if("hex"===i&&n%2!=0)throw new v("encoding",r,`is invalid for data of length ${n}`)},validateFunction:F,validateInt32:C,validateInteger:I,validateNumber:function(t,r,i,n){if("number"!=typeof t)throw new w(r,"number",t);if(null!=i&&t<i||null!=n&&t>n||(null!=i||null!=n)&&u(t))throw new _(r,`${null!=i?`>= ${i}`:""}${null!=i&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,t)},validateObject:L,validateOneOf:M,validatePlainFunction:j,validatePort:function(t,r="Port",i=!0){if("number"!=typeof t&&"string"!=typeof t||"string"==typeof t&&0===m(t).length||+t!=+t>>>0||t>65535||0===t&&!i)throw new $(r,t,i);return 0|t},validateSignalName:function(t,r="signal"){if(x(t,r),void 0===R[t]){if(void 0!==R[b(t)])throw new S(t+" (signals must use all capital letters)");throw new S(t)}},validateString:x,validateUint32:P,validateUndefined:V,validateUnion:function(t,r,i){if(!o(i,t))throw new w(r,`('${s(i,"|")}')`,t)},validateAbortSignal:B,validateLinkHeaderValue:function(t){if("string"==typeof t)return q(t,"hints"),t;if(n(t)){let r=t.length,i="";if(0===r)return i;for(let o=0;o<r;o++){let s=t[o];q(s,"hints"),i+=s,o!==r-1&&(i+=", ")}return i}throw new v("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},7115(t,r,i){"use strict";let{format:n,inspect:o,AggregateError:s}=i(8104),a=globalThis.AggregateError||s,l=Symbol("kIsNodeError"),u=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,d={};function h(t,r){if(!t)throw new d.ERR_INTERNAL_ASSERTION(r)}function f(t){let r="",i=t.length,n="-"===t[0]?1:0;for(;i>=n+4;i-=3)r=`_${t.slice(i-3,i)}${r}`;return`${t.slice(0,i)}${r}`}function p(t,r,i){i||(i=Error);class o extends i{constructor(...i){super(function(t,r,i){if("function"==typeof r)return h(r.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${r.length}).`),r(...i);let o=(r.match(/%[dfijoOs]/g)||[]).length;return h(o===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${o}).`),0===i.length?r:n(r,...i)}(t,r,i))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=t,o.prototype[l]=!0,d[t]=o}function g(t){let r="__node_internal_"+t.name;return Object.defineProperty(t,"name",{value:r}),t}p("ERR_ASSERTION","%s",Error),p("ERR_INVALID_ARG_TYPE",(t,r,i)=>{h("string"==typeof t,"'name' must be a string"),Array.isArray(r)||(r=[r]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let s=[],a=[],l=[];for(let d of r)h("string"==typeof d,"All expected entries have to be of type string"),u.includes(d)?s.push(d.toLowerCase()):c.test(d)?a.push(d):(h("object"!==d,'The value "object" should be written as "Object"'),l.push(d));if(a.length>0){let f=s.indexOf("object");-1!==f&&(s.splice(s,f,1),a.push("Object"))}if(s.length>0){switch(s.length){case 1:n+=`of type ${s[0]}`;break;case 2:n+=`one of type ${s[0]} or ${s[1]}`;break;default:{let p=s.pop();n+=`one of type ${s.join(", ")}, or ${p}`}}(a.length>0||l.length>0)&&(n+=" or ")}if(a.length>0){switch(a.length){case 1:n+=`an instance of ${a[0]}`;break;case 2:n+=`an instance of ${a[0]} or ${a[1]}`;break;default:{let g=a.pop();n+=`an instance of ${a.join(", ")}, or ${g}`}}l.length>0&&(n+=" or ")}switch(l.length){case 0:break;case 1:l[0].toLowerCase()!==l[0]&&(n+="an "),n+=`${l[0]}`;break;case 2:n+=`one of ${l[0]} or ${l[1]}`;break;default:{let b=l.pop();n+=`one of ${l.join(", ")}, or ${b}`}}if(null==i)n+=`. Received ${i}`;else if("function"==typeof i&&i.name)n+=`. Received function ${i.name}`;else if("object"==typeof i){var m;null!==(m=i.constructor)&&void 0!==m&&m.name?n+=`. Received an instance of ${i.constructor.name}`:n+=`. Received ${o(i,{depth:-1})}`}else{let y=o(i,{colors:!1});y.length>25&&(y=`${y.slice(0,25)}...`),n+=`. Received type ${typeof i} (${y})`}return n},TypeError),p("ERR_INVALID_ARG_VALUE",(t,r,i="is invalid")=>{let n=o(r);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${n}`},TypeError),p("ERR_INVALID_RETURN_VALUE",(t,r,i)=>{var n;return`Expected ${t} to be returned from the "${r}" function but got ${null!=i&&null!==(n=i.constructor)&&void 0!==n&&n.name?`instance of ${i.constructor.name}`:"type "+typeof i}.`},TypeError),p("ERR_MISSING_ARGS",(...t)=>{let r;h(t.length>0,"At least one arg needs to be specified");let i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(t=>`"${t}"`).join(" or "),i){case 1:r+=`The ${t[0]} argument`;break;case 2:r+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();r+=`The ${t.join(", ")}, and ${n} arguments`}}return`${r} must be specified`},TypeError),p("ERR_OUT_OF_RANGE",(t,r,i)=>{let n;return h(r,'Missing "range" argument'),Number.isInteger(i)&&Math.abs(i)>4294967296?n=f(String(i)):"bigint"==typeof i?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=f(n)),n+="n"):n=o(i),`The value of "${t}" is out of range. It must be ${r}. Received ${n}`},RangeError),p("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),p("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),p("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),p("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),p("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),p("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),p("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),p("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),p("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),p("ERR_STREAM_WRITE_AFTER_END","write after end",Error),p("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:class t extends Error{constructor(t="The operation was aborted",r){if(void 0!==r&&"object"!=typeof r)throw new d.ERR_INVALID_ARG_TYPE("options","Object",r);super(t,r),this.code="ABORT_ERR",this.name="AbortError"}},aggregateTwoErrors:g(function(t,r){if(t&&r&&t!==r){if(Array.isArray(r.errors))return r.errors.push(t),r;let i=new a([r,t],r.message);return i.code=r.code,i}return t||r}),hideStackFrames:g,codes:d}},6070(t,r,i){"use strict";let n=i(2203);if(n&&"disable"===process.env.READABLE_STREAM){let o=n.promises;t.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,t.exports._isUint8Array=n._isUint8Array,t.exports.isDisturbed=n.isDisturbed,t.exports.isErrored=n.isErrored,t.exports.isReadable=n.isReadable,t.exports.Readable=n.Readable,t.exports.Writable=n.Writable,t.exports.Duplex=n.Duplex,t.exports.Transform=n.Transform,t.exports.PassThrough=n.PassThrough,t.exports.addAbortSignal=n.addAbortSignal,t.exports.finished=n.finished,t.exports.destroy=n.destroy,t.exports.pipeline=n.pipeline,t.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>o}),t.exports.Stream=n.Stream}else{let s=i(7370),a=i(5903),l=s.Readable.destroy;t.exports=s.Readable,t.exports._uint8ArrayToBuffer=s._uint8ArrayToBuffer,t.exports._isUint8Array=s._isUint8Array,t.exports.isDisturbed=s.isDisturbed,t.exports.isErrored=s.isErrored,t.exports.isReadable=s.isReadable,t.exports.Readable=s.Readable,t.exports.Writable=s.Writable,t.exports.Duplex=s.Duplex,t.exports.Transform=s.Transform,t.exports.PassThrough=s.PassThrough,t.exports.addAbortSignal=s.addAbortSignal,t.exports.finished=s.finished,t.exports.destroy=s.destroy,t.exports.destroy=l,t.exports.pipeline=s.pipeline,t.exports.compose=s.compose,Object.defineProperty(s,"promises",{configurable:!0,enumerable:!0,get:()=>a}),t.exports.Stream=s.Stream}t.exports.default=t.exports},8622(t){"use strict";t.exports={ArrayIsArray:t=>Array.isArray(t),ArrayPrototypeIncludes:(t,r)=>t.includes(r),ArrayPrototypeIndexOf:(t,r)=>t.indexOf(r),ArrayPrototypeJoin:(t,r)=>t.join(r),ArrayPrototypeMap:(t,r)=>t.map(r),ArrayPrototypePop:(t,r)=>t.pop(r),ArrayPrototypePush:(t,r)=>t.push(r),ArrayPrototypeSlice:(t,r,i)=>t.slice(r,i),Error,FunctionPrototypeCall:(t,r,...i)=>t.call(r,...i),FunctionPrototypeSymbolHasInstance:(t,r)=>Function.prototype[Symbol.hasInstance].call(t,r),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(t,r)=>Object.defineProperties(t,r),ObjectDefineProperty:(t,r,i)=>Object.defineProperty(t,r,i),ObjectGetOwnPropertyDescriptor:(t,r)=>Object.getOwnPropertyDescriptor(t,r),ObjectKeys:t=>Object.keys(t),ObjectSetPrototypeOf:(t,r)=>Object.setPrototypeOf(t,r),Promise,PromisePrototypeCatch:(t,r)=>t.catch(r),PromisePrototypeThen:(t,r,i)=>t.then(r,i),PromiseReject:t=>Promise.reject(t),PromiseResolve:t=>Promise.resolve(t),ReflectApply:Reflect.apply,RegExpPrototypeTest:(t,r)=>t.test(r),SafeSet:Set,String,StringPrototypeSlice:(t,r,i)=>t.slice(r,i),StringPrototypeToLowerCase:t=>t.toLowerCase(),StringPrototypeToUpperCase:t=>t.toUpperCase(),StringPrototypeTrim:t=>t.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(t,r,i)=>t.set(r,i),Boolean,Uint8Array}},8104(t,r,i){"use strict";let n=i(181),{kResistStopPropagation:o,SymbolDispose:s}=i(8622),a=globalThis.AbortSignal||i(1506).h8,l=globalThis.AbortController||i(1506).z1,u=Object.getPrototypeOf(async function(){}).constructor,c=globalThis.Blob||n.Blob,d=(t,r)=>{if(void 0!==t&&(null===t||"object"!=typeof t||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(r,"AbortSignal",t)};t.exports={AggregateError:class t extends Error{constructor(t){if(!Array.isArray(t))throw TypeError("Expected input to be an Array, got "+typeof t);let r="";for(let i=0;i<t.length;i++)r+=` ${t[i].stack}
|
|
3
|
+
`;super(r),this.name="AggregateError",this.errors=t}},kEmptyObject:Object.freeze({}),once(t){let r=!1;return function(...i){r||(r=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,r;return{promise:new Promise((i,n)=>{t=i,r=n}),resolve:t,reject:r}},promisify:t=>new Promise((r,i)=>{t((t,...n)=>t?i(t):r(...n))}),debuglog:()=>function(){},format:(t,...r)=>t.replace(/%([sdifj])/g,function(...[t,i]){let n=r.shift();return"f"===i?n.toFixed(6):"j"===i?JSON.stringify(n):"s"===i&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()}),inspect(t){switch(typeof t){case"string":if(t.includes("'")){if(!t.includes('"'))return`"${t}"`;if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction:t=>t instanceof u,isArrayBufferView:t=>ArrayBuffer.isView(t)},isBlob:void 0!==c?function(t){return t instanceof c}:function(t){return!1},deprecate:(t,r)=>t,addAbortListener:i(4434).addAbortListener||function(t,r){if(void 0===t)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);let i;return d(t,"signal"),((t,r)=>{if("function"!=typeof t)throw new ERR_INVALID_ARG_TYPE("listener","Function",t)})(r),t.aborted?queueMicrotask(()=>r()):(t.addEventListener("abort",r,{__proto__:null,once:!0,[o]:!0}),i=()=>{t.removeEventListener("abort",r)}),{__proto__:null,[s](){var t;null===(t=i)||void 0===t||t()}}},AbortSignalAny:a.any||function(t){if(1===t.length)return t[0];let r=new l,i=()=>r.abort();return t.forEach(t=>{d(t,"signals"),t.addEventListener("abort",i,{once:!0})}),r.signal.addEventListener("abort",()=>{t.forEach(t=>t.removeEventListener("abort",i))},{once:!0}),r.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},7370(t,r,i){let{Buffer:n}=i(181),{ObjectDefineProperty:o,ObjectKeys:s,ReflectApply:a}=i(8622),{promisify:{custom:l}}=i(8104),{streamReturningOperators:u,promiseReturningOperators:c}=i(5583),{codes:{ERR_ILLEGAL_CONSTRUCTOR:d}}=i(7115),h=i(8062),{setDefaultHighWaterMark:f,getDefaultHighWaterMark:p}=i(8851),{pipeline:g}=i(678),{destroyer:b}=i(8816),m=i(9398),y=i(5903),$=i(3003),w=t.exports=i(6795).Stream;for(let v of(w.isDestroyed=$.isDestroyed,w.isDisturbed=$.isDisturbed,w.isErrored=$.isErrored,w.isReadable=$.isReadable,w.isWritable=$.isWritable,w.Readable=i(7360),s(u))){let _=u[v];function S(...t){if(new.target)throw d();return w.Readable.from(a(_,this,t))}o(S,"name",{__proto__:null,value:_.name}),o(S,"length",{__proto__:null,value:_.length}),o(w.Readable.prototype,v,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}for(let E of s(c)){let k=c[E];function S(...t){if(new.target)throw d();return a(k,this,t)}o(S,"name",{__proto__:null,value:k.name}),o(S,"length",{__proto__:null,value:k.length}),o(w.Readable.prototype,E,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}w.Writable=i(9040),w.Duplex=i(722),w.Transform=i(334),w.PassThrough=i(8676),w.pipeline=g;let{addAbortSignal:A}=i(3483);w.addAbortSignal=A,w.finished=m,w.destroy=b,w.compose=h,w.setDefaultHighWaterMark=f,w.getDefaultHighWaterMark=p,o(w,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),o(g,l,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),o(m,l,{__proto__:null,enumerable:!0,get:()=>y.finished}),w.Stream=w,w._isUint8Array=function(t){return t instanceof Uint8Array},w._uint8ArrayToBuffer=function(t){return n.from(t.buffer,t.byteOffset,t.byteLength)}},5903(t,r,i){"use strict";let{ArrayPrototypePop:n,Promise:o}=i(8622),{isIterable:s,isNodeStream:a,isWebStream:l}=i(3003),{pipelineImpl:u}=i(678),{finished:c}=i(9398);i(7370),t.exports={finished:c,pipeline:function(...t){return new o((r,i)=>{let o,c,d=t[t.length-1];if(d&&"object"==typeof d&&!a(d)&&!s(d)&&!l(d)){let h=n(t);o=h.signal,c=h.end}u(t,(t,n)=>{t?i(t):r(n)},{signal:o,end:c})})}}},6490(t,r,i){let n=i(7721);t.exports.NumberAllocator=n},7721(t,r,i){"use strict";let n=i(6085).CD,o=i(9171)("number-allocator:trace"),s=i(9171)("number-allocator:error");function a(t,r){this.low=t,this.high=r}function l(t,r){if(!(this instanceof l))return new l(t,r);this.min=t,this.max=r,this.ss=new n([],(t,r)=>t.compare(r)),o("Create"),this.clear()}a.prototype.equals=function(t){return this.low===t.low&&this.high===t.high},a.prototype.compare=function(t){return this.low<t.low&&this.high<t.low?-1:t.low<this.low&&t.high<this.low?1:0},l.prototype.firstVacant=function(){return 0===this.ss.size()?null:this.ss.front().low},l.prototype.alloc=function(){if(0===this.ss.size())return o("alloc():empty"),null;let t=this.ss.begin(),r=t.pointer.low,i=t.pointer.high,n=r;return n+1<=i?this.ss.updateKeyByIterator(t,new a(r+1,i)):this.ss.eraseElementByPos(0),o("alloc():"+n),n},l.prototype.use=function(t){let r=new a(t,t),i=this.ss.lowerBound(r);if(!i.equals(this.ss.end())){let n=i.pointer.low,s=i.pointer.high;return i.pointer.equals(r)?(this.ss.eraseElementByIterator(i),o("use():"+t),!0):!(n>t||(n===t?(this.ss.updateKeyByIterator(i,new a(n+1,s)),o("use():"+t),0):s===t?(this.ss.updateKeyByIterator(i,new a(n,s-1)),o("use():"+t),0):(this.ss.updateKeyByIterator(i,new a(t+1,s)),this.ss.insert(new a(n,t-1)),o("use():"+t),0)))}return o("use():failed"),!1},l.prototype.free=function(t){if(t<this.min||t>this.max)return void s("free():"+t+" is out of range");let r=new a(t,t),i=this.ss.upperBound(r);if(i.equals(this.ss.end())){if(i.equals(this.ss.begin()))return void this.ss.insert(r);i.pre();let n=i.pointer.high;i.pointer.high+1===t?this.ss.updateKeyByIterator(i,new a(n,t)):this.ss.insert(r)}else if(i.equals(this.ss.begin())){if(t+1===i.pointer.low){let l=i.pointer.high;this.ss.updateKeyByIterator(i,new a(t,l))}else this.ss.insert(r)}else{let u=i.pointer.low,c=i.pointer.high;i.pre();let d=i.pointer.low;i.pointer.high+1===t?t+1===u?(this.ss.eraseElementByIterator(i),this.ss.updateKeyByIterator(i,new a(d,c))):this.ss.updateKeyByIterator(i,new a(d,t)):t+1===u?(this.ss.eraseElementByIterator(i.next()),this.ss.insert(new a(t,c))):this.ss.insert(r)}o("free():"+t)},l.prototype.clear=function(){o("clear()"),this.ss.clear(),this.ss.insert(new a(this.min,this.max))},l.prototype.intervalCount=function(){return this.ss.size()},l.prototype.dump=function(){for(let t of(console.log("length:"+this.ss.size()),this.ss))console.log(t)},t.exports=l},6739(t){"use strict";"undefined"!=typeof process&&process.version&&0!==process.version.indexOf("v0.")&&(0!==process.version.indexOf("v1.")||0===process.version.indexOf("v1.8."))?t.exports=process:t.exports={nextTick:function(t,r,i,n){if("function"!=typeof t)throw TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return process.nextTick(t);case 2:return process.nextTick(function(){t.call(null,r)});case 3:return process.nextTick(function(){t.call(null,r,i)});case 4:return process.nextTick(function(){t.call(null,r,i,n)});default:for(o=Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return process.nextTick(function(){t.apply(null,o)})}}}},6308(t){t.exports=global.process},7319(t,r,i){"use strict";t.exports=i(6318)()},6318(t){"use strict";function r(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}t.exports=function(t){return(t=t||{}).circles?function(t){var i=[],n=[];return t.proto?function t(s){if("object"!=typeof s||null===s)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return o(s,t);if(s instanceof Map)return new Map(o(Array.from(s),t));if(s instanceof Set)return new Set(o(Array.from(s),t));var a={};for(var l in i.push(s),n.push(a),s){var u=s[l];if("object"!=typeof u||null===u)a[l]=u;else if(u instanceof Date)a[l]=new Date(u);else if(u instanceof Map)a[l]=new Map(o(Array.from(u),t));else if(u instanceof Set)a[l]=new Set(o(Array.from(u),t));else if(ArrayBuffer.isView(u))a[l]=r(u);else{var c=i.indexOf(u);a[l]=-1!==c?n[c]:t(u)}}return i.pop(),n.pop(),a}:function t(s){if("object"!=typeof s||null===s)return s;if(s instanceof Date)return new Date(s);if(Array.isArray(s))return o(s,t);if(s instanceof Map)return new Map(o(Array.from(s),t));if(s instanceof Set)return new Set(o(Array.from(s),t));var a={};for(var l in i.push(s),n.push(a),s)if(!1!==Object.hasOwnProperty.call(s,l)){var u=s[l];if("object"!=typeof u||null===u)a[l]=u;else if(u instanceof Date)a[l]=new Date(u);else if(u instanceof Map)a[l]=new Map(o(Array.from(u),t));else if(u instanceof Set)a[l]=new Set(o(Array.from(u),t));else if(ArrayBuffer.isView(u))a[l]=r(u);else{var c=i.indexOf(u);a[l]=-1!==c?n[c]:t(u)}}return i.pop(),n.pop(),a};function o(t,o){for(var s=Object.keys(t),a=Array(s.length),l=0;l<s.length;l++){var u=s[l],c=t[u];if("object"!=typeof c||null===c)a[u]=c;else if(c instanceof Date)a[u]=new Date(c);else if(ArrayBuffer.isView(c))a[u]=r(c);else{var d=i.indexOf(c);a[u]=-1!==d?n[d]:o(c)}}return a}}(t):t.proto?function t(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return i(n,t);if(n instanceof Map)return new Map(i(Array.from(n),t));if(n instanceof Set)return new Set(i(Array.from(n),t));var o={};for(var s in n){var a=n[s];"object"!=typeof a||null===a?o[s]=a:a instanceof Date?o[s]=new Date(a):a instanceof Map?o[s]=new Map(i(Array.from(a),t)):a instanceof Set?o[s]=new Set(i(Array.from(a),t)):ArrayBuffer.isView(a)?o[s]=r(a):o[s]=t(a)}return o}:function t(n){if("object"!=typeof n||null===n)return n;if(n instanceof Date)return new Date(n);if(Array.isArray(n))return i(n,t);if(n instanceof Map)return new Map(i(Array.from(n),t));if(n instanceof Set)return new Set(i(Array.from(n),t));var o={};for(var s in n)if(!1!==Object.hasOwnProperty.call(n,s)){var a=n[s];"object"!=typeof a||null===a?o[s]=a:a instanceof Date?o[s]=new Date(a):a instanceof Map?o[s]=new Map(i(Array.from(a),t)):a instanceof Set?o[s]=new Set(i(Array.from(a),t)):ArrayBuffer.isView(a)?o[s]=r(a):o[s]=t(a)}return o};function i(t,i){for(var n=Object.keys(t),o=Array(n.length),s=0;s<n.length;s++){var a=n[s],l=t[a];"object"!=typeof l||null===l?o[a]=l:l instanceof Date?o[a]=new Date(l):ArrayBuffer.isView(l)?o[a]=r(l):o[a]=i(l)}return o}}},9391(t,r,i){t=i.nmd(t);var n,o=i(4167).SourceMapConsumer,s=i(6928);try{(n=i(9896)).existsSync&&n.readFileSync||(n=null)}catch(a){}var l=i(3432);function u(t,r){return t.require(r)}var c=!1,d=!1,h=!1,f="auto",p={},g={},b=/^data:application\/json[^,]+base64,/,m=[],y=[];function $(){return"browser"===f||"node"!==f&&"undefined"!=typeof window&&"function"==typeof XMLHttpRequest&&!(window.require&&window.module&&window.process&&"renderer"===window.process.type)}function w(t){return function(r){for(var i=0;i<t.length;i++){var n=t[i](r);if(n)return n}return null}}var v=w(m);function _(t,r){if(!t)return r;var i=s.dirname(t),n=/^\w+:\/\/[^\/]*/.exec(i),o=n?n[0]:"",a=i.slice(o.length);return o&&/^\/\w\:/.test(a)?(o+="/")+s.resolve(i.slice(o.length),r).replace(/\\/g,"/"):o+s.resolve(i.slice(o.length),r)}m.push(function(t){if(t=t.trim(),/^file:/.test(t)&&(t=t.replace(/file:\/\/\/(\w:)?/,function(t,r){return r?"":"/"})),t in p)return p[t];var r="";try{if(n)n.existsSync(t)&&(r=n.readFileSync(t,"utf8"));else{var i=new XMLHttpRequest;i.open("GET",t,!1),i.send(null),4===i.readyState&&200===i.status&&(r=i.responseText)}}catch(o){}return p[t]=r});var S=w(y);function E(t){var r=g[t.source];if(!r){var i=S(t.source);i?(r=g[t.source]={url:i.url,map:new o(i.map)}).map.sourcesContent&&r.map.sources.forEach(function(t,i){var n=r.map.sourcesContent[i];n&&(p[_(r.url,t)]=n)}):r=g[t.source]={url:null,map:null}}if(r&&r.map&&"function"==typeof r.map.originalPositionFor){var n=r.map.originalPositionFor(t);if(null!==n.source)return n.source=_(r.url,n.source),n}return t}function k(){var t,r="";if(this.isNative())r="native";else{!(t=this.getScriptNameOrSourceURL())&&this.isEval()&&(r=this.getEvalOrigin(),r+=", "),r+=t||"<anonymous>";var i=this.getLineNumber();if(null!=i){r+=":"+i;var n=this.getColumnNumber();n&&(r+=":"+n)}}var o="",s=this.getFunctionName(),a=!0,l=this.isConstructor();if(this.isToplevel()||l)l?o+="new "+(s||"<anonymous>"):s?o+=s:(o+=r,a=!1);else{var u=this.getTypeName();"[object Object]"===u&&(u="null");var c=this.getMethodName();s?(u&&0!=s.indexOf(u)&&(o+=u+"."),o+=s,c&&s.indexOf("."+c)!=s.length-c.length-1&&(o+=" [as "+c+"]")):o+=u+"."+(c||"<anonymous>")}return a&&(o+=" ("+r+")"),o}function A(t){var r={};return Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(function(i){r[i]=/^(?:is|get)/.test(i)?function(){return t[i].call(t)}:t[i]}),r.toString=k,r}function R(t,r){if(void 0===r&&(r={nextPosition:null,curPosition:null}),t.isNative())return r.curPosition=null,t;var i=t.getFileName()||t.getScriptNameOrSourceURL();if(i){var n=t.getLineNumber(),o=t.getColumnNumber()-1,s=/^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/.test("object"==typeof process&&null!==process?process.version:"")?0:62;1!==n||!(o>s)||$()||t.isEval()||(o-=s);var a=E({source:i,line:n,column:o});r.curPosition=a;var l=(t=A(t)).getFunctionName;return t.getFunctionName=function(){return null==r.nextPosition?l():r.nextPosition.name||l()},t.getFileName=function(){return a.source},t.getLineNumber=function(){return a.line},t.getColumnNumber=function(){return a.column+1},t.getScriptNameOrSourceURL=function(){return a.source},t}var u=t.isEval()&&t.getEvalOrigin();return u&&(u=function t(r){var i=/^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(r);if(i){var n=E({source:i[2],line:+i[3],column:i[4]-1});return"eval at "+i[1]+" ("+n.source+":"+n.line+":"+(n.column+1)+")"}return(i=/^eval at ([^(]+) \((.+)\)$/.exec(r))?"eval at "+i[1]+" ("+t(i[2])+")":r}(u),(t=A(t)).getEvalOrigin=function(){return u}),t}function T(t,r){h&&(p={},g={});for(var i=(t.name||"Error")+": "+(t.message||""),n={nextPosition:null,curPosition:null},o=[],s=r.length-1;s>=0;s--)o.push("\n at "+R(r[s],n)),n.nextPosition=n.curPosition;return n.curPosition=n.nextPosition=null,i+o.reverse().join("")}function I(t){var r=/\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(t.stack);if(r){var i=r[1],o=+r[2],s=+r[3],a=p[i];if(!a&&n&&n.existsSync(i))try{a=n.readFileSync(i,"utf8")}catch(l){a=""}if(a){var u=a.split(/(?:\r\n|\r|\n)/)[o-1];if(u)return i+":"+o+"\n"+u+"\n"+Array(s).join(" ")+"^"}}return null}y.push(function(t){var r,i=function(t){var r;if($())try{var i=new XMLHttpRequest;i.open("GET",t,!1),i.send(null),r=4===i.readyState?i.responseText:null;var n=i.getResponseHeader("SourceMap")||i.getResponseHeader("X-SourceMap");if(n)return n}catch(o){}r=v(t);for(var s,a,l=/(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/gm;a=l.exec(r);)s=a;return s?s[1]:null}(t);return i?(b.test(i)?(r=l(i.slice(i.indexOf(",")+1),"base64").toString(),i=t):(i=_(t,i),r=v(i)),r?{url:i,map:r}:null):null});var C=m.slice(0),P=y.slice(0);r.wrapCallSite=R,r.getErrorSource=I,r.mapSourcePosition=E,r.retrieveSourceMap=S,r.install=function(r){if((r=r||{}).environment&&-1===["node","browser","auto"].indexOf(f=r.environment))throw Error("environment "+f+" was unknown. Available options are {auto, browser, node}");if(r.retrieveFile&&(r.overrideRetrieveFile&&(m.length=0),m.unshift(r.retrieveFile)),r.retrieveSourceMap&&(r.overrideRetrieveSourceMap&&(y.length=0),y.unshift(r.retrieveSourceMap)),r.hookRequire&&!$()){var i,n=u(t,"module"),o=n.prototype._compile;o.__sourceMapSupport||(n.prototype._compile=function(t,r){return p[r]=t,g[r]=void 0,o.call(this,t,r)},n.prototype._compile.__sourceMapSupport=!0)}if(h||(h="emptyCacheBetweenOperations"in r&&r.emptyCacheBetweenOperations),c||(c=!0,Error.prepareStackTrace=T),!d){var s=!("handleUncaughtExceptions"in r)||r.handleUncaughtExceptions;try{!1===u(t,"worker_threads").isMainThread&&(s=!1)}catch(a){}s&&"object"==typeof process&&null!==process&&"function"==typeof process.on&&(d=!0,i=process.emit,process.emit=function(t){if("uncaughtException"===t){var r,n,o,s=arguments[1]&&arguments[1].stack,a=this.listeners(t).length>0;if(s&&!a)return n=I(r=arguments[1]),(o=function(){if("object"==typeof process&&null!==process)return process.stderr}())&&o._handle&&o._handle.setBlocking&&o._handle.setBlocking(!0),n&&(console.error(),console.error(n)),console.error(r.stack),void("object"==typeof process&&null!==process&&"function"==typeof process.exit&&process.exit(1))}return i.apply(this,arguments)})}},r.resetRetrieveHandlers=function(){m.length=0,y.length=0,m=C.slice(0),S=w(y=P.slice(0)),v=w(m)}},1365(t,r,i){var n=i(33),o=Object.prototype.hasOwnProperty,s="undefined"!=typeof Map;function a(){this._array=[],this._set=s?new Map:Object.create(null)}a.fromArray=function(t,r){for(var i=new a,n=0,o=t.length;n<o;n++)i.add(t[n],r);return i},a.prototype.size=function(){return s?this._set.size:Object.getOwnPropertyNames(this._set).length},a.prototype.add=function(t,r){var i=s?t:n.toSetString(t),a=s?this.has(t):o.call(this._set,i),l=this._array.length;a&&!r||this._array.push(t),a||(s?this._set.set(t,l):this._set[i]=l)},a.prototype.has=function(t){if(s)return this._set.has(t);var r=n.toSetString(t);return o.call(this._set,r)},a.prototype.indexOf=function(t){if(s){var r=this._set.get(t);if(r>=0)return r}else{var i=n.toSetString(t);if(o.call(this._set,i))return this._set[i]}throw Error('"'+t+'" is not in the set.')},a.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw Error("No element indexed by "+t)},a.prototype.toArray=function(){return this._array.slice()},r.C=a},114(t,r,i){var n=i(7374);r.encode=function(t){var r,i,o="",s=(r=t)<0?1+(-r<<1):0+(r<<1);do i=31&s,(s>>>=5)>0&&(i|=32),o+=n.encode(i);while(s>0);return o},r.decode=function(t,r,i){var o,s,a,l,u=t.length,c=0,d=0;do{if(r>=u)throw Error("Expected more digits in base 64 VLQ value.");if(-1===(s=n.decode(t.charCodeAt(r++))))throw Error("Invalid base64 digit: "+t.charAt(r-1));o=!!(32&s),c+=(s&=31)<<d,d+=5}while(o);i.value=(l=(a=c)>>1,1&~a?l:-l),i.rest=r}},7374(t,r){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");r.encode=function(t){if(0<=t&&t<i.length)return i[t];throw TypeError("Must be between 0 and 63: "+t)},r.decode=function(t){return 65<=t&&t<=90?t-65:97<=t&&t<=122?t-97+26:48<=t&&t<=57?t-48+52:43==t?62:47==t?63:-1}},8045(t,r){function i(t,n,o,s,a,l){var u=Math.floor((n-t)/2)+t,c=a(o,s[u],!0);return 0===c?u:c>0?n-u>1?i(u,n,o,s,a,l):l==r.LEAST_UPPER_BOUND?n<s.length?n:-1:u:u-t>1?i(t,u,o,s,a,l):l==r.LEAST_UPPER_BOUND?u:t<0?-1:t}r.GREATEST_LOWER_BOUND=1,r.LEAST_UPPER_BOUND=2,r.search=function(t,n,o,s){if(0===n.length)return -1;var a=i(-1,n.length,t,n,o,s||r.GREATEST_LOWER_BOUND);if(a<0)return -1;for(;a-1>=0&&0===o(n[a],n[a-1],!0);)--a;return a}},0(t,r,i){var n=i(33);function o(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}o.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)},o.prototype.add=function(t){var r,i,o,s,a,l;i=t,o=(r=this._last).generatedLine,s=i.generatedLine,a=r.generatedColumn,l=i.generatedColumn,s>o||s==o&&l>=a||0>=n.compareByGeneratedPositionsInflated(r,i)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))},o.prototype.toArray=function(){return this._sorted||(this._array.sort(n.compareByGeneratedPositionsInflated),this._sorted=!0),this._array},r.P=o},1011(t,r){function i(t,r,i){var n=t[r];t[r]=t[i],t[i]=n}r.g=function(t,r){!function t(r,n,o,s){if(o<s){var a,l,u=o-1;i(r,Math.round((a=o)+Math.random()*((l=s)-a)),s);for(var c=r[s],d=o;d<s;d++)0>=n(r[d],c)&&i(r,u+=1,d);i(r,u+1,d);var h=u+1;t(r,n,o,h-1),t(r,n,h+1,s)}}(t,r,0,t.length-1)}},2660(t,r,i){var n=i(33),o=i(8045),s=i(1365).C,a=i(114),l=i(1011).g;function u(t,r){var i=t;return"string"==typeof t&&(i=n.parseSourceMapInput(t)),null!=i.sections?new h(i,r):new c(i,r)}function c(t,r){var i=t;"string"==typeof t&&(i=n.parseSourceMapInput(t));var o=n.getArg(i,"version"),a=n.getArg(i,"sources"),l=n.getArg(i,"names",[]),u=n.getArg(i,"sourceRoot",null),c=n.getArg(i,"sourcesContent",null),d=n.getArg(i,"mappings"),h=n.getArg(i,"file",null);if(o!=this._version)throw Error("Unsupported version: "+o);u&&(u=n.normalize(u)),a=a.map(String).map(n.normalize).map(function(t){return u&&n.isAbsolute(u)&&n.isAbsolute(t)?n.relative(u,t):t}),this._names=s.fromArray(l.map(String),!0),this._sources=s.fromArray(a,!0),this._absoluteSources=this._sources.toArray().map(function(t){return n.computeSourceURL(u,t,r)}),this.sourceRoot=u,this.sourcesContent=c,this._mappings=d,this._sourceMapURL=r,this.file=h}function d(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function h(t,r){var i=t;"string"==typeof t&&(i=n.parseSourceMapInput(t));var o=n.getArg(i,"version"),a=n.getArg(i,"sections");if(o!=this._version)throw Error("Unsupported version: "+o);this._sources=new s,this._names=new s;var l={line:-1,column:0};this._sections=a.map(function(t){if(t.url)throw Error("Support for url field in sections not implemented.");var i=n.getArg(t,"offset"),o=n.getArg(i,"line"),s=n.getArg(i,"column");if(o<l.line||o===l.line&&s<l.column)throw Error("Section offsets must be ordered and non-overlapping.");return l=i,{generatedOffset:{generatedLine:o+1,generatedColumn:s+1},consumer:new u(n.getArg(t,"map"),r)}})}u.fromSourceMap=function(t,r){return c.fromSourceMap(t,r)},u.prototype._version=3,u.prototype.__generatedMappings=null,Object.defineProperty(u.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),u.prototype.__originalMappings=null,Object.defineProperty(u.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),u.prototype._charIsMappingSeparator=function(t,r){var i=t.charAt(r);return";"===i||","===i},u.prototype._parseMappings=function(t,r){throw Error("Subclasses must implement _parseMappings")},u.GENERATED_ORDER=1,u.ORIGINAL_ORDER=2,u.GREATEST_LOWER_BOUND=1,u.LEAST_UPPER_BOUND=2,u.prototype.eachMapping=function(t,r,i){switch(i||u.GENERATED_ORDER){case u.GENERATED_ORDER:o=this._generatedMappings;break;case u.ORIGINAL_ORDER:o=this._originalMappings;break;default:throw Error("Unknown order of iteration.")}var o,s=this.sourceRoot;o.map(function(t){var r=null===t.source?null:this._sources.at(t.source);return{source:r=n.computeSourceURL(s,r,this._sourceMapURL),generatedLine:t.generatedLine,generatedColumn:t.generatedColumn,originalLine:t.originalLine,originalColumn:t.originalColumn,name:null===t.name?null:this._names.at(t.name)}},this).forEach(t,r||null)},u.prototype.allGeneratedPositionsFor=function(t){var r=n.getArg(t,"line"),i={source:n.getArg(t,"source"),originalLine:r,originalColumn:n.getArg(t,"column",0)};if(i.source=this._findSourceIndex(i.source),i.source<0)return[];var s=[],a=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,o.LEAST_UPPER_BOUND);if(a>=0){var l=this._originalMappings[a];if(void 0===t.column)for(var u=l.originalLine;l&&l.originalLine===u;)s.push({line:n.getArg(l,"generatedLine",null),column:n.getArg(l,"generatedColumn",null),lastColumn:n.getArg(l,"lastGeneratedColumn",null)}),l=this._originalMappings[++a];else for(var c=l.originalColumn;l&&l.originalLine===r&&l.originalColumn==c;)s.push({line:n.getArg(l,"generatedLine",null),column:n.getArg(l,"generatedColumn",null),lastColumn:n.getArg(l,"lastGeneratedColumn",null)}),l=this._originalMappings[++a]}return s},r.SourceMapConsumer=u,c.prototype=Object.create(u.prototype),c.prototype.consumer=u,c.prototype._findSourceIndex=function(t){var r,i=t;if(null!=this.sourceRoot&&(i=n.relative(this.sourceRoot,i)),this._sources.has(i))return this._sources.indexOf(i);for(r=0;r<this._absoluteSources.length;++r)if(this._absoluteSources[r]==t)return r;return -1},c.fromSourceMap=function(t,r){var i=Object.create(c.prototype),o=i._names=s.fromArray(t._names.toArray(),!0),a=i._sources=s.fromArray(t._sources.toArray(),!0);i.sourceRoot=t._sourceRoot,i.sourcesContent=t._generateSourcesContent(i._sources.toArray(),i.sourceRoot),i.file=t._file,i._sourceMapURL=r,i._absoluteSources=i._sources.toArray().map(function(t){return n.computeSourceURL(i.sourceRoot,t,r)});for(var u=t._mappings.toArray().slice(),h=i.__generatedMappings=[],f=i.__originalMappings=[],p=0,g=u.length;p<g;p++){var b=u[p],m=new d;m.generatedLine=b.generatedLine,m.generatedColumn=b.generatedColumn,b.source&&(m.source=a.indexOf(b.source),m.originalLine=b.originalLine,m.originalColumn=b.originalColumn,b.name&&(m.name=o.indexOf(b.name)),f.push(m)),h.push(m)}return l(i.__originalMappings,n.compareByOriginalPositions),i},c.prototype._version=3,Object.defineProperty(c.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),c.prototype._parseMappings=function(t,r){for(var i,o,s,u,c,h=1,f=0,p=0,g=0,b=0,m=0,y=t.length,$=0,w={},v={},_=[],S=[];$<y;)if(";"===t.charAt($))h++,$++,f=0;else if(","===t.charAt($))$++;else{for((i=new d).generatedLine=h,u=$;u<y&&!this._charIsMappingSeparator(t,u);u++);if(s=w[o=t.slice($,u)])$+=o.length;else{for(s=[];$<u;)a.decode(t,$,v),c=v.value,$=v.rest,s.push(c);if(2===s.length)throw Error("Found a source, but no line and column");if(3===s.length)throw Error("Found a source and line, but no column");w[o]=s}i.generatedColumn=f+s[0],f=i.generatedColumn,s.length>1&&(i.source=b+s[1],b+=s[1],i.originalLine=p+s[2],p=i.originalLine,i.originalLine+=1,i.originalColumn=g+s[3],g=i.originalColumn,s.length>4&&(i.name=m+s[4],m+=s[4])),S.push(i),"number"==typeof i.originalLine&&_.push(i)}l(S,n.compareByGeneratedPositionsDeflated),this.__generatedMappings=S,l(_,n.compareByOriginalPositions),this.__originalMappings=_},c.prototype._findMapping=function(t,r,i,n,s,a){if(t[i]<=0)throw TypeError("Line must be greater than or equal to 1, got "+t[i]);if(t[n]<0)throw TypeError("Column must be greater than or equal to 0, got "+t[n]);return o.search(t,r,s,a)},c.prototype.computeColumnSpans=function(){for(var t=0;t<this._generatedMappings.length;++t){var r=this._generatedMappings[t];if(t+1<this._generatedMappings.length){var i=this._generatedMappings[t+1];if(r.generatedLine===i.generatedLine){r.lastGeneratedColumn=i.generatedColumn-1;continue}}r.lastGeneratedColumn=1/0}},c.prototype.originalPositionFor=function(t){var r={generatedLine:n.getArg(t,"line"),generatedColumn:n.getArg(t,"column")},i=this._findMapping(r,this._generatedMappings,"generatedLine","generatedColumn",n.compareByGeneratedPositionsDeflated,n.getArg(t,"bias",u.GREATEST_LOWER_BOUND));if(i>=0){var o=this._generatedMappings[i];if(o.generatedLine===r.generatedLine){var s=n.getArg(o,"source",null);null!==s&&(s=this._sources.at(s),s=n.computeSourceURL(this.sourceRoot,s,this._sourceMapURL));var a=n.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:s,line:n.getArg(o,"originalLine",null),column:n.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},c.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return null==t})},c.prototype.sourceContentFor=function(t,r){if(!this.sourcesContent)return null;var i=this._findSourceIndex(t);if(i>=0)return this.sourcesContent[i];var o,s=t;if(null!=this.sourceRoot&&(s=n.relative(this.sourceRoot,s)),null!=this.sourceRoot&&(o=n.urlParse(this.sourceRoot))){var a=s.replace(/^file:\/\//,"");if("file"==o.scheme&&this._sources.has(a))return this.sourcesContent[this._sources.indexOf(a)];if((!o.path||"/"==o.path)&&this._sources.has("/"+s))return this.sourcesContent[this._sources.indexOf("/"+s)]}if(r)return null;throw Error('"'+s+'" is not in the SourceMap.')},c.prototype.generatedPositionFor=function(t){var r=n.getArg(t,"source");if((r=this._findSourceIndex(r))<0)return{line:null,column:null,lastColumn:null};var i={source:r,originalLine:n.getArg(t,"line"),originalColumn:n.getArg(t,"column")},o=this._findMapping(i,this._originalMappings,"originalLine","originalColumn",n.compareByOriginalPositions,n.getArg(t,"bias",u.GREATEST_LOWER_BOUND));if(o>=0){var s=this._originalMappings[o];if(s.source===i.source)return{line:n.getArg(s,"generatedLine",null),column:n.getArg(s,"generatedColumn",null),lastColumn:n.getArg(s,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},h.prototype=Object.create(u.prototype),h.prototype.constructor=u,h.prototype._version=3,Object.defineProperty(h.prototype,"sources",{get:function(){for(var t=[],r=0;r<this._sections.length;r++)for(var i=0;i<this._sections[r].consumer.sources.length;i++)t.push(this._sections[r].consumer.sources[i]);return t}}),h.prototype.originalPositionFor=function(t){var r={generatedLine:n.getArg(t,"line"),generatedColumn:n.getArg(t,"column")},i=o.search(r,this._sections,function(t,r){return t.generatedLine-r.generatedOffset.generatedLine||t.generatedColumn-r.generatedOffset.generatedColumn}),s=this._sections[i];return s?s.consumer.originalPositionFor({line:r.generatedLine-(s.generatedOffset.generatedLine-1),column:r.generatedColumn-(s.generatedOffset.generatedLine===r.generatedLine?s.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}},h.prototype.hasContentsOfAllSources=function(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})},h.prototype.sourceContentFor=function(t,r){for(var i=0;i<this._sections.length;i++){var n=this._sections[i].consumer.sourceContentFor(t,!0);if(n)return n}if(r)return null;throw Error('"'+t+'" is not in the SourceMap.')},h.prototype.generatedPositionFor=function(t){for(var r=0;r<this._sections.length;r++){var i=this._sections[r];if(-1!==i.consumer._findSourceIndex(n.getArg(t,"source"))){var o=i.consumer.generatedPositionFor(t);if(o)return{line:o.line+(i.generatedOffset.generatedLine-1),column:o.column+(i.generatedOffset.generatedLine===o.line?i.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},h.prototype._parseMappings=function(t,r){this.__generatedMappings=[],this.__originalMappings=[];for(var i=0;i<this._sections.length;i++)for(var o=this._sections[i],s=o.consumer._generatedMappings,a=0;a<s.length;a++){var u=s[a],c=o.consumer._sources.at(u.source);c=n.computeSourceURL(o.consumer.sourceRoot,c,this._sourceMapURL),this._sources.add(c),c=this._sources.indexOf(c);var d=null;u.name&&(d=o.consumer._names.at(u.name),this._names.add(d),d=this._names.indexOf(d));var h={source:c,generatedLine:u.generatedLine+(o.generatedOffset.generatedLine-1),generatedColumn:u.generatedColumn+(o.generatedOffset.generatedLine===u.generatedLine?o.generatedOffset.generatedColumn-1:0),originalLine:u.originalLine,originalColumn:u.originalColumn,name:d};this.__generatedMappings.push(h),"number"==typeof h.originalLine&&this.__originalMappings.push(h)}l(this.__generatedMappings,n.compareByGeneratedPositionsDeflated),l(this.__originalMappings,n.compareByOriginalPositions)}},4963(t,r,i){var n=i(114),o=i(33),s=i(1365).C,a=i(0).P;function l(t){t||(t={}),this._file=o.getArg(t,"file",null),this._sourceRoot=o.getArg(t,"sourceRoot",null),this._skipValidation=o.getArg(t,"skipValidation",!1),this._sources=new s,this._names=new s,this._mappings=new a,this._sourcesContents=null}l.prototype._version=3,l.fromSourceMap=function(t){var r=t.sourceRoot,i=new l({file:t.file,sourceRoot:r});return t.eachMapping(function(t){var n={generated:{line:t.generatedLine,column:t.generatedColumn}};null!=t.source&&(n.source=t.source,null!=r&&(n.source=o.relative(r,n.source)),n.original={line:t.originalLine,column:t.originalColumn},null!=t.name&&(n.name=t.name)),i.addMapping(n)}),t.sources.forEach(function(n){var s=n;null!==r&&(s=o.relative(r,n)),i._sources.has(s)||i._sources.add(s);var a=t.sourceContentFor(n);null!=a&&i.setSourceContent(n,a)}),i},l.prototype.addMapping=function(t){var r=o.getArg(t,"generated"),i=o.getArg(t,"original",null),n=o.getArg(t,"source",null),s=o.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,i,n,s),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=s&&(s=String(s),this._names.has(s)||this._names.add(s)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:null!=i&&i.line,originalColumn:null!=i&&i.column,source:n,name:s})},l.prototype.setSourceContent=function(t,r){var i=t;null!=this._sourceRoot&&(i=o.relative(this._sourceRoot,i)),null!=r?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[o.toSetString(i)]=r):this._sourcesContents&&(delete this._sourcesContents[o.toSetString(i)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},l.prototype.applySourceMap=function(t,r,i){var n=r;if(null==r){if(null==t.file)throw Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=t.file}var a=this._sourceRoot;null!=a&&(n=o.relative(a,n));var l=new s,u=new s;this._mappings.unsortedForEach(function(r){if(r.source===n&&null!=r.originalLine){var s=t.originalPositionFor({line:r.originalLine,column:r.originalColumn});null!=s.source&&(r.source=s.source,null!=i&&(r.source=o.join(i,r.source)),null!=a&&(r.source=o.relative(a,r.source)),r.originalLine=s.line,r.originalColumn=s.column,null!=s.name&&(r.name=s.name))}var c=r.source;null==c||l.has(c)||l.add(c);var d=r.name;null==d||u.has(d)||u.add(d)},this),this._sources=l,this._names=u,t.sources.forEach(function(r){var n=t.sourceContentFor(r);null!=n&&(null!=i&&(r=o.join(i,r)),null!=a&&(r=o.relative(a,r)),this.setSourceContent(r,n))},this)},l.prototype._validateMapping=function(t,r,i,n){if(r&&"number"!=typeof r.line&&"number"!=typeof r.column)throw Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0)||r||i||n)&&!(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&i))throw Error("Invalid mapping: "+JSON.stringify({generated:t,source:i,original:r,name:n}))},l.prototype._serializeMappings=function(){for(var t,r,i,s,a=0,l=1,u=0,c=0,d=0,h=0,f="",p=this._mappings.toArray(),g=0,b=p.length;g<b;g++){if(t="",(r=p[g]).generatedLine!==l)for(a=0;r.generatedLine!==l;)t+=";",l++;else if(g>0){if(!o.compareByGeneratedPositionsInflated(r,p[g-1]))continue;t+=","}t+=n.encode(r.generatedColumn-a),a=r.generatedColumn,null!=r.source&&(s=this._sources.indexOf(r.source),t+=n.encode(s-h),h=s,t+=n.encode(r.originalLine-1-c),c=r.originalLine-1,t+=n.encode(r.originalColumn-u),u=r.originalColumn,null!=r.name&&(i=this._names.indexOf(r.name),t+=n.encode(i-d),d=i)),f+=t}return f},l.prototype._generateSourcesContent=function(t,r){return t.map(function(t){if(!this._sourcesContents)return null;null!=r&&(t=o.relative(r,t));var i=o.toSetString(t);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)},l.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(t.file=this._file),null!=this._sourceRoot&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t},l.prototype.toString=function(){return JSON.stringify(this.toJSON())},r.x=l},7957(t,r,i){var n=i(4963).x,o=i(33),s=/(\r?\n)/,a="$$$isSourceNode$$$";function l(t,r,i,n,o){this.children=[],this.sourceContents={},this.line=null==t?null:t,this.column=null==r?null:r,this.source=null==i?null:i,this.name=null==o?null:o,this[a]=!0,null!=n&&this.add(n)}l.fromStringWithSourceMap=function(t,r,i){var n=new l,a=t.split(s),u=0,c=function(){return t()+(t()||"");function t(){return u<a.length?a[u++]:void 0}},d=1,h=0,f=null;return r.eachMapping(function(t){if(null!==f){if(!(d<t.generatedLine)){var r=(i=a[u]||"").substr(0,t.generatedColumn-h);return a[u]=i.substr(t.generatedColumn-h),h=t.generatedColumn,p(f,r),void(f=t)}p(f,c()),d++,h=0}for(;d<t.generatedLine;)n.add(c()),d++;if(h<t.generatedColumn){var i=a[u]||"";n.add(i.substr(0,t.generatedColumn)),a[u]=i.substr(t.generatedColumn),h=t.generatedColumn}f=t},this),u<a.length&&(f&&p(f,c()),n.add(a.splice(u).join(""))),r.sources.forEach(function(t){var s=r.sourceContentFor(t);null!=s&&(null!=i&&(t=o.join(i,t)),n.setSourceContent(t,s))}),n;function p(t,r){if(null===t||void 0===t.source)n.add(r);else{var s=i?o.join(i,t.source):t.source;n.add(new l(t.originalLine,t.originalColumn,s,r,t.name))}}},l.prototype.add=function(t){if(Array.isArray(t))t.forEach(function(t){this.add(t)},this);else{if(!t[a]&&"string"!=typeof t)throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);t&&this.children.push(t)}return this},l.prototype.prepend=function(t){if(Array.isArray(t))for(var r=t.length-1;r>=0;r--)this.prepend(t[r]);else{if(!t[a]&&"string"!=typeof t)throw TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);this.children.unshift(t)}return this},l.prototype.walk=function(t){for(var r,i=0,n=this.children.length;i<n;i++)(r=this.children[i])[a]?r.walk(t):""!==r&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})},l.prototype.join=function(t){var r,i,n=this.children.length;if(n>0){for(r=[],i=0;i<n-1;i++)r.push(this.children[i]),r.push(t);r.push(this.children[i]),this.children=r}return this},l.prototype.replaceRight=function(t,r){var i=this.children[this.children.length-1];return i[a]?i.replaceRight(t,r):"string"==typeof i?this.children[this.children.length-1]=i.replace(t,r):this.children.push("".replace(t,r)),this},l.prototype.setSourceContent=function(t,r){this.sourceContents[o.toSetString(t)]=r},l.prototype.walkSourceContents=function(t){for(var r=0,i=this.children.length;r<i;r++)this.children[r][a]&&this.children[r].walkSourceContents(t);var n=Object.keys(this.sourceContents);for(r=0,i=n.length;r<i;r++)t(o.fromSetString(n[r]),this.sourceContents[n[r]])},l.prototype.toString=function(){var t="";return this.walk(function(r){t+=r}),t},l.prototype.toStringWithSourceMap=function(t){var r={code:"",line:1,column:0},i=new n(t),o=!1,s=null,a=null,l=null,u=null;return this.walk(function(t,n){r.code+=t,null!==n.source&&null!==n.line&&null!==n.column?(s===n.source&&a===n.line&&l===n.column&&u===n.name||i.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:r.line,column:r.column},name:n.name}),s=n.source,a=n.line,l=n.column,u=n.name,o=!0):o&&(i.addMapping({generated:{line:r.line,column:r.column}}),s=null,o=!1);for(var c=0,d=t.length;c<d;c++)10===t.charCodeAt(c)?(r.line++,r.column=0,c+1===d?(s=null,o=!1):o&&i.addMapping({source:n.source,original:{line:n.line,column:n.column},generated:{line:r.line,column:r.column},name:n.name})):r.column++}),this.walkSourceContents(function(t,r){i.setSourceContent(t,r)}),{code:r.code,map:i}}},33(t,r){r.getArg=function(t,r,i){if(r in t)return t[r];if(3===arguments.length)return i;throw Error('"'+r+'" is a required argument.')};var i=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function o(t){var r=t.match(i);return r?{scheme:r[1],auth:r[2],host:r[3],port:r[4],path:r[5]}:null}function s(t){var r="";return t.scheme&&(r+=t.scheme+":"),r+="//",t.auth&&(r+=t.auth+"@"),t.host&&(r+=t.host),t.port&&(r+=":"+t.port),t.path&&(r+=t.path),r}function a(t){var i=t,n=o(t);if(n){if(!n.path)return t;i=n.path}for(var a,l=r.isAbsolute(i),u=i.split(/\/+/),c=0,d=u.length-1;d>=0;d--)"."===(a=u[d])?u.splice(d,1):".."===a?c++:c>0&&(""===a?(u.splice(d+1,c),c=0):(u.splice(d,2),c--));return""===(i=u.join("/"))&&(i=l?"/":"."),n?(n.path=i,s(n)):i}function l(t,r){""===t&&(t="."),""===r&&(r=".");var i=o(r),l=o(t);if(l&&(t=l.path||"/"),i&&!i.scheme)return l&&(i.scheme=l.scheme),s(i);if(i||r.match(n))return r;if(l&&!l.host&&!l.path)return l.host=r,s(l);var u="/"===r.charAt(0)?r:a(t.replace(/\/+$/,"")+"/"+r);return l?(l.path=u,s(l)):u}r.urlParse=o,r.urlGenerate=s,r.normalize=a,r.join=l,r.isAbsolute=function(t){return"/"===t.charAt(0)||i.test(t)},r.relative=function(t,r){""===t&&(t="."),t=t.replace(/\/$/,"");for(var i=0;0!==r.indexOf(t+"/");){var n=t.lastIndexOf("/");if(n<0||(t=t.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return r;++i}return Array(i+1).join("../")+r.substr(t.length+1)};var u=!("__proto__"in Object.create(null));function c(t){return t}function d(t){if(!t)return!1;var r=t.length;if(r<9||95!==t.charCodeAt(r-1)||95!==t.charCodeAt(r-2)||111!==t.charCodeAt(r-3)||116!==t.charCodeAt(r-4)||111!==t.charCodeAt(r-5)||114!==t.charCodeAt(r-6)||112!==t.charCodeAt(r-7)||95!==t.charCodeAt(r-8)||95!==t.charCodeAt(r-9))return!1;for(var i=r-10;i>=0;i--)if(36!==t.charCodeAt(i))return!1;return!0}function h(t,r){return t===r?0:null===t?1:null===r?-1:t>r?1:-1}r.toSetString=u?c:function(t){return d(t)?"$"+t:t},r.fromSetString=u?c:function(t){return d(t)?t.slice(1):t},r.compareByOriginalPositions=function(t,r,i){var n=h(t.source,r.source);return 0!==n||0!=(n=t.originalLine-r.originalLine)||0!=(n=t.originalColumn-r.originalColumn)||i||0!=(n=t.generatedColumn-r.generatedColumn)||0!=(n=t.generatedLine-r.generatedLine)?n:h(t.name,r.name)},r.compareByGeneratedPositionsDeflated=function(t,r,i){var n=t.generatedLine-r.generatedLine;return 0!==n||0!=(n=t.generatedColumn-r.generatedColumn)||i||0!==(n=h(t.source,r.source))||0!=(n=t.originalLine-r.originalLine)||0!=(n=t.originalColumn-r.originalColumn)?n:h(t.name,r.name)},r.compareByGeneratedPositionsInflated=function(t,r){var i=t.generatedLine-r.generatedLine;return 0!==i||0!=(i=t.generatedColumn-r.generatedColumn)||0!==(i=h(t.source,r.source))||0!=(i=t.originalLine-r.originalLine)||0!=(i=t.originalColumn-r.originalColumn)?i:h(t.name,r.name)},r.parseSourceMapInput=function(t){return JSON.parse(t.replace(/^\)]}'[^\n]*\n/,""))},r.computeSourceURL=function(t,r,i){if(r=r||"",t&&("/"!==t[t.length-1]&&"/"!==r[0]&&(t+="/"),r=t+r),i){var n=o(i);if(!n)throw Error("sourceMapURL could not be parsed");if(n.path){var u=n.path.lastIndexOf("/");u>=0&&(n.path=n.path.substring(0,u+1))}r=l(s(n),r)}return a(r)}},4167(t,r,i){i(4963).x,r.SourceMapConsumer=i(2660).SourceMapConsumer,i(7957)},3533(t,r,i){"use strict";let n=i(857),o=i(2018),s=i(9614),{env:a}=process,l;function u(t,r={}){var i;return 0!==(i=function(t,{streamIsTTY:r,sniffFlags:i=!0}={}){let o=function(){if("FORCE_COLOR"in a)return"true"===a.FORCE_COLOR?1:"false"===a.FORCE_COLOR?0:0===a.FORCE_COLOR.length?1:Math.min(Number.parseInt(a.FORCE_COLOR,10),3)}();void 0!==o&&(l=o);let u=i?l:o;if(0===u)return 0;if(i){if(s("color=16m")||s("color=full")||s("color=truecolor"))return 3;if(s("color=256"))return 2}if(t&&!r&&void 0===u)return 0;let c=u||0;if("dumb"===a.TERM)return c;if("win32"===process.platform){let d=n.release().split(".");return Number(d[0])>=10&&Number(d[2])>=10586?Number(d[2])>=14931?3:2:1}if("CI"in a)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(t=>t in a)||"codeship"===a.CI_NAME?1:c;if("TEAMCITY_VERSION"in a)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0;if("truecolor"===a.COLORTERM)return 3;if("TERM_PROGRAM"in a){let h=Number.parseInt((a.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(a.TERM_PROGRAM){case"iTerm.app":return h>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||"COLORTERM"in a?1:c}(t,{streamIsTTY:t&&t.isTTY,...r}))&&{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}s("no-color")||s("no-colors")||s("color=false")||s("color=never")?l=0:(s("color")||s("colors")||s("color=true")||s("color=always"))&&(l=1),t.exports={supportsColor:u,stdout:u({isTTY:o.isatty(1)}),stderr:u({isTTY:o.isatty(2)})}},9830(t,r,i){"use strict";var n,o,s;i.r(r),i.d(r,{clearInterval:()=>h,clearTimeout:()=>f,setInterval:()=>p,setTimeout:()=>g});let a=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,l=new WeakMap,u,c=(o=(n=l,(t,r)=>(n.set(t,r),r)),s=l,t=>{let r=s.get(t),i=void 0===r?t.size:r<1073741824?r+1:0;if(!t.has(i))return o(t,i);if(t.size<536870912){for(;t.has(i);)i=Math.floor(1073741824*Math.random());return o(t,i)}if(t.size>a)throw Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;t.has(i);)i=Math.floor(Math.random()*a);return o(t,i)}),d=(u=null,()=>{if(null!==u)return u;let t=new Blob(['(()=>{"use strict";const e=new Map,t=new Map,r=(e,t)=>{let r,o;const i=performance.now();r=i,o=e-Math.max(0,i-t);return{expected:r+o,remainingDelay:o}},o=(e,t,r,i)=>{const s=performance.now();s>r?postMessage({id:null,method:"call",params:{timerId:t,timerType:i}}):e.set(t,setTimeout(o,r-s,e,t,r,i))};addEventListener("message",(i=>{let{data:s}=i;try{if("clear"===s.method){const{id:r,params:{timerId:o,timerType:i}}=s;if("interval"===i)(t=>{const r=e.get(t);if(void 0===r)throw new Error(\'There is no interval scheduled with the given id "\'.concat(t,\'".\'));clearTimeout(r),e.delete(t)})(o),postMessage({error:null,id:r});else{if("timeout"!==i)throw new Error(\'The given type "\'.concat(i,\'" is not supported\'));(e=>{const r=t.get(e);if(void 0===r)throw new Error(\'There is no timeout scheduled with the given id "\'.concat(e,\'".\'));clearTimeout(r),t.delete(e)})(o),postMessage({error:null,id:r})}}else{if("set"!==s.method)throw new Error(\'The given method "\'.concat(s.method,\'" is not supported\'));{const{params:{delay:i,now:n,timerId:a,timerType:d}}=s;if("interval"===d)((t,i,s)=>{const{expected:n,remainingDelay:a}=r(t,s);e.set(i,setTimeout(o,a,e,i,n,"interval"))})(i,a,n);else{if("timeout"!==d)throw new Error(\'The given type "\'.concat(d,\'" is not supported\'));((e,i,s)=>{const{expected:n,remainingDelay:a}=r(e,s);t.set(i,setTimeout(o,a,t,i,n,"timeout"))})(i,a,n)}}}}catch(e){postMessage({error:{message:e.message},id:s.id,result:null})}}))})();'],{type:"application/javascript; charset=utf-8"}),r=URL.createObjectURL(t);return u=(t=>{let r=new Map([[0,()=>{}]]),i=new Map([[0,()=>{}]]),n=new Map,o=new Worker(t);return o.addEventListener("message",({data:t})=>{var o,s;if(void 0!==(o=t).method&&"call"===o.method){let{params:{timerId:a,timerType:l}}=t;if("interval"===l){let u=r.get(a);if("number"==typeof u){let c=n.get(u);if(void 0===c||c.timerId!==a||c.timerType!==l)throw Error("The timer is in an undefined state.")}else{if(void 0===u)throw Error("The timer is in an undefined state.");u()}}else if("timeout"===l){let d=i.get(a);if("number"==typeof d){let h=n.get(d);if(void 0===h||h.timerId!==a||h.timerType!==l)throw Error("The timer is in an undefined state.")}else{if(void 0===d)throw Error("The timer is in an undefined state.");d(),i.delete(a)}}}else{if(!(null===(s=t).error&&"number"==typeof s.id)){let{error:{message:f}}=t;throw Error(f)}{let{id:p}=t,g=n.get(p);if(void 0===g)throw Error("The timer is in an undefined state.");let{timerId:b,timerType:m}=g;n.delete(p),"interval"===m?r.delete(b):i.delete(b)}}}),{clearInterval(t){let i=c(n);n.set(i,{timerId:t,timerType:"interval"}),r.set(t,i),o.postMessage({id:i,method:"clear",params:{timerId:t,timerType:"interval"}})},clearTimeout(t){let r=c(n);n.set(r,{timerId:t,timerType:"timeout"}),i.set(t,r),o.postMessage({id:r,method:"clear",params:{timerId:t,timerType:"timeout"}})},setInterval(t,i=0){let n=c(r);return r.set(n,()=>{t(),"function"==typeof r.get(n)&&o.postMessage({id:null,method:"set",params:{delay:i,now:performance.now(),timerId:n,timerType:"interval"}})}),o.postMessage({id:null,method:"set",params:{delay:i,now:performance.now(),timerId:n,timerType:"interval"}}),n},setTimeout(t,r=0){let n=c(i);return i.set(n,t),o.postMessage({id:null,method:"set",params:{delay:r,now:performance.now(),timerId:n,timerType:"timeout"}}),n}}})(r),setTimeout(()=>URL.revokeObjectURL(r)),u}),h=t=>d().clearInterval(t),f=t=>d().clearTimeout(t),p=(...t)=>d().setInterval(...t),g=(...t)=>d().setTimeout(...t)},2641(t,r,i){"use strict";let n=i(158);n.createWebSocketStream=i(7757),n.Server=i(904),n.Receiver=i(1076),n.Sender=i(6284),n.WebSocket=n,n.WebSocketServer=n.Server,t.exports=n},3764(t,r,i){"use strict";let{EMPTY_BUFFER:n}=i(3520),o=Buffer[Symbol.species];function s(t,r,i,n,o){for(let s=0;s<o;s++)i[n+s]=t[s]^r[3&s]}function a(t,r){for(let i=0;i<t.length;i++)t[i]^=r[3&i]}if(t.exports={concat:function(t,r){if(0===t.length)return n;if(1===t.length)return t[0];let i=Buffer.allocUnsafe(r),s=0;for(let a=0;a<t.length;a++){let l=t[a];i.set(l,s),s+=l.length}return s<r?new o(i.buffer,i.byteOffset,s):i},mask:s,toArrayBuffer:function(t){return t.length===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.length)},toBuffer:function t(r){if(t.readOnly=!0,Buffer.isBuffer(r))return r;let i;return r instanceof ArrayBuffer?i=new o(r):ArrayBuffer.isView(r)?i=new o(r.buffer,r.byteOffset,r.byteLength):(i=Buffer.from(r),t.readOnly=!1),i},unmask:a},!process.env.WS_NO_BUFFER_UTIL)try{let l=i(Object(function(){var t=Error("Cannot find module 'bufferutil'");throw t.code="MODULE_NOT_FOUND",t}()));t.exports.mask=function(t,r,i,n,o){o<48?s(t,r,i,n,o):l.mask(t,r,i,n,o)},t.exports.unmask=function(t,r){t.length<32?a(t,r):l.unmask(t,r)}}catch(u){}},3520(t){"use strict";t.exports={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP(){}}},5035(t,r,i){"use strict";let{kForOnEventAttribute:n,kListener:o}=i(3520),s=Symbol("kCode"),a=Symbol("kData"),l=Symbol("kError"),u=Symbol("kMessage"),c=Symbol("kReason"),d=Symbol("kTarget"),h=Symbol("kType"),f=Symbol("kWasClean");class p{constructor(t){this[d]=null,this[h]=t}get target(){return this[d]}get type(){return this[h]}}Object.defineProperty(p.prototype,"target",{enumerable:!0}),Object.defineProperty(p.prototype,"type",{enumerable:!0});class g extends p{constructor(t,r={}){super(t),this[s]=void 0===r.code?0:r.code,this[c]=void 0===r.reason?"":r.reason,this[f]=void 0!==r.wasClean&&r.wasClean}get code(){return this[s]}get reason(){return this[c]}get wasClean(){return this[f]}}Object.defineProperty(g.prototype,"code",{enumerable:!0}),Object.defineProperty(g.prototype,"reason",{enumerable:!0}),Object.defineProperty(g.prototype,"wasClean",{enumerable:!0});class b extends p{constructor(t,r={}){super(t),this[l]=void 0===r.error?null:r.error,this[u]=void 0===r.message?"":r.message}get error(){return this[l]}get message(){return this[u]}}Object.defineProperty(b.prototype,"error",{enumerable:!0}),Object.defineProperty(b.prototype,"message",{enumerable:!0});class m extends p{constructor(t,r={}){super(t),this[a]=void 0===r.data?null:r.data}get data(){return this[a]}}function y(t,r,i){"object"==typeof t&&t.handleEvent?t.handleEvent.call(t,i):t.call(r,i)}Object.defineProperty(m.prototype,"data",{enumerable:!0}),t.exports={CloseEvent:g,ErrorEvent:b,Event:p,EventTarget:{addEventListener(t,r,i={}){for(let s of this.listeners(t))if(!i[n]&&s[o]===r&&!s[n])return;let a;if("message"===t)a=function(t,i){let n=new m("message",{data:i?t:t.toString()});n[d]=this,y(r,this,n)};else if("close"===t)a=function(t,i){let n=new g("close",{code:t,reason:i.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});n[d]=this,y(r,this,n)};else if("error"===t)a=function(t){let i=new b("error",{error:t,message:t.message});i[d]=this,y(r,this,i)};else{if("open"!==t)return;a=function(){let t=new p("open");t[d]=this,y(r,this,t)}}a[n]=!!i[n],a[o]=r,i.once?this.once(t,a):this.on(t,a)},removeEventListener(t,r){for(let i of this.listeners(t))if(i[o]===r&&!i[n]){this.removeListener(t,i);break}}},MessageEvent:m}},168(t,r,i){"use strict";let{tokenChars:n}=i(2530);function o(t,r,i){void 0===t[r]?t[r]=[i]:t[r].push(i)}t.exports={format:function(t){return Object.keys(t).map(r=>{let i=t[r];return Array.isArray(i)||(i=[i]),i.map(t=>[r].concat(Object.keys(t).map(r=>{let i=t[r];return Array.isArray(i)||(i=[i]),i.map(t=>!0===t?r:`${r}=${t}`).join("; ")})).join("; ")).join(", ")}).join(", ")},parse:function(t){let r=Object.create(null),i,s,a=Object.create(null),l=!1,u=!1,c=!1,d=-1,h=-1,f=-1,p=0;for(;p<t.length;p++)if(h=t.charCodeAt(p),void 0===i){if(-1===f&&1===n[h])-1===d&&(d=p);else if(0===p||32!==h&&9!==h){if(59!==h&&44!==h)throw SyntaxError(`Unexpected character at index ${p}`);{if(-1===d)throw SyntaxError(`Unexpected character at index ${p}`);-1===f&&(f=p);let g=t.slice(d,f);44===h?(o(r,g,a),a=Object.create(null)):i=g,d=f=-1}}else -1===f&&-1!==d&&(f=p)}else if(void 0===s){if(-1===f&&1===n[h])-1===d&&(d=p);else if(32===h||9===h)-1===f&&-1!==d&&(f=p);else if(59===h||44===h){if(-1===d)throw SyntaxError(`Unexpected character at index ${p}`);-1===f&&(f=p),o(a,t.slice(d,f),!0),44===h&&(o(r,i,a),a=Object.create(null),i=void 0),d=f=-1}else{if(61!==h||-1===d||-1!==f)throw SyntaxError(`Unexpected character at index ${p}`);s=t.slice(d,p),d=f=-1}}else if(u){if(1!==n[h])throw SyntaxError(`Unexpected character at index ${p}`);-1===d?d=p:l||(l=!0),u=!1}else if(c){if(1===n[h])-1===d&&(d=p);else if(34===h&&-1!==d)c=!1,f=p;else{if(92!==h)throw SyntaxError(`Unexpected character at index ${p}`);u=!0}}else if(34===h&&61===t.charCodeAt(p-1))c=!0;else if(-1===f&&1===n[h])-1===d&&(d=p);else if(-1===d||32!==h&&9!==h){if(59!==h&&44!==h)throw SyntaxError(`Unexpected character at index ${p}`);{if(-1===d)throw SyntaxError(`Unexpected character at index ${p}`);-1===f&&(f=p);let b=t.slice(d,f);l&&(b=b.replace(/\\/g,""),l=!1),o(a,s,b),44===h&&(o(r,i,a),a=Object.create(null),i=void 0),s=void 0,d=f=-1}}else -1===f&&(f=p);if(-1===d||c||32===h||9===h)throw SyntaxError("Unexpected end of input");-1===f&&(f=p);let m=t.slice(d,f);return void 0===i?o(r,m,a):(void 0===s?o(a,m,!0):o(a,s,l?m.replace(/\\/g,""):m),o(r,i,a)),r}}},6957(t){"use strict";let r=Symbol("kDone"),i=Symbol("kRun");t.exports=class{constructor(t){this[r]=()=>{this.pending--,this[i]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[i]()}[i](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[r])}}}},1837(t,r,i){"use strict";let n=i(3106),o=i(3764),s=i(6957),{kStatusCode:a}=i(3520),l=Buffer[Symbol.species],u=Buffer.from([0,0,255,255]),c=Symbol("permessage-deflate"),d=Symbol("total-length"),h=Symbol("callback"),f=Symbol("buffers"),p=Symbol("error"),g;function b(t){this[f].push(t),this[d]+=t.length}function m(t){this[d]+=t.length,this[c]._maxPayload<1||this[d]<=this[c]._maxPayload?this[f].push(t):(this[p]=RangeError("Max payload size exceeded"),this[p].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[p][a]=1009,this.removeListener("data",m),this.reset())}function y(t){this[c]._inflate=null,t[a]=1007,this[h](t)}t.exports=class{constructor(t,r,i){if(this._maxPayload=0|i,this._options=t||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!r,this._deflate=null,this._inflate=null,this.params=null,!g){let n=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;g=new s(n)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[h];this._deflate.close(),this._deflate=null,t&&t(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let r=this._options,i=t.find(t=>!(!1===r.serverNoContextTakeover&&t.server_no_context_takeover||t.server_max_window_bits&&(!1===r.serverMaxWindowBits||"number"==typeof r.serverMaxWindowBits&&r.serverMaxWindowBits>t.server_max_window_bits)||"number"==typeof r.clientMaxWindowBits&&!t.client_max_window_bits));if(!i)throw Error("None of the extension offers can be accepted");return r.serverNoContextTakeover&&(i.server_no_context_takeover=!0),r.clientNoContextTakeover&&(i.client_no_context_takeover=!0),"number"==typeof r.serverMaxWindowBits&&(i.server_max_window_bits=r.serverMaxWindowBits),"number"==typeof r.clientMaxWindowBits?i.client_max_window_bits=r.clientMaxWindowBits:!0!==i.client_max_window_bits&&!1!==r.clientMaxWindowBits||delete i.client_max_window_bits,i}acceptAsClient(t){let r=t[0];if(!1===this._options.clientNoContextTakeover&&r.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(r.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&r.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(r.client_max_window_bits=this._options.clientMaxWindowBits);return r}normalizeParams(t){return t.forEach(t=>{Object.keys(t).forEach(r=>{let i=t[r];if(i.length>1)throw Error(`Parameter "${r}" must have only a single value`);if(i=i[0],"client_max_window_bits"===r){if(!0!==i){let n=+i;if(!Number.isInteger(n)||n<8||n>15)throw TypeError(`Invalid value for parameter "${r}": ${i}`);i=n}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${r}": ${i}`)}else if("server_max_window_bits"===r){let o=+i;if(!Number.isInteger(o)||o<8||o>15)throw TypeError(`Invalid value for parameter "${r}": ${i}`);i=o}else{if("client_no_context_takeover"!==r&&"server_no_context_takeover"!==r)throw Error(`Unknown parameter "${r}"`);if(!0!==i)throw TypeError(`Invalid value for parameter "${r}": ${i}`)}t[r]=i})}),t}decompress(t,r,i){g.add(n=>{this._decompress(t,r,(t,r)=>{n(),i(t,r)})})}compress(t,r,i){g.add(n=>{this._compress(t,r,(t,r)=>{n(),i(t,r)})})}_decompress(t,r,i){let s=this._isServer?"client":"server";if(!this._inflate){let a=`${s}_max_window_bits`,l="number"!=typeof this.params[a]?n.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=n.createInflateRaw({...this._options.zlibInflateOptions,windowBits:l}),this._inflate[c]=this,this._inflate[d]=0,this._inflate[f]=[],this._inflate.on("error",y),this._inflate.on("data",m)}this._inflate[h]=i,this._inflate.write(t),r&&this._inflate.write(u),this._inflate.flush(()=>{let t=this._inflate[p];if(t)return this._inflate.close(),this._inflate=null,void i(t);let n=o.concat(this._inflate[f],this._inflate[d]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[d]=0,this._inflate[f]=[],r&&this.params[`${s}_no_context_takeover`]&&this._inflate.reset()),i(null,n)})}_compress(t,r,i){let s=this._isServer?"server":"client";if(!this._deflate){let a=`${s}_max_window_bits`,u="number"!=typeof this.params[a]?n.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=n.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:u}),this._deflate[d]=0,this._deflate[f]=[],this._deflate.on("data",b)}this._deflate[h]=i,this._deflate.write(t),this._deflate.flush(n.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let t=o.concat(this._deflate[f],this._deflate[d]);r&&(t=new l(t.buffer,t.byteOffset,t.length-4)),this._deflate[h]=null,this._deflate[d]=0,this._deflate[f]=[],r&&this.params[`${s}_no_context_takeover`]&&this._deflate.reset(),i(null,t)})}}},1076(t,r,i){"use strict";let{Writable:n}=i(2203),o=i(1837),{BINARY_TYPES:s,EMPTY_BUFFER:a,kStatusCode:l,kWebSocket:u}=i(3520),{concat:c,toArrayBuffer:d,unmask:h}=i(3764),{isValidStatusCode:f,isValidUTF8:p}=i(2530),g=Buffer[Symbol.species],b=Promise.resolve(),m="function"==typeof queueMicrotask?queueMicrotask:function(t){b.then(t).catch($)};function y(t){throw t}function $(t){process.nextTick(y,t)}t.exports=class extends n{constructor(t={}){super(),this._allowSynchronousEvents=!!t.allowSynchronousEvents,this._binaryType=t.binaryType||s[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxPayload=0|t.maxPayload,this._skipUTF8Validation=!!t.skipUTF8Validation,this[u]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(t,r,i){if(8===this._opcode&&0==this._state)return i();this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(i)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new g(r.buffer,r.byteOffset+t,r.length-t),new g(r.buffer,r.byteOffset,t)}let i=Buffer.allocUnsafe(t);do{let n=this._buffers[0],o=i.length-t;t>=n.length?i.set(this._buffers.shift(),o):(i.set(new Uint8Array(n.buffer,n.byteOffset,t),o),this._buffers[0]=new g(n.buffer,n.byteOffset+t,n.length-t)),t-=n.length}while(t>0);return i}startLoop(t){this._loop=!0;do switch(this._state){case 0:this.getInfo(t);break;case 1:this.getPayloadLength16(t);break;case 2:this.getPayloadLength64(t);break;case 3:this.getMask();break;case 4:this.getData(t);break;case 5:case 6:return void(this._loop=!1)}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2)return void(this._loop=!1);let r=this.consume(2);if(48&r[0])return void t(this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3"));let i=!(64&~r[0]);if(!i||this._extensions[o.extensionName]){if(this._fin=!(128&~r[0]),this._opcode=15&r[0],this._payloadLength=127&r[1],0===this._opcode){if(i)return void t(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"));if(!this._fragmented)return void t(this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE"));this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented)return void t(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE"));this._compressed=i}else{if(!(this._opcode>7&&this._opcode<11))return void t(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE"));if(!this._fin)return void t(this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN"));if(i)return void t(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"));if(this._payloadLength>125||8===this._opcode&&1===this._payloadLength)return void t(this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"))}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=!(128&~r[1]),this._isServer){if(!this._masked)return void t(this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK"))}else if(this._masked)return void t(this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK"));126===this._payloadLength?this._state=1:127===this._payloadLength?this._state=2:this.haveLength(t)}else t(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"))}getPayloadLength16(t){this._bufferedBytes<2?this._loop=!1:(this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t))}getPayloadLength64(t){if(this._bufferedBytes<8)return void(this._loop=!1);let r=this.consume(8),i=r.readUInt32BE(0);i>2097151?t(this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=4294967296*i+r.readUInt32BE(4),this.haveLength(t))}haveLength(t){this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)?t(this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH")):this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(t){let r=a;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);r=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&h(r,this._mask)}if(this._opcode>7)this.controlMessage(r,t);else{if(this._compressed)return this._state=5,void this.decompress(r,t);r.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(r)),this.dataMessage(t)}}decompress(t,r){this._extensions[o.extensionName].decompress(t,this._fin,(t,i)=>{if(t)return r(t);if(i.length){if(this._messageLength+=i.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let n=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");return void r(n)}this._fragments.push(i)}this.dataMessage(r),0===this._state&&this.startLoop(r)})}dataMessage(t){if(!this._fin)return void(this._state=0);let r=this._messageLength,i=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let n;n="nodebuffer"===this._binaryType?c(i,r):"arraybuffer"===this._binaryType?d(c(i,r)):i,5===this._state||this._allowSynchronousEvents?(this.emit("message",n,!0),this._state=0):(this._state=6,m(()=>{this.emit("message",n,!0),this._state=0,this.startLoop(t)}))}else{let o=c(i,r);if(!this._skipUTF8Validation&&!p(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");return void t(s)}5===this._state||this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=0):(this._state=6,m(()=>{this.emit("message",o,!1),this._state=0,this.startLoop(t)}))}}controlMessage(t,r){if(8!==this._opcode)this._allowSynchronousEvents?(this.emit(9===this._opcode?"ping":"pong",t),this._state=0):(this._state=6,m(()=>{this.emit(9===this._opcode?"ping":"pong",t),this._state=0,this.startLoop(r)}));else{if(0===t.length)this._loop=!1,this.emit("conclude",1005,a),this.end();else{let i=t.readUInt16BE(0);if(!f(i)){let n=this.createError(RangeError,`invalid status code ${i}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");return void r(n)}let o=new g(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!p(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");return void r(s)}this._loop=!1,this.emit("conclude",i,o),this.end()}this._state=0}}createError(t,r,i,n,o){this._loop=!1,this._errored=!0;let s=new t(i?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(s,this.createError),s.code=o,s[l]=n,s}}},6284(t,r,i){"use strict";let{Duplex:n}=i(2203),{randomFillSync:o}=i(6982),s=i(1837),{EMPTY_BUFFER:a}=i(3520),{isValidStatusCode:l}=i(2530),{mask:u,toBuffer:c}=i(3764),d=Symbol("kByteLength"),h=Buffer.alloc(4);class f{constructor(t,r,i){this._extensions=r||{},i&&(this._generateMask=i,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(t,r){let i,n,s=!1,a=2,l=!1;r.mask&&(i=r.maskBuffer||h,r.generateMask?r.generateMask(i):o(i,0,4),l=!(i[0]|i[1]|i[2]|i[3]),a=6),"string"==typeof t?n=r.mask&&!l||void 0===r[d]?(t=Buffer.from(t)).length:r[d]:(n=t.length,s=r.mask&&r.readOnly&&!l);let c=n;n>=65536?(a+=8,c=127):n>125&&(a+=2,c=126);let f=Buffer.allocUnsafe(s?n+a:a);return f[0]=r.fin?128|r.opcode:r.opcode,r.rsv1&&(f[0]|=64),f[1]=c,126===c?f.writeUInt16BE(n,2):127===c&&(f[2]=f[3]=0,f.writeUIntBE(n,4,6)),r.mask?(f[1]|=128,f[a-4]=i[0],f[a-3]=i[1],f[a-2]=i[2],f[a-1]=i[3],l?[f,t]:s?(u(t,i,f,a,n),[f]):(u(t,i,t,0,n),[f,t])):[f,t]}close(t,r,i,n){let o;if(void 0===t)o=a;else{if("number"!=typeof t||!l(t))throw TypeError("First argument must be a valid error code number");if(void 0!==r&&r.length){let s=Buffer.byteLength(r);if(s>123)throw RangeError("The message must not be greater than 123 bytes");(o=Buffer.allocUnsafe(2+s)).writeUInt16BE(t,0),"string"==typeof r?o.write(r,2):o.set(r,2)}else(o=Buffer.allocUnsafe(2)).writeUInt16BE(t,0)}let u={[d]:o.length,fin:!0,generateMask:this._generateMask,mask:i,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,o,!1,u,n]):this.sendFrame(f.frame(o,u),n)}ping(t,r,i){let n,o;if("string"==typeof t?(n=Buffer.byteLength(t),o=!1):(n=(t=c(t)).length,o=c.readOnly),n>125)throw RangeError("The data size must not be greater than 125 bytes");let s={[d]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:9,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,s,i]):this.sendFrame(f.frame(t,s),i)}pong(t,r,i){let n,o;if("string"==typeof t?(n=Buffer.byteLength(t),o=!1):(n=(t=c(t)).length,o=c.readOnly),n>125)throw RangeError("The data size must not be greater than 125 bytes");let s={[d]:n,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:10,readOnly:o,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,s,i]):this.sendFrame(f.frame(t,s),i)}send(t,r,i){let n=this._extensions[s.extensionName],o,a,l=r.binary?2:1,u=r.compress;if("string"==typeof t?(o=Buffer.byteLength(t),a=!1):(o=(t=c(t)).length,a=c.readOnly),this._firstFragment?(this._firstFragment=!1,u&&n&&n.params[n._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(u=o>=n._threshold),this._compress=u):(u=!1,l=0),r.fin&&(this._firstFragment=!0),n){let h={[d]:o,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:l,readOnly:a,rsv1:u};this._deflating?this.enqueue([this.dispatch,t,this._compress,h,i]):this.dispatch(t,this._compress,h,i)}else this.sendFrame(f.frame(t,{[d]:o,fin:r.fin,generateMask:this._generateMask,mask:r.mask,maskBuffer:this._maskBuffer,opcode:l,readOnly:a,rsv1:!1}),i)}dispatch(t,r,i,n){if(!r)return void this.sendFrame(f.frame(t,i),n);let o=this._extensions[s.extensionName];this._bufferedBytes+=i[d],this._deflating=!0,o.compress(t,i.fin,(t,r)=>{if(this._socket.destroyed){let o=Error("The socket was closed while data was being compressed");"function"==typeof n&&n(o);for(let s=0;s<this._queue.length;s++){let a=this._queue[s],l=a[a.length-1];"function"==typeof l&&l(o)}}else this._bufferedBytes-=i[d],this._deflating=!1,i.readOnly=!1,this.sendFrame(f.frame(r,i),n),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][d],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][d],this._queue.push(t)}sendFrame(t,r){2===t.length?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],r),this._socket.uncork()):this._socket.write(t[0],r)}}t.exports=f},7757(t,r,i){"use strict";let{Duplex:n}=i(2203);function o(t){t.emit("close")}function s(){!this.destroyed&&this._writableState.finished&&this.destroy()}function a(t){this.removeListener("error",a),this.destroy(),0===this.listenerCount("error")&&this.emit("error",t)}t.exports=function(t,r){let i=!0,l=new n({...r,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return t.on("message",function(r,i){let n=!i&&l._readableState.objectMode?r.toString():r;l.push(n)||t.pause()}),t.once("error",function(t){l.destroyed||(i=!1,l.destroy(t))}),t.once("close",function(){l.destroyed||l.push(null)}),l._destroy=function(r,n){if(t.readyState===t.CLOSED)return n(r),void process.nextTick(o,l);let s=!1;t.once("error",function(t){s=!0,n(t)}),t.once("close",function(){s||n(r),process.nextTick(o,l)}),i&&t.terminate()},l._final=function(r){t.readyState!==t.CONNECTING?null!==t._socket&&(t._socket._writableState.finished?(r(),l._readableState.endEmitted&&l.destroy()):(t._socket.once("finish",function(){r()}),t.close())):t.once("open",function(){l._final(r)})},l._read=function(){t.isPaused&&t.resume()},l._write=function(r,i,n){t.readyState!==t.CONNECTING?t.send(r,n):t.once("open",function(){l._write(r,i,n)})},l.on("end",s),l.on("error",a),l}},1499(t,r,i){"use strict";let{tokenChars:n}=i(2530);t.exports={parse:function(t){let r=new Set,i=-1,o=-1,s=0;for(;s<t.length;s++){let a=t.charCodeAt(s);if(-1===o&&1===n[a])-1===i&&(i=s);else if(0===s||32!==a&&9!==a){if(44!==a)throw SyntaxError(`Unexpected character at index ${s}`);{if(-1===i)throw SyntaxError(`Unexpected character at index ${s}`);-1===o&&(o=s);let l=t.slice(i,o);if(r.has(l))throw SyntaxError(`The "${l}" subprotocol is duplicated`);r.add(l),i=o=-1}}else -1===o&&-1!==i&&(o=s)}if(-1===i||-1!==o)throw SyntaxError("Unexpected end of input");let u=t.slice(i,s);if(r.has(u))throw SyntaxError(`The "${u}" subprotocol is duplicated`);return r.add(u),r}}},2530(t,r,i){"use strict";let{isUtf8:n}=i(181);function o(t){let r=t.length,i=0;for(;i<r;)if(128&t[i]){if(192==(224&t[i])){if(i+1===r||128!=(192&t[i+1])||192==(254&t[i]))return!1;i+=2}else if(224==(240&t[i])){if(i+2>=r||128!=(192&t[i+1])||128!=(192&t[i+2])||224===t[i]&&128==(224&t[i+1])||237===t[i]&&160==(224&t[i+1]))return!1;i+=3}else{if(240!=(248&t[i])||i+3>=r||128!=(192&t[i+1])||128!=(192&t[i+2])||128!=(192&t[i+3])||240===t[i]&&128==(240&t[i+1])||244===t[i]&&t[i+1]>143||t[i]>244)return!1;i+=4}}else i++;return!0}if(t.exports={isValidStatusCode:function(t){return t>=1e3&&t<=1014&&1004!==t&&1005!==t&&1006!==t||t>=3e3&&t<=4999},isValidUTF8:o,tokenChars:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0]},n)t.exports.isValidUTF8=function(t){return t.length<24?o(t):n(t)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let s=i(Object(function(){var t=Error("Cannot find module 'utf-8-validate'");throw t.code="MODULE_NOT_FOUND",t}()));t.exports.isValidUTF8=function(t){return t.length<32?o(t):s(t)}}catch(a){}},904(t,r,i){"use strict";let n=i(4434),o=i(8611),{Duplex:s}=i(2203),{createHash:a}=i(6982),l=i(168),u=i(1837),c=i(1499),d=i(158),{GUID:h,kWebSocket:f}=i(3520),p=/^[+/0-9A-Za-z]{22}==$/;function g(t){t._state=2,t.emit("close")}function b(){this.destroy()}function m(t,r,i,n){i=i||o.STATUS_CODES[r],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(i),...n},t.once("finish",t.destroy),t.end(`HTTP/1.1 ${r} ${o.STATUS_CODES[r]}\r
|
|
4
|
+
`+Object.keys(n).map(t=>`${t}: ${n[t]}`).join("\r\n")+"\r\n\r\n"+i)}function y(t,r,i,n,o){if(t.listenerCount("wsClientError")){let s=Error(o);Error.captureStackTrace(s,y),t.emit("wsClientError",s,i,r)}else m(i,n,o)}t.exports=class extends n{constructor(t,r){if(super(),null==(t={allowSynchronousEvents:!1,autoPong:!0,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:d,...t}).port&&!t.server&&!t.noServer||null!=t.port&&(t.server||t.noServer)||t.server&&t.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(null!=t.port?(this._server=o.createServer((t,r)=>{let i=o.STATUS_CODES[426];r.writeHead(426,{"Content-Length":i.length,"Content-Type":"text/plain"}),r.end(i)}),this._server.listen(t.port,t.host,t.backlog,r)):t.server&&(this._server=t.server),this._server){let i=this.emit.bind(this,"connection");this._removeListeners=function(t,r){for(let i of Object.keys(r))t.on(i,r[i]);return function(){for(let i of Object.keys(r))t.removeListener(i,r[i])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(t,r,n)=>{this.handleUpgrade(t,r,n,i)}})}!0===t.perMessageDeflate&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(2===this._state)return t&&this.once("close",()=>{t(Error("The server is not running"))}),void process.nextTick(g,this);if(t&&this.once("close",t),1!==this._state){if(this._state=1,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients&&this.clients.size?this._shouldEmitClose=!0:process.nextTick(g,this);else{let r=this._server;this._removeListeners(),this._removeListeners=this._server=null,r.close(()=>{g(this)})}}}shouldHandle(t){if(this.options.path){let r=t.url.indexOf("?");if((-1!==r?t.url.slice(0,r):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,r,i,n){r.on("error",b);let o=t.headers["sec-websocket-key"],s=+t.headers["sec-websocket-version"];if("GET"!==t.method)return void y(this,t,r,405,"Invalid HTTP method");if("websocket"!==t.headers.upgrade.toLowerCase())return void y(this,t,r,400,"Invalid Upgrade header");if(!o||!p.test(o))return void y(this,t,r,400,"Missing or invalid Sec-WebSocket-Key header");if(8!==s&&13!==s)return void y(this,t,r,400,"Missing or invalid Sec-WebSocket-Version header");if(!this.shouldHandle(t))return void m(r,400);let a=t.headers["sec-websocket-protocol"],d=new Set;if(void 0!==a)try{d=c.parse(a)}catch(h){return void y(this,t,r,400,"Invalid Sec-WebSocket-Protocol header")}let f=t.headers["sec-websocket-extensions"],g={};if(this.options.perMessageDeflate&&void 0!==f){let $=new u(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let w=l.parse(f);w[u.extensionName]&&($.accept(w[u.extensionName]),g[u.extensionName]=$)}catch(v){return void y(this,t,r,400,"Invalid or unacceptable Sec-WebSocket-Extensions header")}}if(this.options.verifyClient){let _={origin:t.headers[8===s?"sec-websocket-origin":"origin"],secure:!(!t.socket.authorized&&!t.socket.encrypted),req:t};if(2===this.options.verifyClient.length)return void this.options.verifyClient(_,(s,a,l,u)=>{if(!s)return m(r,a||401,l,u);this.completeUpgrade(g,o,d,t,r,i,n)});if(!this.options.verifyClient(_))return m(r,401)}this.completeUpgrade(g,o,d,t,r,i,n)}completeUpgrade(t,r,i,n,o,s,c){if(!o.readable||!o.writable)return o.destroy();if(o[f])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return m(o,503);let d=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${a("sha1").update(r+h).digest("base64")}`],p=new this.options.WebSocket(null,void 0,this.options);if(i.size){let y=this.options.handleProtocols?this.options.handleProtocols(i,n):i.values().next().value;y&&(d.push(`Sec-WebSocket-Protocol: ${y}`),p._protocol=y)}if(t[u.extensionName]){let $=t[u.extensionName].params,w=l.format({[u.extensionName]:[$]});d.push(`Sec-WebSocket-Extensions: ${w}`),p._extensions=t}this.emit("headers",d,n),o.write(d.concat("\r\n").join("\r\n")),o.removeListener("error",b),p.setSocket(o,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(g,this)})),c(p,n)}}},158(t,r,i){"use strict";let n=i(4434),o=i(5692),s=i(8611),a=i(9278),l=i(4756),{randomBytes:u,createHash:c}=i(6982),{Duplex:d,Readable:h}=i(2203),{URL:f}=i(7016),p=i(1837),g=i(1076),b=i(6284),{BINARY_TYPES:m,EMPTY_BUFFER:y,GUID:$,kForOnEventAttribute:w,kListener:v,kStatusCode:_,kWebSocket:S,NOOP:E}=i(3520),{EventTarget:{addEventListener:k,removeEventListener:A}}=i(5035),{format:R,parse:T}=i(168),{toBuffer:I}=i(3764),C=Symbol("kAborted"),P=[8,13],x=["CONNECTING","OPEN","CLOSING","CLOSED"],M=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class O extends n{constructor(t,r,i){super(),this._binaryType=m[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=y,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=O.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==t?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,void 0===r?r=[]:Array.isArray(r)||("object"==typeof r&&null!==r?(i=r,r=[]):r=[r]),function t(r,i,n,a){let l={allowSynchronousEvents:!1,autoPong:!0,protocolVersion:P[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...a,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=l.autoPong,!P.includes(l.protocolVersion))throw RangeError(`Unsupported protocol version: ${l.protocolVersion} (supported versions: ${P.join(", ")})`);let d;if(i instanceof f)d=i;else try{d=new f(i)}catch(h){throw SyntaxError(`Invalid URL: ${i}`)}"http:"===d.protocol?d.protocol="ws:":"https:"===d.protocol&&(d.protocol="wss:"),r._url=d.href;let g="wss:"===d.protocol,b="ws+unix:"===d.protocol,m;if("ws:"===d.protocol||g||b?b&&!d.pathname?m="The URL's pathname is empty":d.hash&&(m="The URL contains a fragment identifier"):m='The URL\'s protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"',m){let y=SyntaxError(m);if(0===r._redirects)throw y;return void N(r,y)}let w=g?443:80,v=u(16).toString("base64"),_=g?o.request:s.request,S=new Set,E,k;if(l.createConnection=g?D:L,l.defaultPort=l.defaultPort||w,l.port=d.port||w,l.host=d.hostname.startsWith("[")?d.hostname.slice(1,-1):d.hostname,l.headers={...l.headers,"Sec-WebSocket-Version":l.protocolVersion,"Sec-WebSocket-Key":v,Connection:"Upgrade",Upgrade:"websocket"},l.path=d.pathname+d.search,l.timeout=l.handshakeTimeout,l.perMessageDeflate&&(E=new p(!0!==l.perMessageDeflate?l.perMessageDeflate:{},!1,l.maxPayload),l.headers["Sec-WebSocket-Extensions"]=R({[p.extensionName]:E.offer()})),n.length){for(let A of n){if("string"!=typeof A||!M.test(A)||S.has(A))throw SyntaxError("An invalid or duplicated subprotocol was specified");S.add(A)}l.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(l.origin&&(l.protocolVersion<13?l.headers["Sec-WebSocket-Origin"]=l.origin:l.headers.Origin=l.origin),(d.username||d.password)&&(l.auth=`${d.username}:${d.password}`),b){let I=l.path.split(":");l.socketPath=I[0],l.path=I[1]}if(l.followRedirects){if(0===r._redirects){r._originalIpc=b,r._originalSecure=g,r._originalHostOrSocketPath=b?l.socketPath:d.host;let x=a&&a.headers;if(a={...a,headers:{}},x)for(let[U,B]of Object.entries(x))a.headers[U.toLowerCase()]=B}else if(0===r.listenerCount("redirect")){let F=b?!!r._originalIpc&&l.socketPath===r._originalHostOrSocketPath:!r._originalIpc&&d.host===r._originalHostOrSocketPath;F&&(!r._originalSecure||g)||(delete l.headers.authorization,delete l.headers.cookie,F||delete l.headers.host,l.auth=void 0)}l.auth&&!a.headers.authorization&&(a.headers.authorization="Basic "+Buffer.from(l.auth).toString("base64")),k=r._req=_(l),r._redirects&&r.emit("redirect",r.url,k)}else k=r._req=_(l);l.timeout&&k.on("timeout",()=>{W(r,k,"Opening handshake has timed out")}),k.on("error",t=>{null===k||k[C]||(k=r._req=null,N(r,t))}),k.on("response",o=>{let s=o.headers.location,u=o.statusCode;if(s&&l.followRedirects&&u>=300&&u<400){if(++r._redirects>l.maxRedirects)return void W(r,k,"Maximum redirects exceeded");let c;k.abort();try{c=new f(s,i)}catch(d){let h=SyntaxError(`Invalid URL: ${s}`);return void N(r,h)}t(r,c,n,a)}else r.emit("unexpected-response",k,o)||W(r,k,`Unexpected server response: ${o.statusCode}`)}),k.on("upgrade",(t,i,n)=>{if(r.emit("upgrade",t),r.readyState!==O.CONNECTING)return;if(k=r._req=null,"websocket"!==t.headers.upgrade.toLowerCase())return void W(r,i,"Invalid Upgrade header");let o=c("sha1").update(v+$).digest("base64");if(t.headers["sec-websocket-accept"]!==o)return void W(r,i,"Invalid Sec-WebSocket-Accept header");let s=t.headers["sec-websocket-protocol"],a;if(void 0!==s?S.size?S.has(s)||(a="Server sent an invalid subprotocol"):a="Server sent a subprotocol but none was requested":S.size&&(a="Server sent no subprotocol"),a)return void W(r,i,a);s&&(r._protocol=s);let u=t.headers["sec-websocket-extensions"];if(void 0!==u){if(!E)return void W(r,i,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");let d;try{d=T(u)}catch(h){return void W(r,i,"Invalid Sec-WebSocket-Extensions header")}let f=Object.keys(d);if(1!==f.length||f[0]!==p.extensionName)return void W(r,i,"Server indicated an extension that was not requested");try{E.accept(d[p.extensionName])}catch(g){return void W(r,i,"Invalid Sec-WebSocket-Extensions header")}r._extensions[p.extensionName]=E}r.setSocket(i,n,{allowSynchronousEvents:l.allowSynchronousEvents,generateMask:l.generateMask,maxPayload:l.maxPayload,skipUTF8Validation:l.skipUTF8Validation})}),l.finishRequest?l.finishRequest(k,r):k.end()}(this,t,r,i)):(this._autoPong=i.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){m.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,r,i){let n=new g({allowSynchronousEvents:i.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation});this._sender=new b(t,this._extensions,i.generateMask),this._receiver=n,this._socket=t,n[S]=this,t[S]=this,n.on("conclude",B),n.on("drain",F),n.on("error",j),n.on("message",G),n.on("ping",q),n.on("pong",K),t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),r.length>0&&t.unshift(r),t.on("close",z),t.on("data",Q),t.on("end",Y),t.on("error",X),this._readyState=O.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=O.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[p.extensionName]&&this._extensions[p.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=O.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,r){this.readyState!==O.CLOSED&&(this.readyState!==O.CONNECTING?this.readyState!==O.CLOSING?(this._readyState=O.CLOSING,this._sender.close(t,r,!this._isServer,t=>{t||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end():W(this,this._req,"WebSocket was closed before the connection was established"))}pause(){this.readyState!==O.CONNECTING&&this.readyState!==O.CLOSED&&(this._paused=!0,this._socket.pause())}ping(t,r,i){if(this.readyState===O.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof t?(i=t,t=r=void 0):"function"==typeof r&&(i=r,r=void 0),"number"==typeof t&&(t=t.toString()),this.readyState===O.OPEN?(void 0===r&&(r=!this._isServer),this._sender.ping(t||y,r,i)):U(this,t,i)}pong(t,r,i){if(this.readyState===O.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof t?(i=t,t=r=void 0):"function"==typeof r&&(i=r,r=void 0),"number"==typeof t&&(t=t.toString()),this.readyState===O.OPEN?(void 0===r&&(r=!this._isServer),this._sender.pong(t||y,r,i)):U(this,t,i)}resume(){this.readyState!==O.CONNECTING&&this.readyState!==O.CLOSED&&(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,r,i){if(this.readyState===O.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof r&&(i=r,r={}),"number"==typeof t&&(t=t.toString()),this.readyState!==O.OPEN)return void U(this,t,i);let n={binary:"string"!=typeof t,mask:!this._isServer,compress:!0,fin:!0,...r};this._extensions[p.extensionName]||(n.compress=!1),this._sender.send(t||y,n,i)}terminate(){this.readyState!==O.CLOSED&&(this.readyState!==O.CONNECTING?this._socket&&(this._readyState=O.CLOSING,this._socket.destroy()):W(this,this._req,"WebSocket was closed before the connection was established"))}}function N(t,r){t._readyState=O.CLOSING,t.emit("error",r),t.emitClose()}function L(t){return t.path=t.socketPath,a.connect(t)}function D(t){return t.path=void 0,t.servername||""===t.servername||(t.servername=a.isIP(t.host)?"":t.host),l.connect(t)}function W(t,r,i){t._readyState=O.CLOSING;let n=Error(i);Error.captureStackTrace(n,W),r.setHeader?(r[C]=!0,r.abort(),r.socket&&!r.socket.destroyed&&r.socket.destroy(),process.nextTick(N,t,n)):(r.destroy(n),r.once("error",t.emit.bind(t,"error")),r.once("close",t.emitClose.bind(t)))}function U(t,r,i){if(r){let n=I(r).length;t._socket?t._sender._bufferedBytes+=n:t._bufferedAmount+=n}if(i){let o=Error(`WebSocket is not open: readyState ${t.readyState} (${x[t.readyState]})`);process.nextTick(i,o)}}function B(t,r){let i=this[S];i._closeFrameReceived=!0,i._closeMessage=r,i._closeCode=t,void 0!==i._socket[S]&&(i._socket.removeListener("data",Q),process.nextTick(H,i._socket),1005===t?i.close():i.close(t,r))}function F(){let t=this[S];t.isPaused||t._socket.resume()}function j(t){let r=this[S];void 0!==r._socket[S]&&(r._socket.removeListener("data",Q),process.nextTick(H,r._socket),r.close(t[_])),r.emit("error",t)}function V(){this[S].emitClose()}function G(t,r){this[S].emit("message",t,r)}function q(t){let r=this[S];r._autoPong&&r.pong(t,!this._isServer,E),r.emit("ping",t)}function K(t){this[S].emit("pong",t)}function H(t){t.resume()}function z(){let t=this[S],r;this.removeListener("close",z),this.removeListener("data",Q),this.removeListener("end",Y),t._readyState=O.CLOSING,this._readableState.endEmitted||t._closeFrameReceived||t._receiver._writableState.errorEmitted||null===(r=t._socket.read())||t._receiver.write(r),t._receiver.end(),this[S]=void 0,clearTimeout(t._closeTimer),t._receiver._writableState.finished||t._receiver._writableState.errorEmitted?t.emitClose():(t._receiver.on("error",V),t._receiver.on("finish",V))}function Q(t){this[S]._receiver.write(t)||this.pause()}function Y(){let t=this[S];t._readyState=O.CLOSING,t._receiver.end(),this.end()}function X(){let t=this[S];this.removeListener("error",X),this.on("error",E),t&&(t._readyState=O.CLOSING,this.destroy())}Object.defineProperty(O,"CONNECTING",{enumerable:!0,value:x.indexOf("CONNECTING")}),Object.defineProperty(O.prototype,"CONNECTING",{enumerable:!0,value:x.indexOf("CONNECTING")}),Object.defineProperty(O,"OPEN",{enumerable:!0,value:x.indexOf("OPEN")}),Object.defineProperty(O.prototype,"OPEN",{enumerable:!0,value:x.indexOf("OPEN")}),Object.defineProperty(O,"CLOSING",{enumerable:!0,value:x.indexOf("CLOSING")}),Object.defineProperty(O.prototype,"CLOSING",{enumerable:!0,value:x.indexOf("CLOSING")}),Object.defineProperty(O,"CLOSED",{enumerable:!0,value:x.indexOf("CLOSED")}),Object.defineProperty(O.prototype,"CLOSED",{enumerable:!0,value:x.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(t=>{Object.defineProperty(O.prototype,t,{enumerable:!0})}),["open","error","close","message"].forEach(t=>{Object.defineProperty(O.prototype,`on${t}`,{enumerable:!0,get(){for(let r of this.listeners(t))if(r[w])return r[v];return null},set(r){for(let i of this.listeners(t))if(i[w]){this.removeListener(t,i);break}"function"==typeof r&&this.addEventListener(t,r,{[w]:!0})}})}),O.prototype.addEventListener=k,O.prototype.removeEventListener=A,t.exports=O},181(t){"use strict";t.exports=require("buffer")},6982(t){"use strict";t.exports=require("crypto")},4434(t){"use strict";t.exports=require("events")},9896(t){"use strict";t.exports=require("fs")},8611(t){"use strict";t.exports=require("http")},5692(t){"use strict";t.exports=require("https")},9278(t){"use strict";t.exports=require("net")},857(t){"use strict";t.exports=require("os")},6928(t){"use strict";t.exports=require("path")},2203(t){"use strict";t.exports=require("stream")},3193(t){"use strict";t.exports=require("string_decoder")},4756(t){"use strict";t.exports=require("tls")},2018(t){"use strict";t.exports=require("tty")},7016(t){"use strict";t.exports=require("url")},9023(t){"use strict";t.exports=require("util")},3106(t){"use strict";t.exports=require("zlib")},6660(t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.LRUCache=void 0;let i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,n=new Set,o="object"==typeof process&&process?process:{},s=(t,r,i,n)=>{"function"==typeof o.emitWarning?o.emitWarning(t,r,i,n):console.error(`[${i}] ${r}: ${t}`)},a=globalThis.AbortController,l=globalThis.AbortSignal;if(void 0===a){a=class{constructor(){c()}signal=new(l=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,r){this._onabort.push(r)}});abort(t){if(!this.signal.aborted){for(let r of(this.signal.reason=t,this.signal.aborted=!0,this.signal._onabort))r(t);this.signal.onabort?.(t)}}};let u="1"!==o.env?.LRU_CACHE_IGNORE_AC_WARNING,c=()=>{u&&(u=!1,s("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",c))}}Symbol("type");let d=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),h=t=>d(t)?t<=256?Uint8Array:t<=65536?Uint16Array:t<=4294967296?Uint32Array:t<=Number.MAX_SAFE_INTEGER?f:null:null;class f extends Array{constructor(t){super(t),this.fill(0)}}class p{heap;length;static #a=!1;static create(t){let r=h(t);if(!r)return[];p.#a=!0;let i=new p(t,r);return p.#a=!1,i}constructor(t,r){if(!p.#a)throw TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class g{#b;#c;#d;#e;#f;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#g;#h;#i;#j;#k;#l;#m;#n;#o;#p;#q;#r;#s;#t;#u;#v;#w;static unsafeExposeInternals(t){return{starts:t.#s,ttls:t.#t,sizes:t.#r,keyMap:t.#i,keyList:t.#j,valList:t.#k,next:t.#l,prev:t.#m,get head(){return t.#n},get tail(){return t.#o},free:t.#p,isBackgroundFetch:r=>t.#x(r),backgroundFetch:(r,i,n,o)=>t.#y(r,i,n,o),moveToTail:r=>t.#z(r),indexes:r=>t.#A(r),rindexes:r=>t.#B(r),isStale:r=>t.#C(r)}}get max(){return this.#b}get maxSize(){return this.#c}get calculatedSize(){return this.#h}get size(){return this.#g}get fetchMethod(){return this.#f}get dispose(){return this.#d}get disposeAfter(){return this.#e}constructor(t){let{max:r=0,ttl:i,ttlResolution:o=1,ttlAutopurge:a,updateAgeOnGet:l,updateAgeOnHas:u,allowStale:c,dispose:f,disposeAfter:b,noDisposeOnSet:m,noUpdateTTL:y,maxSize:$=0,maxEntrySize:w=0,sizeCalculation:v,fetchMethod:_,noDeleteOnFetchRejection:S,noDeleteOnStaleGet:E,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:A,ignoreFetchAbort:R}=t;if(0!==r&&!d(r))throw TypeError("max option must be a nonnegative integer");let T=r?h(r):Array;if(!T)throw Error("invalid max value: "+r);if(this.#b=r,this.#c=$,this.maxEntrySize=w||this.#c,this.sizeCalculation=v,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw TypeError("sizeCalculation set to non-function")}if(void 0!==_&&"function"!=typeof _)throw TypeError("fetchMethod must be a function if specified");if(this.#f=_,this.#v=!!_,this.#i=new Map,this.#j=Array(r).fill(void 0),this.#k=Array(r).fill(void 0),this.#l=new T(r),this.#m=new T(r),this.#n=0,this.#o=0,this.#p=p.create(r),this.#g=0,this.#h=0,"function"==typeof f&&(this.#d=f),"function"==typeof b?(this.#e=b,this.#q=[]):(this.#e=void 0,this.#q=void 0),this.#u=!!this.#d,this.#w=!!this.#e,this.noDisposeOnSet=!!m,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!S,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!R,0!==this.maxEntrySize){if(0!==this.#c&&!d(this.#c))throw TypeError("maxSize must be a positive integer if specified");if(!d(this.maxEntrySize))throw TypeError("maxEntrySize must be a positive integer if specified");this.#D()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!E,this.updateAgeOnGet=!!l,this.updateAgeOnHas=!!u,this.ttlResolution=d(o)||0===o?o:1,this.ttlAutopurge=!!a,this.ttl=i||0,this.ttl){if(!d(this.ttl))throw TypeError("ttl must be a positive integer if specified");this.#E()}if(0===this.#b&&0===this.ttl&&0===this.#c)throw TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#b&&!this.#c){var I;let C="LRU_CACHE_UNBOUNDED";I=C,n.has(I)||(n.add(C),s("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",C,g))}}getRemainingTTL(t){return this.#i.has(t)?1/0:0}#E(){let b=new f(this.#b),m=new f(this.#b);this.#t=b,this.#s=m,this.#F=(t,r,n=i.now())=>{if(m[t]=0!==r?n:0,b[t]=r,0!==r&&this.ttlAutopurge){let o=setTimeout(()=>{this.#C(t)&&this.delete(this.#j[t])},r+1);o.unref&&o.unref()}},this.#G=t=>{m[t]=0!==b[t]?i.now():0},this.#H=(t,r)=>{if(b[r]){let i=b[r],n=m[r];if(!i||!n)return;t.ttl=i,t.start=n,t.now=y||$();let o=t.now-n;t.remainingTTL=i-o}};let y=0,$=()=>{let t=i.now();if(this.ttlResolution>0){y=t;let r=setTimeout(()=>y=0,this.ttlResolution);r.unref&&r.unref()}return t};this.getRemainingTTL=t=>{let r=this.#i.get(t);if(void 0===r)return 0;let i=b[r],n=m[r];return i&&n?i-((y||$())-n):1/0},this.#C=t=>{let r=m[t],i=b[t];return!!i&&!!r&&(y||$())-r>i}}#G=()=>{};#H=()=>{};#F=()=>{};#C=()=>!1;#D(){let w=new f(this.#b);this.#h=0,this.#r=w,this.#I=t=>{this.#h-=w[t],w[t]=0},this.#J=(t,r,i,n)=>{if(this.#x(r))return 0;if(!d(i)){if(!n)throw TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw TypeError("sizeCalculation must be a function");if(!d(i=n(r,t)))throw TypeError("sizeCalculation return invalid (expect positive integer)")}return i},this.#K=(t,r,i)=>{if(w[t]=r,this.#c){let n=this.#c-w[t];for(;this.#h>n;)this.#L(!0)}this.#h+=w[t],i&&(i.entrySize=r,i.totalCalculatedSize=this.#h)}}#I=t=>{};#K=(t,r,i)=>{};#J=(t,r,i,n)=>{if(i||n)throw TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:v=this.allowStale}={}){if(this.#g)for(let _=this.#o;this.#M(_)&&(!v&&this.#C(_)||(yield _),_!==this.#n);)_=this.#m[_]}*#B({allowStale:S=this.allowStale}={}){if(this.#g)for(let E=this.#n;this.#M(E)&&(!S&&this.#C(E)||(yield E),E!==this.#o);)E=this.#l[E]}#M(k){return void 0!==k&&this.#i.get(this.#j[k])===k}*entries(){for(let t of this.#A())void 0===this.#k[t]||void 0===this.#j[t]||this.#x(this.#k[t])||(yield[this.#j[t],this.#k[t]])}*rentries(){for(let t of this.#B())void 0===this.#k[t]||void 0===this.#j[t]||this.#x(this.#k[t])||(yield[this.#j[t],this.#k[t]])}*keys(){for(let t of this.#A()){let r=this.#j[t];void 0===r||this.#x(this.#k[t])||(yield r)}}*rkeys(){for(let t of this.#B()){let r=this.#j[t];void 0===r||this.#x(this.#k[t])||(yield r)}}*values(){for(let t of this.#A())void 0===this.#k[t]||this.#x(this.#k[t])||(yield this.#k[t])}*rvalues(){for(let t of this.#B())void 0===this.#k[t]||this.#x(this.#k[t])||(yield this.#k[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,r={}){for(let i of this.#A()){let n=this.#k[i],o=this.#x(n)?n.__staleWhileFetching:n;if(void 0!==o&&t(o,this.#j[i],this))return this.get(this.#j[i],r)}}forEach(t,r=this){for(let i of this.#A()){let n=this.#k[i],o=this.#x(n)?n.__staleWhileFetching:n;void 0!==o&&t.call(r,o,this.#j[i],this)}}rforEach(t,r=this){for(let i of this.#B()){let n=this.#k[i],o=this.#x(n)?n.__staleWhileFetching:n;void 0!==o&&t.call(r,o,this.#j[i],this)}}purgeStale(){let t=!1;for(let r of this.#B({allowStale:!0}))this.#C(r)&&(this.delete(this.#j[r]),t=!0);return t}info(t){let r=this.#i.get(t);if(void 0===r)return;let n=this.#k[r],o=this.#x(n)?n.__staleWhileFetching:n;if(void 0===o)return;let s={value:o};if(this.#t&&this.#s){let a=this.#t[r],l=this.#s[r];if(a&&l){let u=a-(i.now()-l);s.ttl=u,s.start=Date.now()}}return this.#r&&(s.size=this.#r[r]),s}dump(){let t=[];for(let r of this.#A({allowStale:!0})){let n=this.#j[r],o=this.#k[r],s=this.#x(o)?o.__staleWhileFetching:o;if(void 0===s||void 0===n)continue;let a={value:s};if(this.#t&&this.#s){a.ttl=this.#t[r];let l=i.now()-this.#s[r];a.start=Math.floor(Date.now()-l)}this.#r&&(a.size=this.#r[r]),t.unshift([n,a])}return t}load(t){for(let[r,n]of(this.clear(),t)){if(n.start){let o=Date.now()-n.start;n.start=i.now()-o}this.set(r,n.value,n)}}set(t,r,i={}){if(void 0===r)return this.delete(t),this;let{ttl:n=this.ttl,start:o,noDisposeOnSet:s=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=i,{noUpdateTTL:u=this.noUpdateTTL}=i,c=this.#J(t,r,i.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(t),this;let d=0===this.#g?void 0:this.#i.get(t);if(void 0===d)d=0===this.#g?this.#o:0!==this.#p.length?this.#p.pop():this.#g===this.#b?this.#L(!1):this.#g,this.#j[d]=t,this.#k[d]=r,this.#i.set(t,d),this.#l[this.#o]=d,this.#m[d]=this.#o,this.#o=d,this.#g++,this.#K(d,c,l),l&&(l.set="add"),u=!1;else{this.#z(d);let h=this.#k[d];if(r!==h){if(this.#v&&this.#x(h)){h.__abortController.abort(Error("replaced"));let{__staleWhileFetching:f}=h;void 0===f||s||(this.#u&&this.#d?.(f,t,"set"),this.#w&&this.#q?.push([f,t,"set"]))}else s||(this.#u&&this.#d?.(h,t,"set"),this.#w&&this.#q?.push([h,t,"set"]));if(this.#I(d),this.#K(d,c,l),this.#k[d]=r,l){l.set="replace";let p=h&&this.#x(h)?h.__staleWhileFetching:h;void 0!==p&&(l.oldValue=p)}}else l&&(l.set="update")}if(0===n||this.#t||this.#E(),this.#t&&(u||this.#F(d,n,o),l&&this.#H(l,d)),!s&&this.#w&&this.#q){let g=this.#q,b;for(;b=g?.shift();)this.#e?.(...b)}return this}pop(){try{for(;this.#g;){let t=this.#k[this.#n];if(this.#L(!0),this.#x(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#w&&this.#q){let r=this.#q,i;for(;i=r?.shift();)this.#e?.(...i)}}}#L(A){let R=this.#n,T=this.#j[R],I=this.#k[R];return this.#v&&this.#x(I)?I.__abortController.abort(Error("evicted")):(this.#u||this.#w)&&(this.#u&&this.#d?.(I,T,"evict"),this.#w&&this.#q?.push([I,T,"evict"])),this.#I(R),A&&(this.#j[R]=void 0,this.#k[R]=void 0,this.#p.push(R)),1===this.#g?(this.#n=this.#o=0,this.#p.length=0):this.#n=this.#l[R],this.#i.delete(T),this.#g--,R}has(t,r={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:n}=r,o=this.#i.get(t);if(void 0!==o){let s=this.#k[o];if(this.#x(s)&&void 0===s.__staleWhileFetching)return!1;if(!this.#C(o))return i&&this.#G(o),n&&(n.has="hit",this.#H(n,o)),!0;n&&(n.has="stale",this.#H(n,o))}else n&&(n.has="miss");return!1}peek(t,r={}){let{allowStale:i=this.allowStale}=r,n=this.#i.get(t);if(void 0===n||!i&&this.#C(n))return;let o=this.#k[n];return this.#x(o)?o.__staleWhileFetching:o}#y(C,P,x,M){let O=void 0===P?void 0:this.#k[P];if(this.#x(O))return O;let N=new a,{signal:L}=x;L?.addEventListener("abort",()=>N.abort(L.reason),{signal:N.signal});let D={signal:N.signal,options:x,context:M},W=(t,r=!1)=>{let{aborted:i}=N.signal,n=x.ignoreFetchAbort&&void 0!==t;if(x.status&&(i&&!r?(x.status.fetchAborted=!0,x.status.fetchError=N.signal.reason,n&&(x.status.fetchAbortIgnored=!0)):x.status.fetchResolved=!0),i&&!n&&!r)return U(N.signal.reason);let o=B;return this.#k[P]===B&&(void 0===t?o.__staleWhileFetching?this.#k[P]=o.__staleWhileFetching:this.delete(C):(x.status&&(x.status.fetchUpdated=!0),this.set(C,t,D.options))),t},U=t=>{let{aborted:r}=N.signal,i=r&&x.allowStaleOnFetchAbort,n=i||x.allowStaleOnFetchRejection,o=n||x.noDeleteOnFetchRejection,s=B;if(this.#k[P]===B&&(o&&void 0!==s.__staleWhileFetching?i||(this.#k[P]=s.__staleWhileFetching):this.delete(C)),n)return x.status&&void 0!==s.__staleWhileFetching&&(x.status.returnedStale=!0),s.__staleWhileFetching;if(s.__returned===s)throw t};x.status&&(x.status.fetchDispatched=!0);let B=new Promise((t,r)=>{let i=this.#f?.(C,O,D);i&&i instanceof Promise&&i.then(r=>t(void 0===r?void 0:r),r),N.signal.addEventListener("abort",()=>{x.ignoreFetchAbort&&!x.allowStaleOnFetchAbort||(t(void 0),x.allowStaleOnFetchAbort&&(t=t=>W(t,!0)))})}).then(W,t=>(x.status&&(x.status.fetchRejected=!0,x.status.fetchError=t),U(t))),F=Object.assign(B,{__abortController:N,__staleWhileFetching:O,__returned:void 0});return void 0===P?(this.set(C,F,{...D.options,status:void 0}),P=this.#i.get(C)):this.#k[P]=F,F}#x(j){if(!this.#v)return!1;let V=j;return!!V&&V instanceof Promise&&V.hasOwnProperty("__staleWhileFetching")&&V.__abortController instanceof a}async fetch(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:g,forceRefresh:b=!1,status:m,signal:y}=r;if(!this.#v)return m&&(m.fetch="get"),this.get(t,{allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:m});let $={allowStale:i,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:s,noDisposeOnSet:a,size:l,sizeCalculation:u,noUpdateTTL:c,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:m,signal:y},w=this.#i.get(t);if(void 0===w){m&&(m.fetch="miss");let v=this.#y(t,w,$,g);return v.__returned=v}{let _=this.#k[w];if(this.#x(_)){let S=i&&void 0!==_.__staleWhileFetching;return m&&(m.fetch="inflight",S&&(m.returnedStale=!0)),S?_.__staleWhileFetching:_.__returned=_}let E=this.#C(w);if(!b&&!E)return m&&(m.fetch="hit"),this.#z(w),n&&this.#G(w),m&&this.#H(m,w),_;let k=this.#y(t,w,$,g),A=void 0!==k.__staleWhileFetching&&i;return m&&(m.fetch=E?"stale":"refresh",A&&E&&(m.returnedStale=!0)),A?k.__staleWhileFetching:k.__returned=k}}get(t,r={}){let{allowStale:i=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:s}=r,a=this.#i.get(t);if(void 0!==a){let l=this.#k[a],u=this.#x(l);return s&&this.#H(s,a),this.#C(a)?(s&&(s.get="stale"),u?(s&&i&&void 0!==l.__staleWhileFetching&&(s.returnedStale=!0),i?l.__staleWhileFetching:void 0):(o||this.delete(t),s&&i&&(s.returnedStale=!0),i?l:void 0)):(s&&(s.get="hit"),u?l.__staleWhileFetching:(this.#z(a),n&&this.#G(a),l))}s&&(s.get="miss")}#N(G,q){this.#m[q]=G,this.#l[G]=q}#z(K){K!==this.#o&&(K===this.#n?this.#n=this.#l[K]:this.#N(this.#m[K],this.#l[K]),this.#N(this.#o,K),this.#o=K)}delete(t){let r=!1;if(0!==this.#g){let i=this.#i.get(t);if(void 0!==i){if(r=!0,1===this.#g)this.clear();else{this.#I(i);let n=this.#k[i];if(this.#x(n)?n.__abortController.abort(Error("deleted")):(this.#u||this.#w)&&(this.#u&&this.#d?.(n,t,"delete"),this.#w&&this.#q?.push([n,t,"delete"])),this.#i.delete(t),this.#j[i]=void 0,this.#k[i]=void 0,i===this.#o)this.#o=this.#m[i];else if(i===this.#n)this.#n=this.#l[i];else{let o=this.#m[i];this.#l[o]=this.#l[i];let s=this.#l[i];this.#m[s]=this.#m[i]}this.#g--,this.#p.push(i)}}}if(this.#w&&this.#q?.length){let a=this.#q,l;for(;l=a?.shift();)this.#e?.(...l)}return r}clear(){for(let t of this.#B({allowStale:!0})){let r=this.#k[t];if(this.#x(r))r.__abortController.abort(Error("deleted"));else{let i=this.#j[t];this.#u&&this.#d?.(r,i,"delete"),this.#w&&this.#q?.push([r,i,"delete"])}}if(this.#i.clear(),this.#k.fill(void 0),this.#j.fill(void 0),this.#t&&this.#s&&(this.#t.fill(0),this.#s.fill(0)),this.#r&&this.#r.fill(0),this.#n=0,this.#o=0,this.#p.length=0,this.#h=0,this.#g=0,this.#w&&this.#q){let n=this.#q,o;for(;o=n?.shift();)this.#e?.(...o)}}}r.LRUCache=g}},r={};function i(n){var o=r[n];if(void 0!==o)return o.exports;var s=r[n]={id:n,loaded:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.loaded=!0,s.exports}i.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return i.d(r,{a:r}),r},i.d=(t,r)=>{for(var n in r)i.o(r,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},i.o=(t,r)=>Object.prototype.hasOwnProperty.call(t,r),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t);var n={};i(9391).install(),(()=>{"use strict";i.r(n),i.d(n,{default:()=>r});var t=i(738);let r=i.n(t)()})();var o=exports;for(var s in n)o[s]=n[s];n.__esModule&&Object.defineProperty(o,"__esModule",{value:!0})})();
|