@linzumi/cli 1.0.145 → 1.0.147

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.
@@ -1,5 +1,5 @@
1
- import { createRequire } from 'node:module';
2
- const require = createRequire(import.meta.url);
1
+ import { createRequire as __linzumiBundleCreateRequire } from 'node:module';
2
+ const require = __linzumiBundleCreateRequire(import.meta.url);
3
3
  var Sx=Object.create;var kl=Object.defineProperty;var $x=Object.getOwnPropertyDescriptor;var Tx=Object.getOwnPropertyNames;var zx=Object.getPrototypeOf,Ex=Object.prototype.hasOwnProperty;var E=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Sl=(e,t)=>{for(var r in t)kl(e,r,{get:t[r],enumerable:!0})},Ax=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Tx(t))!Ex.call(e,i)&&i!==r&&kl(e,i,{get:()=>t[i],enumerable:!(n=$x(t,i))||n.enumerable});return e};var sh=(e,t,r)=>(r=e!=null?Sx(zx(e)):{},Ax(t||!e||!e.__esModule?kl(r,"default",{value:e,enumerable:!0}):r,e));var $s=E(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.regexpCode=oe.getEsmExportName=oe.getProperty=oe.safeStringify=oe.stringify=oe.strConcat=oe.addCodeArg=oe.str=oe._=oe.nil=oe._Code=oe.Name=oe.IDENTIFIER=oe._CodeOrName=void 0;var ks=class{};oe._CodeOrName=ks;oe.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var _i=class extends ks{constructor(t){if(super(),!oe.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};oe.Name=_i;var tr=class extends ks{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof _i&&(r[n.str]=(r[n.str]||0)+1),r),{})}};oe._Code=tr;oe.nil=new tr("");function bb(e,...t){let r=[e[0]],n=0;for(;n<t.length;)cp(r,t[n]),r.push(e[++n]);return new tr(r)}oe._=bb;var ap=new tr("+");function wb(e,...t){let r=[Ss(e[0])],n=0;for(;n<t.length;)r.push(ap),cp(r,t[n]),r.push(ap,Ss(e[++n]));return iP(r),new tr(r)}oe.str=wb;function cp(e,t){t instanceof tr?e.push(...t._items):t instanceof _i?e.push(t):e.push(aP(t))}oe.addCodeArg=cp;function iP(e){let t=1;for(;t<e.length-1;){if(e[t]===ap){let r=oP(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function oP(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof _i||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof _i))return`"${e}${t.slice(1)}`}function sP(e,t){return t.emptyStr()?e:e.emptyStr()?t:wb`${e}${t}`}oe.strConcat=sP;function aP(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Ss(Array.isArray(e)?e.join(","):e)}function cP(e){return new tr(Ss(e))}oe.stringify=cP;function Ss(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}oe.safeStringify=Ss;function lP(e){return typeof e=="string"&&oe.IDENTIFIER.test(e)?new tr(`.${e}`):bb`[${e}]`}oe.getProperty=lP;function uP(e){if(typeof e=="string"&&oe.IDENTIFIER.test(e))return new tr(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}oe.getEsmExportName=uP;function dP(e){return new tr(e.toString())}oe.regexpCode=dP});var dp=E(It=>{"use strict";Object.defineProperty(It,"__esModule",{value:!0});It.ValueScope=It.ValueScopeName=It.Scope=It.varKinds=It.UsedValueState=void 0;var Rt=$s(),lp=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Rc;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Rc||(It.UsedValueState=Rc={}));It.varKinds={const:new Rt.Name("const"),let:new Rt.Name("let"),var:new Rt.Name("var")};var Ic=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Rt.Name?t:this.name(t)}name(t){return new Rt.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};It.Scope=Ic;var jc=class extends Rt.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Rt._)`.${new Rt.Name(r)}[${n}]`}};It.ValueScopeName=jc;var fP=(0,Rt._)`\n`,up=class extends Ic{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?fP:Rt.nil}}get(){return this._scope}name(t){return new jc(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(t),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let u=a.get(s);if(u)return u}else a=this._values[o]=new Map;a.set(s,i);let l=this._scope[o]||(this._scope[o]=[]),c=l.length;return l[c]=r.ref,i.setValue(r,{property:o,itemIndex:c}),i}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Rt._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(t,r,n={},i){let o=Rt.nil;for(let s in t){let a=t[s];if(!a)continue;let l=n[s]=n[s]||new Map;a.forEach(c=>{if(l.has(c))return;l.set(c,Rc.Started);let u=r(c);if(u){let d=this.opts.es5?It.varKinds.var:It.varKinds.const;o=(0,Rt._)`${o}${d} ${c} = ${u};${this.opts._n}`}else if(u=i?.(c))o=(0,Rt._)`${o}${u}${this.opts._n}`;else throw new lp(c);l.set(c,Rc.Completed)})}return o}};It.ValueScope=up});var H=E(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.or=K.and=K.not=K.CodeGen=K.operators=K.varKinds=K.ValueScopeName=K.ValueScope=K.Scope=K.Name=K.regexpCode=K.stringify=K.getProperty=K.nil=K.strConcat=K.str=K._=void 0;var ne=$s(),mr=dp(),An=$s();Object.defineProperty(K,"_",{enumerable:!0,get:function(){return An._}});Object.defineProperty(K,"str",{enumerable:!0,get:function(){return An.str}});Object.defineProperty(K,"strConcat",{enumerable:!0,get:function(){return An.strConcat}});Object.defineProperty(K,"nil",{enumerable:!0,get:function(){return An.nil}});Object.defineProperty(K,"getProperty",{enumerable:!0,get:function(){return An.getProperty}});Object.defineProperty(K,"stringify",{enumerable:!0,get:function(){return An.stringify}});Object.defineProperty(K,"regexpCode",{enumerable:!0,get:function(){return An.regexpCode}});Object.defineProperty(K,"Name",{enumerable:!0,get:function(){return An.Name}});var Dc=dp();Object.defineProperty(K,"Scope",{enumerable:!0,get:function(){return Dc.Scope}});Object.defineProperty(K,"ValueScope",{enumerable:!0,get:function(){return Dc.ValueScope}});Object.defineProperty(K,"ValueScopeName",{enumerable:!0,get:function(){return Dc.ValueScopeName}});Object.defineProperty(K,"varKinds",{enumerable:!0,get:function(){return Dc.varKinds}});K.operators={GT:new ne._Code(">"),GTE:new ne._Code(">="),LT:new ne._Code("<"),LTE:new ne._Code("<="),EQ:new ne._Code("==="),NEQ:new ne._Code("!=="),NOT:new ne._Code("!"),OR:new ne._Code("||"),AND:new ne._Code("&&"),ADD:new ne._Code("+")};var tn=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},fp=class extends tn{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?mr.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=lo(this.rhs,t,r)),this}get names(){return this.rhs instanceof ne._CodeOrName?this.rhs.names:{}}},Nc=class extends tn{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof ne.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=lo(this.rhs,t,r),this}get names(){let t=this.lhs instanceof ne.Name?{}:{...this.lhs.names};return Zc(t,this.rhs)}},pp=class extends Nc{constructor(t,r,n,i){super(t,n,i),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},mp=class extends tn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},hp=class extends tn{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},gp=class extends tn{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},_p=class extends tn{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=lo(this.code,t,r),this}get names(){return this.code instanceof ne._CodeOrName?this.code.names:{}}},Ts=class extends tn{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(t,r)||(pP(t,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>bi(t,r.names),{})}},rn=class extends Ts{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},yp=class extends Ts{},co=class extends rn{};co.kind="else";var yi=class e extends rn{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new co(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(xb(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=lo(this.condition,t,r),this}get names(){let t=super.names;return Zc(t,this.condition),this.else&&bi(t,this.else.names),t}};yi.kind="if";var vi=class extends rn{};vi.kind="for";var vp=class extends vi{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=lo(this.iteration,t,r),this}get names(){return bi(super.names,this.iteration.names)}},bp=class extends vi{constructor(t,r,n,i){super(),this.varKind=t,this.name=r,this.from=n,this.to=i}render(t){let r=t.es5?mr.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(t)}get names(){let t=Zc(super.names,this.from);return Zc(t,this.to)}},Mc=class extends vi{constructor(t,r,n,i){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=i}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=lo(this.iterable,t,r),this}get names(){return bi(super.names,this.iterable.names)}},zs=class extends rn{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};zs.kind="func";var Es=class extends Ts{render(t){return"return "+super.render(t)}};Es.kind="return";var wp=class extends rn{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,i;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(i=this.finally)===null||i===void 0||i.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&bi(t,this.catch.names),this.finally&&bi(t,this.finally.names),t}},As=class extends rn{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};As.kind="catch";var Ps=class extends rn{render(t){return"finally"+super.render(t)}};Ps.kind="finally";var xp=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
4
4
  `:""},this._extScope=t,this._scope=new mr.Scope({parent:t}),this._nodes=[new yp]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,i){let o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new fp(t,o,n)),o}const(t,r,n){return this._def(mr.varKinds.const,t,r,n)}let(t,r,n){return this._def(mr.varKinds.let,t,r,n)}var(t,r,n){return this._def(mr.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Nc(t,r,n))}add(t,r){return this._leafNode(new pp(t,K.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==ne.nil&&this._leafNode(new _p(t)),this}object(...t){let r=["{"];for(let[n,i]of t)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,ne.addCodeArg)(r,i));return r.push("}"),new ne._Code(r)}if(t,r,n){if(this._blockNode(new yi(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new yi(t))}else(){return this._elseNode(new co)}endIf(){return this._endBlockNode(yi,co)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new vp(t),r)}forRange(t,r,n,i,o=this.opts.es5?mr.varKinds.var:mr.varKinds.let){let s=this._scope.toName(t);return this._for(new bp(o,s,r,n),()=>i(s))}forOf(t,r,n,i=mr.varKinds.const){let o=this._scope.toName(t);if(this.opts.es5){let s=r instanceof ne.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,ne._)`${s}.length`,a=>{this.var(o,(0,ne._)`${s}[${a}]`),n(o)})}return this._for(new Mc("of",i,o,r),()=>n(o))}forIn(t,r,n,i=this.opts.es5?mr.varKinds.var:mr.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,ne._)`Object.keys(${r})`,n);let o=this._scope.toName(t);return this._for(new Mc("in",i,o,r),()=>n(o))}endFor(){return this._endBlockNode(vi)}label(t){return this._leafNode(new mp(t))}break(t){return this._leafNode(new hp(t))}return(t){let r=new Es;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(Es)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new wp;if(this._blockNode(i),this.code(t),r){let o=this.name("e");this._currNode=i.catch=new As(o),r(o)}return n&&(this._currNode=i.finally=new Ps,this.code(n)),this._endBlockNode(As,Ps)}throw(t){return this._leafNode(new gp(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=ne.nil,n,i){return this._blockNode(new zs(t,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(zs)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof yi))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};K.CodeGen=xp;function bi(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Zc(e,t){return t instanceof ne._CodeOrName?bi(e,t.names):e}function lo(e,t,r){if(e instanceof ne.Name)return n(e);if(!i(e))return e;return new ne._Code(e._items.reduce((o,s)=>(s instanceof ne.Name&&(s=n(s)),s instanceof ne._Code?o.push(...s._items):o.push(s),o),[]));function n(o){let s=r[o.str];return s===void 0||t[o.str]!==1?o:(delete t[o.str],s)}function i(o){return o instanceof ne._Code&&o._items.some(s=>s instanceof ne.Name&&t[s.str]===1&&r[s.str]!==void 0)}}function pP(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function xb(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,ne._)`!${kp(e)}`}K.not=xb;var mP=kb(K.operators.AND);function hP(...e){return e.reduce(mP)}K.and=hP;var gP=kb(K.operators.OR);function _P(...e){return e.reduce(gP)}K.or=_P;function kb(e){return(t,r)=>t===ne.nil?r:r===ne.nil?t:(0,ne._)`${kp(t)} ${e} ${kp(r)}`}function kp(e){return e instanceof ne.Name?e:(0,ne._)`(${e})`}});var se=E(Y=>{"use strict";Object.defineProperty(Y,"__esModule",{value:!0});Y.checkStrictMode=Y.getErrorPath=Y.Type=Y.useFunc=Y.setEvaluated=Y.evaluatedPropsToName=Y.mergeEvaluated=Y.eachItem=Y.unescapeJsonPointer=Y.escapeJsonPointer=Y.escapeFragment=Y.unescapeFragment=Y.schemaRefOrVal=Y.schemaHasRulesButRef=Y.schemaHasRules=Y.checkUnknownRules=Y.alwaysValidSchema=Y.toHash=void 0;var ye=H(),yP=$s();function vP(e){let t={};for(let r of e)t[r]=!0;return t}Y.toHash=vP;function bP(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(Tb(e,t),!zb(t,e.self.RULES.all))}Y.alwaysValidSchema=bP;function Tb(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let i=n.RULES.keywords;for(let o in t)i[o]||Pb(e,`unknown keyword: "${o}"`)}Y.checkUnknownRules=Tb;function zb(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}Y.schemaHasRules=zb;function wP(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}Y.schemaHasRulesButRef=wP;function xP({topSchemaRef:e,schemaPath:t},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,ye._)`${r}`}return(0,ye._)`${e}${t}${(0,ye.getProperty)(n)}`}Y.schemaRefOrVal=xP;function kP(e){return Eb(decodeURIComponent(e))}Y.unescapeFragment=kP;function SP(e){return encodeURIComponent($p(e))}Y.escapeFragment=SP;function $p(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}Y.escapeJsonPointer=$p;function Eb(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Y.unescapeJsonPointer=Eb;function $P(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}Y.eachItem=$P;function Sb({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(i,o,s,a)=>{let l=s===void 0?o:s instanceof ye.Name?(o instanceof ye.Name?e(i,o,s):t(i,o,s),s):o instanceof ye.Name?(t(i,s,o),o):r(o,s);return a===ye.Name&&!(l instanceof ye.Name)?n(i,l):l}}Y.mergeEvaluated={props:Sb({mergeNames:(e,t,r)=>e.if((0,ye._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,ye._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,ye._)`${r} || {}`).code((0,ye._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,ye._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,ye._)`${r} || {}`),Tp(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Ab}),items:Sb({mergeNames:(e,t,r)=>e.if((0,ye._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,ye._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,ye._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,ye._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Ab(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,ye._)`{}`);return t!==void 0&&Tp(e,r,t),r}Y.evaluatedPropsToName=Ab;function Tp(e,t,r){Object.keys(r).forEach(n=>e.assign((0,ye._)`${t}${(0,ye.getProperty)(n)}`,!0))}Y.setEvaluated=Tp;var $b={};function TP(e,t){return e.scopeValue("func",{ref:t,code:$b[t.code]||($b[t.code]=new yP._Code(t.code))})}Y.useFunc=TP;var Sp;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Sp||(Y.Type=Sp={}));function zP(e,t,r){if(e instanceof ye.Name){let n=t===Sp.Num;return r?n?(0,ye._)`"[" + ${e} + "]"`:(0,ye._)`"['" + ${e} + "']"`:n?(0,ye._)`"/" + ${e}`:(0,ye._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,ye.getProperty)(e).toString():"/"+$p(e)}Y.getErrorPath=zP;function Pb(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}Y.checkStrictMode=Pb});var nn=E(zp=>{"use strict";Object.defineProperty(zp,"__esModule",{value:!0});var dt=H(),EP={data:new dt.Name("data"),valCxt:new dt.Name("valCxt"),instancePath:new dt.Name("instancePath"),parentData:new dt.Name("parentData"),parentDataProperty:new dt.Name("parentDataProperty"),rootData:new dt.Name("rootData"),dynamicAnchors:new dt.Name("dynamicAnchors"),vErrors:new dt.Name("vErrors"),errors:new dt.Name("errors"),this:new dt.Name("this"),self:new dt.Name("self"),scope:new dt.Name("scope"),json:new dt.Name("json"),jsonPos:new dt.Name("jsonPos"),jsonLen:new dt.Name("jsonLen"),jsonPart:new dt.Name("jsonPart")};zp.default=EP});var Os=E(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.extendErrors=ft.resetErrorsCount=ft.reportExtraError=ft.reportError=ft.keyword$DataError=ft.keywordError=void 0;var ie=H(),Lc=se(),wt=nn();ft.keywordError={message:({keyword:e})=>(0,ie.str)`must pass "${e}" keyword validation`};ft.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,ie.str)`"${e}" keyword must be ${t} ($data)`:(0,ie.str)`"${e}" keyword is invalid ($data)`};function AP(e,t=ft.keywordError,r,n){let{it:i}=e,{gen:o,compositeRule:s,allErrors:a}=i,l=Rb(e,t,r);n??(s||a)?Ob(o,l):Cb(i,(0,ie._)`[${l}]`)}ft.reportError=AP;function PP(e,t=ft.keywordError,r){let{it:n}=e,{gen:i,compositeRule:o,allErrors:s}=n,a=Rb(e,t,r);Ob(i,a),o||s||Cb(n,wt.default.vErrors)}ft.reportExtraError=PP;function OP(e,t){e.assign(wt.default.errors,t),e.if((0,ie._)`${wt.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,ie._)`${wt.default.vErrors}.length`,t),()=>e.assign(wt.default.vErrors,null)))}ft.resetErrorsCount=OP;function CP({gen:e,keyword:t,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw new Error("ajv implementation error");let s=e.name("err");e.forRange("i",i,wt.default.errors,a=>{e.const(s,(0,ie._)`${wt.default.vErrors}[${a}]`),e.if((0,ie._)`${s}.instancePath === undefined`,()=>e.assign((0,ie._)`${s}.instancePath`,(0,ie.strConcat)(wt.default.instancePath,o.errorPath))),e.assign((0,ie._)`${s}.schemaPath`,(0,ie.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,ie._)`${s}.schema`,r),e.assign((0,ie._)`${s}.data`,n))})}ft.extendErrors=CP;function Ob(e,t){let r=e.const("err",t);e.if((0,ie._)`${wt.default.vErrors} === null`,()=>e.assign(wt.default.vErrors,(0,ie._)`[${r}]`),(0,ie._)`${wt.default.vErrors}.push(${r})`),e.code((0,ie._)`${wt.default.errors}++`)}function Cb(e,t){let{gen:r,validateName:n,schemaEnv:i}=e;i.$async?r.throw((0,ie._)`new ${e.ValidationError}(${t})`):(r.assign((0,ie._)`${n}.errors`,t),r.return(!1))}var wi={keyword:new ie.Name("keyword"),schemaPath:new ie.Name("schemaPath"),params:new ie.Name("params"),propertyName:new ie.Name("propertyName"),message:new ie.Name("message"),schema:new ie.Name("schema"),parentSchema:new ie.Name("parentSchema")};function Rb(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,ie._)`{}`:RP(e,t,r)}function RP(e,t,r={}){let{gen:n,it:i}=e,o=[IP(i,r),jP(e,r)];return NP(e,t,o),n.object(...o)}function IP({errorPath:e},{instancePath:t}){let r=t?(0,ie.str)`${e}${(0,Lc.getErrorPath)(t,Lc.Type.Str)}`:e;return[wt.default.instancePath,(0,ie.strConcat)(wt.default.instancePath,r)]}function jP({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let i=n?t:(0,ie.str)`${t}/${e}`;return r&&(i=(0,ie.str)`${i}${(0,Lc.getErrorPath)(r,Lc.Type.Str)}`),[wi.schemaPath,i]}function NP(e,{params:t,message:r},n){let{keyword:i,data:o,schemaValue:s,it:a}=e,{opts:l,propertyName:c,topSchemaRef:u,schemaPath:d}=a;n.push([wi.keyword,i],[wi.params,typeof t=="function"?t(e):t||(0,ie._)`{}`]),l.messages&&n.push([wi.message,typeof r=="function"?r(e):r]),l.verbose&&n.push([wi.schema,s],[wi.parentSchema,(0,ie._)`${u}${d}`],[wt.default.data,o]),c&&n.push([wi.propertyName,c])}});var jb=E(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.boolOrEmptySchema=uo.topBoolOrEmptySchema=void 0;var MP=Os(),ZP=H(),DP=nn(),LP={message:"boolean schema is false"};function FP(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Ib(e,!1):typeof r=="object"&&r.$async===!0?t.return(DP.default.data):(t.assign((0,ZP._)`${n}.errors`,null),t.return(!0))}uo.topBoolOrEmptySchema=FP;function qP(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Ib(e)):r.var(t,!0)}uo.boolOrEmptySchema=qP;function Ib(e,t){let{gen:r,data:n}=e,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,MP.reportError)(i,LP,void 0,t)}});var Ep=E(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.getRules=fo.isJSONType=void 0;var UP=["string","number","integer","boolean","null","object","array"],VP=new Set(UP);function GP(e){return typeof e=="string"&&VP.has(e)}fo.isJSONType=GP;function BP(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}fo.getRules=BP});var Ap=E(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn.shouldUseRule=Pn.shouldUseGroup=Pn.schemaHasRulesForType=void 0;function JP({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Nb(e,n)}Pn.schemaHasRulesForType=JP;function Nb(e,t){return t.rules.some(r=>Mb(e,r))}Pn.shouldUseGroup=Nb;function Mb(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Pn.shouldUseRule=Mb});var Cs=E(pt=>{"use strict";Object.defineProperty(pt,"__esModule",{value:!0});pt.reportTypeError=pt.checkDataTypes=pt.checkDataType=pt.coerceAndCheckDataType=pt.getJSONTypes=pt.getSchemaTypes=pt.DataType=void 0;var WP=Ep(),HP=Ap(),KP=Os(),B=H(),Zb=se(),po;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(po||(pt.DataType=po={}));function XP(e){let t=Db(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}pt.getSchemaTypes=XP;function Db(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(WP.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}pt.getJSONTypes=Db;function YP(e,t){let{gen:r,data:n,opts:i}=e,o=QP(t,i.coerceTypes),s=t.length>0&&!(o.length===0&&t.length===1&&(0,HP.schemaHasRulesForType)(e,t[0]));if(s){let a=Op(t,n,i.strictNumbers,po.Wrong);r.if(a,()=>{o.length?eO(e,t,o):Cp(e)})}return s}pt.coerceAndCheckDataType=YP;var Lb=new Set(["string","number","integer","boolean","null"]);function QP(e,t){return t?e.filter(r=>Lb.has(r)||t==="array"&&r==="array"):[]}function eO(e,t,r){let{gen:n,data:i,opts:o}=e,s=n.let("dataType",(0,B._)`typeof ${i}`),a=n.let("coerced",(0,B._)`undefined`);o.coerceTypes==="array"&&n.if((0,B._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,B._)`${i}[0]`).assign(s,(0,B._)`typeof ${i}`).if(Op(t,i,o.strictNumbers),()=>n.assign(a,i))),n.if((0,B._)`${a} !== undefined`);for(let c of r)(Lb.has(c)||c==="array"&&o.coerceTypes==="array")&&l(c);n.else(),Cp(e),n.endIf(),n.if((0,B._)`${a} !== undefined`,()=>{n.assign(i,a),tO(e,a)});function l(c){switch(c){case"string":n.elseIf((0,B._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,B._)`"" + ${i}`).elseIf((0,B._)`${i} === null`).assign(a,(0,B._)`""`);return;case"number":n.elseIf((0,B._)`${s} == "boolean" || ${i} === null
5
5
  || (${s} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,B._)`+${i}`);return;case"integer":n.elseIf((0,B._)`${s} === "boolean" || ${i} === null
@@ -1,5 +1,5 @@
1
- import { createRequire } from 'node:module';
2
- const require = createRequire(import.meta.url);
1
+ import { createRequire as __linzumiBundleCreateRequire } from 'node:module';
2
+ const require = __linzumiBundleCreateRequire(import.meta.url);
3
3
  var lr=Object.create;var wn=Object.defineProperty;var ur=Object.getOwnPropertyDescriptor;var fr=Object.getOwnPropertyNames;var pr=Object.getPrototypeOf,gr=Object.prototype.hasOwnProperty;var E=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var A=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var mr=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of fr(n))!gr.call(e,o)&&o!==t&&wn(e,o,{get:()=>n[o],enumerable:!(r=ur(n,o))||r.enumerable});return e};var fe=(e,n,t)=>(t=e!=null?lr(pr(e)):{},mr(n||!e||!e.__esModule?wn(t,"default",{value:e,enumerable:!0}):t,e));var F=A((Oi,On)=>{"use strict";var kn=["nodebuffer","arraybuffer","fragments"],Cn=typeof Blob<"u";Cn&&kn.push("blob");On.exports={BINARY_TYPES:kn,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Cn,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var pe=A((Ei,Ce)=>{"use strict";var{EMPTY_BUFFER:hr}=F(),Ve=Buffer[Symbol.species];function yr(e,n){if(e.length===0)return hr;if(e.length===1)return e[0];let t=Buffer.allocUnsafe(n),r=0;for(let o=0;o<e.length;o++){let s=e[o];t.set(s,r),r+=s.length}return r<n?new Ve(t.buffer,t.byteOffset,r):t}function En(e,n,t,r,o){for(let s=0;s<o;s++)t[r+s]=e[s]^n[s&3]}function Pn(e,n){for(let t=0;t<e.length;t++)e[t]^=n[t&3]}function _r(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}function Ge(e){if(Ge.readOnly=!0,Buffer.isBuffer(e))return e;let n;return e instanceof ArrayBuffer?n=new Ve(e):ArrayBuffer.isView(e)?n=new Ve(e.buffer,e.byteOffset,e.byteLength):(n=Buffer.from(e),Ge.readOnly=!1),n}Ce.exports={concat:yr,mask:En,toArrayBuffer:_r,toBuffer:Ge,unmask:Pn};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=E("bufferutil");Ce.exports.mask=function(n,t,r,o,s){s<48?En(n,t,r,o,s):e.mask(n,t,r,o,s)},Ce.exports.unmask=function(n,t){n.length<32?Pn(n,t):e.unmask(n,t)}}catch{}});var An=A((Pi,In)=>{"use strict";var Tn=Symbol("kDone"),qe=Symbol("kRun"),Be=class{constructor(n){this[Tn]=()=>{this.pending--,this[qe]()},this.concurrency=n||1/0,this.jobs=[],this.pending=0}add(n){this.jobs.push(n),this[qe]()}[qe](){if(this.pending!==this.concurrency&&this.jobs.length){let n=this.jobs.shift();this.pending++,n(this[Tn])}}};In.exports=Be});var me=A((Ti,Nn)=>{"use strict";var ge=E("zlib"),Rn=pe(),xr=An(),{kStatusCode:Mn}=F(),br=Buffer[Symbol.species],vr=Buffer.from([0,0,255,255]),Ee=Symbol("permessage-deflate"),V=Symbol("total-length"),te=Symbol("callback"),B=Symbol("buffers"),re=Symbol("error"),Oe,We=class{constructor(n,t,r){if(this._maxPayload=r|0,this._options=n||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!Oe){let o=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Oe=new xr(o)}}static get extensionName(){return"permessage-deflate"}offer(){let n={};return this._options.serverNoContextTakeover&&(n.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(n.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(n.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?n.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(n.client_max_window_bits=!0),n}accept(n){return n=this.normalizeParams(n),this.params=this._isServer?this.acceptAsServer(n):this.acceptAsClient(n),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let n=this._deflate[te];this._deflate.close(),this._deflate=null,n&&n(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(n){let t=this._options,r=n.find(o=>!(t.serverNoContextTakeover===!1&&o.server_no_context_takeover||o.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>o.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!o.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(r.server_no_context_takeover=!0),t.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof t.serverMaxWindowBits=="number"&&(r.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?r.client_max_window_bits=t.clientMaxWindowBits:(r.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(n){let t=n[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(n){return n.forEach(t=>{Object.keys(t).forEach(r=>{let o=t[r];if(o.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(o=o[0],r==="client_max_window_bits"){if(o!==!0){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${o}`);o=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${o}`)}else if(r==="server_max_window_bits"){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${o}`);o=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(o!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${o}`)}else throw new Error(`Unknown parameter "${r}"`);t[r]=o})}),n}decompress(n,t,r){Oe.add(o=>{this._decompress(n,t,(s,i)=>{o(),r(s,i)})})}compress(n,t,r){Oe.add(o=>{this._compress(n,t,(s,i)=>{o(),r(s,i)})})}_decompress(n,t,r){let o=this._isServer?"client":"server";if(!this._inflate){let s=`${o}_max_window_bits`,i=typeof this.params[s]!="number"?ge.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=ge.createInflateRaw({...this._options.zlibInflateOptions,windowBits:i}),this._inflate[Ee]=this,this._inflate[V]=0,this._inflate[B]=[],this._inflate.on("error",wr),this._inflate.on("data",jn)}this._inflate[te]=r,this._inflate.write(n),t&&this._inflate.write(vr),this._inflate.flush(()=>{let s=this._inflate[re];if(s){this._inflate.close(),this._inflate=null,r(s);return}let i=Rn.concat(this._inflate[B],this._inflate[V]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[V]=0,this._inflate[B]=[],t&&this.params[`${o}_no_context_takeover`]&&this._inflate.reset()),r(null,i)})}_compress(n,t,r){let o=this._isServer?"server":"client";if(!this._deflate){let s=`${o}_max_window_bits`,i=typeof this.params[s]!="number"?ge.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=ge.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:i}),this._deflate[V]=0,this._deflate[B]=[],this._deflate.on("data",Sr)}this._deflate[te]=r,this._deflate.write(n),this._deflate.flush(ge.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Rn.concat(this._deflate[B],this._deflate[V]);t&&(s=new br(s.buffer,s.byteOffset,s.length-4)),this._deflate[te]=null,this._deflate[V]=0,this._deflate[B]=[],t&&this.params[`${o}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};Nn.exports=We;function Sr(e){this[B].push(e),this[V]+=e.length}function jn(e){if(this[V]+=e.length,this[Ee]._maxPayload<1||this[V]<=this[Ee]._maxPayload){this[B].push(e);return}this[re]=new RangeError("Max payload size exceeded"),this[re].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[re][Mn]=1009,this.removeListener("data",jn),this.reset()}function wr(e){if(this[Ee]._inflate=null,this[re]){this[te](this[re]);return}e[Mn]=1007,this[te](e)}});var oe=A((Ii,Pe)=>{"use strict";var{isUtf8:Ln}=E("buffer"),{hasBlob:kr}=F(),Cr=[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];function Or(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}function Ke(e){let n=e.length,t=0;for(;t<n;)if((e[t]&128)===0)t++;else if((e[t]&224)===192){if(t+1===n||(e[t+1]&192)!==128||(e[t]&254)===192)return!1;t+=2}else if((e[t]&240)===224){if(t+2>=n||(e[t+1]&192)!==128||(e[t+2]&192)!==128||e[t]===224&&(e[t+1]&224)===128||e[t]===237&&(e[t+1]&224)===160)return!1;t+=3}else if((e[t]&248)===240){if(t+3>=n||(e[t+1]&192)!==128||(e[t+2]&192)!==128||(e[t+3]&192)!==128||e[t]===240&&(e[t+1]&240)===128||e[t]===244&&e[t+1]>143||e[t]>244)return!1;t+=4}else return!1;return!0}function Er(e){return kr&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}Pe.exports={isBlob:Er,isValidStatusCode:Or,isValidUTF8:Ke,tokenChars:Cr};if(Ln)Pe.exports.isValidUTF8=function(e){return e.length<24?Ke(e):Ln(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=E("utf-8-validate");Pe.exports.isValidUTF8=function(n){return n.length<32?Ke(n):e(n)}}catch{}});var Qe=A((Ai,Vn)=>{"use strict";var{Writable:Pr}=E("stream"),Jn=me(),{BINARY_TYPES:Tr,EMPTY_BUFFER:$n,kStatusCode:Ir,kWebSocket:Ar}=F(),{concat:He,toArrayBuffer:Rr,unmask:Mr}=pe(),{isValidStatusCode:jr,isValidUTF8:Un}=oe(),Te=Buffer[Symbol.species],j=0,Dn=1,zn=2,Fn=3,Ze=4,Xe=5,Ie=6,Ye=class extends Pr{constructor(n={}){super(),this._allowSynchronousEvents=n.allowSynchronousEvents!==void 0?n.allowSynchronousEvents:!0,this._binaryType=n.binaryType||Tr[0],this._extensions=n.extensions||{},this._isServer=!!n.isServer,this._maxPayload=n.maxPayload|0,this._skipUTF8Validation=!!n.skipUTF8Validation,this[Ar]=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=j}_write(n,t,r){if(this._opcode===8&&this._state==j)return r();this._bufferedBytes+=n.length,this._buffers.push(n),this.startLoop(r)}consume(n){if(this._bufferedBytes-=n,n===this._buffers[0].length)return this._buffers.shift();if(n<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new Te(r.buffer,r.byteOffset+n,r.length-n),new Te(r.buffer,r.byteOffset,n)}let t=Buffer.allocUnsafe(n);do{let r=this._buffers[0],o=t.length-n;n>=r.length?t.set(this._buffers.shift(),o):(t.set(new Uint8Array(r.buffer,r.byteOffset,n),o),this._buffers[0]=new Te(r.buffer,r.byteOffset+n,r.length-n)),n-=r.length}while(n>0);return t}startLoop(n){this._loop=!0;do switch(this._state){case j:this.getInfo(n);break;case Dn:this.getPayloadLength16(n);break;case zn:this.getPayloadLength64(n);break;case Fn:this.getMask();break;case Ze:this.getData(n);break;case Xe:case Ie:this._loop=!1;return}while(this._loop);this._errored||n()}getInfo(n){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let o=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");n(o);return}let r=(t[0]&64)===64;if(r&&!this._extensions[Jn.extensionName]){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");n(o);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(r){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");n(o);return}if(!this._fragmented){let o=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");n(o);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");n(o);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let o=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");n(o);return}if(r){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");n(o);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let o=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");n(o);return}}else{let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");n(o);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let o=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");n(o);return}}else if(this._masked){let o=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");n(o);return}this._payloadLength===126?this._state=Dn:this._payloadLength===127?this._state=zn:this.haveLength(n)}getPayloadLength16(n){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(n)}getPayloadLength64(n){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),r=t.readUInt32BE(0);if(r>Math.pow(2,21)-1){let o=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");n(o);return}this._payloadLength=r*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(n)}haveLength(n){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");n(t);return}this._masked?this._state=Fn:this._state=Ze}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Ze}getData(n){let t=$n;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&Mr(t,this._mask)}if(this._opcode>7){this.controlMessage(t,n);return}if(this._compressed){this._state=Xe,this.decompress(t,n);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(n)}decompress(n,t){this._extensions[Jn.extensionName].decompress(n,this._fin,(o,s)=>{if(o)return t(o);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(i);return}this._fragments.push(s)}this.dataMessage(t),this._state===j&&this.startLoop(t)})}dataMessage(n){if(!this._fin){this._state=j;return}let t=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=He(r,t):this._binaryType==="arraybuffer"?o=Rr(He(r,t)):this._binaryType==="blob"?o=new Blob(r):o=r,this._allowSynchronousEvents?(this.emit("message",o,!0),this._state=j):(this._state=Ie,setImmediate(()=>{this.emit("message",o,!0),this._state=j,this.startLoop(n)}))}else{let o=He(r,t);if(!this._skipUTF8Validation&&!Un(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");n(s);return}this._state===Xe||this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=j):(this._state=Ie,setImmediate(()=>{this.emit("message",o,!1),this._state=j,this.startLoop(n)}))}}controlMessage(n,t){if(this._opcode===8){if(n.length===0)this._loop=!1,this.emit("conclude",1005,$n),this.end();else{let r=n.readUInt16BE(0);if(!jr(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let o=new Te(n.buffer,n.byteOffset+2,n.length-2);if(!this._skipUTF8Validation&&!Un(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",r,o),this.end()}this._state=j;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",n),this._state=j):(this._state=Ie,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",n),this._state=j,this.startLoop(t)}))}createError(n,t,r,o,s){this._loop=!1,this._errored=!0;let i=new n(r?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(i,this.createError),i.code=s,i[Ir]=o,i}};Vn.exports=Ye});var tn=A((Mi,Bn)=>{"use strict";var{Duplex:Ri}=E("stream"),{randomFillSync:Nr}=E("crypto"),Gn=me(),{EMPTY_BUFFER:Lr,kWebSocket:Jr,NOOP:$r}=F(),{isBlob:se,isValidStatusCode:Ur}=oe(),{mask:qn,toBuffer:H}=pe(),N=Symbol("kByteLength"),Dr=Buffer.alloc(4),Ae=8*1024,Z,ie=Ae,J=0,zr=1,Fr=2,en=class e{constructor(n,t,r){this._extensions=t||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=n,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=J,this.onerror=$r,this[Jr]=void 0}static frame(n,t){let r,o=!1,s=2,i=!1;t.mask&&(r=t.maskBuffer||Dr,t.generateMask?t.generateMask(r):(ie===Ae&&(Z===void 0&&(Z=Buffer.alloc(Ae)),Nr(Z,0,Ae),ie=0),r[0]=Z[ie++],r[1]=Z[ie++],r[2]=Z[ie++],r[3]=Z[ie++]),i=(r[0]|r[1]|r[2]|r[3])===0,s=6);let a;typeof n=="string"?(!t.mask||i)&&t[N]!==void 0?a=t[N]:(n=Buffer.from(n),a=n.length):(a=n.length,o=t.mask&&t.readOnly&&!i);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let d=Buffer.allocUnsafe(o?a+s:s);return d[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(d[0]|=64),d[1]=c,c===126?d.writeUInt16BE(a,2):c===127&&(d[2]=d[3]=0,d.writeUIntBE(a,4,6)),t.mask?(d[1]|=128,d[s-4]=r[0],d[s-3]=r[1],d[s-2]=r[2],d[s-1]=r[3],i?[d,n]:o?(qn(n,r,d,s,a),[d]):(qn(n,r,n,0,a),[d,n])):[d,n]}close(n,t,r,o){let s;if(n===void 0)s=Lr;else{if(typeof n!="number"||!Ur(n))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(n,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(n,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let i={[N]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==J?this.enqueue([this.dispatch,s,!1,i,o]):this.sendFrame(e.frame(s,i),o)}ping(n,t,r){let o,s;if(typeof n=="string"?(o=Buffer.byteLength(n),s=!1):se(n)?(o=n.size,s=!1):(n=H(n),o=n.length,s=H.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let i={[N]:o,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};se(n)?this._state!==J?this.enqueue([this.getBlobData,n,!1,i,r]):this.getBlobData(n,!1,i,r):this._state!==J?this.enqueue([this.dispatch,n,!1,i,r]):this.sendFrame(e.frame(n,i),r)}pong(n,t,r){let o,s;if(typeof n=="string"?(o=Buffer.byteLength(n),s=!1):se(n)?(o=n.size,s=!1):(n=H(n),o=n.length,s=H.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let i={[N]:o,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};se(n)?this._state!==J?this.enqueue([this.getBlobData,n,!1,i,r]):this.getBlobData(n,!1,i,r):this._state!==J?this.enqueue([this.dispatch,n,!1,i,r]):this.sendFrame(e.frame(n,i),r)}send(n,t,r){let o=this._extensions[Gn.extensionName],s=t.binary?2:1,i=t.compress,a,c;typeof n=="string"?(a=Buffer.byteLength(n),c=!1):se(n)?(a=n.size,c=!1):(n=H(n),a=n.length,c=H.readOnly),this._firstFragment?(this._firstFragment=!1,i&&o&&o.params[o._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(i=a>=o._threshold),this._compress=i):(i=!1,s=0),t.fin&&(this._firstFragment=!0);let d={[N]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:i};se(n)?this._state!==J?this.enqueue([this.getBlobData,n,this._compress,d,r]):this.getBlobData(n,this._compress,d,r):this._state!==J?this.enqueue([this.dispatch,n,this._compress,d,r]):this.dispatch(n,this._compress,d,r)}getBlobData(n,t,r,o){this._bufferedBytes+=r[N],this._state=Fr,n.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(nn,this,a,o);return}this._bufferedBytes-=r[N];let i=H(s);t?this.dispatch(i,t,r,o):(this._state=J,this.sendFrame(e.frame(i,r),o),this.dequeue())}).catch(s=>{process.nextTick(Vr,this,s,o)})}dispatch(n,t,r,o){if(!t){this.sendFrame(e.frame(n,r),o);return}let s=this._extensions[Gn.extensionName];this._bufferedBytes+=r[N],this._state=zr,s.compress(n,r.fin,(i,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");nn(this,c,o);return}this._bufferedBytes-=r[N],this._state=J,r.readOnly=!1,this.sendFrame(e.frame(a,r),o),this.dequeue()})}dequeue(){for(;this._state===J&&this._queue.length;){let n=this._queue.shift();this._bufferedBytes-=n[3][N],Reflect.apply(n[0],this,n.slice(1))}}enqueue(n){this._bufferedBytes+=n[3][N],this._queue.push(n)}sendFrame(n,t){n.length===2?(this._socket.cork(),this._socket.write(n[0]),this._socket.write(n[1],t),this._socket.uncork()):this._socket.write(n[0],t)}};Bn.exports=en;function nn(e,n,t){typeof t=="function"&&t(n);for(let r=0;r<e._queue.length;r++){let o=e._queue[r],s=o[o.length-1];typeof s=="function"&&s(n)}}function Vr(e,n,t){nn(e,n,t),e.onerror(n)}});var nt=A((ji,et)=>{"use strict";var{kForOnEventAttribute:he,kListener:rn}=F(),Wn=Symbol("kCode"),Kn=Symbol("kData"),Hn=Symbol("kError"),Zn=Symbol("kMessage"),Xn=Symbol("kReason"),ae=Symbol("kTarget"),Yn=Symbol("kType"),Qn=Symbol("kWasClean"),G=class{constructor(n){this[ae]=null,this[Yn]=n}get target(){return this[ae]}get type(){return this[Yn]}};Object.defineProperty(G.prototype,"target",{enumerable:!0});Object.defineProperty(G.prototype,"type",{enumerable:!0});var X=class extends G{constructor(n,t={}){super(n),this[Wn]=t.code===void 0?0:t.code,this[Xn]=t.reason===void 0?"":t.reason,this[Qn]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[Wn]}get reason(){return this[Xn]}get wasClean(){return this[Qn]}};Object.defineProperty(X.prototype,"code",{enumerable:!0});Object.defineProperty(X.prototype,"reason",{enumerable:!0});Object.defineProperty(X.prototype,"wasClean",{enumerable:!0});var de=class extends G{constructor(n,t={}){super(n),this[Hn]=t.error===void 0?null:t.error,this[Zn]=t.message===void 0?"":t.message}get error(){return this[Hn]}get message(){return this[Zn]}};Object.defineProperty(de.prototype,"error",{enumerable:!0});Object.defineProperty(de.prototype,"message",{enumerable:!0});var ye=class extends G{constructor(n,t={}){super(n),this[Kn]=t.data===void 0?null:t.data}get data(){return this[Kn]}};Object.defineProperty(ye.prototype,"data",{enumerable:!0});var Gr={addEventListener(e,n,t={}){for(let o of this.listeners(e))if(!t[he]&&o[rn]===n&&!o[he])return;let r;if(e==="message")r=function(s,i){let a=new ye("message",{data:i?s:s.toString()});a[ae]=this,Re(n,this,a)};else if(e==="close")r=function(s,i){let a=new X("close",{code:s,reason:i.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[ae]=this,Re(n,this,a)};else if(e==="error")r=function(s){let i=new de("error",{error:s,message:s.message});i[ae]=this,Re(n,this,i)};else if(e==="open")r=function(){let s=new G("open");s[ae]=this,Re(n,this,s)};else return;r[he]=!!t[he],r[rn]=n,t.once?this.once(e,r):this.on(e,r)},removeEventListener(e,n){for(let t of this.listeners(e))if(t[rn]===n&&!t[he]){this.removeListener(e,t);break}}};et.exports={CloseEvent:X,ErrorEvent:de,Event:G,EventTarget:Gr,MessageEvent:ye};function Re(e,n,t){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,t):e.call(n,t)}});var on=A((Ni,tt)=>{"use strict";var{tokenChars:_e}=oe();function U(e,n,t){e[n]===void 0?e[n]=[t]:e[n].push(t)}function qr(e){let n=Object.create(null),t=Object.create(null),r=!1,o=!1,s=!1,i,a,c=-1,d=-1,f=-1,p=0;for(;p<e.length;p++)if(d=e.charCodeAt(p),i===void 0)if(f===-1&&_e[d]===1)c===-1&&(c=p);else if(p!==0&&(d===32||d===9))f===-1&&c!==-1&&(f=p);else if(d===59||d===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let u=e.slice(c,f);d===44?(U(n,u,t),t=Object.create(null)):i=u,c=f=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(a===void 0)if(f===-1&&_e[d]===1)c===-1&&(c=p);else if(d===32||d===9)f===-1&&c!==-1&&(f=p);else if(d===59||d===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p),U(t,e.slice(c,f),!0),d===44&&(U(n,i,t),t=Object.create(null),i=void 0),c=f=-1}else if(d===61&&c!==-1&&f===-1)a=e.slice(c,p),c=f=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(o){if(_e[d]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);c===-1?c=p:r||(r=!0),o=!1}else if(s)if(_e[d]===1)c===-1&&(c=p);else if(d===34&&c!==-1)s=!1,f=p;else if(d===92)o=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(d===34&&e.charCodeAt(p-1)===61)s=!0;else if(f===-1&&_e[d]===1)c===-1&&(c=p);else if(c!==-1&&(d===32||d===9))f===-1&&(f=p);else if(d===59||d===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${p}`);f===-1&&(f=p);let u=e.slice(c,f);r&&(u=u.replace(/\\/g,""),r=!1),U(t,a,u),d===44&&(U(n,i,t),t=Object.create(null),i=void 0),a=void 0,c=f=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(c===-1||s||d===32||d===9)throw new SyntaxError("Unexpected end of input");f===-1&&(f=p);let y=e.slice(c,f);return i===void 0?U(n,y,t):(a===void 0?U(t,y,!0):r?U(t,a,y.replace(/\\/g,"")):U(t,a,y),U(n,i,t)),n}function Br(e){return Object.keys(e).map(n=>{let t=e[n];return Array.isArray(t)||(t=[t]),t.map(r=>[n].concat(Object.keys(r).map(o=>{let s=r[o];return Array.isArray(s)||(s=[s]),s.map(i=>i===!0?o:`${o}=${i}`).join("; ")})).join("; ")).join(", ")}).join(", ")}tt.exports={format:Br,parse:qr}});var Le=A(($i,gt)=>{"use strict";var Wr=E("events"),Kr=E("https"),Hr=E("http"),st=E("net"),Zr=E("tls"),{randomBytes:Xr,createHash:Yr}=E("crypto"),{Duplex:Li,Readable:Ji}=E("stream"),{URL:sn}=E("url"),W=me(),Qr=Qe(),eo=tn(),{isBlob:no}=oe(),{BINARY_TYPES:rt,EMPTY_BUFFER:Me,GUID:to,kForOnEventAttribute:an,kListener:ro,kStatusCode:oo,kWebSocket:P,NOOP:it}=F(),{EventTarget:{addEventListener:so,removeEventListener:io}}=nt(),{format:ao,parse:co}=on(),{toBuffer:lo}=pe(),uo=30*1e3,at=Symbol("kAborted"),dn=[8,13],q=["CONNECTING","OPEN","CLOSING","CLOSED"],fo=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,C=class e extends Wr{constructor(n,t,r){super(),this._binaryType=rt[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Me,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,n!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(r=t,t=[]):t=[t]),dt(this,n,t,r)):(this._autoPong=r.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(n){rt.includes(n)&&(this._binaryType=n,this._receiver&&(this._receiver._binaryType=n))}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(n,t,r){let o=new Qr({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),s=new eo(n,this._extensions,r.generateMask);this._receiver=o,this._sender=s,this._socket=n,o[P]=this,s[P]=this,n[P]=this,o.on("conclude",mo),o.on("drain",ho),o.on("error",yo),o.on("message",_o),o.on("ping",xo),o.on("pong",bo),s.onerror=vo,n.setTimeout&&n.setTimeout(0),n.setNoDelay&&n.setNoDelay(),t.length>0&&n.unshift(t),n.on("close",ut),n.on("data",Ne),n.on("end",ft),n.on("error",pt),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[W.extensionName]&&this._extensions[W.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(n,t){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){R(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(n,t,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),lt(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(n,t,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof n=="function"?(r=n,n=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof n=="number"&&(n=n.toString()),this.readyState!==e.OPEN){cn(this,n,r);return}t===void 0&&(t=!this._isServer),this._sender.ping(n||Me,t,r)}pong(n,t,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof n=="function"?(r=n,n=t=void 0):typeof t=="function"&&(r=t,t=void 0),typeof n=="number"&&(n=n.toString()),this.readyState!==e.OPEN){cn(this,n,r);return}t===void 0&&(t=!this._isServer),this._sender.pong(n||Me,t,r)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(n,t,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(r=t,t={}),typeof n=="number"&&(n=n.toString()),this.readyState!==e.OPEN){cn(this,n,r);return}let o={binary:typeof n!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[W.extensionName]||(o.compress=!1),this._sender.send(n||Me,o,r)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){R(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(C,"CONNECTING",{enumerable:!0,value:q.indexOf("CONNECTING")});Object.defineProperty(C.prototype,"CONNECTING",{enumerable:!0,value:q.indexOf("CONNECTING")});Object.defineProperty(C,"OPEN",{enumerable:!0,value:q.indexOf("OPEN")});Object.defineProperty(C.prototype,"OPEN",{enumerable:!0,value:q.indexOf("OPEN")});Object.defineProperty(C,"CLOSING",{enumerable:!0,value:q.indexOf("CLOSING")});Object.defineProperty(C.prototype,"CLOSING",{enumerable:!0,value:q.indexOf("CLOSING")});Object.defineProperty(C,"CLOSED",{enumerable:!0,value:q.indexOf("CLOSED")});Object.defineProperty(C.prototype,"CLOSED",{enumerable:!0,value:q.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(C.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(C.prototype,`on${e}`,{enumerable:!0,get(){for(let n of this.listeners(e))if(n[an])return n[ro];return null},set(n){for(let t of this.listeners(e))if(t[an]){this.removeListener(e,t);break}typeof n=="function"&&this.addEventListener(e,n,{[an]:!0})}})});C.prototype.addEventListener=so;C.prototype.removeEventListener=io;gt.exports=C;function dt(e,n,t,r){let o={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:dn[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=o.autoPong,!dn.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${dn.join(", ")})`);let s;if(n instanceof sn)s=n;else try{s=new sn(n)}catch{throw new SyntaxError(`Invalid URL: ${n}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),e._url=s.href;let i=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!i&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let l=new SyntaxError(c);if(e._redirects===0)throw l;je(e,l);return}let d=i?443:80,f=Xr(16).toString("base64"),p=i?Kr.request:Hr.request,y=new Set,u;if(o.createConnection=o.createConnection||(i?go:po),o.defaultPort=o.defaultPort||d,o.port=s.port||d,o.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":f,Connection:"Upgrade",Upgrade:"websocket"},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(u=new W(o.perMessageDeflate!==!0?o.perMessageDeflate:{},!1,o.maxPayload),o.headers["Sec-WebSocket-Extensions"]=ao({[W.extensionName]:u.offer()})),t.length){for(let l of t){if(typeof l!="string"||!fo.test(l)||y.has(l))throw new SyntaxError("An invalid or duplicated subprotocol was specified");y.add(l)}o.headers["Sec-WebSocket-Protocol"]=t.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(s.username||s.password)&&(o.auth=`${s.username}:${s.password}`),a){let l=o.path.split(":");o.socketPath=l[0],o.path=l[1]}let g;if(o.followRedirects){if(e._redirects===0){e._originalIpc=a,e._originalSecure=i,e._originalHostOrSocketPath=a?o.socketPath:s.host;let l=r&&r.headers;if(r={...r,headers:{}},l)for(let[x,O]of Object.entries(l))r.headers[x.toLowerCase()]=O}else if(e.listenerCount("redirect")===0){let l=a?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:s.host===e._originalHostOrSocketPath;(!l||e._originalSecure&&!i)&&(delete o.headers.authorization,delete o.headers.cookie,l||delete o.headers.host,o.auth=void 0)}o.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),g=e._req=p(o),e._redirects&&e.emit("redirect",e.url,g)}else g=e._req=p(o);o.timeout&&g.on("timeout",()=>{R(e,g,"Opening handshake has timed out")}),g.on("error",l=>{g===null||g[at]||(g=e._req=null,je(e,l))}),g.on("response",l=>{let x=l.headers.location,O=l.statusCode;if(x&&o.followRedirects&&O>=300&&O<400){if(++e._redirects>o.maxRedirects){R(e,g,"Maximum redirects exceeded");return}g.abort();let M;try{M=new sn(x,n)}catch{let v=new SyntaxError(`Invalid URL: ${x}`);je(e,v);return}dt(e,M,t,r)}else e.emit("unexpected-response",g,l)||R(e,g,`Unexpected server response: ${l.statusCode}`)}),g.on("upgrade",(l,x,O)=>{if(e.emit("upgrade",l),e.readyState!==C.CONNECTING)return;g=e._req=null;let M=l.headers.upgrade;if(M===void 0||M.toLowerCase()!=="websocket"){R(e,x,"Invalid Upgrade header");return}let L=Yr("sha1").update(f+to).digest("base64");if(l.headers["sec-websocket-accept"]!==L){R(e,x,"Invalid Sec-WebSocket-Accept header");return}let v=l.headers["sec-websocket-protocol"],h;if(v!==void 0?y.size?y.has(v)||(h="Server sent an invalid subprotocol"):h="Server sent a subprotocol but none was requested":y.size&&(h="Server sent no subprotocol"),h){R(e,x,h);return}v&&(e._protocol=v);let S=l.headers["sec-websocket-extensions"];if(S!==void 0){if(!u){R(e,x,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let k;try{k=co(S)}catch{R(e,x,"Invalid Sec-WebSocket-Extensions header");return}let b=Object.keys(k);if(b.length!==1||b[0]!==W.extensionName){R(e,x,"Server indicated an extension that was not requested");return}try{u.accept(k[W.extensionName])}catch{R(e,x,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[W.extensionName]=u}e.setSocket(x,O,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(g,e):g.end()}function je(e,n){e._readyState=C.CLOSING,e._errorEmitted=!0,e.emit("error",n),e.emitClose()}function po(e){return e.path=e.socketPath,st.connect(e)}function go(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=st.isIP(e.host)?"":e.host),Zr.connect(e)}function R(e,n,t){e._readyState=C.CLOSING;let r=new Error(t);Error.captureStackTrace(r,R),n.setHeader?(n[at]=!0,n.abort(),n.socket&&!n.socket.destroyed&&n.socket.destroy(),process.nextTick(je,e,r)):(n.destroy(r),n.once("error",e.emit.bind(e,"error")),n.once("close",e.emitClose.bind(e)))}function cn(e,n,t){if(n){let r=no(n)?n.size:lo(n).length;e._socket?e._sender._bufferedBytes+=r:e._bufferedAmount+=r}if(t){let r=new Error(`WebSocket is not open: readyState ${e.readyState} (${q[e.readyState]})`);process.nextTick(t,r)}}function mo(e,n){let t=this[P];t._closeFrameReceived=!0,t._closeMessage=n,t._closeCode=e,t._socket[P]!==void 0&&(t._socket.removeListener("data",Ne),process.nextTick(ct,t._socket),e===1005?t.close():t.close(e,n))}function ho(){let e=this[P];e.isPaused||e._socket.resume()}function yo(e){let n=this[P];n._socket[P]!==void 0&&(n._socket.removeListener("data",Ne),process.nextTick(ct,n._socket),n.close(e[oo])),n._errorEmitted||(n._errorEmitted=!0,n.emit("error",e))}function ot(){this[P].emitClose()}function _o(e,n){this[P].emit("message",e,n)}function xo(e){let n=this[P];n._autoPong&&n.pong(e,!this._isServer,it),n.emit("ping",e)}function bo(e){this[P].emit("pong",e)}function ct(e){e.resume()}function vo(e){let n=this[P];n.readyState!==C.CLOSED&&(n.readyState===C.OPEN&&(n._readyState=C.CLOSING,lt(n)),this._socket.end(),n._errorEmitted||(n._errorEmitted=!0,n.emit("error",e)))}function lt(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),uo)}function ut(){let e=this[P];this.removeListener("close",ut),this.removeListener("data",Ne),this.removeListener("end",ft),e._readyState=C.CLOSING;let n;!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&(n=e._socket.read())!==null&&e._receiver.write(n),e._receiver.end(),this[P]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",ot),e._receiver.on("finish",ot))}function Ne(e){this[P]._receiver.write(e)||this.pause()}function ft(){let e=this[P];e._readyState=C.CLOSING,e._receiver.end(),this.end()}function pt(){let e=this[P];this.removeListener("error",pt),this.on("error",it),e&&(e._readyState=C.CLOSING,this.destroy())}});var _t=A((Di,yt)=>{"use strict";var Ui=Le(),{Duplex:So}=E("stream");function mt(e){e.emit("close")}function wo(){!this.destroyed&&this._writableState.finished&&this.destroy()}function ht(e){this.removeListener("error",ht),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}function ko(e,n){let t=!0,r=new So({...n,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",function(s,i){let a=!i&&r._readableState.objectMode?s.toString():s;r.push(a)||e.pause()}),e.once("error",function(s){r.destroyed||(t=!1,r.destroy(s))}),e.once("close",function(){r.destroyed||r.push(null)}),r._destroy=function(o,s){if(e.readyState===e.CLOSED){s(o),process.nextTick(mt,r);return}let i=!1;e.once("error",function(c){i=!0,s(c)}),e.once("close",function(){i||s(o),process.nextTick(mt,r)}),t&&e.terminate()},r._final=function(o){if(e.readyState===e.CONNECTING){e.once("open",function(){r._final(o)});return}e._socket!==null&&(e._socket._writableState.finished?(o(),r._readableState.endEmitted&&r.destroy()):(e._socket.once("finish",function(){o()}),e.close()))},r._read=function(){e.isPaused&&e.resume()},r._write=function(o,s,i){if(e.readyState===e.CONNECTING){e.once("open",function(){r._write(o,s,i)});return}e.send(o,i)},r.on("end",wo),r.on("error",ht),r}yt.exports=ko});var bt=A((zi,xt)=>{"use strict";var{tokenChars:Co}=oe();function Oo(e){let n=new Set,t=-1,r=-1,o=0;for(o;o<e.length;o++){let i=e.charCodeAt(o);if(r===-1&&Co[i]===1)t===-1&&(t=o);else if(o!==0&&(i===32||i===9))r===-1&&t!==-1&&(r=o);else if(i===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${o}`);r===-1&&(r=o);let a=e.slice(t,r);if(n.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);n.add(a),t=r=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}if(t===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let s=e.slice(t,o);if(n.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return n.add(s),n}xt.exports={parse:Oo}});var Et=A((Vi,Ot)=>{"use strict";var Eo=E("events"),Je=E("http"),{Duplex:Fi}=E("stream"),{createHash:Po}=E("crypto"),vt=on(),Y=me(),To=bt(),Io=Le(),{GUID:Ao,kWebSocket:Ro}=F(),Mo=/^[+/0-9A-Za-z]{22}==$/,St=0,wt=1,Ct=2,ln=class extends Eo{constructor(n,t){if(super(),n={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:Io,...n},n.port==null&&!n.server&&!n.noServer||n.port!=null&&(n.server||n.noServer)||n.server&&n.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(n.port!=null?(this._server=Je.createServer((r,o)=>{let s=Je.STATUS_CODES[426];o.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),o.end(s)}),this._server.listen(n.port,n.host,n.backlog,t)):n.server&&(this._server=n.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=jo(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(o,s,i)=>{this.handleUpgrade(o,s,i,r)}})}n.perMessageDeflate===!0&&(n.perMessageDeflate={}),n.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=n,this._state=St}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(n){if(this._state===Ct){n&&this.once("close",()=>{n(new Error("The server is not running"))}),process.nextTick(xe,this);return}if(n&&this.once("close",n),this._state!==wt)if(this._state=wt,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(xe,this):process.nextTick(xe,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{xe(this)})}}shouldHandle(n){if(this.options.path){let t=n.url.indexOf("?");if((t!==-1?n.url.slice(0,t):n.url)!==this.options.path)return!1}return!0}handleUpgrade(n,t,r,o){t.on("error",kt);let s=n.headers["sec-websocket-key"],i=n.headers.upgrade,a=+n.headers["sec-websocket-version"];if(n.method!=="GET"){Q(this,n,t,405,"Invalid HTTP method");return}if(i===void 0||i.toLowerCase()!=="websocket"){Q(this,n,t,400,"Invalid Upgrade header");return}if(s===void 0||!Mo.test(s)){Q(this,n,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Q(this,n,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(n)){be(t,400);return}let c=n.headers["sec-websocket-protocol"],d=new Set;if(c!==void 0)try{d=To.parse(c)}catch{Q(this,n,t,400,"Invalid Sec-WebSocket-Protocol header");return}let f=n.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&f!==void 0){let y=new Y(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let u=vt.parse(f);u[Y.extensionName]&&(y.accept(u[Y.extensionName]),p[Y.extensionName]=y)}catch{Q(this,n,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let y={origin:n.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(n.socket.authorized||n.socket.encrypted),req:n};if(this.options.verifyClient.length===2){this.options.verifyClient(y,(u,g,l,x)=>{if(!u)return be(t,g||401,l,x);this.completeUpgrade(p,s,d,n,t,r,o)});return}if(!this.options.verifyClient(y))return be(t,401)}this.completeUpgrade(p,s,d,n,t,r,o)}completeUpgrade(n,t,r,o,s,i,a){if(!s.readable||!s.writable)return s.destroy();if(s[Ro])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>St)return be(s,503);let d=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Po("sha1").update(t+Ao).digest("base64")}`],f=new this.options.WebSocket(null,void 0,this.options);if(r.size){let p=this.options.handleProtocols?this.options.handleProtocols(r,o):r.values().next().value;p&&(d.push(`Sec-WebSocket-Protocol: ${p}`),f._protocol=p)}if(n[Y.extensionName]){let p=n[Y.extensionName].params,y=vt.format({[Y.extensionName]:[p]});d.push(`Sec-WebSocket-Extensions: ${y}`),f._extensions=n}this.emit("headers",d,o),s.write(d.concat(`\r
4
4
  `).join(`\r
5
5
  `)),s.removeListener("error",kt),f.setSocket(s,i,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(f),f.on("close",()=>{this.clients.delete(f),this._shouldEmitClose&&!this.clients.size&&process.nextTick(xe,this)})),a(f,o)}};Ot.exports=ln;function jo(e,n){for(let t of Object.keys(n))e.on(t,n[t]);return function(){for(let r of Object.keys(n))e.removeListener(r,n[r])}}function xe(e){e._state=Ct,e.emit("close")}function kt(){this.destroy()}function be(e,n,t,r){t=t||Je.STATUS_CODES[n],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...r},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${n} ${Je.STATUS_CODES[n]}\r
@@ -1,5 +1,5 @@
1
- import { createRequire } from 'node:module';
2
- const require = createRequire(import.meta.url);
1
+ import { createRequire as __linzumiBundleCreateRequire } from 'node:module';
2
+ const require = __linzumiBundleCreateRequire(import.meta.url);
3
3
  import{randomUUID as ce}from"node:crypto";import{mkdir as me,realpath as pe,writeFile as _e}from"node:fs/promises";import{homedir as J}from"node:os";import{join as L}from"node:path";function $(e){return e===void 0?{BS_PRIVATE_NESTED_SOME_NONE:0}:e!==null&&e.BS_PRIVATE_NESTED_SOME_NONE!==void 0?{BS_PRIVATE_NESTED_SOME_NONE:e.BS_PRIVATE_NESTED_SOME_NONE+1|0}:e}function _(e){if(e===null||e.BS_PRIVATE_NESTED_SOME_NONE===void 0)return e;let t=e.BS_PRIVATE_NESTED_SOME_NONE;if(t!==0)return{BS_PRIVATE_NESTED_SOME_NONE:t-1|0}}function h(e,t){let r=e.length,i=new Array(r),n=0;for(let s=0;s<r;++s){let o=e[s],m=t(o);m!==void 0&&(i[n]=_(m),n=n+1|0)}return i.length=n,i}function g(e,t,r){return e!==void 0?r(_(e)):t}function k(e,t){if(e!==void 0)return $(t(_(e)))}function v(e,t){if(e!==void 0)return t(_(e))}function E(e,t){return e!==void 0?_(e):t}var R=["codex","claude-code","pi","opencode"];function M(e){return e}function D(e,t){let r=e[t];if(typeof r=="object"&&r!==null&&!Array.isArray(r))return r}function d(e,t){let r=e[t];if(typeof r=="string")return r}function T(e,t){let r=e[t];if(Array.isArray(r))return r}function I(e){return h(e,t=>{if(typeof t!="object"||t===null||Array.isArray(t))return;if(d(t,"type")==="text")return d(t,"text")}).join(`
4
4
  `)}function j(e,t,r,i){return e+":"+t+":"+r+":"+i}function N(e,t){let r=t.split(":"),i=r[0],n=r[1],s=r[2];if(i===void 0||n===void 0||s===void 0||!(i===e&&n!==""&&s!==""&&r.length>=4))return;let o=r.slice(3,r.length).join(":");if(o!=="")return{keySessionId:n,keyTurnId:s,keyItemId:o}}function W(e,t){return{threadId:e,threadTitle:void 0,nodes:t,hasMore:!1,cursor:void 0,budget:void 0,session:void 0}}var V="codex";function ne(e,t,r){return j(V,e,t,r)}function ie(e){if(e===void 0)return"system_notice";switch(e){case"agentMessage":return"assistant_message";case"commandExecution":return"command_execution";case"fileChange":return"file_change";case"collabAgentToolCall":case"dynamicToolCall":case"mcpToolCall":return"tool_call";case"reasoning":return"reasoning";case"plan":case"subAgentActivity":return"agent_status";case"terminalInput":return"terminal_input";case"userMessage":return"user_message";default:return"system_notice"}}function B(e){return h(e,t=>{if(typeof t=="string")return t})}function se(e){let t=d(e,"type");if(t===void 0)return"";switch(t){case"collabAgentToolCall":return E(d(e,"prompt"),"");case"commandExecution":return E(d(e,"aggregatedOutput"),"");case"dynamicToolCall":return g(T(e,"contentItems"),"",I);case"fileChange":return g(T(e,"changes"),[],n=>h(n,s=>{if(typeof s=="object"&&s!==null&&!Array.isArray(s))return d(s,"path")})).join(`
5
5
  `);case"mcpToolCall":return g(v(D(e,"result"),n=>T(n,"content")),"",I);case"reasoning":let r=g(T(e,"summary"),[],B),i=g(T(e,"content"),[],B);return r.concat(i).filter(n=>n!=="").join(`